TemplatesNext ToolKit - Version 3.1.4

Version Description

  • Fix: Video slider bug fix
  • Fix: Meta box update
  • Added: Breadcrumb
Download this release

Release Info

Developer marsian
Plugin Icon 128x128 TemplatesNext ToolKit
Version 3.1.4
Comparing to
See all releases

Code changes from version 3.1.3 to 3.1.4

Files changed (324) hide show
  1. inc/meta-box/css/background.css +17 -0
  2. inc/meta-box/css/button-group.css +68 -0
  3. inc/meta-box/css/color.css +7 -6
  4. inc/meta-box/css/datepicker.css +231 -0
  5. inc/meta-box/css/fieldset-text.css +4 -0
  6. inc/meta-box/css/file-input.css +6 -0
  7. inc/meta-box/css/file.css +40 -47
  8. inc/meta-box/css/image-select.css +2 -2
  9. inc/meta-box/css/image.css +51 -52
  10. inc/meta-box/css/input-list.css +20 -0
  11. inc/meta-box/css/jqueryui/jquery-ui-timepicker-addon.css +0 -6
  12. inc/meta-box/css/jqueryui/jquery-ui-timepicker-addon.min.css +5 -0
  13. inc/meta-box/css/map.css +49 -0
  14. inc/meta-box/css/media.css +50 -0
  15. inc/meta-box/css/oembed.css +2 -2
  16. inc/meta-box/css/plupload-image.css +0 -25
  17. inc/meta-box/css/range.css +9 -4
  18. inc/meta-box/css/select-advanced.css +17 -2
  19. inc/meta-box/css/select-tree.css +7 -0
  20. inc/meta-box/css/select.css +11 -4
  21. inc/meta-box/css/select2/select2-spinner.gif +0 -0
  22. inc/meta-box/css/select2/select2.css +457 -498
  23. inc/meta-box/css/select2/select2.png +0 -0
  24. inc/meta-box/css/select2/select2x2.png +0 -0
  25. inc/meta-box/css/select2/spinner.gif +0 -0
  26. inc/meta-box/css/style-rtl.css +11 -0
  27. inc/meta-box/css/style.css +91 -25
  28. inc/meta-box/css/switch.css +94 -0
  29. inc/meta-box/css/taxonomy.css +0 -10
  30. inc/meta-box/css/text-list.css +19 -0
  31. inc/meta-box/css/upload.css +32 -0
  32. inc/meta-box/css/video.css +25 -0
  33. inc/meta-box/css/wysiwyg.css +4 -1
  34. inc/meta-box/img/drag_icon.gif +0 -0
  35. inc/meta-box/img/loader.gif +0 -0
  36. inc/meta-box/inc/about/about.php +230 -0
  37. inc/meta-box/inc/about/css/about.css +219 -0
  38. inc/meta-box/inc/about/images/meta-box.svg +5 -0
  39. inc/meta-box/inc/about/images/online-generator.png +0 -0
  40. inc/meta-box/inc/about/js/about.js +22 -0
  41. inc/meta-box/inc/about/sections/extensions.php +351 -0
  42. inc/meta-box/inc/about/sections/getting-started.php +36 -0
  43. inc/meta-box/inc/about/sections/newsletter.php +16 -0
  44. inc/meta-box/inc/about/sections/support.php +25 -0
  45. inc/meta-box/inc/about/sections/tabs.php +14 -0
  46. inc/meta-box/inc/about/sections/upgrade.php +26 -0
  47. inc/meta-box/inc/about/sections/welcome.php +24 -0
  48. inc/meta-box/inc/autoloader.php +180 -0
  49. inc/meta-box/inc/clone.php +123 -0
  50. inc/meta-box/inc/common.php +0 -61
  51. inc/meta-box/inc/core.php +117 -0
  52. inc/meta-box/inc/field-registry.php +64 -0
  53. inc/meta-box/inc/field.php +631 -281
  54. inc/meta-box/inc/fields/autocomplete.php +118 -150
  55. inc/meta-box/inc/fields/background.php +152 -0
  56. inc/meta-box/inc/fields/button-group.php +80 -0
  57. inc/meta-box/inc/fields/button.php +48 -34
  58. inc/meta-box/inc/fields/checkbox-list.php +21 -102
  59. inc/meta-box/inc/fields/checkbox.php +49 -39
  60. inc/meta-box/inc/fields/choice.php +134 -0
  61. inc/meta-box/inc/fields/color.php +87 -71
  62. inc/meta-box/inc/fields/custom-html.php +27 -0
  63. inc/meta-box/inc/fields/date.php +32 -86
  64. inc/meta-box/inc/fields/datetime.php +263 -156
  65. inc/meta-box/inc/fields/divider.php +43 -45
  66. inc/meta-box/inc/fields/email.php +0 -47
  67. inc/meta-box/inc/fields/fieldset-text.php +110 -63
  68. inc/meta-box/inc/fields/file-advanced.php +0 -124
  69. inc/meta-box/inc/fields/file-input.php +58 -63
  70. inc/meta-box/inc/fields/file-upload.php +48 -0
  71. inc/meta-box/inc/fields/file.php +353 -308
  72. inc/meta-box/inc/fields/heading.php +43 -48
  73. inc/meta-box/inc/fields/hidden.php +0 -27
  74. inc/meta-box/inc/fields/image-advanced.php +87 -130
  75. inc/meta-box/inc/fields/image-select.php +72 -63
  76. inc/meta-box/inc/fields/image-upload.php +40 -0
  77. inc/meta-box/inc/fields/image.php +136 -162
  78. inc/meta-box/inc/fields/input-list.php +94 -0
  79. inc/meta-box/inc/fields/input.php +88 -0
  80. inc/meta-box/inc/fields/key-value.php +151 -0
  81. inc/meta-box/inc/fields/map.php +202 -57
  82. inc/meta-box/inc/fields/media.php +177 -0
  83. inc/meta-box/inc/fields/multiple-values.php +49 -0
  84. inc/meta-box/inc/fields/number.php +42 -41
  85. inc/meta-box/inc/fields/object-choice.php +108 -0
  86. inc/meta-box/inc/fields/oembed.php +109 -82
  87. inc/meta-box/inc/fields/password.php +25 -31
  88. inc/meta-box/inc/fields/plupload-image.php +0 -197
  89. inc/meta-box/inc/fields/post.php +125 -156
  90. inc/meta-box/inc/fields/radio.php +19 -31
  91. inc/meta-box/inc/fields/range.php +70 -86
  92. inc/meta-box/inc/fields/select-advanced.php +74 -76
  93. inc/meta-box/inc/fields/select-tree.php +65 -0
  94. inc/meta-box/inc/fields/select.php +92 -147
  95. inc/meta-box/inc/fields/sidebar.php +80 -0
  96. inc/meta-box/inc/fields/single-image.php +64 -0
  97. inc/meta-box/inc/fields/slider.php +68 -68
  98. inc/meta-box/inc/fields/switch.php +94 -0
  99. inc/meta-box/inc/fields/taxonomy-advanced.php +133 -62
  100. inc/meta-box/inc/fields/taxonomy.php +174 -263
  101. inc/meta-box/inc/fields/text-list.php +108 -93
  102. inc/meta-box/inc/fields/text.php +45 -73
  103. inc/meta-box/inc/fields/textarea.php +76 -41
  104. inc/meta-box/inc/fields/thickbox-image.php +0 -61
  105. inc/meta-box/inc/fields/time.php +32 -91
  106. inc/meta-box/inc/fields/url.php +0 -47
  107. inc/meta-box/inc/fields/user.php +80 -143
  108. inc/meta-box/inc/fields/video.php +139 -0
  109. inc/meta-box/inc/fields/wysiwyg.php +93 -108
  110. inc/meta-box/inc/functions.php +282 -0
  111. inc/meta-box/inc/helpers.php +0 -408
  112. inc/meta-box/inc/init.php +0 -43
  113. inc/meta-box/inc/interfaces/storage.php +22 -0
  114. inc/meta-box/inc/loader.php +108 -0
  115. inc/meta-box/inc/media-modal.php +127 -0
  116. inc/meta-box/inc/meta-box-registry.php +70 -0
  117. inc/meta-box/inc/meta-box.php +475 -454
  118. inc/meta-box/inc/sanitizer.php +52 -0
  119. inc/meta-box/inc/storage-registry.php +37 -0
  120. inc/meta-box/inc/storages/base.php +98 -0
  121. inc/meta-box/inc/storages/post.php +19 -0
  122. inc/meta-box/inc/templates/audio.php +40 -0
  123. inc/meta-box/inc/templates/image-advanced.php +31 -0
  124. inc/meta-box/inc/templates/media.php +51 -0
  125. inc/meta-box/inc/templates/upload.php +7 -0
  126. inc/meta-box/inc/templates/video.php +43 -0
  127. inc/meta-box/inc/validation.php +50 -0
  128. inc/meta-box/inc/walkers/base.php +45 -0
  129. inc/meta-box/inc/walkers/input-list.php +67 -0
  130. inc/meta-box/inc/walkers/select-tree.php +98 -0
  131. inc/meta-box/inc/walkers/select.php +37 -0
  132. inc/meta-box/inc/wpml.php +125 -0
  133. inc/meta-box/js/autocomplete.js +20 -33
  134. inc/meta-box/js/autosave.js +12 -15
  135. inc/meta-box/js/button-group.js +37 -0
  136. inc/meta-box/js/clone.js +222 -215
  137. inc/meta-box/js/color.js +26 -35
  138. inc/meta-box/js/date.js +53 -9
  139. inc/meta-box/js/datetime.js +57 -9
  140. inc/meta-box/js/file-advanced.js +0 -91
  141. inc/meta-box/js/file-input.js +14 -13
  142. inc/meta-box/js/file-upload.js +190 -0
  143. inc/meta-box/js/file.js +91 -140
  144. inc/meta-box/js/image-advanced.js +41 -84
  145. inc/meta-box/js/image-select.js +5 -11
  146. inc/meta-box/js/image-upload.js +31 -0
  147. inc/meta-box/js/image.js +0 -25
  148. inc/meta-box/js/input-list.js +29 -0
  149. inc/meta-box/js/jquery-validation/additional-methods.min.js +4 -0
  150. inc/meta-box/js/jquery-validation/jquery.validate.min.js +4 -0
  151. inc/meta-box/js/jquery.validate.min.js +0 -2
  152. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-af.js +0 -23
  153. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ar-DZ.js +0 -23
  154. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ar.js +0 -23
  155. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-az.js +0 -23
  156. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-be.js +0 -23
  157. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-bg.js +0 -24
  158. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-bs.js +0 -23
  159. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ca.js +0 -23
  160. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-cs.js +0 -23
  161. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-cy-GB.js +0 -23
  162. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-da.js +0 -23
  163. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-de.js +0 -23
  164. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-el.js +0 -23
  165. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-AU.js +0 -23
  166. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-GB.js +0 -23
  167. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-NZ.js +0 -23
  168. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-eo.js +0 -23
  169. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-es.js +0 -23
  170. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-et.js +0 -23
  171. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-eu.js +0 -23
  172. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fa.js +0 -59
  173. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fi.js +0 -23
  174. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fo.js +0 -23
  175. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr-CA.js +0 -23
  176. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr-CH.js +0 -23
  177. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr.js +0 -25
  178. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-gl.js +0 -23
  179. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-he.js +0 -23
  180. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hi.js +0 -23
  181. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hr.js +0 -23
  182. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hu.js +0 -23
  183. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hy.js +0 -23
  184. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-id.js +0 -23
  185. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-is.js +0 -23
  186. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-it.js +0 -23
  187. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ja.js +0 -23
  188. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ka.js +0 -21
  189. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-kk.js +0 -23
  190. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-km.js +0 -23
  191. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ko.js +0 -23
  192. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ky.js +0 -24
  193. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lb.js +0 -23
  194. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lt.js +0 -23
  195. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lv.js +0 -23
  196. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-mk.js +0 -23
  197. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ml.js +0 -23
  198. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ms.js +0 -23
  199. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nb.js +0 -22
  200. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nl-BE.js +0 -23
  201. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nl.js +0 -23
  202. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nn.js +0 -22
  203. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-no.js +0 -23
  204. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pl.js +0 -23
  205. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pt-BR.js +0 -23
  206. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pt.js +0 -22
  207. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-rm.js +0 -21
  208. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ro.js +0 -26
  209. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ru.js +0 -23
  210. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sk.js +0 -23
  211. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sl.js +0 -24
  212. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sq.js +0 -23
  213. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sr-SR.js +0 -23
  214. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sr.js +0 -23
  215. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sv.js +0 -23
  216. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ta.js +0 -23
  217. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-th.js +0 -23
  218. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-tj.js +0 -23
  219. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-tr.js +0 -23
  220. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-uk.js +0 -24
  221. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-vi.js +0 -23
  222. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-CN.js +0 -23
  223. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-HK.js +0 -23
  224. inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-TW.js +0 -23
  225. inc/meta-box/js/jqueryui/jquery-ui-timepicker-addon-i18n.min.js +4 -0
  226. inc/meta-box/js/jqueryui/jquery-ui-timepicker-addon.js +0 -71
  227. inc/meta-box/js/jqueryui/jquery-ui-timepicker-addon.min.js +5 -0
  228. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-af.js +0 -20
  229. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-bg.js +0 -20
  230. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ca.js +0 -20
  231. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-cs.js +0 -20
  232. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-de.js +0 -20
  233. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-el.js +0 -20
  234. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-es.js +0 -20
  235. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-et.js +0 -20
  236. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-eu.js +0 -20
  237. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-fi.js +0 -20
  238. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-fr.js +0 -20
  239. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-gl.js +0 -20
  240. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-he.js +0 -20
  241. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-hu.js +0 -20
  242. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-id.js +0 -20
  243. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-it.js +0 -20
  244. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ja.js +0 -20
  245. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ko.js +0 -20
  246. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-lt.js +0 -20
  247. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-nl.js +0 -20
  248. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-no.js +0 -20
  249. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pl.js +0 -20
  250. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pt-BR.js +0 -20
  251. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pt.js +0 -20
  252. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ro.js +0 -20
  253. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ru.js +0 -20
  254. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-sk.js +0 -20
  255. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-sv.js +0 -20
  256. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-th.js +0 -17
  257. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-tr.js +0 -20
  258. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-uk.js +0 -20
  259. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-vi.js +0 -20
  260. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-zh-CN.js +0 -20
  261. inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-zh-TW.js +0 -20
  262. inc/meta-box/js/map-frontend.js +77 -0
  263. inc/meta-box/js/map.js +128 -95
  264. inc/meta-box/js/media.js +617 -0
  265. inc/meta-box/js/oembed.js +22 -12
  266. inc/meta-box/js/plupload-image.js +0 -141
  267. inc/meta-box/js/range.js +20 -0
  268. inc/meta-box/js/script.js +4 -0
  269. inc/meta-box/js/select-advanced.js +47 -7
  270. inc/meta-box/js/select-tree.js +20 -0
  271. inc/meta-box/js/select.js +51 -0
  272. inc/meta-box/js/select2/i18n/ar.js +3 -0
  273. inc/meta-box/js/select2/i18n/az.js +3 -0
  274. inc/meta-box/js/select2/i18n/bg.js +3 -0
  275. inc/meta-box/js/select2/i18n/ca.js +3 -0
  276. inc/meta-box/js/select2/i18n/cs.js +3 -0
  277. inc/meta-box/js/select2/i18n/da.js +3 -0
  278. inc/meta-box/js/select2/i18n/de.js +3 -0
  279. inc/meta-box/js/select2/i18n/en.js +3 -0
  280. inc/meta-box/js/select2/i18n/es.js +3 -0
  281. inc/meta-box/js/select2/i18n/et.js +3 -0
  282. inc/meta-box/js/select2/i18n/eu.js +3 -0
  283. inc/meta-box/js/select2/i18n/fa.js +3 -0
  284. inc/meta-box/js/select2/i18n/fi.js +3 -0
  285. inc/meta-box/js/select2/i18n/fr.js +3 -0
  286. inc/meta-box/js/select2/i18n/gl.js +3 -0
  287. inc/meta-box/js/select2/i18n/he.js +3 -0
  288. inc/meta-box/js/select2/i18n/hi.js +3 -0
  289. inc/meta-box/js/select2/i18n/hr.js +3 -0
  290. inc/meta-box/js/select2/i18n/hu.js +3 -0
  291. inc/meta-box/js/select2/i18n/id.js +3 -0
  292. inc/meta-box/js/select2/i18n/is.js +3 -0
  293. inc/meta-box/js/select2/i18n/it.js +3 -0
  294. inc/meta-box/js/select2/i18n/ja.js +3 -0
  295. inc/meta-box/js/select2/i18n/ko.js +3 -0
  296. inc/meta-box/js/select2/i18n/lt.js +3 -0
  297. inc/meta-box/js/select2/i18n/lv.js +3 -0
  298. inc/meta-box/js/select2/i18n/mk.js +3 -0
  299. inc/meta-box/js/select2/i18n/ms.js +3 -0
  300. inc/meta-box/js/select2/i18n/nb.js +3 -0
  301. inc/meta-box/js/select2/i18n/nl.js +3 -0
  302. inc/meta-box/js/select2/i18n/pl.js +3 -0
  303. inc/meta-box/js/select2/i18n/pt-BR.js +3 -0
  304. inc/meta-box/js/select2/i18n/pt.js +3 -0
  305. inc/meta-box/js/select2/i18n/ro.js +3 -0
  306. inc/meta-box/js/select2/i18n/ru.js +3 -0
  307. inc/meta-box/js/select2/i18n/sk.js +3 -0
  308. inc/meta-box/js/select2/i18n/sr-Cyrl.js +3 -0
  309. inc/meta-box/js/select2/i18n/sr.js +3 -0
  310. inc/meta-box/js/select2/i18n/sv.js +3 -0
  311. inc/meta-box/js/select2/i18n/th.js +3 -0
  312. inc/meta-box/js/select2/i18n/tr.js +3 -0
  313. inc/meta-box/js/select2/i18n/uk.js +3 -0
  314. inc/meta-box/js/select2/i18n/vi.js +3 -0
  315. inc/meta-box/js/select2/i18n/zh-CN.js +3 -0
  316. inc/meta-box/js/select2/i18n/zh-TW.js +3 -0
  317. inc/meta-box/js/select2/select2.min.js +2 -82
  318. inc/meta-box/js/slider.js +8 -12
  319. inc/meta-box/js/taxonomy.js +0 -31
  320. inc/meta-box/js/thickbox-image.js +0 -37
  321. inc/meta-box/js/time.js +30 -9
  322. inc/meta-box/js/validate.js +42 -20
  323. inc/meta-box/js/video.js +46 -0
  324. inc/meta-box/js/wp-color-picker-alpha/wp-color-picker-alpha.min.js +11 -0
inc/meta-box/css/background.css ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-background-row {
2
+ margin-bottom: 5px;
3
+ }
4
+ .rwmb-background-wrapper .wp-picker-container {
5
+ position: relative;
6
+ display: inline-block;
7
+ vertical-align: top;
8
+ }
9
+ .rwmb-background-wrapper .wp-picker-holder {
10
+ position: absolute;
11
+ z-index: 9;
12
+ min-width: 255px;
13
+ }
14
+ .rwmb-background-wrapper .rwmb-select {
15
+ width: 49%;
16
+ max-width: 230px;
17
+ }
inc/meta-box/css/button-group.css ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-button-input-list li {
2
+ margin-bottom: 0;
3
+ list-style: none;
4
+ }
5
+ .rwmb-button-input-list .rwmb-button_group {
6
+ display: none;
7
+ }
8
+ .rwmb-button-input-list li label {
9
+ display: inline-block;
10
+ border: #ccc solid 1px;
11
+ position: relative;
12
+ z-index: 1;
13
+ padding: 5px 10px;
14
+ background: #fff;
15
+ }
16
+ .rwmb-button-input-list li label.selected {
17
+ border-color: #0073aa;
18
+ background: #0073aa;
19
+ color: #fff;
20
+ z-index: 2;
21
+ }
22
+ /* Layout not inline
23
+ -------------------------------------------------*/
24
+ .rwmb-button-input-list:not(.inline) li label {
25
+ border-top-width: 0;
26
+ }
27
+ .rwmb-button-input-list:not(.inline) li:first-child label {
28
+ border-top-width: 1px;
29
+ }
30
+ .rwmb-button-input-list:not(.inline) li label.selected {
31
+ border-bottom: 1px solid #fff;
32
+ }
33
+ .rwmb-button-input-list:not(.inline) li:last-child label.selected {
34
+ border-bottom-color: #0073aa;
35
+ }
36
+ .rwmb-button-input-list:not(.inline) > li:first-child:not(:last-child) label {
37
+ border-top-left-radius: 3px;
38
+ border-top-right-radius: 3px;
39
+ }
40
+ .rwmb-button-input-list:not(.inline) > li:last-child:not(:first-child) label {
41
+ border-bottom-right-radius: 3px;
42
+ border-bottom-left-radius: 3px;
43
+ }
44
+ /* Layout inline
45
+ ---------------------------------------------*/
46
+ .rwmb-button-input-list.inline li {
47
+ display: inline-block;
48
+ }
49
+ .rwmb-button-input-list.inline li label {
50
+ border-left-width: 0;
51
+ }
52
+ .rwmb-button-input-list.inline li:first-child label {
53
+ border-left-width: 1px;
54
+ }
55
+ .rwmb-button-input-list.inline li label.selected {
56
+ border-right-color: rgb(255, 255, 255);
57
+ }
58
+ .rwmb-button-input-list.inline li:last-child label.selected {
59
+ border-right-color: #0073aa;
60
+ }
61
+ .rwmb-button-input-list.inline > li:first-child:not(:last-child) label {
62
+ border-top-left-radius: 3px;
63
+ border-bottom-left-radius: 3px;
64
+ }
65
+ .rwmb-button-input-list.inline > li:last-child:not(:first-child) label {
66
+ border-top-right-radius: 3px;
67
+ border-bottom-right-radius: 3px;
68
+ }
inc/meta-box/css/color.css CHANGED
@@ -1,7 +1,8 @@
1
- .rwmb-color-picker {
2
- display: none; /* Hidden by default */
3
- z-index: 100;
4
- background: rgb(238, 238, 238);
5
- border: 1px solid rgb(204, 204, 204);
6
  position: absolute;
7
- }
 
 
1
+ .rwmb-color-wrapper .wp-picker-container {
2
+ position: relative;
3
+ }
4
+ .rwmb-color-wrapper .wp-picker-holder {
 
5
  position: absolute;
6
+ z-index: 9;
7
+ min-width: 255px;
8
+ }
inc/meta-box/css/datepicker.css ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Fix empty block below admin footer (issue #24) */
2
+ #ui-datepicker-div {
3
+ display: none;
4
+ z-index: 99999 !important;
5
+ }
6
+
7
+ /* Style for multiple months */
8
+ .ui-datepicker-multi .ui-datepicker-group {
9
+ padding: 0 .5%;
10
+ box-sizing: border-box;
11
+ }
12
+ .ui-datepicker-multi .ui-datepicker-group .ui-datepicker-calendar {
13
+ width: 100%;
14
+ }
15
+
16
+ /* Date Picker Default Styles */
17
+ .ui-datepicker {
18
+ padding: 0;
19
+ border: 1px solid #ddd;
20
+ -webkit-border-radius: 0;
21
+ -moz-border-radius: 0;
22
+ border-radius: 0;
23
+ }
24
+ .ui-datepicker * {
25
+ padding: 0;
26
+ font-family: "Open Sans", sans-serif;
27
+ -webkit-border-radius: 0;
28
+ -moz-border-radius: 0;
29
+ border-radius: 0;
30
+ }
31
+ .ui-datepicker table {
32
+ font-size: 13px;
33
+ margin: 0;
34
+ }
35
+ .ui-datepicker .ui-datepicker-header,
36
+ .ui-timepicker-div .ui-widget-header{
37
+ border: none;
38
+ background: #23282d;
39
+ color: #fff;
40
+ font-weight: normal;
41
+ }
42
+ .ui-datepicker .ui-datepicker-header .ui-state-hover {
43
+ background: #23282d;
44
+ border-color: transparent;
45
+ cursor: pointer;
46
+ -webkit-border-radius: 0;
47
+ -moz-border-radius: 0;
48
+ border-radius: 0;
49
+ }
50
+ .ui-datepicker thead {
51
+ background: #23282d;
52
+ color: #fff;
53
+ }
54
+ .ui-datepicker .ui-datepicker-title {
55
+ margin-top: .4em;
56
+ margin-bottom: .3em;
57
+ color: #fff;
58
+ font-size: 14px;
59
+ }
60
+ .ui-datepicker .ui-datepicker-prev-hover,
61
+ .ui-datepicker .ui-datepicker-next-hover,
62
+ .ui-datepicker .ui-datepicker-next,
63
+ .ui-datepicker .ui-datepicker-prev {
64
+ height: 1em;
65
+ top: .9em;
66
+ border: none;
67
+ }
68
+ .ui-datepicker .ui-datepicker-prev-hover {
69
+ left: 2px;
70
+ }
71
+ .ui-datepicker .ui-datepicker-next-hover {
72
+ right: 2px;
73
+ }
74
+ .ui-datepicker .ui-datepicker-next span,
75
+ .ui-datepicker .ui-datepicker-prev span {
76
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAAAEgAAABIAEbJaz4AABe4SURBVHja7V1diCXHdf56vbZmVl6nxwKFO2yyq1mM4qAwM7oDsR6C7iYIKesH3V1QHgyBu5YYJwHjrB9NQCuByIthHbAga6TZxeBgHMJKISZ+SDIb1oQgRtoVgtjGyD8PmSGQMIpfJmCLk4f+q6o+daq6+965P1VfM3Pv7VN16ud8Vd1dp6o6IUSEjBPTzkDEdBEJEDgiAXT0QOhNOxPHiUgAFT3sA9gPiQLjJsD0208Pbe9rM/OvwkaBQvP0yzhG6ASQO0AqDwmu9mOPT3nqPWsYV9qFEduVIDP/QU4BSfMC9REqAcbRAa520FDELdphc3SJCyRIcADgAAkSQXOXMs4ckrIxFEUs2oENBNSqR0WmJ2kVv2hltvRdaVPHvPtqdpVxjlD1AHIH6AupDbovH1nqkgllLd3apnQJUjV362dmDEnjOya5FUltsEqqbdtxa5Dbppx3uQ+sNLv6mblCcwLIoKlXTQ/7rQkmX4IKzdMv4xgxbgLMO3rYXyTzuhEJEDjiSGDgiAQIHJEAgSMSIHBEAgSOSIDAEQkQOOJ8ADPutPN/zGgyH8BvRoDLGdMT5wPIKbjN02U+gNsdnuV9oUjSbD6AnwdMrkK7gVYt3311u8zv0r5vfNq1L8xsgPp8gAz20fAilORvs8tdsX3mA0i5k1N3x5dBue7icyGgzwfgvus48OoF+DDu9ukzH0Bqf355s9OHnLMNmqQ0F2jjDJIcrrM+H0Ail6v/KUoe3cECpl85XecDTDv/x4zoDg4ccSAocEQCBI5IgMARCRA4IgECRyRA4IgECBwnp52BmQNNcZS/+1hp4/yf7BZ9IpUwzRyQMwftXUHumFMouX4JIED09fvsD0AtJE3RNg1X/jPTJ6IWNznaxvYrgU+oBnFPaAFcxU88CmCPn3hUkE8RSHD2+OQvEWT6Z7M0Com7BuQSygQiR2zA1Yi1/KuXAN/i22bruCspGUMHT6In0nUV7ZIDKmMnrFRNnUulaF72PJAgl3VXpZObgZrLBGh6E0gerccVyoed7dq4n3ETD+2SgXz0tq0BqQn66HbXQU3e5DGw6uJ8QvEyuQt0M1jW4epi/bpoVwtype5zE9kWboq75VoOTHdw6E8B851+i8fIOB8gcMSRwMARCRA4IgECRyRA4IgECByRAIEjEiBw6ItDi81Spwf3fuCThE8N+HhE28VzrY32TaURKgIUC6N8tntvVwHjQztdrpz71YC01Wzljes1jp35KYvDXoZe6xogI5cA+MWh8hJOH492jzk3PgrYdPltDWHPv18N2NLoGctre41iVyVw9UDdlqbXFujqQ8E+26m7lmDbFoj6zaRx58Cmx72FuzvnfhvS8z63umkTQ+5aWF4Zh1ufSJpm2WFsc1gn9TBNCeBfAUmDuH45kKvQJ3332n57+q7YLgK460A2oJsAMoEsBGj2FFBVQBuPVaLo4LWT9iml3wZVvtveQ0ipr+bS4grO7yAgpV/E5O8BXJqrvRuk9c1mLhvOB5AqQL+BkYovZ04qoqRDLZp72hdnAjcBpRIcGBtIHDTW4AfJvAfla2/8commlwA/XzU5t4iQr4JdYvtVL18Ov2tw9yltkp72L7Vx3wOwiPMBVPScb0xaOEQCBI44FBw4IgECRyRA4IgECByRAIEjEmDcmLPHKnM+gAuSv8qn6L2O/u5Jo3vuEsdg94yVvT4fQILkMfcZJSw8dqseC0zt6Lq4Sl4enjiXv7oNbIsvaZ8SqoEgNVvu3X7rg43q0sh2b//2HWgGJI+dK3ZiDaeetXk7pcWj5CX1L+mxgL8HsE06kP1V1aWhzaSFrOW4p03Z9zAg+Pr6kgZnuXS59N0rm2cS5vsCqips+gZu8xKSNIhbSP2WQLsXb7ffQkIyo6uH8Ncs7RFwzKh6ANVR2CZrrjcJuJ2tXa+OidKD8D2E/smFGE8r5lLQe48ZMb9+CTgoM8V14FkHn0334nEgzgfw8fa7t4eQUc0F4KdUyFVfXYTsu4sUIZOGUjVE2wk1EwHvDSRrB+7jLLXdBI7D2eo3a7HtjabPTSQAB0Fnxrg+iO5gHTPTNR8XIgECRxwKDhyRAIEjEiBwRAIEjkiAwDF7BEhny1u26DAJ4OfLllw25CW1hUhxeCxP4tPeB2Fm0Gy7eJ/tpBOsdMjPIQqSpGK4tlvWV1igN4B3gU4AeZRaHu0uWnWKQ5YCVA6U8mv3sq5/pQxxaIlffGu3qbra+/i9an7BURFA3+69jsofbtsyPUGSm/8DNi25a8+6/g+wIqydLVLn09dnFJha/LaPCA7FULDf6nYJxVwbm/nNuThmL+L6LZ2tS8xw5vYR0lvOg4I6JSxB3Uwm7FMZ/CZE2CeVmQSyTcngc+jaPkEn+IK9Ar4LqhdGqFVm32DE/dYL39dK2OQZBah2H1E4gvld+fX8+Lw2IgIAtz+A38r1ul/evUONJM1uHuUQurbE61wB9w5CgcL/hRH6rNjq+7hhv4voBv/tI4LCrM0HmJT5IyyYNQJEHDNmzxcQcayIBAgckQCBIxIgcCwSAfqlJ6A/Ef0nsZQfzd63OtPICDDMK24Xw9aaXnZ4+l0g3NBmCzQ1Yh975fc9Nna/Ez1O4ld4FEc4wqP4FUuBvjP3a7l0zZKGXe6KCTxnHHIKxtwOoqs0oAENSUUVtjo/JFgOKj+3tbhqCF57doyor8lHmrRPJvqN5HoOudytGfHXDPkSrRPREi0R0TotCTXAp1GHVEP+EjXEtncZyxAFk+8BAO5YJnPcxpdxD0CK2+W5O7hgZeMXLCOKy+W3o5rsJr4htL89ZBtLZNgHYU9LYQ9bSg8AbBlyN95Xcpfl0Ix/H8t4EEAf942wej6BLUbim5suL5+XsYb3y++lpoIA9/NPdRqGmuV7AH6EI3G2z1L+ecMa4qNC7Ct4D9uC/JLmSr6kUDHD2woFtvC2ISWoizP5FYYfxS/K759g8/AgPoEEp4RcXhRkpkeSl/MvoE4YLc0IXpj/D/DP6unqWnboUPAjHNXC6FnICLAiaLO1G8DVAwBvlRQgXMJbTIiCAnXzZ0iNz3rufl3M6Qb+G38I4B+xwcZ/GygpxOdgK++p9N7qOFCY/4+wrFPA936WM3+9AgG5o8razk9ZmasHKCgAi/mRpw7rTd5549PEEn6efzvLSB/Eu9jAfQAbeBcP4f8MuTkLqe0yU3dH7wrxOfxN7Vxm/i/gQQD/AADFBdz/MbBufrOAp3AKp7CMU9ZO8gE8gAcAcC3spsP8QA9v4RIu4S3LdM4+DjDEEAct7/OX8Vv5sVzLXw9nQPgFNrCBEyCcEaeUblmMf075s2EJLrhCfIs5l5H+Bj6G7wAALuBOJmj/RFsv4rIzzg+FkK4eoIcDIG/7B0z19zU5R4HfMD7NKspayQayOyK9n3gY9wH8pPx9HxvCjKIuHfxRxxD8hNmf5OXL7s9K86N8DEwdj1HuR5iXNfnL1scV+2PMjQk+BhYPSdWnLRd95hGQe4hzPeg1fQwGjayl9wmhlpDXXzwEDtSzs+MO7gP4HeX3e5YbqcmCAJxXWvr4tWeYztSUNbyvtX7E+QDBY5F8AREtEAkQOCIBAkckQOCIBFgsvIJXmkXQCZCC4FqYbQeVjoyujxZ9cB71LeXxte5vGxqPvUNDvm3IuUEn1Vu+NgE5APylo34GGLSut9P4Cr6C045QI4wwKn8pdZISUZ/6RJTWBhF2aSkfRrhG6zRkh0Fu5AMR23TDkMuebPPos+G3FE82EdEWOxBSHPX47oGcLMw6rdP6hORFmGxQx5QMqBiQS83hmtw6RNuEvHQpo/suERHdFWu3GEwa0TkCQU+gn4+h1dUT9RqNg3FyENGf5X9XrRXUp2wCSt+iH5YUXAYmAv07ge4R6N+InzJBtJ5L1gU5RPlpWqLTFnlR/SMaNa7BAtusfLsWe5tNf0hEI0qrkUTVHVw4Kfew1WqjFnWuAO85fAL7+DF+gJ/jPYtPsI89XMIbVpduF/wTfhffwwa+hyfwL9ZQ2Vj6hijXxyx1/LLmJ6wwwk0AyP/X6+9Q+8WDn21x1uMMAHwJwEp+eUzxAcoe4IYxmt6nG417ALWDs/UAV4noL4joFbaF9InY1j+uHuBvCfRdAn2Llpj0H3X0AIUcotzeA4y03JmXgIGS6wyDRuX7qib7KlOD5+hcPXUziX5OhHr1j4MAn6HfpM/R+fyvifn1WXE2AqRElFKaXy9N+XeI6Nv539/V5EX5bNfwSv64Q87Hr6692XG+IQFMd10q1JDsatLOmwrUT122RENCyaEBE0ImQN1f18T8ZvFkAvDys/Rdeph26WH6e/q0IV+t5W5trPLK/LAeuolTUW6T3s1vBE35iIpr/25bAsBxUJ6N1DM8b+C+Vb5lVDD3FJCWRecJYidghsccuesih8P8Pi73ggIpI3uKPsxv/LbpQ3qKIcBVGtXj+ibvNqh+H8rfg0qTlmXzmxTYqkld07plORFRz2GcLvKR0/yux8CKAqkl9nPl9+dqsa09kK87eB3v+gWM6IgBoHvsx4QRAOCWeTrOBwgc0RcQOCIBAkckQOCIBAgc4REgcxsPGMmgfDZ61EOPbTfFOburVgmwXlbAemt9NLUqSEHYyb/vwDar4Vq+qHS3RoHfxy4u4zI+hU/hh/h0LWZWO1fzX9mepeq+55v4LAhP4AkQPovNWnx5+4ph7cF+6JC7QgxraRgjQObZdSLapSEN6ZAqpwc34CENZpAzRPtjlOdrnR1UybBDoB1rLorhkHPsUNep8vgYOxa6Q8M8B5meAZO+fRyv8FKklmEw+UwVO7XoycYa+7k3B0z51BjrxXc1QDZKvENEh1YjTpMAxVgWn0Zh9uqzruGaONZ5gj5CCSX0ETrBGmRIIKJB6dPncicTQPWHmCuXMm9Iv6zjOgGgzaKoEyDTul2OyXIEOEOr+cEQYJhX4w4748dFAHJWgdu4cvx1Rcb1UDuKnDN/KuonSspjjUn9eh5rlx9SpWz3kOLgCWBPn8oZV7wGKn2cQwKdYwkAhQB8n7JOm7RZ+isZAuzkVcdP+XIxXA7RTMoTyOVTk1p/NeMpw8CQf5uI1vKD6DqjYVC6bLn0iU53IsBD+dmHyv9m7KL/GhLROUsPYK+/PhGdoTO0Smdok4iuZefV9wV8gBQ38fn8FknecR9OubSbuFvKpbBe7mOSrdE38U38cfn9+/g9TZYqM56AK/UxcazjS8qvl/EzIfWslszyrwD4EADwS2aDGcKKNs/KfMHFI9p5ws8MuT5f6Ca+bMzayrbwzybL7jHb+RMeB/BfAID/VGpX62APaUhD2qXZvAksWh+fxjfL1p/hrhG3n7f71Kp/s2w759jUd+gqUd4Odxh59vmQ5UbPnGhjtt/H6DHjv9x/NL8HGFKfNmmTNolos34JUK+xNvPP/lPAXSrmxnLVM3CksEPbtM1Op0IeO6MQRwESfpln12ohhrUOfGjEPFc7mt0DEA3Lw0IA31Y4LQLIR6q0+rtkes2z1uFTOlv+s57lkFIqbieTWtzP02eoJ9QSEZT7DF22lD8FZP/NbejqBDEpMhSlaum0MkZ3sIqH8BKAF/E/rHSEFdzM32aQ4n/xa9qbDVz3SIC+meUk5j23QCRA4AjPFxChIRIgcEQCBA6TAEPrfuEXcau8obwlbokaMU/QHhRuExHRbeYB5ou1h5AvTuVhLx5jPtQfz5TGfcYIdlF7eixwkVG4R0R71uR+6jkgA48Qx3/sKfTfm3puJkCA21T4nMw+4DWWAK8xCuWBoNowhNX8HEncy6tcIVxyor1yuGiPlfvlf46O6uszmoH1PsCGpgQAgV24WTd/vZ9Q19byBnSFGBHR07RET1s1+JVuQQmQXf8Lr7PeB+gFl6phm2zLwlTz7zKSQfnJXyZcxkFu+DQnAid/Ov/2tKBhT0hjgQkwIBOqAfwJwHfeuqZ7jEeuiGczvy8BUrL3MVSOsNf99RXsBOgT0R7t0R75+BXm5DArwPzelACuozBS3fyZ2W3mn4UeYIFvAqv2nyp+58oMX2cJ8HVGoasHsB1qD8THn/49gJuCc3hwRasX8ilW+hSj0FU5dqnU+nUDj1qH6PoUkIWZutHGT4A91sBqFTxfkz5vNeNASFCiR9ve43iPBSOAvzv4SQzx5/n3r+EN/Ou0xzCnhLbvAppRxPkAgSN6AwNHJEDgiAQIHJEAgSMSIHBEApgYgFpL5xAqAYjZNkEHYVyvhJgWbgjvNgeAAXZbS+cTxigd0a4wGqd6A0xJES+1ahjQbu4IGtCuoAGEfHmTLt/WNLVx1w4cg80Dj9hFDdi1zNXBV5/NhBIB1Hj1ah6UcQb5CntZg50Atvg+BJCksqOnLl2QIWFbIflpHS4CZCasfutSEErjuTTYCGCP7yZAUxPbpfwGDHN58DeBd3AB32hxPbmDC7iAbJ3cBWXMPFHOXhB3wi002OCKfzxYJG9AjeWLfA/gOgK8B1CdQYQ7eElsX5Szv/icL6hPLrbcZ/f57aRziegNNDHArmBiWTqHiAQIHHEkMHBEAgSOSIDAEQkQOCIBAodJAFJeLB4RACoCpPlWqWdx1rLXfjZ0dM0ijZhLFARIcVhuDvMIDlkjb+ACvoYXcejxQglzeGHbGIHcPmZ5hA15je0Q0V8RiOhFyvbFtY0ep+JewtWovOt3/1jl8bAchVGJ7hEI9CINCHSPbG+n3qFzlDllU6tSfqfapXw79dP5n7nT7WmSNlwv5CTKl8q/pdYOocCOkwCA8wDeBAC8BAB4Exs4X9vKdAObuIkreASXcIgruN6oq/mk0ukkqI9Afzz/S8Avvzqd/30S/ObyHwewkstXFmu8fpLIfAEpDnFfedHRPWxgRdsJt0CKQ9zBBezgClvJlO9UX9+t/re13/9h7JU7aXmEDXlXsEvVoukR8Zu4ZL7w7H0VtpfK2ObL6O8Wr883mrQ8Hpaj8AZm78O4jzfxLDbAv5Gjmg1wAWDcomrrX7A1tIuLyh28jmv5g+AbuBZfFh8K4nyAwBF9AYEjEiBwRAIEjkiAwFERwPU+gK7yJ3G9lF/Hk8cun3T5pi1vi1yn630AXeWubeYmLZ90+aYtb31kHxeJQ/U+gK5y10aTk5ZPunzTlnc4skvA5bJDSJQRvMvMNxWm/IU8boIXDPmzin4wZ5/l1FvkSYv4l9n4XPlc5Vfz3zz+20iUELb4klzNBW+VhsgGgqrRoKT2S5dzGSnkCYDnAbyunRmffp/4bv1qiKbxE/ALzKjBb1K01OV/AgD4a2v9FWc38Q7GskhNJYD+Lup6Blxy4AW8DuB5vCZWsK2C3PoTVpuvAdz6ZQJ0r5+kPN9O/jjeUcw/FgKc7K5CwYfK/+YgZ48gQ12O3kZDony2iU8ecV1usj8VZI/jnmb+sWDcl4ARgFtofwno3sXb81fX0K4Ll/T79SCuHsqW/uO4p5l/DD1AdhP4Kit7lfkmyZ8HcBM382+q/HUlFjFnX1ekLjlEOVi5nn+qnX1Vk7jkbeunKB+1lr+jmZ9PtSmCeAyb9mPopOWdxwEWfyBm2gNRk5Z3JgDoSbpeKr9OT9aCdpVfpFul/BYziDFp+aTLN215yyNOCAkc0RsYOCIBAkckQOCIBAgckQCBIxIgcKjOoLrTUcesyyNaQPcGLpffjtjQXeURM4f6JaCb6Y6cGrq13KSzhggNJgFcBjzCkShfxpHSD9ThMqA6JYoDtfT1R1hgEmAZEA24jGVRfoRlkSAEecJE7qGwIq47HjPql4DlFlr02LKGbu3XRaCIhtDfF6BJamFnXR7RAtEbGDjiQFDgiAQIHJEAgSMSIHBEAgSOSIDAMb8E6MUBoXFAJ0D3cTZCH4T+xPPdwz5WJ55KANAJsJr/TRuu1p2Z/2Da2VwE6ATYz/+mC1frjuYfI3x7AEKv9tcMzKokFpl57TQszB/vAcYCfUbQPhLss26WhPlrhi2vUIX5V0X5QbwHGBd0Akg9wGppmuKvWSe8VztTJ1FP0c9RTDd/vAiMAbPUA0TzTwG+PUB3uN/f0cz8PUu4iEbw7QGOA1Lvwpk/3gOMAfqEkB4O0JvJzpXyTt/8jOiIOCMocMyvLyBiLPh/gj9Qphd3t8gAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTMtMDItMDFUMDU6MzM6MTAtMDg6MDApYMCSAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDEzLTAyLTAxVDA1OjMzOjEwLTA4OjAwWD14LgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=');
77
+ background-position: -32px 0;
78
+ margin-top: 0;
79
+ top: 0;
80
+ font-weight: normal;
81
+ }
82
+ .ui-datepicker .ui-datepicker-prev span {
83
+ background-position: -96px 0;
84
+ }
85
+ .ui-datepicker th {
86
+ padding: 0.75em 0;
87
+ color: #fff;
88
+ font-weight: normal;
89
+ border: none;
90
+ border-top: 1px solid #32373c;
91
+ }
92
+ .ui-datepicker td {
93
+ background: #f1f1f1;
94
+ border: none;
95
+ padding: 0;
96
+ }
97
+ .ui-datepicker td .ui-state-default {
98
+ background: transparent;
99
+ border: none;
100
+ text-align: center;
101
+ padding: .5em;
102
+ margin: 0;
103
+ font-weight: normal;
104
+ color: #32373c;
105
+ }
106
+ .ui-datepicker td .ui-state-active,
107
+ .ui-datepicker td .ui-state-hover {
108
+ background: #0073aa;
109
+ color: #fff;
110
+ }
111
+ .ui-datepicker td.ui-state-disabled,
112
+ .ui-datepicker td.ui-state-disabled .ui-state-default {
113
+ opacity: 1;
114
+ color: #999;
115
+ }
116
+ /* Other Datepicker Color Schemes */
117
+ /* Blue */
118
+ .admin-color-blue .ui-datepicker .ui-datepicker-header,
119
+ .admin-color-blue .ui-timepicker-div .ui-widget-header,
120
+ .admin-color-blue .ui-datepicker .ui-datepicker-header .ui-state-hover,
121
+ .admin-color-blue .ui-datepicker thead {
122
+ background: #4796b3;
123
+ }
124
+ .admin-color-blue .ui-datepicker th {
125
+ border-color: #52accc;
126
+ }
127
+ .admin-color-blue .ui-datepicker td .ui-state-active,
128
+ .admin-color-blue .ui-datepicker td .ui-state-hover {
129
+ background: #096484;
130
+ }
131
+ /* Coffee */
132
+ .admin-color-coffee .ui-datepicker .ui-datepicker-header,
133
+ .admin-color-cofee .ui-timepicker-div .ui-widget-header,
134
+ .admin-color-coffee .ui-datepicker .ui-datepicker-header .ui-state-hover,
135
+ .admin-color-coffee .ui-datepicker thead {
136
+ background: #46403c;
137
+ }
138
+ .admin-color-coffee .ui-datepicker th {
139
+ border-color: #59524c;
140
+ }
141
+ .admin-color-coffee .ui-datepicker td .ui-state-active,
142
+ .admin-color-coffee .ui-datepicker td .ui-state-hover {
143
+ background: #c7a589;
144
+ }
145
+ /* Ectoplasm */
146
+ .admin-color-ectoplasm .ui-datepicker .ui-datepicker-header,
147
+ .admin-color-ectoplasm .ui-timepicker-div .ui-widget-header,
148
+ .admin-color-ectoplasm .ui-datepicker .ui-datepicker-header .ui-state-hover,
149
+ .admin-color-ectoplasm .ui-datepicker thead {
150
+ background: #413256;
151
+ }
152
+ .admin-color-ectoplasm .ui-datepicker th {
153
+ border-color: #523f6d;
154
+ }
155
+ .admin-color-ectoplasm .ui-datepicker td .ui-state-active,
156
+ .admin-color-ectoplasm .ui-datepicker td .ui-state-hover {
157
+ background: #a3b745;
158
+ }
159
+ /* Midnight */
160
+ .admin-color-midnight .ui-datepicker .ui-datepicker-header,
161
+ .admin-color-midnight .ui-timepicker-div .ui-widget-header,
162
+ .admin-color-midnight .ui-datepicker .ui-datepicker-header .ui-state-hover,
163
+ .admin-color-midnight .ui-datepicker thead {
164
+ background: #26292c;
165
+ }
166
+ .admin-color-midnight .ui-datepicker th {
167
+ border-color: #363b3f;
168
+ }
169
+ .admin-color-midnight .ui-datepicker td .ui-state-active,
170
+ .admin-color-midnight .ui-datepicker td .ui-state-hover {
171
+ background: #e14d43;
172
+ }
173
+ /* Ocean */
174
+ .admin-color-ocean .ui-datepicker .ui-datepicker-header,
175
+ .admin-color-ocean .ui-timepicker-div .ui-widget-header,
176
+ .admin-color-ocean .ui-datepicker .ui-datepicker-header .ui-state-hover,
177
+ .admin-color-ocean .ui-datepicker thead {
178
+ background: #627c83;
179
+ }
180
+ .admin-color-ocean .ui-datepicker th {
181
+ border-color: #738e96;
182
+ }
183
+ .admin-color-ocean .ui-datepicker td .ui-state-active,
184
+ .admin-color-ocean .ui-datepicker td .ui-state-hover {
185
+ background: #9ebaa0;
186
+ }
187
+ /* Sunrise */
188
+ .admin-color-sunrise .ui-datepicker .ui-datepicker-header,
189
+ .admin-color-sunrise .ui-timepicker-div .ui-widget-header,
190
+ .admin-color-sunrise .ui-datepicker .ui-datepicker-header .ui-state-hover,
191
+ .admin-color-sunrise .ui-datepicker thead {
192
+ background: #be3631;
193
+ }
194
+ .admin-color-sunrise .ui-datepicker th {
195
+ border-color: #cf4944;
196
+ }
197
+ .admin-color-sunrise .ui-datepicker td .ui-state-active,
198
+ .admin-color-sunrise .ui-datepicker td .ui-state-hover {
199
+ background: #dd823b;
200
+ }
201
+ /* Light */
202
+ .admin-color-light .ui-datepicker .ui-datepicker-header,
203
+ .admin-color-light .ui-timepicker-div .ui-widget-header,
204
+ .admin-color-light .ui-datepicker .ui-datepicker-header .ui-state-hover,
205
+ .admin-color-light .ui-datepicker thead {
206
+ background: #e5e5e5;
207
+ }
208
+ .admin-color-light .ui-datepicker td {
209
+ background: #fff;
210
+ }
211
+ .admin-color-light .ui-datepicker .ui-datepicker-next span,
212
+ .admin-color-light .ui-datepicker .ui-datepicker-prev span {
213
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAYAAADvl7rLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMUIxRjI2RjhCODYxMUUzQTEyNERCMDU1QzdBQ0EyMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMUIxRjI3MDhCODYxMUUzQTEyNERCMDU1QzdBQ0EyMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjExQjFGMjZEOEI4NjExRTNBMTI0REIwNTVDN0FDQTIwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjExQjFGMjZFOEI4NjExRTNBMTI0REIwNTVDN0FDQTIwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+kKfR4AAAHcRJREFUeNrsXWuMXsdZnuMu4CUN2S0t0a6o4sQqAaooTncrKGrUNbe2qSC2uQqpqtexbCqI0xaQEBclKUL8qts6stqNkuwWiYqbajtqS9oAuyEISrubrLmUFnBSfmRXFa12KT+cKk2GM9mZ7ng858w7l3PmnO88jzQ633e+8565vs+8M9+8MwXnnAEAMEzsQREAAAgAAIABYkx9OHXqFEoDMDFVho0yTJdhE8UxOjhz5gwsAICk/Exep1AkGAK0DY6G93L+eUblnw4gATPNqMceEsBURMVxSwhFbO8TEj838j4V8B6eQHF1RWyzDnTl3zRIIDTNsCJ6RABdMf+mM6XBjNfsDXP1wm2hkEGN+ze1eyFpngYJ9IcAYs0/vQEVkenz7X1SwRZv2xNhqeJNVRcxac5Vj0AAAcSYf13pBVMMPfS8xyhhaFpy9pqhQ6CqNOe0ZgBPAgg1/7rcC8aQQJEx7lzkGzoEqkpz7noEPOcAmhhPxjTGzcA42zR/m0jDZkSPGZPvmCFQVZqh/B3EWMfTV6CKvm2F5LJAQhYCmWlGPYIAAJAPMMQhAAAAIAAAAEAAAACAAAAAAAEAAAACAAAABAAAAAhAA/zI8+wHoMcL772BEkBsA0i1J0CsM0yIAvGa0CZ55doPIIU7uF7uIJKeEUCKBpDS6yumEW4kTPt0S+mOVf7YtG84voekHXsB9IQAUlXeZgMk0JYC2dIe6swS2vBTK79P2mMdmTZayBPQEAGkrLyUJDDdkvLb0h7ryRZCAtOZlD/F8G264TwBDRJAURNYJhLwbcSpepqU+wFs9KDcqhR1OkHa4Q7cQbTlDRjjVRa6H0BuFInKbTqQ0IpE8YYqrl7n8CgcOAHkVKK+I+d+ACj/AQ4BAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAeg1sCw64IJYBFwPNt4li1Mp/DJUPBSAoQUwZ8AwKlCLOQdT5HmLlh1ZCikM6eUsyOXqUJvMRW/660hcRaUlBHDyjEqdsuzxTW+O+BJCi8lOdyRcSf5GoAaWqhJAelCcsvyKB8sQocmzeU7SBWAuorbabmjxqy3+spcrnERkPbUhFR8z3UAVIMQ7NVQbcEneRIO/UvBSW/PuWAw+U54naQJFgCFZVlgV1DiDH2LlI/K5UzNlmL55ScYtEaQ9VoFTpbbsNhHaCqdKdoh045fe0pPxFBiKJnXtIwcAx6SgSpD+VCR3bA8XmPdUkZB+sv9TzGLV135QFUHTgXTl7z5Tx5yzH0PynznvRkTJscx4lZvhHjnesw4XXFRTIP/I/qvFiJSAADBggAAAAAQAAAAIAAAAEAAAACAAAABAAAABDIwB1suvQT3WNXU3YZ6RqA6m8QtuML/Zk6N60P8rhoBs9bABdJZO2G05omadsA0Vg/DZvuKkW4lZyKY7GM9Ocwx14inm6A28Q7zVdCSGVzztKAr7pmkqYh5DyT9kGeIDy1x1QO9Vg3E1YQDmPRXceklt3OGjV91w9H6Ugiw5aAr6706Q42Ti2/FO1gZCdeTYqLBkfIoptBzEWUGia60z/UEvOVZaNTwKGNIC6sVdo5fNMSp9SAXwbQS4yrMt7G+vbiwTtILUV7Itp4r1G5gCaVP62HCtiG38KBs6xFx5FCbpo9VQ1dNv4e7qFdhBjAcWmWcA8Xj3FMe/WuYw9HWwAdZMvoZWfk4FTKUCKrb24R/2lMEFD0rtZU9Z9PCo+9nj1IlDeVZaNEkATPb5vQcb0eKkYOCQdmyy9uedbH6kIkEeUv82nfbPFNKQq981Ew+DQ4V/tMe9jDTJnFzazYJEkkGszkk2WvucqPOOf1sa9PgTYtf0D+riZSGvx4mAQoE0SAjoGLAUGABAAAAAgAAAAQAAAAIAAAAAAAQBAVnAUQfsEkMobLdSjKlWl6/GjIYUpX+6yCz0hCfUeSACpvNFCPapSnYmnxy/eN83SHFLat14s9njwgsUf8JpCgXlLaR88AVR5o/n6NKf2KQ+NX5GJz8KWlCfqhnok8kRxhypwEdgTV3kDxigwi6w7kECCOQDfjQ1iPKpsCt/WxgrcQn4pThj2aYS2k3lTmNJNPEvNrw+BxJ7KDEQQQJ0LYRs+0dNaXLEbK8QoSpHAjCwSKVauHoxnym/Kd6QYjgyKAKq80dpi4VhvuBSurLlNxqLCAuEtNvqu9cQ8sO5SHfM+qCGAbbzssyXSlFFpIRsihO4HkMqVNbbx8wQkEDoOjm30tmGQ7xCCB86rxMjWkQCD8l8NH2/AjcAKjPGlZwHviXFlTWmG6uWQwowtAuOPSXusK23oxjAxsk0ORwZNAG1MIqV6X1dcWYvM70mhwLn86aGwGYcAAAAlBAEAAAACAAAABAAAAAgAAAAQAAAAIIDRxwTD8lFgoASQ0g871LGGJ5T1fYdQ/i02On+HxZ50CwyIAGIP1kzpCDOZqXy2LEQyEamAOWR1bIAEAAoBxKyfjlnPbfbUqhee9FAUcxmpz9l6usk/aXnHlmf85r0YQk1lPW2g6QNVBMAjeyCbPzj3JBSlbLryb0dYH769vpLflnGHnCxr5t0n/3V7ErjSkmo7N2AAGCOY/TygF09hRTCL8ucYi2+zdA41VOWvKjdX+ZvbsBUV9TuNpg/YCMBstFWffUzQWK+0WMSOu32tj7q8u8qhqpenluFGTb4LTfk30fQBGwHUKV0R0fCLSDLIRSCFQQKcMBfBa4ZCrrzUlU8XdtcBBjAH4OqNQhXWd0+8mP34YuQnLbJbWh62CUpW1NwriKQTgqrt3KD4gDcBxI7fQ7elKioCi5APGfPrsqn+hiwSP2cidjs1AEOA6IZYJG7UOREzB5ALmww9PpCIAIYOKBIw2CEAAAAgAAAAQAAAAIAAAAAAAQDNYoZdvZZhpkfpF5PLe42ACeeOE8Aho8Ety3tt4/0szoc/FiKuBVa9l8BMC8q/arm/6hH3TEbyEIr+rTLcXIbLMtws740Fpj8kHzcZsjd55iNEPjZOgV9whJg8XKVLeoWcK8P7yvC0/D4h79lg+3vskOX5w2U475no32dXH8t1kvktB64jDNc75svwL2U4UfH7LWVY81ReHbMR8qsOef250KPNRKO5VPP7/jI84yCA15dhvQzj8p4ggQNl+LIkAuaZfp98VNX9JY82wCxlcIkgFyJj4s/l9aTsiFLWY1FHAExTfoEV5rcCjkog4r0HA5jRlwTGLfcuE+QWy/BgYO+3qhW0uSJPnXa8WpMHpeCrNeSxyppdn3Cpouz0MnTFr5T/Go3Y1h3vrStPlXcKmjiVqm+Hy1aROLextVlxOrY8C1kp/5dlQwldQrvX+L4Q8I7vCIzbZQG4cLiCqLj87ZxDfq2CBCg9P69ogL7nFIqy+4bl/vd4lMM18nkR33cHluUdEcO4GIIIdYcviGkpWlT+nyjD39SZa4yo9FQo5Xe9pyASwGRg2sYD0x9jAQh83kICSvk/T3yHSQIU5dcx4fhOKbvrI8pUmPtfK8Pb5fe/kveYR/6ZhYR8ymDWsKhmCcOzvsNU/l+UdVZJAqlnZqnK76O8oeaU3us826IFYJIA81R+G0n6TuLtd3ynWGD/bdy7waPnvygVfl0jBHHve8vwPLH3rduZqs0l2inM+dh3/EoZPu45b3FSG4J9Urt/xfC7ib8Btzwadp3yqjCuffbBd2nBpwdbjFR+gSmNBJTy+2zEKRReOPUckmGTtTuTL8rpB40wTig/kcfvl439G1LxD8h2xuVvoRuSznoq/r6Ka+xwNMc7/iSA+MWw+TvZ7qSiUv6VJi2AVJM04wni+VLgO2MtgCm2u+OO3utvEhv/TI08lQRe6/juakSXDHNenx+qsya+T3vO9k/BunxfyI5Eucz3y5nf4bMvxzNG/S3UKX8oAcxGmDkU5f8DqYBVv6UimSbmACjjzNkG5XVFrPvuakT63MWYTJPr7z+dJFzPuCbSeIK6/cuKK7UTWKy43+Y7QvCMhcStyv9yYXK+U9anTp1iwBXj7VsqfhfktDaQsuBar/9MT9OeqmPoG9SEoFX5z5w5k20I0HWsGdcho0Dae4tnKGUAXwAAGDBAAAAAAgAAAAQAAAAIAACATuAPZchCAOqU3NgjsUNg+i23vSeADcpHnbIYZ5bZ/bAp/+EfYtV7EXDm3qPhhEOeusCpypf8pp7IK/xRZPuZk6FtXFuG35Hh2sh3HdXCFRirUf4trcFST+gVm4gIBxB95dP9bMcD7kZ5pfhzi4U4a1qlndQUsKiRUygaUH61QMfljivK7AtGWlTaxP03svrFPue0PJtYIJShy3NygdEWOqmFJLoTzzqj+7jnllf4baNNCCVYIij9smzzy/LepNSDykU1hu6oOnxQku6C9h7KOROfNj7fHqH85oIkkf6vvFwoloVAuvLr3mirhMSLlwk/+Lrz50M3dPCRV0r3a2U4q13FfgWnPRvQjCQjteGJyzOv6mBPah4oPVVByP/nyvCjbMdF+7Yy/EMZfozRnWk423XiUTK3MvdKPpu8Qoi8+D/7BbbjonyTh7zZ+NUKvMWG26Ape9JCykWN9eYi8JOMvlJVtVmR9/NSr8XnpbqFQKbyq15vVv7WxgKLqn0EfLwM3ySJ6D/L8O9sx7tNrOJ71lP5Rd7Vzka+brm58Ndl+JEyPCaV6DFZHn8bOBzTFTJUXuCWAHmh/M8HyJk936Jn+9vybJuhFpmOGxI9o3CPluZDhpWybZsDWGDV69EVCSy00IC3ZdiSYZv5H8/1j2X4uTJ8VjaGT0r2PBeg/Oc0S6AP+Em2s/b9bdJ8FFfhTkrdYONmS2/lQ/ymvAqvCJAXPf9e5rfBy9EahXetxZ8zlN88X3KrwTmB3y3DB2p+/4B8xoV9Mqh0npblMS+HP9tVcwAnLeNZphHCWsXYtItQFsBXy/BP0pQU138LUP6Ynp+zMH/wSW3uxdcCEi6gP1+GP5VKL66/xGhuqcJj8UvamFu59CrzPUReKP6LEfL6HICv8psK/2QL1utWgHWr8Jtl+I2a30LIr5K8Xb4AIY1+SzOZ9xkm98EWFH+WoGwfb0n5Y0nAtIqo+C22sxmEmNi5Xl7Ffgq/V4YjNXJi/uY5456pdPs7LG9T/iXPcl4xlJhbFHjbUU9VJECZANT/cft7eX2zabo78q+P+VfqImvCGeh5trsT8Fci5wxC9hRci4xTWTuhyi9m+b9QMxZ+Y8PKr8qdSetHv/6MQ+45Y7z+r57x5pZf1Ig2RPkplhZlHsxGAtTZf9E+XirDu9nuZJ+YHPyI/O1xot6oMf9hXwKo2hBR78maxMmantJn+GGm1TftoT3/ag0JuP4CVD3cJa3xbHn0gLp83e8uiJ54M6IOc8nPJ1B+ZakuG0qs/w1IJW19GEclcTHp+ctl+Avt3oPyPS8Q33FaK4/aeFPvByDGiRcZAIwO5rShQR9wVPtcSYJN7QcA5QdGDSs9S6+X5QNfAAAYMEAAAAACAAAABAAAAAgAGCno7sVzRJk5drUb7s2J0uPzV2wX3MAHSQC3WhrArRnSxwfYCNQ+DI8Y9x9h/nsz3Meu9H1YJpDAj8vnjsjwOhnE8twfIsSpt533Vih/YQQdwnPxHVL+TTJwee82QvwzlrZLPVDFtReDaz8GinzsOw556g2v0yPbOgC15nulDB+W9xZlwzPdOykJ8WV9m3zMO3LgqCwzVV6qTCkLVPQ8i3cck8o/71kWKg0KYj+GZwnyIv5rLPe/VYZvMporrYj3UUk+qgz09NT51KdwBzdXkFK9WDmju5tT47Zhy/EOtZpR30BmVbtfEPJvi+Pb7thqHYDNAlDKLypJLOn9Wba7BnmdARQsamV5VCu3RQ9ZJpXeVH6qW+s+47uPG/TzUtkvy/BNSQBUPMp2l4NPsqv98ldaqIP9bNeblHlaA+buT75W6LbMp+7J6uPRyo20zBDJ0YQ4i3FaC/9DHQJ8WDM71RFH8y0pT5W50sZwgBODCwcqFJbiT3+MVXuzKYuAMoy4N7IcXtK+v8Toh2t+SPb8qpzuNZR/ifCO8Yrgg1XP+wp72ZW7P+3V4qce8inK/7Rm0jPmdzhpETF/UkjiEW3tNWzHGew1WrgCdSsBdeU/Rhx7VLFUm6Z8ivMJY3GRXX023LzH8OlYpPLbNnVhmvldhz+TCm/6DFySyu2CGPdfsMw5+KzPF77/L7A8uMby/Wvy86uJ73iP9lmQofIsvZFoBfAKsqJ0Pspa+LpG3nuk8j/Fdrboq50D4DKRE0ajU5XZxpZeLOIdvEFZah6qfOepcyh/XIZ3Wu4L99DbA5WfqoAi7fdU/PZ+tutp6Jt3KoHp4+gXtfsvyOEIdQ6gapztGsPfWPM8Z/UernrcVcO797UwB/AG+fmr2v3n9LZbNwdwQBvzPyp7fqX8B4jKYc7uVs34UuV93lE4QowsNQ/rFSb8eoDy61aE8At/0jG5pCv/QdkgC4/eVxDUAzLdeqAov8qjauhM63HUfAZ1DC3C/7GdM+5f4WF+zzK/reNMvFKGZ+X1WuNzDKjD6Ng5gBukbl+vBSaJgbuGABeloq+zK/9C8v0HYMhQ5r8qs6fZ7r8ALrzT6PFFr/k6trspxJuJY1/X7rV1eFqm/3Py+w8QlV8nsRU5Dl6RQ4ctLf/HPN71dc+0rzH75itiQ1HXCcfCVNePprd9PkwYgt3o+J3SCXKP+za8lmTKNnw8+FD/BoyBMuNNc/9Jqfx1vuVc6wXXEtWdb/nr/1psa+NefbvsPTUNWd2/qwxfZDubuW4GtCVlKt9kmcsoHJOAr2e7e2Ay7bPYTq5ug9JDjLbnpNoxK+QddbKUoewVQ4CmjwcvMsv3EdsV+b695fJ6tWa++/yjIHr3v5NEtaiRldog43/LcB1hMuzhyPRXbQ3nOpzleXb1rlLUcj2foA7Ot6k3YwwAqk3vXw+UXaohN+ZQ/lQktsaG2YF4Ab4AAAACAAAABAAAAAhAwyFGXwGocIccA5rLZ5cY/WQaAAAyE8A5I1Bwdxk+VYZ3WX57l/ztbhQ7AHSbAN5m9PyH5D1Xz3/GuGdbOXfGwxJYldbDakDenjUskLkE5TWHJuNVb2ZYRdH0gwDUARyTbHddtutQjiMe8VKfnTGuPthnfF9OoPzLRBI4ajT8owHxxb4jVl4p7IxFuV2Y9bwPdIgA9N5f92F2WQF3VTQiTnw2NZT1MZngXXMagbhIQCia6bO/6KmAse9Q8qK+xuV1MYAEZiy9+QzUZrQJQO/pJ9iVa5dPBiphKE4GxqunXy0/XQk08+cM68G1xn7R837ds/OSwOY936GU/zNsZ2XbZzQS8MUa1GQ4BDBnjP31HVWUFdDmOPg/jKsvVNqFI85hovLrPbyv8qfGeWmBnQ+QfcLxndVYbLGbrsxo5LGmkQish44TwDKhB19uMX0rMv5YpTvI3GvPbWZ+TuVXhDvB/P+KFXiL43udxRa7hHZBU3jdnXUBKtddApirMKEnCGaywFmPeKnPzrG4GXzVmCm7sKywK3fLCVX+ec/7dc8uSitm0fMd4rnHyvBWtuPd9lb5PWRbt5mEMrAAOkwAyxUmtG1zBduzF2pMSsqzrCaeUKvD15w1SSCk51+yKJrvcdWx71jSSOCypvxLnuUnTPdZwzKgzAmYlkQqywJokADWPBuGicfLcJwge1w+SzXdGaOfyZ5q2HEw0uxfMhr9UoZ3xMoXzL6vAP7KGyGMJa5Y4cP9X3LM+h7jN7ErjJjMesJTGWN6jSKCBNBbAYMigFR4Qob3ongBEGl/hgAAAIAAAAAAAQAAAAIAAAAEAAAACAAYIOZYuG9AjCyQkQBEpVF931nNO3jNd6B5LLC49fdzLHwVZows0AELQFVgLBH4koYZ30RAGlTaJyz3eEAaFE4Q5U/UpIl7lIXvseRmfCdkmOuI8nOGXZV6NwRomwjM+IQjz0FNeeYIJucy2/UADEl/yjznIFJmKKCPInOtDEOtvirZAlZBf+cAVEM+0eLYc1lrMIXWmHlNz20+G6N4ZhpClLBtxWc15ZMTGP71nABWZK/6YEtpU/EdNBrQQWZfXlpUPBvjx2+mwRex8Y8SsCS4pwSw0nJDNuOb0Ex61+YgKxoRqDmAkPSnzPNKBiIoKoKP7MGIeA/WWAEHoXYdYuWK48G5bKz3RzRa8zjn2KPCgXhz27fs5yzDqjZkgYbhOh48RYUVMAF7b26vaNZUm7JAB+cAgGFihWFfBRAAAAAgAAAAQAAAAIAAAAAAAQAAMJoEEHqyLQAAPSUAsXruHu37DTJMeLxX92C7z1MWAIBMBKBO0zXPortR3qcq8gG2swhEnAVwr5S9NUF6XQ4lJ5jdjVaFEyMuDwBeMFcCnpbXfzbur2i/HyO896ImJ5YTn2M7J/Qe0H5rAmLzi8JBIPpptaMmDwDBFoDo3eeloqohgDDf1Uk+6/J3ihWgeqxH5PPKEWY9cDjg40oqDsO8Vl71z+I6XoZVh/y1Mj79HSr4yvMI+b2WK0UeAIIsgP3yqh/ceb/2+YLswfcTeiDx3G1s51TbeTmEOCyHAuL7BxvM06sqCKQgEskrjWthvIMRFFi/vsqTxFS8k4b8JMOyWqBBC+CSvN5Z8eydxnOuIcCS1ogFEWzL6+mGen6F6yxhQl43mPsMRPHsD7Pdo9H1dzxHkL9OyutXJe8bv/4eavwAEGQBbEszfY7t/PW3pP12VPbqK/I5quIWsucXcwD7yvAoCzujnoqTZfii4/e1EZYHAC+Y+wHcKsfpasx/Qfb8BzTT/qInAajvaiOIZYIpq5vstisAABGo2g/golTy+9jOX4FK8c/Le9QZ/Lq9AAoP+aorAACJhwA6CRxG0QDA6AO+AAAAAgAAAAQAAAAIAACA4RLAHWxnDYDpiLIkf3Mht/xb2M5KQ1P+g/K3UZfve/0NXb5VmOsA7i7DGYeMePCBit9yy99Vhocc8sfL8PCIyve9/oYu3xrUOgCdAAQ7fYoo/44yfNrCfDnlf6oMnyXK/3QZHh8x+b7X39DlsxCAPgQ4YrMQmH3xzRHivSq45I+zqxcPHXfI31mRfkZ89k6P9PvIFy3Ff8Qjfmr9FQnkWab411j1sWi+8RcJ2n8RqCutDQF4TaI5oXJ9HXfq5AvNJGaaycs948+V/lTxp0h/1Tuajr8gposFps8n/iKg/Yjff1X7/tGA9mc+Kzxkn3KQY6sWAPVosMJTSaoyR5XnxliXMjZ2pYdHKHcIScRWcJE4/b7vSJl2lqD9hKSfW0jABx8xCMAHb5DKblP+zmCMdRcvVnxuAzyBhZBKgXIrcEgHkKL8U8Qb60D27kA5ofxPd1356wggtgJ4ogZ4VF6X2O5fKzENKpQEeCISaav8eKTyxhIgz0AaLgskxIL6aGD+n9JIoLPKL6BPAp71kDtLvBcqr8b+izLo96rkH/ZQpoeJ93gCeRYhzzzkz3oQCqX+eEL5ttuPWX88g/xTNcp/tosEcMFDAS4Q71XBJf+QpQE+5JD/hIcCfoJ4jyWQ5y3Ff8Ejfmr98QTyLEP83EFATcvrJMAidaU1AhD/Kx8nyBxnV/8H3QV58b/qKYL8KWb/D7bv8n2vv6HLZycAZVrOsZ39/E18SP72sMM0zSkvVliJRRYfs/z2MfnbAyMs3/f6G7p8+5MlxlJgAAAGANtKQAAABgYQAACAAAAAAAEAAAACAAAABAAAwIjD5QtgA2V9O+Tj5AEgKwEIjFvuXfZ4d255AAASDAFyKt3lBGnI2ePiSDOg1wQQq4CXtRCCcSk7nkkBq7aEokI/1BQAekcA4zXmOFWBxyPkL2skEKqAjMXtI8BZvg0pACD7EGA8Y/rGE6QhZ+/LO5AGAKjEWINj/9zyAAAEEkDKDS0hDwA9HgIAAAACAAAABAAAAAgAAAAQAAAAIAAAAEAAAAVTDAuDgB4QQBdWsYm4Z7TrKCj/Rhmm0fSArhPAtHFFzx1Hhrryb6I4ga4TwIZxHbryx/TcUH5gEBYA13rKumvTwwZXCFXejQTKjzkAoDMYc1gAhXaloCBem8RsQz1/iAVgU37MAQC9IIBQC2DaojTmtUkzeNWDqHyV34cM65QfwwAAFkCHLQAoPwALIMAC6ALWEryjSeWf8nwfAPTGAhgVhFouVOXHHAAACyBAEbsO08x3fQeAvD0d5/hHCgCGCvgCAMCA8f8CDABatG6NN+gY2wAAAABJRU5ErkJggg==');
214
+ }
215
+ .admin-color-light .ui-datepicker th {
216
+ border-color: #fff;
217
+ }
218
+ .admin-color-light .ui-datepicker .ui-datepicker-title,
219
+ .admin-color-light .ui-datepicker td .ui-state-default,
220
+ .admin-color-light .ui-datepicker th {
221
+ color: #555;
222
+ }
223
+ .admin-color-light .ui-datepicker td .ui-state-active,
224
+ .admin-color-light .ui-datepicker td .ui-state-hover {
225
+ color: #fff;
226
+ background: #888;
227
+ }
228
+ .admin-color-light .ui-datepicker td.ui-state-disabled,
229
+ .admin-color-light .ui-datepicker td.ui-state-disabled .ui-state-default {
230
+ color: #ccc;
231
+ }
inc/meta-box/css/fieldset-text.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .rwmb-fieldset_text-wrapper fieldset label {
2
+ width: 20%;
3
+ display: inline-block;
4
+ }
inc/meta-box/css/file-input.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ .rwmb-file_input.rwmb-file_input {
2
+ line-height: 18px;
3
+ margin: 0;
4
+ padding: 4px;
5
+ width: 300px;
6
+ }
inc/meta-box/css/file.css CHANGED
@@ -1,58 +1,51 @@
1
- .rwmb-file li {
2
- width: 250px;
3
- margin: 0 10px 10px 0;
4
- -webkit-transition: width .25s, opacity .25s, -webkit-opacity .25s;
5
- transition: width .25s, opacity .25s;
6
- }
7
- .rwmb-file .rwmb-icon {
8
- width: 60px;
9
- text-align: center;
10
- vertical-align: middle;
11
  overflow: hidden;
12
  }
13
- .rwmb-file .rwmb-icon img {
 
 
 
 
 
 
 
 
 
 
 
14
  max-height: 60px;
15
  max-width: 60px;
16
  }
17
- .rwmb-file .rwmb-info {
18
- width: 180px;
19
- vertical-align: top;
20
- overflow: hidden;
21
- }
22
- .rwmb-file .rwmb-info p {
23
- margin: .1em 0;
24
  }
25
- .rwmb-file .rwmb-info a {
26
  font-weight: bold;
27
  text-decoration: none;
28
  }
29
- .rwmb-file li,
30
- .rwmb-file .rwmb-icon,
31
- .rwmb-file .rwmb-info {
32
- display: inline-block;
33
- }
34
- .rwmb-file .rwmb-icon,
35
- .rwmb-file .rwmb-info {
36
- margin: 0 0 2px 2px;
37
  }
38
-
39
- .rwmb-file li.removed {
40
- width: 0;
41
  margin: 0;
42
- opacity: 0;
43
- -webkit-opacity: 0;
44
- -moz-opacity: 0;
45
- -o-opacity: 0;
46
- }
47
-
48
- .rwmb-file li.removed:after {
49
- content: ' ';
50
- position: absolute;
51
- top: 0;
52
- left: 0;
53
- right: 0;
54
- bottom: 0;
55
- z-index: 2;
56
- opacity: .4;
57
- background-color: #f00;
58
- }
 
 
1
+ .rwmb-uploaded {
2
+ margin: 0;
 
 
 
 
 
 
 
 
3
  overflow: hidden;
4
  }
5
+ .rwmb-file {
6
+ display: flex;
7
+ margin-bottom: 10px;
8
+ background: #fff;
9
+ cursor: move;
10
+ }
11
+ .rwmb-file-icon {
12
+ min-width: 60px;
13
+ flex-basis: 60px;
14
+ margin-right: 5px;
15
+ }
16
+ .rwmb-file-icon img {
17
  max-height: 60px;
18
  max-width: 60px;
19
  }
20
+ .rwmb-file-info {
21
+ flex: 1;
 
 
 
 
 
22
  }
23
+ .rwmb-file-title {
24
  font-weight: bold;
25
  text-decoration: none;
26
  }
27
+ .rwmb-file-name {
28
+ margin: 0 0 4px;
29
+ white-space: nowrap;
 
 
 
 
 
30
  }
31
+ .rwmb-file-actions {
 
 
32
  margin: 0;
33
+ font-size: 11px;
34
+ }
35
+ .rwmb-file-edit,
36
+ .rwmb-file-delete {
37
+ color: inherit;
38
+ text-decoration: none;
39
+ }
40
+ .rwmb-file-edit {
41
+ margin-right: 6px;
42
+ }
43
+ .rwmb-file-actions .dashicons {
44
+ font-size: 1em;
45
+ width: 1em;
46
+ height: 1em;
47
+ vertical-align: middle;
48
+ }
49
+ .rwmb-file-input {
50
+ width: 100%;
51
+ }
inc/meta-box/css/image-select.css CHANGED
@@ -16,6 +16,6 @@
16
  .rwmb-image-select.rwmb-active {
17
  border-color: #0074a2;
18
  }
19
- .rwmb-image-select input {
20
  display: none;
21
- }
16
  .rwmb-image-select.rwmb-active {
17
  border-color: #0074a2;
18
  }
19
+ .rwmb-image_select.rwmb-image_select {
20
  display: none;
21
+ }
inc/meta-box/css/image.css CHANGED
@@ -1,67 +1,66 @@
1
- /* Uploaded image */
2
- .rwmb-images {
 
 
 
 
3
  overflow: hidden;
4
  }
5
- .rwmb-images li {
6
- margin: 0 10px 10px 0;
 
7
  float: left;
8
- width: 150px;
9
- height: 150px;
 
 
 
10
  text-align: center;
11
- cursor: move;
12
- position: relative;
13
- -webkit-transition: width .25s, opacity .25s, -webkit-opacity .25s;
14
- transition: width .25s, opacity .25s;
 
 
15
  }
16
- .rwmb-images img {
17
  width: 150px;
18
- height: 150px;
19
  }
20
- .rwmb-image-bar {
21
- color: #fff;
22
- font-weight: bold;
23
- background: #000;
24
- background: rgba(0, 0, 0, .5);
25
- position: absolute;
26
- top: 0;
27
- right: 0;
28
- padding: 5px;
29
- display: none;
30
- text-align: center;
31
  }
32
- li:hover .rwmb-image-bar {
33
- display: block;
34
  }
35
- .rwmb-image-bar a {
 
 
 
 
 
 
 
36
  color: #fff;
37
- font-weight: bold;
 
 
 
38
  text-decoration: none;
39
- vertical-align: middle;
40
  }
41
- .rwmb-image-bar a.rwmb-delete-file {
42
- font-size: 23px;
43
- width: 18px;
44
- font-weight: normal;
 
 
 
 
 
 
45
  }
46
- .rwmb-images li.removed {
47
- width: 0;
48
- margin: 0;
49
- opacity: 0;
50
- -webkit-opacity: 0;
51
- -moz-opacity: 0;
52
- -o-opacity: 0;
53
  }
54
- .rwmb-images li.removed:after {
55
- content: ' ';
56
- position: absolute;
57
- top: 0;
58
- left: 0;
59
- right: 0;
60
- bottom: 0;
61
- z-index: 2;
62
- opacity: .4;
63
- background-color: #f00;
64
  }
65
- .rwmb-images li.ui-state-highlight {
66
- background: #ddd;
67
- }
1
+ .rwmb-image-wrapper .rwmb-uploaded:empty {
2
+ display: none;
3
+ }
4
+ .rwmb-uploaded:not(:empty) {
5
+ display: block;
6
+ margin: -8px 0 0 -8px;
7
  overflow: hidden;
8
  }
9
+ /* Re-add WP core UI style to make sure frontend works */
10
+ .rwmb-image-item {
11
+ position: relative;
12
  float: left;
13
+ padding: 8px;
14
+ margin: 0;
15
+ color: #444;
16
+ cursor: pointer;
17
+ list-style: none;
18
  text-align: center;
19
+ -webkit-user-select: none;
20
+ -moz-user-select: none;
21
+ -ms-user-select: none;
22
+ user-select: none;
23
+ width: 25%;
24
+ box-sizing: border-box;
25
  }
26
+ .rwmb-image-item.thumbnail {
27
  width: 150px;
 
28
  }
29
+ .rwmb-image-item.medium {
30
+ width: 300px;
 
 
 
 
 
 
 
 
 
31
  }
32
+ .rwmb-image-item.large {
33
+ width: 1024px;
34
  }
35
+
36
+ .rwmb-image-actions {
37
+ position: absolute;
38
+ z-index: 2;
39
+ right: 12px;
40
+ top: 12px;
41
+ opacity: 0;
42
+ transition: opacity .2s;
43
  color: #fff;
44
+ }
45
+ .rwmb-image-edit,
46
+ .rwmb-image-delete {
47
+ color: inherit;
48
  text-decoration: none;
 
49
  }
50
+ .rwmb-image-overlay {
51
+ position: absolute;
52
+ z-index: 1;
53
+ top: 8px;
54
+ bottom: 8px;
55
+ left: 8px;
56
+ right: 8px;
57
+ background: #000;
58
+ opacity: 0;
59
+ transition: opacity .2s;
60
  }
61
+ .rwmb-image-item:hover .rwmb-image-actions {
62
+ opacity: 1;
 
 
 
 
 
63
  }
64
+ .rwmb-image-item:hover .rwmb-image-overlay {
65
+ opacity: .6;
 
 
 
 
 
 
 
 
66
  }
 
 
 
inc/meta-box/css/input-list.css ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-input-list {
2
+ margin: 0;
3
+ line-height: 1.8;
4
+ }
5
+ .rwmb-input-list .rwmb-input-list {
6
+ margin-left: 20px;
7
+ }
8
+ .rwmb-input-list li {
9
+ list-style: none;
10
+ margin-bottom: 0;
11
+ }
12
+ .rwmb-input-list.inline {
13
+ line-height: inherit;
14
+ }
15
+ .rwmb-input-list.inline li {
16
+ display: inline-block;
17
+ }
18
+ .rwmb-input-list.inline li:not(:last-child) {
19
+ margin-right: 20px;
20
+ }
inc/meta-box/css/jqueryui/jquery-ui-timepicker-addon.css DELETED
@@ -1,6 +0,0 @@
1
- .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
2
- .ui-timepicker-div dl { text-align: left; }
3
- .ui-timepicker-div dl dt { height: 25px; }
4
- .ui-timepicker-div dl dd { margin: -25px 10px 10px 65px; }
5
- .ui-timepicker-div td { font-size: 90%; }
6
- .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
 
 
 
 
 
 
inc/meta-box/css/jqueryui/jquery-ui-timepicker-addon.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
2
+ * http://trentrichardson.com/examples/timepicker
3
+ * Copyright (c) 2016 Trent Richardson; Licensed MIT */
4
+
5
+ .ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input{background:0 0;color:inherit;border:0;outline:0;border-bottom:solid 1px #555;width:95%}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus{border-bottom-color:#aaa}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
inc/meta-box/css/map.css ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-map-canvas {
2
+ width: 100%;
3
+ height: 400px;
4
+ margin-bottom: 10px;
5
+ }
6
+
7
+ /* Autocomplete style, copy from WordPress's common.css and forms.css */
8
+
9
+ input.ui-autocomplete-input.open {
10
+ border-bottom-color: transparent;
11
+ }
12
+
13
+ .ui-autocomplete {
14
+ padding: 0;
15
+ margin: 0;
16
+ list-style: none;
17
+ position: absolute;
18
+ z-index: 10000;
19
+ border: 1px solid #5b9dd9;
20
+ box-shadow: 0 1px 2px rgba( 30, 140, 190, 0.8 );
21
+ background-color: #fff;
22
+ }
23
+
24
+ .ui-autocomplete li {
25
+ margin-bottom: 0;
26
+ padding: 4px 10px;
27
+ white-space: nowrap;
28
+ text-align: left;
29
+ cursor: pointer;
30
+ }
31
+
32
+ /* Colors for the wplink toolbar autocomplete. */
33
+ .ui-autocomplete .ui-state-focus {
34
+ background-color: #ddd;
35
+ }
36
+
37
+ .ui-helper-hidden-accessible {
38
+ border: 0;
39
+ clip: rect(1px, 1px, 1px, 1px);
40
+ -webkit-clip-path: inset(50%);
41
+ clip-path: inset(50%);
42
+ height: 1px;
43
+ margin: -1px;
44
+ overflow: hidden;
45
+ padding: 0;
46
+ position: absolute;
47
+ width: 1px;
48
+ word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
49
+ }
inc/meta-box/css/media.css ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-media-list:empty {
2
+ display: none;
3
+ }
4
+ .rwmb-media-list:not(:empty) {
5
+ display: block;
6
+ margin: -8px 0 0 -8px;
7
+ overflow: hidden;
8
+ }
9
+ .rwmb-media-item.attachment {
10
+ float: none;
11
+ text-align: left;
12
+ width: auto;
13
+ overflow: hidden;
14
+ }
15
+ .rwmb-media-preview {
16
+ width: 60px;
17
+ float: left;
18
+ position: relative;
19
+ }
20
+ .rwmb-media-info {
21
+ margin-left: 65px;
22
+ }
23
+ .rwmb-media-title {
24
+ font-weight: bold;
25
+ text-decoration: none;
26
+ }
27
+ .rwmb-media-name {
28
+ margin: 0 0 4px;
29
+ }
30
+ .rwmb-media-actions {
31
+ margin: 0;
32
+ }
33
+ .rwmb-edit-media,
34
+ .rwmb-remove-media {
35
+ font-size: 11px;
36
+ color: inherit;
37
+ text-decoration: none;
38
+ }
39
+ .rwmb-media-actions .dashicons {
40
+ font-size: 1em;
41
+ width: 1em;
42
+ height: 1em;
43
+ vertical-align: middle;
44
+ }
45
+
46
+ /* Add more button */
47
+ .rwmb-media-view .rwmb-add-media {
48
+ padding-left: 5px;
49
+ margin-right: 5px;
50
+ }
inc/meta-box/css/oembed.css CHANGED
@@ -3,9 +3,9 @@
3
  vertical-align: top;
4
  display: inline-block;
5
  }
6
- .rwmb-oembed-wrapper .embed-code {
7
  margin-top: 1em;
8
  }
9
- .rwmb-oembed-wrapper .embed-code iframe {
10
  max-width: 100%;
11
  }
3
  vertical-align: top;
4
  display: inline-block;
5
  }
6
+ .rwmb-embed-media {
7
  margin-top: 1em;
8
  }
9
+ .rwmb-embed-media iframe {
10
  max-width: 100%;
11
  }
inc/meta-box/css/plupload-image.css DELETED
@@ -1,25 +0,0 @@
1
- div.rwmb-drag-drop {
2
- border: 4px dashed #ddd;
3
- height: 200px;
4
- }
5
-
6
- div.rwmb-image-uploading-bar {
7
- position: absolute;
8
- width: 100%;
9
- height: 0;
10
- bottom: 0;
11
- }
12
- div.rwmb-image-uploading-status {
13
- position: absolute;
14
- }
15
- li.rwmb-image-error {
16
- border: 3px solid #c00;
17
- background: #903838;
18
- }
19
- .rwmb-image-uploading-status .rwmb-loader {
20
- width: 64px;
21
- height: 64px;
22
- top: 43px;
23
- left: 43px;
24
- position: relative;
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/css/range.css CHANGED
@@ -1,4 +1,9 @@
1
- input[type='range'] {
2
- border-radius: 2px;
3
- border: 1px solid #dfdfdf;
4
- }
 
 
 
 
 
1
+ .rwmb-range.rwmb-range,
2
+ .rwmb-range.rwmb-range:hover {
3
+ vertical-align: middle;
4
+ padding: 0;
5
+ border: none;
6
+ }
7
+ .rwmb-output {
8
+ margin-left: 8px;
9
+ }
inc/meta-box/css/select-advanced.css CHANGED
@@ -1,4 +1,19 @@
1
- #post-body .rwmb-select-advanced {
2
  height: auto;
3
  min-width: 200px;
4
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-field .select2-container {
2
  height: auto;
3
  min-width: 200px;
4
+ }
5
+ #wpbody .rwmb-select-all {
6
+ display: block;
7
+ margin-top: 5px;
8
+ }
9
+ #wpbody .select2-selection--single,
10
+ #wpbody .select2-selection--multiple,
11
+ .select2-dropdown {
12
+ border-color: #ddd;
13
+ }
14
+ .select2-results__option {
15
+ margin-bottom: 0;
16
+ }
17
+ .select2-container .select2-search--inline {
18
+ margin-bottom: 0;
19
+ }
inc/meta-box/css/select-tree.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ .rwmb-select-tree {
2
+ display: inline-block;
3
+ }
4
+
5
+ .rwmb-select-tree.hidden {
6
+ display: none;
7
+ }
inc/meta-box/css/select.css CHANGED
@@ -1,4 +1,11 @@
1
- #post-body .rwmb-select {
2
- height: auto;
3
- min-width: 200px;
4
- }
 
 
 
 
 
 
 
1
+ .rwmb-select.rwmb-select {
2
+ min-width: 160px;
3
+ padding: 0;
4
+ }
5
+ .rwmb-select option {
6
+ padding: 4px 8px;
7
+ }
8
+ .rwmb-select-all-none {
9
+ display: block;
10
+ margin-top: 5px;
11
+ }
inc/meta-box/css/select2/select2-spinner.gif DELETED
Binary file
inc/meta-box/css/select2/select2.css CHANGED
@@ -1,524 +1,483 @@
1
- /*
2
- Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
3
- */
4
  .select2-container {
5
- position: relative;
6
- display: inline-block;
7
- /* inline-block for ie7 */
8
- zoom: 1;
9
- *display: inline;
10
- vertical-align: top;
11
- }
12
-
13
- .select2-container,
14
- .select2-drop,
15
- .select2-search,
16
- .select2-search input{
17
- /*
18
- Force border-box so that % widths fit the parent
19
- container without overlap because of margin/padding.
20
-
21
- More Info : http://www.quirksmode.org/css/box.html
22
- */
23
- -moz-box-sizing: border-box; /* firefox */
24
- -ms-box-sizing: border-box; /* ie */
25
- -webkit-box-sizing: border-box; /* webkit */
26
- -khtml-box-sizing: border-box; /* konqueror */
27
- box-sizing: border-box; /* css3 */
28
- }
29
-
30
- .select2-container .select2-choice {
31
- background-color: #fff;
32
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
33
- background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
34
- background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
35
- background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
36
- background-image: -ms-linear-gradient(top, #eeeeee 0%, #ffffff 50%);
37
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#ffffff', GradientType = 0);
38
- background-image: linear-gradient(top, #eeeeee 0%, #ffffff 50%);
39
- -webkit-border-radius: 4px;
40
- -moz-border-radius: 4px;
41
- border-radius: 4px;
42
- -moz-background-clip: padding;
43
- -webkit-background-clip: padding-box;
44
- background-clip: padding-box;
45
- border: 1px solid #aaa;
46
  display: block;
47
- overflow: hidden;
48
- white-space: nowrap;
49
- position: relative;
50
- height: 26px;
51
- line-height: 26px;
52
- padding: 0 0 0 8px;
53
- color: #444;
54
- text-decoration: none;
55
- }
56
-
57
- .select2-container.select2-drop-above .select2-choice
58
- {
59
- border-bottom-color: #aaa;
60
- -webkit-border-radius:0px 0px 4px 4px;
61
- -moz-border-radius:0px 0px 4px 4px;
62
- border-radius:0px 0px 4px 4px;
63
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
64
- background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
65
- background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
66
- background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
67
- background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
68
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
69
- background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
70
- }
71
-
72
- .select2-container .select2-choice span {
73
- margin-right: 26px;
74
  display: block;
75
- overflow: hidden;
76
- white-space: nowrap;
77
- -o-text-overflow: ellipsis;
78
- -ms-text-overflow: ellipsis;
79
- text-overflow: ellipsis;
80
- }
81
-
82
- .select2-container .select2-choice abbr {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  display: block;
84
  position: absolute;
85
- right: 26px;
86
- top: 8px;
87
- width: 12px;
88
- height: 12px;
89
- font-size: 1px;
90
- background: url('select2.png') right top no-repeat;
91
- cursor: pointer;
92
- text-decoration: none;
93
- border:0;
94
- outline: 0;
95
- }
96
- .select2-container .select2-choice abbr:hover {
97
- background-position: right -11px;
98
- cursor: pointer;
99
- }
100
-
101
- .select2-drop {
102
- background: #fff;
103
- color: #000;
104
- border: 1px solid #aaa;
105
- border-top: 0;
106
- position: absolute;
107
- top: 100%;
108
- -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
109
- -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
110
- -o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
111
- box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
112
- z-index: 9999;
113
- width:100%;
114
- margin-top:-1px;
115
-
116
- -webkit-border-radius: 0 0 4px 4px;
117
- -moz-border-radius: 0 0 4px 4px;
118
- border-radius: 0 0 4px 4px;
119
- }
120
-
121
- .select2-drop.select2-drop-above {
122
- -webkit-border-radius: 4px 4px 0px 0px;
123
- -moz-border-radius: 4px 4px 0px 0px;
124
- border-radius: 4px 4px 0px 0px;
125
- margin-top:1px;
126
- border-top: 1px solid #aaa;
127
- border-bottom: 0;
128
-
129
- -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
130
- -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
131
- -o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
132
- box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
133
- }
134
-
135
- .select2-container .select2-choice div {
136
- -webkit-border-radius: 0 4px 4px 0;
137
- -moz-border-radius: 0 4px 4px 0;
138
- border-radius: 0 4px 4px 0;
139
- -moz-background-clip: padding;
140
- -webkit-background-clip: padding-box;
141
- background-clip: padding-box;
142
- background: #ccc;
143
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
144
- background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
145
- background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
146
- background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
147
- background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
148
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#cccccc', endColorstr = '#eeeeee', GradientType = 0);
149
- background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
150
- border-left: 1px solid #aaa;
151
- position: absolute;
152
- right: 0;
153
- top: 0;
154
- display: block;
155
- height: 100%;
156
- width: 18px;
157
- }
158
 
159
- .select2-container .select2-choice div b {
160
- background: url('select2.png') no-repeat 0 1px;
161
- display: block;
162
- width: 100%;
163
- height: 100%;
164
- }
165
 
166
- .select2-search {
167
- display: inline-block;
168
- white-space: nowrap;
169
- z-index: 10000;
170
- min-height: 26px;
171
- width: 100%;
172
  margin: 0;
173
- padding-left: 4px;
174
- padding-right: 4px;
175
- }
 
 
 
 
 
 
 
 
176
 
177
- .select2-search-hidden {
 
 
 
 
 
 
 
 
 
 
178
  display: block;
179
- position: absolute;
180
- left: -10000px;
181
- }
182
-
183
- .select2-search input {
184
- background: #fff url('select2.png') no-repeat 100% -22px;
185
- background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
186
- background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
187
- background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
188
- background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
189
- background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
190
- background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
191
- padding: 4px 20px 4px 5px;
192
- outline: 0;
193
- border: 1px solid #aaa;
194
- font-family: sans-serif;
195
- font-size: 1em;
196
- width:100%;
197
- margin:0;
198
- height:auto !important;
199
- min-height: 26px;
200
- -webkit-box-shadow: none;
201
- -moz-box-shadow: none;
202
- box-shadow: none;
203
- border-radius: 0;
204
- -moz-border-radius: 0;
205
- -webkit-border-radius: 0;
206
- }
207
-
208
- .select2-drop.select2-drop-above .select2-search input
209
- {
210
- margin-top:4px;
211
- }
212
-
213
- .select2-search input.select2-active {
214
- background: #fff url('spinner.gif') no-repeat 100%;
215
- background: url('spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
216
- background: url('spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
217
- background: url('spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
218
- background: url('spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
219
- background: url('spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
220
- background: url('spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
221
- }
222
-
223
-
224
- .select2-container-active .select2-choice,
225
- .select2-container-active .select2-choices {
226
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
227
- -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
228
- -o-box-shadow : 0 0 5px rgba(0,0,0,.3);
229
- box-shadow : 0 0 5px rgba(0,0,0,.3);
230
- border: 1px solid #5897fb;
231
- outline: none;
232
- }
233
-
234
- .select2-dropdown-open .select2-choice {
235
  border: 1px solid #aaa;
236
- border-bottom-color: transparent;
237
- -webkit-box-shadow: 0 1px 0 #fff inset;
238
- -moz-box-shadow : 0 1px 0 #fff inset;
239
- -o-box-shadow : 0 1px 0 #fff inset;
240
- box-shadow : 0 1px 0 #fff inset;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  background-color: #eee;
242
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
243
- background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
244
- background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
245
- background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
246
- background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
247
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
248
- background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
249
- -webkit-border-bottom-left-radius : 0;
250
- -webkit-border-bottom-right-radius: 0;
251
- -moz-border-radius-bottomleft : 0;
252
- -moz-border-radius-bottomright: 0;
253
- border-bottom-left-radius : 0;
254
- border-bottom-right-radius: 0;
255
- }
256
 
257
- .select2-dropdown-open .select2-choice div {
258
- background: transparent;
259
- border-left: none;
260
- }
261
- .select2-dropdown-open .select2-choice div b {
262
- background-position: -18px 1px;
263
- }
264
 
265
- /* results */
266
- .select2-results {
267
- margin: 4px 4px 4px 0;
268
- padding: 0 0 0 4px;
269
- position: relative;
270
- overflow-x: hidden;
271
- overflow-y: auto;
272
- max-height: 200px;
273
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
 
275
- .select2-results ul.select2-result-sub {
276
- margin: 0 0 0 0;
277
- }
278
 
279
- .select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
280
- .select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
281
- .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
282
- .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
283
- .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
284
- .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
285
- .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
286
 
287
- .select2-results li {
288
- list-style: none;
289
- display: list-item;
290
- }
291
 
292
- .select2-results li.select2-result-with-children > .select2-result-label {
293
- font-weight: bold;
294
- }
295
 
296
- .select2-results .select2-result-label {
297
- padding: 3px 7px 4px;
298
- margin: 0;
299
- cursor: pointer;
300
- }
301
-
302
- .select2-results .select2-highlighted {
303
- background: #3875d7;
304
- color: #fff;
305
- }
306
- .select2-results li em {
307
- background: #feffde;
308
- font-style: normal;
309
- }
310
- .select2-results .select2-highlighted em {
 
 
 
 
311
  background: transparent;
312
- }
313
- .select2-results .select2-no-results,
314
- .select2-results .select2-searching,
315
- .select2-results .select2-selection-limit {
316
- background: #f4f4f4;
317
- display: list-item;
318
- }
319
-
320
- /*
321
- disabled look for already selected choices in the results dropdown
322
- .select2-results .select2-disabled.select2-highlighted {
323
- color: #666;
324
- background: #f4f4f4;
325
- display: list-item;
326
- cursor: default;
327
- }
328
- .select2-results .select2-disabled {
329
- background: #f4f4f4;
330
- display: list-item;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  cursor: default;
332
- }
333
- */
334
- .select2-results .select2-disabled {
335
- display: none;
336
- }
337
-
338
- .select2-more-results.select2-active {
339
- background: #f4f4f4 url('spinner.gif') no-repeat 100%;
340
- }
341
-
342
- .select2-more-results {
343
- background: #f4f4f4;
344
- display: list-item;
345
- }
346
-
347
- /* disabled styles */
348
-
349
- .select2-container.select2-container-disabled .select2-choice {
350
- background-color: #f4f4f4;
351
- background-image: none;
352
- border: 1px solid #ddd;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  cursor: default;
354
- }
355
-
356
- .select2-container.select2-container-disabled .select2-choice div {
357
- background-color: #f4f4f4;
358
- background-image: none;
359
- border-left: 0;
360
- }
361
-
362
-
363
- /* multiselect */
364
-
365
- .select2-container-multi .select2-choices {
366
- background-color: #fff;
367
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
368
- background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
369
- background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
370
- background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
371
- background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
372
- background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
373
- border: 1px solid #aaa;
374
- margin: 0;
375
- padding: 0;
376
- cursor: text;
377
- overflow: hidden;
378
- height: auto !important;
379
- height: 1%;
380
- position: relative;
381
- }
382
-
383
- .select2-container-multi .select2-choices {
384
- min-height: 26px;
385
- }
386
-
387
- .select2-container-multi.select2-container-active .select2-choices {
388
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
389
- -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
390
- -o-box-shadow : 0 0 5px rgba(0,0,0,.3);
391
- box-shadow : 0 0 5px rgba(0,0,0,.3);
392
- border: 1px solid #5897fb;
393
- outline: none;
394
- }
395
- .select2-container-multi .select2-choices li {
396
- float: left;
397
- list-style: none;
398
- }
399
- .select2-container-multi .select2-choices .select2-search-field {
400
- white-space: nowrap;
401
- margin: 0;
402
- padding: 0;
403
- }
404
 
405
- .select2-container-multi .select2-choices .select2-search-field input {
406
- color: #666;
407
- background: transparent !important;
408
- font-family: sans-serif;
409
- font-size: 100%;
410
- height: auto;
411
- padding: 5px;
412
- margin: 1px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  outline: 0;
414
- border: 0;
415
- -webkit-box-shadow: none;
416
- -moz-box-shadow : none;
417
- -o-box-shadow : none;
418
- box-shadow : none;
419
- }
420
-
421
- .select2-container-multi .select2-choices .select2-search-field input.select2-active {
422
- background: #fff url('spinner.gif') no-repeat 100% !important;
423
- }
424
-
425
- .select2-default {
426
- color: #999 !important;
427
- }
428
-
429
- .select2-container-multi .select2-choices .select2-search-choice {
430
- -webkit-border-radius: 3px;
431
- -moz-border-radius : 3px;
432
- border-radius : 3px;
433
- -moz-background-clip : padding;
434
- -webkit-background-clip: padding-box;
435
- background-clip : padding-box;
436
- background-color: #e4e4e4;
437
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
438
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
439
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
440
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
441
- background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
442
- background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
443
- background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
444
- -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
445
- -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
446
- box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
447
- color: #333;
448
- border: 1px solid #aaaaaa;
449
- line-height: 13px;
450
- padding: 3px 5px 3px 18px;
451
- margin: 3px 0 3px 5px;
452
- position: relative;
453
- cursor: default;
454
- }
455
- .select2-container-multi .select2-choices .select2-search-choice span {
456
- cursor: default;
457
- }
458
- .select2-container-multi .select2-choices .select2-search-choice-focus {
459
- background: #d4d4d4;
460
- }
461
 
462
- .select2-search-choice-close {
 
 
 
 
 
 
 
 
463
  display: block;
464
- position: absolute;
465
- right: 3px;
466
- top: 4px;
467
- width: 12px;
468
- height: 13px;
469
- font-size: 1px;
470
- background: url('select2.png') right top no-repeat;
471
- outline: none;
472
- }
473
-
474
- .select2-container-multi .select2-search-choice-close {
475
- left: 3px;
476
- }
477
-
478
-
479
- .select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
480
- background-position: right -11px;
481
- }
482
- .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
483
- background-position: right -11px;
484
- }
485
-
486
- /* disabled styles */
487
-
488
- .select2-container-multi.select2-container-disabled .select2-choices{
489
- background-color: #f4f4f4;
490
- background-image: none;
491
- border: 1px solid #ddd;
492
- cursor: default;
493
- }
494
-
495
- .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
496
- background-image: none;
497
- background-color: #f4f4f4;
498
- border: 1px solid #ddd;
499
- padding: 3px 5px 3px 5px;
500
- }
501
-
502
- .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
503
- display: none;
504
- }
505
- /* end multiselect */
506
-
507
- .select2-result-selectable .select2-match,
508
- .select2-result-unselectable .select2-result-selectable .select2-match { text-decoration: underline; }
509
- .select2-result-unselectable .select2-match { text-decoration: none; }
510
-
511
- .select2-offscreen { position: absolute; left: -10000px; }
512
-
513
- /* Retina-ize icons */
514
-
515
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
516
- .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
517
- background-image: url(select2x2.png) !important;
518
- background-repeat: no-repeat !important;
519
- background-size: 60px 40px !important;
520
- }
521
- .select2-search input {
522
- background-position: 100% -21px !important;
523
- }
524
- }
 
 
 
1
  .select2-container {
2
+ box-sizing: border-box;
3
+ display: inline-block;
4
+ margin: 0;
5
+ position: relative;
6
+ vertical-align: middle;
7
+ }
8
+ .select2-container .select2-selection--single {
9
+ box-sizing: border-box;
10
+ cursor: pointer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  display: block;
12
+ height: 28px;
13
+ user-select: none;
14
+ -webkit-user-select: none; }
15
+ .select2-container .select2-selection--single .select2-selection__rendered {
16
+ display: block;
17
+ padding-left: 8px;
18
+ padding-right: 20px;
19
+ overflow: hidden;
20
+ text-overflow: ellipsis;
21
+ white-space: nowrap; }
22
+ .select2-container .select2-selection--single .select2-selection__clear {
23
+ position: relative; }
24
+ .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
25
+ padding-right: 8px;
26
+ padding-left: 20px; }
27
+ .select2-container .select2-selection--multiple {
28
+ box-sizing: border-box;
29
+ cursor: pointer;
 
 
 
 
 
 
 
 
 
30
  display: block;
31
+ min-height: 32px;
32
+ user-select: none;
33
+ -webkit-user-select: none; }
34
+ .select2-container .select2-selection--multiple .select2-selection__rendered {
35
+ /*display: inline-block;*/
36
+ overflow: hidden;
37
+ padding-left: 8px;
38
+ text-overflow: ellipsis;
39
+ white-space: nowrap; }
40
+ .select2-container .select2-search--inline {
41
+ float: left; }
42
+ .select2-container .select2-search--inline .select2-search__field {
43
+ box-sizing: border-box;
44
+ border: none;
45
+ font-size: 100%;
46
+ margin-top: 5px;
47
+ padding: 0; }
48
+ .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
49
+ -webkit-appearance: none; }
50
+
51
+ .select2-dropdown {
52
+ background-color: white;
53
+ border: 1px solid #aaa;
54
+ border-radius: 4px;
55
+ box-sizing: border-box;
56
  display: block;
57
  position: absolute;
58
+ left: -100000px;
59
+ width: 100%;
60
+ z-index: 1051; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ .select2-results {
63
+ display: block; }
 
 
 
 
64
 
65
+ .select2-results__options {
66
+ list-style: none;
 
 
 
 
67
  margin: 0;
68
+ padding: 0; }
69
+
70
+ .select2-results__option {
71
+ padding: 6px;
72
+ user-select: none;
73
+ -webkit-user-select: none; }
74
+ .select2-results__option[aria-selected] {
75
+ cursor: pointer; }
76
+
77
+ .select2-container--open .select2-dropdown {
78
+ left: 0; }
79
 
80
+ .select2-container--open .select2-dropdown--above {
81
+ border-bottom: none;
82
+ border-bottom-left-radius: 0;
83
+ border-bottom-right-radius: 0; }
84
+
85
+ .select2-container--open .select2-dropdown--below {
86
+ border-top: none;
87
+ border-top-left-radius: 0;
88
+ border-top-right-radius: 0; }
89
+
90
+ .select2-search--dropdown {
91
  display: block;
92
+ padding: 4px; }
93
+ .select2-search--dropdown .select2-search__field {
94
+ padding: 4px;
95
+ width: 100%;
96
+ box-sizing: border-box; }
97
+ .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
98
+ -webkit-appearance: none; }
99
+ .select2-search--dropdown.select2-search--hide {
100
+ display: none; }
101
+
102
+ .select2-close-mask {
103
+ border: 0;
104
+ margin: 0;
105
+ padding: 0;
106
+ display: block;
107
+ position: fixed;
108
+ left: 0;
109
+ top: 0;
110
+ min-height: 100%;
111
+ min-width: 100%;
112
+ height: auto;
113
+ width: auto;
114
+ opacity: 0;
115
+ z-index: 99;
116
+ background-color: #fff;
117
+ filter: alpha(opacity=0); }
118
+
119
+ .select2-hidden-accessible {
120
+ border: 0 !important;
121
+ clip: rect(0 0 0 0) !important;
122
+ height: 1px !important;
123
+ margin: -1px !important;
124
+ overflow: hidden !important;
125
+ padding: 0 !important;
126
+ position: absolute !important;
127
+ width: 1px !important; }
128
+
129
+ .select2-container--default .select2-selection--single {
130
+ background-color: #fff;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  border: 1px solid #aaa;
132
+ border-radius: 4px; }
133
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
134
+ color: #444;
135
+ line-height: 28px; }
136
+ .select2-container--default .select2-selection--single .select2-selection__clear {
137
+ cursor: pointer;
138
+ float: right;
139
+ font-weight: bold; }
140
+ .select2-container--default .select2-selection--single .select2-selection__placeholder {
141
+ color: #999; }
142
+ .select2-container--default .select2-selection--single .select2-selection__arrow {
143
+ height: 26px;
144
+ position: absolute;
145
+ top: 1px;
146
+ right: 1px;
147
+ width: 20px; }
148
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
149
+ border-color: #888 transparent transparent transparent;
150
+ border-style: solid;
151
+ border-width: 5px 4px 0 4px;
152
+ height: 0;
153
+ left: 50%;
154
+ margin-left: -4px;
155
+ margin-top: -2px;
156
+ position: absolute;
157
+ top: 50%;
158
+ width: 0; }
159
+
160
+ .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
161
+ float: left; }
162
+
163
+ .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
164
+ left: 1px;
165
+ right: auto; }
166
+
167
+ .select2-container--default.select2-container--disabled .select2-selection--single {
168
  background-color: #eee;
169
+ cursor: default; }
170
+ .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
171
+ display: none; }
 
 
 
 
 
 
 
 
 
 
 
172
 
173
+ .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
174
+ border-color: transparent transparent #888 transparent;
175
+ border-width: 0 4px 5px 4px; }
 
 
 
 
176
 
177
+ .select2-container--default .select2-selection--multiple {
178
+ background-color: white;
179
+ border: 1px solid #aaa;
180
+ border-radius: 4px;
181
+ cursor: text; }
182
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered {
183
+ box-sizing: border-box;
184
+ list-style: none;
185
+ margin: 0;
186
+ padding: 0 5px;
187
+ width: 100%; }
188
+ .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
189
+ color: #999;
190
+ margin-top: 5px;
191
+ float: left; }
192
+ .select2-container--default .select2-selection--multiple .select2-selection__clear {
193
+ cursor: pointer;
194
+ float: right;
195
+ font-weight: bold;
196
+ margin-top: 5px;
197
+ margin-right: 10px; }
198
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
199
+ background-color: #e4e4e4;
200
+ border: 1px solid #aaa;
201
+ border-radius: 4px;
202
+ cursor: default;
203
+ float: left;
204
+ margin-right: 5px;
205
+ margin-top: 5px;
206
+ padding: 0 5px; }
207
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
208
+ color: #999;
209
+ cursor: pointer;
210
+ display: inline-block;
211
+ font-weight: bold;
212
+ margin-right: 2px; }
213
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
214
+ color: #333; }
215
 
216
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
217
+ float: right; }
 
218
 
219
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
220
+ margin-left: 5px;
221
+ margin-right: auto; }
 
 
 
 
222
 
223
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
224
+ margin-left: 2px;
225
+ margin-right: auto; }
 
226
 
227
+ .select2-container--default.select2-container--focus .select2-selection--multiple {
228
+ border: solid black 1px;
229
+ outline: 0; }
230
 
231
+ .select2-container--default.select2-container--disabled .select2-selection--multiple {
232
+ background-color: #eee;
233
+ cursor: default; }
234
+
235
+ .select2-container--default.select2-container--disabled .select2-selection__choice__remove {
236
+ display: none; }
237
+
238
+ .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
239
+ border-top-left-radius: 0;
240
+ border-top-right-radius: 0; }
241
+
242
+ .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
243
+ border-bottom-left-radius: 0;
244
+ border-bottom-right-radius: 0; }
245
+
246
+ .select2-container--default .select2-search--dropdown .select2-search__field {
247
+ border: 1px solid #aaa; }
248
+
249
+ .select2-container--default .select2-search--inline .select2-search__field {
250
  background: transparent;
251
+ border: none;
252
+ outline: 0;
253
+ box-shadow: none;
254
+ -webkit-appearance: textfield; }
255
+
256
+ .select2-container--default .select2-results > .select2-results__options {
257
+ max-height: 200px;
258
+ overflow-y: auto; }
259
+
260
+ .select2-container--default .select2-results__option[role=group] {
261
+ padding: 0; }
262
+
263
+ .select2-container--default .select2-results__option[aria-disabled=true] {
264
+ color: #999; }
265
+
266
+ .select2-container--default .select2-results__option[aria-selected=true] {
267
+ background-color: #ddd; }
268
+
269
+ .select2-container--default .select2-results__option .select2-results__option {
270
+ padding-left: 1em; }
271
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
272
+ padding-left: 0; }
273
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
274
+ margin-left: -1em;
275
+ padding-left: 2em; }
276
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
277
+ margin-left: -2em;
278
+ padding-left: 3em; }
279
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
280
+ margin-left: -3em;
281
+ padding-left: 4em; }
282
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
283
+ margin-left: -4em;
284
+ padding-left: 5em; }
285
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
286
+ margin-left: -5em;
287
+ padding-left: 6em; }
288
+
289
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
290
+ background-color: #5897fb;
291
+ color: white; }
292
+
293
+ .select2-container--default .select2-results__group {
294
  cursor: default;
295
+ display: block;
296
+ padding: 6px; }
297
+
298
+ .select2-container--classic .select2-selection--single {
299
+ background-color: #f7f7f7;
300
+ border: 1px solid #aaa;
301
+ border-radius: 4px;
302
+ outline: 0;
303
+ background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
304
+ background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
305
+ background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
306
+ background-repeat: repeat-x;
307
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
308
+ .select2-container--classic .select2-selection--single:focus {
309
+ border: 1px solid #5897fb; }
310
+ .select2-container--classic .select2-selection--single .select2-selection__rendered {
311
+ color: #444;
312
+ line-height: 28px; }
313
+ .select2-container--classic .select2-selection--single .select2-selection__clear {
314
+ cursor: pointer;
315
+ float: right;
316
+ font-weight: bold;
317
+ margin-right: 10px; }
318
+ .select2-container--classic .select2-selection--single .select2-selection__placeholder {
319
+ color: #999; }
320
+ .select2-container--classic .select2-selection--single .select2-selection__arrow {
321
+ background-color: #ddd;
322
+ border: none;
323
+ border-left: 1px solid #aaa;
324
+ border-top-right-radius: 4px;
325
+ border-bottom-right-radius: 4px;
326
+ height: 26px;
327
+ position: absolute;
328
+ top: 1px;
329
+ right: 1px;
330
+ width: 20px;
331
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
332
+ background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
333
+ background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
334
+ background-repeat: repeat-x;
335
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
336
+ .select2-container--classic .select2-selection--single .select2-selection__arrow b {
337
+ border-color: #888 transparent transparent transparent;
338
+ border-style: solid;
339
+ border-width: 5px 4px 0 4px;
340
+ height: 0;
341
+ left: 50%;
342
+ margin-left: -4px;
343
+ margin-top: -2px;
344
+ position: absolute;
345
+ top: 50%;
346
+ width: 0; }
347
+
348
+ .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
349
+ float: left; }
350
+
351
+ .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
352
+ border: none;
353
+ border-right: 1px solid #aaa;
354
+ border-radius: 0;
355
+ border-top-left-radius: 4px;
356
+ border-bottom-left-radius: 4px;
357
+ left: 1px;
358
+ right: auto; }
359
+
360
+ .select2-container--classic.select2-container--open .select2-selection--single {
361
+ border: 1px solid #5897fb; }
362
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
363
+ background: transparent;
364
+ border: none; }
365
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
366
+ border-color: transparent transparent #888 transparent;
367
+ border-width: 0 4px 5px 4px; }
368
+
369
+ .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
370
+ border-top: none;
371
+ border-top-left-radius: 0;
372
+ border-top-right-radius: 0;
373
+ background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
374
+ background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
375
+ background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
376
+ background-repeat: repeat-x;
377
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
378
+
379
+ .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
380
+ border-bottom: none;
381
+ border-bottom-left-radius: 0;
382
+ border-bottom-right-radius: 0;
383
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
384
+ background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
385
+ background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
386
+ background-repeat: repeat-x;
387
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
388
+
389
+ .select2-container--classic .select2-selection--multiple {
390
+ background-color: white;
391
+ border: 1px solid #aaa;
392
+ border-radius: 4px;
393
+ cursor: text;
394
+ outline: 0; }
395
+ .select2-container--classic .select2-selection--multiple:focus {
396
+ border: 1px solid #5897fb; }
397
+ .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
398
+ list-style: none;
399
+ margin: 0;
400
+ padding: 0 5px; }
401
+ .select2-container--classic .select2-selection--multiple .select2-selection__clear {
402
+ display: none; }
403
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice {
404
+ background-color: #e4e4e4;
405
+ border: 1px solid #aaa;
406
+ border-radius: 4px;
407
  cursor: default;
408
+ float: left;
409
+ margin-right: 5px;
410
+ margin-top: 5px;
411
+ padding: 0 5px; }
412
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
413
+ color: #888;
414
+ cursor: pointer;
415
+ display: inline-block;
416
+ font-weight: bold;
417
+ margin-right: 2px; }
418
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
419
+ color: #555; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
+ .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
422
+ float: right; }
423
+
424
+ .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
425
+ margin-left: 5px;
426
+ margin-right: auto; }
427
+
428
+ .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
429
+ margin-left: 2px;
430
+ margin-right: auto; }
431
+
432
+ .select2-container--classic.select2-container--open .select2-selection--multiple {
433
+ border: 1px solid #5897fb; }
434
+
435
+ .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
436
+ border-top: none;
437
+ border-top-left-radius: 0;
438
+ border-top-right-radius: 0; }
439
+
440
+ .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
441
+ border-bottom: none;
442
+ border-bottom-left-radius: 0;
443
+ border-bottom-right-radius: 0; }
444
+
445
+ .select2-container--classic .select2-search--dropdown .select2-search__field {
446
+ border: 1px solid #aaa;
447
+ outline: 0; }
448
+
449
+ .select2-container--classic .select2-search--inline .select2-search__field {
450
  outline: 0;
451
+ box-shadow: none; }
452
+
453
+ .select2-container--classic .select2-dropdown {
454
+ background-color: white;
455
+ border: 1px solid transparent; }
456
+
457
+ .select2-container--classic .select2-dropdown--above {
458
+ border-bottom: none; }
459
+
460
+ .select2-container--classic .select2-dropdown--below {
461
+ border-top: none; }
462
+
463
+ .select2-container--classic .select2-results > .select2-results__options {
464
+ max-height: 200px;
465
+ overflow-y: auto; }
466
+
467
+ .select2-container--classic .select2-results__option[role=group] {
468
+ padding: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
 
470
+ .select2-container--classic .select2-results__option[aria-disabled=true] {
471
+ color: grey; }
472
+
473
+ .select2-container--classic .select2-results__option--highlighted[aria-selected] {
474
+ background-color: #3875d7;
475
+ color: white; }
476
+
477
+ .select2-container--classic .select2-results__group {
478
+ cursor: default;
479
  display: block;
480
+ padding: 6px; }
481
+
482
+ .select2-container--classic.select2-container--open .select2-dropdown {
483
+ border-color: #5897fb; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/css/select2/select2.png DELETED
Binary file
inc/meta-box/css/select2/select2x2.png DELETED
Binary file
inc/meta-box/css/select2/spinner.gif DELETED
Binary file
inc/meta-box/css/style-rtl.css ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-label, .rwmb-input{
2
+ float: right;
3
+ }
4
+ label.error{
5
+ padding-left: auto;
6
+ padding-right: 3px;
7
+ }
8
+ .rwmb-button.remove-clone {
9
+ right: auto;
10
+ left: 0;
11
+ }
inc/meta-box/css/style.css CHANGED
@@ -1,20 +1,35 @@
1
- /* =Styles for 'normal' meta boxes
2
  -------------------------------------------------------------- */
3
 
4
- .rwmb-field {
5
- margin: 0 0 10px;
 
 
 
 
 
 
 
 
 
 
 
6
  }
7
  .rwmb-label,
8
  .rwmb-input {
9
- display: inline-block;
10
  vertical-align: top;
 
11
  }
12
  .rwmb-label {
13
- width: 24%;
14
  }
15
- .rwmb-label.required > span {
16
- color: #c00;
 
 
 
17
  font-weight: bold;
 
18
  }
19
 
20
  /* 75% if field has label, 100% if no label */
@@ -34,44 +49,95 @@
34
  /* Clone */
35
  .rwmb-clone {
36
  min-height: 24px;
37
- margin-bottom: 5px;
38
  position: relative;
 
 
39
  }
40
  .rwmb-clone > input[type='radio'],
41
  .rwmb-clone > input[type='checkbox'] {
42
  margin: 6px 0 0 4px;
43
  }
44
- .rwmb-button {
45
- float: right;
46
- }
47
  .rwmb-button.remove-clone {
 
 
 
 
 
48
  position: absolute;
49
  top: 0;
50
  right: 0;
51
  }
52
-
53
- /* Fix empty block below admin footer (issue #24) */
54
- #ui-datepicker-div {
55
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
  /* jQuery validation */
59
- label.error {
60
- padding-left: 3px;
61
- color: red;
62
  }
63
- input.error,
64
- textarea.error,
65
- select.error {
66
- border: #c00 solid 1px !important;
67
- background: #ffebe8 !important;
 
 
 
 
 
 
 
 
68
  }
69
 
70
 
71
- /* =Styles for 'side' meta boxes
72
  -------------------------------------------------------------- */
73
 
74
  #side-sortables .rwmb-label,
75
  #side-sortables .rwmb-input {
76
  width: 100%;
77
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Styles for 'normal' meta boxes
2
  -------------------------------------------------------------- */
3
 
4
+ /* Clearfix for field */
5
+ .rwmb-field:before,
6
+ .rwmb-field:after {
7
+ content: " ";
8
+ display: table;
9
+ }
10
+ .rwmb-field:after {
11
+ clear: both;
12
+ }
13
+ .rwmb-field:not(:last-of-type) {
14
+ *zoom: 1;
15
+
16
+ margin: 0 0 12px;
17
  }
18
  .rwmb-label,
19
  .rwmb-input {
 
20
  vertical-align: top;
21
+ float: left;
22
  }
23
  .rwmb-label {
24
+ width: 25%;
25
  }
26
+ .rwmb-label > label {
27
+ font-weight: 600;
28
+ }
29
+ .rwmb-required {
30
+ color: #dc3232;
31
  font-weight: bold;
32
+ margin-left: 3px;
33
  }
34
 
35
  /* 75% if field has label, 100% if no label */
49
  /* Clone */
50
  .rwmb-clone {
51
  min-height: 24px;
52
+ margin-bottom: 12px;
53
  position: relative;
54
+ clear: both;
55
+ background: #fff;
56
  }
57
  .rwmb-clone > input[type='radio'],
58
  .rwmb-clone > input[type='checkbox'] {
59
  margin: 6px 0 0 4px;
60
  }
 
 
 
61
  .rwmb-button.remove-clone {
62
+ text-decoration: none;
63
+ color: #fff;
64
+ background: #e74c3c;
65
+ border-radius: 50%;
66
+ display: inline-block;
67
  position: absolute;
68
  top: 0;
69
  right: 0;
70
  }
71
+ .rwmb-button.remove-clone .dashicons {
72
+ font-size: 14px;
73
+ line-height: 20px;
74
+ }
75
+ .remove-clone:focus {
76
+ outline: 0;
77
+ box-shadow: none;
78
+ }
79
+ .rwmb-button.add-clone {
80
+ margin-top: 5px;
81
+ }
82
+ .rwmb-clone-icon {
83
+ cursor: move;
84
+ background: url(../img/drag_icon.gif) no-repeat;
85
+ height: 23px;
86
+ width: 15px;
87
+ vertical-align: top;
88
+ display: inline-block;
89
+ position: absolute;
90
+ left: 0;
91
+ top: 0;
92
+ }
93
+ .rwmb-sort-clone {
94
+ padding-left: 15px;
95
  }
96
 
97
  /* jQuery validation */
98
+ p.rwmb-error {
99
+ color: #dc3232;
100
+ margin: 2px 0 5px;
101
  }
102
+ input.rwmb-error.rwmb-error,
103
+ textarea.rwmb-error,
104
+ select.rwmb-error {
105
+ border-color: #dc3232;
106
+ background: #ffebe8;
107
+ }
108
+
109
+ /* Utilities
110
+ -------------------------------------------------------------- */
111
+ .rwmb-sortable-placeholder {
112
+ background: #fcf8e3;
113
+ border: 1px solid #faebcc;
114
+ display: block;
115
  }
116
 
117
 
118
+ /* Styles for 'side' meta boxes
119
  -------------------------------------------------------------- */
120
 
121
  #side-sortables .rwmb-label,
122
  #side-sortables .rwmb-input {
123
  width: 100%;
124
+ }
125
+
126
+ /* Seamless style
127
+ --------------------------------------------------------------*/
128
+ .rwmb-seamless {
129
+ background: none;
130
+ border: none;
131
+ box-shadow: none;
132
+ }
133
+ .rwmb-seamless .inside {
134
+ padding-left: 0;
135
+ padding-right: 0;
136
+ }
137
+ .postbox.rwmb-seamless .hndle,
138
+ .postbox.rwmb-seamless .handlediv {
139
+ display: none;
140
+ }
141
+ .rwmb-seamless .rwmb-clone {
142
+ background: none;
143
+ }
inc/meta-box/css/switch.css ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* style switch
2
+ -----------------------------*/
3
+ .rwmb-switch-label {
4
+ position: relative;
5
+ display: inline-block;
6
+ background-color: #ccc;
7
+ padding: 2px;
8
+ border-radius: 3px;
9
+ min-width: 40px;
10
+ height: 22px;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ .rwmb-switch.rwmb-switch {
15
+ display: none;
16
+ }
17
+
18
+ .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider {
19
+ background-color: #0073aa;
20
+ box-shadow: 0 0 1px #0073aa;
21
+ }
22
+
23
+ .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider:before {
24
+ left: calc(100% - 20px);
25
+ }
26
+
27
+ .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-off {
28
+ visibility: hidden;
29
+ display: none;
30
+ }
31
+
32
+ .rwmb-switch:not(:checked) + .rwmb-switch-status .rwmb-switch-on {
33
+ visibility: hidden;
34
+ display: none;
35
+ }
36
+
37
+ .rwmb-switch-slider {
38
+ position: absolute;
39
+ cursor: pointer;
40
+ top: 0;
41
+ left: 0;
42
+ right: 0;
43
+ bottom: 0;
44
+ z-index: 15;
45
+ -webkit-transition: .4s;
46
+ transition: .4s;
47
+ }
48
+
49
+ .rwmb-switch-slider:before {
50
+ position: absolute;
51
+ content: attr(title-before) "";
52
+ height: 18px;
53
+ width: 18px;
54
+ left: 2px;
55
+ bottom: 2px;
56
+ z-index: 99;
57
+ background-color: white;
58
+ -webkit-transition: .4s;
59
+ transition: .4s;
60
+ border-radius: 2px;
61
+ }
62
+
63
+ .rwmb-switch-label--square .rwmb-switch-slider {
64
+ border-radius: 3px;
65
+ }
66
+
67
+ .rwmb-switch-label--rounded,
68
+ .rwmb-switch-label--rounded .rwmb-switch-slider {
69
+ border-radius: 34px;
70
+ }
71
+
72
+ .rwmb-switch-label--rounded .rwmb-switch-slider:before {
73
+ border-radius: 50%;
74
+ }
75
+
76
+ .rwmb-switch-on,
77
+ .rwmb-switch-off {
78
+ display: inline-block;
79
+ float: left;
80
+ margin: 0 4px;
81
+ color: #fff;
82
+ text-transform: uppercase;
83
+ font-size: 11px;
84
+ position: relative;
85
+ z-index: 20;
86
+ }
87
+
88
+ .rwmb-switch-on {
89
+ padding-right: 20px;
90
+ }
91
+
92
+ .rwmb-switch-off {
93
+ padding-left: 20px;
94
+ }
inc/meta-box/css/taxonomy.css DELETED
@@ -1,10 +0,0 @@
1
- .rw-taxonomy-tree {
2
- margin-left: 15px;
3
- margin-top: 5px;
4
- }
5
- .rw-taxonomy-tree.active {
6
- display: inline-block;
7
- }
8
- .rw-taxonomy-tree.disabled {
9
- display: none;
10
- }
 
 
 
 
 
 
 
 
 
 
inc/meta-box/css/text-list.css ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-text_list-non-cloneable > .rwmb-input,
2
+ .rwmb-text_list-clone {
3
+ display: flex;
4
+ flex-wrap: wrap;
5
+ }
6
+ .rwmb-text_list-non-cloneable > .rwmb-input > label,
7
+ .rwmb-text_list-clone > label {
8
+ margin: 0 10px 10px 0;
9
+ }
10
+ .rwmb-text_list-non-cloneable > .rwmb-input > label:last-child,
11
+ .rwmb-text_list-clone > label:last-child {
12
+ margin-right: 0;
13
+ }
14
+
15
+ .rwmb-text-list-label {
16
+ font-weight: 600;
17
+ display: block;
18
+ margin-bottom: 5px;
19
+ }
inc/meta-box/css/upload.css ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-upload-area {
2
+ position: relative;
3
+ padding-top: 0;
4
+ margin-top: 0;
5
+ height: 200px;
6
+ border: 4px dashed #ddd;
7
+ }
8
+ /* Fix blank space in the footer */
9
+ .rwmb-upload-area .moxie-shim {
10
+ display: none;
11
+ }
12
+ .rwmb-upload-inside {
13
+ text-align: center;
14
+ position: absolute;
15
+ left: 0;
16
+ right: 0;
17
+ top: 50%;
18
+ transform: translateY(-50%);
19
+ -webkit-transform: translateY(-50%);
20
+ -moz-transform: translateY(-50%);
21
+ -ms-transform: translateY(-50%);
22
+ margin-top: 10px;
23
+ }
24
+ .rwmb-upload-inside p, .rwmb-upload-inside h3 {
25
+ text-align: center;
26
+ }
27
+ .rwmb-upload-inside h3 {
28
+ font-size: 20px;
29
+ line-height: 28px;
30
+ font-weight: 400;
31
+ margin: 0;
32
+ }
inc/meta-box/css/video.css ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Video */
2
+ .rwmb-video-item {
3
+ position: relative;
4
+ float: left;
5
+ padding: 0;
6
+ margin: 0 5px 5px 0;
7
+ box-sizing: border-box;
8
+ width: 300px;
9
+ }
10
+
11
+ .rwmb-video-item .rwmb-media-preview {
12
+ width: 100%;
13
+ float: none;
14
+ background: #EEE;
15
+ }
16
+
17
+ .rwmb-video-item video {
18
+ width: auto;
19
+ height: 100%;
20
+ }
21
+
22
+ .rwmb-video-item .rwmb-media-info {
23
+ margin-left: 0;
24
+ padding: 10px;
25
+ }
inc/meta-box/css/wysiwyg.css CHANGED
@@ -1,3 +1,6 @@
1
  .rwmb-field .mceIframeContainer {
2
  background: #fff;
3
- }
 
 
 
1
  .rwmb-field .mceIframeContainer {
2
  background: #fff;
3
+ }
4
+ .rwmb-wysiwyg-clone {
5
+ padding-top: 20px;
6
+ }
inc/meta-box/img/drag_icon.gif ADDED
Binary file
inc/meta-box/img/loader.gif DELETED
Binary file
inc/meta-box/inc/about/about.php ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Add about page for the Meta Box plugin.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * About page class.
10
+ */
11
+ class RWMB_About {
12
+ /**
13
+ * Plugin data.
14
+ *
15
+ * @var array
16
+ */
17
+ protected $plugin;
18
+
19
+ /**
20
+ * Init hooks.
21
+ */
22
+ public function init() {
23
+ if ( ! function_exists( 'get_plugin_data' ) ) {
24
+ include ABSPATH . 'wp-admin/includes/plugin.php';
25
+ }
26
+ $this->plugin = get_plugin_data( RWMB_DIR . 'meta-box.php' );
27
+
28
+ // Add links to about page in the plugin action links.
29
+ add_filter( 'plugin_action_links_meta-box/meta-box.php', array( $this, 'plugin_links' ) );
30
+
31
+ // Add a shared top-level admin menu and Dashboard page. Use priority 5 to show Dashboard at the top.
32
+ add_action( 'admin_menu', array( $this, 'add_menu' ), 5 );
33
+ add_action( 'admin_menu', array( $this, 'add_submenu' ), 5 );
34
+
35
+ // If no admin menu, then hide the About page.
36
+ add_action( 'admin_head', array( $this, 'hide_page' ) );
37
+
38
+ // Redirect to about page after activation.
39
+ add_action( 'activated_plugin', array( $this, 'redirect' ), 10, 2 );
40
+ }
41
+
42
+ /**
43
+ * Add links to About page.
44
+ *
45
+ * @param array $links Array of plugin links.
46
+ *
47
+ * @return array
48
+ */
49
+ public function plugin_links( $links ) {
50
+ $links[] = '<a href="' . esc_url( $this->get_menu_link() ) . '">' . esc_html__( 'About', 'meta-box' ) . '</a>';
51
+ return $links;
52
+ }
53
+
54
+ /**
55
+ * Register admin page.
56
+ */
57
+ public function add_menu() {
58
+ if ( ! $this->has_menu() ) {
59
+ return;
60
+ }
61
+ add_menu_page(
62
+ __( 'Meta Box', 'meta-box' ),
63
+ __( 'Meta Box', 'meta-box' ),
64
+ 'activate_plugins',
65
+ 'meta-box',
66
+ '__return_null',
67
+ 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIxNjQuMzI4IDE0OS40NDEgNTMuNDcgNDIuNjYiIHdpZHRoPSI1My40NyIgaGVpZ2h0PSI0Mi42NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNIDIwNC42NjggMTc5LjM5MSBMIDIwNS40ODggMTYwLjU1MSBMIDIwNS4zMTggMTYwLjUyMSBMIDE5My44ODggMTkyLjEwMSBMIDE4OC4xNDggMTkyLjEwMSBMIDE3Ni43NzggMTYwLjY0MSBMIDE3Ni42MDggMTYwLjY2MSBMIDE3Ny40MjggMTc5LjM5MSBMIDE3Ny40MjggMTg2LjA5MSBMIDE4MS45OTggMTg2Ljk3MSBMIDE4MS45OTggMTkyLjEwMSBMIDE2NC4zMjggMTkyLjEwMSBMIDE2NC4zMjggMTg2Ljk3MSBMIDE2OC44NjggMTg2LjA5MSBMIDE2OC44NjggMTU1LjQ4MSBMIDE2NC4zMjggMTU0LjYwMSBMIDE2NC4zMjggMTQ5LjQ0MSBMIDE2OC44NjggMTQ5LjQ0MSBMIDE4MC4wMjggMTQ5LjQ0MSBMIDE5MC44OTggMTgwLjg4MSBMIDE5MS4wNzggMTgwLjg4MSBMIDIwMi4wMzggMTQ5LjQ0MSBMIDIxNy43OTggMTQ5LjQ0MSBMIDIxNy43OTggMTU0LjYwMSBMIDIxMy4yMjggMTU1LjQ4MSBMIDIxMy4yMjggMTg2LjA5MSBMIDIxNy43OTggMTg2Ljk3MSBMIDIxNy43OTggMTkyLjEwMSBMIDIwMC4xMjggMTkyLjEwMSBMIDIwMC4xMjggMTg2Ljk3MSBMIDIwNC42NjggMTg2LjA5MSBMIDIwNC42NjggMTc5LjM5MSBaIiBzdHlsZT0iZmlsbDogcmdiKDE1OCwgMTYzLCAxNjgpOyB3aGl0ZS1zcGFjZTogcHJlOyIvPgo8L3N2Zz4='
68
+ );
69
+ }
70
+
71
+ /**
72
+ * Add submenu for the About page.
73
+ */
74
+ public function add_submenu() {
75
+ $parent_menu = $this->has_menu() ? 'meta-box' : $this->get_parent_menu();
76
+ $about = add_submenu_page(
77
+ $parent_menu,
78
+ __( 'Welcome to Meta Box', 'meta-box' ),
79
+ __( 'Dashboard', 'meta-box' ),
80
+ 'activate_plugins',
81
+ 'meta-box',
82
+ array( $this, 'render' )
83
+ );
84
+ add_action( "load-$about", array( $this, 'load_about' ) );
85
+ }
86
+
87
+ /**
88
+ * Functions and hooks for about page.
89
+ */
90
+ public function load_about() {
91
+ $this->enqueue();
92
+ add_filter( 'admin_footer_text', array( $this, 'change_footer_text' ) );
93
+ }
94
+
95
+ /**
96
+ * Hide about page from the admin menu.
97
+ */
98
+ public function hide_page() {
99
+ remove_submenu_page( $this->get_parent_menu(), 'meta-box' );
100
+ }
101
+
102
+ /**
103
+ * Render admin page.
104
+ */
105
+ public function render() {
106
+ ?>
107
+ <div class="wrap">
108
+ <div id="poststuff">
109
+ <div id="post-body" class="metabox-holder columns-2">
110
+ <div id="post-body-content">
111
+ <div class="about-wrap">
112
+ <?php
113
+ include dirname( __FILE__ ) . '/sections/welcome.php';
114
+ include dirname( __FILE__ ) . '/sections/tabs.php';
115
+ include dirname( __FILE__ ) . '/sections/getting-started.php';
116
+ include dirname( __FILE__ ) . '/sections/extensions.php';
117
+ include dirname( __FILE__ ) . '/sections/support.php';
118
+ do_action( 'rwmb_about_tabs_content' );
119
+ ?>
120
+ </div>
121
+ </div>
122
+ <div id="postbox-container-1" class="postbox-container">
123
+ <?php
124
+ include dirname( __FILE__ ) . '/sections/newsletter.php';
125
+ if ( ! $this->is_premium_user() ) {
126
+ include dirname( __FILE__ ) . '/sections/upgrade.php';
127
+ }
128
+ ?>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ <?php
134
+ }
135
+
136
+ /**
137
+ * Enqueue CSS and JS.
138
+ */
139
+ public function enqueue() {
140
+ wp_enqueue_style( 'meta-box-about', RWMB_URL . 'inc/about/css/about.css' );
141
+ wp_enqueue_script( 'meta-box-about', RWMB_URL . 'inc/about/js/about.js', array( 'jquery' ), '', true );
142
+ }
143
+
144
+ /**
145
+ * Change WordPress footer text on about page.
146
+ */
147
+ public function change_footer_text() {
148
+ $allowed_html = array(
149
+ 'a' => array(
150
+ 'href' => array(),
151
+ 'target' => array(),
152
+ ),
153
+ 'strong' => array(),
154
+ );
155
+
156
+ // Translators: %1$s - link to review form.
157
+ echo wp_kses( sprintf( __( 'Please rate <strong>Meta Box</strong> <a href="%1$s" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a> on <a href="%1$s" target="_blank">WordPress.org</a> to help us spread the word. Thank you from the Meta Box team!', 'meta-box' ), 'https://wordpress.org/support/view/plugin-reviews/meta-box?filter=5#new-post' ), $allowed_html );
158
+ }
159
+
160
+ /**
161
+ * Redirect to about page after Meta Box has been activated.
162
+ *
163
+ * @param string $plugin Path to the main plugin file from plugins directory.
164
+ * @param bool $network_wide Whether to enable the plugin for all sites in the network
165
+ * or just the current site. Multisite only. Default is false.
166
+ */
167
+ public function redirect( $plugin, $network_wide ) {
168
+ if ( ! $network_wide && 'meta-box/meta-box.php' === $plugin && ! $this->is_bundled() ) {
169
+ wp_safe_redirect( $this->get_menu_link() );
170
+ die;
171
+ }
172
+ }
173
+
174
+ /**
175
+ * Get link to the plugin admin menu.
176
+ *
177
+ * @return string
178
+ */
179
+ protected function get_menu_link() {
180
+ $menu = $this->has_menu() ? 'admin.php?page=meta-box' : $this->get_parent_menu() . '?page=meta-box';
181
+ return admin_url( $menu );
182
+ }
183
+
184
+ /**
185
+ * Get default parent menu, which is Plugins.
186
+ *
187
+ * @return string
188
+ */
189
+ protected function get_parent_menu() {
190
+ return 'plugins.php';
191
+ }
192
+
193
+ /**
194
+ * Check if the plugin has a top-level admin menu.
195
+ *
196
+ * @return bool
197
+ */
198
+ protected function has_menu() {
199
+ return apply_filters( 'rwmb_admin_menu', false );
200
+ }
201
+
202
+ /**
203
+ * Check if Meta Box is bundled by TGM Activation Class.
204
+ */
205
+ protected function is_bundled() {
206
+ // @codingStandardsIgnoreLine
207
+ foreach ( $_REQUEST as $key => $value ) {
208
+ if ( false !== strpos( $key, 'tgmpa' ) || false !== strpos( $value, 'tgmpa' ) ) {
209
+ return true;
210
+ }
211
+ }
212
+ return false;
213
+ }
214
+
215
+ /**
216
+ * Check if current user is a premium user.
217
+ *
218
+ * @return bool
219
+ */
220
+ protected function is_premium_user() {
221
+ $option = is_multisite() ? get_site_option( 'meta_box_updater' ) : get_option( 'meta_box_updater' );
222
+ if ( empty( $option['api_key'] ) ) {
223
+ return false;
224
+ }
225
+ if ( isset( $option['status'] ) && 'success' !== $option['status'] ) {
226
+ return false;
227
+ }
228
+ return true;
229
+ }
230
+ }
inc/meta-box/inc/about/css/about.css ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .about-wrap.about-wrap .wp-badge {
2
+ background-image: url(../images/meta-box.svg);
3
+ background-color: #fff;
4
+ color: #222;
5
+ text-transform: uppercase;
6
+ font-weight: bold;
7
+ text-decoration: none;
8
+ }
9
+
10
+ .wp-badge:hover {
11
+ text-decoration: none;
12
+ }
13
+
14
+ .about-buttons .dashicons {
15
+ position: relative;
16
+ top: 5px;
17
+ width: 16px;
18
+ height: 16px;
19
+ font-size: 16px;
20
+ }
21
+
22
+ #poststuff .nav-tab-wrapper {
23
+ padding: 0;
24
+ margin-top: 60px;
25
+ }
26
+
27
+ .feature-section.two-col {
28
+ align-items: flex-start;
29
+ }
30
+
31
+ .feature-section.two-col h3:not(:first-child) {
32
+ margin-top: 3em;
33
+ }
34
+
35
+ .feature-section img {
36
+ display: block;
37
+ box-shadow: 0 0 20px rgba(0, 0, 0, .1);
38
+ }
39
+
40
+ .nav-tab-active:focus {
41
+ box-shadow: none;
42
+ }
43
+
44
+ .gt-tab-pane {
45
+ display: none;
46
+ }
47
+
48
+ .gt-is-active {
49
+ display: block;
50
+ }
51
+
52
+ .screenshot {
53
+ display: block;
54
+ margin: 3em auto;
55
+ }
56
+ .col ul {
57
+ font-size: 14px;
58
+ margin: 2em 0;
59
+ }
60
+
61
+ .col li a {
62
+ text-decoration: none;
63
+ }
64
+
65
+ .col .dashicons {
66
+ color: #82878c;
67
+ padding-right: 5px;
68
+ font-size: 16px;
69
+ vertical-align: middle;
70
+ }
71
+
72
+ /* Extensions tab */
73
+ .theme-browser {
74
+ margin-top: 40px;
75
+ }
76
+ .theme-browser .theme:hover {
77
+ cursor: initial;
78
+ }
79
+ .extension-inner {
80
+ display: flex;
81
+ background: #fff;
82
+ padding: 25px 20px;
83
+ }
84
+ .extension-inner svg {
85
+ width: 36px;
86
+ height: 36px;
87
+ margin: 8px 15px 0 0;
88
+ fill: #b4b9be;
89
+ }
90
+ .extension-info {
91
+ flex: 1;
92
+ }
93
+ .extension-info.extension-info h3 {
94
+ margin: 0 0 5px;
95
+ font-size: 1.2em;
96
+ }
97
+ .extension-info p {
98
+ margin: 0;
99
+ }
100
+ .extension-action {
101
+ border-top: 1px solid #ddd;
102
+ text-align: center;
103
+ padding: 20px;
104
+ background: #f7f7f7;
105
+ }
106
+
107
+ /* Extensions tab: 2 columns */
108
+ .extension {
109
+ margin-bottom: 4%;
110
+ }
111
+ @media (min-width: 768px) {
112
+ .extension {
113
+ float: left;
114
+ width: 47.5%;
115
+ margin: 0 4% 4% 0;
116
+ }
117
+ .extension:nth-child(2n) {
118
+ margin-right: 0;
119
+ }
120
+ .extension:nth-child(2n+1) {
121
+ clear: left;
122
+ }
123
+ }
124
+ /* For large screen: 2 columns */
125
+ @media (min-width: 1640px) {
126
+ .extension {
127
+ width: 30.6%;
128
+ }
129
+ .extension:nth-child(2n) {
130
+ margin-right: 4%;
131
+ }
132
+ .extension:nth-child(2n+1) {
133
+ clear: none;
134
+ }
135
+ .extension:nth-child(3n) {
136
+ margin-right: 0;
137
+ }
138
+ .extension:nth-child(3n+1) {
139
+ clear: left;
140
+ }
141
+ }
142
+
143
+ /* Right column */
144
+ #post-body.columns-2 #postbox-container-1 {
145
+ position: fixed;
146
+ right: 320px;
147
+ top: 40px;
148
+ }
149
+
150
+ @media (max-width: 1279px) {
151
+ #postbox-container-1 {
152
+ display: none;
153
+ }
154
+ #poststuff #post-body.columns-2 {
155
+ margin-right: 0;
156
+ }
157
+ }
158
+
159
+ /* Newsletter */
160
+ .newsletter {
161
+ margin: 40px 0;
162
+ border: 3px dashed #82878c;
163
+ padding: 15px;
164
+ background: #fff;
165
+ }
166
+ .newsletter .dashicons {
167
+ color: #00b9eb;
168
+ width: 30px;
169
+ height: 30px;
170
+ font-size: 30px;
171
+ position: relative;
172
+ top: -5px;
173
+ left: -2px;
174
+ }
175
+ .newsletter h3 {
176
+ margin: 0 0 5px;
177
+ }
178
+ .newsletter p {
179
+ margin-top: 0;
180
+ }
181
+ .newsletter.newsletter input,
182
+ .newsletter.newsletter button {
183
+ margin-top: 5px;
184
+ }
185
+ .newsletter.newsletter input {
186
+ width: 145px;
187
+ padding: 5px;
188
+ }
189
+
190
+ /* Upgrade */
191
+ .upgrade {
192
+ border: 3px dashed #82878c;
193
+ background: #fff;
194
+ padding: 15px;
195
+ }
196
+ .upgrade .dashicons {
197
+ color: #ef4836;
198
+ width: 26px;
199
+ height: 26px;
200
+ font-size: 30px;
201
+ position: relative;
202
+ top: -4px;
203
+ left: -5px;
204
+ }
205
+ .upgrade h3 {
206
+ margin: 0;
207
+ }
208
+ .upgrade li {
209
+ padding-left: 20px;
210
+ position: relative;
211
+ }
212
+ .upgrade svg {
213
+ width: 1em;
214
+ height: 1em;
215
+ fill: #0073aa;
216
+ position: absolute;
217
+ top: 4px;
218
+ left: 0;
219
+ }
inc/meta-box/inc/about/images/meta-box.svg ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg viewBox="227 227 46 46" width="46" height="46" xmlns="http://www.w3.org/2000/svg">
3
+ <rect style="" x="227" y="227" width="46" height="46" rx="4" ry="4"/>
4
+ <path d="M 256.873 255.508 L 257.283 246.088 L 257.193 246.078 L 251.483 261.868 L 248.613 261.868 L 242.933 246.138 L 242.843 246.148 L 243.253 255.508 L 243.253 258.868 L 245.533 259.308 L 245.533 261.868 L 236.703 261.868 L 236.703 259.308 L 238.973 258.868 L 238.973 243.558 L 236.703 243.118 L 236.703 240.538 L 238.973 240.538 L 244.553 240.538 L 249.993 256.258 L 250.073 256.258 L 255.553 240.538 L 263.433 240.538 L 263.433 243.118 L 261.153 243.558 L 261.153 258.868 L 263.433 259.308 L 263.433 261.868 L 254.603 261.868 L 254.603 259.308 L 256.873 258.868 L 256.873 255.508 Z" style="fill:#fff"/>
5
+ </svg>
inc/meta-box/inc/about/images/online-generator.png ADDED
Binary file
inc/meta-box/inc/about/js/about.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function ( $ ) {
2
+ 'use strict';
3
+
4
+ function tabs() {
5
+ var $container = $( '.nav-tab-wrapper' ),
6
+ $tabs = $container.find( '.nav-tab' ),
7
+ $panes = $( '.gt-tab-pane' );
8
+
9
+ $container.on( 'click', '.nav-tab', function ( e ) {
10
+ e.preventDefault();
11
+
12
+ $tabs.removeClass( 'nav-tab-active' );
13
+ $( this ).addClass( 'nav-tab-active' );
14
+
15
+ $panes.removeClass( 'gt-is-active' );
16
+ $panes.filter( $( this ).attr( 'href' ) ).addClass( 'gt-is-active' );
17
+ } );
18
+ }
19
+
20
+ // Auto activate tabs when DOM ready.
21
+ $( tabs );
22
+ } ( jQuery ) );
inc/meta-box/inc/about/sections/extensions.php ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Extensions section.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ ?>
9
+ <div id="extensions" class="gt-tab-pane">
10
+ <p class="about-description">
11
+ <?php esc_html_e( 'Extend custom fields in WordPress well beyond what others would ever consider ordinary! Save over 70% with our extensions bundles.', 'meta-box' ); ?> <a target="_blank" href="https://metabox.io/pricing/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'View Bundles', 'meta-box' ); ?> &rarr;</a>
12
+ </p>
13
+ <div class="extensions wp-clearfix">
14
+ <div class="extension">
15
+ <div class="extension-inner">
16
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M736 1440q0 12-10 24l-319 319q-10 9-23 9-12 0-23-9l-320-320q-15-16-7-35 8-20 30-20h192v-1376q0-14 9-23t23-9h192q14 0 23 9t9 23v1376h192q14 0 23 9t9 23zm1056 128v192q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-192q0-14 9-23t23-9h832q14 0 23 9t9 23zm-192-512v192q0 14-9 23t-23 9h-640q-14 0-23-9t-9-23v-192q0-14 9-23t23-9h640q14 0 23 9t9 23zm-192-512v192q0 14-9 23t-23 9h-448q-14 0-23-9t-9-23v-192q0-14 9-23t23-9h448q14 0 23 9t9 23zm-192-512v192q0 14-9 23t-23 9h-256q-14 0-23-9t-9-23v-192q0-14 9-23t23-9h256q14 0 23 9t9 23z"/></svg>
17
+ <div class="extension-info">
18
+ <h3>Meta Box Builder</h3>
19
+ <p><?php esc_html_e( 'Drag and drop your custom fields into place without a single line of code.', 'meta-box' ); ?></p>
20
+ </div>
21
+ </div>
22
+ <div class="extension-action">
23
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-builder/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
24
+ </div>
25
+ </div>
26
+ <div class="extension">
27
+ <div class="extension-inner">
28
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1596 476q14 14 28 36h-472v-472q22 14 36 28zm-476 164h544v1056q0 40-28 68t-68 28h-1344q-40 0-68-28t-28-68v-1600q0-40 28-68t68-28h800v544q0 40 28 68t68 28zm160 736v-64q0-14-9-23t-23-9h-704q-14 0-23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23-9t9-23zm0-256v-64q0-14-9-23t-23-9h-704q-14 0-23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23-9t9-23zm0-256v-64q0-14-9-23t-23-9h-704q-14 0-23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23-9t9-23z" /></svg>
29
+ <div class="extension-info">
30
+ <h3>MB Custom Post Type</h3>
31
+ <p><?php esc_html_e( 'Create and manage custom post types easily in WordPress with an easy-to-use interface.', 'meta-box' ); ?></p>
32
+ </div>
33
+ </div>
34
+ <div class="extension-action">
35
+ <a class="button" target="_blank" href="https://metabox.io/plugins/custom-post-type/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
36
+ </div>
37
+ </div>
38
+ <div class="extension">
39
+ <div class="extension-inner">
40
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M512 1248v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm0-512v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm1280 512v192q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h960q40 0 68 28t28 68zm-1280-1024v192q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h320q40 0 68 28t28 68zm1280 512v192q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h960q40 0 68 28t28 68zm0-512v192q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h960q40 0 68 28t28 68z" /></svg>
41
+ <div class="extension-info">
42
+ <h3>Meta Box Group</h3>
43
+ <p><?php esc_html_e( 'Create repeatable groups of custom fields for better appearance and structure.', 'meta-box' ); ?></p>
44
+ </div>
45
+ </div>
46
+ <div class="extension-action">
47
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-group/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
48
+ </div>
49
+ </div>
50
+ <div class="extension">
51
+ <div class="extension-inner">
52
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1152 896q0-106-75-181t-181-75-181 75-75 181 75 181 181 75 181-75 75-181zm512-109v222q0 12-8 23t-20 13l-185 28q-19 54-39 91 35 50 107 138 10 12 10 25t-9 23q-27 37-99 108t-94 71q-12 0-26-9l-138-108q-44 23-91 38-16 136-29 186-7 28-36 28h-222q-14 0-24.5-8.5t-11.5-21.5l-28-184q-49-16-90-37l-141 107q-10 9-25 9-14 0-25-11-126-114-165-168-7-10-7-23 0-12 8-23 15-21 51-66.5t54-70.5q-27-50-41-99l-183-27q-13-2-21-12.5t-8-23.5v-222q0-12 8-23t19-13l186-28q14-46 39-92-40-57-107-138-10-12-10-24 0-10 9-23 26-36 98.5-107.5t94.5-71.5q13 0 26 10l138 107q44-23 91-38 16-136 29-186 7-28 36-28h222q14 0 24.5 8.5t11.5 21.5l28 184q49 16 90 37l142-107q9-9 24-9 13 0 25 10 129 119 165 170 7 8 7 22 0 12-8 23-15 21-51 66.5t-54 70.5q26 50 41 98l183 28q13 2 21 12.5t8 23.5z" /></svg>
53
+ <div class="extension-info">
54
+ <h3>MB Settings Page</h3>
55
+ <p><?php esc_html_e( 'Create a powerful settings page for your theme, plugin or website.', 'meta-box' ); ?></p>
56
+ </div>
57
+ </div>
58
+ <div class="extension-action">
59
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-settings-page/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
60
+ </div>
61
+ </div>
62
+ <div class="extension">
63
+ <div class="extension-inner">
64
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1792 1184v192q0 13-9.5 22.5t-22.5 9.5h-1376v192q0 13-9.5 22.5t-22.5 9.5q-12 0-24-10l-319-320q-9-9-9-22 0-14 9-23l320-320q9-9 23-9 13 0 22.5 9.5t9.5 22.5v192h1376q13 0 22.5 9.5t9.5 22.5zm0-544q0 14-9 23l-320 320q-9 9-23 9-13 0-22.5-9.5t-9.5-22.5v-192h-1376q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1376v-192q0-14 9-23t23-9q12 0 24 10l319 319q9 9 9 23z" /></svg>
65
+ <div class="extension-info">
66
+ <h3>Meta Box Conditional Logic</h3>
67
+ <p><?php esc_html_e( 'Control the visibility of meta boxes and fields or even HTML elements with ease.', 'meta-box' ); ?></p>
68
+ </div>
69
+ </div>
70
+ <div class="extension-action">
71
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-conditional-logic/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
72
+ </div>
73
+ </div>
74
+ <div class="extension">
75
+ <div class="extension-inner">
76
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1703 478q40 57 18 129l-275 906q-19 64-76.5 107.5t-122.5 43.5h-923q-77 0-148.5-53.5t-99.5-131.5q-24-67-2-127 0-4 3-27t4-37q1-8-3-21.5t-3-19.5q2-11 8-21t16.5-23.5 16.5-23.5q23-38 45-91.5t30-91.5q3-10 .5-30t-.5-28q3-11 17-28t17-23q21-36 42-92t25-90q1-9-2.5-32t.5-28q4-13 22-30.5t22-22.5q19-26 42.5-84.5t27.5-96.5q1-8-3-25.5t-2-26.5q2-8 9-18t18-23 17-21q8-12 16.5-30.5t15-35 16-36 19.5-32 26.5-23.5 36-11.5 47.5 5.5l-1 3q38-9 51-9h761q74 0 114 56t18 130l-274 906q-36 119-71.5 153.5t-128.5 34.5h-869q-27 0-38 15-11 16-1 43 24 70 144 70h923q29 0 56-15.5t35-41.5l300-987q7-22 5-57 38 15 59 43zm-1064 2q-4 13 2 22.5t20 9.5h608q13 0 25.5-9.5t16.5-22.5l21-64q4-13-2-22.5t-20-9.5h-608q-13 0-25.5 9.5t-16.5 22.5zm-83 256q-4 13 2 22.5t20 9.5h608q13 0 25.5-9.5t16.5-22.5l21-64q4-13-2-22.5t-20-9.5h-608q-13 0-25.5 9.5t-16.5 22.5z" /></svg>
77
+ <div class="extension-info">
78
+ <h3>MB Term Meta</h3>
79
+ <p><?php esc_html_e( 'Easily add custom fields to categories, tags or any custom taxonomy.', 'meta-box' ); ?></p>
80
+ </div>
81
+ </div>
82
+ <div class="extension-action">
83
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-term-meta/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
84
+ </div>
85
+ </div>
86
+ <div class="extension">
87
+ <div class="extension-inner">
88
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1536 1399q0 109-62.5 187t-150.5 78h-854q-88 0-150.5-78t-62.5-187q0-85 8.5-160.5t31.5-152 58.5-131 94-89 134.5-34.5q131 128 313 128t313-128q76 0 134.5 34.5t94 89 58.5 131 31.5 152 8.5 160.5zm-256-887q0 159-112.5 271.5t-271.5 112.5-271.5-112.5-112.5-271.5 112.5-271.5 271.5-112.5 271.5 112.5 112.5 271.5z" /></svg>
89
+ <div class="extension-info">
90
+ <h3>MB User Meta</h3>
91
+ <p><?php esc_html_e( 'Add custom fields to user profile (user meta) quickly with simple syntax.', 'meta-box' ); ?></p>
92
+ </div>
93
+ </div>
94
+ <div class="extension-action">
95
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-user-meta/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
96
+ </div>
97
+ </div>
98
+ <div class="extension">
99
+ <div class="extension-inner">
100
+ <svg viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M657 896q-162 5-265 128h-134q-82 0-138-40.5t-56-118.5q0-353 124-353 6 0 43.5 21t97.5 42.5 119 21.5q67 0 133-23-5 37-5 66 0 139 81 256zm1071 637q0 120-73 189.5t-194 69.5h-874q-121 0-194-69.5t-73-189.5q0-53 3.5-103.5t14-109 26.5-108.5 43-97.5 62-81 85.5-53.5 111.5-20q10 0 43 21.5t73 48 107 48 135 21.5 135-21.5 107-48 73-48 43-21.5q61 0 111.5 20t85.5 53.5 62 81 43 97.5 26.5 108.5 14 109 3.5 103.5zm-1024-1277q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75 75 181zm704 384q0 159-112.5 271.5t-271.5 112.5-271.5-112.5-112.5-271.5 112.5-271.5 271.5-112.5 271.5 112.5 112.5 271.5zm576 225q0 78-56 118.5t-138 40.5h-134q-103-123-265-128 81-117 81-256 0-29-5-66 66 23 133 23 59 0 119-21.5t97.5-42.5 43.5-21q124 0 124 353zm-128-609q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75 75 181z" /></svg>
101
+ <div class="extension-info">
102
+ <h3>MB User Profile</h3>
103
+ <p><?php esc_html_e( 'Create register, login and edit user profile forms in the frontend. Embed everywhere with shortcodes.', 'meta-box' ); ?></p>
104
+ </div>
105
+ </div>
106
+ <div class="extension-action">
107
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-user-profile/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
108
+ </div>
109
+ </div>
110
+ <div class="extension">
111
+ <div class="extension-inner">
112
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M381 1620q0 80-54.5 126t-135.5 46q-106 0-172-66l57-88q49 45 106 45 29 0 50.5-14.5t21.5-42.5q0-64-105-56l-26-56q8-10 32.5-43.5t42.5-54 37-38.5v-1q-16 0-48.5 1t-48.5 1v53h-106v-152h333v88l-95 115q51 12 81 49t30 88zm2-627v159h-362q-6-36-6-54 0-51 23.5-93t56.5-68 66-47.5 56.5-43.5 23.5-45q0-25-14.5-38.5t-39.5-13.5q-46 0-81 58l-85-59q24-51 71.5-79.5t105.5-28.5q73 0 123 41.5t50 112.5q0 50-34 91.5t-75 64.5-75.5 50.5-35.5 52.5h127v-60h105zm1409 319v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-14 9-23t23-9h1216q13 0 22.5 9.5t9.5 22.5zm-1408-899v99h-335v-99h107q0-41 .5-121.5t.5-121.5v-12h-2q-8 17-50 54l-71-76 136-127h106v404h108zm1408 387v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-14 9-23t23-9h1216q13 0 22.5 9.5t9.5 22.5zm0-512v192q0 13-9.5 22.5t-22.5 9.5h-1216q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1216q13 0 22.5 9.5t9.5 22.5z" /></svg>
113
+ <div class="extension-info">
114
+ <h3>MB Frontend Submission</h3>
115
+ <p><?php esc_html_e( 'Create frontend forms for users to submit custom content. Embed everywhere with shortcode.', 'meta-box' ); ?></p>
116
+ </div>
117
+ </div>
118
+ <div class="extension-action">
119
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-frontend-submission/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
120
+ </div>
121
+ </div>
122
+ <div class="extension">
123
+ <div class="extension-inner">
124
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1600 1312v-704q0-40-28-68t-68-28h-704q-40 0-68-28t-28-68v-64q0-40-28-68t-68-28h-320q-40 0-68 28t-28 68v960q0 40 28 68t68 28h1216q40 0 68-28t28-68zm128-704v704q0 92-66 158t-158 66h-1216q-92 0-158-66t-66-158v-960q0-92 66-158t158-66h320q92 0 158 66t66 158v32h672q92 0 158 66t66 158z" /></svg>
125
+ <div class="extension-info">
126
+ <h3>Meta Box Tabs</h3>
127
+ <p><?php esc_html_e( 'Add as many custom fields as you want and organize them into tabs.', 'meta-box' ); ?></p>
128
+ </div>
129
+ </div>
130
+ <div class="extension-action">
131
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-tabs/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
132
+ </div>
133
+ </div>
134
+ <div class="extension">
135
+ <div class="extension-inner">
136
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M576 1376v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm-512-768v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm-512-768v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm128-320v1088q0 66-47 113t-113 47h-1344q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1344q66 0 113 47t47 113z" /></svg>
137
+ <div class="extension-info">
138
+ <h3>MB Custom Table</h3>
139
+ <p><?php esc_html_e( 'Save custom fields data to custom table instead of the default meta tables. Reduce database size and increase performance.', 'meta-box' ); ?></p>
140
+ </div>
141
+ </div>
142
+ <div class="extension-action">
143
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-custom-table/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
144
+ </div>
145
+ </div>
146
+ <div class="extension">
147
+ <div class="extension-inner">
148
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M672 1472q0-40-28-68t-68-28-68 28-28 68 28 68 68 28 68-28 28-68zm0-1152q0-40-28-68t-68-28-68 28-28 68 28 68 68 28 68-28 28-68zm640 128q0-40-28-68t-68-28-68 28-28 68 28 68 68 28 68-28 28-68zm96 0q0 52-26 96.5t-70 69.5q-2 287-226 414-67 38-203 81-128 40-169.5 71t-41.5 100v26q44 25 70 69.5t26 96.5q0 80-56 136t-136 56-136-56-56-136q0-52 26-96.5t70-69.5v-820q-44-25-70-69.5t-26-96.5q0-80 56-136t136-56 136 56 56 136q0 52-26 96.5t-70 69.5v497q54-26 154-57 55-17 87.5-29.5t70.5-31 59-39.5 40.5-51 28-69.5 8.5-91.5q-44-25-70-69.5t-26-96.5q0-80 56-136t136-56 136 56 56 136z" /></svg>
149
+ <div class="extension-info">
150
+ <h3>MB Rest API</h3>
151
+ <p><?php esc_html_e( 'Pull all meta value from posts, terms into the WP REST API responses.', 'meta-box' ); ?></p>
152
+ </div>
153
+ </div>
154
+ <div class="extension-action">
155
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-rest-api/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
156
+ </div>
157
+ </div>
158
+ <div class="extension">
159
+ <div class="extension-inner">
160
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1792 1184v192q0 13-9.5 22.5t-22.5 9.5h-1376v192q0 13-9.5 22.5t-22.5 9.5q-12 0-24-10l-319-320q-9-9-9-22 0-14 9-23l320-320q9-9 23-9 13 0 22.5 9.5t9.5 22.5v192h1376q13 0 22.5 9.5t9.5 22.5zm0-544q0 14-9 23l-320 320q-9 9-23 9-13 0-22.5-9.5t-9.5-22.5v-192h-1376q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1376v-192q0-14 9-23t23-9q12 0 24 10l319 319q9 9 9 23z" /></svg>
161
+ <div class="extension-info">
162
+ <h3>MB Relationships</h3>
163
+ <p><?php esc_html_e( 'A lightweight WordPress plugin for creating many-to-many relationships between posts, terms and users.', 'meta-box' ); ?></p>
164
+ </div>
165
+ </div>
166
+ <div class="extension-action">
167
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-relationships/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
168
+ </div>
169
+ </div>
170
+ <div class="extension">
171
+ <div class="extension-inner">
172
+ <svg viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M212 768l623 665-300-665h-323zm812 772l349-772h-698zm-486-900l204-384h-262l-288 384h346zm675 793l623-665h-323zm-530-793h682l-204-384h-274zm827 0h346l-288-384h-262zm141-486l384 512q14 18 13 41.5t-17 40.5l-960 1024q-18 20-47 20t-47-20l-960-1024q-16-17-17-40.5t13-41.5l384-512q18-26 51-26h1152q33 0 51 26z" /></svg>
173
+ <div class="extension-info">
174
+ <h3>Meta Box – FacetWP Integrator</h3>
175
+ <p><?php esc_html_e( 'Integrates Meta Box and FacetWP, makes custom fields searchable and filterable in the frontend.', 'meta-box' ); ?></p>
176
+ </div>
177
+ </div>
178
+ <div class="extension-action">
179
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-facetwp-integrator/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
180
+ </div>
181
+ </div>
182
+ <div class="extension">
183
+ <div class="extension-inner">
184
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1755 453q37 38 37 90.5t-37 90.5l-401 400 150 150-160 160q-163 163-389.5 186.5t-411.5-100.5l-362 362h-181v-181l362-362q-124-185-100.5-411.5t186.5-389.5l160-160 150 150 400-401q38-37 91-37t90 37 37 90.5-37 90.5l-400 401 234 234 401-400q38-37 91-37t90 37z" /></svg>
185
+ <div class="extension-info">
186
+ <h3>Meta Box – Beaver Themer Integrator</h3>
187
+ <p><?php esc_html_e( 'Select and show custom fields created by the Meta Box plugin in the Beaver Themer field connection.', 'meta-box' ); ?></p>
188
+ </div>
189
+ </div>
190
+ <div class="extension-action">
191
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-beaver-themer-integrator/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
192
+ </div>
193
+ </div>
194
+ <div class="extension">
195
+ <div class="extension-inner">
196
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1792 896q0 174-120 321.5t-326 233-450 85.5q-70 0-145-8-198 175-460 242-49 14-114 22-17 2-30.5-9t-17.5-29v-1q-3-4-.5-12t2-10 4.5-9.5l6-9 7-8.5 8-9q7-8 31-34.5t34.5-38 31-39.5 32.5-51 27-59 26-76q-157-89-247.5-220t-90.5-281q0-130 71-248.5t191-204.5 286-136.5 348-50.5q244 0 450 85.5t326 233 120 321.5z" /></svg>
197
+ <div class="extension-info">
198
+ <h3>MB Comment Meta</h3>
199
+ <p><?php esc_html_e( 'Add custom fields to comments in WordPress. Support all field types and options.', 'meta-box' ); ?></p>
200
+ </div>
201
+ </div>
202
+ <div class="extension-action">
203
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-comment-meta/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
204
+ </div>
205
+ </div>
206
+ <div class="extension">
207
+ <div class="extension-inner">
208
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1664 256v448q0 26-19 45t-45 19h-448q-42 0-59-40-17-39 14-69l138-138q-148-137-349-137-104 0-198.5 40.5t-163.5 109.5-109.5 163.5-40.5 198.5 40.5 198.5 109.5 163.5 163.5 109.5 198.5 40.5q119 0 225-52t179-147q7-10 23-12 15 0 25 9l137 138q9 8 9.5 20.5t-7.5 22.5q-109 132-264 204.5t-327 72.5q-156 0-298-61t-245-164-164-245-61-298 61-298 164-245 245-164 298-61q147 0 284.5 55.5t244.5 156.5l130-129q29-31 70-14 39 17 39 59z" /></svg>
209
+ <div class="extension-info">
210
+ <h3>MB Revision</h3>
211
+ <p><?php esc_html_e( 'Track changes of custom fields with WordPress revision. Save, compare, restore the changes easily.', 'meta-box' ); ?></p>
212
+ </div>
213
+ </div>
214
+ <div class="extension-action">
215
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-revision/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
216
+ </div>
217
+ </div>
218
+ <div class="extension">
219
+ <div class="extension-inner">
220
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1593 349l-640 1280q-17 35-57 35-5 0-15-2-22-5-35.5-22.5t-13.5-39.5v-576h-576q-22 0-39.5-13.5t-22.5-35.5 4-42 29-30l1280-640q13-7 29-7 27 0 45 19 15 14 18.5 34.5t-6.5 39.5z" /></svg>
221
+ <div class="extension-info">
222
+ <h3>Meta Box Geolocation</h3>
223
+ <p><?php esc_html_e( 'Automatically and instantly populate location data with the power of Google Maps Geolocation API.', 'meta-box' ); ?></p>
224
+ </div>
225
+ </div>
226
+ <div class="extension-action">
227
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-geolocation/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
228
+ </div>
229
+ </div>
230
+ <div class="extension">
231
+ <div class="extension-inner">
232
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M576 1376v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm-512-768v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm-512-768v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm128-320v1088q0 66-47 113t-113 47h-1344q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1344q66 0 113 47t47 113z" /></svg>
233
+ <div class="extension-info">
234
+ <h3>MB Admin Columns</h3>
235
+ <p><?php esc_html_e( 'Display custom fields in table columns in admin screens for All Posts (types).', 'meta-box' ); ?></p>
236
+ </div>
237
+ </div>
238
+ <div class="extension-action">
239
+ <a class="button" target="_blank" href="https://metabox.io/plugins/mb-admin-columns/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
240
+ </div>
241
+ </div>
242
+ <div class="extension">
243
+ <div class="extension-inner">
244
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M888 1184l116-116-152-152-116 116v56h96v96h56zm440-720q-16-16-33 1l-350 350q-17 17-1 33t33-1l350-350q17-17 1-33zm80 594v190q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q63 0 117 25 15 7 18 23 3 17-9 29l-49 49q-14 14-32 8-23-6-45-6h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-126q0-13 9-22l64-64q15-15 35-7t20 29zm-96-738l288 288-672 672h-288v-288zm444 132l-92 92-288-288 92-92q28-28 68-28t68 28l152 152q28 28 28 68t-28 68z" /></svg>
245
+ <div class="extension-info">
246
+ <h3>Meta Box for Yoast SEO</h3>
247
+ <p><?php esc_html_e( 'Add content of custom fields to Yoast SEO Content Analysis to have better/correct SEO score.', 'meta-box' ); ?></p>
248
+ </div>
249
+ </div>
250
+ <div class="extension-action">
251
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-yoast-seo/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
252
+ </div>
253
+ </div>
254
+ <div class="extension">
255
+ <div class="extension-inner">
256
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z" /></svg>
257
+ <div class="extension-info">
258
+ <h3>Meta Box Text Limiter</h3>
259
+ <p><?php esc_html_e( 'Limit the number of characters or words entered for text and textarea fields.', 'meta-box' ); ?></p>
260
+ </div>
261
+ </div>
262
+ <div class="extension-action">
263
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-text-limiter/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
264
+ </div>
265
+ </div>
266
+ <div class="extension">
267
+ <div class="extension-inner">
268
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1639 1056q0 5-1 7-64 268-268 434.5t-478 166.5q-146 0-282.5-55t-243.5-157l-129 129q-19 19-45 19t-45-19-19-45v-448q0-26 19-45t45-19h448q26 0 45 19t19 45-19 45l-137 137q71 66 161 102t187 36q134 0 250-65t186-179q11-17 53-117 8-23 30-23h192q13 0 22.5 9.5t9.5 22.5zm25-800v448q0 26-19 45t-45 19h-448q-26 0-45-19t-19-45 19-45l138-138q-148-137-349-137-134 0-250 65t-186 179q-11 17-53 117-8 23-30 23h-199q-13 0-22.5-9.5t-9.5-22.5v-7q65-268 270-434.5t480-166.5q146 0 284 55.5t245 156.5l130-129q19-19 45-19t45 19 19 45z" /></svg>
269
+ <div class="extension-info">
270
+ <h3>Meta Box Updater</h3>
271
+ <p><?php esc_html_e( 'Automatically updates all Meta Box extensions within the WordPress Admin area.', 'meta-box' ); ?></p>
272
+ </div>
273
+ </div>
274
+ <div class="extension-action">
275
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-updater/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
276
+ </div>
277
+ </div>
278
+ <div class="extension">
279
+ <div class="extension-inner">
280
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1596 476q14 14 28 36h-472v-472q22 14 36 28zm-476 164h544v1056q0 40-28 68t-68 28h-1344q-40 0-68-28t-28-68v-1600q0-40 28-68t68-28h800v544q0 40 28 68t68 28zm160 736v-64q0-14-9-23t-23-9h-704q-14 0-23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23-9t9-23zm0-256v-64q0-14-9-23t-23-9h-704q-14 0-23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23-9t9-23zm0-256v-64q0-14-9-23t-23-9h-704q-14 0-23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23-9t9-23z" /></svg>
281
+ <div class="extension-info">
282
+ <h3>Meta Box Template</h3>
283
+ <p><?php esc_html_e( 'Define custom meta boxes and custom fields easier with templates.', 'meta-box' ); ?></p>
284
+ </div>
285
+ </div>
286
+ <div class="extension-action">
287
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-template/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
288
+ </div>
289
+ </div>
290
+ <div class="extension">
291
+ <div class="extension-inner">
292
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1152 1376v-160q0-14-9-23t-23-9h-96v-512q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v160q0 14 9 23t23 9h96v320h-96q-14 0-23 9t-9 23v160q0 14 9 23t23 9h448q14 0 23-9t9-23zm-128-896v-160q0-14-9-23t-23-9h-192q-14 0-23 9t-9 23v160q0 14 9 23t23 9h192q14 0 23-9t9-23zm640 416q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z" /></svg>
293
+ <div class="extension-info">
294
+ <h3>Meta Box Tooltip</h3>
295
+ <p><?php esc_html_e( 'Display help information for fields using beautiful tooltips.', 'meta-box' ); ?></p>
296
+ </div>
297
+ </div>
298
+ <div class="extension-action">
299
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-tooltip/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
300
+ </div>
301
+ </div>
302
+ <div class="extension">
303
+ <div class="extension-inner">
304
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1664 960q-152-236-381-353 61 104 61 225 0 185-131.5 316.5t-316.5 131.5-316.5-131.5-131.5-316.5q0-121 61-225-229 117-381 353 133 205 333.5 326.5t434.5 121.5 434.5-121.5 333.5-326.5zm-720-384q0-20-14-34t-34-14q-125 0-214.5 89.5t-89.5 214.5q0 20 14 34t34 14 34-14 14-34q0-86 61-147t147-61q20 0 34-14t14-34zm848 384q0 34-20 69-140 230-376.5 368.5t-499.5 138.5-499.5-139-376.5-368q-20-35-20-69t20-69q140-229 376.5-368t499.5-139 499.5 139 376.5 368q20 35 20 69z" /></svg>
305
+ <div class="extension-info">
306
+ <h3>Meta Box Show Hide</h3>
307
+ <p><?php esc_html_e( 'Toggle meta boxes by page template, post format or taxonomy using JS.', 'meta-box' ); ?></p>
308
+ </div>
309
+ </div>
310
+ <div class="extension-action">
311
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-show-hide/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
312
+ </div>
313
+ </div>
314
+ <div class="extension">
315
+ <div class="extension-inner">
316
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M224 1536h608v-1152h-640v1120q0 13 9.5 22.5t22.5 9.5zm1376-32v-1120h-640v1152h608q13 0 22.5-9.5t9.5-22.5zm128-1216v1216q0 66-47 113t-113 47h-1344q-66 0-113-47t-47-113v-1216q0-66 47-113t113-47h1344q66 0 113 47t47 113z" /></svg>
317
+ <div class="extension-info">
318
+ <h3>Meta Box Columns</h3>
319
+ <p><?php esc_html_e( 'Display fields more beautiful by putting them into 12-columns grid.', 'meta-box' ); ?></p>
320
+ </div>
321
+ </div>
322
+ <div class="extension-action">
323
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-columns/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
324
+ </div>
325
+ </div>
326
+ <div class="extension">
327
+ <div class="extension-inner">
328
+ <svg viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M681 1399l-50 50q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l50 50q10 10 10 23t-10 23l-393 393 393 393q10 10 10 23t-10 23zm591-1067l-373 1291q-4 13-15.5 19.5t-23.5 2.5l-62-17q-13-4-19.5-15.5t-2.5-24.5l373-1291q4-13 15.5-19.5t23.5-2.5l62 17q13 4 19.5 15.5t2.5 24.5zm657 651l-466 466q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l393-393-393-393q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l466 466q10 10 10 23t-10 23z" /></svg>
329
+ <div class="extension-info">
330
+ <h3>Meta Box Include Exclude</h3>
331
+ <p><?php esc_html_e( 'Show or hide meta boxes whenever and for whomever you choose.', 'meta-box' ); ?></p>
332
+ </div>
333
+ </div>
334
+ <div class="extension-action">
335
+ <a class="button" target="_blank" href="https://metabox.io/plugins/meta-box-include-exclude/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a>
336
+ </div>
337
+ </div>
338
+ <div class="extension">
339
+ <div class="extension-inner">
340
+ <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M384 1184v64q0 13-9.5 22.5t-22.5 9.5h-64q-13 0-22.5-9.5t-9.5-22.5v-64q0-13 9.5-22.5t22.5-9.5h64q13 0 22.5 9.5t9.5 22.5zm0-256v64q0 13-9.5 22.5t-22.5 9.5h-64q-13 0-22.5-9.5t-9.5-22.5v-64q0-13 9.5-22.5t22.5-9.5h64q13 0 22.5 9.5t9.5 22.5zm0-256v64q0 13-9.5 22.5t-22.5 9.5h-64q-13 0-22.5-9.5t-9.5-22.5v-64q0-13 9.5-22.5t22.5-9.5h64q13 0 22.5 9.5t9.5 22.5zm1152 512v64q0 13-9.5 22.5t-22.5 9.5h-960q-13 0-22.5-9.5t-9.5-22.5v-64q0-13 9.5-22.5t22.5-9.5h960q13 0 22.5 9.5t9.5 22.5zm0-256v64q0 13-9.5 22.5t-22.5 9.5h-960q-13 0-22.5-9.5t-9.5-22.5v-64q0-13 9.5-22.5t22.5-9.5h960q13 0 22.5 9.5t9.5 22.5zm0-256v64q0 13-9.5 22.5t-22.5 9.5h-960q-13 0-22.5-9.5t-9.5-22.5v-64q0-13 9.5-22.5t22.5-9.5h960q13 0 22.5 9.5t9.5 22.5zm128 704v-832q0-13-9.5-22.5t-22.5-9.5h-1472q-13 0-22.5 9.5t-9.5 22.5v832q0 13 9.5 22.5t22.5 9.5h1472q13 0 22.5-9.5t9.5-22.5zm128-1088v1088q0 66-47 113t-113 47h-1472q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1472q66 0 113 47t47 113z" /></svg>
341
+ <div class="extension-info">
342
+ <h3>MB Custom Taxonomy</h3>
343
+ <p><?php esc_html_e( 'Create and manage custom taxonomies with an easy-to-use interface in WordPress.', 'meta-box' ); ?></p>
344
+ </div>
345
+ </div>
346
+ <div class="extension-action">
347
+ <a class="button" target="_blank" href="https://metabox.io/plugins/custom-taxonomy/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Free Download', 'meta-box' ); ?></a>
348
+ </div>
349
+ </div>
350
+ </div>
351
+ </div>
inc/meta-box/inc/about/sections/getting-started.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Getting started section.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ ?>
9
+ <div id="getting-started" class="gt-tab-pane gt-is-active">
10
+ <div class="feature-section two-col">
11
+ <div class="col">
12
+ <h3><?php esc_html_e( 'Getting Started With Online Generator', 'meta-box' ); ?></h3>
13
+ <p><?php esc_html_e( 'The fastest way to getting started with Meta Box is use our online generator to generate meta boxes with custom fields. It provides a friendly UI for you to create meta boxes and custom fields just by drag and drop fields.', 'meta-box' ); ?><p>
14
+
15
+ <a target="_blank" class="screenshot" href="https://metabox.io/online-generator/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><img src="<?php echo esc_url( RWMB_URL . 'inc/about/images/online-generator.png' ); ?>" alt="<?php esc_attr_e( 'online generator', 'meta-box' ); ?>"></a>
16
+
17
+ <p><a class="button" target="_blank" href="<?php echo esc_url( 'https://metabox.io/online-generator/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin' ); ?>"><?php esc_html_e( 'Go to Online Generator', 'meta-box' ); ?></a></p>
18
+ </div>
19
+
20
+ <div class="col">
21
+ <h3><?php esc_html_e( 'Understand The Basics', 'meta-box' ); ?></h3>
22
+ <p><?php esc_html_e( 'Meta Box doesn\'t have any admin page for configuration or settings. Instead of that, it provides a very powerful API to speed up the process of creating meta boxes and custom fields. It might take you a little time at first, but then you\'ll love the way it work because it helps you do and customize almost everything.', 'meta-box' ); ?><p>
23
+ <p><a class="button" target="_blank" href="<?php echo esc_url( 'https://docs.metabox.io/quick-start/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin' ); ?>"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a></p>
24
+
25
+ <h3><?php esc_html_e( 'Extensions', 'meta-box' ); ?></h3>
26
+ <p><?php esc_html_e( 'Wanna see more features that transform your WordPress website into a powerful CMS? Check out some extensions below:', 'meta-box' ); ?><p>
27
+ <ul>
28
+ <li><a target="_blank" href="https://metabox.io/plugins/meta-box-group/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><span class="dashicons dashicons-welcome-widgets-menus"></span> <?php esc_html_e( 'Meta Box Group', 'meta-box' ); ?></a></li>
29
+ <li><a target="_blank" href="https://metabox.io/plugins/meta-box-conditional-logic/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Meta Box Conditional Logic', 'meta-box' ); ?></a></li>
30
+ <li><a target="_blank" href="https://metabox.io/plugins/mb-settings-page/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e( 'MB Settings Page', 'meta-box' ); ?></a></li>
31
+ <li><a target="_blank" href="https://metabox.io/plugins/mb-term-meta/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><span class="dashicons dashicons-image-filter"></span> <?php esc_html_e( 'MB Term Meta', 'meta-box' ); ?></a></li>
32
+ </ul>
33
+ <p><a class="button" target="_blank" href="https://metabox.io/plugins/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'More Extensions', 'meta-box' ); ?></a>
34
+ </div>
35
+ </div>
36
+ </div>
inc/meta-box/inc/about/sections/newsletter.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Newsletter form
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ ?>
9
+
10
+ <form method="post" action="https://app.zetamail.vn/form.php?form=77" target="_blank" class="newsletter">
11
+ <h3><span class="dashicons dashicons-email-alt"></span> <?php esc_html_e( 'Meta Box Newsletter', 'meta-box' ); ?></h3>
12
+ <input name="format" value="h" type="hidden">
13
+ <p><?php esc_html_e( 'Want to learn how to use Meta Box to its full potential? Sign up to get valuable tips and resources. We will never spam you.', 'meta-box' ); ?></p>
14
+ <input name="email" value="" placeholder="joe@gmail.com" required type="email">
15
+ <button class="button button-primary"><?php esc_html_e( 'Subscribe', 'meta-box' ); ?></button>
16
+ </form>
inc/meta-box/inc/about/sections/support.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Support section.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ ?>
9
+ <div id="support" class="gt-tab-pane">
10
+ <p class="about-description">Still need help with Meta Box? We offer excellent support for you. But don't forget to check our <a href="https://docs.metabox.io?utm_source=WordPress&utm_medium=link&utm_campaign=plugin">documentation</a> first.</p>
11
+ <div class="feature-section two-col">
12
+ <div class="col">
13
+ <h3><?php esc_html_e( 'Free Support', 'meta-box' ); ?></h3>
14
+ <p><?php esc_html_e( 'If you have any question about how to use the plugin, please open a new topic on WordPress.org support forum or open a new issue on Github (preferable). We will try to answer as soon as we can.', 'meta-box' ); ?><p>
15
+ <p><a class="button" target="_blank" href="https://github.com/wpmetabox/meta-box/issues"><?php esc_html_e( 'Go to Github', 'meta-box' ); ?> &rarr;</a></p>
16
+ <p><a class="button" target="_blank" href="https://wordpress.org/support/plugin/meta-box"><?php esc_html_e( 'Go to WordPress.org', 'meta-box' ); ?> &rarr;</a></p>
17
+ </div>
18
+
19
+ <div class="col">
20
+ <h3><?php esc_html_e( 'Premium Support', 'meta-box' ); ?></h3>
21
+ <p><?php esc_html_e( 'For users that have bought premium extensions, the support is provided in the Meta Box Support forum. Any question will be answered with technical details within 24 hours.', 'meta-box' ); ?><p>
22
+ <p><a class="button" target="_blank" href="https://metabox.io/support/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Go to support forum', 'meta-box' ); ?> &rarr;</a></p>
23
+ </div>
24
+ </div>
25
+ </div>
inc/meta-box/inc/about/sections/tabs.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Tabs navigation.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ ?>
9
+ <h2 class="nav-tab-wrapper">
10
+ <a href="#getting-started" class="nav-tab nav-tab-active"><?php esc_html_e( 'Getting Started', 'meta-box' ); ?></a>
11
+ <?php do_action( 'rwmb_about_tabs' ); ?>
12
+ <a href="#extensions" class="nav-tab"><?php esc_html_e( 'Extensions', 'meta-box' ); ?></a>
13
+ <a href="#support" class="nav-tab"><?php esc_html_e( 'Support', 'meta-box' ); ?></a>
14
+ </h2>
inc/meta-box/inc/about/sections/upgrade.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Upgrade notice
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ ?>
9
+ <div class="upgrade">
10
+ <h3><span class="dashicons dashicons-awards"></span> <?php esc_html_e( 'Upgrade to Meta Box PRO', 'meta-box' ); ?></h3>
11
+ <p><?php esc_html_e( 'Please upgrade to the PRO plan to unlock more awesome features.', 'meta-box' ); ?></p>
12
+ <ul>
13
+ <li><svg class="icon"><use xlink:href="#checkmark-outline"></use></svg><?php esc_html_e( 'Create custom fields with drag-n-drop interface - no coding knowledge required!', 'meta-box' ); ?></li>
14
+ <li><svg class="icon"><use xlink:href="#checkmark-outline"></use></svg><?php esc_html_e( 'Add custom fields to taxonomies or user profile.', 'meta-box' ); ?></li>
15
+ <li><svg class="icon"><use xlink:href="#checkmark-outline"></use></svg><?php esc_html_e( 'Create custom settings pages.', 'meta-box' ); ?></li>
16
+ <li><svg class="icon"><use xlink:href="#checkmark-outline"></use></svg><?php esc_html_e( 'Create frontend submission forms.', 'meta-box' ); ?></li>
17
+ <li><svg class="icon"><use xlink:href="#checkmark-outline"></use></svg><?php esc_html_e( 'Save custom fields in custom tables.', 'meta-box' ); ?></li>
18
+ <li><svg class="icon"><use xlink:href="#checkmark-outline"></use></svg><?php esc_html_e( 'And much more!', 'meta-box' ); ?></li>
19
+ </ul>
20
+ <a class="button button-primary" target="_blank" href="https://metabox.io/pricing/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin"><?php esc_html_e( 'Get Meta Box PRO now', 'meta-box' ); ?></a>
21
+ </div>
22
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
23
+ <symbol id="checkmark-outline" viewBox="0 0 20 20">
24
+ <path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM6.7 9.29L9 11.6l4.3-4.3 1.4 1.42L9 14.4l-3.7-3.7 1.4-1.42z"/>
25
+ </symbol>
26
+ </svg>
inc/meta-box/inc/about/sections/welcome.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Welcome section.
4
+ *
5
+ * @package Meta Box
6
+ * @subpackage MB Custom Post Type
7
+ */
8
+
9
+ ?>
10
+ <h1>
11
+ <?php
12
+ // Translators: %s - Plugin name.
13
+ echo esc_html( sprintf( __( 'Welcome to %s', 'meta-box' ), $this->plugin['Name'] ) );
14
+ ?>
15
+ </h1>
16
+ <div class="about-text"><?php esc_html_e( 'Meta Box is a free Gutenberg and GDPR-compatible WordPress custom fields plugin and framework that makes quick work of customizing a website with—you guessed it—meta boxes and custom fields in WordPress. Follow the instruction below to get started!', 'meta-box' ); ?></div>
17
+ <a target="_blank" class="wp-badge" href="<?php echo esc_url( 'https://metabox.io/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin' ); ?>"><?php echo esc_html( $this->plugin['Name'] ); ?></a>
18
+ <p class="about-buttons">
19
+ <a target="_blank" class="button" href="<?php echo esc_url( 'https://docs.metabox.io?utm_source=WordPress&utm_medium=link&utm_campaign=plugin' ); ?>"><?php esc_html_e( 'Documentation', 'meta-box' ); ?></a>
20
+ <a target="_blank" class="button" href="<?php echo esc_url( 'https://metabox.io/plugins/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin' ); ?>"><?php esc_html_e( 'Extensions', 'meta-box' ); ?></a>
21
+ <a target="_blank" class="button" href="<?php echo esc_url( 'https://metabox.io/support/?utm_source=WordPress&utm_medium=link&utm_campaign=plugin' ); ?>"><?php esc_html_e( 'Support', 'meta-box' ); ?></a>
22
+ <a target="_blank" class="button" href="https://www.facebook.com/sharer/sharer.php?u=https%3A//metabox.io"><span class="dashicons dashicons-facebook-alt"></span> Share</a>
23
+ <a target="_blank" class="button" href="https://twitter.com/home?status=Reduce%20your%20dev%20time!%20Meta%20Box%20is%20the%20most%20powerful%20custom%20fields%20plugin%20for%20WordPress%20on%20the%20web%20https%3A//metabox.io%20via%20%40wpmetabox"><span class="dashicons dashicons-twitter"></span> Tweet</a>
24
+ </p>
inc/meta-box/inc/autoloader.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Autoload plugin classes.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Autoload class
10
+ */
11
+ class RWMB_Autoloader {
12
+
13
+ /**
14
+ * List of directories to load classes.
15
+ *
16
+ * @var array
17
+ */
18
+ protected $dirs = array();
19
+
20
+ /**
21
+ * Adds a base directory for a class name prefix and/or suffix.
22
+ *
23
+ * @param string $base_dir A base directory for class files.
24
+ * @param string $prefix The class name prefix.
25
+ * @param string $suffix The class name suffix.
26
+ */
27
+ public function add( $base_dir, $prefix, $suffix = '' ) {
28
+ $this->dirs[] = array(
29
+ 'dir' => trailingslashit( $base_dir ),
30
+ 'prefix' => $prefix,
31
+ 'suffix' => $suffix,
32
+ );
33
+ }
34
+
35
+ /**
36
+ * Register autoloader for plugin classes.
37
+ * In PHP 5.3, SPL extension cannot be disabled and it's safe to use autoload.
38
+ * However, hosting providers can disable it in PHP 5.2. In that case, we provide a fallback for autoload.
39
+ *
40
+ * @link http://php.net/manual/en/spl.installation.php
41
+ * @link https://github.com/rilwis/meta-box/issues/810
42
+ */
43
+ public function register() {
44
+ spl_autoload_register( array( $this, 'autoload' ) );
45
+ if ( ! class_exists( 'RWMB_Core' ) ) {
46
+ $this->fallback();
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Autoload fields' classes.
52
+ *
53
+ * @param string $class Class name.
54
+ * @return mixed Boolean false if no mapped file can be loaded, or the name of the mapped file that was loaded.
55
+ */
56
+ public function autoload( $class ) {
57
+ foreach ( $this->dirs as $dir ) {
58
+ if (
59
+ ( $dir['prefix'] && 0 !== strpos( $class, $dir['prefix'] ) )
60
+ && ( $dir['suffix'] && substr( $class, - strlen( $dir['suffix'] ) ) !== $dir['suffix'] )
61
+ ) {
62
+ continue;
63
+ }
64
+ $file = substr( $class, strlen( $dir['prefix'] ) );
65
+ if ( $dir['suffix'] && strlen( $file ) > strlen( $dir['suffix'] ) ) {
66
+ $file = substr( $file, 0, - strlen( $dir['suffix'] ) );
67
+ }
68
+ $file = strtolower( str_replace( '_', '-', $file ) ) . '.php';
69
+ $file = $dir['dir'] . $file;
70
+ if ( $this->require_file( $file ) ) {
71
+ return $file;
72
+ }
73
+ }
74
+ return false;
75
+ }
76
+
77
+ /**
78
+ * Fallback for autoload in PHP 5.2.
79
+ */
80
+ protected function fallback() {
81
+ $files = array(
82
+ // Core.
83
+ 'core',
84
+ 'clone',
85
+ 'meta-box',
86
+ 'meta-box-registry',
87
+ 'storage-registry',
88
+ 'interfaces/storage.php',
89
+ 'storages/base.php',
90
+ 'storages/post.php',
91
+ 'validation',
92
+ 'sanitizer',
93
+ 'media-modal',
94
+ 'wpml',
95
+ 'about/about.php',
96
+
97
+ // Walkers.
98
+ 'walkers/walker',
99
+ 'walkers/select',
100
+ 'walkers/select-tree',
101
+ 'walkers/input-list',
102
+
103
+ // Fields.
104
+ 'field',
105
+ 'field-registry',
106
+
107
+ 'fields/multiple-values',
108
+ 'fields/autocomplete',
109
+ 'fields/text-list',
110
+
111
+ 'fields/choice',
112
+
113
+ 'fields/select',
114
+ 'fields/select-advanced',
115
+ 'fields/select-tree',
116
+
117
+ 'fields/input-list',
118
+ 'fields/radio',
119
+ 'fields/checkbox-list',
120
+
121
+ 'fields/object-choice',
122
+ 'fields/post',
123
+ 'fields/taxonomy',
124
+ 'fields/taxonomy-advanced',
125
+ 'fields/user',
126
+
127
+ 'fields/input',
128
+
129
+ 'fields/checkbox',
130
+ 'fields/number',
131
+ 'fields/range',
132
+
133
+ 'fields/text',
134
+ 'fields/color',
135
+ 'fields/datetime',
136
+ 'fields/date',
137
+ 'fields/time',
138
+ 'fields/fieldset-text',
139
+ 'fields/key-value',
140
+ 'fields/oembed',
141
+ 'fields/password',
142
+
143
+ 'fields/file-input',
144
+ 'fields/file',
145
+ 'fields/image',
146
+ 'fields/image-select',
147
+
148
+ 'fields/media',
149
+ 'fields/file-upload',
150
+ 'fields/image-advanced',
151
+ 'fields/image-upload',
152
+
153
+ 'fields/button',
154
+ 'fields/custom-html',
155
+ 'fields/divider',
156
+ 'fields/heading',
157
+ 'fields/map',
158
+ 'fields/slider',
159
+ 'fields/textarea',
160
+ 'fields/wysiwyg',
161
+ );
162
+ foreach ( $files as $file ) {
163
+ $this->require_file( RWMB_INC_DIR . "$file.php" );
164
+ }
165
+ }
166
+
167
+ /**
168
+ * If a file exists, require it from the file system.
169
+ *
170
+ * @param string $file The file to require.
171
+ * @return bool True if the file exists, false if not.
172
+ */
173
+ protected function require_file( $file ) {
174
+ if ( file_exists( $file ) ) {
175
+ require_once $file;
176
+ return true;
177
+ }
178
+ return false;
179
+ }
180
+ }
inc/meta-box/inc/clone.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The clone module, allowing users to clone (duplicate) fields.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The clone class.
10
+ */
11
+ class RWMB_Clone {
12
+ /**
13
+ * Get clone field HTML.
14
+ *
15
+ * @param mixed $meta The meta value.
16
+ * @param array $field The field parameters.
17
+ *
18
+ * @return string
19
+ */
20
+ public static function html( $meta, $field ) {
21
+ $field_html = '';
22
+
23
+ /**
24
+ * Note: $meta must contain value so that the foreach loop runs!
25
+ *
26
+ * @see meta()
27
+ */
28
+ foreach ( $meta as $index => $sub_meta ) {
29
+ $sub_field = $field;
30
+ $sub_field['field_name'] = $field['field_name'] . "[{$index}]";
31
+ if ( $index > 0 ) {
32
+ if ( isset( $sub_field['address_field'] ) ) {
33
+ $sub_field['address_field'] = $field['address_field'] . "_{$index}";
34
+ }
35
+ $sub_field['id'] = $field['id'] . "_{$index}";
36
+
37
+ if ( ! empty( $sub_field['attributes']['id'] ) ) {
38
+ $sub_field['attributes']['id'] = $sub_field['attributes']['id'] . "_{$index}";
39
+ }
40
+ }
41
+
42
+ if ( in_array( $sub_field['type'], array( 'file', 'image' ), true ) ) {
43
+ $sub_field['file_input_name'] = $field['file_input_name'] . "[{$index}]";
44
+ } elseif ( $field['multiple'] ) {
45
+ $sub_field['field_name'] .= '[]';
46
+ }
47
+
48
+ // Wrap field HTML in a div with class="rwmb-clone" if needed.
49
+ $class = "rwmb-clone rwmb-{$field['type']}-clone";
50
+ $sort_icon = '';
51
+ if ( $field['sort_clone'] ) {
52
+ $class .= ' rwmb-sort-clone';
53
+ $sort_icon = "<a href='javascript:;' class='rwmb-clone-icon'></a>";
54
+ }
55
+ $input_html = "<div class='$class'>" . $sort_icon;
56
+
57
+ // Call separated methods for displaying each type of field.
58
+ $input_html .= RWMB_Field::call( $sub_field, 'html', $sub_meta );
59
+ $input_html = RWMB_Field::filter( 'html', $input_html, $sub_field, $sub_meta );
60
+
61
+ // Remove clone button.
62
+ $input_html .= self::remove_clone_button( $sub_field );
63
+ $input_html .= '</div>';
64
+
65
+ $field_html .= $input_html;
66
+ } // End foreach().
67
+
68
+ return $field_html;
69
+ }
70
+
71
+ /**
72
+ * Set value of meta before saving into database
73
+ *
74
+ * @param mixed $new The submitted meta value.
75
+ * @param mixed $old The existing meta value.
76
+ * @param int $post_id The post ID.
77
+ * @param array $field The field parameters.
78
+ *
79
+ * @return mixed
80
+ */
81
+ public static function value( $new, $old, $post_id, $field ) {
82
+ if ( ! is_array( $new ) ) {
83
+ $new = array();
84
+ }
85
+
86
+ if ( in_array( $field['type'], array( 'file', 'image' ), true ) ) {
87
+ return RWMB_Field::call( $field, 'value', $new, '', $post_id );
88
+ }
89
+
90
+ foreach ( $new as $key => $value ) {
91
+ $old_value = isset( $old[ $key ] ) ? $old[ $key ] : null;
92
+ $value = RWMB_Field::call( $field, 'value', $value, $old_value, $post_id );
93
+ $new[ $key ] = RWMB_Field::filter( 'sanitize', $value, $field );
94
+ }
95
+
96
+ return $new;
97
+ }
98
+
99
+ /**
100
+ * Add clone button.
101
+ *
102
+ * @param array $field Field parameters.
103
+ * @return string $html
104
+ */
105
+ public static function add_clone_button( $field ) {
106
+ if ( ! $field['clone'] ) {
107
+ return '';
108
+ }
109
+ $text = RWMB_Field::filter( 'add_clone_button_text', $field['add_button'], $field );
110
+ return '<a href="#" class="rwmb-button button-primary add-clone">' . esc_html( $text ) . '</a>';
111
+ }
112
+
113
+ /**
114
+ * Remove clone button.
115
+ *
116
+ * @param array $field Field parameters.
117
+ * @return string $html
118
+ */
119
+ public static function remove_clone_button( $field ) {
120
+ $text = RWMB_Field::filter( 'remove_clone_button_text', '<i class="dashicons dashicons-minus"></i>', $field );
121
+ return '<a href="#" class="rwmb-button remove-clone">' . $text . '</a>';
122
+ }
123
+ }
inc/meta-box/inc/common.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Common' ) )
6
- {
7
- /**
8
- * Common functions for the plugin
9
- * Independent from meta box/field classes
10
- */
11
- class RWMB_Common
12
- {
13
- /**
14
- * Do actions when class is loaded
15
- *
16
- * @return void
17
- */
18
- public static function on_load()
19
- {
20
- self::load_textdomain();
21
-
22
- $plugin = 'meta-box/meta-box.php';
23
- add_filter( "plugin_action_links_$plugin", array( __CLASS__, 'plugin_links' ) );
24
- }
25
-
26
- /**
27
- * Load plugin translation
28
- *
29
- * @return void
30
- */
31
- public static function load_textdomain()
32
- {
33
- // l18n translation files
34
- $locale = get_locale();
35
- $dir = trailingslashit( RWMB_DIR . 'lang' );
36
- $mofile = "{$dir}{$locale}.mo";
37
-
38
- // In themes/plugins/mu-plugins directory
39
- load_textdomain( 'rwmb', $mofile );
40
- }
41
-
42
- /**
43
- * Add links to Documentation and Extensions in plugin's list of action links
44
- *
45
- * @since 4.3.11
46
- *
47
- * @param array $links Array of action links
48
- *
49
- * @return array
50
- */
51
- public static function plugin_links( $links )
52
- {
53
- $links[] = '<a href="http://metabox.io/docs/">' . __( 'Documentation', 'meta-box' ) . '</a>';
54
- $links[] = '<a href="http://metabox.io/plugins/">' . __( 'Extensions', 'meta-box' ) . '</a>';
55
- return $links;
56
- }
57
-
58
- }
59
-
60
- RWMB_Common::on_load();
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/core.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The plugin core class which initialize plugin's code.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The Meta Box core class.
10
+ *
11
+ * @package Meta Box
12
+ */
13
+ class RWMB_Core {
14
+ /**
15
+ * Initialization.
16
+ */
17
+ public function init() {
18
+ load_plugin_textdomain( 'meta-box', false, plugin_basename( RWMB_DIR ) . '/languages/' );
19
+
20
+ add_filter( 'plugin_action_links_meta-box/meta-box.php', array( $this, 'plugin_links' ), 20 );
21
+
22
+ // Uses priority 20 to support custom port types registered using the default priority.
23
+ add_action( 'init', array( $this, 'register_meta_boxes' ), 20 );
24
+ add_action( 'edit_page_form', array( $this, 'fix_page_template' ) );
25
+ $this->add_context_hooks();
26
+ }
27
+
28
+ /**
29
+ * Add links to Documentation and Extensions in plugin's list of action links.
30
+ *
31
+ * @since 4.3.11
32
+ *
33
+ * @param array $links Array of plugin links.
34
+ *
35
+ * @return array
36
+ */
37
+ public function plugin_links( $links ) {
38
+ $links[] = '<a href="https://docs.metabox.io">' . esc_html__( 'Documentation', 'meta-box' ) . '</a>';
39
+ $links[] = '<a href="https://metabox.io/plugins/" style="color: #39b54a; font-weight: bold">' . esc_html__( 'Extensions', 'meta-box' ) . '</a>';
40
+ return $links;
41
+ }
42
+
43
+ /**
44
+ * Register meta boxes.
45
+ * Advantages:
46
+ * - prevents incorrect hook.
47
+ * - no need to check for class existences.
48
+ */
49
+ public function register_meta_boxes() {
50
+ $configs = apply_filters( 'rwmb_meta_boxes', array() );
51
+ $meta_boxes = rwmb_get_registry( 'meta_box' );
52
+
53
+ foreach ( $configs as $config ) {
54
+ $meta_box = rwmb_get_meta_box( $config );
55
+ $meta_boxes->add( $meta_box );
56
+ $meta_box->register_fields();
57
+ }
58
+ }
59
+
60
+ /**
61
+ * WordPress will prevent post data saving if a page template has been selected that does not exist.
62
+ * This is especially a problem when switching to our theme, and old page templates are in the post data.
63
+ * Unset the page template if the page does not exist to allow the post to save.
64
+ *
65
+ * @param WP_Post $post Post object.
66
+ *
67
+ * @since 4.3.10
68
+ */
69
+ public function fix_page_template( WP_Post $post ) {
70
+ $template = get_post_meta( $post->ID, '_wp_page_template', true );
71
+ $page_templates = wp_get_theme()->get_page_templates();
72
+
73
+ // If the template doesn't exists, remove the data to allow WordPress to save.
74
+ if ( ! isset( $page_templates[ $template ] ) ) {
75
+ delete_post_meta( $post->ID, '_wp_page_template' );
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Get registered meta boxes via a filter.
81
+ *
82
+ * @deprecated No longer used. Keep for backward-compatibility with extensions.
83
+ *
84
+ * @return array
85
+ */
86
+ public static function get_meta_boxes() {
87
+ $meta_boxes = rwmb_get_registry( 'meta_box' )->all();
88
+ return wp_list_pluck( $meta_boxes, 'meta_box' );
89
+ }
90
+
91
+ /**
92
+ * Add hooks for extra contexts.
93
+ */
94
+ public function add_context_hooks() {
95
+ $hooks = array(
96
+ 'edit_form_top',
97
+ 'edit_form_after_title',
98
+ 'edit_form_after_editor',
99
+ 'edit_form_before_permalink',
100
+ );
101
+
102
+ foreach ( $hooks as $hook ) {
103
+ add_action( $hook, array( $this, 'add_context' ) );
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Add new meta box context.
109
+ *
110
+ * @param WP_Post $post The current post object.
111
+ */
112
+ public function add_context( $post ) {
113
+ $hook = current_filter();
114
+ $context = 'edit_form_top' === $hook ? 'form_top' : substr( $hook, 10 );
115
+ do_meta_boxes( null, $context, $post );
116
+ }
117
+ }
inc/meta-box/inc/field-registry.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * A registry for storing all fields.
4
+ *
5
+ * @link https://designpatternsphp.readthedocs.io/en/latest/Structural/Registry/README.html
6
+ * @package Meta Box
7
+ */
8
+
9
+ /**
10
+ * Field registry class.
11
+ */
12
+ class RWMB_Field_Registry {
13
+ /**
14
+ * Internal data storage.
15
+ *
16
+ * @var array
17
+ */
18
+ private $data = array();
19
+
20
+ /**
21
+ * Add a single field to the registry.
22
+ *
23
+ * @param array $field Field configuration.
24
+ * @param string $type Post type|Taxonomy|'user'|Setting page which the field belongs to.
25
+ * @param string $object_type Object type which the field belongs to.
26
+ */
27
+ public function add( $field, $type, $object_type = 'post' ) {
28
+ if ( ! isset( $field['id'] ) ) {
29
+ return;
30
+ }
31
+
32
+ if ( empty( $this->data[ $object_type ] ) ) {
33
+ $this->data[ $object_type ] = array();
34
+ }
35
+ if ( empty( $this->data[ $object_type ][ $type ] ) ) {
36
+ $this->data[ $object_type ][ $type ] = array();
37
+ }
38
+ $this->data[ $object_type ][ $type ][ $field['id'] ] = $field;
39
+ }
40
+
41
+ /**
42
+ * Retrieve a field.
43
+ *
44
+ * @param string $id A meta box instance id.
45
+ * @param string $type Post type|Taxonomy|'user'|Setting page which the field belongs to.
46
+ * @param string $object_type Object type which the field belongs to.
47
+ *
48
+ * @return bool|array False or field configuration.
49
+ */
50
+ public function get( $id, $type, $object_type = 'post' ) {
51
+ return isset( $this->data[ $object_type ][ $type ][ $id ] ) ? $this->data[ $object_type ][ $type ][ $id ] : false;
52
+ }
53
+
54
+ /**
55
+ * Retrieve fields by object type.
56
+ *
57
+ * @param string $object_type Object type which the field belongs to.
58
+ *
59
+ * @return array List of fields.
60
+ */
61
+ public function get_by_object_type( $object_type = 'post' ) {
62
+ return isset( $this->data[ $object_type ] ) ? $this->data[ $object_type ] : array();
63
+ }
64
+ }
inc/meta-box/inc/field.php CHANGED
@@ -1,335 +1,685 @@
1
  <?php
2
- if ( ! class_exists( 'RWMB_Field ' ) )
3
- {
4
- class RWMB_Field
5
- {
6
- /**
7
- * Add actions
8
- *
9
- * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  */
11
- static function add_actions()
12
- {
13
  }
 
14
 
15
- /**
16
- * Enqueue scripts and styles
17
- *
18
- * @return void
19
- */
20
- static function admin_enqueue_scripts()
21
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  /**
25
- * Show field HTML
26
- * Filters are put inside this method, not inside methods such as "meta", "html", "begin_html", etc.
27
- * That ensures the returned value are always been applied filters
28
- * This method is not meant to be overwritten in specific fields
29
- *
30
- * @param array $field
31
- * @param bool $saved
32
- *
33
- * @return string
34
  */
35
- static function show( $field, $saved )
36
- {
37
- global $post;
38
-
39
- $field_class = RW_Meta_Box::get_class_name( $field );
40
- $meta = call_user_func( array( $field_class, 'meta' ), $post->ID, $saved, $field );
41
-
42
- // Apply filter to field meta value
43
- // 1st filter applies to all fields
44
- // 2nd filter applies to all fields with the same type
45
- // 3rd filter applies to current field only
46
- $meta = apply_filters( 'rwmb_field_meta', $meta, $field, $saved );
47
- $meta = apply_filters( "rwmb_{$field['type']}_meta", $meta, $field, $saved );
48
- $meta = apply_filters( "rwmb_{$field['id']}_meta", $meta, $field, $saved );
49
-
50
- $type = $field['type'];
51
- $id = $field['id'];
52
-
53
- $begin = call_user_func( array( $field_class, 'begin_html' ), $meta, $field );
54
-
55
- // Apply filter to field begin HTML
56
- // 1st filter applies to all fields
57
- // 2nd filter applies to all fields with the same type
58
- // 3rd filter applies to current field only
59
- $begin = apply_filters( 'rwmb_begin_html', $begin, $field, $meta );
60
- $begin = apply_filters( "rwmb_{$type}_begin_html", $begin, $field, $meta );
61
- $begin = apply_filters( "rwmb_{$id}_begin_html", $begin, $field, $meta );
62
-
63
- // Separate code for cloneable and non-cloneable fields to make easy to maintain
64
-
65
- // Cloneable fields
66
- if ( $field['clone'] )
67
- {
68
  $meta = (array) $meta;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
- $field_html = '';
 
 
 
 
 
 
 
 
 
71
 
72
- foreach ( $meta as $index => $sub_meta )
73
- {
74
- $sub_field = $field;
75
- $sub_field['field_name'] = $field['field_name'] . "[{$index}]";
76
- if ( $index > 0 )
77
- {
78
- if ( isset( $sub_field['address_field'] ) )
79
- $sub_field['address_field'] = $field['address_field'] . "_{$index}";
80
- $sub_field['id'] = $field['id'] . "_{$index}";
81
- }
82
- if ( $field['multiple'] )
83
- $sub_field['field_name'] .= '[]';
 
84
 
85
- // Wrap field HTML in a div with class="rwmb-clone" if needed
86
- $input_html = '<div class="rwmb-clone">';
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
- // Call separated methods for displaying each type of field
89
- $input_html .= call_user_func( array( $field_class, 'html' ), $sub_meta, $sub_field );
 
 
 
90
 
91
- // Apply filter to field HTML
92
- // 1st filter applies to all fields with the same type
93
- // 2nd filter applies to current field only
94
- $input_html = apply_filters( "rwmb_{$type}_html", $input_html, $field, $sub_meta );
95
- $input_html = apply_filters( "rwmb_{$id}_html", $input_html, $field, $sub_meta );
96
 
97
- // Remove clone button
98
- $input_html .= call_user_func( array( $field_class, 'remove_clone_button' ), $sub_meta, $sub_field );
 
99
 
100
- $input_html .= '</div>';
 
101
 
102
- $field_html .= $input_html;
 
103
  }
 
 
104
  }
105
- // Non-cloneable fields
106
- else
107
- {
108
- // Call separated methods for displaying each type of field
109
- $field_html = call_user_func( array( $field_class, 'html' ), $meta, $field );
110
-
111
- // Apply filter to field HTML
112
- // 1st filter applies to all fields with the same type
113
- // 2nd filter applies to current field only
114
- $field_html = apply_filters( "rwmb_{$type}_html", $field_html, $field, $meta );
115
- $field_html = apply_filters( "rwmb_{$id}_html", $field_html, $field, $meta );
116
  }
117
 
118
- $end = call_user_func( array( $field_class, 'end_html' ), $meta, $field );
119
-
120
- // Apply filter to field end HTML
121
- // 1st filter applies to all fields
122
- // 2nd filter applies to all fields with the same type
123
- // 3rd filter applies to current field only
124
- $end = apply_filters( 'rwmb_end_html', $end, $field, $meta );
125
- $end = apply_filters( "rwmb_{$type}_end_html", $end, $field, $meta );
126
- $end = apply_filters( "rwmb_{$id}_end_html", $end, $field, $meta );
127
-
128
- // Apply filter to field wrapper
129
- // This allow users to change whole HTML markup of the field wrapper (i.e. table row)
130
- // 1st filter applies to all fields
131
- // 1st filter applies to all fields with the same type
132
- // 2nd filter applies to current field only
133
- $html = apply_filters( 'rwmb_wrapper_html', "{$begin}{$field_html}{$end}", $field, $meta );
134
- $html = apply_filters( "rwmb_{$type}_wrapper_html", $html, $field, $meta );
135
- $html = apply_filters( "rwmb_{$id}_wrapper_html", $html, $field, $meta );
136
-
137
- // Display label and input in DIV and allow user-defined classes to be appended
138
- $classes = array( 'rwmb-field', "rwmb-{$type}-wrapper" );
139
- if ( 'hidden' === $field['type'] )
140
- $classes[] = 'hidden';
141
- if ( ! empty( $field['required'] ) )
142
- $classes[] = 'required';
143
- if ( ! empty( $field['class'] ) )
144
- $classes[] = $field['class'];
145
-
146
- $outer_html = sprintf(
147
- $field['before'] . '<div class="%s">%s</div>' . $field['after'],
148
- implode( ' ', $classes ),
149
- $html
150
- );
151
 
152
- // Allow to change output of outer div
153
- // 1st filter applies to all fields
154
- // 1st filter applies to all fields with the same type
155
- // 2nd filter applies to current field only
156
- $outer_html = apply_filters( 'rwmb_outer_html', $outer_html, $field, $meta );
157
- $outer_html = apply_filters( "rwmb_{$type}_outer_html", $outer_html, $field, $meta );
158
- $outer_html = apply_filters( "rwmb_{$id}_outer_html", $outer_html, $field, $meta );
159
 
160
- echo $outer_html;
 
 
 
 
 
 
 
 
 
 
 
 
161
  }
162
 
163
- /**
164
- * Get field HTML
165
- *
166
- * @param mixed $meta
167
- * @param array $field
168
- *
169
- * @return string
170
- */
171
- static function html( $meta, $field )
172
- {
173
- return '';
 
 
174
  }
175
 
176
- /**
177
- * Show begin HTML markup for fields
178
- *
179
- * @param mixed $meta
180
- * @param array $field
181
- *
182
- * @return string
183
- */
184
- static function begin_html( $meta, $field )
185
- {
186
- if ( empty( $field['name'] ) )
187
- return '<div class="rwmb-input">';
188
 
189
- return sprintf(
190
- '<div class="rwmb-label">
191
- <label for="%s">%s</label>
192
- </div>
193
- <div class="rwmb-input">',
194
- $field['id'],
195
- $field['name']
196
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  }
198
 
199
- /**
200
- * Show end HTML markup for fields
201
- *
202
- * @param mixed $meta
203
- * @param array $field
204
- *
205
- * @return string
206
- */
207
- static function end_html( $meta, $field )
208
- {
209
- $button = $field['clone'] ? call_user_func( array( RW_Meta_Box::get_class_name( $field ), 'add_clone_button' ) ) : '';
210
- $desc = $field['desc'] ? "<p id='{$field['id']}_description' class='description'>{$field['desc']}</p>" : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
- // Closes the container
213
- $html = "{$button}{$desc}</div>";
 
214
 
215
- return $html;
216
  }
217
 
218
- /**
219
- * Add clone button
220
- *
221
- * @return string $html
222
- */
223
- static function add_clone_button()
224
- {
225
- return '<a href="#" class="rwmb-button button-primary add-clone">' . __( '+', 'meta-box' ) . '</a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  }
227
 
228
- /**
229
- * Remove clone button
230
- *
231
- * @return string $html
232
- */
233
- static function remove_clone_button()
234
- {
235
- return '<a href="#" class="rwmb-button button remove-clone">' . __( '&#8211;', 'meta-box' ) . '</a>';
236
  }
237
 
238
- /**
239
- * Get meta value
240
- *
241
- * @param int $post_id
242
- * @param bool $saved
243
- * @param array $field
244
- *
245
- * @return mixed
246
- */
247
- static function meta( $post_id, $saved, $field )
248
- {
249
- $meta = get_post_meta( $post_id, $field['id'], ! $field['multiple'] );
250
 
251
- // Use $field['std'] only when the meta box hasn't been saved (i.e. the first time we run)
252
- $meta = ( ! $saved && '' === $meta || array() === $meta ) ? $field['std'] : $meta;
 
 
253
 
254
- // Escape attributes for non-wysiwyg fields
255
- if ( 'wysiwyg' !== $field['type'] )
256
- $meta = is_array( $meta ) ? array_map( 'esc_attr', $meta ) : esc_attr( $meta );
257
 
258
- return $meta;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
260
 
261
- /**
262
- * Set value of meta before saving into database
263
- *
264
- * @param mixed $new
265
- * @param mixed $old
266
- * @param int $post_id
267
- * @param array $field
268
- *
269
- * @return int
270
- */
271
- static function value( $new, $old, $post_id, $field )
272
- {
273
- return $new;
 
 
 
274
  }
 
 
 
 
 
 
 
275
 
276
- /**
277
- * Save meta value
278
- *
279
- * @param $new
280
- * @param $old
281
- * @param $post_id
282
- * @param $field
283
- */
284
- static function save( $new, $old, $post_id, $field )
285
- {
286
- $name = $field['id'];
 
 
 
 
 
 
 
 
 
 
287
 
288
- if ( '' === $new || array() === $new )
289
- {
290
- delete_post_meta( $post_id, $name );
 
 
 
 
 
 
 
 
 
 
291
 
292
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  }
 
294
 
295
- if ( $field['multiple'] )
296
- {
297
- foreach ( $new as $new_value )
298
- {
299
- if ( ! in_array( $new_value, $old ) )
300
- add_post_meta( $post_id, $name, $new_value, false );
301
- }
302
- foreach ( $old as $old_value )
303
- {
304
- if ( ! in_array( $old_value, $new ) )
305
- delete_post_meta( $post_id, $name, $old_value );
306
- }
307
- }
308
- else
309
- {
310
- if ( $field['clone'] )
311
- {
312
- $new = (array) $new;
313
- foreach ( $new as $k => $v )
314
- {
315
- if ( '' === $v )
316
- unset( $new[$k] );
317
- }
318
- }
319
- update_post_meta( $post_id, $name, $new );
320
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  }
322
 
323
- /**
324
- * Normalize parameters for field
325
- *
326
- * @param array $field
327
- *
328
- * @return array
329
- */
330
- static function normalize_field( $field )
331
- {
332
- return $field;
333
  }
 
 
334
  }
335
  }
1
  <?php
2
+ /**
3
+ * The field base class.
4
+ * This is the parent class of all custom fields defined by the plugin, which defines all the common methods.
5
+ * Fields must inherit this class and overwrite methods with its own.
6
+ *
7
+ * @package Meta Box
8
+ */
9
+
10
+ /**
11
+ * The field base class.
12
+ */
13
+ abstract class RWMB_Field {
14
+ /**
15
+ * Add actions.
16
+ */
17
+ public static function add_actions() {
18
+ }
19
+
20
+ /**
21
+ * Enqueue scripts and styles.
22
+ */
23
+ public static function admin_enqueue_scripts() {
24
+ }
25
+
26
+ /**
27
+ * Localize scripts with prevention of loading localized data twice.
28
+ *
29
+ * @link https://github.com/rilwis/meta-box/issues/850
30
+ *
31
+ * @param string $handle Script handle.
32
+ * @param string $name Object name.
33
+ * @param mixed $data Localized data.
34
+ */
35
+ public static function localize_script( $handle, $name, $data ) {
36
+ /*
37
+ * Check with function_exists to make it work in WordPress 4.1.
38
+ * @link https://github.com/rilwis/meta-box/issues/1009
39
  */
40
+ if ( ! function_exists( 'wp_scripts' ) || ! wp_scripts()->get_data( $handle, 'data' ) ) {
41
+ wp_localize_script( $handle, $name, $data );
42
  }
43
+ }
44
 
45
+ /**
46
+ * Show field HTML
47
+ * Filters are put inside this method, not inside methods such as "meta", "html", "begin_html", etc.
48
+ * That ensures the returned value are always been applied filters.
49
+ * This method is not meant to be overwritten in specific fields.
50
+ *
51
+ * @param array $field Field parameters.
52
+ * @param bool $saved Whether the meta box is saved at least once.
53
+ * @param int $post_id Post ID.
54
+ */
55
+ public static function show( $field, $saved, $post_id = 0 ) {
56
+ $meta = self::call( $field, 'meta', $post_id, $saved );
57
+ $meta = self::filter( 'field_meta', $meta, $field, $saved );
58
+
59
+ $begin = self::call( $field, 'begin_html', $meta );
60
+ $begin = self::filter( 'begin_html', $begin, $field, $meta );
61
+
62
+ // Separate code for cloneable and non-cloneable fields to make easy to maintain.
63
+ if ( $field['clone'] ) {
64
+ $field_html = RWMB_Clone::html( $meta, $field );
65
+ } else {
66
+ // Call separated methods for displaying each type of field.
67
+ $field_html = self::call( $field, 'html', $meta );
68
+ $field_html = self::filter( 'html', $field_html, $field, $meta );
69
  }
70
 
71
+ $end = self::call( $field, 'end_html', $meta );
72
+ $end = self::filter( 'end_html', $end, $field, $meta );
73
+
74
+ $html = self::filter( 'wrapper_html', "$begin$field_html$end", $field, $meta );
75
+
76
+ // Display label and input in DIV and allow user-defined classes to be appended.
77
+ $classes = "rwmb-field rwmb-{$field['type']}-wrapper " . $field['class'];
78
+ if ( 'hidden' === $field['type'] ) {
79
+ $classes .= ' hidden';
80
+ }
81
+ if ( ! empty( $field['required'] ) ) {
82
+ $classes .= ' required';
83
+ }
84
+
85
+ $outer_html = sprintf(
86
+ $field['before'] . '<div class="%s">%s</div>' . $field['after'],
87
+ trim( $classes ),
88
+ $html
89
+ );
90
+ $outer_html = self::filter( 'outer_html', $outer_html, $field, $meta );
91
+
92
+ echo $outer_html; // WPCS: XSS OK.
93
+ }
94
+
95
+ /**
96
+ * Get field HTML.
97
+ *
98
+ * @param mixed $meta Meta value.
99
+ * @param array $field Field parameters.
100
+ *
101
+ * @return string
102
+ */
103
+ public static function html( $meta, $field ) {
104
+ return '';
105
+ }
106
+
107
+ /**
108
+ * Show begin HTML markup for fields.
109
+ *
110
+ * @param mixed $meta Meta value.
111
+ * @param array $field Field parameters.
112
+ *
113
+ * @return string
114
+ */
115
+ public static function begin_html( $meta, $field ) {
116
+ $field_label = '';
117
+ if ( $field['name'] ) {
118
+ $field_label = sprintf(
119
+ '<div class="rwmb-label">
120
+ <label for="%s">%s</label>
121
+ %s
122
+ </div>',
123
+ esc_attr( $field['id'] ),
124
+ $field['name'],
125
+ self::label_description( $field )
126
+ );
127
+ }
128
+
129
+ $data_max_clone = is_numeric( $field['max_clone'] ) && $field['max_clone'] > 1 ? ' data-max-clone=' . $field['max_clone'] : '';
130
+
131
+ $input_open = sprintf(
132
+ '<div class="rwmb-input"%s>',
133
+ $data_max_clone
134
+ );
135
+
136
+ return $field_label . $input_open;
137
+ }
138
+
139
+ /**
140
+ * Show end HTML markup for fields.
141
+ *
142
+ * @param mixed $meta Meta value.
143
+ * @param array $field Field parameters.
144
+ *
145
+ * @return string
146
+ */
147
+ public static function end_html( $meta, $field ) {
148
+ return RWMB_Clone::add_clone_button( $field ) . self::call( 'input_description', $field ) . '</div>';
149
+ }
150
+
151
+ /**
152
+ * Display field label description.
153
+ *
154
+ * @param array $field Field parameters.
155
+ * @return string
156
+ */
157
+ protected static function label_description( $field ) {
158
+ $id = $field['id'] ? ' id="' . esc_attr( $field['id'] ) . '-label-description"' : '';
159
+ return $field['label_description'] ? "<p{$id} class='description'>{$field['label_description']}</p>" : '';
160
+ }
161
+
162
+ /**
163
+ * Display field description.
164
+ *
165
+ * @param array $field Field parameters.
166
+ * @return string
167
+ */
168
+ protected static function input_description( $field ) {
169
+ $id = $field['id'] ? ' id="' . esc_attr( $field['id'] ) . '-description"' : '';
170
+ return $field['desc'] ? "<p{$id} class='description'>{$field['desc']}</p>" : '';
171
+ }
172
+
173
+ /**
174
+ * Get raw meta value.
175
+ *
176
+ * @param int $object_id Object ID.
177
+ * @param array $field Field parameters.
178
+ * @param array $args Arguments of {@see rwmb_meta()} helper.
179
+ *
180
+ * @return mixed
181
+ */
182
+ public static function raw_meta( $object_id, $field, $args = array() ) {
183
+ if ( empty( $field['id'] ) ) {
184
+ return '';
185
+ }
186
+
187
+ if ( isset( $args['object_type'] ) ) {
188
+ $storage = rwmb_get_storage( $args['object_type'] );
189
+ } elseif ( isset( $field['storage'] ) ) {
190
+ $storage = $field['storage'];
191
+ } else {
192
+ $storage = rwmb_get_storage( 'post' );
193
+ }
194
+
195
+ if ( ! isset( $args['single'] ) ) {
196
+ $args['single'] = $field['clone'] || ! $field['multiple'];
197
+ }
198
+
199
+ if ( $field['clone'] && $field['clone_as_multiple'] ) {
200
+ $args['single'] = false;
201
+ }
202
+
203
+ return $storage->get( $object_id, $field['id'], $args );
204
+ }
205
+
206
+ /**
207
+ * Get meta value.
208
+ *
209
+ * @param int $post_id Post ID.
210
+ * @param bool $saved Whether the meta box is saved at least once.
211
+ * @param array $field Field parameters.
212
+ *
213
+ * @return mixed
214
+ */
215
+ public static function meta( $post_id, $saved, $field ) {
216
  /**
217
+ * For special fields like 'divider', 'heading' which don't have ID, just return empty string
218
+ * to prevent notice error when displaying fields.
 
 
 
 
 
 
 
219
  */
220
+ if ( empty( $field['id'] ) ) {
221
+ return '';
222
+ }
223
+
224
+ // Get raw meta.
225
+ $meta = self::call( $field, 'raw_meta', $post_id );
226
+
227
+ // Use $field['std'] only when the meta box hasn't been saved (i.e. the first time we run).
228
+ $meta = ! $saved ? $field['std'] : $meta;
229
+
230
+ // Ensure multiple fields are arrays.
231
+ if ( $field['multiple'] ) {
232
+ if ( $field['clone'] ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  $meta = (array) $meta;
234
+ foreach ( $meta as $key => $m ) {
235
+ $meta[ $key ] = (array) $m;
236
+ }
237
+ } else {
238
+ $meta = (array) $meta;
239
+ }
240
+ }
241
+ // Escape attributes.
242
+ $meta = self::call( $field, 'esc_meta', $meta );
243
+
244
+ // Make sure meta value is an array for clonable and multiple fields.
245
+ if ( $field['clone'] || $field['multiple'] ) {
246
+ if ( empty( $meta ) || ! is_array( $meta ) ) {
247
+ /**
248
+ * If field is clonable, $meta must be an array with values so that the foreach loop in self::show() runs properly.
249
+ *
250
+ * @see self::show()
251
+ */
252
+ $meta = $field['clone'] ? array( '' ) : array();
253
+ }
254
+ }
255
+
256
+ return $meta;
257
+ }
258
 
259
+ /**
260
+ * Escape meta for field output.
261
+ *
262
+ * @param mixed $meta Meta value.
263
+ *
264
+ * @return mixed
265
+ */
266
+ public static function esc_meta( $meta ) {
267
+ return is_array( $meta ) ? array_map( __METHOD__, $meta ) : esc_attr( $meta );
268
+ }
269
 
270
+ /**
271
+ * Set value of meta before saving into database.
272
+ *
273
+ * @param mixed $new The submitted meta value.
274
+ * @param mixed $old The existing meta value.
275
+ * @param int $post_id The post ID.
276
+ * @param array $field The field parameters.
277
+ *
278
+ * @return int
279
+ */
280
+ public static function value( $new, $old, $post_id, $field ) {
281
+ return $new;
282
+ }
283
 
284
+ /**
285
+ * Save meta value.
286
+ *
287
+ * @param mixed $new The submitted meta value.
288
+ * @param mixed $old The existing meta value.
289
+ * @param int $post_id The post ID.
290
+ * @param array $field The field parameters.
291
+ */
292
+ public static function save( $new, $old, $post_id, $field ) {
293
+ if ( empty( $field['id'] ) ) {
294
+ return;
295
+ }
296
+ $name = $field['id'];
297
+ $storage = $field['storage'];
298
 
299
+ // Remove post meta if it's empty.
300
+ if ( '' === $new || array() === $new ) {
301
+ $storage->delete( $post_id, $name );
302
+ return;
303
+ }
304
 
305
+ // Save cloned fields as multiple values instead serialized array.
306
+ if ( $field['clone'] && $field['clone_as_multiple'] ) {
307
+ $old = array_filter( (array) $old );
308
+ $new = array_filter( (array) $new );
 
309
 
310
+ if ( empty( $new ) ) {
311
+ $storage->delete( $post_id, $name );
312
+ }
313
 
314
+ if ( $field['sort_clone'] && array_values( $new ) != array_values( $old ) ) {
315
+ $storage->delete( $post_id, $name );
316
 
317
+ foreach ( $new as $new_value ) {
318
+ $storage->add( $post_id, $name, $new_value, false );
319
  }
320
+
321
+ return;
322
  }
323
+
324
+ $new_values = array_diff( $new, $old );
325
+ foreach ( $new_values as $new_value ) {
326
+ $storage->add( $post_id, $name, $new_value, false );
 
 
 
 
 
 
 
327
  }
328
 
329
+ $old_values = array_diff( $old, $new );
330
+ foreach ( $old_values as $old_value ) {
331
+ $storage->delete( $post_id, $name, $old_value );
332
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
 
334
+ return;
335
+ }
 
 
 
 
 
336
 
337
+ // If field is cloneable, value is saved as a single entry in the database.
338
+ if ( $field['clone'] ) {
339
+ // Remove empty values.
340
+ $new = (array) $new;
341
+ foreach ( $new as $k => $v ) {
342
+ if ( '' === $v || array() === $v ) {
343
+ unset( $new[ $k ] );
344
+ }
345
+ }
346
+ // Reset indexes.
347
+ $new = array_values( $new );
348
+ $storage->update( $post_id, $name, $new );
349
+ return;
350
  }
351
 
352
+ // If field is multiple, value is saved as multiple entries in the database (WordPress behaviour).
353
+ if ( $field['multiple'] ) {
354
+ $old = (array) $old;
355
+ $new = (array) $new;
356
+ $new_values = array_diff( $new, $old );
357
+ foreach ( $new_values as $new_value ) {
358
+ $storage->add( $post_id, $name, $new_value, false );
359
+ }
360
+ $old_values = array_diff( $old, $new );
361
+ foreach ( $old_values as $old_value ) {
362
+ $storage->delete( $post_id, $name, $old_value );
363
+ }
364
+ return;
365
  }
366
 
367
+ // Default: just update post meta.
368
+ $storage->update( $post_id, $name, $new );
369
+ }
 
 
 
 
 
 
 
 
 
370
 
371
+ /**
372
+ * Normalize parameters for field.
373
+ *
374
+ * @param array $field Field parameters.
375
+ *
376
+ * @return array
377
+ */
378
+ public static function normalize( $field ) {
379
+ $field = wp_parse_args( $field, array(
380
+ 'id' => '',
381
+ 'name' => '',
382
+ 'label_description' => '',
383
+ 'multiple' => false,
384
+ 'std' => '',
385
+ 'desc' => '',
386
+ 'format' => '',
387
+ 'before' => '',
388
+ 'after' => '',
389
+ 'field_name' => isset( $field['id'] ) ? $field['id'] : '',
390
+ 'placeholder' => '',
391
+
392
+ 'clone' => false,
393
+ 'max_clone' => 0,
394
+ 'sort_clone' => false,
395
+ 'add_button' => __( '+ Add more', 'meta-box' ),
396
+ 'clone_default' => false,
397
+ 'clone_as_multiple' => false,
398
+
399
+ 'class' => '',
400
+ 'disabled' => false,
401
+ 'required' => false,
402
+ 'autofocus' => false,
403
+ 'attributes' => array(),
404
+ ) );
405
+
406
+ if ( $field['clone_default'] ) {
407
+ $field['attributes'] = wp_parse_args( $field['attributes'], array(
408
+ 'data-default' => $field['std'],
409
+ 'data-clone-default' => 'true',
410
+ ) );
411
  }
412
 
413
+ return $field;
414
+ }
415
+
416
+ /**
417
+ * Get the attributes for a field.
418
+ *
419
+ * @param array $field Field parameters.
420
+ * @param mixed $value Meta value.
421
+ *
422
+ * @return array
423
+ */
424
+ public static function get_attributes( $field, $value = null ) {
425
+ $attributes = wp_parse_args( $field['attributes'], array(
426
+ 'disabled' => $field['disabled'],
427
+ 'autofocus' => $field['autofocus'],
428
+ 'required' => $field['required'],
429
+ 'id' => $field['id'],
430
+ 'class' => '',
431
+ 'name' => $field['field_name'],
432
+ ) );
433
+
434
+ $attributes['class'] = trim( implode( ' ', array_merge( array( "rwmb-{$field['type']}" ), (array) $attributes['class'] ) ) );
435
+
436
+ return $attributes;
437
+ }
438
+
439
+ /**
440
+ * Renders an attribute array into an html attributes string.
441
+ *
442
+ * @param array $attributes HTML attributes.
443
+ *
444
+ * @return string
445
+ */
446
+ public static function render_attributes( $attributes ) {
447
+ $output = '';
448
+
449
+ foreach ( $attributes as $key => $value ) {
450
+ if ( false === $value || '' === $value ) {
451
+ continue;
452
+ }
453
 
454
+ if ( is_array( $value ) ) {
455
+ $value = wp_json_encode( $value );
456
+ }
457
 
458
+ $output .= sprintf( true === $value ? ' %s' : ' %s="%s"', $key, esc_attr( $value ) );
459
  }
460
 
461
+ return $output;
462
+ }
463
+
464
+ /**
465
+ * Get the field value.
466
+ * The difference between this function and 'meta' function is 'meta' function always returns the escaped value
467
+ * of the field saved in the database, while this function returns more meaningful value of the field, for ex.:
468
+ * for file/image: return array of file/image information instead of file/image IDs.
469
+ *
470
+ * Each field can extend this function and add more data to the returned value.
471
+ * See specific field classes for details.
472
+ *
473
+ * @param array $field Field parameters.
474
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
475
+ * @param int|null $post_id Post ID. null for current post. Optional.
476
+ *
477
+ * @return mixed Field value
478
+ */
479
+ public static function get_value( $field, $args = array(), $post_id = null ) {
480
+ // Some fields does not have ID like heading, custom HTML, etc.
481
+ if ( empty( $field['id'] ) ) {
482
+ return '';
483
  }
484
 
485
+ if ( ! $post_id ) {
486
+ $post_id = get_the_ID();
 
 
 
 
 
 
487
  }
488
 
489
+ // Get raw meta value in the database, no escape.
490
+ $value = self::call( $field, 'raw_meta', $post_id, $args );
 
 
 
 
 
 
 
 
 
 
491
 
492
+ // Make sure meta value is an array for cloneable and multiple fields.
493
+ if ( $field['clone'] || $field['multiple'] ) {
494
+ $value = is_array( $value ) && $value ? $value : array();
495
+ }
496
 
497
+ return $value;
498
+ }
 
499
 
500
+ /**
501
+ * Output the field value.
502
+ * Depends on field value and field types, each field can extend this method to output its value in its own way
503
+ * See specific field classes for details.
504
+ *
505
+ * Note: we don't echo the field value directly. We return the output HTML of field, which will be used in
506
+ * rwmb_the_field function later.
507
+ *
508
+ * @use self::get_value()
509
+ * @see rwmb_the_value()
510
+ *
511
+ * @param array $field Field parameters.
512
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
513
+ * @param int|null $post_id Post ID. null for current post. Optional.
514
+ *
515
+ * @return string HTML output of the field
516
+ */
517
+ public static function the_value( $field, $args = array(), $post_id = null ) {
518
+ $value = self::call( 'get_value', $field, $args, $post_id );
519
+
520
+ if ( false === $value ) {
521
+ return '';
522
  }
523
 
524
+ return self::call( 'format_value', $field, $value, $args, $post_id );
525
+ }
526
+
527
+ /**
528
+ * Format value for the helper functions.
529
+ *
530
+ * @param array $field Field parameters.
531
+ * @param string|array $value The field meta value.
532
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
533
+ * @param int|null $post_id Post ID. null for current post. Optional.
534
+ *
535
+ * @return string
536
+ */
537
+ public static function format_value( $field, $value, $args, $post_id ) {
538
+ if ( ! $field['clone'] ) {
539
+ return self::call( 'format_clone_value', $field, $value, $args, $post_id );
540
  }
541
+ $output = '<ul>';
542
+ foreach ( $value as $clone ) {
543
+ $output .= '<li>' . self::call( 'format_clone_value', $field, $clone, $args, $post_id ) . '</li>';
544
+ }
545
+ $output .= '</ul>';
546
+ return $output;
547
+ }
548
 
549
+ /**
550
+ * Format value for a clone.
551
+ *
552
+ * @param array $field Field parameters.
553
+ * @param string|array $value The field meta value.
554
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
555
+ * @param int|null $post_id Post ID. null for current post. Optional.
556
+ *
557
+ * @return string
558
+ */
559
+ public static function format_clone_value( $field, $value, $args, $post_id ) {
560
+ if ( ! $field['multiple'] ) {
561
+ return self::call( 'format_single_value', $field, $value, $args, $post_id );
562
+ }
563
+ $output = '<ul>';
564
+ foreach ( $value as $single ) {
565
+ $output .= '<li>' . self::call( 'format_single_value', $field, $single, $args, $post_id ) . '</li>';
566
+ }
567
+ $output .= '</ul>';
568
+ return $output;
569
+ }
570
 
571
+ /**
572
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
573
+ *
574
+ * @param array $field Field parameters.
575
+ * @param string $value The value.
576
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
577
+ * @param int|null $post_id Post ID. null for current post. Optional.
578
+ *
579
+ * @return string
580
+ */
581
+ public static function format_single_value( $field, $value, $args, $post_id ) {
582
+ return $value;
583
+ }
584
 
585
+ /**
586
+ * Call a method of a field.
587
+ * This should be replaced by static::$method( $args ) in PHP 5.3.
588
+ *
589
+ * @return mixed
590
+ */
591
+ public static function call() {
592
+ $args = func_get_args();
593
+
594
+ $check = reset( $args );
595
+
596
+ // Params: method name, field, other params.
597
+ if ( is_string( $check ) ) {
598
+ $method = array_shift( $args );
599
+ $field = reset( $args ); // Keep field as 1st param.
600
+ } else {
601
+ $field = array_shift( $args );
602
+ $method = array_shift( $args );
603
+
604
+ if ( 'raw_meta' === $method ) {
605
+ // Add field param after object id.
606
+ array_splice( $args, 1, 0, array( $field ) );
607
+ } else {
608
+ $args[] = $field; // Add field as last param.
609
  }
610
+ }
611
 
612
+ return call_user_func_array( array( self::get_class_name( $field ), $method ), $args );
613
+ }
614
+
615
+ /**
616
+ * Map field types.
617
+ *
618
+ * @param array $field Field parameters.
619
+ * @return string Field mapped type.
620
+ */
621
+ public static function map_types( $field ) {
622
+ $type = isset( $field['type'] ) ? $field['type'] : 'input';
623
+ $type_map = apply_filters(
624
+ 'rwmb_type_map',
625
+ array(
626
+ 'file_advanced' => 'media',
627
+ 'plupload_image' => 'image_upload',
628
+ 'url' => 'text',
629
+ )
630
+ );
631
+
632
+ return isset( $type_map[ $type ] ) ? $type_map[ $type ] : $type;
633
+ }
634
+
635
+ /**
636
+ * Get field class name.
637
+ *
638
+ * @param array $field Field parameters.
639
+ * @return string Field class name.
640
+ */
641
+ public static function get_class_name( $field ) {
642
+ $type = self::map_types( $field );
643
+ $type = str_replace( array( '-', '_' ), ' ', $type );
644
+ $class = 'RWMB_' . ucwords( $type ) . '_Field';
645
+ $class = str_replace( ' ', '_', $class );
646
+ return class_exists( $class ) ? $class : 'RWMB_Input_Field';
647
+ }
648
+
649
+ /**
650
+ * Apply various filters based on field type, id.
651
+ * Filters:
652
+ * - rwmb_{$name}
653
+ * - rwmb_{$field['type']}_{$name}
654
+ * - rwmb_{$field['id']}_{$name}
655
+ *
656
+ * @return mixed
657
+ */
658
+ public static function filter() {
659
+ $args = func_get_args();
660
+
661
+ // 3 first params must be: filter name, value, field. Other params will be used for filters.
662
+ $name = array_shift( $args );
663
+ $value = array_shift( $args );
664
+ $field = array_shift( $args );
665
+
666
+ // List of filters.
667
+ $filters = array(
668
+ 'rwmb_' . $name,
669
+ 'rwmb_' . $field['type'] . '_' . $name,
670
+ );
671
+ if ( isset( $field['id'] ) ) {
672
+ $filters[] = 'rwmb_' . $field['id'] . '_' . $name;
673
  }
674
 
675
+ // Filter params: value, field, other params. Note: value is changed after each run.
676
+ array_unshift( $args, $field );
677
+ foreach ( $filters as $filter ) {
678
+ $filter_args = $args;
679
+ array_unshift( $filter_args, $value );
680
+ $value = apply_filters_ref_array( $filter, $filter_args );
 
 
 
 
681
  }
682
+
683
+ return $value;
684
  }
685
  }
inc/meta-box/inc/fields/autocomplete.php CHANGED
@@ -1,150 +1,118 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Autocomplete_Field' ) )
6
- {
7
- class RWMB_Autocomplete_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_style( 'rwmb-autocomplete', TX_RWMB_CSS_URL . 'autocomplete.css', array( 'wp-admin' ), TX_RWMB_VER );
17
- wp_enqueue_script( 'rwmb-autocomplete', TX_RWMB_JS_URL . 'autocomplete.js', array( 'jquery-ui-autocomplete' ), TX_RWMB_VER, true );
18
- wp_localize_script( 'rwmb-autocomplete', 'RWMB_Autocomplete', array( 'delete' => __( 'Delete', 'meta-box' ) ) );
19
- }
20
-
21
- /**
22
- * Get field HTML
23
- *
24
- * @param mixed $meta
25
- * @param array $field
26
- *
27
- * @return string
28
- */
29
- static function html( $meta, $field )
30
- {
31
- if ( ! is_array( $meta ) )
32
- $meta = array( $meta );
33
-
34
- $options = array();
35
- foreach ( $field['options'] as $value => $label )
36
- {
37
- $options[] = array(
38
- 'value' => $value,
39
- 'label' => $label,
40
- );
41
- }
42
-
43
- // Input field that triggers autocomplete.
44
- // This field doesn't store field values, so it doesn't have "name" attribute.
45
- // The value(s) of the field is store in hidden input(s). See below.
46
- $html = sprintf(
47
- '<input type="text" class="rwmb-autocomplete" id="%s" data-name="%s" data-options="%s" size="%s">',
48
- $field['id'],
49
- $field['field_name'],
50
- esc_attr( json_encode( $options ) ),
51
- $field['size']
52
- );
53
-
54
- $html .= '<div class="rwmb-autocomplete-results">';
55
-
56
- // Each value is displayed with label and 'Delete' option
57
- // The hidden input has to have ".rwmb-*" class to make clone work
58
- $tpl = '
59
- <div class="rwmb-autocomplete-result">
60
- <div class="label">%s</div>
61
- <div class="actions">%s</div>
62
- <input type="hidden" class="rwmb-autocomplete-value" name="%s" value="%s">
63
- </div>
64
- ';
65
- foreach ( $field['options'] as $value => $label )
66
- {
67
- if ( in_array( $value, $meta ) )
68
- {
69
- $html .= sprintf(
70
- $tpl,
71
- $label,
72
- __( 'Delete', 'meta-box' ),
73
- $field['field_name'],
74
- $value
75
- );
76
- }
77
- }
78
- $html .= '</div>'; // .rwmb-autocomplete-results
79
-
80
- return $html;
81
- }
82
-
83
- /**
84
- * Get meta value
85
- * If field is cloneable, value is saved as a single entry in DB
86
- * Otherwise value is saved as multiple entries (for backward compatibility)
87
- *
88
- * @see "save" method for better understanding
89
- *
90
- * @param $post_id
91
- * @param $saved
92
- * @param $field
93
- *
94
- * @return array
95
- */
96
- static function meta( $post_id, $saved, $field )
97
- {
98
- $meta = get_post_meta( $post_id, $field['id'], $field['clone'] );
99
- $meta = ( ! $saved && '' === $meta || array() === $meta ) ? $field['std'] : $meta;
100
-
101
- return $meta;
102
- }
103
-
104
- /**
105
- * Save meta value
106
- * If field is cloneable, value is saved as a single entry in DB
107
- * Otherwise value is saved as multiple entries (for backward compatibility)
108
- *
109
- * @param $new
110
- * @param $old
111
- * @param $post_id
112
- * @param $field
113
- */
114
- static function save( $new, $old, $post_id, $field )
115
- {
116
- if ( ! $field['clone'] )
117
- {
118
- parent::save( $new, $old, $post_id, $field );
119
-
120
- return;
121
- }
122
-
123
- if ( empty( $new ) )
124
- delete_post_meta( $post_id, $field['id'] );
125
- else
126
- update_post_meta( $post_id, $field['id'], $new );
127
- }
128
-
129
- /**
130
- * Normalize parameters for field
131
- *
132
- * @param array $field
133
- *
134
- * @return array
135
- */
136
- static function normalize_field( $field )
137
- {
138
- $field = wp_parse_args( $field, array(
139
- 'size' => 30,
140
- ) );
141
-
142
- $field['multiple'] = true;
143
- $field['field_name'] = $field['id'];
144
- if ( ! $field['clone'] )
145
- $field['field_name'] .= '[]';
146
-
147
- return $field;
148
- }
149
- }
150
- }
1
+ <?php
2
+ /**
3
+ * The autocomplete field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Autocomplete field class.
10
+ */
11
+ class RWMB_Autocomplete_Field extends RWMB_Multiple_Values_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-autocomplete', RWMB_CSS_URL . 'autocomplete.css', '', RWMB_VER );
17
+ wp_enqueue_script( 'rwmb-autocomplete', RWMB_JS_URL . 'autocomplete.js', array( 'jquery-ui-autocomplete' ), RWMB_VER, true );
18
+
19
+ self::localize_script( 'rwmb-autocomplete', 'RWMB_Autocomplete', array(
20
+ 'delete' => __( 'Delete', 'meta-box' ),
21
+ ) );
22
+ }
23
+
24
+ /**
25
+ * Get field HTML.
26
+ *
27
+ * @param mixed $meta Meta value.
28
+ * @param array $field Field parameters.
29
+ * @return string
30
+ */
31
+ public static function html( $meta, $field ) {
32
+ if ( ! is_array( $meta ) ) {
33
+ $meta = array( $meta );
34
+ }
35
+
36
+ $field = apply_filters( 'rwmb_autocomplete_field', $field, $meta );
37
+ $options = $field['options'];
38
+
39
+ if ( is_array( $field['options'] ) ) {
40
+ $options = array();
41
+ foreach ( $field['options'] as $value => $label ) {
42
+ $options[] = array(
43
+ 'value' => $value,
44
+ 'label' => $label,
45
+ );
46
+ }
47
+ $options = wp_json_encode( $options );
48
+ }
49
+
50
+ // Input field that triggers autocomplete.
51
+ // This field doesn't store field values, so it doesn't have "name" attribute.
52
+ // The value(s) of the field is store in hidden input(s). See below.
53
+ $html = sprintf(
54
+ '<input type="text" class="rwmb-autocomplete-search" size="%s">
55
+ <input type="hidden" name="%s" class="rwmb-autocomplete" data-options="%s" disabled>',
56
+ esc_attr( $field['size'] ),
57
+ esc_attr( $field['field_name'] ),
58
+ esc_attr( $options )
59
+ );
60
+
61
+ $html .= '<div class="rwmb-autocomplete-results">';
62
+
63
+ // Each value is displayed with label and 'Delete' option.
64
+ // The hidden input has to have ".rwmb-*" class to make clone work.
65
+ $tpl = '
66
+ <div class="rwmb-autocomplete-result">
67
+ <div class="label">%s</div>
68
+ <div class="actions">%s</div>
69
+ <input type="hidden" class="rwmb-autocomplete-value" name="%s" value="%s">
70
+ </div>
71
+ ';
72
+
73
+ if ( is_array( $field['options'] ) ) {
74
+ foreach ( $field['options'] as $value => $label ) {
75
+ if ( ! in_array( $value, $meta ) ) {
76
+ continue;
77
+ }
78
+ $html .= sprintf(
79
+ $tpl,
80
+ esc_html( $label ),
81
+ esc_html__( 'Delete', 'meta-box' ),
82
+ esc_attr( $field['field_name'] ),
83
+ esc_attr( $value )
84
+ );
85
+ }
86
+ } else {
87
+ $meta = array_filter( $meta );
88
+ foreach ( $meta as $value ) {
89
+ $label = apply_filters( 'rwmb_autocomplete_result_label', $value, $field );
90
+ $html .= sprintf(
91
+ $tpl,
92
+ esc_html( $label ),
93
+ esc_html__( 'Delete', 'meta-box' ),
94
+ esc_attr( $field['field_name'] ),
95
+ esc_attr( $value )
96
+ );
97
+ }
98
+ }
99
+
100
+ $html .= '</div>'; // .rwmb-autocomplete-results.
101
+
102
+ return $html;
103
+ }
104
+
105
+ /**
106
+ * Normalize parameters for field.
107
+ *
108
+ * @param array $field Field parameters.
109
+ * @return array
110
+ */
111
+ public static function normalize( $field ) {
112
+ $field = parent::normalize( $field );
113
+ $field = wp_parse_args( $field, array(
114
+ 'size' => 30,
115
+ ) );
116
+ return $field;
117
+ }
118
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/background.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The background field.
4
+ *
5
+ * @package Meta Box.
6
+ */
7
+
8
+ /**
9
+ * The Background field.
10
+ */
11
+ class RWMB_Background_Field extends RWMB_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-background', RWMB_CSS_URL . 'background.css', '', RWMB_VER );
17
+
18
+ RWMB_Color_Field::admin_enqueue_scripts();
19
+ RWMB_File_Input_Field::admin_enqueue_scripts();
20
+ }
21
+
22
+ /**
23
+ * Get field HTML.
24
+ *
25
+ * @param mixed $meta Meta value.
26
+ * @param array $field Field settings.
27
+ *
28
+ * @return string
29
+ */
30
+ public static function html( $meta, $field ) {
31
+ $meta = wp_parse_args( $meta, array(
32
+ 'color' => '',
33
+ 'image' => '',
34
+ 'repeat' => '',
35
+ 'attachment' => '',
36
+ 'position' => '',
37
+ 'size' => '',
38
+ ) );
39
+
40
+ $output = '<div class="rwmb-background-row">';
41
+
42
+ // Color.
43
+ $color = RWMB_Color_Field::normalize( array(
44
+ 'type' => 'color',
45
+ 'id' => "{$field['id']}_color",
46
+ 'field_name' => "{$field['field_name']}[color]",
47
+ ) );
48
+ $output .= RWMB_Color_Field::html( $meta['color'], $color );
49
+
50
+ $output .= '</div><!-- .rwmb-background-row -->';
51
+ $output .= '<div class="rwmb-background-row">';
52
+
53
+ // Image.
54
+ $image = RWMB_File_Input_Field::normalize( array(
55
+ 'type' => 'file_input',
56
+ 'id' => "{$field['id']}_image",
57
+ 'field_name' => "{$field['field_name']}[image]",
58
+ 'placeholder' => __( 'Background Image', 'meta-box' ),
59
+ ) );
60
+ $output .= RWMB_File_Input_Field::html( $meta['image'], $image );
61
+
62
+ $output .= '</div><!-- .rwmb-background-row -->';
63
+ $output .= '<div class="rwmb-background-row">';
64
+
65
+ // Repeat.
66
+ $repeat = RWMB_Select_Field::normalize( array(
67
+ 'type' => 'select',
68
+ 'id' => "{$field['id']}_repeat",
69
+ 'field_name' => "{$field['field_name']}[repeat]",
70
+ 'placeholder' => esc_html__( '-- Background Repeat --', 'meta-box' ),
71
+ 'options' => array(
72
+ 'no-repeat' => esc_html__( 'No Repeat', 'meta-box' ),
73
+ 'repeat' => esc_html__( 'Repeat All', 'meta-box' ),
74
+ 'repeat-x' => esc_html__( 'Repeat Horizontally', 'meta-box' ),
75
+ 'repeat-y' => esc_html__( 'Repeat Vertically', 'meta-box' ),
76
+ 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
77
+ ),
78
+ ) );
79
+ $output .= RWMB_Select_Field::html( $meta['repeat'], $repeat );
80
+
81
+ // Position.
82
+ $position = RWMB_Select_Field::normalize( array(
83
+ 'type' => 'select',
84
+ 'id' => "{$field['id']}_position",
85
+ 'field_name' => "{$field['field_name']}[position]",
86
+ 'placeholder' => esc_html__( '-- Background Position --', 'meta-box' ),
87
+ 'options' => array(
88
+ 'top left' => esc_html__( 'Top Left', 'meta-box' ),
89
+ 'top center' => esc_html__( 'Top Center', 'meta-box' ),
90
+ 'top right' => esc_html__( 'Top Right', 'meta-box' ),
91
+ 'center left' => esc_html__( 'Center Left', 'meta-box' ),
92
+ 'center center' => esc_html__( 'Center Center', 'meta-box' ),
93
+ 'center right' => esc_html__( 'Center Right', 'meta-box' ),
94
+ 'bottom left' => esc_html__( 'Bottom Left', 'meta-box' ),
95
+ 'bottom center' => esc_html__( 'Bottom Center', 'meta-box' ),
96
+ 'bottom right' => esc_html__( 'Bottom Right', 'meta-box' ),
97
+ ),
98
+ ) );
99
+ $output .= RWMB_Select_Field::html( $meta['position'], $position );
100
+
101
+ // Attachment.
102
+ $attachment = RWMB_Select_Field::normalize( array(
103
+ 'type' => 'select',
104
+ 'id' => "{$field['id']}_attachment",
105
+ 'field_name' => "{$field['field_name']}[attachment]",
106
+ 'placeholder' => esc_html__( '-- Background Attachment --', 'meta-box' ),
107
+ 'options' => array(
108
+ 'fixed' => esc_html__( 'Fixed', 'meta-box' ),
109
+ 'scroll' => esc_html__( 'Scroll', 'meta-box' ),
110
+ 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
111
+ ),
112
+ ) );
113
+ $output .= RWMB_Select_Field::html( $meta['attachment'], $attachment );
114
+
115
+ // Size.
116
+ $size = RWMB_Select_Field::normalize( array(
117
+ 'type' => 'select',
118
+ 'id' => "{$field['id']}_size",
119
+ 'field_name' => "{$field['field_name']}[size]",
120
+ 'placeholder' => esc_html__( '-- Background Size --', 'meta-box' ),
121
+ 'options' => array(
122
+ 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
123
+ 'cover' => esc_html__( 'Cover', 'meta-box' ),
124
+ 'contain' => esc_html__( 'Contain', 'meta-box' ),
125
+ ),
126
+ ) );
127
+ $output .= RWMB_Select_Field::html( $meta['size'], $size );
128
+ $output .= '</div><!-- .rwmb-background-row -->';
129
+
130
+ return $output;
131
+ }
132
+
133
+ /**
134
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
135
+ *
136
+ * @param array $field Field parameters.
137
+ * @param array $value The value.
138
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
139
+ * @param int|null $post_id Post ID. null for current post. Optional.
140
+ *
141
+ * @return string
142
+ */
143
+ public static function format_single_value( $field, $value, $args, $post_id ) {
144
+ $output = '';
145
+ $value = array_filter( $value );
146
+ foreach ( $value as $key => $subvalue ) {
147
+ $subvalue = 'image' === $key ? 'url( "' . esc_url( $subvalue ) . '")' : $subvalue;
148
+ $output .= 'background-' . $key . ': ' . $subvalue . ';';
149
+ }
150
+ return $output;
151
+ }
152
+ }
inc/meta-box/inc/fields/button-group.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Button group.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Button group class.
10
+ */
11
+ class RWMB_Button_Group_Field extends RWMB_Choice_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-button-group', RWMB_CSS_URL . 'button-group.css', '', RWMB_VER );
17
+ wp_enqueue_script( 'rwmb-button-group', RWMB_JS_URL . 'button-group.js', array(), RWMB_VER, true );
18
+ }
19
+
20
+ /**
21
+ * Walk options.
22
+ *
23
+ * @param array $field Field parameters.
24
+ * @param mixed $options Select options.
25
+ * @param mixed $db_fields Database fields to use in the output.
26
+ * @param mixed $meta Meta value.
27
+ *
28
+ * @return string
29
+ */
30
+ public static function walk( $field, $options, $db_fields, $meta ) {
31
+ $walker = new RWMB_Walker_Input_List( $db_fields, $field, $meta );
32
+
33
+ $output = sprintf( '<ul class="rwmb-button-input-list %s">',
34
+ $field['inline'] ? 'inline' : ''
35
+ );
36
+ $output .= $walker->walk( $options, - 1 );
37
+ $output .= '</ul>';
38
+
39
+ return $output;
40
+ }
41
+
42
+ /**
43
+ * Normalize parameters for field.
44
+ *
45
+ * @param array $field Field parameters.
46
+ *
47
+ * @return array
48
+ */
49
+ public static function normalize( $field ) {
50
+ $field = parent::normalize( $field );
51
+ $field = wp_parse_args( $field, array(
52
+ 'inline' => null,
53
+ ) );
54
+
55
+ $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
56
+ $field = RWMB_Input_Field::normalize( $field );
57
+
58
+ $field['flatten'] = true;
59
+ $field['inline'] = ! $field['multiple'] && ! isset( $field['inline'] ) ? true : $field['inline'];
60
+
61
+ return $field;
62
+ }
63
+
64
+ /**
65
+ * Get the attributes for a field.
66
+ *
67
+ * @param array $field Field parameters.
68
+ * @param mixed $value Meta value.
69
+ *
70
+ * @return array
71
+ */
72
+ public static function get_attributes( $field, $value = null ) {
73
+ $attributes = RWMB_Input_Field::get_attributes( $field, $value );
74
+ $attributes['id'] = false;
75
+ $attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio';
76
+ $attributes['value'] = $value;
77
+
78
+ return $attributes;
79
+ }
80
+ }
inc/meta-box/inc/fields/button.php CHANGED
@@ -1,40 +1,54 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
 
 
 
4
 
5
- if ( ! class_exists( 'RWMB_Button_Field' ) )
6
- {
7
- class RWMB_Button_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- return sprintf(
20
- '<a href="#" id="%s" class="button hide-if-no-js">%s</a>',
21
- $field['id'],
22
- $field['std']
23
- );
24
- }
 
 
 
 
 
 
 
 
 
25
 
26
- /**
27
- * Normalize parameters for field
28
- *
29
- * @param array $field
30
- *
31
- * @return array
32
- */
33
- static function normalize_field( $field )
34
- {
35
- $field['std'] = $field['std'] ? $field['std'] : __( 'Click me', 'meta-box' );
 
 
 
36
 
37
- return $field;
38
- }
39
  }
40
  }
1
  <?php
2
+ /**
3
+ * The button field. Simply displays a HTML button which might be used for JavaScript actions.
4
+ *
5
+ * @package Meta Box
6
+ */
7
 
8
+ /**
9
+ * Button field class.
10
+ */
11
+ class RWMB_Button_Field extends RWMB_Field {
12
+ /**
13
+ * Get field HTML.
14
+ *
15
+ * @param mixed $meta Meta value.
16
+ * @param array $field The field parameters.
17
+ * @return string
18
+ */
19
+ public static function html( $meta, $field ) {
20
+ $attributes = self::get_attributes( $field );
21
+ return sprintf( '<button %s>%s</button>', self::render_attributes( $attributes ), $field['std'] );
22
+ }
23
+
24
+ /**
25
+ * Normalize parameters for field.
26
+ *
27
+ * @param array $field The field parameters.
28
+ * @return array
29
+ */
30
+ public static function normalize( $field ) {
31
+ $field = wp_parse_args( $field, array(
32
+ 'std' => __( 'Click me', 'meta-box' ),
33
+ ) );
34
+ $field = parent::normalize( $field );
35
+ return $field;
36
+ }
37
 
38
+ /**
39
+ * Get the attributes for a field.
40
+ *
41
+ * @param array $field The field parameters.
42
+ * @param mixed $value The attribute value.
43
+ * @return array
44
+ */
45
+ public static function get_attributes( $field, $value = null ) {
46
+ $attributes = parent::get_attributes( $field, $value );
47
+ $attributes = wp_parse_args( $attributes, array(
48
+ 'type' => $field['type'],
49
+ ) );
50
+ $attributes['class'] .= ' button hide-if-no-js';
51
 
52
+ return $attributes;
 
53
  }
54
  }
inc/meta-box/inc/fields/checkbox-list.php CHANGED
@@ -1,105 +1,24 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Checkbox_List_Field' ) )
6
- {
7
- class RWMB_Checkbox_List_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- $meta = (array) $meta;
20
- $html = array();
21
- $tpl = '<label><input type="checkbox" class="rwmb-checkbox-list" name="%s" value="%s"%s> %s</label>';
22
-
23
- foreach ( $field['options'] as $value => $label )
24
- {
25
- $html[] = sprintf(
26
- $tpl,
27
- $field['field_name'],
28
- $value,
29
- checked( in_array( $value, $meta ), 1, false ),
30
- $label
31
- );
32
- }
33
-
34
- return implode( '<br>', $html );
35
- }
36
-
37
- /**
38
- * Get meta value
39
- * If field is cloneable, value is saved as a single entry in DB
40
- * Otherwise value is saved as multiple entries (for backward compatibility)
41
- *
42
- * @see "save" method for better understanding
43
- *
44
- * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
45
- *
46
- * @param $post_id
47
- * @param $saved
48
- * @param $field
49
- *
50
- * @return array
51
- */
52
- static function meta( $post_id, $saved, $field )
53
- {
54
- $meta = get_post_meta( $post_id, $field['id'], $field['clone'] );
55
- $meta = ( ! $saved && '' === $meta || array() === $meta ) ? $field['std'] : $meta;
56
- $meta = array_map( 'esc_attr', (array) $meta );
57
-
58
- return $meta;
59
- }
60
-
61
- /**
62
- * Save meta value
63
- * If field is cloneable, value is saved as a single entry in DB
64
- * Otherwise value is saved as multiple entries (for backward compatibility)
65
- *
66
- * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
67
- *
68
- * @param $new
69
- * @param $old
70
- * @param $post_id
71
- * @param $field
72
- */
73
- static function save( $new, $old, $post_id, $field )
74
- {
75
- if ( ! $field['clone'] )
76
- {
77
- parent::save( $new, $old, $post_id, $field );
78
-
79
- return;
80
- }
81
-
82
- if ( empty( $new ) )
83
- delete_post_meta( $post_id, $field['id'] );
84
- else
85
- update_post_meta( $post_id, $field['id'], $new );
86
- }
87
-
88
- /**
89
- * Normalize parameters for field
90
- *
91
- * @param array $field
92
- *
93
- * @return array
94
- */
95
- static function normalize_field( $field )
96
- {
97
- $field['multiple'] = true;
98
- $field['field_name'] = $field['id'];
99
- if ( ! $field['clone'] )
100
- $field['field_name'] .= '[]';
101
-
102
- return $field;
103
- }
104
  }
105
  }
1
  <?php
2
+ /**
3
+ * The checkbox list field which shows a list of choices and allow users to select multiple options.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Checkbox list field class.
10
+ */
11
+ class RWMB_Checkbox_List_Field extends RWMB_Input_List_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @return array
17
+ */
18
+ public static function normalize( $field ) {
19
+ $field['multiple'] = true;
20
+ $field = parent::normalize( $field );
21
+
22
+ return $field;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
  }
inc/meta-box/inc/fields/checkbox.php CHANGED
@@ -1,45 +1,55 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
 
 
 
4
 
5
- if ( ! class_exists( 'RWMB_Checkbox_Field' ) )
6
- {
7
- class RWMB_Checkbox_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- return sprintf(
20
- '<input type="checkbox" class="rwmb-checkbox" name="%s" id="%s" value="1" %s>',
21
- $field['field_name'],
22
- $field['id'],
23
- checked( ! empty( $meta ), 1, false )
24
- );
25
  }
 
 
26
 
27
- /**
28
- * Set the value of checkbox to 1 or 0 instead of 'checked' and empty string
29
- * This prevents using default value once the checkbox has been unchecked
30
- *
31
- * @link https://github.com/rilwis/meta-box/issues/6
32
- *
33
- * @param mixed $new
34
- * @param mixed $old
35
- * @param int $post_id
36
- * @param array $field
37
- *
38
- * @return int
39
- */
40
- static function value( $new, $old, $post_id, $field )
41
- {
42
- return empty( $new ) ? 0 : 1;
43
- }
 
 
 
 
 
44
  }
45
  }
1
  <?php
2
+ /**
3
+ * The checkbox field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
 
8
+ /**
9
+ * Checkbox field class.
10
+ */
11
+ class RWMB_Checkbox_Field extends RWMB_Input_Field {
12
+ /**
13
+ * Get field HTML.
14
+ *
15
+ * @param mixed $meta Meta value.
16
+ * @param array $field Field parameters.
17
+ * @return string
18
+ */
19
+ public static function html( $meta, $field ) {
20
+ $attributes = self::get_attributes( $field, 1 );
21
+ $output = sprintf(
22
+ '<input %s %s>',
23
+ self::render_attributes( $attributes ),
24
+ checked( ! empty( $meta ), 1, false )
25
+ );
26
+ if ( $field['desc'] ) {
27
+ $output = "<label id='{$field['id']}_description' class='description'>$output {$field['desc']}</label>";
28
  }
29
+ return $output;
30
+ }
31
 
32
+ /**
33
+ * Do not show field description.
34
+ *
35
+ * @param array $field Field parameters.
36
+ * @return string
37
+ */
38
+ public static function input_description( $field ) {
39
+ return '';
40
+ }
41
+
42
+ /**
43
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
44
+ *
45
+ * @param array $field Field parameters.
46
+ * @param string $value The value.
47
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
48
+ * @param int|null $post_id Post ID. null for current post. Optional.
49
+ *
50
+ * @return string
51
+ */
52
+ public static function format_single_value( $field, $value, $args, $post_id ) {
53
+ return $value ? __( 'Yes', 'meta-box' ) : __( 'No', 'meta-box' );
54
  }
55
  }
inc/meta-box/inc/fields/choice.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The abstract choice field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Abstract class for any kind of choice field.
10
+ */
11
+ abstract class RWMB_Choice_Field extends RWMB_Field {
12
+ /**
13
+ * Walk options.
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @param mixed $options Select options.
17
+ * @param mixed $db_fields Database fields to use in the output.
18
+ * @param mixed $meta Meta value.
19
+ * @return string
20
+ */
21
+ public static function walk( $field, $options, $db_fields, $meta ) {
22
+ return '';
23
+ }
24
+
25
+ /**
26
+ * Get field HTML.
27
+ *
28
+ * @param mixed $meta Meta value.
29
+ * @param array $field Field parameters.
30
+ * @return string
31
+ */
32
+ public static function html( $meta, $field ) {
33
+ $meta = (array) $meta;
34
+ $options = self::call( 'get_options', $field );
35
+ $options = self::call( 'filter_options', $field, $options );
36
+ $db_fields = self::call( 'get_db_fields', $field );
37
+ return ! empty( $options ) ? self::call( 'walk', $field, $options, $db_fields, $meta ) : null;
38
+ }
39
+
40
+ /**
41
+ * Normalize parameters for field.
42
+ *
43
+ * @param array $field Field parameters.
44
+ * @return array
45
+ */
46
+ public static function normalize( $field ) {
47
+ $field = parent::normalize( $field );
48
+ $field = wp_parse_args( $field, array(
49
+ 'flatten' => true,
50
+ 'options' => array(),
51
+ ) );
52
+
53
+ return $field;
54
+ }
55
+
56
+ /**
57
+ * Get field names of object to be used by walker.
58
+ *
59
+ * @return array
60
+ */
61
+ public static function get_db_fields() {
62
+ return array(
63
+ 'parent' => 'parent',
64
+ 'id' => 'value',
65
+ 'label' => 'label',
66
+ );
67
+ }
68
+
69
+ /**
70
+ * Get options for walker.
71
+ *
72
+ * @param array $field Field parameters.
73
+ *
74
+ * @return array
75
+ */
76
+ public static function get_options( $field ) {
77
+ $options = array();
78
+ foreach ( (array) $field['options'] as $value => $label ) {
79
+ $option = is_array( $label ) ? $label : array(
80
+ 'label' => (string) $label,
81
+ 'value' => (string) $value,
82
+ );
83
+ if ( isset( $option['label'] ) && isset( $option['value'] ) ) {
84
+ $options[ $option['value'] ] = (object) $option;
85
+ }
86
+ }
87
+ return $options;
88
+ }
89
+
90
+ /**
91
+ * Filter options for walker.
92
+ *
93
+ * @param array $field Field parameters.
94
+ * @param array $options Array of choice options.
95
+ *
96
+ * @return array
97
+ */
98
+ public static function filter_options( $field, $options ) {
99
+ $db_fields = self::call( 'get_db_fields', $field );
100
+ $label = $db_fields['label'];
101
+ foreach ( $options as &$option ) {
102
+ $option = apply_filters( 'rwmb_option', $option, $field );
103
+ $option->$label = apply_filters( 'rwmb_option_label', $option->$label, $option, $field );
104
+ }
105
+ return $options;
106
+ }
107
+
108
+ /**
109
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
110
+ *
111
+ * @param array $field Field parameters.
112
+ * @param string $value The value.
113
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
114
+ * @param int|null $post_id Post ID. null for current post. Optional.
115
+ *
116
+ * @return string
117
+ */
118
+ public static function format_single_value( $field, $value, $args, $post_id ) {
119
+ return self::call( 'get_option_label', $field, $value );
120
+ }
121
+
122
+ /**
123
+ * Get option label.
124
+ *
125
+ * @param array $field Field parameters.
126
+ * @param string $value Option value.
127
+ *
128
+ * @return string
129
+ */
130
+ public static function get_option_label( $field, $value ) {
131
+ $options = self::call( 'get_options', $field );
132
+ return isset( $options[ $value ] ) ? $options[ $value ]->label : '';
133
+ }
134
+ }
inc/meta-box/inc/fields/color.php CHANGED
@@ -1,71 +1,87 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Color_Field' ) )
6
- {
7
- class RWMB_Color_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_style( 'rwmb-color', TX_RWMB_CSS_URL . 'color.css', array( 'wp-color-picker' ), TX_RWMB_VER );
17
- wp_enqueue_script( 'rwmb-color', TX_RWMB_JS_URL . 'color.js', array( 'wp-color-picker' ), TX_RWMB_VER, true );
18
- }
19
-
20
- /**
21
- * Get field HTML
22
- *
23
- * @param mixed $meta
24
- * @param array $field
25
- *
26
- * @return string
27
- */
28
- static function html( $meta, $field )
29
- {
30
- return sprintf(
31
- '<input class="rwmb-color" type="text" name="%s" id="%s" value="%s" size="%s" />
32
- <div class="rwmb-color-picker"></div>',
33
- $field['field_name'],
34
- empty( $field['clone'] ) ? $field['id'] : '',
35
- $meta,
36
- $field['size']
37
- );
38
- }
39
-
40
- /**
41
- * Don't save '#' when no color is chosen
42
- *
43
- * @param mixed $new
44
- * @param mixed $old
45
- * @param int $post_id
46
- * @param array $field
47
- *
48
- * @return int
49
- */
50
- static function value( $new, $old, $post_id, $field )
51
- {
52
- return '#' === $new ? '' : $new;
53
- }
54
-
55
- /**
56
- * Normalize parameters for field
57
- *
58
- * @param array $field
59
- *
60
- * @return array
61
- */
62
- static function normalize_field( $field )
63
- {
64
- $field = wp_parse_args( $field, array(
65
- 'size' => 7,
66
- ) );
67
-
68
- return $field;
69
- }
70
- }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The color field which uses WordPress color picker to select a color.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Color field class.
10
+ */
11
+ class RWMB_Color_Field extends RWMB_Text_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-color', RWMB_CSS_URL . 'color.css', array( 'wp-color-picker' ), RWMB_VER );
17
+
18
+ $dependencies = array( 'wp-color-picker' );
19
+ $args = func_get_args();
20
+ $field = reset( $args );
21
+ if ( ! empty( $field['alpha_channel'] ) ) {
22
+ wp_enqueue_script( 'wp-color-picker-alpha', RWMB_JS_URL . 'wp-color-picker-alpha/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), RWMB_VER, true );
23
+ $dependencies = array( 'wp-color-picker-alpha' );
24
+ }
25
+ wp_enqueue_script( 'rwmb-color', RWMB_JS_URL . 'color.js', $dependencies, RWMB_VER, true );
26
+ }
27
+
28
+ /**
29
+ * Normalize parameters for field.
30
+ *
31
+ * @param array $field Field parameters.
32
+ *
33
+ * @return array
34
+ */
35
+ public static function normalize( $field ) {
36
+ $field = wp_parse_args( $field, array(
37
+ 'alpha_channel' => false,
38
+ 'js_options' => array(),
39
+ ) );
40
+
41
+ $field['js_options'] = wp_parse_args( $field['js_options'], array(
42
+ 'defaultColor' => false,
43
+ 'hide' => true,
44
+ 'palettes' => true,
45
+ ) );
46
+
47
+ $field = parent::normalize( $field );
48
+
49
+ return $field;
50
+ }
51
+
52
+ /**
53
+ * Get the attributes for a field.
54
+ *
55
+ * @param array $field Field parameters.
56
+ * @param mixed $value Meta value.
57
+ *
58
+ * @return array
59
+ */
60
+ public static function get_attributes( $field, $value = null ) {
61
+ $attributes = parent::get_attributes( $field, $value );
62
+ $attributes = wp_parse_args( $attributes, array(
63
+ 'data-options' => wp_json_encode( $field['js_options'] ),
64
+ ) );
65
+ $attributes['type'] = 'text';
66
+
67
+ if ( $field['alpha_channel'] ) {
68
+ $attributes['data-alpha'] = 'true';
69
+ }
70
+
71
+ return $attributes;
72
+ }
73
+
74
+ /**
75
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
76
+ *
77
+ * @param array $field Field parameters.
78
+ * @param string $value The value.
79
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
80
+ * @param int|null $post_id Post ID. null for current post. Optional.
81
+ *
82
+ * @return string
83
+ */
84
+ public static function format_single_value( $field, $value, $args, $post_id ) {
85
+ return sprintf( "<span style='display:inline-block;width:20px;height:20px;border-radius:50%%;background:%s;'></span>", $value );
86
+ }
87
+ }
inc/meta-box/inc/fields/custom-html.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The custom HTML field which allows users to output any kind of content to the meta box.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Custom HTML field class.
10
+ */
11
+ class RWMB_Custom_Html_Field extends RWMB_Field {
12
+ /**
13
+ * Get field HTML.
14
+ *
15
+ * @param mixed $meta Meta value.
16
+ * @param array $field Field parameters.
17
+ *
18
+ * @return string
19
+ */
20
+ public static function html( $meta, $field ) {
21
+ $html = ! empty( $field['std'] ) ? $field['std'] : '';
22
+ if ( ! empty( $field['callback'] ) && is_callable( $field['callback'] ) ) {
23
+ $html = call_user_func_array( $field['callback'], array( $meta, $field ) );
24
+ }
25
+ return $html;
26
+ }
27
+ }
inc/meta-box/inc/fields/date.php CHANGED
@@ -1,86 +1,32 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Date_Field' ) )
6
- {
7
- class RWMB_Date_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- $url = TX_RWMB_CSS_URL . 'jqueryui';
17
- wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
18
- wp_register_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
19
- wp_enqueue_style( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
20
-
21
- // Load localized scripts
22
- $locale = str_replace( '_', '-', get_locale() );
23
- $file_paths = array( 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js' );
24
- // Also check alternate i18n filename (e.g. jquery.ui.datepicker-de.js instead of jquery.ui.datepicker-de-DE.js)
25
- if ( strlen( $locale ) > 2 )
26
- $file_paths[] = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . substr( $locale, 0, 2 ) . '.js';
27
- $deps = array( 'jquery-ui-datepicker' );
28
- foreach ( $file_paths as $file_path )
29
- {
30
- if ( file_exists( RWMB_DIR . 'js/' . $file_path ) )
31
- {
32
- wp_register_script( 'jquery-ui-datepicker-i18n', TX_RWMB_JS_URL . $file_path, $deps, '1.8.17', true );
33
- $deps[] = 'jquery-ui-datepicker-i18n';
34
- break;
35
- }
36
- }
37
-
38
- wp_enqueue_script( 'rwmb-date', TX_RWMB_JS_URL . 'date.js', $deps, TX_RWMB_VER, true );
39
- wp_localize_script( 'rwmb-date', 'RWMB_Datepicker', array( 'lang' => $locale ) );
40
- }
41
-
42
- /**
43
- * Get field HTML
44
- *
45
- * @param mixed $meta
46
- * @param array $field
47
- *
48
- * @return string
49
- */
50
- static function html( $meta, $field )
51
- {
52
- return sprintf(
53
- '<input type="text" class="rwmb-date" name="%s" value="%s" id="%s" size="%s" data-options="%s" />',
54
- $field['field_name'],
55
- $meta,
56
- isset( $field['clone'] ) && $field['clone'] ? '' : $field['id'],
57
- $field['size'],
58
- esc_attr( json_encode( $field['js_options'] ) )
59
- );
60
- }
61
-
62
- /**
63
- * Normalize parameters for field
64
- *
65
- * @param array $field
66
- *
67
- * @return array
68
- */
69
- static function normalize_field( $field )
70
- {
71
- $field = wp_parse_args( $field, array(
72
- 'size' => 30,
73
- 'js_options' => array(),
74
- ) );
75
-
76
- // Deprecate 'format', but keep it for backward compatible
77
- // Use 'js_options' instead
78
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
79
- 'dateFormat' => empty( $field['format'] ) ? 'yy-mm-dd' : $field['format'],
80
- 'showButtonPanel' => true,
81
- ) );
82
-
83
- return $field;
84
- }
85
- }
86
- }
1
+ <?php
2
+ /**
3
+ * The date picker field, which uses built-in jQueryUI date picker widget.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Date field class.
10
+ */
11
+ class RWMB_Date_Field extends RWMB_Datetime_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ parent::admin_register_scripts();
17
+ wp_enqueue_style( 'rwmb-date' );
18
+ wp_enqueue_script( 'rwmb-date' );
19
+ }
20
+
21
+ /**
22
+ * Returns a date() compatible format string from the JavaScript format.
23
+ *
24
+ * @link http://www.php.net/manual/en/function.date.php
25
+ * @param array $field Field parameters.
26
+ *
27
+ * @return string
28
+ */
29
+ public static function translate_format( $field ) {
30
+ return strtr( $field['js_options']['dateFormat'], self::$date_formats );
31
+ }
32
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/datetime.php CHANGED
@@ -1,156 +1,263 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Datetime_Field' ) )
6
- {
7
- class RWMB_Datetime_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- $url = TX_RWMB_CSS_URL . 'jqueryui';
17
- wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
18
- wp_register_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
19
- wp_register_style( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
20
- wp_register_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
21
- wp_enqueue_style( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7' );
22
-
23
- wp_register_script( 'jquery-ui-timepicker', TX_RWMB_JS_URL . 'jqueryui/jquery-ui-timepicker-addon.js', array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
24
-
25
- // Load localized scripts
26
- $locale = str_replace( '_', '-', get_locale() );
27
- $date_paths = array( 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js' );
28
- $time_paths = array( 'jqueryui/timepicker-i18n/jquery-ui-timepicker-' . $locale . '.js' );
29
- if ( strlen( $locale ) > 2 )
30
- {
31
- // Also check alternate i18n filenames
32
- // (e.g. jquery.ui.datepicker-de.js instead of jquery.ui.datepicker-de-DE.js)
33
- $date_paths[] = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . substr( $locale, 0, 2 ) . '.js';
34
- $time_paths[] = 'jqueryui/timepicker-i18n/jquery-ui-timepicker-' . substr( $locale, 0, 2 ) . '.js';
35
- }
36
- $deps = array( 'jquery-ui-datepicker', 'jquery-ui-timepicker' );
37
- foreach ( $date_paths as $date_path )
38
- {
39
- if ( file_exists( RWMB_DIR . 'js/' . $date_path ) )
40
- {
41
- wp_register_script( 'jquery-ui-datepicker-i18n', TX_RWMB_JS_URL . $date_path, array( 'jquery-ui-datepicker' ), '1.8.17', true );
42
- $deps[] = 'jquery-ui-datepicker-i18n';
43
- break;
44
- }
45
- }
46
- foreach ( $time_paths as $time_path )
47
- {
48
- if ( file_exists( RWMB_DIR . 'js/' . $time_path ) )
49
- {
50
- wp_register_script( 'jquery-ui-timepicker-i18n', TX_RWMB_JS_URL . $time_path, array( 'jquery-ui-timepicker' ), '1.8.17', true );
51
- $deps[] = 'jquery-ui-timepicker-i18n';
52
- break;
53
- }
54
- }
55
-
56
- wp_enqueue_script( 'rwmb-datetime', TX_RWMB_JS_URL . 'datetime.js', $deps, TX_RWMB_VER, true );
57
- wp_localize_script( 'rwmb-datetime', 'RWMB_Datetimepicker', array( 'lang' => $locale ) );
58
- }
59
-
60
- /**
61
- * Get field HTML
62
- *
63
- * @param mixed $meta
64
- * @param array $field
65
- *
66
- * @return string
67
- */
68
- static function html( $meta, $field )
69
- {
70
- return sprintf(
71
- '<input type="text" class="rwmb-datetime" name="%s" value="%s" id="%s" size="%s" data-options="%s">',
72
- $field['field_name'],
73
- isset( $field['timestamp'] ) && $field['timestamp'] ? date( self::translate_format( $field ), $meta ) : $meta,
74
- isset( $field['clone'] ) && $field['clone'] ? '' : $field['id'],
75
- $field['size'],
76
- esc_attr( json_encode( $field['js_options'] ) )
77
- );
78
- }
79
-
80
- /**
81
- * Calculates the timestamp from the datetime string and returns it
82
- * if $field['timestamp'] is set or the datetime string if not
83
- *
84
- * @param mixed $new
85
- * @param mixed $old
86
- * @param int $post_id
87
- * @param array $field
88
- *
89
- * @return string|int
90
- */
91
- static function value( $new, $old, $post_id, $field )
92
- {
93
- if ( ! $field['timestamp'] )
94
- return $new;
95
-
96
- $d = DateTime::createFromFormat( self::translate_format( $field ), $new );
97
-
98
- return $d ? $d->getTimestamp() : 0;
99
- }
100
-
101
- /**
102
- * Normalize parameters for field
103
- *
104
- * @param array $field
105
- *
106
- * @return array
107
- */
108
- static function normalize_field( $field )
109
- {
110
- $field = wp_parse_args( $field, array(
111
- 'size' => 30,
112
- 'js_options' => array(),
113
- 'timestamp' => false,
114
- ) );
115
-
116
- // Deprecate 'format', but keep it for backward compatible
117
- // Use 'js_options' instead
118
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
119
- 'dateFormat' => empty( $field['format'] ) ? 'yy-mm-dd' : $field['format'],
120
- 'timeFormat' => 'hh:mm',
121
- 'showButtonPanel' => true,
122
- 'separator' => ' ',
123
- ) );
124
-
125
- return $field;
126
- }
127
-
128
- // Missing: 't' => '', T' => '', 'm' => '', 's' => ''
129
- static $time_format_translation = array(
130
- 'H' => 'H', 'HH' => 'H', 'h' => 'H', 'hh' => 'H',
131
- 'mm' => 'i', 'ss' => 's', 'l' => 'u', 'tt' => 'a', 'TT' => 'A',
132
- );
133
-
134
- // Missing: 'o' => '', '!' => '', 'oo' => '', '@' => '', "''" => "'"
135
- static $date_format_translation = array(
136
- 'd' => 'j', 'dd' => 'd', 'oo' => 'z', 'D' => 'D', 'DD' => 'l',
137
- 'm' => 'n', 'mm' => 'm', 'M' => 'M', 'MM' => 'F', 'y' => 'y', 'yy' => 'Y',
138
- );
139
-
140
- /**
141
- * Returns a date() compatible format string from the JavaScript format
142
- *
143
- * @see http://www.php.net/manual/en/function.date.php
144
- *
145
- * @param array $field
146
- *
147
- * @return string
148
- */
149
- static function translate_format( $field )
150
- {
151
- return strtr( $field['js_options']['dateFormat'], self::$date_format_translation )
152
- . $field['js_options']['separator']
153
- . strtr( $field['js_options']['timeFormat'], self::$time_format_translation );
154
- }
155
- }
156
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The date and time picker field which allows users to select both date and time via jQueryUI datetime picker.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Datetime field class.
10
+ */
11
+ class RWMB_Datetime_Field extends RWMB_Text_Field {
12
+ /**
13
+ * Translate date format from jQuery UI date picker to PHP date().
14
+ * It's used to store timestamp value of the field.
15
+ * Missing: '!' => '', 'oo' => '', '@' => '', "''" => "'".
16
+ *
17
+ * @var array
18
+ */
19
+ protected static $date_formats = array(
20
+ 'd' => 'j',
21
+ 'dd' => 'd',
22
+ 'oo' => 'z',
23
+ 'D' => 'D',
24
+ 'DD' => 'l',
25
+ 'm' => 'n',
26
+ 'mm' => 'm',
27
+ 'M' => 'M',
28
+ 'MM' => 'F',
29
+ 'y' => 'y',
30
+ 'yy' => 'Y',
31
+ 'o' => 'z',
32
+ );
33
+
34
+ /**
35
+ * Translate time format from jQuery UI time picker to PHP date().
36
+ * It's used to store timestamp value of the field.
37
+ * Missing: 't' => '', T' => '', 'm' => '', 's' => ''.
38
+ *
39
+ * @var array
40
+ */
41
+ protected static $time_formats = array(
42
+ 'H' => 'G',
43
+ 'HH' => 'H',
44
+ 'h' => 'g',
45
+ 'hh' => 'h',
46
+ 'mm' => 'i',
47
+ 'ss' => 's',
48
+ 'l' => 'u',
49
+ 'tt' => 'a',
50
+ 'TT' => 'A',
51
+ );
52
+
53
+ /**
54
+ * Register scripts and styles.
55
+ */
56
+ public static function admin_register_scripts() {
57
+ $url = RWMB_CSS_URL . 'jqueryui';
58
+ wp_register_style( 'jquery-ui-core', "$url/jquery.ui.core.css", array(), '1.8.17' );
59
+ wp_register_style( 'jquery-ui-theme', "$url/jquery.ui.theme.css", array(), '1.8.17' );
60
+ wp_register_style( 'jquery-ui-datepicker', "$url/jquery.ui.datepicker.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
61
+ wp_register_style( 'rwmb-date', RWMB_CSS_URL . 'datepicker.css', array( 'jquery-ui-datepicker' ), '1.8.17' );
62
+
63
+ wp_register_style( 'jquery-ui-slider', "$url/jquery.ui.slider.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
64
+ wp_register_style( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.css", array( 'rwmb-date', 'jquery-ui-slider' ), '1.5.0' );
65
+
66
+ $url = RWMB_JS_URL . 'jqueryui';
67
+ wp_register_script( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '1.5.0', true );
68
+ wp_register_script( 'jquery-ui-timepicker-i18n', "$url/jquery-ui-timepicker-addon-i18n.min.js", array( 'jquery-ui-timepicker' ), '1.5.0', true );
69
+
70
+ wp_register_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', array( 'jquery-ui-datepicker', 'jquery-ui-timepicker-i18n' ), RWMB_VER, true );
71
+ wp_register_script( 'rwmb-date', RWMB_JS_URL . 'date.js', array( 'jquery-ui-datepicker' ), RWMB_VER, true );
72
+ wp_register_script( 'rwmb-time', RWMB_JS_URL . 'time.js', array( 'jquery-ui-timepicker-i18n' ), RWMB_VER, true );
73
+
74
+ $handles = array( 'datetime', 'time' );
75
+ $locale = str_replace( '_', '-', get_locale() );
76
+ $locale_short = substr( $locale, 0, 2 );
77
+ $data = array(
78
+ 'locale' => $locale,
79
+ 'localeShort' => $locale_short,
80
+ );
81
+ foreach ( $handles as $handle ) {
82
+ self::localize_script( "rwmb-$handle", 'RWMB_' . ucfirst( $handle ), $data );
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Enqueue scripts and styles.
88
+ */
89
+ public static function admin_enqueue_scripts() {
90
+ self::admin_register_scripts();
91
+ wp_enqueue_style( 'jquery-ui-timepicker' );
92
+ wp_enqueue_script( 'rwmb-datetime' );
93
+ }
94
+
95
+ /**
96
+ * Get field HTML.
97
+ *
98
+ * @param mixed $meta The field meta value.
99
+ * @param array $field The field parameters.
100
+ *
101
+ * @return string
102
+ */
103
+ public static function html( $meta, $field ) {
104
+ $output = '';
105
+
106
+ if ( $field['timestamp'] ) {
107
+ $name = $field['field_name'];
108
+ $field = wp_parse_args( array(
109
+ 'field_name' => $name . '[formatted]',
110
+ ), $field );
111
+ $output .= sprintf(
112
+ '<input type="hidden" name="%s" class="rwmb-datetime-timestamp" value="%s">',
113
+ esc_attr( $name . '[timestamp]' ),
114
+ isset( $meta['timestamp'] ) ? intval( $meta['timestamp'] ) : ''
115
+ );
116
+ $meta = isset( $meta['formatted'] ) ? $meta['formatted'] : '';
117
+ }
118
+
119
+ $output .= parent::html( $meta, $field );
120
+
121
+ if ( $field['inline'] ) {
122
+ $output .= '<div class="rwmb-datetime-inline"></div>';
123
+ }
124
+
125
+ return $output;
126
+ }
127
+
128
+ /**
129
+ * Calculates the timestamp from the datetime string and returns it if $field['timestamp'] is set or the datetime string if not.
130
+ *
131
+ * @param mixed $new The submitted meta value.
132
+ * @param mixed $old The existing meta value.
133
+ * @param int $post_id The post ID.
134
+ * @param array $field The field parameters.
135
+ *
136
+ * @return string|int
137
+ */
138
+ public static function value( $new, $old, $post_id, $field ) {
139
+ return $field['timestamp'] ? $new['timestamp'] : $new;
140
+ }
141
+
142
+ /**
143
+ * Get meta value.
144
+ *
145
+ * @param int $post_id The post ID.
146
+ * @param bool $saved Whether the meta box is saved at least once.
147
+ * @param array $field The field parameters.
148
+ *
149
+ * @return mixed
150
+ */
151
+ public static function meta( $post_id, $saved, $field ) {
152
+ $meta = parent::meta( $post_id, $saved, $field );
153
+ if ( $field['timestamp'] ) {
154
+ $meta = self::prepare_meta( $meta, $field );
155
+ }
156
+ return $meta;
157
+ }
158
+
159
+ /**
160
+ * Format meta value if set 'timestamp'.
161
+ *
162
+ * @param array|string $meta The meta value.
163
+ * @param array $field Field parameters.
164
+ * @return array
165
+ */
166
+ protected static function prepare_meta( $meta, $field ) {
167
+ if ( is_array( $meta ) ) {
168
+ foreach ( $meta as $key => $value ) {
169
+ $meta[ $key ] = self::prepare_meta( $value, $field );
170
+ }
171
+ return $meta;
172
+ }
173
+ return array(
174
+ 'timestamp' => $meta ? $meta : null,
175
+ 'formatted' => $meta ? date( self::call( 'translate_format', $field ), intval( $meta ) ) : '',
176
+ );
177
+ }
178
+
179
+ /**
180
+ * Normalize parameters for field.
181
+ *
182
+ * @param array $field The field parameters.
183
+ * @return array
184
+ */
185
+ public static function normalize( $field ) {
186
+ $field = wp_parse_args( $field, array(
187
+ 'timestamp' => false,
188
+ 'inline' => false,
189
+ 'js_options' => array(),
190
+ ) );
191
+
192
+ // Deprecate 'format', but keep it for backward compatible.
193
+ // Use 'js_options' instead.
194
+ $field['js_options'] = wp_parse_args( $field['js_options'], array(
195
+ 'timeFormat' => 'HH:mm',
196
+ 'separator' => ' ',
197
+ 'dateFormat' => empty( $field['format'] ) ? 'yy-mm-dd' : $field['format'],
198
+ 'showButtonPanel' => true,
199
+ ) );
200
+
201
+ if ( $field['inline'] ) {
202
+ $field['js_options'] = wp_parse_args( $field['js_options'], array(
203
+ 'altFieldTimeOnly' => false,
204
+ ) );
205
+ }
206
+
207
+ $field = parent::normalize( $field );
208
+
209
+ return $field;
210
+ }
211
+
212
+ /**
213
+ * Get the attributes for a field.
214
+ *
215
+ * @param array $field The field parameters.
216
+ * @param mixed $value The meta value.
217
+ *
218
+ * @return array
219
+ */
220
+ public static function get_attributes( $field, $value = null ) {
221
+ $attributes = parent::get_attributes( $field, $value );
222
+ $attributes = wp_parse_args( $attributes, array(
223
+ 'data-options' => wp_json_encode( $field['js_options'] ),
224
+ ) );
225
+ $attributes['type'] = 'text';
226
+
227
+ return $attributes;
228
+ }
229
+
230
+ /**
231
+ * Returns a date() compatible format string from the JavaScript format.
232
+ *
233
+ * @link http://www.php.net/manual/en/function.date.php
234
+ * @param array $field The field parameters.
235
+ *
236
+ * @return string
237
+ */
238
+ public static function translate_format( $field ) {
239
+ return strtr( $field['js_options']['dateFormat'], self::$date_formats )
240
+ . $field['js_options']['separator']
241
+ . strtr( $field['js_options']['timeFormat'], self::$time_formats );
242
+ }
243
+
244
+ /**
245
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
246
+ *
247
+ * @param array $field Field parameters.
248
+ * @param string $value The value.
249
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
250
+ * @param int|null $post_id Post ID. null for current post. Optional.
251
+ *
252
+ * @return string
253
+ */
254
+ public static function format_single_value( $field, $value, $args, $post_id ) {
255
+ if ( ! isset( $args['format'] ) ) {
256
+ return $value;
257
+ }
258
+ if ( ! $field['timestamp'] ) {
259
+ $value = strtotime( $value );
260
+ }
261
+ return date( $args['format'], $value );
262
+ }
263
+ }
inc/meta-box/inc/fields/divider.php CHANGED
@@ -1,45 +1,43 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Divider_Field' ) )
6
- {
7
- class RWMB_Divider_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_style( 'rwmb-divider', TX_RWMB_CSS_URL . 'divider.css', array(), TX_RWMB_VER );
17
- }
18
-
19
- /**
20
- * Show begin HTML markup for fields
21
- *
22
- * @param mixed $meta
23
- * @param array $field
24
- *
25
- * @return string
26
- */
27
- static function begin_html( $meta, $field )
28
- {
29
- return '<hr>';
30
- }
31
-
32
- /**
33
- * Show end HTML markup for fields
34
- *
35
- * @param mixed $meta
36
- * @param array $field
37
- *
38
- * @return string
39
- */
40
- static function end_html( $meta, $field )
41
- {
42
- return '';
43
- }
44
- }
45
- }
1
+ <?php
2
+ /**
3
+ * The divider field which displays a simple horizontal line.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Divider field class.
10
+ */
11
+ class RWMB_Divider_Field extends RWMB_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-divider', RWMB_CSS_URL . 'divider.css', array(), RWMB_VER );
17
+ }
18
+
19
+ /**
20
+ * Show begin HTML markup for fields.
21
+ *
22
+ * @param mixed $meta Meta value.
23
+ * @param array $field Field parameters.
24
+ *
25
+ * @return string
26
+ */
27
+ public static function begin_html( $meta, $field ) {
28
+ $attributes = empty( $field['id'] ) ? '' : " id='{$field['id']}'";
29
+ return "<hr$attributes>";
30
+ }
31
+
32
+ /**
33
+ * Show end HTML markup for fields.
34
+ *
35
+ * @param mixed $meta Meta value.
36
+ * @param array $field Field parameters.
37
+ *
38
+ * @return string
39
+ */
40
+ public static function end_html( $meta, $field ) {
41
+ return '';
42
+ }
43
+ }
 
 
inc/meta-box/inc/fields/email.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- // Make sure "text" field is loaded
6
- require_once TX_RWMB_FIELDS_DIR . 'text.php';
7
-
8
- if ( ! class_exists( 'RWMB_Email_Field' ) )
9
- {
10
- class RWMB_Email_Field extends RWMB_Text_Field
11
- {
12
- /**
13
- * Get field HTML
14
- *
15
- * @param mixed $meta
16
- * @param array $field
17
- *
18
- * @return string
19
- */
20
- static function html( $meta, $field )
21
- {
22
- return sprintf(
23
- '<input type="email" class="rwmb-email" name="%s" id="%s" value="%s" size="%s" placeholder="%s"/>',
24
- $field['field_name'],
25
- $field['id'],
26
- $meta,
27
- $field['size'],
28
- $field['placeholder']
29
- );
30
- }
31
-
32
- /**
33
- * Sanitize email
34
- *
35
- * @param mixed $new
36
- * @param mixed $old
37
- * @param int $post_id
38
- * @param array $field
39
- *
40
- * @return string
41
- */
42
- static function value( $new, $old, $post_id, $field )
43
- {
44
- return sanitize_email( $new );
45
- }
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/fieldset-text.php CHANGED
@@ -1,78 +1,125 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
 
 
 
4
 
5
- if ( ! class_exists( 'RWMB_Fieldset_Text_Field' ) )
6
- {
7
- class RWMB_Fieldset_Text_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- if ( count( $meta ) == 1 && trim( $meta[0] ) == '' )
20
- $meta = '';
21
 
22
- $html = array();
23
- $before = '<fieldset><legend>' . $field['desc'] . '</legend>';
24
- $after = '</fieldset>';
 
 
 
 
 
 
 
 
25
 
26
- $tpl = '<label>%s <input type="text" class="rwmb-fieldset-text" name="%s[%s][%d]" placeholder="%s" value="%s" /></label>';
 
 
 
 
27
 
28
- for ( $n = 0; $n < $field['rows']; $n ++ )
29
- {
30
- foreach ( $field['options'] as $k => $v )
31
- {
32
- $fid = $field['id'];
33
- if ( is_array( $meta ) && ! empty( $meta ) )
34
- $html[] = sprintf( $tpl, $k, $fid, $v, $n, $k, $meta[$v][$n] );
35
- else
36
- $html[] = sprintf( $tpl, $k, $fid, $v, $n, $k, '' );
37
- }
38
- $html[] = '<br>';
39
- }
40
 
41
- $out = $before . implode( ' ', $html ) . $after;
 
42
 
43
- return $out;
44
- }
 
 
 
 
 
 
 
 
45
 
46
- /**
47
- * Get meta value
48
- *
49
- * @param $post_id
50
- * @param $saved
51
- * @param $field
52
- *
53
- * @return array
54
- */
55
- static function meta( $post_id, $saved, $field )
56
- {
57
- $meta = get_post_meta( $post_id, $field['id'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
- if ( is_array( $meta ) && ! empty( $meta ) )
60
- $meta = $meta[0];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
- return $meta;
 
 
 
 
 
63
  }
 
 
 
64
 
65
- /**
66
- * Save meta value
67
- *
68
- * @param $new
69
- * @param $old
70
- * @param $post_id
71
- * @param $field
72
- */
73
- static function save( $new, $old, $post_id, $field )
74
- {
75
- update_post_meta( $post_id, $field['id'], $new, $old );
 
 
 
76
  }
 
 
77
  }
78
  }
1
  <?php
2
+ /**
3
+ * The text fieldset field, which allows users to enter content for a list of text fields.
4
+ *
5
+ * @package Meta Box
6
+ */
7
 
8
+ /**
9
+ * Fieldset text class.
10
+ */
11
+ class RWMB_Fieldset_Text_Field extends RWMB_Text_Field {
12
+ /**
13
+ * Enqueue field scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-fieldset-text', RWMB_CSS_URL . 'fieldset-text.css', '', RWMB_VER );
17
+ }
 
 
 
 
 
 
18
 
19
+ /**
20
+ * Get field HTML.
21
+ *
22
+ * @param mixed $meta Meta value.
23
+ * @param array $field Field parameters.
24
+ *
25
+ * @return string
26
+ */
27
+ public static function html( $meta, $field ) {
28
+ $html = array();
29
+ $tpl = '<p><label>%s</label> %s</p>';
30
 
31
+ foreach ( $field['options'] as $key => $label ) {
32
+ $value = isset( $meta[ $key ] ) ? $meta[ $key ] : '';
33
+ $field['attributes']['name'] = $field['field_name'] . "[{$key}]";
34
+ $html[] = sprintf( $tpl, $label, parent::html( $value, $field ) );
35
+ }
36
 
37
+ $out = '<fieldset><legend>' . $field['desc'] . '</legend>' . implode( ' ', $html ) . '</fieldset>';
 
 
 
 
 
 
 
 
 
 
 
38
 
39
+ return $out;
40
+ }
41
 
42
+ /**
43
+ * Do not show field description.
44
+ *
45
+ * @param array $field Field parameters.
46
+ *
47
+ * @return string
48
+ */
49
+ public static function input_description( $field ) {
50
+ return '';
51
+ }
52
 
53
+ /**
54
+ * Do not show field description.
55
+ *
56
+ * @param array $field Field parameters.
57
+ *
58
+ * @return string
59
+ */
60
+ public static function label_description( $field ) {
61
+ return '';
62
+ }
63
+
64
+ /**
65
+ * Normalize parameters for field.
66
+ *
67
+ * @param array $field Field parameters.
68
+ *
69
+ * @return array
70
+ */
71
+ public static function normalize( $field ) {
72
+ $field = parent::normalize( $field );
73
+ $field['multiple'] = false;
74
+ $field['attributes']['id'] = false;
75
+ $field['attributes']['type'] = 'text';
76
+ return $field;
77
+ }
78
 
79
+ /**
80
+ * Format value for the helper functions.
81
+ *
82
+ * @param array $field Field parameters.
83
+ * @param string|array $value The field meta value.
84
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
85
+ * @param int|null $post_id Post ID. null for current post. Optional.
86
+ *
87
+ * @return string
88
+ */
89
+ public static function format_value( $field, $value, $args, $post_id ) {
90
+ $output = '<table><thead><tr>';
91
+ foreach ( $field['options'] as $label ) {
92
+ $output .= "<th>$label</th>";
93
+ }
94
+ $output .= '</tr></thead></tbody>';
95
 
96
+ if ( ! $field['clone'] ) {
97
+ $output .= self::format_single_value( $field, $value, $args, $post_id );
98
+ } else {
99
+ foreach ( $value as $subvalue ) {
100
+ $output .= self::format_single_value( $field, $subvalue, $args, $post_id );
101
+ }
102
  }
103
+ $output .= '</tbody></table>';
104
+ return $output;
105
+ }
106
 
107
+ /**
108
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
109
+ *
110
+ * @param array $field Field parameters.
111
+ * @param array $value The value.
112
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
113
+ * @param int|null $post_id Post ID. null for current post. Optional.
114
+ *
115
+ * @return string
116
+ */
117
+ public static function format_single_value( $field, $value, $args, $post_id ) {
118
+ $output = '<tr>';
119
+ foreach ( $value as $subvalue ) {
120
+ $output .= "<td>$subvalue</td>";
121
  }
122
+ $output .= '</tr>';
123
+ return $output;
124
  }
125
  }
inc/meta-box/inc/fields/file-advanced.php DELETED
@@ -1,124 +0,0 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- require_once TX_RWMB_FIELDS_DIR . 'file.php';
6
- if ( ! class_exists( 'RWMB_File_Advanced_Field' ) )
7
- {
8
- class RWMB_File_Advanced_Field extends RWMB_File_Field
9
- {
10
- /**
11
- * Enqueue scripts and styles
12
- *
13
- * @return void
14
- */
15
- static function admin_enqueue_scripts()
16
- {
17
- parent::admin_enqueue_scripts();
18
-
19
- // Make sure scripts for new media uploader in WordPress 3.5 is enqueued
20
- wp_enqueue_media();
21
- wp_enqueue_script( 'rwmb-file-advanced', TX_RWMB_JS_URL . 'file-advanced.js', array( 'jquery', 'underscore' ), TX_RWMB_VER, true );
22
- wp_localize_script( 'rwmb-file-advanced', 'rwmbFileAdvanced', array(
23
- 'frameTitle' => __( 'Select Files', 'meta-box' ),
24
- ) );
25
- }
26
-
27
- /**
28
- * Add actions
29
- *
30
- * @return void
31
- */
32
- static function add_actions()
33
- {
34
- parent::add_actions();
35
-
36
- // Attach images via Ajax
37
- add_action( 'wp_ajax_rwmb_attach_file', array( __CLASS__, 'wp_ajax_attach_file' ) );
38
- add_action( 'print_media_templates', array( __CLASS__, 'print_templates' ) );
39
- }
40
-
41
- static function wp_ajax_attach_file()
42
- {
43
- $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
44
- $field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
45
- $attachment_ids = isset( $_POST['attachment_ids'] ) ? (array) $_POST['attachment_ids'] : array();
46
-
47
- check_ajax_referer( "rwmb-attach-file_{$field_id}" );
48
- foreach ( $attachment_ids as $attachment_id )
49
- {
50
- add_post_meta( $post_id, $field_id, $attachment_id, false );
51
- }
52
-
53
- wp_send_json_success();
54
- }
55
-
56
- /**
57
- * Get field HTML
58
- *
59
- * @param mixed $meta
60
- * @param array $field
61
- *
62
- * @return string
63
- */
64
- static function html( $meta, $field )
65
- {
66
- $i18n_title = apply_filters( 'rwmb_file_advanced_select_string', _x( 'Select or Upload Files', 'file upload', 'meta-box' ), $field );
67
- $attach_nonce = wp_create_nonce( "rwmb-attach-file_{$field['id']}" );
68
-
69
- // Uploaded files
70
- $html = self::get_uploaded_files( $meta, $field );
71
-
72
- // Show form upload
73
- $classes = array( 'button', 'rwmb-file-advanced-upload', 'hide-if-no-js', 'new-files' );
74
- if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
75
- $classes[] = 'hidden';
76
-
77
- $classes = implode( ' ', $classes );
78
- $html .= "<a href='#' class='{$classes}' data-attach_file_nonce={$attach_nonce}>{$i18n_title}</a>";
79
-
80
- return $html;
81
- }
82
-
83
- /**
84
- * Get field value
85
- * It's the combination of new (uploaded) images and saved images
86
- *
87
- * @param array $new
88
- * @param array $old
89
- * @param int $post_id
90
- * @param array $field
91
- *
92
- * @return array|mixed
93
- */
94
- static function value( $new, $old, $post_id, $field )
95
- {
96
- $new = (array) $new;
97
-
98
- return array_unique( array_merge( $old, $new ) );
99
- }
100
-
101
- static function print_templates()
102
- {
103
- $i18n_delete = apply_filters( 'rwmb_file_delete_string', _x( 'Delete', 'file upload', 'meta-box' ) );
104
- $i18n_edit = apply_filters( 'rwmb_file_edit_string', _x( 'Edit', 'file upload', 'meta-box' ) );
105
- ?>
106
- <script id="tmpl-rwmb-file-advanced" type="text/html">
107
- <# _.each( attachments, function( attachment ) { #>
108
- <li id="item_{{{ attachment.id }}}">
109
- <div class="rwmb-icon">
110
- <img src="<# if ( attachment.type == 'image' ){ #>{{{ attachment.sizes.thumbnail.url }}}<# } else { #>{{{ attachment.icon }}}<# } #>">
111
- </div>
112
- <div class="rwmb-info">
113
- <a href="{{{ attachment.url }}}" target="_blank">{{{ attachment.title }}}</a>
114
- <p>{{{ attachment.mime }}}</p>
115
- <a title="<?php echo esc_attr( $i18n_edit ); ?>" href="{{{ attachment.editLink }}}" target="_blank"><?php echo esc_html( $i18n_edit ); ?></a> |
116
- <a title="<?php echo esc_attr( $i18n_delete ); ?>" class="rwmb-delete-file" href="#" data-attachment_id="{{{ attachment.id }}}"><?php echo esc_html( $i18n_delete ); ?></a>
117
- </div>
118
- </li>
119
- <# } ); #>
120
- </script>
121
- <?php
122
- }
123
- }
124
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/file-input.php CHANGED
@@ -1,63 +1,58 @@
1
- <?php
2
- if ( ! class_exists( 'RWMB_File_Input_Field' ) )
3
- {
4
- class RWMB_File_Input_Field extends RWMB_Field
5
- {
6
- /**
7
- * Enqueue scripts and styles
8
- *
9
- * @return void
10
- */
11
- static function admin_enqueue_scripts()
12
- {
13
- // Make sure scripts for new media uploader in WordPress 3.5 is enqueued
14
- wp_enqueue_media();
15
- wp_enqueue_script( 'rwmb-file-input', TX_RWMB_JS_URL . 'file-input.js', array( 'jquery' ), TX_RWMB_VER, true );
16
- wp_localize_script( 'rwmb-file-input', 'rwmbFileInput', array(
17
- 'frameTitle' => __( 'Select File', 'meta-box' ),
18
- ) );
19
- }
20
-
21
- /**
22
- * Get field HTML
23
- *
24
- * @param mixed $meta
25
- * @param array $field
26
- *
27
- * @return string
28
- */
29
- static function html( $meta, $field )
30
- {
31
- return sprintf(
32
- '<input type="text" class="rwmb-file-input" name="%s" id="%s" value="%s" placeholder="%s" size="%s">
33
- <a href="#" class="rwmb-file-input-select button-primary">%s</a>
34
- <a href="#" class="rwmb-file-input-remove button %s">%s</a>',
35
- $field['field_name'],
36
- $field['id'],
37
- $meta,
38
- $field['placeholder'],
39
- $field['size'],
40
- __( 'Select', 'meta-box' ),
41
- $meta ? '' : 'hidden',
42
- __( 'Remove', 'meta-box' )
43
- );
44
- }
45
-
46
- /**
47
- * Normalize parameters for field
48
- *
49
- * @param array $field
50
- *
51
- * @return array
52
- */
53
- static function normalize_field( $field )
54
- {
55
- $field = wp_parse_args( $field, array(
56
- 'size' => 30,
57
- 'placeholder' => '',
58
- ) );
59
-
60
- return $field;
61
- }
62
- }
63
- }
1
+ <?php
2
+ /**
3
+ * The file input field which allows users to enter a file URL or select it from the Media Library.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * File input field class which uses an input for file URL.
10
+ */
11
+ class RWMB_File_Input_Field extends RWMB_Input_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_media();
17
+ wp_enqueue_style( 'rwmb-file-input', RWMB_CSS_URL . 'file-input.css' );
18
+ wp_enqueue_script( 'rwmb-file-input', RWMB_JS_URL . 'file-input.js', array( 'jquery' ), RWMB_VER, true );
19
+ self::localize_script('rwmb-file-input', 'rwmbFileInput', array(
20
+ 'frameTitle' => esc_html__( 'Select File', 'meta-box' ),
21
+ ) );
22
+ }
23
+
24
+ /**
25
+ * Get field HTML.
26
+ *
27
+ * @param mixed $meta Meta value.
28
+ * @param array $field Field parameters.
29
+ *
30
+ * @return string
31
+ */
32
+ public static function html( $meta, $field ) {
33
+ $attributes = self::get_attributes( $field, $meta );
34
+ return sprintf(
35
+ '<input %s>
36
+ <a href="#" class="rwmb-file-input-select button">%s</a>
37
+ <a href="#" class="rwmb-file-input-remove button %s">%s</a>',
38
+ self::render_attributes( $attributes ),
39
+ esc_html__( 'Select', 'meta-box' ),
40
+ $meta ? '' : 'hidden',
41
+ esc_html__( 'Remove', 'meta-box' )
42
+ );
43
+ }
44
+
45
+ /**
46
+ * Get the attributes for a field.
47
+ *
48
+ * @param array $field Field parameters.
49
+ * @param mixed $value Meta value.
50
+ * @return array
51
+ */
52
+ public static function get_attributes( $field, $value = null ) {
53
+ $attributes = parent::get_attributes( $field, $value );
54
+ $attributes['type'] = 'text';
55
+
56
+ return $attributes;
57
+ }
58
+ }
 
 
 
 
 
inc/meta-box/inc/fields/file-upload.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The file upload field which allows users to drag and drop files to upload.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The file upload field class.
10
+ */
11
+ class RWMB_File_Upload_Field extends RWMB_Media_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ parent::admin_enqueue_scripts();
17
+ wp_enqueue_style( 'rwmb-upload', RWMB_CSS_URL . 'upload.css', array( 'rwmb-media' ), RWMB_VER );
18
+ wp_enqueue_script( 'rwmb-file-upload', RWMB_JS_URL . 'file-upload.js', array( 'rwmb-media' ), RWMB_VER, true );
19
+ }
20
+
21
+ /**
22
+ * Normalize parameters for field.
23
+ *
24
+ * @param array $field Field parameters.
25
+ *
26
+ * @return array
27
+ */
28
+ public static function normalize( $field ) {
29
+ $field = parent::normalize( $field );
30
+ $field = wp_parse_args( $field, array(
31
+ 'max_file_size' => 0,
32
+ ) );
33
+
34
+ $field['js_options'] = wp_parse_args( $field['js_options'], array(
35
+ 'maxFileSize' => $field['max_file_size'],
36
+ ) );
37
+
38
+ return $field;
39
+ }
40
+
41
+ /**
42
+ * Template for media item.
43
+ */
44
+ public static function print_templates() {
45
+ parent::print_templates();
46
+ require_once RWMB_INC_DIR . 'templates/upload.php';
47
+ }
48
+ }
inc/meta-box/inc/fields/file.php CHANGED
@@ -1,308 +1,353 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_File_Field' ) )
6
- {
7
- class RWMB_File_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_style( 'rwmb-file', TX_RWMB_CSS_URL . 'file.css', array(), TX_RWMB_VER );
17
- wp_enqueue_script( 'rwmb-file', TX_RWMB_JS_URL . 'file.js', array( 'jquery' ), TX_RWMB_VER, true );
18
- wp_localize_script( 'rwmb-file', 'rwmbFile', array(
19
- 'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'meta-box' ),
20
- 'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'meta-box' ),
21
- ) );
22
- }
23
-
24
- /**
25
- * Add actions
26
- *
27
- * @return void
28
- */
29
- static function add_actions()
30
- {
31
- // Add data encoding type for file uploading
32
- add_action( 'post_edit_form_tag', array( __CLASS__, 'post_edit_form_tag' ) );
33
-
34
- // Delete file via Ajax
35
- add_action( 'wp_ajax_rwmb_delete_file', array( __CLASS__, 'wp_ajax_delete_file' ) );
36
-
37
- // allow reordering
38
- add_action( 'wp_ajax_rwmb_reorder_files', array( __CLASS__, 'wp_ajax_reorder_files' ) );
39
- }
40
-
41
- /**
42
- * Ajax callback for reordering images
43
- *
44
- * @return void
45
- */
46
- static function wp_ajax_reorder_files()
47
- {
48
- $field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
49
- $order = isset( $_POST['order'] ) ? $_POST['order'] : '';
50
- $post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
51
-
52
- check_ajax_referer( "rwmb-reorder-files_{$field_id}" );
53
-
54
- parse_str( $order, $items );
55
-
56
- delete_post_meta( $post_id, $field_id );
57
-
58
- foreach ( $items['item'] as $item )
59
- {
60
- add_post_meta( $post_id, $field_id, $item, false );
61
- }
62
-
63
- wp_send_json_success();
64
- }
65
-
66
- /**
67
- * Add data encoding type for file uploading
68
- *
69
- * @return void
70
- */
71
- static function post_edit_form_tag()
72
- {
73
- echo ' enctype="multipart/form-data"';
74
- }
75
-
76
- /**
77
- * Ajax callback for deleting files.
78
- * Modified from a function used by "Verve Meta Boxes" plugin
79
- *
80
- * @link http://goo.gl/LzYSq
81
- * @return void
82
- */
83
- static function wp_ajax_delete_file()
84
- {
85
- $post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
86
- $field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
87
- $attachment_id = isset( $_POST['attachment_id'] ) ? intval( $_POST['attachment_id'] ) : 0;
88
- $force_delete = isset( $_POST['force_delete'] ) ? intval( $_POST['force_delete'] ) : 0;
89
-
90
- check_ajax_referer( "rwmb-delete-file_{$field_id}" );
91
-
92
- delete_post_meta( $post_id, $field_id, $attachment_id );
93
- $ok = $force_delete ? wp_delete_attachment( $attachment_id ) : true;
94
-
95
- if ( $ok )
96
- wp_send_json_success();
97
- else
98
- wp_send_json_error( __( 'Error: Cannot delete file', 'meta-box' ) );
99
- }
100
-
101
- /**
102
- * Get field HTML
103
- *
104
- * @param mixed $meta
105
- * @param array $field
106
- *
107
- * @return string
108
- */
109
- static function html( $meta, $field )
110
- {
111
- $i18n_title = apply_filters( 'rwmb_file_upload_string', _x( 'Upload Files', 'file upload', 'meta-box' ), $field );
112
- $i18n_more = apply_filters( 'rwmb_file_add_string', _x( '+ Add new file', 'file upload', 'meta-box' ), $field );
113
-
114
- // Uploaded files
115
- $html = self::get_uploaded_files( $meta, $field );
116
- $new_file_classes = array( 'new-files' );
117
- if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
118
- $new_file_classes[] = 'hidden';
119
-
120
- // Show form upload
121
- $html .= sprintf(
122
- '<div class="%s">
123
- <h4>%s</h4>
124
- <div class="file-input"><input type="file" name="%s[]" /></div>
125
- <a class="rwmb-add-file" href="#"><strong>%s</strong></a>
126
- </div>',
127
- implode( ' ', $new_file_classes ),
128
- $i18n_title,
129
- $field['id'],
130
- $i18n_more
131
- );
132
-
133
- return $html;
134
- }
135
-
136
- static function get_uploaded_files( $files, $field )
137
- {
138
- $reorder_nonce = wp_create_nonce( "rwmb-reorder-files_{$field['id']}" );
139
- $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" );
140
-
141
- $classes = array( 'rwmb-file', 'rwmb-uploaded' );
142
- if ( count( $files ) <= 0 )
143
- $classes[] = 'hidden';
144
- $ol = '<ul class="%s" data-field_id="%s" data-delete_nonce="%s" data-reorder_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s" data-mime_type="%s">';
145
- $html = sprintf(
146
- $ol,
147
- implode( ' ', $classes ),
148
- $field['id'],
149
- $delete_nonce,
150
- $reorder_nonce,
151
- $field['force_delete'] ? 1 : 0,
152
- $field['max_file_uploads'],
153
- $field['mime_type']
154
- );
155
-
156
- foreach ( $files as $attachment_id )
157
- {
158
- $html .= self::file_html( $attachment_id );
159
- }
160
-
161
- $html .= '</ul>';
162
-
163
- return $html;
164
- }
165
-
166
- static function file_html( $attachment_id )
167
- {
168
- $i18n_delete = apply_filters( 'rwmb_file_delete_string', _x( 'Delete', 'file upload', 'meta-box' ) );
169
- $i18n_edit = apply_filters( 'rwmb_file_edit_string', _x( 'Edit', 'file upload', 'meta-box' ) );
170
- $li = '
171
- <li id="item_%s">
172
- <div class="rwmb-icon">%s</div>
173
- <div class="rwmb-info">
174
- <a href="%s" target="_blank">%s</a>
175
- <p>%s</p>
176
- <a title="%s" href="%s" target="_blank">%s</a> |
177
- <a title="%s" class="rwmb-delete-file" href="#" data-attachment_id="%s">%s</a>
178
- </div>
179
- </li>';
180
-
181
- $mime_type = get_post_mime_type( $attachment_id );
182
-
183
- return sprintf(
184
- $li,
185
- $attachment_id,
186
- wp_get_attachment_image( $attachment_id, array( 60, 60 ), true ),
187
- wp_get_attachment_url( $attachment_id ),
188
- get_the_title( $attachment_id ),
189
- $mime_type,
190
- $i18n_edit,
191
- get_edit_post_link( $attachment_id ),
192
- $i18n_edit,
193
- $i18n_delete,
194
- $attachment_id,
195
- $i18n_delete
196
- );
197
- }
198
-
199
- /**
200
- * Get meta values to save
201
- *
202
- * @param mixed $new
203
- * @param mixed $old
204
- * @param int $post_id
205
- * @param array $field
206
- *
207
- * @return array|mixed
208
- */
209
- static function value( $new, $old, $post_id, $field )
210
- {
211
- $name = $field['id'];
212
- if ( empty( $_FILES[$name] ) )
213
- return $new;
214
-
215
- $new = array();
216
- $files = self::fix_file_array( $_FILES[$name] );
217
-
218
- foreach ( $files as $file_item )
219
- {
220
- $file = wp_handle_upload( $file_item, array( 'test_form' => false ) );
221
-
222
- if ( ! isset( $file['file'] ) )
223
- continue;
224
-
225
- $file_name = $file['file'];
226
-
227
- $attachment = array(
228
- 'post_mime_type' => $file['type'],
229
- 'guid' => $file['url'],
230
- 'post_parent' => $post_id,
231
- 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file_name ) ),
232
- 'post_content' => '',
233
- );
234
- $id = wp_insert_attachment( $attachment, $file_name, $post_id );
235
-
236
- if ( ! is_wp_error( $id ) )
237
- {
238
- wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file_name ) );
239
-
240
- // Save file ID in meta field
241
- $new[] = $id;
242
- }
243
- }
244
-
245
- return array_unique( array_merge( $old, $new ) );
246
- }
247
-
248
- /**
249
- * Fixes the odd indexing of multiple file uploads from the format:
250
- * $_FILES['field']['key']['index']
251
- * To the more standard and appropriate:
252
- * $_FILES['field']['index']['key']
253
- *
254
- * @param array $files
255
- *
256
- * @return array
257
- */
258
- static function fix_file_array( $files )
259
- {
260
- $output = array();
261
- foreach ( $files as $key => $list )
262
- {
263
- foreach ( $list as $index => $value )
264
- {
265
- $output[$index][$key] = $value;
266
- }
267
- }
268
-
269
- return $output;
270
- }
271
-
272
- /**
273
- * Normalize parameters for field
274
- *
275
- * @param array $field
276
- *
277
- * @return array
278
- */
279
- static function normalize_field( $field )
280
- {
281
- $field = wp_parse_args( $field, array(
282
- 'std' => array(),
283
- 'force_delete' => false,
284
- 'max_file_uploads' => 0,
285
- 'mime_type' => '',
286
- ) );
287
- $field['multiple'] = true;
288
-
289
- return $field;
290
- }
291
-
292
- /**
293
- * Standard meta retrieval
294
- *
295
- * @param int $post_id
296
- * @param array $field
297
- * @param bool $saved
298
- *
299
- * @return mixed
300
- */
301
- static function meta( $post_id, $saved, $field )
302
- {
303
- $meta = parent::meta( $post_id, $saved, $field );
304
-
305
- return empty( $meta ) ? array() : (array) $meta;
306
- }
307
- }
308
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The file upload file which allows users to upload files via the default HTML <input type="file">.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * File field class which uses HTML <input type="file"> to upload file.
10
+ */
11
+ class RWMB_File_Field extends RWMB_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-file', RWMB_CSS_URL . 'file.css', array(), RWMB_VER );
17
+ wp_enqueue_script( 'rwmb-file', RWMB_JS_URL . 'file.js', array( 'jquery-ui-sortable' ), RWMB_VER, true );
18
+
19
+ self::localize_script( 'rwmb-file', 'rwmbFile', array(
20
+ // Translators: %d is the number of files in singular form.
21
+ 'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'meta-box' ),
22
+ // Translators: %d is the number of files in plural form.
23
+ 'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'meta-box' ),
24
+ ) );
25
+ }
26
+
27
+ /**
28
+ * Add custom actions.
29
+ */
30
+ public static function add_actions() {
31
+ add_action( 'post_edit_form_tag', array( __CLASS__, 'post_edit_form_tag' ) );
32
+ add_action( 'wp_ajax_rwmb_delete_file', array( __CLASS__, 'ajax_delete_file' ) );
33
+ }
34
+
35
+ /**
36
+ * Add data encoding type for file uploading
37
+ */
38
+ public static function post_edit_form_tag() {
39
+ echo ' enctype="multipart/form-data"';
40
+ }
41
+
42
+ /**
43
+ * Ajax callback for deleting files.
44
+ */
45
+ public static function ajax_delete_file() {
46
+ $field_id = (string) filter_input( INPUT_POST, 'field_id' );
47
+ $attachment_id = (int) filter_input( INPUT_POST, 'attachment_id', FILTER_SANITIZE_NUMBER_INT );
48
+
49
+ check_ajax_referer( "rwmb-delete-file_{$field_id}" );
50
+ if ( wp_delete_attachment( $attachment_id ) ) {
51
+ wp_send_json_success();
52
+ }
53
+ wp_send_json_error( __( 'Error: Cannot delete file', 'meta-box' ) );
54
+ }
55
+
56
+ /**
57
+ * Get field HTML.
58
+ *
59
+ * @param mixed $meta Meta value.
60
+ * @param array $field Field parameters.
61
+ *
62
+ * @return string
63
+ */
64
+ public static function html( $meta, $field ) {
65
+ $meta = array_filter( (array) $meta );
66
+ $i18n_more = apply_filters( 'rwmb_file_add_string', _x( '+ Add new file', 'file upload', 'meta-box' ), $field );
67
+ $html = self::get_uploaded_files( $meta, $field );
68
+
69
+ // Show form upload.
70
+ $html .= sprintf(
71
+ '<div class="rwmb-file-new">
72
+ <input type="file" name="%s[]" class="rwmb-file-input">
73
+ <a class="rwmb-file-add" href="#"><strong>%s</strong></a>
74
+ </div>',
75
+ $field['file_input_name'],
76
+ $i18n_more
77
+ );
78
+
79
+ return $html;
80
+ }
81
+
82
+ /**
83
+ * Get HTML for uploaded files.
84
+ *
85
+ * @param array $files List of uploaded files.
86
+ * @param array $field Field parameters.
87
+ * @return string
88
+ */
89
+ protected static function get_uploaded_files( $files, $field ) {
90
+ $reorder_nonce = wp_create_nonce( "rwmb-reorder-files_{$field['id']}" );
91
+ $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" );
92
+ $output = '';
93
+
94
+ foreach ( (array) $files as $k => $file ) {
95
+ // Ignore deleted files (if users accidentally deleted files or uses `force_delete` without saving post).
96
+ if ( get_attached_file( $file ) ) {
97
+ $output .= self::call( $field, 'file_html', $file, $k );
98
+ }
99
+ }
100
+ return sprintf(
101
+ '<ul class="rwmb-uploaded" data-field_id="%s" data-delete_nonce="%s" data-reorder_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s" data-mime_type="%s">%s</ul>',
102
+ $field['id'],
103
+ $delete_nonce,
104
+ $reorder_nonce,
105
+ $field['force_delete'] ? 1 : 0,
106
+ $field['max_file_uploads'],
107
+ $field['mime_type'],
108
+ $output
109
+ );
110
+ }
111
+
112
+ /**
113
+ * Get HTML for uploaded file.
114
+ *
115
+ * @param int $file Attachment (file) ID.
116
+ * @param int $index File index.
117
+ * @param array $field Field data.
118
+ * @return string
119
+ */
120
+ protected static function file_html( $file, $index, $field ) {
121
+ $i18n_delete = apply_filters( 'rwmb_file_delete_string', _x( 'Delete', 'file upload', 'meta-box' ) );
122
+ $i18n_edit = apply_filters( 'rwmb_file_edit_string', _x( 'Edit', 'file upload', 'meta-box' ) );
123
+ $attributes = self::get_attributes( $field, $file );
124
+ $path = get_attached_file( $file );
125
+ $icon = wp_get_attachment_image( $file, array( 60, 60 ), true );
126
+
127
+ return sprintf(
128
+ '<li class="rwmb-file">
129
+ <div class="rwmb-file-icon"><a href="%s" target="_blank">%s</a></div>
130
+ <div class="rwmb-file-info">
131
+ <a href="%s" target="_blank" class="rwmb-file-title">%s</a>
132
+ <p class="rwmb-file-name">%s</p>
133
+ <p class="rwmb-file-actions">
134
+ <a href="%s" class="rwmb-file-edit" target="_blank"><span class="dashicons dashicons-edit"></span>%s</a>
135
+ <a href="#" class="rwmb-file-delete" data-attachment_id="%s"><span class="dashicons dashicons-no-alt"></span>%s</a>
136
+ </p>
137
+ </div>
138
+ <input type="hidden" name="%s[%s]" value="%s">
139
+ </li>',
140
+ wp_get_attachment_url( $file ), $icon,
141
+ wp_get_attachment_url( $file ), get_the_title( $file ),
142
+ basename( $path ),
143
+ get_edit_post_link( $file ), $i18n_edit,
144
+ $file, $i18n_delete,
145
+ $attributes['name'], $index, $file
146
+ );
147
+ }
148
+
149
+ /**
150
+ * Get meta values to save.
151
+ *
152
+ * @param mixed $new The submitted meta value.
153
+ * @param mixed $old The existing meta value.
154
+ * @param int $post_id The post ID.
155
+ * @param array $field The field parameters.
156
+ *
157
+ * @return array|mixed
158
+ */
159
+ public static function value( $new, $old, $post_id, $field ) {
160
+ $input = $field['file_input_name'];
161
+
162
+ // @codingStandardsIgnoreLine
163
+ if ( empty( $_FILES[ $input ] ) ) {
164
+ return $new;
165
+ }
166
+
167
+ $new = array_filter( (array) $new );
168
+
169
+ // Non-cloneable field.
170
+ if ( ! $field['clone'] ) {
171
+ $count = self::transform( $input );
172
+ for ( $i = 0; $i <= $count; $i ++ ) {
173
+ $attachment = media_handle_upload( "{$input}_{$i}", $post_id );
174
+ if ( ! is_wp_error( $attachment ) ) {
175
+ $new[] = $attachment;
176
+ }
177
+ }
178
+ return $new;
179
+ }
180
+
181
+ // Cloneable field.
182
+ $counts = self::transform_cloneable( $input );
183
+ foreach ( $counts as $clone_index => $count ) {
184
+ if ( empty( $new[ $clone_index ] ) ) {
185
+ $new[ $clone_index ] = array();
186
+ }
187
+ for ( $i = 0; $i <= $count; $i ++ ) {
188
+ $attachment = media_handle_upload( "{$input}_{$clone_index}_{$i}", $post_id );
189
+ if ( ! is_wp_error( $attachment ) ) {
190
+ $new[ $clone_index ][] = $attachment;
191
+ }
192
+ }
193
+ }
194
+
195
+ return $new;
196
+ }
197
+
198
+ /**
199
+ * Transform $_FILES from $_FILES['field']['key']['index'] to $_FILES['field_index']['key'].
200
+ *
201
+ * @param string $input_name The field input name.
202
+ *
203
+ * @return int The number of uploaded files.
204
+ */
205
+ protected static function transform( $input_name ) {
206
+ // @codingStandardsIgnoreStart
207
+ foreach ( $_FILES[ $input_name ] as $key => $list ) {
208
+ foreach ( $list as $index => $value ) {
209
+ $file_key = "{$input_name}_{$index}";
210
+ if ( ! isset( $_FILES[ $file_key ] ) ) {
211
+ $_FILES[ $file_key ] = array();
212
+ }
213
+ $_FILES[ $file_key ][ $key ] = $value;
214
+ }
215
+ }
216
+
217
+ return count( $_FILES[ $input_name ]['name'] );
218
+ // @codingStandardsIgnoreEnd
219
+ }
220
+
221
+ /**
222
+ * Transform $_FILES from $_FILES['field']['key']['cloneIndex']['index'] to $_FILES['field_cloneIndex_index']['key'].
223
+ *
224
+ * @param string $input_name The field input name.
225
+ *
226
+ * @return array
227
+ */
228
+ protected static function transform_cloneable( $input_name ) {
229
+ // @codingStandardsIgnoreStart
230
+ foreach ( $_FILES[ $input_name ] as $key => $list ) {
231
+ foreach ( $list as $clone_index => $clone_values ) {
232
+ foreach ( $clone_values as $index => $value ) {
233
+ $file_key = "{$input_name}_{$clone_index}_{$index}";
234
+
235
+ if ( ! isset( $_FILES[ $file_key ] ) ) {
236
+ $_FILES[ $file_key ] = array();
237
+ }
238
+ $_FILES[ $file_key ][ $key ] = $value;
239
+ }
240
+ }
241
+ }
242
+
243
+ $counts = array();
244
+ foreach ( $_FILES[ $input_name ]['name'] as $clone_index => $clone_values ) {
245
+ $counts[ $clone_index ] = count( $clone_values );
246
+ }
247
+ return $counts;
248
+ // @codingStandardsIgnoreEnd
249
+ }
250
+
251
+ /**
252
+ * Normalize parameters for field.
253
+ *
254
+ * @param array $field Field parameters.
255
+ * @return array
256
+ */
257
+ public static function normalize( $field ) {
258
+ $field = parent::normalize( $field );
259
+ $field = wp_parse_args( $field, array(
260
+ 'std' => array(),
261
+ 'force_delete' => false,
262
+ 'max_file_uploads' => 0,
263
+ 'mime_type' => '',
264
+ ) );
265
+ $field['multiple'] = true;
266
+
267
+ $field['file_input_name'] = '_file_' . $field['id'];
268
+
269
+ return $field;
270
+ }
271
+
272
+ /**
273
+ * Get the field value. Return meaningful info of the files.
274
+ *
275
+ * @param array $field Field parameters.
276
+ * @param array $args Not used for this field.
277
+ * @param int|null $post_id Post ID. null for current post. Optional.
278
+ *
279
+ * @return mixed Full info of uploaded files
280
+ */
281
+ public static function get_value( $field, $args = array(), $post_id = null ) {
282
+ $value = parent::get_value( $field, $args, $post_id );
283
+ if ( ! $field['clone'] ) {
284
+ $value = self::call( 'files_info', $field, $value, $args );
285
+ } else {
286
+ $return = array();
287
+ foreach ( $value as $subvalue ) {
288
+ $return[] = self::call( 'files_info', $field, $subvalue, $args );
289
+ }
290
+ $value = $return;
291
+ }
292
+ if ( isset( $args['limit'] ) ) {
293
+ $value = array_slice( $value, 0, intval( $args['limit'] ) );
294
+ }
295
+ return $value;
296
+ }
297
+
298
+ /**
299
+ * Get uploaded files information.
300
+ *
301
+ * @param array $field Field parameters.
302
+ * @param array $files Files IDs.
303
+ * @param array $args Additional arguments (for image size).
304
+ * @return array
305
+ */
306
+ public static function files_info( $field, $files, $args ) {
307
+ $return = array();
308
+ foreach ( (array) $files as $file ) {
309
+ $info = self::call( $field, 'file_info', $file, $args );
310
+ if ( $info ) {
311
+ $return[ $file ] = $info;
312
+ }
313
+ }
314
+ return $return;
315
+ }
316
+
317
+ /**
318
+ * Get uploaded file information.
319
+ *
320
+ * @param int $file Attachment file ID (post ID). Required.
321
+ * @param array $args Array of arguments (for size).
322
+ *
323
+ * @return array|bool False if file not found. Array of (id, name, path, url) on success.
324
+ */
325
+ public static function file_info( $file, $args = array() ) {
326
+ $path = get_attached_file( $file );
327
+ if ( ! $path ) {
328
+ return false;
329
+ }
330
+
331
+ return wp_parse_args( array(
332
+ 'ID' => $file,
333
+ 'name' => basename( $path ),
334
+ 'path' => $path,
335
+ 'url' => wp_get_attachment_url( $file ),
336
+ 'title' => get_the_title( $file ),
337
+ ), wp_get_attachment_metadata( $file ) );
338
+ }
339
+
340
+ /**
341
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
342
+ *
343
+ * @param array $field Field parameters.
344
+ * @param array $value The value.
345
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
346
+ * @param int|null $post_id Post ID. null for current post. Optional.
347
+ *
348
+ * @return string
349
+ */
350
+ public static function format_single_value( $field, $value, $args, $post_id ) {
351
+ return sprintf( '<a href="%s" target="_blank">%s</a>', esc_url( $value['url'] ), esc_html( $value['title'] ) );
352
+ }
353
+ }
inc/meta-box/inc/fields/heading.php CHANGED
@@ -1,48 +1,43 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Heading_Field' ) )
6
- {
7
- class RWMB_Heading_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_style( 'rwmb-heading', TX_RWMB_CSS_URL . 'heading.css', array(), TX_RWMB_VER );
17
- }
18
-
19
- /**
20
- * Show begin HTML markup for fields
21
- *
22
- * @param mixed $meta
23
- * @param array $field
24
- *
25
- * @return string
26
- */
27
- static function begin_html( $meta, $field )
28
- {
29
- return sprintf(
30
- '<h4>%s</h4>',
31
- $field['name']
32
- );
33
- }
34
-
35
- /**
36
- * Show end HTML markup for fields
37
- *
38
- * @param mixed $meta
39
- * @param array $field
40
- *
41
- * @return string
42
- */
43
- static function end_html( $meta, $field )
44
- {
45
- return '';
46
- }
47
- }
48
- }
1
+ <?php
2
+ /**
3
+ * The heading field which displays a simple heading text.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Heading field class.
10
+ */
11
+ class RWMB_Heading_Field extends RWMB_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-heading', RWMB_CSS_URL . 'heading.css', array(), RWMB_VER );
17
+ }
18
+
19
+ /**
20
+ * Show begin HTML markup for fields.
21
+ *
22
+ * @param mixed $meta Meta value.
23
+ * @param array $field Field parameters.
24
+ *
25
+ * @return string
26
+ */
27
+ public static function begin_html( $meta, $field ) {
28
+ $attributes = empty( $field['id'] ) ? '' : " id='{$field['id']}'";
29
+ return sprintf( '<h4%s>%s</h4>', $attributes, $field['name'] );
30
+ }
31
+
32
+ /**
33
+ * Show end HTML markup for fields.
34
+ *
35
+ * @param mixed $meta Meta value.
36
+ * @param array $field Field parameters.
37
+ *
38
+ * @return string
39
+ */
40
+ public static function end_html( $meta, $field ) {
41
+ return self::input_description( $field );
42
+ }
43
+ }
 
 
 
 
 
inc/meta-box/inc/fields/hidden.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Hidden_Field' ) )
6
- {
7
- class RWMB_Hidden_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- return sprintf(
20
- '<input type="hidden" class="rwmb-hidden" name="%s" id="%s" value="%s" />',
21
- $field['field_name'],
22
- $field['id'],
23
- $meta
24
- );
25
- }
26
- }
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/image-advanced.php CHANGED
@@ -1,130 +1,87 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- require_once TX_RWMB_FIELDS_DIR . 'image.php';
6
- if ( ! class_exists( 'RWMB_Image_Advanced_Field' ) )
7
- {
8
- class RWMB_Image_Advanced_Field extends RWMB_Image_Field
9
- {
10
- /**
11
- * Enqueue scripts and styles
12
- *
13
- * @return void
14
- */
15
- static function admin_enqueue_scripts()
16
- {
17
- parent::admin_enqueue_scripts();
18
-
19
- // Make sure scripts for new media uploader in WordPress 3.5 is enqueued
20
- wp_enqueue_media();
21
- wp_enqueue_script( 'rwmb-image-advanced', TX_RWMB_JS_URL . 'image-advanced.js', array( 'jquery', 'underscore' ), TX_RWMB_VER, true );
22
- wp_localize_script( 'rwmb-image-advanced', 'rwmbImageAdvanced', array(
23
- 'frameTitle' => __( 'Select Images', 'meta-box' ),
24
- ) );
25
- }
26
-
27
- /**
28
- * Add actions
29
- *
30
- * @return void
31
- */
32
- static function add_actions()
33
- {
34
- // Do same actions as file field
35
- parent::add_actions();
36
-
37
- // Attach images via Ajax
38
- add_action( 'wp_ajax_rwmb_attach_media', array( __CLASS__, 'wp_ajax_attach_media' ) );
39
- add_action( 'print_media_templates', array( __CLASS__, 'print_templates' ) );
40
- }
41
-
42
- /**
43
- * Ajax callback for attaching media to field
44
- *
45
- * @return void
46
- */
47
- static function wp_ajax_attach_media()
48
- {
49
- $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
50
- $field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
51
- $attachment_ids = isset( $_POST['attachment_ids'] ) ? (array) $_POST['attachment_ids'] : array();
52
-
53
- check_ajax_referer( "rwmb-attach-media_{$field_id}" );
54
- foreach ( $attachment_ids as $attachment_id )
55
- {
56
- add_post_meta( $post_id, $field_id, $attachment_id, false );
57
- }
58
- wp_send_json_success();
59
- }
60
-
61
- /**
62
- * Get field HTML
63
- *
64
- * @param mixed $meta
65
- * @param array $field
66
- *
67
- * @return string
68
- */
69
- static function html( $meta, $field )
70
- {
71
- $i18n_title = apply_filters( 'rwmb_image_advanced_select_string', _x( 'Select or Upload Images', 'image upload', 'meta-box' ), $field );
72
- $attach_nonce = wp_create_nonce( "rwmb-attach-media_{$field['id']}" );
73
-
74
- // Uploaded images
75
- $html = self::get_uploaded_images( $meta, $field );
76
-
77
- // Show form upload
78
- $classes = array( 'button', 'rwmb-image-advanced-upload', 'hide-if-no-js', 'new-files' );
79
- if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
80
- $classes[] = 'hidden';
81
-
82
- $classes = implode( ' ', $classes );
83
- $html .= "<a href='#' class='{$classes}' data-attach_media_nonce={$attach_nonce}>{$i18n_title}</a>";
84
-
85
- return $html;
86
- }
87
-
88
- /**
89
- * Get field value
90
- * It's the combination of new (uploaded) images and saved images
91
- *
92
- * @param array $new
93
- * @param array $old
94
- * @param int $post_id
95
- * @param array $field
96
- *
97
- * @return array|mixed
98
- */
99
- static function value( $new, $old, $post_id, $field )
100
- {
101
- $new = (array) $new;
102
-
103
- return array_unique( array_merge( $old, $new ) );
104
- }
105
-
106
- static function print_templates()
107
- {
108
- $i18n_delete = apply_filters( 'rwmb_image_delete_string', _x( 'Delete', 'image upload', 'meta-box' ) );
109
- $i18n_edit = apply_filters( 'rwmb_image_edit_string', _x( 'Edit', 'image upload', 'meta-box' ) );
110
- ?>
111
- <script id="tmpl-rwmb-image-advanced" type="text/html">
112
- <# _.each( attachments, function( attachment ) { #>
113
- <li id="item_{{{ attachment.id }}}">
114
- <# if ( attachment.sizes.hasOwnProperty( 'thumbnail' ) ) { #>
115
- <img src="{{{ attachment.sizes.thumbnail.url }}}">
116
- <# } else { #>
117
- <img src="{{{ attachment.sizes.full.url }}}">
118
- <# } #>
119
- <div class="rwmb-image-bar">
120
- <a title="<?php echo esc_attr( $i18n_edit ); ?>" class="rwmb-edit-file" href="{{{ attachment.editLink }}}" target="_blank"><?php echo esc_html( $i18n_edit ); ?></a> |
121
- <a title="<?php echo esc_attr( $i18n_delete ); ?>" class="rwmb-delete-file" href="#" data-attachment_id="{{{ attachment.id }}}">&times;</a>
122
- </div>
123
- </li>
124
- <# } ); #>
125
- </script>
126
- <?php
127
- }
128
-
129
- }
130
- }
1
+ <?php
2
+ /**
3
+ * The advanced image upload field which uses WordPress media popup to upload and select images.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Image advanced field class.
10
+ */
11
+ class RWMB_Image_Advanced_Field extends RWMB_Media_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ parent::admin_enqueue_scripts();
17
+ RWMB_Image_Field::admin_enqueue_scripts();
18
+ wp_enqueue_script( 'rwmb-image-advanced', RWMB_JS_URL . 'image-advanced.js', array( 'rwmb-media' ), RWMB_VER, true );
19
+ }
20
+
21
+ /**
22
+ * Normalize parameters for field.
23
+ *
24
+ * @param array $field Field parameters.
25
+ *
26
+ * @return array
27
+ */
28
+ public static function normalize( $field ) {
29
+ $field['mime_type'] = 'image';
30
+ $field = wp_parse_args( $field, array(
31
+ 'image_size' => 'thumbnail',
32
+ ) );
33
+
34
+ $field = parent::normalize( $field );
35
+
36
+ $field['js_options'] = wp_parse_args( $field['js_options'], array(
37
+ 'imageSize' => $field['image_size'],
38
+ ) );
39
+
40
+ return $field;
41
+ }
42
+
43
+ /**
44
+ * Get the field value.
45
+ *
46
+ * @param array $field Field parameters.
47
+ * @param array $args Additional arguments.
48
+ * @param null $post_id Post ID.
49
+ * @return mixed
50
+ */
51
+ public static function get_value( $field, $args = array(), $post_id = null ) {
52
+ return RWMB_Image_Field::get_value( $field, $args, $post_id );
53
+ }
54
+
55
+ /**
56
+ * Get uploaded file information.
57
+ *
58
+ * @param int $file Attachment image ID (post ID). Required.
59
+ * @param array $args Array of arguments (for size).
60
+ * @return array|bool False if file not found. Array of image info on success.
61
+ */
62
+ public static function file_info( $file, $args = array() ) {
63
+ return RWMB_Image_Field::file_info( $file, $args );
64
+ }
65
+
66
+ /**
67
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
68
+ *
69
+ * @param array $field Field parameters.
70
+ * @param string $value The value.
71
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
72
+ * @param int|null $post_id Post ID. null for current post. Optional.
73
+ *
74
+ * @return string
75
+ */
76
+ public static function format_single_value( $field, $value, $args, $post_id ) {
77
+ return RWMB_Image_Field::format_single_value( $field, $value, $args, $post_id );
78
+ }
79
+
80
+ /**
81
+ * Template for media item.
82
+ */
83
+ public static function print_templates() {
84
+ parent::print_templates();
85
+ require_once RWMB_INC_DIR . 'templates/image-advanced.php';
86
+ }
87
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/image-select.php CHANGED
@@ -1,63 +1,72 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Image_Select_Field' ) )
6
- {
7
- class RWMB_Image_Select_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_style( 'rwmb-image-select', TX_RWMB_CSS_URL . 'image-select.css', array(), TX_RWMB_VER );
17
- wp_enqueue_script( 'rwmb-image-select', TX_RWMB_JS_URL . 'image-select.js', array( 'jquery' ), TX_RWMB_VER, true );
18
- }
19
-
20
- /**
21
- * Get field HTML
22
- *
23
- * @param mixed $meta
24
- * @param array $field
25
- *
26
- * @return string
27
- */
28
- static function html( $meta, $field )
29
- {
30
- $html = array();
31
- $tpl = '<label class="rwmb-image-select"><img src="%s"><input type="%s" class="hidden" name="%s" value="%s"%s></label>';
32
-
33
- $meta = (array) $meta;
34
- foreach ( $field['options'] as $value => $image )
35
- {
36
- $html[] = sprintf(
37
- $tpl,
38
- $image,
39
- $field['multiple'] ? 'checkbox' : 'radio',
40
- $field['field_name'],
41
- $value,
42
- checked( in_array( $value, $meta ), true, false )
43
- );
44
- }
45
-
46
- return implode( ' ', $html );
47
- }
48
-
49
- /**
50
- * Normalize parameters for field
51
- *
52
- * @param array $field
53
- *
54
- * @return array
55
- */
56
- static function normalize_field( $field )
57
- {
58
- $field['field_name'] .= $field['multiple'] ? '[]' : '';
59
-
60
- return $field;
61
- }
62
- }
63
- }
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The image select field which behaves similar to the radio field but uses images as options.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The image select field class.
10
+ */
11
+ class RWMB_Image_Select_Field extends RWMB_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-image-select', RWMB_CSS_URL . 'image-select.css', array(), RWMB_VER );
17
+ wp_enqueue_script( 'rwmb-image-select', RWMB_JS_URL . 'image-select.js', array( 'jquery' ), RWMB_VER, true );
18
+ }
19
+
20
+ /**
21
+ * Get field HTML.
22
+ *
23
+ * @param mixed $meta Meta value.
24
+ * @param array $field Field parameters.
25
+ * @return string
26
+ */
27
+ public static function html( $meta, $field ) {
28
+ $html = array();
29
+ $tpl = '<label class="rwmb-image-select"><img src="%s"><input type="%s" class="rwmb-image_select" name="%s" value="%s"%s></label>';
30
+
31
+ $meta = (array) $meta;
32
+ foreach ( $field['options'] as $value => $image ) {
33
+ $html[] = sprintf(
34
+ $tpl,
35
+ $image,
36
+ $field['multiple'] ? 'checkbox' : 'radio',
37
+ $field['field_name'],
38
+ $value,
39
+ checked( in_array( $value, $meta ), true, false )
40
+ );
41
+ }
42
+
43
+ return implode( ' ', $html );
44
+ }
45
+
46
+ /**
47
+ * Normalize parameters for field.
48
+ *
49
+ * @param array $field Field parameters.
50
+ * @return array
51
+ */
52
+ public static function normalize( $field ) {
53
+ $field = parent::normalize( $field );
54
+ $field['field_name'] .= $field['multiple'] ? '[]' : '';
55
+
56
+ return $field;
57
+ }
58
+
59
+ /**
60
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
61
+ *
62
+ * @param array $field Field parameters.
63
+ * @param string $value The value.
64
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
65
+ * @param int|null $post_id Post ID. null for current post. Optional.
66
+ *
67
+ * @return string
68
+ */
69
+ public static function format_single_value( $field, $value, $args, $post_id ) {
70
+ return sprintf( '<img src="%s">', esc_url( $field['options'][ $value ] ) );
71
+ }
72
+ }
inc/meta-box/inc/fields/image-upload.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The image upload field which allows users to drag and drop images.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * File advanced field class which users WordPress media popup to upload and select files.
10
+ */
11
+ class RWMB_Image_Upload_Field extends RWMB_Image_Advanced_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ parent::admin_enqueue_scripts();
17
+ RWMB_File_Upload_Field::admin_enqueue_scripts();
18
+ wp_enqueue_script( 'rwmb-image-upload', RWMB_JS_URL . 'image-upload.js', array( 'rwmb-file-upload', 'rwmb-image-advanced' ), RWMB_VER, true );
19
+ }
20
+
21
+ /**
22
+ * Normalize parameters for field.
23
+ *
24
+ * @param array $field Field parameters.
25
+ *
26
+ * @return array
27
+ */
28
+ public static function normalize( $field ) {
29
+ $field = parent::normalize( $field );
30
+ return RWMB_File_Upload_Field::normalize( $field );
31
+ }
32
+
33
+ /**
34
+ * Template for media item.
35
+ */
36
+ public static function print_templates() {
37
+ parent::print_templates();
38
+ RWMB_File_Upload_Field::print_templates();
39
+ }
40
+ }
inc/meta-box/inc/fields/image.php CHANGED
@@ -1,162 +1,136 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Image_Field' ) )
6
- {
7
- class RWMB_Image_Field extends RWMB_File_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- // Enqueue same scripts and styles as for file field
17
- parent::admin_enqueue_scripts();
18
-
19
- wp_enqueue_style( 'rwmb-image', TX_RWMB_CSS_URL . 'image.css', array(), TX_RWMB_VER );
20
- wp_enqueue_script( 'rwmb-image', TX_RWMB_JS_URL . 'image.js', array( 'jquery-ui-sortable' ), TX_RWMB_VER, true );
21
- }
22
-
23
- /**
24
- * Add actions
25
- *
26
- * @return void
27
- */
28
- static function add_actions()
29
- {
30
- // Do same actions as file field
31
- parent::add_actions();
32
-
33
- // Reorder images via Ajax
34
- add_action( 'wp_ajax_rwmb_reorder_images', array( __CLASS__, 'wp_ajax_reorder_images' ) );
35
- }
36
-
37
- /**
38
- * Ajax callback for reordering images
39
- *
40
- * @return void
41
- */
42
- static function wp_ajax_reorder_images()
43
- {
44
- $field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
45
- $order = isset( $_POST['order'] ) ? $_POST['order'] : '';
46
- $post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
47
-
48
- check_ajax_referer( "rwmb-reorder-images_{$field_id}" );
49
-
50
- parse_str( $order, $items );
51
-
52
- delete_post_meta( $post_id, $field_id );
53
- foreach ( $items['item'] as $item )
54
- {
55
- add_post_meta( $post_id, $field_id, $item, false );
56
- }
57
- wp_send_json_success();
58
- }
59
-
60
- /**
61
- * Get field HTML
62
- *
63
- * @param mixed $meta
64
- * @param array $field
65
- *
66
- * @return string
67
- */
68
- static function html( $meta, $field )
69
- {
70
- $i18n_title = apply_filters( 'rwmb_image_upload_string', _x( 'Upload Images', 'image upload', 'meta-box' ), $field );
71
- $i18n_more = apply_filters( 'rwmb_image_add_string', _x( '+ Add new image', 'image upload', 'meta-box' ), $field );
72
-
73
- // Uploaded images
74
- $html = self::get_uploaded_images( $meta, $field );
75
-
76
- // Show form upload
77
- $html .= sprintf(
78
- '<h4>%s</h4>
79
- <div class="new-files">
80
- <div class="file-input"><input type="file" name="%s[]" /></div>
81
- <a class="rwmb-add-file" href="#"><strong>%s</strong></a>
82
- </div>',
83
- $i18n_title,
84
- $field['id'],
85
- $i18n_more
86
- );
87
-
88
- return $html;
89
- }
90
-
91
- /**
92
- * Get HTML markup for uploaded images
93
- *
94
- * @param array $images
95
- * @param array $field
96
- *
97
- * @return string
98
- */
99
- static function get_uploaded_images( $images, $field )
100
- {
101
- $reorder_nonce = wp_create_nonce( "rwmb-reorder-images_{$field['id']}" );
102
- $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" );
103
- $classes = array( 'rwmb-images', 'rwmb-uploaded' );
104
- if ( count( $images ) <= 0 )
105
- $classes[] = 'hidden';
106
- $ul = '<ul class="%s" data-field_id="%s" data-delete_nonce="%s" data-reorder_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s">';
107
- $html = sprintf(
108
- $ul,
109
- implode( ' ', $classes ),
110
- $field['id'],
111
- $delete_nonce,
112
- $reorder_nonce,
113
- $field['force_delete'] ? 1 : 0,
114
- $field['max_file_uploads']
115
- );
116
-
117
- foreach ( $images as $image )
118
- {
119
- $html .= self::img_html( $image );
120
- }
121
-
122
- $html .= '</ul>';
123
-
124
- return $html;
125
- }
126
-
127
- /**
128
- * Get HTML markup for ONE uploaded image
129
- *
130
- * @param int $image Image ID
131
- *
132
- * @return string
133
- */
134
- static function img_html( $image )
135
- {
136
- $i18n_delete = apply_filters( 'rwmb_image_delete_string', _x( 'Delete', 'image upload', 'meta-box' ) );
137
- $i18n_edit = apply_filters( 'rwmb_image_edit_string', _x( 'Edit', 'image upload', 'meta-box' ) );
138
- $li = '
139
- <li id="item_%s">
140
- <img src="%s" />
141
- <div class="rwmb-image-bar">
142
- <a title="%s" class="rwmb-edit-file" href="%s" target="_blank">%s</a> |
143
- <a title="%s" class="rwmb-delete-file" href="#" data-attachment_id="%s">&times;</a>
144
- </div>
145
- </li>
146
- ';
147
-
148
- $src = wp_get_attachment_image_src( $image, 'thumbnail' );
149
- $src = $src[0];
150
- $link = get_edit_post_link( $image );
151
-
152
- return sprintf(
153
- $li,
154
- $image,
155
- $src,
156
- $i18n_edit, $link, $i18n_edit,
157
- $i18n_delete, $image
158
- );
159
- }
160
-
161
- }
162
- }
1
+ <?php
2
+ /**
3
+ * The image field which uploads images via HTML <input type="file">.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Image field class which uses <input type="file"> to upload.
10
+ */
11
+ class RWMB_Image_Field extends RWMB_File_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ parent::admin_enqueue_scripts();
17
+ wp_enqueue_media();
18
+ wp_enqueue_style( 'rwmb-image', RWMB_CSS_URL . 'image.css', array(), RWMB_VER );
19
+ }
20
+
21
+ /**
22
+ * Get HTML for uploaded file.
23
+ *
24
+ * @param int $file Attachment (file) ID.
25
+ * @param int $index File index.
26
+ * @param array $field Field data.
27
+ *
28
+ * @return string
29
+ */
30
+ protected static function file_html( $file, $index, $field ) {
31
+ $attributes = self::get_attributes( $field, $file );
32
+
33
+ return sprintf(
34
+ '<li class="rwmb-image-item attachment %s">
35
+ <input type="hidden" name="%s[%s]" value="%s">
36
+ <div class="attachment-preview">
37
+ <div class="thumbnail">
38
+ <div class="centered">
39
+ %s
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <div class="rwmb-image-overlay"></div>
44
+ <div class="rwmb-image-actions">
45
+ <a href="%s" class="rwmb-image-edit" target="_blank"><span class="dashicons dashicons-edit"></span></a>
46
+ <a href="#" class="rwmb-image-delete rwmb-file-delete" data-attachment_id="%s"><span class="dashicons dashicons-no-alt"></span></a>
47
+ </div>
48
+ </li>',
49
+ esc_attr( $field['image_size'] ),
50
+ $attributes['name'], $index, $file,
51
+ wp_get_attachment_image( $file, $field['image_size'] ),
52
+ get_edit_post_link( $file ),
53
+ $file
54
+ );
55
+ }
56
+
57
+
58
+ /**
59
+ * Normalize field settings.
60
+ *
61
+ * @param array $field Field settings.
62
+ *
63
+ * @return array
64
+ */
65
+ public static function normalize( $field ) {
66
+ $field = parent::normalize( $field );
67
+ $field = wp_parse_args( $field, array(
68
+ 'image_size' => 'thumbnail',
69
+ ) );
70
+
71
+ return $field;
72
+ }
73
+
74
+ /**
75
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
76
+ *
77
+ * @param array $field Field parameters.
78
+ * @param array $value The value.
79
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
80
+ * @param int|null $post_id Post ID. null for current post. Optional.
81
+ *
82
+ * @return string
83
+ */
84
+ public static function format_single_value( $field, $value, $args, $post_id ) {
85
+ $output = sprintf( '<img src="%s" alt="%s">', esc_url( $value['url'] ), esc_attr( $value['alt'] ) );
86
+
87
+ // Link thumbnail to full size image?
88
+ if ( ! empty( $args['link'] ) ) {
89
+ $output = sprintf( '<a href="%s" title="%s">%s</a>', esc_url( $value['full_url'] ), esc_attr( $value['title'] ), $output );
90
+ }
91
+ return $output;
92
+ }
93
+
94
+ /**
95
+ * Get uploaded file information.
96
+ *
97
+ * @param int $file Attachment image ID (post ID). Required.
98
+ * @param array $args Array of arguments (for size).
99
+ *
100
+ * @return array|bool False if file not found. Array of image info on success.
101
+ */
102
+ public static function file_info( $file, $args = array() ) {
103
+ $path = get_attached_file( $file );
104
+ if ( ! $path ) {
105
+ return false;
106
+ }
107
+
108
+ $args = wp_parse_args( $args, array(
109
+ 'size' => 'thumbnail',
110
+ ) );
111
+ $image = wp_get_attachment_image_src( $file, $args['size'] );
112
+ $attachment = get_post( $file );
113
+ $info = array(
114
+ 'ID' => $file,
115
+ 'name' => basename( $path ),
116
+ 'path' => $path,
117
+ 'url' => $image[0],
118
+ 'full_url' => wp_get_attachment_url( $file ),
119
+ 'title' => $attachment->post_title,
120
+ 'caption' => $attachment->post_excerpt,
121
+ 'description' => $attachment->post_content,
122
+ 'alt' => get_post_meta( $file, '_wp_attachment_image_alt', true ),
123
+ );
124
+ if ( function_exists( 'wp_get_attachment_image_srcset' ) ) {
125
+ $info['srcset'] = wp_get_attachment_image_srcset( $file, $args['size'] );
126
+ }
127
+
128
+ $info = wp_parse_args( $info, wp_get_attachment_metadata( $file ) );
129
+
130
+ // Do not overwrite width and height by returned value of image meta.
131
+ $info['width'] = $image[1];
132
+ $info['height'] = $image[2];
133
+
134
+ return $info;
135
+ }
136
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/input-list.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The input list field which displays choices in a list of inputs.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Input list field class.
10
+ */
11
+ class RWMB_Input_List_Field extends RWMB_Choice_Field {
12
+ /**
13
+ * Enqueue scripts and styles
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-input-list', RWMB_CSS_URL . 'input-list.css', array(), RWMB_VER );
17
+ wp_enqueue_script( 'rwmb-input-list', RWMB_JS_URL . 'input-list.js', array(), RWMB_VER, true );
18
+ }
19
+
20
+ /**
21
+ * Walk options.
22
+ *
23
+ * @param array $field Field parameters.
24
+ * @param mixed $options Select options.
25
+ * @param mixed $db_fields Database fields to use in the output.
26
+ * @param mixed $meta Meta value.
27
+ *
28
+ * @return string
29
+ */
30
+ public static function walk( $field, $options, $db_fields, $meta ) {
31
+ $walker = new RWMB_Walker_Input_List( $db_fields, $field, $meta );
32
+ $output = self::get_select_all_html( $field );
33
+ $output .= sprintf( '<ul class="rwmb-input-list %s %s">',
34
+ $field['collapse'] ? 'collapse' : '',
35
+ $field['inline'] ? 'inline' : ''
36
+ );
37
+ $output .= $walker->walk( $options, $field['flatten'] ? - 1 : 0 );
38
+ $output .= '</ul>';
39
+
40
+ return $output;
41
+ }
42
+
43
+ /**
44
+ * Normalize parameters for field.
45
+ *
46
+ * @param array $field Field parameters.
47
+ * @return array
48
+ */
49
+ public static function normalize( $field ) {
50
+ $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
51
+ $field = RWMB_Input_Field::normalize( $field );
52
+ $field = parent::normalize( $field );
53
+ $field = wp_parse_args( $field, array(
54
+ 'collapse' => true,
55
+ 'inline' => null,
56
+ 'select_all_none' => false,
57
+ ) );
58
+
59
+ $field['flatten'] = $field['multiple'] ? $field['flatten'] : true;
60
+ $field['inline'] = ! $field['multiple'] && ! isset( $field['inline'] ) ? true : $field['inline'];
61
+
62
+ return $field;
63
+ }
64
+
65
+ /**
66
+ * Get the attributes for a field.
67
+ *
68
+ * @param array $field Field parameters.
69
+ * @param mixed $value Meta value.
70
+ *
71
+ * @return array
72
+ */
73
+ public static function get_attributes( $field, $value = null ) {
74
+ $attributes = RWMB_Input_Field::get_attributes( $field, $value );
75
+ $attributes['id'] = false;
76
+ $attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio';
77
+ $attributes['value'] = $value;
78
+
79
+ return $attributes;
80
+ }
81
+
82
+ /**
83
+ * Get html for select all|none for multiple checkbox.
84
+ *
85
+ * @param array $field Field parameters.
86
+ * @return string
87
+ */
88
+ public static function get_select_all_html( $field ) {
89
+ if ( $field['multiple'] && $field['select_all_none'] ) {
90
+ return sprintf( '<p><button class="rwmb-input-list-select-all-none button" data-name="%s">%s</button></p>', $field['id'], __( 'Select All / None', 'meta-box' ) );
91
+ }
92
+ return '';
93
+ }
94
+ }
inc/meta-box/inc/fields/input.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The abstract input field which is used for all <input> fields.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Abstract input field class.
10
+ */
11
+ abstract class RWMB_Input_Field extends RWMB_Field {
12
+ /**
13
+ * Get field HTML.
14
+ *
15
+ * @param mixed $meta Meta value.
16
+ * @param array $field Field parameters.
17
+ * @return string
18
+ */
19
+ public static function html( $meta, $field ) {
20
+ $attributes = self::call( 'get_attributes', $field, $meta );
21
+ return sprintf( '<input %s>%s', self::render_attributes( $attributes ), self::datalist( $field ) );
22
+ }
23
+
24
+ /**
25
+ * Normalize parameters for field.
26
+ *
27
+ * @param array $field Field parameters.
28
+ * @return array
29
+ */
30
+ public static function normalize( $field ) {
31
+ $field = parent::normalize( $field );
32
+ $field = wp_parse_args( $field, array(
33
+ 'autocomplete' => false,
34
+ 'size' => 30,
35
+ 'datalist' => false,
36
+ 'readonly' => false,
37
+ ) );
38
+ if ( $field['datalist'] ) {
39
+ $field['datalist'] = wp_parse_args( $field['datalist'], array(
40
+ 'id' => $field['id'] . '_list',
41
+ 'options' => array(),
42
+ ) );
43
+ }
44
+ return $field;
45
+ }
46
+
47
+ /**
48
+ * Get the attributes for a field.
49
+ *
50
+ * @param array $field Field parameters.
51
+ * @param mixed $value Meta value.
52
+ * @return array
53
+ */
54
+ public static function get_attributes( $field, $value = null ) {
55
+ $attributes = parent::get_attributes( $field, $value );
56
+ $attributes = wp_parse_args( $attributes, array(
57
+ 'autocomplete' => $field['autocomplete'],
58
+ 'list' => $field['datalist'] ? $field['datalist']['id'] : false,
59
+ 'readonly' => $field['readonly'],
60
+ 'value' => $value,
61
+ 'placeholder' => $field['placeholder'],
62
+ 'type' => $field['type'],
63
+ 'size' => $field['size'],
64
+ ) );
65
+
66
+ return $attributes;
67
+ }
68
+
69
+ /**
70
+ * Create datalist, if any.
71
+ *
72
+ * @param array $field Field parameters.
73
+ * @return string
74
+ */
75
+ protected static function datalist( $field ) {
76
+ if ( empty( $field['datalist'] ) ) {
77
+ return '';
78
+ }
79
+
80
+ $datalist = $field['datalist'];
81
+ $html = sprintf( '<datalist id="%s">', $datalist['id'] );
82
+ foreach ( $datalist['options'] as $option ) {
83
+ $html .= sprintf( '<option value="%s"></option>', $option );
84
+ }
85
+ $html .= '</datalist>';
86
+ return $html;
87
+ }
88
+ }
inc/meta-box/inc/fields/key-value.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The key-value field which allows users to add pairs of keys and values.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Key-value field class.
10
+ */
11
+ class RWMB_Key_Value_Field extends RWMB_Text_Field {
12
+ /**
13
+ * Get field HTML.
14
+ *
15
+ * @param mixed $meta Meta value.
16
+ * @param array $field Field parameters.
17
+ *
18
+ * @return string
19
+ */
20
+ public static function html( $meta, $field ) {
21
+ // Key.
22
+ $key = isset( $meta[0] ) ? $meta[0] : '';
23
+ $attributes = self::get_attributes( $field, $key );
24
+ $attributes['placeholder'] = $field['placeholder']['key'];
25
+ $html = sprintf( '<input %s>', self::render_attributes( $attributes ) );
26
+
27
+ // Value.
28
+ $val = isset( $meta[1] ) ? $meta[1] : '';
29
+ $attributes = self::get_attributes( $field, $val );
30
+ $attributes['placeholder'] = $field['placeholder']['value'];
31
+ $html .= sprintf( '<input %s>', self::render_attributes( $attributes ) );
32
+
33
+ return $html;
34
+ }
35
+
36
+ /**
37
+ * Show begin HTML markup for fields.
38
+ *
39
+ * @param mixed $meta Meta value.
40
+ * @param array $field Field parameters.
41
+ *
42
+ * @return string
43
+ */
44
+ public static function begin_html( $meta, $field ) {
45
+ $desc = $field['desc'] ? "<p id='{$field['id']}_description' class='description'>{$field['desc']}</p>" : '';
46
+
47
+ if ( empty( $field['name'] ) ) {
48
+ return '<div class="rwmb-input">' . $desc;
49
+ }
50
+
51
+ return sprintf(
52
+ '<div class="rwmb-label">
53
+ <label for="%s">%s</label>
54
+ </div>
55
+ <div class="rwmb-input">
56
+ %s',
57
+ $field['id'],
58
+ $field['name'],
59
+ $desc
60
+ );
61
+ }
62
+
63
+ /**
64
+ * Do not show field description.
65
+ *
66
+ * @param array $field Field parameters.
67
+ *
68
+ * @return string
69
+ */
70
+ public static function input_description( $field ) {
71
+ return '';
72
+ }
73
+
74
+ /**
75
+ * Do not show field description.
76
+ *
77
+ * @param array $field Field parameters.
78
+ *
79
+ * @return string
80
+ */
81
+ public static function label_description( $field ) {
82
+ return '';
83
+ }
84
+
85
+ /**
86
+ * Escape meta for field output.
87
+ *
88
+ * @param mixed $meta Meta value.
89
+ *
90
+ * @return mixed
91
+ */
92
+ public static function esc_meta( $meta ) {
93
+ foreach ( (array) $meta as $k => $pairs ) {
94
+ $meta[ $k ] = array_map( 'esc_attr', (array) $pairs );
95
+ }
96
+ return $meta;
97
+ }
98
+
99
+ /**
100
+ * Sanitize field value.
101
+ *
102
+ * @param mixed $new The submitted meta value.
103
+ * @param mixed $old The existing meta value.
104
+ * @param int $post_id The post ID.
105
+ * @param array $field The field parameters.
106
+ *
107
+ * @return array
108
+ */
109
+ public static function value( $new, $old, $post_id, $field ) {
110
+ foreach ( $new as &$arr ) {
111
+ if ( empty( $arr[0] ) && empty( $arr[1] ) ) {
112
+ $arr = false;
113
+ }
114
+ }
115
+ $new = array_filter( $new );
116
+ return $new;
117
+ }
118
+
119
+ /**
120
+ * Normalize parameters for field.
121
+ *
122
+ * @param array $field Field parameters.
123
+ *
124
+ * @return array
125
+ */
126
+ public static function normalize( $field ) {
127
+ $field = parent::normalize( $field );
128
+ $field['clone'] = true;
129
+ $field['multiple'] = true;
130
+ $field['attributes']['type'] = 'text';
131
+ $field['placeholder'] = wp_parse_args( (array) $field['placeholder'], array(
132
+ 'key' => __( 'Key', 'meta-box' ),
133
+ 'value' => __( 'Value', 'meta-box' ),
134
+ ) );
135
+ return $field;
136
+ }
137
+
138
+ /**
139
+ * Format value for the helper functions.
140
+ *
141
+ * @param array $field Field parameters.
142
+ * @param string|array $value The field meta value.
143
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
144
+ * @param int|null $post_id Post ID. null for current post. Optional.
145
+ *
146
+ * @return string
147
+ */
148
+ public static function format_clone_value( $field, $value, $args, $post_id ) {
149
+ return sprintf( '<label>%s:</label> %s', $value[0], $value[1] );
150
+ }
151
+ }
inc/meta-box/inc/fields/map.php CHANGED
@@ -1,57 +1,202 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Map_Field' ) )
6
- {
7
- class RWMB_Map_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_script( 'googlemap', 'https://maps.google.com/maps/api/js?sensor=false', array(), '', true );
17
- wp_enqueue_script( 'rwmb-map', TX_RWMB_JS_URL . 'map.js', array( 'jquery', 'jquery-ui-autocomplete', 'googlemap' ), TX_RWMB_VER, true );
18
- }
19
-
20
- /**
21
- * Get field HTML
22
- *
23
- * @param mixed $meta
24
- * @param array $field
25
- *
26
- * @return string
27
- */
28
- static function html( $meta, $field )
29
- {
30
- $address = isset( $field['address_field'] ) ? $field['address_field'] : false;
31
-
32
- $html = '<div class="rwmb-map-field">';
33
-
34
- $html .= sprintf(
35
- '<div class="rwmb-map-canvas" style="%s"%s></div>
36
- <input type="hidden" name="%s" class="rwmb-map-coordinate" value="%s">',
37
- isset( $field['style'] ) ? $field['style'] : '',
38
- isset( $field['std'] ) ? " data-default-loc=\"{$field['std']}\"" : '',
39
- $field['field_name'],
40
- $meta
41
- );
42
-
43
- if ( $address )
44
- {
45
- $html .= sprintf(
46
- '<button class="button rwmb-map-goto-address-button" value="%s">%s</button>',
47
- is_array( $address ) ? implode( ',', $address ) : $address,
48
- __( 'Find Address', 'meta-box' )
49
- );
50
- }
51
-
52
- $html .= '</div>';
53
-
54
- return $html;
55
- }
56
- }
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Google Maps field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Map field class.
10
+ */
11
+ class RWMB_Map_Field extends RWMB_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-map', RWMB_CSS_URL . 'map.css', array(), RWMB_VER );
17
+
18
+ /**
19
+ * Since June 2016, Google Maps requires a valid API key.
20
+ *
21
+ * @link http://googlegeodevelopers.blogspot.com/2016/06/building-for-scale-updates-to-google.html
22
+ * @link https://developers.google.com/maps/documentation/javascript/get-api-key
23
+ */
24
+ $args = func_get_args();
25
+ $field = $args[0];
26
+ $google_maps_url = add_query_arg(
27
+ array(
28
+ 'key' => $field['api_key'],
29
+ 'language' => $field['language'],
30
+ ),
31
+ 'https://maps.google.com/maps/api/js'
32
+ );
33
+
34
+ /**
35
+ * Allows developers load more libraries via a filter.
36
+ *
37
+ * @link https://developers.google.com/maps/documentation/javascript/libraries
38
+ */
39
+ $google_maps_url = apply_filters( 'rwmb_google_maps_url', $google_maps_url );
40
+ wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), '', true );
41
+ wp_enqueue_script( 'rwmb-map', RWMB_JS_URL . 'map.js', array(
42
+ 'jquery-ui-autocomplete',
43
+ 'google-maps',
44
+ ), RWMB_VER, true );
45
+ }
46
+
47
+ /**
48
+ * Get field HTML.
49
+ *
50
+ * @param mixed $meta Meta value.
51
+ * @param array $field Field parameters.
52
+ *
53
+ * @return string
54
+ */
55
+ public static function html( $meta, $field ) {
56
+ $address = is_array( $field['address_field'] ) ? implode( ',', $field['address_field'] ) : $field['address_field'];
57
+ $html = sprintf(
58
+ '<div class="rwmb-map-field" data-address-field="%s">',
59
+ esc_attr( $address )
60
+ );
61
+
62
+ $html .= sprintf(
63
+ '<div class="rwmb-map-canvas" data-default-loc="%s" data-region="%s"></div>
64
+ <input type="hidden" name="%s" class="rwmb-map-coordinate" value="%s">',
65
+ esc_attr( $field['std'] ),
66
+ esc_attr( $field['region'] ),
67
+ esc_attr( $field['field_name'] ),
68
+ esc_attr( $meta )
69
+ );
70
+
71
+ if ( $field['address_field'] ) {
72
+ $html .= sprintf(
73
+ '<button class="button rwmb-map-goto-address-button">%s</button>',
74
+ esc_html__( 'Find Address', 'meta-box' )
75
+ );
76
+ }
77
+
78
+ $html .= '</div>';
79
+
80
+ return $html;
81
+ }
82
+
83
+ /**
84
+ * Normalize parameters for field.
85
+ *
86
+ * @param array $field Field parameters.
87
+ *
88
+ * @return array
89
+ */
90
+ public static function normalize( $field ) {
91
+ $field = parent::normalize( $field );
92
+ $field = wp_parse_args( $field, array(
93
+ 'std' => '',
94
+ 'address_field' => '',
95
+ 'language' => '',
96
+ 'region' => '',
97
+
98
+ // Default API key, required by Google Maps since June 2016.
99
+ // Users should overwrite this key with their own key.
100
+ 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ',
101
+ ) );
102
+
103
+ return $field;
104
+ }
105
+
106
+ /**
107
+ * Get the field value.
108
+ * The difference between this function and 'meta' function is 'meta' function always returns the escaped value
109
+ * of the field saved in the database, while this function returns more meaningful value of the field.
110
+ *
111
+ * @param array $field Field parameters.
112
+ * @param array $args Not used for this field.
113
+ * @param int|null $post_id Post ID. null for current post. Optional.
114
+ *
115
+ * @return mixed Array(latitude, longitude, zoom)
116
+ */
117
+ public static function get_value( $field, $args = array(), $post_id = null ) {
118
+ $value = parent::get_value( $field, $args, $post_id );
119
+ list( $latitude, $longitude, $zoom ) = explode( ',', $value . ',,' );
120
+ return compact( 'latitude', 'longitude', 'zoom' );
121
+ }
122
+
123
+ /**
124
+ * Output the field value.
125
+ * Display Google maps.
126
+ *
127
+ * @param array $field Field parameters.
128
+ * @param array $args Additional arguments for the map.
129
+ * @param int|null $post_id Post ID. null for current post. Optional.
130
+ *
131
+ * @return string HTML output of the field
132
+ */
133
+ public static function the_value( $field, $args = array(), $post_id = null ) {
134
+ $value = parent::get_value( $field, $args, $post_id );
135
+ $args = wp_parse_args( $args, array(
136
+ 'api_key' => isset( $field['api_key'] ) ? $field['api_key'] : '',
137
+ ) );
138
+ return self::render_map( $value, $args );
139
+ }
140
+
141
+ /**
142
+ * Render a map in the frontend.
143
+ *
144
+ * @param array $location The [latitude, longitude[, zoom]] location.
145
+ * @param array $args Additional arguments for the map.
146
+ *
147
+ * @return string
148
+ */
149
+ public static function render_map( $location, $args = array() ) {
150
+ list( $latitude, $longitude, $zoom ) = explode( ',', $location . ',,' );
151
+ if ( ! $latitude || ! $longitude ) {
152
+ return '';
153
+ }
154
+
155
+ $args = wp_parse_args( $args, array(
156
+ 'latitude' => $latitude,
157
+ 'longitude' => $longitude,
158
+ 'width' => '100%',
159
+ 'height' => '480px',
160
+ 'marker' => true, // Display marker?
161
+ 'marker_title' => '', // Marker title, when hover.
162
+ 'info_window' => '', // Content of info window (when click on marker). HTML allowed.
163
+ 'js_options' => array(),
164
+
165
+ // Default API key, required by Google Maps since June 2016.
166
+ // Users should overwrite this key with their own key.
167
+ 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ',
168
+ ) );
169
+
170
+ $google_maps_url = add_query_arg( 'key', $args['api_key'], 'https://maps.google.com/maps/api/js' );
171
+
172
+ /*
173
+ * Allows developers load more libraries via a filter.
174
+ * @link https://developers.google.com/maps/documentation/javascript/libraries
175
+ */
176
+ $google_maps_url = apply_filters( 'rwmb_google_maps_url', $google_maps_url );
177
+ wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), RWMB_VER, true );
178
+ wp_enqueue_script( 'rwmb-map-frontend', RWMB_JS_URL . 'map-frontend.js', array( 'google-maps' ), RWMB_VER, true );
179
+
180
+ /*
181
+ * Google Maps options.
182
+ * Option name is the same as specified in Google Maps documentation.
183
+ * This array will be convert to Javascript Object and pass as map options.
184
+ * @link https://developers.google.com/maps/documentation/javascript/reference
185
+ */
186
+ $args['js_options'] = wp_parse_args( $args['js_options'], array(
187
+ // Default to 'zoom' level set in admin, but can be overwritten.
188
+ 'zoom' => $zoom,
189
+
190
+ // Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId.
191
+ 'mapTypeId' => 'ROADMAP',
192
+ ) );
193
+
194
+ $output = sprintf(
195
+ '<div class="rwmb-map-canvas" data-map_options="%s" style="width:%s;height:%s"></div>',
196
+ esc_attr( wp_json_encode( $args ) ),
197
+ esc_attr( $args['width'] ),
198
+ esc_attr( $args['height'] )
199
+ );
200
+ return $output;
201
+ }
202
+ }
inc/meta-box/inc/fields/media.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Media field class which users WordPress media popup to upload and select files.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The media field class.
10
+ */
11
+ class RWMB_Media_Field extends RWMB_File_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_media();
17
+ if ( ! is_admin() ) {
18
+ wp_register_script( 'media-grid', includes_url( 'js/media-grid.min.js' ), array( 'media-editor' ), '', true );
19
+ }
20
+ wp_enqueue_style( 'rwmb-media', RWMB_CSS_URL . 'media.css', array(), RWMB_VER );
21
+ wp_enqueue_script( 'rwmb-media', RWMB_JS_URL . 'media.js', array( 'jquery-ui-sortable', 'underscore', 'backbone', 'media-grid' ), RWMB_VER, true );
22
+
23
+ self::localize_script( 'rwmb-media', 'i18nRwmbMedia', array(
24
+ 'add' => apply_filters( 'rwmb_media_add_string', _x( '+ Add Media', 'media', 'meta-box' ) ),
25
+ 'single' => apply_filters( 'rwmb_media_single_files_string', _x( ' file', 'media', 'meta-box' ) ),
26
+ 'multiple' => apply_filters( 'rwmb_media_multiple_files_string', _x( ' files', 'media', 'meta-box' ) ),
27
+ 'remove' => apply_filters( 'rwmb_media_remove_string', _x( 'Remove', 'media', 'meta-box' ) ),
28
+ 'edit' => apply_filters( 'rwmb_media_edit_string', _x( 'Edit', 'media', 'meta-box' ) ),
29
+ 'view' => apply_filters( 'rwmb_media_view_string', _x( 'View', 'media', 'meta-box' ) ),
30
+ 'noTitle' => _x( 'No Title', 'media', 'meta-box' ),
31
+ 'loadingUrl' => admin_url( 'images/spinner.gif' ),
32
+ 'extensions' => self::get_mime_extensions(),
33
+ 'select' => apply_filters( 'rwmb_media_select_string', _x( 'Select Files', 'media', 'meta-box' ) ),
34
+ 'or' => apply_filters( 'rwmb_media_or_string', _x( 'or', 'media', 'meta-box' ) ),
35
+ 'uploadInstructions' => apply_filters( 'rwmb_media_upload_instructions_string', _x( 'Drop files here to upload', 'media', 'meta-box' ) ),
36
+ ) );
37
+ }
38
+
39
+ /**
40
+ * Add actions.
41
+ */
42
+ public static function add_actions() {
43
+ $args = func_get_args();
44
+ $field = reset( $args );
45
+ add_action( 'print_media_templates', array( self::get_class_name( $field ), 'print_templates' ) );
46
+ }
47
+
48
+ /**
49
+ * Get field HTML.
50
+ *
51
+ * @param mixed $meta Meta value.
52
+ * @param array $field Field parameters.
53
+ *
54
+ * @return string
55
+ */
56
+ public static function html( $meta, $field ) {
57
+ $meta = (array) $meta;
58
+ $meta = implode( ',', $meta );
59
+ $attributes = self::call( 'get_attributes', $field, $meta );
60
+
61
+ $html = sprintf(
62
+ '<input %s data-options="%s">',
63
+ self::render_attributes( $attributes ),
64
+ esc_attr( wp_json_encode( $field['js_options'] ) )
65
+ );
66
+
67
+ return $html;
68
+ }
69
+
70
+ /**
71
+ * Normalize parameters for field.
72
+ *
73
+ * @param array $field Field parameters.
74
+ *
75
+ * @return array
76
+ */
77
+ public static function normalize( $field ) {
78
+ $field = parent::normalize( $field );
79
+ $field = wp_parse_args( $field, array(
80
+ 'std' => array(),
81
+ 'mime_type' => '',
82
+ 'max_file_uploads' => 0,
83
+ 'force_delete' => false,
84
+ 'max_status' => true,
85
+ 'js_options' => array(),
86
+ ) );
87
+
88
+ $field['js_options'] = wp_parse_args( $field['js_options'], array(
89
+ 'mimeType' => $field['mime_type'],
90
+ 'maxFiles' => $field['max_file_uploads'],
91
+ 'forceDelete' => $field['force_delete'] ? true : false,
92
+ 'maxStatus' => $field['max_status'],
93
+ ) );
94
+
95
+ $field['multiple'] = true;
96
+
97
+ return $field;
98
+ }
99
+
100
+ /**
101
+ * Get the attributes for a field.
102
+ *
103
+ * @param array $field Field parameters.
104
+ * @param mixed $value Meta value.
105
+ *
106
+ * @return array
107
+ */
108
+ public static function get_attributes( $field, $value = null ) {
109
+ $attributes = parent::get_attributes( $field, $value );
110
+ $attributes['type'] = 'hidden';
111
+ $attributes['name'] = $field['clone'] ? str_replace( '[]', '', $attributes['name'] ) : $attributes['name'];
112
+ $attributes['id'] = false;
113
+ $attributes['value'] = $value;
114
+
115
+ return $attributes;
116
+ }
117
+
118
+ /**
119
+ * Get supported mime extensions.
120
+ *
121
+ * @return array
122
+ */
123
+ protected static function get_mime_extensions() {
124
+ $mime_types = wp_get_mime_types();
125
+ $extensions = array();
126
+ foreach ( $mime_types as $ext => $mime ) {
127
+ $ext = explode( '|', $ext );
128
+ $extensions[ $mime ] = $ext;
129
+
130
+ $mime_parts = explode( '/', $mime );
131
+ if ( empty( $extensions[ $mime_parts[0] ] ) ) {
132
+ $extensions[ $mime_parts[0] ] = array();
133
+ }
134
+ $extensions[ $mime_parts[0] ] = array_merge( $extensions[ $mime_parts[0] ], $ext );
135
+ $extensions[ $mime_parts[0] . '/*' ] = $extensions[ $mime_parts[0] ];
136
+ }
137
+
138
+ return $extensions;
139
+ }
140
+
141
+ /**
142
+ * Get meta values to save.
143
+ *
144
+ * @param mixed $new The submitted meta value.
145
+ * @param mixed $old The existing meta value.
146
+ * @param int $post_id The post ID.
147
+ * @param array $field The field parameters.
148
+ *
149
+ * @return array|mixed
150
+ */
151
+ public static function value( $new, $old, $post_id, $field ) {
152
+ $new = ! is_array( $new ) && is_string( $new ) ? explode( ',', $new ) : $new;
153
+ array_walk( $new, 'absint' );
154
+ return array_filter( array_unique( $new ) );
155
+ }
156
+
157
+ /**
158
+ * Save meta value.
159
+ *
160
+ * @param mixed $new The submitted meta value.
161
+ * @param mixed $old The existing meta value.
162
+ * @param int $post_id The post ID.
163
+ * @param array $field The field parameters.
164
+ */
165
+ public static function save( $new, $old, $post_id, $field ) {
166
+ $storage = $field['storage'];
167
+ $storage->delete( $post_id, $field['id'] );
168
+ parent::save( $new, array(), $post_id, $field );
169
+ }
170
+
171
+ /**
172
+ * Template for media item.
173
+ */
174
+ public static function print_templates() {
175
+ require_once RWMB_INC_DIR . 'templates/media.php';
176
+ }
177
+ }
inc/meta-box/inc/fields/multiple-values.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This class implements common methods used in fields which have multiple values
4
+ * like checkbox list, autocomplete, etc.
5
+ *
6
+ * The difference when handling actions for these fields are the way they get/set
7
+ * meta value. Briefly:
8
+ * - If field is cloneable, value is saved as a single entry in the database
9
+ * - Otherwise value is saved as multiple entries
10
+ *
11
+ * @package Meta Box
12
+ */
13
+
14
+ /**
15
+ * Multiple values field class.
16
+ */
17
+ abstract class RWMB_Multiple_Values_Field extends RWMB_Field {
18
+ /**
19
+ * Normalize parameters for field.
20
+ *
21
+ * @param array $field Field parameters.
22
+ *
23
+ * @return array
24
+ */
25
+ public static function normalize( $field ) {
26
+ $field = parent::normalize( $field );
27
+ $field['multiple'] = true;
28
+ $field['field_name'] = $field['id'];
29
+ if ( ! $field['clone'] ) {
30
+ $field['field_name'] .= '[]';
31
+ }
32
+
33
+ return $field;
34
+ }
35
+
36
+ /**
37
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
38
+ *
39
+ * @param array $field Field parameters.
40
+ * @param string $value The value.
41
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
42
+ * @param int|null $post_id Post ID. null for current post. Optional.
43
+ *
44
+ * @return string
45
+ */
46
+ public static function format_single_value( $field, $value, $args, $post_id ) {
47
+ return $field['options'][ $value ];
48
+ }
49
+ }
inc/meta-box/inc/fields/number.php CHANGED
@@ -1,47 +1,48 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
 
 
 
4
 
5
- if ( ! class_exists( 'RWMB_Number_Field' ) )
6
- {
7
- class RWMB_Number_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- return sprintf(
20
- '<input type="number" class="rwmb-number" name="%s" id="%s" value="%s" step="%s" min="%s" placeholder="%s"/>',
21
- $field['field_name'],
22
- empty( $field['clone'] ) ? $field['id'] : '',
23
- $meta,
24
- $field['step'],
25
- $field['min'],
26
- $field['placeholder']
27
- );
28
- }
29
 
30
- /**
31
- * Normalize parameters for field
32
- *
33
- * @param array $field
34
- *
35
- * @return array
36
- */
37
- static function normalize_field( $field )
38
- {
39
- $field = wp_parse_args( $field, array(
40
- 'step' => 1,
41
- 'min' => 0,
42
- ) );
43
 
44
- return $field;
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
  }
1
  <?php
2
+ /**
3
+ * The number field which uses HTML <input type="number">.
4
+ *
5
+ * @package Meta Box
6
+ */
7
 
8
+ /**
9
+ * Number field class.
10
+ */
11
+ class RWMB_Number_Field extends RWMB_Input_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ *
17
+ * @return array
18
+ */
19
+ public static function normalize( $field ) {
20
+ $field = parent::normalize( $field );
 
 
 
 
 
 
 
 
 
 
 
21
 
22
+ $field = wp_parse_args( $field, array(
23
+ 'step' => 1,
24
+ 'min' => 0,
25
+ 'max' => false,
26
+ ) );
 
 
 
 
 
 
 
 
27
 
28
+ return $field;
29
+ }
30
+
31
+ /**
32
+ * Get the attributes for a field.
33
+ *
34
+ * @param array $field Field parameters.
35
+ * @param mixed $value Meta value.
36
+ *
37
+ * @return array
38
+ */
39
+ public static function get_attributes( $field, $value = null ) {
40
+ $attributes = parent::get_attributes( $field, $value );
41
+ $attributes = wp_parse_args( $attributes, array(
42
+ 'step' => $field['step'],
43
+ 'max' => $field['max'],
44
+ 'min' => $field['min'],
45
+ ) );
46
+ return $attributes;
47
  }
48
  }
inc/meta-box/inc/fields/object-choice.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The object choice class which allows users to select specific objects in WordPress.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Abstract field to select an object: post, user, taxonomy, etc.
10
+ */
11
+ abstract class RWMB_Object_Choice_Field extends RWMB_Choice_Field {
12
+ /**
13
+ * Get field HTML
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @param mixed $options Select options.
17
+ * @param mixed $db_fields Database fields to use in the output.
18
+ * @param mixed $meta Meta value.
19
+ * @return string
20
+ */
21
+ public static function walk( $field, $options, $db_fields, $meta ) {
22
+ return call_user_func( array( self::get_type_class( $field ), 'walk' ), $field, $options, $db_fields, $meta );
23
+ }
24
+
25
+ /**
26
+ * Normalize parameters for field.
27
+ *
28
+ * @param array $field Field parameters.
29
+ *
30
+ * @return array
31
+ */
32
+ public static function normalize( $field ) {
33
+ $field = parent::normalize( $field );
34
+ $field = wp_parse_args( $field, array(
35
+ 'flatten' => true,
36
+ 'query_args' => array(),
37
+ 'field_type' => 'select_advanced',
38
+ ) );
39
+
40
+ if ( 'checkbox_tree' === $field['field_type'] ) {
41
+ $field['field_type'] = 'checkbox_list';
42
+ $field['flatten'] = false;
43
+ }
44
+ if ( 'radio_list' === $field['field_type'] ) {
45
+ $field['multiple'] = false;
46
+ }
47
+ if ( 'checkbox_list' === $field['field_type'] ) {
48
+ $field['multiple'] = true;
49
+ }
50
+ return call_user_func( array( self::get_type_class( $field ), 'normalize' ), $field );
51
+ }
52
+
53
+ /**
54
+ * Get the attributes for a field.
55
+ *
56
+ * @param array $field Field parameters.
57
+ * @param mixed $value Meta value.
58
+ *
59
+ * @return array
60
+ */
61
+ public static function get_attributes( $field, $value = null ) {
62
+ $attributes = call_user_func( array( self::get_type_class( $field ), 'get_attributes' ), $field, $value );
63
+ if ( 'select_advanced' === $field['field_type'] ) {
64
+ $attributes['class'] .= ' rwmb-select_advanced';
65
+ } elseif ( 'select' === $field['field_type'] ) {
66
+ $attributes['class'] .= ' rwmb-select';
67
+ }
68
+ return $attributes;
69
+ }
70
+
71
+ /**
72
+ * Get field names of object to be used by walker.
73
+ *
74
+ * @return array
75
+ */
76
+ public static function get_db_fields() {
77
+ return array(
78
+ 'parent' => '',
79
+ 'id' => '',
80
+ 'label' => '',
81
+ );
82
+ }
83
+
84
+ /**
85
+ * Enqueue scripts and styles.
86
+ */
87
+ public static function admin_enqueue_scripts() {
88
+ RWMB_Input_List_Field::admin_enqueue_scripts();
89
+ RWMB_Select_Field::admin_enqueue_scripts();
90
+ RWMB_Select_Tree_Field::admin_enqueue_scripts();
91
+ RWMB_Select_Advanced_Field::admin_enqueue_scripts();
92
+ }
93
+
94
+ /**
95
+ * Get correct rendering class for the field.
96
+ *
97
+ * @param array $field Field parameters.
98
+ * @return string
99
+ */
100
+ protected static function get_type_class( $field ) {
101
+ if ( in_array( $field['field_type'], array( 'checkbox_list', 'radio_list' ), true ) ) {
102
+ return 'RWMB_Input_List_Field';
103
+ }
104
+ return self::get_class_name( array(
105
+ 'type' => $field['field_type'],
106
+ ) );
107
+ }
108
+ }
inc/meta-box/inc/fields/oembed.php CHANGED
@@ -1,82 +1,109 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- // Make sure "text" field is loaded
6
- require_once TX_RWMB_FIELDS_DIR . 'url.php';
7
-
8
- if ( ! class_exists( 'RWMB_OEmbed_Field' ) )
9
- {
10
- class RWMB_OEmbed_Field extends RWMB_URL_Field
11
- {
12
- /**
13
- * Enqueue scripts and styles
14
- *
15
- * @return void
16
- */
17
- static function admin_enqueue_scripts()
18
- {
19
- wp_enqueue_style( 'rwmb-oembed', TX_RWMB_CSS_URL . 'oembed.css' );
20
- wp_enqueue_script( 'rwmb-oembed', TX_RWMB_JS_URL . 'oembed.js', array(), TX_RWMB_VER, true );
21
- }
22
-
23
- /**
24
- * Add actions
25
- *
26
- * @return void
27
- */
28
- static function add_actions()
29
- {
30
- add_action( 'wp_ajax_rwmb_get_embed', array( __CLASS__, 'wp_ajax_get_embed' ) );
31
- }
32
-
33
- /**
34
- * Ajax callback for returning oEmbed HTML
35
- *
36
- * @return void
37
- */
38
- static function wp_ajax_get_embed()
39
- {
40
- $url = isset( $_POST['url'] ) ? $_POST['url'] : '';
41
- wp_send_json_success( self::get_embed( $url ) );
42
- }
43
-
44
- /**
45
- * Get embed html from url
46
- *
47
- * @param string $url
48
- *
49
- * @return string
50
- */
51
- static function get_embed( $url )
52
- {
53
- $embed = @wp_oembed_get( $url );
54
-
55
- return $embed ? $embed : __( 'Embed HTML not available.', 'meta-box' );
56
- }
57
-
58
- /**
59
- * Get field HTML
60
- *
61
- * @param mixed $meta
62
- * @param array $field
63
- *
64
- * @return string
65
- */
66
- static function html( $meta, $field )
67
- {
68
- return sprintf(
69
- '<input type="url" class="rwmb-oembed" name="%s" id="%s" value="%s" size="%s">
70
- <a href="#" class="show-embed button">%s</a>
71
- <span class="spinner"></span>
72
- <div class="embed-code">%s</div>',
73
- $field['field_name'],
74
- $field['id'],
75
- $meta,
76
- $field['size'],
77
- __( 'Preview', 'meta-box' ),
78
- $meta ? self::get_embed( $meta ) : ''
79
- );
80
- }
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The oEmbed field which allows users to enter oEmbed URLs.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * OEmbed field class.
10
+ */
11
+ class RWMB_OEmbed_Field extends RWMB_Text_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-oembed', RWMB_CSS_URL . 'oembed.css' );
17
+ wp_enqueue_script( 'rwmb-oembed', RWMB_JS_URL . 'oembed.js', array( 'jquery', 'underscore' ), RWMB_VER, true );
18
+ }
19
+
20
+ /**
21
+ * Add actions.
22
+ */
23
+ public static function add_actions() {
24
+ add_action( 'wp_ajax_rwmb_get_embed', array( __CLASS__, 'wp_ajax_get_embed' ) );
25
+ }
26
+
27
+ /**
28
+ * Ajax callback for returning oEmbed HTML.
29
+ */
30
+ public static function wp_ajax_get_embed() {
31
+ $url = (string) filter_input( INPUT_POST, 'url', FILTER_SANITIZE_URL );
32
+ wp_send_json_success( self::get_embed( $url ) );
33
+ }
34
+
35
+ /**
36
+ * Get embed html from url.
37
+ *
38
+ * @param string $url URL.
39
+ * @return string
40
+ */
41
+ public static function get_embed( $url ) {
42
+ /**
43
+ * Set arguments for getting embeded HTML.
44
+ * Without arguments, default width will be taken from global $content_width, which can break UI in the admin.
45
+ *
46
+ * @link https://github.com/rilwis/meta-box/issues/801
47
+ * @see WP_oEmbed::fetch()
48
+ * @see WP_Embed::shortcode()
49
+ * @see wp_embed_defaults()
50
+ */
51
+ $args = array();
52
+ if ( is_admin() ) {
53
+ $args['width'] = 360;
54
+ }
55
+
56
+ // Try oembed first.
57
+ $embed = wp_oembed_get( $url, $args );
58
+
59
+ // If no oembed provides found, try WordPress auto embed.
60
+ if ( ! $embed ) {
61
+ $embed = $GLOBALS['wp_embed']->shortcode( $args, $url );
62
+ }
63
+
64
+ return $embed ? $embed : __( 'Embed HTML not available.', 'meta-box' );
65
+ }
66
+
67
+ /**
68
+ * Get field HTML.
69
+ *
70
+ * @param mixed $meta Meta value.
71
+ * @param array $field Field parameters.
72
+ * @return string
73
+ */
74
+ public static function html( $meta, $field ) {
75
+ return parent::html( $meta, $field ) . sprintf(
76
+ '<span class="spinner"></span>
77
+ <div class="rwmb-embed-media">%s</div>',
78
+ $meta ? self::get_embed( $meta ) : ''
79
+ );
80
+ }
81
+
82
+ /**
83
+ * Get the attributes for a field.
84
+ *
85
+ * @param array $field Field parameters.
86
+ * @param mixed $value Meta value.
87
+ *
88
+ * @return array
89
+ */
90
+ public static function get_attributes( $field, $value = null ) {
91
+ $attributes = parent::get_attributes( $field, $value );
92
+ $attributes['type'] = 'url';
93
+ return $attributes;
94
+ }
95
+
96
+ /**
97
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
98
+ *
99
+ * @param array $field Field parameters.
100
+ * @param string $value The value.
101
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
102
+ * @param int|null $post_id Post ID. null for current post. Optional.
103
+ *
104
+ * @return string
105
+ */
106
+ public static function format_single_value( $field, $value, $args, $post_id ) {
107
+ return self::get_embed( $value );
108
+ }
109
+ }
inc/meta-box/inc/fields/password.php CHANGED
@@ -1,31 +1,25 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- // Make sure "text" field is loaded
6
- require_once TX_RWMB_FIELDS_DIR . 'text.php';
7
-
8
- if ( ! class_exists( 'RWMB_Password_Field' ) )
9
- {
10
- class RWMB_Password_Field extends RWMB_Text_Field
11
- {
12
- /**
13
- * Get field HTML
14
- *
15
- * @param mixed $meta
16
- * @param array $field
17
- *
18
- * @return string
19
- */
20
- static function html( $meta, $field )
21
- {
22
- return sprintf(
23
- '<input type="password" class="rwmb-password" name="%s" id="%s" value="%s" size="%s" />',
24
- $field['field_name'],
25
- $field['id'],
26
- $meta,
27
- $field['size']
28
- );
29
- }
30
- }
31
- }
1
+ <?php
2
+ /**
3
+ * The secured password field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Password field class.
10
+ */
11
+ class RWMB_Password_Field extends RWMB_Text_Field {
12
+ /**
13
+ * Store secured password in the database.
14
+ *
15
+ * @param mixed $new The submitted meta value.
16
+ * @param mixed $old The existing meta value.
17
+ * @param int $post_id The post ID.
18
+ * @param array $field The field parameters.
19
+ * @return string
20
+ */
21
+ public static function value( $new, $old, $post_id, $field ) {
22
+ $new = $new !== $old ? wp_hash_password( $new ) : $new;
23
+ return $new;
24
+ }
25
+ }
 
 
 
 
 
 
inc/meta-box/inc/fields/plupload-image.php DELETED
@@ -1,197 +0,0 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
- require_once TX_RWMB_FIELDS_DIR . 'image.php';
5
- if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
6
- {
7
- class RWMB_Plupload_Image_Field extends RWMB_Image_Field
8
- {
9
- /**
10
- * Add field actions
11
- *
12
- * @return void
13
- */
14
- static function add_actions()
15
- {
16
- parent::add_actions();
17
- add_action( 'wp_ajax_rwmb_plupload_image_upload', array( __CLASS__, 'handle_upload' ) );
18
- }
19
-
20
- /**
21
- * Upload
22
- * Ajax callback function
23
- *
24
- * @return string Error or (XML-)response
25
- */
26
- static function handle_upload()
27
- {
28
- global $wpdb;
29
- $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
30
- $field_id = isset( $_REQUEST['field_id'] ) ? $_REQUEST['field_id'] : '';
31
-
32
- check_ajax_referer( "rwmb-upload-images_{$field_id}" );
33
-
34
- // You can use WP's wp_handle_upload() function:
35
- $file = $_FILES['async-upload'];
36
- $file_attr = wp_handle_upload( $file, array( 'test_form' => false ) );
37
- //Get next menu_order
38
- $meta = get_post_meta( $post_id, $field_id, false );
39
- if ( empty( $meta ) )
40
- {
41
- $next = 0;
42
- }
43
- else
44
- {
45
- $meta = implode( ',', (array) $meta );
46
- $max = $wpdb->get_var( "
47
- SELECT MAX(menu_order) FROM {$wpdb->posts}
48
- WHERE post_type = 'attachment'
49
- AND ID in ({$meta})
50
- " );
51
- $next = is_numeric( $max ) ? (int) $max + 1 : 0;
52
- }
53
-
54
- $attachment = array(
55
- 'guid' => $file_attr['url'],
56
- 'post_mime_type' => $file_attr['type'],
57
- 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file['name'] ) ),
58
- 'post_content' => '',
59
- 'post_status' => 'inherit',
60
- 'menu_order' => $next,
61
- );
62
-
63
- // Adds file as attachment to WordPress
64
- $id = wp_insert_attachment( $attachment, $file_attr['file'], $post_id );
65
- if ( ! is_wp_error( $id ) )
66
- {
67
- wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file_attr['file'] ) );
68
-
69
- // Save file ID in meta field
70
- add_post_meta( $post_id, $field_id, $id, false );
71
- wp_send_json_success( self::img_html( $id ) );
72
- }
73
-
74
- exit;
75
- }
76
-
77
- /**
78
- * Enqueue scripts and styles
79
- *
80
- * @return void
81
- */
82
- static function admin_enqueue_scripts()
83
- {
84
- // Enqueue same scripts and styles as for file field
85
- parent::admin_enqueue_scripts();
86
- wp_enqueue_style( 'rwmb-plupload-image', TX_RWMB_CSS_URL . 'plupload-image.css', array( 'wp-admin' ), TX_RWMB_VER );
87
- wp_enqueue_script( 'rwmb-plupload-image', TX_RWMB_JS_URL . 'plupload-image.js', array( 'jquery-ui-sortable', 'wp-ajax-response', 'plupload-all' ), TX_RWMB_VER, true );
88
- wp_localize_script( 'rwmb-plupload-image', 'RWMB', array( 'url' => RWMB_URL ) );
89
- }
90
-
91
- /**
92
- * Get field HTML
93
- *
94
- * @param mixed $meta
95
- * @param array $field
96
- *
97
- * @return string
98
- */
99
- static function html( $meta, $field )
100
- {
101
- if ( ! is_array( $meta ) )
102
- $meta = ( array ) $meta;
103
-
104
- // Filter to change the drag & drop box background string
105
- $i18n_drop = apply_filters( 'rwmb_plupload_image_drop_string', _x( 'Drop images here', 'image upload', 'meta-box' ), $field );
106
- $i18n_or = apply_filters( 'rwmb_plupload_image_or_string', _x( 'or', 'image upload', 'meta-box' ), $field );
107
- $i18n_select = apply_filters( 'rwmb_plupload_image_select_string', _x( 'Select Files', 'image upload', 'meta-box' ), $field );
108
-
109
- // Uploaded images
110
-
111
- // Check for max_file_uploads
112
- $classes = array( 'rwmb-drag-drop', 'drag-drop', 'hide-if-no-js', 'new-files' );
113
- if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
114
- $classes[] = 'hidden';
115
-
116
-
117
- $html = self::get_uploaded_images( $meta, $field );
118
-
119
- // Show form upload
120
- $html .= sprintf(
121
- '<div id="%s-dragdrop" class="%s" data-upload_nonce="%s" data-js_options="%s">
122
- <div class = "drag-drop-inside">
123
- <p class="drag-drop-info">%s</p>
124
- <p>%s</p>
125
- <p class="drag-drop-buttons"><input id="%s-browse-button" type="button" value="%s" class="button" /></p>
126
- </div>
127
- </div>',
128
- $field['id'],
129
- implode( ' ', $classes ),
130
- wp_create_nonce( "rwmb-upload-images_{$field['id']}" ),
131
- esc_attr( json_encode( $field['js_options'] ) ),
132
- $i18n_drop,
133
- $i18n_or,
134
- $field['id'],
135
- $i18n_select
136
- );
137
-
138
- return $html;
139
- }
140
-
141
- /**
142
- * Get field value
143
- * It's the combination of new (uploaded) images and saved images
144
- *
145
- * @param array $new
146
- * @param array $old
147
- * @param int $post_id
148
- * @param array $field
149
- *
150
- * @return array|mixed
151
- */
152
- static function value( $new, $old, $post_id, $field )
153
- {
154
- $new = (array) $new;
155
-
156
- return array_unique( array_merge( $old, $new ) );
157
- }
158
-
159
- /**
160
- * Normalize parameters for field
161
- *
162
- * @param array $field
163
- *
164
- * @return array
165
- */
166
- static function normalize_field( $field )
167
- {
168
- $field['js_options'] = array(
169
- 'runtimes' => 'html5,silverlight,flash,html4',
170
- 'file_data_name' => 'async-upload',
171
- //'container' => $field['id'] . '-container',
172
- 'browse_button' => $field['id'] . '-browse-button',
173
- 'drop_element' => $field['id'] . '-dragdrop',
174
- 'multiple_queues' => true,
175
- 'max_file_size' => wp_max_upload_size() . 'b',
176
- 'url' => admin_url( 'admin-ajax.php' ),
177
- 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
178
- 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
179
- 'multipart' => true,
180
- 'urlstream_upload' => true,
181
- 'filters' => array(
182
- array(
183
- 'title' => _x( 'Allowed Image Files', 'image upload', 'meta-box' ),
184
- 'extensions' => 'jpg,jpeg,gif,png',
185
- ),
186
- ),
187
- 'multipart_params' => array(
188
- 'field_id' => $field['id'],
189
- 'action' => 'rwmb_plupload_image_upload',
190
- )
191
- );
192
- $field = parent::normalize_field( $field );
193
-
194
- return $field;
195
- }
196
- }
197
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/post.php CHANGED
@@ -1,156 +1,125 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- // Make sure "select" field is loaded
6
- require_once TX_RWMB_FIELDS_DIR . 'select-advanced.php';
7
-
8
- if ( ! class_exists( 'RWMB_Post_Field' ) )
9
- {
10
- class RWMB_Post_Field extends RWMB_Field
11
- {
12
- /**
13
- * Enqueue scripts and styles
14
- *
15
- * @return void
16
- */
17
- static function admin_enqueue_scripts()
18
- {
19
- RWMB_Select_Advanced_Field::admin_enqueue_scripts();
20
- }
21
-
22
- /**
23
- * Get field HTML
24
- *
25
- * @param mixed $meta
26
- * @param array $field
27
- *
28
- * @return string
29
- */
30
- static function html( $meta, $field )
31
- {
32
- $field['options'] = self::get_options( $field );
33
- switch ( $field['field_type'] )
34
- {
35
- case 'select':
36
- return RWMB_Select_Field::html( $meta, $field );
37
- case 'select_advanced':
38
- default:
39
- return RWMB_Select_Advanced_Field::html( $meta, $field );
40
- }
41
- }
42
-
43
- /**
44
- * Normalize parameters for field
45
- *
46
- * @param array $field
47
- *
48
- * @return array
49
- */
50
- static function normalize_field( $field )
51
- {
52
- $default_post_type = __( 'Post', 'meta-box' );
53
- if ( is_string( $field['post_type'] ) )
54
- {
55
- $post_type_object = get_post_type_object( $field['post_type'] );
56
- $default_post_type = $post_type_object->labels->singular_name;
57
- }
58
-
59
- $field = wp_parse_args( $field, array(
60
- 'post_type' => 'post',
61
- 'field_type' => 'select_advanced',
62
- 'parent' => false,
63
- 'query_args' => array(),
64
- ) );
65
-
66
- $field['std'] = empty( $field['std'] ) ? sprintf( __( 'Select a %s', 'meta-box' ), $default_post_type ) : $field['std'];
67
-
68
- if ( $field['parent'] )
69
- {
70
- $field['multiple'] = false;
71
- $field['field_name'] = 'parent_id';
72
- }
73
-
74
- $field['query_args'] = wp_parse_args( $field['query_args'], array(
75
- 'post_type' => $field['post_type'],
76
- 'post_status' => 'publish',
77
- 'posts_per_page' => - 1,
78
- ) );
79
-
80
- switch ( $field['field_type'] )
81
- {
82
- case 'select':
83
- return RWMB_Select_Field::normalize_field( $field );
84
- break;
85
- case 'select_advanced':
86
- default:
87
- return RWMB_Select_Advanced_Field::normalize_field( $field );
88
- }
89
- }
90
-
91
- /**
92
- * Get meta value
93
- * If field is cloneable, value is saved as a single entry in DB
94
- * Otherwise value is saved as multiple entries (for backward compatibility)
95
- *
96
- * @see "save" method for better understanding
97
- *
98
- * @param $post_id
99
- * @param $saved
100
- * @param $field
101
- *
102
- * @return array
103
- */
104
- static function meta( $post_id, $saved, $field )
105
- {
106
- if ( isset( $field['parent'] ) && $field['parent'] )
107
- {
108
- $post = get_post( $post_id );
109
-
110
- return $post->post_parent;
111
- }
112
-
113
- return RWMB_Select_Field::meta( $post_id, $saved, $field );
114
- }
115
-
116
- /**
117
- * Save meta value
118
- * If field is cloneable, value is saved as a single entry in DB
119
- * Otherwise value is saved as multiple entries (for backward compatibility)
120
- *
121
- * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
122
- *
123
- * @param $new
124
- * @param $old
125
- * @param $post_id
126
- * @param $field
127
- */
128
- static function save( $new, $old, $post_id, $field )
129
- {
130
- return RWMB_Select_Field::save( $new, $old, $post_id, $field );
131
- }
132
-
133
- /**
134
- * Get posts
135
- *
136
- * @param array $field
137
- *
138
- * @return array
139
- */
140
- static function get_options( $field )
141
- {
142
- $options = array();
143
- $query = new WP_Query( $field['query_args'] );
144
- if ( $query->have_posts() )
145
- {
146
- while ( $query->have_posts() )
147
- {
148
- $post = $query->next_post();
149
- $options[$post->ID] = $post->post_title;
150
- }
151
- }
152
-
153
- return $options;
154
- }
155
- }
156
- }
1
+ <?php
2
+ /**
3
+ * The post field which allows users to select existing posts.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Post field class.
10
+ */
11
+ class RWMB_Post_Field extends RWMB_Object_Choice_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @return array
17
+ */
18
+ public static function normalize( $field ) {
19
+ // Set default field args.
20
+ $field = wp_parse_args( $field, array(
21
+ 'post_type' => 'post',
22
+ 'parent' => false,
23
+ ) );
24
+
25
+ $field['post_type'] = (array) $field['post_type'];
26
+
27
+ /*
28
+ * Set default placeholder:
29
+ * - If multiple post types: show 'Select a post'.
30
+ * - If single post type: show 'Select a %post_type_name%'.
31
+ */
32
+ $placeholder = __( 'Select a post', 'meta-box' );
33
+ if ( 1 === count( $field['post_type'] ) ) {
34
+ $post_type = reset( $field['post_type'] );
35
+ $post_type_object = get_post_type_object( $post_type );
36
+ if ( ! empty( $post_type_object ) ) {
37
+ // Translators: %s is the taxonomy singular label.
38
+ $placeholder = sprintf( __( 'Select a %s', 'meta-box' ), strtolower( $post_type_object->labels->singular_name ) );
39
+ }
40
+ }
41
+ $field = wp_parse_args( $field, array(
42
+ 'placeholder' => $placeholder,
43
+ ) );
44
+ $field = parent::normalize( $field );
45
+
46
+ if ( ! isset( $field['query_args']['post_type'] ) ) {
47
+ $field['query_args']['post_type'] = $field['post_type'];
48
+ }
49
+
50
+ // Set parent option, which will change field name to `parent_id` to save as post parent.
51
+ if ( $field['parent'] ) {
52
+ $field['multiple'] = false;
53
+ $field['field_name'] = 'parent_id';
54
+ }
55
+
56
+ // Set default query args.
57
+ $field['query_args'] = wp_parse_args( $field['query_args'], array(
58
+ 'post_status' => 'publish',
59
+ 'posts_per_page' => - 1,
60
+ ) );
61
+
62
+ return $field;
63
+ }
64
+
65
+ /**
66
+ * Get field names of object to be used by walker.
67
+ *
68
+ * @return array
69
+ */
70
+ public static function get_db_fields() {
71
+ return array(
72
+ 'parent' => 'post_parent',
73
+ 'id' => 'ID',
74
+ 'label' => 'post_title',
75
+ );
76
+ }
77
+
78
+ /**
79
+ * Get meta value.
80
+ * If field is cloneable, value is saved as a single entry in DB.
81
+ * Otherwise value is saved as multiple entries (for backward compatibility).
82
+ *
83
+ * @see "save" method for better understanding
84
+ *
85
+ * @param int $post_id Post ID.
86
+ * @param bool $saved Is the meta box saved.
87
+ * @param array $field Field parameters.
88
+ *
89
+ * @return mixed
90
+ */
91
+ public static function meta( $post_id, $saved, $field ) {
92
+ return $field['parent'] ? wp_get_post_parent_id( $post_id ) : parent::meta( $post_id, $saved, $field );
93
+ }
94
+
95
+ /**
96
+ * Get options for walker.
97
+ *
98
+ * @param array $field Field parameters.
99
+ * @return array
100
+ */
101
+ public static function get_options( $field ) {
102
+ $query = new WP_Query( $field['query_args'] );
103
+ return $query->have_posts() ? $query->posts : array();
104
+ }
105
+
106
+ /**
107
+ * Get option label.
108
+ *
109
+ * @param array $field Field parameters.
110
+ * @param string $value Option value.
111
+ *
112
+ * @return string
113
+ */
114
+ public static function get_option_label( $field, $value ) {
115
+ return sprintf(
116
+ '<a href="%s" title="%s">%s</a>',
117
+ esc_url( get_permalink( $value ) ),
118
+ the_title_attribute( array(
119
+ 'post' => $value,
120
+ 'echo' => false,
121
+ ) ),
122
+ get_the_title( $value )
123
+ );
124
+ }
125
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/radio.php CHANGED
@@ -1,36 +1,24 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
 
 
 
4
 
5
- if ( ! class_exists( 'RWMB_Radio_Field' ) )
6
- {
7
- class RWMB_Radio_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- $html = array();
20
- $tpl = '<label><input type="radio" class="rwmb-radio" name="%s" value="%s"%s> %s</label>';
21
 
22
- foreach ( $field['options'] as $value => $label )
23
- {
24
- $html[] = sprintf(
25
- $tpl,
26
- $field['field_name'],
27
- $value,
28
- checked( $value, $meta, false ),
29
- $label
30
- );
31
- }
32
-
33
- return implode( ' ', $html );
34
- }
35
  }
36
  }
1
  <?php
2
+ /**
3
+ * The radio field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
 
8
+ /**
9
+ * Radio field class.
10
+ */
11
+ class RWMB_Radio_Field extends RWMB_Input_List_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @return array
17
+ */
18
+ public static function normalize( $field ) {
19
+ $field['multiple'] = false;
20
+ $field = parent::normalize( $field );
 
 
 
21
 
22
+ return $field;
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
  }
inc/meta-box/inc/fields/range.php CHANGED
@@ -1,86 +1,70 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Range_Field' ) )
6
- {
7
- class RWMB_Range_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_style( 'rwmb-range', TX_RWMB_CSS_URL . 'range.css', array(), TX_RWMB_VER );
17
- }
18
-
19
- /**
20
- * Get field HTML
21
- *
22
- * @param mixed $meta
23
- * @param array $field
24
- *
25
- * @return string
26
- */
27
- static function html( $meta, $field )
28
- {
29
- return sprintf(
30
- '<input type="range" class="rwmb-range" name="%s" id="%s" value="%s" min="%s" max="%s" step="%s" />',
31
- $field['field_name'],
32
- $field['id'],
33
- $meta,
34
- $field['min'],
35
- $field['max'],
36
- $field['step']
37
- );
38
- }
39
-
40
- /**
41
- * Normalize parameters for field.
42
- *
43
- * @param array $field
44
- *
45
- * @return array
46
- */
47
- static function normalize_field( $field )
48
- {
49
- $field = wp_parse_args( $field, array(
50
- 'min' => 0,
51
- 'max' => 10,
52
- 'step' => 1,
53
- ) );
54
-
55
- return $field;
56
- }
57
-
58
- /**
59
- * Ensure number in range.
60
- *
61
- * @param mixed $new
62
- * @param mixed $old
63
- * @param int $post_id
64
- * @param array $field
65
- *
66
- * @return int
67
- */
68
- static function value( $new, $old, $post_id, $field )
69
- {
70
- $new = intval( $new );
71
- $min = intval( $field['min'] );
72
- $max = intval( $field['max'] );
73
-
74
- if ( $new < $min )
75
- {
76
- return $min;
77
- }
78
- elseif ( $new > $max )
79
- {
80
- return $max;
81
- }
82
-
83
- return $new;
84
- }
85
- }
86
- }
1
+ <?php
2
+ /**
3
+ * The HTML5 range field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * HTML5 range field class.
10
+ */
11
+ class RWMB_Range_Field extends RWMB_Number_Field {
12
+ /**
13
+ * Get field HTML.
14
+ *
15
+ * @param mixed $meta Meta value.
16
+ * @param array $field Field parameters.
17
+ * @return string
18
+ */
19
+ public static function html( $meta, $field ) {
20
+ $output = parent::html( $meta, $field );
21
+ $output .= sprintf( '<span class="rwmb-output">%s</span>', $meta );
22
+ return $output;
23
+ }
24
+
25
+ /**
26
+ * Enqueue styles.
27
+ */
28
+ public static function admin_enqueue_scripts() {
29
+ wp_enqueue_style( 'rwmb-range', RWMB_CSS_URL . 'range.css', array(), RWMB_VER );
30
+ wp_enqueue_script( 'rwmb-range', RWMB_JS_URL . 'range.js', array(), RWMB_VER, true );
31
+ }
32
+
33
+ /**
34
+ * Normalize parameters for field.
35
+ *
36
+ * @param array $field Field parameters.
37
+ * @return array
38
+ */
39
+ public static function normalize( $field ) {
40
+ $field = wp_parse_args( $field, array(
41
+ 'max' => 10,
42
+ ) );
43
+ $field = parent::normalize( $field );
44
+ return $field;
45
+ }
46
+
47
+ /**
48
+ * Ensure number in range.
49
+ *
50
+ * @param mixed $new The submitted meta value.
51
+ * @param mixed $old The existing meta value.
52
+ * @param int $post_id The post ID.
53
+ * @param array $field The field parameters.
54
+ *
55
+ * @return int
56
+ */
57
+ public static function value( $new, $old, $post_id, $field ) {
58
+ $new = intval( $new );
59
+ $min = intval( $field['min'] );
60
+ $max = intval( $field['max'] );
61
+
62
+ if ( $new < $min ) {
63
+ return $min;
64
+ }
65
+ if ( $new > $max ) {
66
+ return $max;
67
+ }
68
+ return $new;
69
+ }
70
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/select-advanced.php CHANGED
@@ -1,76 +1,74 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- // Make sure "select" field is loaded
6
- require_once TX_RWMB_FIELDS_DIR . 'select.php';
7
-
8
- if ( ! class_exists( 'RWMB_Select_Advanced_Field' ) )
9
- {
10
- class RWMB_Select_Advanced_Field extends RWMB_Select_Field
11
- {
12
- /**
13
- * Enqueue scripts and styles
14
- *
15
- * @return void
16
- */
17
- static function admin_enqueue_scripts()
18
- {
19
- wp_enqueue_style( 'select2', TX_RWMB_CSS_URL . 'select2/select2.css', array(), '3.2' );
20
- wp_enqueue_style( 'rwmb-select-advanced', TX_RWMB_CSS_URL . 'select-advanced.css', array(), TX_RWMB_VER );
21
-
22
- wp_register_script( 'select2', TX_RWMB_JS_URL . 'select2/select2.min.js', array(), '3.2', true );
23
- wp_enqueue_script( 'rwmb-select-advanced', TX_RWMB_JS_URL . 'select-advanced.js', array( 'select2' ), TX_RWMB_VER, true );
24
- }
25
-
26
- /**
27
- * Get field HTML
28
- *
29
- * @param mixed $meta
30
- * @param array $field
31
- *
32
- * @return string
33
- */
34
- static function html( $meta, $field )
35
- {
36
- $html = sprintf(
37
- '<select class="rwmb-select-advanced" name="%s" id="%s" size="%s"%s data-options="%s">',
38
- $field['field_name'],
39
- $field['id'],
40
- $field['size'],
41
- $field['multiple'] ? ' multiple="multiple"' : '',
42
- esc_attr( json_encode( $field['js_options'] ) )
43
- );
44
-
45
- $html .= self::options_html( $field, $meta );
46
-
47
- $html .= '</select>';
48
-
49
- return $html;
50
- }
51
-
52
- /**
53
- * Normalize parameters for field
54
- *
55
- * @param array $field
56
- *
57
- * @return array
58
- */
59
- static function normalize_field( $field )
60
- {
61
- $field = parent::normalize_field( $field );
62
-
63
- $field = wp_parse_args( $field, array(
64
- 'js_options' => array(),
65
- ) );
66
-
67
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
68
- 'allowClear' => true,
69
- 'width' => 'resolve',
70
- 'placeholder' => $field['placeholder'],
71
- ) );
72
-
73
- return $field;
74
- }
75
- }
76
- }
1
+ <?php
2
+ /**
3
+ * The beautiful select field which uses select2 library.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Select advanced field which uses select2 library.
10
+ */
11
+ class RWMB_Select_Advanced_Field extends RWMB_Select_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ parent::admin_enqueue_scripts();
17
+ wp_enqueue_style( 'rwmb-select2', RWMB_CSS_URL . 'select2/select2.css', array(), '4.0.1' );
18
+ wp_enqueue_style( 'rwmb-select-advanced', RWMB_CSS_URL . 'select-advanced.css', array(), RWMB_VER );
19
+
20
+ wp_register_script( 'rwmb-select2', RWMB_JS_URL . 'select2/select2.min.js', array( 'jquery' ), '4.0.2', true );
21
+
22
+ // Localize.
23
+ $dependencies = array( 'rwmb-select2', 'rwmb-select' );
24
+ $locale = str_replace( '_', '-', get_locale() );
25
+ $locale_short = substr( $locale, 0, 2 );
26
+ $locale = file_exists( RWMB_DIR . "js/select2/i18n/$locale.js" ) ? $locale : $locale_short;
27
+
28
+ if ( file_exists( RWMB_DIR . "js/select2/i18n/$locale.js" ) ) {
29
+ wp_register_script( 'rwmb-select2-i18n', RWMB_JS_URL . "select2/i18n/$locale.js", array( 'rwmb-select2' ), '4.0.2', true );
30
+ $dependencies[] = 'rwmb-select2-i18n';
31
+ }
32
+
33
+ wp_enqueue_script( 'rwmb-select-advanced', RWMB_JS_URL . 'select-advanced.js', $dependencies, RWMB_VER, true );
34
+ }
35
+
36
+ /**
37
+ * Normalize parameters for field.
38
+ *
39
+ * @param array $field Field parameters.
40
+ * @return array
41
+ */
42
+ public static function normalize( $field ) {
43
+ $field = wp_parse_args( $field, array(
44
+ 'js_options' => array(),
45
+ 'placeholder' => __( 'Select an item', 'meta-box' ),
46
+ ) );
47
+
48
+ $field = parent::normalize( $field );
49
+
50
+ $field['js_options'] = wp_parse_args( $field['js_options'], array(
51
+ 'allowClear' => true,
52
+ 'width' => 'none',
53
+ 'placeholder' => $field['placeholder'],
54
+ ) );
55
+
56
+ return $field;
57
+ }
58
+
59
+ /**
60
+ * Get the attributes for a field.
61
+ *
62
+ * @param array $field Field parameters.
63
+ * @param mixed $value Meta value.
64
+ * @return array
65
+ */
66
+ public static function get_attributes( $field, $value = null ) {
67
+ $attributes = parent::get_attributes( $field, $value );
68
+ $attributes = wp_parse_args( $attributes, array(
69
+ 'data-options' => wp_json_encode( $field['js_options'] ),
70
+ ) );
71
+
72
+ return $attributes;
73
+ }
74
+ }
 
 
inc/meta-box/inc/fields/select-tree.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The select tree field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Select tree field class.
10
+ */
11
+ class RWMB_Select_Tree_Field extends RWMB_Select_Field {
12
+ /**
13
+ * Walk options.
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @param mixed $options Select options.
17
+ * @param mixed $db_fields Database fields to use in the output.
18
+ * @param mixed $meta Meta value.
19
+ *
20
+ * @return string
21
+ */
22
+ public static function walk( $field, $options, $db_fields, $meta ) {
23
+ $walker = new RWMB_Walker_Select_Tree( $db_fields, $field, $meta );
24
+ return $walker->walk( $options );
25
+ }
26
+
27
+ /**
28
+ * Enqueue scripts and styles.
29
+ */
30
+ public static function admin_enqueue_scripts() {
31
+ parent::admin_enqueue_scripts();
32
+ wp_enqueue_style( 'rwmb-select-tree', RWMB_CSS_URL . 'select-tree.css', array( 'rwmb-select' ), RWMB_VER );
33
+ wp_enqueue_script( 'rwmb-select-tree', RWMB_JS_URL . 'select-tree.js', array( 'rwmb-select' ), RWMB_VER, true );
34
+ }
35
+
36
+ /**
37
+ * Normalize parameters for field.
38
+ *
39
+ * @param array $field Field parameters.
40
+ * @return array
41
+ */
42
+ public static function normalize( $field ) {
43
+ $field['multiple'] = true;
44
+ $field['size'] = 0;
45
+ $field = parent::normalize( $field );
46
+
47
+ return $field;
48
+ }
49
+
50
+ /**
51
+ * Get the attributes for a field.
52
+ *
53
+ * @param array $field Field parameters.
54
+ * @param mixed $value Meta value.
55
+ *
56
+ * @return array
57
+ */
58
+ public static function get_attributes( $field, $value = null ) {
59
+ $attributes = parent::get_attributes( $field, $value );
60
+ $attributes['multiple'] = false;
61
+ $attributes['id'] = false;
62
+
63
+ return $attributes;
64
+ }
65
+ }
inc/meta-box/inc/fields/select.php CHANGED
@@ -1,147 +1,92 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Select_Field' ) )
6
- {
7
- class RWMB_Select_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- wp_enqueue_style( 'rwmb-select', TX_RWMB_CSS_URL . 'select.css', array(), TX_RWMB_VER );
17
- }
18
-
19
- /**
20
- * Get field HTML
21
- *
22
- * @param mixed $meta
23
- * @param array $field
24
- *
25
- * @return string
26
- */
27
- static function html( $meta, $field )
28
- {
29
- $html = sprintf(
30
- '<select class="rwmb-select" name="%s" id="%s" size="%s"%s>',
31
- $field['field_name'],
32
- $field['id'],
33
- $field['size'],
34
- $field['multiple'] ? ' multiple="multiple"' : ''
35
- );
36
-
37
- $html .= self::options_html( $field, $meta );
38
-
39
- $html .= '</select>';
40
-
41
- return $html;
42
- }
43
-
44
- /**
45
- * Get meta value
46
- * If field is cloneable, value is saved as a single entry in DB
47
- * Otherwise value is saved as multiple entries (for backward compatibility)
48
- *
49
- * @see "save" method for better understanding
50
- *
51
- * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
52
- *
53
- * @param $post_id
54
- * @param $saved
55
- * @param $field
56
- *
57
- * @return array
58
- */
59
- static function meta( $post_id, $saved, $field )
60
- {
61
- $single = $field['clone'] || ! $field['multiple'];
62
- $meta = get_post_meta( $post_id, $field['id'], $single );
63
- $meta = ( ! $saved && '' === $meta || array() === $meta ) ? $field['std'] : $meta;
64
-
65
- $meta = array_map( 'esc_attr', (array) $meta );
66
-
67
- return $meta;
68
- }
69
-
70
- /**
71
- * Save meta value
72
- * If field is cloneable, value is saved as a single entry in DB
73
- * Otherwise value is saved as multiple entries (for backward compatibility)
74
- *
75
- * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
76
- *
77
- * @param $new
78
- * @param $old
79
- * @param $post_id
80
- * @param $field
81
- */
82
- static function save( $new, $old, $post_id, $field )
83
- {
84
- if ( ! $field['clone'] )
85
- {
86
- parent::save( $new, $old, $post_id, $field );
87
-
88
- return;
89
- }
90
-
91
- if ( empty( $new ) )
92
- delete_post_meta( $post_id, $field['id'] );
93
- else
94
- update_post_meta( $post_id, $field['id'], $new );
95
- }
96
-
97
- /**
98
- * Normalize parameters for field
99
- *
100
- * @param array $field
101
- *
102
- * @return array
103
- */
104
- static function normalize_field( $field )
105
- {
106
- $field = wp_parse_args( $field, array(
107
- 'desc' => '',
108
- 'name' => $field['id'],
109
- 'size' => $field['multiple'] ? 5 : 0,
110
- 'placeholder' => '',
111
- ) );
112
- if ( ! $field['clone'] && $field['multiple'] )
113
- $field['field_name'] .= '[]';
114
-
115
- return $field;
116
- }
117
-
118
- /**
119
- * Creates html for options
120
- *
121
- * @param array $field
122
- * @param mixed $meta
123
- *
124
- * @return array
125
- */
126
- static function options_html( $field, $meta )
127
- {
128
- $html = '';
129
- if ( $field['placeholder'] )
130
- $html = 'select' == $field['type'] ? "<option value=''>{$field['placeholder']}</option>" : '<option></option>';
131
-
132
- $option = '<option value="%s"%s>%s</option>';
133
-
134
- foreach ( $field['options'] as $value => $label )
135
- {
136
- $html .= sprintf(
137
- $option,
138
- $value,
139
- selected( in_array( $value, (array) $meta ), true, false ),
140
- $label
141
- );
142
- }
143
-
144
- return $html;
145
- }
146
- }
147
- }
1
+ <?php
2
+ /**
3
+ * The select field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Select field class.
10
+ */
11
+ class RWMB_Select_Field extends RWMB_Choice_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-select', RWMB_CSS_URL . 'select.css', array(), RWMB_VER );
17
+ wp_enqueue_script( 'rwmb-select', RWMB_JS_URL . 'select.js', array( 'jquery' ), RWMB_VER, true );
18
+ }
19
+
20
+ /**
21
+ * Walk options.
22
+ *
23
+ * @param array $field Field parameters.
24
+ * @param mixed $options Select options.
25
+ * @param mixed $db_fields Database fields to use in the output.
26
+ * @param mixed $meta Meta value.
27
+ *
28
+ * @return string
29
+ */
30
+ public static function walk( $field, $options, $db_fields, $meta ) {
31
+ $attributes = self::call( 'get_attributes', $field, $meta );
32
+ $attributes['data-selected'] = $meta;
33
+ $walker = new RWMB_Walker_Select( $db_fields, $field, $meta );
34
+ $output = sprintf(
35
+ '<select %s>',
36
+ self::render_attributes( $attributes )
37
+ );
38
+ if ( false === $field['multiple'] ) {
39
+ $output .= $field['placeholder'] ? '<option value="">' . esc_html( $field['placeholder'] ) . '</option>' : '';
40
+ }
41
+ $output .= $walker->walk( $options, $field['flatten'] ? - 1 : 0 );
42
+ $output .= '</select>';
43
+ $output .= self::get_select_all_html( $field );
44
+ return $output;
45
+ }
46
+
47
+ /**
48
+ * Normalize parameters for field.
49
+ *
50
+ * @param array $field Field parameters.
51
+ * @return array
52
+ */
53
+ public static function normalize( $field ) {
54
+ $field = parent::normalize( $field );
55
+ $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
56
+ $field = wp_parse_args( $field, array(
57
+ 'select_all_none' => false,
58
+ ) );
59
+
60
+ return $field;
61
+ }
62
+
63
+ /**
64
+ * Get the attributes for a field.
65
+ *
66
+ * @param array $field Field parameters.
67
+ * @param mixed $value Meta value.
68
+ *
69
+ * @return array
70
+ */
71
+ public static function get_attributes( $field, $value = null ) {
72
+ $attributes = parent::get_attributes( $field, $value );
73
+ $attributes = wp_parse_args( $attributes, array(
74
+ 'multiple' => $field['multiple'],
75
+ ) );
76
+
77
+ return $attributes;
78
+ }
79
+
80
+ /**
81
+ * Get html for select all|none for multiple select.
82
+ *
83
+ * @param array $field Field parameters.
84
+ * @return string
85
+ */
86
+ public static function get_select_all_html( $field ) {
87
+ if ( $field['multiple'] && $field['select_all_none'] ) {
88
+ return '<div class="rwmb-select-all-none">' . __( 'Select', 'meta-box' ) . ': <a data-type="all" href="#">' . __( 'All', 'meta-box' ) . '</a> | <a data-type="none" href="#">' . __( 'None', 'meta-box' ) . '</a></div>';
89
+ }
90
+ return '';
91
+ }
92
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/sidebar.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The sidebar select field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Sidebar field class.
10
+ */
11
+ class RWMB_Sidebar_Field extends RWMB_Object_Choice_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ *
17
+ * @return array
18
+ */
19
+ public static function normalize( $field ) {
20
+ // Set default field args.
21
+ $field = parent::normalize( $field );
22
+
23
+ // Prevent select tree for user since it's not hierarchical.
24
+ $field['field_type'] = 'select_tree' === $field['field_type'] ? 'select' : $field['field_type'];
25
+
26
+ // Set to always flat.
27
+ $field['flatten'] = true;
28
+
29
+ // Set default placeholder.
30
+ $field['placeholder'] = empty( $field['placeholder'] ) ? __( 'Select a sidebar', 'meta-box' ) : $field['placeholder'];
31
+
32
+ return $field;
33
+ }
34
+
35
+ /**
36
+ * Get users.
37
+ *
38
+ * @param array $field Field parameters.
39
+ *
40
+ * @return array
41
+ */
42
+ public static function get_options( $field ) {
43
+ global $wp_registered_sidebars;
44
+ $options = array();
45
+ foreach ( $wp_registered_sidebars as $sidebar ) {
46
+ $options[] = (object) $sidebar;
47
+ }
48
+ return $options;
49
+ }
50
+
51
+ /**
52
+ * Get field names of object to be used by walker.
53
+ *
54
+ * @return array
55
+ */
56
+ public static function get_db_fields() {
57
+ return array(
58
+ 'parent' => 'parent',
59
+ 'id' => 'id',
60
+ 'label' => 'name',
61
+ );
62
+ }
63
+
64
+ /**
65
+ * Get option label.
66
+ *
67
+ * @param array $field Field parameters.
68
+ * @param string $value Option value.
69
+ *
70
+ * @return string
71
+ */
72
+ public static function get_option_label( $field, $value ) {
73
+ if ( ! is_active_sidebar( $value ) ) {
74
+ return '';
75
+ }
76
+ ob_start();
77
+ dynamic_sidebar( $value );
78
+ return ob_get_clean();
79
+ }
80
+ }
inc/meta-box/inc/fields/single-image.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The advanced image upload field which uses WordPress media popup to upload and select images.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Image advanced field class.
10
+ */
11
+ class RWMB_Single_Image_Field extends RWMB_Image_Advanced_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ *
17
+ * @return array
18
+ */
19
+ public static function normalize( $field ) {
20
+ $field['max_file_uploads'] = 1;
21
+ $field['max_status'] = false;
22
+
23
+ $field = parent::normalize( $field );
24
+
25
+ $field['attributes'] = wp_parse_args( $field['attributes'], array(
26
+ 'class' => '',
27
+ 'data-single-image' => 1,
28
+ ) );
29
+
30
+ $field['attributes']['class'] .= ' rwmb-image_advanced';
31
+ $field['multiple'] = false;
32
+
33
+ return $field;
34
+ }
35
+
36
+ /**
37
+ * Get meta values to save.
38
+ *
39
+ * @param mixed $new The submitted meta value.
40
+ * @param mixed $old The existing meta value.
41
+ * @param int $post_id The post ID.
42
+ * @param array $field The field parameters.
43
+ *
44
+ * @return array|mixed
45
+ */
46
+ public static function value( $new, $old, $post_id, $field ) {
47
+ return $new;
48
+ }
49
+
50
+ /**
51
+ * Get the field value. Return meaningful info of the files.
52
+ *
53
+ * @param array $field Field parameters.
54
+ * @param array $args Not used for this field.
55
+ * @param int|null $post_id Post ID. null for current post. Optional.
56
+ *
57
+ * @return mixed Full info of uploaded files
58
+ */
59
+ public static function get_value( $field, $args = array(), $post_id = null ) {
60
+ $value = RWMB_Field::get_value( $field, $args, $post_id );
61
+ $return = RWMB_Image_Field::file_info( $value, $args );
62
+ return $return;
63
+ }
64
+ }
inc/meta-box/inc/fields/slider.php CHANGED
@@ -1,68 +1,68 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Slider_Field' ) )
6
- {
7
- class RWMB_Slider_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- $url = TX_RWMB_CSS_URL . 'jqueryui';
17
- wp_enqueue_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
18
- wp_enqueue_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
19
- wp_enqueue_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array(), '1.8.17' );
20
- wp_enqueue_style( 'rwmb-slider', TX_RWMB_CSS_URL . 'slider.css' );
21
-
22
- wp_enqueue_script( 'rwmb-slider', TX_RWMB_JS_URL . 'slider.js', array( 'jquery-ui-slider', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-core' ), TX_RWMB_VER, true );
23
- }
24
-
25
- /**
26
- * Get div HTML
27
- *
28
- * @param mixed $meta
29
- * @param array $field
30
- *
31
- * @return string
32
- */
33
- static function html( $meta, $field )
34
- {
35
- return sprintf(
36
- '<div class="clearfix">
37
- <div class="rwmb-slider" id="%s" data-options="%s"></div>
38
- <span class="rwmb-slider-value-label">%s<span>%s</span>%s</span>
39
- <input type="hidden" name="%s" value="%s" class="rwmb-slider-value">
40
- </div>',
41
- $field['id'], esc_attr( json_encode( $field['js_options'] ) ),
42
- $field['prefix'], $meta, $field['suffix'],
43
- $field['field_name'], $meta
44
- );
45
- }
46
-
47
- /**
48
- * Normalize parameters for field
49
- *
50
- * @param array $field
51
- *
52
- * @return array
53
- */
54
- static function normalize_field( $field )
55
- {
56
- $field = wp_parse_args( $field, array(
57
- 'prefix' => '',
58
- 'suffix' => '',
59
- 'js_options' => array(),
60
- ) );
61
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
62
- 'range' => 'min', // range = 'min' will add a dark background to sliding part, better UI
63
- ) );
64
-
65
- return $field;
66
- }
67
- }
68
- }
1
+ <?php
2
+ /**
3
+ * The slider field which users jQueryUI slider widget.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Slider field class.
10
+ */
11
+ class RWMB_Slider_Field extends RWMB_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ $url = RWMB_CSS_URL . 'jqueryui';
17
+ wp_enqueue_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
18
+ wp_enqueue_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
19
+ wp_enqueue_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array(), '1.8.17' );
20
+ wp_enqueue_style( 'rwmb-slider', RWMB_CSS_URL . 'slider.css' );
21
+
22
+ wp_enqueue_script( 'rwmb-slider', RWMB_JS_URL . 'slider.js', array( 'jquery-ui-slider', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-core' ), RWMB_VER, true );
23
+ }
24
+
25
+ /**
26
+ * Get div HTML.
27
+ *
28
+ * @param mixed $meta Meta value.
29
+ * @param array $field Field parameters.
30
+ *
31
+ * @return string
32
+ */
33
+ public static function html( $meta, $field ) {
34
+ return sprintf(
35
+ '<div class="clearfix">
36
+ <div class="rwmb-slider" id="%s" data-options="%s"></div>
37
+ <span class="rwmb-slider-value-label">%s<span>%s</span>%s</span>
38
+ <input type="hidden" name="%s" value="%s" class="rwmb-slider-value">
39
+ </div>',
40
+ $field['id'], esc_attr( wp_json_encode( $field['js_options'] ) ),
41
+ $field['prefix'], ( $meta >= 0 ) ? $meta : $field['std'], $field['suffix'],
42
+ $field['field_name'], ( $meta >= 0 ) ? $meta : $field['std']
43
+ );
44
+ }
45
+
46
+ /**
47
+ * Normalize parameters for field.
48
+ *
49
+ * @param array $field Field parameters.
50
+ *
51
+ * @return array
52
+ */
53
+ public static function normalize( $field ) {
54
+ $field = parent::normalize( $field );
55
+ $field = wp_parse_args( $field, array(
56
+ 'prefix' => '',
57
+ 'suffix' => '',
58
+ 'std' => '',
59
+ 'js_options' => array(),
60
+ ) );
61
+ $field['js_options'] = wp_parse_args( $field['js_options'], array(
62
+ 'range' => 'min', // range = 'min' will add a dark background to sliding part, better UI.
63
+ 'value' => $field['std'],
64
+ ) );
65
+
66
+ return $field;
67
+ }
68
+ }
inc/meta-box/inc/fields/switch.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Switch field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Switch field class.
10
+ */
11
+ class RWMB_Switch_Field extends RWMB_Input_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-switch', RWMB_CSS_URL . 'switch.css', '', RWMB_VER );
17
+ }
18
+
19
+ /**
20
+ * Get field HTML.
21
+ *
22
+ * @param mixed $meta Meta value.
23
+ * @param array $field Field parameters.
24
+ *
25
+ * @return string
26
+ */
27
+ public static function html( $meta, $field ) {
28
+ $attributes = self::get_attributes( $field, 1 );
29
+ $output = sprintf(
30
+ '<label class="rwmb-switch-label rwmb-switch-label--' . esc_attr( $field['style'] ) . '">
31
+ <input %s %s>
32
+ <div class="rwmb-switch-status">
33
+ <span class="rwmb-switch-slider"></span>
34
+ <span class="rwmb-switch-on">' . $field['on_label'] . '</span>
35
+ <span class="rwmb-switch-off">' . $field['off_label'] . '</span>
36
+ </div>
37
+ </label>
38
+ ',
39
+ self::render_attributes( $attributes ),
40
+ checked( ! empty( $meta ), 1, false )
41
+ );
42
+
43
+ return $output;
44
+ }
45
+
46
+ /**
47
+ * Normalize parameters for field.
48
+ *
49
+ * @param array $field Field parameters.
50
+ *
51
+ * @return array
52
+ */
53
+ public static function normalize( $field ) {
54
+ $field = parent::normalize( $field );
55
+ $field = wp_parse_args( $field, array(
56
+ 'style' => 'rounded',
57
+ 'on_label' => '',
58
+ 'off_label' => '',
59
+ ) );
60
+
61
+ return $field;
62
+ }
63
+
64
+ /**
65
+ * Get the attributes for a field.
66
+ *
67
+ * @param array $field The field parameters.
68
+ * @param mixed $value The attribute value.
69
+ *
70
+ * @return array
71
+ */
72
+ public static function get_attributes( $field, $value = null ) {
73
+ $attributes = parent::get_attributes( $field, $value );
74
+ $attributes['type'] = 'checkbox';
75
+
76
+ return $attributes;
77
+ }
78
+
79
+ /**
80
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
81
+ *
82
+ * @param array $field Field parameters.
83
+ * @param string $value The value.
84
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
85
+ * @param int|null $post_id Post ID. null for current post. Optional.
86
+ *
87
+ * @return string
88
+ */
89
+ public static function format_single_value( $field, $value, $args, $post_id ) {
90
+ $on = $field['on_label'] ? $field['on_label'] : __( 'On', 'meta-box' );
91
+ $off = $field['off_label'] ? $field['on_label'] : __( 'Off', 'meta-box' );
92
+ return $value ? $on : $off;
93
+ }
94
+ }
inc/meta-box/inc/fields/taxonomy-advanced.php CHANGED
@@ -1,62 +1,133 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
- require_once TX_RWMB_FIELDS_DIR . 'taxonomy.php';
5
-
6
- if ( ! class_exists( 'RWMB_Taxonomy_Advanced_Field' ) )
7
- {
8
- class RWMB_Taxonomy_Advanced_Field extends RWMB_Taxonomy_Field
9
- {
10
- /**
11
- * Get meta values to save
12
- * Save terms in custom field, no more by setting post terms
13
- * Save in form of comma-separated IDs
14
- *
15
- * @param mixed $new
16
- * @param mixed $old
17
- * @param int $post_id
18
- * @param array $field
19
- *
20
- * @return string
21
- */
22
- static function value( $new, $old, $post_id, $field )
23
- {
24
- return implode( ',', array_unique( $new ) );
25
- }
26
-
27
- /**
28
- * Save meta value
29
- *
30
- * @param mixed $new
31
- * @param mixed $old
32
- * @param int $post_id
33
- * @param array $field
34
- *
35
- * @return string
36
- */
37
- static function save( $new, $old, $post_id, $field )
38
- {
39
- if ( $new )
40
- update_post_meta( $post_id, $field['id'], $new );
41
- else
42
- delete_post_meta( $post_id, $field['id'] );
43
- }
44
-
45
- /**
46
- * Standard meta retrieval
47
- *
48
- * @param int $post_id
49
- * @param bool $saved
50
- * @param array $field
51
- *
52
- * @return array
53
- */
54
- static function meta( $post_id, $saved, $field )
55
- {
56
- $meta = get_post_meta( $post_id, $field['id'], true );
57
- $meta = array_map( 'intval', array_filter( explode( ',', $meta . ',' ) ) );
58
-
59
- return $meta;
60
- }
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Taxonomy advanced field which saves terms' IDs in the post meta in CSV format.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The taxonomy advanced field class.
10
+ */
11
+ class RWMB_Taxonomy_Advanced_Field extends RWMB_Taxonomy_Field {
12
+ /**
13
+ * Normalize the field parameters.
14
+ *
15
+ * @param array $field Field parameters.
16
+ *
17
+ * @return array
18
+ */
19
+ public static function normalize( $field ) {
20
+ $field = wp_parse_args( $field, array(
21
+ 'clone' => false,
22
+ ) );
23
+
24
+ $clone = $field['clone'];
25
+ $field = parent::normalize( $field );
26
+ $field['clone'] = $clone;
27
+
28
+ return $field;
29
+ }
30
+
31
+ /**
32
+ * Get meta values to save.
33
+ * Save terms in custom field in form of comma-separated IDs, no more by setting post terms.
34
+ *
35
+ * @param mixed $new The submitted meta value.
36
+ * @param mixed $old The existing meta value.
37
+ * @param int $post_id The post ID.
38
+ * @param array $field The field parameters.
39
+ *
40
+ * @return string
41
+ */
42
+ public static function value( $new, $old, $post_id, $field ) {
43
+ return implode( ',', array_unique( (array) $new ) );
44
+ }
45
+
46
+ /**
47
+ * Save meta value.
48
+ *
49
+ * @param mixed $new The submitted meta value.
50
+ * @param mixed $old The existing meta value.
51
+ * @param int $post_id The post ID.
52
+ * @param array $field The field parameters.
53
+ */
54
+ public static function save( $new, $old, $post_id, $field ) {
55
+ $storage = $field['storage'];
56
+
57
+ if ( $new ) {
58
+ $storage->update( $post_id, $field['id'], $new );
59
+ } else {
60
+ $storage->delete( $post_id, $field['id'] );
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Get raw meta value.
66
+ *
67
+ * @param int $object_id Object ID.
68
+ * @param array $field Field parameters.
69
+ * @param array $args Arguments of {@see rwmb_meta()} helper.
70
+ *
71
+ * @return mixed
72
+ */
73
+ public static function raw_meta( $object_id, $field, $args = array() ) {
74
+ $args['single'] = true;
75
+ $meta = RWMB_Field::raw_meta( $object_id, $field, $args );
76
+
77
+ if ( empty( $meta ) ) {
78
+ return $field['multiple'] ? array() : '';
79
+ }
80
+ $meta = is_array( $meta ) ? array_map( 'wp_parse_id_list', $meta ) : wp_parse_id_list( $meta );
81
+ $meta = array_filter( $meta );
82
+
83
+ return $meta;
84
+ }
85
+
86
+ /**
87
+ * Get the field value.
88
+ * Return list of post term objects.
89
+ *
90
+ * @param array $field Field parameters.
91
+ * @param array $args Additional arguments.
92
+ * @param int|null $post_id Post ID. null for current post. Optional.
93
+ *
94
+ * @return array List of post term objects.
95
+ */
96
+ public static function get_value( $field, $args = array(), $post_id = null ) {
97
+ $value = RWMB_Field::get_value( $field, $args, $post_id );
98
+ if ( ! $field['clone'] ) {
99
+ $value = self::call( 'terms_info', $field, $value, $args );
100
+ } else {
101
+ $return = array();
102
+ foreach ( $value as $subvalue ) {
103
+ $return[] = self::call( 'terms_info', $field, $subvalue, $args );
104
+ }
105
+ $value = $return;
106
+ }
107
+
108
+ return $value;
109
+ }
110
+
111
+ /**
112
+ * Get terms information.
113
+ *
114
+ * @param array $field Field parameters.
115
+ * @param string $term_ids Term IDs, in CSV format.
116
+ * @param array $args Additional arguments (for image size).
117
+ *
118
+ * @return array
119
+ */
120
+ public static function terms_info( $field, $term_ids, $args ) {
121
+ if ( empty( $term_ids ) ) {
122
+ return array();
123
+ }
124
+ $args = wp_parse_args( array(
125
+ 'include' => $term_ids,
126
+ 'hide_empty' => false,
127
+ ), $args );
128
+
129
+ $info = get_terms( $field['taxonomy'], $args );
130
+ $info = is_array( $info ) ? $info : array();
131
+ return $field['multiple'] ? $info : reset( $info );
132
+ }
133
+ }
inc/meta-box/inc/fields/taxonomy.php CHANGED
@@ -1,263 +1,174 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
- require_once TX_RWMB_FIELDS_DIR . 'select-advanced.php';
5
- require_once TX_RWMB_FIELDS_DIR . 'checkbox-list.php';
6
-
7
- if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
8
- {
9
- class RWMB_Taxonomy_Field extends RWMB_Field
10
- {
11
- /**
12
- * Enqueue scripts and styles
13
- *
14
- * @return void
15
- */
16
- static function admin_enqueue_scripts()
17
- {
18
- RWMB_Select_Advanced_Field::admin_enqueue_scripts();
19
- wp_enqueue_style( 'rwmb-taxonomy', TX_RWMB_CSS_URL . 'taxonomy.css', array(), TX_RWMB_VER );
20
- wp_enqueue_script( 'rwmb-taxonomy', TX_RWMB_JS_URL . 'taxonomy.js', array( 'jquery', 'rwmb-select-advanced', 'wp-ajax-response' ), TX_RWMB_VER, true );
21
- }
22
-
23
- /**
24
- * Add default value for 'taxonomy' field
25
- *
26
- * @param $field
27
- *
28
- * @return array
29
- */
30
- static function normalize_field( $field )
31
- {
32
- $default_args = array(
33
- 'hide_empty' => false,
34
- );
35
-
36
- // Set default args
37
- $field['options']['args'] = ! isset( $field['options']['args'] ) ? $default_args : wp_parse_args( $field['options']['args'], $default_args );
38
-
39
- $tax = get_taxonomy( $field['options']['taxonomy'] );
40
- $field['placeholder'] = empty( $field['placeholder'] ) ? sprintf( __( 'Select a %s', 'meta-box' ), $tax->labels->singular_name ) : $field['placeholder'];
41
-
42
- switch ( $field['options']['type'] )
43
- {
44
- case 'select_advanced':
45
- $field = RWMB_Select_Advanced_Field::normalize_field( $field );
46
- break;
47
- case 'checkbox_list':
48
- case 'checkbox_tree':
49
- $field = RWMB_Checkbox_List_Field::normalize_field( $field );
50
- break;
51
- case 'select':
52
- case 'select_tree':
53
- $field = RWMB_Select_Field::normalize_field( $field );
54
- break;
55
- default:
56
- $field['options']['type'] = 'select';
57
- $field = RWMB_Select_Field::normalize_field( $field );
58
- }
59
-
60
- if ( in_array( $field['options']['type'], array( 'checkbox_tree', 'select_tree' ) ) )
61
- {
62
- if ( isset( $field['options']['args']['parent'] ) )
63
- {
64
- $field['options']['parent'] = $field['options']['args']['parent'];
65
- unset( $field['options']['args']['parent'] );
66
- }
67
- else
68
- {
69
- $field['options']['parent'] = 0;
70
- }
71
- }
72
-
73
- $field['field_name'] = "{$field['id']}[]";
74
-
75
- return $field;
76
- }
77
-
78
- /**
79
- * Get field HTML
80
- *
81
- * @param $field
82
- * @param $meta
83
- *
84
- * @return string
85
- */
86
- static function html( $meta, $field )
87
- {
88
- $options = $field['options'];
89
- $terms = get_terms( $options['taxonomy'], $options['args'] );
90
-
91
- $field['options'] = self::get_options( $terms );
92
-
93
- $html = '';
94
-
95
- switch ( $options['type'] )
96
- {
97
- case 'checkbox_list':
98
- $html = RWMB_Checkbox_List_Field::html( $meta, $field );
99
- break;
100
- case 'checkbox_tree':
101
- $elements = self::process_terms( $terms );
102
- $html .= self::walk_checkbox_tree( $meta, $field, $elements, $options['parent'], true );
103
- break;
104
- case 'select_tree':
105
- $elements = self::process_terms( $terms );
106
- $html .= self::walk_select_tree( $meta, $field, $elements, $options['parent'], true );
107
- break;
108
- case 'select_advanced':
109
- $html = RWMB_Select_Advanced_Field::html( $meta, $field );
110
- break;
111
- case 'select':
112
- default:
113
- $html = RWMB_Select_Field::html( $meta, $field );
114
- }
115
-
116
- return $html;
117
- }
118
-
119
- /**
120
- * Walker for displaying checkboxes in tree format
121
- *
122
- * @param $meta
123
- * @param $field
124
- * @param $elements
125
- * @param int $parent
126
- * @param bool $active
127
- *
128
- * @return string
129
- */
130
- static function walk_checkbox_tree( $meta, $field, $elements, $parent = 0, $active = false )
131
- {
132
- if ( ! isset( $elements[$parent] ) )
133
- return;
134
- $terms = $elements[$parent];
135
- $field['options'] = self::get_options( $terms );
136
- $hidden = $active ? '' : 'hidden';
137
-
138
- $html = "<ul class = 'rw-taxonomy-tree {$hidden}'>";
139
- $li = '<li><label><input type="checkbox" name="%s" value="%s"%s> %s</label>';
140
- foreach ( $terms as $term )
141
- {
142
- $html .= sprintf(
143
- $li,
144
- $field['field_name'],
145
- $term->term_id,
146
- checked( in_array( $term->term_id, $meta ), true, false ),
147
- $term->name
148
- );
149
- $html .= self::walk_checkbox_tree( $meta, $field, $elements, $term->term_id, $active && in_array( $term->term_id, $meta ) ) . '</li>';
150
- }
151
- $html .= '</ul>';
152
-
153
- return $html;
154
- }
155
-
156
- /**
157
- * Walker for displaying select in tree format
158
- *
159
- * @param $meta
160
- * @param $field
161
- * @param $elements
162
- * @param int $parent
163
- * @param bool $active
164
- *
165
- * @return string
166
- */
167
- static function walk_select_tree( $meta, $field, $elements, $parent = 0, $active = false )
168
- {
169
- if ( ! isset( $elements[$parent] ) )
170
- return;
171
- $terms = $elements[$parent];
172
- $field['options'] = self::get_options( $terms );
173
-
174
- $classes = array( 'rw-taxonomy-tree' );
175
- $classes[] = $active ? 'active' : 'disabled';
176
- $classes[] = "rwmb-taxonomy-{$parent}";
177
-
178
- $html = '<div class="' . implode( ' ', $classes ) . '">';
179
- $html .= RWMB_Select_Field::html( $meta, $field );
180
- foreach ( $terms as $term )
181
- {
182
- $html .= self::walk_select_tree( $meta, $field, $elements, $term->term_id, $active && in_array( $term->term_id, $meta ) );
183
- }
184
- $html .= '</div>';
185
-
186
- return $html;
187
- }
188
-
189
- /**
190
- * Processes terms into indexed array for walker functions
191
- *
192
- * @param $terms
193
- *
194
- * @internal param $field
195
- * @return array
196
- */
197
- static function process_terms( $terms )
198
- {
199
- $elements = array();
200
- foreach ( $terms as $term )
201
- {
202
- $elements[$term->parent][] = $term;
203
- }
204
-
205
- return $elements;
206
- }
207
-
208
- /**
209
- * Get options for selects, checkbox list, etc via the terms
210
- *
211
- * @param array $terms Array of term objects
212
- *
213
- * @return array
214
- */
215
- static function get_options( $terms = array() )
216
- {
217
- $options = array();
218
- foreach ( $terms as $term )
219
- {
220
- $options[$term->term_id] = $term->name;
221
- }
222
-
223
- return $options;
224
- }
225
-
226
- /**
227
- * Save meta value
228
- *
229
- * @param mixed $new
230
- * @param mixed $old
231
- * @param int $post_id
232
- * @param array $field
233
- *
234
- * @return string
235
- */
236
- static function save( $new, $old, $post_id, $field )
237
- {
238
- $new = array_unique( array_map( 'intval', (array) $new ) );
239
- $new = empty( $new ) ? null : $new;
240
- wp_set_object_terms( $post_id, $new, $field['options']['taxonomy'] );
241
- }
242
-
243
- /**
244
- * Standard meta retrieval
245
- *
246
- * @param int $post_id
247
- * @param bool $saved
248
- * @param array $field
249
- *
250
- * @return array
251
- */
252
- static function meta( $post_id, $saved, $field )
253
- {
254
- $options = $field['options'];
255
-
256
- $meta = wp_get_post_terms( $post_id, $options['taxonomy'] );
257
- $meta = is_array( $meta ) ? $meta : (array) $meta;
258
- $meta = wp_list_pluck( $meta, 'term_id' );
259
-
260
- return $meta;
261
- }
262
- }
263
- }
1
+ <?php
2
+ /**
3
+ * The taxonomy field which aims to replace the built-in WordPress taxonomy UI with more options.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Taxonomy field class which set post terms when saving.
10
+ */
11
+ class RWMB_Taxonomy_Field extends RWMB_Object_Choice_Field {
12
+ /**
13
+ * Add default value for 'taxonomy' field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @return array
17
+ */
18
+ public static function normalize( $field ) {
19
+ // Backwards compatibility with field args.
20
+ if ( isset( $field['options']['args'] ) ) {
21
+ $field['query_args'] = $field['options']['args'];
22
+ }
23
+ if ( isset( $field['options']['taxonomy'] ) ) {
24
+ $field['taxonomy'] = $field['options']['taxonomy'];
25
+ }
26
+ if ( isset( $field['options']['type'] ) ) {
27
+ $field['field_type'] = $field['options']['type'];
28
+ }
29
+
30
+ // Set default field args.
31
+ $field = wp_parse_args( $field, array(
32
+ 'taxonomy' => 'category',
33
+ ) );
34
+
35
+ // Force taxonomy to be an array.
36
+ $field['taxonomy'] = (array) $field['taxonomy'];
37
+
38
+ /*
39
+ * Set default placeholder:
40
+ * - If multiple taxonomies: show 'Select a term'.
41
+ * - If single taxonomy: show 'Select a %taxonomy_name%'.
42
+ */
43
+ $placeholder = __( 'Select a term', 'meta-box' );
44
+ if ( 1 === count( $field['taxonomy'] ) ) {
45
+ $taxonomy = reset( $field['taxonomy'] );
46
+ $taxonomy_object = get_taxonomy( $taxonomy );
47
+ if ( false !== $taxonomy_object ) {
48
+ // Translators: %s is the taxonomy singular label.
49
+ $placeholder = sprintf( __( 'Select a %s', 'meta-box' ), strtolower( $taxonomy_object->labels->singular_name ) );
50
+ }
51
+ }
52
+ $field = wp_parse_args( $field, array(
53
+ 'placeholder' => $placeholder,
54
+ ) );
55
+ $field = parent::normalize( $field );
56
+
57
+ // Set default query args.
58
+ $field['query_args'] = wp_parse_args( $field['query_args'], array(
59
+ 'hide_empty' => false,
60
+ ) );
61
+
62
+ // Prevent cloning for taxonomy field.
63
+ $field['clone'] = false;
64
+
65
+ return $field;
66
+ }
67
+
68
+ /**
69
+ * Get field names of object to be used by walker.
70
+ *
71
+ * @return array
72
+ */
73
+ public static function get_db_fields() {
74
+ return array(
75
+ 'parent' => 'parent',
76
+ 'id' => 'term_id',
77
+ 'label' => 'name',
78
+ );
79
+ }
80
+
81
+ /**
82
+ * Get options for selects, checkbox list, etc via the terms.
83
+ *
84
+ * @param array $field Field parameters.
85
+ *
86
+ * @return array
87
+ */
88
+ public static function get_options( $field ) {
89
+ $options = get_terms( $field['taxonomy'], $field['query_args'] );
90
+ return $options;
91
+ }
92
+
93
+ /**
94
+ * Save meta value.
95
+ *
96
+ * @param mixed $new The submitted meta value.
97
+ * @param mixed $old The existing meta value.
98
+ * @param int $post_id The post ID.
99
+ * @param array $field The field parameters.
100
+ */
101
+ public static function save( $new, $old, $post_id, $field ) {
102
+ $new = array_unique( array_map( 'intval', (array) $new ) );
103
+ $new = empty( $new ) ? null : $new;
104
+
105
+ foreach ( $field['taxonomy'] as $taxonomy ) {
106
+ wp_set_object_terms( $post_id, $new, $taxonomy );
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Get raw meta value.
112
+ *
113
+ * @param int $object_id Object ID.
114
+ * @param array $field Field parameters.
115
+ * @param array $args Arguments of {@see rwmb_meta()} helper.
116
+ *
117
+ * @return mixed
118
+ */
119
+ public static function raw_meta( $object_id, $field, $args = array() ) {
120
+ if ( empty( $field['id'] ) ) {
121
+ return '';
122
+ }
123
+
124
+ $meta = wp_get_object_terms( $object_id, $field['taxonomy'], array(
125
+ 'orderby' => 'term_order',
126
+ ) );
127
+ $meta = wp_list_pluck( $meta, 'term_id' );
128
+
129
+ return $field['multiple'] ? $meta : reset( $meta );
130
+ }
131
+
132
+ /**
133
+ * Get the field value.
134
+ * Return list of post term objects.
135
+ *
136
+ * @param array $field Field parameters.
137
+ * @param array $args Additional arguments.
138
+ * @param int|null $post_id Post ID. null for current post. Optional.
139
+ *
140
+ * @return array List of post term objects.
141
+ */
142
+ public static function get_value( $field, $args = array(), $post_id = null ) {
143
+ if ( ! $post_id ) {
144
+ $post_id = get_the_ID();
145
+ }
146
+ $value = wp_get_object_terms( $post_id, $field['taxonomy'], array(
147
+ 'orderby' => 'term_order',
148
+ ) );
149
+
150
+ // Get single value if necessary.
151
+ if ( ! $field['clone'] && ! $field['multiple'] && is_array( $value ) ) {
152
+ $value = reset( $value );
153
+ }
154
+ return $value;
155
+ }
156
+
157
+ /**
158
+ * Get option label.
159
+ *
160
+ * @param array $field Field parameters.
161
+ * @param object $value The term object.
162
+ *
163
+ * @return string
164
+ */
165
+ public static function get_option_label( $field, $value ) {
166
+ return sprintf(
167
+ '<a href="%s" title="%s">%s</a>',
168
+ // @codingStandardsIgnoreLine
169
+ esc_url( get_term_link( $value ) ),
170
+ esc_attr( $value->name ),
171
+ $value->name
172
+ );
173
+ }
174
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/text-list.php CHANGED
@@ -1,109 +1,124 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
 
 
 
4
 
5
- if ( ! class_exists( 'RWMB_Text_List_Field' ) )
6
- {
7
- class RWMB_Text_List_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- $html = '';
20
- $input = '<label><input type="text" class="rwmb-text-list" name="%s" id="%s" value="%s" placeholder="%s" /> %s</label>';
21
-
22
- $i = 0;
23
- foreach ( $field['options'] as $value => $label )
24
- {
25
- $html .= sprintf(
26
- $input,
27
- $field['field_name'],
28
- $field['id'],
29
- $meta[$i],
30
- $value,
31
- $label
32
- );
33
- $i ++;
34
- }
35
 
36
- return $html;
 
 
 
 
 
 
 
 
 
 
37
  }
 
 
38
 
39
- /**
40
- * Get meta value
41
- * If field is cloneable, value is saved as a single entry in DB
42
- * Otherwise value is saved as multiple entries (for backward compatibility)
43
- *
44
- * @see "save" method for better understanding
45
- *
46
- * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
47
- *
48
- * @param $post_id
49
- * @param $saved
50
- * @param $field
51
- *
52
- * @return array
53
- */
54
- static function meta( $post_id, $saved, $field )
55
- {
56
- $single = $field['clone'] || ! $field['multiple'];
57
- $meta = get_post_meta( $post_id, $field['id'], $single );
58
- $meta = ( ! $saved && '' === $meta || array() === $meta ) ? $field['std'] : $meta;
59
 
60
- $meta = array_map( 'esc_attr', (array) $meta );
 
61
 
62
- return $meta;
 
 
 
 
 
 
 
 
 
 
63
  }
 
 
64
 
65
- /**
66
- * Save meta value
67
- * If field is cloneable, value is saved as a single entry in DB
68
- * Otherwise value is saved as multiple entries (for backward compatibility)
69
- *
70
- * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
71
- *
72
- * @param $new
73
- * @param $old
74
- * @param $post_id
75
- * @param $field
76
- */
77
- static function save( $new, $old, $post_id, $field )
78
- {
79
- if ( ! $field['clone'] )
80
- {
81
- parent::save( $new, $old, $post_id, $field );
82
 
83
- return;
 
 
 
 
84
  }
85
-
86
- if ( empty( $new ) )
87
- delete_post_meta( $post_id, $field['id'] );
88
- else
89
- update_post_meta( $post_id, $field['id'], $new );
90
  }
 
 
 
91
 
92
- /**
93
- * Normalize parameters for field
94
- *
95
- * @param array $field
96
- *
97
- * @return array
98
- */
99
- static function normalize_field( $field )
100
- {
101
- $field['multiple'] = true;
102
- $field['field_name'] = $field['id'];
103
- if ( ! $field['clone'] )
104
- $field['field_name'] .= '[]';
105
-
106
- return $field;
107
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  }
109
  }
1
  <?php
2
+ /**
3
+ * The text list field which allows users to enter multiple texts.
4
+ *
5
+ * @package Meta Box
6
+ */
7
 
8
+ /**
9
+ * Text list field class.
10
+ */
11
+ class RWMB_Text_List_Field extends RWMB_Multiple_Values_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-text-list', RWMB_CSS_URL . 'text-list.css', '', RWMB_VER );
17
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
+ /**
20
+ * Get field HTML.
21
+ *
22
+ * @param mixed $meta Meta value.
23
+ * @param array $field Field parameters.
24
+ *
25
+ * @return string
26
+ */
27
+ public static function html( $meta, $field ) {
28
+ if ( empty( $field['options'] ) ) {
29
+ return '';
30
  }
31
+ $html = array();
32
+ $input = '<label><span class="rwmb-text-list-label">%s</span> <input type="text" class="rwmb-text-list" name="%s" value="%s" placeholder="%s"></label>';
33
 
34
+ $count = 0;
35
+ foreach ( $field['options'] as $placeholder => $label ) {
36
+ $html[] = sprintf(
37
+ $input,
38
+ $label,
39
+ $field['field_name'],
40
+ isset( $meta[ $count ] ) ? esc_attr( $meta[ $count ] ) : '',
41
+ $placeholder
42
+ );
43
+ $count ++;
44
+ }
 
 
 
 
 
 
 
 
 
45
 
46
+ return implode( ' ', $html );
47
+ }
48
 
49
+ /**
50
+ * Normalize parameters for field.
51
+ *
52
+ * @param array $field Field parameters.
53
+ *
54
+ * @return array
55
+ */
56
+ public static function normalize( $field ) {
57
+ $field = parent::normalize( $field );
58
+ if ( ! $field['clone'] ) {
59
+ $field['class'] .= ' rwmb-text_list-non-cloneable';
60
  }
61
+ return $field;
62
+ }
63
 
64
+ /**
65
+ * Format value for the helper functions.
66
+ *
67
+ * @param array $field Field parameters.
68
+ * @param string|array $value The field meta value.
69
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
70
+ * @param int|null $post_id Post ID. null for current post. Optional.
71
+ *
72
+ * @return string
73
+ */
74
+ public static function format_value( $field, $value, $args, $post_id ) {
75
+ $output = '<table><thead><tr>';
76
+ foreach ( $field['options'] as $label ) {
77
+ $output .= "<th>$label</th>";
78
+ }
79
+ $output .= '</tr></thead><tbody>';
 
80
 
81
+ if ( ! $field['clone'] ) {
82
+ $output .= self::format_single_value( $field, $value, $args, $post_id );
83
+ } else {
84
+ foreach ( $value as $subvalue ) {
85
+ $output .= self::format_single_value( $field, $subvalue, $args, $post_id );
86
  }
 
 
 
 
 
87
  }
88
+ $output .= '</tbody></table>';
89
+ return $output;
90
+ }
91
 
92
+ /**
93
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
94
+ *
95
+ * @param array $field Field parameters.
96
+ * @param array $value The value.
97
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
98
+ * @param int|null $post_id Post ID. null for current post. Optional.
99
+ *
100
+ * @return string
101
+ */
102
+ public static function format_single_value( $field, $value, $args, $post_id ) {
103
+ $output = '<tr>';
104
+ foreach ( $value as $subvalue ) {
105
+ $output .= "<td>$subvalue</td>";
 
106
  }
107
+ $output .= '</tr>';
108
+ return $output;
109
+ }
110
+
111
+ /**
112
+ * Save meta value.
113
+ *
114
+ * @param mixed $new The submitted meta value.
115
+ * @param mixed $old The existing meta value.
116
+ * @param int $post_id The post ID.
117
+ * @param array $field The field parameters.
118
+ */
119
+ public static function save( $new, $old, $post_id, $field ) {
120
+ $storage = $field['storage'];
121
+ $storage->delete( $post_id, $field['id'] );
122
+ parent::save( $new, array(), $post_id, $field );
123
  }
124
  }
inc/meta-box/inc/fields/text.php CHANGED
@@ -1,77 +1,49 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Text_Field' ) )
6
- {
7
- class RWMB_Text_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- return sprintf(
20
- '<input type="text" class="rwmb-text" name="%s" id="%s" value="%s" placeholder="%s" size="%s" %s>%s',
21
- $field['field_name'],
22
- $field['id'],
23
- $meta,
24
- $field['placeholder'],
25
- $field['size'],
26
- $field['datalist'] ? "list='{$field['datalist']['id']}'" : '',
27
- self::datalist_html( $field )
28
- );
29
- }
30
-
31
- /**
32
- * Normalize parameters for field
33
- *
34
- * @param array $field
35
- *
36
- * @return array
37
- */
38
- static function normalize_field( $field )
39
- {
40
- $field = wp_parse_args( $field, array(
41
- 'size' => 30,
42
- 'datalist' => false,
43
- 'placeholder' => '',
44
- ) );
45
-
46
- return $field;
47
- }
48
-
49
- /**
50
- * Create datalist, if any
51
- *
52
- * @param array $field
53
- *
54
- * @return array
55
- */
56
- static function datalist_html( $field )
57
- {
58
- if ( ! $field['datalist'] )
59
- return '';
60
-
61
- $datalist = $field['datalist'];
62
- $html = sprintf(
63
- '<datalist id="%s">',
64
- $datalist['id']
65
- );
66
-
67
- foreach ( $datalist['options'] as $option )
68
- {
69
- $html .= sprintf( '<option value="%s"></option>', $option );
70
- }
71
-
72
- $html .= '</datalist>';
73
 
74
- return $html;
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }
77
  }
1
  <?php
2
+ /**
3
+ * The text field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Text field class.
10
+ */
11
+ class RWMB_Text_Field extends RWMB_Input_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @return array
17
+ */
18
+ public static function normalize( $field ) {
19
+ $field = parent::normalize( $field );
20
+
21
+ $field = wp_parse_args( $field, array(
22
+ 'size' => 30,
23
+ 'maxlength' => false,
24
+ 'pattern' => false,
25
+ ) );
26
+
27
+ return $field;
28
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
+ /**
31
+ * Get the attributes for a field.
32
+ *
33
+ * @param array $field Field parameters.
34
+ * @param mixed $value Meta value.
35
+ *
36
+ * @return array
37
+ */
38
+ public static function get_attributes( $field, $value = null ) {
39
+ $attributes = parent::get_attributes( $field, $value );
40
+ $attributes = wp_parse_args( $attributes, array(
41
+ 'size' => $field['size'],
42
+ 'maxlength' => $field['maxlength'],
43
+ 'pattern' => $field['pattern'],
44
+ 'placeholder' => $field['placeholder'],
45
+ ) );
46
+
47
+ return $attributes;
48
  }
49
  }
inc/meta-box/inc/fields/textarea.php CHANGED
@@ -1,47 +1,82 @@
1
  <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
 
 
 
4
 
5
- if ( ! class_exists( 'RWMB_Textarea_Field' ) )
6
- {
7
- class RWMB_Textarea_Field extends RWMB_Field
8
- {
9
- /**
10
- * Get field HTML
11
- *
12
- * @param mixed $meta
13
- * @param array $field
14
- *
15
- * @return string
16
- */
17
- static function html( $meta, $field )
18
- {
19
- return sprintf(
20
- '<textarea class="rwmb-textarea large-text" name="%s" id="%s" cols="%s" rows="%s" placeholder="%s">%s</textarea>',
21
- $field['field_name'],
22
- $field['id'],
23
- $field['cols'],
24
- $field['rows'],
25
- $field['placeholder'],
26
- $meta
27
- );
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
- /**
31
- * Normalize parameters for field
32
- *
33
- * @param array $field
34
- *
35
- * @return array
36
- */
37
- static function normalize_field( $field )
38
- {
39
- $field = wp_parse_args( $field, array(
40
- 'cols' => 60,
41
- 'rows' => 3,
42
- ) );
 
 
 
 
 
 
 
43
 
44
- return $field;
45
- }
46
  }
47
  }
1
  <?php
2
+ /**
3
+ * The textarea field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
 
8
+ /**
9
+ * Textarea field class.
10
+ */
11
+ class RWMB_Textarea_Field extends RWMB_Field {
12
+ /**
13
+ * Get field HTML.
14
+ *
15
+ * @param mixed $meta Meta value.
16
+ * @param array $field Field parameters.
17
+ *
18
+ * @return string
19
+ */
20
+ public static function html( $meta, $field ) {
21
+ $attributes = self::get_attributes( $field, $meta );
22
+ return sprintf(
23
+ '<textarea %s>%s</textarea>',
24
+ self::render_attributes( $attributes ),
25
+ $meta
26
+ );
27
+ }
28
+
29
+ /**
30
+ * Escape meta for field output.
31
+ *
32
+ * @param mixed $meta Meta value.
33
+ * @return mixed
34
+ */
35
+ public static function esc_meta( $meta ) {
36
+ return is_array( $meta ) ? array_map( 'esc_textarea', $meta ) : esc_textarea( $meta );
37
+ }
38
+
39
+ /**
40
+ * Normalize parameters for field.
41
+ *
42
+ * @param array $field Field parameters.
43
+ * @return array
44
+ */
45
+ public static function normalize( $field ) {
46
+ $field = parent::normalize( $field );
47
+ $field = wp_parse_args( $field, array(
48
+ 'autocomplete' => false,
49
+ 'cols' => 60,
50
+ 'rows' => 3,
51
+ 'maxlength' => false,
52
+ 'wrap' => false,
53
+ 'readonly' => false,
54
+ ) );
55
+
56
+ return $field;
57
+ }
58
 
59
+ /**
60
+ * Get the attributes for a field.
61
+ *
62
+ * @param array $field Field parameters.
63
+ * @param mixed $value Meta value.
64
+ *
65
+ * @return array
66
+ */
67
+ public static function get_attributes( $field, $value = null ) {
68
+ $attributes = parent::get_attributes( $field, $value );
69
+ $attributes = wp_parse_args( $attributes, array(
70
+ 'autocomplete' => $field['autocomplete'],
71
+ 'cols' => $field['cols'],
72
+ 'rows' => $field['rows'],
73
+ 'maxlength' => $field['maxlength'],
74
+ 'wrap' => $field['wrap'],
75
+ 'readonly' => $field['readonly'],
76
+ 'placeholder' => $field['placeholder'],
77
+ ) );
78
+ $attributes['class'] .= ' large-text';
79
 
80
+ return $attributes;
 
81
  }
82
  }
inc/meta-box/inc/fields/thickbox-image.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Thickbox_Image_Field' ) )
6
- {
7
- class RWMB_Thickbox_Image_Field extends RWMB_Image_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- parent::admin_enqueue_scripts();
17
-
18
- add_thickbox();
19
- wp_enqueue_script( 'media-upload' );
20
-
21
- wp_enqueue_script( 'rwmb-thickbox-image', TX_RWMB_JS_URL . 'thickbox-image.js', array( 'jquery' ), TX_RWMB_VER, true );
22
- }
23
-
24
- /**
25
- * Get field HTML
26
- *
27
- * @param mixed $meta
28
- * @param array $field
29
- *
30
- * @return string
31
- */
32
- static function html( $meta, $field )
33
- {
34
- $i18n_title = apply_filters( 'rwmb_thickbox_image_upload_string', _x( 'Upload Images', 'image upload', 'meta-box' ), $field );
35
-
36
- // Uploaded images
37
- $html = self::get_uploaded_images( $meta, $field );
38
-
39
- // Show form upload
40
- $html .= "<a href='#' class='button rwmb-thickbox-upload' data-field_id='{$field['id']}'>{$i18n_title}</a>";
41
-
42
- return $html;
43
- }
44
-
45
- /**
46
- * Get field value
47
- * It's the combination of new (uploaded) images and saved images
48
- *
49
- * @param array $new
50
- * @param array $old
51
- * @param int $post_id
52
- * @param array $field
53
- *
54
- * @return array|mixed
55
- */
56
- static function value( $new, $old, $post_id, $field )
57
- {
58
- return array_unique( array_merge( $old, $new ) );
59
- }
60
- }
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/time.php CHANGED
@@ -1,91 +1,32 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Time_Field' ) )
6
- {
7
- class RWMB_Time_Field extends RWMB_Field
8
- {
9
- /**
10
- * Enqueue scripts and styles
11
- *
12
- * @return void
13
- */
14
- static function admin_enqueue_scripts()
15
- {
16
- $url = TX_RWMB_CSS_URL . 'jqueryui';
17
- wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
18
- wp_register_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
19
- wp_register_style( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
20
- wp_register_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
21
- wp_enqueue_style( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7' );
22
-
23
- $url = TX_RWMB_JS_URL . 'jqueryui';
24
- wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
25
- $deps = array( 'jquery-ui-timepicker' );
26
-
27
- $locale = str_replace( '_', '-', get_locale() );
28
- $timepicker_locale_js_url = '';
29
- if ( file_exists( RWMB_DIR . "js/jqueryui/timepicker-i18n/jquery-ui-timepicker-{$locale}.js" ) )
30
- {
31
- $timepicker_locale_js_url = "{$url}/timepicker-i18n/jquery-ui-timepicker-{$locale}.js";
32
- }
33
- elseif ( strlen( $locale ) > 2 && file_exists( RWMB_DIR . 'js/jqueryui/timepicker-i18n/jquery-ui-timepicker-' . substr( $locale, 0, 2 ) . '.js' ) )
34
- {
35
- $timepicker_locale_js_url = "{$url}/timepicker-i18n/jquery-ui-timepicker-" . substr( $locale, 0, 2 ) . '.js';
36
- }
37
- if ( $timepicker_locale_js_url )
38
- {
39
- wp_register_script( 'jquery-ui-timepicker-i18n', $timepicker_locale_js_url, array( 'jquery-ui-timepicker' ), '0.9.7', true );
40
- $deps = array( 'jquery-ui-timepicker-i18n' );
41
- }
42
-
43
- wp_enqueue_script( 'rwmb-time', TX_RWMB_JS_URL . 'time.js', $deps, TX_RWMB_VER, true );
44
- wp_localize_script( 'rwmb-time', 'RWMB_Timepicker', array( 'lang' => $locale ) );
45
- }
46
-
47
- /**
48
- * Get field HTML
49
- *
50
- * @param mixed $meta
51
- * @param array $field
52
- *
53
- * @return string
54
- */
55
- static function html( $meta, $field )
56
- {
57
- return sprintf(
58
- '<input type="text" class="rwmb-time" name="%s" value="%s" id="%s" size="%s" data-options="%s" />',
59
- $field['field_name'],
60
- $meta,
61
- isset( $field['clone'] ) && $field['clone'] ? '' : $field['id'],
62
- $field['size'],
63
- esc_attr( json_encode( $field['js_options'] ) )
64
- );
65
- }
66
-
67
- /**
68
- * Normalize parameters for field
69
- *
70
- * @param array $field
71
- *
72
- * @return array
73
- */
74
- static function normalize_field( $field )
75
- {
76
- $field = wp_parse_args( $field, array(
77
- 'size' => 30,
78
- 'js_options' => array(),
79
- ) );
80
-
81
- // Deprecate 'format', but keep it for backward compatible
82
- // Use 'js_options' instead
83
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
84
- 'showButtonPanel' => true,
85
- 'timeFormat' => empty( $field['format'] ) ? 'hh:mm:ss' : $field['format'],
86
- ) );
87
-
88
- return $field;
89
- }
90
- }
91
- }
1
+ <?php
2
+ /**
3
+ * The time picker field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Time field class.
10
+ */
11
+ class RWMB_Time_Field extends RWMB_Datetime_Field {
12
+ /**
13
+ * Enqueue scripts and styles.
14
+ */
15
+ public static function admin_enqueue_scripts() {
16
+ parent::admin_register_scripts();
17
+ wp_enqueue_style( 'jquery-ui-timepicker' );
18
+ wp_enqueue_script( 'rwmb-time' );
19
+ }
20
+
21
+ /**
22
+ * Normalize parameters for field.
23
+ *
24
+ * @param array $field Field parameters.
25
+ * @return array
26
+ */
27
+ public static function normalize( $field ) {
28
+ $field = parent::normalize( $field );
29
+ $field['js_options']['timeFormat'] = empty( $field['format'] ) ? $field['js_options']['timeFormat'] : $field['format'];
30
+ return $field;
31
+ }
32
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/url.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- // Make sure "text" field is loaded
6
- require_once TX_RWMB_FIELDS_DIR . 'text.php';
7
-
8
- if ( ! class_exists( 'RWMB_URL_Field' ) )
9
- {
10
- class RWMB_URL_Field extends RWMB_Text_Field
11
- {
12
- /**
13
- * Get field HTML
14
- *
15
- * @param mixed $meta
16
- * @param array $field
17
- *
18
- * @return string
19
- */
20
- static function html( $meta, $field )
21
- {
22
- return sprintf(
23
- '<input type="url" class="rwmb-url" name="%s" id="%s" value="%s" size="%s" placeholder="%s"/>',
24
- $field['field_name'],
25
- $field['id'],
26
- $meta,
27
- $field['size'],
28
- $field['placeholder']
29
- );
30
- }
31
-
32
- /**
33
- * Sanitize url
34
- *
35
- * @param mixed $new
36
- * @param mixed $old
37
- * @param int $post_id
38
- * @param array $field
39
- *
40
- * @return string
41
- */
42
- static function value( $new, $old, $post_id, $field )
43
- {
44
- return is_array( $new ) ? array_map( 'esc_url', $new ) : esc_url( $new );
45
- }
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/user.php CHANGED
@@ -1,143 +1,80 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- // Make sure "select" field is loaded
6
- require_once TX_RWMB_FIELDS_DIR . 'select-advanced.php';
7
-
8
- if ( ! class_exists( 'RWMB_User_Field' ) )
9
- {
10
- class RWMB_User_Field extends RWMB_Field
11
- {
12
- /**
13
- * Enqueue scripts and styles
14
- *
15
- * @return void
16
- */
17
- static function admin_enqueue_scripts()
18
- {
19
- RWMB_Select_Advanced_Field::admin_enqueue_scripts();
20
- }
21
-
22
- /**
23
- * Get field HTML
24
- *
25
- * @param mixed $meta
26
- * @param array $field
27
- *
28
- * @return string
29
- */
30
- static function html( $meta, $field )
31
- {
32
- $field['options'] = self::get_options( $field );
33
- switch ( $field['field_type'] )
34
- {
35
- case 'select':
36
- return RWMB_Select_Field::html( $meta, $field );
37
- break;
38
- case 'select_advanced':
39
- default:
40
- return RWMB_Select_Advanced_Field::html( $meta, $field );
41
- }
42
- }
43
-
44
- /**
45
- * Normalize parameters for field
46
- *
47
- * @param array $field
48
- *
49
- * @return array
50
- */
51
- static function normalize_field( $field )
52
- {
53
-
54
- $default_post_type = __( 'User', 'meta-box' );
55
-
56
- $field = wp_parse_args( $field, array(
57
- 'field_type' => 'select_advanced',
58
- 'parent' => false,
59
- 'query_args' => array(),
60
- ) );
61
-
62
- $field['std'] = empty( $field['std'] ) ? sprintf( __( 'Select a %s', 'meta-box' ), $default_post_type ) : $field['std'];
63
-
64
- $field['query_args'] = wp_parse_args( $field['query_args'], array(
65
- 'orderby' => 'display_name',
66
- 'order' => 'asc',
67
- 'role' => '',
68
- 'fields' => 'all',
69
- ) );
70
-
71
- switch ( $field['field_type'] )
72
- {
73
- case 'select':
74
- return RWMB_Select_Field::normalize_field( $field );
75
- break;
76
- case 'select_advanced':
77
- default:
78
- return RWMB_Select_Advanced_Field::normalize_field( $field );
79
- }
80
- }
81
-
82
- /**
83
- * Get meta value
84
- * If field is cloneable, value is saved as a single entry in DB
85
- * Otherwise value is saved as multiple entries (for backward compatibility)
86
- *
87
- * @see "save" method for better understanding
88
- *
89
- * @param $post_id
90
- * @param $saved
91
- * @param $field
92
- *
93
- * @return array
94
- */
95
- static function meta( $post_id, $saved, $field )
96
- {
97
- if ( isset( $field['parent'] ) && $field['parent'] )
98
- {
99
- $post = get_post( $post_id );
100
-
101
- return $post->post_parent;
102
- }
103
-
104
- return RWMB_Select_Field::meta( $post_id, $saved, $field );
105
- }
106
-
107
- /**
108
- * Save meta value
109
- * If field is cloneable, value is saved as a single entry in DB
110
- * Otherwise value is saved as multiple entries (for backward compatibility)
111
- *
112
- * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
113
- *
114
- * @param $new
115
- * @param $old
116
- * @param $post_id
117
- * @param $field
118
- */
119
- static function save( $new, $old, $post_id, $field )
120
- {
121
- return RWMB_Select_Field::save( $new, $old, $post_id, $field );
122
- }
123
-
124
- /**
125
- * Get users
126
- *
127
- * @param array $field
128
- *
129
- * @return array
130
- */
131
- static function get_options( $field )
132
- {
133
- $results = get_users( $field['query_args'] );
134
- $options = array();
135
- foreach ( $results as $result )
136
- {
137
- $options[$result->ID] = $result->display_name;
138
- }
139
-
140
- return $options;
141
- }
142
- }
143
- }
1
+ <?php
2
+ /**
3
+ * The user select field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * User field class.
10
+ */
11
+ class RWMB_User_Field extends RWMB_Object_Choice_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ *
17
+ * @return array
18
+ */
19
+ public static function normalize( $field ) {
20
+ // Set default field args.
21
+ $field = wp_parse_args( $field, array(
22
+ 'placeholder' => __( 'Select an user', 'meta-box' ),
23
+ ) );
24
+ $field = parent::normalize( $field );
25
+
26
+ // Prevent select tree for user since it's not hierarchical.
27
+ $field['field_type'] = 'select_tree' === $field['field_type'] ? 'select' : $field['field_type'];
28
+
29
+ // Set to always flat.
30
+ $field['flatten'] = true;
31
+
32
+ // Set default query args.
33
+ $field['query_args'] = wp_parse_args( $field['query_args'], array(
34
+ 'orderby' => 'display_name',
35
+ 'order' => 'asc',
36
+ 'role' => '',
37
+ 'fields' => 'all',
38
+ ) );
39
+
40
+ return $field;
41
+ }
42
+
43
+ /**
44
+ * Get users.
45
+ *
46
+ * @param array $field Field parameters.
47
+ *
48
+ * @return array
49
+ */
50
+ public static function get_options( $field ) {
51
+ $query = new WP_User_Query( $field['query_args'] );
52
+ return $query->get_results();
53
+ }
54
+
55
+ /**
56
+ * Get field names of object to be used by walker.
57
+ *
58
+ * @return array
59
+ */
60
+ public static function get_db_fields() {
61
+ return array(
62
+ 'parent' => 'parent',
63
+ 'id' => 'ID',
64
+ 'label' => 'display_name',
65
+ );
66
+ }
67
+
68
+ /**
69
+ * Get option label.
70
+ *
71
+ * @param array $field Field parameters.
72
+ * @param string $value Option value.
73
+ *
74
+ * @return string
75
+ */
76
+ public static function get_option_label( $field, $value ) {
77
+ $user = get_userdata( $value );
78
+ return '<a href="' . get_author_posts_url( $value ) . '">' . $user->display_name . '</a>';
79
+ }
80
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/fields/video.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Video field which uses WordPress media popup to upload and select video.
4
+ *
5
+ * @package Meta Box
6
+ * @since 4.10
7
+ */
8
+
9
+ /**
10
+ * The video field class.
11
+ */
12
+ class RWMB_Video_Field extends RWMB_Media_Field {
13
+ /**
14
+ * Enqueue scripts and styles.
15
+ */
16
+ public static function admin_enqueue_scripts() {
17
+ parent::admin_enqueue_scripts();
18
+ wp_enqueue_style( 'rwmb-video', RWMB_CSS_URL . 'video.css', array( 'rwmb-media' ), RWMB_VER );
19
+ wp_enqueue_script( 'rwmb-video', RWMB_JS_URL . 'video.js', array( 'rwmb-media' ), RWMB_VER, true );
20
+ self::localize_script( 'rwmb-video', 'i18nRwmbVideo', array(
21
+ 'extensions' => wp_get_video_extensions(),
22
+ ) );
23
+ }
24
+
25
+ /**
26
+ * Normalize parameters for field.
27
+ *
28
+ * @param array $field Field parameters.
29
+ *
30
+ * @return array
31
+ */
32
+ public static function normalize( $field ) {
33
+ $field['mime_type'] = 'video';
34
+ $field = parent::normalize( $field );
35
+
36
+ return $field;
37
+ }
38
+
39
+ /**
40
+ * Get uploaded file information.
41
+ *
42
+ * @param int $file_id Attachment image ID (post ID). Required.
43
+ * @param array $args Array of arguments (for size).
44
+ *
45
+ * @return array|bool False if file not found. Array of image info on success.
46
+ */
47
+ public static function file_info( $file_id, $args = array() ) {
48
+ if ( ! get_attached_file( $file_id ) ) {
49
+ return false;
50
+ }
51
+ $attachment = get_post( $file_id );
52
+ $url = wp_get_attachment_url( $attachment->ID );
53
+ $file_type = wp_check_filetype( $url, wp_get_mime_types() );
54
+ $data = array(
55
+ 'ID' => $file_id,
56
+ 'src' => $url,
57
+ 'type' => $file_type['type'],
58
+ 'title' => $attachment->post_title,
59
+ 'caption' => $attachment->post_excerpt,
60
+ 'description' => $attachment->post_content,
61
+ );
62
+
63
+ $data['meta'] = array();
64
+ $meta = wp_get_attachment_metadata( $attachment->ID );
65
+ if ( ! empty( $meta ) ) {
66
+ foreach ( wp_get_attachment_id3_keys( $attachment ) as $key => $label ) {
67
+ if ( ! empty( $meta[ $key ] ) ) {
68
+ $data['meta'][ $key ] = $meta[ $key ];
69
+ }
70
+ }
71
+
72
+ if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) {
73
+ $data['dimensions'] = array(
74
+ 'width' => $meta['width'],
75
+ 'height' => $meta['height'],
76
+ );
77
+ } else {
78
+ $data['dimensions'] = array(
79
+ 'width' => 640,
80
+ 'height' => 360,
81
+ );
82
+ }
83
+ }
84
+
85
+ $thumb_id = get_post_thumbnail_id( $attachment->ID );
86
+ if ( ! empty( $thumb_id ) ) {
87
+ list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'full' );
88
+ $data['image'] = compact( 'src', 'width', 'height' );
89
+ list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'thumbnail' );
90
+ $data['thumb'] = compact( 'src', 'width', 'height' );
91
+ } else {
92
+ $src = wp_mime_type_icon( $attachment->ID );
93
+ $width = 48;
94
+ $height = 64;
95
+ $data['image'] = compact( 'src', 'width', 'height' );
96
+ $data['thumb'] = compact( 'src', 'width', 'height' );
97
+ }
98
+
99
+ return $data;
100
+ }
101
+
102
+ /**
103
+ * Format value for a clone.
104
+ *
105
+ * @param array $field Field parameters.
106
+ * @param string|array $value The field meta value.
107
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
108
+ * @param int|null $post_id Post ID. null for current post. Optional.
109
+ *
110
+ * @return string
111
+ */
112
+ public static function format_clone_value( $field, $value, $args, $post_id ) {
113
+ $ids = implode( ',', wp_list_pluck( $value, 'ID' ) );
114
+
115
+ // Display single video.
116
+ if ( 1 === count( $value ) ) {
117
+ $video = reset( $value );
118
+ return wp_video_shortcode( array(
119
+ 'src' => $video['src'],
120
+ 'width' => $video['dimensions']['width'],
121
+ 'height' => $video['dimensions']['height'],
122
+ ) );
123
+ }
124
+
125
+ // Display multiple videos in a playlist.
126
+ return wp_playlist_shortcode( array(
127
+ 'ids' => $ids,
128
+ 'type' => 'video',
129
+ ) );
130
+ }
131
+
132
+ /**
133
+ * Template for media item.
134
+ */
135
+ public static function print_templates() {
136
+ parent::print_templates();
137
+ require_once( RWMB_INC_DIR . 'templates/video.php' );
138
+ }
139
+ }
inc/meta-box/inc/fields/wysiwyg.php CHANGED
@@ -1,108 +1,93 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- if ( ! class_exists( 'RWMB_Wysiwyg_Field' ) )
6
- {
7
- class RWMB_Wysiwyg_Field extends RWMB_Field
8
- {
9
-
10
- static $cloneable_editors = array();
11
-
12
- /**
13
- * Enqueue scripts and styles
14
- *
15
- * @return void
16
- */
17
- static function admin_enqueue_scripts()
18
- {
19
- wp_enqueue_style( 'rwmb-meta-box-wysiwyg', TX_RWMB_CSS_URL . 'wysiwyg.css', array(), TX_RWMB_VER );
20
- }
21
-
22
- /**
23
- * Change field value on save
24
- *
25
- * @param mixed $new
26
- * @param mixed $old
27
- * @param int $post_id
28
- * @param array $field
29
- *
30
- * @return string
31
- */
32
- static function value( $new, $old, $post_id, $field )
33
- {
34
- if ( $field['raw'] )
35
- {
36
- $meta = $new;
37
- }
38
- else if ( $field['clone'] )
39
- {
40
- $meta = array_map( 'wpautop', $new );
41
- }
42
- else
43
- {
44
- $meta = wpautop( $new );
45
- }
46
-
47
- return $meta;
48
- }
49
-
50
- /**
51
- * Get field HTML
52
- *
53
- * @param mixed $meta
54
- * @param array $field
55
- *
56
- * @return string
57
- */
58
- static function html( $meta, $field )
59
- {
60
- // Using output buffering because wp_editor() echos directly
61
- ob_start();
62
-
63
- $field['options']['textarea_name'] = $field['field_name'];
64
-
65
- // Use new wp_editor() since WP 3.3
66
- wp_editor( $meta, $field['id'], $field['options'] );
67
-
68
- $editor = ob_get_clean();
69
- if ( $field['clone'] )
70
- {
71
- self::$cloneable_editors[$field['id']] = $editor;
72
- add_action( 'admin_print_footer_scripts', array( __CLASS__, 'footer_scripts' ), 51 );
73
- }
74
-
75
- return $editor;
76
- }
77
-
78
- /**
79
- * Normalize parameters for field
80
- *
81
- * @param array $field
82
- *
83
- * @return array
84
- */
85
- static function normalize_field( $field )
86
- {
87
- $field = wp_parse_args( $field, array(
88
- 'raw' => false,
89
- 'options' => array(),
90
- ) );
91
-
92
- $field['options'] = wp_parse_args( $field['options'], array(
93
- 'editor_class' => 'rwmb-wysiwyg',
94
- 'dfw' => true, // Use default WordPress full screen UI
95
- ) );
96
-
97
- // Keep the filter to be compatible with previous versions
98
- $field['options'] = apply_filters( 'rwmb_wysiwyg_settings', $field['options'] );
99
-
100
- return $field;
101
- }
102
-
103
- static function footer_scripts()
104
- {
105
- echo '<script> var rwmb_cloneable_editors = ' . json_encode( self::$cloneable_editors ) . ';</script>';
106
- }
107
- }
108
- }
1
+ <?php
2
+ /**
3
+ * The WYSIWYG (editor) field.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * WYSIWYG (editor) field class.
10
+ */
11
+ class RWMB_Wysiwyg_Field extends RWMB_Field {
12
+ /**
13
+ * Array of cloneable editors.
14
+ *
15
+ * @var array
16
+ */
17
+ protected static $cloneable_editors = array();
18
+
19
+ /**
20
+ * Enqueue scripts and styles.
21
+ */
22
+ public static function admin_enqueue_scripts() {
23
+ wp_enqueue_style( 'rwmb-wysiwyg', RWMB_CSS_URL . 'wysiwyg.css', array(), RWMB_VER );
24
+ wp_enqueue_script( 'rwmb-wysiwyg', RWMB_JS_URL . 'wysiwyg.js', array( 'jquery' ), RWMB_VER, true );
25
+ }
26
+
27
+ /**
28
+ * Change field value on save.
29
+ *
30
+ * @param mixed $new The submitted meta value.
31
+ * @param mixed $old The existing meta value.
32
+ * @param int $post_id The post ID.
33
+ * @param array $field The field parameters.
34
+ * @return string
35
+ */
36
+ public static function value( $new, $old, $post_id, $field ) {
37
+ return $field['raw'] ? $new : wpautop( $new );
38
+ }
39
+
40
+ /**
41
+ * Get field HTML.
42
+ *
43
+ * @param mixed $meta Meta value.
44
+ * @param array $field Field parameters.
45
+ * @return string
46
+ */
47
+ public static function html( $meta, $field ) {
48
+ // Using output buffering because wp_editor() echos directly.
49
+ ob_start();
50
+
51
+ $field['options']['textarea_name'] = $field['field_name'];
52
+ $attributes = self::get_attributes( $field );
53
+
54
+ // Use new wp_editor() since WP 3.3.
55
+ wp_editor( $meta, $attributes['id'], $field['options'] );
56
+
57
+ return ob_get_clean();
58
+ }
59
+
60
+ /**
61
+ * Escape meta for field output.
62
+ *
63
+ * @param mixed $meta Meta value.
64
+ * @return mixed
65
+ */
66
+ public static function esc_meta( $meta ) {
67
+ return $meta;
68
+ }
69
+
70
+ /**
71
+ * Normalize parameters for field.
72
+ *
73
+ * @param array $field Field parameters.
74
+ * @return array
75
+ */
76
+ public static function normalize( $field ) {
77
+ $field = parent::normalize( $field );
78
+ $field = wp_parse_args( $field, array(
79
+ 'raw' => false,
80
+ 'options' => array(),
81
+ ) );
82
+
83
+ $field['options'] = wp_parse_args( $field['options'], array(
84
+ 'editor_class' => 'rwmb-wysiwyg',
85
+ 'dfw' => true, // Use default WordPress full screen UI.
86
+ ) );
87
+
88
+ // Keep the filter to be compatible with previous versions.
89
+ $field['options'] = apply_filters( 'rwmb_wysiwyg_settings', $field['options'] );
90
+
91
+ return $field;
92
+ }
93
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/functions.php ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin public functions.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ if ( ! function_exists( 'rwmb_meta' ) ) {
9
+ /**
10
+ * Get post meta.
11
+ *
12
+ * @param string $key Meta key. Required.
13
+ * @param array $args Array of arguments. Optional.
14
+ * @param int|null $post_id Post ID. null for current post. Optional.
15
+ *
16
+ * @return mixed
17
+ */
18
+ function rwmb_meta( $key, $args = array(), $post_id = null ) {
19
+ $args = wp_parse_args( $args );
20
+ $field = rwmb_get_field_settings( $key, $args, $post_id );
21
+
22
+ /*
23
+ * If field is not found, which can caused by registering meta boxes for the backend only or conditional registration.
24
+ * Then fallback to the old method to retrieve meta (which uses get_post_meta() as the latest fallback).
25
+ */
26
+ if ( false === $field ) {
27
+ return apply_filters( 'rwmb_meta', rwmb_meta_legacy( $key, $args, $post_id ) );
28
+ }
29
+ $meta = in_array( $field['type'], array( 'oembed', 'map' ), true ) ?
30
+ rwmb_the_value( $key, $args, $post_id, false ) :
31
+ rwmb_get_value( $key, $args, $post_id );
32
+ return apply_filters( 'rwmb_meta', $meta, $key, $args, $post_id );
33
+ }
34
+ }
35
+
36
+ if ( ! function_exists( 'rwmb_get_field_settings' ) ) {
37
+ /**
38
+ * Get field settings.
39
+ *
40
+ * @param string $key Meta key. Required.
41
+ * @param array $args Array of arguments. Optional.
42
+ * @param int|null $object_id Object ID. null for current post. Optional.
43
+ *
44
+ * @return array
45
+ */
46
+ function rwmb_get_field_settings( $key, $args = array(), $object_id = null ) {
47
+ $args = wp_parse_args( $args, array(
48
+ 'object_type' => 'post',
49
+ ) );
50
+ $type = get_post_type( $object_id );
51
+
52
+ /**
53
+ * Filter meta type from object type and object id.
54
+ *
55
+ * @var string Meta type, default is post type name.
56
+ * @var string Object type.
57
+ * @var string|int Object id.
58
+ */
59
+ $type = apply_filters( 'rwmb_meta_type', $type, $args['object_type'], $object_id );
60
+
61
+ return rwmb_get_registry( 'field' )->get( $key, $type, $args['object_type'] );
62
+ }
63
+ }
64
+
65
+ if ( ! function_exists( 'rwmb_meta_legacy' ) ) {
66
+ /**
67
+ * Get post meta.
68
+ *
69
+ * @param string $key Meta key. Required.
70
+ * @param array $args Array of arguments. Optional.
71
+ * @param int|null $post_id Post ID. null for current post. Optional.
72
+ *
73
+ * @return mixed
74
+ */
75
+ function rwmb_meta_legacy( $key, $args = array(), $post_id = null ) {
76
+ $args = wp_parse_args( $args, array(
77
+ 'type' => 'text',
78
+ 'multiple' => false,
79
+ 'clone' => false,
80
+ ) );
81
+ $field = array(
82
+ 'id' => $key,
83
+ 'type' => $args['type'],
84
+ 'clone' => $args['clone'],
85
+ 'multiple' => $args['multiple'],
86
+ );
87
+
88
+ $method = 'get_value';
89
+ switch ( $args['type'] ) {
90
+ case 'taxonomy':
91
+ case 'taxonomy_advanced':
92
+ $field['taxonomy'] = $args['taxonomy'];
93
+ break;
94
+ case 'map':
95
+ case 'oembed':
96
+ $method = 'the_value';
97
+ break;
98
+ }
99
+ $field = RWMB_Field::call( 'normalize', $field );
100
+
101
+ return RWMB_Field::call( $method, $field, $args, $post_id );
102
+ }
103
+ } // End if().
104
+
105
+ if ( ! function_exists( 'rwmb_get_value' ) ) {
106
+ /**
107
+ * Get value of custom field.
108
+ * This is used to replace old version of rwmb_meta key.
109
+ *
110
+ * @param string $field_id Field ID. Required.
111
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
112
+ * @param int|null $post_id Post ID. null for current post. Optional.
113
+ *
114
+ * @return mixed false if field doesn't exist. Field value otherwise.
115
+ */
116
+ function rwmb_get_value( $field_id, $args = array(), $post_id = null ) {
117
+ $args = wp_parse_args( $args );
118
+ $field = rwmb_get_field_settings( $field_id, $args, $post_id );
119
+
120
+ // Get field value.
121
+ $value = $field ? RWMB_Field::call( 'get_value', $field, $args, $post_id ) : false;
122
+
123
+ /*
124
+ * Allow developers to change the returned value of field.
125
+ * For version < 4.8.2, the filter name was 'rwmb_get_field'.
126
+ *
127
+ * @param mixed $value Field value.
128
+ * @param array $field Field parameters.
129
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
130
+ * @param int|null $post_id Post ID. null for current post. Optional.
131
+ */
132
+ $value = apply_filters( 'rwmb_get_value', $value, $field, $args, $post_id );
133
+
134
+ return $value;
135
+ }
136
+ }
137
+
138
+ if ( ! function_exists( 'rwmb_the_value' ) ) {
139
+ /**
140
+ * Display the value of a field
141
+ *
142
+ * @param string $field_id Field ID. Required.
143
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
144
+ * @param int|null $post_id Post ID. null for current post. Optional.
145
+ * @param bool $echo Display field meta value? Default `true` which works in almost all cases. We use `false` for the [rwmb_meta] shortcode.
146
+ *
147
+ * @return string
148
+ */
149
+ function rwmb_the_value( $field_id, $args = array(), $post_id = null, $echo = true ) {
150
+ $args = wp_parse_args( $args );
151
+ $field = rwmb_get_field_settings( $field_id, $args, $post_id );
152
+
153
+ if ( ! $field ) {
154
+ return '';
155
+ }
156
+
157
+ $output = RWMB_Field::call( 'the_value', $field, $args, $post_id );
158
+
159
+ /*
160
+ * Allow developers to change the returned value of field.
161
+ * For version < 4.8.2, the filter name was 'rwmb_get_field'.
162
+ *
163
+ * @param mixed $value Field HTML output.
164
+ * @param array $field Field parameters.
165
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
166
+ * @param int|null $post_id Post ID. null for current post. Optional.
167
+ */
168
+ $output = apply_filters( 'rwmb_the_value', $output, $field, $args, $post_id );
169
+
170
+ if ( $echo ) {
171
+ echo $output; // WPCS: XSS OK.
172
+ }
173
+
174
+ return $output;
175
+ }
176
+ } // End if().
177
+
178
+ if ( ! function_exists( 'rwmb_meta_shortcode' ) ) {
179
+ /**
180
+ * Shortcode to display meta value.
181
+ *
182
+ * @param array $atts Shortcode attributes, same as rwmb_meta() function, but has more "meta_key" parameter.
183
+ *
184
+ * @return string
185
+ */
186
+ function rwmb_meta_shortcode( $atts ) {
187
+ $atts = wp_parse_args( $atts, array(
188
+ 'post_id' => get_the_ID(),
189
+ ) );
190
+ if ( empty( $atts['meta_key'] ) ) {
191
+ return '';
192
+ }
193
+
194
+ $field_id = $atts['meta_key'];
195
+ $post_id = $atts['post_id'];
196
+ unset( $atts['meta_key'], $atts['post_id'] );
197
+
198
+ return rwmb_the_value( $field_id, $atts, $post_id, false );
199
+ }
200
+
201
+ add_shortcode( 'rwmb_meta', 'rwmb_meta_shortcode' );
202
+ }
203
+
204
+ if ( ! function_exists( 'rwmb_get_registry' ) ) {
205
+ /**
206
+ * Get the registry by type.
207
+ * Always return the same instance of the registry.
208
+ *
209
+ * @param string $type Registry type.
210
+ *
211
+ * @return object
212
+ */
213
+ function rwmb_get_registry( $type ) {
214
+ static $data = array();
215
+
216
+ $type = str_replace( array( '-', '_' ), ' ', $type );
217
+ $class = 'RWMB_' . ucwords( $type ) . '_Registry';
218
+ $class = str_replace( ' ', '_', $class );
219
+ if ( ! isset( $data[ $type ] ) ) {
220
+ $data[ $type ] = new $class();
221
+ }
222
+
223
+ return $data[ $type ];
224
+ }
225
+ }
226
+
227
+ if ( ! function_exists( 'rwmb_get_storage_class_name' ) ) {
228
+ /**
229
+ * Get storage class name.
230
+ *
231
+ * @param string $object_type Object type. Use post or term.
232
+ * @return string
233
+ */
234
+ function rwmb_get_storage_class_name( $object_type ) {
235
+ $object_type = str_replace( array( '-', '_' ), ' ', $object_type );
236
+ $object_type = ucwords( $object_type );
237
+ $object_type = str_replace( ' ', '_', $object_type );
238
+ $class_name = 'RWMB_' . $object_type . '_Storage';
239
+
240
+ if ( ! class_exists( $class_name ) ) {
241
+ $class_name = 'RWMB_Post_Storage';
242
+ }
243
+
244
+ return apply_filters( 'rwmb_storage_class_name', $class_name, $object_type );
245
+ }
246
+ }
247
+
248
+ if ( ! function_exists( 'rwmb_get_storage' ) ) {
249
+ /**
250
+ * Get storage instance.
251
+ *
252
+ * @param string $object_type Object type. Use post or term.
253
+ * @param RW_Meta_Box $meta_box Meta box object. Optional.
254
+ * @return RWMB_Storage_Interface
255
+ */
256
+ function rwmb_get_storage( $object_type, $meta_box = null ) {
257
+ $class_name = rwmb_get_storage_class_name( $object_type );
258
+ $storage = rwmb_get_registry( 'storage' )->get( $class_name );
259
+
260
+ return apply_filters( 'rwmb_get_storage', $storage, $object_type, $meta_box );
261
+ }
262
+ }
263
+
264
+ if ( ! function_exists( 'rwmb_get_meta_box' ) ) {
265
+ /**
266
+ * Get meta box object from meta box data.
267
+ *
268
+ * @param array $meta_box Array of meta box data.
269
+ * @return RW_Meta_Box
270
+ */
271
+ function rwmb_get_meta_box( $meta_box ) {
272
+ /**
273
+ * Allow filter meta box class name.
274
+ *
275
+ * @var string Meta box class name.
276
+ * @var array Meta box data.
277
+ */
278
+ $class_name = apply_filters( 'rwmb_meta_box_class_name', 'RW_Meta_Box', $meta_box );
279
+
280
+ return new $class_name( $meta_box );
281
+ }
282
+ }
inc/meta-box/inc/helpers.php DELETED
@@ -1,408 +0,0 @@
1
- <?php
2
- /**
3
- * This file contains all helpers/public functions
4
- * that can be used both on the back-end or front-end
5
- */
6
-
7
- // Prevent loading this file directly
8
- defined( 'ABSPATH' ) || exit;
9
-
10
- if ( ! class_exists( 'RWMB_Helper' ) )
11
- {
12
- /**
13
- * Wrapper class for helper functions
14
- */
15
- class RWMB_Helper
16
- {
17
- /**
18
- * Do actions when class is loaded
19
- *
20
- * @return void
21
- */
22
- static function on_load()
23
- {
24
- //add_shortcode( 'rwmb_meta', array( __CLASS__, 'shortcode' ) );
25
- }
26
-
27
- /**
28
- * Shortcode to display meta value
29
- *
30
- * @param $atts Array of shortcode attributes, same as meta() function, but has more "meta_key" parameter
31
- *
32
- * @see meta() function below
33
- *
34
- * @return string
35
- */
36
- static function shortcode( $atts )
37
- {
38
- $atts = wp_parse_args( $atts, array(
39
- 'type' => 'text',
40
- 'post_id' => get_the_ID(),
41
- ) );
42
- if ( empty( $atts['meta_key'] ) )
43
- return '';
44
-
45
- $meta = self::meta( $atts['meta_key'], $atts, $atts['post_id'] );
46
-
47
- // Get uploaded files info
48
- if ( in_array( $atts['type'], array( 'file', 'file_advanced' ) ) )
49
- {
50
- $content = '<ul>';
51
- foreach ( $meta as $file )
52
- {
53
- $content .= sprintf(
54
- '<li><a href="%s" title="%s">%s</a></li>',
55
- $file['url'],
56
- $file['title'],
57
- $file['name']
58
- );
59
- }
60
- $content .= '</ul>';
61
- }
62
-
63
- // Get uploaded images info
64
- elseif ( in_array( $atts['type'], array( 'image', 'plupload_image', 'thickbox_image', 'image_advanced' ) ) )
65
- {
66
- $content = '<ul>';
67
- foreach ( $meta as $image )
68
- {
69
- // Link thumbnail to full size image?
70
- if ( isset( $atts['link'] ) && $atts['link'] )
71
- {
72
- $content .= sprintf(
73
- '<li><a href="%s" title="%s"><img src="%s" alt="%s" title="%s" /></a></li>',
74
- $image['full_url'],
75
- $image['title'],
76
- $image['url'],
77
- $image['alt'],
78
- $image['title']
79
- );
80
- }
81
- else
82
- {
83
- $content .= sprintf(
84
- '<li><img src="%s" alt="%s" title="%s" /></li>',
85
- $image['url'],
86
- $image['alt'],
87
- $image['title']
88
- );
89
- }
90
- }
91
- $content .= '</ul>';
92
- }
93
-
94
- // Get post terms
95
- elseif ( 'taxonomy' == $atts['type'] )
96
- {
97
- $content = '<ul>';
98
- foreach ( $meta as $term )
99
- {
100
- $content .= sprintf(
101
- '<li><a href="%s" title="%s">%s</a></li>',
102
- get_term_link( $term, $atts['taxonomy'] ),
103
- $term->name,
104
- $term->name
105
- );
106
- }
107
- $content .= '</ul>';
108
- }
109
-
110
- // Normal multiple fields: checkbox_list, select with multiple values
111
- elseif ( is_array( $meta ) )
112
- {
113
- $content = '<ul><li>' . implode( '</li><li>', $meta ) . '</li></ul>';
114
- }
115
-
116
- else
117
- {
118
- $content = $meta;
119
- }
120
-
121
- return apply_filters( 'rwmb_shortcode', $content );
122
- }
123
-
124
- /**
125
- * Get post meta
126
- *
127
- * @param string $key Meta key. Required.
128
- * @param int|null $post_id Post ID. null for current post. Optional
129
- * @param array $args Array of arguments. Optional.
130
- *
131
- * @return mixed
132
- */
133
- static function meta( $key, $args = array(), $post_id = null )
134
- {
135
- $post_id = empty( $post_id ) ? get_the_ID() : $post_id;
136
-
137
- $args = wp_parse_args( $args, array(
138
- 'type' => 'text',
139
- )
140
- );
141
-
142
- // Set 'multiple' for fields based on 'type'
143
- if ( ! isset( $args['multiple'] ) )
144
- $args['multiple'] = in_array( $args['type'], array( 'checkbox_list', 'file', 'file_advanced', 'image', 'image_advanced', 'plupload_image', 'thickbox_image' ) );
145
-
146
- $meta = get_post_meta( $post_id, $key, ! $args['multiple'] );
147
-
148
- // Get uploaded files info
149
- if ( in_array( $args['type'], array( 'file', 'file_advanced' ) ) )
150
- {
151
- if ( is_array( $meta ) && ! empty( $meta ) )
152
- {
153
- $files = array();
154
- foreach ( $meta as $id )
155
- {
156
- $files[$id] = self::file_info( $id );
157
- }
158
- $meta = $files;
159
- }
160
- }
161
-
162
- // Get uploaded images info
163
- elseif ( in_array( $args['type'], array( 'image', 'plupload_image', 'thickbox_image', 'image_advanced' ) ) )
164
- {
165
- global $wpdb;
166
-
167
- $meta = $wpdb->get_col( $wpdb->prepare( "
168
- SELECT meta_value FROM $wpdb->postmeta
169
- WHERE post_id = %d AND meta_key = '%s'
170
- ORDER BY meta_id ASC
171
- ", $post_id, $key ) );
172
-
173
- if ( is_array( $meta ) && ! empty( $meta ) )
174
- {
175
- $images = array();
176
- foreach ( $meta as $id )
177
- {
178
- $images[$id] = self::image_info( $id, $args );
179
- }
180
- $meta = $images;
181
- }
182
- }
183
-
184
- // Get terms
185
- elseif ( 'taxonomy_advanced' == $args['type'] )
186
- {
187
- if ( ! empty( $args['taxonomy'] ) )
188
- {
189
- $term_ids = array_map( 'intval', array_filter( explode( ',', $meta . ',' ) ) );
190
-
191
- // Allow to pass more arguments to "get_terms"
192
- $func_args = wp_parse_args( array(
193
- 'include' => $term_ids,
194
- 'hide_empty' => false,
195
- ), $args );
196
- unset( $func_args['type'], $func_args['taxonomy'], $func_args['multiple'] );
197
- $meta = get_terms( $args['taxonomy'], $func_args );
198
- }
199
- else
200
- {
201
- $meta = array();
202
- }
203
- }
204
-
205
- // Get post terms
206
- elseif ( 'taxonomy' == $args['type'] )
207
- {
208
- $meta = empty( $args['taxonomy'] ) ? array() : wp_get_post_terms( $post_id, $args['taxonomy'] );
209
- }
210
-
211
- // Get map
212
- elseif ( 'map' == $args['type'] )
213
- {
214
- $meta = self::map( $key, $args, $post_id );
215
- }
216
-
217
- return apply_filters( 'rwmb_meta', $meta, $key, $args, $post_id );
218
- }
219
-
220
- /**
221
- * Get uploaded file information
222
- *
223
- * @param int $id Attachment file ID (post ID). Required.
224
- *
225
- * @return array|bool False if file not found. Array of (id, name, path, url) on success
226
- */
227
- static function file_info( $id )
228
- {
229
- $path = get_attached_file( $id );
230
-
231
- return array(
232
- 'ID' => $id,
233
- 'name' => basename( $path ),
234
- 'path' => $path,
235
- 'url' => wp_get_attachment_url( $id ),
236
- 'title' => get_the_title( $id ),
237
- );
238
- }
239
-
240
- /**
241
- * Get uploaded image information
242
- *
243
- * @param int $id Attachment image ID (post ID). Required.
244
- * @param array $args Array of arguments (for size). Required.
245
- *
246
- * @return array|bool False if file not found. Array of (id, name, path, url) on success
247
- */
248
- static function image_info( $id, $args = array() )
249
- {
250
- $args = wp_parse_args( $args, array(
251
- 'size' => 'thumbnail',
252
- ) );
253
-
254
- $img_src = wp_get_attachment_image_src( $id, $args['size'] );
255
- if ( empty( $img_src ) )
256
- return false;
257
-
258
- $attachment = get_post( $id );
259
- $path = get_attached_file( $id );
260
-
261
- return array(
262
- 'ID' => $id,
263
- 'name' => basename( $path ),
264
- 'path' => $path,
265
- 'url' => $img_src[0],
266
- 'width' => $img_src[1],
267
- 'height' => $img_src[2],
268
- 'full_url' => wp_get_attachment_url( $id ),
269
- 'title' => $attachment->post_title,
270
- 'caption' => $attachment->post_excerpt,
271
- 'description' => $attachment->post_content,
272
- 'alt' => get_post_meta( $id, '_wp_attachment_image_alt', true ),
273
- );
274
- }
275
-
276
- /**
277
- * Display map using Google API
278
- *
279
- * @param string $key Meta key
280
- * @param array $args Map parameter
281
- * @param int|null $post_id Post ID
282
- *
283
- * @return string
284
- */
285
- static function map( $key, $args = array(), $post_id = null )
286
- {
287
- $post_id = empty( $post_id ) ? get_the_ID() : $post_id;
288
- $loc = get_post_meta( $post_id, $key, true );
289
- if ( ! $loc )
290
- return '';
291
-
292
- $parts = array_map( 'trim', explode( ',', $loc ) );
293
-
294
- // No zoom entered, set it to 14 by default
295
- if ( count( $parts ) < 3 )
296
- $parts[2] = 14;
297
-
298
- // Map parameters
299
- $args = wp_parse_args( $args, array(
300
- 'width' => '640px',
301
- 'height' => '480px',
302
- 'marker' => true, // Display marker?
303
- 'marker_title' => '', // Marker title, when hover
304
- 'info_window' => '', // Content of info window (when click on marker). HTML allowed
305
- 'js_options' => array(),
306
- ) );
307
- $args['js_options'] = wp_parse_args( $args['js_options'], array(
308
- 'zoom' => $parts[2], // Default to 'zoom' level set in admin, but can be overwritten
309
- 'mapTypeId' => 'ROADMAP', // Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId
310
- ) );
311
-
312
- // Counter to display multiple maps on same page
313
- static $counter = 0;
314
-
315
- $html = sprintf(
316
- '<div id="rwmb-map-canvas-%d" style="width:%s;height:%s"></div>',
317
- $counter,
318
- $args['width'],
319
- $args['height']
320
- );
321
-
322
- // Load Google Maps script only when needed
323
- $html .= '<script>if ( typeof google !== "object" || typeof google.maps !== "object" )
324
- document.write(\'<script src="//maps.google.com/maps/api/js?sensor=false"><\/script>\')</script>';
325
- $html .= '<script>
326
- ( function()
327
- {
328
- ';
329
-
330
- $html .= sprintf( '
331
- var center = new google.maps.LatLng( %s, %s ),
332
- mapOptions = %s,
333
- map;
334
-
335
- switch ( mapOptions.mapTypeId )
336
- {
337
- case "ROADMAP":
338
- mapOptions.mapTypeId = google.maps.MapTypeId.ROADMAP;
339
- break;
340
- case "SATELLITE":
341
- mapOptions.mapTypeId = google.maps.MapTypeId.SATELLITE;
342
- break;
343
- case "HYBRID":
344
- mapOptions.mapTypeId = google.maps.MapTypeId.HYBRID;
345
- break;
346
- case "TERRAIN":
347
- mapOptions.mapTypeId = google.maps.MapTypeId.TERRAIN;
348
- break;
349
- }
350
- mapOptions.center = center;
351
- map = new google.maps.Map( document.getElementById( "rwmb-map-canvas-%d" ), mapOptions );
352
- ',
353
- $parts[0], $parts[1],
354
- json_encode( $args['js_options'] ),
355
- $counter
356
- );
357
-
358
- if ( $args['marker'] )
359
- {
360
- $html .= sprintf( '
361
- var marker = new google.maps.Marker( {
362
- position: center,
363
- map: map%s
364
- } );',
365
- $args['marker_title'] ? ', title: "' . $args['marker_title'] . '"' : ''
366
- );
367
-
368
- if ( $args['info_window'] )
369
- {
370
- $html .= sprintf( '
371
- var infoWindow = new google.maps.InfoWindow( {
372
- content: "%s"
373
- } );
374
-
375
- google.maps.event.addListener( marker, "click", function()
376
- {
377
- infoWindow.open( map, marker );
378
- } );',
379
- $args['info_window']
380
- );
381
- }
382
- }
383
-
384
- $html .= '} )();
385
- </script>';
386
-
387
- $counter ++;
388
-
389
- return $html;
390
- }
391
- }
392
-
393
- RWMB_Helper::on_load();
394
- }
395
-
396
- /**
397
- * Get post meta
398
- *
399
- * @param string $key Meta key. Required.
400
- * @param int|null $post_id Post ID. null for current post. Optional
401
- * @param array $args Array of arguments. Optional.
402
- *
403
- * @return mixed
404
- */
405
- function rwmb_meta( $key, $args = array(), $post_id = null )
406
- {
407
- return RWMB_Helper::meta( $key, $args, $post_id );
408
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/init.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- add_action( 'admin_init', 'rwmb_register_meta_boxes' );
3
-
4
- /**
5
- * Register meta boxes via a filter
6
- * Advantages:
7
- * - prevents incorrect hook
8
- * - prevents duplicated global variables
9
- * - allows users to remove/hide registered meta boxes
10
- * - no need to check for class existences
11
- *
12
- * @return void
13
- */
14
- function rwmb_register_meta_boxes()
15
- {
16
- $meta_boxes = apply_filters( 'rwmb_meta_boxes', array() );
17
- foreach ( $meta_boxes as $meta_box )
18
- {
19
- new RW_Meta_Box( $meta_box );
20
- }
21
- }
22
-
23
- add_action( 'edit_page_form', 'rwmb_fix_page_template' );
24
-
25
- /**
26
- * WordPress will prevent post data saving if a page template has been selected that does not exist
27
- * This is especially a problem when switching to our theme, and old page templates are in the post data
28
- * Unset the page template if the page does not exist to allow the post to save
29
- *
30
- * @param WP_Post $post
31
- *
32
- * @return void
33
- * @since 4.3.10
34
- */
35
- function rwmb_fix_page_template( $post )
36
- {
37
- $template = get_post_meta( $post->ID, '_wp_page_template', true );
38
- $page_templates = wp_get_theme()->get_page_templates();
39
-
40
- // If the template doesn't exists, remove the data to allow WordPress to save
41
- if ( ! isset( $page_templates[$template] ) )
42
- delete_post_meta( $post->ID, '_wp_page_template' );
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/inc/interfaces/storage.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Storage interface
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Interface RWMB_Storage_Interface
10
+ */
11
+ interface RWMB_Storage_Interface {
12
+
13
+ /**
14
+ * Get value from storage.
15
+ *
16
+ * @param int $object_id Object id.
17
+ * @param string $name Field name.
18
+ * @param array $args Custom arguments..
19
+ * @return mixed
20
+ */
21
+ public function get( $object_id, $name, $args = array() );
22
+ }
inc/meta-box/inc/loader.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Load plugin's files with check for installing it as a standalone plugin or
4
+ * a module of a theme / plugin. If standalone plugin is already installed, it
5
+ * will take higher priority.
6
+ *
7
+ * @package Meta Box
8
+ */
9
+
10
+ /**
11
+ * Plugin loader class.
12
+ *
13
+ * @package Meta Box
14
+ */
15
+ class RWMB_Loader {
16
+ /**
17
+ * Define plugin constants.
18
+ */
19
+ protected function constants() {
20
+ // Script version, used to add version for scripts and styles.
21
+ define( 'RWMB_VER', '4.14.11' );
22
+
23
+ list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
+
25
+ // Plugin URLs, for fast enqueuing scripts and styles.
26
+ define( 'RWMB_URL', $url );
27
+ define( 'RWMB_JS_URL', trailingslashit( RWMB_URL . 'js' ) );
28
+ define( 'RWMB_CSS_URL', trailingslashit( RWMB_URL . 'css' ) );
29
+
30
+ // Plugin paths, for including files.
31
+ define( 'RWMB_DIR', $path );
32
+ define( 'RWMB_INC_DIR', trailingslashit( RWMB_DIR . 'inc' ) );
33
+ }
34
+
35
+ /**
36
+ * Get plugin base path and URL.
37
+ * The method is static and can be used in extensions.
38
+ *
39
+ * @link http://www.deluxeblogtips.com/2013/07/get-url-of-php-file-in-wordpress.html
40
+ * @param string $path Base folder path.
41
+ * @return array Path and URL.
42
+ */
43
+ public static function get_path( $path = '' ) {
44
+ // Plugin base path.
45
+ $path = wp_normalize_path( untrailingslashit( $path ) );
46
+ $themes_dir = wp_normalize_path( untrailingslashit( dirname( get_stylesheet_directory() ) ) );
47
+
48
+ // Default URL.
49
+ $url = plugins_url( '', $path . '/' . basename( $path ) . '.php' );
50
+
51
+ // Included into themes.
52
+ if (
53
+ 0 !== strpos( $path, wp_normalize_path( WP_PLUGIN_DIR ) )
54
+ && 0 !== strpos( $path, wp_normalize_path( WPMU_PLUGIN_DIR ) )
55
+ && 0 === strpos( $path, $themes_dir )
56
+ ) {
57
+ $themes_url = untrailingslashit( dirname( get_stylesheet_directory_uri() ) );
58
+ $url = str_replace( $themes_dir, $themes_url, $path );
59
+ }
60
+
61
+ $path = trailingslashit( $path );
62
+ $url = trailingslashit( $url );
63
+
64
+ return array( $path, $url );
65
+ }
66
+
67
+ /**
68
+ * Bootstrap the plugin.
69
+ */
70
+ public function init() {
71
+ $this->constants();
72
+
73
+ // Register autoload for classes.
74
+ require_once RWMB_INC_DIR . 'autoloader.php';
75
+ $autoloader = new RWMB_Autoloader();
76
+ $autoloader->add( RWMB_INC_DIR, 'RW_' );
77
+ $autoloader->add( RWMB_INC_DIR, 'RWMB_' );
78
+ $autoloader->add( RWMB_INC_DIR . 'about', 'RWMB_' );
79
+ $autoloader->add( RWMB_INC_DIR . 'fields', 'RWMB_', '_Field' );
80
+ $autoloader->add( RWMB_INC_DIR . 'walkers', 'RWMB_Walker_' );
81
+ $autoloader->add( RWMB_INC_DIR . 'interfaces', 'RWMB_', '_Interface' );
82
+ $autoloader->add( RWMB_INC_DIR . 'storages', 'RWMB_', '_Storage' );
83
+ $autoloader->register();
84
+
85
+ // Plugin core.
86
+ $core = new RWMB_Core();
87
+ $core->init();
88
+
89
+ $about = new RWMB_About();
90
+ $about->init();
91
+
92
+ // Validation module.
93
+ new RWMB_Validation();
94
+
95
+ $sanitize = new RWMB_Sanitizer();
96
+ $sanitize->init();
97
+
98
+ $media_modal = new RWMB_Media_Modal();
99
+ $media_modal->init();
100
+
101
+ // WPML Compatibility.
102
+ $wpml = new RWMB_WPML();
103
+ $wpml->init();
104
+
105
+ // Public functions.
106
+ require_once RWMB_INC_DIR . 'functions.php';
107
+ }
108
+ }
inc/meta-box/inc/media-modal.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Add support for editing attachment custom fields in the media modal.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The media modal class.
10
+ * Handling showing and saving custom fields in the media modal.
11
+ */
12
+ class RWMB_Media_Modal {
13
+ /**
14
+ * List of custom fields.
15
+ *
16
+ * @var array
17
+ */
18
+ protected $fields = array();
19
+
20
+ /**
21
+ * Initialize.
22
+ */
23
+ public function init() {
24
+ // Meta boxes are registered at priority 20, so we use 30 to capture them all.
25
+ add_action( 'init', array( $this, 'get_fields' ), 30 );
26
+
27
+ add_filter( 'attachment_fields_to_edit', array( $this, 'add_fields' ), 11, 2 );
28
+ add_filter( 'attachment_fields_to_save', array( $this, 'save_fields' ), 11, 2 );
29
+
30
+ add_filter( 'rwmb_show', array( $this, 'is_in_normal_mode' ), 10, 2 );
31
+ }
32
+
33
+ /**
34
+ * Get list of custom fields and store in the current object for future use.
35
+ */
36
+ public function get_fields() {
37
+ $meta_boxes = rwmb_get_registry( 'meta_box' )->all();
38
+ foreach ( $meta_boxes as $meta_box ) {
39
+ if ( $this->is_in_modal( $meta_box->meta_box ) ) {
40
+ $this->fields = array_merge( $this->fields, array_values( $meta_box->fields ) );
41
+ }
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Add fields to the attachment edit popup.
47
+ *
48
+ * @param array $form_fields An array of attachment form fields.
49
+ * @param WP_Post $post The WP_Post attachment object.
50
+ *
51
+ * @return mixed
52
+ */
53
+ public function add_fields( $form_fields, WP_Post $post ) {
54
+ foreach ( $this->fields as $field ) {
55
+ $form_field = $field;
56
+ $form_field['label'] = $field['name'];
57
+ $form_field['input'] = 'html';
58
+
59
+ // Just ignore the field 'std' because there's no way to check it.
60
+ $meta = RWMB_Field::call( $field, 'meta', $post->ID, true );
61
+ $form_field['value'] = $meta;
62
+
63
+ $field['field_name'] = 'attachments[' . $post->ID . '][' . $field['field_name'] . ']';
64
+ $form_field['html'] = RWMB_Field::call( $field, 'html', $meta );
65
+
66
+ $form_fields[ $field['id'] ] = $form_field;
67
+ }
68
+
69
+ return $form_fields;
70
+ }
71
+
72
+ /**
73
+ * Save custom fields.
74
+ *
75
+ * @param array $post An array of post data.
76
+ * @param array $attachment An array of attachment metadata.
77
+ *
78
+ * @return array
79
+ */
80
+ public function save_fields( $post, $attachment ) {
81
+ foreach ( $this->fields as $field ) {
82
+ $key = $field['id'];
83
+
84
+ $old = RWMB_Field::call( $field, 'raw_meta', $post['ID'] );
85
+ $new = isset( $attachment[ $key ] ) ? $attachment[ $key ] : '';
86
+
87
+ // Allow field class change the value.
88
+ if ( $field['clone'] ) {
89
+ $new = RWMB_Clone::value( $new, $old, $post['ID'], $field );
90
+ } else {
91
+ $new = RWMB_Field::call( $field, 'value', $new, $old, $post['ID'] );
92
+ $new = RWMB_Field::filter( 'sanitize', $new, $field );
93
+ }
94
+ $new = RWMB_Field::filter( 'value', $new, $field, $old );
95
+
96
+ // Call defined method to save meta value, if there's no methods, call common one.
97
+ RWMB_Field::call( $field, 'save', $new, $old, $post['ID'] );
98
+ }
99
+
100
+ return $post;
101
+ }
102
+
103
+ /**
104
+ * Whether or not show the meta box when editing custom fields in the normal mode.
105
+ *
106
+ * @param bool $show Whether to show the meta box in normal editing mode.
107
+ * @param array $meta_box Meta Box parameters.
108
+ *
109
+ * @return bool
110
+ */
111
+ public function is_in_normal_mode( $show, $meta_box ) {
112
+ $show = $show && ! $this->is_in_modal( $meta_box );
113
+
114
+ return $show;
115
+ }
116
+
117
+ /**
118
+ * Check if the meta box is for editing custom fields in the media modal.
119
+ *
120
+ * @param array $meta_box Meta Box parameters.
121
+ *
122
+ * @return bool
123
+ */
124
+ protected function is_in_modal( $meta_box ) {
125
+ return in_array( 'attachment', $meta_box['post_types'], true ) && ! empty( $meta_box['media_modal'] );
126
+ }
127
+ }
inc/meta-box/inc/meta-box-registry.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * A registry for storing all meta boxes.
4
+ *
5
+ * @link https://designpatternsphp.readthedocs.io/en/latest/Structural/Registry/README.html
6
+ * @package Meta Box
7
+ */
8
+
9
+ /**
10
+ * Meta box registry class.
11
+ */
12
+ class RWMB_Meta_Box_Registry {
13
+ /**
14
+ * Internal data storage.
15
+ *
16
+ * @var array
17
+ */
18
+ private $data = array();
19
+
20
+ /**
21
+ * Add a meta box to the registry.
22
+ *
23
+ * @param RW_Meta_Box $meta_box Meta box instance.
24
+ */
25
+ public function add( RW_Meta_Box $meta_box ) {
26
+ $this->data[ $meta_box->id ] = $meta_box;
27
+ }
28
+
29
+ /**
30
+ * Retrieve a meta box by id.
31
+ *
32
+ * @param string $id Meta box id.
33
+ *
34
+ * @return RW_Meta_Box|bool False or meta box object.
35
+ */
36
+ public function get( $id ) {
37
+ return isset( $this->data[ $id ] ) ? $this->data[ $id ] : false;
38
+ }
39
+
40
+ /**
41
+ * Get meta boxes under some conditions.
42
+ *
43
+ * @param array $args Custom argument to get meta boxes by.
44
+ *
45
+ * @return array
46
+ */
47
+ public function get_by( $args ) {
48
+ $meta_boxes = $this->data;
49
+ foreach ( $meta_boxes as $index => $meta_box ) {
50
+ foreach ( $args as $key => $value ) {
51
+ $meta_box_key = 'object_type' === $key ? $meta_box->get_object_type() : $meta_box->$key;
52
+ if ( $meta_box_key !== $value ) {
53
+ unset( $meta_boxes[ $index ] );
54
+ continue 2; // Skip the meta box loop.
55
+ }
56
+ }
57
+ }
58
+
59
+ return $meta_boxes;
60
+ }
61
+
62
+ /**
63
+ * Retrieve all meta boxes.
64
+ *
65
+ * @return array
66
+ */
67
+ public function all() {
68
+ return $this->data;
69
+ }
70
+ }
inc/meta-box/inc/meta-box.php CHANGED
@@ -1,454 +1,475 @@
1
- <?php
2
- // Prevent loading this file directly
3
- defined( 'ABSPATH' ) || exit;
4
-
5
- // Meta Box Class
6
- if ( ! class_exists( 'RW_Meta_Box' ) )
7
- {
8
- /**
9
- * A class to rapid develop meta boxes for custom & built in content types
10
- * Piggybacks on WordPress
11
- *
12
- * @author Rilwis
13
- * @author Co-Authors @see https://github.com/rilwis/meta-box
14
- * @license GNU GPL2+
15
- * @package RW Meta Box
16
- */
17
- class RW_Meta_Box
18
- {
19
- /**
20
- * @var array Meta box information
21
- */
22
- public $meta_box;
23
-
24
- /**
25
- * @var array Fields information
26
- */
27
- public $fields;
28
-
29
- /**
30
- * @var array Contains all field types of current meta box
31
- */
32
- public $types;
33
-
34
- /**
35
- * @var array Validation information
36
- */
37
- public $validation;
38
-
39
- /**
40
- * @var bool Used to prevent duplicated calls like revisions, manual hook to wp_insert_post, etc.
41
- */
42
- public $saved = false;
43
-
44
- /**
45
- * Create meta box based on given data
46
- *
47
- * @see demo/demo.php file for details
48
- *
49
- * @param array $meta_box Meta box definition
50
- *
51
- * @return RW_Meta_Box
52
- */
53
- function __construct( $meta_box )
54
- {
55
- // Run script only in admin area
56
- if ( ! is_admin() )
57
- return;
58
-
59
- // Assign meta box values to local variables and add it's missed values
60
- $this->meta_box = self::normalize( $meta_box );
61
- $this->fields = &$this->meta_box['fields'];
62
- $this->validation = &$this->meta_box['validation'];
63
-
64
- // Allow users to show/hide meta box
65
- // 1st action applies to all meta boxes
66
- // 2nd action applies to only current meta box
67
- $show = true;
68
- $show = apply_filters( 'rwmb_show', $show, $this->meta_box );
69
- $show = apply_filters( "rwmb_show_{$this->meta_box['id']}", $show, $this->meta_box );
70
- if ( ! $show )
71
- return;
72
-
73
- // Enqueue common styles and scripts
74
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
75
-
76
- // Add additional actions for fields
77
- $fields = self::get_fields( $this->fields );
78
- foreach ( $fields as $field )
79
- {
80
- call_user_func( array( self::get_class_name( $field ), 'add_actions' ) );
81
- }
82
-
83
- // Add meta box
84
- add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
85
-
86
- // Hide meta box if it's set 'default_hidden'
87
- add_filter( 'default_hidden_meta_boxes', array( $this, 'hide' ), 10, 2 );
88
-
89
- // Save post meta
90
- add_action( 'save_post', array( $this, 'save_post' ) );
91
-
92
- // Attachment uses other hooks
93
- // @see wp_update_post(), wp_insert_attachment()
94
- add_action( 'edit_attachment', array( $this, 'save_post' ) );
95
- add_action( 'add_attachment', array( $this, 'save_post' ) );
96
- }
97
-
98
- /**
99
- * Enqueue common styles
100
- *
101
- * @return void
102
- */
103
- function admin_enqueue_scripts()
104
- {
105
- $screen = get_current_screen();
106
-
107
- // Enqueue scripts and styles for registered pages (post types) only
108
- if ( 'post' != $screen->base || ! in_array( $screen->post_type, $this->meta_box['pages'] ) )
109
- return;
110
-
111
- wp_enqueue_style( 'rwmb', TX_RWMB_CSS_URL . 'style.css', array(), TX_RWMB_VER );
112
-
113
- // Load clone script conditionally
114
- $has_clone = false;
115
- $fields = self::get_fields( $this->fields );
116
-
117
- foreach ( $fields as $field )
118
- {
119
- if ( $field['clone'] )
120
- $has_clone = true;
121
-
122
- // Enqueue scripts and styles for fields
123
- call_user_func( array( self::get_class_name( $field ), 'admin_enqueue_scripts' ) );
124
- }
125
-
126
- if ( $has_clone )
127
- wp_enqueue_script( 'rwmb-clone', TX_RWMB_JS_URL . 'clone.js', array( 'jquery' ), TX_RWMB_VER, true );
128
-
129
- if ( $this->validation )
130
- {
131
- wp_enqueue_script( 'jquery-validate', TX_RWMB_JS_URL . 'jquery.validate.min.js', array( 'jquery' ), TX_RWMB_VER, true );
132
- wp_enqueue_script( 'rwmb-validate', TX_RWMB_JS_URL . 'validate.js', array( 'jquery-validate' ), TX_RWMB_VER, true );
133
- }
134
-
135
- // Auto save
136
- if ( $this->meta_box['autosave'] )
137
- wp_enqueue_script( 'rwmb-autosave', TX_RWMB_JS_URL . 'autosave.js', array( 'jquery' ), TX_RWMB_VER, true );
138
- }
139
-
140
- /**
141
- * Get all fields of a meta box, recursively
142
- *
143
- * @param array $fields
144
- *
145
- * @return array
146
- */
147
- static function get_fields( $fields )
148
- {
149
- $all_fields = array();
150
- foreach ( $fields as $field )
151
- {
152
- $all_fields[] = $field;
153
- if ( isset( $field['fields'] ) )
154
- $all_fields = array_merge( $all_fields, self::get_fields( $field['fields'] ) );
155
- }
156
-
157
- return $all_fields;
158
- }
159
-
160
- /**************************************************
161
- * SHOW META BOX
162
- **************************************************/
163
-
164
- /**
165
- * Add meta box for multiple post types
166
- *
167
- * @return void
168
- */
169
- function add_meta_boxes()
170
- {
171
- foreach ( $this->meta_box['pages'] as $page )
172
- {
173
- add_meta_box(
174
- $this->meta_box['id'],
175
- $this->meta_box['title'],
176
- array( $this, 'show' ),
177
- $page,
178
- $this->meta_box['context'],
179
- $this->meta_box['priority']
180
- );
181
- }
182
- }
183
-
184
- /**
185
- * Hide meta box if it's set 'default_hidden'
186
- *
187
- * @param array $hidden Array of default hidden meta boxes
188
- * @param object $screen Current screen information
189
- *
190
- * @return array
191
- */
192
- function hide( $hidden, $screen )
193
- {
194
- if (
195
- 'post' === $screen->base
196
- && in_array( $screen->post_type, $this->meta_box['pages'] )
197
- && $this->meta_box['default_hidden']
198
- )
199
- {
200
- $hidden[] = $this->meta_box['id'];
201
- }
202
-
203
- return $hidden;
204
- }
205
-
206
- /**
207
- * Callback function to show fields in meta box
208
- *
209
- * @return void
210
- */
211
- function show()
212
- {
213
- global $post;
214
-
215
- $saved = self::has_been_saved( $post->ID, $this->fields );
216
-
217
- // Container
218
- printf(
219
- '<div class="rwmb-meta-box" data-autosave="%s">',
220
- $this->meta_box['autosave'] ? 'true' : 'false'
221
- );
222
-
223
- wp_nonce_field( "rwmb-save-{$this->meta_box['id']}", "nonce_{$this->meta_box['id']}" );
224
-
225
- // Allow users to add custom code before meta box content
226
- // 1st action applies to all meta boxes
227
- // 2nd action applies to only current meta box
228
- do_action( 'rwmb_before', $this );
229
- do_action( "rwmb_before_{$this->meta_box['id']}", $this );
230
-
231
- foreach ( $this->fields as $field )
232
- {
233
- call_user_func( array( self::get_class_name( $field ), 'show' ), $field, $saved );
234
- }
235
-
236
- // Include validation settings for this meta-box
237
- if ( isset( $this->validation ) && $this->validation )
238
- {
239
- echo '
240
- <script>
241
- if ( typeof rwmb == "undefined" )
242
- {
243
- var rwmb = {
244
- validationOptions : jQuery.parseJSON( \'' . json_encode( $this->validation ) . '\' ),
245
- summaryMessage : "' . esc_js( __( 'Please correct the errors highlighted below and try again.', 'meta-box' ) ) . '"
246
- };
247
- }
248
- else
249
- {
250
- var tempOptions = jQuery.parseJSON( \'' . json_encode( $this->validation ) . '\' );
251
- jQuery.extend( true, rwmb.validationOptions, tempOptions );
252
- }
253
- </script>
254
- ';
255
- }
256
-
257
- // Allow users to add custom code after meta box content
258
- // 1st action applies to all meta boxes
259
- // 2nd action applies to only current meta box
260
- do_action( 'rwmb_after', $this );
261
- do_action( "rwmb_after_{$this->meta_box['id']}", $this );
262
-
263
- // End container
264
- echo '</div>';
265
- }
266
-
267
- /**************************************************
268
- * SAVE META BOX
269
- **************************************************/
270
-
271
- /**
272
- * Save data from meta box
273
- *
274
- * @param int $post_id Post ID
275
- *
276
- * @return void
277
- */
278
- function save_post( $post_id )
279
- {
280
- // Check if this function is called to prevent duplicated calls like revisions, manual hook to wp_insert_post, etc.
281
- if ( $this->saved === true )
282
- return;
283
- $this->saved = true;
284
-
285
- // Check whether form is submitted properly
286
- $id = $this->meta_box['id'];
287
- $nonce = isset( $_POST["nonce_{$id}"] ) ? sanitize_key( $_POST["nonce_{$id}"] ) : '';
288
- if ( empty( $_POST["nonce_{$id}"] ) || ! wp_verify_nonce( $nonce, "rwmb-save-{$id}" ) )
289
- return;
290
-
291
- // Autosave
292
- if ( defined( 'DOING_AUTOSAVE' ) && ! $this->meta_box['autosave'] )
293
- return;
294
-
295
- // Make sure meta is added to the post, not a revision
296
- if ( $the_post = wp_is_post_revision( $post_id ) )
297
- $post_id = $the_post;
298
-
299
- // Before save action
300
- do_action( 'rwmb_before_save_post', $post_id );
301
- do_action( "rwmb_{$this->meta_box['id']}_before_save_post", $post_id );
302
-
303
- foreach ( $this->fields as $field )
304
- {
305
- $name = $field['id'];
306
- $old = get_post_meta( $post_id, $name, ! $field['multiple'] );
307
- $new = isset( $_POST[$name] ) ? $_POST[$name] : ( $field['multiple'] ? array() : '' );
308
-
309
- // Allow field class change the value
310
- $new = call_user_func( array( self::get_class_name( $field ), 'value' ), $new, $old, $post_id, $field );
311
-
312
- // Use filter to change field value
313
- // 1st filter applies to all fields with the same type
314
- // 2nd filter applies to current field only
315
- $new = apply_filters( "rwmb_{$field['type']}_value", $new, $field, $old );
316
- $new = apply_filters( "rwmb_{$name}_value", $new, $field, $old );
317
-
318
- // Call defined method to save meta value, if there's no methods, call common one
319
- call_user_func( array( self::get_class_name( $field ), 'save' ), $new, $old, $post_id, $field );
320
- }
321
-
322
- // After save action
323
- do_action( 'rwmb_after_save_post', $post_id );
324
- do_action( "rwmb_{$this->meta_box['id']}_after_save_post", $post_id );
325
- }
326
-
327
- /**************************************************
328
- * HELPER FUNCTIONS
329
- **************************************************/
330
-
331
- /**
332
- * Normalize parameters for meta box
333
- *
334
- * @param array $meta_box Meta box definition
335
- *
336
- * @return array $meta_box Normalized meta box
337
- */
338
- static function normalize( $meta_box )
339
- {
340
- // Set default values for meta box
341
- $meta_box = wp_parse_args( $meta_box, array(
342
- 'id' => sanitize_title( $meta_box['title'] ),
343
- 'context' => 'normal',
344
- 'priority' => 'high',
345
- 'pages' => array( 'post' ),
346
- 'autosave' => false,
347
- 'default_hidden' => false,
348
- ) );
349
-
350
- // Set default values for fields
351
- $meta_box['fields'] = self::normalize_fields( $meta_box['fields'] );
352
-
353
- // Allow to add default values for meta box
354
- $meta_box = apply_filters( 'rwmb_normalize_meta_box', $meta_box );
355
- $meta_box = apply_filters( "rwmb_normalize_{$meta_box['id']}_meta_box", $meta_box );
356
-
357
- return $meta_box;
358
- }
359
-
360
- /**
361
- * Normalize an array of fields
362
- *
363
- * @param array $fields Array of fields
364
- *
365
- * @return array $fields Normalized fields
366
- */
367
- static function normalize_fields( $fields )
368
- {
369
- foreach ( $fields as &$field )
370
- {
371
- $field = wp_parse_args( $field, array(
372
- 'multiple' => false,
373
- 'clone' => false,
374
- 'std' => '',
375
- 'desc' => '',
376
- 'format' => '',
377
- 'before' => '',
378
- 'after' => '',
379
- 'field_name' => isset( $field['id'] ) ? $field['id'] : '',
380
- 'required' => false,
381
- 'placeholder' => '',
382
- ) );
383
-
384
- do_action( 'rwmb_before_normalize_field', $field );
385
- do_action( "rwmb_before_normalize_{$field['type']}_field", $field );
386
- do_action( "rwmb_before_normalize_{$field['id']}_field", $field );
387
-
388
- // Allow field class add/change default field values
389
- $field = call_user_func( array( self::get_class_name( $field ), 'normalize_field' ), $field );
390
-
391
- if ( isset( $field['fields'] ) )
392
- $field['fields'] = self::normalize_fields( $field['fields'] );
393
-
394
- // Allow to add default values for fields
395
- $field = apply_filters( 'rwmb_normalize_field', $field );
396
- $field = apply_filters( "rwmb_normalize_{$field['type']}_field", $field );
397
- $field = apply_filters( "rwmb_normalize_{$field['id']}_field", $field );
398
-
399
- do_action( 'rwmb_after_normalize_field', $field );
400
- do_action( "rwmb_after_normalize_{$field['type']}_field", $field );
401
- do_action( "rwmb_after_normalize_{$field['id']}_field", $field );
402
- }
403
-
404
- return $fields;
405
- }
406
-
407
- /**
408
- * Get field class name
409
- *
410
- * @param array $field Field array
411
- *
412
- * @return bool|string Field class name OR false on failure
413
- */
414
- static function get_class_name( $field )
415
- {
416
- // Convert underscores to whitespace so ucwords works as expected. Otherwise: plupload_image -> Plupload_image instead of Plupload_Image
417
- $type = str_replace( '_', ' ', $field['type'] );
418
-
419
- // Uppercase first words
420
- $class = 'RWMB_' . ucwords( $type ) . '_Field';
421
-
422
- // Relace whitespace with underscores
423
- $class = str_replace( ' ', '_', $class );
424
-
425
- return class_exists( $class ) ? $class : false;
426
- }
427
-
428
- /**
429
- * Check if meta box has been saved
430
- * This helps saving empty value in meta fields (for text box, check box, etc.)
431
- *
432
- * @param int $post_id
433
- * @param array $fields
434
- *
435
- * @return bool
436
- */
437
- static function has_been_saved( $post_id, $fields )
438
- {
439
- foreach ( $fields as $field )
440
- {
441
- $value = get_post_meta( $post_id, $field['id'], ! $field['multiple'] );
442
- if (
443
- ( ! $field['multiple'] && '' !== $value )
444
- || ( $field['multiple'] && array() !== $value )
445
- )
446
- {
447
- return true;
448
- }
449
- }
450
-
451
- return false;
452
- }
453
- }
454
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * A class to rapid develop meta boxes for custom & built in content types
4
+ * Piggybacks on WordPress
5
+ *
6
+ * @author Tran Ngoc Tuan Anh <rilwis@gmail.com>
7
+ * @license GNU GPL2+
8
+ * @package Meta Box
9
+ */
10
+
11
+ /**
12
+ * The main meta box class.
13
+ *
14
+ * @package Meta Box
15
+ */
16
+ class RW_Meta_Box {
17
+ /**
18
+ * Meta box parameters.
19
+ *
20
+ * @var array
21
+ */
22
+ public $meta_box;
23
+
24
+ /**
25
+ * Detect whether the meta box is saved at least once.
26
+ * Used to prevent duplicated calls like revisions, manual hook to wp_insert_post, etc.
27
+ *
28
+ * @var bool
29
+ */
30
+ public $saved = false;
31
+
32
+ /**
33
+ * The object ID.
34
+ *
35
+ * @var int
36
+ */
37
+ protected $object_id = null;
38
+
39
+ /**
40
+ * The object type.
41
+ *
42
+ * @var string
43
+ */
44
+ protected $object_type = 'post';
45
+
46
+ /**
47
+ * Create meta box based on given data.
48
+ *
49
+ * @param array $meta_box Meta box definition.
50
+ */
51
+ public function __construct( $meta_box ) {
52
+ $meta_box = self::normalize( $meta_box );
53
+ $this->meta_box = $meta_box;
54
+
55
+ $storage = $this->get_storage();
56
+ if ( ! $storage ) {
57
+ return;
58
+ }
59
+
60
+ $this->meta_box['fields'] = self::normalize_fields( $meta_box['fields'], $storage );
61
+
62
+ $this->meta_box = apply_filters( 'rwmb_meta_box_settings', $this->meta_box );
63
+
64
+ if ( $this->is_shown() ) {
65
+ $this->global_hooks();
66
+ $this->object_hooks();
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Add fields to field registry.
72
+ */
73
+ public function register_fields() {
74
+ $field_registry = rwmb_get_registry( 'field' );
75
+
76
+ foreach ( $this->post_types as $post_type ) {
77
+ foreach ( $this->fields as $field ) {
78
+ $field_registry->add( $field, $post_type );
79
+ }
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Conditional check for whether initializing meta box.
85
+ *
86
+ * - 1st filter applies to all meta boxes.
87
+ * - 2nd filter applies to only current meta box.
88
+ *
89
+ * @return bool
90
+ */
91
+ protected function is_shown() {
92
+ $show = apply_filters( 'rwmb_show', true, $this->meta_box );
93
+
94
+ return apply_filters( "rwmb_show_{$this->id}", $show, $this->meta_box );
95
+ }
96
+
97
+ /**
98
+ * Add global hooks.
99
+ */
100
+ protected function global_hooks() {
101
+ // Enqueue common styles and scripts.
102
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
103
+
104
+ // Add additional actions for fields.
105
+ foreach ( $this->fields as $field ) {
106
+ RWMB_Field::call( $field, 'add_actions' );
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Specific hooks for meta box object. Default is 'post'.
112
+ * This should be extended in sub-classes to support meta fields for terms, user, settings pages, etc.
113
+ */
114
+ protected function object_hooks() {
115
+ // Add meta box.
116
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
117
+
118
+ // Hide meta box if it's set 'default_hidden'.
119
+ add_filter( 'default_hidden_meta_boxes', array( $this, 'hide' ), 10, 2 );
120
+
121
+ // Save post meta.
122
+ foreach ( $this->post_types as $post_type ) {
123
+ if ( 'attachment' === $post_type ) {
124
+ // Attachment uses other hooks.
125
+ // @see wp_update_post(), wp_insert_attachment().
126
+ add_action( 'edit_attachment', array( $this, 'save_post' ) );
127
+ add_action( 'add_attachment', array( $this, 'save_post' ) );
128
+ } else {
129
+ add_action( "save_post_{$post_type}", array( $this, 'save_post' ) );
130
+ }
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Enqueue common scripts and styles.
136
+ */
137
+ public function enqueue() {
138
+ if ( is_admin() && ! $this->is_edit_screen() ) {
139
+ return;
140
+ }
141
+
142
+ wp_enqueue_style( 'rwmb', RWMB_CSS_URL . 'style.css', array(), RWMB_VER );
143
+ if ( is_rtl() ) {
144
+ wp_enqueue_style( 'rwmb-rtl', RWMB_CSS_URL . 'style-rtl.css', array(), RWMB_VER );
145
+ }
146
+
147
+ if ( 'seamless' === $this->style ) {
148
+ wp_enqueue_script( 'rwmb', RWMB_JS_URL . 'script.js', array( 'jquery' ), RWMB_VER, true );
149
+ }
150
+
151
+ // Load clone script conditionally.
152
+ foreach ( $this->fields as $field ) {
153
+ if ( $field['clone'] ) {
154
+ wp_enqueue_script( 'rwmb-clone', RWMB_JS_URL . 'clone.js', array( 'jquery-ui-sortable' ), RWMB_VER, true );
155
+ break;
156
+ }
157
+ }
158
+
159
+ // Enqueue scripts and styles for fields.
160
+ foreach ( $this->fields as $field ) {
161
+ RWMB_Field::call( $field, 'admin_enqueue_scripts' );
162
+ }
163
+
164
+ // Auto save.
165
+ if ( $this->autosave ) {
166
+ wp_enqueue_script( 'rwmb-autosave', RWMB_JS_URL . 'autosave.js', array( 'jquery' ), RWMB_VER, true );
167
+ }
168
+
169
+ /**
170
+ * Allow developers to enqueue more scripts and styles
171
+ *
172
+ * @param RW_Meta_Box $object Meta Box object
173
+ */
174
+ do_action( 'rwmb_enqueue_scripts', $this );
175
+ }
176
+
177
+ /**
178
+ * Add meta box for multiple post types
179
+ */
180
+ public function add_meta_boxes() {
181
+ foreach ( $this->post_types as $post_type ) {
182
+ add_meta_box(
183
+ $this->id,
184
+ $this->title,
185
+ array( $this, 'show' ),
186
+ $post_type,
187
+ $this->context,
188
+ $this->priority
189
+ );
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Hide meta box if it's set 'default_hidden'
195
+ *
196
+ * @param array $hidden Array of default hidden meta boxes.
197
+ * @param object $screen Current screen information.
198
+ *
199
+ * @return array
200
+ */
201
+ public function hide( $hidden, $screen ) {
202
+ if ( $this->is_edit_screen( $screen ) && $this->default_hidden ) {
203
+ $hidden[] = $this->id;
204
+ }
205
+
206
+ return $hidden;
207
+ }
208
+
209
+ /**
210
+ * Callback function to show fields in meta box
211
+ */
212
+ public function show() {
213
+ if ( null === $this->object_id ) {
214
+ $this->set_object_id( $this->get_current_object_id() );
215
+ }
216
+ $saved = $this->is_saved();
217
+
218
+ // Container.
219
+ printf(
220
+ '<div class="rwmb-meta-box%s" data-autosave="%s" data-object-type="%s">',
221
+ esc_attr( 'seamless' === $this->style ? ' rwmb-meta-box--seamless' : '' ),
222
+ esc_attr( $this->autosave ? 'true' : 'false' ),
223
+ esc_attr( $this->object_type )
224
+ );
225
+
226
+ wp_nonce_field( "rwmb-save-{$this->id}", "nonce_{$this->id}" );
227
+
228
+ // Allow users to add custom code before meta box content.
229
+ // 1st action applies to all meta boxes.
230
+ // 2nd action applies to only current meta box.
231
+ do_action( 'rwmb_before', $this );
232
+ do_action( "rwmb_before_{$this->id}", $this );
233
+
234
+ foreach ( $this->fields as $field ) {
235
+ RWMB_Field::call( 'show', $field, $saved, $this->object_id );
236
+ }
237
+
238
+ // Allow users to add custom code after meta box content.
239
+ // 1st action applies to all meta boxes.
240
+ // 2nd action applies to only current meta box.
241
+ do_action( 'rwmb_after', $this );
242
+ do_action( "rwmb_after_{$this->id}", $this );
243
+
244
+ // End container.
245
+ echo '</div>';
246
+ }
247
+
248
+ /**
249
+ * Save data from meta box
250
+ *
251
+ * @param int $post_id Post ID.
252
+ */
253
+ public function save_post( $post_id ) {
254
+ if ( ! $this->validate() ) {
255
+ return;
256
+ }
257
+ $this->saved = true;
258
+
259
+ // Make sure meta is added to the post, not a revision.
260
+ if ( 'post' === $this->object_type ) {
261
+ $the_post = wp_is_post_revision( $post_id );
262
+ if ( $the_post ) {
263
+ $post_id = $the_post;
264
+ }
265
+ }
266
+
267
+ // Before save action.
268
+ do_action( 'rwmb_before_save_post', $post_id );
269
+ do_action( "rwmb_{$this->id}_before_save_post", $post_id );
270
+
271
+ $this->save_fields( $post_id, $this->fields );
272
+
273
+ // After save action.
274
+ do_action( 'rwmb_after_save_post', $post_id );
275
+ do_action( "rwmb_{$this->id}_after_save_post", $post_id );
276
+ }
277
+
278
+ /**
279
+ * Save fields data.
280
+ *
281
+ * @param int $post_id Post id.
282
+ * @param array $fields Fields data.
283
+ */
284
+ public function save_fields( $post_id, $fields ) {
285
+ foreach ( $fields as $field ) {
286
+ $single = $field['clone'] || ! $field['multiple'];
287
+ $old = RWMB_Field::call( $field, 'raw_meta', $post_id );
288
+ // @codingStandardsIgnoreLine
289
+ $new = isset( $_POST[ $field['id'] ] ) ? $_POST[ $field['id'] ] : ( $single ? '' : array() );
290
+
291
+ // Allow field class change the value.
292
+ if ( $field['clone'] ) {
293
+ $new = RWMB_Clone::value( $new, $old, $post_id, $field );
294
+ } else {
295
+ $new = RWMB_Field::call( $field, 'value', $new, $old, $post_id );
296
+ $new = RWMB_Field::filter( 'sanitize', $new, $field );
297
+ }
298
+ $new = RWMB_Field::filter( 'value', $new, $field, $old );
299
+
300
+ // Filter to allow the field to be modified.
301
+ $field = RWMB_Field::filter( 'field', $field, $field, $new, $old );
302
+
303
+ // Call defined method to save meta value, if there's no methods, call common one.
304
+ RWMB_Field::call( $field, 'save', $new, $old, $post_id );
305
+
306
+ RWMB_Field::filter( 'after_save_field', null, $field, $new, $old, $post_id, $field );
307
+ }
308
+ }
309
+
310
+ /**
311
+ * Validate form when submit. Check:
312
+ * - If this function is called to prevent duplicated calls like revisions, manual hook to wp_insert_post, etc.
313
+ * - Autosave
314
+ * - If form is submitted properly
315
+ *
316
+ * @return bool
317
+ */
318
+ public function validate() {
319
+ $nonce = filter_input( INPUT_POST, "nonce_{$this->id}", FILTER_SANITIZE_STRING );
320
+
321
+ return ! $this->saved
322
+ && ( ! defined( 'DOING_AUTOSAVE' ) || $this->autosave )
323
+ && wp_verify_nonce( $nonce, "rwmb-save-{$this->id}" );
324
+ }
325
+
326
+ /**
327
+ * Normalize parameters for meta box
328
+ *
329
+ * @param array $meta_box Meta box definition.
330
+ *
331
+ * @return array $meta_box Normalized meta box.
332
+ */
333
+ public static function normalize( $meta_box ) {
334
+ // Set default values for meta box.
335
+ $meta_box = wp_parse_args( $meta_box, array(
336
+ 'id' => sanitize_title( $meta_box['title'] ),
337
+ 'context' => 'normal',
338
+ 'priority' => 'high',
339
+ 'post_types' => 'post',
340
+ 'autosave' => false,
341
+ 'default_hidden' => false,
342
+ 'style' => 'default',
343
+ ) );
344
+
345
+ /**
346
+ * Use 'post_types' for better understanding and fallback to 'pages' for previous versions.
347
+ *
348
+ * @since 4.4.1
349
+ */
350
+ if ( ! empty( $meta_box['pages'] ) ) {
351
+ $meta_box['post_types'] = $meta_box['pages'];
352
+ }
353
+
354
+ // Make sure the post type is an array and is sanitized.
355
+ $meta_box['post_types'] = array_map( 'sanitize_key', (array) $meta_box['post_types'] );
356
+
357
+ return $meta_box;
358
+ }
359
+
360
+ /**
361
+ * Normalize an array of fields
362
+ *
363
+ * @param array $fields Array of fields.
364
+ * @param RWMB_Storage_Interface $storage Storage object. Optional.
365
+ *
366
+ * @return array $fields Normalized fields.
367
+ */
368
+ public static function normalize_fields( $fields, $storage = null ) {
369
+ foreach ( $fields as $k => $field ) {
370
+ $field = RWMB_Field::call( 'normalize', $field );
371
+
372
+ // Allow to add default values for fields.
373
+ $field = apply_filters( 'rwmb_normalize_field', $field );
374
+ $field = apply_filters( "rwmb_normalize_{$field['type']}_field", $field );
375
+ $field = apply_filters( "rwmb_normalize_{$field['id']}_field", $field );
376
+
377
+ // Add storage object to field.
378
+ if ( $storage ) {
379
+ $field['storage'] = $storage;
380
+ }
381
+
382
+ $fields[ $k ] = $field;
383
+ }
384
+
385
+ return $fields;
386
+ }
387
+
388
+ /**
389
+ * Check if meta box is saved before.
390
+ * This helps saving empty value in meta fields (text, check box, etc.) and set the correct default values.
391
+ *
392
+ * @return bool
393
+ */
394
+ public function is_saved() {
395
+ foreach ( $this->fields as $field ) {
396
+ if ( empty( $field['id'] ) ) {
397
+ continue;
398
+ }
399
+ $value = RWMB_Field::call( $field, 'raw_meta', $this->object_id );
400
+ if ( false === $value ) {
401
+ continue;
402
+ }
403
+ if (
404
+ ( ! $field['multiple'] && '' !== $value )
405
+ || ( $field['multiple'] && array() !== $value )
406
+ ) {
407
+ return true;
408
+ }
409
+ }
410
+
411
+ return false;
412
+ }
413
+
414
+ /**
415
+ * Check if we're on the right edit screen.
416
+ *
417
+ * @param WP_Screen $screen Screen object. Optional. Use current screen object by default.
418
+ *
419
+ * @return bool
420
+ */
421
+ public function is_edit_screen( $screen = null ) {
422
+ if ( ! ( $screen instanceof WP_Screen ) ) {
423
+ $screen = get_current_screen();
424
+ }
425
+
426
+ return 'post' === $screen->base && in_array( $screen->post_type, $this->post_types, true );
427
+ }
428
+
429
+ /**
430
+ * Magic function to get meta box property.
431
+ *
432
+ * @param string $key Meta box property name.
433
+ *
434
+ * @return mixed
435
+ */
436
+ public function __get( $key ) {
437
+ return isset( $this->meta_box[ $key ] ) ? $this->meta_box[ $key ] : false;
438
+ }
439
+
440
+ /**
441
+ * Set the object ID.
442
+ *
443
+ * @param mixed $id Object ID.
444
+ */
445
+ public function set_object_id( $id = null ) {
446
+ $this->object_id = $id;
447
+ }
448
+
449
+ /**
450
+ * Get object type.
451
+ *
452
+ * @return string
453
+ */
454
+ public function get_object_type() {
455
+ return $this->object_type;
456
+ }
457
+
458
+ /**
459
+ * Get storage object.
460
+ *
461
+ * @return RWMB_Storage_Interface
462
+ */
463
+ public function get_storage() {
464
+ return rwmb_get_storage( $this->object_type, $this );
465
+ }
466
+
467
+ /**
468
+ * Get current object id.
469
+ *
470
+ * @return int|string
471
+ */
472
+ protected function get_current_object_id() {
473
+ return get_the_ID();
474
+ }
475
+ }
inc/meta-box/inc/sanitizer.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sanitize field value before saving.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Sanitize class.
10
+ */
11
+ class RWMB_Sanitizer {
12
+
13
+ /**
14
+ * Built-in callbacks for some specific types.
15
+ *
16
+ * @var array
17
+ */
18
+ protected $callbacks = array(
19
+ 'email' => 'sanitize_email',
20
+ 'file_input' => 'esc_url_raw',
21
+ 'oembed' => 'esc_url_raw',
22
+ 'url' => 'esc_url_raw',
23
+ );
24
+
25
+ /**
26
+ * Register hook to sanitize field value.
27
+ */
28
+ public function init() {
29
+ // Built-in callback.
30
+ foreach ( $this->callbacks as $type => $callback ) {
31
+ add_filter( "rwmb_{$type}_sanitize", $callback );
32
+ }
33
+
34
+ // Custom callback.
35
+ $types = array_diff( get_class_methods( __CLASS__ ), array( 'init' ) );
36
+ foreach ( $types as $type ) {
37
+ add_filter( "rwmb_{$type}_sanitize", array( $this, $type ) );
38
+ }
39
+ }
40
+
41
+ /**
42
+ * Set the value of checkbox to 1 or 0 instead of 'checked' and empty string.
43
+ * This prevents using default value once the checkbox has been unchecked.
44
+ *
45
+ * @link https://github.com/rilwis/meta-box/issues/6
46
+ * @param string $value Checkbox value.
47
+ * @return int
48
+ */
49
+ public function checkbox( $value ) {
50
+ return (int) ! empty( $value );
51
+ }
52
+ }
inc/meta-box/inc/storage-registry.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Storage registry class
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Class RWMB_Storage_Registry
10
+ */
11
+ class RWMB_Storage_Registry {
12
+
13
+ /**
14
+ * List storage instances.
15
+ *
16
+ * @var array
17
+ */
18
+ protected $storages = array();
19
+
20
+ /**
21
+ * Get storage instance.
22
+ *
23
+ * @param string $class_name Storage class name.
24
+ * @return RWMB_Storage_Interface
25
+ */
26
+ public function get( $class_name ) {
27
+ if ( empty( $this->storages[ $class_name ] ) ) {
28
+ if ( ! class_exists( $class_name ) ) {
29
+ return null;
30
+ }
31
+
32
+ $this->storages[ $class_name ] = new $class_name();
33
+ }
34
+
35
+ return $this->storages[ $class_name ];
36
+ }
37
+ }
inc/meta-box/inc/storages/base.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Base storage
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Class RWMB_Base_Storage
10
+ */
11
+ class RWMB_Base_Storage implements RWMB_Storage_Interface {
12
+
13
+ /**
14
+ * Object type.
15
+ *
16
+ * @var string
17
+ */
18
+ protected $object_type;
19
+
20
+ /**
21
+ * Retrieve metadata for the specified object.
22
+ *
23
+ * @param int $object_id ID of the object metadata is for.
24
+ * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
25
+ * the specified object.
26
+ * @param bool|array $args Optional, default is false.
27
+ * If true, return only the first value of the specified meta_key.
28
+ * If is array, use the `single` element.
29
+ * This parameter has no effect if meta_key is not specified.
30
+ * @return mixed Single metadata value, or array of values.
31
+ *
32
+ * @see get_metadata()
33
+ */
34
+ public function get( $object_id, $meta_key, $args = false ) {
35
+ if ( is_array( $args ) ) {
36
+ $single = ! empty( $args['single'] );
37
+ } else {
38
+ $single = (bool) $args;
39
+ }
40
+
41
+ return get_metadata( $this->object_type, $object_id, $meta_key, $single );
42
+ }
43
+
44
+ /**
45
+ * Add metadata
46
+ *
47
+ * @param int $object_id ID of the object metadata is for.
48
+ * @param string $meta_key Metadata key.
49
+ * @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
50
+ * @param bool $unique Optional, default is false.
51
+ * Whether the specified metadata key should be unique for the object.
52
+ * If true, and the object already has a value for the specified metadata key,
53
+ * no change will be made.
54
+ * @return int|false The meta ID on success, false on failure.
55
+ *
56
+ * @see add_metadata()
57
+ */
58
+ public function add( $object_id, $meta_key, $meta_value, $unique = false ) {
59
+ return add_metadata( $this->object_type, $object_id, $meta_key, $meta_value, $unique );
60
+ }
61
+
62
+ /**
63
+ * Update metadata.
64
+ *
65
+ * @param int $object_id ID of the object metadata is for.
66
+ * @param string $meta_key Metadata key.
67
+ * @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
68
+ * @param mixed $prev_value Optional. If specified, only update existing metadata entries with
69
+ * the specified value. Otherwise, update all entries.
70
+ * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
71
+ *
72
+ * @see update_metadata()
73
+ */
74
+ public function update( $object_id, $meta_key, $meta_value, $prev_value = '' ) {
75
+ return update_metadata( $this->object_type, $object_id, $meta_key, $meta_value, $prev_value );
76
+ }
77
+
78
+ /**
79
+ * Delete metadata.
80
+ *
81
+ * @param int $object_id ID of the object metadata is for.
82
+ * @param string $meta_key Metadata key.
83
+ * @param mixed $meta_value Optional. Metadata value. Must be serializable if non-scalar. If specified, only delete
84
+ * metadata entries with this value. Otherwise, delete all entries with the specified meta_key.
85
+ * Pass `null, `false`, or an empty string to skip this check. (For backward compatibility,
86
+ * it is not possible to pass an empty string to delete those entries with an empty string
87
+ * for a value).
88
+ * @param bool $delete_all Optional, default is false. If true, delete matching metadata entries for all objects,
89
+ * ignoring the specified object_id. Otherwise, only delete matching metadata entries for
90
+ * the specified object_id.
91
+ * @return bool True on successful delete, false on failure.
92
+ *
93
+ * @see delete_metadata()
94
+ */
95
+ public function delete( $object_id, $meta_key, $meta_value = '', $delete_all = false ) {
96
+ return delete_metadata( $this->object_type, $object_id, $meta_key, $meta_value, $delete_all );
97
+ }
98
+ }
inc/meta-box/inc/storages/post.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Post storage
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Class RWMB_Post_Storage
10
+ */
11
+ class RWMB_Post_Storage extends RWMB_Base_Storage {
12
+
13
+ /**
14
+ * Object type.
15
+ *
16
+ * @var string
17
+ */
18
+ protected $object_type = 'post';
19
+ }
inc/meta-box/inc/templates/audio.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script id="tmpl-rwmb-media-item" type="text/html">
2
+ <input type="hidden" name="{{{ data.controller.fieldName }}}" value="{{{ data.id }}}" class="rwmb-media-input">
3
+ <div class="rwmb-media-preview">
4
+ <div class="rwmb-media-content">
5
+ <div class="centered">
6
+ <# if ( 'image' === data.type && data.sizes ) { #>
7
+ <# if ( data.sizes.thumbnail ) { #>
8
+ <img src="{{{ data.sizes.thumbnail.url }}}">
9
+ <# } else { #>
10
+ <img src="{{{ data.sizes.full.url }}}">
11
+ <# } #>
12
+ <# } else { #>
13
+ <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>
14
+ <img src="{{ data.image.src }}" />
15
+ <# } else { #>
16
+ <img src="{{ data.icon }}" />
17
+ <# } #>
18
+ <# } #>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ <div class="rwmb-media-info">
23
+ <h4>
24
+ <a href="{{{ data.url }}}" target="_blank" title="{{{ i18nRwmbMedia.view }}}">
25
+ <# if( data.title ) { #> {{{ data.title }}}
26
+ <# } else { #> {{{ i18nRwmbMedia.noTitle }}}
27
+ <# } #>
28
+ </a>
29
+ </h4>
30
+ <p>{{{ data.mime }}}</p>
31
+ <p>
32
+ <a class="rwmb-edit-media" title="{{{ i18nRwmbMedia.edit }}}" href="{{{ data.editLink }}}" target="_blank">
33
+ <span class="dashicons dashicons-edit"></span>{{{ i18nRwmbMedia.edit }}}
34
+ </a>
35
+ <a href="#" class="rwmb-remove-media" title="{{{ i18nRwmbMedia.remove }}}">
36
+ <span class="dashicons dashicons-no-alt"></span>{{{ i18nRwmbMedia.remove }}}
37
+ </a>
38
+ </p>
39
+ </div>
40
+ </script>
inc/meta-box/inc/templates/image-advanced.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script id="tmpl-rwmb-image-item" type="text/html">
2
+ <input type="hidden" name="{{{ data.controller.fieldName }}}" value="{{{ data.id }}}" class="rwmb-media-input">
3
+ <div class="attachment-preview">
4
+ <div class="thumbnail">
5
+ <div class="centered">
6
+ <# if ( 'image' === data.type && data.sizes ) { #>
7
+ <# if ( data.sizes[data.controller.imageSize] ) { #>
8
+ <img src="{{{ data.sizes[data.controller.imageSize].url }}}">
9
+ <# } else { #>
10
+ <img src="{{{ data.sizes.full.url }}}">
11
+ <# } #>
12
+ <# } else { #>
13
+ <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>
14
+ <img src="{{ data.image.src }}" />
15
+ <# } else { #>
16
+ <img src="{{ data.icon }}" />
17
+ <# } #>
18
+ <# } #>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ <div class="rwmb-image-overlay"></div>
23
+ <div class="rwmb-image-actions">
24
+ <a class="rwmb-image-edit rwmb-edit-media" title="{{{ i18nRwmbMedia.edit }}}" href="{{{ data.editLink }}}" target="_blank">
25
+ <span class="dashicons dashicons-edit"></span>
26
+ </a>
27
+ <a href="#" class="rwmb-image-delete rwmb-remove-media" title="{{{ i18nRwmbMedia.remove }}}">
28
+ <span class="dashicons dashicons-no-alt"></span>
29
+ </a>
30
+ </div>
31
+ </script>
inc/meta-box/inc/templates/media.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script id="tmpl-rwmb-media-item" type="text/html">
2
+ <input type="hidden" name="{{{ data.controller.fieldName }}}" value="{{{ data.id }}}" class="rwmb-media-input">
3
+ <div class="rwmb-media-preview attachment-preview">
4
+ <div class="rwmb-media-content thumbnail">
5
+ <div class="centered">
6
+ <# if ( 'image' === data.type && data.sizes ) { #>
7
+ <# if ( data.sizes.thumbnail ) { #>
8
+ <img src="{{{ data.sizes.thumbnail.url }}}">
9
+ <# } else { #>
10
+ <img src="{{{ data.sizes.full.url }}}">
11
+ <# } #>
12
+ <# } else { #>
13
+ <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>
14
+ <img src="{{ data.image.src }}" />
15
+ <# } else { #>
16
+ <img src="{{ data.icon }}" />
17
+ <# } #>
18
+ <# } #>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ <div class="rwmb-media-info">
23
+ <a href="{{{ data.url }}}" class="rwmb-media-title" target="_blank">
24
+ <# if( data.title ) { #>
25
+ {{{ data.title }}}
26
+ <# } else { #>
27
+ {{{ i18nRwmbMedia.noTitle }}}
28
+ <# } #>
29
+ </a>
30
+ <p class="rwmb-media-name">{{{ data.filename }}}</p>
31
+ <p class="rwmb-media-actions">
32
+ <a class="rwmb-edit-media" title="{{{ i18nRwmbMedia.edit }}}" href="{{{ data.editLink }}}" target="_blank">
33
+ <span class="dashicons dashicons-edit"></span>{{{ i18nRwmbMedia.edit }}}
34
+ </a>
35
+ <a href="#" class="rwmb-remove-media" title="{{{ i18nRwmbMedia.remove }}}">
36
+ <span class="dashicons dashicons-no-alt"></span>{{{ i18nRwmbMedia.remove }}}
37
+ </a>
38
+ </p>
39
+ </div>
40
+ </script>
41
+
42
+ <script id="tmpl-rwmb-media-status" type="text/html">
43
+ <# if ( data.maxFiles > 0 ) { #>
44
+ {{{ data.length }}}/{{{ data.maxFiles }}}
45
+ <# if ( 1 < data.maxFiles ) { #>{{{ i18nRwmbMedia.multiple }}}<# } else {#>{{{ i18nRwmbMedia.single }}}<# } #>
46
+ <# } #>
47
+ </script>
48
+
49
+ <script id="tmpl-rwmb-media-button" type="text/html">
50
+ <a class="button">{{{ data.text }}}</a>
51
+ </script>
inc/meta-box/inc/templates/upload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <script id="tmpl-rwmb-upload-area" type="text/html">
2
+ <div class="rwmb-upload-inside">
3
+ <h3>{{{ i18nRwmbMedia.uploadInstructions }}}</h3>
4
+ <p>{{{ i18nRwmbMedia.or }}}</p>
5
+ <p><a href="#" class="rwmb-browse-button button button-hero" id="{{{ _.uniqueId( 'rwmb-upload-browser-') }}}">{{{ i18nRwmbMedia.select }}}</a></p>
6
+ </div>
7
+ </script>
inc/meta-box/inc/templates/video.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script id="tmpl-rwmb-video-item" type="text/html">
2
+ <input type="hidden" name="{{{ data.controller.fieldName }}}" value="{{{ data.id }}}" class="rwmb-media-input">
3
+ <div class="rwmb-media-preview">
4
+ <div class="rwmb-media-content">
5
+ <div class="centered">
6
+ <# if( _.indexOf( i18nRwmbVideo.extensions, data.url.substr( data.url.lastIndexOf('.') + 1 ) ) > -1 ) { #>
7
+ <div class="rwmb-video-wrapper">
8
+ <video controls="controls" class="rwmb-video-element" preload="metadata"
9
+ <# if ( data.width ) { #>width="{{ data.width }}"<# } #>
10
+ <# if ( data.height ) { #>height="{{ data.height }}"<# } #>
11
+ <# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>>
12
+ <source type="{{ data.mime }}" src="{{ data.url }}"/>
13
+ </video>
14
+ </div>
15
+ <# } else { #>
16
+ <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>
17
+ <img src="{{ data.image.src }}" />
18
+ <# } else { #>
19
+ <img src="{{ data.icon }}" />
20
+ <# } #>
21
+ <# } #>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <div class="rwmb-media-info">
26
+ <a href="{{{ data.url }}}" class="rwmb-media-title" target="_blank">
27
+ <# if( data.title ) { #>
28
+ {{{ data.title }}}
29
+ <# } else { #>
30
+ {{{ i18nRwmbMedia.noTitle }}}
31
+ <# } #>
32
+ </a>
33
+ <p class="rwmb-media-name">{{{ data.filename }}}</p>
34
+ <p class="rwmb-media-actions">
35
+ <a class="rwmb-edit-media" title="{{{ i18nRwmbMedia.edit }}}" href="{{{ data.editLink }}}" target="_blank">
36
+ <span class="dashicons dashicons-edit"></span>{{{ i18nRwmbMedia.edit }}}
37
+ </a>
38
+ <a href="#" class="rwmb-remove-media" title="{{{ i18nRwmbMedia.remove }}}">
39
+ <span class="dashicons dashicons-no-alt"></span>{{{ i18nRwmbMedia.remove }}}
40
+ </a>
41
+ </p>
42
+ </div>
43
+ </script>
inc/meta-box/inc/validation.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Validation module.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * Validation class.
10
+ */
11
+ class RWMB_Validation {
12
+
13
+ /**
14
+ * Add hooks when module is loaded.
15
+ */
16
+ public function __construct() {
17
+ add_action( 'rwmb_after', array( $this, 'rules' ) );
18
+ add_action( 'rwmb_enqueue_scripts', array( $this, 'enqueue' ) );
19
+ }
20
+
21
+ /**
22
+ * Output validation rules of each meta box.
23
+ * The rules are outputted in [data-rules] attribute of an hidden <script> and will be converted into JSON by JS.
24
+ *
25
+ * @param RW_Meta_Box $object Meta Box object.
26
+ */
27
+ public function rules( RW_Meta_Box $object ) {
28
+ if ( ! empty( $object->meta_box['validation'] ) ) {
29
+ echo '<script type="text/html" class="rwmb-validation-rules" data-rules="' . esc_attr( wp_json_encode( $object->meta_box['validation'] ) ) . '"></script>';
30
+ }
31
+ }
32
+
33
+ /**
34
+ * Enqueue scripts for validation.
35
+ *
36
+ * @param RW_Meta_Box $object Meta Box object.
37
+ */
38
+ public function enqueue( RW_Meta_Box $object ) {
39
+ if ( empty( $object->meta_box['validation'] ) ) {
40
+ return;
41
+ }
42
+ wp_enqueue_script( 'jquery-validation', RWMB_JS_URL . 'jquery-validation/jquery.validate.min.js', array( 'jquery' ), '1.15.0', true );
43
+ wp_enqueue_script( 'jquery-validation-additional-methods', RWMB_JS_URL . 'jquery-validation/additional-methods.min.js', array( 'jquery-validation' ), '1.15.0', true );
44
+ wp_enqueue_script( 'rwmb-validate', RWMB_JS_URL . 'validate.js', array( 'jquery-validation', 'jquery-validation-additional-methods' ), RWMB_VER, true );
45
+
46
+ RWMB_Field::localize_script( 'rwmb-validate', 'rwmbValidate', array(
47
+ 'summaryMessage' => esc_html__( 'Please correct the errors highlighted below and try again.', 'meta-box' ),
48
+ ) );
49
+ }
50
+ }
inc/meta-box/inc/walkers/base.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Base walker.
4
+ * Walkers must inherit this class and overwrite methods with its own.
5
+ *
6
+ * @package Meta Box
7
+ */
8
+
9
+ /**
10
+ * Base walker class.
11
+ */
12
+ abstract class RWMB_Walker_Base extends Walker {
13
+ /**
14
+ * Field data.
15
+ *
16
+ * @access public
17
+ * @var array
18
+ */
19
+ public $field;
20
+
21
+ /**
22
+ * Meta data.
23
+ *
24
+ * @access public
25
+ * @var array
26
+ */
27
+ public $meta = array();
28
+
29
+ /**
30
+ * Constructor.
31
+ *
32
+ * @param array $db_fields Database fields.
33
+ * @param array $field Field parameters.
34
+ * @param mixed $meta Meta value.
35
+ */
36
+ public function __construct( $db_fields, $field, $meta ) {
37
+ $this->db_fields = wp_parse_args( (array) $db_fields, array(
38
+ 'parent' => '',
39
+ 'id' => '',
40
+ 'label' => '',
41
+ ) );
42
+ $this->field = $field;
43
+ $this->meta = (array) $meta;
44
+ }
45
+ }
inc/meta-box/inc/walkers/input-list.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The input list walker for checkbox and radio list fields.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The input list walker class.
10
+ */
11
+ class RWMB_Walker_Input_List extends RWMB_Walker_Base {
12
+ /**
13
+ * Starts the list before the elements are added.
14
+ *
15
+ * @param string $output Passed by reference. Used to append additional content.
16
+ * @param int $depth Depth of the item.
17
+ * @param array $args An array of additional arguments.
18
+ */
19
+ public function start_lvl( &$output, $depth = 0, $args = array() ) {
20
+ $output .= '<ul class="rwmb-input-list">';
21
+ }
22
+
23
+ /**
24
+ * Ends the list of after the elements are added.
25
+ *
26
+ * @param string $output Passed by reference. Used to append additional content.
27
+ * @param int $depth Depth of the item.
28
+ * @param array $args An array of additional arguments.
29
+ */
30
+ public function end_lvl( &$output, $depth = 0, $args = array() ) {
31
+ $output .= '</ul>';
32
+ }
33
+
34
+ /**
35
+ * Start the element output.
36
+ *
37
+ * @param string $output Passed by reference. Used to append additional content.
38
+ * @param object $object The data object.
39
+ * @param int $depth Depth of the item.
40
+ * @param array $args An array of additional arguments.
41
+ * @param int $current_object_id ID of the current item.
42
+ */
43
+ public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
44
+ $label = $this->db_fields['label'];
45
+ $id = $this->db_fields['id'];
46
+ $attributes = RWMB_Field::call( 'get_attributes', $this->field, $object->$id );
47
+
48
+ $output .= sprintf(
49
+ '<li><label><input %s %s>%s</label>',
50
+ RWMB_Field::render_attributes( $attributes ),
51
+ checked( in_array( $object->$id, $this->meta ), 1, false ),
52
+ RWMB_Field::filter( 'choice_label', $object->$label, $this->field, $object )
53
+ );
54
+ }
55
+
56
+ /**
57
+ * Ends the element output, if needed.
58
+ *
59
+ * @param string $output Passed by reference. Used to append additional content.
60
+ * @param object $object The data object.
61
+ * @param int $depth Depth of the item.
62
+ * @param array $args An array of additional arguments.
63
+ */
64
+ public function end_el( &$output, $object, $depth = 0, $args = array() ) {
65
+ $output .= '</li>';
66
+ }
67
+ }
inc/meta-box/inc/walkers/select-tree.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Select tree walker for cascading select fields.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The select tree walker class.
10
+ */
11
+ class RWMB_Walker_Select_Tree {
12
+ /**
13
+ * Field data.
14
+ *
15
+ * @var string
16
+ */
17
+ public $field;
18
+
19
+ /**
20
+ * Field meta value.
21
+ *
22
+ * @var array
23
+ */
24
+ public $meta = array();
25
+
26
+ /**
27
+ * Constructor.
28
+ *
29
+ * @param array $db_fields Database fields.
30
+ * @param array $field Field parameters.
31
+ * @param mixed $meta Meta value.
32
+ */
33
+ public function __construct( $db_fields, $field, $meta ) {
34
+ $this->db_fields = wp_parse_args( (array) $db_fields, array(
35
+ 'parent' => '',
36
+ 'id' => '',
37
+ 'label' => '',
38
+ ) );
39
+ $this->field = $field;
40
+ $this->meta = (array) $meta;
41
+ }
42
+
43
+ /**
44
+ * Display array of elements hierarchically.
45
+ *
46
+ * @param array $options An array of options.
47
+ *
48
+ * @return string
49
+ */
50
+ public function walk( $options ) {
51
+ $parent = $this->db_fields['parent'];
52
+ $children = array();
53
+
54
+ foreach ( $options as $option ) {
55
+ $index = isset( $option->$parent ) ? $option->$parent : 0;
56
+ $children[ $index ][] = $option;
57
+ }
58
+
59
+ $top_level = isset( $children[0] ) ? 0 : $options[0]->$parent;
60
+ return $this->display_level( $children, $top_level, true );
61
+ }
62
+
63
+ /**
64
+ * Display a hierarchy level.
65
+ *
66
+ * @param array $options An array of options.
67
+ * @param int $parent_id Parent item ID.
68
+ * @param bool $active Whether to show or hide.
69
+ *
70
+ * @return string
71
+ */
72
+ public function display_level( $options, $parent_id = 0, $active = false ) {
73
+ $id = $this->db_fields['id'];
74
+ $field = $this->field;
75
+ $walker = new RWMB_Walker_Select( $this->db_fields, $field, $this->meta );
76
+ $attributes = RWMB_Field::call( 'get_attributes', $field, $this->meta );
77
+
78
+ $children = $options[ $parent_id ];
79
+ $output = sprintf(
80
+ '<div class="rwmb-select-tree %s" data-parent-id="%s"><select %s>',
81
+ $active ? '' : 'hidden',
82
+ $parent_id,
83
+ RWMB_Field::render_attributes( $attributes )
84
+ );
85
+ $output .= isset( $field['placeholder'] ) ? "<option value=''>{$field['placeholder']}</option>" : '<option></option>';
86
+ $output .= $walker->walk( $children, - 1 );
87
+ $output .= '</select>';
88
+
89
+ foreach ( $children as $c ) {
90
+ if ( isset( $options[ $c->$id ] ) ) {
91
+ $output .= $this->display_level( $options, $c->$id, in_array( $c->$id, $this->meta ) && $active );
92
+ }
93
+ }
94
+
95
+ $output .= '</div>';
96
+ return $output;
97
+ }
98
+ }
inc/meta-box/inc/walkers/select.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Select walker select fields.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * The select walker class.
10
+ */
11
+ class RWMB_Walker_Select extends RWMB_Walker_Base {
12
+ /**
13
+ * Start the element output.
14
+ *
15
+ * @see Walker::start_el()
16
+ *
17
+ * @param string $output Passed by reference. Used to append additional content.
18
+ * @param object $object The data object.
19
+ * @param int $depth Depth of the item.
20
+ * @param array $args An array of additional arguments.
21
+ * @param int $current_object_id ID of the current item.
22
+ */
23
+ public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
24
+ $label = $this->db_fields['label'];
25
+ $id = $this->db_fields['id'];
26
+ $meta = $this->meta;
27
+ $indent = str_repeat( '&nbsp;', $depth * 4 );
28
+
29
+ $output .= sprintf(
30
+ '<option value="%s" %s>%s%s</option>',
31
+ esc_attr( $object->$id ),
32
+ selected( in_array( $object->$id, $meta ), true, false ),
33
+ $indent,
34
+ esc_html( RWMB_Field::filter( 'choice_label', $object->$label, $this->field, $object ) )
35
+ );
36
+ }
37
+ }
inc/meta-box/inc/wpml.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The WPML compatibility module, allowing all fields are translatable by WPML plugin.
4
+ *
5
+ * @package Meta Box
6
+ */
7
+
8
+ /**
9
+ * WPML compatibility class
10
+ */
11
+ class RWMB_WPML {
12
+ /**
13
+ * List of fields that need to translate values (because they're saved as IDs).
14
+ *
15
+ * @var array
16
+ */
17
+ protected $field_types = array( 'post', 'taxonomy_advanced' );
18
+
19
+ /**
20
+ * Initialize.
21
+ */
22
+ public function init() {
23
+ /**
24
+ * Run before meta boxes are registered so it can modify fields.
25
+ *
26
+ * @see modify_field()
27
+ */
28
+ add_action( 'init', array( $this, 'register_hooks' ), 9 );
29
+ }
30
+
31
+ /**
32
+ * Register hooks.
33
+ */
34
+ public function register_hooks() {
35
+ if ( ! defined( 'ICL_SITEPRESS_VERSION' ) ) {
36
+ return;
37
+ }
38
+ add_filter( 'wpml_duplicate_generic_string', array( $this, 'translate_ids' ), 10, 3 );
39
+ add_filter( 'rwmb_normalize_field', array( $this, 'modify_field' ) );
40
+ }
41
+
42
+ /**
43
+ * Translating IDs stored as field values upon WPML post/page duplication.
44
+ *
45
+ * @param mixed $value Meta value.
46
+ * @param string $target_language Target language.
47
+ * @param array $meta_data Meta arguments.
48
+ * @return mixed
49
+ */
50
+ public function translate_ids( $value, $target_language, $meta_data ) {
51
+ if ( 'custom_field' !== $meta_data['context'] ) {
52
+ return $value;
53
+ }
54
+
55
+ $field = rwmb_get_registry( 'field' )->get( $meta_data['key'], get_post_type( $meta_data['master_post_id'] ) );
56
+ if ( false === $field || ! in_array( $field['type'], $this->field_types, true ) ) {
57
+ return $value;
58
+ }
59
+
60
+ // Object type needed for WPML filter differs between fields.
61
+ $object_type = 'taxonomy_advanced' === $field['type'] ? $field['taxonomy'] : $field['post_type'];
62
+
63
+ // Translating values, whether are stored as comma separated strings or not.
64
+ if ( false === strpos( $value, ',' ) ) {
65
+ $value = apply_filters( 'wpml_object_id', $value, $object_type, true, $target_language );
66
+ return $value;
67
+ }
68
+
69
+ // Dealing with IDs stored as comma separated strings.
70
+ $translated_values = array();
71
+ $values = explode( ',', $value );
72
+
73
+ foreach ( $values as $v ) {
74
+ $translated_values[] = apply_filters( 'wpml_object_id', $v, $object_type, true, $target_language );
75
+ }
76
+
77
+ $value = implode( ',', $translated_values );
78
+ return $value;
79
+ }
80
+
81
+ /**
82
+ * Modified field depends on its translation status.
83
+ * If the post is a translated version of another post and the field is set to:
84
+ * - Do not translate: hide the field.
85
+ * - Copy: make it disabled so users cannot edit.
86
+ * - Translate: do nothing.
87
+ *
88
+ * @param array $field Field parameters.
89
+ *
90
+ * @return mixed
91
+ */
92
+ public function modify_field( $field ) {
93
+ global $wpml_post_translations;
94
+
95
+ if ( empty( $field['id'] ) ) {
96
+ return $field;
97
+ }
98
+
99
+ // Get post ID.
100
+ $post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT );
101
+ if ( ! $post_id ) {
102
+ $post_id = filter_input( INPUT_POST, 'post_ID', FILTER_SANITIZE_NUMBER_INT );
103
+ }
104
+
105
+ // If the post is the original one: do nothing.
106
+ if ( ! method_exists( $wpml_post_translations, 'get_source_lang_code' ) || ! $wpml_post_translations->get_source_lang_code( $post_id ) ) {
107
+ return $field;
108
+ }
109
+
110
+ // Get setting for the custom field translation.
111
+ $custom_fields_translation = apply_filters( 'wpml_sub_setting', false, 'translation-management', 'custom_fields_translation' );
112
+ if ( ! isset( $custom_fields_translation[ $field['id'] ] ) ) {
113
+ return $field;
114
+ }
115
+
116
+ $setting = intval( $custom_fields_translation[ $field['id'] ] );
117
+ if ( 0 === $setting ) { // Do not translate: hide it.
118
+ $field['class'] .= ' hidden';
119
+ } elseif ( 1 === $setting ) { // Copy: disable editing.
120
+ $field['disabled'] = true;
121
+ }
122
+
123
+ return $field;
124
+ }
125
+ }
inc/meta-box/js/autocomplete.js CHANGED
@@ -1,62 +1,49 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
  /**
6
  * Update date picker element
7
  * Used for static & dynamic added elements (when clone)
8
  */
9
- function updateAutocomplete( e )
10
- {
11
  var $this = $( this ),
12
- $result = $this.next(),
13
- name = $this.data( 'name' );
 
14
 
15
  // If the function is called on cloning, then change the field name and clear all results
16
  // @see clone.js
17
- if ( e.hasOwnProperty( 'type' ) && 'clone' == e.type )
18
- {
19
- name = name.replace( /\[(\d+)\]/, function ( match, p1 )
20
- {
21
- return '[' + ( parseInt( p1, 10 ) + 1 ) + ']';
22
- } );
23
-
24
- // Update the "data-name" attribute for further cloning
25
- $this.attr( 'data-name', name );
26
-
27
  // Clear all results
28
  $result.html( '' );
29
  }
30
 
31
- $this.removeClass( 'ui-autocomplete-input' ).attr( 'id', '' )
32
- .autocomplete( {
33
  minLength: 0,
34
- source : $this.data( 'options' ),
35
- select : function ( event, ui )
36
- {
37
  $result.append(
38
  '<div class="rwmb-autocomplete-result">' +
39
- '<div class="label">' + ui.item.label + '</div>' +
40
  '<div class="actions">' + RWMB_Autocomplete.delete + '</div>' +
41
  '<input type="hidden" class="rwmb-autocomplete-value" name="' + name + '" value="' + ui.item.value + '">' +
42
  '</div>'
43
  );
44
 
45
  // Reinitialize value
46
- this.value = '';
47
 
48
  return false;
49
  }
50
  } );
51
  }
52
 
53
- $( '.rwmb-autocomplete-wrapper input[type="text"]' ).each( updateAutocomplete );
54
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-autocomplete', updateAutocomplete );
55
-
56
- // Handle remove action
57
- $( document ).on( 'click', '.rwmb-autocomplete-result .actions', function ()
58
- {
59
- // remove result
60
- $( this ).parent().remove();
61
- } );
62
- } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
  /**
5
  * Update date picker element
6
  * Used for static & dynamic added elements (when clone)
7
  */
8
+ function updateAutocomplete( e ) {
 
9
  var $this = $( this ),
10
+ $search = $this.siblings( '.rwmb-autocomplete-search' ),
11
+ $result = $this.siblings( '.rwmb-autocomplete-results' ),
12
+ name = $this.attr( 'name' );
13
 
14
  // If the function is called on cloning, then change the field name and clear all results
15
  // @see clone.js
16
+ if ( e.hasOwnProperty( 'type' ) && 'clone' == e.type ) {
 
 
 
 
 
 
 
 
 
17
  // Clear all results
18
  $result.html( '' );
19
  }
20
 
21
+ $search.removeClass( 'ui-autocomplete-input' ).autocomplete( {
 
22
  minLength: 0,
23
+ source: $this.data( 'options' ),
24
+ select: function ( event, ui ) {
 
25
  $result.append(
26
  '<div class="rwmb-autocomplete-result">' +
27
+ '<div class="label">' + ( typeof ui.item.excerpt !== 'undefined' ? ui.item.excerpt : ui.item.label ) + '</div>' +
28
  '<div class="actions">' + RWMB_Autocomplete.delete + '</div>' +
29
  '<input type="hidden" class="rwmb-autocomplete-value" name="' + name + '" value="' + ui.item.value + '">' +
30
  '</div>'
31
  );
32
 
33
  // Reinitialize value
34
+ $search.val( '' );
35
 
36
  return false;
37
  }
38
  } );
39
  }
40
 
41
+ $( '.rwmb-autocomplete-wrapper input[type="hidden"]' ).each( updateAutocomplete );
42
+ $( document )
43
+ .on( 'clone', '.rwmb-autocomplete', updateAutocomplete )
44
+ // Handle remove action
45
+ .on( 'click', '.rwmb-autocomplete-result .actions', function () {
46
+ // remove result
47
+ $( this ).parent().remove();
48
+ } );
49
+ } );
 
inc/meta-box/js/autosave.js CHANGED
@@ -1,19 +1,16 @@
1
- jQuery( function( $ )
2
- {
3
  'use strict';
4
 
5
- $( document ).ajaxSend( function( e, xhr, s )
6
- {
7
- if ( typeof s.data !== 'undefined' && -1 !== s.data.indexOf( 'action=autosave' ) )
8
- {
9
- $( '.rwmb-meta-box').each( function()
10
- {
11
- var $meta_box = $( this );
12
- if ( $meta_box.data( 'autosave' ) === true )
13
- {
14
- s.data += '&' + $meta_box.find( ':input' ).serialize();
15
- }
16
- } );
17
  }
 
 
 
 
 
 
 
18
  } );
19
- } );
1
+ ( function ( $, document ) {
 
2
  'use strict';
3
 
4
+ $( document ).ajaxSend( function ( event, xhr, settings ) {
5
+ if ( typeof settings.data === 'undefined' || -1 === settings.data.indexOf( 'wp_autosave' ) ) {
6
+ return;
 
 
 
 
 
 
 
 
 
7
  }
8
+ var inputSelectors = 'input[class*="rwmb"], textarea[class*="rwmb"], select[class*="rwmb"], button[class*="rwmb"], input[name^="nonce_"]';
9
+ $( '.rwmb-meta-box' ).each( function () {
10
+ var $meta_box = $( this );
11
+ if ( true === $meta_box.data( 'autosave' ) ) {
12
+ settings.data += '&' + $meta_box.find( inputSelectors ).serialize();
13
+ }
14
+ } );
15
  } );
16
+ } )( jQuery, document );
inc/meta-box/js/button-group.js ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function ( $ ) {
2
+ 'use strict';
3
+
4
+ function update() {
5
+ var $this = $( this ),
6
+ $input = $this.find( 'input' ),
7
+ $label = $input.parent();
8
+
9
+ if ( $input.prop( 'checked' ) ) {
10
+ $label.addClass( 'selected' );
11
+ } else {
12
+ $label.removeClass( 'selected' );
13
+ }
14
+ }
15
+
16
+ function clickHandler() {
17
+ var $this = $( this ),
18
+ $input = $this.find( 'input' ),
19
+ $label = $input.parent(),
20
+ type = $input.attr( 'type' ),
21
+ $allLabels = $this.parent().find( 'label' );
22
+ if ( ! $input.prop( 'checked' ) ) {
23
+ $label.removeClass( 'selected' );
24
+ return;
25
+ }
26
+ $label.addClass( 'selected' );
27
+
28
+ if ( 'radio' === type ) {
29
+ $allLabels.removeClass( 'selected' );
30
+ $label.addClass( 'selected' );
31
+ }
32
+ }
33
+
34
+ $( '.rwmb-button-input-list li' ).each( update );
35
+ $( document ).on( 'click', '.rwmb-button-input-list li', clickHandler );
36
+ $( document ).on( 'clone', '.rwmb-button-input-list', update );
37
+ } );
inc/meta-box/js/clone.js CHANGED
@@ -1,253 +1,260 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  /**
6
  * Clone fields
7
  * @param $container A div container which has all fields
8
- * @return void
9
  */
10
- function clone( $container )
11
- {
12
- var $clone_last = $container.find( '.rwmb-clone:last' ),
13
- $clone = $clone_last.clone(),
14
- $input;
15
-
16
- $clone.insertAfter( $clone_last );
17
- $input = $clone.find( ':input[class|="rwmb"]' );
18
-
19
- // Increment each field type
20
- $input.each( function ()
21
- {
22
- var $this = $( this );
23
-
24
- if ( $this.attr( 'type' ) === 'radio' || $this.attr( 'type' ) === 'checkbox' )
25
- {
26
- // Reset 'checked' attribute
27
- $this.removeAttr( 'checked' );
28
- }
29
- else
30
- {
31
- // Reset value
32
- $this.val( '' );
33
- }
34
 
35
- // Get the field name, and increment
36
- var name = $this.attr( 'name' ).replace( /\[(\d+)\]/, function ( match, p1 )
37
- {
38
- return '[' + ( parseInt( p1, 10 ) + 1 ) + ']';
39
- } );
40
 
41
- // Update the "name" attribute
42
- $this.attr( 'name', name );
43
-
44
- // Get the field id, and increment
45
- // Not all fields require id, such as 'radio', 'checkbox_list'
46
- var id = $this.attr( 'id' );
47
- if ( id )
48
- {
49
- if ( /_(\d+)/.test( id ) )
50
- {
51
- id = id.replace( /_(\d+)/, function ( match, p1 )
52
- {
53
- return '_' + ( parseInt( p1, 10 ) + 1 );
54
- } );
55
- }
56
- else
57
- {
58
- id += '_1';
59
- }
60
 
61
- // Update the "id" attribute
62
- $this.attr( 'id', id );
63
- }
64
 
65
- // Update the address_button "value" attribute
66
- var $address_button = $clone.find( '.rwmb-map-goto-address-button' );
67
- if ( $address_button )
68
- {
69
- var value = $address_button.attr( 'value' );
70
- if ( /_(\d+)/.test( value ) )
71
- {
72
- value = value.replace( /_(\d+)/, function ( match, p1 )
73
- {
74
- return '_' + ( parseInt( p1, 10 ) + 1 );
75
- } );
76
- }
77
- else
78
- {
79
- value += '_1';
80
- }
81
- $address_button.attr( 'value', value );
82
- }
83
- } );
84
 
85
- // Toggle remove buttons
86
- toggleRemoveButtons( $input );
87
 
88
- // Trigger custom clone event
89
- $input.trigger( 'clone' );
90
  }
91
 
92
  /**
93
  * Hide remove buttons when there's only 1 of them
94
  *
95
- * @param $el jQuery element. If not supplied, the function will applies for all fields
96
- *
97
- * @return void
98
  */
99
- function toggleRemoveButtons( $el )
100
- {
101
- var $button;
102
- $el = $el || $( '.rwmb-field' );
103
- $el.each( function ()
104
- {
105
- $button = $( this ).find( '.remove-clone' );
106
- if ( $button.length < 2 )
107
- {
108
- $button.hide();
109
- }
110
- else
111
- {
112
- $button.show();
113
- }
114
  } );
115
  }
116
 
117
  /**
118
- * Clone WYSIWYG field
119
- * @param $container
120
- * @return void
 
121
  */
122
- function cloneWYSIWYG( $container )
123
- {
124
- var $clone_first = $container.find( '.rwmb-clone:first' ),
125
- $clone_last = $container.find( '.rwmb-clone:last' ),
126
- $clone = $( '<div />' ).addClass( 'rwmb-clone' ),
127
- field_name = $clone_last.find( 'textarea.wp-editor-area' ).attr( 'name' ),
128
- field_id = field_name.replace( /\[(\d+)\]/, '' );
129
-
130
- //Create some global vars
131
- var new_index = 0;
132
- var new_name = field_name.replace( /\[(\d+)\]/, function ( match, p1 )
133
- {
134
- new_index = ( parseInt( p1, 10 ) + 1 );
135
- return '[' + new_index + ']';
136
- } );
137
-
138
- if ( typeof rwmb_cloneable_editors !== 'undefined' && typeof rwmb_cloneable_editors[field_id] !== 'undefined' )
139
- {
140
- //Get HTML of editor from global object
141
- var cloned_editor = $( rwmb_cloneable_editors[field_id] );
142
-
143
- //Fill new clone with html form global object
144
- $clone.append( cloned_editor );
145
-
146
- //Add remove button to clone
147
- $clone.append( $clone_last.find( '.remove-clone' ).clone() );
148
 
149
- //Add new clone after the last clone
150
- $clone.insertAfter( $clone_last );
151
-
152
- //Replace ID of field with new ID
153
- var new_id = cloned_editor.attr( 'id' ).replace( /\[(\d+)\]/, '[' + new_index + ']' );
154
- cloned_editor.attr( 'id', new_id );
155
-
156
- //Replace all IDs within cloned field
157
- cloned_editor.find( '[id*="' + field_id + '"]' ).each( function ()
158
- {
159
- var id = $( this ).attr( 'id' ).replace( /\[(\d+)\]/, '[' + new_index + ']' );
160
- $( this ).attr( 'id', id );
161
- } );
162
-
163
- //Get the new textarea element
164
- var textarea = $( cloned_editor ).find( 'textarea.wp-editor-area' );
165
-
166
- // Update the "name" attribute
167
- textarea.attr( 'name', new_name );
168
-
169
- //Empty the textarea
170
- textarea.html( '' );
171
-
172
- //Update editor link, so we can add media to the new editor
173
- cloned_editor.find( '#insert-media-button' ).data( 'editor', new_name );
174
-
175
-
176
- //Get TinyMCE setting for our fields
177
- var tmceinit = tinyMCEPreInit.mceInit[$clone_first.find( 'textarea.wp-editor-area' ).attr( 'name' )];
178
- var tmceqtinit = tinyMCEPreInit.qtInit[$clone_first.find( 'textarea.wp-editor-area' ).attr( 'name' )];
179
 
180
- //Replace id & elements with new created field names
181
- tmceinit.elements = new_name;
182
- tmceqtinit.id = new_name;
 
 
 
183
 
184
- //Initialize TinyMCE
185
- try
186
- {
187
- tinymce.init( tmceinit );
188
- }
189
- catch ( e )
190
- {
191
  }
192
- if ( typeof(QTags) === 'function' )
193
- {
194
- try
195
- {
196
- quicktags( tmceqtinit );
197
- }
198
- catch ( e )
199
- {
200
- }
201
- }
202
-
203
- // Toggle remove buttons
204
- toggleRemoveButtons( $clone );
205
-
206
- //Trigger custom clone event
207
- textarea.trigger( 'clone' );
208
- }
209
 
 
 
 
 
 
 
 
 
 
 
210
  }
211
 
 
 
 
 
212
 
213
- // Add more clones
214
- $( '.add-clone' ).on( 'click', function ( e )
215
- {
216
- e.preventDefault();
217
 
218
- var $input = $( this ).parents( '.rwmb-input' );
 
 
 
 
 
 
219
 
220
- if ( $( this ).parents( '.rwmb-field' ).hasClass( 'rwmb-wysiwyg-wrapper' ) )
221
- {
222
- cloneWYSIWYG( $input );
223
- }
224
- else
225
- {
226
- clone( $input );
227
- }
228
-
229
- toggleRemoveButtons( $input );
230
- } );
231
 
232
- // Remove clones
233
- $( '.rwmb-input' ).on( 'click', '.remove-clone', function ( e )
234
- {
235
- e.preventDefault();
236
-
237
- var $this = $( this ),
238
- $input = $this.parents( '.rwmb-input' );
239
-
240
- // Remove clone only if there're 2 or more of them
241
- if ( $input.find( '.rwmb-clone' ).length <= 1 )
242
- {
243
- return;
244
- }
245
 
246
- $this.parent().remove();
 
 
 
247
 
248
- // Toggle remove buttons
249
- toggleRemoveButtons( $input );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  } );
251
-
252
- toggleRemoveButtons();
253
  } );
1
+ /* global jQuery */
2
+ jQuery( function ( $ ) {
3
  'use strict';
4
 
5
+ // Object holds all methods related to fields' index when clone
6
+ var cloneIndex = {
7
+ /**
8
+ * Set index for fields in a .rwmb-clone
9
+ * @param $inputs .rwmb-clone element
10
+ * @param index Index value
11
+ */
12
+ set: function ( $inputs, index ) {
13
+ $inputs.each( function () {
14
+ var $field = $( this );
15
+
16
+ // Name attribute
17
+ var name = this.name;
18
+ if ( name && ! $field.closest( '.rwmb-group-clone' ).length ) {
19
+ $field.attr( 'name', cloneIndex.replace( index, name, '[', ']', false ) );
20
+ }
21
+
22
+ // ID attribute
23
+ var id = this.id;
24
+ if ( id ) {
25
+ $field.attr( 'id', cloneIndex.replace( index, id, '_', '', true, true ) );
26
+ }
27
+
28
+ $field.trigger( 'update_index', index );
29
+ } );
30
+
31
+ // Address button's value attribute
32
+ var $address = $inputs.filter( '.rwmb-map-goto-address-button' );
33
+ if ( $address.length ) {
34
+ var value = $address.attr( 'value' );
35
+ $address.attr( 'value', cloneIndex.replace( index, value, '_' ) );
36
+ }
37
+ },
38
+
39
+ /**
40
+ * Replace an attribute of a field with updated index
41
+ * @param index New index value
42
+ * @param value Attribute value
43
+ * @param before String before returned value
44
+ * @param after String after returned value
45
+ * @param alternative Check if attribute does not contain any integer, will reset the attribute?
46
+ * @param isEnd Check if we find string at the end?
47
+ * @return string
48
+ */
49
+ replace: function ( index, value, before, after, alternative, isEnd ) {
50
+ before = before || '';
51
+ after = after || '';
52
+
53
+ if ( typeof alternative === 'undefined' ) {
54
+ alternative = true;
55
+ }
56
+
57
+ var end = isEnd ? '$' : '';
58
+
59
+ var regex = new RegExp( cloneIndex.escapeRegex( before ) + '(\\d+)' + cloneIndex.escapeRegex( after ) + end ),
60
+ newValue = before + index + after;
61
+
62
+ return regex.test( value ) ? value.replace( regex, newValue ) : (alternative ? value + newValue : value );
63
+ },
64
+
65
+ /**
66
+ * Helper function to escape string in regular expression
67
+ * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
68
+ * @param string
69
+ * @return string
70
+ */
71
+ escapeRegex: function ( string ) {
72
+ return string.replace( /[.*+?^${}()|[\]\\]/g, "\\$&" );
73
+ },
74
+
75
+ /**
76
+ * Helper function to create next index for clones
77
+ * @param $container .rwmb-input container
78
+ * @return integer
79
+ */
80
+ nextIndex: function ( $container ) {
81
+ var nextIndex = $container.data( 'next-index' );
82
+ $container.data( 'next-index', nextIndex + 1 );
83
+ return nextIndex;
84
+ }
85
+ };
86
+
87
+ // Object holds all method related to fields' value when clone.
88
+ var cloneValue = {
89
+ /**
90
+ * Reset field value when clone. Expect this = current input.
91
+ */
92
+ reset: function() {
93
+ cloneValue.$field = $( this );
94
+ cloneValue.type = cloneValue.$field.attr( 'type' );
95
+ cloneValue.isHiddenField = cloneValue.$field.hasClass( 'rwmb-hidden' );
96
+
97
+ if ( true === cloneValue.$field.data( 'clone-default' ) ) {
98
+ cloneValue.resetToDefault();
99
+ } else {
100
+ cloneValue.clear();
101
+ }
102
+ },
103
+ /**
104
+ * Reset field value to its default.
105
+ */
106
+ resetToDefault: function() {
107
+ var defaultValue = cloneValue.$field.data( 'default' );
108
+ if ( 'radio' === cloneValue.type ) {
109
+ cloneValue.$field.prop( 'checked', cloneValue.$field.val() === defaultValue );
110
+ } else if ( 'checkbox' === cloneValue.type ) {
111
+ cloneValue.$field.prop( 'checked', !!defaultValue );
112
+ } else if ( 'select' === cloneValue.type ) {
113
+ cloneValue.$field.find( 'option[value="' + defaultValue + '"]' ).prop( 'selected', true );
114
+ } else if ( ! cloneValue.isHiddenField ) {
115
+ cloneValue.$field.val( defaultValue );
116
+ }
117
+ },
118
+ /**
119
+ * Clear field value.
120
+ */
121
+ clear: function() {
122
+ if ( 'radio' === cloneValue.type || 'checkbox' === cloneValue.type ) {
123
+ cloneValue.$field.prop( 'checked', false );
124
+ } else if ( 'select' === cloneValue.type ) {
125
+ cloneValue.$field.prop( 'selectedIndex', - 1 );
126
+ } else if ( ! cloneValue.isHiddenField ) {
127
+ cloneValue.$field.val( '' );
128
+ }
129
+ }
130
+ };
131
+
132
  /**
133
  * Clone fields
134
  * @param $container A div container which has all fields
 
135
  */
136
+ function clone( $container ) {
137
+ var $last = $container.children( '.rwmb-clone' ).last(),
138
+ $clone = $last.clone(),
139
+ inputSelectors = 'input[class*="rwmb"], textarea[class*="rwmb"], select[class*="rwmb"], button[class*="rwmb"]',
140
+ nextIndex = cloneIndex.nextIndex( $container );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
 
142
+ // Reset value for fields
143
+ var $inputs = $clone.find( inputSelectors );
144
+ $inputs.each( cloneValue.reset );
 
 
145
 
146
+ // Insert Clone
147
+ $clone.insertAfter( $last );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
+ // Trigger custom event for the clone instance. Required for Group extension to update sub fields.
150
+ $clone.trigger( 'clone_instance', nextIndex );
 
151
 
152
+ // Set fields index. Must run before trigger clone event.
153
+ cloneIndex.set( $inputs, nextIndex );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
 
155
+ // Trigger custom clone event.
156
+ $inputs.trigger( 'clone', nextIndex );
157
 
158
+ // After cloning fields.
159
+ $inputs.trigger( 'after_clone', nextIndex );
160
  }
161
 
162
  /**
163
  * Hide remove buttons when there's only 1 of them
164
  *
165
+ * @param $container .rwmb-input container
 
 
166
  */
167
+ function toggleRemoveButtons( $container ) {
168
+ var $clones = $container.children( '.rwmb-clone' );
169
+ $clones.children( '.remove-clone' ).toggle( $clones.length > 1 );
170
+
171
+ // Recursive for nested groups.
172
+ $container.find( '.rwmb-input' ).each( function () {
173
+ toggleRemoveButtons( $( this ) );
 
 
 
 
 
 
 
 
174
  } );
175
  }
176
 
177
  /**
178
+ * Toggle add button
179
+ * Used with [data-max-clone] attribute. When max clone is reached, the add button is hid and vice versa
180
+ *
181
+ * @param $container .rwmb-input container
182
  */
183
+ function toggleAddButton( $container ) {
184
+ var $button = $container.children( '.add-clone' ),
185
+ maxClone = parseInt( $container.data( 'max-clone' ) ),
186
+ numClone = $container.children( '.rwmb-clone' ).length;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
 
188
+ $button.toggle( isNaN( maxClone ) || ( maxClone && numClone < maxClone ) );
189
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
+ /**
192
+ * Initialize clone sorting.
193
+ */
194
+ function initSortable() {
195
+ $( '.rwmb-input' ).each( function () {
196
+ var $container = $( this );
197
 
198
+ if ( undefined !== $container.sortable( 'instance' ) ) {
199
+ return;
 
 
 
 
 
200
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
+ $container.sortable( {
203
+ handle: '.rwmb-clone-icon',
204
+ placeholder: ' rwmb-clone rwmb-sortable-placeholder',
205
+ items: '> .rwmb-clone',
206
+ start: function ( event, ui ) {
207
+ // Make the placeholder has the same height as dragged item
208
+ ui.placeholder.height( ui.item.outerHeight() );
209
+ }
210
+ } );
211
+ } );
212
  }
213
 
214
+ $( document )
215
+ // Add clones
216
+ .on( 'click', '.add-clone', function ( e ) {
217
+ e.preventDefault();
218
 
219
+ var $container = $( this ).closest( '.rwmb-input' );
220
+ clone( $container );
 
 
221
 
222
+ toggleRemoveButtons( $container );
223
+ toggleAddButton( $container );
224
+ initSortable();
225
+ } )
226
+ // Remove clones
227
+ .on( 'click', '.remove-clone', function ( e ) {
228
+ e.preventDefault();
229
 
230
+ var $this = $( this ),
231
+ $container = $this.closest( '.rwmb-input' );
 
 
 
 
 
 
 
 
 
232
 
233
+ // Remove clone only if there are 2 or more of them
234
+ if ( $container.children( '.rwmb-clone' ).length < 2 ) {
235
+ return;
236
+ }
 
 
 
 
 
 
 
 
 
237
 
238
+ $this.parent().trigger( 'remove' ).remove();
239
+ toggleRemoveButtons( $container );
240
+ toggleAddButton( $container );
241
+ } );
242
 
243
+ $( '.rwmb-input' ).each( function () {
244
+ var $container = $( this );
245
+ toggleRemoveButtons( $container );
246
+ toggleAddButton( $container );
247
+
248
+ $container
249
+ .data( 'next-index', $container.children( '.rwmb-clone' ).length )
250
+ .sortable( {
251
+ handle: '.rwmb-clone-icon',
252
+ placeholder: ' rwmb-clone rwmb-sortable-placeholder',
253
+ items: '> .rwmb-clone',
254
+ start: function ( event, ui ) {
255
+ // Make the placeholder has the same height as dragged item
256
+ ui.placeholder.height( ui.item.outerHeight() );
257
+ }
258
+ } );
259
  } );
 
 
260
  } );
inc/meta-box/js/color.js CHANGED
@@ -1,44 +1,35 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
- function rwmb_update_color_picker()
6
- {
 
 
 
7
  var $this = $( this ),
8
- $clone_container = $this.closest( '.rwmb-clone' ),
9
- $color_picker = $this.siblings( '.rwmb-color-picker' );
 
 
 
 
 
 
 
 
 
 
10
 
11
- // Make sure the value is displayed
12
- if ( !$this.val() )
13
- {
14
- $this.val( '#' );
15
  }
16
 
17
- if ( typeof $.wp === 'object' && typeof $.wp.wpColorPicker === 'function' )
18
- {
19
- if ( $clone_container.length > 0 )
20
- {
21
- $this.appendTo( $clone_container ).siblings( 'div.wp-picker-container' ).remove();
22
- }
23
- $this.wpColorPicker();
24
- }
25
- else
26
- {
27
- //We use farbtastic if the WordPress color picker widget doesn't exist
28
- $color_picker.farbtastic( $this );
29
- }
30
  }
31
 
32
- $( ':input.rwmb-color' ).each( rwmb_update_color_picker );
33
- $( '.rwmb-input' )
34
- .on( 'clone', ':input.rwmb-color', rwmb_update_color_picker )
35
- .on( 'focus', '.rwmb-color', function ()
36
- {
37
- $( this ).siblings( '.rwmb-color-picker' ).show();
38
- return false;
39
- } ).on( 'blur', '.rwmb-color', function ()
40
- {
41
- $( this ).siblings( '.rwmb-color-picker' ).hide();
42
- return false;
43
- } );
44
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
+ /**
5
+ * Update color picker element
6
+ * Used for static & dynamic added elements (when clone)
7
+ */
8
+ function update() {
9
  var $this = $( this ),
10
+ $container = $this.closest( '.wp-picker-container' ),
11
+ data = $.extend(
12
+ {
13
+ change: function () {
14
+ $( this ).trigger( 'color:change' );
15
+ },
16
+ clear: function () {
17
+ $( this ).trigger( 'color:clear' );
18
+ }
19
+ },
20
+ $this.data( 'options' )
21
+ );
22
 
23
+ // Clone doesn't have input for color picker, we have to add the input and remove the color picker container
24
+ if ( $container.length > 0 ) {
25
+ $this.insertBefore( $container );
26
+ $container.remove();
27
  }
28
 
29
+ // Show color picker
30
+ $this.wpColorPicker( data );
 
 
 
 
 
 
 
 
 
 
 
31
  }
32
 
33
+ $( '.rwmb-color' ).each( update );
34
+ $( document ).on( 'clone', '.rwmb-color', update );
 
 
 
 
 
 
 
 
 
 
35
  } );
inc/meta-box/js/date.js CHANGED
@@ -1,20 +1,64 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
  /**
6
  * Update date picker element
7
  * Used for static & dynamic added elements (when clone)
8
  */
9
- function rwmb_update_date_picker()
10
- {
11
  var $this = $( this ),
12
- options = $this.data( 'options' );
 
 
 
 
13
 
14
- $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
15
- $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).datepicker( options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
 
18
- $( ':input.rwmb-date' ).each( rwmb_update_date_picker );
19
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-date', rwmb_update_date_picker );
20
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
  /**
5
  * Update date picker element
6
  * Used for static & dynamic added elements (when clone)
7
  */
8
+ function update() {
 
9
  var $this = $( this ),
10
+ options = $this.data( 'options' ),
11
+ $inline = $this.siblings( '.rwmb-datetime-inline' ),
12
+ $timestamp = $this.siblings( '.rwmb-datetime-timestamp' ),
13
+ current = $this.val(),
14
+ $picker = $inline.length ? $inline : $this;
15
 
16
+ $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
17
+ if ( $timestamp.length ) {
18
+ options.onClose = options.onSelect = function () {
19
+ $timestamp.val( getTimestamp( $picker.datepicker( 'getDate' ) ) );
20
+ };
21
+ }
22
+
23
+ if ( $inline.length ) {
24
+ options.altField = '#' + $this.attr( 'id' );
25
+ $this.on( 'keydown', _.debounce( function () {
26
+ // if val is empty, return to allow empty datepicker input.
27
+ if ( !$this.val() ) {
28
+ return;
29
+ }
30
+ $picker
31
+ .datepicker( 'setDate', $this.val() )
32
+ .find( ".ui-datepicker-current-day" )
33
+ .trigger( "click" );
34
+ }, 600 ) );
35
+
36
+ $inline
37
+ .removeClass( 'hasDatepicker' )
38
+ .empty()
39
+ .prop( 'id', '' )
40
+ .datepicker( options )
41
+ .datepicker( 'setDate', current );
42
+ }
43
+ else {
44
+ $this.removeClass( 'hasDatepicker' ).datepicker( options );
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Convert date to Unix timestamp in milliseconds
50
+ * @link http://stackoverflow.com/a/14006555/556258
51
+ * @param date
52
+ * @return number
53
+ */
54
+ function getTimestamp( date ) {
55
+ if ( date === null ) {
56
+ return "";
57
+ }
58
+ var milliseconds = Date.UTC( date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() );
59
+ return Math.floor( milliseconds / 1000 );
60
  }
61
 
62
+ $( '.rwmb-date' ).each( update );
63
+ $( document ).on( 'clone', '.rwmb-date', update );
64
  } );
inc/meta-box/js/datetime.js CHANGED
@@ -1,21 +1,69 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
  /**
6
  * Update datetime picker element
7
  * Used for static & dynamic added elements (when clone)
8
  */
9
- function rwmb_update_datetime_picker()
10
- {
11
  var $this = $( this ),
12
- options = $this.data( 'options' );
 
 
 
 
13
 
14
- $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
15
- $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).datetimepicker( options );
 
 
 
 
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
 
19
- $( ':input.rwmb-datetime' ).each( rwmb_update_datetime_picker );
20
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-datetime', rwmb_update_datetime_picker );
21
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
  /**
5
  * Update datetime picker element
6
  * Used for static & dynamic added elements (when clone)
7
  */
8
+ function update() {
 
9
  var $this = $( this ),
10
+ options = $this.data( 'options' ),
11
+ $inline = $this.siblings( '.rwmb-datetime-inline' ),
12
+ $timestamp = $this.siblings( '.rwmb-datetime-timestamp' ),
13
+ current = $this.val(),
14
+ $picker = $inline.length ? $inline : $this;
15
 
16
+ $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
17
+ if ( $timestamp.length ) {
18
+ options.onClose = options.onSelect = function () {
19
+ $timestamp.val( getTimestamp( $picker.datetimepicker( 'getDate' ) ) );
20
+ };
21
+ }
22
 
23
+ if ( $inline.length ) {
24
+ options.altField = '#' + $this.attr( 'id' );
25
+ $this.on( 'keydown', _.debounce( function () {
26
+ $picker
27
+ .datepicker( 'setDate', $this.val() )
28
+ .find( ".ui-datepicker-current-day" )
29
+ .trigger( "click" );
30
+ }, 600 ) );
31
+
32
+ $inline
33
+ .removeClass( 'hasDatepicker' )
34
+ .empty()
35
+ .prop( 'id', '' )
36
+ .datetimepicker( options )
37
+ .datetimepicker( 'setDate', current );
38
+ }
39
+ else {
40
+ $this.removeClass( 'hasDatepicker' ).datetimepicker( options );
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Convert date to Unix timestamp in milliseconds
46
+ * @link http://stackoverflow.com/a/14006555/556258
47
+ * @param date
48
+ * @return number
49
+ */
50
+ function getTimestamp( date ) {
51
+ if ( date === null ) {
52
+ return "";
53
+ }
54
+ var milliseconds = Date.UTC( date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() );
55
+ return Math.floor( milliseconds / 1000 );
56
+ }
57
+
58
+ // Set language if available
59
+ $.timepicker.setDefaults( $.timepicker.regional[""] );
60
+ if ( $.timepicker.regional.hasOwnProperty( RWMB_Datetime.locale ) ) {
61
+ $.timepicker.setDefaults( $.timepicker.regional[RWMB_Datetime.locale] );
62
+ }
63
+ else if ( $.timepicker.regional.hasOwnProperty( RWMB_Datetime.localeShort ) ) {
64
+ $.timepicker.setDefaults( $.timepicker.regional[RWMB_Datetime.localeShort] );
65
  }
66
 
67
+ $( '.rwmb-datetime' ).each( update );
68
+ $( document ).on( 'clone', '.rwmb-datetime', update );
69
  } );
inc/meta-box/js/file-advanced.js DELETED
@@ -1,91 +0,0 @@
1
- jQuery( function ( $ )
2
- {
3
- 'use strict';
4
-
5
- var template = $( '#tmpl-rwmb-file-advanced' ).html();
6
-
7
- $( 'body' ).on( 'click', '.rwmb-file-advanced-upload', function ( e )
8
- {
9
- e.preventDefault();
10
-
11
- var $uploadButton = $( this ),
12
- $fileList = $uploadButton.siblings( '.rwmb-uploaded' ),
13
- maxFileUploads = $fileList.data( 'max_file_uploads' ),
14
- mimeType = $fileList.data( 'mime_type' ),
15
- msg = maxFileUploads > 1 ? rwmbFile.maxFileUploadsPlural : rwmbFile.maxFileUploadsSingle,
16
- frame,
17
- frameOptions = {
18
- className: 'media-frame rwmb-file-frame',
19
- multiple : true,
20
- title : rwmbFileAdvanced.frameTitle
21
- };
22
-
23
- msg = msg.replace( '%d', maxFileUploads );
24
-
25
- // Create a media frame
26
- if ( mimeType )
27
- {
28
- frameOptions.library = {
29
- type: mimeType
30
- };
31
- }
32
- frame = wp.media( frameOptions );
33
-
34
- // Open media uploader
35
- frame.open();
36
-
37
- // Remove all attached 'select' event
38
- frame.off( 'select' );
39
-
40
- // Handle selection
41
- frame.on( 'select', function ()
42
- {
43
- // Get selections
44
- var selection = frame.state().get( 'selection' ).toJSON(),
45
- uploaded = $fileList.children().length,
46
- ids;
47
-
48
- if ( maxFileUploads > 0 && ( uploaded + selection.length ) > maxFileUploads )
49
- {
50
- if ( uploaded < maxFileUploads )
51
- {
52
- selection = selection.slice( 0, maxFileUploads - uploaded );
53
- }
54
- alert( msg );
55
- }
56
-
57
- // Get only files that haven't been added to the list
58
- // Also prevent duplication when send ajax request
59
- selection = _.filter( selection, function ( attachment )
60
- {
61
- return $fileList.children( 'li#item_' + attachment.id ).length === 0;
62
- } );
63
- ids = _.pluck( selection, 'id' );
64
-
65
- if ( ids.length > 0 )
66
- {
67
- // Attach attachment to field and get HTML
68
- var data = {
69
- action : 'rwmb_attach_file',
70
- post_id : $( '#post_ID' ).val(),
71
- field_id : $fileList.data( 'field_id' ),
72
- attachment_ids: ids,
73
- _ajax_nonce : $uploadButton.data( 'attach_file_nonce' )
74
- };
75
- $.post( ajaxurl, data, function ( r )
76
- {
77
- if ( r.success )
78
- {
79
- $fileList
80
- .append( _.template( template, { attachments: selection }, {
81
- evaluate : /<#([\s\S]+?)#>/g,
82
- interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
83
- escape : /\{\{([^\}]+?)\}\}(?!\})/g
84
- } ) )
85
- .trigger( 'update.rwmbFile' );
86
- }
87
- }, 'json' );
88
- }
89
- } );
90
- } );
91
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/file-input.js CHANGED
@@ -1,21 +1,19 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
- var frame;
 
6
 
7
- $( 'body' ).on( 'click', '.rwmb-file-input-select', function ( e )
8
- {
9
  e.preventDefault();
10
  var $el = $( this );
11
 
12
  // Create a frame only if needed
13
- if ( !frame )
14
- {
15
  frame = wp.media( {
16
  className: 'media-frame rwmb-file-frame',
17
- multiple : false,
18
- title : rwmbFileInput.frameTitle
19
  } );
20
  }
21
 
@@ -26,17 +24,20 @@ jQuery( function ( $ )
26
  frame.off( 'select' );
27
 
28
  // Handle selection
29
- frame.on( 'select', function ()
30
- {
31
  var url = frame.state().get( 'selection' ).first().toJSON().url;
32
  $el.siblings( 'input' ).val( url ).siblings( 'a' ).removeClass( 'hidden' );
33
  } );
34
  } );
35
 
36
  // Clear selected images
37
- $( 'body' ).on( 'click', '.rwmb-file-input-remove', function ( e )
38
- {
39
  e.preventDefault();
40
  $( this ).addClass( 'hidden' ).siblings( 'input' ).val( '' );
41
  } );
 
 
 
 
 
42
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
+ var frame,
5
+ $doc = $( document );
6
 
7
+ $doc.on( 'click', '.rwmb-file-input-select', function ( e ) {
 
8
  e.preventDefault();
9
  var $el = $( this );
10
 
11
  // Create a frame only if needed
12
+ if ( ! frame ) {
 
13
  frame = wp.media( {
14
  className: 'media-frame rwmb-file-frame',
15
+ multiple: false,
16
+ title: rwmbFileInput.frameTitle
17
  } );
18
  }
19
 
24
  frame.off( 'select' );
25
 
26
  // Handle selection
27
+ frame.on( 'select', function () {
 
28
  var url = frame.state().get( 'selection' ).first().toJSON().url;
29
  $el.siblings( 'input' ).val( url ).siblings( 'a' ).removeClass( 'hidden' );
30
  } );
31
  } );
32
 
33
  // Clear selected images
34
+ $doc.on( 'click', '.rwmb-file-input-remove', function ( e ) {
 
35
  e.preventDefault();
36
  $( this ).addClass( 'hidden' ).siblings( 'input' ).val( '' );
37
  } );
38
+
39
+ // Hide the Remove button when cloning
40
+ $doc.on( 'clone', '.rwmb-file_input', function () {
41
+ $( this ).siblings( '.rwmb-file-input-remove' ).addClass( 'hidden' );
42
+ } );
43
  } );
inc/meta-box/js/file-upload.js ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ window.rwmb = window.rwmb || {};
2
+
3
+ jQuery( function ( $ ) {
4
+ 'use strict';
5
+
6
+ var views = rwmb.views = rwmb.views || {},
7
+ MediaField = views.MediaField,
8
+ FileUploadField, UploadButton;
9
+
10
+ FileUploadField = views.FileUploadField = MediaField.extend( {
11
+ createAddButton: function () {
12
+ this.addButton = new UploadButton( {controller: this.controller} );
13
+ }
14
+ } );
15
+
16
+ UploadButton = views.UploadButton = Backbone.View.extend( {
17
+ className: 'rwmb-upload-area',
18
+ tagName: 'div',
19
+ template: wp.template( 'rwmb-upload-area' ),
20
+ render: function () {
21
+ this.$el.html( this.template( {} ) );
22
+ return this;
23
+ },
24
+
25
+ initialize: function ( options ) {
26
+ this.controller = options.controller;
27
+ this.el.id = _.uniqueId( 'rwmb-upload-area-' );
28
+ this.render();
29
+
30
+ //Areas
31
+ this.dropzone = this.el;
32
+ this.browser = this.$( '.rwmb-browse-button' )[0];
33
+
34
+ if ( wp.Uploader.browser.supported ) {
35
+ this.initUploader();
36
+ }
37
+
38
+ // Auto hide if you reach the max number of media
39
+ this.listenTo( this.controller, 'change:full', function () {
40
+ this.$el.toggle( ! this.controller.get( 'full' ) );
41
+ } );
42
+ },
43
+
44
+ //Initializes plupload
45
+ //Uses code from wp.Uploader
46
+ initUploader: function () {
47
+ var isIE = navigator.userAgent.indexOf( 'Trident/' ) != - 1 || navigator.userAgent.indexOf( 'MSIE ' ) != - 1,
48
+ self = this,
49
+ extensions = this.getExtensions().join( ',' ),
50
+ max_file_size;
51
+ this.plupload = $.extend( true, {
52
+ multipart_params: {
53
+ post_id : $( '#post_ID' ).val()
54
+ },
55
+ multipart: true,
56
+ urlstream_upload: true,
57
+ drop_element: this.dropzone,
58
+ browse_button: this.browser,
59
+ filters: {}
60
+ }, wp.Uploader.defaults );
61
+
62
+ if( max_file_size = this.controller.get( 'maxFileSize' ) ) {
63
+ this.plupload.filters.max_file_size = max_file_size;
64
+ }
65
+
66
+ if ( extensions ) {
67
+ this.plupload.filters.mime_types = [{title: i18nRwmbMedia.select, extensions: extensions}];
68
+ }
69
+
70
+ // Make sure flash sends cookies (seems in IE it does without switching to urlstream mode)
71
+ if ( ! isIE && 'flash' === plupload.predictRuntime( this.plupload ) &&
72
+ ( ! this.plupload.required_features || ! this.plupload.required_features.hasOwnProperty( 'send_binary_string' ) ) ) {
73
+ this.plupload.required_features = this.plupload.required_features || {};
74
+ this.plupload.required_features.send_binary_string = true;
75
+ }
76
+
77
+ // Initialize the plupload instance.
78
+ this.uploader = new plupload.Uploader( this.plupload );
79
+ this.uploader.init();
80
+
81
+ this.uploader.bind( 'FilesAdded', function ( up, files ) {
82
+ _.each( files, function ( file ) {
83
+ var attributes, image;
84
+
85
+ // Ignore failed uploads.
86
+ if ( plupload.FAILED === file.status ) {
87
+ return;
88
+ }
89
+
90
+ // Generate attributes for a new `Attachment` model.
91
+ attributes = _.extend( {
92
+ file: file,
93
+ uploading: true,
94
+ date: new Date(),
95
+ filename: file.name,
96
+ menuOrder: 0,
97
+ uploadedTo: wp.media.model.settings.post.id,
98
+ icon: i18nRwmbMedia.loadingUrl
99
+ }, _.pick( file, 'loaded', 'size', 'percent' ) );
100
+
101
+ // Handle early mime type scanning for images.
102
+ image = /(?:jpe?g|png|gif)$/i.exec( file.name );
103
+
104
+ // For images set the model's type and subtype attributes.
105
+ if ( image ) {
106
+ attributes.type = 'image';
107
+
108
+ // `jpeg`, `png` and `gif` are valid subtypes.
109
+ // `jpg` is not, so map it to `jpeg`.
110
+ attributes.subtype = ( 'jpg' === image[0] ) ? 'jpeg' : image[0];
111
+ }
112
+
113
+ // Create a model for the attachment, and add it to the Upload queue collection
114
+ // so listeners to the upload queue can track and display upload progress.
115
+ file.attachment = wp.media.model.Attachment.create( attributes );
116
+ wp.Uploader.queue.add( file.attachment );
117
+ self.controller.get( 'items' ).add( [file.attachment] );
118
+ } );
119
+
120
+ up.refresh();
121
+ up.start();
122
+ } );
123
+
124
+ this.uploader.bind( 'UploadProgress', function ( up, file ) {
125
+ file.attachment.set( _.pick( file, 'loaded', 'percent' ) );
126
+ } );
127
+
128
+ this.uploader.bind( 'FileUploaded', function ( up, file, response ) {
129
+ var complete;
130
+
131
+ try {
132
+ response = JSON.parse( response.response );
133
+ } catch ( e ) {
134
+ return false;
135
+ }
136
+
137
+ if ( ! _.isObject( response ) || _.isUndefined( response.success ) || ! response.success ) {
138
+ return false;
139
+ }
140
+
141
+ _.each( ['file', 'loaded', 'size', 'percent'], function ( key ) {
142
+ file.attachment.unset( key );
143
+ } );
144
+
145
+ file.attachment.set( _.extend( response.data, {uploading: false} ) );
146
+ wp.media.model.Attachment.get( response.data.id, file.attachment );
147
+
148
+ complete = wp.Uploader.queue.all( function ( attachment ) {
149
+ return ! attachment.get( 'uploading' );
150
+ } );
151
+
152
+ if ( complete ) {
153
+ wp.Uploader.queue.reset();
154
+ }
155
+ } );
156
+
157
+ this.uploader.bind( 'Error', function ( up, error ) {
158
+ if ( error.file.attachment ) {
159
+ error.file.attachment.destroy();
160
+ }
161
+ } );
162
+ },
163
+
164
+ getExtensions: function () {
165
+ var mimeTypes = this.controller.get( 'mimeType' ).split( ',' ),
166
+ exts = [];
167
+
168
+ _.each( mimeTypes, function ( current, index ) {
169
+ if ( i18nRwmbMedia.extensions[current] ) {
170
+ exts = exts.concat( i18nRwmbMedia.extensions[current] );
171
+ }
172
+ } );
173
+ return exts;
174
+ }
175
+ } );
176
+
177
+ /**
178
+ * Initialize fields
179
+ * @return void
180
+ */
181
+ function init() {
182
+ var view = new FileUploadField( { input: this } );
183
+ //Remove old then add new
184
+ $( this ).siblings( 'div.rwmb-media-view' ).remove();
185
+ $( this ).after( view.el );
186
+ }
187
+
188
+ $( '.rwmb-file_upload' ).each( init );
189
+ $( document ).on( 'clone', '.rwmb-file_upload', init )
190
+ } );
inc/meta-box/js/file.js CHANGED
@@ -1,157 +1,108 @@
1
- jQuery( document ).ready( function ( $ )
2
- {
3
  'use strict';
4
 
5
- // Add more file
6
- $( '.rwmb-add-file' ).each( function ()
7
- {
8
- var $this = $( this ),
9
- $uploads = $this.siblings( '.file-input' ),
10
- $first = $uploads.first(),
11
- uploadCount = $uploads.length,
12
- $fileList = $this.closest( '.rwmb-input' ).find( '.rwmb-uploaded' ),
13
- fileCount = $fileList.children( 'li' ).length,
14
- maxFileUploads = $fileList.data( 'max_file_uploads' );
15
 
16
- // Hide "Add New File" and input fields when loaded
17
- if ( maxFileUploads > 0 )
18
- {
19
- if ( uploadCount + fileCount >= maxFileUploads )
20
- {
21
- $this.hide();
22
- }
23
- if ( fileCount >= maxFileUploads )
24
- {
25
- $uploads.hide();
26
- }
27
- }
28
 
29
- $this.click( function ()
30
- {
31
- // Clone upload input only when needed
32
- if ( maxFileUploads <= 0 || uploadCount + fileCount < maxFileUploads )
33
- {
34
- $first.clone().insertBefore( $this );
35
- uploadCount++;
36
 
37
- // If there're too many upload inputs, hide "Add New File"
38
- if ( maxFileUploads > 0 && uploadCount + fileCount >= maxFileUploads )
39
- {
40
- $this.hide();
41
- }
42
- }
43
 
44
- return false;
45
- } );
46
- } );
 
 
 
 
 
47
 
48
- // Delete file via Ajax
49
- $( '.rwmb-uploaded' ).on( 'click', '.rwmb-delete-file', function ()
50
- {
51
  var $this = $( this ),
52
- $parent = $this.parents( 'li' ),
53
- $container = $this.closest( '.rwmb-uploaded' ),
54
- data = {
55
- action : 'rwmb_delete_file',
56
- _ajax_nonce : $container.data( 'delete_nonce' ),
57
- post_id : $( '#post_ID' ).val(),
58
- field_id : $container.data( 'field_id' ),
59
- attachment_id: $this.data( 'attachment_id' ),
60
- force_delete : $container.data( 'force_delete' )
61
- };
62
 
63
- $.post( ajaxurl, data, function ( r )
64
- {
65
- if ( !r.success )
66
- {
67
- alert( r.data );
68
- return;
69
- }
70
 
71
- $parent.addClass( 'removed' );
 
 
72
 
73
- // If transition events not supported
74
- var div = document.createElement( 'div' );
75
- if (
76
- !( 'ontransitionend' in window ) &&
77
- ( 'onwebkittransitionend' in window ) && !( 'onotransitionend' in div || navigator.appName === 'Opera' )
78
- )
79
- {
80
- $parent.remove();
81
- $container.trigger( 'update.rwmbFile' );
82
  }
83
-
84
- $( '.rwmb-uploaded' ).on( 'transitionend webkitTransitionEnd otransitionend', 'li.removed', function ()
85
- {
86
- $( this ).remove();
87
- $container.trigger( 'update.rwmbFile' );
88
- } );
89
  }, 'json' );
90
-
91
- return false;
92
- } );
93
-
94
- //Remove deleted file
95
- $( '.rwmb-uploaded' ).on( 'transitionend webkitTransitionEnd otransitionend', 'li.removed', function ()
96
- {
97
- $( this ).remove();
98
- } );
99
-
100
- $( 'body' ).on( 'update.rwmbFile', '.rwmb-uploaded', function ()
101
- {
102
- var $fileList = $( this ),
103
- maxFileUploads = $fileList.data( 'max_file_uploads' ),
104
- $uploader = $fileList.siblings( '.new-files' ),
105
- numFiles = $fileList.children().length;
106
-
107
- if ( numFiles > 0 )
108
- {
109
- $fileList.removeClass( 'hidden' );
110
- }
111
- else
112
- {
113
- $fileList.addClass( 'hidden' );
114
- }
115
-
116
- // Return if maxFileUpload = 0
117
- if ( maxFileUploads === 0 )
118
- {
119
- return false;
120
- }
121
-
122
- // Hide files button if reach max file uploads
123
- if ( numFiles >= maxFileUploads )
124
- {
125
- $uploader.addClass( 'hidden' );
126
- }
127
- else
128
- {
129
- $uploader.removeClass( 'hidden' );
130
  }
 
 
 
131
 
132
- return false;
133
- } );
134
-
135
- // Reorder images
136
- $( '.rwmb-file' ).each( function ()
137
- {
138
  var $this = $( this ),
139
- data = {
140
- action : 'rwmb_reorder_files',
141
- _ajax_nonce: $this.data( 'reorder_nonce' ),
142
- post_id : $( '#post_ID' ).val(),
143
- field_id : $this.data( 'field_id' )
144
- };
145
- $this.sortable( {
146
- placeholder: 'ui-state-highlight',
147
- items : 'li',
148
- update : function ()
149
- {
150
-
151
- data.order = $this.sortable( 'serialize' );
152
-
153
- $.post( ajaxurl, data );
154
- }
155
- } );
156
  } );
157
- } );
1
+ /* global jQuery */
2
+ ( function ( $, document ) {
3
  'use strict';
4
 
5
+ var file = {};
 
 
 
 
 
 
 
 
 
6
 
7
+ /**
8
+ * Handles a click on add new file.
9
+ * Expects `this` to equal the clicked element.
10
+ *
11
+ * @param event Click event.
12
+ */
13
+ file.addHandler = function ( event ) {
14
+ event.preventDefault();
 
 
 
 
15
 
16
+ var $this = $( this ),
17
+ $clone = $this.prev().clone();
 
 
 
 
 
18
 
19
+ $clone.insertBefore( this ).val( '' );
20
+ file.updateVisibility.call( $this.closest( '.rwmb-input' ).find( '.rwmb-uploaded' )[0] );
21
+ };
 
 
 
22
 
23
+ /**
24
+ * Handles a click on delete new file.
25
+ * Expects `this` to equal the clicked element.
26
+ *
27
+ * @param event Click event.
28
+ */
29
+ file.deleteHandler = function ( event ) {
30
+ event.preventDefault();
31
 
 
 
 
32
  var $this = $( this ),
33
+ $item = $this.closest( 'li' ),
34
+ $uploaded = $this.closest( '.rwmb-uploaded' );
 
 
 
 
 
 
 
 
35
 
36
+ $item.remove();
37
+ file.updateVisibility.call( $uploaded );
 
 
 
 
 
38
 
39
+ if ( 1 > $uploaded.data( 'force_delete' ) ) {
40
+ return;
41
+ }
42
 
43
+ $.post( ajaxurl, {
44
+ action: 'rwmb_delete_file',
45
+ _ajax_nonce: $uploaded.data( 'delete_nonce' ),
46
+ field_id: $uploaded.data( 'field_id' ),
47
+ attachment_id: $this.data( 'attachment_id' )
48
+ }, function ( response ) {
49
+ if ( ! response.success ) {
50
+ alert( response.data );
 
51
  }
 
 
 
 
 
 
52
  }, 'json' );
53
+ };
54
+
55
+ /**
56
+ * Sort uploaded files.
57
+ * Expects `this` to equal the uploaded file list.
58
+ */
59
+ file.sort = function () {
60
+ $( this ).sortable( {
61
+ items: 'li',
62
+ start: function ( e, ui ) {
63
+ ui.placeholder.height( ui.helper.outerHeight() );
64
+ ui.placeholder.width( ui.helper.outerWidth() );
65
+ }
66
+ } );
67
+ };
68
+
69
+ /**
70
+ * Update visibility of upload inputs and Add new file link.
71
+ * Expect this equal to the uploaded file list.
72
+ */
73
+ file.updateVisibility = function () {
74
+ var $uploaded = $( this ),
75
+ max = parseInt( $uploaded.data( 'max_file_uploads' ), 10 ),
76
+ $new = $uploaded.siblings( '.rwmb-file-new' ),
77
+ $add = $new.find( '.rwmb-file-add' ),
78
+ numFiles = $uploaded.children().length,
79
+ numInputs = $new.find( '.rwmb-file-input' ).length;
80
+
81
+ $uploaded.toggle( 0 < numFiles );
82
+ if ( 0 === max ) {
83
+ return;
 
 
 
 
 
 
 
 
 
84
  }
85
+ $new.toggle( numFiles < max );
86
+ $add.toggle( numFiles + numInputs < max );
87
+ };
88
 
89
+ // Reset field when cloning.
90
+ file.resetClone = function() {
 
 
 
 
91
  var $this = $( this ),
92
+ $clone = $this.closest( '.rwmb-clone' );
93
+ $clone.find( '.rwmb-uploaded' ).remove();
94
+ $clone.find( '.rwmb-file-input' ).not( ':first' ).remove();
95
+ };
96
+
97
+ // Initialize when document ready.
98
+ $( function ( $ ) {
99
+ $( document )
100
+ .on( 'click', '.rwmb-file-add', file.addHandler )
101
+ .on( 'click', '.rwmb-file-delete', file.deleteHandler )
102
+ .on( 'clone', '.rwmb-file-input', file.resetClone );
103
+
104
+ var $uploaded = $( '.rwmb-uploaded' );
105
+ $uploaded.each( file.sort );
106
+ $uploaded.each( file.updateVisibility );
 
 
107
  } );
108
+ } )( jQuery, document );
inc/meta-box/js/image-advanced.js CHANGED
@@ -1,90 +1,47 @@
1
- jQuery( function ( $ )
2
- {
3
- 'use strict';
4
-
5
- // Use only one frame for all upload fields
6
- var frame,
7
- template = $( '#tmpl-rwmb-image-advanced' ).html();
8
-
9
- $( 'body' ).on( 'click', '.rwmb-image-advanced-upload', function ( e )
10
- {
11
- e.preventDefault();
12
-
13
- var $uploadButton = $( this ),
14
- $imageList = $uploadButton.siblings( '.rwmb-images' ),
15
- maxFileUploads = $imageList.data( 'max_file_uploads' ),
16
- msg = maxFileUploads > 1 ? rwmbFile.maxFileUploadsPlural : rwmbFile.maxFileUploadsSingle;
17
 
18
- msg = msg.replace( '%d', maxFileUploads );
 
19
 
20
- // Create a frame only if needed
21
- if ( !frame )
22
- {
23
- frame = wp.media( {
24
- className: 'media-frame rwmb-media-frame',
25
- multiple : true,
26
- title : rwmbImageAdvanced.frameTitle,
27
- library : {
28
- type: 'image'
29
- }
 
 
 
 
 
 
 
 
30
  } );
31
  }
32
-
33
- // Open media uploader
34
- frame.open();
35
-
36
- // Remove all attached 'select' event
37
- frame.off( 'select' );
38
-
39
- // Handle selection
40
- frame.on( 'select', function ()
41
- {
42
- // Get selections
43
- var selection = frame.state().get( 'selection' ).toJSON(),
44
- uploaded = $imageList.children().length,
45
- ids;
46
-
47
- if ( maxFileUploads > 0 && ( uploaded + selection.length ) > maxFileUploads )
48
- {
49
- if ( uploaded < maxFileUploads )
50
- {
51
- selection = selection.slice( 0, maxFileUploads - uploaded );
52
- }
53
- alert( msg );
54
- }
55
-
56
- // Get only files that haven't been added to the list
57
- // Also prevent duplication when send ajax request
58
- selection = _.filter( selection, function ( attachment )
59
- {
60
- return $imageList.children( 'li#item_' + attachment.id ).length === 0;
61
- } );
62
- ids = _.pluck( selection, 'id' );
63
-
64
- if ( ids.length > 0 )
65
- {
66
- var data = {
67
- action : 'rwmb_attach_media',
68
- post_id : $( '#post_ID' ).val(),
69
- field_id : $imageList.data( 'field_id' ),
70
- attachment_ids: ids,
71
- _ajax_nonce : $uploadButton.data( 'attach_media_nonce' )
72
- };
73
-
74
- $.post( ajaxurl, data, function ( r )
75
- {
76
- if ( r.success )
77
- {
78
- $imageList
79
- .append( _.template( template, { attachments: selection }, {
80
- evaluate : /<#([\s\S]+?)#>/g,
81
- interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
82
- escape : /\{\{([^\}]+?)\}\}(?!\})/g
83
- } ) )
84
- .trigger( 'update.rwmbFile' );
85
- }
86
- }, 'json' );
87
- }
88
- } );
89
  } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  } );
1
+ window.rwmb = window.rwmb || {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
+ jQuery( function ( $ ) {
4
+ 'use strict';
5
 
6
+ var views = rwmb.views = rwmb.views || {},
7
+ MediaField = views.MediaField,
8
+ MediaItem = views.MediaItem,
9
+ MediaList = views.MediaList,
10
+ ImageField;
11
+
12
+ ImageField = views.ImageField = MediaField.extend( {
13
+ createList: function () {
14
+ this.list = new MediaList( {
15
+ controller: this.controller,
16
+ itemView: MediaItem.extend( {
17
+ className: 'rwmb-image-item attachment',
18
+ template: wp.template( 'rwmb-image-item' ),
19
+ initialize: function( models, options ) {
20
+ MediaItem.prototype.initialize.call( this, models, options );
21
+ this.$el.addClass( this.controller.get( 'imageSize' ) );
22
+ }
23
+ } )
24
  } );
25
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  } );
27
+
28
+ /**
29
+ * Initialize image fields
30
+ */
31
+ function initImageField() {
32
+ var view = new ImageField( { input: this } );
33
+ $( this ).after( view.el );
34
+ }
35
+
36
+ /**
37
+ * Remove views for uploaded images.
38
+ */
39
+ function removeView() {
40
+ $( this ).siblings( '.rwmb-media-view' ).remove();
41
+ }
42
+
43
+ $( '.rwmb-image_advanced' ).each( initImageField );
44
+ $( document )
45
+ .on( 'clone', '.rwmb-image_advanced', removeView )
46
+ .on( 'after_clone', '.rwmb-image_advanced', initImageField );
47
  } );
inc/meta-box/js/image-select.js CHANGED
@@ -1,24 +1,18 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
- $( 'body' ).on( 'change', '.rwmb-image-select input', function ()
6
- {
7
  var $this = $( this ),
8
  type = $this.attr( 'type' ),
9
  selected = $this.is( ':checked' ),
10
  $parent = $this.parent(),
11
  $others = $parent.siblings();
12
- if ( selected )
13
- {
14
  $parent.addClass( 'rwmb-active' );
15
- if ( type === 'radio' )
16
- {
17
  $others.removeClass( 'rwmb-active' );
18
  }
19
- }
20
- else
21
- {
22
  $parent.removeClass( 'rwmb-active' );
23
  }
24
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
+ $( 'body' ).on( 'change', '.rwmb-image-select input', function () {
 
5
  var $this = $( this ),
6
  type = $this.attr( 'type' ),
7
  selected = $this.is( ':checked' ),
8
  $parent = $this.parent(),
9
  $others = $parent.siblings();
10
+ if ( selected ) {
 
11
  $parent.addClass( 'rwmb-active' );
12
+ if ( type === 'radio' ) {
 
13
  $others.removeClass( 'rwmb-active' );
14
  }
15
+ } else {
 
 
16
  $parent.removeClass( 'rwmb-active' );
17
  }
18
  } );
inc/meta-box/js/image-upload.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ window.rwmb = window.rwmb || {};
2
+
3
+ jQuery( function ( $ ) {
4
+ 'use strict';
5
+
6
+ var views = rwmb.views = rwmb.views || {},
7
+ ImageField = views.ImageField,
8
+ ImageUploadField,
9
+ UploadButton = views.UploadButton;
10
+
11
+ ImageUploadField = views.ImageUploadField = ImageField.extend( {
12
+ createAddButton: function () {
13
+ this.addButton = new UploadButton( {controller: this.controller} );
14
+ }
15
+ } );
16
+
17
+ /**
18
+ * Initialize fields
19
+ * @return void
20
+ */
21
+ function init() {
22
+ var view = new ImageUploadField( { input: this } );
23
+ //Remove old then add new
24
+ $( this ).siblings( 'div.rwmb-media-view' ).remove();
25
+ $( this ).after( view.el );
26
+ }
27
+
28
+ $( '.rwmb-image_upload, .rwmb-plupload_image' ).each( init );
29
+ $( document )
30
+ .on( 'clone', '.rwmb-image_upload, .rwmb-plupload_image', init )
31
+ } );
inc/meta-box/js/image.js DELETED
@@ -1,25 +0,0 @@
1
- jQuery( function ( $ )
2
- {
3
- 'use strict';
4
-
5
- // Reorder images
6
- $( '.rwmb-images' ).each( function ()
7
- {
8
- var $this = $( this ),
9
- data = {
10
- action : 'rwmb_reorder_images',
11
- _ajax_nonce: $this.data( 'reorder_nonce' ),
12
- post_id : $( '#post_ID' ).val(),
13
- field_id : $this.data( 'field_id' )
14
- };
15
- $this.sortable( {
16
- placeholder: 'ui-state-highlight',
17
- items : 'li',
18
- update : function ()
19
- {
20
- data.order = $this.sortable( 'serialize' );
21
- $.post( ajaxurl, data );
22
- }
23
- } );
24
- } );
25
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/input-list.js ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function ( $ ) {
2
+ function update() {
3
+ var $this = $( this ),
4
+ $children = $this.closest( 'li' ).children( 'ul' );
5
+
6
+ if ( $this.is( ':checked' ) ) {
7
+ $children.removeClass( 'hidden' );
8
+ } else {
9
+ $children
10
+ .addClass( 'hidden' )
11
+ .find( 'input' )
12
+ .removeAttr( 'checked' );
13
+ }
14
+ }
15
+
16
+ $( '.rwmb-input' )
17
+ .on( 'change', '.rwmb-input-list.collapse :checkbox', update )
18
+ .on( 'clone', '.rwmb-input-list.collapse :checkbox', update );
19
+ $( '.rwmb-input-list.collapse :checkbox' ).each( update );
20
+
21
+ $( '.rwmb-input-list-select-all-none' ).toggle(
22
+ function () {
23
+ $('input[name="' + $(this).data('name') + '[]"]').prop('checked', true);
24
+ },
25
+ function () {
26
+ $('input[name="' + $(this).data('name') + '[]"]').prop('checked', false);
27
+ }
28
+ );
29
+ } );
inc/meta-box/js/jquery-validation/additional-methods.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery Validation Plugin - v1.17.0 - 7/29/2017
2
+ * https://jqueryvalidation.org/
3
+ * Copyright (c) 2017 Jörn Zaefferer; Licensed MIT */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g,h="string"==typeof d?d.replace(/\s/g,""):"image/*",i=this.optional(c);if(i)return i;if("file"===a(c).attr("type")&&(h=h.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g,"\\$&").replace(/,/g,"|").replace(/\/\*/g,"/.*"),c.files&&c.files.length))for(g=new RegExp(".?("+h+")$","i"),e=0;e<c.files.length;e++)if(f=c.files[e],!f.type.match(g))return!1;return!0},a.validator.format("Please enter a value with a valid mimetype.")),a.validator.addMethod("alphanumeric",function(a,b){return this.optional(b)||/^\w+$/i.test(a)},"Letters, numbers, and underscores only please"),a.validator.addMethod("bankaccountNL",function(a,b){if(this.optional(b))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(a))return!1;var c,d,e,f=a.replace(/ /g,""),g=0,h=f.length;for(c=0;c<h;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a.toUpperCase())},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a,b){"use strict";function c(a){return a%2===0}if(this.optional(b))return!0;var d,e,f,g,h=new RegExp(/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi),i=a.substring(0,1),j=a.substring(1,8),k=a.substring(8,9),l=0,m=0,n=0;if(9!==a.length||!h.test(a))return!1;for(d=0;d<j.length;d++)e=parseInt(j[d],10),c(d)?(e*=2,n+=e<10?e:e-9):m+=e;return l=m+n,f=(10-l.toString().substr(-1)).toString(),f=parseInt(f,10)>9?"0":f,g="JABCDEFGHI".substr(f,1).toString(),i.match(/[ABEH]/)?k===f:i.match(/[KPQS]/)?k===g:k===f||k===g},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return 10!==c&&11!==c||(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;e<=9;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;e<=10;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcard",function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},"Please enter a valid credit card number."),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:!!(128&d)},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=!!e||c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="",q=5;if(l.length<q)return!1;if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j<d.length;j++)e=d.charAt(j),"0"!==e&&(n=!1),n||(m+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(e));for(k=0;k<m.length;k++)f=m.charAt(k),p=""+o+f,o=p%97;return 1===o},"Please specify a valid IBAN"),a.validator.addMethod("integer",function(a,b){return this.optional(b)||/^-?\d+$/.test(a)},"A positive or negative non-decimal number please"),a.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(a)},"Please enter a valid IP v4 address."),a.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address."),a.validator.addMethod("lettersonly",function(a,b){return this.optional(b)||/^[a-z]+$/i.test(a)},"Letters only please"),a.validator.addMethod("letterswithbasicpunc",function(a,b){return this.optional(b)||/^[a-z\-.,()'"\s]+$/i.test(a)},"Letters or punctuation only please"),a.validator.addMethod("mobileNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid mobile number"),a.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("netmask",function(a,b){return this.optional(b)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(a)},"Please enter a valid netmask."),a.validator.addMethod("nieES",function(a,b){"use strict";if(this.optional(b))return!0;var c,d=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),e="TRWAGMYFPDXBNJZSQVHLCKET",f=a.substr(a.length-1).toUpperCase();return a=a.toString().toUpperCase(),!(a.length>10||a.length<9||!d.test(a))&&(a=a.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2"),c=9===a.length?a.substr(0,8):a.substr(0,9),e.charAt(parseInt(c,10)%23)===f)},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a,b){"use strict";return!!this.optional(b)||(a=a.toUpperCase(),!!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):!!/^[KLM]{1}/.test(a)&&a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,1)%23)))},"Please specify a valid NIF number."),a.validator.addMethod("nipPL",function(a){"use strict";if(a=a.replace(/[^0-9]/g,""),10!==a.length)return!1;for(var b=[6,5,7,2,3,4,5,6,7],c=0,d=0;d<9;d++)c+=b[d]*a[d];var e=c%11,f=10===e?0:e;return f===parseInt(a[9],10)},"Please specify a valid NIP number."),a.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return!!this.optional(b)||("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=!e&&"undefined"!=typeof c.caseSensitive&&c.caseSensitive,g=!e&&"undefined"!=typeof c.includeTerritories&&c.includeTerritories,h=!e&&"undefined"!=typeof c.includeMilitary&&c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;b<17;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c<h.length;c++)if(d.toUpperCase()===h[c]){d=i[c],d*=e,isNaN(g)&&8===c&&(g=h[c]);break}}else d*=e;k+=d}return f=k%11,10===f&&(f="X"),f===g},"The specified vehicle identification number (VIN) is invalid."),a.validator.addMethod("zipcodeUS",function(a,b){return this.optional(b)||/^\d{5}(-\d{4})?$/.test(a)},"The specified US ZIP Code is invalid"),a.validator.addMethod("ziprange",function(a,b){return this.optional(b)||/^90[2-5]\d\{2\}-\d{4}$/.test(a)},"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"),a});
inc/meta-box/js/jquery-validation/jquery.validate.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery Validation Plugin - v1.17.0 - 7/29/2017
2
+ * https://jqueryvalidation.org/
3
+ * Copyright (c) 2017 Jörn Zaefferer; Licensed MIT */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!c.settings.submitHandler||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(null!=j&&(!j.form&&j.hasAttribute("contenteditable")&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){!this.form&&this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name"));var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0],this.name=d),!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type;return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=b.hasAttribute("contenteditable")?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);if("function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f){if(j=f.call(b,j),"string"!=typeof j)throw new TypeError("The normalizer should return a string value.");delete g.normalizer}for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a});
inc/meta-box/js/jquery.validate.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation
2
- * Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."),void 0;var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t("<input type='hidden'/>").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){if(t(this[0]).is("form"))return this.validate().form();var e=!0,i=t(this[0].form).validate();return this.each(function(){e=e&&i.element(this)}),e},removeAttrs:function(e){var i={},s=this;return t.each(e.split(/\s/),function(t,e){i[e]=s.attr(e),s.removeAttr(e)}),i},rules:function(e,i){var s=this[0];if(e){var r=t.data(s.form,"validator").settings,n=r.rules,a=t.validator.staticRules(s);switch(e){case"add":t.extend(a,t.validator.normalizeRule(i)),delete a.messages,n[s.name]=a,i.messages&&(r.messages[s.name]=t.extend(r.messages[s.name],i.messages));break;case"remove":if(!i)return delete n[s.name],a;var u={};return t.each(i.split(/\s/),function(t,e){u[e]=a[e],delete a[e]}),u}}var o=t.validator.normalizeRules(t.extend({},t.validator.classRules(s),t.validator.attributeRules(s),t.validator.dataRules(s),t.validator.staticRules(s)),s);if(o.required){var l=o.required;delete o.required,o=t.extend({required:l},o)}return o}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){return!!t.trim(""+t(e).val())},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(t)).hide())},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){(9!==e.which||""!==this.elementValue(t))&&(t.name in this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){var i=t.data(this[0].form,"validator"),s="on"+e.type.replace(/^validate/,"");i.settings[s]&&i.settings[s].call(i,this[0],e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i=this.groups={};t.each(this.settings.groups,function(e,s){"string"==typeof s&&(s=s.split(/\s/)),t.each(s,function(t,s){i[s]=e})});var s=this.settings.rules;t.each(s,function(e,i){s[e]=t.validator.normalizeRule(i)}),t(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",e).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",e),this.settings.invalidHandler&&t(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){e=this.validationTargetFor(this.clean(e)),this.lastElement=e,this.prepareElement(e),this.currentElements=t(e);var i=this.check(e)!==!1;return i?delete this.invalid[e.name]:this.invalid[e.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(e){if(e){t.extend(this.errorMap,e),this.errorList=[];for(var i in e)this.errorList.push({message:e[i],element:this.findByName(i)[0]});this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e=0;for(var i in t)e++;return e},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!e.objectLength(t(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.replace(" ",".");return t(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([]),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i=t(e).attr("type"),s=t(e).val();return"radio"===i||"checkbox"===i?t("input[name='"+t(e).attr("name")+"']:checked").val():"string"==typeof s?s.replace(/\r/g,""):s},check:function(e){e=this.validationTargetFor(this.clean(e));var i,s=t(e).rules(),r=!1,n=this.elementValue(e);for(var a in s){var u={method:a,parameters:s[a]};try{if(i=t.validator.methods[a].call(this,n,e,u.parameters),"dependency-mismatch"===i){r=!0;continue}if(r=!1,"pending"===i)return this.toHide=this.toHide.not(this.errorsFor(e)),void 0;if(!i)return this.formatAndAdd(e,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+u.method+"' method.",o),o}}return r?void 0:(this.objectLength(s)&&this.successList.push(e),!0)},customDataMessage:function(e,i){return t(e).data("msg-"+i.toLowerCase())||e.attributes&&t(e).attr("data-msg-"+i.toLowerCase())},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;arguments.length>t;t++)if(void 0!==arguments[t])return arguments[t];return void 0},defaultMessage:function(e,i){return this.findDefined(this.customMessage(e.name,i),this.customDataMessage(e,i),!this.settings.ignoreTitle&&e.title||void 0,t.validator.messages[i],"<strong>Warning: No message defined for "+e.name+"</strong>")},formatAndAdd:function(e,i){var s=this.defaultMessage(e,i.method),r=/\$?\{(\d+)\}/g;"function"==typeof s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),this.errorList.push({message:s,element:e}),this.errorMap[e.name]=s,this.submitted[e.name]=s},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e;for(t=0;this.errorList[t];t++){var i=this.errorList[t];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var s=this.errorsFor(e);s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(s=t("<"+this.settings.errorElement+">").attr("for",this.idOrName(e)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(s=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(s).length||(this.settings.errorPlacement?this.settings.errorPlacement(s,t(e)):s.insertAfter(e))),!i&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var i=this.idOrName(e);return this.errors().filter(function(){return t(this).attr("for")===i})},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name).not(this.settings.ignore)[0]),t},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+e+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return this.dependTypes[typeof t]?this.dependTypes[typeof t](t,e):!0},dependTypes:{"boolean":function(t){return t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,this.pending[t.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,0>this.pendingRequest&&(this.pendingRequest=0),delete this.pending[e.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},attributeRules:function(e){var i={},s=t(e),r=s[0].getAttribute("type");for(var n in t.validator.methods){var a;"required"===n?(a=s.get(0).getAttribute(n),""===a&&(a=!0),a=!!a):a=s.attr(n),/min|max/.test(n)&&(null===r||/number|range|text/.test(r))&&(a=Number(a)),a?i[n]=a:r===n&&"range"!==r&&(i[n]=!0)}return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(e){var i,s,r={},n=t(e);for(i in t.validator.methods)s=n.data("rule-"+i.toLowerCase()),void 0!==s&&(r[i]=s);return r},staticRules:function(e){var i={},s=t.data(e.form,"validator");return s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(s,r){if(r===!1)return delete e[s],void 0;if(r.param||r.depends){var n=!0;switch(typeof r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void 0!==r.param?r.param:!0:delete e[s]}}),t.each(e,function(s,r){e[s]=t.isFunction(r)?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(e.min&&e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),e.minlength&&e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==s?s:t.validator.messages[e],3>i.length&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:t.trim(e).length>0},email:function(t,e){return this.optional(e)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)},url:function(t,e){return this.optional(e)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(""+new Date(t))},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)},number:function(t,e){return this.optional(e)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},creditcard:function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i=0,s=0,r=!1;t=t.replace(/\D/g,"");for(var n=t.length-1;n>=0;n--){var a=t.charAt(n);s=parseInt(a,10),r&&(s*=2)>9&&(s-=9),i+=s,r=!r}return 0===i%10},minlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s},maxlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||s>=r},rangelength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s[0]&&s[1]>=r},min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||i>=t},range:function(t,e,i){return this.optional(e)||t>=i[0]&&i[1]>=t},equalTo:function(e,i,s){var r=t(s);return this.settings.onfocusout&&r.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s){if(this.optional(i))return"dependency-mismatch";var r=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),r.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=r.message,s="string"==typeof s&&{url:s}||s,r.old===e)return r.valid;r.old=e;var n=this;this.startRequest(i);var a={};return a[i.name]=e,t.ajax(t.extend(!0,{url:s,mode:"abort",port:"validate"+i.name,dataType:"json",data:a,success:function(s){n.settings.messages[i.name].remote=r.originalMessage;var a=s===!0||"true"===s;if(a){var u=n.formSubmitted;n.prepareElement(i),n.formSubmitted=u,n.successList.push(i),delete n.invalid[i.name],n.showErrors()}else{var o={},l=s||n.defaultMessage(i,"remote");o[i.name]=r.message=t.isFunction(l)?l(e):l,n.invalid[i.name]=!0,n.showErrors(o)}r.valid=a,n.stopRequest(i,a)}},s)),"pending"}}}),t.format=t.validator.format})(jQuery),function(t){var e={};if(t.ajaxPrefilter)t.ajaxPrefilter(function(t,i,s){var r=t.port;"abort"===t.mode&&(e[r]&&e[r].abort(),e[r]=s)});else{var i=t.ajax;t.ajax=function(s){var r=("mode"in s?s:t.ajaxSettings).mode,n=("port"in s?s:t.ajaxSettings).port;return"abort"===r?(e[n]&&e[n].abort(),e[n]=i.apply(this,arguments),e[n]):i.apply(this,arguments)}}}(jQuery),function(t){t.extend(t.fn,{validateDelegate:function(e,i,s){return this.bind(i,function(i){var r=t(i.target);return r.is(e)?s.apply(r,arguments):void 0})}})}(jQuery);
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-af.js DELETED
@@ -1,23 +0,0 @@
1
- /* Afrikaans initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Renier Pretorius. */
3
- jQuery(function($){
4
- $.datepicker.regional['af'] = {
5
- closeText: 'Selekteer',
6
- prevText: 'Vorige',
7
- nextText: 'Volgende',
8
- currentText: 'Vandag',
9
- monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie',
10
- 'Julie','Augustus','September','Oktober','November','Desember'],
11
- monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun',
12
- 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
13
- dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
14
- dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
15
- dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['af']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ar-DZ.js DELETED
@@ -1,23 +0,0 @@
1
- /* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/
2
- /* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem@yahoo.fr */
3
-
4
- jQuery(function($){
5
- $.datepicker.regional['ar-DZ'] = {
6
- closeText: 'إغلاق',
7
- prevText: '&#x3C;السابق',
8
- nextText: 'التالي&#x3E;',
9
- currentText: 'اليوم',
10
- monthNames: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان',
11
- 'جويلية', 'أوت', 'سبتمبر','أكتوبر', 'نوفمبر', 'ديسمبر'],
12
- monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
13
- dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
14
- dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
15
- dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
16
- weekHeader: 'أسبوع',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 6,
19
- isRTL: true,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['ar-DZ']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ar.js DELETED
@@ -1,23 +0,0 @@
1
- /* Arabic Translation for jQuery UI date picker plugin. */
2
- /* Khaled Alhourani -- me@khaledalhourani.com */
3
- /* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
4
- jQuery(function($){
5
- $.datepicker.regional['ar'] = {
6
- closeText: 'إغلاق',
7
- prevText: '&#x3C;السابق',
8
- nextText: 'التالي&#x3E;',
9
- currentText: 'اليوم',
10
- monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'مايو', 'حزيران',
11
- 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
12
- monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
13
- dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
14
- dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
15
- dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
16
- weekHeader: 'أسبوع',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 6,
19
- isRTL: true,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['ar']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-az.js DELETED
@@ -1,23 +0,0 @@
1
- /* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Jamil Najafov (necefov33@gmail.com). */
3
- jQuery(function($) {
4
- $.datepicker.regional['az'] = {
5
- closeText: 'Bağla',
6
- prevText: '&#x3C;Geri',
7
- nextText: 'İrəli&#x3E;',
8
- currentText: 'Bugün',
9
- monthNames: ['Yanvar','Fevral','Mart','Aprel','May','İyun',
10
- 'İyul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'],
11
- monthNamesShort: ['Yan','Fev','Mar','Apr','May','İyun',
12
- 'İyul','Avq','Sen','Okt','Noy','Dek'],
13
- dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'],
14
- dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'],
15
- dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'],
16
- weekHeader: 'Hf',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['az']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-be.js DELETED
@@ -1,23 +0,0 @@
1
- /* Belarusian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Pavel Selitskas <p.selitskas@gmail.com> */
3
- jQuery(function($){
4
- $.datepicker.regional['be'] = {
5
- closeText: 'Зачыніць',
6
- prevText: '&larr;Папяр.',
7
- nextText: 'Наст.&rarr;',
8
- currentText: 'Сёньня',
9
- monthNames: ['Студзень','Люты','Сакавік','Красавік','Травень','Чэрвень',
10
- 'Ліпень','Жнівень','Верасень','Кастрычнік','Лістапад','Сьнежань'],
11
- monthNamesShort: ['Сту','Лют','Сак','Кра','Тра','Чэр',
12
- 'Ліп','Жні','Вер','Кас','Ліс','Сьн'],
13
- dayNames: ['нядзеля','панядзелак','аўторак','серада','чацьвер','пятніца','субота'],
14
- dayNamesShort: ['ндз','пнд','аўт','срд','чцв','птн','сбт'],
15
- dayNamesMin: ['Нд','Пн','Аў','Ср','Чц','Пт','Сб'],
16
- weekHeader: 'Тд',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['be']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-bg.js DELETED
@@ -1,24 +0,0 @@
1
- /* Bulgarian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Stoyan Kyosev (http://svest.org). */
3
- jQuery(function($){
4
- $.datepicker.regional['bg'] = {
5
- closeText: 'затвори',
6
- prevText: '&#x3C;назад',
7
- nextText: 'напред&#x3E;',
8
- nextBigText: '&#x3E;&#x3E;',
9
- currentText: 'днес',
10
- monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
11
- 'Юли','Август','Септември','Октомври','Ноември','Декември'],
12
- monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
13
- 'Юли','Авг','Сеп','Окт','Нов','Дек'],
14
- dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
15
- dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
16
- dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
17
- weekHeader: 'Wk',
18
- dateFormat: 'dd.mm.yy',
19
- firstDay: 1,
20
- isRTL: false,
21
- showMonthAfterYear: false,
22
- yearSuffix: ''};
23
- $.datepicker.setDefaults($.datepicker.regional['bg']);
24
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-bs.js DELETED
@@ -1,23 +0,0 @@
1
- /* Bosnian i18n for the jQuery UI date picker plugin. */
2
- /* Written by Kenan Konjo. */
3
- jQuery(function($){
4
- $.datepicker.regional['bs'] = {
5
- closeText: 'Zatvori',
6
- prevText: '&#x3C;',
7
- nextText: '&#x3E;',
8
- currentText: 'Danas',
9
- monthNames: ['Januar','Februar','Mart','April','Maj','Juni',
10
- 'Juli','August','Septembar','Oktobar','Novembar','Decembar'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
12
- 'Jul','Aug','Sep','Okt','Nov','Dec'],
13
- dayNames: ['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
14
- dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
15
- dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['bs']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ca.js DELETED
@@ -1,23 +0,0 @@
1
- /* Inicialització en català per a l'extensió 'UI date picker' per jQuery. */
2
- /* Writers: (joan.leon@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['ca'] = {
5
- closeText: 'Tanca',
6
- prevText: 'Anterior',
7
- nextText: 'Següent',
8
- currentText: 'Avui',
9
- monthNames: ['gener','febrer','març','abril','maig','juny',
10
- 'juliol','agost','setembre','octubre','novembre','desembre'],
11
- monthNamesShort: ['gen','feb','març','abr','maig','juny',
12
- 'jul','ag','set','oct','nov','des'],
13
- dayNames: ['diumenge','dilluns','dimarts','dimecres','dijous','divendres','dissabte'],
14
- dayNamesShort: ['dg','dl','dt','dc','dj','dv','ds'],
15
- dayNamesMin: ['dg','dl','dt','dc','dj','dv','ds'],
16
- weekHeader: 'Set',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['ca']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-cs.js DELETED
@@ -1,23 +0,0 @@
1
- /* Czech initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Tomas Muller (tomas@tomas-muller.net). */
3
- jQuery(function($){
4
- $.datepicker.regional['cs'] = {
5
- closeText: 'Zavřít',
6
- prevText: '&#x3C;Dříve',
7
- nextText: 'Později&#x3E;',
8
- currentText: 'Nyní',
9
- monthNames: ['leden','únor','březen','duben','květen','červen',
10
- 'červenec','srpen','září','říjen','listopad','prosinec'],
11
- monthNamesShort: ['led','úno','bře','dub','kvě','čer',
12
- 'čvc','srp','zář','říj','lis','pro'],
13
- dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
14
- dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
15
- dayNamesMin: ['ne','po','út','st','čt','pá','so'],
16
- weekHeader: 'Týd',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['cs']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-cy-GB.js DELETED
@@ -1,23 +0,0 @@
1
- /* Welsh/UK initialisation for the jQuery UI date picker plugin. */
2
- /* Written by William Griffiths. */
3
- jQuery(function($){
4
- $.datepicker.regional['cy-GB'] = {
5
- closeText: 'Done',
6
- prevText: 'Prev',
7
- nextText: 'Next',
8
- currentText: 'Today',
9
- monthNames: ['Ionawr','Chwefror','Mawrth','Ebrill','Mai','Mehefin',
10
- 'Gorffennaf','Awst','Medi','Hydref','Tachwedd','Rhagfyr'],
11
- monthNamesShort: ['Ion', 'Chw', 'Maw', 'Ebr', 'Mai', 'Meh',
12
- 'Gor', 'Aws', 'Med', 'Hyd', 'Tac', 'Rha'],
13
- dayNames: ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'],
14
- dayNamesShort: ['Sul', 'Llu', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'],
15
- dayNamesMin: ['Su','Ll','Ma','Me','Ia','Gw','Sa'],
16
- weekHeader: 'Wy',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['cy-GB']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-da.js DELETED
@@ -1,23 +0,0 @@
1
- /* Danish initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Jan Christensen ( deletestuff@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['da'] = {
5
- closeText: 'Luk',
6
- prevText: '&#x3C;Forrige',
7
- nextText: 'Næste&#x3E;',
8
- currentText: 'Idag',
9
- monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
10
- 'Juli','August','September','Oktober','November','December'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
12
- 'Jul','Aug','Sep','Okt','Nov','Dec'],
13
- dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
14
- dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
15
- dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
16
- weekHeader: 'Uge',
17
- dateFormat: 'dd-mm-yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['da']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-de.js DELETED
@@ -1,23 +0,0 @@
1
- /* German initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Milian Wolff (mail@milianw.de). */
3
- jQuery(function($){
4
- $.datepicker.regional['de'] = {
5
- closeText: 'Schließen',
6
- prevText: '&#x3C;Zurück',
7
- nextText: 'Vor&#x3E;',
8
- currentText: 'Heute',
9
- monthNames: ['Januar','Februar','März','April','Mai','Juni',
10
- 'Juli','August','September','Oktober','November','Dezember'],
11
- monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
12
- 'Jul','Aug','Sep','Okt','Nov','Dez'],
13
- dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
14
- dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
15
- dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
16
- weekHeader: 'KW',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['de']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-el.js DELETED
@@ -1,23 +0,0 @@
1
- /* Greek (el) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Alex Cicovic (http://www.alexcicovic.com) */
3
- jQuery(function($){
4
- $.datepicker.regional['el'] = {
5
- closeText: 'Κλείσιμο',
6
- prevText: 'Προηγούμενος',
7
- nextText: 'Επόμενος',
8
- currentText: 'Τρέχων Μήνας',
9
- monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
10
- 'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
11
- monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
12
- 'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
13
- dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
14
- dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
15
- dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
16
- weekHeader: 'Εβδ',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['el']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-AU.js DELETED
@@ -1,23 +0,0 @@
1
- /* English/Australia initialisation for the jQuery UI date picker plugin. */
2
- /* Based on the en-GB initialisation. */
3
- jQuery(function($){
4
- $.datepicker.regional['en-AU'] = {
5
- closeText: 'Done',
6
- prevText: 'Prev',
7
- nextText: 'Next',
8
- currentText: 'Today',
9
- monthNames: ['January','February','March','April','May','June',
10
- 'July','August','September','October','November','December'],
11
- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
12
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
13
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
14
- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
15
- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['en-AU']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-GB.js DELETED
@@ -1,23 +0,0 @@
1
- /* English/UK initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Stuart. */
3
- jQuery(function($){
4
- $.datepicker.regional['en-GB'] = {
5
- closeText: 'Done',
6
- prevText: 'Prev',
7
- nextText: 'Next',
8
- currentText: 'Today',
9
- monthNames: ['January','February','March','April','May','June',
10
- 'July','August','September','October','November','December'],
11
- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
12
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
13
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
14
- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
15
- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['en-GB']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-NZ.js DELETED
@@ -1,23 +0,0 @@
1
- /* English/New Zealand initialisation for the jQuery UI date picker plugin. */
2
- /* Based on the en-GB initialisation. */
3
- jQuery(function($){
4
- $.datepicker.regional['en-NZ'] = {
5
- closeText: 'Done',
6
- prevText: 'Prev',
7
- nextText: 'Next',
8
- currentText: 'Today',
9
- monthNames: ['January','February','March','April','May','June',
10
- 'July','August','September','October','November','December'],
11
- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
12
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
13
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
14
- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
15
- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['en-NZ']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-eo.js DELETED
@@ -1,23 +0,0 @@
1
- /* Esperanto initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Olivier M. (olivierweb@ifrance.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['eo'] = {
5
- closeText: 'Fermi',
6
- prevText: '&#x3C;Anta',
7
- nextText: 'Sekv&#x3E;',
8
- currentText: 'Nuna',
9
- monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
10
- 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
12
- 'Jul','Aŭg','Sep','Okt','Nov','Dec'],
13
- dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
14
- dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'],
15
- dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'],
16
- weekHeader: 'Sb',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['eo']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-es.js DELETED
@@ -1,23 +0,0 @@
1
- /* Inicialización en español para la extensión 'UI date picker' para jQuery. */
2
- /* Traducido por Vester (xvester@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['es'] = {
5
- closeText: 'Cerrar',
6
- prevText: '&#x3C;Ant',
7
- nextText: 'Sig&#x3E;',
8
- currentText: 'Hoy',
9
- monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
10
- 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
11
- monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
12
- 'Jul','Ago','Sep','Oct','Nov','Dic'],
13
- dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'],
14
- dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
15
- dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
16
- weekHeader: 'Sm',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['es']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-et.js DELETED
@@ -1,23 +0,0 @@
1
- /* Estonian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Mart Sõmermaa (mrts.pydev at gmail com). */
3
- jQuery(function($){
4
- $.datepicker.regional['et'] = {
5
- closeText: 'Sulge',
6
- prevText: 'Eelnev',
7
- nextText: 'Järgnev',
8
- currentText: 'Täna',
9
- monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni',
10
- 'Juuli','August','September','Oktoober','November','Detsember'],
11
- monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni',
12
- 'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'],
13
- dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'],
14
- dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'],
15
- dayNamesMin: ['P','E','T','K','N','R','L'],
16
- weekHeader: 'näd',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['et']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-eu.js DELETED
@@ -1,23 +0,0 @@
1
- /* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */
2
- /* Karrikas-ek itzulia (karrikas@karrikas.com) */
3
- jQuery(function($){
4
- $.datepicker.regional['eu'] = {
5
- closeText: 'Egina',
6
- prevText: '&#x3C;Aur',
7
- nextText: 'Hur&#x3E;',
8
- currentText: 'Gaur',
9
- monthNames: ['urtarrila','otsaila','martxoa','apirila','maiatza','ekaina',
10
- 'uztaila','abuztua','iraila','urria','azaroa','abendua'],
11
- monthNamesShort: ['urt.','ots.','mar.','api.','mai.','eka.',
12
- 'uzt.','abu.','ira.','urr.','aza.','abe.'],
13
- dayNames: ['igandea','astelehena','asteartea','asteazkena','osteguna','ostirala','larunbata'],
14
- dayNamesShort: ['ig.','al.','ar.','az.','og.','ol.','lr.'],
15
- dayNamesMin: ['ig','al','ar','az','og','ol','lr'],
16
- weekHeader: 'As',
17
- dateFormat: 'yy-mm-dd',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['eu']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fa.js DELETED
@@ -1,59 +0,0 @@
1
- /* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
2
- /* Javad Mowlanezhad -- jmowla@gmail.com */
3
- /* Jalali calendar should supported soon! (Its implemented but I have to test it) */
4
- jQuery(function($) {
5
- $.datepicker.regional['fa'] = {
6
- closeText: 'بستن',
7
- prevText: '&#x3C;قبلی',
8
- nextText: 'بعدی&#x3E;',
9
- currentText: 'امروز',
10
- monthNames: [
11
- 'فروردين',
12
- 'ارديبهشت',
13
- 'خرداد',
14
- 'تير',
15
- 'مرداد',
16
- 'شهريور',
17
- 'مهر',
18
- 'آبان',
19
- 'آذر',
20
- 'دی',
21
- 'بهمن',
22
- 'اسفند'
23
- ],
24
- monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
25
- dayNames: [
26
- 'يکشنبه',
27
- 'دوشنبه',
28
- 'سه‌شنبه',
29
- 'چهارشنبه',
30
- 'پنجشنبه',
31
- 'جمعه',
32
- 'شنبه'
33
- ],
34
- dayNamesShort: [
35
- 'ی',
36
- 'د',
37
- 'س',
38
- 'چ',
39
- 'پ',
40
- 'ج',
41
- 'ش'
42
- ],
43
- dayNamesMin: [
44
- 'ی',
45
- 'د',
46
- 'س',
47
- 'چ',
48
- 'پ',
49
- 'ج',
50
- 'ش'
51
- ],
52
- weekHeader: 'هف',
53
- dateFormat: 'yy/mm/dd',
54
- firstDay: 6,
55
- isRTL: true,
56
- showMonthAfterYear: false,
57
- yearSuffix: ''};
58
- $.datepicker.setDefaults($.datepicker.regional['fa']);
59
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fi.js DELETED
@@ -1,23 +0,0 @@
1
- /* Finnish initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Harri Kilpiö (harrikilpio@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['fi'] = {
5
- closeText: 'Sulje',
6
- prevText: '&#xAB;Edellinen',
7
- nextText: 'Seuraava&#xBB;',
8
- currentText: 'Tänään',
9
- monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu',
10
- 'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
11
- monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä',
12
- 'Heinä','Elo','Syys','Loka','Marras','Joulu'],
13
- dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','La'],
14
- dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
15
- dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
16
- weekHeader: 'Vk',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['fi']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fo.js DELETED
@@ -1,23 +0,0 @@
1
- /* Faroese initialisation for the jQuery UI date picker plugin */
2
- /* Written by Sverri Mohr Olsen, sverrimo@gmail.com */
3
- jQuery(function($){
4
- $.datepicker.regional['fo'] = {
5
- closeText: 'Lat aftur',
6
- prevText: '&#x3C;Fyrra',
7
- nextText: 'Næsta&#x3E;',
8
- currentText: 'Í dag',
9
- monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni',
10
- 'Juli','August','September','Oktober','November','Desember'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
12
- 'Jul','Aug','Sep','Okt','Nov','Des'],
13
- dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'],
14
- dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'],
15
- dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'],
16
- weekHeader: 'Vk',
17
- dateFormat: 'dd-mm-yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['fo']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr-CA.js DELETED
@@ -1,23 +0,0 @@
1
- /* Canadian-French initialisation for the jQuery UI date picker plugin. */
2
- jQuery(function ($) {
3
- $.datepicker.regional['fr-CA'] = {
4
- closeText: 'Fermer',
5
- prevText: 'Précédent',
6
- nextText: 'Suivant',
7
- currentText: 'Aujourd\'hui',
8
- monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
9
- 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
10
- monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin',
11
- 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
12
- dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
13
- dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
14
- dayNamesMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
15
- weekHeader: 'Sem.',
16
- dateFormat: 'yy-mm-dd',
17
- firstDay: 0,
18
- isRTL: false,
19
- showMonthAfterYear: false,
20
- yearSuffix: ''
21
- };
22
- $.datepicker.setDefaults($.datepicker.regional['fr-CA']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr-CH.js DELETED
@@ -1,23 +0,0 @@
1
- /* Swiss-French initialisation for the jQuery UI date picker plugin. */
2
- /* Written Martin Voelkle (martin.voelkle@e-tc.ch). */
3
- jQuery(function($){
4
- $.datepicker.regional['fr-CH'] = {
5
- closeText: 'Fermer',
6
- prevText: '&#x3C;Préc',
7
- nextText: 'Suiv&#x3E;',
8
- currentText: 'Courant',
9
- monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
10
- 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
11
- monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
12
- 'Jul','Aoû','Sep','Oct','Nov','Déc'],
13
- dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
14
- dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
15
- dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
16
- weekHeader: 'Sm',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['fr-CH']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr.js DELETED
@@ -1,25 +0,0 @@
1
- /* French initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Keith Wood (kbwood{at}iinet.com.au),
3
- Stéphane Nahmani (sholby@sholby.net),
4
- Stéphane Raimbault <stephane.raimbault@gmail.com> */
5
- jQuery(function($){
6
- $.datepicker.regional['fr'] = {
7
- closeText: 'Fermer',
8
- prevText: 'Précédent',
9
- nextText: 'Suivant',
10
- currentText: 'Aujourd\'hui',
11
- monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
12
- 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
13
- monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin',
14
- 'Juil.','Août','Sept.','Oct.','Nov.','Déc.'],
15
- dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
16
- dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'],
17
- dayNamesMin: ['D','L','M','M','J','V','S'],
18
- weekHeader: 'Sem.',
19
- dateFormat: 'dd/mm/yy',
20
- firstDay: 1,
21
- isRTL: false,
22
- showMonthAfterYear: false,
23
- yearSuffix: ''};
24
- $.datepicker.setDefaults($.datepicker.regional['fr']);
25
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-gl.js DELETED
@@ -1,23 +0,0 @@
1
- /* Galician localization for 'UI date picker' jQuery extension. */
2
- /* Translated by Jorge Barreiro <yortx.barry@gmail.com>. */
3
- jQuery(function($){
4
- $.datepicker.regional['gl'] = {
5
- closeText: 'Pechar',
6
- prevText: '&#x3C;Ant',
7
- nextText: 'Seg&#x3E;',
8
- currentText: 'Hoxe',
9
- monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño',
10
- 'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'],
11
- monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ',
12
- 'Xul','Ago','Set','Out','Nov','Dec'],
13
- dayNames: ['Domingo','Luns','Martes','Mércores','Xoves','Venres','Sábado'],
14
- dayNamesShort: ['Dom','Lun','Mar','Mér','Xov','Ven','Sáb'],
15
- dayNamesMin: ['Do','Lu','Ma','Mé','Xo','Ve','Sá'],
16
- weekHeader: 'Sm',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['gl']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-he.js DELETED
@@ -1,23 +0,0 @@
1
- /* Hebrew initialisation for the UI Datepicker extension. */
2
- /* Written by Amir Hardon (ahardon at gmail dot com). */
3
- jQuery(function($){
4
- $.datepicker.regional['he'] = {
5
- closeText: 'סגור',
6
- prevText: '&#x3C;הקודם',
7
- nextText: 'הבא&#x3E;',
8
- currentText: 'היום',
9
- monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
10
- 'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
11
- monthNamesShort: ['ינו','פבר','מרץ','אפר','מאי','יוני',
12
- 'יולי','אוג','ספט','אוק','נוב','דצמ'],
13
- dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
14
- dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
15
- dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 0,
19
- isRTL: true,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['he']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hi.js DELETED
@@ -1,23 +0,0 @@
1
- /* Hindi initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Michael Dawart. */
3
- jQuery(function($){
4
- $.datepicker.regional['hi'] = {
5
- closeText: 'बंद',
6
- prevText: 'पिछला',
7
- nextText: 'अगला',
8
- currentText: 'आज',
9
- monthNames: ['जनवरी ','फरवरी','मार्च','अप्रेल','मई','जून',
10
- 'जूलाई','अगस्त ','सितम्बर','अक्टूबर','नवम्बर','दिसम्बर'],
11
- monthNamesShort: ['जन', 'फर', 'मार्च', 'अप्रेल', 'मई', 'जून',
12
- 'जूलाई', 'अग', 'सित', 'अक्ट', 'नव', 'दि'],
13
- dayNames: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'],
14
- dayNamesShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
15
- dayNamesMin: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
16
- weekHeader: 'हफ्ता',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['hi']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hr.js DELETED
@@ -1,23 +0,0 @@
1
- /* Croatian i18n for the jQuery UI date picker plugin. */
2
- /* Written by Vjekoslav Nesek. */
3
- jQuery(function($){
4
- $.datepicker.regional['hr'] = {
5
- closeText: 'Zatvori',
6
- prevText: '&#x3C;',
7
- nextText: '&#x3E;',
8
- currentText: 'Danas',
9
- monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj',
10
- 'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
11
- monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
12
- 'Srp','Kol','Ruj','Lis','Stu','Pro'],
13
- dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
14
- dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
15
- dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
16
- weekHeader: 'Tje',
17
- dateFormat: 'dd.mm.yy.',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['hr']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hu.js DELETED
@@ -1,23 +0,0 @@
1
- /* Hungarian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Istvan Karaszi (jquery@spam.raszi.hu). */
3
- jQuery(function($){
4
- $.datepicker.regional['hu'] = {
5
- closeText: 'bezár',
6
- prevText: 'vissza',
7
- nextText: 'előre',
8
- currentText: 'ma',
9
- monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június',
10
- 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
11
- monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún',
12
- 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
13
- dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
14
- dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
15
- dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
16
- weekHeader: 'Hét',
17
- dateFormat: 'yy.mm.dd.',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['hu']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hy.js DELETED
@@ -1,23 +0,0 @@
1
- /* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/
3
- jQuery(function($){
4
- $.datepicker.regional['hy'] = {
5
- closeText: 'Փակել',
6
- prevText: '&#x3C;Նախ.',
7
- nextText: 'Հաջ.&#x3E;',
8
- currentText: 'Այսօր',
9
- monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս',
10
- 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'],
11
- monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս',
12
- 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'],
13
- dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'],
14
- dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
15
- dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
16
- weekHeader: 'ՇԲՏ',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['hy']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-id.js DELETED
@@ -1,23 +0,0 @@
1
- /* Indonesian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Deden Fathurahman (dedenf@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['id'] = {
5
- closeText: 'Tutup',
6
- prevText: '&#x3C;mundur',
7
- nextText: 'maju&#x3E;',
8
- currentText: 'hari ini',
9
- monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
10
- 'Juli','Agustus','September','Oktober','Nopember','Desember'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
12
- 'Jul','Agus','Sep','Okt','Nop','Des'],
13
- dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
14
- dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
15
- dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
16
- weekHeader: 'Mg',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['id']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-is.js DELETED
@@ -1,23 +0,0 @@
1
- /* Icelandic initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Haukur H. Thorsson (haukur@eskill.is). */
3
- jQuery(function($){
4
- $.datepicker.regional['is'] = {
5
- closeText: 'Loka',
6
- prevText: '&#x3C; Fyrri',
7
- nextText: 'Næsti &#x3E;',
8
- currentText: 'Í dag',
9
- monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní',
10
- 'Júlí','Ágúst','September','Október','Nóvember','Desember'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún',
12
- 'Júl','Ágú','Sep','Okt','Nóv','Des'],
13
- dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'],
14
- dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'],
15
- dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'],
16
- weekHeader: 'Vika',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['is']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-it.js DELETED
@@ -1,23 +0,0 @@
1
- /* Italian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Antonello Pasella (antonello.pasella@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['it'] = {
5
- closeText: 'Chiudi',
6
- prevText: '&#x3C;Prec',
7
- nextText: 'Succ&#x3E;',
8
- currentText: 'Oggi',
9
- monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
10
- 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
11
- monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
12
- 'Lug','Ago','Set','Ott','Nov','Dic'],
13
- dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
14
- dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
15
- dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
16
- weekHeader: 'Sm',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['it']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ja.js DELETED
@@ -1,23 +0,0 @@
1
- /* Japanese initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Kentaro SATO (kentaro@ranvis.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['ja'] = {
5
- closeText: '閉じる',
6
- prevText: '&#x3C;前',
7
- nextText: '次&#x3E;',
8
- currentText: '今日',
9
- monthNames: ['1月','2月','3月','4月','5月','6月',
10
- '7月','8月','9月','10月','11月','12月'],
11
- monthNamesShort: ['1月','2月','3月','4月','5月','6月',
12
- '7月','8月','9月','10月','11月','12月'],
13
- dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
14
- dayNamesShort: ['日','月','火','水','木','金','土'],
15
- dayNamesMin: ['日','月','火','水','木','金','土'],
16
- weekHeader: '週',
17
- dateFormat: 'yy/mm/dd',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: '年'};
22
- $.datepicker.setDefaults($.datepicker.regional['ja']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ka.js DELETED
@@ -1,21 +0,0 @@
1
- /* Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Lado Lomidze (lado.lomidze@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['ka'] = {
5
- closeText: 'დახურვა',
6
- prevText: '&#x3c; წინა',
7
- nextText: 'შემდეგი &#x3e;',
8
- currentText: 'დღეს',
9
- monthNames: ['იანვარი','თებერვალი','მარტი','აპრილი','მაისი','ივნისი', 'ივლისი','აგვისტო','სექტემბერი','ოქტომბერი','ნოემბერი','დეკემბერი'],
10
- monthNamesShort: ['იან','თებ','მარ','აპრ','მაი','ივნ', 'ივლ','აგვ','სექ','ოქტ','ნოე','დეკ'],
11
- dayNames: ['კვირა','ორშაბათი','სამშაბათი','ოთხშაბათი','ხუთშაბათი','პარასკევი','შაბათი'],
12
- dayNamesShort: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'],
13
- dayNamesMin: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'],
14
- weekHeader: 'კვირა',
15
- dateFormat: 'dd-mm-yy',
16
- firstDay: 1,
17
- isRTL: false,
18
- showMonthAfterYear: false,
19
- yearSuffix: ''};
20
- $.datepicker.setDefaults($.datepicker.regional['ka']);
21
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-kk.js DELETED
@@ -1,23 +0,0 @@
1
- /* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Dmitriy Karasyov (dmitriy.karasyov@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['kk'] = {
5
- closeText: 'Жабу',
6
- prevText: '&#x3C;Алдыңғы',
7
- nextText: 'Келесі&#x3E;',
8
- currentText: 'Бүгін',
9
- monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым',
10
- 'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'],
11
- monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау',
12
- 'Шіл','Там','Қыр','Қаз','Қар','Жел'],
13
- dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'],
14
- dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'],
15
- dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'],
16
- weekHeader: 'Не',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['kk']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-km.js DELETED
@@ -1,23 +0,0 @@
1
- /* Khmer initialisation for the jQuery calendar extension. */
2
- /* Written by Chandara Om (chandara.teacher@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['km'] = {
5
- closeText: 'ធ្វើ​រួច',
6
- prevText: 'មុន',
7
- nextText: 'បន្ទាប់',
8
- currentText: 'ថ្ងៃ​នេះ',
9
- monthNames: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
10
- 'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
11
- monthNamesShort: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
12
- 'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
13
- dayNames: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'],
14
- dayNamesShort: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
15
- dayNamesMin: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
16
- weekHeader: 'សប្ដាហ៍',
17
- dateFormat: 'dd-mm-yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['km']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ko.js DELETED
@@ -1,23 +0,0 @@
1
- /* Korean initialisation for the jQuery calendar extension. */
2
- /* Written by DaeKwon Kang (ncrash.dk@gmail.com), Edited by Genie. */
3
- jQuery(function($){
4
- $.datepicker.regional['ko'] = {
5
- closeText: '닫기',
6
- prevText: '이전달',
7
- nextText: '다음달',
8
- currentText: '오늘',
9
- monthNames: ['1월','2월','3월','4월','5월','6월',
10
- '7월','8월','9월','10월','11월','12월'],
11
- monthNamesShort: ['1월','2월','3월','4월','5월','6월',
12
- '7월','8월','9월','10월','11월','12월'],
13
- dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'],
14
- dayNamesShort: ['일','월','화','수','목','금','토'],
15
- dayNamesMin: ['일','월','화','수','목','금','토'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'yy-mm-dd',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: '년'};
22
- $.datepicker.setDefaults($.datepicker.regional['ko']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ky.js DELETED
@@ -1,24 +0,0 @@
1
- /* Kyrgyz (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Sergey Kartashov (ebishkek@yandex.ru). */
3
- jQuery(function($){
4
- $.datepicker.regional['ky'] = {
5
- closeText: 'Жабуу',
6
- prevText: '&#x3c;Мур',
7
- nextText: 'Кий&#x3e;',
8
- currentText: 'Бүгүн',
9
- monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
10
- 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
11
- monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
12
- 'Июл','Авг','Сен','Окт','Ноя','Дек'],
13
- dayNames: ['жекшемби', 'дүйшөмбү', 'шейшемби', 'шаршемби', 'бейшемби', 'жума', 'ишемби'],
14
- dayNamesShort: ['жек', 'дүй', 'шей', 'шар', 'бей', 'жум', 'ише'],
15
- dayNamesMin: ['Жк','Дш','Шш','Шр','Бш','Жм','Иш'],
16
- weekHeader: 'Жум',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''
22
- };
23
- $.datepicker.setDefaults($.datepicker.regional['ky']);
24
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lb.js DELETED
@@ -1,23 +0,0 @@
1
- /* Luxembourgish initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Michel Weimerskirch <michel@weimerskirch.net> */
3
- jQuery(function($){
4
- $.datepicker.regional['lb'] = {
5
- closeText: 'Fäerdeg',
6
- prevText: 'Zréck',
7
- nextText: 'Weider',
8
- currentText: 'Haut',
9
- monthNames: ['Januar','Februar','Mäerz','Abrëll','Mee','Juni',
10
- 'Juli','August','September','Oktober','November','Dezember'],
11
- monthNamesShort: ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun',
12
- 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
13
- dayNames: ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'],
14
- dayNamesShort: ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'],
15
- dayNamesMin: ['So','Mé','Dë','Më','Do','Fr','Sa'],
16
- weekHeader: 'W',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['lb']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lt.js DELETED
@@ -1,23 +0,0 @@
1
- /* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* @author Arturas Paleicikas <arturas@avalon.lt> */
3
- jQuery(function($){
4
- $.datepicker.regional['lt'] = {
5
- closeText: 'Uždaryti',
6
- prevText: '&#x3C;Atgal',
7
- nextText: 'Pirmyn&#x3E;',
8
- currentText: 'Šiandien',
9
- monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
10
- 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
11
- monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
12
- 'Lie','Rugp','Rugs','Spa','Lap','Gru'],
13
- dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'],
14
- dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
15
- dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'yy-mm-dd',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['lt']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lv.js DELETED
@@ -1,23 +0,0 @@
1
- /* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* @author Arturas Paleicikas <arturas.paleicikas@metasite.net> */
3
- jQuery(function($){
4
- $.datepicker.regional['lv'] = {
5
- closeText: 'Aizvērt',
6
- prevText: 'Iepr',
7
- nextText: 'Nāka',
8
- currentText: 'Šodien',
9
- monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs',
10
- 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn',
12
- 'Jūl','Aug','Sep','Okt','Nov','Dec'],
13
- dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
14
- dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
15
- dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
16
- weekHeader: 'Nav',
17
- dateFormat: 'dd-mm-yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['lv']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-mk.js DELETED
@@ -1,23 +0,0 @@
1
- /* Macedonian i18n for the jQuery UI date picker plugin. */
2
- /* Written by Stojce Slavkovski. */
3
- jQuery(function($){
4
- $.datepicker.regional['mk'] = {
5
- closeText: 'Затвори',
6
- prevText: '&#x3C;',
7
- nextText: '&#x3E;',
8
- currentText: 'Денес',
9
- monthNames: ['Јануари','Февруари','Март','Април','Мај','Јуни',
10
- 'Јули','Август','Септември','Октомври','Ноември','Декември'],
11
- monthNamesShort: ['Јан','Фев','Мар','Апр','Мај','Јун',
12
- 'Јул','Авг','Сеп','Окт','Ное','Дек'],
13
- dayNames: ['Недела','Понеделник','Вторник','Среда','Четврток','Петок','Сабота'],
14
- dayNamesShort: ['Нед','Пон','Вто','Сре','Чет','Пет','Саб'],
15
- dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Са'],
16
- weekHeader: 'Сед',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['mk']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ml.js DELETED
@@ -1,23 +0,0 @@
1
- /* Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Saji Nediyanchath (saji89@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['ml'] = {
5
- closeText: 'ശരി',
6
- prevText: 'മുന്നത്തെ',
7
- nextText: 'അടുത്തത് ',
8
- currentText: 'ഇന്ന്',
9
- monthNames: ['ജനുവരി','ഫെബ്രുവരി','മാര്‍ച്ച്','ഏപ്രില്‍','മേയ്','ജൂണ്‍',
10
- 'ജൂലൈ','ആഗസ്റ്റ്','സെപ്റ്റംബര്‍','ഒക്ടോബര്‍','നവംബര്‍','ഡിസംബര്‍'],
11
- monthNamesShort: ['ജനു', 'ഫെബ്', 'മാര്‍', 'ഏപ്രി', 'മേയ്', 'ജൂണ്‍',
12
- 'ജൂലാ', 'ആഗ', 'സെപ്', 'ഒക്ടോ', 'നവം', 'ഡിസ'],
13
- dayNames: ['ഞായര്‍', 'തിങ്കള്‍', 'ചൊവ്വ', 'ബുധന്‍', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
14
- dayNamesShort: ['ഞായ', 'തിങ്ക', 'ചൊവ്വ', 'ബുധ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
15
- dayNamesMin: ['ഞാ','തി','ചൊ','ബു','വ്യാ','വെ','ശ'],
16
- weekHeader: 'ആ',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['ml']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ms.js DELETED
@@ -1,23 +0,0 @@
1
- /* Malaysian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */
3
- jQuery(function($){
4
- $.datepicker.regional['ms'] = {
5
- closeText: 'Tutup',
6
- prevText: '&#x3C;Sebelum',
7
- nextText: 'Selepas&#x3E;',
8
- currentText: 'hari ini',
9
- monthNames: ['Januari','Februari','Mac','April','Mei','Jun',
10
- 'Julai','Ogos','September','Oktober','November','Disember'],
11
- monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun',
12
- 'Jul','Ogo','Sep','Okt','Nov','Dis'],
13
- dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'],
14
- dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'],
15
- dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'],
16
- weekHeader: 'Mg',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['ms']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nb.js DELETED
@@ -1,22 +0,0 @@
1
- /* Norwegian Bokmål initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Bjørn Johansen (post@bjornjohansen.no). */
3
- jQuery(function($){
4
- $.datepicker.regional['nb'] = {
5
- closeText: 'Lukk',
6
- prevText: '&#xAB;Forrige',
7
- nextText: 'Neste&#xBB;',
8
- currentText: 'I dag',
9
- monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'],
10
- monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'],
11
- dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'],
12
- dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'],
13
- dayNamesMin: ['sø','ma','ti','on','to','fr','lø'],
14
- weekHeader: 'Uke',
15
- dateFormat: 'dd.mm.yy',
16
- firstDay: 1,
17
- isRTL: false,
18
- showMonthAfterYear: false,
19
- yearSuffix: ''
20
- };
21
- $.datepicker.setDefaults($.datepicker.regional['nb']);
22
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nl-BE.js DELETED
@@ -1,23 +0,0 @@
1
- /* Dutch (Belgium) initialisation for the jQuery UI date picker plugin. */
2
- /* David De Sloovere @DavidDeSloovere */
3
- jQuery(function($){
4
- $.datepicker.regional['nl-BE'] = {
5
- closeText: 'Sluiten',
6
- prevText: '←',
7
- nextText: '→',
8
- currentText: 'Vandaag',
9
- monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
10
- 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
11
- monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
12
- 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
13
- dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
14
- dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
15
- dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['nl-BE']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nl.js DELETED
@@ -1,23 +0,0 @@
1
- /* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Mathias Bynens <http://mathiasbynens.be/> */
3
- jQuery(function($){
4
- $.datepicker.regional.nl = {
5
- closeText: 'Sluiten',
6
- prevText: '←',
7
- nextText: '→',
8
- currentText: 'Vandaag',
9
- monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
10
- 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
11
- monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
12
- 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
13
- dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
14
- dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
15
- dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd-mm-yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional.nl);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nn.js DELETED
@@ -1,22 +0,0 @@
1
- /* Norwegian Nynorsk initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Bjørn Johansen (post@bjornjohansen.no). */
3
- jQuery(function($){
4
- $.datepicker.regional['nn'] = {
5
- closeText: 'Lukk',
6
- prevText: '&#xAB;Førre',
7
- nextText: 'Neste&#xBB;',
8
- currentText: 'I dag',
9
- monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'],
10
- monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'],
11
- dayNamesShort: ['sun','mån','tys','ons','tor','fre','lau'],
12
- dayNames: ['sundag','måndag','tysdag','onsdag','torsdag','fredag','laurdag'],
13
- dayNamesMin: ['su','må','ty','on','to','fr','la'],
14
- weekHeader: 'Veke',
15
- dateFormat: 'dd.mm.yy',
16
- firstDay: 1,
17
- isRTL: false,
18
- showMonthAfterYear: false,
19
- yearSuffix: ''
20
- };
21
- $.datepicker.setDefaults($.datepicker.regional['nn']);
22
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-no.js DELETED
@@ -1,23 +0,0 @@
1
- /* Norwegian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Naimdjon Takhirov (naimdjon@gmail.com). */
3
-
4
- jQuery(function($){
5
- $.datepicker.regional['no'] = {
6
- closeText: 'Lukk',
7
- prevText: '&#xAB;Forrige',
8
- nextText: 'Neste&#xBB;',
9
- currentText: 'I dag',
10
- monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'],
11
- monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'],
12
- dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'],
13
- dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'],
14
- dayNamesMin: ['sø','ma','ti','on','to','fr','lø'],
15
- weekHeader: 'Uke',
16
- dateFormat: 'dd.mm.yy',
17
- firstDay: 1,
18
- isRTL: false,
19
- showMonthAfterYear: false,
20
- yearSuffix: ''
21
- };
22
- $.datepicker.setDefaults($.datepicker.regional['no']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pl.js DELETED
@@ -1,23 +0,0 @@
1
- /* Polish initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['pl'] = {
5
- closeText: 'Zamknij',
6
- prevText: '&#x3C;Poprzedni',
7
- nextText: 'Następny&#x3E;',
8
- currentText: 'Dziś',
9
- monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
10
- 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
11
- monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
12
- 'Lip','Sie','Wrz','Pa','Lis','Gru'],
13
- dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
14
- dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
15
- dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
16
- weekHeader: 'Tydz',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['pl']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pt-BR.js DELETED
@@ -1,23 +0,0 @@
1
- /* Brazilian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Leonildo Costa Silva (leocsilva@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['pt-BR'] = {
5
- closeText: 'Fechar',
6
- prevText: '&#x3C;Anterior',
7
- nextText: 'Próximo&#x3E;',
8
- currentText: 'Hoje',
9
- monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
10
- 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
11
- monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
12
- 'Jul','Ago','Set','Out','Nov','Dez'],
13
- dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
14
- dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
15
- dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
16
- weekHeader: 'Sm',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['pt-BR']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pt.js DELETED
@@ -1,22 +0,0 @@
1
- /* Portuguese initialisation for the jQuery UI date picker plugin. */
2
- jQuery(function($){
3
- $.datepicker.regional['pt'] = {
4
- closeText: 'Fechar',
5
- prevText: '&#x3C;Anterior',
6
- nextText: 'Seguinte',
7
- currentText: 'Hoje',
8
- monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
9
- 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
10
- monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
11
- 'Jul','Ago','Set','Out','Nov','Dez'],
12
- dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
13
- dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
14
- dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
15
- weekHeader: 'Sem',
16
- dateFormat: 'dd/mm/yy',
17
- firstDay: 0,
18
- isRTL: false,
19
- showMonthAfterYear: false,
20
- yearSuffix: ''};
21
- $.datepicker.setDefaults($.datepicker.regional['pt']);
22
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-rm.js DELETED
@@ -1,21 +0,0 @@
1
- /* Romansh initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Yvonne Gienal (yvonne.gienal@educa.ch). */
3
- jQuery(function($){
4
- $.datepicker.regional['rm'] = {
5
- closeText: 'Serrar',
6
- prevText: '&#x3C;Suandant',
7
- nextText: 'Precedent&#x3E;',
8
- currentText: 'Actual',
9
- monthNames: ['Schaner','Favrer','Mars','Avrigl','Matg','Zercladur', 'Fanadur','Avust','Settember','October','November','December'],
10
- monthNamesShort: ['Scha','Fev','Mar','Avr','Matg','Zer', 'Fan','Avu','Sett','Oct','Nov','Dec'],
11
- dayNames: ['Dumengia','Glindesdi','Mardi','Mesemna','Gievgia','Venderdi','Sonda'],
12
- dayNamesShort: ['Dum','Gli','Mar','Mes','Gie','Ven','Som'],
13
- dayNamesMin: ['Du','Gl','Ma','Me','Gi','Ve','So'],
14
- weekHeader: 'emna',
15
- dateFormat: 'dd/mm/yy',
16
- firstDay: 1,
17
- isRTL: false,
18
- showMonthAfterYear: false,
19
- yearSuffix: ''};
20
- $.datepicker.setDefaults($.datepicker.regional['rm']);
21
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ro.js DELETED
@@ -1,26 +0,0 @@
1
- /* Romanian initialisation for the jQuery UI date picker plugin.
2
- *
3
- * Written by Edmond L. (ll_edmond@walla.com)
4
- * and Ionut G. Stan (ionut.g.stan@gmail.com)
5
- */
6
- jQuery(function($){
7
- $.datepicker.regional['ro'] = {
8
- closeText: 'Închide',
9
- prevText: '&#xAB; Luna precedentă',
10
- nextText: 'Luna următoare &#xBB;',
11
- currentText: 'Azi',
12
- monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie',
13
- 'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'],
14
- monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun',
15
- 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
16
- dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'],
17
- dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
18
- dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'],
19
- weekHeader: 'Săpt',
20
- dateFormat: 'dd.mm.yy',
21
- firstDay: 1,
22
- isRTL: false,
23
- showMonthAfterYear: false,
24
- yearSuffix: ''};
25
- $.datepicker.setDefaults($.datepicker.regional['ro']);
26
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ru.js DELETED
@@ -1,23 +0,0 @@
1
- /* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Andrew Stromnov (stromnov@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['ru'] = {
5
- closeText: 'Закрыть',
6
- prevText: '&#x3C;Пред',
7
- nextText: 'След&#x3E;',
8
- currentText: 'Сегодня',
9
- monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
10
- 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
11
- monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
12
- 'Июл','Авг','Сен','Окт','Ноя','Дек'],
13
- dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
14
- dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
15
- dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
16
- weekHeader: 'Нед',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['ru']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sk.js DELETED
@@ -1,23 +0,0 @@
1
- /* Slovak initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Vojtech Rinik (vojto@hmm.sk). */
3
- jQuery(function($){
4
- $.datepicker.regional['sk'] = {
5
- closeText: 'Zavrieť',
6
- prevText: '&#x3C;Predchádzajúci',
7
- nextText: 'Nasledujúci&#x3E;',
8
- currentText: 'Dnes',
9
- monthNames: ['január','február','marec','apríl','máj','jún',
10
- 'júl','august','september','október','november','december'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
12
- 'Júl','Aug','Sep','Okt','Nov','Dec'],
13
- dayNames: ['nedeľa','pondelok','utorok','streda','štvrtok','piatok','sobota'],
14
- dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'],
15
- dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'],
16
- weekHeader: 'Ty',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['sk']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sl.js DELETED
@@ -1,24 +0,0 @@
1
- /* Slovenian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Jaka Jancar (jaka@kubje.org). */
3
- /* c = č, s = š z = ž C = Č S = Š Z = Ž */
4
- jQuery(function($){
5
- $.datepicker.regional['sl'] = {
6
- closeText: 'Zapri',
7
- prevText: '&#x3C;Prejšnji',
8
- nextText: 'Naslednji&#x3E;',
9
- currentText: 'Trenutni',
10
- monthNames: ['Januar','Februar','Marec','April','Maj','Junij',
11
- 'Julij','Avgust','September','Oktober','November','December'],
12
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
13
- 'Jul','Avg','Sep','Okt','Nov','Dec'],
14
- dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','Četrtek','Petek','Sobota'],
15
- dayNamesShort: ['Ned','Pon','Tor','Sre','Čet','Pet','Sob'],
16
- dayNamesMin: ['Ne','Po','To','Sr','Če','Pe','So'],
17
- weekHeader: 'Teden',
18
- dateFormat: 'dd.mm.yy',
19
- firstDay: 1,
20
- isRTL: false,
21
- showMonthAfterYear: false,
22
- yearSuffix: ''};
23
- $.datepicker.setDefaults($.datepicker.regional['sl']);
24
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sq.js DELETED
@@ -1,23 +0,0 @@
1
- /* Albanian initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Flakron Bytyqi (flakron@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['sq'] = {
5
- closeText: 'mbylle',
6
- prevText: '&#x3C;mbrapa',
7
- nextText: 'Përpara&#x3E;',
8
- currentText: 'sot',
9
- monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor',
10
- 'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'],
11
- monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer',
12
- 'Kor','Gus','Sht','Tet','Nën','Dhj'],
13
- dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'],
14
- dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'],
15
- dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'],
16
- weekHeader: 'Ja',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['sq']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sr-SR.js DELETED
@@ -1,23 +0,0 @@
1
- /* Serbian i18n for the jQuery UI date picker plugin. */
2
- /* Written by Dejan Dimić. */
3
- jQuery(function($){
4
- $.datepicker.regional['sr-SR'] = {
5
- closeText: 'Zatvori',
6
- prevText: '&#x3C;',
7
- nextText: '&#x3E;',
8
- currentText: 'Danas',
9
- monthNames: ['Januar','Februar','Mart','April','Maj','Jun',
10
- 'Jul','Avgust','Septembar','Oktobar','Novembar','Decembar'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
12
- 'Jul','Avg','Sep','Okt','Nov','Dec'],
13
- dayNames: ['Nedelja','Ponedeljak','Utorak','Sreda','Četvrtak','Petak','Subota'],
14
- dayNamesShort: ['Ned','Pon','Uto','Sre','Čet','Pet','Sub'],
15
- dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
16
- weekHeader: 'Sed',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['sr-SR']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sr.js DELETED
@@ -1,23 +0,0 @@
1
- /* Serbian i18n for the jQuery UI date picker plugin. */
2
- /* Written by Dejan Dimić. */
3
- jQuery(function($){
4
- $.datepicker.regional['sr'] = {
5
- closeText: 'Затвори',
6
- prevText: '&#x3C;',
7
- nextText: '&#x3E;',
8
- currentText: 'Данас',
9
- monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун',
10
- 'Јул','Август','Септембар','Октобар','Новембар','Децембар'],
11
- monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун',
12
- 'Јул','Авг','Сеп','Окт','Нов','Дец'],
13
- dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'],
14
- dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'],
15
- dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'],
16
- weekHeader: 'Сед',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['sr']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sv.js DELETED
@@ -1,23 +0,0 @@
1
- /* Swedish initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Anders Ekdahl ( anders@nomadiz.se). */
3
- jQuery(function($){
4
- $.datepicker.regional['sv'] = {
5
- closeText: 'Stäng',
6
- prevText: '&#xAB;Förra',
7
- nextText: 'Nästa&#xBB;',
8
- currentText: 'Idag',
9
- monthNames: ['Januari','Februari','Mars','April','Maj','Juni',
10
- 'Juli','Augusti','September','Oktober','November','December'],
11
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
12
- 'Jul','Aug','Sep','Okt','Nov','Dec'],
13
- dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'],
14
- dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'],
15
- dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'],
16
- weekHeader: 'Ve',
17
- dateFormat: 'yy-mm-dd',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['sv']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ta.js DELETED
@@ -1,23 +0,0 @@
1
- /* Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by S A Sureshkumar (saskumar@live.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['ta'] = {
5
- closeText: 'மூடு',
6
- prevText: 'முன்னையது',
7
- nextText: 'அடுத்தது',
8
- currentText: 'இன்று',
9
- monthNames: ['தை','மாசி','பங்குனி','சித்திரை','வைகாசி','ஆனி',
10
- 'ஆடி','ஆவணி','புரட்டாசி','ஐப்பசி','கார்த்திகை','மார்கழி'],
11
- monthNamesShort: ['தை','மாசி','பங்','சித்','வைகா','ஆனி',
12
- 'ஆடி','ஆவ','புர','ஐப்','கார்','மார்'],
13
- dayNames: ['ஞாயிற்றுக்கிழமை','திங்கட்கிழமை','செவ்வாய்க்கிழமை','புதன்கிழமை','வியாழக்கிழமை','வெள்ளிக்கிழமை','சனிக்கிழமை'],
14
- dayNamesShort: ['ஞாயிறு','திங்கள்','செவ்வாய்','புதன்','வியாழன்','வெள்ளி','சனி'],
15
- dayNamesMin: ['ஞா','தி','செ','பு','வி','வெ','ச'],
16
- weekHeader: 'Не',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['ta']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-th.js DELETED
@@ -1,23 +0,0 @@
1
- /* Thai initialisation for the jQuery UI date picker plugin. */
2
- /* Written by pipo (pipo@sixhead.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['th'] = {
5
- closeText: 'ปิด',
6
- prevText: '&#xAB;&#xA0;ย้อน',
7
- nextText: 'ถัดไป&#xA0;&#xBB;',
8
- currentText: 'วันนี้',
9
- monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน',
10
- 'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
11
- monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.',
12
- 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'],
13
- dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'],
14
- dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
15
- dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
16
- weekHeader: 'Wk',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['th']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-tj.js DELETED
@@ -1,23 +0,0 @@
1
- /* Tajiki (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Abdurahmon Saidov (saidovab@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['tj'] = {
5
- closeText: 'Идома',
6
- prevText: '&#x3c;Қафо',
7
- nextText: 'Пеш&#x3e;',
8
- currentText: 'Имрӯз',
9
- monthNames: ['Январ','Феврал','Март','Апрел','Май','Июн',
10
- 'Июл','Август','Сентябр','Октябр','Ноябр','Декабр'],
11
- monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
12
- 'Июл','Авг','Сен','Окт','Ноя','Дек'],
13
- dayNames: ['якшанбе','душанбе','сешанбе','чоршанбе','панҷшанбе','ҷумъа','шанбе'],
14
- dayNamesShort: ['якш','душ','сеш','чор','пан','ҷум','шан'],
15
- dayNamesMin: ['Як','Дш','Сш','Чш','Пш','Ҷм','Шн'],
16
- weekHeader: 'Хф',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['tj']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-tr.js DELETED
@@ -1,23 +0,0 @@
1
- /* Turkish initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Izzet Emre Erkan (kara@karalamalar.net). */
3
- jQuery(function($){
4
- $.datepicker.regional['tr'] = {
5
- closeText: 'kapat',
6
- prevText: '&#x3C;geri',
7
- nextText: 'ileri&#x3e',
8
- currentText: 'bugün',
9
- monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
10
- 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
11
- monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz',
12
- 'Tem','Ağu','Eyl','Eki','Kas','Ara'],
13
- dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
14
- dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
15
- dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
16
- weekHeader: 'Hf',
17
- dateFormat: 'dd.mm.yy',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['tr']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-uk.js DELETED
@@ -1,24 +0,0 @@
1
- /* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Maxim Drogobitskiy (maxdao@gmail.com). */
3
- /* Corrected by Igor Milla (igor.fsp.milla@gmail.com). */
4
- jQuery(function($){
5
- $.datepicker.regional['uk'] = {
6
- closeText: 'Закрити',
7
- prevText: '&#x3C;',
8
- nextText: '&#x3E;',
9
- currentText: 'Сьогодні',
10
- monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
11
- 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],
12
- monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
13
- 'Лип','Сер','Вер','Жов','Лис','Гру'],
14
- dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'],
15
- dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'],
16
- dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'],
17
- weekHeader: 'Тиж',
18
- dateFormat: 'dd/mm/yy',
19
- firstDay: 1,
20
- isRTL: false,
21
- showMonthAfterYear: false,
22
- yearSuffix: ''};
23
- $.datepicker.setDefaults($.datepicker.regional['uk']);
24
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-vi.js DELETED
@@ -1,23 +0,0 @@
1
- /* Vietnamese initialisation for the jQuery UI date picker plugin. */
2
- /* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */
3
- jQuery(function($){
4
- $.datepicker.regional['vi'] = {
5
- closeText: 'Đóng',
6
- prevText: '&#x3C;Trước',
7
- nextText: 'Tiếp&#x3E;',
8
- currentText: 'Hôm nay',
9
- monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu',
10
- 'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'],
11
- monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6',
12
- 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],
13
- dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
14
- dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
15
- dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
16
- weekHeader: 'Tu',
17
- dateFormat: 'dd/mm/yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: false,
21
- yearSuffix: ''};
22
- $.datepicker.setDefaults($.datepicker.regional['vi']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-CN.js DELETED
@@ -1,23 +0,0 @@
1
- /* Chinese initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Cloudream (cloudream@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['zh-CN'] = {
5
- closeText: '关闭',
6
- prevText: '&#x3C;上月',
7
- nextText: '下月&#x3E;',
8
- currentText: '今天',
9
- monthNames: ['一月','二月','三月','四月','五月','六月',
10
- '七月','八月','九月','十月','十一月','十二月'],
11
- monthNamesShort: ['一月','二月','三月','四月','五月','六月',
12
- '七月','八月','九月','十月','十一月','十二月'],
13
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
14
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
15
- dayNamesMin: ['日','一','二','三','四','五','六'],
16
- weekHeader: '周',
17
- dateFormat: 'yy-mm-dd',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: '年'};
22
- $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-HK.js DELETED
@@ -1,23 +0,0 @@
1
- /* Chinese initialisation for the jQuery UI date picker plugin. */
2
- /* Written by SCCY (samuelcychan@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['zh-HK'] = {
5
- closeText: '關閉',
6
- prevText: '&#x3C;上月',
7
- nextText: '下月&#x3E;',
8
- currentText: '今天',
9
- monthNames: ['一月','二月','三月','四月','五月','六月',
10
- '七月','八月','九月','十月','十一月','十二月'],
11
- monthNamesShort: ['一月','二月','三月','四月','五月','六月',
12
- '七月','八月','九月','十月','十一月','十二月'],
13
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
14
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
15
- dayNamesMin: ['日','一','二','三','四','五','六'],
16
- weekHeader: '周',
17
- dateFormat: 'dd-mm-yy',
18
- firstDay: 0,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: '年'};
22
- $.datepicker.setDefaults($.datepicker.regional['zh-HK']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-TW.js DELETED
@@ -1,23 +0,0 @@
1
- /* Chinese initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Ressol (ressol@gmail.com). */
3
- jQuery(function($){
4
- $.datepicker.regional['zh-TW'] = {
5
- closeText: '關閉',
6
- prevText: '&#x3C;上月',
7
- nextText: '下月&#x3E;',
8
- currentText: '今天',
9
- monthNames: ['一月','二月','三月','四月','五月','六月',
10
- '七月','八月','九月','十月','十一月','十二月'],
11
- monthNamesShort: ['一月','二月','三月','四月','五月','六月',
12
- '七月','八月','九月','十月','十一月','十二月'],
13
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
14
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
15
- dayNamesMin: ['日','一','二','三','四','五','六'],
16
- weekHeader: '周',
17
- dateFormat: 'yy/mm/dd',
18
- firstDay: 1,
19
- isRTL: false,
20
- showMonthAfterYear: true,
21
- yearSuffix: '年'};
22
- $.datepicker.setDefaults($.datepicker.regional['zh-TW']);
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/jquery-ui-timepicker-addon-i18n.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
2
+ * http://trentrichardson.com/examples/timepicker
3
+ * Copyright (c) 2016 Trent Richardson; Licensed MIT */
4
+ !function(a){a.timepicker.regional.af={timeOnlyTitle:"Kies Tyd",timeText:"Tyd ",hourText:"Ure ",minuteText:"Minute",secondText:"Sekondes",millisecText:"Millisekondes",microsecText:"Mikrosekondes",timezoneText:"Tydsone",currentText:"Huidige Tyd",closeText:"Klaar",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.am={timeOnlyTitle:"Ընտրեք ժամանակը",timeText:"Ժամանակը",hourText:"Ժամ",minuteText:"Րոպե",secondText:"Վարկյան",millisecText:"Միլիվարկյան",microsecText:"Միկրովարկյան",timezoneText:"Ժամային գոտին",currentText:"Այժմ",closeText:"Փակել",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.bg={timeOnlyTitle:"Изберете време",timeText:"Време",hourText:"Час",minuteText:"Минути",secondText:"Секунди",millisecText:"Милисекунди",microsecText:"Микросекунди",timezoneText:"Часови пояс",currentText:"Сега",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.ca={timeOnlyTitle:"Escollir una hora",timeText:"Hora",hourText:"Hores",minuteText:"Minuts",secondText:"Segons",millisecText:"Milisegons",microsecText:"Microsegons",timezoneText:"Fus horari",currentText:"Ara",closeText:"Tancar",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.cs={timeOnlyTitle:"Vyberte čas",timeText:"Čas",hourText:"Hodiny",minuteText:"Minuty",secondText:"Vteřiny",millisecText:"Milisekundy",microsecText:"Mikrosekundy",timezoneText:"Časové pásmo",currentText:"Nyní",closeText:"Zavřít",timeFormat:"HH:mm",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["odp.","PM","P"],isRTL:!1},a.timepicker.regional.da={timeOnlyTitle:"Vælg tid",timeText:"Tid",hourText:"Time",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tidszone",currentText:"Nu",closeText:"Luk",timeFormat:"HH:mm",timeSuffix:"",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},a.timepicker.regional.de={timeOnlyTitle:"Zeit wählen",timeText:"Zeit",hourText:"Stunde",minuteText:"Minute",secondText:"Sekunde",millisecText:"Millisekunde",microsecText:"Mikrosekunde",timezoneText:"Zeitzone",currentText:"Jetzt",closeText:"Fertig",timeFormat:"HH:mm",timeSuffix:"",amNames:["vorm.","AM","A"],pmNames:["nachm.","PM","P"],isRTL:!1},a.timepicker.regional.el={timeOnlyTitle:"Επιλογή ώρας",timeText:"Ώρα",hourText:"Ώρες",minuteText:"Λεπτά",secondText:"Δευτερόλεπτα",millisecText:"Χιλιοστοδευτερόλεπτα",microsecText:"Μικροδευτερόλεπτα",timezoneText:"Ζώνη ώρας",currentText:"Τώρα",closeText:"Κλείσιμο",timeFormat:"HH:mm",timeSuffix:"",amNames:["π.μ.","AM","A"],pmNames:["μ.μ.","PM","P"],isRTL:!1},a.timepicker.regional.es={timeOnlyTitle:"Elegir una hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milisegundos",microsecText:"Microsegundos",timezoneText:"Uso horario",currentText:"Hoy",closeText:"Cerrar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.et={timeOnlyTitle:"Vali aeg",timeText:"Aeg",hourText:"Tund",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekundis",microsecText:"Mikrosekundis",timezoneText:"Ajavöönd",currentText:"Praegu",closeText:"Valmis",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.eu={timeOnlyTitle:"Aukeratu ordua",timeText:"Ordua",hourText:"Orduak",minuteText:"Minutuak",secondText:"Segundoak",millisecText:"Milisegundoak",microsecText:"Mikrosegundoak",timezoneText:"Ordu-eremua",currentText:"Orain",closeText:"Itxi",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.fa={timeOnlyTitle:"انتخاب زمان",timeText:"زمان",hourText:"ساعت",minuteText:"دقیقه",secondText:"ثانیه",millisecText:"میلی ثانیه",microsecText:"میکرو ثانیه",timezoneText:"منطقه زمانی",currentText:"الان",closeText:"انتخاب",timeFormat:"HH:mm",timeSuffix:"",amNames:["قبل ظهر","AM","A"],pmNames:["بعد ظهر","PM","P"],isRTL:!0},a.timepicker.regional.fi={timeOnlyTitle:"Valitse aika",timeText:"Aika",hourText:"Tunti",minuteText:"Minuutti",secondText:"Sekunti",millisecText:"Millisekunnin",microsecText:"Mikrosekuntia",timezoneText:"Aikavyöhyke",currentText:"Nyt",closeText:"Sulje",timeFormat:"HH:mm",timeSuffix:"",amNames:["ap.","AM","A"],pmNames:["ip.","PM","P"],isRTL:!1},a.timepicker.regional.fr={timeOnlyTitle:"Choisir une heure",timeText:"Heure",hourText:"Heures",minuteText:"Minutes",secondText:"Secondes",millisecText:"Millisecondes",microsecText:"Microsecondes",timezoneText:"Fuseau horaire",currentText:"Maintenant",closeText:"Terminé",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.gl={timeOnlyTitle:"Elixir unha hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milisegundos",microsecText:"Microssegundos",timezoneText:"Fuso horario",currentText:"Agora",closeText:"Pechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.he={timeOnlyTitle:"בחירת זמן",timeText:"שעה",hourText:"שעות",minuteText:"דקות",secondText:"שניות",millisecText:"אלפית השנייה",microsecText:"מיקרו",timezoneText:"אזור זמן",currentText:"עכשיו",closeText:"סגור",timeFormat:"HH:mm",timeSuffix:"",amNames:['לפנה"צ',"AM","A"],pmNames:['אחה"צ',"PM","P"],isRTL:!0},a.timepicker.regional.hr={timeOnlyTitle:"Odaberi vrijeme",timeText:"Vrijeme",hourText:"Sati",minuteText:"Minute",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Vremenska zona",currentText:"Sada",closeText:"Gotovo",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.hu={timeOnlyTitle:"Válasszon időpontot",timeText:"Idő",hourText:"Óra",minuteText:"Perc",secondText:"Másodperc",millisecText:"Milliszekundumos",microsecText:"Ezredmásodperc",timezoneText:"Időzóna",currentText:"Most",closeText:"Kész",timeFormat:"HH:mm",timeSuffix:"",amNames:["de.","AM","A"],pmNames:["du.","PM","P"],isRTL:!1},a.timepicker.regional.id={timeOnlyTitle:"Pilih Waktu",timeText:"Waktu",hourText:"Pukul",minuteText:"Menit",secondText:"Detik",millisecText:"Milidetik",microsecText:"Mikrodetik",timezoneText:"Zona Waktu",currentText:"Sekarang",closeText:"OK",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.it={timeOnlyTitle:"Scegli orario",timeText:"Orario",hourText:"Ora",minuteText:"Minuti",secondText:"Secondi",millisecText:"Millisecondi",microsecText:"Microsecondi",timezoneText:"Fuso orario",currentText:"Adesso",closeText:"Chiudi",timeFormat:"HH:mm",timeSuffix:"",amNames:["m.","AM","A"],pmNames:["p.","PM","P"],isRTL:!1},a.timepicker.regional.ja={timeOnlyTitle:"時間を選択",timeText:"時間",hourText:"時",minuteText:"分",secondText:"秒",millisecText:"ミリ秒",microsecText:"マイクロ秒",timezoneText:"タイムゾーン",currentText:"現時刻",closeText:"閉じる",timeFormat:"HH:mm",timeSuffix:"",amNames:["午前","AM","A"],pmNames:["午後","PM","P"],isRTL:!1},a.timepicker.regional.ko={timeOnlyTitle:"시간 선택",timeText:"시간",hourText:"시",minuteText:"분",secondText:"초",millisecText:"밀리초",microsecText:"마이크로",timezoneText:"표준 시간대",currentText:"현재 시각",closeText:"닫기",timeFormat:"tt h:mm",timeSuffix:"",amNames:["오전","AM","A"],pmNames:["오후","PM","P"],isRTL:!1},a.timepicker.regional.lt={timeOnlyTitle:"Pasirinkite laiką",timeText:"Laikas",hourText:"Valandos",minuteText:"Minutės",secondText:"Sekundės",millisecText:"Milisekundės",microsecText:"Mikrosekundės",timezoneText:"Laiko zona",currentText:"Dabar",closeText:"Uždaryti",timeFormat:"HH:mm",timeSuffix:"",amNames:["priešpiet","AM","A"],pmNames:["popiet","PM","P"],isRTL:!1},a.timepicker.regional.lv={timeOnlyTitle:"Ievadiet laiku",timeText:"Laiks",hourText:"Stundas",minuteText:"Minūtes",secondText:"Sekundes",millisecText:"Milisekundes",microsecText:"Mikrosekundes",timezoneText:"Laika josla",currentText:"Tagad",closeText:"Aizvērt",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","AM","A"],pmNames:["PM","PM","P"],isRTL:!1},a.timepicker.regional.mk={timeOnlyTitle:"Одберете време",timeText:"Време",hourText:"Час",minuteText:"Минути",secondText:"Секунди",millisecText:"Милисекунди",microsecText:"Микросекунди",timezoneText:"Временска зона",currentText:"Сега",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.nl={timeOnlyTitle:"Tijdstip",timeText:"Tijd",hourText:"Uur",minuteText:"Minuut",secondText:"Seconde",millisecText:"Milliseconde",microsecText:"Microseconde",timezoneText:"Tijdzone",currentText:"Vandaag",closeText:"Sluiten",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.no={timeOnlyTitle:"Velg tid",timeText:"Tid",hourText:"Time",minuteText:"Minutt",secondText:"Sekund",millisecText:"Millisekund",microsecText:"mikrosekund",timezoneText:"Tidssone",currentText:"Nå",closeText:"Lukk",timeFormat:"HH:mm",timeSuffix:"",amNames:["am","AM","A"],pmNames:["pm","PM","P"],isRTL:!1},a.timepicker.regional.pl={timeOnlyTitle:"Wybierz godzinę",timeText:"Czas",hourText:"Godzina",minuteText:"Minuta",secondText:"Sekunda",millisecText:"Milisekunda",microsecText:"Mikrosekunda",timezoneText:"Strefa czasowa",currentText:"Teraz",closeText:"Gotowe",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["pt-BR"]={timeOnlyTitle:"Escolha o horário",timeText:"Horário",hourText:"Hora",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milissegundos",microsecText:"Microssegundos",timezoneText:"Fuso horário",currentText:"Agora",closeText:"Fechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.pt={timeOnlyTitle:"Escolha uma hora",timeText:"Hora",hourText:"Horas",minuteText:"Minutos",secondText:"Segundos",millisecText:"Milissegundos",microsecText:"Microssegundos",timezoneText:"Fuso horário",currentText:"Agora",closeText:"Fechar",timeFormat:"HH:mm",timeSuffix:"",amNames:["a.m.","AM","A"],pmNames:["p.m.","PM","P"],isRTL:!1},a.timepicker.regional.ro={timeOnlyTitle:"Alegeţi o oră",timeText:"Timp",hourText:"Ore",minuteText:"Minute",secondText:"Secunde",millisecText:"Milisecunde",microsecText:"Microsecunde",timezoneText:"Fus orar",currentText:"Acum",closeText:"Închide",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.ru={timeOnlyTitle:"Выберите время",timeText:"Время",hourText:"Часы",minuteText:"Минуты",secondText:"Секунды",millisecText:"Миллисекунды",microsecText:"Микросекунды",timezoneText:"Часовой пояс",currentText:"Сейчас",closeText:"Закрыть",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.sk={timeOnlyTitle:"Zvoľte čas",timeText:"Čas",hourText:"Hodiny",minuteText:"Minúty",secondText:"Sekundy",millisecText:"Milisekundy",microsecText:"Mikrosekundy",timezoneText:"Časové pásmo",currentText:"Teraz",closeText:"Zavrieť",timeFormat:"H:m",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["pop.","PM","P"],isRTL:!1},a.timepicker.regional.sl={timeOnlyTitle:"Izberite čas",timeText:"Čas",hourText:"Ura",minuteText:"Minute",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Časovni pas",currentText:"Sedaj",closeText:"Zapri",timeFormat:"HH:mm",timeSuffix:"",amNames:["dop.","AM","A"],pmNames:["pop.","PM","P"],isRTL:!1},a.timepicker.regional.sq={timeOnlyTitle:"Zgjidh orarin",timeText:"Orari",hourText:"Ora",minuteText:"Minuta",secondText:"Sekonda",millisecText:"Minisekonda",microsecText:"Mikrosekonda",timezoneText:"Zona kohore",currentText:"Tani",closeText:"Mbyll",timeFormat:"HH:mm",timeSuffix:"",amNames:["m.","AM","A"],pmNames:["p.","PM","P"],isRTL:!1},a.timepicker.regional["sr-RS"]={timeOnlyTitle:"Одаберите време",timeText:"Време",hourText:"Сати",minuteText:"Минути",secondText:"Секунде",millisecText:"Милисекунде",microsecText:"Микросекунде",timezoneText:"Временска зона",currentText:"Сада",closeText:"Затвори",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["sr-YU"]={timeOnlyTitle:"Odaberite vreme",timeText:"Vreme",hourText:"Sati",minuteText:"Minuti",secondText:"Sekunde",millisecText:"Milisekunde",microsecText:"Mikrosekunde",timezoneText:"Vremenska zona",currentText:"Sada",closeText:"Zatvori",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.sv={timeOnlyTitle:"Välj en tid",timeText:"Tid",hourText:"Timme",minuteText:"Minut",secondText:"Sekund",millisecText:"Millisekund",microsecText:"Mikrosekund",timezoneText:"Tidszon",currentText:"Nu",closeText:"Stäng",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.th={timeOnlyTitle:"เลือกเวลา",timeText:"เวลา ",hourText:"ชั่วโมง ",minuteText:"นาที",secondText:"วินาที",millisecText:"มิลลิวินาที",microsecText:"ไมโคริวินาที",timezoneText:"เขตเวลา",currentText:"เวลาปัจจุบัน",closeText:"ปิด",timeFormat:"hh:mm tt",timeSuffix:""},a.timepicker.regional.tr={timeOnlyTitle:"Zaman Seçiniz",timeText:"Zaman",hourText:"Saat",minuteText:"Dakika",secondText:"Saniye",millisecText:"Milisaniye",microsecText:"Mikrosaniye",timezoneText:"Zaman Dilimi",currentText:"Şu an",closeText:"Tamam",timeFormat:"HH:mm",timeSuffix:"",amNames:["ÖÖ","Ö"],pmNames:["ÖS","S"],isRTL:!1},a.timepicker.regional.uk={timeOnlyTitle:"Виберіть час",timeText:"Час",hourText:"Години",minuteText:"Хвилини",secondText:"Секунди",millisecText:"Мілісекунди",microsecText:"Мікросекунди",timezoneText:"Часовий пояс",currentText:"Зараз",closeText:"Закрити",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional.vi={timeOnlyTitle:"Chọn giờ",timeText:"Thời gian",hourText:"Giờ",minuteText:"Phút",secondText:"Giây",millisecText:"Mili giây",microsecText:"Micrô giây",timezoneText:"Múi giờ",currentText:"Hiện thời",closeText:"Đóng",timeFormat:"HH:mm",timeSuffix:"",amNames:["SA","S"],pmNames:["CH","C"],isRTL:!1},a.timepicker.regional["zh-CN"]={timeOnlyTitle:"选择时间",timeText:"时间",hourText:"小时",minuteText:"分钟",secondText:"秒钟",millisecText:"毫秒",microsecText:"微秒",timezoneText:"时区",currentText:"现在时间",closeText:"关闭",timeFormat:"HH:mm",timeSuffix:"",amNames:["AM","A"],pmNames:["PM","P"],isRTL:!1},a.timepicker.regional["zh-TW"]={timeOnlyTitle:"選擇時分秒",timeText:"時間",hourText:"時",minuteText:"分",secondText:"秒",millisecText:"毫秒",microsecText:"微秒",timezoneText:"時區",currentText:"現在時間",closeText:"確定",timeFormat:"HH:mm",timeSuffix:"",amNames:["上午","AM","A"],pmNames:["下午","PM","P"],isRTL:!1}}(jQuery);
inc/meta-box/js/jqueryui/jquery-ui-timepicker-addon.js DELETED
@@ -1,71 +0,0 @@
1
- /*
2
- * jQuery timepicker addon
3
- * By: Trent Richardson [http://trentrichardson.com]
4
- * Version 0.9.7
5
- * Last Modified: 10/02/2011
6
- *
7
- * Copyright 2011 Trent Richardson
8
- * Dual licensed under the MIT and GPL licenses.
9
- * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
10
- * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
11
- *
12
- * HERES THE CSS:
13
- * .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
14
- * .ui-timepicker-div dl { text-align: left; }
15
- * .ui-timepicker-div dl dt { height: 25px; }
16
- * .ui-timepicker-div dl dd { margin: -25px 10px 10px 65px; }
17
- * .ui-timepicker-div td { font-size: 90%; }
18
- * .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
19
- */
20
-
21
- (function(e){function m(){this.regional=[];this.regional[""]={currentText:"Now",closeText:"Done",ampm:false,amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"hh:mm tt",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",timezoneText:"Time Zone"};this._defaults={showButtonPanel:true,timeOnly:false,showHour:true,showMinute:true,showSecond:false,showMillisec:false,showTimezone:false,showTime:true,stepHour:0.05,stepMinute:0.05,
22
- stepSecond:0.05,stepMillisec:0.5,hour:0,minute:0,second:0,millisec:0,timezone:"+0000",hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,minDateTime:null,maxDateTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,alwaysSetTime:true,separator:" ",altFieldTimeOnly:true,showTimepicker:true,timezoneIso8609:false,timezoneList:null};e.extend(this._defaults,this.regional[""])}e.extend(e.ui,{timepicker:{version:"0.9.7"}});e.extend(m.prototype,
23
- {$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,timezone_select:null,hour:0,minute:0,second:0,millisec:0,timezone:"+0000",hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,setDefaults:function(c){var a=this._defaults,
24
- c=c||{};e.extend(a,c);for(var b in c)if(c[b]===null||c[b]===void 0)a[b]=c[b];return this},_newInst:function(c,a){var b=new m,d={},f;for(f in this._defaults){var g=c.attr("time:"+f);if(g)try{d[f]=eval(g)}catch(j){d[f]=g}}b._defaults=e.extend({},this._defaults,d,a,{beforeShow:function(c,d){e.isFunction(a.beforeShow)&&a.beforeShow(c,d,b)},onChangeMonthYear:function(d,f,g){b._updateDateTime(g);e.isFunction(a.onChangeMonthYear)&&a.onChangeMonthYear.call(c[0],d,f,g,b)},onClose:function(d,f){b.timeDefined===
25
- true&&c.val()!=""&&b._updateDateTime(f);e.isFunction(a.onClose)&&a.onClose.call(c[0],d,f,b)},timepicker:b});b.amNames=e.map(b._defaults.amNames,function(a){return a.toUpperCase()});b.pmNames=e.map(b._defaults.pmNames,function(a){return a.toUpperCase()});if(b._defaults.timezoneList===null){d=[];for(f=-11;f<=12;f++)d.push((f>=0?"+":"-")+("0"+Math.abs(f).toString()).slice(-2)+"00");b._defaults.timezoneIso8609&&(d=e.map(d,function(a){return a=="+0000"?"Z":a.substring(0,3)+":"+a.substring(3)}));b._defaults.timezoneList=
26
- d}b.hour=b._defaults.hour;b.minute=b._defaults.minute;b.second=b._defaults.second;b.millisec=b._defaults.millisec;b.ampm="";b.$input=c;if(a.altField)b.$altInput=e(a.altField).css({cursor:"pointer"}).focus(function(){c.trigger("focus")});if(b._defaults.minDate==0||b._defaults.minDateTime==0)b._defaults.minDate=new Date;if(b._defaults.maxDate==0||b._defaults.maxDateTime==0)b._defaults.maxDate=new Date;if(b._defaults.minDate!==void 0&&b._defaults.minDate instanceof Date)b._defaults.minDateTime=new Date(b._defaults.minDate.getTime());
27
- if(b._defaults.minDateTime!==void 0&&b._defaults.minDateTime instanceof Date)b._defaults.minDate=new Date(b._defaults.minDateTime.getTime());if(b._defaults.maxDate!==void 0&&b._defaults.maxDate instanceof Date)b._defaults.maxDateTime=new Date(b._defaults.maxDate.getTime());if(b._defaults.maxDateTime!==void 0&&b._defaults.maxDateTime instanceof Date)b._defaults.maxDate=new Date(b._defaults.maxDateTime.getTime());return b},_addTimePicker:function(c){this.timeDefined=this._parseTime(this.$altInput&&
28
- this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this._limitMinMaxDateTime(c,false);this._injectTimePicker()},_parseTime:function(c,a){var b=this._defaults.timeFormat.toString().replace(/h{1,2}/ig,"(\\d?\\d)").replace(/m{1,2}/ig,"(\\d?\\d)").replace(/s{1,2}/ig,"(\\d?\\d)").replace(/l{1}/ig,"(\\d?\\d?\\d)").replace(/t{1,2}/ig,this._getPatternAmpm()).replace(/z{1}/ig,"(z|[-+]\\d\\d:?\\d\\d)?").replace(/\s/g,"\\s?")+this._defaults.timeSuffix+"$",d=this._getFormatPositions(),
29
- f="";if(!this.inst)this.inst=e.datepicker._getInst(this.$input[0]);if(a||!this._defaults.timeOnly)b=".{"+e.datepicker._get(this.inst,"dateFormat").length+",}"+this._defaults.separator.replace(RegExp("[.*+?|()\\[\\]{}\\\\]","g"),"\\$&")+b;if(b=c.match(RegExp(b,"i"))){if(d.t!==-1)b[d.t]===void 0||b[d.t].length===0?this.ampm=f="":(f=e.inArray(b[d.t].toUpperCase(),this.amNames)!==-1?"AM":"PM",this.ampm=this._defaults[f=="AM"?"amNames":"pmNames"][0]);if(d.h!==-1)this.hour=f=="AM"&&b[d.h]=="12"?0:f=="PM"&&
30
- b[d.h]!="12"?(parseFloat(b[d.h])+12).toFixed(0):Number(b[d.h]);if(d.m!==-1)this.minute=Number(b[d.m]);if(d.s!==-1)this.second=Number(b[d.s]);if(d.l!==-1)this.millisec=Number(b[d.l]);if(d.z!==-1&&b[d.z]!==void 0){d=b[d.z].toUpperCase();switch(d.length){case 1:d=this._defaults.timezoneIso8609?"Z":"+0000";break;case 5:this._defaults.timezoneIso8609&&(d=d.substring(1)=="0000"?"Z":d.substring(0,3)+":"+d.substring(3));break;case 6:this._defaults.timezoneIso8609?d.substring(1)=="00:00"&&(d="Z"):d=d=="Z"||
31
- d.substring(1)=="00:00"?"+0000":d.replace(/:/,"")}this.timezone=d}return true}return false},_getPatternAmpm:function(){var c=[];o=this._defaults;o.amNames&&e.merge(c,o.amNames);o.pmNames&&e.merge(c,o.pmNames);c=e.map(c,function(a){return a.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")});return"("+c.join("|")+")?"},_getFormatPositions:function(){var c=this._defaults.timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z)/g),a={h:-1,m:-1,s:-1,l:-1,t:-1,z:-1};if(c)for(var b=0;b<c.length;b++)a[c[b].toString().charAt(0)]==
32
- -1&&(a[c[b].toString().charAt(0)]=b+1);return a},_injectTimePicker:function(){var c=this.inst.dpDiv,a=this._defaults,b=this,d=(a.hourMax-(a.hourMax-a.hourMin)%a.stepHour).toFixed(0),f=(a.minuteMax-(a.minuteMax-a.minuteMin)%a.stepMinute).toFixed(0),g=(a.secondMax-(a.secondMax-a.secondMin)%a.stepSecond).toFixed(0),j=(a.millisecMax-(a.millisecMax-a.millisecMin)%a.stepMillisec).toFixed(0),h=this.inst.id.toString().replace(/([^A-Za-z0-9_])/g,"");if(c.find("div#ui-timepicker-div-"+h).length===0&&a.showTimepicker){var i=
33
- '<div class="ui-timepicker-div" id="ui-timepicker-div-'+h+'"><dl><dt class="ui_tpicker_time_label" id="ui_tpicker_time_label_'+h+'"'+(a.showTime?"":' style="display:none;"')+">"+a.timeText+'</dt><dd class="ui_tpicker_time" id="ui_tpicker_time_'+h+'"'+(a.showTime?"":' style="display:none;"')+'></dd><dt class="ui_tpicker_hour_label" id="ui_tpicker_hour_label_'+h+'"'+(a.showHour?"":' style="display:none;"')+">"+a.hourText+"</dt>",q=0,r=0,m=0,s=0,l;if(a.showHour&&a.hourGrid>0){i+='<dd class="ui_tpicker_hour"><div id="ui_tpicker_hour_'+
34
- h+'"'+(a.showHour?"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';for(var k=a.hourMin;k<=d;k+=parseInt(a.hourGrid,10)){q++;var n=a.ampm&&k>12?k-12:k;n<10&&(n="0"+n);a.ampm&&(k==0?n="12a":n+=k<12?"a":"p");i+="<td>"+n+"</td>"}i+="</tr></table></div></dd>"}else i+='<dd class="ui_tpicker_hour" id="ui_tpicker_hour_'+h+'"'+(a.showHour?"":' style="display:none;"')+"></dd>";i+='<dt class="ui_tpicker_minute_label" id="ui_tpicker_minute_label_'+
35
- h+'"'+(a.showMinute?"":' style="display:none;"')+">"+a.minuteText+"</dt>";if(a.showMinute&&a.minuteGrid>0){i+='<dd class="ui_tpicker_minute ui_tpicker_minute_'+a.minuteGrid+'"><div id="ui_tpicker_minute_'+h+'"'+(a.showMinute?"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';for(k=a.minuteMin;k<=f;k+=parseInt(a.minuteGrid,10))r++,i+="<td>"+(k<10?"0":"")+k+"</td>";i+="</tr></table></div></dd>"}else i+='<dd class="ui_tpicker_minute" id="ui_tpicker_minute_'+
36
- h+'"'+(a.showMinute?"":' style="display:none;"')+"></dd>";i+='<dt class="ui_tpicker_second_label" id="ui_tpicker_second_label_'+h+'"'+(a.showSecond?"":' style="display:none;"')+">"+a.secondText+"</dt>";if(a.showSecond&&a.secondGrid>0){i+='<dd class="ui_tpicker_second ui_tpicker_second_'+a.secondGrid+'"><div id="ui_tpicker_second_'+h+'"'+(a.showSecond?"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table><tr>';for(var p=a.secondMin;p<=g;p+=parseInt(a.secondGrid,10))m++,i+="<td>"+
37
- (p<10?"0":"")+p+"</td>";i+="</tr></table></div></dd>"}else i+='<dd class="ui_tpicker_second" id="ui_tpicker_second_'+h+'"'+(a.showSecond?"":' style="display:none;"')+"></dd>";i+='<dt class="ui_tpicker_millisec_label" id="ui_tpicker_millisec_label_'+h+'"'+(a.showMillisec?"":' style="display:none;"')+">"+a.millisecText+"</dt>";if(a.showMillisec&&a.millisecGrid>0){i+='<dd class="ui_tpicker_millisec ui_tpicker_millisec_'+a.millisecGrid+'"><div id="ui_tpicker_millisec_'+h+'"'+(a.showMillisec?"":' style="display:none;"')+
38
- '></div><div style="padding-left: 1px"><table><tr>';for(k=a.millisecMin;k<=j;k+=parseInt(a.millisecGrid,10))s++,i+="<td>"+(k<10?"0":"")+p+"</td>";i+="</tr></table></div></dd>"}else i+='<dd class="ui_tpicker_millisec" id="ui_tpicker_millisec_'+h+'"'+(a.showMillisec?"":' style="display:none;"')+"></dd>";i+='<dt class="ui_tpicker_timezone_label" id="ui_tpicker_timezone_label_'+h+'"'+(a.showTimezone?"":' style="display:none;"')+">"+a.timezoneText+"</dt>";i+='<dd class="ui_tpicker_timezone" id="ui_tpicker_timezone_'+
39
- h+'"'+(a.showTimezone?"":' style="display:none;"')+"></dd>";i+="</dl></div>";$tp=e(i);a.timeOnly===true&&($tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+a.timeOnlyTitle+"</div></div>"),c.find(".ui-datepicker-header, .ui-datepicker-calendar").hide());this.hour_slider=$tp.find("#ui_tpicker_hour_"+h).slider({orientation:"horizontal",value:this.hour,min:a.hourMin,max:d,step:a.stepHour,slide:function(a,c){b.hour_slider.slider("option","value",
40
- c.value);b._onTimeChange()}});this.minute_slider=$tp.find("#ui_tpicker_minute_"+h).slider({orientation:"horizontal",value:this.minute,min:a.minuteMin,max:f,step:a.stepMinute,slide:function(a,c){b.minute_slider.slider("option","value",c.value);b._onTimeChange()}});this.second_slider=$tp.find("#ui_tpicker_second_"+h).slider({orientation:"horizontal",value:this.second,min:a.secondMin,max:g,step:a.stepSecond,slide:function(a,c){b.second_slider.slider("option","value",c.value);b._onTimeChange()}});this.millisec_slider=
41
- $tp.find("#ui_tpicker_millisec_"+h).slider({orientation:"horizontal",value:this.millisec,min:a.millisecMin,max:j,step:a.stepMillisec,slide:function(a,c){b.millisec_slider.slider("option","value",c.value);b._onTimeChange()}});this.timezone_select=$tp.find("#ui_tpicker_timezone_"+h).append("<select></select>").find("select");e.fn.append.apply(this.timezone_select,e.map(a.timezoneList,function(a){return e("<option />").val(typeof a=="object"?a.value:a).text(typeof a=="object"?a.label:a)}));this.timezone_select.val(typeof this.timezone!=
42
- "undefined"&&this.timezone!=null&&this.timezone!=""?this.timezone:a.timezone);this.timezone_select.change(function(){b._onTimeChange()});a.showHour&&a.hourGrid>0&&(l=100*q*a.hourGrid/(d-a.hourMin),$tp.find(".ui_tpicker_hour table").css({width:l+"%",marginLeft:l/(-2*q)+"%",borderCollapse:"collapse"}).find("td").each(function(){e(this).click(function(){var c=e(this).html();if(a.ampm)var d=c.substring(2).toLowerCase(),c=parseInt(c.substring(0,2),10),c=d=="a"?c==12?0:c:c==12?12:c+12;b.hour_slider.slider("option",
43
- "value",c);b._onTimeChange();b._onSelectHandler()}).css({cursor:"pointer",width:100/q+"%",textAlign:"center",overflow:"hidden"})}));a.showMinute&&a.minuteGrid>0&&(l=100*r*a.minuteGrid/(f-a.minuteMin),$tp.find(".ui_tpicker_minute table").css({width:l+"%",marginLeft:l/(-2*r)+"%",borderCollapse:"collapse"}).find("td").each(function(){e(this).click(function(){b.minute_slider.slider("option","value",e(this).html());b._onTimeChange();b._onSelectHandler()}).css({cursor:"pointer",width:100/r+"%",textAlign:"center",
44
- overflow:"hidden"})}));a.showSecond&&a.secondGrid>0&&$tp.find(".ui_tpicker_second table").css({width:l+"%",marginLeft:l/(-2*m)+"%",borderCollapse:"collapse"}).find("td").each(function(){e(this).click(function(){b.second_slider.slider("option","value",e(this).html());b._onTimeChange();b._onSelectHandler()}).css({cursor:"pointer",width:100/m+"%",textAlign:"center",overflow:"hidden"})});a.showMillisec&&a.millisecGrid>0&&$tp.find(".ui_tpicker_millisec table").css({width:l+"%",marginLeft:l/(-2*s)+"%",
45
- borderCollapse:"collapse"}).find("td").each(function(){e(this).click(function(){b.millisec_slider.slider("option","value",e(this).html());b._onTimeChange();b._onSelectHandler()}).css({cursor:"pointer",width:100/s+"%",textAlign:"center",overflow:"hidden"})});d=c.find(".ui-datepicker-buttonpane");d.length?d.before($tp):c.append($tp);this.$timeObj=$tp.find("#ui_tpicker_time_"+h);if(this.inst!==null)c=this.timeDefined,this._onTimeChange(),this.timeDefined=c;c=function(){b._onSelectHandler()};this.hour_slider.bind("slidestop",
46
- c);this.minute_slider.bind("slidestop",c);this.second_slider.bind("slidestop",c);this.millisec_slider.bind("slidestop",c)}},_limitMinMaxDateTime:function(c,a){var b=this._defaults,d=new Date(c.selectedYear,c.selectedMonth,c.selectedDay);if(this._defaults.showTimepicker){if(e.datepicker._get(c,"minDateTime")!==null&&e.datepicker._get(c,"minDateTime")!==void 0&&d){var f=e.datepicker._get(c,"minDateTime"),g=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0);if(this.hourMinOriginal===null||this.minuteMinOriginal===
47
- null||this.secondMinOriginal===null||this.millisecMinOriginal===null)this.hourMinOriginal=b.hourMin,this.minuteMinOriginal=b.minuteMin,this.secondMinOriginal=b.secondMin,this.millisecMinOriginal=b.millisecMin;if(c.settings.timeOnly||g.getTime()==d.getTime())if(this._defaults.hourMin=f.getHours(),this.hour<=this._defaults.hourMin)if(this.hour=this._defaults.hourMin,this._defaults.minuteMin=f.getMinutes(),this.minute<=this._defaults.minuteMin)this.minute=this._defaults.minuteMin,this._defaults.secondMin=
48
- f.getSeconds();else if(this.second<=this._defaults.secondMin)this.second=this._defaults.secondMin,this._defaults.millisecMin=f.getMilliseconds();else{if(this.millisec<this._defaults.millisecMin)this.millisec=this._defaults.millisecMin;this._defaults.millisecMin=this.millisecMinOriginal}else this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal;else this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=
49
- this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal}if(e.datepicker._get(c,"maxDateTime")!==null&&e.datepicker._get(c,"maxDateTime")!==void 0&&d){f=e.datepicker._get(c,"maxDateTime");g=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0);if(this.hourMaxOriginal===null||this.minuteMaxOriginal===null||this.secondMaxOriginal===null)this.hourMaxOriginal=b.hourMax,this.minuteMaxOriginal=b.minuteMax,this.secondMaxOriginal=b.secondMax,
50
- this.millisecMaxOriginal=b.millisecMax;if(c.settings.timeOnly||g.getTime()==d.getTime())if(this._defaults.hourMax=f.getHours(),this.hour>=this._defaults.hourMax)if(this.hour=this._defaults.hourMax,this._defaults.minuteMax=f.getMinutes(),this.minute>=this._defaults.minuteMax)this.minute=this._defaults.minuteMax,this._defaults.secondMax=f.getSeconds();else if(this.second>=this._defaults.secondMax)this.second=this._defaults.secondMax,this._defaults.millisecMax=f.getMilliseconds();else{if(this.millisec>
51
- this._defaults.millisecMax)this.millisec=this._defaults.millisecMax;this._defaults.millisecMax=this.millisecMaxOriginal}else this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal;else this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal}a!==void 0&&a===true&&(b=(this._defaults.hourMax-
52
- (this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour).toFixed(0),d=(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute).toFixed(0),f=(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond).toFixed(0),g=(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec).toFixed(0),this.hour_slider&&this.hour_slider.slider("option",{min:this._defaults.hourMin,
53
- max:b}).slider("value",this.hour),this.minute_slider&&this.minute_slider.slider("option",{min:this._defaults.minuteMin,max:d}).slider("value",this.minute),this.second_slider&&this.second_slider.slider("option",{min:this._defaults.secondMin,max:f}).slider("value",this.second),this.millisec_slider&&this.millisec_slider.slider("option",{min:this._defaults.millisecMin,max:g}).slider("value",this.millisec))}},_onTimeChange:function(){var c=this.hour_slider?this.hour_slider.slider("value"):false,a=this.minute_slider?
54
- this.minute_slider.slider("value"):false,b=this.second_slider?this.second_slider.slider("value"):false,d=this.millisec_slider?this.millisec_slider.slider("value"):false,f=this.timezone_select?this.timezone_select.val():false,g=this._defaults;typeof c=="object"&&(c=false);typeof a=="object"&&(a=false);typeof b=="object"&&(b=false);typeof d=="object"&&(d=false);typeof f=="object"&&(f=false);c!==false&&(c=parseInt(c,10));a!==false&&(a=parseInt(a,10));b!==false&&(b=parseInt(b,10));d!==false&&(d=parseInt(d,
55
- 10));var j=g[c<12?"amNames":"pmNames"][0],h=c!=this.hour||a!=this.minute||b!=this.second||d!=this.millisec||this.ampm.length>0&&c<12!=(e.inArray(this.ampm.toUpperCase(),this.amNames)!==-1)||f!=this.timezone;if(h){if(c!==false)this.hour=c;if(a!==false)this.minute=a;if(b!==false)this.second=b;if(d!==false)this.millisec=d;if(f!==false)this.timezone=f;if(!this.inst)this.inst=e.datepicker._getInst(this.$input[0]);this._limitMinMaxDateTime(this.inst,true)}if(g.ampm)this.ampm=j;this._formatTime();this.$timeObj&&
56
- this.$timeObj.text(this.formattedTime+g.timeSuffix);this.timeDefined=true;h&&this._updateDateTime()},_onSelectHandler:function(){var c=this._defaults.onSelect,a=this.$input?this.$input[0]:null;c&&a&&c.apply(a,[this.formattedDateTime,this])},_formatTime:function(c,a,b){if(b==void 0)b=this._defaults.ampm;var c=c||{hour:this.hour,minute:this.minute,second:this.second,millisec:this.millisec,ampm:this.ampm,timezone:this.timezone},d=(a||this._defaults.timeFormat).toString(),f=parseInt(c.hour,10);b&&(!e.inArray(c.ampm.toUpperCase(),
57
- this.amNames)!==-1&&(f%=12),f===0&&(f=12));d=d.replace(/(?:hh?|mm?|ss?|[tT]{1,2}|[lz])/g,function(a){switch(a.toLowerCase()){case "hh":return("0"+f).slice(-2);case "h":return f;case "mm":return("0"+c.minute).slice(-2);case "m":return c.minute;case "ss":return("0"+c.second).slice(-2);case "s":return c.second;case "l":return("00"+c.millisec).slice(-3);case "z":return c.timezone;case "t":case "tt":if(b){var d=c.ampm;a.length==1&&(d=d.charAt(0));return a.charAt(0)=="T"?d.toUpperCase():d.toLowerCase()}return""}});
58
- if(arguments.length)return d;else this.formattedTime=d},_updateDateTime:function(c){c=this.inst||c;dt=new Date(c.selectedYear,c.selectedMonth,c.selectedDay);dateFmt=e.datepicker._get(c,"dateFormat");formatCfg=e.datepicker._getFormatConfig(c);timeAvailable=dt!==null&&this.timeDefined;var a=this.formattedDate=e.datepicker.formatDate(dateFmt,dt===null?new Date:dt,formatCfg);if(!(c.lastVal!==void 0&&c.lastVal.length>0&&this.$input.val().length===0)){if(this._defaults.timeOnly===true)a=this.formattedTime;
59
- else if(this._defaults.timeOnly!==true&&(this._defaults.alwaysSetTime||timeAvailable))a+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix;this.formattedDateTime=a;this._defaults.showTimepicker?this.$altInput&&this._defaults.altFieldTimeOnly===true?(this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate)):(this.$altInput&&this.$altInput.val(a),this.$input.val(a)):this.$input.val(this.formattedDate);this.$input.trigger("change")}}});e.fn.extend({timepicker:function(c){var c=
60
- c||{},a=arguments;typeof c=="object"&&(a[0]=e.extend(c,{timeOnly:true}));return e(this).each(function(){e.fn.datetimepicker.apply(e(this),a)})},datetimepicker:function(c){var c=c||{},a=arguments;return typeof c=="string"?c=="getDate"?e.fn.datepicker.apply(e(this[0]),a):this.each(function(){var b=e(this);b.datepicker.apply(b,a)}):this.each(function(){var a=e(this);a.datepicker(e.timepicker._newInst(a,c)._defaults)})}});e.datepicker._base_selectDate=e.datepicker._selectDate;e.datepicker._selectDate=
61
- function(c,a){var b=this._getInst(e(c)[0]),d=this._get(b,"timepicker");d?(d._limitMinMaxDateTime(b,true),b.inline=b.stay_open=true,this._base_selectDate(c,a),b.inline=b.stay_open=false,this._notifyChange(b),this._updateDatepicker(b)):this._base_selectDate(c,a)};e.datepicker._base_updateDatepicker=e.datepicker._updateDatepicker;e.datepicker._updateDatepicker=function(c){var a=c.input[0];if(!e.datepicker._curInst||!(e.datepicker._curInst!=c&&e.datepicker._datepickerShowing&&e.datepicker._lastInput!=
62
- a))if(typeof c.stay_open!=="boolean"||c.stay_open===false)this._base_updateDatepicker(c),(a=this._get(c,"timepicker"))&&a._addTimePicker(c)};e.datepicker._base_doKeyPress=e.datepicker._doKeyPress;e.datepicker._doKeyPress=function(c){var a=e.datepicker._getInst(c.target),b=e.datepicker._get(a,"timepicker");if(b&&e.datepicker._get(a,"constrainInput")){var d=b._defaults.ampm,a=e.datepicker._possibleChars(e.datepicker._get(a,"dateFormat")),b=b._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,
63
- d?"APM":"").replace(/Tt/g,d?"AaPpMm":"").replace(/tT/g,d?"AaPpMm":"").replace(/T/g,d?"AP":"").replace(/tt/g,d?"apm":"").replace(/t/g,d?"ap":"")+" "+b._defaults.separator+b._defaults.timeSuffix+(b._defaults.showTimezone?b._defaults.timezoneList.join(""):"")+b._defaults.amNames.join("")+b._defaults.pmNames.join("")+a,d=String.fromCharCode(c.charCode===void 0?c.keyCode:c.charCode);return c.ctrlKey||d<" "||!a||b.indexOf(d)>-1}return e.datepicker._base_doKeyPress(c)};e.datepicker._base_doKeyUp=e.datepicker._doKeyUp;
64
- e.datepicker._doKeyUp=function(c){var a=e.datepicker._getInst(c.target),b=e.datepicker._get(a,"timepicker");if(b&&b._defaults.timeOnly&&a.input.val()!=a.lastVal)try{e.datepicker._updateDatepicker(a)}catch(d){e.datepicker.log(d)}return e.datepicker._base_doKeyUp(c)};e.datepicker._base_gotoToday=e.datepicker._gotoToday;e.datepicker._gotoToday=function(c){var a=this._getInst(e(c)[0]),b=a.dpDiv;this._base_gotoToday(c);var c=new Date,d=this._get(a,"timepicker");if(d._defaults.showTimezone&&d.timezone_select){var f=
65
- c.getTimezoneOffset(),g=f>0?"-":"+",f=Math.abs(f),j=f%60,f=g+("0"+(f-j)/60).slice(-2)+("0"+j).slice(-2);d._defaults.timezoneIso8609&&(f=f.substring(0,3)+":"+f.substring(3));d.timezone_select.val(f)}this._setTime(a,c);e(".ui-datepicker-today",b).click()};e.datepicker._disableTimepickerDatepicker=function(c){var a=this._getInst(c),b=this._get(a,"timepicker");e(c).datepicker("getDate");if(b)b._defaults.showTimepicker=false,b._updateDateTime(a)};e.datepicker._enableTimepickerDatepicker=function(c){var a=
66
- this._getInst(c),b=this._get(a,"timepicker");e(c).datepicker("getDate");if(b)b._defaults.showTimepicker=true,b._addTimePicker(a),b._updateDateTime(a)};e.datepicker._setTime=function(c,a){var b=this._get(c,"timepicker");if(b){var d=b._defaults,e=a?a.getHours():d.hour,g=a?a.getMinutes():d.minute,j=a?a.getSeconds():d.second,h=a?a.getMilliseconds():d.millisec;if(e<d.hourMin||e>d.hourMax||g<d.minuteMin||g>d.minuteMax||j<d.secondMin||j>d.secondMax||h<d.millisecMin||h>d.millisecMax)e=d.hourMin,g=d.minuteMin,
67
- j=d.secondMin,h=d.millisecMin;b.hour=e;b.minute=g;b.second=j;b.millisec=h;b.hour_slider&&b.hour_slider.slider("value",e);b.minute_slider&&b.minute_slider.slider("value",g);b.second_slider&&b.second_slider.slider("value",j);b.millisec_slider&&b.millisec_slider.slider("value",h);b._onTimeChange();b._updateDateTime(c)}};e.datepicker._setTimeDatepicker=function(c,a,b){var c=this._getInst(c),d=this._get(c,"timepicker");d&&(this._setDateFromField(c),a&&(typeof a=="string"?(d._parseTime(a,b),a=new Date,
68
- a.setHours(d.hour,d.minute,d.second,d.millisec)):a=new Date(a.getTime()),a.toString()=="Invalid Date"&&(a=void 0),this._setTime(c,a)))};e.datepicker._base_setDateDatepicker=e.datepicker._setDateDatepicker;e.datepicker._setDateDatepicker=function(c,a){var b=this._getInst(c),d=a instanceof Date?new Date(a.getTime()):a;this._updateDatepicker(b);this._base_setDateDatepicker.apply(this,arguments);this._setTimeDatepicker(c,d,true)};e.datepicker._base_getDateDatepicker=e.datepicker._getDateDatepicker;e.datepicker._getDateDatepicker=
69
- function(c,a){var b=this._getInst(c),d=this._get(b,"timepicker");return d?(this._setDateFromField(b,a),(b=this._getDate(b))&&d._parseTime(e(c).val(),d.timeOnly)&&b.setHours(d.hour,d.minute,d.second,d.millisec),b):this._base_getDateDatepicker(c,a)};e.datepicker._base_parseDate=e.datepicker.parseDate;e.datepicker.parseDate=function(c,a,b){var d;try{d=this._base_parseDate(c,a,b)}catch(e){d=this._base_parseDate(c,a.substring(0,a.length-(e.length-e.indexOf(":")-2)),b)}return d};e.datepicker._base_formatDate=
70
- e.datepicker._formatDate;e.datepicker._formatDate=function(c,a,b,d){var e=this._get(c,"timepicker");return e?(a&&this._base_formatDate(c,a,b,d),e._updateDateTime(),e.$input.val()):this._base_formatDate(c)};e.datepicker._base_optionDatepicker=e.datepicker._optionDatepicker;e.datepicker._optionDatepicker=function(c,a,b){var d=this._get(this._getInst(c),"timepicker");if(d){var e,g,j;if(typeof a=="string")a==="minDate"||a==="minDateTime"?e=b:a==="maxDate"||a==="maxDateTime"?g=b:a==="onSelect"&&(j=b);
71
- else if(typeof a=="object")if(a.minDate)e=a.minDate;else if(a.minDateTime)e=a.minDateTime;else if(a.maxDate)g=a.maxDate;else if(a.maxDateTime)g=a.maxDateTime;if(e)e=e==0?new Date:new Date(e),d._defaults.minDate=e,d._defaults.minDateTime=e;else if(g)g=g==0?new Date:new Date(g),d._defaults.maxDate=g,d._defaults.maxDateTime=g;else if(j)d._defaults.onSelect=j}this._base_optionDatepicker(c,a,b)};e.timepicker=new m;e.timepicker.version="0.9.7"})(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/jquery-ui-timepicker-addon.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
2
+ * http://trentrichardson.com/examples/timepicker
3
+ * Copyright (c) 2016 Trent Richardson; Licensed MIT */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery","jquery-ui"],a):a(jQuery)}(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.6.3"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",oneLine:!1,defaultValue:null,parse:"strict",afterInject:null},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(a,b){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],a,b,tp_inst):void 0},onChangeMonthYear:function(a,b,c){$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],a,b,c,tp_inst)},onClose:function(a,b){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(b),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],a,b,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||this._defaults[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(a){return a.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(a){return a.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&"undefined"==typeof $.ui.slider&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(a){var b=$.trim(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(b),this._limitMinMaxDateTime(a,!1),this._injectTimePicker(),this._afterInject()},_parseTime:function(a,b){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),b||!this._defaults.timeOnly){var c=$.datepicker._get(this.inst,"dateFormat");try{var d=parseDateTimeInternal(c,this._defaults.timeFormat,a,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!d.timeObj)return!1;$.extend(this,d.timeObj)}catch(e){return $.timepicker.log("Error parsing the date/time string: "+e+"\ndate/time string = "+a+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+c),!1}return!0}var f=$.datepicker.parseTime(this._defaults.timeFormat,a,this._defaults);return f?($.extend(this,f),!0):!1},_afterInject:function(){var a=this.inst.settings;$.isFunction(a.afterInject)&&a.afterInject.call(this)},_injectTimePicker:function(){var a=this.inst.dpDiv,b=this.inst.settings,c=this,d="",e="",f=null,g={},h={},i=null,j=0,k=0;if(0===a.find("div.ui-timepicker-div").length&&b.showTimepicker){var l=" ui_tpicker_unit_hide",m='<div class="ui-timepicker-div'+(b.isRTL?" ui-timepicker-rtl":"")+(b.oneLine&&"select"===b.controlType?" ui-timepicker-oneLine":"")+'"><dl><dt class="ui_tpicker_time_label'+(b.showTime?"":l)+'">'+b.timeText+'</dt><dd class="ui_tpicker_time '+(b.showTime?"":l)+'"><input class="ui_tpicker_time_input" '+(b.timeInput?"":"disabled")+"/></dd>";for(j=0,k=this.units.length;k>j;j++){if(d=this.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],g[d]=parseInt(b[d+"Max"]-(b[d+"Max"]-b[d+"Min"])%b["step"+e],10),h[d]=0,m+='<dt class="ui_tpicker_'+d+"_label"+(f?"":l)+'">'+b[d+"Text"]+'</dt><dd class="ui_tpicker_'+d+(f?"":l)+'"><div class="ui_tpicker_'+d+"_slider"+(f?"":l)+'"></div>',f&&b[d+"Grid"]>0){if(m+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===d)for(var n=b[d+"Min"];n<=g[d];n+=parseInt(b[d+"Grid"],10)){h[d]++;var o=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:n},b);m+='<td data-for="'+d+'">'+o+"</td>"}else for(var p=b[d+"Min"];p<=g[d];p+=parseInt(b[d+"Grid"],10))h[d]++,m+='<td data-for="'+d+'">'+(10>p?"0":"")+p+"</td>";m+="</tr></table></div>"}m+="</dd>"}var q=null!==b.showTimezone?b.showTimezone:this.support.timezone;m+='<dt class="ui_tpicker_timezone_label'+(q?"":l)+'">'+b.timezoneText+"</dt>",m+='<dd class="ui_tpicker_timezone'+(q?"":l)+'"></dd>',m+="</dl></div>";var r=$(m);for(b.timeOnly===!0&&(r.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+b.timeOnlyTitle+"</div></div>"),a.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),j=0,k=c.units.length;k>j;j++)d=c.units[j],e=d.substr(0,1).toUpperCase()+d.substr(1),f=null!==b["show"+e]?b["show"+e]:this.support[d],c[d+"_slider"]=c.control.create(c,r.find(".ui_tpicker_"+d+"_slider"),d,c[d],b[d+"Min"],g[d],b["step"+e]),f&&b[d+"Grid"]>0&&(i=100*h[d]*b[d+"Grid"]/(g[d]-b[d+"Min"]),r.find(".ui_tpicker_"+d+" table").css({width:i+"%",marginLeft:b.isRTL?"0":i/(-2*h[d])+"%",marginRight:b.isRTL?i/(-2*h[d])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(a){var b=$(this),e=b.html(),f=parseInt(e.replace(/[^0-9]/g),10),g=e.replace(/[^apm]/gi),h=b.data("for");"hour"===h&&(-1!==g.indexOf("p")&&12>f?f+=12:-1!==g.indexOf("a")&&12===f&&(f=0)),c.control.value(c,c[h+"_slider"],d,f),c._onTimeChange(),c._onSelectHandler()}).css({cursor:"pointer",width:100/h[d]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=r.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(b.timezoneList,function(a,b){return $("<option />").val("object"==typeof a?a.value:a).text("object"==typeof a?a.label:a)})),"undefined"!=typeof this.timezone&&null!==this.timezone&&""!==this.timezone){var s=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();s===this.timezone?selectLocalTimezone(c):this.timezone_select.val(this.timezone)}else"undefined"!=typeof this.hour&&null!==this.hour&&""!==this.hour?this.timezone_select.val(b.timezone):selectLocalTimezone(c);this.timezone_select.change(function(){c._onTimeChange(),c._onSelectHandler(),c._afterInject()});var t=a.find(".ui-datepicker-buttonpane");if(t.length?t.before(r):a.append(r),this.$timeObj=r.find(".ui_tpicker_time_input"),this.$timeObj.change(function(){var a=c.inst.settings.timeFormat,b=$.datepicker.parseTime(a,this.value),d=new Date;b?(d.setHours(b.hour),d.setMinutes(b.minute),d.setSeconds(b.second),$.datepicker._setTime(c.inst,d)):(this.value=c.formattedTime,this.blur())}),null!==this.inst){var u=this.timeDefined;this._onTimeChange(),this.timeDefined=u}if(this._defaults.addSliderAccess){var v=this._defaults.sliderAccessArgs,w=this._defaults.isRTL;v.isRTL=w,setTimeout(function(){if(0===r.find(".ui-slider-access").length){r.find(".ui-slider:visible").sliderAccess(v);var a=r.find(".ui-slider-access:eq(0)").outerWidth(!0);a&&r.find("table:visible").each(function(){var b=$(this),c=b.outerWidth(),d=b.css(w?"marginRight":"marginLeft").toString().replace("%",""),e=c-a,f=d*e/c+"%",g={width:e,marginRight:0,marginLeft:0};g[w?"marginRight":"marginLeft"]=f,b.css(g)})}},10)}c._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(a,b){var c=this._defaults,d=new Date(a.selectedYear,a.selectedMonth,a.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(a,"minDateTime")&&void 0!==$.datepicker._get(a,"minDateTime")&&d){var e=$.datepicker._get(a,"minDateTime"),f=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0);(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal||null===this.millisecMinOriginal||null===this.microsecMinOriginal)&&(this.hourMinOriginal=c.hourMin,this.minuteMinOriginal=c.minuteMin,this.secondMinOriginal=c.secondMin,this.millisecMinOriginal=c.millisecMin,this.microsecMinOriginal=c.microsecMin),a.settings.timeOnly||f.getTime()===d.getTime()?(this._defaults.hourMin=e.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=e.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=e.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=e.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=e.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(a,"maxDateTime")&&void 0!==$.datepicker._get(a,"maxDateTime")&&d){var g=$.datepicker._get(a,"maxDateTime"),h=new Date(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0,0);(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal||null===this.millisecMaxOriginal)&&(this.hourMaxOriginal=c.hourMax,this.minuteMaxOriginal=c.minuteMax,this.secondMaxOriginal=c.secondMax,this.millisecMaxOriginal=c.millisecMax,this.microsecMaxOriginal=c.microsecMax),a.settings.timeOnly||h.getTime()===d.getTime()?(this._defaults.hourMax=g.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=g.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=g.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=g.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=g.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==a.settings.minTime){var i=new Date("01/01/1970 "+a.settings.minTime);this.hour<i.getHours()?(this.hour=this._defaults.hourMin=i.getHours(),this.minute=this._defaults.minuteMin=i.getMinutes()):this.hour===i.getHours()&&this.minute<i.getMinutes()?this.minute=this._defaults.minuteMin=i.getMinutes():this._defaults.hourMin<i.getHours()?(this._defaults.hourMin=i.getHours(),this._defaults.minuteMin=i.getMinutes()):this._defaults.hourMin===i.getHours()===this.hour&&this._defaults.minuteMin<i.getMinutes()?this._defaults.minuteMin=i.getMinutes():this._defaults.minuteMin=0}if(null!==a.settings.maxTime){var j=new Date("01/01/1970 "+a.settings.maxTime);this.hour>j.getHours()?(this.hour=this._defaults.hourMax=j.getHours(),this.minute=this._defaults.minuteMax=j.getMinutes()):this.hour===j.getHours()&&this.minute>j.getMinutes()?this.minute=this._defaults.minuteMax=j.getMinutes():this._defaults.hourMax>j.getHours()?(this._defaults.hourMax=j.getHours(),this._defaults.minuteMax=j.getMinutes()):this._defaults.hourMax===j.getHours()===this.hour&&this._defaults.minuteMax>j.getMinutes()?this._defaults.minuteMax=j.getMinutes():this._defaults.minuteMax=59}if(void 0!==b&&b===!0){var k=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),l=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),m=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),n=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),o=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:k,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:l,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:m,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:n,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:o,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var a=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,b=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,c=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,d=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,e=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,f=this.timezone_select?this.timezone_select.val():!1,g=this._defaults,h=g.pickerTimeFormat||g.timeFormat,i=g.pickerTimeSuffix||g.timeSuffix;"object"==typeof a&&(a=!1),"object"==typeof b&&(b=!1),"object"==typeof c&&(c=!1),"object"==typeof d&&(d=!1),"object"==typeof e&&(e=!1),"object"==typeof f&&(f=!1),a!==!1&&(a=parseInt(a,10)),b!==!1&&(b=parseInt(b,10)),c!==!1&&(c=parseInt(c,10)),d!==!1&&(d=parseInt(d,10)),e!==!1&&(e=parseInt(e,10)),f!==!1&&(f=f.toString());var j=g[12>a?"amNames":"pmNames"][0],k=a!==parseInt(this.hour,10)||b!==parseInt(this.minute,10)||c!==parseInt(this.second,10)||d!==parseInt(this.millisec,10)||e!==parseInt(this.microsec,10)||this.ampm.length>0&&12>a!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&f!==this.timezone.toString();if(k&&(a!==!1&&(this.hour=a),b!==!1&&(this.minute=b),c!==!1&&(this.second=c),d!==!1&&(this.millisec=d),e!==!1&&(this.microsec=e),f!==!1&&(this.timezone=f),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=j),this.formattedTime=$.datepicker.formatTime(g.timeFormat,this,g),this.$timeObj&&(this.$timeObj.val(h===g.timeFormat?this.formattedTime+i:$.datepicker.formatTime(h,this,g)+i),this.$timeObj[0].setSelectionRange)){var l=this.$timeObj[0].selectionStart,m=this.$timeObj[0].selectionEnd;this.$timeObj[0].setSelectionRange(l,m)}this.timeDefined=!0,k&&this._updateDateTime()}},_onSelectHandler:function(){var a=this._defaults.onSelect||this.inst.settings.onSelect,b=this.$input?this.$input[0]:null;a&&b&&a.apply(b,[this.formattedDateTime,this])},_updateDateTime:function(a){a=this.inst||a;var b=a.currentYear>0?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(a.selectedYear,a.selectedMonth,a.selectedDay),c=$.datepicker._daylightSavingAdjust(b),d=$.datepicker._get(a,"dateFormat"),e=$.datepicker._getFormatConfig(a),f=null!==c&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(d,null===c?new Date:c,e);var g=this.formattedDate;if(""===a.lastVal&&(a.currentYear=a.selectedYear,a.currentMonth=a.selectedMonth,a.currentDay=a.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?g=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||f)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(g+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=g,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(g);var h="",i=null!==this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,j=null!==this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(h=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===c?new Date:c,e):this.formattedDate,h&&(h+=i)),h+=null!==this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+j:this.formattedTime+j,this.$altInput.val(h)}else this.$input.val(g);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var a=$.datepicker._getInst(this.$input.get(0)),b=$.datepicker._get(a,"timepicker");if(b&&b._defaults.timeOnly&&a.input.val()!==a.lastVal)try{$.datepicker._updateDatepicker(a)}catch(c){$.timepicker.log(c)}}},_controls:{slider:{create:function(a,b,c,d,e,f,g){var h=a._defaults.isRTL;return b.prop("slide",null).slider({orientation:"horizontal",value:h?-1*d:d,min:h?-1*f:e,max:h?-1*e:f,step:g,slide:function(b,d){a.control.value(a,$(this),c,h?-1*d.value:d.value),a._onTimeChange()},stop:function(b,c){a._onSelectHandler()}})},options:function(a,b,c,d,e){if(a._defaults.isRTL){if("string"==typeof d)return"min"===d||"max"===d?void 0!==e?b.slider(d,-1*e):Math.abs(b.slider(d)):b.slider(d);var f=d.min,g=d.max;return d.min=d.max=null,void 0!==f&&(d.max=-1*f),void 0!==g&&(d.min=-1*g),b.slider(d)}return"string"==typeof d&&void 0!==e?b.slider(d,e):b.slider(d)},value:function(a,b,c,d){return a._defaults.isRTL?void 0!==d?b.slider("value",-1*d):Math.abs(b.slider("value")):void 0!==d?b.slider("value",d):b.slider("value")}},select:{create:function(a,b,c,d,e,f,g){for(var h='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+c+'" data-min="'+e+'" data-max="'+f+'" data-step="'+g+'">',i=a._defaults.pickerTimeFormat||a._defaults.timeFormat,j=e;f>=j;j+=g)h+='<option value="'+j+'"'+(j===d?" selected":"")+">",h+="hour"===c?$.datepicker.formatTime($.trim(i.replace(/[^ht ]/gi,"")),{hour:j},a._defaults):"millisec"===c||"microsec"===c||j>=10?j:"0"+j.toString(),h+="</option>";return h+="</select>",b.children("select").remove(),$(h).appendTo(b).change(function(b){a._onTimeChange(),a._onSelectHandler(),a._afterInject()}),b},options:function(a,b,c,d,e){var f={},g=b.children("select");if("string"==typeof d){if(void 0===e)return g.data(d);f[d]=e}else f=d;return a.control.create(a,b,g.data("unit"),g.val(),f.min>=0?f.min:g.data("min"),f.max||g.data("max"),f.step||g.data("step"))},value:function(a,b,c,d){var e=b.children("select");return void 0!==d?e.val(d):e.val()}}}}),$.fn.extend({timepicker:function(a){a=a||{};var b=Array.prototype.slice.call(arguments);return"object"==typeof a&&(b[0]=$.extend(a,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),b)})},datetimepicker:function(a){a=a||{};var b=arguments;return"string"==typeof a?"getDate"===a||"option"===a&&2===b.length&&"string"==typeof b[1]?$.fn.datepicker.apply($(this[0]),b):this.each(function(){var a=$(this);a.datepicker.apply(a,b)}):this.each(function(){var b=$(this);b.datepicker($.timepicker._newInst(b,a)._defaults)})}}),$.datepicker.parseDateTime=function(a,b,c,d,e){var f=parseDateTimeInternal(a,b,c,d,e);if(f.timeObj){var g=f.timeObj;f.date.setHours(g.hour,g.minute,g.second,g.millisec),f.date.setMicroseconds(g.microsec)}return f.date},$.datepicker.parseTime=function(a,b,c){var d=extendRemove(extendRemove({},$.timepicker._defaults),c||{}),e=(-1!==a.replace(/\'.*?\'/g,"").indexOf("Z"),function(a,b,c){var d,e=function(a,b){var c=[];return a&&$.merge(c,a),b&&$.merge(c,b),c=$.map(c,function(a){return a.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+c.join("|")+")?"},f=function(a){var b=a.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),c={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(b)for(var d=0;d<b.length;d++)-1===c[b[d].toString().charAt(0)]&&(c[b[d].toString().charAt(0)]=d+1);return c},g="^"+a.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){var b=a.length;switch(a.charAt(0).toLowerCase()){case"h":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"m":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"s":return 1===b?"(\\d?\\d)":"(\\d{"+b+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return e(c.amNames,c.pmNames);default:return"("+a.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(a){return"\\"+a})+")?"}}).replace(/\s/g,"\\s?")+c.timeSuffix+"$",h=f(a),i="";d=b.match(new RegExp(g,"i"));var j={hour:0,minute:0,second:0,millisec:0,microsec:0};return d?(-1!==h.t&&(void 0===d[h.t]||0===d[h.t].length?(i="",j.ampm=""):(i=-1!==$.inArray(d[h.t].toUpperCase(),$.map(c.amNames,function(a,b){return a.toUpperCase()}))?"AM":"PM",j.ampm=c["AM"===i?"amNames":"pmNames"][0])),-1!==h.h&&("AM"===i&&"12"===d[h.h]?j.hour=0:"PM"===i&&"12"!==d[h.h]?j.hour=parseInt(d[h.h],10)+12:j.hour=Number(d[h.h])),-1!==h.m&&(j.minute=Number(d[h.m])),-1!==h.s&&(j.second=Number(d[h.s])),-1!==h.l&&(j.millisec=Number(d[h.l])),-1!==h.c&&(j.microsec=Number(d[h.c])),-1!==h.z&&void 0!==d[h.z]&&(j.timezone=$.timepicker.timezoneOffsetNumber(d[h.z])),j):!1}),f=function(a,b,c){try{var d=new Date("2012-01-01 "+b);if(isNaN(d.getTime())&&(d=new Date("2012-01-01T"+b),isNaN(d.getTime())&&(d=new Date("01/01/2012 "+b),isNaN(d.getTime()))))throw"Unable to parse time with native Date: "+b;return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:-1*d.getTimezoneOffset()}}catch(f){try{return e(a,b,c)}catch(g){$.timepicker.log("Unable to parse \ntimeString: "+b+"\ntimeFormat: "+a)}}return!1};return"function"==typeof d.parse?d.parse(a,b,d):"loose"===d.parse?f(a,b,d):e(a,b,d)},$.datepicker.formatTime=function(a,b,c){c=c||{},c=$.extend({},$.timepicker._defaults,c),b=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},b);var d=a,e=c.amNames[0],f=parseInt(b.hour,10);return f>11&&(e=c.pmNames[0]),d=d.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(a){switch(a){case"HH":return("0"+f).slice(-2);case"H":return f;case"hh":return("0"+convert24to12(f)).slice(-2);case"h":return convert24to12(f);case"mm":return("0"+b.minute).slice(-2);case"m":return b.minute;case"ss":return("0"+b.second).slice(-2);case"s":return b.second;case"l":return("00"+b.millisec).slice(-3);case"c":return("00"+b.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===b.timezone?c.timezone:b.timezone,!0);case"T":return e.charAt(0).toUpperCase();case"TT":return e.toUpperCase();case"t":return e.charAt(0).toLowerCase();case"tt":return e.toLowerCase();default:return a.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(a,b){var c,d=this._getInst($(a)[0]),e=this._get(d,"timepicker");e&&d.settings.showTimepicker?(e._limitMinMaxDateTime(d,!0),c=d.inline,d.inline=d.stay_open=!0,this._base_selectDate(a,b),d.inline=c,d.stay_open=!1,this._notifyChange(d),this._updateDatepicker(d)):this._base_selectDate(a,b)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(a){var b=a.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==a&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==b||"boolean"==typeof a.stay_open&&a.stay_open!==!1)){this._base_updateDatepicker(a);var c=this._get(a,"timepicker");c&&c._addTimePicker(a)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");if(c&&$.datepicker._get(b,"constrainInput")){var d=c.support.ampm,e=null!==c._defaults.showTimezone?c._defaults.showTimezone:c.support.timezone,f=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),g=c._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,d?"APM":"").replace(/Tt/g,d?"AaPpMm":"").replace(/tT/g,d?"AaPpMm":"").replace(/T/g,d?"AP":"").replace(/tt/g,d?"apm":"").replace(/t/g,d?"ap":"")+" "+c._defaults.separator+c._defaults.timeSuffix+(e?c._defaults.timezoneList.join(""):"")+c._defaults.amNames.join("")+c._defaults.pmNames.join("")+f,h=String.fromCharCode(void 0===a.charCode?a.keyCode:a.charCode);return a.ctrlKey||" ">h||!f||g.indexOf(h)>-1}return $.datepicker._base_doKeyPress(a)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(a){var b=this._get(a,"timepicker");if(b){var c=b._defaults.altField;if(c){var d=(b._defaults.altFormat||b._defaults.dateFormat,this._getDate(a)),e=$.datepicker._getFormatConfig(a),f="",g=b._defaults.altSeparator?b._defaults.altSeparator:b._defaults.separator,h=b._defaults.altTimeSuffix?b._defaults.altTimeSuffix:b._defaults.timeSuffix,i=null!==b._defaults.altTimeFormat?b._defaults.altTimeFormat:b._defaults.timeFormat;f+=$.datepicker.formatTime(i,b,b._defaults)+h,b._defaults.timeOnly||b._defaults.altFieldTimeOnly||null===d||(f=b._defaults.altFormat?$.datepicker.formatDate(b._defaults.altFormat,d,e)+g+f:b.formattedDate+g+f),$(c).val(a.input.val()?f:"")}}else $.datepicker._base_updateAlternate(a)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(a){var b=$.datepicker._getInst(a.target),c=$.datepicker._get(b,"timepicker");
5
+ if(c&&c._defaults.timeOnly&&b.input.val()!==b.lastVal)try{$.datepicker._updateDatepicker(b)}catch(d){$.timepicker.log(d)}return $.datepicker._base_doKeyUp(a)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(a){var b=this._getInst($(a)[0]);this._base_gotoToday(a);var c=this._get(b,"timepicker");if(c){var d=$.timepicker.timezoneOffsetNumber(c.timezone),e=new Date;e.setMinutes(e.getMinutes()+e.getTimezoneOffset()+parseInt(d,10)),this._setTime(b,e),this._setDate(b,e),c._onSelectHandler()}},$.datepicker._disableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!1,c._defaults.showTimepicker=!1,c._updateDateTime(b))}},$.datepicker._enableTimepickerDatepicker=function(a){var b=this._getInst(a);if(b){var c=this._get(b,"timepicker");$(a).datepicker("getDate"),c&&(b.settings.showTimepicker=!0,c._defaults.showTimepicker=!0,c._addTimePicker(b),c._updateDateTime(b))}},$.datepicker._setTime=function(a,b){var c=this._get(a,"timepicker");if(c){var d=c._defaults;c.hour=b?b.getHours():d.hour,c.minute=b?b.getMinutes():d.minute,c.second=b?b.getSeconds():d.second,c.millisec=b?b.getMilliseconds():d.millisec,c.microsec=b?b.getMicroseconds():d.microsec,c._limitMinMaxDateTime(a,!0),c._onTimeChange(),c._updateDateTime(a)}},$.datepicker._setTimeDatepicker=function(a,b,c){var d=this._getInst(a);if(d){var e=this._get(d,"timepicker");if(e){this._setDateFromField(d);var f;b&&("string"==typeof b?(e._parseTime(b,c),f=new Date,f.setHours(e.hour,e.minute,e.second,e.millisec),f.setMicroseconds(e.microsec)):(f=new Date(b.getTime()),f.setMicroseconds(b.getMicroseconds())),"Invalid Date"===f.toString()&&(f=void 0),this._setTime(d,f))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(a,b){var c=this._getInst(a),d=b;if(c){"string"==typeof b&&(d=new Date(b),d.getTime()||(this._base_setDateDatepicker.apply(this,arguments),d=$(a).datepicker("getDate")));var e,f=this._get(c,"timepicker");d instanceof Date?(e=new Date(d.getTime()),e.setMicroseconds(d.getMicroseconds())):e=d,f&&e&&(f.support.timezone||null!==f._defaults.timezone||(f.timezone=-1*e.getTimezoneOffset()),d=$.timepicker.timezoneAdjust(d,$.timepicker.timezoneOffsetString(-d.getTimezoneOffset()),f.timezone),e=$.timepicker.timezoneAdjust(e,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset()),f.timezone)),this._updateDatepicker(c),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(a,e,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(a,b){var c=this._getInst(a);if(c){var d=this._get(c,"timepicker");if(d){void 0===c.lastVal&&this._setDateFromField(c,b);var e=this._getDate(c),f=null;return f=d.$altInput&&d._defaults.altFieldTimeOnly?d.$input.val()+" "+d.$altInput.val():"INPUT"!==d.$input.get(0).tagName&&d.$altInput?d.$altInput.val():d.$input.val(),e&&d._parseTime(f,!c.settings.timeOnly)&&(e.setHours(d.hour,d.minute,d.second,d.millisec),e.setMicroseconds(d.microsec),null!=d.timezone&&(d.support.timezone||null!==d._defaults.timezone||(d.timezone=-1*e.getTimezoneOffset()),e=$.timepicker.timezoneAdjust(e,d.timezone,$.timepicker.timezoneOffsetString(-e.getTimezoneOffset())))),e}return this._base_getDateDatepicker(a,b)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(a,b,c){var d;try{d=this._base_parseDate(a,b,c)}catch(e){if(!(e.indexOf(":")>=0))throw e;d=this._base_parseDate(a,b.substring(0,b.length-(e.length-e.indexOf(":")-2)),c),$.timepicker.log("Error parsing the date string: "+e+"\ndate string = "+b+"\ndate format = "+a)}return d},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(a,b,c,d){var e=this._get(a,"timepicker");return e?(e._updateDateTime(a),e.$input.val()):this._base_formatDate(a)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(a,b,c){var d,e=this._getInst(a);if(!e)return null;var f=this._get(e,"timepicker");if(f){var g,h,i,j,k=null,l=null,m=null,n=f._defaults.evnts,o={};if("string"==typeof b){if("minDate"===b||"minDateTime"===b)k=c;else if("maxDate"===b||"maxDateTime"===b)l=c;else if("onSelect"===b)m=c;else if(n.hasOwnProperty(b)){if("undefined"==typeof c)return n[b];o[b]=c,d={}}}else if("object"==typeof b){b.minDate?k=b.minDate:b.minDateTime?k=b.minDateTime:b.maxDate?l=b.maxDate:b.maxDateTime&&(l=b.maxDateTime);for(g in n)n.hasOwnProperty(g)&&b[g]&&(o[g]=b[g])}for(g in o)o.hasOwnProperty(g)&&(n[g]=o[g],d||(d=$.extend({},b)),delete d[g]);if(d&&isEmptyObject(d))return;if(k?(k=0===k?new Date:new Date(k),f._defaults.minDate=k,f._defaults.minDateTime=k):l?(l=0===l?new Date:new Date(l),f._defaults.maxDate=l,f._defaults.maxDateTime=l):m&&(f._defaults.onSelect=m),k||l)return j=$(a),i=j.datetimepicker("getDate"),h=this._base_optionDatepicker.call($.datepicker,a,d||b,c),j.datetimepicker("setDate",i),h}return void 0===c?this._base_optionDatepicker.call($.datepicker,a,b):this._base_optionDatepicker.call($.datepicker,a,d||b,c)};var isEmptyObject=function(a){var b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0},extendRemove=function(a,b){$.extend(a,b);for(var c in b)(null===b[c]||void 0===b[c])&&(a[c]=b[c]);return a},detectSupport=function(a){var b=a.replace(/'.*?'/g,"").toLowerCase(),c=function(a,b){return-1!==a.indexOf(b)?!0:!1};return{hour:c(b,"h"),minute:c(b,"m"),second:c(b,"s"),millisec:c(b,"l"),microsec:c(b,"c"),timezone:c(b,"z"),ampm:c(b,"t")&&c(a,"h"),iso8601:c(a,"Z")}},convert24to12=function(a){return a%=12,0===a&&(a=12),String(a)},computeEffectiveSetting=function(a,b){return a&&a[b]?a[b]:$.timepicker._defaults[b]},splitDateTime=function(a,b){var c=computeEffectiveSetting(b,"separator"),d=computeEffectiveSetting(b,"timeFormat"),e=d.split(c),f=e.length,g=a.split(c),h=g.length;return h>1?{dateString:g.splice(0,h-f).join(c),timeString:g.splice(0,f).join(c)}:{dateString:a,timeString:""}},parseDateTimeInternal=function(a,b,c,d,e){var f,g,h;if(g=splitDateTime(c,e),f=$.datepicker._base_parseDate(a,g.dateString,d),""===g.timeString)return{date:f};if(h=$.datepicker.parseTime(b,g.timeString,e),!h)throw"Wrong time format";return{date:f,timeObj:h}},selectLocalTimezone=function(a,b){if(a&&a.timezone_select){var c=b||new Date;a.timezone_select.val(-c.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(a,b){if(isNaN(a)||a>840||-720>a)return a;var c=a,d=c%60,e=(c-d)/60,f=b?":":"",g=(c>=0?"+":"-")+("0"+Math.abs(e)).slice(-2)+f+("0"+Math.abs(d)).slice(-2);return"+00:00"===g?"Z":g},$.timepicker.timezoneOffsetNumber=function(a){var b=a.toString().replace(":","");return"Z"===b.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(b)?("-"===b.substr(0,1)?-1:1)*(60*parseInt(b.substr(1,2),10)+parseInt(b.substr(3,2),10)):parseInt(a,10)},$.timepicker.timezoneAdjust=function(a,b,c){var d=$.timepicker.timezoneOffsetNumber(b),e=$.timepicker.timezoneOffsetNumber(c);return isNaN(e)||a.setMinutes(a.getMinutes()+-d- -e),a},$.timepicker.timeRange=function(a,b,c){return $.timepicker.handleRange("timepicker",a,b,c)},$.timepicker.datetimeRange=function(a,b,c){$.timepicker.handleRange("datetimepicker",a,b,c)},$.timepicker.dateRange=function(a,b,c){$.timepicker.handleRange("datepicker",a,b,c)},$.timepicker.handleRange=function(a,b,c,d){function e(e,f){var g=b[a]("getDate"),h=c[a]("getDate"),i=e[a]("getDate");if(null!==g){var j=new Date(g.getTime()),k=new Date(g.getTime());j.setMilliseconds(j.getMilliseconds()+d.minInterval),k.setMilliseconds(k.getMilliseconds()+d.maxInterval),d.minInterval>0&&j>h?c[a]("setDate",j):d.maxInterval>0&&h>k?c[a]("setDate",k):g>h&&f[a]("setDate",i)}}function f(b,c,e){if(b.val()){var f=b[a].call(b,"getDate");null!==f&&d.minInterval>0&&("minDate"===e&&f.setMilliseconds(f.getMilliseconds()+d.minInterval),"maxDate"===e&&f.setMilliseconds(f.getMilliseconds()-d.minInterval)),f.getTime&&c[a].call(c,"option",e,f)}}d=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},d);var g=!1;return"timepicker"===a&&(g=!0,a="datetimepicker"),$.fn[a].call(b,$.extend({timeOnly:g,onClose:function(a,b){e($(this),c)},onSelect:function(a){f($(this),c,"minDate")}},d,d.start)),$.fn[a].call(c,$.extend({timeOnly:g,onClose:function(a,c){e($(this),b)},onSelect:function(a){f($(this),b,"maxDate")}},d,d.end)),e(b,c),f(b,c,"minDate"),f(c,b,"maxDate"),$([b.get(0),c.get(0)])},$.timepicker.log=function(){window.console&&window.console.log&&window.console.log.apply&&window.console.log.apply(window.console,Array.prototype.slice.call(arguments))},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(a){return this.setMilliseconds(this.getMilliseconds()+Math.floor(a/1e3)),this.microseconds=a%1e3,this}),$.timepicker.version="1.6.3"}});
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-af.js DELETED
@@ -1,20 +0,0 @@
1
- /* Afrikaans translation for the jQuery Timepicker Addon */
2
- /* Written by Deon Heyns */
3
- (function($) {
4
- $.timepicker.regional['af'] = {
5
- timeOnlyTitle: 'Kies Tyd',
6
- timeText: 'Tyd ',
7
- hourText: 'Ure ',
8
- minuteText: 'Minute',
9
- secondText: 'Sekondes',
10
- millisecText: 'Millisekondes',
11
- timezoneText: 'Tydsone',
12
- currentText: 'Huidige Tyd',
13
- closeText: 'Klaar',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['af']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-bg.js DELETED
@@ -1,20 +0,0 @@
1
- /* Bulgarian translation for the jQuery Timepicker Addon */
2
- /* Written by Plamen Kovandjiev */
3
- (function($) {
4
- $.timepicker.regional['bg'] = {
5
- timeOnlyTitle: 'Изберете време',
6
- timeText: 'Време',
7
- hourText: 'Час',
8
- minuteText: 'Минути',
9
- secondText: 'Секунди',
10
- millisecText: 'Милисекунди',
11
- timezoneText: 'Часови пояс',
12
- currentText: 'Сега',
13
- closeText: 'Затвори',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['bg']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ca.js DELETED
@@ -1,20 +0,0 @@
1
- /* Catalan translation for the jQuery Timepicker Addon */
2
- /* Written by Sergi Faber */
3
- (function($) {
4
- $.timepicker.regional['ca'] = {
5
- timeOnlyTitle: 'Escollir una hora',
6
- timeText: 'Hora',
7
- hourText: 'Hores',
8
- minuteText: 'Minuts',
9
- secondText: 'Segons',
10
- millisecText: 'Milisegons',
11
- timezoneText: 'Fus horari',
12
- currentText: 'Ara',
13
- closeText: 'Tancar',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['ca']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-cs.js DELETED
@@ -1,20 +0,0 @@
1
- /* Czech translation for the jQuery Timepicker Addon */
2
- /* Written by Ondřej Vodáček */
3
- (function($) {
4
- $.timepicker.regional['cs'] = {
5
- timeOnlyTitle: 'Vyberte čas',
6
- timeText: 'Čas',
7
- hourText: 'Hodiny',
8
- minuteText: 'Minuty',
9
- secondText: 'Vteřiny',
10
- millisecText: 'Milisekundy',
11
- timezoneText: 'Časové pásmo',
12
- currentText: 'Nyní',
13
- closeText: 'Zavřít',
14
- timeFormat: 'HH:mm',
15
- amNames: ['dop.', 'AM', 'A'],
16
- pmNames: ['odp.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['cs']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-de.js DELETED
@@ -1,20 +0,0 @@
1
- /* German translation for the jQuery Timepicker Addon */
2
- /* Written by Marvin */
3
- (function($) {
4
- $.timepicker.regional['de'] = {
5
- timeOnlyTitle: 'Zeit Wählen',
6
- timeText: 'Zeit',
7
- hourText: 'Stunde',
8
- minuteText: 'Minute',
9
- secondText: 'Sekunde',
10
- millisecText: 'Millisekunde',
11
- timezoneText: 'Zeitzone',
12
- currentText: 'Jetzt',
13
- closeText: 'Fertig',
14
- timeFormat: 'HH:mm',
15
- amNames: ['vorm.', 'AM', 'A'],
16
- pmNames: ['nachm.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['de']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-el.js DELETED
@@ -1,20 +0,0 @@
1
- /* Hellenic translation for the jQuery Timepicker Addon */
2
- /* Written by Christos Pontikis */
3
- (function($) {
4
- $.timepicker.regional['el'] = {
5
- timeOnlyTitle: 'Επιλογή ώρας',
6
- timeText: 'Ώρα',
7
- hourText: 'Ώρες',
8
- minuteText: 'Λεπτά',
9
- secondText: 'Δευτερόλεπτα',
10
- millisecText: 'μιλιδευτερόλεπτο',
11
- timezoneText: 'Ζώνη ώρας',
12
- currentText: 'Τώρα',
13
- closeText: 'Κλείσιμο',
14
- timeFormat: 'HH:mm',
15
- amNames: ['π.μ.', 'AM', 'A'],
16
- pmNames: ['μ.μ.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['el']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-es.js DELETED
@@ -1,20 +0,0 @@
1
- /* Spanish translation for the jQuery Timepicker Addon */
2
- /* Written by Ianaré Sévi */
3
- (function($) {
4
- $.timepicker.regional['es'] = {
5
- timeOnlyTitle: 'Elegir una hora',
6
- timeText: 'Hora',
7
- hourText: 'Horas',
8
- minuteText: 'Minutos',
9
- secondText: 'Segundos',
10
- millisecText: 'Milisegundos',
11
- timezoneText: 'Huso horario',
12
- currentText: 'Ahora',
13
- closeText: 'Cerrar',
14
- timeFormat: 'HH:mm',
15
- amNames: ['a.m.', 'AM', 'A'],
16
- pmNames: ['p.m.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['es']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-et.js DELETED
@@ -1,20 +0,0 @@
1
- /* Estonian translation for the jQuery Timepicker Addon */
2
- /* Written by Karl Sutt (karl@sutt.ee) */
3
- (function($) {
4
- $.timepicker.regional['et'] = {
5
- timeOnlyTitle: 'Vali aeg',
6
- timeText: 'Aeg',
7
- hourText: 'Tund',
8
- minuteText: 'Minut',
9
- secondText: 'Sekund',
10
- millisecText: 'Millisekundis',
11
- timezoneText: 'Ajavöönd',
12
- currentText: 'Praegu',
13
- closeText: 'Valmis',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['et']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-eu.js DELETED
@@ -1,20 +0,0 @@
1
- /* Basque trannslation for JQuery Timepicker Addon
2
- /* Translated by Xabi Fer */
3
- (function($) {
4
- $.timepicker.regional['eu'] = {
5
- timeOnlyTitle: 'Aukeratu ordua',
6
- timeText: 'Ordua',
7
- hourText: 'Orduak',
8
- minuteText: 'Minutuak',
9
- secondText: 'Segunduak',
10
- millisecText: 'Milisegunduak',
11
- timezoneText: 'Ordu-eremua',
12
- currentText: 'Orain',
13
- closeText: 'Itxi',
14
- timeFormat: 'HH:mm',
15
- amNames: ['a.m.', 'AM', 'A'],
16
- pmNames: ['p.m.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['eu']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-fi.js DELETED
@@ -1,20 +0,0 @@
1
- /* Finnish translation for the jQuery Timepicker Addon */
2
- /* Written by Juga Paazmaya (http://github.com/paazmaya) */
3
- (function($) {
4
- $.timepicker.regional['fi'] = {
5
- timeOnlyTitle: 'Valitse aika',
6
- timeText: 'Aika',
7
- hourText: 'Tunti',
8
- minuteText: 'Minuutti',
9
- secondText: 'Sekunti',
10
- millisecText: 'Millisekunnin',
11
- timezoneText: 'Aikavyöhyke',
12
- currentText: 'Nyt',
13
- closeText: 'Sulje',
14
- timeFormat: 'HH:mm',
15
- amNames: ['ap.', 'AM', 'A'],
16
- pmNames: ['ip.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['fi']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-fr.js DELETED
@@ -1,20 +0,0 @@
1
- /* French translation for the jQuery Timepicker Addon */
2
- /* Written by Thomas Lété */
3
- (function($) {
4
- $.timepicker.regional['fr'] = {
5
- timeOnlyTitle: 'Choisir une heure',
6
- timeText: 'Heure',
7
- hourText: 'Heures',
8
- minuteText: 'Minutes',
9
- secondText: 'Secondes',
10
- millisecText: 'Millisecondes',
11
- timezoneText: 'Fuseau horaire',
12
- currentText: 'Maintenant',
13
- closeText: 'Terminé',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['fr']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-gl.js DELETED
@@ -1,20 +0,0 @@
1
- /* Galician translation for the jQuery Timepicker Addon */
2
- /* Written by David Barral */
3
- (function($) {
4
- $.timepicker.regional['gl'] = {
5
- timeOnlyTitle: 'Elixir unha hora',
6
- timeText: 'Hora',
7
- hourText: 'Horas',
8
- minuteText: 'Minutos',
9
- secondText: 'Segundos',
10
- millisecText: 'Milisegundos',
11
- timezoneText: 'Fuso horario',
12
- currentText: 'Agora',
13
- closeText: 'Pechar',
14
- timeFormat: 'HH:mm',
15
- amNames: ['a.m.', 'AM', 'A'],
16
- pmNames: ['p.m.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['gl']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-he.js DELETED
@@ -1,20 +0,0 @@
1
- /* Hebrew translation for the jQuery Timepicker Addon */
2
- /* Written by Lior Lapid */
3
- (function($) {
4
- $.timepicker.regional["he"] = {
5
- timeOnlyTitle: "בחירת זמן",
6
- timeText: "שעה",
7
- hourText: "שעות",
8
- minuteText: "דקות",
9
- secondText: "שניות",
10
- millisecText: "אלפית השנייה",
11
- timezoneText: "אזור זמן",
12
- currentText: "עכשיו",
13
- closeText:"סגור",
14
- timeFormat: "HH:mm",
15
- amNames: ['לפנה"צ', 'AM', 'A'],
16
- pmNames: ['אחה"צ', 'PM', 'P'],
17
- isRTL: true
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional["he"]);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-hu.js DELETED
@@ -1,20 +0,0 @@
1
- /* Hungarian translation for the jQuery Timepicker Addon */
2
- /* Written by Vas Gábor */
3
- (function($) {
4
- $.timepicker.regional['hu'] = {
5
- timeOnlyTitle: 'Válasszon időpontot',
6
- timeText: 'Idő',
7
- hourText: 'Óra',
8
- minuteText: 'Perc',
9
- secondText: 'Másodperc',
10
- millisecText: 'Milliszekundumos',
11
- timezoneText: 'Időzóna',
12
- currentText: 'Most',
13
- closeText: 'Kész',
14
- timeFormat: 'HH:mm',
15
- amNames: ['de.', 'AM', 'A'],
16
- pmNames: ['du.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['hu']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-id.js DELETED
@@ -1,20 +0,0 @@
1
- /* Indonesian translation for the jQuery Timepicker Addon */
2
- /* Written by Nia */
3
- (function($) {
4
- $.timepicker.regional['id'] = {
5
- timeOnlyTitle: 'Pilih Waktu',
6
- timeText: 'Waktu',
7
- hourText: 'Pukul',
8
- minuteText: 'Menit',
9
- secondText: 'Detik',
10
- millisecText: 'Milidetik',
11
- timezoneText: 'Zona Waktu',
12
- currentText: 'Sekarang',
13
- closeText: 'OK',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['id']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-it.js DELETED
@@ -1,20 +0,0 @@
1
- /* Italian translation for the jQuery Timepicker Addon */
2
- /* Written by Marco "logicoder" Del Tongo */
3
- (function($) {
4
- $.timepicker.regional['it'] = {
5
- timeOnlyTitle: 'Scegli orario',
6
- timeText: 'Orario',
7
- hourText: 'Ora',
8
- minuteText: 'Minuto',
9
- secondText: 'Secondo',
10
- millisecText: 'Millisecondo',
11
- timezoneText: 'Fuso orario',
12
- currentText: 'Adesso',
13
- closeText: 'Chiudi',
14
- timeFormat: 'HH:mm',
15
- amNames: ['m.', 'AM', 'A'],
16
- pmNames: ['p.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['it']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ja.js DELETED
@@ -1,20 +0,0 @@
1
- /* Japanese translation for the jQuery Timepicker Addon */
2
- /* Written by Jun Omae */
3
- (function($) {
4
- $.timepicker.regional['ja'] = {
5
- timeOnlyTitle: '時間を選択',
6
- timeText: '時間',
7
- hourText: '時',
8
- minuteText: '分',
9
- secondText: '秒',
10
- millisecText: 'ミリ秒',
11
- timezoneText: 'タイムゾーン',
12
- currentText: '現時刻',
13
- closeText: '閉じる',
14
- timeFormat: 'HH:mm',
15
- amNames: ['午前', 'AM', 'A'],
16
- pmNames: ['午後', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['ja']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ko.js DELETED
@@ -1,20 +0,0 @@
1
- /* Korean translation for the jQuery Timepicker Addon */
2
- /* Written by Genie */
3
- (function($) {
4
- $.timepicker.regional['ko'] = {
5
- timeOnlyTitle: '시간 선택',
6
- timeText: '시간',
7
- hourText: '시',
8
- minuteText: '분',
9
- secondText: '초',
10
- millisecText: '밀리초',
11
- timezoneText: '표준 시간대',
12
- currentText: '현재 시각',
13
- closeText: '닫기',
14
- timeFormat: 'tt h:mm',
15
- amNames: ['오전', 'AM', 'A'],
16
- pmNames: ['오후', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['ko']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-lt.js DELETED
@@ -1,20 +0,0 @@
1
- /* Lithuanian translation for the jQuery Timepicker Addon */
2
- /* Written by Irmantas Šiupšinskas */
3
- (function($) {
4
- $.timepicker.regional['lt'] = {
5
- timeOnlyTitle: 'Pasirinkite laiką',
6
- timeText: 'Laikas',
7
- hourText: 'Valandos',
8
- minuteText: 'Minutės',
9
- secondText: 'Sekundės',
10
- millisecText: 'Milisekundės',
11
- timezoneText: 'Laiko zona',
12
- currentText: 'Dabar',
13
- closeText: 'Uždaryti',
14
- timeFormat: 'HH:mm',
15
- amNames: ['priešpiet', 'AM', 'A'],
16
- pmNames: ['popiet', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['lt']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-nl.js DELETED
@@ -1,20 +0,0 @@
1
- /* Dutch translation for the jQuery Timepicker Addon */
2
- /* Written by Martijn van der Lee */
3
- (function($) {
4
- $.timepicker.regional['nl'] = {
5
- timeOnlyTitle: 'Tijdstip',
6
- timeText: 'Tijd',
7
- hourText: 'Uur',
8
- minuteText: 'Minuut',
9
- secondText: 'Seconde',
10
- millisecText: 'Milliseconde',
11
- timezoneText: 'Tijdzone',
12
- currentText: 'Vandaag',
13
- closeText: 'Sluiten',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['nl']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-no.js DELETED
@@ -1,20 +0,0 @@
1
- /* Norwegian translation for the jQuery Timepicker Addon */
2
- /* Written by Morten Hauan (http://hauan.me) */
3
- (function($) {
4
- $.timepicker.regional['no'] = {
5
- timeOnlyTitle: 'Velg tid',
6
- timeText: 'Tid',
7
- hourText: 'Time',
8
- minuteText: 'Minutt',
9
- secondText: 'Sekund',
10
- millisecText: 'Millisekund',
11
- timezoneText: 'Tidssone',
12
- currentText: 'Nå',
13
- closeText: 'Lukk',
14
- timeFormat: 'HH:mm',
15
- amNames: ['am', 'AM', 'A'],
16
- pmNames: ['pm', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['no']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pl.js DELETED
@@ -1,20 +0,0 @@
1
- /* Polish translation for the jQuery Timepicker Addon */
2
- /* Written by Michał Pena */
3
- (function($) {
4
- $.timepicker.regional['pl'] = {
5
- timeOnlyTitle: 'Wybierz godzinę',
6
- timeText: 'Czas',
7
- hourText: 'Godzina',
8
- minuteText: 'Minuta',
9
- secondText: 'Sekunda',
10
- millisecText: 'Milisekunda',
11
- timezoneText: 'Strefa czasowa',
12
- currentText: 'Teraz',
13
- closeText: 'Gotowe',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['pl']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pt-BR.js DELETED
@@ -1,20 +0,0 @@
1
- /* Brazilian Portuguese translation for the jQuery Timepicker Addon */
2
- /* Written by Diogo Damiani (diogodamiani@gmail.com) */
3
- (function ($) {
4
- $.timepicker.regional['pt-BR'] = {
5
- timeOnlyTitle: 'Escolha a horário',
6
- timeText: 'Horário',
7
- hourText: 'Hora',
8
- minuteText: 'Minutos',
9
- secondText: 'Segundos',
10
- millisecText: 'Milissegundos',
11
- timezoneText: 'Fuso horário',
12
- currentText: 'Agora',
13
- closeText: 'Fechar',
14
- timeFormat: 'HH:mm',
15
- amNames: ['a.m.', 'AM', 'A'],
16
- pmNames: ['p.m.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['pt-BR']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pt.js DELETED
@@ -1,20 +0,0 @@
1
- /* Portuguese translation for the jQuery Timepicker Addon */
2
- /* Written by Luan Almeida */
3
- (function($) {
4
- $.timepicker.regional['pt'] = {
5
- timeOnlyTitle: 'Escolha uma hora',
6
- timeText: 'Hora',
7
- hourText: 'Horas',
8
- minuteText: 'Minutos',
9
- secondText: 'Segundos',
10
- millisecText: 'Milissegundos',
11
- timezoneText: 'Fuso horário',
12
- currentText: 'Agora',
13
- closeText: 'Fechar',
14
- timeFormat: 'HH:mm',
15
- amNames: ['a.m.', 'AM', 'A'],
16
- pmNames: ['p.m.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['pt']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ro.js DELETED
@@ -1,20 +0,0 @@
1
- /* Romanian translation for the jQuery Timepicker Addon */
2
- /* Written by Romeo Adrian Cioaba */
3
- (function($) {
4
- $.timepicker.regional['ro'] = {
5
- timeOnlyTitle: 'Alegeţi o oră',
6
- timeText: 'Timp',
7
- hourText: 'Ore',
8
- minuteText: 'Minute',
9
- secondText: 'Secunde',
10
- millisecText: 'Milisecunde',
11
- timezoneText: 'Fus orar',
12
- currentText: 'Acum',
13
- closeText: 'Închide',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['ro']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ru.js DELETED
@@ -1,20 +0,0 @@
1
- /* Russian translation for the jQuery Timepicker Addon */
2
- /* Written by Trent Richardson */
3
- (function($) {
4
- $.timepicker.regional['ru'] = {
5
- timeOnlyTitle: 'Выберите время',
6
- timeText: 'Время',
7
- hourText: 'Часы',
8
- minuteText: 'Минуты',
9
- secondText: 'Секунды',
10
- millisecText: 'Миллисекунды',
11
- timezoneText: 'Часовой пояс',
12
- currentText: 'Сейчас',
13
- closeText: 'Закрыть',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['ru']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-sk.js DELETED
@@ -1,20 +0,0 @@
1
- /* Slovak translation for the jQuery Timepicker Addon */
2
- /* Written by David Vallner */
3
- (function($) {
4
- $.timepicker.regional['sk'] = {
5
- timeOnlyTitle: 'Zvoľte čas',
6
- timeText: 'Čas',
7
- hourText: 'Hodiny',
8
- minuteText: 'Minúty',
9
- secondText: 'Sekundy',
10
- millisecText: 'Milisekundy',
11
- timezoneText: 'Časové pásmo',
12
- currentText: 'Teraz',
13
- closeText: 'Zavrieť',
14
- timeFormat: 'H:m',
15
- amNames: ['dop.', 'AM', 'A'],
16
- pmNames: ['pop.', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['sk']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-sv.js DELETED
@@ -1,20 +0,0 @@
1
- /* Swedish translation for the jQuery Timepicker Addon */
2
- /* Written by Nevon */
3
- (function($) {
4
- $.timepicker.regional['sv'] = {
5
- timeOnlyTitle: 'Välj en tid',
6
- timeText: 'Timme',
7
- hourText: 'Timmar',
8
- minuteText: 'Minuter',
9
- secondText: 'Sekunder',
10
- millisecText: 'Millisekunder',
11
- timezoneText: 'Tidszon',
12
- currentText: 'Nu',
13
- closeText: 'Stäng',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['sv']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-th.js DELETED
@@ -1,17 +0,0 @@
1
- /* Thai translation for the jQuery Timepicker Addon */
2
- /* Written by Yote Wachirapornpongsa */
3
- (function($) {
4
- $.timepicker.regional['th'] = {
5
- timeOnlyTitle: 'เลือกเวลา',
6
- timeText: 'เวลา ',
7
- hourText: 'ชั่วโมง ',
8
- minuteText: 'นาที',
9
- secondText: 'วินาที',
10
- millisecText: 'มิลลิวินาที',
11
- timezoneText: 'เขตเวลา',
12
- currentText: 'เวลาปัจจุบัน',
13
- closeText: 'ปิด',
14
- timeFormat: 'hh:mm tt'
15
- };
16
- $.timepicker.setDefaults($.timepicker.regional['th']);
17
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-tr.js DELETED
@@ -1,20 +0,0 @@
1
- /* Turkish translation for the jQuery Timepicker Addon */
2
- /* Written by Fehmi Can Saglam, Edited by Goktug Ozturk */
3
- (function($) {
4
- $.timepicker.regional['tr'] = {
5
- timeOnlyTitle: 'Zaman Seçiniz',
6
- timeText: 'Zaman',
7
- hourText: 'Saat',
8
- minuteText: 'Dakika',
9
- secondText: 'Saniye',
10
- millisecText: 'Milisaniye',
11
- timezoneText: 'Zaman Dilimi',
12
- currentText: 'Şu an',
13
- closeText: 'Tamam',
14
- timeFormat: 'HH:mm',
15
- amNames: ['ÖÖ', 'Ö'],
16
- pmNames: ['ÖS', 'S'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['tr']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-uk.js DELETED
@@ -1,20 +0,0 @@
1
- /* Ukrainian translation for the jQuery Timepicker Addon */
2
- /* Written by Sergey Noskov */
3
- (function($) {
4
- $.timepicker.regional['uk'] = {
5
- timeOnlyTitle: 'Виберіть час',
6
- timeText: 'Час',
7
- hourText: 'Години',
8
- minuteText: 'Хвилини',
9
- secondText: 'Секунди',
10
- millisecText: 'Мілісекунди',
11
- timezoneText: 'Часовий пояс',
12
- currentText: 'Зараз',
13
- closeText: 'Закрити',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['uk']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-vi.js DELETED
@@ -1,20 +0,0 @@
1
- /* Vietnamese translation for the jQuery Timepicker Addon */
2
- /* Written by Nguyen Dinh Trung */
3
- (function($) {
4
- $.timepicker.regional['vi'] = {
5
- timeOnlyTitle: 'Chọn giờ',
6
- timeText: 'Thời gian',
7
- hourText: 'Giờ',
8
- minuteText: 'Phút',
9
- secondText: 'Giây',
10
- millisecText: 'Phần nghìn giây',
11
- timezoneText: 'Múi giờ',
12
- currentText: 'Hiện thời',
13
- closeText: 'Đóng',
14
- timeFormat: 'H:m',
15
- amNames: ['SA', 'AM', 'A'],
16
- pmNames: ['CH', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['vi']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-zh-CN.js DELETED
@@ -1,20 +0,0 @@
1
- /* Simplified Chinese translation for the jQuery Timepicker Addon /
2
- / Written by Will Lu */
3
- (function($) {
4
- $.timepicker.regional['zh-CN'] = {
5
- timeOnlyTitle: '选择时间',
6
- timeText: '时间',
7
- hourText: '小时',
8
- minuteText: '分钟',
9
- secondText: '秒钟',
10
- millisecText: '微秒',
11
- timezoneText: '时区',
12
- currentText: '现在时间',
13
- closeText: '关闭',
14
- timeFormat: 'HH:mm',
15
- amNames: ['AM', 'A'],
16
- pmNames: ['PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['zh-CN']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/jqueryui/timepicker-i18n/jquery-ui-timepicker-zh-TW.js DELETED
@@ -1,20 +0,0 @@
1
- /* Chinese translation for the jQuery Timepicker Addon */
2
- /* Written by Alang.lin */
3
- (function($) {
4
- $.timepicker.regional['zh-TW'] = {
5
- timeOnlyTitle: '選擇時分秒',
6
- timeText: '時間',
7
- hourText: '時',
8
- minuteText: '分',
9
- secondText: '秒',
10
- millisecText: '毫秒',
11
- timezoneText: '時區',
12
- currentText: '現在時間',
13
- closeText: '確定',
14
- timeFormat: 'HH:mm',
15
- amNames: ['上午', 'AM', 'A'],
16
- pmNames: ['下午', 'PM', 'P'],
17
- isRTL: false
18
- };
19
- $.timepicker.setDefaults($.timepicker.regional['zh-TW']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/map-frontend.js ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global google, jQuery */
2
+
3
+ jQuery( function ( $ ) {
4
+ 'use strict';
5
+
6
+ /**
7
+ * Callback function for Google Maps Lazy Load library to display map
8
+ *
9
+ * @return void
10
+ */
11
+ function displayMap() {
12
+ var $container = $( this ),
13
+ options = $container.data( 'map_options' );
14
+
15
+ var mapOptions = options.js_options,
16
+ center = new google.maps.LatLng( options.latitude, options.longitude ),
17
+ map;
18
+
19
+ switch ( mapOptions.mapTypeId ) {
20
+ case 'ROADMAP':
21
+ mapOptions.mapTypeId = google.maps.MapTypeId.ROADMAP;
22
+ break;
23
+ case 'SATELLITE':
24
+ mapOptions.mapTypeId = google.maps.MapTypeId.SATELLITE;
25
+ break;
26
+ case 'HYBRID':
27
+ mapOptions.mapTypeId = google.maps.MapTypeId.HYBRID;
28
+ break;
29
+ case 'TERRAIN':
30
+ mapOptions.mapTypeId = google.maps.MapTypeId.TERRAIN;
31
+ break;
32
+ }
33
+ mapOptions.center = center;
34
+
35
+ // Typcast zoom to a number
36
+ mapOptions.zoom *= 1;
37
+
38
+ if ( typeof mapOptions.styles === 'string' ) {
39
+ mapOptions.styles = JSON.parse(mapOptions.styles);
40
+ }
41
+
42
+ map = new google.maps.Map( this, mapOptions );
43
+
44
+ // Set marker
45
+ if ( options.marker ) {
46
+ var marker = new google.maps.Marker( {
47
+ position: center,
48
+ map: map
49
+ } );
50
+
51
+ // Set marker title
52
+ if ( options.marker_title ) {
53
+ marker.setTitle( options.marker_title );
54
+ }
55
+
56
+ // Set marker icon
57
+ if ( options.marker_icon ) {
58
+ marker.setIcon( options.marker_icon );
59
+ }
60
+ }
61
+
62
+ // Set info window
63
+ if ( options.info_window ) {
64
+ var infoWindow = new google.maps.InfoWindow( {
65
+ content: options.info_window,
66
+ minWidth: 200
67
+ } );
68
+
69
+ google.maps.event.addListener( marker, 'click', function () {
70
+ infoWindow.open( map, marker );
71
+ } );
72
+ }
73
+ }
74
+
75
+ // Loop through all map instances and display them
76
+ $( '.rwmb-map-canvas' ).each( displayMap );
77
+ } );
inc/meta-box/js/map.js CHANGED
@@ -1,18 +1,20 @@
1
- (function ( $ )
2
- {
 
3
  'use strict';
4
 
5
  // Use function construction to store map & DOM elements separately for each instance
6
- var MapField = function ( $container )
7
- {
8
  this.$container = $container;
9
  };
10
 
 
 
 
11
  // Use prototype for better performance
12
  MapField.prototype = {
13
  // Initialize everything
14
- init : function ()
15
- {
16
  this.initDomElements();
17
  this.initMapElements();
18
 
@@ -22,109 +24,146 @@
22
  },
23
 
24
  // Initialize DOM elements
25
- initDomElements : function ()
26
- {
27
- this.canvas = this.$container.find( '.rwmb-map-canvas' )[0];
28
  this.$coordinate = this.$container.find( '.rwmb-map-coordinate' );
29
  this.$findButton = this.$container.find( '.rwmb-map-goto-address-button' );
30
- this.addressField = this.$findButton.val();
31
  },
32
 
33
  // Initialize map elements
34
- initMapElements : function ()
35
- {
36
- var defaultLoc = $( this.canvas ).data( 'default-loc' ),
37
  latLng;
38
 
39
- defaultLoc = defaultLoc ? defaultLoc.split( ',' ) : [53.346881, -6.258860];
40
  latLng = new google.maps.LatLng( defaultLoc[0], defaultLoc[1] ); // Initial position for map
41
 
42
  this.map = new google.maps.Map( this.canvas, {
43
- center : latLng,
44
- zoom : 14,
45
  streetViewControl: 0,
46
- mapTypeId : google.maps.MapTypeId.ROADMAP
47
  } );
48
- this.marker = new google.maps.Marker( { position: latLng, map: this.map, draggable: true } );
49
- this.geocoder = new google.maps.Geocoder();
50
  },
51
 
52
  // Initialize marker position
53
- initMarkerPosition: function ()
54
- {
55
- var coord = this.$coordinate.val(),
56
- l,
57
  zoom;
58
 
59
- if ( coord )
60
- {
61
- l = coord.split( ',' );
62
- this.marker.setPosition( new google.maps.LatLng( l[0], l[1] ) );
63
 
64
- zoom = l.length > 2 ? parseInt( l[2], 10 ) : 14;
65
 
66
  this.map.setCenter( this.marker.position );
67
  this.map.setZoom( zoom );
68
  }
69
- else if ( this.addressField )
70
- {
71
  this.geocodeAddress();
72
  }
73
  },
74
 
75
  // Add event listeners for 'click' & 'drag'
76
- addListeners : function ()
77
- {
78
  var that = this;
79
- google.maps.event.addListener( this.map, 'click', function ( event )
80
- {
81
  that.marker.setPosition( event.latLng );
82
  that.updateCoordinate( event.latLng );
83
  } );
84
- google.maps.event.addListener( this.marker, 'drag', function ( event )
85
- {
 
 
 
 
86
  that.updateCoordinate( event.latLng );
87
  } );
88
 
89
- this.$findButton.on( 'click', function ()
90
- {
91
  that.geocodeAddress();
92
  return false;
93
  } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  },
95
 
96
  // Autocomplete address
97
- autocomplete : function ()
98
- {
99
  var that = this;
100
 
101
  // No address field or more than 1 address fields, ignore
102
- if ( !this.addressField || this.addressField.split( ',' ).length > 1 )
103
- {
104
  return;
105
  }
106
 
107
- $( '#' + this.addressField ).autocomplete( {
108
- source: function ( request, response )
109
- {
110
- // TODO: add 'region' option, to help bias geocoder.
111
- that.geocoder.geocode( {
112
- 'address': request.term
113
- }, function ( results )
114
- {
115
- response( $.map( results, function ( item )
116
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  return {
118
- label : item.formatted_address,
119
- value : item.formatted_address,
120
- latitude : item.geometry.location.lat(),
121
  longitude: item.geometry.location.lng()
122
  };
123
  } ) );
124
  } );
125
  },
126
- select: function ( event, ui )
127
- {
128
  var latLng = new google.maps.LatLng( ui.item.latitude, ui.item.longitude );
129
 
130
  that.map.setCenter( latLng );
@@ -135,63 +174,57 @@
135
  },
136
 
137
  // Update coordinate to input field
138
- updateCoordinate : function ( latLng )
139
- {
140
- this.$coordinate.val( latLng.lat() + ',' + latLng.lng() );
141
  },
142
 
143
  // Find coordinates by address
144
- // Find coordinates by address
145
- geocodeAddress : function ()
146
- {
147
  var address,
148
  addressList = [],
149
  fieldList = this.addressField.split( ',' ),
150
  loop,
151
  that = this;
152
 
153
- for ( loop = 0; loop < fieldList.length; loop++ )
154
- {
155
- addressList[loop] = jQuery( '#' + fieldList[loop] ).val();
156
  }
157
 
158
  address = addressList.join( ',' ).replace( /\n/g, ',' ).replace( /,,/g, ',' );
159
 
160
- if ( address )
161
- {
162
- this.geocoder.geocode( { 'address': address }, function ( results, status )
163
- {
164
- if ( status === google.maps.GeocoderStatus.OK )
165
- {
166
- that.map.setCenter( results[0].geometry.location );
167
- that.marker.setPosition( results[0].geometry.location );
168
- that.updateCoordinate( results[0].geometry.location );
169
- }
170
- } );
171
  }
 
 
 
 
 
 
 
 
 
172
  }
173
  };
174
 
175
- $( function ()
176
- {
177
- $( '.rwmb-map-field' ).each( function ()
178
- {
179
- var field = new MapField( $( this ) );
180
- field.init();
 
181
 
182
- $( this ).data( 'mapController', field );
 
 
183
  } );
 
184
 
185
- $( '.rwmb-input' ).on( 'clone', function ()
186
- {
187
- $( '.rwmb-map-field' ).each( function ()
188
- {
189
- var field = new MapField( $( this ) );
190
- field.init();
191
-
192
- $( this ).data( 'mapController', field );
193
- } );
194
- } );
195
  } );
196
 
197
- })( jQuery );
1
+ /* global google */
2
+
3
+ (function ( $, document, window, google ) {
4
  'use strict';
5
 
6
  // Use function construction to store map & DOM elements separately for each instance
7
+ var MapField = function ( $container ) {
 
8
  this.$container = $container;
9
  };
10
 
11
+ // Geocoder service.
12
+ var geocoder = new google.maps.Geocoder();
13
+
14
  // Use prototype for better performance
15
  MapField.prototype = {
16
  // Initialize everything
17
+ init: function () {
 
18
  this.initDomElements();
19
  this.initMapElements();
20
 
24
  },
25
 
26
  // Initialize DOM elements
27
+ initDomElements: function () {
28
+ this.$canvas = this.$container.find( '.rwmb-map-canvas' );
29
+ this.canvas = this.$canvas[0];
30
  this.$coordinate = this.$container.find( '.rwmb-map-coordinate' );
31
  this.$findButton = this.$container.find( '.rwmb-map-goto-address-button' );
32
+ this.addressField = this.$container.data( 'address-field' );
33
  },
34
 
35
  // Initialize map elements
36
+ initMapElements: function () {
37
+ var defaultLoc = this.$canvas.data( 'default-loc' ),
 
38
  latLng;
39
 
40
+ defaultLoc = defaultLoc ? defaultLoc.split( ',' ) : [53.346881, - 6.258860];
41
  latLng = new google.maps.LatLng( defaultLoc[0], defaultLoc[1] ); // Initial position for map
42
 
43
  this.map = new google.maps.Map( this.canvas, {
44
+ center: latLng,
45
+ zoom: 14,
46
  streetViewControl: 0,
47
+ mapTypeId: google.maps.MapTypeId.ROADMAP
48
  } );
49
+ this.marker = new google.maps.Marker( {position: latLng, map: this.map, draggable: true} );
 
50
  },
51
 
52
  // Initialize marker position
53
+ initMarkerPosition: function () {
54
+ var coordinate = this.$coordinate.val(),
55
+ location,
 
56
  zoom;
57
 
58
+ if ( coordinate ) {
59
+ location = coordinate.split( ',' );
60
+ this.marker.setPosition( new google.maps.LatLng( location[0], location[1] ) );
 
61
 
62
+ zoom = location.length > 2 ? parseInt( location[2], 10 ) : 14;
63
 
64
  this.map.setCenter( this.marker.position );
65
  this.map.setZoom( zoom );
66
  }
67
+ else if ( this.addressField ) {
 
68
  this.geocodeAddress();
69
  }
70
  },
71
 
72
  // Add event listeners for 'click' & 'drag'
73
+ addListeners: function () {
 
74
  var that = this;
75
+ google.maps.event.addListener( this.map, 'click', function ( event ) {
 
76
  that.marker.setPosition( event.latLng );
77
  that.updateCoordinate( event.latLng );
78
  } );
79
+
80
+ google.maps.event.addListener( this.map, 'zoom_changed', function ( event ) {
81
+ that.updateCoordinate( that.marker.getPosition() );
82
+ } );
83
+
84
+ google.maps.event.addListener( this.marker, 'drag', function ( event ) {
85
  that.updateCoordinate( event.latLng );
86
  } );
87
 
88
+ this.$findButton.on( 'click', function () {
 
89
  that.geocodeAddress();
90
  return false;
91
  } );
92
+
93
+ /**
94
+ * Add a custom event that allows other scripts to refresh the maps when needed
95
+ * For example: when maps is in tabs or hidden div (this is known issue of Google Maps)
96
+ *
97
+ * @see https://developers.google.com/maps/documentation/javascript/reference ('resize' Event)
98
+ */
99
+ $( window ).on( 'rwmb_map_refresh', function () {
100
+ that.refresh();
101
+ } );
102
+
103
+ // Refresh on meta box hide and show
104
+ $( document ).on( 'postbox-toggled', function () {
105
+ that.refresh();
106
+ } );
107
+ // Refresh on sorting meta boxes
108
+ $( '.meta-box-sortables' ).on( 'sortstop', function () {
109
+ that.refresh();
110
+ } );
111
+ },
112
+
113
+ refresh: function () {
114
+ var zoom = this.map.getZoom(),
115
+ center = this.map.getCenter();
116
+
117
+ if ( this.map ) {
118
+ google.maps.event.trigger( this.map, 'resize' );
119
+ this.map.setZoom( zoom );
120
+ this.map.setCenter( center );
121
+ }
122
  },
123
 
124
  // Autocomplete address
125
+ autocomplete: function () {
 
126
  var that = this;
127
 
128
  // No address field or more than 1 address fields, ignore
129
+ if ( ! this.addressField || this.addressField.split( ',' ).length > 1 ) {
 
130
  return;
131
  }
132
 
133
+ var $address = $( 'input[name="' + this.addressField + '"]');
134
+
135
+ // If map and address is inside a group, the input name of address field is changed.
136
+ if ( 0 === $address.length ) {
137
+ $address = this.$container.closest( '.rwmb-group-wrapper' ).find( 'input[name*="[' + this.addressField + ']"]' );
138
+ }
139
+
140
+ // If Meta Box Geo Location installed. Do not run auto complete.
141
+ if ( $( '.rwmb-geo-binding' ).length ) {
142
+ $address.on( 'selected_address', function () {
143
+ that.$findButton.trigger( 'click' );
144
+ } );
145
+
146
+ return false;
147
+ }
148
+
149
+ $address.autocomplete( {
150
+ source: function ( request, response ) {
151
+ var options = {
152
+ 'address': request.term,
153
+ 'region': that.$canvas.data( 'region' )
154
+ };
155
+ geocoder.geocode( options, function ( results ) {
156
+ response( $.map( results, function ( item ) {
157
  return {
158
+ label: item.formatted_address,
159
+ value: item.formatted_address,
160
+ latitude: item.geometry.location.lat(),
161
  longitude: item.geometry.location.lng()
162
  };
163
  } ) );
164
  } );
165
  },
166
+ select: function ( event, ui ) {
 
167
  var latLng = new google.maps.LatLng( ui.item.latitude, ui.item.longitude );
168
 
169
  that.map.setCenter( latLng );
174
  },
175
 
176
  // Update coordinate to input field
177
+ updateCoordinate: function ( latLng ) {
178
+ var zoom = this.map.getZoom();
179
+ this.$coordinate.val( latLng.lat() + ',' + latLng.lng() + ',' + zoom );
180
  },
181
 
182
  // Find coordinates by address
183
+ geocodeAddress: function () {
 
 
184
  var address,
185
  addressList = [],
186
  fieldList = this.addressField.split( ',' ),
187
  loop,
188
  that = this;
189
 
190
+ for ( loop = 0; loop < fieldList.length; loop ++ ) {
191
+ addressList[loop] = $( '#' + fieldList[loop] ).val();
 
192
  }
193
 
194
  address = addressList.join( ',' ).replace( /\n/g, ',' ).replace( /,,/g, ',' );
195
 
196
+ if ( ! address ) {
197
+ return;
 
 
 
 
 
 
 
 
 
198
  }
199
+
200
+ geocoder.geocode( {'address': address}, function ( results, status ) {
201
+ if ( status !== google.maps.GeocoderStatus.OK ) {
202
+ return;
203
+ }
204
+ that.map.setCenter( results[0].geometry.location );
205
+ that.marker.setPosition( results[0].geometry.location );
206
+ that.updateCoordinate( results[0].geometry.location );
207
+ } );
208
  }
209
  };
210
 
211
+ function update() {
212
+ $( '.rwmb-map-field' ).each( function () {
213
+ var $this = $( this ),
214
+ controller = $this.data( 'mapController' );
215
+ if ( controller ) {
216
+ return;
217
+ }
218
 
219
+ controller = new MapField( $( this ) );
220
+ controller.init();
221
+ $this.data( 'mapController', controller );
222
  } );
223
+ }
224
 
225
+ $( function () {
226
+ update();
227
+ $( '.rwmb-input' ).on( 'clone', update );
 
 
 
 
 
 
 
228
  } );
229
 
230
+ })( jQuery, document, window, google );
inc/meta-box/js/media.js ADDED
@@ -0,0 +1,617 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global jQuery, _,i18nRwmbMedia */
2
+
3
+ window.rwmb = window.rwmb || {};
4
+
5
+ jQuery( function ( $ ) {
6
+ 'use strict';
7
+
8
+ var views = rwmb.views = rwmb.views || {},
9
+ models = rwmb.models = rwmb.models || {},
10
+ media = wp.media,
11
+ MediaFrame = media.view.MediaFrame,
12
+ MediaCollection, Controller, MediaField, MediaList, MediaItem, MediaButton, MediaStatus, EditMedia,
13
+ MediaDetails, MediaLibrary, MediaSelect;
14
+
15
+ MediaCollection = models.MediaCollection = media.model.Attachments.extend( {
16
+ initialize: function ( models, options ) {
17
+ this.controller = options.controller || new models.Controller;
18
+ this.on( 'add remove reset', function () {
19
+ var max = this.controller.get( 'maxFiles' );
20
+ this.controller.set( 'length', this.length );
21
+ this.controller.set( 'full', max > 0 && this.length >= max );
22
+ } );
23
+
24
+ media.model.Attachments.prototype.initialize.call( this, models, options );
25
+ },
26
+
27
+ add: function ( models, options ) {
28
+ var max = this.controller.get( 'maxFiles' ),
29
+ left = max - this.length;
30
+
31
+ if ( max > 0 && left <= 0 ) {
32
+ return this;
33
+ }
34
+ if( models) {
35
+ if ( ! models.hasOwnProperty( 'length' ) ) {
36
+ models = [models];
37
+ } else if ( models instanceof media.model.Attachments ) {
38
+ models = models.models;
39
+ }
40
+ }
41
+ if ( left > 0 ) {
42
+ models = _.difference( models, this.models );
43
+ models = _.first( models, left );
44
+ }
45
+
46
+ return media.model.Attachments.prototype.add.call( this, models, options );
47
+ },
48
+
49
+ remove: function ( models, options ) {
50
+ models = media.model.Attachments.prototype.remove.call( this, models, options );
51
+ if ( this.controller.get( 'forceDelete' ) === true ) {
52
+ models = ! _.isArray( models ) ? [models] : models;
53
+ _.each( models, function ( model ) {
54
+ model.destroy();
55
+ } );
56
+ }
57
+ },
58
+
59
+ destroyAll: function () {
60
+ _.each( _.clone( this.models ), function ( model ) {
61
+ model.destroy();
62
+ } );
63
+ }
64
+ } );
65
+
66
+ /***
67
+ * Controller Model
68
+ * Manages data of media field and media models. Most of the media views will use this to manage the media
69
+ */
70
+ Controller = models.Controller = Backbone.Model.extend( {
71
+ //Default options
72
+ defaults: {
73
+ maxFiles: 0,
74
+ ids: [],
75
+ mimeType: '',
76
+ forceDelete: false,
77
+ maxStatus: true,
78
+ length: 0
79
+ },
80
+
81
+ //Initialize Controller model
82
+ initialize: function () {
83
+ // All numbers, no 0 ids
84
+ this.set( 'ids', _.without( _.map( this.get( 'ids' ), Number ), 0, - 1 ) );
85
+
86
+ // Create items collection
87
+ this.set( 'items', new MediaCollection( [], {controller: this} ) );
88
+
89
+ // Listen for destroy event on controller, delete all models when triggered
90
+ this.on( 'destroy', function () {
91
+ if ( this.get( 'forceDelete' ) ) {
92
+ this.get( 'items' ).destroyAll();
93
+ }
94
+ } );
95
+ },
96
+
97
+
98
+ // Load initial media
99
+ load: function () {
100
+ if ( _.isEmpty( this.get( 'ids' ) ) ) {
101
+ return;
102
+ }
103
+ this.get( 'items' ).props.set( {
104
+ query: true,
105
+ include: this.get( 'ids' ),
106
+ orderby: 'post__in',
107
+ order: 'ASC',
108
+ type: this.get( 'mimeType' ),
109
+ perPage: this.get( 'maxFiles' ) || - 1
110
+ } );
111
+ // Get more then trigger ready
112
+ this.get( 'items' ).more();
113
+ }
114
+ } );
115
+
116
+ /***
117
+ * MediaField
118
+ * Sets up media field view and subviews
119
+ */
120
+ MediaField = views.MediaField = Backbone.View.extend( {
121
+ className: 'rwmb-media-view',
122
+ initialize: function ( options ) {
123
+ var that = this,
124
+ fieldName = options.input.name;
125
+ this.$input = $( options.input );
126
+
127
+ if ( 1 != this.$input.attr( 'data-single-image' ) ) {
128
+ fieldName += '[]';
129
+ }
130
+
131
+ this.controller = new Controller( _.extend(
132
+ {
133
+ fieldName: fieldName,
134
+ ids: this.$input.val().split( ',' )
135
+ },
136
+ this.$input.data( 'options' )
137
+ ) );
138
+
139
+ // Create views
140
+ this.createList();
141
+ this.createAddButton();
142
+ this.createStatus();
143
+
144
+ // Render
145
+ this.render();
146
+
147
+ // Load media
148
+ this.controller.load();
149
+
150
+ // Listen for destroy event on input
151
+ this.$input.on( 'remove', function () {
152
+ that.controller.destroy();
153
+ } );
154
+
155
+ this.$input.on( 'media:reset', function() {
156
+ that.controller.get( 'items' ).reset();
157
+ } );
158
+
159
+ this.controller.get( 'items' ).on( 'add remove reset', _.debounce( function () {
160
+ that.$input.trigger( 'change', [that.$( '.rwmb-media-input' )] );
161
+ }, 500 ) );
162
+
163
+ this.controller.get( 'items' ).on( 'remove', _.debounce( function () {
164
+ that.$input.val( '' );
165
+ }, 500 ) );
166
+ },
167
+
168
+ // Creates media list
169
+ createList: function () {
170
+ this.list = new MediaList( {controller: this.controller} );
171
+ },
172
+
173
+ // Creates button that adds media
174
+ createAddButton: function () {
175
+ this.addButton = new MediaButton( {controller: this.controller} );
176
+ },
177
+
178
+ // Creates status
179
+ createStatus: function () {
180
+ this.status = new MediaStatus( {controller: this.controller} );
181
+ },
182
+
183
+ // Render field and adds sub fields
184
+ render: function () {
185
+ // Empty then add parts
186
+ this.$el.empty().append(
187
+ this.list.el,
188
+ this.status.el,
189
+ this.addButton.el
190
+ );
191
+ }
192
+ } );
193
+
194
+ /***
195
+ * Media List
196
+ * lists media
197
+ */
198
+ MediaList = views.MediaList = Backbone.View.extend( {
199
+ tagName: 'ul',
200
+ className: 'rwmb-media-list',
201
+
202
+ initialize: function ( options ) {
203
+ this.controller = options.controller;
204
+ this.collection = this.controller.get( 'items' );
205
+ this.itemView = options.itemView || MediaItem;
206
+ this.getItemView = _.memoize( function ( item ) {
207
+ var itemView = new this.itemView( {
208
+ model: item,
209
+ controller: this.controller
210
+ } );
211
+
212
+ this.listenToItemView( itemView );
213
+
214
+ return itemView;
215
+ },
216
+ function ( item ) {
217
+ return item.cid;
218
+ } );
219
+
220
+ this.listenTo( this.collection, 'add', this.addItemView );
221
+ this.listenTo( this.collection, 'remove', this.removeItemView );
222
+ this.listenTo( this.collection, 'reset', this.resetItemViews );
223
+
224
+ // Sort media using sortable
225
+ this.initSortable();
226
+ },
227
+
228
+ listenToItemView: function ( itemView ) {
229
+ this.listenTo( itemView, 'click:remove', this.removeItem );
230
+ this.listenTo( itemView, 'click:switch', this.switchItem );
231
+ this.listenTo( itemView, 'click:edit', this.editItem );
232
+ },
233
+
234
+ //Add item view
235
+ addItemView: function ( item ) {
236
+ var index = this.collection.indexOf( item ),
237
+ itemEl = this.getItemView( item ).el;
238
+
239
+ if ( 0 >= index ) {
240
+ this.$el.prepend( itemEl );
241
+ }
242
+ else if ( this.$el.children().length <= index ) {
243
+ this.$el.append( itemEl )
244
+ }
245
+ else {
246
+ this.$el.children().eq( index - 1 ).after( itemEl );
247
+ }
248
+ },
249
+
250
+ // Remove item view
251
+ removeItemView: function ( item ) {
252
+ this.getItemView( item ).$el.detach();
253
+ },
254
+
255
+ removeItem: function ( item ) {
256
+ this.collection.remove( item );
257
+ },
258
+
259
+ resetItemViews: function( items, options ){
260
+ var that = this;
261
+ _.each( options.previousModels, function( item ){
262
+ that.removeItemView( item );
263
+ } );
264
+ items.each( function( item ) {
265
+ that.addItemView( item );
266
+ } );
267
+ },
268
+
269
+ switchItem: function ( item ) {
270
+ if ( this._switchFrame ) {
271
+ //this.stopListening( this._frame );
272
+ this._switchFrame.dispose();
273
+ }
274
+ this._switchFrame = new MediaSelect( {
275
+ className: 'media-frame rwmb-media-frame',
276
+ multiple: false,
277
+ title: i18nRwmbMedia.select,
278
+ editing: true,
279
+ library: {
280
+ type: this.controller.get( 'mimeType' )
281
+ },
282
+ edit: this.controller.get( 'items' )
283
+ } );
284
+
285
+ this._switchFrame.on( 'select', function () {
286
+ var selection = this._switchFrame.state().get( 'selection' ),
287
+ collection = this.collection,
288
+ index = collection.indexOf( item );
289
+
290
+ if ( ! _.isEmpty( selection ) ) {
291
+ collection.remove( item );
292
+ collection.add( selection, {at: index} );
293
+ }
294
+ }, this );
295
+
296
+ this._switchFrame.open();
297
+ return false;
298
+ },
299
+
300
+ editItem: function ( item ) {
301
+ // Destroy the previous collection frame.
302
+ if ( this._editFrame ) {
303
+ //this.stopListening( this._frame );
304
+ this._editFrame.dispose();
305
+ }
306
+
307
+ // Trigger the media frame to open the correct item
308
+ this._editFrame = new EditMedia( {
309
+ frame: 'edit-attachments',
310
+ controller: {
311
+ // Needed to trick Edit modal to think there is a gridRouter
312
+ gridRouter: {
313
+ navigate: function ( destination ) {
314
+ },
315
+ baseUrl: function ( url ) {
316
+ }
317
+ }
318
+ },
319
+ library: this.collection,
320
+ model: item
321
+ } );
322
+
323
+ this._editFrame.open();
324
+ },
325
+
326
+ initSortable: function () {
327
+ var collection = this.controller.get( 'items' );
328
+ this.$el.sortable( {
329
+ // Clone the element and the clone will be dragged. Prevent trigger click on the image, which means reselect.
330
+ helper : 'clone',
331
+
332
+ // Record the initial `index` of the dragged model.
333
+ start: function ( event, ui ) {
334
+ ui.item.data( 'sortableIndexStart', ui.item.index() );
335
+ },
336
+
337
+ // Update the model's index in the collection.
338
+ // Do so silently, as the view is already accurate.
339
+ update: function ( event, ui ) {
340
+ var model = collection.at( ui.item.data( 'sortableIndexStart' ) );
341
+
342
+ // Silently shift the model to its new index.
343
+ collection.remove( model, {
344
+ silent: true
345
+ } );
346
+ collection.add( model, {
347
+ silent: true,
348
+ at: ui.item.index()
349
+ } );
350
+
351
+ // Fire the `reset` event to ensure other collections sync.
352
+ collection.trigger( 'reset', collection );
353
+ }
354
+ } );
355
+ }
356
+ } );
357
+
358
+ /***
359
+ * MediaStatus view.
360
+ * Show number of selected/uploaded files and number of files remain if "maxStatus" parameter is true.
361
+ */
362
+ MediaStatus = views.MediaStatus = Backbone.View.extend( {
363
+ tagName: 'div',
364
+ className: 'rwmb-media-status',
365
+ template: wp.template( 'rwmb-media-status' ),
366
+
367
+ initialize: function ( options ) {
368
+ this.controller = options.controller;
369
+
370
+ // Auto hide if maxStatus is false
371
+ if ( ! this.controller.get( 'maxStatus' ) ) {
372
+ this.$el.hide();
373
+ return;
374
+ }
375
+
376
+ // Re-render if changes happen in controller
377
+ this.listenTo( this.controller.get( 'items' ), 'update', this.render );
378
+ this.listenTo( this.controller.get( 'items' ), 'reset', this.render );
379
+
380
+ // Render
381
+ this.render();
382
+ },
383
+
384
+ render: function () {
385
+ var attributes = _.clone( this.controller.attributes );
386
+ this.$el.html( this.template( attributes ) );
387
+ }
388
+ } );
389
+
390
+ /***
391
+ * Media Button
392
+ * Selects and adds media to controller
393
+ */
394
+ MediaButton = views.MediaButton = Backbone.View.extend( {
395
+ tagName: 'div',
396
+ className: 'rwmb-media-add',
397
+ template: wp.template( 'rwmb-media-button' ),
398
+ events: {
399
+ 'click .button': function () {
400
+ // Destroy the previous collection frame.
401
+ if ( this._frame ) {
402
+ //this.stopListening( this._frame );
403
+ this._frame.dispose();
404
+ }
405
+ var maxFiles = this.controller.get( 'maxFiles' );
406
+ this._frame = new MediaSelect( {
407
+ className: 'media-frame rwmb-media-frame',
408
+ multiple: maxFiles > 1 || maxFiles <= 0 ? 'add' : false,
409
+ title: i18nRwmbMedia.select,
410
+ editing: true,
411
+ library: {
412
+ type: this.controller.get( 'mimeType' )
413
+ },
414
+ edit: this.controller.get( 'items' )
415
+ } );
416
+
417
+ this._frame.on( 'select', function () {
418
+ var selection = this._frame.state().get( 'selection' );
419
+ this.controller.get( 'items' ).add( selection.models );
420
+ }, this );
421
+
422
+ this._frame.open();
423
+ }
424
+ },
425
+ render: function () {
426
+ this.$el.html( this.template( {text: i18nRwmbMedia.add} ) );
427
+ return this;
428
+ },
429
+
430
+ initialize: function ( options ) {
431
+ this.controller = options.controller;
432
+ this.collection = this.controller.get( 'items' );
433
+
434
+ // Auto hide if you reach the max number of media
435
+ this.listenTo( this.controller, 'change:full', function () {
436
+ this.$el.toggle( ! this.controller.get( 'full' ) );
437
+ } );
438
+
439
+ this.render();
440
+ }
441
+ } );
442
+
443
+ /***
444
+ * MediaItem
445
+ * View for individual media items
446
+ */
447
+ MediaItem = views.MediaItem = Backbone.View.extend( {
448
+ tagName: 'li',
449
+ className: 'rwmb-media-item attachment',
450
+ template: wp.template( 'rwmb-media-item' ),
451
+ initialize: function ( options ) {
452
+ this.controller = options.controller;
453
+ this.render();
454
+ this.listenTo( this.model, 'change', function () {
455
+ this.render();
456
+ } );
457
+
458
+ this.$el.data( 'id', this.model.cid );
459
+ },
460
+
461
+
462
+ events: {
463
+ 'click .rwmb-overlay': function () {
464
+ this.trigger( 'click:switch', this.model );
465
+ return false;
466
+ },
467
+
468
+ // Event when remove button clicked
469
+ 'click .rwmb-remove-media': function () {
470
+ this.trigger( 'click:remove', this.model );
471
+ return false;
472
+ },
473
+
474
+ 'click .rwmb-edit-media': function () {
475
+ this.trigger( 'click:edit', this.model );
476
+ return false;
477
+ }
478
+ },
479
+
480
+ render: function () {
481
+ var attrs = _.clone( this.model.attributes );
482
+ attrs.controller = _.clone( this.controller.attributes );
483
+ this.$el.html( this.template( attrs ) );
484
+ return this;
485
+ }
486
+ } );
487
+
488
+ /**
489
+ * Extend media frames to make things work right
490
+ */
491
+
492
+ /**
493
+ * MediaDetails
494
+ * Custom version of TwoColumn view to prevent all video and audio from being unset
495
+ */
496
+ MediaDetails = views.MediaDetails = media.view.Attachment.Details.TwoColumn.extend( {
497
+ render: function () {
498
+ var that = this;
499
+ media.view.Attachment.Details.prototype.render.apply( this, arguments );
500
+ this.players = this.players || [];
501
+
502
+ media.mixin.unsetPlayers.call( this );
503
+
504
+ this.$( 'audio, video' ).each( function ( i, elem ) {
505
+ var el = media.view.MediaDetails.prepareSrc( elem );
506
+ that.players.push( new window.MediaElementPlayer( el, media.mixin.mejsSettings ) );
507
+ } );
508
+ }
509
+ } );
510
+
511
+ /**
512
+ * MediaLibrary
513
+ * Custom version of Library to exclude already selected media in a media frame
514
+ */
515
+ MediaLibrary = media.controller.Library.extend( {
516
+ defaults: _.defaults( {
517
+ multiple: 'add',
518
+ filterable: 'uploaded',
519
+ priority: 100,
520
+ syncSelection: false
521
+ }, media.controller.Library.prototype.defaults ),
522
+
523
+ activate: function () {
524
+ var library = this.get( 'library' ),
525
+ edit = this.frame.options.edit;
526
+
527
+ if ( this.editLibrary && this.editLibrary !== edit ) {
528
+ library.unobserve( this.editLibrary );
529
+ }
530
+
531
+ // Accepts attachments that exist in the original library and
532
+ // that do not exist in gallery's library.
533
+ library.validator = function ( attachment ) {
534
+ return ! ! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && media.model.Selection.prototype.validator.apply( this, arguments );
535
+ };
536
+
537
+ // Reset the library to ensure that all attachments are re-added
538
+ // to the collection. Do so silently, as calling `observe` will
539
+ // trigger the `reset` event.
540
+ library.reset( library.mirroring.models, {silent: true} );
541
+ library.observe( edit );
542
+ this.editLibrary = edit;
543
+
544
+ media.controller.Library.prototype.activate.apply( this, arguments );
545
+ }
546
+ } );
547
+
548
+ /**
549
+ * MediaSelect
550
+ * Custom version of Select media frame that uses MediaLibrary
551
+ */
552
+ MediaSelect = views.MediaSelect = MediaFrame.Select.extend( {
553
+ /**
554
+ * Create the default states on the frame.
555
+ */
556
+ createStates: function () {
557
+ var options = this.options;
558
+
559
+ if ( this.options.states ) {
560
+ return;
561
+ }
562
+
563
+ // Add the default states.
564
+ this.states.add( [
565
+ // Main states.
566
+ new MediaLibrary( {
567
+ library: media.query( options.library ),
568
+ multiple: options.multiple,
569
+ title: options.title,
570
+ priority: 20
571
+ } )
572
+ ] );
573
+ }
574
+ } );
575
+
576
+ /***
577
+ * EditMedia
578
+ * Custom version of EditAttachments frame to prevent all video and audio from being unset
579
+ */
580
+ EditMedia = views.EditMedia = MediaFrame.EditAttachments.extend( {
581
+ /**
582
+ * Content region rendering callback for the `edit-metadata` mode.
583
+ *
584
+ * @param {Object} contentRegion Basic object with a `view` property, which
585
+ * should be set with the proper region view.
586
+ */
587
+ editMetadataMode: function ( contentRegion ) {
588
+ contentRegion.view = new MediaDetails( {
589
+ controller: this,
590
+ model: this.model
591
+ } );
592
+
593
+ /**
594
+ * Attach a subview to display fields added via the
595
+ * `attachment_fields_to_edit` filter.
596
+ */
597
+ contentRegion.view.views.set( '.attachment-compat', new media.view.AttachmentCompat( {
598
+ controller: this,
599
+ model: this.model
600
+ } ) );
601
+ }
602
+ } );
603
+
604
+ /**
605
+ * Initialize media fields
606
+ * @return void
607
+ */
608
+ function initMediaField() {
609
+ var view = new MediaField( { input: this } );
610
+ //Remove old then add new
611
+ $( this ).siblings( 'div.rwmb-media-view' ).remove();
612
+ $( this ).after( view.el );
613
+ }
614
+
615
+ $( '.rwmb-file_advanced' ).each( initMediaField );
616
+ $( document ).on( 'clone', '.rwmb-file_advanced', initMediaField );
617
+ } );
inc/meta-box/js/oembed.js CHANGED
@@ -1,24 +1,34 @@
1
- jQuery( function( $ )
2
- {
3
  'use strict';
4
 
5
- $( '.rwmb-oembed-wrapper .spinner' ).hide();
 
 
 
 
6
 
7
- $( 'body' ).on( 'click', '.rwmb-oembed-wrapper .show-embed', function() {
8
  var $this = $( this ),
9
  $spinner = $this.siblings( '.spinner' ),
10
  data = {
11
  action: 'rwmb_get_embed',
12
- url: $this.siblings( 'input' ).val()
13
  };
14
 
15
- $spinner.show();
16
- $.post( ajaxurl, data, function( r )
17
- {
18
- $spinner.hide();
19
- $this.siblings( '.embed-code' ).html( r.data );
20
  }, 'json' );
 
21
 
22
- return false;
23
- } );
 
 
 
 
 
 
 
 
24
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
+ /**
5
+ * Show preview of oembeded media.
6
+ */
7
+ function showPreview( e ) {
8
+ e.preventDefault();
9
 
 
10
  var $this = $( this ),
11
  $spinner = $this.siblings( '.spinner' ),
12
  data = {
13
  action: 'rwmb_get_embed',
14
+ url: $this.val()
15
  };
16
 
17
+ $spinner.css( 'visibility', 'visible' );
18
+ $.post( ajaxurl, data, function ( response ) {
19
+ $spinner.css( 'visibility', 'hidden' );
20
+ $this.siblings( '.rwmb-embed-media' ).html( response.data );
 
21
  }, 'json' );
22
+ }
23
 
24
+ /**
25
+ * Remove oembed preview when cloning.
26
+ */
27
+ function removePreview() {
28
+ $( this ).siblings( '.rwmb-embed-media' ).html( '' );
29
+ }
30
+
31
+ $( document )
32
+ .on( 'change', '.rwmb-oembed', _.debounce( showPreview, 250 ) )
33
+ .on( 'clone', '.rwmb-oembed', removePreview );
34
  } );
inc/meta-box/js/plupload-image.js DELETED
@@ -1,141 +0,0 @@
1
- jQuery( function ( $ )
2
- {
3
- 'use strict';
4
-
5
- // Hide "Uploaded files" title if there are no files uploaded after deleting files
6
- $( '.rwmb-images' ).on( 'click', '.rwmb-delete-file', function ()
7
- {
8
- // Check if we need to show drop target
9
- var $dragndrop = $( this ).parents( '.rwmb-images' ).siblings( '.rwmb-drag-drop' );
10
-
11
- // After delete files, show the Drag & Drop section
12
- $dragndrop.removeClass( 'hidden' );
13
- } );
14
-
15
- $( '.rwmb-drag-drop' ).each( function ()
16
- {
17
- // Declare vars
18
- var $dropArea = $( this ),
19
- $imageList = $dropArea.siblings( '.rwmb-uploaded' ),
20
- uploaderData = $dropArea.data( 'js_options' ),
21
- uploader = {};
22
-
23
- // Extend uploaderData
24
- uploaderData.multipart_params = $.extend(
25
- {
26
- _ajax_nonce: $dropArea.data( 'upload_nonce' ),
27
- post_id : $( '#post_ID' ).val()
28
- },
29
- uploaderData.multipart_params
30
- );
31
-
32
- // Create uploader
33
- uploader = new plupload.Uploader( uploaderData );
34
- uploader.init();
35
-
36
- // Add files
37
- uploader.bind( 'FilesAdded', function ( up, files )
38
- {
39
- var maxFileUploads = $imageList.data( 'max_file_uploads' ),
40
- uploaded = $imageList.children().length,
41
- msg = maxFileUploads > 1 ? rwmbFile.maxFileUploadsPlural : rwmbFile.maxFileUploadsSingle;
42
-
43
- msg = msg.replace( '%d', maxFileUploads );
44
-
45
- // Remove files from queue if exceed max file uploads
46
- if ( maxFileUploads > 0 && ( uploaded + files.length ) > maxFileUploads )
47
- {
48
- if ( uploaded < maxFileUploads )
49
- {
50
- var diff = maxFileUploads - uploaded;
51
- up.splice( diff - 1, files.length - diff );
52
- files = up.files;
53
- }
54
- alert( msg );
55
- }
56
-
57
- // Hide drag & drop section if reach max file uploads
58
- if ( maxFileUploads > 0 && uploaded + files.length >= maxFileUploads )
59
- {
60
- $dropArea.addClass( 'hidden' );
61
- }
62
-
63
- var max = parseInt( up.settings.max_file_size, 10 );
64
-
65
- // Upload files
66
- plupload.each( files, function ( file )
67
- {
68
- addLoading( up, file, $imageList );
69
- addThrobber( file );
70
- if ( file.size >= max )
71
- {
72
- removeError( file );
73
- }
74
- } );
75
- up.refresh();
76
- up.start();
77
-
78
- } );
79
-
80
- uploader.bind( 'Error', function ( up, e )
81
- {
82
- addLoading( up, e.file, $imageList );
83
- removeError( e.file );
84
- up.removeFile( e.file );
85
- } );
86
-
87
- uploader.bind( 'FileUploaded', function ( up, file, r )
88
- {
89
- r = $.parseJSON( r.response );
90
- if ( r.success )
91
- {
92
- $( 'li#' + file.id ).replaceWith( r.data );
93
- }
94
- else
95
- {
96
- removeError( file );
97
- }
98
- } );
99
- } );
100
-
101
- /**
102
- * Helper functions
103
- */
104
-
105
- /**
106
- * Removes li element if there is an error with the file
107
- *
108
- * @return void
109
- */
110
- function removeError( file )
111
- {
112
- $( 'li#' + file.id )
113
- .addClass( 'rwmb-image-error' )
114
- .delay( 1600 )
115
- .fadeOut( 'slow', function ()
116
- {
117
- $( this ).remove();
118
- }
119
- );
120
- }
121
-
122
- /**
123
- * Adds loading li element
124
- *
125
- * @return void
126
- */
127
- function addLoading( up, file, $ul )
128
- {
129
- $ul.removeClass( 'hidden' ).append( '<li id="' + file.id + '"><div class="rwmb-image-uploading-bar"></div><div id="' + file.id + '-throbber" class="rwmb-image-uploading-status"></div></li>' );
130
- }
131
-
132
- /**
133
- * Adds loading throbber while waiting for a response
134
- *
135
- * @return void
136
- */
137
- function addThrobber( file )
138
- {
139
- $( '#' + file.id + '-throbber' ).html( '<img class="rwmb-loader" height="64" width="64" src="' + RWMB.url + '"img/loader.gif">' );
140
- }
141
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/range.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function ( $ ) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * Update color picker element
6
+ * Used for static & dynamic added elements (when clone)
7
+ */
8
+ function update() {
9
+ var $this = $( this ),
10
+ $output = $this.siblings( '.rwmb-output' );
11
+
12
+ $this.on( 'input propertychange change', function ( e ) {
13
+ $output.html( $this.val() );
14
+ } );
15
+
16
+ }
17
+
18
+ $( '.rwmb-range' ).each( update );
19
+ $( document ).on( 'clone', '.rwmb-range', update );
20
+ } );
inc/meta-box/js/script.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ jQuery( function ( $ ) {
2
+ // Add class for seamless meta boxes.
3
+ $( '.rwmb-meta-box--seamless' ).closest( '.postbox' ).addClass( 'rwmb-seamless' );
4
+ } );
inc/meta-box/js/select-advanced.js CHANGED
@@ -1,15 +1,55 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
- function rwmb_update_select_advanced()
6
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  var $this = $( this ),
8
  options = $this.data( 'options' );
 
9
  $this.siblings( '.select2-container' ).remove();
10
- $this.select2( options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  }
12
 
13
- $( ':input.rwmb-select-advanced' ).each( rwmb_update_select_advanced );
14
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-select-advanced', rwmb_update_select_advanced );
15
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
+ /**
5
+ * Reorder selected values in correct order that they were selected.
6
+ * @param $select2 jQuery element of the select2.
7
+ */
8
+ function reorderSelected( $select2 ) {
9
+ var selected = $select2.data( 'selected' );
10
+ if ( ! selected ) {
11
+ return;
12
+ }
13
+ selected.forEach( function ( value ) {
14
+ var option = $select2.children( '[value="' + value + '"]' );
15
+ option.detach();
16
+ $select2.append( option );
17
+ } );
18
+ $select2.trigger( 'change' );
19
+ }
20
+
21
+ /**
22
+ * Turn select field into beautiful dropdown with select2 library
23
+ * This function is called when document ready and when clone button is clicked (to update the new cloned field)
24
+ *
25
+ * @return void
26
+ */
27
+ function update() {
28
  var $this = $( this ),
29
  options = $this.data( 'options' );
30
+ $this.removeClass( 'select2-hidden-accessible' );
31
  $this.siblings( '.select2-container' ).remove();
32
+ $this.show().select2( options );
33
+
34
+ rwmbSelect.bindEvents( $this );
35
+
36
+ if ( ! $this.attr( 'multiple' ) ) {
37
+ return;
38
+ }
39
+
40
+ reorderSelected( $this );
41
+
42
+ /**
43
+ * Preserve the order that options are selected.
44
+ * @see https://github.com/select2/select2/issues/3106#issuecomment-255492815
45
+ */
46
+ $this.on( 'select2:select', function ( event ) {
47
+ var option = $this.children( '[value="' + event.params.data.id + '"]' );
48
+ option.detach();
49
+ $this.append( option ).trigger( 'change' );
50
+ } );
51
  }
52
 
53
+ $( '.rwmb-select_advanced' ).each( update );
54
+ $( document ).on( 'clone', '.rwmb-select_advanced', update );
55
  } );
inc/meta-box/js/select-tree.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function ( $ ) {
2
+ 'use strict';
3
+
4
+ function update() {
5
+ var $this = $( this ),
6
+ val = $this.val(),
7
+ $selected = $this.siblings( "[data-parent-id='" + val + "']" ),
8
+ $notSelected = $this.parent().find( '.rwmb-select-tree' ).not( $selected );
9
+
10
+ $selected.removeClass( 'hidden' );
11
+ $notSelected
12
+ .addClass( 'hidden' )
13
+ .find( 'select' )
14
+ .prop( 'selectedIndex', 0 );
15
+ }
16
+
17
+ $( '.rwmb-input' )
18
+ .on( 'change', '.rwmb-select-tree select', update )
19
+ .on( 'clone', '.rwmb-select-tree select', update );
20
+ } );
inc/meta-box/js/select.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function ( $ ) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * Object stores all necessary methods for select All/None actions
6
+ * Assign to global variable so we can access to this object from select advanced field
7
+ */
8
+ var select = {
9
+ /**
10
+ * Select all/none for select tag
11
+ * @param event Click event.
12
+ */
13
+ selectAllNone: function ( event ) {
14
+ event.preventDefault();
15
+ var $this = $( this ),
16
+ $element = $this.parent().siblings( 'select' );
17
+
18
+ if ( 'none' === $this.data( 'type' ) ) {
19
+ $element.val( [] ).trigger( 'change' );
20
+ return;
21
+ }
22
+ var selected = [];
23
+ $element.find( 'option' ).each( function ( index, option ) {
24
+ selected.push( option.value );
25
+ } );
26
+ $element.val( selected ).trigger( 'change' );
27
+ },
28
+
29
+ /**
30
+ * Add event listener for select all/none links when click
31
+ * @param $el jQuery select element
32
+ */
33
+ bindEvents: function ( $el ) {
34
+ $el.closest( '.rwmb-input' ).on( 'click', '.rwmb-select-all-none a', select.selectAllNone );
35
+ }
36
+ };
37
+
38
+ /**
39
+ * Update select field when clicking clone button
40
+ */
41
+ function update() {
42
+ select.bindEvents( $( this ) );
43
+ }
44
+
45
+ // Run for select field.
46
+ $( '.rwmb-select' ).each( update );
47
+ $( document ).on( 'clone', '.rwmb-select', update );
48
+
49
+ // Export to use for select_advanced.
50
+ window.rwmbSelect = select;
51
+ } );
inc/meta-box/js/select2/i18n/ar.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="الرجاء حذف "+t+" عناصر";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="الرجاء إضافة "+t+" عناصر";return n},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){var t="تستطيع إختيار "+e.maximum+" بنود فقط";return t},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/az.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/bg.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/ca.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/cs.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/da.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Angiv venligst "+t+" tegn mindre";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Angiv venligst "+t+" tegn mere";return n},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/de.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/en.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/es.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/et.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/eu.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/fa.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/fi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/fr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/gl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Elimine ";return t===1?n+="un carácter":n+=t+" caracteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Engada ";return t===1?n+="un carácter":n+=t+" caracteres",n},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){var t="Só pode ";return e.maximum===1?t+="un elemento":t+=e.maximum+" elementos",t},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/he.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/hi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/hr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/hu.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/id.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/is.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/it.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/ja.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/ko.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/lt.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%100>9&&e%100<21||e%10===0?e%10>1?n:r:t}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"ių","ius","į"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"ių","ius","į"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ų","us","ą"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/lv.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/mk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/ms.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/nb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=" flere tegn":n+=" tegn til",n},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/nl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/pl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/pt-BR.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/pt.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"carácter",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/ro.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+"sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/ru.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/sk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/sr-Cyrl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/sr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/sv.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/th.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/tr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/uk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/vi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+' ký tự"';return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/zh-CN.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/i18n/zh-TW.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
inc/meta-box/js/select2/select2.min.js CHANGED
@@ -1,82 +1,2 @@
1
- /*
2
- Copyright 2012 Igor Vaynberg
3
-
4
- Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in
7
- compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software distributed under the License is
12
- distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and limitations under the License.
14
- */
15
- (function(e){"undefined"==typeof e.fn.each2&&e.fn.extend({each2:function(g){for(var i=e([0]),m=-1,s=this.length;++m<s&&(i.context=i[0]=this[m])&&!1!==g.call(i[0],m,i););return this}})})(jQuery);
16
- (function(e,g){function i(a,b){var c=0,d=b.length,j;if("undefined"===typeof a)return-1;if(a.constructor===String)for(;c<d;c+=1){if(0===a.localeCompare(b[c]))return c}else for(;c<d;c+=1)if(j=b[c],j.constructor===String){if(0===j.localeCompare(a))return c}else if(j===a)return c;return-1}function m(a,b){return a===b?!0:a===g||b===g||null===a||null===b?!1:a.constructor===String?0===a.localeCompare(b):b.constructor===String?0===b.localeCompare(a):!1}function s(a,b){var c,d,j;if(null===a||1>a.length)return[];
17
- c=a.split(b);d=0;for(j=c.length;d<j;d+=1)c[d]=e.trim(c[d]);return c}function A(a,b,c){var c=c||g,d;return function(){var j=arguments;window.clearTimeout(d);d=window.setTimeout(function(){b.apply(c,j)},a)}}function l(a){a.preventDefault();a.stopPropagation()}function B(a,b,c){var d=a.toUpperCase().indexOf(b.toUpperCase()),b=b.length;0>d?c.push(a):(c.push(a.substring(0,d)),c.push("<span class='select2-match'>"),c.push(a.substring(d,d+b)),c.push("</span>"),c.push(a.substring(d+b,a.length)))}function C(a){var b,
18
- c=0,d=null,j=a.quietMillis||100;return function(h){window.clearTimeout(b);b=window.setTimeout(function(){var b=c+=1,j=a.data,n=a.transport||e.ajax,f=a.traditional||!1,g=a.type||"GET",j=j.call(this,h.term,h.page,h.context);null!==d&&d.abort();d=n.call(null,{url:a.url,dataType:a.dataType,data:j,type:g,traditional:f,success:function(d){b<c||(d=a.results(d,h.page),h.callback(d))}})},j)}}function D(a){var b=a,c,d=function(a){return""+a.text};e.isArray(b)||(d=b.text,e.isFunction(d)||(c=b.text,d=function(a){return a[c]}),
19
- b=b.results);return function(a){var c=a.term,f={results:[]},k;if(c==="")a.callback({results:b});else{k=function(b,f){var g,t,b=b[0];if(b.children){g={};for(t in b)b.hasOwnProperty(t)&&(g[t]=b[t]);g.children=[];e(b.children).each2(function(a,b){k(b,g.children)});g.children.length&&f.push(g)}else a.matcher(c,d(b))&&f.push(b)};e(b).each2(function(a,b){k(b,f.results)});a.callback(f)}}}function E(a){return e.isFunction(a)?a:function(b){var c=b.term,d={results:[]};e(a).each(function(){var a=this.text!==
20
- g,e=a?this.text:this;if(""===c||b.matcher(c,e))d.results.push(a?this:{id:this,text:this})});b.callback(d)}}function u(a){if(e.isFunction(a))return!0;if(!a)return!1;throw Error("formatterName must be a function or a falsy value");}function v(a){return e.isFunction(a)?a():a}function F(a){var b=0;e.each(a,function(a,d){d.children?b+=F(d.children):b++});return b}function H(a,b,c,d){var e=a,h=!1,f,k,n,o;if(!d.createSearchChoice||!d.tokenSeparators||1>d.tokenSeparators.length)return g;for(;;){h=-1;k=0;
21
- for(n=d.tokenSeparators.length;k<n&&!(o=d.tokenSeparators[k],h=a.indexOf(o),0<=h);k++);if(0>h)break;f=a.substring(0,h);a=a.substring(h+o.length);if(0<f.length&&(f=d.createSearchChoice(f,b),f!==g&&null!==f&&d.id(f)!==g&&null!==d.id(f))){h=!1;k=0;for(n=b.length;k<n;k++)if(m(d.id(f),d.id(b[k]))){h=!0;break}h||c(f)}}if(0!=e.localeCompare(a))return a}function x(a,b){var c=function(){};c.prototype=new a;c.prototype.constructor=c;c.prototype.parent=a.prototype;c.prototype=e.extend(c.prototype,b);return c}
22
- if(window.Select2===g){var f,w,y,z,G,q;f={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){a=a.which?a.which:a;switch(a){case f.LEFT:case f.RIGHT:case f.UP:case f.DOWN:return!0}return!1},isControl:function(a){switch(a.which){case f.SHIFT:case f.CTRL:case f.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){a=a.which?a.which:a;return 112<=a&&123>=a}};var I=1;G=function(){return I++};
23
- e(document).delegate("body","mousemove",function(a){e.data(document,"select2-lastpos",{x:a.pageX,y:a.pageY})});e(document).ready(function(){e(document).delegate("body","mousedown touchend",function(a){var b=e(a.target).closest("div.select2-container").get(0),c;b?e(document).find("div.select2-container-active").each(function(){this!==b&&e(this).data("select2").blur()}):(b=e(a.target).closest("div.select2-drop").get(0),e(document).find("div.select2-drop-active").each(function(){this!==b&&e(this).data("select2").blur()}));
24
- b=e(a.target);c=b.attr("for");"LABEL"===a.target.tagName&&(c&&0<c.length)&&(b=e("#"+c),b=b.data("select2"),b!==g&&(b.focus(),a.preventDefault()))})});w=x(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(a){var b,c;this.opts=a=this.prepareOpts(a);this.id=a.id;a.element.data("select2")!==g&&null!==a.element.data("select2")&&this.destroy();this.enabled=!0;this.container=this.createContainer();this.containerId="s2id_"+(a.element.attr("id")||"autogen"+G());this.containerSelector=
25
- "#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.container.attr("id",this.containerId);var d=!1,j;this.body=function(){!1===d&&(j=a.element.closest("body"),d=!0);return j};a.element.attr("class")!==g&&this.container.addClass(a.element.attr("class").replace(/validate\[[\S ]+] ?/,""));this.container.css(v(a.containerCss));this.container.addClass(v(a.containerCssClass));this.opts.element.data("select2",this).hide().before(this.container);this.container.data("select2",
26
- this);this.dropdown=this.container.find(".select2-drop");this.dropdown.addClass(v(a.dropdownCssClass));this.dropdown.data("select2",this);this.results=b=this.container.find(".select2-results");this.search=c=this.container.find("input.select2-input");c.attr("tabIndex",this.opts.element.attr("tabIndex"));this.resultsPage=0;this.context=null;this.initContainer();this.initContainerWidth();this.results.bind("mousemove",function(a){var b=e.data(document,"select2-lastpos");(b===g||b.x!==a.pageX||b.y!==a.pageY)&&
27
- e(a.target).trigger("mousemove-filtered",a)});this.dropdown.delegate(".select2-results","mousemove-filtered",this.bind(this.highlightUnderEvent));var h=this.results,f=A(80,function(a){h.trigger("scroll-debounced",a)});h.bind("scroll",function(a){0<=i(a.target,h.get())&&f(a)});this.dropdown.delegate(".select2-results","scroll-debounced",this.bind(this.loadMoreIfNeeded));e.fn.mousewheel&&b.mousewheel(function(a,c,d,e){c=b.scrollTop();0<e&&0>=c-e?(b.scrollTop(0),l(a)):0>e&&b.get(0).scrollHeight-b.scrollTop()+
28
- e<=b.height()&&(b.scrollTop(b.get(0).scrollHeight-b.height()),l(a))});c.bind("keydown",function(){e.data(c,"keyup-change-value")===g&&e.data(c,"keyup-change-value",c.val())});c.bind("keyup",function(){var a=e.data(c,"keyup-change-value");a!==g&&c.val()!==a&&(e.removeData(c,"keyup-change-value"),c.trigger("keyup-change"))});c.bind("keyup-change",this.bind(this.updateResults));c.bind("focus",function(){c.addClass("select2-focused");" "===c.val()&&c.val("")});c.bind("blur",function(){c.removeClass("select2-focused")});
29
- this.dropdown.delegate(".select2-results","mouseup",this.bind(function(a){0<e(a.target).closest(".select2-result-selectable:not(.select2-disabled)").length?(this.highlightUnderEvent(a),this.selectHighlighted(a)):this.focusSearch();l(a)}));this.dropdown.bind("click mouseup mousedown",function(a){a.stopPropagation()});e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource());(a.element.is(":disabled")||a.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var a=
30
- this.opts.element.data("select2");a!==g&&(a.container.remove(),a.dropdown.remove(),a.opts.element.removeData("select2").unbind(".select2").show())},prepareOpts:function(a){var b,c,d;b=a.element;"select"===b.get(0).tagName.toLowerCase()&&(this.select=c=a.element);c&&e.each("id multiple ajax query createSearchChoice initSelection data tags".split(" "),function(){if(this in a)throw Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.");});a=e.extend({},{populateResults:function(b,
31
- c,d){var f,n=this.opts.id,o=this;f=function(b,c,j){var h,l,i,m,r,p,q;h=0;for(l=b.length;h<l;h=h+1){i=b[h];m=n(i)!==g;r=i.children&&i.children.length>0;p=e("<li></li>");p.addClass("select2-results-dept-"+j);p.addClass("select2-result");p.addClass(m?"select2-result-selectable":"select2-result-unselectable");r&&p.addClass("select2-result-with-children");p.addClass(o.opts.formatResultCssClass(i));m=e("<div></div>");m.addClass("select2-result-label");q=a.formatResult(i,m,d);q!==g&&m.html(o.opts.escapeMarkup(q));
32
- p.append(m);if(r){r=e("<ul></ul>");r.addClass("select2-result-sub");f(i.children,r,j+1);p.append(r)}p.data("select2-data",i);c.append(p)}};f(c,b,0)}},e.fn.select2.defaults,a);"function"!==typeof a.id&&(d=a.id,a.id=function(a){return a[d]});if(c)a.query=this.bind(function(a){var c={results:[],more:false},d=a.term,f,n,o;o=function(b,c){var e;if(b.is("option"))a.matcher(d,b.text(),b)&&c.push({id:b.attr("value"),text:b.text(),element:b.get(),css:b.attr("class")});else if(b.is("optgroup")){e={text:b.attr("label"),
33
- children:[],element:b.get(),css:b.attr("class")};b.children().each2(function(a,b){o(b,e.children)});e.children.length>0&&c.push(e)}};f=b.children();if(this.getPlaceholder()!==g&&f.length>0){n=f[0];e(n).text()===""&&(f=f.not(n))}f.each2(function(a,b){o(b,c.results)});a.callback(c)}),a.id=function(a){return a.id},a.formatResultCssClass=function(a){return a.css};else if(!("query"in a))if("ajax"in a){if((c=a.element.data("ajax-url"))&&0<c.length)a.ajax.url=c;a.query=C(a.ajax)}else"data"in a?a.query=D(a.data):
34
- "tags"in a&&(a.query=E(a.tags),a.createSearchChoice=function(a){return{id:a,text:a}},a.initSelection=function(b,c){var d=[];e(s(b.val(),a.separator)).each(function(){var b=this,c=this,j=a.tags;e.isFunction(j)&&(j=j());e(j).each(function(){if(m(this.id,b)){c=this.text;return false}});d.push({id:b,text:c})});c(d)});if("function"!==typeof a.query)throw"query function not defined for Select2 "+a.element.attr("id");return a},monitorSource:function(){this.opts.element.bind("change.select2",this.bind(function(){!0!==
35
- this.opts.element.data("select2-change-triggered")&&this.initSelection()}))},triggerChange:function(a){a=a||{};a=e.extend({},a,{type:"change",val:this.val()});this.opts.element.data("select2-change-triggered",!0);this.opts.element.trigger(a);this.opts.element.data("select2-change-triggered",!1);this.opts.element.click();this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){this.enabled||(this.enabled=!0,this.container.removeClass("select2-container-disabled"))},disable:function(){this.enabled&&
36
- (this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"))},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var a=this.container.offset(),b=this.container.outerHeight(),c=this.container.outerWidth(),d=this.dropdown.outerHeight(),j=e(window).scrollTop()+document.documentElement.clientHeight,b=a.top+b,f=a.left,j=b+d<=j,g=a.top-d>=this.body().scrollTop(),k=this.dropdown.hasClass("select2-drop-above"),n;"static"!==this.body().css("position")&&
37
- (n=this.body().offset(),b-=n.top,f-=n.left);k?(k=!0,!g&&j&&(k=!1)):(k=!1,!j&&g&&(k=!0));k?(b=a.top-d,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above"));a=e.extend({top:b,left:f,width:c},v(this.opts.dropdownCss));this.dropdown.css(a)},shouldOpen:function(){var a;if(this.opened())return!1;a=e.Event("open");this.opts.element.trigger(a);return!a.isDefaultPrevented()},
38
- clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){if(!this.shouldOpen())return!1;window.setTimeout(this.bind(this.opening),1);return!0},opening:function(){var a=this.containerId,b=this.containerSelector,c="scroll."+a,d="resize."+a;this.container.parents().each(function(){e(this).bind(c,function(){var a=e(b);0==a.length&&e(this).unbind(c);a.select2("close")})});e(window).bind(d,function(){var a=
39
- e(b);0==a.length&&e(window).unbind(d);a.select2("close")});this.clearDropdownAlignmentPreference();" "===this.search.val()&&this.search.val("");this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.updateResults(!0);this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body());this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");this.ensureHighlightVisible();this.focusSearch()},close:function(){if(this.opened()){var a=
40
- this;this.container.parents().each(function(){e(this).unbind("scroll."+a.containerId)});e(window).unbind("resize."+this.containerId);this.clearDropdownAlignmentPreference();this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();this.clearSearch();this.opts.element.trigger(e.Event("close"))}},clearSearch:function(){},ensureHighlightVisible:function(){var a=this.results,b,c,d,f;c=this.highlight();0>c||(0==c?a.scrollTop(0):
41
- (b=a.find(".select2-result-selectable"),d=e(b[c]),f=d.offset().top+d.outerHeight(),c===b.length-1&&(b=a.find("li.select2-more-results"),0<b.length&&(f=b.offset().top+b.outerHeight())),b=a.offset().top+a.outerHeight(),f>b&&a.scrollTop(a.scrollTop()+(f-b)),d=d.offset().top-a.offset().top,0>d&&a.scrollTop(a.scrollTop()+d)))},moveHighlight:function(a){for(var b=this.results.find(".select2-result-selectable"),c=this.highlight();-1<c&&c<b.length;){var c=c+a,d=e(b[c]);if(d.hasClass("select2-result-selectable")&&
42
- !d.hasClass("select2-disabled")){this.highlight(c);break}}},highlight:function(a){var b=this.results.find(".select2-result-selectable").not(".select2-disabled");if(0===arguments.length)return i(b.filter(".select2-highlighted")[0],b.get());a>=b.length&&(a=b.length-1);0>a&&(a=0);b.removeClass("select2-highlighted");e(b[a]).addClass("select2-highlighted");this.ensureHighlightVisible()},countSelectableResults:function(){return this.results.find(".select2-result-selectable").not(".select2-disabled").length},
43
- highlightUnderEvent:function(a){a=e(a.target).closest(".select2-result-selectable");if(0<a.length&&!a.is(".select2-highlighted")){var b=this.results.find(".select2-result-selectable");this.highlight(b.index(a))}else 0==a.length&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var a=this.results,b=a.find("li.select2-more-results"),c,d=this.resultsPage+1,e=this,f=this.search.val(),g=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-
44
- a.height(),0>=c&&(b.addClass("select2-active"),this.opts.query({term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:f,page:d,context:g}),!0===c.more?(b.detach().appendTo(a).text(e.opts.formatLoadMore(d+1)),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d)})})))},tokenize:function(){},updateResults:function(a){function b(){f.scrollTop(0);d.removeClass("select2-active");
45
- k.positionDropdown()}function c(a){f.html(k.opts.escapeMarkup(a));b()}var d=this.search,f=this.results,h=this.opts,i,k=this;if(!(!0!==a&&(!1===this.showSearchInput||!this.opened()))){d.addClass("select2-active");if(1<=h.maximumSelectionSize&&(i=this.data(),e.isArray(i)&&i.length>=h.maximumSelectionSize&&u(h.formatSelectionTooBig,"formatSelectionTooBig"))){c("<li class='select2-selection-limit'>"+h.formatSelectionTooBig(h.maximumSelectionSize)+"</li>");return}d.val().length<h.minimumInputLength&&u(h.formatInputTooShort,
46
- "formatInputTooShort")?c("<li class='select2-no-results'>"+h.formatInputTooShort(d.val(),h.minimumInputLength)+"</li>"):(c("<li class='select2-searching'>"+h.formatSearching()+"</li>"),i=this.tokenize(),i!=g&&null!=i&&d.val(i),this.resultsPage=1,h.query({term:d.val(),page:this.resultsPage,context:null,matcher:h.matcher,callback:this.bind(function(i){var l;this.opened()&&((this.context=i.context===g?null:i.context,this.opts.createSearchChoice&&""!==d.val()&&(l=this.opts.createSearchChoice.call(null,
47
- d.val(),i.results),l!==g&&null!==l&&k.id(l)!==g&&null!==k.id(l)&&0===e(i.results).filter(function(){return m(k.id(this),k.id(l))}).length&&i.results.unshift(l)),0===i.results.length&&u(h.formatNoMatches,"formatNoMatches"))?c("<li class='select2-no-results'>"+h.formatNoMatches(d.val())+"</li>"):(f.empty(),k.opts.populateResults.call(this,f,i.results,{term:d.val(),page:this.resultsPage,context:null}),!0===i.more&&u(h.formatLoadMore,"formatLoadMore")&&(f.append("<li class='select2-more-results'>"+k.opts.escapeMarkup(h.formatLoadMore(this.resultsPage))+
48
- "</li>"),window.setTimeout(function(){k.loadMoreIfNeeded()},10)),this.postprocessResults(i,a),b()))})}))}},cancel:function(){this.close()},blur:function(){this.close();this.container.removeClass("select2-container-active");this.dropdown.removeClass("select2-drop-active");this.search[0]===document.activeElement&&this.search.blur();this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){this.search.show();this.search.focus();
49
- window.setTimeout(this.bind(function(){this.search.show();this.search.focus();this.search.val(this.search.val())}),10)},selectHighlighted:function(){var a=this.highlight(),b=this.results.find(".select2-highlighted").not(".select2-disabled"),c=b.closest(".select2-result-selectable").data("select2-data");c&&(b.addClass("select2-disabled"),this.highlight(a),this.onSelect(c))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||
50
- this.opts.placeholder},initContainerWidth:function(){var a=function(){var a,c,d,f;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth()?"auto":this.opts.element.outerWidth()+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){a=this.opts.element.attr("style");if(a!==g){a=a.split(";");d=0;for(f=a.length;d<f;d+=1)if(c=a[d].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/),null!==c&&1<=c.length)return c[1]}return"resolve"===
51
- this.opts.width?(a=this.opts.element.css("width"),0<a.indexOf("%")?a:0===this.opts.element.outerWidth()?"auto":this.opts.element.outerWidth()+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);null!==a&&this.container.attr("style","width: "+a)}});y=x(w,{createContainer:function(){return e("<div></div>",{"class":"select2-container"}).html(" <a href='#' onclick='return false;' class='select2-choice'> <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr> <div><b></b></div></a> <div class='select2-drop select2-offscreen'> <div class='select2-search'> <input type='text' autocomplete='off' class='select2-input'/> </div> <ul class='select2-results'> </ul></div>")},
52
- opening:function(){this.search.show();this.parent.opening.apply(this,arguments);this.dropdown.removeClass("select2-offscreen")},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show())},focus:function(){this.close();this.selection.focus()},isFocused:function(){return this.selection[0]===document.activeElement},cancel:function(){this.parent.cancel.apply(this,arguments);this.selection.focus()},
53
- initContainer:function(){var a,b=this.dropdown;this.selection=a=this.container.find(".select2-choice");this.search.bind("keydown",this.bind(function(a){if(this.enabled)if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)l(a);else if(this.opened())switch(a.which){case f.UP:case f.DOWN:this.moveHighlight(a.which===f.UP?-1:1);l(a);break;case f.TAB:case f.ENTER:this.selectHighlighted();l(a);break;case f.ESC:this.cancel(a),l(a)}else a.which===f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC||!1===
54
- this.opts.openOnEnter&&a.which===f.ENTER||this.open()}));this.search.bind("focus",this.bind(function(){this.selection.attr("tabIndex","-1")}));this.search.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.selection.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));a.bind("mousedown",this.bind(function(){this.opened()?(this.close(),this.selection.focus()):this.enabled&&this.open()}));b.bind("mousedown",
55
- this.bind(function(){this.search.focus()}));a.bind("focus",this.bind(function(){this.container.addClass("select2-container-active");this.search.attr("tabIndex","-1")}));a.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.search.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));a.bind("keydown",this.bind(function(a){if(this.enabled)if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)l(a);else if(!(a.which===
56
- f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC)&&!(!1===this.opts.openOnEnter&&a.which===f.ENTER))if(a.which==f.DELETE)this.opts.allowClear&&this.clear();else{this.open();if(a.which!==f.ENTER&&!(48>a.which)){var b=String.fromCharCode(a.which).toLowerCase();a.shiftKey&&(b=b.toUpperCase());this.search.focus();this.search.val(b)}l(a)}}));a.delegate("abbr","mousedown",this.bind(function(a){this.enabled&&(this.clear(),l(a),this.close(),this.triggerChange(),this.selection.focus())}));this.setPlaceholder();
57
- this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")}))},clear:function(){this.opts.element.val("");this.selection.find("span").empty();this.selection.removeData("select2-data");this.setPlaceholder()},initSelection:function(){if(""===this.opts.element.val())this.close(),this.setPlaceholder();else{var a=this;this.opts.initSelection.call(null,this.opts.element,function(b){b!==g&&null!==b&&(a.updateSelection(b),a.close(),a.setPlaceholder())})}},prepareOpts:function(){var a=
58
- this.parent.prepareOpts.apply(this,arguments);"select"===a.element.get(0).tagName.toLowerCase()&&(a.initSelection=function(a,c){var d=a.find(":selected");e.isFunction(c)&&c({id:d.attr("value"),text:d.text()})});return a},setPlaceholder:function(){var a=this.getPlaceholder();""===this.opts.element.val()&&a!==g&&!(this.select&&""!==this.select.find("option:first").text())&&(this.selection.find("span").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide())},
59
- postprocessResults:function(a,b){var c=0,d=this,f=!0;this.results.find(".select2-result-selectable").each2(function(a,b){if(m(d.id(b.data("select2-data")),d.opts.element.val()))return c=a,!1});this.highlight(c);!0===b&&(f=this.showSearchInput=F(a.results)>=this.opts.minimumResultsForSearch,this.dropdown.find(".select2-search")[f?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[f?"addClass":"removeClass"]("select2-with-searchbox"))},onSelect:function(a){var b=this.opts.element.val();
60
- this.opts.element.val(this.id(a));this.updateSelection(a);this.close();this.selection.focus();m(b,this.id(a))||this.triggerChange()},updateSelection:function(a){var b=this.selection.find("span");this.selection.data("select2-data",a);b.empty();a=this.opts.formatSelection(a,b);a!==g&&b.append(this.opts.escapeMarkup(a));this.selection.removeClass("select2-default");this.opts.allowClear&&this.getPlaceholder()!==g&&this.selection.find("abbr").show()},val:function(){var a,b=null,c=this;if(0===arguments.length)return this.opts.element.val();
61
- a=arguments[0];if(this.select)this.select.val(a).find(":selected").each2(function(a,c){b={id:c.attr("value"),text:c.text()};return!1}),this.updateSelection(b),this.setPlaceholder();else{if(this.opts.initSelection===g)throw Error("cannot call val() if initSelection() is not defined");a?(this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){c.opts.element.val(!a?"":c.id(a));c.updateSelection(a);c.setPlaceholder()})):this.clear()}},clearSearch:function(){this.search.val("")},
62
- data:function(a){var b;if(0===arguments.length)return b=this.selection.data("select2-data"),b==g&&(b=null),b;!a||""===a?this.clear():(this.opts.element.val(!a?"":this.id(a)),this.updateSelection(a))}});z=x(w,{createContainer:function(){return e("<div></div>",{"class":"select2-container select2-container-multi"}).html(" <ul class='select2-choices'> <li class='select2-search-field'> <input type='text' autocomplete='off' class='select2-input'> </li></ul><div class='select2-drop select2-drop-multi' style='display:none;'> <ul class='select2-results'> </ul></div>")},
63
- prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments);"select"===a.element.get(0).tagName.toLowerCase()&&(a.initSelection=function(a,c){var d=[];a.find(":selected").each2(function(a,b){d.push({id:b.attr("value"),text:b.text()})});e.isFunction(c)&&c(d)});return a},initContainer:function(){var a;this.searchContainer=this.container.find(".select2-search-field");this.selection=a=this.container.find(".select2-choices");this.search.bind("keydown",this.bind(function(b){if(this.enabled){if(b.which===
64
- f.BACKSPACE&&""===this.search.val()){this.close();var c;c=a.find(".select2-search-choice-focus");if(0<c.length){this.unselect(c.first());this.search.width(10);l(b);return}c=a.find(".select2-search-choice");0<c.length&&c.last().addClass("select2-search-choice-focus")}else a.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(b.which){case f.UP:case f.DOWN:this.moveHighlight(b.which===f.UP?-1:1);l(b);return;case f.ENTER:case f.TAB:this.selectHighlighted();
65
- l(b);return;case f.ESC:this.cancel(b);l(b);return}if(!(b.which===f.TAB||f.isControl(b)||f.isFunctionKey(b)||b.which===f.BACKSPACE||b.which===f.ESC)&&!(!1===this.opts.openOnEnter&&b.which===f.ENTER))this.open(),(b.which===f.PAGE_UP||b.which===f.PAGE_DOWN)&&l(b)}}));this.search.bind("keyup",this.bind(this.resizeSearch));this.search.bind("blur",this.bind(function(a){this.container.removeClass("select2-container-active");this.search.removeClass("select2-focused");this.clearSearch();a.stopImmediatePropagation()}));
66
- this.container.delegate(".select2-choices","mousedown",this.bind(function(a){this.enabled&&!(0<e(a.target).closest(".select2-search-choice").length)&&(this.clearPlaceholder(),this.open(),this.focusSearch(),a.preventDefault())}));this.container.delegate(".select2-choices","focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())}));this.clearSearch()},enable:function(){this.enabled||(this.parent.enable.apply(this,
67
- arguments),this.search.removeAttr("disabled"))},disable:function(){this.enabled&&(this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0))},initSelection:function(){""===this.opts.element.val()&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||""!==this.opts.element.val()){var a=this;this.opts.initSelection.call(null,this.opts.element,function(b){if(b!==g&&b!==null){a.updateSelection(b);a.close();a.clearSearch()}})}},clearSearch:function(){var a=this.getPlaceholder();
68
- a!==g&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(a).addClass("select2-default"),this.resizeSearch()):this.search.val(" ").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")?this.search.val("").removeClass("select2-default"):" "===this.search.val()&&this.search.val("")},opening:function(){this.parent.opening.apply(this,arguments);this.clearPlaceholder();this.resizeSearch();this.focusSearch()},close:function(){this.opened()&&
69
- this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(a){var b=[],c=[],d=this;e(a).each(function(){0>i(d.id(this),b)&&(b.push(d.id(this)),c.push(this))});a=c;this.selection.find(".select2-search-choice").remove();e(a).each(function(){d.addSelectedChoice(this)});d.postprocessResults()},tokenize:function(){var a=this.search.val(),a=this.opts.tokenizer(a,this.data(),this.bind(this.onSelect),
70
- this.opts);null!=a&&a!=g&&(this.search.val(a),0<a.length&&this.open())},onSelect:function(a){this.addSelectedChoice(a);this.select&&this.postprocessResults();this.opts.closeOnSelect?(this.close(),this.search.width(10)):0<this.countSelectableResults()?(this.search.width(10),this.resizeSearch(),this.positionDropdown()):this.close();this.triggerChange({added:a});this.focusSearch()},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(a){var b=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),
71
- c=this.id(a),d=this.getVal(),f;f=this.opts.formatSelection(a,b);b.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>");b.find(".select2-search-choice-close").bind("mousedown",l).bind("click dblclick",this.bind(function(a){this.enabled&&(e(a.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(a.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");this.close();this.focusSearch()})).dequeue(),
72
- l(a))})).bind("focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))}));b.data("select2-data",a);b.insertBefore(this.searchContainer);d.push(c);this.setVal(d)},unselect:function(a){var b=this.getVal(),c,d,a=a.closest(".select2-search-choice");if(0===a.length)throw"Invalid argument: "+a+". Must be .select2-search-choice";c=a.data("select2-data");d=i(this.id(c),b);0<=d&&(b.splice(d,1),this.setVal(b),this.select&&
73
- this.postprocessResults());a.remove();this.triggerChange({removed:c})},postprocessResults:function(){var a=this.getVal(),b=this.results.find(".select2-result-selectable"),c=this.results.find(".select2-result-with-children"),d=this;b.each2(function(b,c){var e=d.id(c.data("select2-data"));0<=i(e,a)?c.addClass("select2-disabled").removeClass("select2-result-selectable"):c.removeClass("select2-disabled").addClass("select2-result-selectable")});c.each2(function(a,b){0==b.find(".select2-result-selectable").length?
74
- b.addClass("select2-disabled"):b.removeClass("select2-disabled")});b.each2(function(a,b){if(!b.hasClass("select2-disabled")&&b.hasClass("select2-result-selectable"))return d.highlight(0),!1})},resizeSearch:function(){var a,b,c,d,f=this.search.outerWidth()-this.search.width();a=this.search;q||(c=a[0].currentStyle||window.getComputedStyle(a[0],null),q=e("<div></div>").css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,
75
- fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),e("body").append(q));q.text(a.val());a=q.width()+10;b=this.search.offset().left;c=this.selection.width();d=this.selection.offset().left;b=c-(b-d)-f;b<a&&(b=c-f);40>b&&(b=c-f);this.search.width(b)},getVal:function(){var a;if(this.select)return a=this.select.val(),null===a?[]:a;a=this.opts.element.val();return s(a,this.opts.separator)},setVal:function(a){var b;this.select?this.select.val(a):(b=
76
- [],e(a).each(function(){0>i(this,b)&&b.push(this)}),this.opts.element.val(0===b.length?"":b.join(this.opts.separator)))},val:function(){var a,b=[],c=this;if(0===arguments.length)return this.getVal();if(a=arguments[0])if(this.setVal(a),this.select)this.select.find(":selected").each(function(){b.push({id:e(this).attr("value"),text:e(this).text()})}),this.updateSelection(b);else{if(this.opts.initSelection===g)throw Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,
77
- function(a){var b=e(a).map(c.id);c.setVal(b);c.updateSelection(a);c.clearSearch()})}else this.opts.element.val(""),this.updateSelection([]);this.clearSearch()},onSortStart:function(){if(this.select)throw Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var a=[],b=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();
78
- this.selection.find(".select2-search-choice").each(function(){a.push(b.opts.id(e(this).data("select2-data")))});this.setVal(a);this.triggerChange()},data:function(a){var b=this,c;if(0===arguments.length)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();a||(a=[]);c=e.map(a,function(a){return b.opts.id(a)});this.setVal(c);this.updateSelection(a);this.clearSearch()}});e.fn.select2=function(){var a=Array.prototype.slice.call(arguments,0),b,
79
- c,d,f,h="val destroy opened open close focus isFocused container onSortStart onSortEnd enable disable positionDropdown data".split(" ");this.each(function(){if(0===a.length||"object"===typeof a[0])b=0===a.length?{}:e.extend({},a[0]),b.element=e(this),"select"===b.element.get(0).tagName.toLowerCase()?f=b.element.attr("multiple"):(f=b.multiple||!1,"tags"in b&&(b.multiple=f=!0)),c=f?new z:new y,c.init(b);else if("string"===typeof a[0]){if(0>i(a[0],h))throw"Unknown method: "+a[0];d=g;c=e(this).data("select2");
80
- if(c!==g&&(d="container"===a[0]?c.container:c[a[0]].apply(c,a.slice(1)),d!==g))return!1}else throw"Invalid arguments to select2 plugin: "+a;});return d===g?this:d};e.fn.select2.defaults={width:"copy",closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c){b=[];B(a.text,c.term,b);return b.join("")},formatSelection:function(a){return a?a.text:g},formatResultCssClass:function(){return g},formatNoMatches:function(){return"No matches found"},
81
- formatInputTooShort:function(a,b){return"Please enter "+(b-a.length)+" more characters"},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumSelectionSize:0,id:function(a){return a.id},matcher:function(a,b){return 0<=b.toUpperCase().indexOf(a.toUpperCase())},separator:",",tokenSeparators:[],tokenizer:H,
82
- escapeMarkup:function(a){return a&&"string"===typeof a?a.replace(/&/g,"&amp;"):a},blurOnChange:!1};window.Select2={query:{ajax:C,local:D,tags:E},util:{debounce:A,markMatch:B},"class":{"abstract":w,single:y,multi:z}}}})(jQuery);
1
+ /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice;this.listeners=this.listeners||{},a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&d.setClasses()}),b.on("unselect",function(){b.isOpen()&&d.setClasses()}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,
2
+ c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(a,b,c){function d(a){e.trigger("select",{data:a})}var e=this;b.term=b.term||"";var f=this.tokenizer(b,this.options,d);f.term!==b.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),b.term=f.term),a.call(this,b,c)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(){d._handleSelectOnClose()})},a.prototype._handleSelectOnClose=function(){var a=this.getHighlightedResults();if(!(a.length<1)){var b=a.data("data");null!=b.element&&b.element.selected||null==b.element&&b.selected||this.trigger("select",{data:b})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d;return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var e=Array.prototype.slice.call(arguments,1);d=c[b].apply(c,e)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/slider.js CHANGED
@@ -1,32 +1,28 @@
1
- jQuery( function( $ )
2
- {
3
  'use strict';
4
 
5
- function rwmb_update_slider()
6
- {
7
  var $input = $( this ),
8
  $slider = $input.siblings( '.rwmb-slider' ),
9
  $valueLabel = $slider.siblings( '.rwmb-slider-value-label' ).find( 'span' ),
10
  value = $input.val(),
11
  options = $slider.data( 'options' );
12
 
 
13
  $slider.html( '' );
14
 
15
- if ( !value )
16
- {
17
  value = 0;
18
  $input.val( 0 );
19
  $valueLabel.text( '0' );
20
  }
21
- else
22
- {
23
  $valueLabel.text( value );
24
  }
25
 
26
  // Assign field value and callback function when slide
27
  options.value = value;
28
- options.slide = function( event, ui )
29
- {
30
  $input.val( ui.value );
31
  $valueLabel.text( ui.value );
32
  };
@@ -34,6 +30,6 @@ jQuery( function( $ )
34
  $slider.slider( options );
35
  }
36
 
37
- $( ':input.rwmb-slider-value' ).each( rwmb_update_slider );
38
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-slider-value', rwmb_update_slider );
39
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
+ function rwmb_update_slider() {
 
5
  var $input = $( this ),
6
  $slider = $input.siblings( '.rwmb-slider' ),
7
  $valueLabel = $slider.siblings( '.rwmb-slider-value-label' ).find( 'span' ),
8
  value = $input.val(),
9
  options = $slider.data( 'options' );
10
 
11
+
12
  $slider.html( '' );
13
 
14
+ if ( ! value ) {
 
15
  value = 0;
16
  $input.val( 0 );
17
  $valueLabel.text( '0' );
18
  }
19
+ else {
 
20
  $valueLabel.text( value );
21
  }
22
 
23
  // Assign field value and callback function when slide
24
  options.value = value;
25
+ options.slide = function ( event, ui ) {
 
26
  $input.val( ui.value );
27
  $valueLabel.text( ui.value );
28
  };
30
  $slider.slider( options );
31
  }
32
 
33
+ $( '.rwmb-slider-value' ).each( rwmb_update_slider );
34
+ $( document ).on( 'clone', '.rwmb-slider-value', rwmb_update_slider );
35
  } );
inc/meta-box/js/taxonomy.js DELETED
@@ -1,31 +0,0 @@
1
- jQuery( function( $ )
2
- {
3
- 'use strict';
4
-
5
- $( '.rw-taxonomy-tree input:checkbox' ).change( function()
6
- {
7
- var $this = $( this ),
8
- $childList = $this.parent().siblings( '.rw-taxonomy-tree' );
9
- if ( $this.is( ':checked' ) )
10
- {
11
- $childList.removeClass( 'hidden' );
12
- }
13
- else
14
- {
15
- $childList.find( 'input' ).removeAttr( 'checked' );
16
- $childList.addClass( 'hidden' );
17
- }
18
- } );
19
-
20
- $( '.rw-taxonomy-tree select' ).change( function()
21
- {
22
- var $this = $( this ),
23
- $childList = $this.siblings( '.rw-taxonomy-tree' ),
24
- $value = $this.val();
25
- $childList.removeClass( 'active' ).addClass( 'disabled' ).find( 'select' ).each( function()
26
- {
27
- $( this ).val( $( 'options:first', this ).val() ).attr( 'disabled', 'disabled' );
28
- } );
29
- $childList.filter( '.rwmb-taxonomy-' + $value ).removeClass( 'disabled' ).addClass( 'active' ).children( 'select' ).removeAttr( 'disabled' );
30
- } );
31
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/thickbox-image.js DELETED
@@ -1,37 +0,0 @@
1
- jQuery( function ( $ )
2
- {
3
- 'use strict';
4
-
5
- $( 'body' ).on( 'click', '.rwmb-thickbox-upload', function ()
6
- {
7
- var $this = $( this ),
8
- $holder = $this.siblings( '.rwmb-images' ),
9
- post_id = $( '#post_ID' ).val(),
10
- field_id = $this.data( 'field_id' ),
11
- backup = window.send_to_editor;
12
-
13
- window.send_to_editor = function ( html )
14
- {
15
- var $img = $( '<div />' ).append( html ).find( 'img' ),
16
- url = $img.attr( 'src' ),
17
- img_class = $img.attr( 'class' ),
18
- id = parseInt( img_class.replace( /\D/g, '' ), 10 );
19
-
20
- html = '<li id="item_' + id + '">';
21
- html += '<img src="' + url + '">';
22
- html += '<div class="rwmb-image-bar">';
23
- html += '<a class="rwmb-delete-file" href="#" data-attachment_id="' + id + '">×</a>';
24
- html += '</div>';
25
- html += '<input type="hidden" name="' + field_id + '[]" value="' + id + '">';
26
- html += '</li>';
27
-
28
- $holder.append( $( html ) ).removeClass( 'hidden' );
29
-
30
- tb_remove();
31
- window.send_to_editor = backup;
32
- };
33
- tb_show( '', 'media-upload.php?post_id=' + post_id + '&TB_iframe=true' );
34
-
35
- return false;
36
- } );
37
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/meta-box/js/time.js CHANGED
@@ -1,20 +1,41 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
  /**
6
  * Update datetime picker element
7
  * Used for static & dynamic added elements (when clone)
8
  */
9
- function rwmb_update_time_picker()
10
- {
11
  var $this = $( this ),
12
- options = $this.data( 'options' );
 
 
13
 
14
- $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
15
- $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).timepicker( options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
 
18
- $( ':input.rwmb-time' ).each( rwmb_update_time_picker );
19
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-time', rwmb_update_time_picker );
20
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
  /**
5
  * Update datetime picker element
6
  * Used for static & dynamic added elements (when clone)
7
  */
8
+ function update() {
 
9
  var $this = $( this ),
10
+ options = $this.data( 'options' ),
11
+ $inline = $this.siblings( '.rwmb-datetime-inline' ),
12
+ current = $this.val();
13
 
14
+ $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
15
+
16
+ if ( $inline.length ) {
17
+ options.altField = '#' + $this.attr( 'id' );
18
+ $inline
19
+ .removeClass( 'hasDatepicker' )
20
+ .empty()
21
+ .prop( 'id', '' )
22
+ .timepicker( options )
23
+ .timepicker( "setTime", current );
24
+ }
25
+ else {
26
+ $this.removeClass( 'hasDatepicker' ).timepicker( options );
27
+ }
28
+ }
29
+
30
+ // Set language if available
31
+ $.timepicker.setDefaults( $.timepicker.regional[""] );
32
+ if ( $.timepicker.regional.hasOwnProperty( RWMB_Time.locale ) ) {
33
+ $.timepicker.setDefaults( $.timepicker.regional[RWMB_Time.locale] );
34
+ }
35
+ else if ( $.timepicker.regional.hasOwnProperty( RWMB_Time.localeShort ) ) {
36
+ $.timepicker.setDefaults( $.timepicker.regional[RWMB_Time.localeShort] );
37
  }
38
 
39
+ $( '.rwmb-time' ).each( update );
40
+ $( '.rwmb-input' ).on( 'clone', '.rwmb-time', update );
41
  } );
inc/meta-box/js/validate.js CHANGED
@@ -1,26 +1,48 @@
1
- jQuery( function ( $ )
2
- {
3
  'use strict';
4
 
5
- var $form = $( '#post' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- // Required field styling
8
- $.each( rwmb.validationOptions.rules, function ( k, v )
9
- {
10
- if ( v['required'] )
11
- {
12
- $( '#' + k ).parent().siblings( '.rwmb-label' ).addClass( 'required' ).append( '<span>*</span>' );
13
- }
14
- } );
15
 
16
- rwmb.validationOptions.invalidHandler = function ()
17
- {
18
- // Re-enable the submit ( publish/update ) button and hide the ajax indicator
19
- $( '#publish' ).removeClass( 'button-primary-disabled' );
20
- $( '#ajax-loading' ).attr( 'style', '' );
21
- $form.siblings( '#message' ).remove();
22
- $form.before( '<div id="message" class="error"><p>' + rwmb.summaryMessage + '</p></div>' );
23
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
- $form.validate( rwmb.validationOptions );
 
26
  } );
1
+ jQuery( function ( $ ) {
 
2
  'use strict';
3
 
4
+ var rules = {
5
+ invalidHandler: function () {
6
+ // Re-enable the submit ( publish/update ) button and hide the ajax indicator
7
+ $( '#publish' ).removeClass( 'button-primary-disabled' );
8
+ $( '#ajax-loading' ).attr( 'style', '' );
9
+ $form.siblings( '#message' ).remove();
10
+ $form.before( '<div id="message" class="error"><p>' + rwmbValidate.summaryMessage + '</p></div>' );
11
+ },
12
+ ignore: ':not([class|="rwmb"])',
13
+ errorPlacement: function(error, element) {
14
+ error.appendTo( element.closest( '.rwmb-input' ) );
15
+ },
16
+ errorClass: 'rwmb-error',
17
+ errorElement: 'p'
18
+ };
19
 
20
+ // Edit post form.
21
+ var $form = $( '#post, .rwmb-form' );
 
 
 
 
 
 
22
 
23
+ // Edit user form.
24
+ if ( ! $form.length ) {
25
+ $form = $( '#your-profile' );
26
+ }
27
+
28
+ // Edit term form.
29
+ if ( ! $form.length ) {
30
+ $form = $( '#edittag' );
31
+ }
32
+
33
+ // Gather all validation rules.
34
+ $( '.rwmb-validation-rules' ).each( function () {
35
+ var subRules = $( this ).data( 'rules' );
36
+ $.extend( true, rules, subRules );
37
+
38
+ // Required field styling
39
+ $.each( subRules.rules, function ( k, v ) {
40
+ if ( v['required'] ) {
41
+ $( '#' + k ).parent().siblings( '.rwmb-label' ).append( '<span class="rwmb-required">*</span>' );
42
+ }
43
+ } );
44
+ } );
45
 
46
+ // Execute.
47
+ $form.validate( rules );
48
  } );
inc/meta-box/js/video.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ window.rwmb = window.rwmb || {};
2
+
3
+ jQuery( function ( $ )
4
+ {
5
+ 'use strict';
6
+
7
+ var views = rwmb.views = rwmb.views || {},
8
+ MediaField = views.MediaField,
9
+ MediaItem = views.MediaItem,
10
+ MediaList = views.MediaList,
11
+ VideoField;
12
+
13
+ VideoField = views.VideoField = MediaField.extend( {
14
+ createList: function ()
15
+ {
16
+ this.list = new MediaList( {
17
+ controller: this.controller,
18
+ itemView: MediaItem.extend( {
19
+ className: 'rwmb-video-item',
20
+ template : wp.template( 'rwmb-video-item' ),
21
+ render: function()
22
+ {
23
+ var settings = ! _.isUndefined( window._wpmejsSettings ) ? _.clone( _wpmejsSettings ) : {};
24
+ MediaItem.prototype.render.apply( this, arguments );
25
+ this.player = new MediaElementPlayer( this.$( 'video' ).get(0), settings );
26
+ }
27
+ } )
28
+ } );
29
+ }
30
+ } );
31
+
32
+ /**
33
+ * Initialize image fields
34
+ * @return void
35
+ */
36
+ function initVideoField()
37
+ {
38
+ var view = new VideoField( { input: this } );
39
+ //Remove old then add new
40
+ $( this ).siblings( 'div.rwmb-media-view' ).remove();
41
+ $( this ).after( view.el );
42
+ }
43
+ $( '.rwmb-video' ).each( initVideoField );
44
+ $( document )
45
+ .on( 'clone', '.rwmb-video', initVideoField )
46
+ } );
inc/meta-box/js/wp-color-picker-alpha/wp-color-picker-alpha.min.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**!
2
+ * wp-color-picker-alpha
3
+ *
4
+ * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
5
+ * Only run in input and is defined data alpha in true
6
+ *
7
+ * Version: 2.1.2
8
+ * https://github.com/kallookoo/wp-color-picker-alpha
9
+ * Licensed under the GPLv2 license.
10
+ */
11
+ !function(t){var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",r='<div class="wp-picker-holder" />',e='<div class="wp-picker-container" />',i='<input type="button" class="button button-small" />',a=void 0!==wpColorPickerL10n.current;if(a)n='<a tabindex="0" class="wp-color-result" />';else var n='<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',l="<label></label>",s='<span class="screen-reader-text"></span>';Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);return this.error?"":(t.length<6&&(t=("00000"+t).substr(-6)),"#"+t)},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_create:function(){if(t.support.iris){var p=this,c=p.element;if(t.extend(p.options,c.data()),"hue"===p.options.type)return p._createHueOnly();p.close=t.proxy(p.close,p),p.initialValue=c.val(),c.addClass("wp-color-picker"),a?(c.hide().wrap(e),p.wrap=c.parent(),p.toggler=t(n).insertBefore(c).css({backgroundColor:p.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),p.pickerContainer=t(r).insertAfter(c),p.button=t(i).addClass("hidden")):(c.parent("label").length||(c.wrap(l),p.wrappingLabelText=t(s).insertBefore(c).text(wpColorPickerL10n.defaultLabel)),p.wrappingLabel=c.parent(),p.wrappingLabel.wrap(e),p.wrap=p.wrappingLabel.parent(),p.toggler=t(n).insertBefore(p.wrappingLabel).css({backgroundColor:p.initialValue}),p.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),p.pickerContainer=t(r).insertAfter(p.wrappingLabel),p.button=t(i)),p.options.defaultColor?(p.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString),a||p.button.attr("aria-label",wpColorPickerL10n.defaultAriaLabel)):(p.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),a||p.button.attr("aria-label",wpColorPickerL10n.clearAriaLabel)),a?c.wrap('<span class="wp-picker-input-wrap" />').after(p.button):(p.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(p.button),p.inputWrapper=c.closest(".wp-picker-input-wrap")),c.iris({target:p.pickerContainer,hide:p.options.hide,width:p.options.width,mode:p.options.mode,palettes:p.options.palettes,change:function(r,e){p.options.alpha?(p.toggler.css({"background-image":"url("+o+")"}),a?p.toggler.html('<span class="color-alpha" />'):(p.toggler.css({position:"relative"}),0==p.toggler.find("span.color-alpha").length&&p.toggler.append('<span class="color-alpha" />')),p.toggler.find("span.color-alpha").css({width:"30px",height:"24px",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:e.color.toString()})):p.toggler.css({backgroundColor:e.color.toString()}),t.isFunction(p.options.change)&&p.options.change.call(this,r,e)}}),c.val(p.initialValue),p._addListeners(),p.options.hide||p.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),o.toggler.click(function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(r){(""===t(this).val()||o.element.hasClass("iris-error"))&&(o.options.alpha?(a&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r))}),o.button.on("click",function(r){t(this).hasClass("wp-picker-clear")?(o.element.val(""),o.options.alpha?(a&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r)):t(this).hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var o=this,r=o.element,e=t('<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>').appendTo(o.picker.find(".iris-picker-inner")),i={aContainer:e,aSlider:e.find(".iris-slider-offset-alpha")};void 0!==r.data("custom-width")?o.options.customWidth=parseInt(r.data("custom-width"))||0:o.options.customWidth=100,o.options.defaultWidth=r.width(),(o._color._alpha<1||-1!=o._color.toString().indexOf("rgb"))&&r.width(parseInt(o.options.defaultWidth+o.options.customWidth)),t.each(i,function(t,r){o.controls[t]=r}),o.controls.square.css({"margin-right":"0"});var a=o.pic