Strong Testimonials - Version 2.37

Version Description

Download this release

Release Info

Developer machothemes
Plugin Icon 128x128 Strong Testimonials
Version 2.37
Comparing to
See all releases

Code changes from version 2.36 to 2.37

Files changed (514) hide show
  1. admin/about/addons.php +0 -0
  2. admin/about/class-strong-testimonials-about.php +8 -8
  3. admin/about/how-to.php +0 -0
  4. admin/about/links.php +0 -0
  5. admin/about/privacy.php +0 -0
  6. admin/about/whats-new.php +0 -0
  7. admin/admin-notices.php +3 -1
  8. admin/admin.php +0 -0
  9. admin/class-strong-testimonials-admin-category-list.php +0 -0
  10. admin/class-strong-testimonials-admin-list.php +0 -0
  11. admin/class-strong-testimonials-admin-scripts.php +8 -4
  12. admin/class-strong-testimonials-defaults.php +13 -21
  13. admin/class-strong-testimonials-exporter.php +80 -0
  14. admin/class-strong-testimonials-help.php +53 -53
  15. admin/class-strong-testimonials-list-table.php +1011 -946
  16. admin/class-strong-testimonials-page-shortcodes.php +2 -2
  17. admin/class-strong-testimonials-post-editor.php +8 -12
  18. admin/class-strong-testimonials-updater.php +9 -0
  19. admin/class-strong-views-list-table.php +5 -4
  20. admin/class-walker-strong-category-checklist.php +0 -0
  21. admin/class-walker-strong-form-category-checklist.php +0 -0
  22. admin/compat.php +0 -0
  23. admin/css/about.css +0 -0
  24. admin/css/admin-compat.css +0 -0
  25. admin/css/admin-form.css +0 -0
  26. admin/css/fields.css +0 -0
  27. admin/css/form-preview.css +0 -0
  28. admin/css/number-spinner.css +0 -0
  29. admin/css/order.css +0 -0
  30. admin/css/polylang.css +0 -0
  31. admin/css/post-editor.css +0 -0
  32. admin/css/views.css +0 -0
  33. admin/css/wpml.css +0 -0
  34. admin/custom-fields-ajax.php +0 -0
  35. admin/custom-fields.php +132 -112
  36. admin/form-preview.php +0 -0
  37. admin/img/logo-long.svg +0 -0
  38. admin/img/mascot.png +0 -0
  39. admin/img/quotes.png +0 -0
  40. admin/img/screen-options.png +0 -0
  41. admin/img/strong-date.png +0 -0
  42. admin/img/strong-testimonials-badge.png +0 -0
  43. admin/js/addon-licenses.js +0 -0
  44. admin/js/admin-compat.js +0 -0
  45. admin/js/admin-fields.js +6 -5
  46. admin/js/admin-form.js +0 -0
  47. admin/js/admin-global.js +0 -0
  48. admin/js/admin-order.js +0 -0
  49. admin/js/admin.js +0 -106
  50. admin/js/custom-spinner.js +0 -0
  51. admin/js/help.js +0 -0
  52. admin/js/lib/are-you-sure/jquery.are-you-sure.js +0 -0
  53. admin/js/lib/are-you-sure/jquery.are-you-sure.min.js +0 -0
  54. admin/js/lib/autosize/autosize.min.js +0 -0
  55. admin/js/rating-edit.js +0 -0
  56. admin/js/view-category-filter.js +0 -0
  57. admin/js/views.js +0 -0
  58. admin/menu/class-strong-testimonials-menu-fields.php +0 -0
  59. admin/menu/class-strong-testimonials-menu-settings.php +0 -0
  60. admin/menu/class-strong-testimonials-menu-shortcodes.php +0 -0
  61. admin/menu/class-strong-testimonials-menu-views.php +0 -0
  62. admin/menu/class-strong-testimonials-menu.php +0 -0
  63. admin/partials/fields/field-controls.php +1 -1
  64. admin/partials/fields/field-header.php +0 -0
  65. admin/partials/fields/field-label.php +0 -0
  66. admin/partials/fields/field-name.php +0 -0
  67. admin/partials/fields/field-text.php +0 -0
  68. admin/partials/fields/field-type.php +0 -0
  69. admin/partials/templates/form-preview-template.php +0 -0
  70. admin/partials/views/group-compat.php +0 -0
  71. admin/partials/views/group-extra.php +0 -0
  72. admin/partials/views/group-fields.php +0 -0
  73. admin/partials/views/group-form.php +0 -0
  74. admin/partials/views/group-query.php +3 -3
  75. admin/partials/views/group-slideshow.php +0 -0
  76. admin/partials/views/group-style.php +0 -0
  77. admin/partials/views/option-background.php +0 -0
  78. admin/partials/views/option-boilerplate.php +0 -0
  79. admin/partials/views/option-category.php +3 -3
  80. admin/partials/views/option-classes.php +0 -0
  81. admin/partials/views/option-client-section.php +0 -0
  82. admin/partials/views/option-color.php +0 -0
  83. admin/partials/views/option-content.php +3 -1
  84. admin/partials/views/option-divi.php +0 -0
  85. admin/partials/views/option-form-ajax.php +0 -0
  86. admin/partials/views/option-form-category.php +0 -0
  87. admin/partials/views/option-id.php +1 -1
  88. admin/partials/views/option-layout.php +0 -0
  89. admin/partials/views/option-limit.php +3 -3
  90. admin/partials/views/option-order.php +4 -4
  91. admin/partials/views/option-pagination.php +3 -2
  92. admin/partials/views/option-read-more-page.php +13 -12
  93. admin/partials/views/option-select.php +3 -3
  94. admin/partials/views/option-slideshow-behavior.php +1 -1
  95. admin/partials/views/option-slideshow-breakpoints.php +0 -0
  96. admin/partials/views/option-slideshow-navigation.php +0 -0
  97. admin/partials/views/option-slideshow-num.php +0 -0
  98. admin/partials/views/option-slideshow-transition.php +0 -0
  99. admin/partials/views/option-slideshow-type.php +0 -0
  100. admin/partials/views/option-template-list.php +0 -0
  101. admin/partials/views/option-thumbnail.php +0 -0
  102. admin/partials/views/option-title.php +0 -0
  103. admin/partials/views/template-input.php +0 -0
  104. admin/partials/views/template-not-found.php +0 -0
  105. admin/partials/views/template-options.php +0 -0
  106. admin/partials/views/view-mode.php +0 -0
  107. admin/partials/views/view-name.php +0 -0
  108. admin/partials/views/view-shortcode.php +0 -0
  109. admin/scss/_partials/_background.scss +0 -0
  110. admin/scss/_partials/_category-checkboxes.scss +0 -0
  111. admin/scss/_partials/_category-filter.scss +0 -0
  112. admin/scss/_partials/_checkbox-icons.scss +0 -0
  113. admin/scss/_partials/_custom-fields.scss +0 -0
  114. admin/scss/_partials/_elements.scss +0 -0
  115. admin/scss/_partials/_form-table.scss +0 -0
  116. admin/scss/_partials/_help-tab.scss +0 -0
  117. admin/scss/_partials/_inner-table.scss +0 -0
  118. admin/scss/_partials/_inputs.scss +0 -0
  119. admin/scss/_partials/_layout-example-columns.scss +0 -0
  120. admin/scss/_partials/_layout-example-grid.scss +0 -0
  121. admin/scss/_partials/_layout-example-masonry.scss +0 -0
  122. admin/scss/_partials/_layout-examples.scss +0 -0
  123. admin/scss/_partials/_layout.scss +0 -0
  124. admin/scss/_partials/_list-radio-buttons.scss +0 -0
  125. admin/scss/_partials/_misc.scss +0 -0
  126. admin/scss/_partials/_screenshots.scss +0 -0
  127. admin/scss/_partials/_sticky-views.scss +0 -0
  128. admin/scss/_partials/_structure.scss +0 -0
  129. admin/scss/_partials/_template.scss +0 -0
  130. admin/scss/_partials/_view-info.scss +0 -0
  131. admin/scss/about.scss +0 -0
  132. admin/scss/admin-compat.scss +0 -0
  133. admin/scss/number-spinner.scss +0 -0
  134. admin/scss/post-editor.scss +0 -0
  135. admin/scss/views.scss +0 -0
  136. admin/settings/class-strong-testimonials-settings-compat.php +3 -3
  137. admin/settings/class-strong-testimonials-settings-form.php +1 -5
  138. admin/settings/class-strong-testimonials-settings-general.php +13 -12
  139. admin/settings/class-strong-testimonials-settings-licenses.php +0 -0
  140. admin/settings/class-strong-testimonials-settings.php +5 -5
  141. admin/settings/partials/email-from.php +0 -0
  142. admin/settings/partials/email-to.php +0 -0
  143. admin/settings/partials/email.php +0 -0
  144. admin/settings/partials/form.php +86 -101
  145. admin/settings/partials/general.php +12 -0
  146. admin/settings/partials/licenses.php +0 -0
  147. admin/settings/partials/recipient.php +0 -0
  148. admin/view-list-order.php +0 -0
  149. admin/views-ajax.php +0 -0
  150. admin/views-validate.php +0 -0
  151. admin/views.php +12 -11
  152. {admin → assets}/css/admin.css +202 -374
  153. assets/js/admin-js.js +261 -0
  154. assets/src/js/admin.js +125 -0
  155. assets/src/js/modules/notice.js +21 -0
  156. assets/src/js/modules/range-slider.js +26 -0
  157. assets/src/scss/admin.scss +853 -0
  158. assets/src/scss/admin/_notices.scss +1 -0
  159. assets/src/scss/admin/_pages.scss +28 -0
  160. changelog.txt +12 -0
  161. includes/class-strong-form.php +0 -0
  162. includes/class-strong-log.php +0 -0
  163. includes/class-strong-mail.php +0 -0
  164. includes/class-strong-templates.php +0 -0
  165. includes/class-strong-testimonials-order.php +0 -0
  166. includes/class-strong-testimonials-privacy.php +0 -0
  167. includes/class-strong-testimonials-render.php +3 -1
  168. includes/class-strong-testimonials-shortcode-average.php +0 -0
  169. includes/class-strong-testimonials-shortcode-count.php +0 -0
  170. includes/class-strong-testimonials-shortcode.php +0 -0
  171. includes/class-strong-view-display.php +0 -0
  172. includes/class-strong-view-form.php +0 -0
  173. includes/class-strong-view-slideshow.php +0 -0
  174. includes/class-strong-view.php +0 -0
  175. includes/class-walker-strong-category-checklist-front.php +0 -0
  176. includes/deprecated.php +0 -0
  177. includes/filters.php +118 -0
  178. includes/functions-activation.php +0 -0
  179. includes/functions-content.php +3 -3
  180. includes/functions-image.php +0 -0
  181. includes/functions-rating.php +0 -0
  182. includes/functions-template-form.php +111 -101
  183. includes/functions-template.php +3 -3
  184. includes/functions-views.php +0 -0
  185. includes/functions.php +23 -2
  186. includes/integrations/class-integration-captcha-pro.php +0 -0
  187. includes/integrations/class-integration-captcha.php +0 -0
  188. includes/integrations/class-integration-google-captcha.php +0 -0
  189. includes/integrations/class-integration-really-simple-captcha.php +0 -0
  190. includes/l10n-polylang.php +0 -0
  191. includes/l10n-wpml.php +0 -0
  192. includes/post-types.php +15 -15
  193. includes/retro.php +0 -0
  194. includes/scripts.php +2 -0
  195. includes/widget2.php +6 -7
  196. languages/strong-testimonials-ar_AR.mo +0 -0
  197. languages/strong-testimonials-ar_AR.po +0 -0
  198. languages/strong-testimonials-es_ES.mo +0 -0
  199. languages/strong-testimonials-es_ES.po +0 -0
  200. languages/strong-testimonials-fa_IR.mo +0 -0
  201. languages/strong-testimonials-fa_IR.po +0 -0
  202. languages/strong-testimonials-fr_FR.mo +0 -0
  203. languages/strong-testimonials-fr_FR.po +0 -0
  204. languages/strong-testimonials-he_IL.mo +0 -0
  205. languages/strong-testimonials-he_IL.po +0 -0
  206. languages/strong-testimonials-pt_BR.mo +0 -0
  207. languages/strong-testimonials-pt_BR.po +0 -0
  208. languages/strong-testimonials-ru_RU.mo +0 -0
  209. languages/strong-testimonials-ru_RU.po +0 -0
  210. languages/strong-testimonials-sv_SE.mo +0 -0
  211. languages/strong-testimonials-sv_SE.po +0 -0
  212. languages/strong-testimonials.pot +0 -0
  213. license.txt +0 -0
  214. public/css/animate.min.css +0 -0
  215. public/css/columns.css +0 -0
  216. public/css/grid.css +0 -0
  217. public/css/masonry.css +0 -0
  218. public/css/rating-display.css +0 -0
  219. public/css/rating-form.css +0 -0
  220. public/css/slider-controls-full-buttons.css +0 -0
  221. public/css/slider-controls-full-buttons2.css +0 -0
  222. public/css/slider-controls-full-buttons3.css +0 -0
  223. public/css/slider-controls-full-text.css +0 -0
  224. public/css/slider-controls-sides-buttons-pager-buttons.css +0 -0
  225. public/css/slider-controls-sides-buttons-pager-text.css +0 -0
  226. public/css/slider-controls-sides-buttons.css +0 -0
  227. public/css/slider-controls-sides-buttons2-pager-buttons.css +0 -0
  228. public/css/slider-controls-sides-buttons2-pager-text.css +0 -0
  229. public/css/slider-controls-sides-buttons2.css +0 -0
  230. public/css/slider-controls-sides-buttons3-pager-buttons.css +0 -0
  231. public/css/slider-controls-sides-buttons3-pager-text.css +0 -0
  232. public/css/slider-controls-sides-buttons3.css +0 -0
  233. public/css/slider-controls-sides-inside-buttons-pager-buttons.css +0 -0
  234. public/css/slider-controls-sides-inside-buttons-pager-text.css +0 -0
  235. public/css/slider-controls-sides-inside-buttons.css +0 -0
  236. public/css/slider-controls-sides-inside-buttons2-pager-buttons.css +0 -0
  237. public/css/slider-controls-sides-inside-buttons2-pager-text.css +0 -0
  238. public/css/slider-controls-sides-inside-buttons2.css +0 -0
  239. public/css/slider-controls-sides-inside-buttons3-pager-buttons.css +0 -0
  240. public/css/slider-controls-sides-inside-buttons3-pager-text.css +0 -0
  241. public/css/slider-controls-sides-inside-buttons3.css +0 -0
  242. public/css/slider-controls-sides-outside-buttons-pager-buttons.css +0 -0
  243. public/css/slider-controls-sides-outside-buttons-pager-text.css +0 -0
  244. public/css/slider-controls-sides-outside-buttons.css +0 -0
  245. public/css/slider-controls-sides-outside-buttons2-pager-buttons.css +0 -0
  246. public/css/slider-controls-sides-outside-buttons2-pager-text.css +0 -0
  247. public/css/slider-controls-sides-outside-buttons2.css +0 -0
  248. public/css/slider-controls-sides-outside-buttons3-pager-buttons.css +0 -0
  249. public/css/slider-controls-sides-outside-buttons3-pager-text.css +0 -0
  250. public/css/slider-controls-sides-outside-buttons3.css +0 -0
  251. public/css/slider-controls-simple-buttons-pager-buttons.css +0 -0
  252. public/css/slider-controls-simple-buttons-pager-text.css +0 -0
  253. public/css/slider-controls-simple-buttons.css +0 -0
  254. public/css/slider-controls-simple-buttons2-pager-buttons.css +0 -0
  255. public/css/slider-controls-simple-buttons2-pager-text.css +0 -0
  256. public/css/slider-controls-simple-buttons2.css +0 -0
  257. public/css/slider-controls-simple-buttons3-pager-buttons.css +0 -0
  258. public/css/slider-controls-simple-buttons3-pager-text.css +0 -0
  259. public/css/slider-controls-simple-buttons3.css +0 -0
  260. public/css/slider-controls-simple-text-pager-buttons.css +0 -0
  261. public/css/slider-controls-simple-text-pager-text.css +0 -0
  262. public/css/slider-controls-simple-text.css +0 -0
  263. public/css/slider-pager-buttons.css +0 -0
  264. public/css/slider-pager-text.css +0 -0
  265. public/fonts/font-awesome-4.6.3/css/font-awesome.css +0 -0
  266. public/fonts/font-awesome-4.6.3/css/font-awesome.min.css +0 -0
  267. public/fonts/font-awesome-4.6.3/css/index.php +0 -0
  268. public/fonts/font-awesome-4.6.3/fonts/FontAwesome.otf +0 -0
  269. public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.eot +0 -0
  270. public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.svg +0 -0
  271. public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf +0 -0
  272. public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.woff +0 -0
  273. public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2 +0 -0
  274. public/index.php +0 -0
  275. public/js/controller.js +10 -1
  276. public/js/controller.min.js +1 -1
  277. public/js/lib/actual/jquery.actual.js +0 -0
  278. public/js/lib/actual/jquery.actual.min.js +0 -0
  279. public/js/lib/form-validation/form-validation.js +0 -0
  280. public/js/lib/form-validation/form-validation.min.js +0 -0
  281. public/js/lib/imagesloaded/imagesloaded.pkgd.min.js +0 -0
  282. public/js/lib/readmore/readmore.js +0 -0
  283. public/js/lib/readmore/readmore.min.js +0 -0
  284. public/js/lib/strongpager/jquery.strongpager.js +0 -0
  285. public/js/lib/strongpager/jquery.strongpager.min.js +0 -0
  286. public/js/lib/strongslider/LICENSE.md +0 -0
  287. public/js/lib/strongslider/jquery.strongslider.js +1972 -1969
  288. public/js/lib/strongslider/jquery.strongslider.min.js +1 -1
  289. public/js/lib/validate/additional-methods.js +0 -0
  290. public/js/lib/validate/additional-methods.min.js +0 -0
  291. public/js/lib/validate/jquery.validate.js +0 -0
  292. public/js/lib/validate/jquery.validate.min.js +0 -0
  293. public/js/lib/validate/localization/messages_ar.js +0 -0
  294. public/js/lib/validate/localization/messages_ar.min.js +0 -0
  295. public/js/lib/validate/localization/messages_az.js +0 -0
  296. public/js/lib/validate/localization/messages_az.min.js +0 -0
  297. public/js/lib/validate/localization/messages_bg.js +0 -0
  298. public/js/lib/validate/localization/messages_bg.min.js +0 -0
  299. public/js/lib/validate/localization/messages_bn_BD.js +0 -0
  300. public/js/lib/validate/localization/messages_bn_BD.min.js +0 -0
  301. public/js/lib/validate/localization/messages_ca.js +0 -0
  302. public/js/lib/validate/localization/messages_ca.min.js +0 -0
  303. public/js/lib/validate/localization/messages_cs.js +0 -0
  304. public/js/lib/validate/localization/messages_cs.min.js +0 -0
  305. public/js/lib/validate/localization/messages_da.js +0 -0
  306. public/js/lib/validate/localization/messages_da.min.js +0 -0
  307. public/js/lib/validate/localization/messages_de.js +0 -0
  308. public/js/lib/validate/localization/messages_de.min.js +0 -0
  309. public/js/lib/validate/localization/messages_el.js +0 -0
  310. public/js/lib/validate/localization/messages_el.min.js +0 -0
  311. public/js/lib/validate/localization/messages_es.js +0 -0
  312. public/js/lib/validate/localization/messages_es.min.js +0 -0
  313. public/js/lib/validate/localization/messages_es_AR.js +0 -0
  314. public/js/lib/validate/localization/messages_es_AR.min.js +0 -0
  315. public/js/lib/validate/localization/messages_es_PE.js +0 -0
  316. public/js/lib/validate/localization/messages_es_PE.min.js +0 -0
  317. public/js/lib/validate/localization/messages_et.js +0 -0
  318. public/js/lib/validate/localization/messages_et.min.js +0 -0
  319. public/js/lib/validate/localization/messages_eu.js +0 -0
  320. public/js/lib/validate/localization/messages_eu.min.js +0 -0
  321. public/js/lib/validate/localization/messages_fa.js +0 -0
  322. public/js/lib/validate/localization/messages_fa.min.js +0 -0
  323. public/js/lib/validate/localization/messages_fi.js +0 -0
  324. public/js/lib/validate/localization/messages_fi.min.js +0 -0
  325. public/js/lib/validate/localization/messages_fr.js +0 -0
  326. public/js/lib/validate/localization/messages_fr.min.js +0 -0
  327. public/js/lib/validate/localization/messages_ge.js +0 -0
  328. public/js/lib/validate/localization/messages_ge.min.js +0 -0
  329. public/js/lib/validate/localization/messages_gl.js +0 -0
  330. public/js/lib/validate/localization/messages_gl.min.js +0 -0
  331. public/js/lib/validate/localization/messages_he.js +0 -0
  332. public/js/lib/validate/localization/messages_he.min.js +0 -0
  333. public/js/lib/validate/localization/messages_hr.js +0 -0
  334. public/js/lib/validate/localization/messages_hr.min.js +0 -0
  335. public/js/lib/validate/localization/messages_hu.js +0 -0
  336. public/js/lib/validate/localization/messages_hu.min.js +0 -0
  337. public/js/lib/validate/localization/messages_hy_AM.js +0 -0
  338. public/js/lib/validate/localization/messages_hy_AM.min.js +0 -0
  339. public/js/lib/validate/localization/messages_id.js +0 -0
  340. public/js/lib/validate/localization/messages_id.min.js +0 -0
  341. public/js/lib/validate/localization/messages_is.js +0 -0
  342. public/js/lib/validate/localization/messages_is.min.js +0 -0
  343. public/js/lib/validate/localization/messages_it.js +0 -0
  344. public/js/lib/validate/localization/messages_it.min.js +0 -0
  345. public/js/lib/validate/localization/messages_ja.js +0 -0
  346. public/js/lib/validate/localization/messages_ja.min.js +0 -0
  347. public/js/lib/validate/localization/messages_ka.js +0 -0
  348. public/js/lib/validate/localization/messages_ka.min.js +0 -0
  349. public/js/lib/validate/localization/messages_kk.js +0 -0
  350. public/js/lib/validate/localization/messages_kk.min.js +0 -0
  351. public/js/lib/validate/localization/messages_ko.js +0 -0
  352. public/js/lib/validate/localization/messages_ko.min.js +0 -0
  353. public/js/lib/validate/localization/messages_lt.js +0 -0
  354. public/js/lib/validate/localization/messages_lt.min.js +0 -0
  355. public/js/lib/validate/localization/messages_lv.js +0 -0
  356. public/js/lib/validate/localization/messages_lv.min.js +0 -0
  357. public/js/lib/validate/localization/messages_mk.js +0 -0
  358. public/js/lib/validate/localization/messages_mk.min.js +0 -0
  359. public/js/lib/validate/localization/messages_my.js +0 -0
  360. public/js/lib/validate/localization/messages_my.min.js +0 -0
  361. public/js/lib/validate/localization/messages_nl.js +0 -0
  362. public/js/lib/validate/localization/messages_nl.min.js +0 -0
  363. public/js/lib/validate/localization/messages_no.js +0 -0
  364. public/js/lib/validate/localization/messages_no.min.js +0 -0
  365. public/js/lib/validate/localization/messages_pl.js +0 -0
  366. public/js/lib/validate/localization/messages_pl.min.js +0 -0
  367. public/js/lib/validate/localization/messages_pt_BR.js +0 -0
  368. public/js/lib/validate/localization/messages_pt_BR.min.js +0 -0
  369. public/js/lib/validate/localization/messages_pt_PT.js +0 -0
  370. public/js/lib/validate/localization/messages_pt_PT.min.js +0 -0
  371. public/js/lib/validate/localization/messages_ro.js +0 -0
  372. public/js/lib/validate/localization/messages_ro.min.js +0 -0
  373. public/js/lib/validate/localization/messages_ru.js +0 -0
  374. public/js/lib/validate/localization/messages_ru.min.js +0 -0
  375. public/js/lib/validate/localization/messages_si.js +0 -0
  376. public/js/lib/validate/localization/messages_si.min.js +0 -0
  377. public/js/lib/validate/localization/messages_sk.js +0 -0
  378. public/js/lib/validate/localization/messages_sk.min.js +0 -0
  379. public/js/lib/validate/localization/messages_sl.js +0 -0
  380. public/js/lib/validate/localization/messages_sl.min.js +0 -0
  381. public/js/lib/validate/localization/messages_sr.js +0 -0
  382. public/js/lib/validate/localization/messages_sr.min.js +0 -0
  383. public/js/lib/validate/localization/messages_sr_lat.js +0 -0
  384. public/js/lib/validate/localization/messages_sr_lat.min.js +0 -0
  385. public/js/lib/validate/localization/messages_sv.js +0 -0
  386. public/js/lib/validate/localization/messages_sv.min.js +0 -0
  387. public/js/lib/validate/localization/messages_th.js +0 -0
  388. public/js/lib/validate/localization/messages_th.min.js +0 -0
  389. public/js/lib/validate/localization/messages_tj.js +0 -0
  390. public/js/lib/validate/localization/messages_tj.min.js +0 -0
  391. public/js/lib/validate/localization/messages_tr.js +0 -0
  392. public/js/lib/validate/localization/messages_tr.min.js +0 -0
  393. public/js/lib/validate/localization/messages_uk.js +0 -0
  394. public/js/lib/validate/localization/messages_uk.min.js +0 -0
  395. public/js/lib/validate/localization/messages_ur.js +0 -0
  396. public/js/lib/validate/localization/messages_ur.min.js +0 -0
  397. public/js/lib/validate/localization/messages_vi.js +0 -0
  398. public/js/lib/validate/localization/messages_vi.min.js +0 -0
  399. public/js/lib/validate/localization/messages_zh.js +0 -0
  400. public/js/lib/validate/localization/messages_zh.min.js +0 -0
  401. public/js/lib/validate/localization/messages_zh_TW.js +0 -0
  402. public/js/lib/validate/localization/messages_zh_TW.min.js +0 -0
  403. public/js/lib/validate/localization/methods_de.js +0 -0
  404. public/js/lib/validate/localization/methods_de.min.js +0 -0
  405. public/js/lib/validate/localization/methods_es_CL.js +0 -0
  406. public/js/lib/validate/localization/methods_es_CL.min.js +0 -0
  407. public/js/lib/validate/localization/methods_fi.js +0 -0
  408. public/js/lib/validate/localization/methods_fi.min.js +0 -0
  409. public/js/lib/validate/localization/methods_nl.js +0 -0
  410. public/js/lib/validate/localization/methods_nl.min.js +0 -0
  411. public/js/lib/validate/localization/methods_pt.js +0 -0
  412. public/js/lib/validate/localization/methods_pt.min.js +0 -0
  413. public/js/lib/verge/verge.js +0 -0
  414. public/js/lib/verge/verge.min.js +0 -0
  415. public/scss/_partials/_base.scss +0 -0
  416. public/scss/_partials/_buttons.scss +0 -0
  417. public/scss/_partials/_buttons2.scss +0 -0
  418. public/scss/_partials/_buttons3.scss +0 -0
  419. public/scss/_partials/_inside.scss +0 -0
  420. public/scss/_partials/_outside.scss +0 -0
  421. public/scss/_partials/_pager_buttons.scss +0 -0
  422. public/scss/_partials/_pager_inside.scss +0 -0
  423. public/scss/_partials/_pager_text.scss +0 -0
  424. public/scss/_partials/_sides.scss +0 -0
  425. public/scss/_partials/_sides_outside.scss +0 -0
  426. public/scss/_partials/_sides_pager.scss +0 -0
  427. public/scss/_partials/_text.scss +0 -0
  428. public/scss/slider-controls-full-buttons.scss +0 -0
  429. public/scss/slider-controls-full-buttons2.scss +0 -0
  430. public/scss/slider-controls-full-buttons3.scss +0 -0
  431. public/scss/slider-controls-full-text.scss +0 -0
  432. public/scss/slider-controls-sides-buttons-pager-buttons.scss +0 -0
  433. public/scss/slider-controls-sides-buttons-pager-text.scss +0 -0
  434. public/scss/slider-controls-sides-buttons.scss +0 -0
  435. public/scss/slider-controls-sides-buttons2-pager-buttons.scss +0 -0
  436. public/scss/slider-controls-sides-buttons2-pager-text.scss +0 -0
  437. public/scss/slider-controls-sides-buttons2.scss +0 -0
  438. public/scss/slider-controls-sides-buttons3-pager-buttons.scss +0 -0
  439. public/scss/slider-controls-sides-buttons3-pager-text.scss +0 -0
  440. public/scss/slider-controls-sides-buttons3.scss +0 -0
  441. public/scss/slider-controls-sides-outside-buttons-pager-buttons.scss +0 -0
  442. public/scss/slider-controls-sides-outside-buttons-pager-text.scss +0 -0
  443. public/scss/slider-controls-sides-outside-buttons.scss +0 -0
  444. public/scss/slider-controls-sides-outside-buttons2-pager-buttons.scss +0 -0
  445. public/scss/slider-controls-sides-outside-buttons2-pager-text.scss +0 -0
  446. public/scss/slider-controls-sides-outside-buttons2.scss +0 -0
  447. public/scss/slider-controls-sides-outside-buttons3-pager-buttons.scss +0 -0
  448. public/scss/slider-controls-sides-outside-buttons3-pager-text.scss +0 -0
  449. public/scss/slider-controls-sides-outside-buttons3.scss +0 -0
  450. public/scss/slider-controls-simple-buttons-pager-buttons.scss +0 -0
  451. public/scss/slider-controls-simple-buttons-pager-text.scss +0 -0
  452. public/scss/slider-controls-simple-buttons.scss +0 -0
  453. public/scss/slider-controls-simple-buttons2-pager-buttons.scss +0 -0
  454. public/scss/slider-controls-simple-buttons2-pager-text.scss +0 -0
  455. public/scss/slider-controls-simple-buttons2.scss +0 -0
  456. public/scss/slider-controls-simple-buttons3-pager-buttons.scss +0 -0
  457. public/scss/slider-controls-simple-buttons3-pager-text.scss +0 -0
  458. public/scss/slider-controls-simple-buttons3.scss +0 -0
  459. public/scss/slider-controls-simple-text-pager-buttons.scss +0 -0
  460. public/scss/slider-controls-simple-text-pager-text.scss +0 -0
  461. public/scss/slider-controls-simple-text.scss +0 -0
  462. public/scss/slider-pager-buttons.scss +0 -0
  463. public/scss/slider-pager-text.scss +0 -0
  464. readme.txt +2 -2
  465. strong-testimonials.php +7 -2
  466. templates-scss/_mixins/_testimonial.scss +0 -0
  467. templates-scss/_partials/_base.scss +0 -0
  468. templates-scss/_partials/_clear.scss +0 -0
  469. templates-scss/_partials/_form-wait.scss +0 -0
  470. templates-scss/_partials/_pagination-modern.scss +0 -0
  471. templates-scss/_partials/_pagination-simple.scss +0 -0
  472. templates-scss/_partials/_pagination-standard.scss +0 -0
  473. templates-scss/_partials/_responsive-no-heading-background.scss +0 -0
  474. templates-scss/_partials/_responsive.scss +0 -0
  475. templates-scss/_partials/_rtl.scss +0 -0
  476. templates-scss/_partials/_structure-form.scss +0 -0
  477. templates-scss/bold/content.scss +0 -0
  478. templates-scss/default-form/form.scss +0 -0
  479. templates-scss/default/content.scss +0 -0
  480. templates-scss/modern/content.scss +0 -0
  481. templates-scss/simple-form/form.scss +0 -0
  482. templates-scss/simple/content.scss +0 -0
  483. templates-scss/small-widget/content.scss +0 -0
  484. templates-scss/unstyled-form/form.scss +0 -0
  485. templates/bold/config.json +0 -0
  486. templates/bold/content.css +0 -0
  487. templates/bold/content.php +0 -0
  488. templates/default-form/config.json +0 -0
  489. templates/default-form/form.css +0 -0
  490. templates/default-form/form.php +0 -0
  491. templates/default/config.json +0 -0
  492. templates/default/content.css +0 -0
  493. templates/default/content.php +0 -0
  494. templates/default/img/quotes.png +0 -0
  495. templates/index.php +0 -0
  496. templates/modern/config.json +0 -0
  497. templates/modern/content.css +0 -0
  498. templates/modern/content.php +0 -0
  499. templates/simple-form/config.json +0 -0
  500. templates/simple-form/form.css +0 -0
  501. templates/simple-form/form.php +0 -0
  502. templates/simple/config.json +0 -0
  503. templates/simple/content.css +0 -0
  504. templates/simple/content.php +0 -0
  505. templates/small-widget/config.json +0 -0
  506. templates/small-widget/content.css +0 -0
  507. templates/small-widget/content.php +0 -0
  508. templates/unstyled-form/config.json +0 -0
  509. templates/unstyled-form/form.css +0 -0
  510. templates/unstyled-form/form.php +0 -0
  511. templates/unstyled/config.json +0 -0
  512. templates/unstyled/content.php +0 -0
  513. uninstall.php +0 -0
  514. wpml-config.xml +0 -0
admin/about/addons.php CHANGED
File without changes
admin/about/class-strong-testimonials-about.php CHANGED
@@ -39,9 +39,9 @@ class Strong_Testimonials_About {
39
  */
40
  public function get_submenu() {
41
  return array(
42
- 'page_title' => __( 'About' ),
43
- 'menu_title' => __( 'About' ),
44
- 'capability' => 'strong_testimonials_about',
45
  'menu_slug' => 'about-strong-testimonials',
46
  'function' => array( $this, 'about_page' ),
47
  );
@@ -57,21 +57,21 @@ class Strong_Testimonials_About {
57
  ?>
58
  <div class="wrap about-wrap">
59
 
 
 
60
  <?php /* translators: %s is the plugin version number */ ?>
61
  <h1><?php printf( __( 'Welcome to Strong Testimonials %s', 'strong-testimonials' ), $major_minor ); ?></h1>
62
 
63
  <p class="about-text">
64
- <?php _e( 'Thank you for updating to the latest version!' ); ?>
65
  <?php /* translators: %s is the plugin version number */ ?>
66
  </p>
67
-
68
- <div class="wp-badge strong-testimonials"><?php printf( __( 'Version %s' ), $major_minor ); ?></div>
69
 
70
  <h2 class="nav-tab-wrapper wp-clearfix">
71
 
72
  <a href="<?php echo add_query_arg( 'tab', 'how-to', $url ); ?>" class="nav-tab <?php echo $active_tab == 'how-to' ? 'nav-tab-active' : ''; ?>"><?php _e( 'How To', 'strong-testimonials' ); ?></a>
73
-
74
- <a href="<?php echo add_query_arg( 'tab', 'privacy', $url ); ?>" class="nav-tab <?php echo $active_tab == 'privacy' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Privacy' ); ?></a>
75
 
76
  </h2>
77
 
39
  */
40
  public function get_submenu() {
41
  return array(
42
+ 'page_title' => __( 'About', 'strong-testimonials' ),
43
+ 'menu_title' => __( 'About', 'strong-testimonials' ),
44
+ 'capability' => 'strong_testimonials_about',
45
  'menu_slug' => 'about-strong-testimonials',
46
  'function' => array( $this, 'about_page' ),
47
  );
57
  ?>
58
  <div class="wrap about-wrap">
59
 
60
+ <img class="wpmst-mascot" src="<?php echo esc_url( WPMTST_ADMIN_URL ); ?>/img/mascot.png" />
61
+
62
  <?php /* translators: %s is the plugin version number */ ?>
63
  <h1><?php printf( __( 'Welcome to Strong Testimonials %s', 'strong-testimonials' ), $major_minor ); ?></h1>
64
 
65
  <p class="about-text">
66
+ <?php esc_html_e( 'Thank you for updating to the latest version!', 'strong-testimonials' ); ?>
67
  <?php /* translators: %s is the plugin version number */ ?>
68
  </p>
69
+ <br/>
 
70
 
71
  <h2 class="nav-tab-wrapper wp-clearfix">
72
 
73
  <a href="<?php echo add_query_arg( 'tab', 'how-to', $url ); ?>" class="nav-tab <?php echo $active_tab == 'how-to' ? 'nav-tab-active' : ''; ?>"><?php _e( 'How To', 'strong-testimonials' ); ?></a>
74
+ <a href="<?php echo esc_url( add_query_arg( 'tab', 'privacy', $url ) ); ?>" class="nav-tab <?php echo $active_tab == 'privacy' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Privacy', 'strong-testimonials' ); ?></a>
 
75
 
76
  </h2>
77
 
admin/about/how-to.php CHANGED
File without changes
admin/about/links.php CHANGED
File without changes
admin/about/privacy.php CHANGED
File without changes
admin/about/whats-new.php CHANGED
File without changes
admin/admin-notices.php CHANGED
@@ -182,8 +182,10 @@ function wpmtst_admin_feedback_notice() {
182
  if ( $screen->id !== 'edit-wpm-testimonial' ) {
183
  return;
184
  }
 
185
  ?>
186
- <div class="notice wpmtst-notice">
 
187
  <img src="<?php echo esc_url( WPMTST_ADMIN_URL ); ?>/img/logo-long.svg" width="400"/>
188
  <p><?php esc_html_e( 'Do you enjoy using Strong Testimonials? Please take a minute to suggest a feature or tell us what you think.', 'strong-testimonials' ); ?></p>
189
  <a class="button" target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLScch0AchtnzxJsSrjUcW9ypcr1fZ9r-vyk3emEp8Sv47brb2g/viewform"><?php esc_html_e( 'Submit Feedback', 'strong-testimonials' ); ?></a>
182
  if ( $screen->id !== 'edit-wpm-testimonial' ) {
183
  return;
184
  }
185
+
186
  ?>
187
+ <div class="notice wpmtst-notice is-dismissible" data-key="feedback-notice" data-nonce="<?php echo esc_attr( wp_create_nonce( "wpmtst-admin" ) ); ?>">
188
+ <img class="wpmst-mascot" src="<?php echo esc_url( WPMTST_ADMIN_URL ); ?>/img/mascot.png" />
189
  <img src="<?php echo esc_url( WPMTST_ADMIN_URL ); ?>/img/logo-long.svg" width="400"/>
190
  <p><?php esc_html_e( 'Do you enjoy using Strong Testimonials? Please take a minute to suggest a feature or tell us what you think.', 'strong-testimonials' ); ?></p>
191
  <a class="button" target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLScch0AchtnzxJsSrjUcW9ypcr1fZ9r-vyk3emEp8Sv47brb2g/viewform"><?php esc_html_e( 'Submit Feedback', 'strong-testimonials' ); ?></a>
admin/admin.php CHANGED
File without changes
admin/class-strong-testimonials-admin-category-list.php CHANGED
File without changes
admin/class-strong-testimonials-admin-list.php CHANGED
File without changes
admin/class-strong-testimonials-admin-scripts.php CHANGED
@@ -56,14 +56,18 @@ class Strong_Testimonials_Admin_Scripts {
56
  $plugin_version,
57
  true );
58
 
59
- wp_register_script( 'wpmtst-admin-script',
60
- WPMTST_ADMIN_URL . 'js/admin.js',
 
 
61
  array( 'jquery', 'underscore' ),
62
  $plugin_version,
63
  true );
64
 
65
- wp_register_style( 'wpmtst-admin-style',
66
- WPMTST_ADMIN_URL . 'css/admin.css',
 
 
67
  array( 'wpmtst-font-awesome' ),
68
  $plugin_version );
69
 
56
  $plugin_version,
57
  true );
58
 
59
+
60
+ wp_register_script(
61
+ 'wpmtst-admin-script',
62
+ WPMTST_ASSETS_JS . 'admin-js.js',
63
  array( 'jquery', 'underscore' ),
64
  $plugin_version,
65
  true );
66
 
67
+
68
+ wp_register_style(
69
+ 'wpmtst-admin-style',
70
+ WPMTST_ASSETS_CSS . 'admin.css',
71
  array( 'wpmtst-font-awesome' ),
72
  $plugin_version );
73
 
admin/class-strong-testimonials-defaults.php CHANGED
@@ -29,18 +29,19 @@ class Strong_Testimonials_Defaults {
29
  */
30
  public static function get_options() {
31
  $default_options = array(
32
- 'embed_width' => '',
33
- 'load_font_awesome' => true,
34
- 'nofollow' => false,
35
- 'pending_indicator' => true,
36
- 'remove_whitespace' => true,
37
- 'reorder' => false,
38
- 'support_comments' => false,
39
- 'support_custom_fields' => false,
40
- 'scrolltop' => true,
41
- 'scrolltop_offset' => 80,
42
- 'no_lazyload' => true,
43
- 'touch_enabled' => true,
 
44
  );
45
 
46
  return $default_options;
@@ -865,15 +866,6 @@ class Strong_Testimonials_Defaults {
865
  'installed' => false,
866
  'active' => false,
867
  ),
868
- 'really-simple-captcha' => array(
869
- 'name' => 'Really Simple Captcha by Takayuki Miyoshi (free)',
870
- 'class' => 'Really_Simple_Captcha',
871
- 'file' => 'really-simple-captcha/really-simple-captcha.php',
872
- 'search' => 'plugin-install.php?tab=search&s=Really+Simple+Captcha',
873
- 'url' => 'https://wordpress.org/plugins/really-simple-captcha/',
874
- 'installed' => false,
875
- 'active' => false,
876
- ),
877
  );
878
 
879
  return $plugins;
29
  */
30
  public static function get_options() {
31
  $default_options = array(
32
+ 'embed_width' => '',
33
+ 'load_font_awesome' => true,
34
+ 'nofollow' => false,
35
+ 'pending_indicator' => true,
36
+ 'remove_whitespace' => true,
37
+ 'reorder' => false,
38
+ 'support_comments' => false,
39
+ 'support_custom_fields' => false,
40
+ 'single_testimonial_slug' => 'testimonial',
41
+ 'scrolltop' => true,
42
+ 'scrolltop_offset' => 80,
43
+ 'no_lazyload' => true,
44
+ 'touch_enabled' => true,
45
  );
46
 
47
  return $default_options;
866
  'installed' => false,
867
  'active' => false,
868
  ),
 
 
 
 
 
 
 
 
 
869
  );
870
 
871
  return $plugins;
admin/class-strong-testimonials-exporter.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class Strong_Testimonials_Exporter
5
+ *
6
+ * exports testimonials along with their featured media
7
+ *
8
+ * @since 2.36
9
+ */
10
+ class Strong_Testimonials_Exporter {
11
+
12
+ public $args = array();
13
+ public $query_done = false;
14
+
15
+ public function __construct() {
16
+ add_action( 'export_wp', array( $this, 'export_wp' ), 10, 1 );
17
+ add_filter( 'export_query', array( $this, 'export_query' ), 10, 1 );
18
+ }
19
+
20
+ public function export_wp( $args ) {
21
+ $this->args = $args;
22
+ add_filter( 'query', array( $this, 'export_query_filter' ), 10, 1 );
23
+ }
24
+
25
+ public function export_query_filter( $query ) {
26
+
27
+ global $wpdb;
28
+ if ( false === $this->query_done && 0 === strpos( $query, "SELECT ID FROM {$wpdb->posts} " ) ) {
29
+ $this->query_done = true;
30
+ remove_filter( 'query', array( $this, 'export_query_filter' ), 10 );
31
+ $query = apply_filters( 'export_query', $query );
32
+ }
33
+ return $query;
34
+ }
35
+
36
+ public function export_query( $query ) {
37
+ global $wpdb;
38
+
39
+ if ( isset( $this->args['content'] ) && 'wpm-testimonial' === $this->args['content'] ) {
40
+
41
+ $attachments = $wpdb->get_results( "SELECT ID, guid, post_parent FROM {$wpdb->posts} WHERE post_type = 'attachment'", OBJECT_K );
42
+ if ( empty( $attachments ) ) {
43
+ return $query;
44
+ }
45
+
46
+ $ids = array();
47
+
48
+ // get attachments who are post thumbnails
49
+ $posts = $wpdb->get_col( $query );
50
+ if ( $posts ) {
51
+ $ids = $wpdb->get_col( sprintf( "SELECT meta_value FROM {$wpdb->postmeta} WHERE meta_key = '_thumbnail_id' AND post_id IN(%s)", implode( ',', $posts ) ) );
52
+ }
53
+
54
+ // get atachments who have a post parent.
55
+ foreach ( $attachments as $id => $att ) {
56
+ if ( in_array( $att->post_parent, $posts ) ) {
57
+ $ids[] = $id;
58
+ }
59
+ }
60
+
61
+ $ids = array_unique( $ids );
62
+ if ( count( $ids ) === 0 ) {
63
+ return $query;
64
+ }
65
+
66
+ if ( 0 === strpos( $query, "SELECT ID FROM {$wpdb->posts} INNER JOIN {$wpdb->term_relationships} " ) ) {
67
+ // replace INNER JOIN with LEFT JOIN.
68
+ $query = str_replace( "SELECT ID FROM {$wpdb->posts} INNER JOIN {$wpdb->term_relationships} ", "SELECT ID FROM {$wpdb->posts} LEFT JOIN {$wpdb->term_relationships} ", $query );
69
+ }
70
+ $query .= sprintf( " OR {$wpdb->posts}.ID IN (%s) ", implode( ',', $ids ) );
71
+
72
+ }
73
+ return $query;
74
+ }
75
+
76
+
77
+ }
78
+
79
+ new Strong_Testimonials_Exporter();
80
+
admin/class-strong-testimonials-help.php CHANGED
@@ -115,21 +115,21 @@ class Strong_Testimonials_Help {
115
 
116
  ob_start();
117
  ?>
118
- <div>
119
- <p><?php _e( 'Optional shortcode attributes will override the view settings. Use this to create reusable view <strong>patterns</strong>.', 'strong-testimonials' ); ?>
120
- <p><?php _e( 'Overridable settings: <code>post_ids</code>, <code>category</code>, <code>order</code>, <code>count</code>.', 'strong-testimonials' ); ?>
121
- <p><?php _e( 'For example, imagine you have five services, a sales page for each service, and a testimonial category for each service. To display the testimonials on each service page, you can create five duplicate views, one for each category.', 'strong-testimonials' ); ?>
122
- <p><?php _e( 'Or you can configure one view as a pattern and add it to each service page with the <code>category</code> attribute.', 'strong-testimonials' ); ?>
123
- <p>
124
- <?php _e( '<code>[testimonial_view id="1" category="service-1"]</code>', 'strong-testimonials' ); ?>,
125
- <?php _e( '<code>[testimonial_view id="1" category="service-2"]</code>', 'strong-testimonials' ); ?>, etc.
126
- </p>
127
- <p>
128
- <?php _e( 'Attributes may be used in combination. For example:', 'strong-testimonials' ); ?>
129
- <?php _e( '<code>[testimonial_view id="1" category="service-3" order="random" count="5"]</code>', 'strong-testimonials' ); ?>
130
- </p>
131
- <p><?php _e( 'Using <code>post_ids</code> is the most specific method and it will override category and count (whether settings or attributes).', 'strong-testimonials' ); ?></p>
132
- </div>
133
  <?php
134
  $content = ob_get_clean();
135
 
@@ -150,44 +150,44 @@ class Strong_Testimonials_Help {
150
 
151
  ob_start();
152
  ?>
153
- <p><?php _e( 'Some of the features and drawbacks for each method.', 'strong-testimonials' ); ?></p>
154
-
155
- <table class="wpmtst-help-tab" cellpadding="0" cellspacing="0">
156
- <thead>
157
- <tr>
158
- <th></th>
159
- <th><?php _e( 'Simple', 'strong-testimonials' ); ?></th>
160
- <th><?php _e( 'Standard', 'strong-testimonials' ); ?></th>
161
- </tr>
162
- </thead>
163
- <tbody>
164
- <tr>
165
- <td><?php _e( 'best use', 'strong-testimonials' ); ?></td>
166
- <td><?php _e( 'ten pages or less', 'strong-testimonials' ); ?></td>
167
- <td><?php _e( 'more than ten pages', 'strong-testimonials' ); ?></td>
168
- </tr>
169
- <tr>
170
- <td><?php _e( 'URLs', 'strong-testimonials' ); ?></td>
171
- <td><?php _e( 'does not change the URL', 'strong-testimonials' ); ?></td>
172
- <td><?php _e( 'uses paged URLs just like standard WordPress posts', 'strong-testimonials' ); ?></td>
173
- </tr>
174
- <tr>
175
- <td><?php _e( 'the Back button', 'strong-testimonials' ); ?></td>
176
- <td><?php _e( 'It does not remember which page of testimonials you are on. If you click away &ndash; for example, on a "Read more" link &ndash; then click back, you will return to page one.', 'strong-testimonials' ); ?></td>
177
- <td><?php _e( 'You will return the last page you were on so this works well with "Read more" links.', 'strong-testimonials' ); ?></td>
178
- </tr>
179
- <tr>
180
- <td><?php _e( 'works with random order option', 'strong-testimonials' ); ?></td>
181
- <td><?php _e( 'yes' ); ?></td>
182
- <td><?php _e( 'no' ); ?></td>
183
- </tr>
184
- <tr>
185
- <td><?php _e( 'works in a widget', 'strong-testimonials' ); ?></td>
186
- <td><?php _e( 'yes' ); ?></td>
187
- <td><?php _e( 'no' ); ?></td>
188
- </tr>
189
- </tbody>
190
- </table>
191
  <?php
192
  $content = ob_get_clean();
193
 
115
 
116
  ob_start();
117
  ?>
118
+ <div>
119
+ <p><?php echo wp_kses_post( _e( 'Optional shortcode attributes will override the view settings. Use this to create reusable view <strong>patterns</strong>.', 'strong-testimonials' ) ); ?>
120
+ <p><?php echo wp_kses_post( _e( 'Overridable settings: <code>post_ids</code>, <code>category</code>, <code>order</code>, <code>count</code>.', 'strong-testimonials' ) ); ?>
121
+ <p><?php echo wp_kses_post( _e( 'For example, imagine you have five services, a sales page for each service, and a testimonial category for each service. To display the testimonials on each service page, you can create five duplicate views, one for each category.', 'strong-testimonials' ) ); ?>
122
+ <p><?php echo wp_kses_post( _e( 'Or you can configure one view as a pattern and add it to each service page with the <code>category</code> attribute.', 'strong-testimonials' ) ); ?>
123
+ <p>
124
+ <?php echo wp_kses_post( '<code>[testimonial_view id="1" category="service-1"]</code>' ); ?>,
125
+ <?php echo wp_kses_post( '<code>[testimonial_view id="1" category="service-2"]</code>' ); ?>, etc.
126
+ </p>
127
+ <p>
128
+ <?php echo wp_kses_post( _e( 'Attributes may be used in combination. For example:', 'strong-testimonials' ) ); ?>
129
+ <?php echo wp_kses_post( '<code>[testimonial_view id="1" category="service-3" order="random" count="5"]</code>' ); ?>
130
+ </p>
131
+ <p><?php echo wp_kses_post( _e( 'Using <code>post_ids</code> is the most specific method and it will override category and count (whether settings or attributes).', 'strong-testimonials' ) ); ?></p>
132
+ </div>
133
  <?php
134
  $content = ob_get_clean();
135
 
150
 
151
  ob_start();
152
  ?>
153
+ <p><?php esc_html_e( 'Some of the features and drawbacks for each method.', 'strong-testimonials' ); ?></p>
154
+
155
+ <table class="wpmtst-help-tab" cellpadding="0" cellspacing="0">
156
+ <thead>
157
+ <tr>
158
+ <th></th>
159
+ <th><?php esc_html_e( 'Simple', 'strong-testimonials' ); ?></th>
160
+ <th><?php esc_html_e( 'Standard', 'strong-testimonials' ); ?></th>
161
+ </tr>
162
+ </thead>
163
+ <tbody>
164
+ <tr>
165
+ <td><?php esc_html_e( 'best use', 'strong-testimonials' ); ?></td>
166
+ <td><?php esc_html_e( 'ten pages or less', 'strong-testimonials' ); ?></td>
167
+ <td><?php esc_html_e( 'more than ten pages', 'strong-testimonials' ); ?></td>
168
+ </tr>
169
+ <tr>
170
+ <td><?php esc_html_e( 'URLs', 'strong-testimonials' ); ?></td>
171
+ <td><?php esc_html_e( 'does not change the URL', 'strong-testimonials' ); ?></td>
172
+ <td><?php esc_html_e( 'uses paged URLs just like standard WordPress posts', 'strong-testimonials' ); ?></td>
173
+ </tr>
174
+ <tr>
175
+ <td><?php esc_html_e( 'the Back button', 'strong-testimonials' ); ?></td>
176
+ <td><?php esc_html_e( 'It does not remember which page of testimonials you are on. If you click away &ndash; for example, on a "Read more" link &ndash; then click back, you will return to page one.', 'strong-testimonials' ); ?></td>
177
+ <td><?php esc_html_e( 'You will return the last page you were on so this works well with "Read more" links.', 'strong-testimonials' ); ?></td>
178
+ </tr>
179
+ <tr>
180
+ <td><?php esc_html_e( 'works with random order option', 'strong-testimonials' ); ?></td>
181
+ <td><?php esc_html_e( 'yes', 'strong-testimonials' ); ?></td>
182
+ <td><?php esc_html_e( 'no', 'strong-testimonials' ); ?></td>
183
+ </tr>
184
+ <tr>
185
+ <td><?php esc_html_e( 'works in a widget', 'strong-testimonials' ); ?></td>
186
+ <td><?php esc_html_e( 'yes', 'strong-testimonials' ); ?></td>
187
+ <td><?php esc_html_e( 'no', 'strong-testimonials' ); ?></td>
188
+ </tr>
189
+ </tbody>
190
+ </table>
191
  <?php
192
  $content = ob_get_clean();
193
 
admin/class-strong-testimonials-list-table.php CHANGED
@@ -10,585 +10,629 @@
10
  * @access private
11
  */
12
 
13
- if ( !class_exists( 'Strong_Testimonials_List_Table' ) ) :
14
-
15
- class Strong_Testimonials_List_Table {
16
-
17
- /**
18
- * The current list of items
19
- *
20
- * @since 3.1.0
21
- * @var array
22
- * @access public
23
- */
24
- public $items;
25
-
26
- /**
27
- * Various information about the current table
28
- *
29
- * @since 3.1.0
30
- * @var array
31
- * @access protected
32
- */
33
- protected $_args;
34
-
35
- /**
36
- * Various information needed for displaying the pagination
37
- *
38
- * @since 3.1.0
39
- * @var array
40
- */
41
- protected $_pagination_args = array();
42
-
43
- /**
44
- * The current screen
45
- *
46
- * @since 3.1.0
47
- * @var object
48
- * @access protected
49
- */
50
- protected $screen;
51
-
52
- /**
53
- * Cached bulk actions
54
- *
55
- * @since 3.1.0
56
- * @var array
57
- * @access private
58
- */
59
- private $_actions;
60
-
61
- /**
62
- * Cached pagination output
63
- *
64
- * @since 3.1.0
65
- * @var string
66
- * @access private
67
- */
68
- private $_pagination;
69
-
70
- /**
71
- * The view switcher modes.
72
- *
73
- * @since 4.1.0
74
- * @var array
75
- * @access protected
76
- */
77
- protected $modes = array();
78
-
79
- /**
80
- * Stores the value returned by ->get_column_info()
81
- *
82
- * @var array
83
- */
84
- protected $_column_headers;
85
-
86
- protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
87
-
88
- protected $compat_methods = array( 'set_pagination_args', 'get_views', 'get_bulk_actions', 'bulk_actions',
89
- 'row_actions', 'months_dropdown', 'view_switcher', 'comments_bubble', 'get_items_per_page', 'pagination',
90
- 'get_sortable_columns', 'get_column_info', 'get_table_classes', 'display_tablenav', 'extra_tablenav',
91
- 'single_row_columns' );
92
-
93
- /**
94
- * Constructor.
95
- *
96
- * The child class should call this constructor from its own constructor to override
97
- * the default $args.
98
- *
99
- * @since 3.1.0
100
- * @access public
101
- *
102
- * @param array|string $args {
103
- * Array or string of arguments.
104
- *
105
- * @type string $plural Plural value used for labels and the objects being listed.
106
- * This affects things such as CSS class-names and nonces used
107
- * in the list table, e.g. 'posts'. Default empty.
108
- * @type string $singular Singular label for an object being listed, e.g. 'post'.
109
- * Default empty
110
- * @type bool $ajax Whether the list table supports AJAX. This includes loading
111
- * and sorting data, for example. If true, the class will call
112
- * the {@see _js_vars()} method in the footer to provide variables
113
- * to any scripts handling AJAX events. Default false.
114
- * @type string $screen String containing the hook name used to determine the current
115
- * screen. If left null, the current screen will be automatically set.
116
- * Default null.
117
- * }
118
- */
119
- public function __construct( $args = array() ) {
120
- $args = wp_parse_args( $args, array(
121
- 'plural' => '',
122
- 'singular' => '',
123
- 'ajax' => false,
124
- 'screen' => null,
125
- ) );
126
-
127
- $this->screen = convert_to_screen( $args['screen'] );
128
-
129
- add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
130
-
131
- if ( !$args['plural'] )
132
- $args['plural'] = $this->screen->base;
133
-
134
- $args['plural'] = sanitize_key( $args['plural'] );
135
- $args['singular'] = sanitize_key( $args['singular'] );
136
-
137
- $this->_args = $args;
138
-
139
- if ( $args['ajax'] ) {
140
- // wp_enqueue_script( 'list-table' );
141
- add_action( 'admin_footer', array( $this, '_js_vars' ) );
142
- }
143
 
144
- if ( empty( $this->modes ) ) {
145
- $this->modes = array(
146
- 'list' => __( 'List View' ),
147
- 'excerpt' => __( 'Excerpt View' )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  );
149
- }
150
- }
151
 
152
- /**
153
- * Make private properties readable for backwards compatibility.
154
- *
155
- * @since 4.0.0
156
- * @access public
157
- *
158
- * @param string $name Property to get.
159
- * @return mixed Property.
160
- */
161
- public function __get( $name ) {
162
- if ( in_array( $name, $this->compat_fields ) ) {
163
- return $this->$name;
 
 
 
 
 
 
 
 
 
 
 
 
164
  }
165
- }
166
 
167
- /**
168
- * Make private properties settable for backwards compatibility.
169
- *
170
- * @since 4.0.0
171
- * @access public
172
- *
173
- * @param string $name Property to check if set.
174
- * @param mixed $value Property value.
175
- * @return mixed Newly-set property.
176
- */
177
- public function __set( $name, $value ) {
178
- if ( in_array( $name, $this->compat_fields ) ) {
179
- return $this->$name = $value;
180
  }
181
- }
182
 
183
- /**
184
- * Make private properties checkable for backwards compatibility.
185
- *
186
- * @since 4.0.0
187
- * @access public
188
- *
189
- * @param string $name Property to check if set.
190
- * @return bool Whether the property is set.
191
- */
192
- public function __isset( $name ) {
193
- if ( in_array( $name, $this->compat_fields ) ) {
194
- return isset( $this->$name );
 
 
195
  }
196
- }
197
 
198
- /**
199
- * Make private properties un-settable for backwards compatibility.
200
- *
201
- * @since 4.0.0
202
- * @access public
203
- *
204
- * @param string $name Property to unset.
205
- */
206
- public function __unset( $name ) {
207
- if ( in_array( $name, $this->compat_fields ) ) {
208
- unset( $this->$name );
 
 
209
  }
210
- }
211
 
212
- /**
213
- * Make private/protected methods readable for backwards compatibility.
214
- *
215
- * @since 4.0.0
216
- * @access public
217
- *
218
- * @param callable $name Method to call.
219
- * @param array $arguments Arguments to pass when calling.
220
- * @return mixed|bool Return value of the callback, false otherwise.
221
- */
222
- public function __call( $name, $arguments ) {
223
- if ( in_array( $name, $this->compat_methods ) ) {
224
- return call_user_func_array( array( $this, $name ), $arguments );
225
  }
226
- return false;
227
- }
228
 
229
- /**
230
- * Checks the current user's permissions
231
- *
232
- * @since 3.1.0
233
- * @access public
234
- * @abstract
235
- */
236
- public function ajax_user_can() {
237
- die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
238
- }
 
 
 
 
 
 
239
 
240
- /**
241
- * Prepares the list of items for displaying.
242
- * @uses WP_List_Table::set_pagination_args()
243
- *
244
- * @since 3.1.0
245
- * @access public
246
- * @abstract
247
- */
248
- public function prepare_items() {
249
- die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
250
- }
251
 
252
- /**
253
- * An internal method that sets all the necessary pagination arguments
254
- *
255
- * @param array $args An associative array with information about the pagination
256
- * @access protected
257
- */
258
- protected function set_pagination_args( $args ) {
259
- $args = wp_parse_args( $args, array(
260
- 'total_items' => 0,
261
- 'total_pages' => 0,
262
- 'per_page' => 0,
263
- ) );
264
-
265
- if ( !$args['total_pages'] && $args['per_page'] > 0 )
266
- $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
267
-
268
- // Redirect if page number is invalid and headers are not already sent.
269
- if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
270
- wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
271
- exit;
272
  }
273
 
274
- $this->_pagination_args = $args;
275
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
276
 
277
- /**
278
- * Access the pagination args.
279
- *
280
- * @since 3.1.0
281
- * @access public
282
- *
283
- * @param string $key Pagination argument to retrieve. Common values include 'total_items',
284
- * 'total_pages', 'per_page', or 'infinite_scroll'.
285
- * @return int Number of items that correspond to the given pagination argument.
286
- */
287
- public function get_pagination_arg( $key ) {
288
- if ( 'page' == $key )
289
- return $this->get_pagenum();
290
-
291
- if ( isset( $this->_pagination_args[$key] ) )
292
- return $this->_pagination_args[$key];
293
- }
294
 
295
- /**
296
- * Whether the table has items to display or not
297
- *
298
- * @since 3.1.0
299
- * @access public
300
- *
301
- * @return bool
302
- */
303
- public function has_items() {
304
- return !empty( $this->items );
305
- }
306
 
307
- /**
308
- * Message to be displayed when there are no items
309
- *
310
- * @since 3.1.0
311
- * @access public
312
- */
313
- public function no_items() {
314
- _e( 'No items found.' );
315
- }
316
 
317
- /**
318
- * Display the search box.
319
- *
320
- * @since 3.1.0
321
- * @access public
322
- *
323
- * @param string $text The search button text
324
- * @param string $input_id The search input id
325
- */
326
- public function search_box( $text, $input_id ) {
327
- if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
328
- return;
329
-
330
- $input_id = $input_id . '-search-input';
331
-
332
- if ( ! empty( $_REQUEST['orderby'] ) )
333
- echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '">';
334
- if ( ! empty( $_REQUEST['order'] ) )
335
- echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '">';
336
- if ( ! empty( $_REQUEST['post_mime_type'] ) )
337
- echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '">';
338
- if ( ! empty( $_REQUEST['detached'] ) )
339
- echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '">';
340
- ?>
341
- <p class="search-box">
342
- <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
343
- <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>">
344
- <?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
345
- </p>
346
- <?php
347
- }
348
 
349
- /**
350
- * Get an associative array ( id => link ) with the list
351
- * of views available on this table.
352
- *
353
- * @since 3.1.0
354
- * @access protected
355
- *
356
- * @return array
357
- */
358
- protected function get_views() {
359
- return array();
360
- }
361
 
362
- /**
363
- * Display the list of views available on this table.
364
- *
365
- * @since 3.1.0
366
- * @access public
367
- */
368
- public function views() {
369
- $views = $this->get_views();
370
  /**
371
- * Filter the list of available list table views.
372
  *
373
- * The dynamic portion of the hook name, `$this->screen->id`, refers
374
- * to the ID of the current screen, usually a string.
375
  *
376
- * @since 3.5.0
 
 
 
 
 
 
 
377
  *
378
- * @param array $views An array of available list table views.
 
379
  */
380
- $views = apply_filters( "views_{$this->screen->id}", $views );
 
 
381
 
382
- if ( empty( $views ) )
383
- return;
 
 
 
 
 
 
 
 
 
 
 
384
 
385
- echo "<ul class='subsubsub'>\n";
386
- foreach ( $views as $class => $view ) {
387
- $views[ $class ] = "\t<li class='$class'>$view";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  }
389
- echo implode( " |</li>\n", $views ) . "</li>\n";
390
- echo "</ul>";
391
- }
392
 
393
- /**
394
- * Get an associative array ( option_name => option_title ) with the list
395
- * of bulk actions available on this table.
396
- *
397
- * @since 3.1.0
398
- * @access protected
399
- *
400
- * @return array
401
- */
402
- protected function get_bulk_actions() {
403
- return array();
404
- }
405
 
406
- /**
407
- * Display the bulk actions dropdown.
408
- *
409
- * @since 3.1.0
410
- * @access protected
411
- *
412
- * @param string $which The location of the bulk actions: 'top' or 'bottom'.
413
- * This is designated as optional for backwards-compatibility.
414
- */
415
- protected function bulk_actions( $which = '' ) {
416
- if ( is_null( $this->_actions ) ) {
417
- $no_new_actions = $this->_actions = $this->get_bulk_actions();
418
  /**
419
- * Filter the list table Bulk Actions drop-down.
420
  *
421
  * The dynamic portion of the hook name, `$this->screen->id`, refers
422
  * to the ID of the current screen, usually a string.
423
  *
424
- * This filter can currently only be used to remove bulk actions.
425
- *
426
  * @since 3.5.0
427
  *
428
- * @param array $actions An array of the available bulk actions.
429
  */
430
- $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
431
- $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
432
- $two = '';
433
- } else {
434
- $two = '2';
435
- }
436
 
437
- if ( empty( $this->_actions ) )
438
- return;
439
-
440
- echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . __( 'Select bulk action' ) . "</label>";
441
- echo "<select name='action$two' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
442
- echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";
443
 
444
- foreach ( $this->_actions as $name => $title ) {
445
- $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';
 
 
 
 
 
446
 
447
- echo "\t<option value='$name'$class>$title</option>\n";
 
 
 
 
 
 
 
 
 
 
448
  }
449
 
450
- echo "</select>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
 
452
- submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
453
- echo "\n";
454
- }
455
 
456
- /**
457
- * Get the current action selected from the bulk actions dropdown.
458
- *
459
- * @since 3.1.0
460
- * @access public
461
- *
462
- * @return string|bool The action name or False if no action was selected
463
- */
464
- public function current_action() {
465
- if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
466
- return false;
467
 
468
- if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
469
- return $_REQUEST['action'];
470
 
471
- if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
472
- return $_REQUEST['action2'];
473
 
474
- return false;
475
- }
476
 
477
- /**
478
- * Generate row actions div
479
- *
480
- * @since 3.1.0
481
- * @access protected
482
- *
483
- * @param array $actions The list of actions
484
- * @param bool $always_visible Whether the actions should be always visible
485
- * @return string
486
- */
487
- protected function row_actions( $actions, $always_visible = false ) {
488
- $action_count = count( $actions );
489
- $i = 0;
490
-
491
- if ( !$action_count )
492
- return '';
493
-
494
- $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
495
- foreach ( $actions as $action => $link ) {
496
- ++$i;
497
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
498
- $out .= "<span class='$action'>$link$sep</span>";
499
  }
500
- $out .= '</div>';
501
 
502
- return $out;
503
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504
 
505
- /**
506
- * Display a monthly dropdown for filtering items
507
- *
508
- * @since 3.1.0
509
- * @access protected
510
- *
511
- * @param string $post_type
512
- */
513
- protected function months_dropdown( $post_type ) {
514
- global $wpdb, $wp_locale;
515
 
516
  /**
517
- * Filter whether to remove the 'Months' drop-down from the post list table.
518
  *
519
- * @since 4.2.0
 
520
  *
521
- * @param bool $disable Whether to disable the drop-down. Default false.
522
- * @param string $post_type The post type.
 
523
  */
524
- if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
525
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  }
527
 
528
- $months = $wpdb->get_results( $wpdb->prepare( "
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
  SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
530
  FROM $wpdb->posts
531
  WHERE post_type = %s
532
  ORDER BY post_date DESC
533
- ", $post_type ) );
 
 
 
534
 
535
- /**
536
- * Filter the 'Months' drop-down results.
537
- *
538
- * @since 3.7.0
539
- *
540
- * @param object $months The months drop-down query results.
541
- * @param string $post_type The post type.
542
- */
543
- $months = apply_filters( 'months_dropdown_results', $months, $post_type );
544
 
545
- $month_count = count( $months );
546
 
547
- if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
548
- return;
 
549
 
550
- $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
551
- ?>
552
- <label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
553
  <select name="m" id="filter-by-date">
554
- <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
555
- <?php
556
- foreach ( $months as $arc_row ) {
557
- if ( 0 == $arc_row->year )
558
- continue;
559
-
560
- $month = zeroise( $arc_row->month, 2 );
561
- $year = $arc_row->year;
562
-
563
- printf( "<option %s value='%s'>%s</option>\n",
564
- selected( $m, $year . $month, false ),
565
- esc_attr( $arc_row->year . $month ),
566
- /* translators: 1: month name, 2: 4-digit year */
567
- sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
568
- );
569
- }
570
- ?>
 
 
571
  </select>
572
- <?php
573
- }
574
 
575
- /**
576
- * Display a view switcher
577
- *
578
- * @since 3.1.0
579
- * @access protected
580
- *
581
- * @param string $current_mode
582
- */
583
- protected function view_switcher( $current_mode ) {
584
- ?>
585
  <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>">
586
  <div class="view-switch">
587
- <?php
588
  foreach ( $this->modes as $mode => $title ) {
589
  $classes = array( 'view-' . $mode );
590
- if ( $current_mode == $mode )
591
  $classes[] = 'current';
 
592
  printf(
593
  "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
594
  esc_url( add_query_arg( 'mode', $mode ) ),
@@ -596,552 +640,573 @@ class Strong_Testimonials_List_Table {
596
  $title
597
  );
598
  }
599
- ?>
600
  </div>
601
- <?php
602
- }
603
 
604
- /**
605
- * Display a comment count bubble
606
- *
607
- * @since 3.1.0
608
- * @access protected
609
- *
610
- * @param int $post_id The post ID.
611
- * @param int $pending_comments Number of pending comments.
612
- */
613
- protected function comments_bubble( $post_id, $pending_comments ) {
614
- $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
615
-
616
- if ( $pending_comments )
617
- echo '<strong>';
618
-
619
- echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . "</span></a>";
620
-
621
- if ( $pending_comments )
622
- echo '</strong>';
623
- }
624
 
625
- /**
626
- * Get the current page number
627
- *
628
- * @since 3.1.0
629
- * @access public
630
- *
631
- * @return int
632
- */
633
- public function get_pagenum() {
634
- $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
635
-
636
- if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
637
- $pagenum = $this->_pagination_args['total_pages'];
638
-
639
- return max( 1, $pagenum );
640
- }
641
 
642
- /**
643
- * Get number of items to display on a single page
644
- *
645
- * @since 3.1.0
646
- * @access protected
647
- *
648
- * @param string $option
649
- * @param int $default
650
- * @return int
651
- */
652
- protected function get_items_per_page( $option, $default = 20 ) {
653
- $per_page = (int) get_user_option( $option );
654
- if ( empty( $per_page ) || $per_page < 1 )
655
- $per_page = $default;
656
 
657
  /**
658
- * Filter the number of items to be displayed on each page of the list table.
659
- *
660
- * The dynamic hook name, $option, refers to the `per_page` option depending
661
- * on the type of list table in use. Possible values include: 'edit_comments_per_page',
662
- * 'sites_network_per_page', 'site_themes_network_per_page', 'themes_network_per_page',
663
- * 'users_network_per_page', 'edit_post_per_page', 'edit_page_per_page',
664
- * 'edit_{$post_type}_per_page', etc.
665
  *
666
- * @since 2.9.0
 
667
  *
668
- * @param int $per_page Number of items to be displayed. Default 20.
669
  */
670
- return (int) apply_filters( $option, $per_page );
671
- }
672
 
673
- /**
674
- * Display the pagination.
675
- *
676
- * @since 3.1.0
677
- * @access protected
678
- *
679
- * @param string $which
680
- */
681
- protected function pagination( $which ) {
682
- if ( empty( $this->_pagination_args ) ) {
683
- return;
684
  }
685
 
686
- $total_items = $this->_pagination_args['total_items'];
687
- $total_pages = $this->_pagination_args['total_pages'];
688
- $infinite_scroll = false;
689
- if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
690
- $infinite_scroll = $this->_pagination_args['infinite_scroll'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
691
  }
692
 
693
- $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
 
 
 
 
 
 
 
 
 
 
 
694
 
695
- $current = $this->get_pagenum();
 
 
 
 
 
696
 
697
- $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
698
 
699
- $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
700
 
701
- $page_links = array();
702
 
703
- $disable_first = $disable_last = '';
704
- if ( $current == 1 ) {
705
- $disable_first = ' disabled';
706
- }
707
- if ( $current == $total_pages ) {
708
- $disable_last = ' disabled';
709
- }
710
- $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
711
- 'first-page' . $disable_first,
712
- esc_attr__( 'Go to the first page' ),
713
- esc_url( remove_query_arg( 'paged', $current_url ) ),
714
- '&laquo;'
715
- );
716
 
717
- $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
718
- 'prev-page' . $disable_first,
719
- esc_attr__( 'Go to the previous page' ),
720
- esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
721
- '&lsaquo;'
722
- );
723
 
724
- if ( 'bottom' == $which ) {
725
- $html_current_page = $current;
726
- } else {
727
- $html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' title='%s' type='text' name='paged' value='%s' size='%d'>",
728
- '<label for="current-page-selector" class="screen-reader-text">' . __( 'Select Page' ) . '</label>',
729
- esc_attr__( 'Current page' ),
730
- $current,
731
- strlen( $total_pages )
 
 
 
 
 
732
  );
733
- }
734
- $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
735
- $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
736
-
737
- $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
738
- 'next-page' . $disable_last,
739
- esc_attr__( 'Go to the next page' ),
740
- esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
741
- '&rsaquo;'
742
- );
743
-
744
- $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
745
- 'last-page' . $disable_last,
746
- esc_attr__( 'Go to the last page' ),
747
- esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
748
- '&raquo;'
749
- );
750
 
751
- $pagination_links_class = 'pagination-links';
752
- if ( ! empty( $infinite_scroll ) ) {
753
- $pagination_links_class = ' hide-if-js';
754
- }
755
- $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
 
 
756
 
757
- if ( $total_pages ) {
758
- $page_class = $total_pages < 2 ? ' one-page' : '';
759
- } else {
760
- $page_class = ' no-pages';
761
- }
762
- $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
763
 
764
- echo $this->_pagination;
765
- }
 
 
 
 
 
766
 
767
- /**
768
- * Get a list of columns. The format is:
769
- * 'internal-name' => 'Title'
770
- *
771
- * @since 3.1.0
772
- * @access public
773
- * @abstract
774
- *
775
- * @return array
776
- */
777
- public function get_columns() {
778
- die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
779
- }
780
 
781
- /**
782
- * Get a list of sortable columns. The format is:
783
- * 'internal-name' => 'orderby'
784
- * or
785
- * 'internal-name' => array( 'orderby', true )
786
- *
787
- * The second format will make the initial sorting order be descending
788
- *
789
- * @since 3.1.0
790
- * @access protected
791
- *
792
- * @return array
793
- */
794
- protected function get_sortable_columns() {
795
- return array();
796
- }
797
 
798
- /**
799
- * Get a list of all, hidden and sortable columns, with filter applied
800
- *
801
- * @since 3.1.0
802
- * @access protected
803
- *
804
- * @return array
805
- */
806
- protected function get_column_info() {
807
- if ( isset( $this->_column_headers ) )
808
- return $this->_column_headers;
809
 
810
- $columns = get_column_headers( $this->screen );
811
- $hidden = get_hidden_columns( $this->screen );
 
 
 
 
 
 
 
 
 
 
 
812
 
813
- $sortable_columns = $this->get_sortable_columns();
814
  /**
815
- * Filter the list table sortable columns for a specific screen.
 
 
 
816
  *
817
- * The dynamic portion of the hook name, `$this->screen->id`, refers
818
- * to the ID of the current screen, usually a string.
819
  *
820
- * @since 3.5.0
 
821
  *
822
- * @param array $sortable_columns An array of sortable columns.
823
  */
824
- $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
 
 
825
 
826
- $sortable = array();
827
- foreach ( $_sortable as $id => $data ) {
828
- if ( empty( $data ) )
829
- continue;
 
 
 
 
 
 
 
 
830
 
831
- $data = (array) $data;
832
- if ( !isset( $data[1] ) )
833
- $data[1] = false;
834
 
835
- $sortable[$id] = $data;
836
- }
 
 
 
 
 
 
 
 
 
 
837
 
838
- $this->_column_headers = array( $columns, $hidden, $sortable );
 
 
 
 
839
 
840
- return $this->_column_headers;
841
- }
 
 
842
 
843
- /**
844
- * Return number of visible columns
845
- *
846
- * @since 3.1.0
847
- * @access public
848
- *
849
- * @return int
850
- */
851
- public function get_column_count() {
852
- list ( $columns, $hidden ) = $this->get_column_info();
853
- $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
854
- return count( $columns ) - count( $hidden );
855
- }
856
 
857
- /**
858
- * Print column headers, accounting for hidden and sortable columns.
859
- *
860
- * @since 3.1.0
861
- * @access public
862
- *
863
- * @param bool $with_id Whether to set the id attribute or not
864
- */
865
- public function print_column_headers( $with_id = true ) {
866
- list( $columns, $hidden, $sortable ) = $this->get_column_info();
867
-
868
- $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
869
- $current_url = remove_query_arg( 'paged', $current_url );
870
-
871
- if ( isset( $_GET['orderby'] ) )
872
- $current_orderby = $_GET['orderby'];
873
- else
874
- $current_orderby = '';
875
-
876
- if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
877
- $current_order = 'desc';
878
- else
879
- $current_order = 'asc';
880
-
881
- if ( ! empty( $columns['cb'] ) ) {
882
- static $cb_counter = 1;
883
- $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
884
- . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox">';
885
- $cb_counter++;
886
  }
887
 
888
- foreach ( $columns as $column_key => $column_display_name ) {
889
- $class = array( 'manage-column', "column-$column_key" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
890
 
891
- $style = '';
892
- if ( in_array( $column_key, $hidden ) )
893
- $style = 'display:none;';
 
 
894
 
895
- $style = ' style="' . $style . '"';
 
 
 
 
896
 
897
- if ( 'cb' == $column_key )
898
- $class[] = 'check-column';
899
- elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
900
- $class[] = 'num';
 
 
901
 
902
- if ( isset( $sortable[$column_key] ) ) {
903
- list( $orderby, $desc_first ) = $sortable[$column_key];
904
 
905
- if ( $current_orderby == $orderby ) {
906
- $order = 'asc' == $current_order ? 'desc' : 'asc';
907
- $class[] = 'sorted';
908
- $class[] = $current_order;
909
- } else {
910
- $order = $desc_first ? 'desc' : 'asc';
911
- $class[] = 'sortable';
912
- $class[] = $desc_first ? 'asc' : 'desc';
913
  }
914
 
915
- $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
916
- }
917
 
918
- $id = $with_id ? "id='$column_key'" : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
919
 
920
- if ( !empty( $class ) )
921
- $class = "class='" . join( ' ', $class ) . "'";
 
 
922
 
923
- echo "<th scope='col' $id $class $style>$column_display_name</th>";
 
 
 
 
 
924
  }
925
- }
926
 
927
- /**
928
- * Display the table
929
- *
930
- * @since 3.1.0
931
- * @access public
932
- */
933
- public function display() {
934
- $singular = $this->_args['singular'];
935
 
936
- $this->display_tablenav( 'top' );
937
 
938
- ?>
939
  <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
940
  <thead>
941
  <tr>
942
- <?php $this->print_column_headers(); ?>
943
  </tr>
944
  </thead>
945
 
946
- <tbody id="the-list"<?php
947
- if ( $singular ) {
948
- echo " data-wp-lists='list:$singular'";
949
- } ?>>
950
- <?php $this->display_rows_or_placeholder(); ?>
 
 
 
951
  </tbody>
952
 
953
  <tfoot>
954
  <tr>
955
- <?php $this->print_column_headers( false ); ?>
956
  </tr>
957
  </tfoot>
958
 
959
  </table>
960
- <?php
961
- $this->display_tablenav( 'bottom' );
962
- }
963
 
964
- /**
965
- * Get a list of CSS classes for the list table table tag.
966
- *
967
- * @since 3.1.0
968
- * @access protected
969
- *
970
- * @return array List of CSS classes for the table tag.
971
- */
972
- protected function get_table_classes() {
973
- return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
974
- }
975
 
976
- /**
977
- * Generate the table navigation above or below the table
978
- *
979
- * @since 3.1.0
980
- * @access protected
981
- * @param string $which
982
- */
983
- protected function display_tablenav( $which ) {
984
- if ( 'top' == $which )
985
- wp_nonce_field( 'bulk-' . $this->_args['plural'] );
986
- ?>
 
987
  <div class="tablenav <?php echo esc_attr( $which ); ?>">
988
 
989
  <div class="alignleft actions bulkactions">
990
  <?php $this->bulk_actions( $which ); ?>
991
  </div>
992
- <?php
993
- $this->extra_tablenav( $which );
994
- $this->pagination( $which );
995
- ?>
996
 
997
  <br class="clear">
998
  </div>
999
- <?php
1000
- }
1001
 
1002
- /**
1003
- * Extra controls to be displayed between bulk actions and pagination
1004
- *
1005
- * @since 3.1.0
1006
- * @access protected
1007
- *
1008
- * @param string $which
1009
- */
1010
- protected function extra_tablenav( $which ) {}
1011
-
1012
- /**
1013
- * Generate the tbody element for the list table.
1014
- *
1015
- * @since 3.1.0
1016
- * @access public
1017
- */
1018
- public function display_rows_or_placeholder() {
1019
- if ( $this->has_items() ) {
1020
- $this->display_rows();
1021
- } else {
1022
- echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
1023
- $this->no_items();
1024
- echo '</td></tr>';
 
1025
  }
1026
- }
1027
 
1028
- /**
1029
- * Generate the table rows
1030
- *
1031
- * @since 3.1.0
1032
- * @access public
1033
- */
1034
- public function display_rows() {
1035
- foreach ( $this->items as $item )
1036
- $this->single_row( $item );
1037
- }
 
1038
 
1039
- /**
1040
- * Generates content for a single row of the table
1041
- *
1042
- * @since 3.1.0
1043
- * @access public
1044
- *
1045
- * @param object $item The current item
1046
- */
1047
- public function single_row( $item ) {
1048
- echo '<tr>';
1049
- $this->single_row_columns( $item );
1050
- echo '</tr>';
1051
- }
1052
 
1053
- protected function column_default( $item, $column_name ) {}
1054
 
1055
- protected function column_cb( $item ) {}
1056
 
1057
- /**
1058
- * Generates the columns for a single row of the table
1059
- *
1060
- * @since 3.1.0
1061
- * @access protected
1062
- *
1063
- * @param object $item The current item
1064
- */
1065
- protected function single_row_columns( $item ) {
1066
- list( $columns, $hidden ) = $this->get_column_info();
1067
 
1068
- foreach ( $columns as $column_name => $column_display_name ) {
1069
- $class = "class='$column_name column-$column_name'";
1070
 
1071
- $style = '';
1072
- if ( in_array( $column_name, $hidden ) )
1073
- $style = ' style="display:none;"';
 
1074
 
1075
- $attributes = "$class$style";
1076
 
1077
- if ( 'cb' == $column_name ) {
1078
- echo '<th scope="row" class="check-column">';
1079
- echo $this->column_cb( $item );
1080
- echo '</th>';
1081
- }
1082
- elseif ( method_exists( $this, 'column_' . $column_name ) ) {
1083
- echo "<td $attributes>";
1084
- echo call_user_func( array( $this, 'column_' . $column_name ), $item );
1085
- echo "</td>";
1086
- }
1087
- else {
1088
- echo "<td $attributes>";
1089
- echo $this->column_default( $item, $column_name );
1090
- echo "</td>";
1091
  }
1092
  }
1093
- }
1094
 
1095
- /**
1096
- * Handle an incoming ajax request (called from admin-ajax.php)
1097
- *
1098
- * @since 3.1.0
1099
- * @access public
1100
- */
1101
- public function ajax_response() {
1102
- $this->prepare_items();
1103
-
1104
- ob_start();
1105
- if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
1106
- $this->display_rows();
1107
- } else {
1108
- $this->display_rows_or_placeholder();
1109
- }
1110
 
1111
- $rows = ob_get_clean();
1112
 
1113
- $response = array( 'rows' => $rows );
1114
 
1115
- if ( isset( $this->_pagination_args['total_items'] ) ) {
1116
- $response['total_items_i18n'] = sprintf(
1117
- _n( '1 item', '%s items', $this->_pagination_args['total_items'] ),
1118
- number_format_i18n( $this->_pagination_args['total_items'] )
1119
- );
1120
- }
1121
- if ( isset( $this->_pagination_args['total_pages'] ) ) {
1122
- $response['total_pages'] = $this->_pagination_args['total_pages'];
1123
- $response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
1124
- }
1125
 
1126
- die( wp_json_encode( $response ) );
1127
- }
1128
 
1129
- /**
1130
- * Send required variables to JavaScript land
1131
- *
1132
- * @access public
1133
- */
1134
- public function _js_vars() {
1135
- $args = array(
1136
- 'class' => get_class( $this ),
1137
- 'screen' => array(
1138
- 'id' => $this->screen->id,
1139
- 'base' => $this->screen->base,
1140
- )
1141
- );
1142
 
1143
- printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
 
1144
  }
1145
- }
1146
 
1147
- endif;
10
  * @access private
11
  */
12
 
13
+ if ( ! class_exists( 'Strong_Testimonials_List_Table' ) ) :
14
+
15
+ class Strong_Testimonials_List_Table {
16
+
17
+ /**
18
+ * The current list of items
19
+ *
20
+ * @since 3.1.0
21
+ * @var array
22
+ * @access public
23
+ */
24
+ public $items;
25
+
26
+ /**
27
+ * Various information about the current table
28
+ *
29
+ * @since 3.1.0
30
+ * @var array
31
+ * @access protected
32
+ */
33
+ protected $_args;
34
+
35
+ /**
36
+ * Various information needed for displaying the pagination
37
+ *
38
+ * @since 3.1.0
39
+ * @var array
40
+ */
41
+ protected $_pagination_args = array();
42
+
43
+ /**
44
+ * The current screen
45
+ *
46
+ * @since 3.1.0
47
+ * @var object
48
+ * @access protected
49
+ */
50
+ protected $screen;
51
+
52
+ /**
53
+ * Cached bulk actions
54
+ *
55
+ * @since 3.1.0
56
+ * @var array
57
+ * @access private
58
+ */
59
+ private $_actions;
60
+
61
+ /**
62
+ * Cached pagination output
63
+ *
64
+ * @since 3.1.0
65
+ * @var string
66
+ * @access private
67
+ */
68
+ private $_pagination;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
+ /**
71
+ * The view switcher modes.
72
+ *
73
+ * @since 4.1.0
74
+ * @var array
75
+ * @access protected
76
+ */
77
+ protected $modes = array();
78
+
79
+ /**
80
+ * Stores the value returned by ->get_column_info()
81
+ *
82
+ * @var array
83
+ */
84
+ protected $_column_headers;
85
+
86
+ protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
87
+
88
+ protected $compat_methods = array(
89
+ 'set_pagination_args',
90
+ 'get_views',
91
+ 'get_bulk_actions',
92
+ 'bulk_actions',
93
+ 'row_actions',
94
+ 'months_dropdown',
95
+ 'view_switcher',
96
+ 'comments_bubble',
97
+ 'get_items_per_page',
98
+ 'pagination',
99
+ 'get_sortable_columns',
100
+ 'get_column_info',
101
+ 'get_table_classes',
102
+ 'display_tablenav',
103
+ 'extra_tablenav',
104
+ 'single_row_columns',
105
+ );
106
+
107
+ /**
108
+ * Constructor.
109
+ *
110
+ * The child class should call this constructor from its own constructor to override
111
+ * the default $args.
112
+ *
113
+ * @since 3.1.0
114
+ * @access public
115
+ *
116
+ * @param array|string $args {
117
+ * Array or string of arguments.
118
+ *
119
+ * @type string $plural Plural value used for labels and the objects being listed.
120
+ * This affects things such as CSS class-names and nonces used
121
+ * in the list table, e.g. 'posts'. Default empty.
122
+ * @type string $singular Singular label for an object being listed, e.g. 'post'.
123
+ * Default empty
124
+ * @type bool $ajax Whether the list table supports AJAX. This includes loading
125
+ * and sorting data, for example. If true, the class will call
126
+ * the {@see _js_vars()} method in the footer to provide variables
127
+ * to any scripts handling AJAX events. Default false.
128
+ * @type string $screen String containing the hook name used to determine the current
129
+ * screen. If left null, the current screen will be automatically set.
130
+ * Default null.
131
+ * }
132
+ */
133
+ public function __construct( $args = array() ) {
134
+ $args = wp_parse_args(
135
+ $args,
136
+ array(
137
+ 'plural' => '',
138
+ 'singular' => '',
139
+ 'ajax' => false,
140
+ 'screen' => null,
141
+ )
142
  );
 
 
143
 
144
+ $this->screen = convert_to_screen( $args['screen'] );
145
+
146
+ add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
147
+
148
+ if ( ! $args['plural'] ) {
149
+ $args['plural'] = $this->screen->base;
150
+ }
151
+
152
+ $args['plural'] = sanitize_key( $args['plural'] );
153
+ $args['singular'] = sanitize_key( $args['singular'] );
154
+
155
+ $this->_args = $args;
156
+
157
+ if ( $args['ajax'] ) {
158
+ // wp_enqueue_script( 'list-table' );
159
+ add_action( 'admin_footer', array( $this, '_js_vars' ) );
160
+ }
161
+
162
+ if ( empty( $this->modes ) ) {
163
+ $this->modes = array(
164
+ 'list' => __( 'List View', 'strong-testimonials' ),
165
+ 'excerpt' => __( 'Excerpt View', 'strong-testimonials' ),
166
+ );
167
+ }
168
  }
 
169
 
170
+ /**
171
+ * Make private properties readable for backwards compatibility.
172
+ *
173
+ * @since 4.0.0
174
+ * @access public
175
+ *
176
+ * @param string $name Property to get.
177
+ * @return mixed Property.
178
+ */
179
+ public function __get( $name ) {
180
+ if ( in_array( $name, $this->compat_fields ) ) {
181
+ return $this->$name;
182
+ }
183
  }
 
184
 
185
+ /**
186
+ * Make private properties settable for backwards compatibility.
187
+ *
188
+ * @since 4.0.0
189
+ * @access public
190
+ *
191
+ * @param string $name Property to check if set.
192
+ * @param mixed $value Property value.
193
+ * @return mixed Newly-set property.
194
+ */
195
+ public function __set( $name, $value ) {
196
+ if ( in_array( $name, $this->compat_fields ) ) {
197
+ return $this->$name = $value;
198
+ }
199
  }
 
200
 
201
+ /**
202
+ * Make private properties checkable for backwards compatibility.
203
+ *
204
+ * @since 4.0.0
205
+ * @access public
206
+ *
207
+ * @param string $name Property to check if set.
208
+ * @return bool Whether the property is set.
209
+ */
210
+ public function __isset( $name ) {
211
+ if ( in_array( $name, $this->compat_fields ) ) {
212
+ return isset( $this->$name );
213
+ }
214
  }
 
215
 
216
+ /**
217
+ * Make private properties un-settable for backwards compatibility.
218
+ *
219
+ * @since 4.0.0
220
+ * @access public
221
+ *
222
+ * @param string $name Property to unset.
223
+ */
224
+ public function __unset( $name ) {
225
+ if ( in_array( $name, $this->compat_fields ) ) {
226
+ unset( $this->$name );
227
+ }
 
228
  }
 
 
229
 
230
+ /**
231
+ * Make private/protected methods readable for backwards compatibility.
232
+ *
233
+ * @since 4.0.0
234
+ * @access public
235
+ *
236
+ * @param callable $name Method to call.
237
+ * @param array $arguments Arguments to pass when calling.
238
+ * @return mixed|bool Return value of the callback, false otherwise.
239
+ */
240
+ public function __call( $name, $arguments ) {
241
+ if ( in_array( $name, $this->compat_methods ) ) {
242
+ return call_user_func_array( array( $this, $name ), $arguments );
243
+ }
244
+ return false;
245
+ }
246
 
247
+ /**
248
+ * Checks the current user's permissions
249
+ *
250
+ * @since 3.1.0
251
+ * @access public
252
+ * @abstract
253
+ */
254
+ public function ajax_user_can() {
255
+ die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
256
+ }
 
257
 
258
+ /**
259
+ * Prepares the list of items for displaying.
260
+ * @uses WP_List_Table::set_pagination_args()
261
+ *
262
+ * @since 3.1.0
263
+ * @access public
264
+ * @abstract
265
+ */
266
+ public function prepare_items() {
267
+ die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
 
 
 
 
 
 
 
 
 
 
268
  }
269
 
270
+ /**
271
+ * An internal method that sets all the necessary pagination arguments
272
+ *
273
+ * @param array $args An associative array with information about the pagination
274
+ * @access protected
275
+ */
276
+ protected function set_pagination_args( $args ) {
277
+ $args = wp_parse_args(
278
+ $args,
279
+ array(
280
+ 'total_items' => 0,
281
+ 'total_pages' => 0,
282
+ 'per_page' => 0,
283
+ )
284
+ );
285
 
286
+ if ( ! $args['total_pages'] && $args['per_page'] > 0 ) {
287
+ $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
288
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
 
290
+ // Redirect if page number is invalid and headers are not already sent.
291
+ if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
292
+ wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
293
+ exit;
294
+ }
 
 
 
 
 
 
295
 
296
+ $this->_pagination_args = $args;
297
+ }
 
 
 
 
 
 
 
298
 
299
+ /**
300
+ * Access the pagination args.
301
+ *
302
+ * @since 3.1.0
303
+ * @access public
304
+ *
305
+ * @param string $key Pagination argument to retrieve. Common values include 'total_items',
306
+ * 'total_pages', 'per_page', or 'infinite_scroll'.
307
+ * @return int Number of items that correspond to the given pagination argument.
308
+ */
309
+ public function get_pagination_arg( $key ) {
310
+ if ( 'page' == $key ) {
311
+ return $this->get_pagenum();
312
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
 
314
+ if ( isset( $this->_pagination_args[ $key ] ) ) {
315
+ return $this->_pagination_args[ $key ];
316
+ }
317
+ }
 
 
 
 
 
 
 
 
318
 
 
 
 
 
 
 
 
 
319
  /**
320
+ * Whether the table has items to display or not
321
  *
322
+ * @since 3.1.0
323
+ * @access public
324
  *
325
+ * @return bool
326
+ */
327
+ public function has_items() {
328
+ return ! empty( $this->items );
329
+ }
330
+
331
+ /**
332
+ * Message to be displayed when there are no items
333
  *
334
+ * @since 3.1.0
335
+ * @access public
336
  */
337
+ public function no_items() {
338
+ esc_html_e( 'No items found.', 'strong-testimonials' );
339
+ }
340
 
341
+ /**
342
+ * Display the search box.
343
+ *
344
+ * @since 3.1.0
345
+ * @access public
346
+ *
347
+ * @param string $text The search button text
348
+ * @param string $input_id The search input id
349
+ */
350
+ public function search_box( $text, $input_id ) {
351
+ if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
352
+ return;
353
+ }
354
 
355
+ $input_id = $input_id . '-search-input';
356
+
357
+ if ( ! empty( $_REQUEST['orderby'] ) ) {
358
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '">';
359
+ }
360
+ if ( ! empty( $_REQUEST['order'] ) ) {
361
+ echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '">';
362
+ }
363
+ if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
364
+ echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '">';
365
+ }
366
+ if ( ! empty( $_REQUEST['detached'] ) ) {
367
+ echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '">';
368
+ }
369
+ ?>
370
+ <p class="search-box">
371
+ <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $text ); ?>:</label>
372
+ <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>">
373
+ <?php submit_button( $text, 'button', '', false, array( 'id' => 'search-submit' ) ); ?>
374
+ </p>
375
+ <?php
376
  }
 
 
 
377
 
378
+ /**
379
+ * Get an associative array ( id => link ) with the list
380
+ * of views available on this table.
381
+ *
382
+ * @since 3.1.0
383
+ * @access protected
384
+ *
385
+ * @return array
386
+ */
387
+ protected function get_views() {
388
+ return array();
389
+ }
390
 
391
+ /**
392
+ * Display the list of views available on this table.
393
+ *
394
+ * @since 3.1.0
395
+ * @access public
396
+ */
397
+ public function views() {
398
+ $views = $this->get_views();
 
 
 
 
399
  /**
400
+ * Filter the list of available list table views.
401
  *
402
  * The dynamic portion of the hook name, `$this->screen->id`, refers
403
  * to the ID of the current screen, usually a string.
404
  *
 
 
405
  * @since 3.5.0
406
  *
407
+ * @param array $views An array of available list table views.
408
  */
409
+ $views = apply_filters( "views_{$this->screen->id}", $views );
 
 
 
 
 
410
 
411
+ if ( empty( $views ) ) {
412
+ return;
413
+ }
 
 
 
414
 
415
+ echo "<ul class='subsubsub'>\n";
416
+ foreach ( $views as $class => $view ) {
417
+ $views[ $class ] = "\t<li class='$class'>$view";
418
+ }
419
+ echo implode( " |</li>\n", wp_kses_post( $views ) ) . "</li>\n";
420
+ echo '</ul>';
421
+ }
422
 
423
+ /**
424
+ * Get an associative array ( option_name => option_title ) with the list
425
+ * of bulk actions available on this table.
426
+ *
427
+ * @since 3.1.0
428
+ * @access protected
429
+ *
430
+ * @return array
431
+ */
432
+ protected function get_bulk_actions() {
433
+ return array();
434
  }
435
 
436
+ /**
437
+ * Display the bulk actions dropdown.
438
+ *
439
+ * @since 3.1.0
440
+ * @access protected
441
+ *
442
+ * @param string $which The location of the bulk actions: 'top' or 'bottom'.
443
+ * This is designated as optional for backwards-compatibility.
444
+ */
445
+ protected function bulk_actions( $which = '' ) {
446
+ if ( is_null( $this->_actions ) ) {
447
+ $no_new_actions = $this->_actions = $this->get_bulk_actions();
448
+ /**
449
+ * Filter the list table Bulk Actions drop-down.
450
+ *
451
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
452
+ * to the ID of the current screen, usually a string.
453
+ *
454
+ * This filter can currently only be used to remove bulk actions.
455
+ *
456
+ * @since 3.5.0
457
+ *
458
+ * @param array $actions An array of the available bulk actions.
459
+ */
460
+ $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
461
+ $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
462
+ $two = '';
463
+ } else {
464
+ $two = '2';
465
+ }
466
 
467
+ if ( empty( $this->_actions ) ) {
468
+ return;
469
+ }
470
 
471
+ echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . esc_html__( 'Select bulk action', 'strong-testimonials' ) . '</label>';
472
+ echo "<select name='action" . esc_attr( $two ) . "' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
473
+ echo "<option value='-1' selected='selected'>" . esc_html__( 'Bulk Actions', 'strong-testimonials' ) . "</option>\n";
 
 
 
 
 
 
 
 
474
 
475
+ foreach ( $this->_actions as $name => $title ) {
476
+ $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';
477
 
478
+ echo "\t<option value='$name'$class>$title</option>\n";
479
+ }
480
 
481
+ echo "</select>\n";
 
482
 
483
+ submit_button( __( 'Apply', 'strong-testimonials' ), 'action', '', false, array( 'id' => "doaction$two" ) );
484
+ echo "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  }
 
486
 
487
+ /**
488
+ * Get the current action selected from the bulk actions dropdown.
489
+ *
490
+ * @since 3.1.0
491
+ * @access public
492
+ *
493
+ * @return string|bool The action name or False if no action was selected
494
+ */
495
+ public function current_action() {
496
+ if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {
497
+ return false;
498
+ }
499
+
500
+ if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
501
+ return $_REQUEST['action'];
502
+ }
503
+
504
+ if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
505
+ return $_REQUEST['action2'];
506
+ }
507
 
508
+ return false;
509
+ }
 
 
 
 
 
 
 
 
510
 
511
  /**
512
+ * Generate row actions div
513
  *
514
+ * @since 3.1.0
515
+ * @access protected
516
  *
517
+ * @param array $actions The list of actions
518
+ * @param bool $always_visible Whether the actions should be always visible
519
+ * @return string
520
  */
521
+ protected function row_actions( $actions, $always_visible = false ) {
522
+ $action_count = count( $actions );
523
+ $i = 0;
524
+
525
+ if ( ! $action_count ) {
526
+ return '';
527
+ }
528
+
529
+ $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
530
+ foreach ( $actions as $action => $link ) {
531
+ ++$i;
532
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
533
+ $out .= "<span class='$action'>$link$sep</span>";
534
+ }
535
+ $out .= '</div>';
536
+
537
+ return $out;
538
  }
539
 
540
+ /**
541
+ * Display a monthly dropdown for filtering items
542
+ *
543
+ * @since 3.1.0
544
+ * @access protected
545
+ *
546
+ * @param string $post_type
547
+ */
548
+ protected function months_dropdown( $post_type ) {
549
+ global $wpdb, $wp_locale;
550
+
551
+ /**
552
+ * Filter whether to remove the 'Months' drop-down from the post list table.
553
+ *
554
+ * @since 4.2.0
555
+ *
556
+ * @param bool $disable Whether to disable the drop-down. Default false.
557
+ * @param string $post_type The post type.
558
+ */
559
+ if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
560
+ return;
561
+ }
562
+
563
+ $months = $wpdb->get_results(
564
+ $wpdb->prepare(
565
+ "
566
  SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
567
  FROM $wpdb->posts
568
  WHERE post_type = %s
569
  ORDER BY post_date DESC
570
+ ",
571
+ $post_type
572
+ )
573
+ );
574
 
575
+ /**
576
+ * Filter the 'Months' drop-down results.
577
+ *
578
+ * @since 3.7.0
579
+ *
580
+ * @param object $months The months drop-down query results.
581
+ * @param string $post_type The post type.
582
+ */
583
+ $months = apply_filters( 'months_dropdown_results', $months, $post_type );
584
 
585
+ $month_count = count( $months );
586
 
587
+ if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
588
+ return;
589
+ }
590
 
591
+ $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
592
+ ?>
593
+ <label for="filter-by-date" class="screen-reader-text"><?php esc_html_e( 'Filter by date', 'strong-testimonials' ); ?></label>
594
  <select name="m" id="filter-by-date">
595
+ <option<?php selected( $m, 0 ); ?> value="0"><?php esc_html_e( 'All dates', 'strong-testimonials' ); ?></option>
596
+ <?php
597
+ foreach ( $months as $arc_row ) {
598
+ if ( 0 == $arc_row->year ) {
599
+ continue;
600
+ }
601
+
602
+ $month = zeroise( $arc_row->month, 2 );
603
+ $year = $arc_row->year;
604
+
605
+ printf(
606
+ "<option %s value='%s'>%s</option>\n",
607
+ selected( $m, $year . $month, false ),
608
+ esc_attr( $arc_row->year . $month ),
609
+ /* translators: 1: month name, 2: 4-digit year */
610
+ sprintf( '%1$s %2$d', $wp_locale->get_month( $month ), $year )
611
+ );
612
+ }
613
+ ?>
614
  </select>
615
+ <?php
616
+ }
617
 
618
+ /**
619
+ * Display a view switcher
620
+ *
621
+ * @since 3.1.0
622
+ * @access protected
623
+ *
624
+ * @param string $current_mode
625
+ */
626
+ protected function view_switcher( $current_mode ) {
627
+ ?>
628
  <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>">
629
  <div class="view-switch">
630
+ <?php
631
  foreach ( $this->modes as $mode => $title ) {
632
  $classes = array( 'view-' . $mode );
633
+ if ( $current_mode == $mode ) {
634
  $classes[] = 'current';
635
+ }
636
  printf(
637
  "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
638
  esc_url( add_query_arg( 'mode', $mode ) ),
640
  $title
641
  );
642
  }
643
+ ?>
644
  </div>
645
+ <?php
646
+ }
647
 
648
+ /**
649
+ * Display a comment count bubble
650
+ *
651
+ * @since 3.1.0
652
+ * @access protected
653
+ *
654
+ * @param int $post_id The post ID.
655
+ * @param int $pending_comments Number of pending comments.
656
+ */
657
+ protected function comments_bubble( $post_id, $pending_comments ) {
658
+ $pending_phrase = sprintf( __( '%s pending', 'strong-testimonials' ), number_format( $pending_comments ) );
 
 
 
 
 
 
 
 
 
659
 
660
+ if ( $pending_comments ) {
661
+ echo '<strong>';
662
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
663
 
664
+ echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . '</span></a>';
665
+
666
+ if ( $pending_comments ) {
667
+ echo '</strong>';
668
+ }
669
+ }
 
 
 
 
 
 
 
 
670
 
671
  /**
672
+ * Get the current page number
 
 
 
 
 
 
673
  *
674
+ * @since 3.1.0
675
+ * @access public
676
  *
677
+ * @return int
678
  */
679
+ public function get_pagenum() {
680
+ $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
681
 
682
+ if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) {
683
+ $pagenum = $this->_pagination_args['total_pages'];
684
+ }
685
+
686
+ return max( 1, $pagenum );
 
 
 
 
 
 
687
  }
688
 
689
+ /**
690
+ * Get number of items to display on a single page
691
+ *
692
+ * @since 3.1.0
693
+ * @access protected
694
+ *
695
+ * @param string $option
696
+ * @param int $default
697
+ * @return int
698
+ */
699
+ protected function get_items_per_page( $option, $default = 20 ) {
700
+ $per_page = (int) get_user_option( $option );
701
+ if ( empty( $per_page ) || $per_page < 1 ) {
702
+ $per_page = $default;
703
+ }
704
+
705
+ /**
706
+ * Filter the number of items to be displayed on each page of the list table.
707
+ *
708
+ * The dynamic hook name, $option, refers to the `per_page` option depending
709
+ * on the type of list table in use. Possible values include: 'edit_comments_per_page',
710
+ * 'sites_network_per_page', 'site_themes_network_per_page', 'themes_network_per_page',
711
+ * 'users_network_per_page', 'edit_post_per_page', 'edit_page_per_page',
712
+ * 'edit_{$post_type}_per_page', etc.
713
+ *
714
+ * @since 2.9.0
715
+ *
716
+ * @param int $per_page Number of items to be displayed. Default 20.
717
+ */
718
+ return (int) apply_filters( $option, $per_page );
719
  }
720
 
721
+ /**
722
+ * Display the pagination.
723
+ *
724
+ * @since 3.1.0
725
+ * @access protected
726
+ *
727
+ * @param string $which
728
+ */
729
+ protected function pagination( $which ) {
730
+ if ( empty( $this->_pagination_args ) ) {
731
+ return;
732
+ }
733
 
734
+ $total_items = $this->_pagination_args['total_items'];
735
+ $total_pages = $this->_pagination_args['total_pages'];
736
+ $infinite_scroll = false;
737
+ if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
738
+ $infinite_scroll = $this->_pagination_args['infinite_scroll'];
739
+ }
740
 
741
+ $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items, 'strong-testimonials' ), number_format_i18n( $total_items ) ) . '</span>';
742
 
743
+ $current = $this->get_pagenum();
744
 
745
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
746
 
747
+ $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
 
 
 
 
 
 
 
 
 
 
 
 
748
 
749
+ $page_links = array();
 
 
 
 
 
750
 
751
+ $disable_first = $disable_last = '';
752
+ if ( $current == 1 ) {
753
+ $disable_first = ' disabled';
754
+ }
755
+ if ( $current == $total_pages ) {
756
+ $disable_last = ' disabled';
757
+ }
758
+ $page_links[] = sprintf(
759
+ "<a class='%s' title='%s' href='%s'>%s</a>",
760
+ 'first-page' . $disable_first,
761
+ esc_attr__( 'Go to the first page', 'strong-testimonials' ),
762
+ esc_url( remove_query_arg( 'paged', $current_url ) ),
763
+ '&laquo;'
764
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
 
766
+ $page_links[] = sprintf(
767
+ "<a class='%s' title='%s' href='%s'>%s</a>",
768
+ 'prev-page' . $disable_first,
769
+ esc_attr__( 'Go to the previous page', 'strong-testimonials' ),
770
+ esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
771
+ '&lsaquo;'
772
+ );
773
 
774
+ if ( 'bottom' == $which ) {
775
+ $html_current_page = $current;
776
+ } else {
777
+ $html_current_page = sprintf(
778
+ "%s<input class='current-page' id='current-page-selector' title='%s' type='text' name='paged' value='%s' size='%d'>",
779
+ '<label for="current-page-selector" class="screen-reader-text">' . __( 'Select Page', 'strong-testimonials' ) . '</label>',
780
+ esc_attr__( 'Current page', 'strong-testimonials' ),
781
+ $current,
782
+ strlen( $total_pages )
783
+ );
784
+ }
785
+ $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
786
+ $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging', 'strong-testimonials' ), $html_current_page, $html_total_pages ) . '</span>';
787
+
788
+ $page_links[] = sprintf(
789
+ "<a class='%s' title='%s' href='%s'>%s</a>",
790
+ 'next-page' . $disable_last,
791
+ esc_attr__( 'Go to the next page', 'strong-testimonials' ),
792
+ esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
793
+ '&rsaquo;'
794
+ );
795
 
796
+ $page_links[] = sprintf(
797
+ "<a class='%s' title='%s' href='%s'>%s</a>",
798
+ 'last-page' . $disable_last,
799
+ esc_attr__( 'Go to the last page', 'strong-testimonials' ),
800
+ esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
801
+ '&raquo;'
802
+ );
803
 
804
+ $pagination_links_class = 'pagination-links';
805
+ if ( ! empty( $infinite_scroll ) ) {
806
+ $pagination_links_class = ' hide-if-js';
807
+ }
808
+ $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
 
 
 
 
 
 
 
 
809
 
810
+ if ( $total_pages ) {
811
+ $page_class = $total_pages < 2 ? ' one-page' : '';
812
+ } else {
813
+ $page_class = ' no-pages';
814
+ }
815
+ $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
 
 
 
 
 
 
 
 
 
 
816
 
817
+ echo $this->_pagination;
818
+ }
 
 
 
 
 
 
 
 
 
819
 
820
+ /**
821
+ * Get a list of columns. The format is:
822
+ * 'internal-name' => 'Title'
823
+ *
824
+ * @since 3.1.0
825
+ * @access public
826
+ * @abstract
827
+ *
828
+ * @return array
829
+ */
830
+ public function get_columns() {
831
+ die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
832
+ }
833
 
 
834
  /**
835
+ * Get a list of sortable columns. The format is:
836
+ * 'internal-name' => 'orderby'
837
+ * or
838
+ * 'internal-name' => array( 'orderby', true )
839
  *
840
+ * The second format will make the initial sorting order be descending
 
841
  *
842
+ * @since 3.1.0
843
+ * @access protected
844
  *
845
+ * @return array
846
  */
847
+ protected function get_sortable_columns() {
848
+ return array();
849
+ }
850
 
851
+ /**
852
+ * Get a list of all, hidden and sortable columns, with filter applied
853
+ *
854
+ * @since 3.1.0
855
+ * @access protected
856
+ *
857
+ * @return array
858
+ */
859
+ protected function get_column_info() {
860
+ if ( isset( $this->_column_headers ) ) {
861
+ return $this->_column_headers;
862
+ }
863
 
864
+ $columns = get_column_headers( $this->screen );
865
+ $hidden = get_hidden_columns( $this->screen );
 
866
 
867
+ $sortable_columns = $this->get_sortable_columns();
868
+ /**
869
+ * Filter the list table sortable columns for a specific screen.
870
+ *
871
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
872
+ * to the ID of the current screen, usually a string.
873
+ *
874
+ * @since 3.5.0
875
+ *
876
+ * @param array $sortable_columns An array of sortable columns.
877
+ */
878
+ $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
879
 
880
+ $sortable = array();
881
+ foreach ( $_sortable as $id => $data ) {
882
+ if ( empty( $data ) ) {
883
+ continue;
884
+ }
885
 
886
+ $data = (array) $data;
887
+ if ( ! isset( $data[1] ) ) {
888
+ $data[1] = false;
889
+ }
890
 
891
+ $sortable[ $id ] = $data;
892
+ }
 
 
 
 
 
 
 
 
 
 
 
893
 
894
+ $this->_column_headers = array( $columns, $hidden, $sortable );
895
+
896
+ return $this->_column_headers;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
897
  }
898
 
899
+ /**
900
+ * Return number of visible columns
901
+ *
902
+ * @since 3.1.0
903
+ * @access public
904
+ *
905
+ * @return int
906
+ */
907
+ public function get_column_count() {
908
+ list ( $columns, $hidden ) = $this->get_column_info();
909
+ $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
910
+ return count( $columns ) - count( $hidden );
911
+ }
912
+
913
+ /**
914
+ * Print column headers, accounting for hidden and sortable columns.
915
+ *
916
+ * @since 3.1.0
917
+ * @access public
918
+ *
919
+ * @param bool $with_id Whether to set the id attribute or not
920
+ */
921
+ public function print_column_headers( $with_id = true ) {
922
+ list( $columns, $hidden, $sortable ) = $this->get_column_info();
923
+
924
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
925
+ $current_url = remove_query_arg( 'paged', $current_url );
926
 
927
+ if ( isset( $_GET['orderby'] ) ) {
928
+ $current_orderby = $_GET['orderby'];
929
+ } else {
930
+ $current_orderby = '';
931
+ }
932
 
933
+ if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) {
934
+ $current_order = 'desc';
935
+ } else {
936
+ $current_order = 'asc';
937
+ }
938
 
939
+ if ( ! empty( $columns['cb'] ) ) {
940
+ static $cb_counter = 1;
941
+ $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'strong-testimonials' ) . '</label>'
942
+ . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox">';
943
+ $cb_counter++;
944
+ }
945
 
946
+ foreach ( $columns as $column_key => $column_display_name ) {
947
+ $class = array( 'manage-column', "column-$column_key" );
948
 
949
+ $style = '';
950
+ if ( in_array( $column_key, $hidden ) ) {
951
+ $style = 'display:none;';
 
 
 
 
 
952
  }
953
 
954
+ $style = ' style="' . $style . '"';
 
955
 
956
+ if ( 'cb' == $column_key ) {
957
+ $class[] = 'check-column';
958
+ } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) {
959
+ $class[] = 'num';
960
+ }
961
+
962
+ if ( isset( $sortable[ $column_key ] ) ) {
963
+ list( $orderby, $desc_first ) = $sortable[ $column_key ];
964
+
965
+ if ( $current_orderby == $orderby ) {
966
+ $order = 'asc' == $current_order ? 'desc' : 'asc';
967
+ $class[] = 'sorted';
968
+ $class[] = $current_order;
969
+ } else {
970
+ $order = $desc_first ? 'desc' : 'asc';
971
+ $class[] = 'sortable';
972
+ $class[] = $desc_first ? 'asc' : 'desc';
973
+ }
974
 
975
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
976
+ }
977
+
978
+ $id = $with_id ? "id='$column_key'" : '';
979
 
980
+ if ( ! empty( $class ) ) {
981
+ $class = "class='" . join( ' ', $class ) . "'";
982
+ }
983
+
984
+ echo "<th scope='col' $id $class $style>$column_display_name</th>";
985
+ }
986
  }
 
987
 
988
+ /**
989
+ * Display the table
990
+ *
991
+ * @since 3.1.0
992
+ * @access public
993
+ */
994
+ public function display() {
995
+ $singular = $this->_args['singular'];
996
 
997
+ $this->display_tablenav( 'top' );
998
 
999
+ ?>
1000
  <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
1001
  <thead>
1002
  <tr>
1003
+ <?php $this->print_column_headers(); ?>
1004
  </tr>
1005
  </thead>
1006
 
1007
+ <tbody id="the-list"
1008
+ <?php
1009
+ if ( $singular ) {
1010
+ echo " data-wp-lists='list:$singular'";
1011
+ }
1012
+ ?>
1013
+ >
1014
+ <?php $this->display_rows_or_placeholder(); ?>
1015
  </tbody>
1016
 
1017
  <tfoot>
1018
  <tr>
1019
+ <?php $this->print_column_headers( false ); ?>
1020
  </tr>
1021
  </tfoot>
1022
 
1023
  </table>
1024
+ <?php
1025
+ $this->display_tablenav( 'bottom' );
1026
+ }
1027
 
1028
+ /**
1029
+ * Get a list of CSS classes for the list table table tag.
1030
+ *
1031
+ * @since 3.1.0
1032
+ * @access protected
1033
+ *
1034
+ * @return array List of CSS classes for the table tag.
1035
+ */
1036
+ protected function get_table_classes() {
1037
+ return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
1038
+ }
1039
 
1040
+ /**
1041
+ * Generate the table navigation above or below the table
1042
+ *
1043
+ * @since 3.1.0
1044
+ * @access protected
1045
+ * @param string $which
1046
+ */
1047
+ protected function display_tablenav( $which ) {
1048
+ if ( 'top' == $which ) {
1049
+ wp_nonce_field( 'bulk-' . $this->_args['plural'] );
1050
+ }
1051
+ ?>
1052
  <div class="tablenav <?php echo esc_attr( $which ); ?>">
1053
 
1054
  <div class="alignleft actions bulkactions">
1055
  <?php $this->bulk_actions( $which ); ?>
1056
  </div>
1057
+ <?php
1058
+ $this->extra_tablenav( $which );
1059
+ $this->pagination( $which );
1060
+ ?>
1061
 
1062
  <br class="clear">
1063
  </div>
1064
+ <?php
1065
+ }
1066
 
1067
+ /**
1068
+ * Extra controls to be displayed between bulk actions and pagination
1069
+ *
1070
+ * @since 3.1.0
1071
+ * @access protected
1072
+ *
1073
+ * @param string $which
1074
+ */
1075
+ protected function extra_tablenav( $which ) {}
1076
+
1077
+ /**
1078
+ * Generate the tbody element for the list table.
1079
+ *
1080
+ * @since 3.1.0
1081
+ * @access public
1082
+ */
1083
+ public function display_rows_or_placeholder() {
1084
+ if ( $this->has_items() ) {
1085
+ $this->display_rows();
1086
+ } else {
1087
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
1088
+ $this->no_items();
1089
+ echo '</td></tr>';
1090
+ }
1091
  }
 
1092
 
1093
+ /**
1094
+ * Generate the table rows
1095
+ *
1096
+ * @since 3.1.0
1097
+ * @access public
1098
+ */
1099
+ public function display_rows() {
1100
+ foreach ( $this->items as $item ) {
1101
+ $this->single_row( $item );
1102
+ }
1103
+ }
1104
 
1105
+ /**
1106
+ * Generates content for a single row of the table
1107
+ *
1108
+ * @since 3.1.0
1109
+ * @access public
1110
+ *
1111
+ * @param object $item The current item
1112
+ */
1113
+ public function single_row( $item ) {
1114
+ echo '<tr>';
1115
+ $this->single_row_columns( $item );
1116
+ echo '</tr>';
1117
+ }
1118
 
1119
+ protected function column_default( $item, $column_name ) {}
1120
 
1121
+ protected function column_cb( $item ) {}
1122
 
1123
+ /**
1124
+ * Generates the columns for a single row of the table
1125
+ *
1126
+ * @since 3.1.0
1127
+ * @access protected
1128
+ *
1129
+ * @param object $item The current item
1130
+ */
1131
+ protected function single_row_columns( $item ) {
1132
+ list( $columns, $hidden ) = $this->get_column_info();
1133
 
1134
+ foreach ( $columns as $column_name => $column_display_name ) {
1135
+ $class = "class='$column_name column-$column_name'";
1136
 
1137
+ $style = '';
1138
+ if ( in_array( $column_name, $hidden ) ) {
1139
+ $style = ' style="display:none;"';
1140
+ }
1141
 
1142
+ $attributes = "$class$style";
1143
 
1144
+ if ( 'cb' == $column_name ) {
1145
+ echo '<th scope="row" class="check-column">';
1146
+ echo $this->column_cb( $item );
1147
+ echo '</th>';
1148
+ } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
1149
+ echo "<td $attributes>";
1150
+ echo call_user_func( array( $this, 'column_' . $column_name ), $item );
1151
+ echo '</td>';
1152
+ } else {
1153
+ echo "<td $attributes>";
1154
+ echo $this->column_default( $item, $column_name );
1155
+ echo '</td>';
1156
+ }
 
1157
  }
1158
  }
 
1159
 
1160
+ /**
1161
+ * Handle an incoming ajax request (called from admin-ajax.php)
1162
+ *
1163
+ * @since 3.1.0
1164
+ * @access public
1165
+ */
1166
+ public function ajax_response() {
1167
+ $this->prepare_items();
1168
+
1169
+ ob_start();
1170
+ if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
1171
+ $this->display_rows();
1172
+ } else {
1173
+ $this->display_rows_or_placeholder();
1174
+ }
1175
 
1176
+ $rows = ob_get_clean();
1177
 
1178
+ $response = array( 'rows' => $rows );
1179
 
1180
+ if ( isset( $this->_pagination_args['total_items'] ) ) {
1181
+ $response['total_items_i18n'] = sprintf(
1182
+ _n( '1 item', '%s items', $this->_pagination_args['total_items'], 'strong-testimonials' ),
1183
+ number_format_i18n( $this->_pagination_args['total_items'] )
1184
+ );
1185
+ }
1186
+ if ( isset( $this->_pagination_args['total_pages'] ) ) {
1187
+ $response['total_pages'] = $this->_pagination_args['total_pages'];
1188
+ $response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
1189
+ }
1190
 
1191
+ die( wp_json_encode( $response ) );
1192
+ }
1193
 
1194
+ /**
1195
+ * Send required variables to JavaScript land
1196
+ *
1197
+ * @access public
1198
+ */
1199
+ public function _js_vars() {
1200
+ $args = array(
1201
+ 'class' => get_class( $this ),
1202
+ 'screen' => array(
1203
+ 'id' => $this->screen->id,
1204
+ 'base' => $this->screen->base,
1205
+ ),
1206
+ );
1207
 
1208
+ printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
1209
+ }
1210
  }
 
1211
 
1212
+ endif;
admin/class-strong-testimonials-page-shortcodes.php CHANGED
@@ -34,8 +34,8 @@ class Strong_Testimonials_Page_Shortcodes {
34
  <h2><?php _e( 'Testimonial Views', 'strong-testimonials' ); ?></h2>
35
 
36
  <p>
37
- <?php _e( 'Each view has a unique shortcode like <code>&#91;testimonial_view id="1"&#93;</code>.', 'strong-testimonials' ); ?>
38
- <?php printf( '<a href="%s">%s</a>', esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ), __( 'Go to views', 'strong-testimonials' ) ); ?>
39
  </p>
40
 
41
  <h2><?php _e( 'Testimonial Count', 'strong-testimonials' ); ?></h2>
34
  <h2><?php _e( 'Testimonial Views', 'strong-testimonials' ); ?></h2>
35
 
36
  <p>
37
+ <?php echo wp_kses_post( _e( 'Each view has a unique shortcode like ', 'strong-testimonials' ) ); ?><code>&#91;testimonial_view id="1"&#93;</code>.
38
+ <?php printf( '<a href="%s">%s</a>', esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ), esc_html__( 'Go to views', 'strong-testimonials' ) ); ?>
39
  </p>
40
 
41
  <h2><?php _e( 'Testimonial Count', 'strong-testimonials' ); ?></h2>
admin/class-strong-testimonials-post-editor.php CHANGED
@@ -210,12 +210,11 @@ class Strong_Testimonials_Post_Editor {
210
  <?php wpmtst_star_rating_form( $field, $rating, 'in-metabox', true, 'custom' ); ?>
211
  </span>
212
  <?php if ( ! $is_new ) : ?>
213
- <span class="edit-rating-buttons-2">
214
- <button type="button"
215
- class="zero button-link"><?php _e( 'Zero', 'strong-testimonials' ); ?></button>&nbsp;
216
- <button type="button" class="save button button-small"><?php _e( 'OK' ); ?></button>&nbsp;
217
- <button type="button" class="cancel button-link"><?php _e( 'Cancel' ); ?></button>
218
- </span>
219
  <?php endif; ?>
220
  </div>
221
 
@@ -226,12 +225,9 @@ class Strong_Testimonials_Post_Editor {
226
  </span>
227
 
228
  <?php if ( ! $is_new ) : ?>
229
- <span class="edit-rating-buttons-1">
230
- <button type="button"
231
- id=""
232
- class="edit-rating button button-small hide-if-no-js"
233
- aria-label="Edit rating"><?php _e( 'Edit' ); ?></button>
234
- </span>
235
  <?php endif; ?>
236
  </div>
237
 
210
  <?php wpmtst_star_rating_form( $field, $rating, 'in-metabox', true, 'custom' ); ?>
211
  </span>
212
  <?php if ( ! $is_new ) : ?>
213
+ <span class="edit-rating-buttons-2">
214
+ <button type="button" class="zero button-link"><?php esc_html_e( 'Zero', 'strong-testimonials' ); ?></button>&nbsp;
215
+ <button type="button" class="save button button-small"><?php esc_html_e( 'OK', 'strong-testimonials' ); ?></button>&nbsp;
216
+ <button type="button" class="cancel button-link"><?php esc_html_e( 'Cancel', 'strong-testimonials' ); ?></button>
217
+ </span>
 
218
  <?php endif; ?>
219
  </div>
220
 
225
  </span>
226
 
227
  <?php if ( ! $is_new ) : ?>
228
+ <span class="edit-rating-buttons-1">
229
+ <button type="button" id="" class="edit-rating button button-small hide-if-no-js" aria-label="Edit rating"><?php esc_html_e( 'Edit', 'strong-testimonials' ); ?></button>
230
+ </span>
 
 
 
231
  <?php endif; ?>
232
  </div>
233
 
admin/class-strong-testimonials-updater.php CHANGED
@@ -196,6 +196,11 @@ class Strong_Testimonials_Updater {
196
  */
197
  $this->update_log();
198
 
 
 
 
 
 
199
  delete_transient( 'wpmtst_update_in_progress' );
200
  }
201
 
@@ -225,6 +230,10 @@ class Strong_Testimonials_Updater {
225
  update_option( 'wpmtst_update_log', $log );
226
  }
227
 
 
 
 
 
228
  /**
229
  * Return admin role.
230
  *
196
  */
197
  $this->update_log();
198
 
199
+ /**
200
+ * Update admin notices.
201
+ */
202
+ $this->update_admin_notices();
203
+
204
  delete_transient( 'wpmtst_update_in_progress' );
205
  }
206
 
230
  update_option( 'wpmtst_update_log', $log );
231
  }
232
 
233
+ public function update_admin_notices() {
234
+ wpmtst_add_admin_notice( 'feedback-notice', true );
235
+ }
236
+
237
  /**
238
  * Return admin role.
239
  *
admin/class-strong-views-list-table.php CHANGED
@@ -123,10 +123,11 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
123
  $delete_link = 'admin.php?action=delete-strong-view&id=' . $item['id'];
124
 
125
  // Assemble links
126
- $actions = array();
127
- $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
128
- $actions['duplicate'] = '<a href="' . $duplicate_link . '">' . __( 'Duplicate' ) . '</a>';
129
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( $delete_link, 'delete-strong-view_' . $item['id'] ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "Delete \"%s\"?" ), $item['name'] ) ) . "' ) ) { return true;} return false;\">" . __( 'Delete' ) . "</a>";
 
130
 
131
  echo $this->row_actions( $actions );
132
  }
123
  $delete_link = 'admin.php?action=delete-strong-view&id=' . $item['id'];
124
 
125
  // Assemble links
126
+
127
+ $actions = array();
128
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit', 'strong-testimonials' ) . '</a>';
129
+ $actions['duplicate'] = '<a href="' . $duplicate_link . '">' . __( 'Duplicate', 'strong-testimonials' ) . '</a>';
130
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( $delete_link, 'delete-strong-view_' . $item['id'] ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( 'Delete "%s"?', 'strong-testimonials' ), $item['name'] ) ) . "' ) ) { return true;} return false;\">" . __( 'Delete', 'strong-testimonials' ) . '</a>';
131
 
132
  echo $this->row_actions( $actions );
133
  }
admin/class-walker-strong-category-checklist.php CHANGED
File without changes
admin/class-walker-strong-form-category-checklist.php CHANGED
File without changes
admin/compat.php CHANGED
File without changes
admin/css/about.css CHANGED
File without changes
admin/css/admin-compat.css CHANGED
File without changes
admin/css/admin-form.css CHANGED
File without changes
admin/css/fields.css CHANGED
File without changes
admin/css/form-preview.css CHANGED
File without changes
admin/css/number-spinner.css CHANGED
File without changes
admin/css/order.css CHANGED
File without changes
admin/css/polylang.css CHANGED
File without changes
admin/css/post-editor.css CHANGED
File without changes
admin/css/views.css CHANGED
File without changes
admin/css/wpml.css CHANGED
File without changes
admin/custom-fields-ajax.php CHANGED
File without changes
admin/custom-fields.php CHANGED
@@ -94,11 +94,11 @@ function wpmtst_update_custom_fields() {
94
 
95
  $field['placeholder'] = sanitize_text_field( $field['placeholder'] );
96
 
97
- if ( isset( $field['text'] ) ) {
98
- $field['text'] = wp_kses_post( $field['text'] );
99
- }
100
- $field['before'] = wp_kses_post( $field['before'] );
101
- $field['after'] = wp_kses_post( $field['after'] );
102
 
103
  $field['shortcode_on_form'] = sanitize_text_field( $field['shortcode_on_form'] );
104
  $field['shortcode_on_display'] = sanitize_text_field( $field['shortcode_on_display'] );
@@ -144,7 +144,7 @@ add_action( 'admin_post_wpmtst_update_custom_fields', 'wpmtst_update_custom_fiel
144
  */
145
  function wpmtst_settings_custom_fields( $form_id = 1 ) {
146
  if ( ! current_user_can( 'strong_testimonials_fields' ) ) {
147
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
148
  }
149
 
150
  if ( ! $form_id ) {
@@ -155,59 +155,60 @@ function wpmtst_settings_custom_fields( $form_id = 1 ) {
155
  $forms = get_option( 'wpmtst_custom_forms' );
156
  $fields = $forms[$form_id]['fields'];
157
  ?>
158
- <div class="wrap wpmtst">
159
- <h1 class="wp-heading-inline"><?php _e( 'Fields', 'strong-testimonials' ); ?></h1>
160
- <hr class="wp-header-end">
161
- <?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
162
-
163
- <div id="left-col">
164
- <div>
165
- <h3><?php _e( 'Editor', 'strong-testimonials' ); ?></h3>
166
- <p>
167
- <?php _e( 'Click a field to open its options panel.', 'strong-testimonials' ); ?>
168
- <a class="open-help-tab" href="#tab-panel-wpmtst-help"><?php _e( 'Help' ); ?></a>
169
- </p>
170
- <?php do_action( 'wpmtst_before_fields_settings', 'form-fields' ); ?>
171
- </div>
172
-
173
- <form id="wpmtst-custom-fields-form" method="post" action="<?php echo admin_url( 'admin-post.php' ); ?>" autocomplete="off">
174
- <?php wp_nonce_field( 'wpmtst_custom_fields_form', 'wpmtst_form_submitted' ); ?>
175
- <input type="hidden" name="action" value="wpmtst_update_custom_fields">
176
- <input type="hidden" name="form_id" value="<?php echo $form_id; ?>">
177
-
178
- <?php do_action( 'wpmtst_fields_editor_before_fields_editor', $forms[ $form_id ] ); ?>
179
-
180
- <ul id="custom-field-list">
181
- <?php
182
- foreach ( $fields as $key => $field ) {
183
- echo '<li id="field-' . $key . '">' . wpmtst_show_field( $key, $field, false ) . '</li>' . "\n";
184
- }
185
- ?>
186
- </ul>
187
-
188
- <div id="add-field-bar">
189
- <input id="add-field" type="button" class="button" name="add-field" value="<?php _e( 'Add New Field', 'strong-testimonials' ); ?>">
190
- </div>
191
-
192
- <div id="field-group-actions">
193
- <div><?php submit_button( '', 'primary', 'submit-form', false ); ?></div>
194
- <div><?php submit_button( __( 'Cancel Changes', 'strong-testimonials' ), 'secondary', 'reset', false ); ?></div>
195
- <div><?php submit_button( __( 'Restore Defaults', 'strong-testimonials' ), 'secondary', 'restore-defaults', false ); ?></div>
196
- </div>
197
- </form>
198
- </div><!-- #left-col -->
199
-
200
- <div id="right-col">
201
- <div class="intro">
202
- <h3><?php _e( 'Basic Preview', 'strong-testimonials' ); ?></h3>
203
- <p><?php _e( 'Only to demonstrate the fields. May look different in your theme.', 'strong-testimonials' ); ?></p>
204
- </div>
205
- <div id="fields-editor-preview">
206
- <div><!-- placeholder --></div>
207
- </div>
208
- </div><!-- #right-col -->
209
-
210
- </div><!-- .wrap -->
 
211
  <?php
212
  }
213
 
@@ -229,25 +230,27 @@ function wpmtst_show_field( $key, $field, $adding ) {
229
  include 'partials/fields/field-header.php';
230
  ?>
231
  <div class="custom-field" style="display: none;">
232
- <table class="field-table">
233
- <?php
234
- include 'partials/fields/field-type.php';
235
- include 'partials/fields/field-label.php';
236
- include 'partials/fields/field-name.php';
237
-
238
- if ( ! $adding ) {
239
- echo wpmtst_show_field_secondary( $key, $field );
240
- echo wpmtst_show_field_admin_table( $key, $field );
241
- }
242
- ?>
243
- </table>
244
 
245
- <?php
246
- if ( ! $adding ) {
247
- echo wpmtst_show_field_hidden( $key, $field );
248
- }
249
- include 'partials/fields/field-controls.php';
250
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  </div><!-- .custom-field -->
252
 
253
  <?php
@@ -278,17 +281,17 @@ function wpmtst_show_field_secondary( $key, $field ) {
278
  if ( isset( $field['core'] ) && $field['core'] ) {
279
  $disabled = ' disabled="disabled"';
280
  } else {
281
- $disabled = false;
282
  }
283
 
284
  $html .= '<tr class="field-secondary">' . "\n";
285
- $html .= '<th>' . __( 'Required', 'strong-testimonials' ) . '</th>' . "\n";
286
  $html .= '<td>' . "\n";
287
  if ( $disabled ) {
288
- $html .= '<input type="hidden" name="fields[' . $key . '][required]" value="' . $field['required'] . '">';
289
  $html .= '<input type="checkbox" ' . checked( $field['required'], true, false ) . $disabled . '>';
290
  } else {
291
- $html .= '<input type="checkbox" name="fields[' . $key . '][required]" ' . checked( $field['required'], true, false ) . '>';
292
  }
293
  $html .= '</td>' . "\n";
294
  $html .= '</tr>' . "\n";
@@ -300,8 +303,8 @@ function wpmtst_show_field_secondary( $key, $field ) {
300
  if ( $field['show_placeholder_option'] ) {
301
  if ( isset( $field['placeholder'] ) ) {
302
  $html .= '<tr class="field-secondary">' . "\n";
303
- $html .= '<th>' . __( 'Placeholder', 'strong-testimonials' ) . '</th>' . "\n";
304
- $html .= '<td><input type="text" name="fields[' . $key . '][placeholder]" value="' . esc_attr( $field['placeholder'] ) . '"></td>' . "\n";
305
  $html .= '</tr>' . "\n";
306
  }
307
  }
@@ -314,8 +317,8 @@ function wpmtst_show_field_secondary( $key, $field ) {
314
  if ( $field['show_text_option'] ) {
315
  if ( isset( $field['text'] ) ) {
316
  $html .= '<tr class="field-secondary">' . "\n";
317
- $html .= '<th>' . __( 'Text', 'strong-testimonials' ) . '</th>' . "\n";
318
- $html .= '<td><input type="text" name="fields[' . $key . '][text]" value="' . esc_attr( $field['text'] ) . '" placeholder="' . __( 'next to the checkbox', 'strong-testimonials' ) . '"></td>' . "\n";
319
  $html .= '</tr>' . "\n";
320
  }
321
  }
@@ -324,16 +327,16 @@ function wpmtst_show_field_secondary( $key, $field ) {
324
  * Before
325
  */
326
  $html .= '<tr class="field-secondary">' . "\n";
327
- $html .= '<th>' . __( 'Before', 'strong-testimonials' ) . '</th>' . "\n";
328
- $html .= '<td><input type="text" name="fields[' . $key . '][before]" value="' . esc_attr( $field['before'] ) . '"></td>' . "\n";
329
  $html .= '</tr>' . "\n";
330
 
331
  /*
332
  * After
333
  */
334
  $html .= '<tr class="field-secondary">' . "\n";
335
- $html .= '<th>' . __( 'After', 'strong-testimonials' ) . '</th>' . "\n";
336
- $html .= '<td><input type="text" name="fields[' . $key . '][after]" value="' . esc_attr( $field['after'] ) . '"></td>' . "\n";
337
  $html .= '</tr>' . "\n";
338
 
339
  /*
@@ -342,27 +345,27 @@ function wpmtst_show_field_secondary( $key, $field ) {
342
  if ( $field['show_default_options'] ) {
343
  if ( isset( $field['default_form_value'] ) ) {
344
  $html .= '<tr class="field-secondary">' . "\n";
345
- $html .= '<th>' . __( 'Default Form Value', 'strong-testimonials' ) . '</th>' . "\n";
346
  $html .= '<td>' . "\n";
347
 
348
  // TODO Replace this special handling
349
  if ( 'rating' == $field['input_type'] ) {
350
 
351
- $html .= '<input type="text" name="fields[' . $key . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '" class="as-number">';
352
- $html .= '<span class="help inline">' . __( 'stars', 'strong-testimonials' ) . '</span>';
353
- $html .= '<span class="help">' . __( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
354
 
355
  } elseif ( 'checkbox' == $field['input_type'] ) {
356
 
357
  $html .= '<label>';
358
- $html .= '<input type="checkbox" name="fields[' . $key . '][default_form_value]" ' . checked( $field['default_form_value'], true, false ) . '>';
359
- $html .= '<span class="help inline">' . __( 'Checked by default.', 'strong-testimonials' ) . '</span>';
360
  $html .= '</label>';
361
 
362
  } else {
363
 
364
- $html .= '<input type="text" name="fields[' . $key . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '">';
365
- $html .= '<span class="help">' . __( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
366
 
367
  }
368
 
@@ -379,18 +382,18 @@ function wpmtst_show_field_secondary( $key, $field ) {
379
  if ( 'checkbox' != $field['input_type'] ) {
380
  if ( isset( $field['default_display_value'] ) ) {
381
  $html .= '<tr class="field-secondary">' . "\n";
382
- $html .= '<th>' . __( 'Default Display Value', 'strong-testimonials' ) . '</th>' . "\n";
383
  $html .= '<td>' . "\n";
384
 
385
  // TODO Replace this special handling
386
  if ( 'rating' == $field['input_type'] ) {
387
- $html .= '<input type="text" name="fields[' . $key . '][default_display_value]" value="' . esc_attr( $field['default_display_value'] ) . '" class="as-number">';
388
- $html .= '<span class="help inline">' . __( 'stars', 'strong-testimonials' ) . '</span>';
389
  } else {
390
- $html .= '<input type="text" name="fields[' . $key . '][default_display_value]" value="' . esc_attr( $field['default_display_value'] ) . '">';
391
  }
392
 
393
- $html .= '<span class="help">' . __( 'Display this on the testimonial if no value is submitted.', 'strong-testimonials' ) . '</span>';
394
  $html .= '</td>' . "\n";
395
  $html .= '</tr>' . "\n";
396
  }
@@ -403,22 +406,24 @@ function wpmtst_show_field_secondary( $key, $field ) {
403
  if ( $field['show_shortcode_options'] ) {
404
  if ( isset( $field['shortcode_on_form'] ) ) {
405
  $html .= '<tr class="field-secondary">' . "\n";
406
- $html .= '<th>' . __( 'Shortcode on form', 'strong-testimonials' ) . '</th>' . "\n";
407
  $html .= '<td>' . "\n";
408
- $html .= '<input type="text" name="fields[' . $key . '][shortcode_on_form]" value="' . esc_attr( $field['shortcode_on_form'] ) . '">';
409
  $html .= '</td>' . "\n";
410
  $html .= '</tr>' . "\n";
411
  }
412
  if ( isset( $field['shortcode_on_display'] ) ) {
413
  $html .= '<tr class="field-secondary">' . "\n";
414
- $html .= '<th>' . __( 'Shortcode on display', 'strong-testimonials' ) . '</th>' . "\n";
415
  $html .= '<td>' . "\n";
416
- $html .= '<input type="text" name="fields[' . $key . '][shortcode_on_display]" value="' . esc_attr( $field['shortcode_on_display'] ) . '">';
417
  $html .= '</td>' . "\n";
418
  $html .= '</tr>' . "\n";
419
  }
420
  }
421
 
 
 
422
  return $html;
423
  }
424
 
@@ -431,20 +436,20 @@ function wpmtst_show_field_admin_table( $key, $field ) {
431
  // Show in Admin Table
432
  // -------------------
433
  if ( ! $field['show_admin_table_option'] ) {
434
- $html = '<input type="hidden" name="fields[' . $key . '][show_admin_table_option]" value="' . $field['show_admin_table_option'] . '">';
435
  return $html;
436
  }
437
 
438
  $html = '<tr class="field-admin-table">' . "\n";
439
- $html .= '<th>' . __( 'Admin List', 'strong-testimonials' ) . '</th>' . "\n";
440
  $html .= '<td>' . "\n";
441
  if ( $field['admin_table_option'] ) {
442
- $html .= '<label><input type="checkbox" class="field-admin-table" name="fields[' . $key . '][admin_table]" ' . checked( $field['admin_table'], 1, false ) . '>';
443
  } else {
444
- $html .= '<input type="checkbox" ' . checked( $field['admin_table'], 1, false ) . ' disabled="disabled"> <em>' . __( 'required', 'strong-testimonials' ) . '</em>';
445
- $html .= '<input type="hidden" name="fields[' . $key . '][admin_table]" value="' . $field['admin_table'] . '">';
446
  }
447
- $html .= '<span class="help inline">' . __( 'Show this field in the admin list table.', 'strong-testimonials' ) . '</span>';
448
  $html .= '</label>';
449
  $html .= '</td>' . "\n";
450
  $html .= '</tr>' . "\n";
@@ -453,6 +458,21 @@ function wpmtst_show_field_admin_table( $key, $field ) {
453
  }
454
 
455
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
  /**
457
  * Add hidden fields to form.
458
  *
94
 
95
  $field['placeholder'] = sanitize_text_field( $field['placeholder'] );
96
 
97
+ if ( isset( $field['text'] ) ) {
98
+ $field['text'] = wp_filter_post_kses( $field['text'] );
99
+ }
100
+ $field['before'] = wp_filter_post_kses( $field['before'] );
101
+ $field['after'] = wp_filter_post_kses( $field['after'] );
102
 
103
  $field['shortcode_on_form'] = sanitize_text_field( $field['shortcode_on_form'] );
104
  $field['shortcode_on_display'] = sanitize_text_field( $field['shortcode_on_display'] );
144
  */
145
  function wpmtst_settings_custom_fields( $form_id = 1 ) {
146
  if ( ! current_user_can( 'strong_testimonials_fields' ) ) {
147
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'strong-testimonials' ) );
148
  }
149
 
150
  if ( ! $form_id ) {
155
  $forms = get_option( 'wpmtst_custom_forms' );
156
  $fields = $forms[$form_id]['fields'];
157
  ?>
158
+
159
+ <div class="wrap wpmtst">
160
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'Fields', 'strong-testimonials' ); ?></h1>
161
+ <hr class="wp-header-end">
162
+ <?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
163
+
164
+ <div id="left-col">
165
+ <div>
166
+ <h3><?php esc_html_e( 'Editor', 'strong-testimonials' ); ?></h3>
167
+ <p>
168
+ <?php esc_html_e( 'Click a field to open its options panel.', 'strong-testimonials' ); ?>
169
+ <a class="open-help-tab" href="#tab-panel-wpmtst-help"><?php esc_html_e( 'Help', 'strong-testimonials' ); ?></a>
170
+ </p>
171
+ <?php do_action( 'wpmtst_before_fields_settings', 'form-fields' ); ?>
172
+ </div>
173
+
174
+ <form id="wpmtst-custom-fields-form" method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" autocomplete="off">
175
+ <?php wp_nonce_field( 'wpmtst_custom_fields_form', 'wpmtst_form_submitted' ); ?>
176
+ <input type="hidden" name="action" value="wpmtst_update_custom_fields">
177
+ <input type="hidden" name="form_id" value="<?php echo esc_attr( $form_id ); ?>">
178
+
179
+ <?php do_action( 'wpmtst_fields_editor_before_fields_editor', $forms[ $form_id ] ); ?>
180
+
181
+ <ul id="custom-field-list">
182
+ <?php
183
+ foreach ( $fields as $key => $field ) {
184
+ echo '<li id="field-' . esc_attr( $key ) . '">' . wpmtst_show_field( $key, $field, false ) . '</li>' . "\n";
185
+ }
186
+ ?>
187
+ </ul>
188
+
189
+ <div id="add-field-bar">
190
+ <input id="add-field" type="button" class="button" name="add-field" value="<?php esc_attr_e( 'Add New Field', 'strong-testimonials' ); ?>">
191
+ </div>
192
+
193
+ <div id="field-group-actions">
194
+ <div><?php submit_button( '', 'primary', 'submit-form', false ); ?></div>
195
+ <div><?php submit_button( esc_html__( 'Cancel Changes', 'strong-testimonials' ), 'secondary', 'reset', false ); ?></div>
196
+ <div><?php submit_button( esc_html__( 'Restore Defaults', 'strong-testimonials' ), 'secondary', 'restore-defaults', false ); ?></div>
197
+ </div>
198
+ </form>
199
+ </div><!-- #left-col -->
200
+
201
+ <div id="right-col">
202
+ <div class="intro">
203
+ <h3><?php esc_html_e( 'Basic Preview', 'strong-testimonials' ); ?></h3>
204
+ <p><?php esc_html_e( 'Only to demonstrate the fields. May look different in your theme.', 'strong-testimonials' ); ?></p>
205
+ </div>
206
+ <div id="fields-editor-preview">
207
+ <div><!-- placeholder --></div>
208
+ </div>
209
+ </div><!-- #right-col -->
210
+
211
+ </div><!-- .wrap -->
212
  <?php
213
  }
214
 
230
  include 'partials/fields/field-header.php';
231
  ?>
232
  <div class="custom-field" style="display: none;">
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
+ <table class="field-table">
235
+ <?php
236
+ include 'partials/fields/field-type.php';
237
+ include 'partials/fields/field-label.php';
238
+ include 'partials/fields/field-name.php';
239
+
240
+ if ( ! $adding ) {
241
+ echo wpmtst_show_field_secondary( $key, $field );
242
+ echo wpmtst_show_field_admin_table( $key, $field );
243
+ }
244
+
245
+ ?>
246
+ </table>
247
+
248
+ <?php
249
+ if ( ! $adding ) {
250
+ echo wp_kses_post( wpmtst_show_field_hidden( $key, $field ) );
251
+ }
252
+ include 'partials/fields/field-controls.php';
253
+ ?>
254
  </div><!-- .custom-field -->
255
 
256
  <?php
281
  if ( isset( $field['core'] ) && $field['core'] ) {
282
  $disabled = ' disabled="disabled"';
283
  } else {
284
+ $disabled = '';
285
  }
286
 
287
  $html .= '<tr class="field-secondary">' . "\n";
288
+ $html .= '<th>' . esc_html__( 'Required', 'strong-testimonials' ) . '</th>' . "\n";
289
  $html .= '<td>' . "\n";
290
  if ( $disabled ) {
291
+ $html .= '<input type="hidden" name="fields[' . esc_attr( $key ) . '][required]" value="' . esc_attr( $field['required'] ) . '">';
292
  $html .= '<input type="checkbox" ' . checked( $field['required'], true, false ) . $disabled . '>';
293
  } else {
294
+ $html .= '<input type="checkbox" name="fields[' . esc_attr( $key ) . '][required]" ' . checked( $field['required'], true, false ) . '>';
295
  }
296
  $html .= '</td>' . "\n";
297
  $html .= '</tr>' . "\n";
303
  if ( $field['show_placeholder_option'] ) {
304
  if ( isset( $field['placeholder'] ) ) {
305
  $html .= '<tr class="field-secondary">' . "\n";
306
+ $html .= '<th>' . esc_html__( 'Placeholder', 'strong-testimonials' ) . '</th>' . "\n";
307
+ $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][placeholder]" value="' . esc_attr( $field['placeholder'] ) . '"></td>' . "\n";
308
  $html .= '</tr>' . "\n";
309
  }
310
  }
317
  if ( $field['show_text_option'] ) {
318
  if ( isset( $field['text'] ) ) {
319
  $html .= '<tr class="field-secondary">' . "\n";
320
+ $html .= '<th>' . esc_html__( 'Text', 'strong-testimonials' ) . '</th>' . "\n";
321
+ $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][text]" value="' . esc_attr( $field['text'] ) . '" placeholder="' . esc_html__( 'next to the checkbox', 'strong-testimonials' ) . '"></td>' . "\n";
322
  $html .= '</tr>' . "\n";
323
  }
324
  }
327
  * Before
328
  */
329
  $html .= '<tr class="field-secondary">' . "\n";
330
+ $html .= '<th>' . esc_html__( 'Before', 'strong-testimonials' ) . '</th>' . "\n";
331
+ $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][before]" value="' . esc_attr( $field['before'] ) . '"></td>' . "\n";
332
  $html .= '</tr>' . "\n";
333
 
334
  /*
335
  * After
336
  */
337
  $html .= '<tr class="field-secondary">' . "\n";
338
+ $html .= '<th>' . esc_html__( 'After', 'strong-testimonials' ) . '</th>' . "\n";
339
+ $html .= '<td><input type="text" name="fields[' . esc_attr( $key ) . '][after]" value="' . esc_attr( $field['after'] ) . '"></td>' . "\n";
340
  $html .= '</tr>' . "\n";
341
 
342
  /*
345
  if ( $field['show_default_options'] ) {
346
  if ( isset( $field['default_form_value'] ) ) {
347
  $html .= '<tr class="field-secondary">' . "\n";
348
+ $html .= '<th>' . esc_html__( 'Default Form Value', 'strong-testimonials' ) . '</th>' . "\n";
349
  $html .= '<td>' . "\n";
350
 
351
  // TODO Replace this special handling
352
  if ( 'rating' == $field['input_type'] ) {
353
 
354
+ $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '" class="as-number">';
355
+ $html .= '<span class="help inline">' . esc_html__( 'stars', 'strong-testimonials' ) . '</span>';
356
+ $html .= '<span class="help">' . esc_html__( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
357
 
358
  } elseif ( 'checkbox' == $field['input_type'] ) {
359
 
360
  $html .= '<label>';
361
+ $html .= '<input type="checkbox" name="fields[' . esc_attr( $key ) . '][default_form_value]" ' . checked( $field['default_form_value'], true, false ) . '>';
362
+ $html .= '<span class="help inline">' . esc_html__( 'Checked by default.', 'strong-testimonials' ) . '</span>';
363
  $html .= '</label>';
364
 
365
  } else {
366
 
367
+ $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '">';
368
+ $html .= '<span class="help">' . esc_html__( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
369
 
370
  }
371
 
382
  if ( 'checkbox' != $field['input_type'] ) {
383
  if ( isset( $field['default_display_value'] ) ) {
384
  $html .= '<tr class="field-secondary">' . "\n";
385
+ $html .= '<th>' . esc_html__( 'Default Display Value', 'strong-testimonials' ) . '</th>' . "\n";
386
  $html .= '<td>' . "\n";
387
 
388
  // TODO Replace this special handling
389
  if ( 'rating' == $field['input_type'] ) {
390
+ $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][default_display_value]" value="' . esc_attr( $field['default_display_value'] ) . '" class="as-number">';
391
+ $html .= '<span class="help inline">' . esc_html__( 'stars', 'strong-testimonials' ) . '</span>';
392
  } else {
393
+ $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][default_display_value]" value="' . esc_attr( $field['default_display_value'] ) . '">';
394
  }
395
 
396
+ $html .= '<span class="help">' . esc_html__( 'Display this on the testimonial if no value is submitted.', 'strong-testimonials' ) . '</span>';
397
  $html .= '</td>' . "\n";
398
  $html .= '</tr>' . "\n";
399
  }
406
  if ( $field['show_shortcode_options'] ) {
407
  if ( isset( $field['shortcode_on_form'] ) ) {
408
  $html .= '<tr class="field-secondary">' . "\n";
409
+ $html .= '<th>' . esc_html__( 'Shortcode on form', 'strong-testimonials' ) . '</th>' . "\n";
410
  $html .= '<td>' . "\n";
411
+ $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][shortcode_on_form]" value="' . esc_attr( $field['shortcode_on_form'] ) . '">';
412
  $html .= '</td>' . "\n";
413
  $html .= '</tr>' . "\n";
414
  }
415
  if ( isset( $field['shortcode_on_display'] ) ) {
416
  $html .= '<tr class="field-secondary">' . "\n";
417
+ $html .= '<th>' . esc_html__( 'Shortcode on display', 'strong-testimonials' ) . '</th>' . "\n";
418
  $html .= '<td>' . "\n";
419
+ $html .= '<input type="text" name="fields[' . esc_attr( $key ) . '][shortcode_on_display]" value="' . esc_attr( $field['shortcode_on_display'] ) . '">';
420
  $html .= '</td>' . "\n";
421
  $html .= '</tr>' . "\n";
422
  }
423
  }
424
 
425
+ $html = apply_filters( 'wpmtst_fields_secondary', $html, $key, $field );
426
+
427
  return $html;
428
  }
429
 
436
  // Show in Admin Table
437
  // -------------------
438
  if ( ! $field['show_admin_table_option'] ) {
439
+ $html = '<input type="hidden" name="fields[' . esc_attr( $key ) . '][show_admin_table_option]" value="' . esc_attr( $field['show_admin_table_option'] ) . '">';
440
  return $html;
441
  }
442
 
443
  $html = '<tr class="field-admin-table">' . "\n";
444
+ $html .= '<th>' . esc_html__( 'Admin List', 'strong-testimonials' ) . '</th>' . "\n";
445
  $html .= '<td>' . "\n";
446
  if ( $field['admin_table_option'] ) {
447
+ $html .= '<label><input type="checkbox" class="field-admin-table" name="fields[' . esc_attr( $key ) . '][admin_table]" ' . checked( $field['admin_table'], 1, false ) . '>';
448
  } else {
449
+ $html .= '<input type="checkbox" ' . checked( $field['admin_table'], 1, false ) . ' disabled="disabled"> <em>' . esc_html__( 'required', 'strong-testimonials' ) . '</em>';
450
+ $html .= '<input type="hidden" name="fields[' . esc_attr( $key ) . '][admin_table]" value="' . esc_attr( $field['admin_table'] ) . '">';
451
  }
452
+ $html .= '<span class="help inline">' . esc_html__( 'Show this field in the admin list table.', 'strong-testimonials' ) . '</span>';
453
  $html .= '</label>';
454
  $html .= '</td>' . "\n";
455
  $html .= '</tr>' . "\n";
458
  }
459
 
460
 
461
+ /**
462
+ * Add type-specific select options field
463
+ */
464
+ function wpmtst_show_field_select_options( $key, $field ) {
465
+
466
+ if( $field['input_type'] !== 'select' ) {
467
+ return;
468
+ }
469
+
470
+ ob_start();
471
+ include 'partials/fields/field-select-options.php';
472
+ return ob_get_clean();
473
+ }
474
+
475
+
476
  /**
477
  * Add hidden fields to form.
478
  *
admin/form-preview.php CHANGED
File without changes
admin/img/logo-long.svg CHANGED
File without changes
admin/img/mascot.png ADDED
Binary file
admin/img/quotes.png CHANGED
File without changes
admin/img/screen-options.png CHANGED
File without changes
admin/img/strong-date.png CHANGED
File without changes
admin/img/strong-testimonials-badge.png CHANGED
File without changes
admin/js/addon-licenses.js CHANGED
File without changes
admin/js/admin-compat.js CHANGED
File without changes
admin/js/admin-fields.js CHANGED
@@ -178,7 +178,7 @@ function sanitizeName(label) {
178
  * Open/close
179
  */
180
  $fieldList.on("click", "span.link", function () {
181
- toggleField($(this).closest("li"));
182
  return false;
183
  });
184
 
@@ -311,7 +311,7 @@ function sanitizeName(label) {
311
 
312
  if ($parent.data('status') !== 'new') {
313
  $table.find(".field-secondary, .field-admin-table").remove();
314
- }
315
 
316
  if ('none' === fieldType) {
317
  $parent.find('.field-label-row').hide();
@@ -323,7 +323,7 @@ function sanitizeName(label) {
323
  return;
324
  }
325
  $parent.find('tr').removeClass('form-error');
326
- $parent.find('.form-error-text').hide();
327
 
328
  var key_id = $parent.attr("id");
329
  var key = key_id.substr(key_id.lastIndexOf("-") + 1);
@@ -334,7 +334,7 @@ function sanitizeName(label) {
334
 
335
  // get type of field from its optgroup
336
  var fieldOption = $(this).find("option[value='" + fieldType + "']");
337
- var fieldClass = fieldOption.closest("optgroup").attr("class");
338
 
339
  switch (fieldClass) {
340
 
@@ -404,7 +404,8 @@ function sanitizeName(label) {
404
  };
405
 
406
  var ajax1 = $.get(ajaxurl, data1, function (response) {
407
- $table.append(response);
 
408
  });
409
 
410
 
178
  * Open/close
179
  */
180
  $fieldList.on("click", "span.link", function () {
181
+ toggleField($(this).closest("li"));
182
  return false;
183
  });
184
 
311
 
312
  if ($parent.data('status') !== 'new') {
313
  $table.find(".field-secondary, .field-admin-table").remove();
314
+ }
315
 
316
  if ('none' === fieldType) {
317
  $parent.find('.field-label-row').hide();
323
  return;
324
  }
325
  $parent.find('tr').removeClass('form-error');
326
+ $parent.find('.form-error-text').hide();
327
 
328
  var key_id = $parent.attr("id");
329
  var key = key_id.substr(key_id.lastIndexOf("-") + 1);
334
 
335
  // get type of field from its optgroup
336
  var fieldOption = $(this).find("option[value='" + fieldType + "']");
337
+ var fieldClass = fieldOption.closest("optgroup").attr("class");
338
 
339
  switch (fieldClass) {
340
 
404
  };
405
 
406
  var ajax1 = $.get(ajaxurl, data1, function (response) {
407
+ $table.append(response);
408
+ $( document ).trigger( "st-done-loading-secondary-fields", [ $table ] );
409
  });
410
 
411
 
admin/js/admin-form.js CHANGED
File without changes
admin/js/admin-global.js CHANGED
File without changes
admin/js/admin-order.js CHANGED
File without changes
admin/js/admin.js DELETED
@@ -1,106 +0,0 @@
1
- /**
2
- * Strong Testimonials admin
3
- *
4
- * @namespace jQuery
5
- */
6
-
7
- // Function to get the Max value in Array
8
- Array.max = function (array) {
9
- return Math.max.apply(Math, array);
10
- };
11
-
12
- jQuery(document).ready(function ($) {
13
-
14
- // Convert "A String" to "a_string"
15
- function convertLabel (label) {
16
- return label.replace(/\s+/g, '_').replace(/\W/g, '').toLowerCase();
17
- }
18
-
19
- // Remove invalid characters
20
- function removeSpaces (word) {
21
- //return word.replace(/\s+/g, "_");
22
- return word.replace(/[^\w\s(?!\-)]/gi, '');
23
- }
24
-
25
- $.fn.showInlineBlock = function () {
26
- return this.css('display', 'inline-block');
27
- };
28
-
29
- /**
30
- * ----------------------------------------
31
- * General events
32
- * ----------------------------------------
33
- */
34
-
35
- // Add protocol if missing
36
- // Thanks http://stackoverflow.com/a/36429927/51600
37
- $('input[type=url]').change(function () {
38
- if (this.value.length && !/^https*:\/\//.test(this.value)) {
39
- this.value = 'http://' + this.value;
40
- }
41
- });
42
-
43
- $('ul.ui-tabs-nav li a').click(function () {
44
- $(this).blur();
45
- });
46
-
47
- $('.focus-next-field').change(function (e) {
48
- if ($(e.target).is(':checked')) {
49
- $(e.target).parent().next().find('input').focus().select();
50
- }
51
- });
52
-
53
- // toggle screenshots
54
- $('#toggle-screen-options').add('#screenshot-screen-options').click(function (e) {
55
- $(this).blur();
56
- $('#screenshot-screen-options').slideToggle();
57
- });
58
-
59
- // toggle screenshots
60
- $('#toggle-help').click(function (e) {
61
- $(this).toggleClass('closed open').blur();
62
- $('#help-section').slideToggle();
63
- });
64
-
65
- /**
66
- * ----------------------------------------
67
- * View List Table
68
- * ----------------------------------------
69
- */
70
-
71
- /**
72
- * Save sort order
73
- */
74
- $('table.wpm-testimonial_page_testimonial-views th.manage-column').on('click', function (e) {
75
- var columnName = $(this).attr('id');
76
- // get the opposite class
77
- var columnOrder = $(this).hasClass('asc') ? 'desc' : $(this).hasClass('desc') ? 'asc' : '';
78
- var data = {
79
- 'action': 'wpmtst_save_view_list_order',
80
- 'name': columnName,
81
- 'order': columnOrder
82
- };
83
- $.get(ajaxurl, data, function (response) {
84
- });
85
- });
86
-
87
- /**
88
- * Sticky views
89
- */
90
- $('table.wpm-testimonial_page_testimonial-views').on('click', '.stickit', function (e) {
91
- var icon = $(this);
92
- icon.closest('.wp-list-table-wrap').find('.overlay').fadeIn(200);
93
- icon.blur().toggleClass('stuck');
94
- var id = $(this).closest('tr').find('td.id').html();
95
- var data = {
96
- 'action': 'wpmtst_save_view_sticky',
97
- 'id': id
98
- };
99
- $.get(ajaxurl, data, function (response) {
100
- if (response) {
101
- window.location.reload();
102
- }
103
- });
104
- });
105
-
106
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/custom-spinner.js CHANGED
File without changes
admin/js/help.js CHANGED
File without changes
admin/js/lib/are-you-sure/jquery.are-you-sure.js CHANGED
File without changes
admin/js/lib/are-you-sure/jquery.are-you-sure.min.js CHANGED
File without changes
admin/js/lib/autosize/autosize.min.js CHANGED
File without changes
admin/js/rating-edit.js CHANGED
File without changes
admin/js/view-category-filter.js CHANGED
File without changes
admin/js/views.js CHANGED
File without changes
admin/menu/class-strong-testimonials-menu-fields.php CHANGED
File without changes
admin/menu/class-strong-testimonials-menu-settings.php CHANGED
File without changes
admin/menu/class-strong-testimonials-menu-shortcodes.php CHANGED
File without changes
admin/menu/class-strong-testimonials-menu-views.php CHANGED
File without changes
admin/menu/class-strong-testimonials-menu.php CHANGED
File without changes
admin/partials/fields/field-controls.php CHANGED
@@ -6,7 +6,7 @@ $is_core = ( isset( $field['core'] ) && $field['core'] );
6
  ?>
7
  <div class="controls">
8
  <?php if ( $adding || ! $is_core ) : ?>
9
- <span><a href="#" class="delete-field"><?php _e( 'Delete' ); ?></a></span>
10
  <?php endif; ?>
11
  <span class="close-field"><a href="#"><?php _ex( 'Close', 'verb', 'strong-testimonials' ); ?></a></span>
12
  </div>
6
  ?>
7
  <div class="controls">
8
  <?php if ( $adding || ! $is_core ) : ?>
9
+ <span><a href="#" class="delete-field"><?php esc_html_e( 'Delete', 'strong-testimonials' ); ?></a></span>
10
  <?php endif; ?>
11
  <span class="close-field"><a href="#"><?php _ex( 'Close', 'verb', 'strong-testimonials' ); ?></a></span>
12
  </div>
admin/partials/fields/field-header.php CHANGED
File without changes
admin/partials/fields/field-label.php CHANGED
File without changes
admin/partials/fields/field-name.php CHANGED
File without changes
admin/partials/fields/field-text.php CHANGED
File without changes
admin/partials/fields/field-type.php CHANGED
File without changes
admin/partials/templates/form-preview-template.php CHANGED
File without changes
admin/partials/views/group-compat.php CHANGED
File without changes
admin/partials/views/group-extra.php CHANGED
File without changes
admin/partials/views/group-fields.php CHANGED
File without changes
admin/partials/views/group-form.php CHANGED
File without changes
admin/partials/views/group-query.php CHANGED
@@ -21,7 +21,7 @@ $then_classes = array(
21
  <?php _e( 'or Shortcode Attribute', 'strong-testimonials' ); ?>
22
  <span class="help-links">
23
  <span class="description">
24
- <a href="#tab-panel-wpmtst-help-shortcode" class="open-help-tab"><?php _e( 'Help' ); ?></a>
25
  </span>
26
  </span>
27
  </td>
@@ -39,6 +39,6 @@ $then_classes = array(
39
  <tr class="then then_slideshow then_not_single then_multiple" style="display: none;">
40
  <?php include( 'option-limit.php' ); ?>
41
  </tr>
42
- <?php // TODO Add hook here ?>
43
- </table>
44
  </div>
21
  <?php _e( 'or Shortcode Attribute', 'strong-testimonials' ); ?>
22
  <span class="help-links">
23
  <span class="description">
24
+ <a href="#tab-panel-wpmtst-help-shortcode" class="open-help-tab"><?php esc_html_e( 'Help', 'strong-testimonials' ); ?></a>
25
  </span>
26
  </span>
27
  </td>
39
  <tr class="then then_slideshow then_not_single then_multiple" style="display: none;">
40
  <?php include( 'option-limit.php' ); ?>
41
  </tr>
42
+ <?php do_action( 'wpmtst_views_group_query', $view ); ?>
43
+ </table>
44
  </div>
admin/partials/views/group-slideshow.php CHANGED
File without changes
admin/partials/views/group-style.php CHANGED
File without changes
admin/partials/views/option-background.php CHANGED
File without changes
admin/partials/views/option-boilerplate.php CHANGED
File without changes
admin/partials/views/option-category.php CHANGED
@@ -46,11 +46,11 @@
46
  </td>
47
  <?php endif; ?>
48
  <td class="divider">
49
- <p><?php _e( '<code>category</code>', 'strong-testimonials' ); ?></p>
50
  </td>
51
  <td>
52
  <p><?php _e( 'a comma-separated list of category slugs or ID\'s', 'strong-testimonials' ); ?></p>
53
  </td>
54
  <td>
55
- <p><?php _e( '<code>category="accounting"</code>', 'strong-testimonials' ); ?></p>
56
- </td>
46
  </td>
47
  <?php endif; ?>
48
  <td class="divider">
49
+ <p><?php echo wp_kses_post( '<code>category</code>' ); ?></p>
50
  </td>
51
  <td>
52
  <p><?php _e( 'a comma-separated list of category slugs or ID\'s', 'strong-testimonials' ); ?></p>
53
  </td>
54
  <td>
55
+ <p><?php echo wp_kses_post( '<code>category="accounting"</code>' ); ?></p>
56
+ </td>
admin/partials/views/option-classes.php CHANGED
File without changes
admin/partials/views/option-client-section.php CHANGED
File without changes
admin/partials/views/option-color.php CHANGED
File without changes
admin/partials/views/option-content.php CHANGED
@@ -210,7 +210,9 @@
210
 
211
  <div class="row links then then_not_entire then_truncated then_excerpt" style="display: none;">
212
  <p class="description tall solo">
213
- <?php printf( __( '<a href="%s" target="_blank">Learn more about WordPress excerpts</a>', 'strong-testimonials' ), esc_url( 'http://buildwpyourself.com/wordpress-manual-excerpts-more-tag/' ) ); ?>
 
 
214
  </p>
215
  </div>
216
 
210
 
211
  <div class="row links then then_not_entire then_truncated then_excerpt" style="display: none;">
212
  <p class="description tall solo">
213
+ <?php
214
+ echo wp_kses_post( printf( __( '<a href="%s" target="_blank">Learn more about WordPress excerpts</a>', 'strong-testimonials' ), esc_url( 'http://buildwpyourself.com/wordpress-manual-excerpts-more-tag/' ) ) );
215
+ ?>
216
  </p>
217
  </div>
218
 
admin/partials/views/option-divi.php CHANGED
File without changes
admin/partials/views/option-form-ajax.php CHANGED
File without changes
admin/partials/views/option-form-category.php CHANGED
File without changes
admin/partials/views/option-id.php CHANGED
@@ -4,7 +4,7 @@
4
  <div class="row-inner">
5
  <label>
6
  <select id="view-id" name="view[data][id]">
7
- <option value="0"><?php _e( '&mdash; select &mdash;' ); ?></option>
8
  <?php foreach ( $testimonials_list as $post ) : ?>
9
  <option value="<?php echo $post->ID; ?>" <?php selected( $view['id'], $post->ID ); ?>>
10
  <?php echo $post->post_title ? $post->post_title : __( '(untitled)', 'strong-testimonials' ); ?>
4
  <div class="row-inner">
5
  <label>
6
  <select id="view-id" name="view[data][id]">
7
+ <option value="0"><?php _e( '&mdash; select &mdash;', 'strong-testimonials' ); ?></option>
8
  <?php foreach ( $testimonials_list as $post ) : ?>
9
  <option value="<?php echo $post->ID; ?>" <?php selected( $view['id'], $post->ID ); ?>>
10
  <?php echo $post->post_title ? $post->post_title : __( '(untitled)', 'strong-testimonials' ); ?>
admin/partials/views/option-layout.php CHANGED
File without changes
admin/partials/views/option-limit.php CHANGED
@@ -25,9 +25,9 @@
25
  </div>
26
  </td>
27
  <td class="divider">
28
- <p><?php _e( '<code>count</code>', 'strong-testimonials' ); ?></p>
29
  </td>
30
  <td></td>
31
  <td>
32
- <p><?php _e( '<code>count=5</code>', 'strong-testimonials' ); ?></p>
33
- </td>
25
  </div>
26
  </td>
27
  <td class="divider">
28
+ <p><?php echo wp_kses_post( '<code>count</code>' ); ?></p>
29
  </td>
30
  <td></td>
31
  <td>
32
+ <p><?php echo wp_kses_post( '<code>count=5</code>' ); ?></p>
33
+ </td>
admin/partials/views/option-order.php CHANGED
@@ -16,11 +16,11 @@
16
  </div>
17
  </td>
18
  <td class="divider">
19
- <p><?php _e( '<code>order</code>', 'strong-testimonials' ); ?></p>
20
  </td>
21
  <td>
22
- <p><?php _e( 'oldest | newest | random | menu_order', 'strong-testimonials' ); ?></p>
23
  </td>
24
  <td>
25
- <p><?php _e( '<code>order="random"</code>', 'strong-testimonials' ); ?></p>
26
- </td>
16
  </div>
17
  </td>
18
  <td class="divider">
19
+ <p><?php echo wp_kses_post( '<code>order</code>' ); ?></p>
20
  </td>
21
  <td>
22
+ <p><?php echo wp_kses_post( 'oldest | newest | random | menu_order' ); ?></p>
23
  </td>
24
  <td>
25
+ <p><?php echo wp_kses_post( '<code>order="random"</code>' ); ?></p>
26
+ </td>
admin/partials/views/option-pagination.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
- $links = '<span class="help-links">';
3
- $links .= '<a href="#tab-panel-wpmtst-help-pagination" class="open-help-tab">' . __( 'Help' ) . '</a>';
 
4
  $links .= '</span>';
5
  ?>
6
  <?php /* translators: On the Views admin screen. */ ?>
1
  <?php
2
+
3
+ $links = '<span class="help-links">';
4
+ $links .= '<a href="#tab-panel-wpmtst-help-pagination" class="open-help-tab">' . __( 'Help', 'strong-testimonials' ) . '</a>';
5
  $links .= '</span>';
6
  ?>
7
  <?php /* translators: On the Views admin screen. */ ?>
admin/partials/views/option-read-more-page.php CHANGED
@@ -19,27 +19,28 @@
19
  <div class="row-inner">
20
  <label>
21
  <select id="view-page" name="view[data][more_page_id]">
22
- <option value=""><?php _e( '&mdash; select &mdash;' ); ?></option>
23
- <?php
24
- do_action( 'wpmtst_readmore_page_list', $view );
25
- if ( $custom_list ) {
26
- ?>
27
- <optgroup label="<?php _e( 'Custom', 'strong-testimonials' ); ?>">
28
- <?php
29
- foreach ( $custom_list as $page ) {
30
- echo $page;
 
31
  }
32
  ?>
33
  </optgroup>
34
  <?php
35
  }
36
- ?>
37
- <optgroup label="<?php _e( 'Pages' ); ?>">
38
  <?php foreach ( $pages_list as $pages ) : ?>
39
  <option value="<?php echo $pages->ID; ?>" <?php selected( isset( $view['more_page_id'] ) ? $view['more_page_id'] : 0, $pages->ID ); ?>><?php echo $pages->post_title; ?></option>
40
  <?php endforeach; ?>
41
  </optgroup>
42
- <optgroup label="<?php _e( 'Posts' ); ?>">
43
  <?php foreach ( $posts_list as $posts ) : ?>
44
  <option value="<?php echo $posts->ID; ?>" <?php selected( isset( $view['more_page_id'] ) ? $view['more_page_id'] : 0, $posts->ID ); ?>><?php echo $posts->post_title; ?></option>
45
  <?php endforeach; ?>
19
  <div class="row-inner">
20
  <label>
21
  <select id="view-page" name="view[data][more_page_id]">
22
+
23
+ <option value=""><?php _e( '&mdash; select &mdash;', 'strong-testimonials' ); ?></option>
24
+ <?php
25
+ do_action( 'wpmtst_readmore_page_list', $view );
26
+ if ( $custom_list ) {
27
+ ?>
28
+ <optgroup label="<?php esc_html_e( 'Custom', 'strong-testimonials' ); ?>">
29
+ <?php
30
+ foreach ( $custom_list as $page ) {
31
+ echo wp_kses_post( $page );
32
  }
33
  ?>
34
  </optgroup>
35
  <?php
36
  }
37
+ ?>
38
+ <optgroup label="<?php esc_attr_e( 'Pages', 'strong-testimonials' ); ?>">
39
  <?php foreach ( $pages_list as $pages ) : ?>
40
  <option value="<?php echo $pages->ID; ?>" <?php selected( isset( $view['more_page_id'] ) ? $view['more_page_id'] : 0, $pages->ID ); ?>><?php echo $pages->post_title; ?></option>
41
  <?php endforeach; ?>
42
  </optgroup>
43
+ <optgroup label="<?php esc_attr_e( 'Posts', 'strong-testimonials' ); ?>">
44
  <?php foreach ( $posts_list as $posts ) : ?>
45
  <option value="<?php echo $posts->ID; ?>" <?php selected( isset( $view['more_page_id'] ) ? $view['more_page_id'] : 0, $posts->ID ); ?>><?php echo $posts->post_title; ?></option>
46
  <?php endforeach; ?>
admin/partials/views/option-select.php CHANGED
@@ -19,11 +19,11 @@
19
 
20
  </td>
21
  <td class="divider">
22
- <p><?php _e( '<code>post_ids</code>' , 'strong-testimonials' ); ?></p>
23
  </td>
24
  <td>
25
  <p><?php _e( 'a comma-separated list of post ID\'s' , 'strong-testimonials' ); ?></p>
26
  </td>
27
  <td>
28
- <p><?php _e( '<code>post_ids="123,456"</code>', 'strong-testimonials' ); ?></p>
29
- </td>
19
 
20
  </td>
21
  <td class="divider">
22
+ <p><?php echo wp_kses_post( '<code>post_ids</code>' ); ?></p>
23
  </td>
24
  <td>
25
  <p><?php _e( 'a comma-separated list of post ID\'s' , 'strong-testimonials' ); ?></p>
26
  </td>
27
  <td>
28
+ <p><?php echo wp_kses_post( '<code>post_ids="123,456"</code>' ); ?></p>
29
+ </td>
admin/partials/views/option-slideshow-behavior.php CHANGED
@@ -79,7 +79,7 @@
79
  </label>
80
 
81
  <div class="inline description">
82
- <a href="#tab-panel-wpmtst-help-stretch" class="open-help-tab"><?php _e( 'Help' ); ?></a>
83
  </div>
84
  </div>
85
 
79
  </label>
80
 
81
  <div class="inline description">
82
+ <a href="#tab-panel-wpmtst-help-stretch" class="open-help-tab"><?php esc_html_e( 'Help', 'strong-testimonials' ); ?></a>
83
  </div>
84
  </div>
85
 
admin/partials/views/option-slideshow-breakpoints.php CHANGED
File without changes
admin/partials/views/option-slideshow-navigation.php CHANGED
File without changes
admin/partials/views/option-slideshow-num.php CHANGED
File without changes
admin/partials/views/option-slideshow-transition.php CHANGED
File without changes
admin/partials/views/option-slideshow-type.php CHANGED
File without changes
admin/partials/views/option-template-list.php CHANGED
File without changes
admin/partials/views/option-thumbnail.php CHANGED
File without changes
admin/partials/views/option-title.php CHANGED
File without changes
admin/partials/views/template-input.php CHANGED
File without changes
admin/partials/views/template-not-found.php CHANGED
File without changes
admin/partials/views/template-options.php CHANGED
File without changes
admin/partials/views/view-mode.php CHANGED
File without changes
admin/partials/views/view-name.php CHANGED
File without changes
admin/partials/views/view-shortcode.php CHANGED
File without changes
admin/scss/_partials/_background.scss CHANGED
File without changes
admin/scss/_partials/_category-checkboxes.scss CHANGED
File without changes
admin/scss/_partials/_category-filter.scss CHANGED
File without changes
admin/scss/_partials/_checkbox-icons.scss CHANGED
File without changes
admin/scss/_partials/_custom-fields.scss CHANGED
File without changes
admin/scss/_partials/_elements.scss CHANGED
File without changes
admin/scss/_partials/_form-table.scss CHANGED
File without changes
admin/scss/_partials/_help-tab.scss CHANGED
File without changes
admin/scss/_partials/_inner-table.scss CHANGED
File without changes
admin/scss/_partials/_inputs.scss CHANGED
File without changes
admin/scss/_partials/_layout-example-columns.scss CHANGED
File without changes
admin/scss/_partials/_layout-example-grid.scss CHANGED
File without changes
admin/scss/_partials/_layout-example-masonry.scss CHANGED
File without changes
admin/scss/_partials/_layout-examples.scss CHANGED
File without changes
admin/scss/_partials/_layout.scss CHANGED
File without changes
admin/scss/_partials/_list-radio-buttons.scss CHANGED
File without changes
admin/scss/_partials/_misc.scss CHANGED
File without changes
admin/scss/_partials/_screenshots.scss CHANGED
File without changes
admin/scss/_partials/_sticky-views.scss CHANGED
File without changes
admin/scss/_partials/_structure.scss CHANGED
File without changes
admin/scss/_partials/_template.scss CHANGED
File without changes
admin/scss/_partials/_view-info.scss CHANGED
File without changes
admin/scss/about.scss CHANGED
File without changes
admin/scss/admin-compat.scss CHANGED
File without changes
admin/scss/number-spinner.scss CHANGED
File without changes
admin/scss/post-editor.scss CHANGED
File without changes
admin/scss/views.scss CHANGED
File without changes
admin/settings/class-strong-testimonials-settings-compat.php CHANGED
@@ -367,8 +367,8 @@ class Strong_Testimonials_Settings_Compat {
367
  </th>
368
  <td>
369
  <div class="row header">
370
- <p><?php _e( 'Load stylesheets and populate script variables up front.', 'strong-testimonials' ); ?>
371
- <a class="open-help-tab" href="#tab-panel-wpmtst-help-prerender"><?php _e( 'Help' ); ?></a>
372
  </p>
373
  </div>
374
  <fieldset data-radio-group="prerender">
@@ -725,7 +725,7 @@ class Strong_Testimonials_Settings_Compat {
725
  <div>
726
  <select id="script-name" name="wpmtst_compat_options[ajax][script]">
727
  <option value="" <?php selected( $this->options['ajax']['script'], '' ); ?>>
728
- <?php _e( '&mdash; Select &mdash;' ); ?>
729
  </option>
730
  <option value="barba" <?php selected( $this->options['ajax']['script'], 'barba' ); ?>>
731
  Barba.js
367
  </th>
368
  <td>
369
  <div class="row header">
370
+ <p><?php esc_html_e( 'Load stylesheets and populate script variables up front.', 'strong-testimonials' ); ?>
371
+ <a class="open-help-tab" href="#tab-panel-wpmtst-help-prerender"><?php esc_html_e( 'Help', 'strong-testimonials' ); ?></a>
372
  </p>
373
  </div>
374
  <fieldset data-radio-group="prerender">
725
  <div>
726
  <select id="script-name" name="wpmtst_compat_options[ajax][script]">
727
  <option value="" <?php selected( $this->options['ajax']['script'], '' ); ?>>
728
+ <?php esc_html_e( '&mdash; Select &mdash;', 'strong-testimonials' ); ?>
729
  </option>
730
  <option value="barba" <?php selected( $this->options['ajax']['script'], 'barba' ); ?>>
731
  Barba.js
admin/settings/class-strong-testimonials-settings-form.php CHANGED
@@ -164,11 +164,7 @@ class Strong_Testimonials_Settings_Form {
164
 
165
  $input['success_action'] = sanitize_text_field( $input['success_action'] );
166
 
167
- if ( filter_var( $input['success_redirect_url'], FILTER_VALIDATE_URL ) ) {
168
- $input['success_redirect_url'] = wp_validate_redirect( $input['success_redirect_url'] );
169
- } else {
170
- $input['success_redirect_url'] = '';
171
- }
172
 
173
  // Check the "ID or slug" field next
174
  if ( isset( $input['success_redirect_2']) && $input['success_redirect_2'] ) {
164
 
165
  $input['success_action'] = sanitize_text_field( $input['success_action'] );
166
 
167
+ $input['success_redirect_url'] = esc_url_raw( $input['success_redirect_url'] );
 
 
 
 
168
 
169
  // Check the "ID or slug" field next
170
  if ( isset( $input['success_redirect_2']) && $input['success_redirect_2'] ) {
admin/settings/class-strong-testimonials-settings-general.php CHANGED
@@ -80,18 +80,19 @@ class Strong_Testimonials_Settings_General {
80
  * @return array
81
  */
82
  public static function sanitize_options( $input ) {
83
- $input['embed_width'] = $input['embed_width'] ? (int) sanitize_text_field( $input['embed_width'] ) : '';
84
- $input['load_font_awesome'] = wpmtst_sanitize_checkbox( $input, 'load_font_awesome' );
85
- $input['nofollow'] = wpmtst_sanitize_checkbox( $input, 'nofollow' );
86
- $input['pending_indicator'] = wpmtst_sanitize_checkbox( $input, 'pending_indicator' );
87
- $input['remove_whitespace'] = wpmtst_sanitize_checkbox( $input, 'remove_whitespace' );
88
- $input['reorder'] = wpmtst_sanitize_checkbox( $input, 'reorder' );
89
- $input['scrolltop'] = wpmtst_sanitize_checkbox( $input, 'scrolltop' );
90
- $input['scrolltop_offset'] = (int) sanitize_text_field( $input['scrolltop_offset'] );
91
- $input['support_comments'] = wpmtst_sanitize_checkbox( $input, 'support_comments' );
92
- $input['support_custom_fields'] = wpmtst_sanitize_checkbox( $input, 'support_custom_fields' );
93
- $input['no_lazyload'] = wpmtst_sanitize_checkbox( $input, 'no_lazyload' );
94
- $input['touch_enabled'] = wpmtst_sanitize_checkbox( $input, 'touch_enabled' );
 
95
 
96
  return $input;
97
  }
80
  * @return array
81
  */
82
  public static function sanitize_options( $input ) {
83
+ $input['embed_width'] = $input['embed_width'] ? (int) sanitize_text_field( $input['embed_width'] ) : '';
84
+ $input['load_font_awesome'] = wpmtst_sanitize_checkbox( $input, 'load_font_awesome' );
85
+ $input['nofollow'] = wpmtst_sanitize_checkbox( $input, 'nofollow' );
86
+ $input['pending_indicator'] = wpmtst_sanitize_checkbox( $input, 'pending_indicator' );
87
+ $input['remove_whitespace'] = wpmtst_sanitize_checkbox( $input, 'remove_whitespace' );
88
+ $input['reorder'] = wpmtst_sanitize_checkbox( $input, 'reorder' );
89
+ $input['scrolltop'] = wpmtst_sanitize_checkbox( $input, 'scrolltop' );
90
+ $input['scrolltop_offset'] = (int) sanitize_text_field( $input['scrolltop_offset'] );
91
+ $input['support_comments'] = wpmtst_sanitize_checkbox( $input, 'support_comments' );
92
+ $input['support_custom_fields'] = wpmtst_sanitize_checkbox( $input, 'support_custom_fields' );
93
+ $input['single_testimonial_slug'] = sanitize_text_field( $input['single_testimonial_slug'] );
94
+ $input['no_lazyload'] = wpmtst_sanitize_checkbox( $input, 'no_lazyload' );
95
+ $input['touch_enabled'] = wpmtst_sanitize_checkbox( $input, 'touch_enabled' );
96
 
97
  return $input;
98
  }
admin/settings/class-strong-testimonials-settings-licenses.php CHANGED
File without changes
admin/settings/class-strong-testimonials-settings.php CHANGED
@@ -40,19 +40,19 @@ class Strong_Testimonials_Settings {
40
  * Settings page
41
  */
42
  public static function settings_page() {
43
- if ( ! current_user_can( 'strong_testimonials_options' ) )
44
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
45
-
46
  $tab = self::get_tab();
47
  $url = admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-settings' );
48
  ?>
49
  <div class="wrap wpmtst">
50
 
51
- <h1><?php echo apply_filters( 'wpmtst_cpt_singular_name', __( 'Testimonial', 'strong-testimonials' ) ); ?> <?php _e( 'Settings' ); ?></h1>
52
 
53
  <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
54
  <div id="message" class="updated notice is-dismissible">
55
- <p><?php _e( 'Settings saved.' ) ?></p>
56
  </div>
57
  <?php endif; ?>
58
 
40
  * Settings page
41
  */
42
  public static function settings_page() {
43
+ if ( ! current_user_can( 'strong_testimonials_options' ) ) {
44
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'strong-testimonials' ) );
45
+ }
46
  $tab = self::get_tab();
47
  $url = admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-settings' );
48
  ?>
49
  <div class="wrap wpmtst">
50
 
51
+ <h1><?php echo wp_kses_post( apply_filters( 'wpmtst_cpt_singular_name', esc_html__( 'Testimonial', 'strong-testimonials' ) ) ); ?> <?php esc_html_e( 'Settings', 'strong-testimonials' ); ?></h1>
52
 
53
  <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
54
  <div id="message" class="updated notice is-dismissible">
55
+ <p><?php esc_html_e( 'Settings saved.', 'strong-testimonials' ); ?></p>
56
  </div>
57
  <?php endif; ?>
58
 
admin/settings/partials/email-from.php CHANGED
File without changes
admin/settings/partials/email-to.php CHANGED
File without changes
admin/settings/partials/email.php CHANGED
File without changes
admin/settings/partials/form.php CHANGED
@@ -150,32 +150,27 @@ foreach ( $plugins as $key => $plugin ) {
150
  <h3><?php _e( 'Form Actions', 'strong-testimonials' ); ?></h3>
151
 
152
  <table class="form-table" cellpadding="0" cellspacing="0">
153
- <tr>
154
- <th scope="row">
155
- <label for="redirect-page">
156
- <?php _e( 'Upon Successful Submission', 'strong-testimonials' ); ?>
157
- </label>
158
- </th>
159
- <td>
160
- <div>
161
- <label class="success-action">
162
- <input type="radio"
163
- name="wpmtst_form_options[success_action]"
164
- value="message" <?php checked( 'message', $form_options['success_action'] ); ?>/> <?php _e( 'display message', 'strong-testimonials' ); ?>
165
- </label>
166
- </div>
167
-
168
- <div>
169
- <label class="success-action">
170
- <input type="radio"
171
- name="wpmtst_form_options[success_action]"
172
- value="id" <?php checked( 'id', $form_options['success_action'] ); ?>/> <?php _e( 'redirect to a page', 'strong-testimonials' ); ?>
173
- </label>
174
-
175
- <select id="redirect-page" name="wpmtst_form_options[success_redirect_id]">
176
-
177
- <option value=""><?php _e( '&mdash; select a page &mdash;' ); ?></option>
178
-
179
  <?php foreach ( $pages_list as $pages ) : ?>
180
 
181
  <option value="<?php echo $pages->ID; ?>" <?php selected( isset( $form_options['success_redirect_id'] ) ? $form_options['success_redirect_id'] : 0, $pages->ID ); ?>>
@@ -184,81 +179,71 @@ foreach ( $plugins as $key => $plugin ) {
184
 
185
  <?php endforeach; ?>
186
 
187
- </select>
188
-
189
- <div style="display: inline-block; text-indent: 20px;">
190
- <label>
191
- <?php _ex( 'or enter its ID or slug', 'to select a redirect page', 'strong-testimonials' ); ?>
192
- &nbsp;
193
- <input type="text"
194
- id="redirect-page-2"
195
- name="wpmtst_form_options[success_redirect_2]"
196
- size="30">
197
- </label>
198
- </div>
199
- </div>
200
-
201
- <div>
202
- <label class="success-action">
203
- <input type="radio"
204
- name="wpmtst_form_options[success_action]"
205
- value="url" <?php checked( 'url', $form_options['success_action'] ); ?>/> <?php _e( 'redirect to a URL', 'strong-testimonials' ); ?>
206
- </label>
207
- <label>
208
- <input type="text" id="redirect-page-3"
209
- name="wpmtst_form_options[success_redirect_url]"
210
- value="<?php echo $form_options['success_redirect_url']; ?>" size="75"/>
211
- </label>
212
- </div>
213
-
214
- </td>
215
- </tr>
216
-
217
- <tr>
218
- <th scope="row">
219
- <label>
220
- <?php _e( 'Post Status', 'strong-testimonials' ); ?>
221
- </label>
222
- </th>
223
- <td>
224
- <ul class="compact">
225
- <li>
226
- <label>
227
- <input type="radio" name="wpmtst_form_options[post_status]" value="pending"
228
- <?php checked( 'pending', $form_options['post_status'] ); ?>/>
229
- <?php _e( 'Pending', 'strong-testimonials' ); ?>
230
- </label>
231
- </li>
232
- <li>
233
- <label>
234
- <input type="radio" name="wpmtst_form_options[post_status]" value="publish"
235
- <?php checked( 'publish', $form_options['post_status'] ); ?>/>
236
- <?php _e( 'Published' ); ?>
237
- </label>
238
- </li>
239
- </ul>
240
- </td>
241
- </tr>
242
-
243
- <tr>
244
- <th scope="row">
245
- <label for="wpmtst-options-admin-notify">
246
- <?php _e( 'Notification Email', 'strong-testimonials' ); ?>
247
- </label>
248
- </th>
249
-
250
- <td>
251
- <div class="match-height">
252
- <fieldset>
253
- <label for="wpmtst-options-admin-notify">
254
- <input id="wpmtst-options-admin-notify" type="checkbox" name="wpmtst_form_options[admin_notify]"
255
- <?php checked( $form_options['admin_notify'] ); ?>/>
256
- <?php _e( 'Send an email upon new testimonial submission.', 'strong-testimonials' ); ?>
257
- </label>
258
- </fieldset>
259
- </div>
260
- <div class="email-container"
261
- id="admin-notify-fields" <?php echo ( $form_options['admin_notify'] ) ? '' : 'style="display: none;"'; ?>>
262
  <?php
263
  include 'email-from.php';
264
  include 'email-to.php';
150
  <h3><?php _e( 'Form Actions', 'strong-testimonials' ); ?></h3>
151
 
152
  <table class="form-table" cellpadding="0" cellspacing="0">
153
+ <tr>
154
+ <th scope="row">
155
+ <label for="redirect-page">
156
+ <?php esc_html_e( 'Upon Successful Submission', 'strong-testimonials' ); ?>
157
+ </label>
158
+ </th>
159
+ <td>
160
+ <div>
161
+ <label class="success-action">
162
+ <input type="radio" name="wpmtst_form_options[success_action]" value="message" <?php checked( 'message', $form_options['success_action'] ); ?>/> <?php esc_html_e( 'display message', 'strong-testimonials' ); ?>
163
+ </label>
164
+ </div>
165
+
166
+ <div>
167
+ <label class="success-action">
168
+ <input type="radio" name="wpmtst_form_options[success_action]" value="id" <?php checked( 'id', $form_options['success_action'] ); ?>/> <?php esc_html_e( 'redirect to a page', 'strong-testimonials' ); ?>
169
+ </label>
170
+
171
+ <select id="redirect-page" name="wpmtst_form_options[success_redirect_id]">
172
+
173
+ <option value=""><?php esc_html_e( '&mdash; select a page &mdash;', 'strong-testimonials' ); ?></option>
 
 
 
 
 
174
  <?php foreach ( $pages_list as $pages ) : ?>
175
 
176
  <option value="<?php echo $pages->ID; ?>" <?php selected( isset( $form_options['success_redirect_id'] ) ? $form_options['success_redirect_id'] : 0, $pages->ID ); ?>>
179
 
180
  <?php endforeach; ?>
181
 
182
+ </select>
183
+
184
+ <div style="display: inline-block; text-indent: 20px;">
185
+ <label>
186
+ <?php echo esc_html_x( 'or enter its ID or slug', 'to select a redirect page', 'strong-testimonials' ); ?>
187
+ &nbsp;
188
+ <input type="text" id="redirect-page-2" name="wpmtst_form_options[success_redirect_2]" size="30">
189
+ </label>
190
+ </div>
191
+ </div>
192
+
193
+ <div>
194
+ <label class="success-action">
195
+ <input type="radio" name="wpmtst_form_options[success_action]" value="url" <?php checked( 'url', $form_options['success_action'] ); ?>/>
196
+ <?php esc_html_e( 'redirect to a URL', 'strong-testimonials' ); ?>
197
+ </label>
198
+ <label>
199
+ <input type="text" id="redirect-page-3" name="wpmtst_form_options[success_redirect_url]" value="<?php echo esc_attr( $form_options['success_redirect_url'] ); ?>" size="75"/>
200
+ </label>
201
+ </div>
202
+
203
+ </td>
204
+ </tr>
205
+
206
+ <tr>
207
+ <th scope="row">
208
+ <label>
209
+ <?php esc_html_e( 'Post Status', 'strong-testimonials' ); ?>
210
+ </label>
211
+ </th>
212
+ <td>
213
+ <ul class="compact">
214
+ <li>
215
+ <label>
216
+ <input type="radio" name="wpmtst_form_options[post_status]" value="pending" <?php checked( 'pending', $form_options['post_status'] ); ?>/>
217
+ <?php esc_html_e( 'Pending', 'strong-testimonials' ); ?>
218
+ </label>
219
+ </li>
220
+ <li>
221
+ <label>
222
+ <input type="radio" name="wpmtst_form_options[post_status]" value="publish" <?php checked( 'publish', $form_options['post_status'] ); ?>/>
223
+ <?php esc_html_e( 'Published', 'strong-testimonials' ); ?>
224
+ </label>
225
+ </li>
226
+ </ul>
227
+ </td>
228
+ </tr>
229
+
230
+ <tr>
231
+ <th scope="row">
232
+ <label for="wpmtst-options-admin-notify">
233
+ <?php esc_html_e( 'Notification Email', 'strong-testimonials' ); ?>
234
+ </label>
235
+ </th>
236
+
237
+ <td>
238
+ <div class="match-height">
239
+ <fieldset>
240
+ <label for="wpmtst-options-admin-notify">
241
+ <input id="wpmtst-options-admin-notify" type="checkbox" name="wpmtst_form_options[admin_notify]" <?php checked( $form_options['admin_notify'] ); ?>/>
242
+ <?php esc_html_e( 'Send an email upon new testimonial submission.', 'strong-testimonials' ); ?>
243
+ </label>
244
+ </fieldset>
245
+ </div>
246
+ <div class="email-container" id="admin-notify-fields" <?php echo ( $form_options['admin_notify'] ) ? '' : 'style="display: none;"'; ?>>
 
 
 
 
 
 
 
 
 
 
247
  <?php
248
  include 'email-from.php';
249
  include 'email-to.php';
admin/settings/partials/general.php CHANGED
@@ -58,6 +58,18 @@ $options = get_option( 'wpmtst_options' );
58
  </td>
59
  </tr>
60
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  </table>
62
 
63
  <hr/>
58
  </td>
59
  </tr>
60
 
61
+ <tr valign="top">
62
+ <th scope="row">
63
+ <?php esc_html_e( 'Single Testimonial Slug', 'strong-testimonials' ); ?>
64
+ </th>
65
+ <td>
66
+ <label>
67
+ <input type="text" name="wpmtst_options[single_testimonial_slug]" value="<?php echo esc_attr( $options['single_testimonial_slug'] ); ?>"/>
68
+ </label>
69
+ <p class="description"><?php esc_html_e( 'Change the permalink slug for a single entry testimonial. After changing this field, reset permalinks by going to Settings > Permalinks and clicking Save Changes.', 'strong-testimonials' ); ?></p>
70
+ </td>
71
+ </tr>
72
+
73
  </table>
74
 
75
  <hr/>
admin/settings/partials/licenses.php CHANGED
File without changes
admin/settings/partials/recipient.php CHANGED
File without changes
admin/view-list-order.php CHANGED
File without changes
admin/views-ajax.php CHANGED
File without changes
admin/views-validate.php CHANGED
File without changes
admin/views.php CHANGED
@@ -12,8 +12,9 @@
12
  * @since 1.21.0
13
  */
14
  function wpmtst_views_admin() {
15
- if ( ! current_user_can( 'strong_testimonials_views' ) )
16
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
 
17
 
18
  $tags = array(
19
  'a' => array(
@@ -67,9 +68,9 @@ function wpmtst_views_admin() {
67
  */
68
  ?>
69
  <h1>
70
- <?php _e( 'Views', 'strong-testimonials' ); ?>
71
- <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views&action=add' ) ); ?>" class="add-new-h2"><?php _e( 'Add New' ); ?></a>
72
- <a href="#tab-panel-wpmtst-help-views" class="add-new-h2 open-help-tab"><?php _e( 'Help' ); ?></a>
73
  </h1>
74
 
75
  <?php
@@ -204,12 +205,12 @@ function wpmtst_view_settings( $action = '', $view_id = null ) {
204
  $url2 = $url . '&action=duplicate&id=' . $view_id;
205
  ?>
206
  <h1>
207
- <?php 'edit' == $action ? _e( 'Edit View', 'strong-testimonials' ) : _e( 'Add View', 'strong-testimonials' ); ?>
208
- <a href="<?php echo esc_url( $url1 ); ?>" class="add-new-h2"><?php _e( 'Add New' ); ?></a>
209
- <a href="<?php echo esc_url( $url ); ?>" class="add-new-h2"><?php _e( 'Return To List', 'strong-testimonials' ); ?></a>
210
- <?php if ( 'edit' == $action ) : ?>
211
- <a href="<?php echo esc_url( $url2 ); ?>" class="add-new-h2"><?php _e( 'Duplicate This View', 'strong-testimonials' ); ?></a>
212
- <?php endif; ?>
213
  </h1>
214
 
215
  <form id="wpmtst-views-form" method="post" action="<?php echo admin_url( 'admin-post.php' ); ?>" autocomplete="off">
12
  * @since 1.21.0
13
  */
14
  function wpmtst_views_admin() {
15
+ if ( ! current_user_can( 'strong_testimonials_views' ) ) {
16
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'strong-testimonials' ) );
17
+ }
18
 
19
  $tags = array(
20
  'a' => array(
68
  */
69
  ?>
70
  <h1>
71
+ <?php esc_html_e( 'Views', 'strong-testimonials' ); ?>
72
+ <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views&action=add' ) ); ?>" class="add-new-h2"><?php esc_html_e( 'Add New', 'strong-testimonials' ); ?></a>
73
+ <a href="#tab-panel-wpmtst-help-views" class="add-new-h2 open-help-tab"><?php esc_html_e( 'Help', 'strong-testimonials' ); ?></a>
74
  </h1>
75
 
76
  <?php
205
  $url2 = $url . '&action=duplicate&id=' . $view_id;
206
  ?>
207
  <h1>
208
+ <?php 'edit' == $action ? esc_html_e( 'Edit View', 'strong-testimonials' ) : esc_html_e( 'Add View', 'strong-testimonials' ); ?>
209
+ <a href="<?php echo esc_url( $url1 ); ?>" class="add-new-h2"><?php esc_html_e( 'Add New', 'strong-testimonials' ); ?></a>
210
+ <a href="<?php echo esc_url( $url ); ?>" class="add-new-h2"><?php esc_html_e( 'Return To List', 'strong-testimonials' ); ?></a>
211
+ <?php if ( 'edit' == $action ) : ?>
212
+ <a href="<?php echo esc_url( $url2 ); ?>" class="add-new-h2"><?php esc_html_e( 'Duplicate This View', 'strong-testimonials' ); ?></a>
213
+ <?php endif; ?>
214
  </h1>
215
 
216
  <form id="wpmtst-views-form" method="post" action="<?php echo admin_url( 'admin-post.php' ); ?>" autocomplete="off">
{admin → assets}/css/admin.css RENAMED
@@ -1,21 +1,17 @@
1
  /**
2
  * Strong Testimonials admin stylesheet
3
  */
4
-
5
  .icon-blue {
6
- color: #0073aa;
7
- }
8
 
9
  .error {
10
- color: red !important;
11
- }
12
 
13
  .required-phrase {
14
  color: red;
15
  font-style: normal;
16
  font-weight: 400;
17
- font-size: 0.9em;
18
- }
19
 
20
  .required-phrase:before,
21
  label.required:after {
@@ -28,119 +24,93 @@ label.required:after {
28
  font-weight: 600;
29
  vertical-align: middle;
30
  position: relative;
31
- top: 1px;
32
- }
33
 
34
  .has-input {
35
- display: inline-block;
36
- }
37
 
38
  .error-message {
39
  display: inline-block;
40
- margin-left: 0.5em;
41
- }
42
 
43
  button.nogo {
44
- margin: 0 3px;
45
- }
46
 
47
  li.warning {
48
- background: lightyellow;
49
- }
50
 
51
  .between-inputs {
52
  margin-left: 0.3em;
53
- margin-right: 0.3em;
54
- }
55
 
56
  .intro p {
57
- font-size: 14px;
58
- }
59
 
60
  .wrap.wpmtst h2 {
61
- margin: 2em 0 1em;
62
- }
63
 
64
  .wrap.wpmtst p {
65
- font-size: 14px;
66
- }
67
 
68
  .wrap.wpmtst .notice p {
69
- font-size: 13px;
70
- }
71
 
72
  .wpmtst .list-wrap {
73
- padding: .5em;
74
- }
75
 
76
  .wp-core-ui .button-primary.active,
77
  .wp-core-ui .button-primary.active:hover,
78
  .wp-core-ui .button-primary.active:focus,
79
  .wp-core-ui .button-primary:active {
80
- vertical-align: baseline;
81
- }
82
 
83
  /* Firefox fix */
84
  a.widget-action:focus {
85
- outline: none;
86
- }
87
 
88
  /* Slug field */
89
  input#post_name {
90
- width: 98%;
91
- }
92
 
93
  fieldset > div {
94
- min-height: 30px;
95
- }
96
 
97
  /* Help sections
98
- ---------------------------------------------------------*/
99
-
100
  div.help {
101
- margin-left: 0;
102
- }
103
 
104
  div.help.minor {
105
  font-size: 0.9em;
106
- text-align: left;
107
- }
108
 
109
  /* Settings table
110
- ---------------------------------------------------------*/
111
-
112
  .wpmtst i.fa.example {
113
- color: #0073aa;
114
- }
115
 
116
  .stackem ul {
117
- margin: 14px 0 0 0;
118
- }
119
 
120
  .stackem li {
121
  margin-top: 16px;
122
- margin-bottom: 16px;
123
- }
124
 
125
  .stackem label {
126
  display: inline-block;
127
  line-height: 28px;
128
  margin-right: 0.5em;
129
- vertical-align: baseline;
130
- }
131
 
132
  .stackem label.inline {
133
- display: inline-block;
134
- }
135
 
136
  .stackem p.description {
137
  margin-top: 0;
138
- margin-left: 22px;
139
- }
140
 
141
  .stackem p.description.warning {
142
- color: #CD0000;
143
- }
144
 
145
  .stackem .notice {
146
  background: none;
@@ -151,271 +121,208 @@ div.help.minor {
151
  font-style: italic;
152
  margin: 0 .2em;
153
  padding: 0;
154
- color: #868686;
155
- }
156
 
157
  .stackem span.link {
158
  display: inline-block;
159
  margin: 0 .3em;
160
  font-size: .9em;
161
- line-height: 28px;
162
- }
163
 
164
  .stackem label.disabled {
165
- color: #888;
166
- }
167
 
168
  div.radio {
169
- line-height: 1.5em;
170
- }
171
 
172
  div.radio:hover {
173
- color: #000;
174
- }
175
 
176
  #screenshot-screen-options,
177
  #help-section {
178
- display: none;
179
- }
180
 
181
  .screenshot > div {
182
  display: inline-block;
183
- -webkit-box-shadow: inset 0px 0px 40px rgba(0, 0, 0, 0.8);
184
- -moz-box-shadow: inset 0px 0px 40px rgba(0, 0, 0, 0.8);
185
- box-shadow: inset 0px 0px 40px rgba(0, 0, 0, 0.8);
186
- }
187
 
188
  .help-text {
189
- padding: 0.5em 0;
190
- }
191
 
192
  /* form table */
193
-
194
  .wpmtst .form-table {
195
- vertical-align: middle;
196
- }
197
 
198
  .wpmtst .form-table .actions {
199
- /*vertical-align: top;*/
200
- }
201
 
202
  .wpmtst .form-table td {
203
- padding-top: 15px; /* override PopupMaker's override */
204
- }
205
 
206
  .wpmtst .form-table td:nth-child(1) {
207
- width: 200px;
208
- }
209
 
210
  .wpmtst .form-table .parent {
211
  border-bottom: 0;
212
- vertical-align: top;
213
- }
214
-
215
- .wpmtst .form-table th.parent + td {
216
- }
217
 
218
  .wpmtst .form-table .child {
219
- border-top: 0;
220
- }
221
 
222
  .wpmtst .form-table p {
223
- /*margin-bottom: 1em;*/
224
- }
225
 
226
  .wpmtst .form-table td p:last-child {
227
- margin-bottom: 0;
228
- }
229
 
230
  .wpmtst .form-table input,
231
  .wpmtst .form-table select,
232
  .wpmtst .form-table textarea {
233
- /*line-height: 1.5em;*/
234
- }
235
 
236
  .wpmtst .form-table input[type="button"] {
237
  line-height: 26px;
238
- height: 28px;
239
- }
240
 
241
  .wpmtst select {
242
- min-width: 120px;
243
- }
244
 
245
  .wpmtst option {
246
- padding-left: 5px;
247
- }
248
 
249
  .wpmtst .form-table div.box {
250
  border: 1px solid #DDD;
251
  display: inline-block;
252
- padding: 10px;
253
- }
254
 
255
  .wpmtst .form-table .row {
256
- line-height: 2.5em;
257
- }
258
 
259
  .wpmtst .form-table .alpha {
260
- width: 120px;
261
- }
262
 
263
  .wpmtst .form-table .alpha.alpha-110 {
264
- width: 110px;
265
- }
266
 
267
  .wpmtst .form-table .alpha + div {
268
- display: inline-block;
269
- }
270
 
271
  .wpmtst label.success-action {
272
  display: inline-block;
273
  width: 11em;
274
- padding: 10px 0;
275
- }
276
 
277
  /* compact */
278
-
279
  .wpmtst .form-table.compact th {
280
- vertical-align: top;
281
- }
282
 
283
  .wpmtst .form-table.compact td {
284
- vertical-align: middle;
285
- }
286
 
287
  /*.wpmtst .form-table.compact td:nth-child(3) {*/
288
  .wpmtst .form-table.compact td.actions {
289
  width: 100px;
290
- vertical-align: bottom;
291
- }
292
 
293
  /*.wpmtst .form-table.compact td:nth-child(3) input.button {*/
294
  .wpmtst .form-table.compact td.actions input.button {
295
  margin-right: 0;
296
- margin-bottom: 3px;
297
- }
298
 
299
  .wpmtst .form-table.compact input[type="text"] {
300
- width: 100%;
301
- }
302
 
303
  .wpmtst .form-table.compact input.error {
304
  border-color: red;
305
  border-radius: 2px;
306
- box-shadow: none;
307
- }
308
 
309
  .wpmtst .form-table.compact label.error {
310
  color: red;
311
- display: block;
312
- }
313
 
314
  /* end: form-table */
315
-
316
  .code {
317
- background: #FFF;
318
- }
319
 
320
  .code.wide {
321
  padding: 2px 5px;
322
  margin: 3px;
323
- border-radius: 2px;
324
- }
325
 
326
  .submit-buttons input.button {
327
- margin-right: 10px;
328
- }
329
 
330
  .custom-input {
331
- line-height: 1.3em;
332
- }
333
 
334
  .indent {
335
- margin-left: 2em;
336
- }
337
 
338
  .outdent {
339
- margin-left: -2em;
340
- }
341
 
342
  .hilite {
343
  background: lightyellow;
344
  border-radius: 4px;
345
  display: inline-block;
346
  padding: .25em .75em;
347
- -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
348
- -moz-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
349
- box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
350
- }
351
 
352
  p.description.hilite {
353
- margin-bottom: 2em;
354
- }
355
 
356
  ul.compact {
357
- margin: 0;
358
- }
359
 
360
  ul.compact li {
361
  display: inline-block;
362
- margin: 6px 30px 6px 0;
363
- }
364
 
365
  /* Add-on license table
366
- ------------------------------------------------*/
367
-
368
  #licenses-form .form-table {
369
  width: auto;
370
- max-width: 1024px;
371
- }
372
 
373
  #licenses-form .form-table label {
374
  /* to match text inputs */
375
- line-height: 27px;
376
- }
377
 
378
  #licenses-form .form-table th,
379
  #licenses-form .form-table td {
380
- vertical-align: top;
381
- }
382
 
383
  #licenses-form th.for-license-key,
384
  #licenses-form th.for-license-status {
385
- width: 350px;
386
- }
387
 
388
  #licenses-form .form-table th {
389
- padding: 15px;
390
- }
391
 
392
  #licenses-form .form-table td {
393
  white-space: nowrap;
394
- padding: 15px;
395
- }
396
 
397
  #licenses-form .form-table th:first-child,
398
  #licenses-form .form-table td:first-child {
399
- padding-left: 0;
400
- }
401
 
402
  #licenses-form .form-table input[type="text"] {
403
  font-family: Consolas, Monaco, monospace;
404
- width: 100%;
405
- }
406
 
407
  #licenses-form .form-table label {
408
  padding-left: 0;
409
- text-indent: 0;
410
- }
411
 
412
  #licenses-form .doing-ajax:before {
413
  display: inline-block;
414
  font: normal 22px/29px dashicons;
415
- content: "\f463";
416
  text-align: center;
417
  vertical-align: middle;
418
-
419
  -webkit-animation-name: rotate;
420
  -webkit-animation-duration: 1.5s;
421
  -webkit-animation-iteration-count: infinite;
@@ -427,8 +334,7 @@ ul.compact li {
427
  animation-name: rotate;
428
  animation-duration: 1.5s;
429
  animation-iteration-count: infinite;
430
- animation-timing-function: linear;
431
- }
432
 
433
  #licenses-form span.license-status {
434
  display: inline-block;
@@ -439,62 +345,49 @@ ul.compact li {
439
  padding: 0 8px;
440
  text-transform: uppercase;
441
  border-radius: 3px;
442
- vertical-align: middle;
443
- }
444
 
445
  #licenses-form span.active {
446
  background: green;
447
- color: #FFF;
448
- }
449
 
450
  #licenses-form span.inactive {
451
  background: #999;
452
- color: #FFF;
453
- }
454
 
455
  #licenses-form span.ib {
456
  display: inline-block;
457
- vertical-align: middle;
458
- }
459
 
460
  .activation-error {
461
- color: red;
462
- }
463
 
464
  /* Descriptions
465
- ------------------------------------------------*/
466
-
467
  .form-table th .description,
468
  .form-table td .description {
469
  font-size: 14px;
470
  font-style: italic;
471
- /*text-indent: 24px;*/
472
- }
473
 
474
  .description.inline {
475
  display: inline-block;
476
- margin-left: 1em;
477
- }
478
 
479
  .description a {
480
- text-decoration: underline;
481
- }
482
 
483
  .description a:hover {
484
- text-decoration: none;
485
- }
486
 
487
  .radio .description {
488
- padding-left: 20px;
489
- }
490
 
491
  li.checkbox {
492
- margin-bottom: 10px;
493
- }
494
 
495
  .checkbox .description {
496
- padding-left: 24px;
497
- }
498
 
499
  ul.description {
500
  font-style: italic;
@@ -502,159 +395,111 @@ ul.description {
502
  margin-top: 4px;
503
  list-style-type: disc;
504
  margin-left: 21px;
505
- margin-bottom: 0;
506
- }
507
 
508
  /* Widget
509
- ------------------------------------------------*/
510
  .wpmtst-widget-form {
511
- margin-bottom: 1em;
512
- }
513
 
514
  .widget-inside p {
515
- margin: .5em 0;
516
- }
517
 
518
  input[disabled],
519
  input[readonly] {
520
  color: #999;
521
- background: rgba(0, 0, 0, 0.04);
522
- }
523
 
524
  /* Categories admin list
525
- ------------------------------------------------*/
526
  .widefat th.column-ID {
527
- width: 2.2em;
528
- }
529
 
530
  /* Post list table
531
- ------------------------------------------------*/
532
  td.column-shortcode,
533
  td.column-id {
534
  white-space: nowrap;
535
- font-family: Consolas, Monaco, monospace;
536
- }
537
 
538
  th.sortable.column-id a span {
539
- float: right;
540
- }
541
 
542
  td.column-id {
543
- text-align: right;
544
- }
545
 
546
  /* Star rating in list table
547
- --------------------------------------------------*/
548
  .column-rating {
549
- width: auto !important;
550
- }
551
 
552
  /* Views list table
553
- --------------------------------------------------*/
554
  .wp-list-table.fixed.wpm-testimonial_page_testimonial-views {
555
- table-layout: auto;
556
- }
557
 
558
  .wpmtst2 > h1 {
559
- margin-bottom: 15px;
560
- }
561
 
562
  /* WordPress fixes
563
- --------------------------------------------------*/
564
-
565
  /* settings page */
566
  @media screen and (max-width: 782px) {
567
  .wpm-testimonial_page_testimonial-settings .form-table td input[type="text"] {
568
  display: inline-block;
569
- width: auto;
570
- }
571
- }
572
 
573
  /* Animation
574
- --------------------------------------------------*/
575
-
576
- @-webkit-keyframes rotate {
577
- from {
578
- -webkit-transform: rotate(0deg);
579
- }
580
- to {
581
- -webkit-transform: rotate(360deg);
582
- }
583
- }
584
-
585
- @-moz-keyframes rotate {
586
- from {
587
- -moz-transform: rotate(0deg);
588
- }
589
- to {
590
- -moz-transform: rotate(360deg);
591
- }
592
- }
593
 
594
  @keyframes rotate {
595
  from {
596
- transform: rotate(0deg);
597
- }
598
  to {
599
- transform: rotate(360deg);
600
- }
601
- }
602
 
603
  /* Admin > Shortcode example table
604
- --------------------------------------------------*/
605
  .form-table.shortcodes tbody tr:hover {
606
- background: #FFF;
607
- }
608
 
609
  .form-table.shortcodes th {
610
  padding-left: 10px;
611
- width: auto;
612
- }
613
 
614
  .form-table.shortcodes td {
615
- border: 1px solid #DDD;
616
- }
617
 
618
  .form-table.shortcodes td.shortcode {
619
- font-family: Consolas, Monaco, monospace;
620
- }
621
 
622
  .form-table.shortcodes td p {
623
- margin: 1em 0;
624
- }
625
 
626
  .form-table.shortcodes td p:first-child {
627
- margin-top: 0;
628
- }
629
 
630
  .form-table.shortcodes td p:last-child {
631
- margin-bottom: 0;
632
- }
633
 
634
  /* special */
635
-
636
  .form-table.shortcodes tr.important {
637
- background: #FFF;
638
- }
639
 
640
  .form-table.shortcodes tr.important td {
641
- border: 1px solid #CCC;
642
- }
643
 
644
  /* Misc
645
- --------------------------------------------------*/
646
  .slug-example {
647
  font-weight: bold;
648
- color: #0073aa;
649
- }
650
 
651
  .form-table.width-auto {
652
- width: auto;
653
- }
654
 
655
  .form-table td p:first-child {
656
- margin-top: 6px;
657
- }
658
 
659
  .current-dashicon {
660
  display: inline-block;
@@ -666,167 +511,150 @@ td.column-id {
666
  width: 28px;
667
  height: 28px;
668
  position: relative;
669
- top: -3px;
670
- }
671
 
672
  .current-dashicon .dashicons {
673
  vertical-align: middle;
674
- line-height: 1.3;
675
- }
676
 
677
  /*
678
- Back these out to have normal "reset" buttons
679
- */
680
-
681
  /* wp-includes/css/buttons.css:109 */
682
  /*
683
- .wp-core-ui input[type="reset"],
684
- .wp-core-ui input[type="reset"]:hover,
685
- .wp-core-ui input[type="reset"]:active,
686
- .wp-core-ui input[type="reset"]:focus {
687
- background: none;
688
- border: none;
689
- -webkit-box-shadow: none;
690
- box-shadow: none;
691
- padding: 0 2px 1px;
692
- width: auto;
693
- }
694
- */
695
  .wp-core-ui input[type="reset"],
696
  .wp-core-ui input[type="reset"]:hover,
697
  .wp-core-ui input[type="reset"]:active,
698
  .wp-core-ui input[type="reset"]:focus {
699
  background: #F7F7F7;
700
  border: 1px solid #CCC;
701
- -webkit-box-shadow: 0 1px 0 #CCC;
702
  box-shadow: 0 1px 0 #CCC;
703
  padding: 0 10px 1px;
704
- width: auto;
705
- }
706
 
707
  /* wp-admin/css/forms.css:102 */
708
  /*
709
- .wp-core-ui input[type="reset"]:hover,
710
- .wp-core-ui input[type="reset"]:active {
711
- color: #00a0d2;
712
- }
713
- */
714
  /* Based on section 2.0 in wp-includes/css/buttons.css:125 */
715
  .wp-core-ui input[type="reset"]:hover,
716
  .wp-core-ui input[type="reset"]:focus {
717
  background: #fafafa;
718
  border-color: #999;
719
- color: #23282d;
720
- }
721
 
722
  .wp-core-ui input[type="reset"]:focus {
723
  border-color: #5b9dd9;
724
- -webkit-box-shadow: 0 0 3px rgba(0, 115, 170, .8);
725
- box-shadow: 0 0 3px rgba(0, 115, 170, .8);
726
- }
727
 
728
  .wp-core-ui input[type="reset"]:active {
729
  background: #eee;
730
  border-color: #999;
731
- -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
732
  box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
733
- -webkit-transform: translateY(1px);
734
- -ms-transform: translateY(1px);
735
- transform: translateY(1px);
736
- }
737
 
738
  input.button.restore-default {
739
  font: normal 20px/1 dashicons;
740
- padding: 1px 3px;
741
- }
742
 
743
  .wpmtst .subsubsub {
744
  float: none;
745
- margin-left: 16px;
746
- }
747
 
748
  .regular-text.half {
749
- width: 12.5em;
750
- }
751
 
752
  .regular-text.third {
753
- width: 20em;
754
- }
755
 
756
  input.code {
757
  font-size: 13px;
758
- font-family: Consolas, Monaco, monospace;
759
- }
760
 
761
  .wrap h2.nav-tab-wrapper {
762
- margin-top: 6px;
763
- }
764
 
765
  .tab-header {
766
- padding: 1em 0;
767
- }
768
 
769
  .striped > tbody > tr.readonly {
770
- background: lightyellow;
771
- }
772
 
773
  ul.standard {
774
  list-style: disc;
775
- padding-left: 1.5em;
776
- }
777
 
778
  .form-table p.error {
779
- margin: 0.5em 0;
780
- }
781
 
782
  /* shortcodes page */
783
  .wpmtst.shortcode {
784
- vertical-align: middle;
785
- }
786
  .wpmtst.shortcodes.has-stars table {
787
- margin-bottom: 1em;
788
- }
789
  .wpmtst.shortcodes.has-stars td:nth-child(2) {
790
  width: 70%;
791
- /*white-space: nowrap;*/
792
- }
793
  .wpmtst.shortcodes td {
794
- padding: 10px;
795
- }
796
  .wpmtst.shortcodes tr.important td {
797
- border: 1px solid #DDD;
798
- }
799
  .wpmtst.shortcodes tr:hover {
800
- background: #FFF;
801
- }
802
 
803
  /* inner table */
804
  .wpmtst.shortcodes td.has-inner {
805
- padding: 0;
806
- }
807
  .wpmtst.shortcodes table.inner {
808
  margin: 0;
809
  vertical-align: middle;
810
- width: 100%;
811
- }
812
  .wpmtst.shortcodes table.inner,
813
  .wpmtst.shortcodes table.inner tr,
814
  .wpmtst.shortcodes table.inner td {
815
- border: 0;
816
- }
817
  .wpmtst.shortcodes table.inner tr:first-child td {
818
- border-bottom: 1px solid #DDD;
819
- }
820
 
821
  .wp-list-table .type-wpm-testimonial .row-actions span.id span {
822
- color: #777;
823
- }
 
 
 
 
824
 
825
- .wpmtst-notice {
826
- padding: 22px;
827
- border: 2px solid #7F22DE;
828
- }
829
 
830
- .wpmtst-notice img {
831
- max-width: 100%;
832
- }
 
 
 
 
1
  /**
2
  * Strong Testimonials admin stylesheet
3
  */
 
4
  .icon-blue {
5
+ color: #0073aa; }
 
6
 
7
  .error {
8
+ color: red !important; }
 
9
 
10
  .required-phrase {
11
  color: red;
12
  font-style: normal;
13
  font-weight: 400;
14
+ font-size: 0.9em; }
 
15
 
16
  .required-phrase:before,
17
  label.required:after {
24
  font-weight: 600;
25
  vertical-align: middle;
26
  position: relative;
27
+ top: 1px; }
 
28
 
29
  .has-input {
30
+ display: inline-block; }
 
31
 
32
  .error-message {
33
  display: inline-block;
34
+ margin-left: 0.5em; }
 
35
 
36
  button.nogo {
37
+ margin: 0 3px; }
 
38
 
39
  li.warning {
40
+ background: lightyellow; }
 
41
 
42
  .between-inputs {
43
  margin-left: 0.3em;
44
+ margin-right: 0.3em; }
 
45
 
46
  .intro p {
47
+ font-size: 14px; }
 
48
 
49
  .wrap.wpmtst h2 {
50
+ margin: 2em 0 1em; }
 
51
 
52
  .wrap.wpmtst p {
53
+ font-size: 14px; }
 
54
 
55
  .wrap.wpmtst .notice p {
56
+ font-size: 13px; }
 
57
 
58
  .wpmtst .list-wrap {
59
+ padding: .5em; }
 
60
 
61
  .wp-core-ui .button-primary.active,
62
  .wp-core-ui .button-primary.active:hover,
63
  .wp-core-ui .button-primary.active:focus,
64
  .wp-core-ui .button-primary:active {
65
+ vertical-align: baseline; }
 
66
 
67
  /* Firefox fix */
68
  a.widget-action:focus {
69
+ outline: none; }
 
70
 
71
  /* Slug field */
72
  input#post_name {
73
+ width: 98%; }
 
74
 
75
  fieldset > div {
76
+ min-height: 30px; }
 
77
 
78
  /* Help sections
79
+ ---------------------------------------------------------*/
 
80
  div.help {
81
+ margin-left: 0; }
 
82
 
83
  div.help.minor {
84
  font-size: 0.9em;
85
+ text-align: left; }
 
86
 
87
  /* Settings table
88
+ ---------------------------------------------------------*/
 
89
  .wpmtst i.fa.example {
90
+ color: #0073aa; }
 
91
 
92
  .stackem ul {
93
+ margin: 14px 0 0 0; }
 
94
 
95
  .stackem li {
96
  margin-top: 16px;
97
+ margin-bottom: 16px; }
 
98
 
99
  .stackem label {
100
  display: inline-block;
101
  line-height: 28px;
102
  margin-right: 0.5em;
103
+ vertical-align: baseline; }
 
104
 
105
  .stackem label.inline {
106
+ display: inline-block; }
 
107
 
108
  .stackem p.description {
109
  margin-top: 0;
110
+ margin-left: 22px; }
 
111
 
112
  .stackem p.description.warning {
113
+ color: #CD0000; }
 
114
 
115
  .stackem .notice {
116
  background: none;
121
  font-style: italic;
122
  margin: 0 .2em;
123
  padding: 0;
124
+ color: #868686; }
 
125
 
126
  .stackem span.link {
127
  display: inline-block;
128
  margin: 0 .3em;
129
  font-size: .9em;
130
+ line-height: 28px; }
 
131
 
132
  .stackem label.disabled {
133
+ color: #888; }
 
134
 
135
  div.radio {
136
+ line-height: 1.5em; }
 
137
 
138
  div.radio:hover {
139
+ color: #000; }
 
140
 
141
  #screenshot-screen-options,
142
  #help-section {
143
+ display: none; }
 
144
 
145
  .screenshot > div {
146
  display: inline-block;
147
+ box-shadow: inset 0px 0px 40px rgba(0, 0, 0, 0.8); }
 
 
 
148
 
149
  .help-text {
150
+ padding: 0.5em 0; }
 
151
 
152
  /* form table */
 
153
  .wpmtst .form-table {
154
+ vertical-align: middle; }
 
155
 
156
  .wpmtst .form-table .actions {
157
+ /*vertical-align: top;*/ }
 
158
 
159
  .wpmtst .form-table td {
160
+ padding-top: 15px;
161
+ /* override PopupMaker's override */ }
162
 
163
  .wpmtst .form-table td:nth-child(1) {
164
+ width: 200px; }
 
165
 
166
  .wpmtst .form-table .parent {
167
  border-bottom: 0;
168
+ vertical-align: top; }
 
 
 
 
169
 
170
  .wpmtst .form-table .child {
171
+ border-top: 0; }
 
172
 
173
  .wpmtst .form-table p {
174
+ /*margin-bottom: 1em;*/ }
 
175
 
176
  .wpmtst .form-table td p:last-child {
177
+ margin-bottom: 0; }
 
178
 
179
  .wpmtst .form-table input,
180
  .wpmtst .form-table select,
181
  .wpmtst .form-table textarea {
182
+ /*line-height: 1.5em;*/ }
 
183
 
184
  .wpmtst .form-table input[type="button"] {
185
  line-height: 26px;
186
+ height: 28px; }
 
187
 
188
  .wpmtst select {
189
+ min-width: 120px; }
 
190
 
191
  .wpmtst option {
192
+ padding-left: 5px; }
 
193
 
194
  .wpmtst .form-table div.box {
195
  border: 1px solid #DDD;
196
  display: inline-block;
197
+ padding: 10px; }
 
198
 
199
  .wpmtst .form-table .row {
200
+ line-height: 2.5em; }
 
201
 
202
  .wpmtst .form-table .alpha {
203
+ width: 120px; }
 
204
 
205
  .wpmtst .form-table .alpha.alpha-110 {
206
+ width: 110px; }
 
207
 
208
  .wpmtst .form-table .alpha + div {
209
+ display: inline-block; }
 
210
 
211
  .wpmtst label.success-action {
212
  display: inline-block;
213
  width: 11em;
214
+ padding: 10px 0; }
 
215
 
216
  /* compact */
 
217
  .wpmtst .form-table.compact th {
218
+ vertical-align: top; }
 
219
 
220
  .wpmtst .form-table.compact td {
221
+ vertical-align: middle; }
 
222
 
223
  /*.wpmtst .form-table.compact td:nth-child(3) {*/
224
  .wpmtst .form-table.compact td.actions {
225
  width: 100px;
226
+ vertical-align: bottom; }
 
227
 
228
  /*.wpmtst .form-table.compact td:nth-child(3) input.button {*/
229
  .wpmtst .form-table.compact td.actions input.button {
230
  margin-right: 0;
231
+ margin-bottom: 3px; }
 
232
 
233
  .wpmtst .form-table.compact input[type="text"] {
234
+ width: 100%; }
 
235
 
236
  .wpmtst .form-table.compact input.error {
237
  border-color: red;
238
  border-radius: 2px;
239
+ box-shadow: none; }
 
240
 
241
  .wpmtst .form-table.compact label.error {
242
  color: red;
243
+ display: block; }
 
244
 
245
  /* end: form-table */
 
246
  .code {
247
+ background: #FFF; }
 
248
 
249
  .code.wide {
250
  padding: 2px 5px;
251
  margin: 3px;
252
+ border-radius: 2px; }
 
253
 
254
  .submit-buttons input.button {
255
+ margin-right: 10px; }
 
256
 
257
  .custom-input {
258
+ line-height: 1.3em; }
 
259
 
260
  .indent {
261
+ margin-left: 2em; }
 
262
 
263
  .outdent {
264
+ margin-left: -2em; }
 
265
 
266
  .hilite {
267
  background: lightyellow;
268
  border-radius: 4px;
269
  display: inline-block;
270
  padding: .25em .75em;
271
+ box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); }
 
 
 
272
 
273
  p.description.hilite {
274
+ margin-bottom: 2em; }
 
275
 
276
  ul.compact {
277
+ margin: 0; }
 
278
 
279
  ul.compact li {
280
  display: inline-block;
281
+ margin: 6px 30px 6px 0; }
 
282
 
283
  /* Add-on license table
284
+ ------------------------------------------------*/
 
285
  #licenses-form .form-table {
286
  width: auto;
287
+ max-width: 1024px; }
 
288
 
289
  #licenses-form .form-table label {
290
  /* to match text inputs */
291
+ line-height: 27px; }
 
292
 
293
  #licenses-form .form-table th,
294
  #licenses-form .form-table td {
295
+ vertical-align: top; }
 
296
 
297
  #licenses-form th.for-license-key,
298
  #licenses-form th.for-license-status {
299
+ width: 350px; }
 
300
 
301
  #licenses-form .form-table th {
302
+ padding: 15px; }
 
303
 
304
  #licenses-form .form-table td {
305
  white-space: nowrap;
306
+ padding: 15px; }
 
307
 
308
  #licenses-form .form-table th:first-child,
309
  #licenses-form .form-table td:first-child {
310
+ padding-left: 0; }
 
311
 
312
  #licenses-form .form-table input[type="text"] {
313
  font-family: Consolas, Monaco, monospace;
314
+ width: 100%; }
 
315
 
316
  #licenses-form .form-table label {
317
  padding-left: 0;
318
+ text-indent: 0; }
 
319
 
320
  #licenses-form .doing-ajax:before {
321
  display: inline-block;
322
  font: normal 22px/29px dashicons;
323
+ content: "\F463";
324
  text-align: center;
325
  vertical-align: middle;
 
326
  -webkit-animation-name: rotate;
327
  -webkit-animation-duration: 1.5s;
328
  -webkit-animation-iteration-count: infinite;
334
  animation-name: rotate;
335
  animation-duration: 1.5s;
336
  animation-iteration-count: infinite;
337
+ animation-timing-function: linear; }
 
338
 
339
  #licenses-form span.license-status {
340
  display: inline-block;
345
  padding: 0 8px;
346
  text-transform: uppercase;
347
  border-radius: 3px;
348
+ vertical-align: middle; }
 
349
 
350
  #licenses-form span.active {
351
  background: green;
352
+ color: #FFF; }
 
353
 
354
  #licenses-form span.inactive {
355
  background: #999;
356
+ color: #FFF; }
 
357
 
358
  #licenses-form span.ib {
359
  display: inline-block;
360
+ vertical-align: middle; }
 
361
 
362
  .activation-error {
363
+ color: red; }
 
364
 
365
  /* Descriptions
366
+ ------------------------------------------------*/
 
367
  .form-table th .description,
368
  .form-table td .description {
369
  font-size: 14px;
370
  font-style: italic;
371
+ /*text-indent: 24px;*/ }
 
372
 
373
  .description.inline {
374
  display: inline-block;
375
+ margin-left: 1em; }
 
376
 
377
  .description a {
378
+ text-decoration: underline; }
 
379
 
380
  .description a:hover {
381
+ text-decoration: none; }
 
382
 
383
  .radio .description {
384
+ padding-left: 20px; }
 
385
 
386
  li.checkbox {
387
+ margin-bottom: 10px; }
 
388
 
389
  .checkbox .description {
390
+ padding-left: 24px; }
 
391
 
392
  ul.description {
393
  font-style: italic;
395
  margin-top: 4px;
396
  list-style-type: disc;
397
  margin-left: 21px;
398
+ margin-bottom: 0; }
 
399
 
400
  /* Widget
401
+ ------------------------------------------------*/
402
  .wpmtst-widget-form {
403
+ margin-bottom: 1em; }
 
404
 
405
  .widget-inside p {
406
+ margin: .5em 0; }
 
407
 
408
  input[disabled],
409
  input[readonly] {
410
  color: #999;
411
+ background: rgba(0, 0, 0, 0.04); }
 
412
 
413
  /* Categories admin list
414
+ ------------------------------------------------*/
415
  .widefat th.column-ID {
416
+ width: 2.2em; }
 
417
 
418
  /* Post list table
419
+ ------------------------------------------------*/
420
  td.column-shortcode,
421
  td.column-id {
422
  white-space: nowrap;
423
+ font-family: Consolas, Monaco, monospace; }
 
424
 
425
  th.sortable.column-id a span {
426
+ float: right; }
 
427
 
428
  td.column-id {
429
+ text-align: right; }
 
430
 
431
  /* Star rating in list table
432
+ --------------------------------------------------*/
433
  .column-rating {
434
+ width: auto !important; }
 
435
 
436
  /* Views list table
437
+ --------------------------------------------------*/
438
  .wp-list-table.fixed.wpm-testimonial_page_testimonial-views {
439
+ table-layout: auto; }
 
440
 
441
  .wpmtst2 > h1 {
442
+ margin-bottom: 15px; }
 
443
 
444
  /* WordPress fixes
445
+ --------------------------------------------------*/
 
446
  /* settings page */
447
  @media screen and (max-width: 782px) {
448
  .wpm-testimonial_page_testimonial-settings .form-table td input[type="text"] {
449
  display: inline-block;
450
+ width: auto; } }
 
 
451
 
452
  /* Animation
453
+ --------------------------------------------------*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
 
455
  @keyframes rotate {
456
  from {
457
+ transform: rotate(0deg); }
 
458
  to {
459
+ transform: rotate(360deg); } }
 
 
460
 
461
  /* Admin > Shortcode example table
462
+ --------------------------------------------------*/
463
  .form-table.shortcodes tbody tr:hover {
464
+ background: #FFF; }
 
465
 
466
  .form-table.shortcodes th {
467
  padding-left: 10px;
468
+ width: auto; }
 
469
 
470
  .form-table.shortcodes td {
471
+ border: 1px solid #DDD; }
 
472
 
473
  .form-table.shortcodes td.shortcode {
474
+ font-family: Consolas, Monaco, monospace; }
 
475
 
476
  .form-table.shortcodes td p {
477
+ margin: 1em 0; }
 
478
 
479
  .form-table.shortcodes td p:first-child {
480
+ margin-top: 0; }
 
481
 
482
  .form-table.shortcodes td p:last-child {
483
+ margin-bottom: 0; }
 
484
 
485
  /* special */
 
486
  .form-table.shortcodes tr.important {
487
+ background: #FFF; }
 
488
 
489
  .form-table.shortcodes tr.important td {
490
+ border: 1px solid #CCC; }
 
491
 
492
  /* Misc
493
+ --------------------------------------------------*/
494
  .slug-example {
495
  font-weight: bold;
496
+ color: #0073aa; }
 
497
 
498
  .form-table.width-auto {
499
+ width: auto; }
 
500
 
501
  .form-table td p:first-child {
502
+ margin-top: 6px; }
 
503
 
504
  .current-dashicon {
505
  display: inline-block;
511
  width: 28px;
512
  height: 28px;
513
  position: relative;
514
+ top: -3px; }
 
515
 
516
  .current-dashicon .dashicons {
517
  vertical-align: middle;
518
+ line-height: 1.3; }
 
519
 
520
  /*
521
+ Back these out to have normal "reset" buttons
522
+ */
 
523
  /* wp-includes/css/buttons.css:109 */
524
  /*
525
+ .wp-core-ui input[type="reset"],
526
+ .wp-core-ui input[type="reset"]:hover,
527
+ .wp-core-ui input[type="reset"]:active,
528
+ .wp-core-ui input[type="reset"]:focus {
529
+ background: none;
530
+ border: none;
531
+ -webkit-box-shadow: none;
532
+ box-shadow: none;
533
+ padding: 0 2px 1px;
534
+ width: auto;
535
+ }
536
+ */
537
  .wp-core-ui input[type="reset"],
538
  .wp-core-ui input[type="reset"]:hover,
539
  .wp-core-ui input[type="reset"]:active,
540
  .wp-core-ui input[type="reset"]:focus {
541
  background: #F7F7F7;
542
  border: 1px solid #CCC;
 
543
  box-shadow: 0 1px 0 #CCC;
544
  padding: 0 10px 1px;
545
+ width: auto; }
 
546
 
547
  /* wp-admin/css/forms.css:102 */
548
  /*
549
+ .wp-core-ui input[type="reset"]:hover,
550
+ .wp-core-ui input[type="reset"]:active {
551
+ color: #00a0d2;
552
+ }
553
+ */
554
  /* Based on section 2.0 in wp-includes/css/buttons.css:125 */
555
  .wp-core-ui input[type="reset"]:hover,
556
  .wp-core-ui input[type="reset"]:focus {
557
  background: #fafafa;
558
  border-color: #999;
559
+ color: #23282d; }
 
560
 
561
  .wp-core-ui input[type="reset"]:focus {
562
  border-color: #5b9dd9;
563
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); }
 
 
564
 
565
  .wp-core-ui input[type="reset"]:active {
566
  background: #eee;
567
  border-color: #999;
 
568
  box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
569
+ transform: translateY(1px); }
 
 
 
570
 
571
  input.button.restore-default {
572
  font: normal 20px/1 dashicons;
573
+ padding: 1px 3px; }
 
574
 
575
  .wpmtst .subsubsub {
576
  float: none;
577
+ margin-left: 16px; }
 
578
 
579
  .regular-text.half {
580
+ width: 12.5em; }
 
581
 
582
  .regular-text.third {
583
+ width: 20em; }
 
584
 
585
  input.code {
586
  font-size: 13px;
587
+ font-family: Consolas, Monaco, monospace; }
 
588
 
589
  .wrap h2.nav-tab-wrapper {
590
+ margin-top: 6px; }
 
591
 
592
  .tab-header {
593
+ padding: 1em 0; }
 
594
 
595
  .striped > tbody > tr.readonly {
596
+ background: lightyellow; }
 
597
 
598
  ul.standard {
599
  list-style: disc;
600
+ padding-left: 1.5em; }
 
601
 
602
  .form-table p.error {
603
+ margin: 0.5em 0; }
 
604
 
605
  /* shortcodes page */
606
  .wpmtst.shortcode {
607
+ vertical-align: middle; }
608
+
609
  .wpmtst.shortcodes.has-stars table {
610
+ margin-bottom: 1em; }
611
+
612
  .wpmtst.shortcodes.has-stars td:nth-child(2) {
613
  width: 70%;
614
+ /*white-space: nowrap;*/ }
615
+
616
  .wpmtst.shortcodes td {
617
+ padding: 10px; }
618
+
619
  .wpmtst.shortcodes tr.important td {
620
+ border: 1px solid #DDD; }
621
+
622
  .wpmtst.shortcodes tr:hover {
623
+ background: #FFF; }
 
624
 
625
  /* inner table */
626
  .wpmtst.shortcodes td.has-inner {
627
+ padding: 0; }
628
+
629
  .wpmtst.shortcodes table.inner {
630
  margin: 0;
631
  vertical-align: middle;
632
+ width: 100%; }
633
+
634
  .wpmtst.shortcodes table.inner,
635
  .wpmtst.shortcodes table.inner tr,
636
  .wpmtst.shortcodes table.inner td {
637
+ border: 0; }
638
+
639
  .wpmtst.shortcodes table.inner tr:first-child td {
640
+ border-bottom: 1px solid #DDD; }
 
641
 
642
  .wp-list-table .type-wpm-testimonial .row-actions span.id span {
643
+ color: #777; }
644
+
645
+ .wpm-testimonial_page_about-strong-testimonials .wpmst-mascot {
646
+ width: 160px;
647
+ margin-left: 1rem;
648
+ float: right; }
649
 
650
+ .edit-php.post-type-wpm-testimonial .wpmtst-notice {
651
+ padding: 2.5rem 2rem;
652
+ border: 2px solid #7F22DE; }
 
653
 
654
+ .edit-php.post-type-wpm-testimonial .wpmtst-notice img {
655
+ max-width: 100%; }
656
+
657
+ .edit-php.post-type-wpm-testimonial .wpmst-mascot {
658
+ width: 120px;
659
+ margin-right: 2rem;
660
+ float: left; }
assets/js/admin-js.js ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function(modules) { // webpackBootstrap
2
+ /******/ // The module cache
3
+ /******/ var installedModules = {};
4
+ /******/
5
+ /******/ // The require function
6
+ /******/ function __webpack_require__(moduleId) {
7
+ /******/
8
+ /******/ // Check if module is in cache
9
+ /******/ if(installedModules[moduleId]) {
10
+ /******/ return installedModules[moduleId].exports;
11
+ /******/ }
12
+ /******/ // Create a new module (and put it into the cache)
13
+ /******/ var module = installedModules[moduleId] = {
14
+ /******/ i: moduleId,
15
+ /******/ l: false,
16
+ /******/ exports: {}
17
+ /******/ };
18
+ /******/
19
+ /******/ // Execute the module function
20
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
+ /******/
22
+ /******/ // Flag the module as loaded
23
+ /******/ module.l = true;
24
+ /******/
25
+ /******/ // Return the exports of the module
26
+ /******/ return module.exports;
27
+ /******/ }
28
+ /******/
29
+ /******/
30
+ /******/ // expose the modules object (__webpack_modules__)
31
+ /******/ __webpack_require__.m = modules;
32
+ /******/
33
+ /******/ // expose the module cache
34
+ /******/ __webpack_require__.c = installedModules;
35
+ /******/
36
+ /******/ // identity function for calling harmony imports with the correct context
37
+ /******/ __webpack_require__.i = function(value) { return value; };
38
+ /******/
39
+ /******/ // define getter function for harmony exports
40
+ /******/ __webpack_require__.d = function(exports, name, getter) {
41
+ /******/ if(!__webpack_require__.o(exports, name)) {
42
+ /******/ Object.defineProperty(exports, name, {
43
+ /******/ configurable: false,
44
+ /******/ enumerable: true,
45
+ /******/ get: getter
46
+ /******/ });
47
+ /******/ }
48
+ /******/ };
49
+ /******/
50
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
51
+ /******/ __webpack_require__.n = function(module) {
52
+ /******/ var getter = module && module.__esModule ?
53
+ /******/ function getDefault() { return module['default']; } :
54
+ /******/ function getModuleExports() { return module; };
55
+ /******/ __webpack_require__.d(getter, 'a', getter);
56
+ /******/ return getter;
57
+ /******/ };
58
+ /******/
59
+ /******/ // Object.prototype.hasOwnProperty.call
60
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
61
+ /******/
62
+ /******/ // __webpack_public_path__
63
+ /******/ __webpack_require__.p = "";
64
+ /******/
65
+ /******/ // Load entry module and return exports
66
+ /******/ return __webpack_require__(__webpack_require__.s = 1);
67
+ /******/ })
68
+ /************************************************************************/
69
+ /******/ ([
70
+ /* 0 */
71
+ /***/ (function(module, exports, __webpack_require__) {
72
+
73
+ "use strict";
74
+
75
+
76
+ Object.defineProperty(exports, "__esModule", {
77
+ value: true
78
+ });
79
+
80
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
81
+
82
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
83
+
84
+ var Notice = function () {
85
+ function Notice($element) {
86
+ var _this = this;
87
+
88
+ _classCallCheck(this, Notice);
89
+
90
+ this.$element = $element;
91
+ this.key = $element.data('key');
92
+ this.nonce = $element.data('nonce');
93
+
94
+ jQuery(document).on('click', '.wpmtst-notice .notice-dismiss', function () {
95
+ return _this.onDismissClick();
96
+ });
97
+ }
98
+
99
+ _createClass(Notice, [{
100
+ key: 'onDismissClick',
101
+ value: function onDismissClick() {
102
+ jQuery.ajax({
103
+ type: "POST",
104
+ data: { action: "wpmtst_dismiss_notice", nonce: this.nonce, key: this.key },
105
+ url: ajaxurl
106
+ });
107
+ }
108
+ }]);
109
+
110
+ return Notice;
111
+ }();
112
+
113
+ exports.default = Notice;
114
+
115
+ /***/ }),
116
+ /* 1 */
117
+ /***/ (function(module, exports, __webpack_require__) {
118
+
119
+ "use strict";
120
+
121
+
122
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
123
+
124
+ var _notice = __webpack_require__(0);
125
+
126
+ var _notice2 = _interopRequireDefault(_notice);
127
+
128
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
129
+
130
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
131
+
132
+ /**
133
+ * Strong Testimonials admin
134
+ *
135
+ * @namespace jQuery
136
+ */
137
+
138
+ // Function to get the Max value in Array
139
+ Array.max = function (array) {
140
+ return Math.max.apply(Math, array);
141
+ };
142
+
143
+ jQuery(document).ready(function ($) {
144
+
145
+ // Convert "A String" to "a_string"
146
+ function convertLabel(label) {
147
+ return label.replace(/\s+/g, '_').replace(/\W/g, '').toLowerCase();
148
+ }
149
+
150
+ // Remove invalid characters
151
+ function removeSpaces(word) {
152
+ //return word.replace(/\s+/g, "_");
153
+ return word.replace(/[^\w\s(?!\-)]/gi, '');
154
+ }
155
+
156
+ $.fn.showInlineBlock = function () {
157
+ return this.css('display', 'inline-block');
158
+ };
159
+
160
+ /**
161
+ * ----------------------------------------
162
+ * General events
163
+ * ----------------------------------------
164
+ */
165
+
166
+ // Add protocol if missing
167
+ // Thanks http://stackoverflow.com/a/36429927/51600
168
+ $('input[type=url]').change(function () {
169
+ if (this.value.length && !/^https*:\/\//.test(this.value)) {
170
+ this.value = 'http://' + this.value;
171
+ }
172
+ });
173
+
174
+ $('ul.ui-tabs-nav li a').click(function () {
175
+ $(this).blur();
176
+ });
177
+
178
+ $('.focus-next-field').change(function (e) {
179
+ if ($(e.target).is(':checked')) {
180
+ $(e.target).parent().next().find('input').focus().select();
181
+ }
182
+ });
183
+
184
+ // toggle screenshots
185
+ $('#toggle-screen-options').add('#screenshot-screen-options').click(function (e) {
186
+ $(this).blur();
187
+ $('#screenshot-screen-options').slideToggle();
188
+ });
189
+
190
+ // toggle screenshots
191
+ $('#toggle-help').click(function (e) {
192
+ $(this).toggleClass('closed open').blur();
193
+ $('#help-section').slideToggle();
194
+ });
195
+
196
+ /**
197
+ * ----------------------------------------
198
+ * View List Table
199
+ * ----------------------------------------
200
+ */
201
+
202
+ /**
203
+ * Save sort order
204
+ */
205
+ $('table.wpm-testimonial_page_testimonial-views th.manage-column').on('click', function (e) {
206
+ var columnName = $(this).attr('id');
207
+ // get the opposite class
208
+ var columnOrder = $(this).hasClass('asc') ? 'desc' : $(this).hasClass('desc') ? 'asc' : '';
209
+ var data = {
210
+ 'action': 'wpmtst_save_view_list_order',
211
+ 'name': columnName,
212
+ 'order': columnOrder
213
+ };
214
+ $.get(ajaxurl, data, function (response) {});
215
+ });
216
+
217
+ /**
218
+ * Sticky views
219
+ */
220
+ $('table.wpm-testimonial_page_testimonial-views').on('click', '.stickit', function (e) {
221
+ var icon = $(this);
222
+ icon.closest('.wp-list-table-wrap').find('.overlay').fadeIn(200);
223
+ icon.blur().toggleClass('stuck');
224
+ var id = $(this).closest('tr').find('td.id').html();
225
+ var data = {
226
+ 'action': 'wpmtst_save_view_sticky',
227
+ 'id': id
228
+ };
229
+ $.get(ajaxurl, data, function (response) {
230
+ if (response) {
231
+ window.location.reload();
232
+ }
233
+ });
234
+ });
235
+ });
236
+
237
+ var WPMTST_Admin = function () {
238
+ function WPMTST_Admin() {
239
+ _classCallCheck(this, WPMTST_Admin);
240
+
241
+ this.initNotices();
242
+ }
243
+
244
+ _createClass(WPMTST_Admin, [{
245
+ key: 'initNotices',
246
+ value: function initNotices() {
247
+ var $div = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : jQuery("body");
248
+
249
+ $div.find('.wpmtst-notice').each(function (index) {
250
+ new _notice2.default(jQuery(this));
251
+ });
252
+ }
253
+ }]);
254
+
255
+ return WPMTST_Admin;
256
+ }();
257
+
258
+ window.WPMTST_Admin = new WPMTST_Admin();
259
+
260
+ /***/ })
261
+ /******/ ]);
assets/src/js/admin.js ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Strong Testimonials admin
3
+ *
4
+ * @namespace jQuery
5
+ */
6
+
7
+ // Function to get the Max value in Array
8
+ Array.max = function (array) {
9
+ return Math.max.apply(Math, array);
10
+ };
11
+
12
+ jQuery(document).ready(function ($) {
13
+
14
+ // Convert "A String" to "a_string"
15
+ function convertLabel(label) {
16
+ return label.replace(/\s+/g, '_').replace(/\W/g, '').toLowerCase();
17
+ }
18
+
19
+ // Remove invalid characters
20
+ function removeSpaces(word) {
21
+ //return word.replace(/\s+/g, "_");
22
+ return word.replace(/[^\w\s(?!\-)]/gi, '');
23
+ }
24
+
25
+ $.fn.showInlineBlock = function () {
26
+ return this.css('display', 'inline-block');
27
+ };
28
+
29
+ /**
30
+ * ----------------------------------------
31
+ * General events
32
+ * ----------------------------------------
33
+ */
34
+
35
+ // Add protocol if missing
36
+ // Thanks http://stackoverflow.com/a/36429927/51600
37
+ $('input[type=url]').change(function () {
38
+ if (this.value.length && !/^https*:\/\//.test(this.value)) {
39
+ this.value = 'http://' + this.value;
40
+ }
41
+ });
42
+
43
+ $('ul.ui-tabs-nav li a').click(function () {
44
+ $(this).blur();
45
+ });
46
+
47
+ $('.focus-next-field').change(function (e) {
48
+ if ($(e.target).is(':checked')) {
49
+ $(e.target).parent().next().find('input').focus().select();
50
+ }
51
+ });
52
+
53
+ // toggle screenshots
54
+ $('#toggle-screen-options').add('#screenshot-screen-options').click(function (e) {
55
+ $(this).blur();
56
+ $('#screenshot-screen-options').slideToggle();
57
+ });
58
+
59
+ // toggle screenshots
60
+ $('#toggle-help').click(function (e) {
61
+ $(this).toggleClass('closed open').blur();
62
+ $('#help-section').slideToggle();
63
+ });
64
+
65
+ /**
66
+ * ----------------------------------------
67
+ * View List Table
68
+ * ----------------------------------------
69
+ */
70
+
71
+ /**
72
+ * Save sort order
73
+ */
74
+ $('table.wpm-testimonial_page_testimonial-views th.manage-column').on('click', function (e) {
75
+ var columnName = $(this).attr('id');
76
+ // get the opposite class
77
+ var columnOrder = $(this).hasClass('asc') ? 'desc' : $(this).hasClass('desc') ? 'asc' : '';
78
+ var data = {
79
+ 'action': 'wpmtst_save_view_list_order',
80
+ 'name': columnName,
81
+ 'order': columnOrder
82
+ };
83
+ $.get(ajaxurl, data, function (response) {
84
+ });
85
+ });
86
+
87
+ /**
88
+ * Sticky views
89
+ */
90
+ $('table.wpm-testimonial_page_testimonial-views').on('click', '.stickit', function (e) {
91
+ var icon = $(this);
92
+ icon.closest('.wp-list-table-wrap').find('.overlay').fadeIn(200);
93
+ icon.blur().toggleClass('stuck');
94
+ var id = $(this).closest('tr').find('td.id').html();
95
+ var data = {
96
+ 'action': 'wpmtst_save_view_sticky',
97
+ 'id': id
98
+ };
99
+ $.get(ajaxurl, data, function (response) {
100
+ if (response) {
101
+ window.location.reload();
102
+ }
103
+ });
104
+ });
105
+
106
+ });
107
+
108
+
109
+ import Notice from './modules/notice';
110
+
111
+ class WPMTST_Admin {
112
+
113
+ constructor(){
114
+ this.initNotices();
115
+ }
116
+
117
+ initNotices( $div = jQuery("body") ) {
118
+ $div.find('.wpmtst-notice').each( function( index ) {
119
+ new Notice( jQuery(this) );
120
+ });
121
+ }
122
+
123
+ }
124
+
125
+ window.WPMTST_Admin = new WPMTST_Admin();
assets/src/js/modules/notice.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export default class Notice {
2
+
3
+ constructor($element){
4
+ this.$element = $element;
5
+ this.key = $element.data('key');
6
+ this.nonce = $element.data('nonce');
7
+
8
+ jQuery(document).on( 'click', '.wpmtst-notice .notice-dismiss', () => this.onDismissClick() );
9
+ }
10
+
11
+ onDismissClick() {
12
+ jQuery.ajax({
13
+ type: "POST",
14
+ data : { action: "wpmtst_dismiss_notice", nonce: this.nonce, key: this.key },
15
+ url : ajaxurl
16
+ });
17
+ }
18
+
19
+ }
20
+
21
+
assets/src/js/modules/range-slider.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export default class RangeSlider {
2
+
3
+ constructor($element){
4
+ this.$element = $element;
5
+ this.$slider = this.$element.find('.wpmtst-range__slider');
6
+ this.$minInput = this.$element.find('.wpmtst-range__min');
7
+ this.$maxInput = this.$element.find('.wpmtst-range__max');
8
+
9
+ this.initRangeSlider();
10
+ }
11
+
12
+ initRangeSlider() {
13
+ this.$slider.slider({
14
+ range: true,
15
+ min: this.$slider.data('min'),
16
+ max: this.$slider.data('max'),
17
+ values: this.$slider.data('values').split(","),
18
+ slide: ( event, ui ) => {
19
+ this.$minInput.val( ui.values[ 0 ] );
20
+ this.$maxInput.val( ui.values[ 1 ] );
21
+ }
22
+ });
23
+ }
24
+ }
25
+
26
+
assets/src/scss/admin.scss ADDED
@@ -0,0 +1,853 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Strong Testimonials admin stylesheet
3
+ */
4
+
5
+ .icon-blue {
6
+ color: #0073aa;
7
+ }
8
+
9
+ .error {
10
+ color: red !important;
11
+ }
12
+
13
+ .required-phrase {
14
+ color: red;
15
+ font-style: normal;
16
+ font-weight: 400;
17
+ font-size: 0.9em;
18
+ }
19
+
20
+ .required-phrase:before,
21
+ label.required:after {
22
+ content: '*';
23
+ display: inline-block;
24
+ color: red;
25
+ font-size: 27px;
26
+ line-height: 19px;
27
+ height: 19px;
28
+ font-weight: 600;
29
+ vertical-align: middle;
30
+ position: relative;
31
+ top: 1px;
32
+ }
33
+
34
+ .has-input {
35
+ display: inline-block;
36
+ }
37
+
38
+ .error-message {
39
+ display: inline-block;
40
+ margin-left: 0.5em;
41
+ }
42
+
43
+ button.nogo {
44
+ margin: 0 3px;
45
+ }
46
+
47
+ li.warning {
48
+ background: lightyellow;
49
+ }
50
+
51
+ .between-inputs {
52
+ margin-left: 0.3em;
53
+ margin-right: 0.3em;
54
+ }
55
+
56
+ .intro p {
57
+ font-size: 14px;
58
+ }
59
+
60
+ .wrap.wpmtst h2 {
61
+ margin: 2em 0 1em;
62
+ }
63
+
64
+ .wrap.wpmtst p {
65
+ font-size: 14px;
66
+ }
67
+
68
+ .wrap.wpmtst .notice p {
69
+ font-size: 13px;
70
+ }
71
+
72
+ .wpmtst .list-wrap {
73
+ padding: .5em;
74
+ }
75
+
76
+ .wp-core-ui .button-primary.active,
77
+ .wp-core-ui .button-primary.active:hover,
78
+ .wp-core-ui .button-primary.active:focus,
79
+ .wp-core-ui .button-primary:active {
80
+ vertical-align: baseline;
81
+ }
82
+
83
+ /* Firefox fix */
84
+
85
+ a.widget-action:focus {
86
+ outline: none;
87
+ }
88
+
89
+ /* Slug field */
90
+
91
+ input#post_name {
92
+ width: 98%;
93
+ }
94
+
95
+ fieldset>div {
96
+ min-height: 30px;
97
+ }
98
+
99
+ /* Help sections
100
+ ---------------------------------------------------------*/
101
+
102
+ div.help {
103
+ margin-left: 0;
104
+ }
105
+
106
+ div.help.minor {
107
+ font-size: 0.9em;
108
+ text-align: left;
109
+ }
110
+
111
+ /* Settings table
112
+ ---------------------------------------------------------*/
113
+
114
+ .wpmtst i.fa.example {
115
+ color: #0073aa;
116
+ }
117
+
118
+ .stackem ul {
119
+ margin: 14px 0 0 0;
120
+ }
121
+
122
+ .stackem li {
123
+ margin-top: 16px;
124
+ margin-bottom: 16px;
125
+ }
126
+
127
+ .stackem label {
128
+ display: inline-block;
129
+ line-height: 28px;
130
+ margin-right: 0.5em;
131
+ vertical-align: baseline;
132
+ }
133
+
134
+ .stackem label.inline {
135
+ display: inline-block;
136
+ }
137
+
138
+ .stackem p.description {
139
+ margin-top: 0;
140
+ margin-left: 22px;
141
+ }
142
+
143
+ .stackem p.description.warning {
144
+ color: #CD0000;
145
+ }
146
+
147
+ .stackem .notice {
148
+ background: none;
149
+ border: none;
150
+ box-shadow: none;
151
+ display: inline-block;
152
+ font-size: .9em;
153
+ font-style: italic;
154
+ margin: 0 .2em;
155
+ padding: 0;
156
+ color: #868686;
157
+ }
158
+
159
+ .stackem span.link {
160
+ display: inline-block;
161
+ margin: 0 .3em;
162
+ font-size: .9em;
163
+ line-height: 28px;
164
+ }
165
+
166
+ .stackem label.disabled {
167
+ color: #888;
168
+ }
169
+
170
+ div.radio {
171
+ line-height: 1.5em;
172
+ }
173
+
174
+ div.radio:hover {
175
+ color: #000;
176
+ }
177
+
178
+ #screenshot-screen-options,
179
+ #help-section {
180
+ display: none;
181
+ }
182
+
183
+ .screenshot>div {
184
+ display: inline-block;
185
+ -webkit-box-shadow: inset 0px 0px 40px rgba(0, 0, 0, 0.8);
186
+ -moz-box-shadow: inset 0px 0px 40px rgba(0, 0, 0, 0.8);
187
+ box-shadow: inset 0px 0px 40px rgba(0, 0, 0, 0.8);
188
+ }
189
+
190
+ .help-text {
191
+ padding: 0.5em 0;
192
+ }
193
+
194
+ /* form table */
195
+
196
+ .wpmtst .form-table {
197
+ vertical-align: middle;
198
+ }
199
+
200
+ .wpmtst .form-table .actions {
201
+ /*vertical-align: top;*/
202
+ }
203
+
204
+ .wpmtst .form-table td {
205
+ padding-top: 15px;
206
+ /* override PopupMaker's override */
207
+ }
208
+
209
+ .wpmtst .form-table td:nth-child(1) {
210
+ width: 200px;
211
+ }
212
+
213
+ .wpmtst .form-table .parent {
214
+ border-bottom: 0;
215
+ vertical-align: top;
216
+ }
217
+
218
+ .wpmtst .form-table th.parent+td {}
219
+
220
+ .wpmtst .form-table .child {
221
+ border-top: 0;
222
+ }
223
+
224
+ .wpmtst .form-table p {
225
+ /*margin-bottom: 1em;*/
226
+ }
227
+
228
+ .wpmtst .form-table td p:last-child {
229
+ margin-bottom: 0;
230
+ }
231
+
232
+ .wpmtst .form-table input,
233
+ .wpmtst .form-table select,
234
+ .wpmtst .form-table textarea {
235
+ /*line-height: 1.5em;*/
236
+ }
237
+
238
+ .wpmtst .form-table input[type="button"] {
239
+ line-height: 26px;
240
+ height: 28px;
241
+ }
242
+
243
+ .wpmtst select {
244
+ min-width: 120px;
245
+ }
246
+
247
+ .wpmtst option {
248
+ padding-left: 5px;
249
+ }
250
+
251
+ .wpmtst .form-table div.box {
252
+ border: 1px solid #DDD;
253
+ display: inline-block;
254
+ padding: 10px;
255
+ }
256
+
257
+ .wpmtst .form-table .row {
258
+ line-height: 2.5em;
259
+ }
260
+
261
+ .wpmtst .form-table .alpha {
262
+ width: 120px;
263
+ }
264
+
265
+ .wpmtst .form-table .alpha.alpha-110 {
266
+ width: 110px;
267
+ }
268
+
269
+ .wpmtst .form-table .alpha+div {
270
+ display: inline-block;
271
+ }
272
+
273
+ .wpmtst label.success-action {
274
+ display: inline-block;
275
+ width: 11em;
276
+ padding: 10px 0;
277
+ }
278
+
279
+ /* compact */
280
+
281
+ .wpmtst .form-table.compact th {
282
+ vertical-align: top;
283
+ }
284
+
285
+ .wpmtst .form-table.compact td {
286
+ vertical-align: middle;
287
+ }
288
+
289
+ /*.wpmtst .form-table.compact td:nth-child(3) {*/
290
+
291
+ .wpmtst .form-table.compact td.actions {
292
+ width: 100px;
293
+ vertical-align: bottom;
294
+ }
295
+
296
+ /*.wpmtst .form-table.compact td:nth-child(3) input.button {*/
297
+
298
+ .wpmtst .form-table.compact td.actions input.button {
299
+ margin-right: 0;
300
+ margin-bottom: 3px;
301
+ }
302
+
303
+ .wpmtst .form-table.compact input[type="text"] {
304
+ width: 100%;
305
+ }
306
+
307
+ .wpmtst .form-table.compact input.error {
308
+ border-color: red;
309
+ border-radius: 2px;
310
+ box-shadow: none;
311
+ }
312
+
313
+ .wpmtst .form-table.compact label.error {
314
+ color: red;
315
+ display: block;
316
+ }
317
+
318
+ /* end: form-table */
319
+
320
+ .code {
321
+ background: #FFF;
322
+ }
323
+
324
+ .code.wide {
325
+ padding: 2px 5px;
326
+ margin: 3px;
327
+ border-radius: 2px;
328
+ }
329
+
330
+ .submit-buttons input.button {
331
+ margin-right: 10px;
332
+ }
333
+
334
+ .custom-input {
335
+ line-height: 1.3em;
336
+ }
337
+
338
+ .indent {
339
+ margin-left: 2em;
340
+ }
341
+
342
+ .outdent {
343
+ margin-left: -2em;
344
+ }
345
+
346
+ .hilite {
347
+ background: lightyellow;
348
+ border-radius: 4px;
349
+ display: inline-block;
350
+ padding: .25em .75em;
351
+ -webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
352
+ -moz-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
353
+ box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
354
+ }
355
+
356
+ p.description.hilite {
357
+ margin-bottom: 2em;
358
+ }
359
+
360
+ ul.compact {
361
+ margin: 0;
362
+ }
363
+
364
+ ul.compact li {
365
+ display: inline-block;
366
+ margin: 6px 30px 6px 0;
367
+ }
368
+
369
+ /* Add-on license table
370
+ ------------------------------------------------*/
371
+
372
+ #licenses-form .form-table {
373
+ width: auto;
374
+ max-width: 1024px;
375
+ }
376
+
377
+ #licenses-form .form-table label {
378
+ /* to match text inputs */
379
+ line-height: 27px;
380
+ }
381
+
382
+ #licenses-form .form-table th,
383
+ #licenses-form .form-table td {
384
+ vertical-align: top;
385
+ }
386
+
387
+ #licenses-form th.for-license-key,
388
+ #licenses-form th.for-license-status {
389
+ width: 350px;
390
+ }
391
+
392
+ #licenses-form .form-table th {
393
+ padding: 15px;
394
+ }
395
+
396
+ #licenses-form .form-table td {
397
+ white-space: nowrap;
398
+ padding: 15px;
399
+ }
400
+
401
+ #licenses-form .form-table th:first-child,
402
+ #licenses-form .form-table td:first-child {
403
+ padding-left: 0;
404
+ }
405
+
406
+ #licenses-form .form-table input[type="text"] {
407
+ font-family: Consolas, Monaco, monospace;
408
+ width: 100%;
409
+ }
410
+
411
+ #licenses-form .form-table label {
412
+ padding-left: 0;
413
+ text-indent: 0;
414
+ }
415
+
416
+ #licenses-form .doing-ajax:before {
417
+ display: inline-block;
418
+ font: normal 22px/29px dashicons;
419
+ content: "\f463";
420
+ text-align: center;
421
+ vertical-align: middle;
422
+ -webkit-animation-name: rotate;
423
+ -webkit-animation-duration: 1.5s;
424
+ -webkit-animation-iteration-count: infinite;
425
+ -webkit-animation-timing-function: linear;
426
+ -moz-animation-name: rotate;
427
+ -moz-animation-duration: 1.5s;
428
+ -moz-animation-iteration-count: infinite;
429
+ -moz-animation-timing-function: linear;
430
+ animation-name: rotate;
431
+ animation-duration: 1.5s;
432
+ animation-iteration-count: infinite;
433
+ animation-timing-function: linear;
434
+ }
435
+
436
+ #licenses-form span.license-status {
437
+ display: inline-block;
438
+ font-size: 0.9em;
439
+ line-height: 28px;
440
+ height: 27px;
441
+ margin: 1px 10px 1px 0;
442
+ padding: 0 8px;
443
+ text-transform: uppercase;
444
+ border-radius: 3px;
445
+ vertical-align: middle;
446
+ }
447
+
448
+ #licenses-form span.active {
449
+ background: green;
450
+ color: #FFF;
451
+ }
452
+
453
+ #licenses-form span.inactive {
454
+ background: #999;
455
+ color: #FFF;
456
+ }
457
+
458
+ #licenses-form span.ib {
459
+ display: inline-block;
460
+ vertical-align: middle;
461
+ }
462
+
463
+ .activation-error {
464
+ color: red;
465
+ }
466
+
467
+ /* Descriptions
468
+ ------------------------------------------------*/
469
+
470
+ .form-table th .description,
471
+ .form-table td .description {
472
+ font-size: 14px;
473
+ font-style: italic;
474
+ /*text-indent: 24px;*/
475
+ }
476
+
477
+ .description.inline {
478
+ display: inline-block;
479
+ margin-left: 1em;
480
+ }
481
+
482
+ .description a {
483
+ text-decoration: underline;
484
+ }
485
+
486
+ .description a:hover {
487
+ text-decoration: none;
488
+ }
489
+
490
+ .radio .description {
491
+ padding-left: 20px;
492
+ }
493
+
494
+ li.checkbox {
495
+ margin-bottom: 10px;
496
+ }
497
+
498
+ .checkbox .description {
499
+ padding-left: 24px;
500
+ }
501
+
502
+ ul.description {
503
+ font-style: italic;
504
+ color: #666;
505
+ margin-top: 4px;
506
+ list-style-type: disc;
507
+ margin-left: 21px;
508
+ margin-bottom: 0;
509
+ }
510
+
511
+ /* Widget
512
+ ------------------------------------------------*/
513
+
514
+ .wpmtst-widget-form {
515
+ margin-bottom: 1em;
516
+ }
517
+
518
+ .widget-inside p {
519
+ margin: .5em 0;
520
+ }
521
+
522
+ input[disabled],
523
+ input[readonly] {
524
+ color: #999;
525
+ background: rgba(0, 0, 0, 0.04);
526
+ }
527
+
528
+ /* Categories admin list
529
+ ------------------------------------------------*/
530
+
531
+ .widefat th.column-ID {
532
+ width: 2.2em;
533
+ }
534
+
535
+ /* Post list table
536
+ ------------------------------------------------*/
537
+
538
+ td.column-shortcode,
539
+ td.column-id {
540
+ white-space: nowrap;
541
+ font-family: Consolas, Monaco, monospace;
542
+ }
543
+
544
+ th.sortable.column-id a span {
545
+ float: right;
546
+ }
547
+
548
+ td.column-id {
549
+ text-align: right;
550
+ }
551
+
552
+ /* Star rating in list table
553
+ --------------------------------------------------*/
554
+
555
+ .column-rating {
556
+ width: auto !important;
557
+ }
558
+
559
+ /* Views list table
560
+ --------------------------------------------------*/
561
+
562
+ .wp-list-table.fixed.wpm-testimonial_page_testimonial-views {
563
+ table-layout: auto;
564
+ }
565
+
566
+ .wpmtst2>h1 {
567
+ margin-bottom: 15px;
568
+ }
569
+
570
+ /* WordPress fixes
571
+ --------------------------------------------------*/
572
+
573
+ /* settings page */
574
+
575
+ @media screen and (max-width: 782px) {
576
+ .wpm-testimonial_page_testimonial-settings .form-table td input[type="text"] {
577
+ display: inline-block;
578
+ width: auto;
579
+ }
580
+ }
581
+
582
+ /* Animation
583
+ --------------------------------------------------*/
584
+
585
+ @-webkit-keyframes rotate {
586
+ from {
587
+ -webkit-transform: rotate(0deg);
588
+ }
589
+ to {
590
+ -webkit-transform: rotate(360deg);
591
+ }
592
+ }
593
+
594
+ @-moz-keyframes rotate {
595
+ from {
596
+ -moz-transform: rotate(0deg);
597
+ }
598
+ to {
599
+ -moz-transform: rotate(360deg);
600
+ }
601
+ }
602
+
603
+ @keyframes rotate {
604
+ from {
605
+ transform: rotate(0deg);
606
+ }
607
+ to {
608
+ transform: rotate(360deg);
609
+ }
610
+ }
611
+
612
+ /* Admin > Shortcode example table
613
+ --------------------------------------------------*/
614
+
615
+ .form-table.shortcodes tbody tr:hover {
616
+ background: #FFF;
617
+ }
618
+
619
+ .form-table.shortcodes th {
620
+ padding-left: 10px;
621
+ width: auto;
622
+ }
623
+
624
+ .form-table.shortcodes td {
625
+ border: 1px solid #DDD;
626
+ }
627
+
628
+ .form-table.shortcodes td.shortcode {
629
+ font-family: Consolas, Monaco, monospace;
630
+ }
631
+
632
+ .form-table.shortcodes td p {
633
+ margin: 1em 0;
634
+ }
635
+
636
+ .form-table.shortcodes td p:first-child {
637
+ margin-top: 0;
638
+ }
639
+
640
+ .form-table.shortcodes td p:last-child {
641
+ margin-bottom: 0;
642
+ }
643
+
644
+ /* special */
645
+
646
+ .form-table.shortcodes tr.important {
647
+ background: #FFF;
648
+ }
649
+
650
+ .form-table.shortcodes tr.important td {
651
+ border: 1px solid #CCC;
652
+ }
653
+
654
+ /* Misc
655
+ --------------------------------------------------*/
656
+
657
+ .slug-example {
658
+ font-weight: bold;
659
+ color: #0073aa;
660
+ }
661
+
662
+ .form-table.width-auto {
663
+ width: auto;
664
+ }
665
+
666
+ .form-table td p:first-child {
667
+ margin-top: 6px;
668
+ }
669
+
670
+ .current-dashicon {
671
+ display: inline-block;
672
+ background: #0073aa;
673
+ color: #FFF;
674
+ border-radius: 2px;
675
+ text-align: center;
676
+ vertical-align: middle;
677
+ width: 28px;
678
+ height: 28px;
679
+ position: relative;
680
+ top: -3px;
681
+ }
682
+
683
+ .current-dashicon .dashicons {
684
+ vertical-align: middle;
685
+ line-height: 1.3;
686
+ }
687
+
688
+ /*
689
+ Back these out to have normal "reset" buttons
690
+ */
691
+
692
+ /* wp-includes/css/buttons.css:109 */
693
+
694
+ /*
695
+ .wp-core-ui input[type="reset"],
696
+ .wp-core-ui input[type="reset"]:hover,
697
+ .wp-core-ui input[type="reset"]:active,
698
+ .wp-core-ui input[type="reset"]:focus {
699
+ background: none;
700
+ border: none;
701
+ -webkit-box-shadow: none;
702
+ box-shadow: none;
703
+ padding: 0 2px 1px;
704
+ width: auto;
705
+ }
706
+ */
707
+
708
+ .wp-core-ui input[type="reset"],
709
+ .wp-core-ui input[type="reset"]:hover,
710
+ .wp-core-ui input[type="reset"]:active,
711
+ .wp-core-ui input[type="reset"]:focus {
712
+ background: #F7F7F7;
713
+ border: 1px solid #CCC;
714
+ -webkit-box-shadow: 0 1px 0 #CCC;
715
+ box-shadow: 0 1px 0 #CCC;
716
+ padding: 0 10px 1px;
717
+ width: auto;
718
+ }
719
+
720
+ /* wp-admin/css/forms.css:102 */
721
+
722
+ /*
723
+ .wp-core-ui input[type="reset"]:hover,
724
+ .wp-core-ui input[type="reset"]:active {
725
+ color: #00a0d2;
726
+ }
727
+ */
728
+
729
+ /* Based on section 2.0 in wp-includes/css/buttons.css:125 */
730
+
731
+ .wp-core-ui input[type="reset"]:hover,
732
+ .wp-core-ui input[type="reset"]:focus {
733
+ background: #fafafa;
734
+ border-color: #999;
735
+ color: #23282d;
736
+ }
737
+
738
+ .wp-core-ui input[type="reset"]:focus {
739
+ border-color: #5b9dd9;
740
+ -webkit-box-shadow: 0 0 3px rgba(0, 115, 170, .8);
741
+ box-shadow: 0 0 3px rgba(0, 115, 170, .8);
742
+ }
743
+
744
+ .wp-core-ui input[type="reset"]:active {
745
+ background: #eee;
746
+ border-color: #999;
747
+ -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
748
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
749
+ -webkit-transform: translateY(1px);
750
+ -ms-transform: translateY(1px);
751
+ transform: translateY(1px);
752
+ }
753
+
754
+ input.button.restore-default {
755
+ font: normal 20px/1 dashicons;
756
+ padding: 1px 3px;
757
+ }
758
+
759
+ .wpmtst .subsubsub {
760
+ float: none;
761
+ margin-left: 16px;
762
+ }
763
+
764
+ .regular-text.half {
765
+ width: 12.5em;
766
+ }
767
+
768
+ .regular-text.third {
769
+ width: 20em;
770
+ }
771
+
772
+ input.code {
773
+ font-size: 13px;
774
+ font-family: Consolas, Monaco, monospace;
775
+ }
776
+
777
+ .wrap h2.nav-tab-wrapper {
778
+ margin-top: 6px;
779
+ }
780
+
781
+ .tab-header {
782
+ padding: 1em 0;
783
+ }
784
+
785
+ .striped>tbody>tr.readonly {
786
+ background: lightyellow;
787
+ }
788
+
789
+ ul.standard {
790
+ list-style: disc;
791
+ padding-left: 1.5em;
792
+ }
793
+
794
+ .form-table p.error {
795
+ margin: 0.5em 0;
796
+ }
797
+
798
+ /* shortcodes page */
799
+
800
+ .wpmtst.shortcode {
801
+ vertical-align: middle;
802
+ }
803
+
804
+ .wpmtst.shortcodes.has-stars table {
805
+ margin-bottom: 1em;
806
+ }
807
+
808
+ .wpmtst.shortcodes.has-stars td:nth-child(2) {
809
+ width: 70%;
810
+ /*white-space: nowrap;*/
811
+ }
812
+
813
+ .wpmtst.shortcodes td {
814
+ padding: 10px;
815
+ }
816
+
817
+ .wpmtst.shortcodes tr.important td {
818
+ border: 1px solid #DDD;
819
+ }
820
+
821
+ .wpmtst.shortcodes tr:hover {
822
+ background: #FFF;
823
+ }
824
+
825
+ /* inner table */
826
+
827
+ .wpmtst.shortcodes td.has-inner {
828
+ padding: 0;
829
+ }
830
+
831
+ .wpmtst.shortcodes table.inner {
832
+ margin: 0;
833
+ vertical-align: middle;
834
+ width: 100%;
835
+ }
836
+
837
+ .wpmtst.shortcodes table.inner,
838
+ .wpmtst.shortcodes table.inner tr,
839
+ .wpmtst.shortcodes table.inner td {
840
+ border: 0;
841
+ }
842
+
843
+ .wpmtst.shortcodes table.inner tr:first-child td {
844
+ border-bottom: 1px solid #DDD;
845
+ }
846
+
847
+ .wp-list-table .type-wpm-testimonial .row-actions span.id span {
848
+ color: #777;
849
+ }
850
+
851
+ @import 'admin/pages';
852
+ @import 'admin/notices';
853
+
assets/src/scss/admin/_notices.scss ADDED
@@ -0,0 +1 @@
 
1
+
assets/src/scss/admin/_pages.scss ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wpm-testimonial_page_about-strong-testimonials {
2
+
3
+
4
+ .wpmst-mascot {
5
+ width: 160px;
6
+ margin-left: 1rem;
7
+ float: right;
8
+ }
9
+ }
10
+
11
+ .edit-php.post-type-wpm-testimonial {
12
+
13
+ .wpmtst-notice {
14
+ padding: 2.5rem 2rem;
15
+ border: 2px solid #7F22DE;
16
+ }
17
+
18
+ .wpmtst-notice img {
19
+ max-width: 100%;
20
+ }
21
+
22
+ .wpmst-mascot {
23
+ width: 120px;
24
+ margin-right: 2rem;
25
+ float: left;
26
+ }
27
+
28
+ }
changelog.txt CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  = 2.36 - Feb. 15, 2019 =
2
  * bug fixes and tweaks
3
 
1
+ = 2.37 - Mar. 18, 2019 =
2
+ * added ability to export testimonials with featured images included.
3
+ * added option to change single testimonial permalink slug.
4
+ * fixed a conflict with `Mesmerize` theme not displaying the views.
5
+ * fixed issue with audio shortcode not playing in the testimonial content.
6
+ * fixed form redirect url not saving.
7
+ * fixed issue when testimonial slideshows has only one testimonial.
8
+ * fixed issue with the `read more` link in a slideshow not toggling correctly.
9
+ * removed `Really Simple Captcha` from captcha settings.
10
+ * fixed wp_debug warnings.
11
+ * minor backend tweaks.
12
+
13
  = 2.36 - Feb. 15, 2019 =
14
  * bug fixes and tweaks
15
 
includes/class-strong-form.php CHANGED
File without changes
includes/class-strong-log.php CHANGED
File without changes
includes/class-strong-mail.php CHANGED
File without changes
includes/class-strong-templates.php CHANGED
File without changes
includes/class-strong-testimonials-order.php CHANGED
File without changes
includes/class-strong-testimonials-privacy.php CHANGED
File without changes
includes/class-strong-testimonials-render.php CHANGED
@@ -441,7 +441,9 @@ class Strong_Testimonials_Render {
441
 
442
  if ( isset( $custom_html_widgets[ $id ] ) ) {
443
  $widget = $custom_html_widgets[ $id ];
444
- $this->process_content( $widget['content'] );
 
 
445
  }
446
  }
447
 
441
 
442
  if ( isset( $custom_html_widgets[ $id ] ) ) {
443
  $widget = $custom_html_widgets[ $id ];
444
+ if ( isset( $widget['content'] ) ) {
445
+ $this->process_content( $widget['content'] );
446
+ }
447
  }
448
  }
449
 
includes/class-strong-testimonials-shortcode-average.php CHANGED
File without changes
includes/class-strong-testimonials-shortcode-count.php CHANGED
File without changes
includes/class-strong-testimonials-shortcode.php CHANGED
File without changes
includes/class-strong-view-display.php CHANGED
File without changes
includes/class-strong-view-form.php CHANGED
File without changes
includes/class-strong-view-slideshow.php CHANGED
File without changes
includes/class-strong-view.php CHANGED
File without changes
includes/class-walker-strong-category-checklist-front.php CHANGED
File without changes
includes/deprecated.php CHANGED
File without changes
includes/filters.php CHANGED
@@ -50,3 +50,121 @@ function wpmtst_content_filters() {
50
  add_filter( 'wpmtst_the_excerpt', 'convert_smilies', 20 );
51
  }
52
  add_action( 'init', 'wpmtst_content_filters' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  add_filter( 'wpmtst_the_excerpt', 'convert_smilies', 20 );
51
  }
52
  add_action( 'init', 'wpmtst_content_filters' );
53
+
54
+ function wpmtst_add_allowed_tags( $tags ) {
55
+
56
+ // iframe
57
+ $tags['iframe'] = array(
58
+ 'src' => true,
59
+ 'height' => true,
60
+ 'width' => true,
61
+ 'frameborder' => true,
62
+ 'allowfullscreen' => true,
63
+ 'style' => true,
64
+ 'data-*' => true,
65
+ 'hidden' => true,
66
+ );
67
+ // form fields - input
68
+ $tags['input'] = array(
69
+ 'class' => true,
70
+ 'id' => true,
71
+ 'name' => true,
72
+ 'value' => true,
73
+ 'type' => true,
74
+ 'placeholder' => true,
75
+ 'required' => true,
76
+ 'checked' => true,
77
+ 'title' => true,
78
+ 'style' => true,
79
+ 'data-*' => true,
80
+ 'hidden' => true,
81
+ );
82
+ // textarea
83
+ $tags['textarea'] = array(
84
+ 'class' => true,
85
+ 'id' => true,
86
+ 'name' => true,
87
+ 'value' => true,
88
+ 'type' => true,
89
+ 'placeholder' => true,
90
+ 'required' => true,
91
+ 'style' => true,
92
+ 'data-*' => true,
93
+ 'hidden' => true,
94
+ );
95
+ // select
96
+ $tags['select'] = array(
97
+ 'class' => true,
98
+ 'id' => true,
99
+ 'name' => true,
100
+ 'value' => true,
101
+ 'type' => true,
102
+ 'style' => true,
103
+ 'data-*' => true,
104
+ 'hidden' => true,
105
+ );
106
+ // select options
107
+ $tags['option'] = array(
108
+ 'selected' => true,
109
+ 'class' => true,
110
+ 'id' => true,
111
+ 'name' => true,
112
+ 'value' => true,
113
+ 'style' => true,
114
+ 'data-*' => true,
115
+ 'hidden' => true,
116
+ );
117
+ $tags['optgroup'] = array(
118
+ 'class' => true,
119
+ 'id' => true,
120
+ 'name' => true,
121
+ 'value' => true,
122
+ 'label' => true,
123
+ 'style' => true,
124
+ 'data-*' => true,
125
+ 'hidden' => true,
126
+ );
127
+ $tags['source'] = array(
128
+ 'type' => true,
129
+ 'src' => true,
130
+ );
131
+
132
+ $tags['span']['hidden'] = true;
133
+
134
+ $tags['img']['srcset'] = true;
135
+ $tags['img']['sizes'] = true;
136
+
137
+ $tags['div']['data-*'] = true;
138
+
139
+ $tags['noscript'] = array();
140
+
141
+ $tags['style'] = array(
142
+ 'types' => true,
143
+ );
144
+
145
+ return $tags;
146
+ }
147
+ add_filter( 'wp_kses_allowed_html', 'wpmtst_add_allowed_tags' );
148
+
149
+
150
+ function wpmtst_safe_style_css( $styles ) {
151
+ $styles[] = 'display';
152
+ return $styles;
153
+ }
154
+ add_filter( 'safe_style_css', 'wpmtst_safe_style_css' );
155
+
156
+
157
+ /**
158
+ * Change single testimonial slug.
159
+ */
160
+ add_filter( 'wpmtst_post_type', 'wpmtst_change_testimonial_slug' );
161
+ function wpmtst_change_testimonial_slug( $args ) {
162
+
163
+ $options = get_option( 'wpmtst_options' );
164
+
165
+ if ( isset( $options['single_testimonial_slug'] ) && $options['single_testimonial_slug'] != '' ) {
166
+ $args['rewrite']['slug'] = $options['single_testimonial_slug'];
167
+ }
168
+
169
+ return $args;
170
+ }
includes/functions-activation.php CHANGED
File without changes
includes/functions-content.php CHANGED
@@ -42,7 +42,7 @@ function wpmtst_get_the_excerpt( $post = null ) {
42
  }
43
 
44
  if ( post_password_required( $post ) ) {
45
- return __( 'There is no excerpt because this is a protected post.' );
46
  }
47
 
48
  /**
@@ -172,7 +172,7 @@ function wpmtst_get_excerpt_more_link() {
172
  */
173
  function wpmtst_trim_words( $text, $num_words = 55, $more = null, $hybrid = false ) {
174
  if ( null === $more ) {
175
- $more = __( '&hellip;' );
176
  }
177
 
178
  $text = wp_strip_all_tags( $text );
@@ -182,7 +182,7 @@ function wpmtst_trim_words( $text, $num_words = 55, $more = null, $hybrid = fals
182
  * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
183
  * Do not translate into your own language.
184
  */
185
- if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
186
  $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
187
  preg_match_all( '/./u', $text, $words_array );
188
  $words_array = array_slice( $words_array[0], 0, $num_words + 1 );
42
  }
43
 
44
  if ( post_password_required( $post ) ) {
45
+ return __( 'There is no excerpt because this is a protected post.', 'strong-testimonials' );
46
  }
47
 
48
  /**
172
  */
173
  function wpmtst_trim_words( $text, $num_words = 55, $more = null, $hybrid = false ) {
174
  if ( null === $more ) {
175
+ $more = __( '&hellip;', 'strong-testimonials' );
176
  }
177
 
178
  $text = wp_strip_all_tags( $text );
182
  * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
183
  * Do not translate into your own language.
184
  */
185
+ if ( strpos( _x( 'words', 'Word count type. Do not translate!', 'strong-testimonials' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
186
  $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
187
  preg_match_all( '/./u', $text, $words_array );
188
  $words_array = array_slice( $words_array[0], 0, $num_words + 1 );
includes/functions-image.php CHANGED
File without changes
includes/functions-rating.php CHANGED
File without changes
includes/functions-template-form.php CHANGED
@@ -84,91 +84,97 @@ function wpmtst_single_form_field( $field ) {
84
  }
85
 
86
  // Check for callback first.
87
- if ( isset( $field['action_input'] ) && $field['action_input'] ) {
88
 
89
- $value = ( isset( $form_values[ $field['name'] ] ) && $form_values[ $field['name'] ] ) ? $form_values[ $field['name'] ] : '';
90
- do_action( $field['action_input'], $field, $value );
91
 
92
- } else {
93
-
94
- // Check field type.
95
- switch ( $field['input_type'] ) {
96
-
97
- case 'category-selector' :
98
- $value = isset( $form_values[ $field['name'] ] ) ? (array) $form_values[ $field['name'] ] : array();
99
-
100
- echo '<div class="field-wrap">';
101
- printf( '<select id="wpmtst_%s" name="%s" class="%s" %s tabindex="0">',
102
- $field['name'],
103
- $field['name'],
104
- wpmtst_field_classes( $field['input_type'], $field['name'] ),
105
- wpmtst_field_required_tag( $field ) );
106
-
107
- echo '<option value="">&mdash;</option>';
108
- wpmtst_nested_cats( $value );
109
- echo '</select>';
110
- echo '</div>';
111
- break;
112
-
113
- case 'category-checklist' :
114
- $value = isset( $form_values[ $field['name'] ] ) ? (array) $form_values[ $field['name'] ] : array();
115
- echo '<div class="field-wrap">';
116
- wpmtst_form_category_checklist_frontend( $value );
117
- echo '</div>';
118
- break;
119
-
120
- case 'textarea' :
121
- $value = ( isset( $form_values[ $field['name'] ] ) && $form_values[ $field['name'] ] ) ? $form_values[ $field['name'] ] : '';
122
-
123
- // textarea tags must be on same line for placeholder to work
124
- printf( '<textarea id="wpmtst_%s" name="%s" class="%s" %s %s tabindex="0">%s</textarea>',
125
- $field['name'],
126
- $field['name'],
127
- wpmtst_field_classes( $field['input_type'], $field['name'] ),
128
- wpmtst_field_required_tag( $field ),
129
- wpmtst_field_placeholder( $field ),
130
- esc_textarea( $value ) );
131
- break;
132
-
133
- case 'file' :
134
- echo '<div class="field-wrap">';
135
- echo '<input id="wpmtst_' . $field['name'] . '" type="file" name="' . $field['name'] . '"' . wpmtst_field_required_tag( $field ) . ' tabindex="0">';
136
- echo '</div>';
137
- break;
138
-
139
- case 'shortcode' :
140
- if ( isset( $field['shortcode_on_form'] ) && $field['shortcode_on_form'] ) {
141
- echo do_shortcode( $field['shortcode_on_form'], true );
142
- }
143
- break;
144
-
145
- case 'rating' :
146
- wpmtst_star_rating_form( $field, $field['default_form_value'], 'in-form' );
147
- break;
148
-
149
- case 'checkbox' :
150
- if ( ! isset( $field['show_label'] ) || $field['show_label'] ) {
151
- printf( '<label for="wpmtst_%s" class="%s">%s</label>',
152
- $field['name'],
153
- wpmtst_field_label_classes($field['input_type'], $field['name']),
154
- wpmtst_form_field_meta_l10n( $field['label'], $field, 'label' ) );
155
- }
156
-
157
- wpmtst_field_before( $field );
158
-
159
- echo '<div class="field-wrap">';
160
-
161
- printf( '<input id="wpmtst_%s" type="%s" class="%s" name="%s" %s %s tabindex="0">',
162
- $field['name'],
163
- $field['input_type'],
164
- wpmtst_field_classes( $field['input_type'], $field['name'] ),
165
- $field['name'],
166
- wpmtst_field_required_tag( $field ),
167
- checked( $field['default_form_value'], 1, false ) );
168
-
169
- if ( isset( $field['text'] ) ) {
170
- echo '<label for="wpmtst_' . $field['name'] . '" class="checkbox-label">' . wpmtst_form_field_meta_l10n( $field['text'], $field, 'text' ) . '</label>';
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  if ( isset( $field['required'] ) && $field['required'] ) {
173
  wpmtst_field_required_symbol();
174
  }
@@ -441,6 +447,11 @@ function wpmtst_form_captcha() {
441
  return;
442
  }
443
 
 
 
 
 
 
444
  /**
445
  * Only display Captcha label if properly configured.
446
  */
@@ -457,31 +468,30 @@ function wpmtst_form_captcha() {
457
  */
458
  if ( $invisible && 'captcha-pro' == $form_options['captcha']) {
459
 
460
- echo '<div class="form-field wpmtst-captcha">';
461
- echo $captcha_html;
462
- echo '</div>';
463
-
464
- } elseif ( $invisible ) {
465
-
466
- echo $captcha_html;
467
 
468
- } else {
 
469
 
470
- ?>
471
- <div class="form-field wpmtst-captcha">
 
472
  <?php if ( wpmtst_get_form_message( 'captcha' ) ) : ?>
473
  <label for="wpmtst_captcha"><?php wpmtst_form_message( 'captcha' ); ?></label><span class="required symbol"></span>
474
  <?php endif; ?>
475
- <div>
476
- <?php echo $captcha_html; ?>
477
- <?php if ( isset( $errors['captcha'] ) ) : ?>
478
- <p><label class="error"><?php echo esc_html( $errors['captcha'] ); ?></label></p>
479
- <?php endif; ?>
480
- </div>
481
- </div>
482
- <?php
483
 
484
- }
 
 
 
 
 
 
 
 
 
485
  }
486
  add_action( 'wpmtst_form_after_fields', 'wpmtst_form_captcha' );
487
 
84
  }
85
 
86
  // Check for callback first.
87
+ if ( isset( $field['action_input'] ) && $field['action_input'] ) {
88
 
89
+ $value = ( isset( $form_values[ $field['name'] ] ) && $form_values[ $field['name'] ] ) ? $form_values[ $field['name'] ] : '';
90
+ do_action( $field['action_input'], $field, $value );
91
 
92
+ } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
+ // Check field type.
95
+ switch ( $field['input_type'] ) {
96
+
97
+ case 'category-selector':
98
+ $value = isset( $form_values[ $field['name'] ] ) ? (array) $form_values[ $field['name'] ] : array();
99
+
100
+ echo '<div class="field-wrap">';
101
+ printf(
102
+ '<select id="wpmtst_%s" name="%s" class="%s" %s tabindex="0">',
103
+ esc_attr( $field['name'] ),
104
+ esc_attr( $field['name'] ),
105
+ esc_attr( wpmtst_field_classes( $field['input_type'], $field['name'] ) ),
106
+ esc_attr( wpmtst_field_required_tag( $field ) )
107
+ );
108
+
109
+ echo '<option value="">&mdash;</option>';
110
+ wpmtst_nested_cats( $value );
111
+ echo '</select>';
112
+ echo '</div>';
113
+ break;
114
+
115
+ case 'category-checklist':
116
+ $value = isset( $form_values[ $field['name'] ] ) ? (array) $form_values[ $field['name'] ] : array();
117
+ echo '<div class="field-wrap">';
118
+ wpmtst_form_category_checklist_frontend( $value );
119
+ echo '</div>';
120
+ break;
121
+
122
+ case 'textarea':
123
+ $value = ( isset( $form_values[ $field['name'] ] ) && $form_values[ $field['name'] ] ) ? $form_values[ $field['name'] ] : '';
124
+ // textarea tags must be on same line for placeholder to work
125
+ printf(
126
+ '<textarea id="wpmtst_%s" name="%s" class="%s" %s placeholder="%s" tabindex="0">%s</textarea>',
127
+ esc_attr( $field['name'] ),
128
+ esc_attr( $field['name'] ),
129
+ esc_attr( wpmtst_field_classes( $field['input_type'], $field['name'] ) ),
130
+ esc_attr( wpmtst_field_required_tag( $field ) ),
131
+ esc_attr( wpmtst_field_placeholder( $field ) ),
132
+ esc_textarea( $value )
133
+ );
134
+ break;
135
+
136
+ case 'file':
137
+ echo '<div class="field-wrap">';
138
+ echo '<input id="wpmtst_' . esc_attr( $field['name'] ) . '" type="file" name="' . esc_attr( $field['name'] ) . '"' . esc_attr( wpmtst_field_required_tag( $field ) ) . ' tabindex="0">';
139
+ echo '</div>';
140
+ break;
141
+
142
+ case 'shortcode':
143
+ if ( isset( $field['shortcode_on_form'] ) && $field['shortcode_on_form'] ) {
144
+ echo do_shortcode( $field['shortcode_on_form'], true );
145
+ }
146
+ break;
147
+
148
+ case 'rating':
149
+ wpmtst_star_rating_form( $field, $field['default_form_value'], 'in-form' );
150
+ break;
151
+
152
+ case 'checkbox':
153
+ if ( ! isset( $field['show_label'] ) || $field['show_label'] ) {
154
+ printf(
155
+ '<label for="wpmtst_%s" class="%s">%s</label>',
156
+ esc_attr( $field['name'] ),
157
+ esc_attr( wpmtst_field_label_classes( $field['input_type'], $field['name'] ) ),
158
+ esc_html( wpmtst_form_field_meta_l10n( $field['label'], $field, 'label' ) )
159
+ );
160
+ }
161
+
162
+ wpmtst_field_before( $field );
163
+
164
+ echo '<div class="field-wrap">';
165
+
166
+ printf(
167
+ '<input id="wpmtst_%s" type="%s" class="%s" name="%s" %s %s tabindex="0">',
168
+ esc_attr( $field['name'] ),
169
+ esc_attr( $field['input_type'] ),
170
+ esc_attr( wpmtst_field_classes( $field['input_type'], $field['name'] ) ),
171
+ esc_attr( $field['name'] ),
172
+ esc_attr( wpmtst_field_required_tag( $field ) ),
173
+ checked( $field['default_form_value'], 1, false )
174
+ );
175
+
176
+ if ( isset( $field['text'] ) ) {
177
+ echo '<label for="wpmtst_' . esc_attr( $field['name'] ) . '" class="checkbox-label">' . wp_kses_post( wpmtst_form_field_meta_l10n( $field['text'], $field, 'text' ) ) . '</label>';
178
  if ( isset( $field['required'] ) && $field['required'] ) {
179
  wpmtst_field_required_symbol();
180
  }
447
  return;
448
  }
449
 
450
+ // removed `really simple captcha` as of 2.37
451
+ if ( 'really-simple-captcha' === $form_options['captcha'] ) {
452
+ return;
453
+ }
454
+
455
  /**
456
  * Only display Captcha label if properly configured.
457
  */
468
  */
469
  if ( $invisible && 'captcha-pro' == $form_options['captcha']) {
470
 
471
+ echo '<div class="form-field wpmtst-captcha">';
472
+ echo $captcha_html;
473
+ echo '</div>';
 
 
 
 
474
 
475
+ } elseif ( $invisible ) {
476
+ echo $captcha_html;
477
 
478
+ } else {
479
+ ?>
480
+ <div class="form-field wpmtst-captcha">
481
  <?php if ( wpmtst_get_form_message( 'captcha' ) ) : ?>
482
  <label for="wpmtst_captcha"><?php wpmtst_form_message( 'captcha' ); ?></label><span class="required symbol"></span>
483
  <?php endif; ?>
 
 
 
 
 
 
 
 
484
 
485
+ <div>
486
+ <?php echo $captcha_html; ?>
487
+ <?php if ( isset( $errors['captcha'] ) ) : ?>
488
+ <p><label class="error"><?php echo esc_html( $errors['captcha'] ); ?></label></p>
489
+ <?php endif; ?>
490
+ </div>
491
+ </div>
492
+ <?php
493
+
494
+ }
495
  }
496
  add_action( 'wpmtst_form_after_fields', 'wpmtst_form_captcha' );
497
 
includes/functions-template.php CHANGED
@@ -98,7 +98,7 @@ function wpmtst_the_excerpt() {
98
  */
99
  function wpmtst_ellipsis() {
100
  if ( apply_filters( 'wpmtst_use_ellipsis', true ) ) {
101
- return apply_filters( 'wpmtst_ellipsis', __( '&hellip;' ) );
102
  }
103
 
104
  return '';
@@ -534,8 +534,8 @@ if ( ! function_exists( 'wpmtst_standard_pagination' ) ) :
534
  'end_size' => isset( $options['end_size'] ) ? $options['end_size'] : 1,
535
  'mid_size' => isset( $options['mid_size'] ) ? $options['mid_size'] : 2,
536
  'prev_next' => isset( $options['prev_next'] ) ? $options['prev_next'] : true,
537
- 'prev_text' => isset( $options['prev_text'] ) ? $options['prev_text'] : __( '&laquo; Previous' ),
538
- 'next_text' => isset( $options['next_text'] ) ? $options['next_text'] : __( 'Next &raquo;' ),
539
  'before_page_number' => isset( $options['before_page_number'] ) ? $options['before_page_number'] : '',
540
  'after_page_number' => isset( $options['after_page_number'] ) ? $options['after_page_number'] : '',
541
  );
98
  */
99
  function wpmtst_ellipsis() {
100
  if ( apply_filters( 'wpmtst_use_ellipsis', true ) ) {
101
+ return apply_filters( 'wpmtst_ellipsis', __( '&hellip;', 'strong-testimonials' ) );
102
  }
103
 
104
  return '';
534
  'end_size' => isset( $options['end_size'] ) ? $options['end_size'] : 1,
535
  'mid_size' => isset( $options['mid_size'] ) ? $options['mid_size'] : 2,
536
  'prev_next' => isset( $options['prev_next'] ) ? $options['prev_next'] : true,
537
+ 'prev_text' => isset( $options['prev_text'] ) ? $options['prev_text'] : __( '&laquo; Previous', 'strong-testimonials' ),
538
+ 'next_text' => isset( $options['next_text'] ) ? $options['next_text'] : __( 'Next &raquo;', 'strong-testimonials' ),
539
  'before_page_number' => isset( $options['before_page_number'] ) ? $options['before_page_number'] : '',
540
  'after_page_number' => isset( $options['after_page_number'] ) ? $options['after_page_number'] : '',
541
  );
includes/functions-views.php CHANGED
File without changes
includes/functions.php CHANGED
@@ -16,7 +16,7 @@ function wpmtst_support_url() {
16
  * @return string
17
  */
18
  function wpmtst_l10n_default( $string ) {
19
- return __( $string, 'strong-testimonials' );
20
  }
21
  add_filter( 'wpmtst_l10n', 'wpmtst_l10n_default' );
22
 
@@ -259,6 +259,27 @@ function wpmtst_get_all_fields() {
259
  return $all_fields;
260
  }
261
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  /**
263
  * Get the built-in fields.
264
  *
@@ -533,7 +554,7 @@ function wpmtst_post_submitbox_misc_actions( $post ) {
533
  echo '<span id="submit-timestamp">&nbsp;';
534
  $submit_date = get_post_meta( $post->ID, 'submit_date', true );
535
  if ( $submit_date ) {
536
- echo 'Submitted on: <strong>' . date_i18n( __( 'M j, Y @ H:i' ), strtotime( $submit_date ) ) . '</strong>';
537
  } else {
538
  echo 'No submit date';
539
  }
16
  * @return string
17
  */
18
  function wpmtst_l10n_default( $string ) {
19
+ return $string;
20
  }
21
  add_filter( 'wpmtst_l10n', 'wpmtst_l10n_default' );
22
 
259
  return $all_fields;
260
  }
261
 
262
+ /**
263
+ * Get all rating fields
264
+ *
265
+ * @return array
266
+ */
267
+ function wpmtst_get_all_rating_fields() {
268
+
269
+ $all_fields = wpmtst_get_all_fields();
270
+
271
+ $rating_fields = array();
272
+
273
+ foreach ( $all_fields as $key => $field ) :
274
+ if ( $field['input_type'] !== 'rating' ) {
275
+ continue;
276
+ }
277
+ $rating_fields[] = $field;
278
+ endforeach;
279
+
280
+ return $rating_fields;
281
+ }
282
+
283
  /**
284
  * Get the built-in fields.
285
  *
554
  echo '<span id="submit-timestamp">&nbsp;';
555
  $submit_date = get_post_meta( $post->ID, 'submit_date', true );
556
  if ( $submit_date ) {
557
+ echo 'Submitted on: <strong>' . wp_kses_post( date_i18n( 'M j, Y @ H:i', strtotime( $submit_date ) ) ) . '</strong>';
558
  } else {
559
  echo 'No submit date';
560
  }
includes/integrations/class-integration-captcha-pro.php CHANGED
File without changes
includes/integrations/class-integration-captcha.php CHANGED
File without changes
includes/integrations/class-integration-google-captcha.php CHANGED
File without changes
includes/integrations/class-integration-really-simple-captcha.php CHANGED
File without changes
includes/l10n-polylang.php CHANGED
File without changes
includes/l10n-wpml.php CHANGED
File without changes
includes/post-types.php CHANGED
@@ -53,24 +53,24 @@ function wpmtst_get_cpt_defaults() {
53
  $labels = array(
54
  'name' => _x( 'Testimonials', 'post type general name', 'strong-testimonials' ),
55
  'singular_name' => _x( 'Testimonial', 'post type singular name', 'strong-testimonials' ),
56
- 'add_new' => __( 'Add New' ),
57
  'add_new_item' => __( 'Add New Testimonial', 'strong-testimonials' ),
58
  'edit_item' => __( 'Edit Testimonial', 'strong-testimonials' ),
59
  'new_item' => __( 'New Testimonial', 'strong-testimonials' ),
60
  'view_item' => __( 'View Testimonial', 'strong-testimonials' ),
61
  'view_items' => __( 'View Testimonials', 'strong-testimonials' ),
62
  'search_items' => __( 'Search Testimonials', 'strong-testimonials' ),
63
- 'not_found' => __( 'Nothing Found' ),
64
- 'not_found_in_trash' => __( 'Nothing found in Trash' ),
65
  'all_items' => __( 'All Testimonials', 'strong-testimonials' ),
66
  'archives' => __( 'Testimonial Archives', 'strong-testimonials' ),
67
  'attributes' => __( 'Attributes', 'strong-testimonials' ),
68
  'insert_into_item' => __( 'Insert into testimonial', 'strong-testimonials' ),
69
  'uploaded_to_this_item' => __( 'Uploaded to this testimonial', 'strong-testimonials' ),
70
- 'featured_image' => __( 'Featured Image' ),
71
- 'set_featured_image' => __( 'Set featured image' ),
72
- 'remove_featured_image' => __( 'Remove featured image' ),
73
- 'use_featured_image' => __( 'Use as featured image' ),
74
  'filter_items_list' => __( 'Filter testimonials list', 'strong-testimonials' ),
75
  'items_list_navigation' => __( 'Testimonials list navigation', 'strong-testimonials' ),
76
  'items_list' => __( 'Testimonials list', 'strong-testimonials' ),
@@ -125,8 +125,8 @@ function wpmtst_get_tax_defaults() {
125
  $labels = array(
126
  'name' => __( 'Testimonial Categories', 'strong-testimonials' ),
127
  'singular_name' => __( 'Testimonial Category', 'strong-testimonials' ),
128
- 'menu_name' => __( 'Categories' ),
129
- 'all_items' => __( 'All categories' ),
130
  );
131
 
132
  $args = array(
@@ -199,14 +199,14 @@ function wpmtst_updated_messages( $messages ) {
199
  );
200
 
201
  /* translators: Publish box date format, see https://secure.php.net/date */
202
- $scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) );
203
 
204
  $messages['wpm-testimonial'] = array(
205
- 0 => '', // Unused. Messages start at index 1.
206
- 1 => __( 'Testimonial updated.', 'strong-testimonials' ) . $view_post_link_html,
207
- 2 => __( 'Custom field updated.' ),
208
- 3 => __( 'Custom field deleted.' ),
209
- 4 => __( 'Testimonial updated.', 'strong-testimonials' ),
210
  /* translators: %s: date and time of the revision */
211
  5 => isset($_GET['revision']) ? sprintf( __( 'Testimonial restored to revision from %s.', 'strong-testimonials' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
212
  6 => __( 'Testimonial published.', 'strong-testimonials' ) . $view_post_link_html,
53
  $labels = array(
54
  'name' => _x( 'Testimonials', 'post type general name', 'strong-testimonials' ),
55
  'singular_name' => _x( 'Testimonial', 'post type singular name', 'strong-testimonials' ),
56
+ 'add_new' => __( 'Add New', 'strong-testimonials' ),
57
  'add_new_item' => __( 'Add New Testimonial', 'strong-testimonials' ),
58
  'edit_item' => __( 'Edit Testimonial', 'strong-testimonials' ),
59
  'new_item' => __( 'New Testimonial', 'strong-testimonials' ),
60
  'view_item' => __( 'View Testimonial', 'strong-testimonials' ),
61
  'view_items' => __( 'View Testimonials', 'strong-testimonials' ),
62
  'search_items' => __( 'Search Testimonials', 'strong-testimonials' ),
63
+ 'not_found' => __( 'Nothing Found', 'strong-testimonials' ),
64
+ 'not_found_in_trash' => __( 'Nothing found in Trash', 'strong-testimonials' ),
65
  'all_items' => __( 'All Testimonials', 'strong-testimonials' ),
66
  'archives' => __( 'Testimonial Archives', 'strong-testimonials' ),
67
  'attributes' => __( 'Attributes', 'strong-testimonials' ),
68
  'insert_into_item' => __( 'Insert into testimonial', 'strong-testimonials' ),
69
  'uploaded_to_this_item' => __( 'Uploaded to this testimonial', 'strong-testimonials' ),
70
+ 'featured_image' => __( 'Featured Image', 'strong-testimonials' ),
71
+ 'set_featured_image' => __( 'Set featured image', 'strong-testimonials' ),
72
+ 'remove_featured_image' => __( 'Remove featured image', 'strong-testimonials' ),
73
+ 'use_featured_image' => __( 'Use as featured image', 'strong-testimonials' ),
74
  'filter_items_list' => __( 'Filter testimonials list', 'strong-testimonials' ),
75
  'items_list_navigation' => __( 'Testimonials list navigation', 'strong-testimonials' ),
76
  'items_list' => __( 'Testimonials list', 'strong-testimonials' ),
125
  $labels = array(
126
  'name' => __( 'Testimonial Categories', 'strong-testimonials' ),
127
  'singular_name' => __( 'Testimonial Category', 'strong-testimonials' ),
128
+ 'menu_name' => __( 'Categories', 'strong-testimonials' ),
129
+ 'all_items' => __( 'All categories', 'strong-testimonials' ),
130
  );
131
 
132
  $args = array(
199
  );
200
 
201
  /* translators: Publish box date format, see https://secure.php.net/date */
202
+ $scheduled_date = date_i18n( 'M j, Y @ H:i', strtotime( $post->post_date ) );
203
 
204
  $messages['wpm-testimonial'] = array(
205
+ 0 => '', // Unused. Messages start at index 1.
206
+ 1 => __( 'Testimonial updated.', 'strong-testimonials' ) . $view_post_link_html,
207
+ 2 => __( 'Custom field updated.', 'strong-testimonials' ),
208
+ 3 => __( 'Custom field deleted.', 'strong-testimonials' ),
209
+ 4 => __( 'Testimonial updated.', 'strong-testimonials' ),
210
  /* translators: %s: date and time of the revision */
211
  5 => isset($_GET['revision']) ? sprintf( __( 'Testimonial restored to revision from %s.', 'strong-testimonials' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
212
  6 => __( 'Testimonial published.', 'strong-testimonials' ) . $view_post_link_html,
includes/retro.php CHANGED
File without changes
includes/scripts.php CHANGED
@@ -220,6 +220,8 @@ function wpmtst_defer_scripts( $tag, $handle ) {
220
  'verge',
221
  'wpmtst-slider',
222
  'wpmtst-readmore',
 
 
223
  );
224
 
225
  if ( in_array( $handle, $scripts_to_defer ) ) {
220
  'verge',
221
  'wpmtst-slider',
222
  'wpmtst-readmore',
223
+ 'jquery-masonry',
224
+ 'wpmtst-admin-views-script',
225
  );
226
 
227
  if ( in_array( $handle, $scripts_to_defer ) ) {
includes/widget2.php CHANGED
@@ -74,15 +74,15 @@ class Strong_Testimonials_View_Widget extends WP_Widget {
74
  ?>
75
  <div class="wpmtst-widget-form">
76
  <p>
77
- <label for="<?php echo $this->get_field_id( 'title' ); ?>">
78
- <?php _e( 'Title:' ); ?>
79
  </label>
80
  <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>"
81
  name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>">
82
  </p>
83
  <p>
84
- <label for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Content:' ); ?></label>
85
- <textarea class="widefat" rows="8" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_textarea( $instance['text'] ); ?></textarea>
86
  </p>
87
  <p>
88
  <input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox"<?php checked( $filter ); ?> />&nbsp;<label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e( 'Automatically add paragraphs to above Content only', 'strong-testimonials' ); ?></label>
@@ -91,9 +91,8 @@ class Strong_Testimonials_View_Widget extends WP_Widget {
91
  <label for="<?php echo $this->get_field_id( 'view' ); ?>">
92
  <?php _ex( 'View:', 'widget setting', 'strong-testimonials' ); ?>
93
  </label>
94
- <select class="widefat" id="<?php echo $this->get_field_id( 'view' ); ?>"
95
- name="<?php echo $this->get_field_name( 'view' ); ?>" autocomplete="off">
96
- <option value=""><?php _e( '&mdash; Select &mdash;' ); ?></option>
97
  <?php
98
  foreach ( $views as $view ) {
99
  printf( '<option value="%s" %s>%s</option>', $view['id'], selected( $view['id'], $instance['view'] ), $view['name'] );
74
  ?>
75
  <div class="wpmtst-widget-form">
76
  <p>
77
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
78
+ <?php esc_html_e( 'Title:', 'strong-testimonials' ); ?>
79
  </label>
80
  <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>"
81
  name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>">
82
  </p>
83
  <p>
84
+ <label for="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>"><?php esc_html_e( 'Content:', 'strong-testimonials' ); ?></label>
85
+ <textarea class="widefat" rows="8" id="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>"><?php echo esc_textarea( $instance['text'] ); ?></textarea>
86
  </p>
87
  <p>
88
  <input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox"<?php checked( $filter ); ?> />&nbsp;<label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e( 'Automatically add paragraphs to above Content only', 'strong-testimonials' ); ?></label>
91
  <label for="<?php echo $this->get_field_id( 'view' ); ?>">
92
  <?php _ex( 'View:', 'widget setting', 'strong-testimonials' ); ?>
93
  </label>
94
+ <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'view' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'view' ) ); ?>" autocomplete="off">
95
+ <option value=""><?php esc_html_e( '&mdash; Select &mdash;', 'strong-testimonials' ); ?></option>
 
96
  <?php
97
  foreach ( $views as $view ) {
98
  printf( '<option value="%s" %s>%s</option>', $view['id'], selected( $view['id'], $instance['view'] ), $view['name'] );
languages/strong-testimonials-ar_AR.mo CHANGED
File without changes
languages/strong-testimonials-ar_AR.po CHANGED
File without changes
languages/strong-testimonials-es_ES.mo CHANGED
File without changes
languages/strong-testimonials-es_ES.po CHANGED
File without changes
languages/strong-testimonials-fa_IR.mo CHANGED
File without changes
languages/strong-testimonials-fa_IR.po CHANGED
File without changes
languages/strong-testimonials-fr_FR.mo CHANGED
File without changes
languages/strong-testimonials-fr_FR.po CHANGED
File without changes
languages/strong-testimonials-he_IL.mo CHANGED
File without changes
languages/strong-testimonials-he_IL.po CHANGED
File without changes
languages/strong-testimonials-pt_BR.mo CHANGED
File without changes
languages/strong-testimonials-pt_BR.po CHANGED
File without changes
languages/strong-testimonials-ru_RU.mo CHANGED
File without changes
languages/strong-testimonials-ru_RU.po CHANGED
File without changes
languages/strong-testimonials-sv_SE.mo CHANGED
File without changes
languages/strong-testimonials-sv_SE.po CHANGED
File without changes
languages/strong-testimonials.pot CHANGED
File without changes
license.txt CHANGED
File without changes
public/css/animate.min.css CHANGED
File without changes
public/css/columns.css CHANGED
File without changes
public/css/grid.css CHANGED
File without changes
public/css/masonry.css CHANGED
File without changes
public/css/rating-display.css CHANGED
File without changes
public/css/rating-form.css CHANGED
File without changes
public/css/slider-controls-full-buttons.css CHANGED
File without changes
public/css/slider-controls-full-buttons2.css CHANGED
File without changes
public/css/slider-controls-full-buttons3.css CHANGED
File without changes
public/css/slider-controls-full-text.css CHANGED
File without changes
public/css/slider-controls-sides-buttons-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-buttons-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-buttons2-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-buttons2-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-buttons2.css CHANGED
File without changes
public/css/slider-controls-sides-buttons3-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-buttons3-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-buttons3.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons2-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons2-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons2.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons3-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons3-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-inside-buttons3.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons2-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons2-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons2.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons3-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons3-pager-text.css CHANGED
File without changes
public/css/slider-controls-sides-outside-buttons3.css CHANGED
File without changes
public/css/slider-controls-simple-buttons-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-simple-buttons-pager-text.css CHANGED
File without changes
public/css/slider-controls-simple-buttons.css CHANGED
File without changes
public/css/slider-controls-simple-buttons2-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-simple-buttons2-pager-text.css CHANGED
File without changes
public/css/slider-controls-simple-buttons2.css CHANGED
File without changes
public/css/slider-controls-simple-buttons3-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-simple-buttons3-pager-text.css CHANGED
File without changes
public/css/slider-controls-simple-buttons3.css CHANGED
File without changes
public/css/slider-controls-simple-text-pager-buttons.css CHANGED
File without changes
public/css/slider-controls-simple-text-pager-text.css CHANGED
File without changes
public/css/slider-controls-simple-text.css CHANGED
File without changes
public/css/slider-pager-buttons.css CHANGED
File without changes
public/css/slider-pager-text.css CHANGED
File without changes
public/fonts/font-awesome-4.6.3/css/font-awesome.css CHANGED
File without changes
public/fonts/font-awesome-4.6.3/css/font-awesome.min.css CHANGED
File without changes
public/fonts/font-awesome-4.6.3/css/index.php CHANGED
File without changes
public/fonts/font-awesome-4.6.3/fonts/FontAwesome.otf CHANGED
File without changes
public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.eot CHANGED
File without changes
public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.svg CHANGED
File without changes
public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf CHANGED
File without changes
public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.woff CHANGED
File without changes
public/fonts/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2 CHANGED
File without changes
public/index.php CHANGED
File without changes
public/js/controller.js CHANGED
@@ -58,7 +58,16 @@ var strongController = {
58
  if (sliders.length) {
59
  // Initialize independently
60
  sliders.each(function () {
61
- jQuery(this).strongSlider();
 
 
 
 
 
 
 
 
 
62
  });
63
  }
64
  },
58
  if (sliders.length) {
59
  // Initialize independently
60
  sliders.each(function () {
61
+
62
+ var $slider = jQuery(this);
63
+
64
+ // don't init if it's only a single testimonial
65
+ var count = $slider.data('count');
66
+ if( count !== undefined && count === 1 ) {
67
+ return;
68
+ }
69
+
70
+ $slider.strongSlider();
71
  });
72
  }
73
  },
public/js/controller.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";var debugit=false;var strongController={grids:{},iframes:{},defaults:{initializeOn:"windowLoad",method:"",universalTimer:500,observerTimer:500,containerId:"page",addedNodeId:"content",event:"",script:"",debug:false},config:{},setup:function(settings){settings.universalTimer=parseInt(settings.universalTimer);settings.observerTimer=parseInt(settings.observerTimer);settings.debug=!!settings.debug;debugit=settings.debug;this.config=jQuery.extend({},this.defaults,settings)},mutationObserver:window.MutationObserver||window.WebKitMutationObserver,eventListenerSupported:window.addEventListener,checkInit:function(){return jQuery('.strong-view[data-state="idle"]').length},initSliders:function(){var sliders=jQuery('.strong-view.slider-container[data-state="idle"]');if(debugit)console.log("sliders found:",sliders.length);if(sliders.length){sliders.each(function(){jQuery(this).strongSlider()})}},initPagers:function(){var pagers=jQuery('.strong-pager[data-state="idle"]');if(debugit)console.log("pagers found:",pagers.length);if(pagers.length){pagers.each(function(){jQuery(this).strongPager()})}},initLayouts:function(){this.grids=jQuery('.strong-view[data-state="idle"] .strong-masonry');if(debugit)console.log("Masonry found:",this.grids.length);if(this.grids.length){this.grids.prepend('<div class="grid-sizer"></div><div class="gutter-sizer"></div>');this.grids.imagesLoaded(function(){strongController.grids.masonry({columnWidth:".grid-sizer",gutter:".gutter-sizer",itemSelector:".testimonial",percentPosition:true});strongController.grids.closest(".strong-view").attr("data-state","init")})}},initForm:function(){var forms=jQuery('.strong-form[data-state="idle"]');var messages=jQuery(".testimonial-success");if(debugit)console.log("forms found:",forms.length);if(debugit)console.log("messages found:",messages.length);if(forms.length||messages.length){strongValidation.init()}},initIframes:function(){this.iframes=jQuery("iframe")},customEvents:function(){addEventListener("toggleFullContent",function(event){if(strongController.grids.length){strongController.grids.masonry()}})},observer:function(obj,callback){if(this.mutationObserver){var obs=new this.mutationObserver(function(mutations){for(var i=0;i<mutations.length;i++){if(mutations[i].addedNodes.length){if(debugit)console.log("mutation observed",mutations);for(var j=0;j<mutations[i].addedNodes.length;j++){if(mutations[i].addedNodes[j].id===strongController.config.containerId){if(debugit)console.log("+",strongController.config.containerId);callback();return}}}}});obs.observe(obj,{childList:true,subtree:true})}else if(this.eventListenerSupported){obj.addEventListener("DOMNodeInserted",function(e){if(e.currentTarget.id===obj.id){if(debugit)console.log("DOMNodeInserted:",e.currentTarget.id);callback()}},false)}},intervalId:null,timeoutId:null,newInterval:function(){strongController.intervalId=setInterval(function tick(){if(debugit)console.log("tick > checkInit",strongController.checkInit());if(strongController.checkInit()){strongController.start()}},strongController.config.universalTimer)},newTimeout:function(){strongController.timeoutId=setTimeout(function tick(){if(debugit)console.log("tick > checkInit",strongController.checkInit());if(strongController.checkInit()){strongController.start()}},strongController.config.observerTimer)},init:function(){if(debugit)console.log("strongController init");var settings={};if(typeof window.strongControllerParms!=="undefined"){settings=window.strongControllerParms}else{if(debugit)console.log("settings not found")}this.setup(settings);if(debugit)console.log("config",this.config);if("documentReady"===this.config.initializeOn){jQuery(document).ready(function(){if(debugit)console.log("document ready");strongController.start();strongController.listen()})}else{jQuery(window).on("load",function(){if(debugit)console.log("window load");strongController.start();strongController.listen()})}jQuery(window).on("load",function(){strongController.listenForIframeReady()})},start:function(){if(debugit)console.log("start");strongController.initSliders();strongController.initPagers();strongController.initLayouts();strongController.initForm();strongController.initIframes();strongController.customEvents()},listen:function(){if(debugit)console.log("listen");switch(this.config.method){case"universal":this.newInterval();break;case"observer":this.observer(document.getElementById(this.config.containerId),this.newTimeout);break;case"event":document.addEventListener(this.config.event,this.start);break;case"script":switch(this.config.script){case"barba":if(typeof Barba==="object"&&Barba.hasOwnProperty("Dispatcher")){Barba.Dispatcher.on("transitionCompleted",this.start)}break;default:}break;default:}},listenForIframeReady:function(){if(debugit)console.log("listenForIframeReady");if(strongController.iframes.length&&strongController.grids.length){strongController.iframes.ready(function(){setTimeout(function(){strongController.grids.masonry();if(debugit)console.log("listenForIframeReady","timeout 1")},1e3);setTimeout(function(){strongController.grids.masonry();if(debugit)console.log("listenForIframeReady","timeout 2")},2e3)})}else{if(debugit)console.log("listenForIframeReady","no iframes or Masonry found")}}};strongController.init();
1
+ "use strict";var debugit=!1,strongController={grids:{},iframes:{},defaults:{initializeOn:"windowLoad",method:"",universalTimer:500,observerTimer:500,containerId:"page",addedNodeId:"content",event:"",script:"",debug:!1},config:{},setup:function(t){t.universalTimer=parseInt(t.universalTimer),t.observerTimer=parseInt(t.observerTimer),t.debug=!!t.debug,debugit=t.debug,this.config=jQuery.extend({},this.defaults,t)},mutationObserver:window.MutationObserver||window.WebKitMutationObserver,eventListenerSupported:window.addEventListener,checkInit:function(){return jQuery('.strong-view[data-state="idle"]').length},initSliders:function(){var t=jQuery('.strong-view.slider-container[data-state="idle"]');debugit&&console.log("sliders found:",t.length),t.length&&t.each(function(){var t=jQuery(this),e=t.data("count");void 0!==e&&1===e||t.strongSlider()})},initPagers:function(){var t=jQuery('.strong-pager[data-state="idle"]');debugit&&console.log("pagers found:",t.length),t.length&&t.each(function(){jQuery(this).strongPager()})},initLayouts:function(){this.grids=jQuery('.strong-view[data-state="idle"] .strong-masonry'),debugit&&console.log("Masonry found:",this.grids.length),this.grids.length&&(this.grids.prepend('<div class="grid-sizer"></div><div class="gutter-sizer"></div>'),this.grids.imagesLoaded(function(){strongController.grids.masonry({columnWidth:".grid-sizer",gutter:".gutter-sizer",itemSelector:".testimonial",percentPosition:!0}),strongController.grids.closest(".strong-view").attr("data-state","init")}))},initForm:function(){var t=jQuery('.strong-form[data-state="idle"]'),e=jQuery(".testimonial-success");debugit&&console.log("forms found:",t.length),debugit&&console.log("messages found:",e.length),(t.length||e.length)&&strongValidation.init()},initIframes:function(){this.iframes=jQuery("iframe")},customEvents:function(){addEventListener("toggleFullContent",function(t){strongController.grids.length&&strongController.grids.masonry()})},observer:function(t,e){this.mutationObserver?new this.mutationObserver(function(t){for(var o=0;o<t.length;o++)if(t[o].addedNodes.length){debugit&&console.log("mutation observed",t);for(var n=0;n<t[o].addedNodes.length;n++)if(t[o].addedNodes[n].id===strongController.config.containerId)return debugit&&console.log("+",strongController.config.containerId),void e()}}).observe(t,{childList:!0,subtree:!0}):this.eventListenerSupported&&t.addEventListener("DOMNodeInserted",function(o){o.currentTarget.id===t.id&&(debugit&&console.log("DOMNodeInserted:",o.currentTarget.id),e())},!1)},intervalId:null,timeoutId:null,newInterval:function(){strongController.intervalId=setInterval(function(){debugit&&console.log("tick > checkInit",strongController.checkInit()),strongController.checkInit()&&strongController.start()},strongController.config.universalTimer)},newTimeout:function(){strongController.timeoutId=setTimeout(function(){debugit&&console.log("tick > checkInit",strongController.checkInit()),strongController.checkInit()&&strongController.start()},strongController.config.observerTimer)},init:function(){debugit&&console.log("strongController init");var t={};void 0!==window.strongControllerParms?t=window.strongControllerParms:debugit&&console.log("settings not found"),this.setup(t),debugit&&console.log("config",this.config),"documentReady"===this.config.initializeOn?jQuery(document).ready(function(){debugit&&console.log("document ready"),strongController.start(),strongController.listen()}):jQuery(window).on("load",function(){debugit&&console.log("window load"),strongController.start(),strongController.listen()}),jQuery(window).on("load",function(){strongController.listenForIframeReady()})},start:function(){debugit&&console.log("start"),strongController.initSliders(),strongController.initPagers(),strongController.initLayouts(),strongController.initForm(),strongController.initIframes(),strongController.customEvents()},listen:function(){switch(debugit&&console.log("listen"),this.config.method){case"universal":this.newInterval();break;case"observer":this.observer(document.getElementById(this.config.containerId),this.newTimeout);break;case"event":document.addEventListener(this.config.event,this.start);break;case"script":switch(this.config.script){case"barba":"object"==typeof Barba&&Barba.hasOwnProperty("Dispatcher")&&Barba.Dispatcher.on("transitionCompleted",this.start)}}},listenForIframeReady:function(){debugit&&console.log("listenForIframeReady"),strongController.iframes.length&&strongController.grids.length?strongController.iframes.ready(function(){setTimeout(function(){strongController.grids.masonry(),debugit&&console.log("listenForIframeReady","timeout 1")},1e3),setTimeout(function(){strongController.grids.masonry(),debugit&&console.log("listenForIframeReady","timeout 2")},2e3)}):debugit&&console.log("listenForIframeReady","no iframes or Masonry found")}};strongController.init();
public/js/lib/actual/jquery.actual.js CHANGED
File without changes
public/js/lib/actual/jquery.actual.min.js CHANGED
File without changes
public/js/lib/form-validation/form-validation.js CHANGED
File without changes
public/js/lib/form-validation/form-validation.min.js CHANGED
File without changes
public/js/lib/imagesloaded/imagesloaded.pkgd.min.js CHANGED
File without changes
public/js/lib/readmore/readmore.js CHANGED
File without changes
public/js/lib/readmore/readmore.min.js CHANGED
File without changes
public/js/lib/strongpager/jquery.strongpager.js CHANGED
File without changes
public/js/lib/strongpager/jquery.strongpager.min.js CHANGED
File without changes
public/js/lib/strongslider/LICENSE.md CHANGED
File without changes
public/js/lib/strongslider/jquery.strongslider.js CHANGED
@@ -16,1972 +16,1975 @@
16
 
17
  ;(function ($) {
18
 
19
- var defaults = {
20
- debug: false,
21
- logAs: 'strongSlider',
22
- compat: {
23
- lazyload: {
24
- active: false,
25
- classes: {}
26
- }
27
- },
28
-
29
- // GENERAL
30
- mode: 'horizontal',
31
- slideSelector: 'div.t-slide',
32
- infiniteLoop: true,
33
- hideControlOnEnd: false,
34
- speed: 500,
35
- easing: null,
36
- slideMargin: 10,
37
- startSlide: 0,
38
- randomStart: false,
39
- captions: false,
40
- adaptiveHeight: false,
41
- adaptiveHeightSpeed: 500,
42
- video: false,
43
- useCSS: true,
44
- preloadImages: 'visible',
45
- responsive: true,
46
- slideZIndex: 50,
47
- wrapperClass: 'wpmslider-wrapper',
48
- stretch: false,
49
- imagesLoaded: true,
50
-
51
- // TOUCH
52
- touchEnabled: true,
53
- swipeThreshold: 50,
54
- oneToOneTouch: true,
55
- preventDefaultSwipeX: true,
56
- preventDefaultSwipeY: false,
57
-
58
- // ACCESSIBILITY
59
- ariaLive: true,
60
- ariaHidden: true,
61
-
62
- // KEYBOARD
63
- keyboardEnabled: false,
64
-
65
- // PAGER
66
- pager: true,
67
- pagerType: 'full',
68
- pagerShortSeparator: ' / ',
69
- pagerSelector: null,
70
- buildPager: null,
71
- pagerCustom: null,
72
-
73
- // CONTROLS
74
- controls: true,
75
- nextText: 'Next',
76
- prevText: 'Prev',
77
- nextSelector: null,
78
- prevSelector: null,
79
- autoControls: false,
80
- startText: 'Start',
81
- stopText: 'Stop',
82
- autoControlsCombine: false,
83
- autoControlsSelector: null,
84
-
85
- // AUTO
86
- auto: true,
87
- pause: 4000,
88
- autoStart: true,
89
- autoDirection: 'next',
90
- stopAutoOnClick: false,
91
- autoHover: false,
92
- autoDelay: 0,
93
- autoSlideForOnePage: false,
94
-
95
- // CAROUSEL
96
- minSlides: 1,
97
- maxSlides: 1,
98
- moveSlides: 0,
99
-
100
- // CALLBACKS
101
- onSliderLoad: function () { return true; },
102
- onSlideBefore: function () { return true; },
103
- onSlideAfter: function () { return true; },
104
- onSlideNext: function () { return true; },
105
- onSlidePrev: function () { return true; },
106
- onSliderResize: function() { return true; },
107
- onAutoChange: function() { return true; } //calls when auto slides starts and stops
108
- };
109
-
110
- $.fn.strongSlider = function (options) {
111
-
112
- if (this.length === 0) {
113
- return this;
114
- }
115
-
116
- // create a namespace to be used throughout the plugin
117
- var slider = {},
118
- // set a reference to our slider element
119
- viewEl = this,
120
- el = this.find('.wpmslider-content');
121
-
122
- // Return if slider is already initialized
123
- if ($(el).data('strongSlider')) { return; }
124
-
125
- /**
126
- * ===================================================================================
127
- * = PRIVATE FUNCTIONS
128
- * ===================================================================================
129
- */
130
-
131
- /**
132
- * Initializes namespace settings to be used throughout plugin
133
- */
134
- var init = function () {
135
- // Return if slider is already initialized
136
- if ($(el).data('strongSlider')) { return; }
137
-
138
- // timer to check visibility; used to control sliders in hidden tabs
139
- slider.visibilityInterval = 0;
140
- // slider state
141
- slider.hidden = false;
142
-
143
- // merge user-supplied options with the defaults
144
- var sliderVar = viewEl.data('slider-var');
145
- var config = {};
146
- if (typeof(window[sliderVar]) !== 'undefined') {
147
- config = window[sliderVar].config;
148
- }
149
-
150
- slider.settings = $.extend({}, defaults, config, options);
151
- slider.debug = slider.settings.debug;
152
- slider.logAs = slider.settings.logAs;
153
-
154
- if (slider.debug) console.log(slider.logAs, 'slider.settings', slider.settings);
155
-
156
- // store the original children
157
- slider.children = el.children(slider.settings.slideSelector);
158
-
159
- // check if actual number of slides is less than minSlides / maxSlides
160
- if (slider.children.length < slider.settings.minSlides) {
161
- slider.settings.minSlides = slider.children.length;
162
- }
163
- if (slider.children.length < slider.settings.maxSlides) {
164
- slider.settings.maxSlides = slider.children.length;
165
- }
166
-
167
- // if random start, set the startSlide setting to random number
168
- if (slider.settings.randomStart) {
169
- slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
170
- }
171
-
172
- // store active slide information
173
- slider.active = {index: slider.settings.startSlide};
174
-
175
- // store if the slider is in carousel mode (displaying / moving multiple slides)
176
- setBreakpoint();
177
- // slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
178
-
179
- // if carousel, force preloadImages = 'all'
180
- if (slider.carousel) {
181
- slider.settings.preloadImages = 'all';
182
- }
183
-
184
- // store the current state of the slider (if currently animating, working is true)
185
- slider.working = false;
186
-
187
- // initialize the controls object
188
- slider.controls = {};
189
-
190
- // initialize an auto interval (no interval = is paused or waiting for user to start)
191
- slider.interval = null;
192
-
193
- // determine which property to use for transitions
194
- slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left';
195
-
196
- // determine if hardware acceleration can be used
197
- slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function () {
198
- // create our test div element
199
- var div = document.createElement('div'),
200
- // css transition properties
201
- props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
202
- // test for each property
203
- for (var i = 0; i < props.length; i++) {
204
- if (div.style[props[i]] !== undefined) {
205
- slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
206
- slider.animProp = '-' + slider.cssPrefix + '-transform';
207
- return true;
208
- }
209
- }
210
- return false;
211
- }());
212
-
213
- // if vertical mode always make maxSlides and minSlides equal
214
- if (slider.settings.mode === 'vertical') {
215
- slider.settings.maxSlides = slider.settings.minSlides;
216
- }
217
- // save original style data
218
- el.data('origStyle', el.attr('style'));
219
- el.children(slider.settings.slideSelector).each(function () {
220
- $(this).data('origStyle', $(this).attr('style'));
221
- });
222
-
223
- // Bail if no slides
224
- if (!el.getSlideCount()) { return; }
225
-
226
- // Wait for images loaded
227
- if (slider.settings.imagesLoaded) {
228
- viewEl.imagesLoaded(function () { initVisibilityCheck(); });
229
- } else {
230
- initVisibilityCheck();
231
- }
232
-
233
- };
234
-
235
- /**
236
- * Primary
237
- *
238
- * @returns {boolean}
239
- */
240
- var reallyVisible = function () {
241
- return (viewEl.is(':visible') && viewEl.css('visibility') !== 'hidden');
242
- };
243
-
244
- /**
245
- * Secondary
246
- *
247
- * @returns {boolean}
248
- */
249
- var compatCheck = function () {
250
- if (slider.settings.compat.lazyload) {
251
-
252
- var inProgress = false;
253
- for (var i = 0, len = slider.settings.compat.lazyload.classes.length; i < len; i++) {
254
-
255
- var startClass = slider.settings.compat.lazyload.classes[i].start;
256
- var finishClass = slider.settings.compat.lazyload.classes[i].finish;
257
-
258
- if (startClass && finishClass) {
259
- if (viewEl.find('img.' + startClass).length && !viewEl.find('img.' + finishClass).length) {
260
- inProgress = true;
261
- }
262
- } else if (startClass) {
263
- if (viewEl.find('img.' + startClass).length) {
264
- inProgress = true;
265
- }
266
- } else if (finishClass) {
267
- if (!viewEl.find('img.' + finishClass).length) {
268
- inProgress = true;
269
- }
270
- }
271
-
272
- }
273
-
274
- if (inProgress) {
275
- if (slider.debug) console.log(slider.logAs, 'lazy loading...');
276
- return false;
277
- }
278
-
279
- }
280
-
281
- if (slider.debug) console.log(slider.logAs, 'compat check complete');
282
- return true;
283
- };
284
-
285
- /**
286
- * Check visibility and lazy load status.
287
- */
288
- var initVisibilityCheck = function () {
289
- if (reallyVisible() && compatCheck()) {
290
-
291
- clearInterval(slider.visibilityInterval);
292
-
293
- // perform all DOM / CSS modifications
294
- setup();
295
-
296
- } else {
297
-
298
- if (slider.visibilityInterval === 0) {
299
- slider.visibilityInterval = setInterval(initVisibilityCheck, 1000 * 4);
300
- }
301
-
302
- }
303
- };
304
-
305
- /**
306
- * Performs all DOM and CSS modifications
307
- */
308
- var setup = function () {
309
- var preloadSelector = slider.children.eq(slider.settings.startSlide); // set the default preload selector (visible)
310
-
311
- // wrap el in a wrapper
312
- el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="wpmslider-viewport"></div></div>');
313
-
314
- // store a namespace reference to .wpmslider-viewport
315
- slider.viewport = el.parent();
316
-
317
- // add aria-live if the setting is enabled
318
- if (slider.settings.ariaLive) {
319
- slider.viewport.attr('aria-live', 'polite');
320
- }
321
-
322
- // add a loading div to display while images are loading
323
- slider.loader = $('<div class="wpmslider-loading" />');
324
- slider.viewport.prepend(slider.loader);
325
-
326
- // set el to a massive width, to hold any needed slides
327
- // also strip any margin and padding from el
328
- el.css({
329
- width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto',
330
- position: 'relative'
331
- });
332
-
333
- // if using CSS, add the easing property
334
- if (slider.usingCSS && slider.settings.easing) {
335
- el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
336
- // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
337
- } else if (!slider.settings.easing) {
338
- slider.settings.easing = 'swing';
339
- }
340
- // make modifications to the viewport (.wpmslider-viewport)
341
- slider.viewport.css({
342
- width: '100%',
343
- overflow: 'hidden',
344
- position: 'relative'
345
- });
346
-
347
- slider.viewport.parent().css({
348
- maxWidth: getViewportMaxWidth2()
349
- });
350
-
351
- // make modification to the wrapper (.wpmslider-wrapper)
352
- if (!slider.settings.pager && !slider.settings.controls) {
353
- slider.viewport.parent().css({ margin: '0 auto' });
354
- }
355
-
356
- // apply css to all slider children
357
- slider.children.css({
358
- // the float attribute is a reserved word in compressors like YUI compressor and need to be quoted #48
359
- 'float': slider.settings.mode === 'horizontal' ? 'left' : 'none',
360
- listStyle: 'none',
361
- position: 'relative'
362
- });
363
-
364
- // apply the calculated width after the float is applied to prevent scrollbar interference
365
- updateWidth();
366
-
367
- // if slideMargin is supplied, add the css
368
- if (slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0) {
369
- slider.children.css('marginRight', slider.settings.slideMargin);
370
- }
371
- if (slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0) {
372
- slider.children.css('marginBottom', slider.settings.slideMargin);
373
- }
374
-
375
- // if "fade" mode, add positioning and z-index CSS
376
- if (slider.settings.mode === 'fade') {
377
- slider.children.css({
378
- position: 'absolute',
379
- zIndex: 0,
380
- display: 'none'
381
- });
382
- // prepare the z-index on the showing element
383
- slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
384
- } else {
385
- slider.children.css({
386
- display: 'block'
387
- });
388
- }
389
-
390
- // create an element to contain all slider controls (pager, start / stop, etc)
391
- slider.controls.el = $('<div class="wpmslider-controls" />');
392
- // if captions are requested, add them
393
- if (slider.settings.captions) {
394
- appendCaptions();
395
- }
396
- // check if startSlide is last slide
397
- slider.active.last = slider.settings.startSlide === getPagerQty() - 1;
398
- // if video is true, set up the fitVids plugin
399
- if (slider.settings.video) { el.fitVids(); }
400
-
401
- //preloadImages
402
- if (slider.settings.preloadImages === 'none') {
403
- preloadSelector = null;
404
- } else if (slider.settings.preloadImages === 'all') {
405
- preloadSelector = slider.children;
406
- }
407
-
408
- // add separate control divs
409
- // [ LEFT ]
410
- // if controls are requested, add them
411
- if (slider.settings.controls) { appendControlPrev(); }
412
- // [ MIDDLE ]
413
- // if auto is true, and auto controls are requested, add them
414
- if (slider.settings.auto && slider.settings.autoControls) { appendControlsAuto(); }
415
- // if pager is requested, add it
416
- if (slider.settings.pager) { appendPager(); }
417
- // [ RIGHT ]
418
- if (slider.settings.controls) { appendControlNext(); }
419
-
420
- // if any control option is requested, add the controls wrapper
421
- if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) { slider.viewport.after(slider.controls.el); }
422
-
423
- if (preloadSelector === null) {
424
- start();
425
- } else {
426
- loadElements(preloadSelector, start);
427
- }
428
- };
429
-
430
- /**
431
- *
432
- */
433
- var setBreakpoint = function () {
434
- if (slider.debug) console.log(slider.logAs, 'setBreakpoint');
435
-
436
- // fallback
437
- var currentBreakpoint = slider.settings.breakpoints.single;
438
- var breakpoints = slider.settings.breakpoints.multiple;
439
-
440
- if (slider.settings.type === 'show_multiple') {
441
-
442
- for (var key in breakpoints) {
443
- if (breakpoints.hasOwnProperty(key)) {
444
- if (verge.viewportW() >= breakpoints[key].width) {
445
- currentBreakpoint = breakpoints[key];
446
- break;
447
- }
448
- }
449
- }
450
-
451
- }
452
-
453
- if (slider.debug) console.log('current breakpoint', currentBreakpoint);
454
-
455
- slider.settings.maxSlides = currentBreakpoint.maxSlides;
456
- slider.settings.moveSlides = currentBreakpoint.moveSlides;
457
- slider.settings.slideMargin = currentBreakpoint.slideMargin;
458
-
459
- slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
460
- };
461
-
462
- /**
463
- *
464
- */
465
- var updateWidth = function () {
466
- setBreakpoint();
467
- slider.children.css('width', getSlideWidth2());
468
- };
469
-
470
- /**
471
- *
472
- * @param selector
473
- * @param callback
474
- */
475
- var loadElements = function(selector, callback) {
476
- var total = selector.find('img:not([src=""]), iframe').length,
477
- count = 0;
478
- if (total === 0) {
479
- callback();
480
- return;
481
- }
482
- selector.find('img:not([src=""]), iframe').each(function() {
483
- $(this).one('load error', function() {
484
- if (++count === total) { callback(); }
485
- }).each(function() {
486
- if (this.complete || this.src === '') { $(this).trigger('load'); }
487
- });
488
- });
489
- };
490
-
491
- /**
492
- * Start the slider
493
- */
494
- var start = function () {
495
-
496
- // if infinite loop, prepare additional slides
497
- if (slider.settings.infiniteLoop && slider.settings.mode !== 'fade') {
498
- var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides,
499
- sliceAppend = slider.children.slice(0, slice).clone(true).addClass('wpmslider-clone'),
500
- slicePrepend = slider.children.slice(-slice).clone(true).addClass('wpmslider-clone');
501
- if (slider.settings.ariaHidden) {
502
- sliceAppend.attr('aria-hidden', true);
503
- slicePrepend.attr('aria-hidden', true);
504
- }
505
-
506
- el.append(sliceAppend).prepend(slicePrepend);
507
- }
508
-
509
- // remove the loading DOM element
510
- slider.loader.remove();
511
-
512
- // set the left / top position of "el"
513
- // setSlidePosition();
514
-
515
- // if "vertical" mode, always use adaptiveHeight to prevent odd behavior
516
- if (slider.settings.mode === 'vertical') {
517
- slider.settings.adaptiveHeight = true;
518
- }
519
-
520
- // set the viewport height
521
- // setViewportHeight();
522
-
523
- // if stretch, set t-slide height to 100%
524
- // if (slider.settings.stretch) {
525
- // setSlideHeight();
526
- // }
527
-
528
- // make sure everything is positioned just right (same as a window resize)
529
- el.redrawSlider();
530
-
531
- // onSliderLoad callback
532
- slider.settings.onSliderLoad.call(el, slider.active.index);
533
-
534
- // slider has been fully initialized
535
- slider.initialized = true;
536
- slider.visibilityInterval = setInterval(visibilityCheck, 500);
537
-
538
- if (slider.settings.responsive) { attachListeners(); }
539
-
540
- // if auto is true and has more than 1 page, start the show
541
- if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) { initAuto(); }
542
-
543
- // if pager is requested, make the appropriate pager link active
544
- if (slider.settings.pager) {
545
- updatePagerActive(slider.settings.startSlide);
546
- }
547
-
548
- // check for any updates to the controls (like hideControlOnEnd updates)
549
- if (slider.settings.controls) {
550
- updateDirectionControls();
551
- }
552
-
553
- // if touchEnabled is true, setup the touch events
554
- if (slider.settings.touchEnabled) { initTouch(); }
555
-
556
- // if keyboardEnabled is true, setup the keyboard events
557
- if (slider.settings.keyboardEnabled) {
558
- $(document).keydown(keyPress);
559
- }
560
- };
561
-
562
- /**
563
- * ==============================================================
564
- * EVENTS
565
- *
566
- * Pause/play actions are coupled by method. The slider can only
567
- * be restarted by the partner of the mechanism that paused it.
568
- * For example, a slider paused by switching windows (blur) will
569
- * only restart upon switching back (focus).
570
- *
571
- * Event : Action : Function
572
- * ------------------------------:------------:-------------------
573
- * hide/show (ex: tabbed pages) : pause/play : visibilityCheck
574
- * scroll out/in of viewport : pause/play : visibilityCheck
575
- * hover in/out : pause/play : initAuto
576
- * blur/focus : pause/play : attachListeners
577
- * resize and orientation change : redraw : attachListeners
578
- * ==============================================================
579
- */
580
-
581
- /**
582
- * Window event listeners.
583
- *
584
- * Not checking inViewport on scroll event because we also check that
585
- * in the general visibility check.
586
- */
587
- var attachListeners = function () {
588
-
589
- window.addEventListener('resize', updateLayout, false);
590
- window.addEventListener('orientationchange', updateLayout, false);
591
- window.addEventListener('toggleFullContent', updateLayout, false);
592
-
593
- // Test this with dev console closed
594
- // (or click in the document once to establish focus).
595
- window.addEventListener('blur', function () {
596
- pauseEvent('blur');
597
- });
598
-
599
- window.addEventListener('focus', function () {
600
- playEvent('blur');
601
- });
602
-
603
- };
604
-
605
- // Debounced resize event.
606
- var updateLayout = _.debounce(function () {
607
- if (slider.debug) console.log(slider.logAs, 'updateLayout');
608
- resizeWindow();
609
- }, 250);
610
-
611
- // General visibility check.
612
- var visibilityCheck = function () {
613
- if (!slider.settings.auto) {
614
- return;
615
- }
616
-
617
- if (!reallyVisible()) {
618
- pauseEvent('hide');
619
- } else {
620
- playEvent('hide');
621
- }
622
-
623
- if (!verge.inViewport(el)) {
624
- pauseEvent('scroll');
625
- } else {
626
- playEvent('scroll');
627
- }
628
- };
629
-
630
- var pauseEvent = function (action) {
631
- // if the auto show is currently playing (has an active interval)
632
- if (slider.interval) {
633
- // stop the auto show and pass true argument which will prevent control update
634
- el.stopAuto(true);
635
- // create a new autoPaused value which will be used by the corresponding event
636
- slider.autoPaused = action;
637
- if (slider.debug) console.log(slider.logAs, 'pause', action);
638
- }
639
- };
640
-
641
- var playEvent = function (action) {
642
- // if the autoPaused value was created by the prior event
643
- if (slider.autoPaused === action) {
644
- // start the auto show and pass true argument which will prevent control update
645
- el.startAuto(true);
646
- // reset the autoPaused value
647
- slider.autoPaused = null;
648
- if (slider.debug) console.log(slider.logAs, 'play', action);
649
- }
650
- };
651
-
652
- /**
653
- *
654
- */
655
- var setSlideHeight = function () {
656
- var heights = slider.children.map(function () {
657
- return jQuery(this).actual('outerHeight');
658
- }).get();
659
-
660
- var maxHeight = arrayMax(heights);
661
- slider.children.height(maxHeight);
662
- };
663
-
664
- /**
665
- *
666
- */
667
- var unsetSlideHeight = function () {
668
- slider.children.height('auto');
669
- };
670
-
671
- // Function to get the max value in array
672
- var arrayMax = function (array) {
673
- return Math.max.apply(Math, array);
674
- };
675
-
676
- /**
677
- * Returns the calculated height of the SLIDER viewport (not browser viewport),
678
- * used to determine either adaptiveHeight or the maxHeight value
679
- */
680
- var getViewportHeight = function () {
681
-
682
- var height = 0;
683
-
684
- // first determine which children (slides) should be used in our height calculation
685
- var children = $();
686
-
687
- // if mode is not "vertical" and adaptiveHeight is false, include all children
688
- if (slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight) {
689
-
690
- children = slider.children;
691
-
692
- } else {
693
-
694
- // if not carousel, return the single active child
695
- if (!slider.carousel) {
696
-
697
- children = slider.children.eq(slider.active.index);
698
-
699
- } else {
700
-
701
- // if carousel, return a slice of children
702
-
703
- // get the individual slide index
704
- var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy();
705
-
706
- // add the current slide to the children
707
- children = slider.children.eq(currentIndex);
708
-
709
- // cycle through the remaining "showing" slides
710
- for (var i = 1; i <= slider.settings.maxSlides - 1; i++) {
711
-
712
- // if looped back to the start
713
- if (currentIndex + i >= slider.children.length) {
714
- children = children.add(slider.children.eq(i - 1));
715
- } else {
716
- children = children.add(slider.children.eq(currentIndex + i));
717
- }
718
-
719
- }
720
-
721
- }
722
-
723
- }
724
-
725
- // if "vertical" mode, calculate the sum of the heights of the children
726
- if (slider.settings.mode === 'vertical') {
727
- children.each(function (index) {
728
- height += $(this).outerHeight();
729
- });
730
- // add user-supplied margins
731
- if (slider.settings.slideMargin > 0) {
732
- height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
733
- }
734
- // if not "vertical" mode, calculate the max height of the children
735
- } else {
736
- height = Math.max.apply(Math, children.map(function () {
737
- return $(this).outerHeight(false);
738
- }).get());
739
- }
740
-
741
- if (slider.viewport.css('box-sizing') === 'border-box') {
742
- height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
743
- parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
744
- } else if (slider.viewport.css('box-sizing') === 'padding-box') {
745
- height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
746
- }
747
-
748
- return height;
749
- };
750
-
751
- /**
752
- *
753
- */
754
- var setViewportHeight = function () {
755
- slider.viewport.height(getViewportHeight() + 2);
756
- };
757
-
758
- /**
759
- * Returns the calculated width to be used for the outer wrapper / viewport
760
- */
761
- var getViewportMaxWidth2 = function () {
762
- return '100%';
763
- };
764
-
765
- /**
766
- * Returns the calculated width to be applied to each slide
767
- */
768
- var getSlideWidth2 = function () {
769
- var wrapWidth = slider.viewport.width();
770
- var margins = slider.settings.slideMargin * (slider.settings.maxSlides - 1);
771
- return Math.floor( (wrapWidth - margins) / slider.settings.maxSlides );
772
- };
773
-
774
- /**
775
- * Returns the number of slides currently visible in the viewport (includes partially visible slides)
776
- */
777
- var getNumberSlidesShowing2 = function () {
778
- return slider.settings.maxSlides;
779
- };
780
-
781
- /**
782
- * Returns the number of pages (one full viewport of slides is one "page")
783
- */
784
- var getPagerQty = function () {
785
- var pagerQty = 0,
786
- breakPoint = 0,
787
- counter = 0;
788
- // if moveSlides is specified by the user
789
- if (slider.settings.moveSlides > 0) {
790
- if (slider.settings.infiniteLoop) {
791
- pagerQty = Math.ceil(slider.children.length / getMoveBy());
792
- } else {
793
- // when breakpoint goes above children length, counter is the number of pages
794
- while (breakPoint < slider.children.length) {
795
- ++pagerQty;
796
- breakPoint = counter + getNumberSlidesShowing2();
797
- counter += slider.settings.moveSlides <= getNumberSlidesShowing2() ? slider.settings.moveSlides : getNumberSlidesShowing2();
798
- }
799
- return counter;
800
- }
801
- // if moveSlides is 0 (auto) divide children length by sides showing, then round up
802
- } else {
803
- pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing2());
804
- }
805
- return pagerQty;
806
- };
807
-
808
- /**
809
- * Returns the number of individual slides by which to shift the slider
810
- */
811
- var getMoveBy = function () {
812
- // if moveSlides was set by the user and moveSlides is less than number of slides showing
813
- if (slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing2()) {
814
- return slider.settings.moveSlides;
815
- }
816
- // if moveSlides is 0 (auto)
817
- return getNumberSlidesShowing2();
818
- };
819
-
820
- /**
821
- * Sets the slider's (el) left or top position
822
- */
823
- var setSlidePosition = function () {
824
- var position, lastChild, lastShowingIndex;
825
-
826
- // if last slide, not infinite loop, and number of children is larger than specified maxSlides
827
- if (slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop) {
828
-
829
- if (slider.settings.mode === 'horizontal') {
830
- // get the last child's position
831
- lastChild = slider.children.last();
832
- position = lastChild.position();
833
- // set the left position
834
- setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
835
- } else if (slider.settings.mode === 'vertical') {
836
- // get the last showing index's position
837
- lastShowingIndex = slider.children.length - slider.settings.minSlides;
838
- position = slider.children.eq(lastShowingIndex).position();
839
- // set the top position
840
- setPositionProperty(-position.top, 'reset', 0);
841
- }
842
-
843
- // if not last slide
844
- } else {
845
-
846
- // get the position of the first showing slide
847
- position = slider.children.eq(slider.active.index * getMoveBy()).position();
848
-
849
- // check for last slide
850
- if (slider.active.index === getPagerQty() - 1) {
851
- slider.active.last = true;
852
- }
853
-
854
- // set the respective position
855
- if (position !== undefined) {
856
- if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
857
- else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
858
- else if (slider.settings.mode === 'none') { setPositionProperty(-position.top, 'reset', 0); }
859
- }
860
-
861
- }
862
- };
863
-
864
- /**
865
- * Sets the el's animating property position (which in turn will sometimes animate el).
866
- * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
867
- *
868
- * @param value (int)
869
- * - the animating property's value
870
- *
871
- * @param type (string) 'slide', 'reset'
872
- * - the type of instance for which the function is being
873
- *
874
- * @param duration (int)
875
- * - the amount of time (in ms) the transition should occupy
876
- *
877
- * @param params (array) optional
878
- * - an optional parameter containing any variables that need to be passed in
879
- */
880
- var setPositionProperty = function (value, type, duration, params) {
881
- var animateObj, propValue;
882
- // use CSS transform
883
- if (slider.usingCSS) {
884
- // determine the translate3d value
885
- if (slider.settings.mode === 'vertical') {
886
- propValue = 'translateY(' + value + 'px)';
887
- } else if (slider.settings.mode === 'horizontal') {
888
- propValue = 'translateX(' + value + 'px';
889
- } else if (slider.settings.mode === 'none') {
890
- propValue = 'translateY(' + value + 'px)';
891
- duration = 0;
892
- }
893
-
894
- // add the CSS transition-duration
895
- el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
896
-
897
- if (type === 'slide') {
898
-
899
- // set the property value
900
- el.css(slider.animProp, propValue);
901
- if (duration !== 0) {
902
- // add a callback method - executes when CSS transition completes
903
- el.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function (e) {
904
- //make sure it's the correct one
905
- if (!$(e.target).is(el)) { return; }
906
- // remove the callback
907
- el.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
908
- updateAfterSlideTransition();
909
- });
910
- } else { //duration = 0
911
- updateAfterSlideTransition();
912
- }
913
-
914
- } else if (type === 'reset') {
915
- el.css(slider.animProp, propValue);
916
- }
917
- // use JS animate
918
- } else {
919
- animateObj = {};
920
- animateObj[slider.animProp] = value;
921
- if (type === 'slide') {
922
- el.animate(animateObj, duration, slider.settings.easing, function () {
923
- updateAfterSlideTransition();
924
- });
925
- } else if (type === 'reset') {
926
- el.css(slider.animProp, value);
927
- }
928
- }
929
- };
930
-
931
- /**
932
- * Populates the pager with proper amount of pages
933
- */
934
- var populatePager = function () {
935
- var pagerHtml = '',
936
- linkContent = '',
937
- pagerQty = getPagerQty();
938
-
939
- // loop through each pager item
940
- for (var i = 0; i < pagerQty; i++) {
941
- linkContent = '';
942
-
943
- if (slider.settings.buildPager) {
944
- // if using icons, use no link text
945
- if (slider.settings.buildPager === 'icons') {
946
- linkContent = '';
947
- }
948
- // if a buildPager function is supplied, use it to get pager link value, else use index + 1
949
- if ($.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom) {
950
- linkContent = slider.settings.buildPager(i);
951
- }
952
- slider.pagerEl.addClass('wpmslider-custom-pager');
953
- } else {
954
- linkContent = i + 1;
955
- slider.pagerEl.addClass('wpmslider-default-pager');
956
- }
957
-
958
- // add the markup to the string
959
- pagerHtml += '<div class="wpmslider-pager-item"><a href="" data-slide-index="' + i + '" class="wpmslider-pager-link">' + linkContent + '</a></div>';
960
- }
961
-
962
- // populate the pager element with pager links
963
- slider.pagerEl.html(pagerHtml);
964
- };
965
-
966
- /**
967
- * Appends the pager to the controls element
968
- */
969
- var appendPager = function () {
970
- if (!slider.settings.pagerCustom) {
971
- // create the pager DOM element
972
- slider.pagerEl = $('<div class="wpmslider-pager" />');
973
- // if a pager selector was supplied, populate it with the pager
974
- if (slider.settings.pagerSelector) {
975
- $(slider.settings.pagerSelector).html(slider.pagerEl);
976
- // if no pager selector was supplied, add it after the wrapper
977
- } else {
978
- slider.controls.el.addClass('wpmslider-has-pager').append(slider.pagerEl);
979
- }
980
- // populate the pager
981
- populatePager();
982
- } else {
983
- slider.pagerEl = $(slider.settings.pagerCustom);
984
- }
985
- // assign the pager click binding
986
- slider.pagerEl.on('click touchend', 'a', clickPagerBind);
987
- };
988
-
989
- /**
990
- * Appends prev control to the controls element
991
- */
992
- var appendControlPrev = function () {
993
- slider.controls.prev = $('<a class="wpmslider-prev" href="">' + slider.settings.prevText + '</a>');
994
-
995
- // bind click actions to the controls
996
- slider.controls.prev.on('click touchend', clickPrevBind);
997
-
998
- // if prevSelector was supplied, populate it
999
- if (slider.settings.prevSelector) {
1000
- $(slider.settings.prevSelector).append(slider.controls.prev);
1001
- }
1002
-
1003
- // if no custom selectors were supplied
1004
- if (!slider.settings.prevSelector) {
1005
- // add the controls to the DOM
1006
- slider.controls.directionEl = $('<div class="wpmslider-controls-direction" />');
1007
- // add the control elements to the directionEl
1008
- slider.controls.directionEl.append(slider.controls.prev);
1009
- slider.controls.el.addClass('wpmslider-has-controls-direction').append(slider.controls.directionEl);
1010
- }
1011
- };
1012
-
1013
- /**
1014
- * Appends next controls to the controls element
1015
- */
1016
- var appendControlNext = function () {
1017
- slider.controls.next = $('<a class="wpmslider-next" href="">' + slider.settings.nextText + '</a>');
1018
-
1019
- // bind click actions to the controls
1020
- slider.controls.next.on('click touchend', clickNextBind);
1021
-
1022
- // if nextSelector was supplied, populate it
1023
- if (slider.settings.nextSelector) {
1024
- $(slider.settings.nextSelector).append(slider.controls.next);
1025
- }
1026
-
1027
- // if no custom selectors were supplied
1028
- if (!slider.settings.nextSelector) {
1029
- // add the controls to the DOM
1030
- slider.controls.directionEl = $('<div class="wpmslider-controls-direction" />');
1031
- // add the control elements to the directionEl
1032
- slider.controls.directionEl.append(slider.controls.next);
1033
- slider.controls.el.addClass('wpmslider-has-controls-direction').append(slider.controls.directionEl);
1034
- }
1035
- };
1036
-
1037
- /**
1038
- * Appends start / stop auto controls to the controls element
1039
- */
1040
- var appendControlsAuto = function () {
1041
- slider.controls.start = $('<div class="wpmslider-controls-auto-item"><a class="wpmslider-start" href="">' + slider.settings.startText + '</a></div>');
1042
- slider.controls.stop = $('<div class="wpmslider-controls-auto-item"><a class="wpmslider-stop" href="">' + slider.settings.stopText + '</a></div>');
1043
-
1044
- // add the controls to the DOM
1045
- slider.controls.autoEl = $('<div class="wpmslider-controls-auto" />');
1046
-
1047
- // on click actions to the controls
1048
- slider.controls.autoEl.on('click', '.wpmslider-start', clickStartBind);
1049
- slider.controls.autoEl.on('click', '.wpmslider-stop', clickStopBind);
1050
-
1051
- // if autoControlsCombine, insert only the "start" control
1052
- if (slider.settings.autoControlsCombine) {
1053
- slider.controls.autoEl.append(slider.controls.start);
1054
- // if autoControlsCombine is false, insert both controls
1055
- }
1056
- else {
1057
- slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
1058
- }
1059
-
1060
- // if auto controls selector was supplied, populate it with the controls
1061
- if (slider.settings.autoControlsSelector) {
1062
- $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
1063
- // if auto controls selector was not supplied, add it after the wrapper
1064
- } else {
1065
- slider.controls.el.addClass('wpmslider-has-controls-auto').append(slider.controls.autoEl);
1066
- }
1067
-
1068
- // update the auto controls
1069
- updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
1070
- };
1071
-
1072
- /**
1073
- * Appends image captions to the DOM
1074
- */
1075
- var appendCaptions = function () {
1076
- // cycle through each child
1077
- slider.children.each(function (index) {
1078
- // get the image title attribute
1079
- var title = $(this).find('img:first').attr('title');
1080
- // append the caption
1081
- if (title !== undefined && ('' + title).length) {
1082
- $(this).append('<div class="wpmslider-caption"><span>' + title + '</span></div>');
1083
- }
1084
- });
1085
- };
1086
-
1087
- /**
1088
- * Click next binding
1089
- *
1090
- * @param e (event)
1091
- * - DOM event object
1092
- */
1093
- var clickNextBind = function (e) {
1094
- e.preventDefault();
1095
- e.stopPropagation(); // for compatibility with WordPress themes
1096
- if (slider.controls.el.hasClass('disabled')) {
1097
- return;
1098
- }
1099
- // if auto show is running, stop it
1100
- if (slider.settings.auto && slider.settings.stopAutoOnClick) {
1101
- if (slider.debug) console.log(slider.logAs, 'stop on navigation');
1102
- el.stopAuto();
1103
- }
1104
- el.goToNextSlide();
1105
- };
1106
-
1107
- /**
1108
- * Click prev binding
1109
- *
1110
- * @param e (event)
1111
- * - DOM event object
1112
- */
1113
- var clickPrevBind = function (e) {
1114
- e.preventDefault();
1115
- e.stopPropagation(); // for compatibility with WordPress themes
1116
- if (slider.controls.el.hasClass('disabled')) {
1117
- return;
1118
- }
1119
- // if auto show is running, stop it
1120
- if (slider.settings.auto && slider.settings.stopAutoOnClick) {
1121
- if (slider.debug) console.log(slider.logAs, 'stop on navigation');
1122
- el.stopAuto();
1123
- }
1124
- el.goToPrevSlide();
1125
- };
1126
-
1127
- /**
1128
- * Click start binding
1129
- *
1130
- * @param e (event)
1131
- * - DOM event object
1132
- */
1133
- var clickStartBind = function (e) {
1134
- el.startAuto();
1135
- e.preventDefault();
1136
- e.stopPropagation(); // for compatibility with WordPress themes
1137
- };
1138
-
1139
- /**
1140
- * Click stop binding
1141
- *
1142
- * @param e (event)
1143
- * - DOM event object
1144
- */
1145
- var clickStopBind = function (e) {
1146
- el.stopAuto();
1147
- e.preventDefault();
1148
- e.stopPropagation(); // for compatibility with WordPress themes
1149
- };
1150
-
1151
- /**
1152
- * Click pager binding
1153
- *
1154
- * @param e (event)
1155
- * - DOM event object
1156
- */
1157
- var clickPagerBind = function (e) {
1158
- var pagerLink, pagerIndex;
1159
- e.preventDefault();
1160
- e.stopPropagation(); // for compatibility with WordPress themes
1161
- if (slider.controls.el.hasClass('disabled')) {
1162
- return;
1163
- }
1164
- // if auto show is running, stop it
1165
- if (slider.settings.auto && slider.settings.stopAutoOnClick) {
1166
- if (slider.debug) console.log(slider.logAs, 'stop on navigation');
1167
- el.stopAuto();
1168
- }
1169
- pagerLink = $(e.currentTarget);
1170
- if (pagerLink.attr('data-slide-index') !== undefined) {
1171
- pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
1172
- // if clicked pager link is not active, continue with the goToSlide call
1173
- if (pagerIndex !== slider.active.index) {
1174
- el.goToSlide(pagerIndex);
1175
- }
1176
- }
1177
- };
1178
-
1179
- /**
1180
- * Updates the pager links with an active class
1181
- *
1182
- * @param slideIndex (int)
1183
- * - index of slide to make active
1184
- */
1185
- var updatePagerActive = function (slideIndex) {
1186
- // if "short" pager type
1187
- var len = slider.children.length; // nb of children
1188
- if (slider.settings.pagerType === 'short') {
1189
- if (slider.settings.maxSlides > 1) {
1190
- len = Math.ceil(slider.children.length / slider.settings.maxSlides);
1191
- }
1192
- slider.pagerEl.html((slideIndex + 1) + slider.settings.pagerShortSeparator + len);
1193
- return;
1194
- }
1195
- // remove all pager active classes
1196
- slider.pagerEl.find('a').removeClass('active');
1197
- // apply the active class for all pagers
1198
- slider.pagerEl.each(function (i, el) {
1199
- $(el).find('a').eq(slideIndex).addClass('active');
1200
- });
1201
- };
1202
-
1203
- /**
1204
- * Performs needed actions after a slide transition
1205
- */
1206
- var updateAfterSlideTransition = function () {
1207
- // if infinite loop is true
1208
- if (slider.settings.infiniteLoop) {
1209
- var position = '';
1210
- // first slide
1211
- if (slider.active.index === 0) {
1212
- // set the new position
1213
- position = slider.children.eq(0).position();
1214
- // carousel, last slide
1215
- } else if (slider.active.index === getPagerQty() - 1 && slider.carousel) {
1216
- position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
1217
- // last slide
1218
- } else if (slider.active.index === slider.children.length - 1) {
1219
- position = slider.children.eq(slider.children.length - 1).position();
1220
- }
1221
- if (position) {
1222
- if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
1223
- else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
1224
- }
1225
- }
1226
- // declare that the transition is complete
1227
- slider.working = false;
1228
- // onSlideAfter callback
1229
- slider.settings.onSlideAfter.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1230
- };
1231
-
1232
- /**
1233
- * Updates the auto controls state (either active, or combined switch)
1234
- *
1235
- * @param state (string) "start", "stop"
1236
- * - the new state of the auto show
1237
- */
1238
- var updateAutoControls = function (state) {
1239
- // if autoControlsCombine is true, replace the current control with the new state
1240
- if (slider.settings.autoControlsCombine) {
1241
- slider.controls.autoEl.html(slider.controls[state]);
1242
- // if autoControlsCombine is false, apply the "active" class to the appropriate control
1243
- } else {
1244
- slider.controls.autoEl.find('a').removeClass('active');
1245
- slider.controls.autoEl.find('a:not(.wpmslider-' + state + ')').addClass('active');
1246
- }
1247
- };
1248
-
1249
- /**
1250
- * Updates the direction controls (checks if either should be hidden)
1251
- */
1252
- var updateDirectionControls = function () {
1253
- if (getPagerQty() === 1) {
1254
- slider.controls.prev.addClass('disabled');
1255
- slider.controls.next.addClass('disabled');
1256
- }
1257
- else if (!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd) {
1258
- // if first slide
1259
- if (slider.active.index === 0) {
1260
- slider.controls.prev.addClass('disabled');
1261
- slider.controls.next.removeClass('disabled');
1262
- // if last slide
1263
- } else if (slider.active.index === getPagerQty() - 1) {
1264
- slider.controls.next.addClass('disabled');
1265
- slider.controls.prev.removeClass('disabled');
1266
- // if any slide in the middle
1267
- } else {
1268
- slider.controls.prev.removeClass('disabled');
1269
- slider.controls.next.removeClass('disabled');
1270
- }
1271
- }
1272
- };
1273
-
1274
- /**
1275
- * Initializes the auto process
1276
- */
1277
- var initAuto = function () {
1278
- // if autoDelay was supplied, launch the auto show using a setTimeout() call
1279
- if (slider.settings.autoDelay > 0) {
1280
- setTimeout(el.startAuto, slider.settings.autoDelay);
1281
- // if autoDelay was not supplied, start the auto show normally
1282
- } else {
1283
- el.startAuto();
1284
- }
1285
-
1286
- // if autoHover is requested
1287
- if (slider.settings.autoHover) {
1288
- // on el hover
1289
- el.hover(function () {
1290
- pauseEvent('hover');
1291
- }, function () {
1292
- playEvent('hover');
1293
- });
1294
- }
1295
- };
1296
-
1297
- /**
1298
- * Initializes keyboard events
1299
- */
1300
- var keyPress = function (e) {
1301
- var activeElementTag = document.activeElement.tagName.toLowerCase(),
1302
- tagFilters = 'input|textarea',
1303
- p = new RegExp(activeElementTag, ['i']),
1304
- result = p.exec(tagFilters);
1305
-
1306
- if (result === null && verge.inViewport(el)) {
1307
- if (e.keyCode === 39) {
1308
- clickNextBind(e);
1309
- return false;
1310
- } else if (e.keyCode === 37) {
1311
- clickPrevBind(e);
1312
- return false;
1313
- }
1314
- }
1315
- };
1316
-
1317
- /**
1318
- * Initializes touch events
1319
- */
1320
- var initTouch = function () {
1321
- // initialize object to contain all touch values
1322
- slider.touch = {
1323
- start: {x: 0, y: 0},
1324
- end: {x: 0, y: 0}
1325
- };
1326
- slider.viewport.on('touchstart MSPointerDown pointerdown', onTouchStart);
1327
-
1328
- //for browsers that have implemented pointer events and fire a click after
1329
- //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not
1330
- slider.viewport.on('click', '.wpmslider a', function (e) {
1331
- if (slider.viewport.hasClass('click-disabled')) {
1332
- e.preventDefault();
1333
- e.stopPropagation(); // for compatibility with WordPress themes
1334
- slider.viewport.removeClass('click-disabled');
1335
- }
1336
- });
1337
- };
1338
-
1339
- /**
1340
- * Event handler for "touchstart"
1341
- *
1342
- * @param e (event)
1343
- * - DOM event object
1344
- */
1345
- var onTouchStart = function (e) {
1346
- // watch only for left mouse, touch contact and pen contact
1347
- // touchstart event object doesn`t have button property
1348
- if (e.type !== 'touchstart' && e.button !== 0) {
1349
- return;
1350
- }
1351
- // e.preventDefault();
1352
- //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls
1353
- slider.controls.el.addClass('disabled');
1354
-
1355
- if (slider.working) {
1356
- e.preventDefault();
1357
- e.stopPropagation(); // for compatibility with WordPress themes
1358
- slider.controls.el.removeClass('disabled');
1359
- } else {
1360
- // record the original position when touch starts
1361
- slider.touch.originalPos = el.position();
1362
- var orig = e.originalEvent,
1363
- touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig];
1364
- var chromePointerEvents = typeof PointerEvent === 'function';
1365
- if (chromePointerEvents) { if (orig.pointerId === undefined) { return; } }
1366
- // record the starting touch x, y coordinates
1367
- slider.touch.start.x = touchPoints[0].pageX;
1368
- slider.touch.start.y = touchPoints[0].pageY;
1369
-
1370
- if (slider.viewport.get(0).setPointerCapture) {
1371
- slider.pointerId = orig.pointerId;
1372
- slider.viewport.get(0).setPointerCapture(slider.pointerId);
1373
- }
1374
- // store original event data for click fixation
1375
- slider.originalClickTarget = orig.originalTarget || orig.target;
1376
- slider.originalClickButton = orig.button;
1377
- slider.originalClickButtons = orig.buttons;
1378
- slider.originalEventType = orig.type;
1379
- // at this moment we don`t know what it is click or swipe
1380
- slider.hasMove = false;
1381
- // on a "touchmove" event to the viewport
1382
- slider.viewport.on('touchmove MSPointerMove pointermove', onTouchMove);
1383
- // on a "touchend" event to the viewport
1384
- slider.viewport.on('touchend MSPointerUp pointerup', onTouchEnd);
1385
- slider.viewport.on('MSPointerCancel pointercancel', onPointerCancel);
1386
- }
1387
- };
1388
-
1389
- /**
1390
- * Cancel Pointer for Windows Phone
1391
- *
1392
- * @param e (event)
1393
- * - DOM event object
1394
- */
1395
- var onPointerCancel = function (e) {
1396
- e.preventDefault();
1397
- /* onPointerCancel handler is needed to deal with situations when a touchend
1398
- doesn't fire after a touchstart (this happens on windows phones only) */
1399
- setPositionProperty(slider.touch.originalPos.left, 'reset', 0);
1400
-
1401
- //remove handlers
1402
- slider.controls.el.removeClass('disabled');
1403
- slider.viewport.off('MSPointerCancel pointercancel', onPointerCancel);
1404
- slider.viewport.off('touchmove MSPointerMove pointermove', onTouchMove);
1405
- slider.viewport.off('touchend MSPointerUp pointerup', onTouchEnd);
1406
- if (slider.viewport.get(0).releasePointerCapture) {
1407
- slider.viewport.get(0).releasePointerCapture(slider.pointerId);
1408
- }
1409
- };
1410
-
1411
- /**
1412
- * Event handler for "touchmove"
1413
- *
1414
- * @param e (event)
1415
- * - DOM event object
1416
- */
1417
- var onTouchMove = function (e) {
1418
- var orig = e.originalEvent,
1419
- touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],
1420
- // if scrolling on y axis, do not prevent default
1421
- xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x),
1422
- yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y),
1423
- value = 0,
1424
- change = 0;
1425
- // this is swipe
1426
- slider.hasMove = true;
1427
-
1428
- // x axis swipe
1429
- if ((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX) {
1430
- e.preventDefault();
1431
- e.stopPropagation(); // for compatibility with WordPress themes
1432
- // y axis swipe
1433
- } else if ((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY) {
1434
- e.preventDefault();
1435
- e.stopPropagation(); // for compatibility with WordPress themes
1436
- }
1437
- if (e.type !== 'touchmove') {
1438
- e.preventDefault();
1439
- }
1440
-
1441
- if (slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch) {
1442
- // if horizontal, drag along x axis
1443
- if (slider.settings.mode === 'horizontal') {
1444
- change = touchPoints[0].pageX - slider.touch.start.x;
1445
- value = slider.touch.originalPos.left + change;
1446
- // if vertical, drag along y axis
1447
- }
1448
- else {
1449
- change = touchPoints[0].pageY - slider.touch.start.y;
1450
- value = slider.touch.originalPos.top + change;
1451
- }
1452
- setPositionProperty(value, 'reset', 0);
1453
- }
1454
- };
1455
-
1456
- /**
1457
- * Event handler for "touchend"
1458
- *
1459
- * @param e (event)
1460
- * - DOM event object
1461
- */
1462
- var onTouchEnd = function (e) {
1463
- e.preventDefault();
1464
- slider.viewport.off('touchmove MSPointerMove pointermove', onTouchMove);
1465
- //enable slider controls as soon as user stops interacing with slides
1466
- slider.controls.el.removeClass('disabled');
1467
- var orig = e.originalEvent,
1468
- touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],
1469
- value = 0,
1470
- distance = 0;
1471
- // record end x, y positions
1472
- slider.touch.end.x = touchPoints[0].pageX;
1473
- slider.touch.end.y = touchPoints[0].pageY;
1474
- // if fade mode, check if absolute x distance clears the threshold
1475
- if (slider.settings.mode === 'fade') {
1476
- distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1477
- if (distance >= slider.settings.swipeThreshold) {
1478
- if (slider.touch.start.x > slider.touch.end.x) {
1479
- el.goToNextSlide();
1480
- } else {
1481
- el.goToPrevSlide();
1482
- }
1483
- el.stopAuto();
1484
- }
1485
- // not fade mode
1486
- } else {
1487
- // calculate distance and el's animate property
1488
- if (slider.settings.mode === 'horizontal') {
1489
- distance = slider.touch.end.x - slider.touch.start.x;
1490
- value = slider.touch.originalPos.left;
1491
- } else {
1492
- distance = slider.touch.end.y - slider.touch.start.y;
1493
- value = slider.touch.originalPos.top;
1494
- }
1495
-
1496
- // if not infinite loop and first / last slide, do not attempt a slide transition
1497
- if (!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))) {
1498
- setPositionProperty(value, 'reset', 200);
1499
- } else {
1500
- // check if distance clears threshold
1501
- if (Math.abs(distance) >= slider.settings.swipeThreshold) {
1502
- if (distance < 0) {
1503
- el.goToNextSlide();
1504
- } else {
1505
- el.goToPrevSlide();
1506
- }
1507
- el.stopAuto();
1508
- } else {
1509
- // el.animate(property, 200);
1510
- setPositionProperty(value, 'reset', 200);
1511
- }
1512
- }
1513
- }
1514
- slider.viewport.off('touchend MSPointerUp pointerup', onTouchEnd);
1515
- if (slider.viewport.get(0).releasePointerCapture) {
1516
- slider.viewport.get(0).releasePointerCapture(slider.pointerId);
1517
- }
1518
- // if slider had swipe with left mouse, touch contact and pen contact
1519
- if (slider.hasMove === false && (slider.originalClickButton === 0 || slider.originalEventType === 'touchstart')) {
1520
- // trigger click event (fix for Firefox59 and PointerEvent standard compatibility)
1521
- $(slider.originalClickTarget).trigger({
1522
- type: 'click',
1523
- button: slider.originalClickButton,
1524
- buttons: slider.originalClickButtons
1525
- });
1526
- }
1527
- };
1528
-
1529
- /**
1530
- * Window resize event callback
1531
- */
1532
- var resizeWindow = function (e) {
1533
- // don't do anything if slider isn't initialized.
1534
- if (!slider.initialized) {
1535
- if (slider.debug) console.log(slider.logAs, 'slider not initialized');
1536
- return;
1537
- }
1538
- // Delay if slider working.
1539
- if (slider.working) {
1540
- if (slider.debug) console.log(slider.logAs, 'slider working');
1541
- window.setTimeout(resizeWindow, 10);
1542
- } else {
1543
- // update all dynamic elements
1544
- el.redrawSlider();
1545
- // Call user resize handler
1546
- slider.settings.onSliderResize.call(el, slider.active.index);
1547
- }
1548
- };
1549
-
1550
- /**
1551
- * Adds an aria-hidden=true attribute to each element
1552
- *
1553
- * @param startVisibleIndex (int)
1554
- * - the first visible element's index
1555
- */
1556
- var applyAriaHiddenAttributes = function (startVisibleIndex) {
1557
- var numberOfSlidesShowing = getNumberSlidesShowing2();
1558
- // only apply attributes if the setting is enabled
1559
- if (slider.settings.ariaHidden) {
1560
- // add aria-hidden=true to all elements
1561
- slider.children.attr('aria-hidden', 'true');
1562
- // get the visible elements and change to aria-hidden=false
1563
- slider.children.slice(startVisibleIndex, startVisibleIndex + numberOfSlidesShowing).attr('aria-hidden', 'false');
1564
- }
1565
- };
1566
-
1567
- /**
1568
- * Returns index according to present page range
1569
- *
1570
- * @param slideIndex (int)
1571
- * - the desired slide index
1572
- */
1573
- var setSlideIndex = function (slideIndex) {
1574
- if (slideIndex < 0) {
1575
- if (slider.settings.infiniteLoop) {
1576
- return getPagerQty() - 1;
1577
- }
1578
- else {
1579
- //we don't go to undefined slides
1580
- return slider.active.index;
1581
- }
1582
- // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
1583
- } else if (slideIndex >= getPagerQty()) {
1584
- if (slider.settings.infiniteLoop) {
1585
- return 0;
1586
- } else {
1587
- //we don't move to undefined pages
1588
- return slider.active.index;
1589
- }
1590
- // set active index to requested slide
1591
- } else {
1592
- return slideIndex;
1593
- }
1594
- };
1595
-
1596
- /**
1597
- * ===================================================================================
1598
- * = PUBLIC FUNCTIONS
1599
- * ===================================================================================
1600
- */
1601
-
1602
- /**
1603
- * Performs slide transition to the specified slide
1604
- *
1605
- * @param slideIndex (int)
1606
- * - the destination slide's index (zero-based)
1607
- *
1608
- * @param direction (string)
1609
- * - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1610
- */
1611
- el.goToSlide = function (slideIndex, direction) {
1612
- // onSlideBefore, onSlideNext, onSlidePrev callbacks
1613
- // Allow transition canceling based on returned value
1614
- var performTransition = true,
1615
- moveBy = 0,
1616
- position = {left: 0, top: 0},
1617
- lastChild = null,
1618
- lastShowingIndex, eq, value, requestEl;
1619
- // store the old index
1620
- slider.oldIndex = slider.active.index;
1621
- //set new index
1622
- slider.active.index = setSlideIndex(slideIndex);
1623
-
1624
- // if plugin is currently in motion, ignore request
1625
- if (slider.working || slider.active.index === slider.oldIndex) {
1626
- return;
1627
- }
1628
- // declare that plugin is in motion
1629
- slider.working = true;
1630
-
1631
- performTransition = slider.settings.onSlideBefore.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1632
-
1633
- // If transitions canceled, reset and return
1634
- if (typeof (performTransition) !== 'undefined' && !performTransition) {
1635
- slider.active.index = slider.oldIndex; // restore old index
1636
- slider.working = false; // is not in motion
1637
- return;
1638
- }
1639
-
1640
- if (direction === 'next') {
1641
- // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
1642
- if (!slider.settings.onSlideNext.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {
1643
- performTransition = false;
1644
- }
1645
- }
1646
- else if (direction === 'prev') {
1647
- // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
1648
- if (!slider.settings.onSlidePrev.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {
1649
- performTransition = false;
1650
- }
1651
- }
1652
-
1653
- // check if last slide
1654
- slider.active.last = slider.active.index >= getPagerQty() - 1;
1655
-
1656
- // update the pager with active class
1657
- if (slider.settings.pager || slider.settings.pagerCustom) {
1658
- updatePagerActive(slider.active.index);
1659
- }
1660
-
1661
- // // check for direction control update
1662
- if (slider.settings.controls) { updateDirectionControls(); }
1663
- // if slider is set to mode: "fade"
1664
- if (slider.settings.mode === 'fade') {
1665
-
1666
- // if adaptiveHeight is true and next height is different from current height, animate to the new height
1667
- if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {
1668
- slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1669
- }
1670
-
1671
- // fade out the visible child and reset its z-index value
1672
- slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
1673
-
1674
- // fade in the newly requested slide
1675
- slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex + 1).fadeIn(slider.settings.speed, function () {
1676
- $(this).css('zIndex', slider.settings.slideZIndex);
1677
- updateAfterSlideTransition();
1678
- });
1679
-
1680
- // slider mode is not "fade"
1681
- } else {
1682
-
1683
- // if adaptiveHeight is true and next height is different from current height, animate to the new height
1684
- if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {
1685
- slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1686
- }
1687
-
1688
- // if carousel and not infinite loop
1689
- if (!slider.settings.infiniteLoop && slider.carousel && slider.active.last) {
1690
-
1691
- if (slider.settings.mode === 'horizontal') {
1692
- // get the last child position
1693
- lastChild = slider.children.eq(slider.children.length - 1);
1694
- position = lastChild.position();
1695
- // calculate the position of the last slide
1696
- moveBy = slider.viewport.width() - lastChild.outerWidth();
1697
- }
1698
- else {
1699
- // get last showing index position
1700
- lastShowingIndex = slider.children.length - slider.settings.minSlides;
1701
- position = slider.children.eq(lastShowingIndex).position();
1702
- }
1703
-
1704
- // horizontal carousel, going previous while on first slide (infiniteLoop mode)
1705
- } else if (slider.carousel && slider.active.last && direction === 'prev') {
1706
-
1707
- // get the last child position
1708
- eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
1709
- lastChild = el.children('.wpmslider-clone').eq(eq);
1710
- position = lastChild.position();
1711
-
1712
- // if infinite loop and "Next" is clicked on the last slide
1713
- } else if (direction === 'next' && slider.active.index === 0) {
1714
-
1715
- // get the last clone position
1716
- position = el.find('> .wpmslider-clone').eq(slider.settings.maxSlides).position();
1717
- slider.active.last = false;
1718
-
1719
- // normal non-zero requests
1720
- } else if (slideIndex >= 0) {
1721
-
1722
- //parseInt is applied to allow floats for slides/page
1723
- requestEl = slideIndex * parseInt(getMoveBy());
1724
- position = slider.children.eq(requestEl).position();
1725
-
1726
- }
1727
-
1728
- /* If the position doesn't exist
1729
- * (e.g. if you destroy the slider on a next click),
1730
- * it doesn't throw an error.
1731
- */
1732
- if (typeof (position) !== 'undefined') {
1733
- value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top;
1734
- // plugin values to be animated
1735
- setPositionProperty(value, 'slide', slider.settings.speed);
1736
-
1737
- }
1738
- slider.working = false;
1739
-
1740
- }
1741
-
1742
- if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); }
1743
- };
1744
-
1745
- /**
1746
- * Transitions to the next slide in the show
1747
- */
1748
- el.goToNextSlide = function () {
1749
- // if infiniteLoop is false and last page is showing, disregard call
1750
- if (!slider.settings.infiniteLoop && slider.active.last) { return; }
1751
- if (slider.working === true){ return ; }
1752
- var pagerIndex = parseInt(slider.active.index) + 1;
1753
- el.goToSlide(pagerIndex, 'next');
1754
- };
1755
-
1756
- /**
1757
- * Transitions to the prev slide in the show
1758
- */
1759
- el.goToPrevSlide = function () {
1760
- // if infiniteLoop is false and last page is showing, disregard call
1761
- if (!slider.settings.infiniteLoop && slider.active.index === 0) { return; }
1762
- if (slider.working === true){ return ;}
1763
- var pagerIndex = parseInt(slider.active.index) - 1;
1764
- el.goToSlide(pagerIndex, 'prev');
1765
- };
1766
-
1767
- /**
1768
- * Starts the auto show
1769
- *
1770
- * @param preventControlUpdate (boolean)
1771
- * - if true, auto controls state will not be updated
1772
- */
1773
- el.startAuto = function (preventControlUpdate) {
1774
- // if an interval already exists, disregard call
1775
- if (slider.interval) {
1776
- return;
1777
- }
1778
-
1779
- // create an interval
1780
- slider.interval = setInterval(function () {
1781
- if (slider.settings.autoDirection === 'next') {
1782
- el.goToNextSlide();
1783
- }
1784
- else {
1785
- el.goToPrevSlide();
1786
- }
1787
- }, slider.settings.pause);
1788
- // callback for when the auto rotate status changes
1789
- slider.settings.onAutoChange.call(el, true);
1790
- // if auto controls are displayed and preventControlUpdate is not true
1791
- if (slider.settings.autoControls && preventControlUpdate !== true) {
1792
- updateAutoControls('stop');
1793
- }
1794
- };
1795
-
1796
- /**
1797
- * Stops the auto show
1798
- *
1799
- * @param preventControlUpdate (boolean)
1800
- * - if true, auto controls state will not be updated
1801
- */
1802
- el.stopAuto = function (preventControlUpdate) {
1803
- // if slider is auto paused, just clear that state
1804
- if (slider.autoPaused) slider.autoPaused = false;
1805
- // if no interval exists, disregard call
1806
- if (!slider.interval) { return; }
1807
- // clear the interval
1808
- clearInterval(slider.interval);
1809
- slider.interval = null;
1810
- // callback for when the auto rotate status changes
1811
- slider.settings.onAutoChange.call(el, false);
1812
- // if auto controls are displayed and preventControlUpdate is not true
1813
- if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('start'); }
1814
- //clearInterval(el.visibilityInterval);
1815
- };
1816
-
1817
- /**
1818
- * Returns current slide index (zero-based)
1819
- */
1820
- el.getCurrentSlide = function () {
1821
- return slider.active.index;
1822
- };
1823
-
1824
- /**
1825
- * Returns current slide element
1826
- */
1827
- el.getCurrentSlideElement = function () {
1828
- return slider.children.eq(slider.active.index);
1829
- };
1830
-
1831
- /**
1832
- * Returns a slide element
1833
- * @param index (int)
1834
- * - The index (zero-based) of the element you want returned.
1835
- */
1836
- el.getSlideElement = function (index) {
1837
- return slider.children.eq(index);
1838
- };
1839
-
1840
- /**
1841
- * Returns number of slides in show
1842
- */
1843
- el.getSlideCount = function () {
1844
- return slider.children.length;
1845
- };
1846
-
1847
- /**
1848
- * Return slider.working variable
1849
- */
1850
- el.isWorking = function () {
1851
- return slider.working;
1852
- };
1853
-
1854
- /**
1855
- * Update all dynamic slider elements
1856
- */
1857
- el.redrawSlider = function () {
1858
- if (slider.debug) console.log(slider.logAs, 'redrawSlider');
1859
-
1860
- // maybe set/revert carousel
1861
- updateWidth();
1862
-
1863
- // adjust the height
1864
- unsetSlideHeight();
1865
- setViewportHeight();
1866
-
1867
- // if stretch, set t-slide height to 100%
1868
- if (slider.settings.stretch) {
1869
- setSlideHeight();
1870
- }
1871
-
1872
- // resize all children in ratio to new screen size
1873
- slider.children.add(el.find('.wpmslider-clone')).outerWidth(getSlideWidth2());
1874
-
1875
- // update the slide position
1876
- setSlidePosition();
1877
-
1878
- // if active.last was true before the screen resize, we want
1879
- // to keep it last no matter what screen size we end on
1880
- if (slider.active.last) {
1881
- slider.active.index = getPagerQty() - 1;
1882
- }
1883
-
1884
- // if the active index (page) no longer exists due to the resize, simply set the index as last
1885
- if (slider.active.index >= getPagerQty()) {
1886
- slider.active.last = true;
1887
- }
1888
-
1889
- // if a pager is being displayed and a custom pager is not being used, update it
1890
- if (slider.settings.pager && !slider.settings.pagerCustom) {
1891
- populatePager();
1892
- updatePagerActive(slider.active.index);
1893
- }
1894
-
1895
- if (slider.settings.ariaHidden) {
1896
- applyAriaHiddenAttributes(slider.active.index * getMoveBy());
1897
- }
1898
- };
1899
-
1900
- /**
1901
- * Destroy the current instance of the slider (revert everything back to original state)
1902
- */
1903
- el.destroySlider = function () {
1904
- // don't do anything if slider has already been destroyed
1905
- if (!slider.initialized) {
1906
- return;
1907
- }
1908
- slider.initialized = false;
1909
- $('.wpmslider-clone', this).remove();
1910
-
1911
- slider.children.each(function () {
1912
- if ($(this).data('origStyle') !== undefined) {
1913
- $(this).attr('style', $(this).data('origStyle'));
1914
- } else {
1915
- $(this).removeAttr('style');
1916
- }
1917
- });
1918
-
1919
- if ($(this).data('origStyle') !== undefined) {
1920
- this.attr('style', $(this).data('origStyle'));
1921
- } else {
1922
- $(this).removeAttr('style');
1923
- }
1924
-
1925
- $(this).unwrap().unwrap();
1926
-
1927
- if (slider.controls.el) {
1928
- slider.controls.el.remove();
1929
- }
1930
- if (slider.controls.next) {
1931
- slider.controls.next.remove();
1932
- }
1933
- if (slider.controls.prev) {
1934
- slider.controls.prev.remove();
1935
- }
1936
- if (slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom) { slider.pagerEl.remove(); }
1937
-
1938
- $('.wpmslider-caption', this).remove();
1939
-
1940
- if (slider.controls.autoEl) {
1941
- slider.controls.autoEl.remove();
1942
- }
1943
-
1944
- clearInterval(slider.interval);
1945
- clearInterval(slider.visibilityInterval);
1946
-
1947
- if (slider.settings.responsive) {
1948
- $(window).off('resize', resizeWindow);
1949
- }
1950
-
1951
- if (slider.settings.keyboardEnabled) {
1952
- $(document).off('keydown', keyPress);
1953
- }
1954
-
1955
- //remove self reference in data
1956
- $(this).removeData('strongSlider');
1957
- };
1958
-
1959
- /**
1960
- * Reload the slider (revert all DOM changes, and re-initialize)
1961
- */
1962
- el.reloadSlider = function (settings) {
1963
- if (settings !== undefined) {
1964
- options = settings;
1965
- }
1966
- el.destroySlider();
1967
- init();
1968
- // store reference to self in order to access public functions later
1969
- $(el).data('strongSlider', this);
1970
- };
1971
-
1972
- // Fire it up!
1973
- init();
1974
-
1975
- // Store reference to self in order to access public functions later
1976
- $(el).data('strongSlider', this);
1977
-
1978
- // Set initialized flag on container
1979
- viewEl.attr('data-state', 'init');
1980
-
1981
- if (slider.debug) console.log(slider.logAs, 'viewport', verge.viewportW(), 'x', verge.viewportH());
1982
-
1983
- // returns the current jQuery object
1984
- return this;
1985
- };
1986
-
1987
- })(jQuery);
 
 
 
16
 
17
  ;(function ($) {
18
 
19
+ var defaults = {
20
+ debug: false,
21
+ logAs: 'strongSlider',
22
+ compat: {
23
+ lazyload: {
24
+ active: false,
25
+ classes: {}
26
+ }
27
+ },
28
+
29
+ // GENERAL
30
+ mode: 'horizontal',
31
+ slideSelector: 'div.t-slide',
32
+ infiniteLoop: true,
33
+ hideControlOnEnd: false,
34
+ speed: 500,
35
+ easing: null,
36
+ slideMargin: 10,
37
+ startSlide: 0,
38
+ randomStart: false,
39
+ captions: false,
40
+ adaptiveHeight: false,
41
+ adaptiveHeightSpeed: 500,
42
+ video: false,
43
+ useCSS: true,
44
+ preloadImages: 'visible',
45
+ responsive: true,
46
+ slideZIndex: 50,
47
+ wrapperClass: 'wpmslider-wrapper',
48
+ stretch: false,
49
+ imagesLoaded: true,
50
+
51
+ // TOUCH
52
+ touchEnabled: true,
53
+ swipeThreshold: 50,
54
+ oneToOneTouch: true,
55
+ preventDefaultSwipeX: true,
56
+ preventDefaultSwipeY: false,
57
+
58
+ // ACCESSIBILITY
59
+ ariaLive: true,
60
+ ariaHidden: true,
61
+
62
+ // KEYBOARD
63
+ keyboardEnabled: false,
64
+
65
+ // PAGER
66
+ pager: true,
67
+ pagerType: 'full',
68
+ pagerShortSeparator: ' / ',
69
+ pagerSelector: null,
70
+ buildPager: null,
71
+ pagerCustom: null,
72
+
73
+ // CONTROLS
74
+ controls: true,
75
+ nextText: 'Next',
76
+ prevText: 'Prev',
77
+ nextSelector: null,
78
+ prevSelector: null,
79
+ autoControls: false,
80
+ startText: 'Start',
81
+ stopText: 'Stop',
82
+ autoControlsCombine: false,
83
+ autoControlsSelector: null,
84
+
85
+ // AUTO
86
+ auto: true,
87
+ pause: 4000,
88
+ autoStart: true,
89
+ autoDirection: 'next',
90
+ stopAutoOnClick: false,
91
+ autoHover: false,
92
+ autoDelay: 0,
93
+ autoSlideForOnePage: false,
94
+
95
+ // CAROUSEL
96
+ minSlides: 1,
97
+ maxSlides: 1,
98
+ moveSlides: 0,
99
+
100
+ // CALLBACKS
101
+ onSliderLoad: function () { return true; },
102
+ onSlideBefore: function () { return true; },
103
+ onSlideAfter: function () { return true; },
104
+ onSlideNext: function () { return true; },
105
+ onSlidePrev: function () { return true; },
106
+ onSliderResize: function() { return true; },
107
+ onAutoChange: function() { return true; } //calls when auto slides starts and stops
108
+ };
109
+
110
+ $.fn.strongSlider = function (options) {
111
+
112
+ if (this.length === 0) {
113
+ return this;
114
+ }
115
+
116
+ // create a namespace to be used throughout the plugin
117
+ var slider = {},
118
+ // set a reference to our slider element
119
+ viewEl = this,
120
+ el = this.find('.wpmslider-content');
121
+
122
+ // Return if slider is already initialized
123
+ if ($(el).data('strongSlider')) { return; }
124
+
125
+ /**
126
+ * ===================================================================================
127
+ * = PRIVATE FUNCTIONS
128
+ * ===================================================================================
129
+ */
130
+
131
+ /**
132
+ * Initializes namespace settings to be used throughout plugin
133
+ */
134
+ var init = function () {
135
+ // Return if slider is already initialized
136
+ if ($(el).data('strongSlider')) { return; }
137
+
138
+ // timer to check visibility; used to control sliders in hidden tabs
139
+ slider.visibilityInterval = 0;
140
+ // slider state
141
+ slider.hidden = false;
142
+
143
+ // merge user-supplied options with the defaults
144
+ var sliderVar = viewEl.data('slider-var');
145
+ var config = {};
146
+ if (typeof(window[sliderVar]) !== 'undefined') {
147
+ config = window[sliderVar].config;
148
+ }
149
+
150
+ slider.settings = $.extend({}, defaults, config, options);
151
+ slider.debug = slider.settings.debug;
152
+ slider.logAs = slider.settings.logAs;
153
+
154
+ if (slider.debug) console.log(slider.logAs, 'slider.settings', slider.settings);
155
+
156
+ // store the original children
157
+ slider.children = el.children(slider.settings.slideSelector);
158
+
159
+ // check if actual number of slides is less than minSlides / maxSlides
160
+ if (slider.children.length < slider.settings.minSlides) {
161
+ slider.settings.minSlides = slider.children.length;
162
+ }
163
+ if (slider.children.length < slider.settings.maxSlides) {
164
+ slider.settings.maxSlides = slider.children.length;
165
+ }
166
+
167
+ // if random start, set the startSlide setting to random number
168
+ if (slider.settings.randomStart) {
169
+ slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
170
+ }
171
+
172
+ // store active slide information
173
+ slider.active = {index: slider.settings.startSlide};
174
+
175
+ // store if the slider is in carousel mode (displaying / moving multiple slides)
176
+ setBreakpoint();
177
+ // slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
178
+
179
+ // if carousel, force preloadImages = 'all'
180
+ if (slider.carousel) {
181
+ slider.settings.preloadImages = 'all';
182
+ }
183
+
184
+ // store the current state of the slider (if currently animating, working is true)
185
+ slider.working = false;
186
+
187
+ // initialize the controls object
188
+ slider.controls = {};
189
+
190
+ // initialize an auto interval (no interval = is paused or waiting for user to start)
191
+ slider.interval = null;
192
+
193
+ // determine which property to use for transitions
194
+ slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left';
195
+
196
+ // determine if hardware acceleration can be used
197
+ slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function () {
198
+ // create our test div element
199
+ var div = document.createElement('div'),
200
+ // css transition properties
201
+ props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
202
+ // test for each property
203
+ for (var i = 0; i < props.length; i++) {
204
+ if (div.style[props[i]] !== undefined) {
205
+ slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
206
+ slider.animProp = '-' + slider.cssPrefix + '-transform';
207
+ return true;
208
+ }
209
+ }
210
+ return false;
211
+ }());
212
+
213
+ // if vertical mode always make maxSlides and minSlides equal
214
+ if (slider.settings.mode === 'vertical') {
215
+ slider.settings.maxSlides = slider.settings.minSlides;
216
+ }
217
+ // save original style data
218
+ el.data('origStyle', el.attr('style'));
219
+ el.children(slider.settings.slideSelector).each(function () {
220
+ $(this).data('origStyle', $(this).attr('style'));
221
+ });
222
+
223
+ // Bail if no slides
224
+ if (!el.getSlideCount()) { return; }
225
+
226
+ // Wait for images loaded
227
+ if (slider.settings.imagesLoaded) {
228
+ viewEl.imagesLoaded(function () { initVisibilityCheck(); });
229
+ } else {
230
+ initVisibilityCheck();
231
+ }
232
+
233
+ };
234
+
235
+ /**
236
+ * Primary
237
+ *
238
+ * @returns {boolean}
239
+ */
240
+ var reallyVisible = function () {
241
+ return (viewEl.is(':visible') && viewEl.css('visibility') !== 'hidden');
242
+ };
243
+
244
+ /**
245
+ * Secondary
246
+ *
247
+ * @returns {boolean}
248
+ */
249
+ var compatCheck = function () {
250
+ if (slider.settings.compat.lazyload) {
251
+
252
+ var inProgress = false;
253
+ for (var i = 0, len = slider.settings.compat.lazyload.classes.length; i < len; i++) {
254
+
255
+ var startClass = slider.settings.compat.lazyload.classes[i].start;
256
+ var finishClass = slider.settings.compat.lazyload.classes[i].finish;
257
+
258
+ if (startClass && finishClass) {
259
+ if (viewEl.find('img.' + startClass).length && !viewEl.find('img.' + finishClass).length) {
260
+ inProgress = true;
261
+ }
262
+ } else if (startClass) {
263
+ if (viewEl.find('img.' + startClass).length) {
264
+ inProgress = true;
265
+ }
266
+ } else if (finishClass) {
267
+ if (!viewEl.find('img.' + finishClass).length) {
268
+ inProgress = true;
269
+ }
270
+ }
271
+
272
+ }
273
+
274
+ if (inProgress) {
275
+ if (slider.debug) console.log(slider.logAs, 'lazy loading...');
276
+ return false;
277
+ }
278
+
279
+ }
280
+
281
+ if (slider.debug) console.log(slider.logAs, 'compat check complete');
282
+ return true;
283
+ };
284
+
285
+ /**
286
+ * Check visibility and lazy load status.
287
+ */
288
+ var initVisibilityCheck = function () {
289
+ if (reallyVisible() && compatCheck()) {
290
+
291
+ clearInterval(slider.visibilityInterval);
292
+
293
+ // perform all DOM / CSS modifications
294
+ setup();
295
+
296
+ } else {
297
+
298
+ if (slider.visibilityInterval === 0) {
299
+ slider.visibilityInterval = setInterval(initVisibilityCheck, 1000 * 4);
300
+ }
301
+
302
+ }
303
+ };
304
+
305
+ /**
306
+ * Performs all DOM and CSS modifications
307
+ */
308
+ var setup = function () {
309
+ var preloadSelector = slider.children.eq(slider.settings.startSlide); // set the default preload selector (visible)
310
+
311
+ // wrap el in a wrapper
312
+ el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="wpmslider-viewport"></div></div>');
313
+
314
+ // store a namespace reference to .wpmslider-viewport
315
+ slider.viewport = el.parent();
316
+
317
+ // add aria-live if the setting is enabled
318
+ if (slider.settings.ariaLive) {
319
+ slider.viewport.attr('aria-live', 'polite');
320
+ }
321
+
322
+ // add a loading div to display while images are loading
323
+ slider.loader = $('<div class="wpmslider-loading" />');
324
+ slider.viewport.prepend(slider.loader);
325
+
326
+ // set el to a massive width, to hold any needed slides
327
+ // also strip any margin and padding from el
328
+ el.css({
329
+ width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto',
330
+ position: 'relative'
331
+ });
332
+
333
+ // if using CSS, add the easing property
334
+ if (slider.usingCSS && slider.settings.easing) {
335
+ el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
336
+ // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
337
+ } else if (!slider.settings.easing) {
338
+ slider.settings.easing = 'swing';
339
+ }
340
+ // make modifications to the viewport (.wpmslider-viewport)
341
+ slider.viewport.css({
342
+ width: '100%',
343
+ overflow: 'hidden',
344
+ position: 'relative'
345
+ });
346
+
347
+ slider.viewport.parent().css({
348
+ maxWidth: getViewportMaxWidth2()
349
+ });
350
+
351
+ // make modification to the wrapper (.wpmslider-wrapper)
352
+ if (!slider.settings.pager && !slider.settings.controls) {
353
+ slider.viewport.parent().css({ margin: '0 auto' });
354
+ }
355
+
356
+ // apply css to all slider children
357
+ slider.children.css({
358
+ // the float attribute is a reserved word in compressors like YUI compressor and need to be quoted #48
359
+ 'float': slider.settings.mode === 'horizontal' ? 'left' : 'none',
360
+ listStyle: 'none',
361
+ position: 'relative'
362
+ });
363
+
364
+ // apply the calculated width after the float is applied to prevent scrollbar interference
365
+ updateWidth();
366
+
367
+ // if slideMargin is supplied, add the css
368
+ if (slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0) {
369
+ slider.children.css('marginRight', slider.settings.slideMargin);
370
+ }
371
+ if (slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0) {
372
+ slider.children.css('marginBottom', slider.settings.slideMargin);
373
+ }
374
+
375
+ // if "fade" mode, add positioning and z-index CSS
376
+ if (slider.settings.mode === 'fade') {
377
+ slider.children.css({
378
+ position: 'absolute',
379
+ zIndex: 0,
380
+ display: 'none'
381
+ });
382
+ // prepare the z-index on the showing element
383
+ slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
384
+ } else {
385
+ slider.children.css({
386
+ display: 'block'
387
+ });
388
+ }
389
+
390
+ // create an element to contain all slider controls (pager, start / stop, etc)
391
+ slider.controls.el = $('<div class="wpmslider-controls" />');
392
+ // if captions are requested, add them
393
+ if (slider.settings.captions) {
394
+ appendCaptions();
395
+ }
396
+ // check if startSlide is last slide
397
+ slider.active.last = slider.settings.startSlide === getPagerQty() - 1;
398
+ // if video is true, set up the fitVids plugin
399
+ if (slider.settings.video) { el.fitVids(); }
400
+
401
+ //preloadImages
402
+ if (slider.settings.preloadImages === 'none') {
403
+ preloadSelector = null;
404
+ } else if (slider.settings.preloadImages === 'all') {
405
+ preloadSelector = slider.children;
406
+ }
407
+
408
+ // add separate control divs
409
+ // [ LEFT ]
410
+ // if controls are requested, add them
411
+ if (slider.settings.controls) { appendControlPrev(); }
412
+ // [ MIDDLE ]
413
+ // if auto is true, and auto controls are requested, add them
414
+ if (slider.settings.auto && slider.settings.autoControls) { appendControlsAuto(); }
415
+ // if pager is requested, add it
416
+ if (slider.settings.pager) { appendPager(); }
417
+ // [ RIGHT ]
418
+ if (slider.settings.controls) { appendControlNext(); }
419
+
420
+ // if any control option is requested, add the controls wrapper
421
+ if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) { slider.viewport.after(slider.controls.el); }
422
+
423
+ if (preloadSelector === null) {
424
+ start();
425
+ } else {
426
+ loadElements(preloadSelector, start);
427
+ }
428
+ };
429
+
430
+ /**
431
+ *
432
+ */
433
+ var setBreakpoint = function () {
434
+ if (slider.debug) console.log(slider.logAs, 'setBreakpoint');
435
+
436
+ // fallback
437
+ var currentBreakpoint = slider.settings.breakpoints.single;
438
+ var breakpoints = slider.settings.breakpoints.multiple;
439
+
440
+ if (slider.settings.type === 'show_multiple') {
441
+
442
+ for (var key in breakpoints) {
443
+ if (breakpoints.hasOwnProperty(key)) {
444
+ if (verge.viewportW() >= breakpoints[key].width) {
445
+ currentBreakpoint = breakpoints[key];
446
+ break;
447
+ }
448
+ }
449
+ }
450
+
451
+ }
452
+
453
+ if (slider.debug) console.log('current breakpoint', currentBreakpoint);
454
+
455
+ slider.settings.maxSlides = currentBreakpoint.maxSlides;
456
+ slider.settings.moveSlides = currentBreakpoint.moveSlides;
457
+ slider.settings.slideMargin = currentBreakpoint.slideMargin;
458
+
459
+ slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
460
+ };
461
+
462
+ /**
463
+ *
464
+ */
465
+ var updateWidth = function () {
466
+ setBreakpoint();
467
+ slider.children.css('width', getSlideWidth2());
468
+ };
469
+
470
+ /**
471
+ *
472
+ * @param selector
473
+ * @param callback
474
+ */
475
+ var loadElements = function(selector, callback) {
476
+ var total = selector.find('img:not([src=""]), iframe').length,
477
+ count = 0;
478
+ if (total === 0) {
479
+ callback();
480
+ return;
481
+ }
482
+ selector.find('img:not([src=""]), iframe').each(function() {
483
+ $(this).one('load error', function() {
484
+ if (++count === total) { callback(); }
485
+ }).each(function() {
486
+ if (this.complete || this.src === '') { $(this).trigger('load'); }
487
+ });
488
+ });
489
+ };
490
+
491
+ /**
492
+ * Start the slider
493
+ */
494
+ var start = function () {
495
+
496
+ // if infinite loop, prepare additional slides
497
+ if (slider.settings.infiniteLoop && slider.settings.mode !== 'fade') {
498
+ var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides,
499
+ sliceAppend = slider.children.slice(0, slice).clone(true).addClass('wpmslider-clone'),
500
+ slicePrepend = slider.children.slice(-slice).clone(true).addClass('wpmslider-clone');
501
+ if (slider.settings.ariaHidden) {
502
+ sliceAppend.attr('aria-hidden', true);
503
+ slicePrepend.attr('aria-hidden', true);
504
+ }
505
+
506
+ el.append(sliceAppend).prepend(slicePrepend);
507
+ }
508
+
509
+ // remove the loading DOM element
510
+ slider.loader.remove();
511
+
512
+ // set the left / top position of "el"
513
+ // setSlidePosition();
514
+
515
+ // if "vertical" mode, always use adaptiveHeight to prevent odd behavior
516
+ if (slider.settings.mode === 'vertical') {
517
+ slider.settings.adaptiveHeight = true;
518
+ }
519
+
520
+ // set the viewport height
521
+ // setViewportHeight();
522
+
523
+ // if stretch, set t-slide height to 100%
524
+ // if (slider.settings.stretch) {
525
+ // setSlideHeight();
526
+ // }
527
+
528
+ // make sure everything is positioned just right (same as a window resize)
529
+ el.redrawSlider();
530
+
531
+ // onSliderLoad callback
532
+ slider.settings.onSliderLoad.call(el, slider.active.index);
533
+
534
+ // slider has been fully initialized
535
+ slider.initialized = true;
536
+ slider.visibilityInterval = setInterval(visibilityCheck, 500);
537
+
538
+ if (slider.settings.responsive) { attachListeners(); }
539
+
540
+ // if auto is true and has more than 1 page, start the show
541
+ if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) { initAuto(); }
542
+
543
+ // if pager is requested, make the appropriate pager link active
544
+ if (slider.settings.pager) {
545
+ updatePagerActive(slider.settings.startSlide);
546
+ }
547
+
548
+ // check for any updates to the controls (like hideControlOnEnd updates)
549
+ if (slider.settings.controls) {
550
+ updateDirectionControls();
551
+ }
552
+
553
+ // if touchEnabled is true, setup the touch events
554
+ if (slider.settings.touchEnabled) { initTouch(); }
555
+
556
+ // if keyboardEnabled is true, setup the keyboard events
557
+ if (slider.settings.keyboardEnabled) {
558
+ $(document).keydown(keyPress);
559
+ }
560
+ };
561
+
562
+ /**
563
+ * ==============================================================
564
+ * EVENTS
565
+ *
566
+ * Pause/play actions are coupled by method. The slider can only
567
+ * be restarted by the partner of the mechanism that paused it.
568
+ * For example, a slider paused by switching windows (blur) will
569
+ * only restart upon switching back (focus).
570
+ *
571
+ * Event : Action : Function
572
+ * ------------------------------:------------:-------------------
573
+ * hide/show (ex: tabbed pages) : pause/play : visibilityCheck
574
+ * scroll out/in of viewport : pause/play : visibilityCheck
575
+ * hover in/out : pause/play : initAuto
576
+ * blur/focus : pause/play : attachListeners
577
+ * resize and orientation change : redraw : attachListeners
578
+ * ==============================================================
579
+ */
580
+
581
+ /**
582
+ * Window event listeners.
583
+ *
584
+ * Not checking inViewport on scroll event because we also check that
585
+ * in the general visibility check.
586
+ */
587
+ var attachListeners = function () {
588
+
589
+ window.addEventListener('resize', updateLayout, false);
590
+ window.addEventListener('orientationchange', updateLayout, false);
591
+ window.addEventListener('toggleFullContent', updateLayout, false);
592
+
593
+ // Test this with dev console closed
594
+ // (or click in the document once to establish focus).
595
+ window.addEventListener('blur', function () {
596
+ pauseEvent('blur');
597
+ });
598
+
599
+ window.addEventListener('focus', function () {
600
+ playEvent('blur');
601
+ });
602
+
603
+ };
604
+
605
+ // Debounced resize event.
606
+ var updateLayout = _.debounce(function () {
607
+ if (slider.debug) console.log(slider.logAs, 'updateLayout');
608
+ resizeWindow();
609
+ }, 250);
610
+
611
+ // General visibility check.
612
+ var visibilityCheck = function () {
613
+ if (!slider.settings.auto) {
614
+ return;
615
+ }
616
+
617
+ if (!reallyVisible()) {
618
+ pauseEvent('hide');
619
+ } else {
620
+ playEvent('hide');
621
+ }
622
+
623
+ if (!verge.inViewport(el)) {
624
+ pauseEvent('scroll');
625
+ } else {
626
+ playEvent('scroll');
627
+ }
628
+ };
629
+
630
+ var pauseEvent = function (action) {
631
+ // if the auto show is currently playing (has an active interval)
632
+ if (slider.interval) {
633
+ // stop the auto show and pass true argument which will prevent control update
634
+ el.stopAuto(true);
635
+ // create a new autoPaused value which will be used by the corresponding event
636
+ slider.autoPaused = action;
637
+ if (slider.debug) console.log(slider.logAs, 'pause', action);
638
+ }
639
+ };
640
+
641
+ var playEvent = function (action) {
642
+ // if the autoPaused value was created by the prior event
643
+ if (slider.autoPaused === action) {
644
+ // start the auto show and pass true argument which will prevent control update
645
+ el.startAuto(true);
646
+ // reset the autoPaused value
647
+ slider.autoPaused = null;
648
+ if (slider.debug) console.log(slider.logAs, 'play', action);
649
+ }
650
+ };
651
+
652
+ /**
653
+ *
654
+ */
655
+ var setSlideHeight = function () {
656
+ var heights = slider.children.map(function () {
657
+ return jQuery(this).actual('outerHeight');
658
+ }).get();
659
+
660
+ var maxHeight = arrayMax(heights);
661
+ slider.children.height(maxHeight);
662
+ };
663
+
664
+ /**
665
+ *
666
+ */
667
+ var unsetSlideHeight = function () {
668
+ slider.children.height('auto');
669
+ };
670
+
671
+ // Function to get the max value in array
672
+ var arrayMax = function (array) {
673
+ return Math.max.apply(Math, array);
674
+ };
675
+
676
+ /**
677
+ * Returns the calculated height of the SLIDER viewport (not browser viewport),
678
+ * used to determine either adaptiveHeight or the maxHeight value
679
+ */
680
+ var getViewportHeight = function () {
681
+
682
+ var height = 0;
683
+
684
+ // first determine which children (slides) should be used in our height calculation
685
+ var children = $();
686
+
687
+ // if mode is not "vertical" and adaptiveHeight is false, include all children
688
+ if (slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight) {
689
+
690
+ children = slider.children;
691
+
692
+ } else {
693
+
694
+ // if not carousel, return the single active child
695
+ if (!slider.carousel) {
696
+
697
+ children = slider.children.eq(slider.active.index);
698
+
699
+ } else {
700
+
701
+ // if carousel, return a slice of children
702
+
703
+ // get the individual slide index
704
+ var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy();
705
+
706
+ // add the current slide to the children
707
+ children = slider.children.eq(currentIndex);
708
+
709
+ // cycle through the remaining "showing" slides
710
+ for (var i = 1; i <= slider.settings.maxSlides - 1; i++) {
711
+
712
+ // if looped back to the start
713
+ if (currentIndex + i >= slider.children.length) {
714
+ children = children.add(slider.children.eq(i - 1));
715
+ } else {
716
+ children = children.add(slider.children.eq(currentIndex + i));
717
+ }
718
+
719
+ }
720
+
721
+ }
722
+
723
+ }
724
+
725
+ // if "vertical" mode, calculate the sum of the heights of the children
726
+ if (slider.settings.mode === 'vertical') {
727
+ children.each(function (index) {
728
+ height += $(this).outerHeight();
729
+ });
730
+ // add user-supplied margins
731
+ if (slider.settings.slideMargin > 0) {
732
+ height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
733
+ }
734
+ // if not "vertical" mode, calculate the max height of the children
735
+ } else {
736
+ height = Math.max.apply(Math, children.map(function () {
737
+ return $(this).outerHeight(false);
738
+ }).get());
739
+ }
740
+
741
+ if (slider.viewport.css('box-sizing') === 'border-box') {
742
+ height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
743
+ parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
744
+ } else if (slider.viewport.css('box-sizing') === 'padding-box') {
745
+ height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
746
+ }
747
+
748
+ return height;
749
+ };
750
+
751
+ /**
752
+ *
753
+ */
754
+ var setViewportHeight = function () {
755
+ slider.viewport.height(getViewportHeight() + 2);
756
+ };
757
+
758
+ /**
759
+ * Returns the calculated width to be used for the outer wrapper / viewport
760
+ */
761
+ var getViewportMaxWidth2 = function () {
762
+ return '100%';
763
+ };
764
+
765
+ /**
766
+ * Returns the calculated width to be applied to each slide
767
+ */
768
+ var getSlideWidth2 = function () {
769
+ var wrapWidth = slider.viewport.width();
770
+ var margins = slider.settings.slideMargin * (slider.settings.maxSlides - 1);
771
+ return Math.floor( (wrapWidth - margins) / slider.settings.maxSlides );
772
+ };
773
+
774
+ /**
775
+ * Returns the number of slides currently visible in the viewport (includes partially visible slides)
776
+ */
777
+ var getNumberSlidesShowing2 = function () {
778
+ return slider.settings.maxSlides;
779
+ };
780
+
781
+ /**
782
+ * Returns the number of pages (one full viewport of slides is one "page")
783
+ */
784
+ var getPagerQty = function () {
785
+ var pagerQty = 0,
786
+ breakPoint = 0,
787
+ counter = 0;
788
+ // if moveSlides is specified by the user
789
+ if (slider.settings.moveSlides > 0) {
790
+ if (slider.settings.infiniteLoop) {
791
+ pagerQty = Math.ceil(slider.children.length / getMoveBy());
792
+ } else {
793
+ // when breakpoint goes above children length, counter is the number of pages
794
+ while (breakPoint < slider.children.length) {
795
+ ++pagerQty;
796
+ breakPoint = counter + getNumberSlidesShowing2();
797
+ counter += slider.settings.moveSlides <= getNumberSlidesShowing2() ? slider.settings.moveSlides : getNumberSlidesShowing2();
798
+ }
799
+ return counter;
800
+ }
801
+ // if moveSlides is 0 (auto) divide children length by sides showing, then round up
802
+ } else {
803
+ pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing2());
804
+ }
805
+ return pagerQty;
806
+ };
807
+
808
+ /**
809
+ * Returns the number of individual slides by which to shift the slider
810
+ */
811
+ var getMoveBy = function () {
812
+ // if moveSlides was set by the user and moveSlides is less than number of slides showing
813
+ if (slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing2()) {
814
+ return slider.settings.moveSlides;
815
+ }
816
+ // if moveSlides is 0 (auto)
817
+ return getNumberSlidesShowing2();
818
+ };
819
+
820
+ /**
821
+ * Sets the slider's (el) left or top position
822
+ */
823
+ var setSlidePosition = function () {
824
+ var position, lastChild, lastShowingIndex;
825
+
826
+ // if last slide, not infinite loop, and number of children is larger than specified maxSlides
827
+ if (slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop) {
828
+
829
+ if (slider.settings.mode === 'horizontal') {
830
+ // get the last child's position
831
+ lastChild = slider.children.last();
832
+ position = lastChild.position();
833
+ // set the left position
834
+ setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
835
+ } else if (slider.settings.mode === 'vertical') {
836
+ // get the last showing index's position
837
+ lastShowingIndex = slider.children.length - slider.settings.minSlides;
838
+ position = slider.children.eq(lastShowingIndex).position();
839
+ // set the top position
840
+ setPositionProperty(-position.top, 'reset', 0);
841
+ }
842
+
843
+ // if not last slide
844
+ } else {
845
+
846
+ // get the position of the first showing slide
847
+ position = slider.children.eq(slider.active.index * getMoveBy()).position();
848
+
849
+ // check for last slide
850
+ if (slider.active.index === getPagerQty() - 1) {
851
+ slider.active.last = true;
852
+ }
853
+
854
+ // set the respective position
855
+ if (position !== undefined) {
856
+ if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
857
+ else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
858
+ else if (slider.settings.mode === 'none') { setPositionProperty(-position.top, 'reset', 0); }
859
+ }
860
+
861
+ }
862
+ };
863
+
864
+ /**
865
+ * Sets the el's animating property position (which in turn will sometimes animate el).
866
+ * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
867
+ *
868
+ * @param value (int)
869
+ * - the animating property's value
870
+ *
871
+ * @param type (string) 'slide', 'reset'
872
+ * - the type of instance for which the function is being
873
+ *
874
+ * @param duration (int)
875
+ * - the amount of time (in ms) the transition should occupy
876
+ *
877
+ * @param params (array) optional
878
+ * - an optional parameter containing any variables that need to be passed in
879
+ */
880
+ var setPositionProperty = function (value, type, duration, params) {
881
+ var animateObj, propValue;
882
+ // use CSS transform
883
+ if (slider.usingCSS) {
884
+ // determine the translate3d value
885
+ if (slider.settings.mode === 'vertical') {
886
+ propValue = 'translateY(' + value + 'px)';
887
+ } else if (slider.settings.mode === 'horizontal') {
888
+ propValue = 'translateX(' + value + 'px';
889
+ } else if (slider.settings.mode === 'none') {
890
+ propValue = 'translateY(' + value + 'px)';
891
+ duration = 0;
892
+ }
893
+
894
+ // add the CSS transition-duration
895
+ el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
896
+
897
+ if (type === 'slide') {
898
+
899
+ // set the property value
900
+ el.css(slider.animProp, propValue);
901
+ if (duration !== 0) {
902
+ // add a callback method - executes when CSS transition completes
903
+ el.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function (e) {
904
+ //make sure it's the correct one
905
+ if (!$(e.target).is(el)) { return; }
906
+ // remove the callback
907
+ el.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
908
+ updateAfterSlideTransition();
909
+ });
910
+ } else { //duration = 0
911
+ updateAfterSlideTransition();
912
+ }
913
+
914
+ } else if (type === 'reset') {
915
+ el.css(slider.animProp, propValue);
916
+ }
917
+ // use JS animate
918
+ } else {
919
+ animateObj = {};
920
+ animateObj[slider.animProp] = value;
921
+ if (type === 'slide') {
922
+ el.animate(animateObj, duration, slider.settings.easing, function () {
923
+ updateAfterSlideTransition();
924
+ });
925
+ } else if (type === 'reset') {
926
+ el.css(slider.animProp, value);
927
+ }
928
+ }
929
+ };
930
+
931
+ /**
932
+ * Populates the pager with proper amount of pages
933
+ */
934
+ var populatePager = function () {
935
+ var pagerHtml = '',
936
+ linkContent = '',
937
+ pagerQty = getPagerQty();
938
+
939
+ // loop through each pager item
940
+ for (var i = 0; i < pagerQty; i++) {
941
+ linkContent = '';
942
+
943
+ if (slider.settings.buildPager) {
944
+ // if using icons, use no link text
945
+ if (slider.settings.buildPager === 'icons') {
946
+ linkContent = '';
947
+ }
948
+ // if a buildPager function is supplied, use it to get pager link value, else use index + 1
949
+ if ($.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom) {
950
+ linkContent = slider.settings.buildPager(i);
951
+ }
952
+ slider.pagerEl.addClass('wpmslider-custom-pager');
953
+ } else {
954
+ linkContent = i + 1;
955
+ slider.pagerEl.addClass('wpmslider-default-pager');
956
+ }
957
+
958
+ // add the markup to the string
959
+ pagerHtml += '<div class="wpmslider-pager-item"><a href="" data-slide-index="' + i + '" class="wpmslider-pager-link">' + linkContent + '</a></div>';
960
+ }
961
+
962
+ // populate the pager element with pager links
963
+ slider.pagerEl.html(pagerHtml);
964
+ };
965
+
966
+ /**
967
+ * Appends the pager to the controls element
968
+ */
969
+ var appendPager = function () {
970
+ if (!slider.settings.pagerCustom) {
971
+ // create the pager DOM element
972
+ slider.pagerEl = $('<div class="wpmslider-pager" />');
973
+ // if a pager selector was supplied, populate it with the pager
974
+ if (slider.settings.pagerSelector) {
975
+ $(slider.settings.pagerSelector).html(slider.pagerEl);
976
+ // if no pager selector was supplied, add it after the wrapper
977
+ } else {
978
+ slider.controls.el.addClass('wpmslider-has-pager').append(slider.pagerEl);
979
+ }
980
+ // populate the pager
981
+ populatePager();
982
+ } else {
983
+ slider.pagerEl = $(slider.settings.pagerCustom);
984
+ }
985
+ // assign the pager click binding
986
+ slider.pagerEl.on('click touchend', 'a', clickPagerBind);
987
+ };
988
+
989
+ /**
990
+ * Appends prev control to the controls element
991
+ */
992
+ var appendControlPrev = function () {
993
+ slider.controls.prev = $('<a class="wpmslider-prev" href="">' + slider.settings.prevText + '</a>');
994
+
995
+ // bind click actions to the controls
996
+ slider.controls.prev.on('click touchend', clickPrevBind);
997
+
998
+ // if prevSelector was supplied, populate it
999
+ if (slider.settings.prevSelector) {
1000
+ $(slider.settings.prevSelector).append(slider.controls.prev);
1001
+ }
1002
+
1003
+ // if no custom selectors were supplied
1004
+ if (!slider.settings.prevSelector) {
1005
+ // add the controls to the DOM
1006
+ slider.controls.directionEl = $('<div class="wpmslider-controls-direction" />');
1007
+ // add the control elements to the directionEl
1008
+ slider.controls.directionEl.append(slider.controls.prev);
1009
+ slider.controls.el.addClass('wpmslider-has-controls-direction').append(slider.controls.directionEl);
1010
+ }
1011
+ };
1012
+
1013
+ /**
1014
+ * Appends next controls to the controls element
1015
+ */
1016
+ var appendControlNext = function () {
1017
+ slider.controls.next = $('<a class="wpmslider-next" href="">' + slider.settings.nextText + '</a>');
1018
+
1019
+ // bind click actions to the controls
1020
+ slider.controls.next.on('click touchend', clickNextBind);
1021
+
1022
+ // if nextSelector was supplied, populate it
1023
+ if (slider.settings.nextSelector) {
1024
+ $(slider.settings.nextSelector).append(slider.controls.next);
1025
+ }
1026
+
1027
+ // if no custom selectors were supplied
1028
+ if (!slider.settings.nextSelector) {
1029
+ // add the controls to the DOM
1030
+ slider.controls.directionEl = $('<div class="wpmslider-controls-direction" />');
1031
+ // add the control elements to the directionEl
1032
+ slider.controls.directionEl.append(slider.controls.next);
1033
+ slider.controls.el.addClass('wpmslider-has-controls-direction').append(slider.controls.directionEl);
1034
+ }
1035
+ };
1036
+
1037
+ /**
1038
+ * Appends start / stop auto controls to the controls element
1039
+ */
1040
+ var appendControlsAuto = function () {
1041
+ slider.controls.start = $('<div class="wpmslider-controls-auto-item"><a class="wpmslider-start" href="">' + slider.settings.startText + '</a></div>');
1042
+ slider.controls.stop = $('<div class="wpmslider-controls-auto-item"><a class="wpmslider-stop" href="">' + slider.settings.stopText + '</a></div>');
1043
+
1044
+ // add the controls to the DOM
1045
+ slider.controls.autoEl = $('<div class="wpmslider-controls-auto" />');
1046
+
1047
+ // on click actions to the controls
1048
+ slider.controls.autoEl.on('click', '.wpmslider-start', clickStartBind);
1049
+ slider.controls.autoEl.on('click', '.wpmslider-stop', clickStopBind);
1050
+
1051
+ // if autoControlsCombine, insert only the "start" control
1052
+ if (slider.settings.autoControlsCombine) {
1053
+ slider.controls.autoEl.append(slider.controls.start);
1054
+ // if autoControlsCombine is false, insert both controls
1055
+ }
1056
+ else {
1057
+ slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
1058
+ }
1059
+
1060
+ // if auto controls selector was supplied, populate it with the controls
1061
+ if (slider.settings.autoControlsSelector) {
1062
+ $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
1063
+ // if auto controls selector was not supplied, add it after the wrapper
1064
+ } else {
1065
+ slider.controls.el.addClass('wpmslider-has-controls-auto').append(slider.controls.autoEl);
1066
+ }
1067
+
1068
+ // update the auto controls
1069
+ updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
1070
+ };
1071
+
1072
+ /**
1073
+ * Appends image captions to the DOM
1074
+ */
1075
+ var appendCaptions = function () {
1076
+ // cycle through each child
1077
+ slider.children.each(function (index) {
1078
+ // get the image title attribute
1079
+ var title = $(this).find('img:first').attr('title');
1080
+ // append the caption
1081
+ if (title !== undefined && ('' + title).length) {
1082
+ $(this).append('<div class="wpmslider-caption"><span>' + title + '</span></div>');
1083
+ }
1084
+ });
1085
+ };
1086
+
1087
+ /**
1088
+ * Click next binding
1089
+ *
1090
+ * @param e (event)
1091
+ * - DOM event object
1092
+ */
1093
+ var clickNextBind = function (e) {
1094
+ e.preventDefault();
1095
+ e.stopPropagation(); // for compatibility with WordPress themes
1096
+ if (slider.controls.el.hasClass('disabled')) {
1097
+ return;
1098
+ }
1099
+ // if auto show is running, stop it
1100
+ if (slider.settings.auto && slider.settings.stopAutoOnClick) {
1101
+ if (slider.debug) console.log(slider.logAs, 'stop on navigation');
1102
+ el.stopAuto();
1103
+ }
1104
+ el.goToNextSlide();
1105
+ };
1106
+
1107
+ /**
1108
+ * Click prev binding
1109
+ *
1110
+ * @param e (event)
1111
+ * - DOM event object
1112
+ */
1113
+ var clickPrevBind = function (e) {
1114
+ e.preventDefault();
1115
+ e.stopPropagation(); // for compatibility with WordPress themes
1116
+ if (slider.controls.el.hasClass('disabled')) {
1117
+ return;
1118
+ }
1119
+ // if auto show is running, stop it
1120
+ if (slider.settings.auto && slider.settings.stopAutoOnClick) {
1121
+ if (slider.debug) console.log(slider.logAs, 'stop on navigation');
1122
+ el.stopAuto();
1123
+ }
1124
+ el.goToPrevSlide();
1125
+ };
1126
+
1127
+ /**
1128
+ * Click start binding
1129
+ *
1130
+ * @param e (event)
1131
+ * - DOM event object
1132
+ */
1133
+ var clickStartBind = function (e) {
1134
+ el.startAuto();
1135
+ e.preventDefault();
1136
+ e.stopPropagation(); // for compatibility with WordPress themes
1137
+ };
1138
+
1139
+ /**
1140
+ * Click stop binding
1141
+ *
1142
+ * @param e (event)
1143
+ * - DOM event object
1144
+ */
1145
+ var clickStopBind = function (e) {
1146
+ el.stopAuto();
1147
+ e.preventDefault();
1148
+ e.stopPropagation(); // for compatibility with WordPress themes
1149
+ };
1150
+
1151
+ /**
1152
+ * Click pager binding
1153
+ *
1154
+ * @param e (event)
1155
+ * - DOM event object
1156
+ */
1157
+ var clickPagerBind = function (e) {
1158
+ var pagerLink, pagerIndex;
1159
+ e.preventDefault();
1160
+ e.stopPropagation(); // for compatibility with WordPress themes
1161
+ if (slider.controls.el.hasClass('disabled')) {
1162
+ return;
1163
+ }
1164
+ // if auto show is running, stop it
1165
+ if (slider.settings.auto && slider.settings.stopAutoOnClick) {
1166
+ if (slider.debug) console.log(slider.logAs, 'stop on navigation');
1167
+ el.stopAuto();
1168
+ }
1169
+ pagerLink = $(e.currentTarget);
1170
+ if (pagerLink.attr('data-slide-index') !== undefined) {
1171
+ pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
1172
+ // if clicked pager link is not active, continue with the goToSlide call
1173
+ if (pagerIndex !== slider.active.index) {
1174
+ el.goToSlide(pagerIndex);
1175
+ }
1176
+ }
1177
+ };
1178
+
1179
+ /**
1180
+ * Updates the pager links with an active class
1181
+ *
1182
+ * @param slideIndex (int)
1183
+ * - index of slide to make active
1184
+ */
1185
+ var updatePagerActive = function (slideIndex) {
1186
+ // if "short" pager type
1187
+ var len = slider.children.length; // nb of children
1188
+ if (slider.settings.pagerType === 'short') {
1189
+ if (slider.settings.maxSlides > 1) {
1190
+ len = Math.ceil(slider.children.length / slider.settings.maxSlides);
1191
+ }
1192
+ slider.pagerEl.html((slideIndex + 1) + slider.settings.pagerShortSeparator + len);
1193
+ return;
1194
+ }
1195
+ // remove all pager active classes
1196
+ slider.pagerEl.find('a').removeClass('active');
1197
+ // apply the active class for all pagers
1198
+ slider.pagerEl.each(function (i, el) {
1199
+ $(el).find('a').eq(slideIndex).addClass('active');
1200
+ });
1201
+ };
1202
+
1203
+ /**
1204
+ * Performs needed actions after a slide transition
1205
+ */
1206
+ var updateAfterSlideTransition = function () {
1207
+ // if infinite loop is true
1208
+ if (slider.settings.infiniteLoop) {
1209
+ var position = '';
1210
+ // first slide
1211
+ if (slider.active.index === 0) {
1212
+ // set the new position
1213
+ position = slider.children.eq(0).position();
1214
+ // carousel, last slide
1215
+ } else if (slider.active.index === getPagerQty() - 1 && slider.carousel) {
1216
+ position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
1217
+ // last slide
1218
+ } else if (slider.active.index === slider.children.length - 1) {
1219
+ position = slider.children.eq(slider.children.length - 1).position();
1220
+ }
1221
+ if (position) {
1222
+ if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
1223
+ else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
1224
+ }
1225
+ }
1226
+ // declare that the transition is complete
1227
+ slider.working = false;
1228
+ // onSlideAfter callback
1229
+ slider.settings.onSlideAfter.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1230
+ };
1231
+
1232
+ /**
1233
+ * Updates the auto controls state (either active, or combined switch)
1234
+ *
1235
+ * @param state (string) "start", "stop"
1236
+ * - the new state of the auto show
1237
+ */
1238
+ var updateAutoControls = function (state) {
1239
+ // if autoControlsCombine is true, replace the current control with the new state
1240
+ if (slider.settings.autoControlsCombine) {
1241
+ slider.controls.autoEl.html(slider.controls[state]);
1242
+ // if autoControlsCombine is false, apply the "active" class to the appropriate control
1243
+ } else {
1244
+ slider.controls.autoEl.find('a').removeClass('active');
1245
+ slider.controls.autoEl.find('a:not(.wpmslider-' + state + ')').addClass('active');
1246
+ }
1247
+ };
1248
+
1249
+ /**
1250
+ * Updates the direction controls (checks if either should be hidden)
1251
+ */
1252
+ var updateDirectionControls = function () {
1253
+ if (getPagerQty() === 1) {
1254
+ slider.controls.prev.addClass('disabled');
1255
+ slider.controls.next.addClass('disabled');
1256
+ }
1257
+ else if (!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd) {
1258
+ // if first slide
1259
+ if (slider.active.index === 0) {
1260
+ slider.controls.prev.addClass('disabled');
1261
+ slider.controls.next.removeClass('disabled');
1262
+ // if last slide
1263
+ } else if (slider.active.index === getPagerQty() - 1) {
1264
+ slider.controls.next.addClass('disabled');
1265
+ slider.controls.prev.removeClass('disabled');
1266
+ // if any slide in the middle
1267
+ } else {
1268
+ slider.controls.prev.removeClass('disabled');
1269
+ slider.controls.next.removeClass('disabled');
1270
+ }
1271
+ }
1272
+ };
1273
+
1274
+ /**
1275
+ * Initializes the auto process
1276
+ */
1277
+ var initAuto = function () {
1278
+ // if autoDelay was supplied, launch the auto show using a setTimeout() call
1279
+ if (slider.settings.autoDelay > 0) {
1280
+ setTimeout(el.startAuto, slider.settings.autoDelay);
1281
+ // if autoDelay was not supplied, start the auto show normally
1282
+ } else {
1283
+ el.startAuto();
1284
+ }
1285
+
1286
+ // if autoHover is requested
1287
+ if (slider.settings.autoHover) {
1288
+ // on el hover
1289
+ el.hover(function () {
1290
+ pauseEvent('hover');
1291
+ }, function () {
1292
+ playEvent('hover');
1293
+ });
1294
+ }
1295
+ };
1296
+
1297
+ /**
1298
+ * Initializes keyboard events
1299
+ */
1300
+ var keyPress = function (e) {
1301
+ var activeElementTag = document.activeElement.tagName.toLowerCase(),
1302
+ tagFilters = 'input|textarea',
1303
+ p = new RegExp(activeElementTag, ['i']),
1304
+ result = p.exec(tagFilters);
1305
+
1306
+ if (result === null && verge.inViewport(el)) {
1307
+ if (e.keyCode === 39) {
1308
+ clickNextBind(e);
1309
+ return false;
1310
+ } else if (e.keyCode === 37) {
1311
+ clickPrevBind(e);
1312
+ return false;
1313
+ }
1314
+ }
1315
+ };
1316
+
1317
+ /**
1318
+ * Initializes touch events
1319
+ */
1320
+ var initTouch = function () {
1321
+ // initialize object to contain all touch values
1322
+ slider.touch = {
1323
+ start: {x: 0, y: 0},
1324
+ end: {x: 0, y: 0}
1325
+ };
1326
+ slider.viewport.on('touchstart MSPointerDown pointerdown', onTouchStart);
1327
+
1328
+ //for browsers that have implemented pointer events and fire a click after
1329
+ //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not
1330
+ slider.viewport.on('click', '.wpmslider a', function (e) {
1331
+ if (slider.viewport.hasClass('click-disabled')) {
1332
+ e.preventDefault();
1333
+ e.stopPropagation(); // for compatibility with WordPress themes
1334
+ slider.viewport.removeClass('click-disabled');
1335
+ }
1336
+ });
1337
+ };
1338
+
1339
+ /**
1340
+ * Event handler for "touchstart"
1341
+ *
1342
+ * @param e (event)
1343
+ * - DOM event object
1344
+ */
1345
+ var onTouchStart = function (e) {
1346
+ // watch only for left mouse, touch contact and pen contact
1347
+ // touchstart event object doesn`t have button property
1348
+ if (e.type !== 'touchstart' && e.button !== 0) {
1349
+ return;
1350
+ }
1351
+
1352
+ if( e.originalEvent.target.classList.contains('readmore-text') ) {
1353
+ return;
1354
+ }
1355
+ // e.preventDefault();
1356
+ //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls
1357
+ slider.controls.el.addClass('disabled');
1358
+
1359
+ if (slider.working) {
1360
+ e.preventDefault();
1361
+ e.stopPropagation(); // for compatibility with WordPress themes
1362
+ slider.controls.el.removeClass('disabled');
1363
+ } else {
1364
+ // record the original position when touch starts
1365
+ slider.touch.originalPos = el.position();
1366
+ var orig = e.originalEvent,
1367
+ touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig];
1368
+ var chromePointerEvents = typeof PointerEvent === 'function';
1369
+ if (chromePointerEvents) { if (orig.pointerId === undefined) { return; } }
1370
+ // record the starting touch x, y coordinates
1371
+ slider.touch.start.x = touchPoints[0].pageX;
1372
+ slider.touch.start.y = touchPoints[0].pageY;
1373
+
1374
+ if (slider.viewport.get(0).setPointerCapture) {
1375
+ slider.pointerId = orig.pointerId;
1376
+ slider.viewport.get(0).setPointerCapture(slider.pointerId);
1377
+ }
1378
+ // store original event data for click fixation
1379
+ slider.originalClickTarget = orig.originalTarget || orig.target;
1380
+ slider.originalClickButton = orig.button;
1381
+ slider.originalClickButtons = orig.buttons;
1382
+ slider.originalEventType = orig.type;
1383
+ // at this moment we don`t know what it is click or swipe
1384
+ slider.hasMove = false;
1385
+ // on a "touchmove" event to the viewport
1386
+ slider.viewport.on('touchmove MSPointerMove pointermove', onTouchMove);
1387
+ // on a "touchend" event to the viewport
1388
+ slider.viewport.on('touchend MSPointerUp pointerup', onTouchEnd);
1389
+ slider.viewport.on('MSPointerCancel pointercancel', onPointerCancel);
1390
+ }
1391
+ };
1392
+
1393
+ /**
1394
+ * Cancel Pointer for Windows Phone
1395
+ *
1396
+ * @param e (event)
1397
+ * - DOM event object
1398
+ */
1399
+ var onPointerCancel = function (e) {
1400
+ e.preventDefault();
1401
+ /* onPointerCancel handler is needed to deal with situations when a touchend
1402
+ doesn't fire after a touchstart (this happens on windows phones only) */
1403
+ setPositionProperty(slider.touch.originalPos.left, 'reset', 0);
1404
+
1405
+ //remove handlers
1406
+ slider.controls.el.removeClass('disabled');
1407
+ slider.viewport.off('MSPointerCancel pointercancel', onPointerCancel);
1408
+ slider.viewport.off('touchmove MSPointerMove pointermove', onTouchMove);
1409
+ slider.viewport.off('touchend MSPointerUp pointerup', onTouchEnd);
1410
+ if (slider.viewport.get(0).releasePointerCapture) {
1411
+ slider.viewport.get(0).releasePointerCapture(slider.pointerId);
1412
+ }
1413
+ };
1414
+
1415
+ /**
1416
+ * Event handler for "touchmove"
1417
+ *
1418
+ * @param e (event)
1419
+ * - DOM event object
1420
+ */
1421
+ var onTouchMove = function (e) {
1422
+ var orig = e.originalEvent,
1423
+ touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],
1424
+ // if scrolling on y axis, do not prevent default
1425
+ xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x),
1426
+ yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y),
1427
+ value = 0,
1428
+ change = 0;
1429
+ // this is swipe
1430
+ slider.hasMove = true;
1431
+
1432
+ // x axis swipe
1433
+ if ((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX) {
1434
+ e.preventDefault();
1435
+ e.stopPropagation(); // for compatibility with WordPress themes
1436
+ // y axis swipe
1437
+ } else if ((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY) {
1438
+ e.preventDefault();
1439
+ e.stopPropagation(); // for compatibility with WordPress themes
1440
+ }
1441
+ if (e.type !== 'touchmove') {
1442
+ e.preventDefault();
1443
+ }
1444
+
1445
+ if (slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch) {
1446
+ // if horizontal, drag along x axis
1447
+ if (slider.settings.mode === 'horizontal') {
1448
+ change = touchPoints[0].pageX - slider.touch.start.x;
1449
+ value = slider.touch.originalPos.left + change;
1450
+ // if vertical, drag along y axis
1451
+ }
1452
+ else {
1453
+ change = touchPoints[0].pageY - slider.touch.start.y;
1454
+ value = slider.touch.originalPos.top + change;
1455
+ }
1456
+ setPositionProperty(value, 'reset', 0);
1457
+ }
1458
+ };
1459
+
1460
+ /**
1461
+ * Event handler for "touchend"
1462
+ *
1463
+ * @param e (event)
1464
+ * - DOM event object
1465
+ */
1466
+ var onTouchEnd = function (e) {
1467
+ e.preventDefault();
1468
+ slider.viewport.off('touchmove MSPointerMove pointermove', onTouchMove);
1469
+ //enable slider controls as soon as user stops interacing with slides
1470
+ slider.controls.el.removeClass('disabled');
1471
+ var orig = e.originalEvent,
1472
+ touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],
1473
+ value = 0,
1474
+ distance = 0;
1475
+ // record end x, y positions
1476
+ slider.touch.end.x = touchPoints[0].pageX;
1477
+ slider.touch.end.y = touchPoints[0].pageY;
1478
+ // if fade mode, check if absolute x distance clears the threshold
1479
+ if (slider.settings.mode === 'fade') {
1480
+ distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1481
+ if (distance >= slider.settings.swipeThreshold) {
1482
+ if (slider.touch.start.x > slider.touch.end.x) {
1483
+ el.goToNextSlide();
1484
+ } else {
1485
+ el.goToPrevSlide();
1486
+ }
1487
+ el.stopAuto();
1488
+ }
1489
+ // not fade mode
1490
+ } else {
1491
+ // calculate distance and el's animate property
1492
+ if (slider.settings.mode === 'horizontal') {
1493
+ distance = slider.touch.end.x - slider.touch.start.x;
1494
+ value = slider.touch.originalPos.left;
1495
+ } else {
1496
+ distance = slider.touch.end.y - slider.touch.start.y;
1497
+ value = slider.touch.originalPos.top;
1498
+ }
1499
+
1500
+ // if not infinite loop and first / last slide, do not attempt a slide transition
1501
+ if (!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))) {
1502
+ setPositionProperty(value, 'reset', 200);
1503
+ } else {
1504
+ // check if distance clears threshold
1505
+ if (Math.abs(distance) >= slider.settings.swipeThreshold) {
1506
+ if (distance < 0) {
1507
+ el.goToNextSlide();
1508
+ } else {
1509
+ el.goToPrevSlide();
1510
+ }
1511
+ el.stopAuto();
1512
+ } else {
1513
+ // el.animate(property, 200);
1514
+ setPositionProperty(value, 'reset', 200);
1515
+ }
1516
+ }
1517
+ }
1518
+ slider.viewport.off('touchend MSPointerUp pointerup', onTouchEnd);
1519
+ if (slider.viewport.get(0).releasePointerCapture) {
1520
+ slider.viewport.get(0).releasePointerCapture(slider.pointerId);
1521
+ }
1522
+ // if slider had swipe with left mouse, touch contact and pen contact
1523
+ if (slider.hasMove === false && (slider.originalClickButton === 0 || slider.originalEventType === 'touchstart')) {
1524
+ // trigger click event (fix for Firefox59 and PointerEvent standard compatibility)
1525
+ $(slider.originalClickTarget).trigger({
1526
+ type: 'click',
1527
+ button: slider.originalClickButton,
1528
+ buttons: slider.originalClickButtons
1529
+ });
1530
+ }
1531
+ };
1532
+
1533
+ /**
1534
+ * Window resize event callback
1535
+ */
1536
+ var resizeWindow = function (e) {
1537
+ // don't do anything if slider isn't initialized.
1538
+ if (!slider.initialized) {
1539
+ if (slider.debug) console.log(slider.logAs, 'slider not initialized');
1540
+ return;
1541
+ }
1542
+ // Delay if slider working.
1543
+ if (slider.working) {
1544
+ if (slider.debug) console.log(slider.logAs, 'slider working');
1545
+ window.setTimeout(resizeWindow, 10);
1546
+ } else {
1547
+ // update all dynamic elements
1548
+ el.redrawSlider();
1549
+ // Call user resize handler
1550
+ slider.settings.onSliderResize.call(el, slider.active.index);
1551
+ }
1552
+ };
1553
+
1554
+ /**
1555
+ * Adds an aria-hidden=true attribute to each element
1556
+ *
1557
+ * @param startVisibleIndex (int)
1558
+ * - the first visible element's index
1559
+ */
1560
+ var applyAriaHiddenAttributes = function (startVisibleIndex) {
1561
+ var numberOfSlidesShowing = getNumberSlidesShowing2();
1562
+ // only apply attributes if the setting is enabled
1563
+ if (slider.settings.ariaHidden) {
1564
+ // add aria-hidden=true to all elements
1565
+ slider.children.attr('aria-hidden', 'true');
1566
+ // get the visible elements and change to aria-hidden=false
1567
+ slider.children.slice(startVisibleIndex, startVisibleIndex + numberOfSlidesShowing).attr('aria-hidden', 'false');
1568
+ }
1569
+ };
1570
+
1571
+ /**
1572
+ * Returns index according to present page range
1573
+ *
1574
+ * @param slideIndex (int)
1575
+ * - the desired slide index
1576
+ */
1577
+ var setSlideIndex = function (slideIndex) {
1578
+ if (slideIndex < 0) {
1579
+ if (slider.settings.infiniteLoop) {
1580
+ return getPagerQty() - 1;
1581
+ }
1582
+ else {
1583
+ //we don't go to undefined slides
1584
+ return slider.active.index;
1585
+ }
1586
+ // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
1587
+ } else if (slideIndex >= getPagerQty()) {
1588
+ if (slider.settings.infiniteLoop) {
1589
+ return 0;
1590
+ } else {
1591
+ //we don't move to undefined pages
1592
+ return slider.active.index;
1593
+ }
1594
+ // set active index to requested slide
1595
+ } else {
1596
+ return slideIndex;
1597
+ }
1598
+ };
1599
+
1600
+ /**
1601
+ * ===================================================================================
1602
+ * = PUBLIC FUNCTIONS
1603
+ * ===================================================================================
1604
+ */
1605
+
1606
+ /**
1607
+ * Performs slide transition to the specified slide
1608
+ *
1609
+ * @param slideIndex (int)
1610
+ * - the destination slide's index (zero-based)
1611
+ *
1612
+ * @param direction (string)
1613
+ * - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1614
+ */
1615
+ el.goToSlide = function (slideIndex, direction) {
1616
+ // onSlideBefore, onSlideNext, onSlidePrev callbacks
1617
+ // Allow transition canceling based on returned value
1618
+ var performTransition = true,
1619
+ moveBy = 0,
1620
+ position = {left: 0, top: 0},
1621
+ lastChild = null,
1622
+ lastShowingIndex, eq, value, requestEl;
1623
+ // store the old index
1624
+ slider.oldIndex = slider.active.index;
1625
+ //set new index
1626
+ slider.active.index = setSlideIndex(slideIndex);
1627
+
1628
+ // if plugin is currently in motion, ignore request
1629
+ if (slider.working || slider.active.index === slider.oldIndex) {
1630
+ return;
1631
+ }
1632
+ // declare that plugin is in motion
1633
+ slider.working = true;
1634
+
1635
+ performTransition = slider.settings.onSlideBefore.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1636
+
1637
+ // If transitions canceled, reset and return
1638
+ if (typeof (performTransition) !== 'undefined' && !performTransition) {
1639
+ slider.active.index = slider.oldIndex; // restore old index
1640
+ slider.working = false; // is not in motion
1641
+ return;
1642
+ }
1643
+
1644
+ if (direction === 'next') {
1645
+ // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
1646
+ if (!slider.settings.onSlideNext.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {
1647
+ performTransition = false;
1648
+ }
1649
+ }
1650
+ else if (direction === 'prev') {
1651
+ // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
1652
+ if (!slider.settings.onSlidePrev.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {
1653
+ performTransition = false;
1654
+ }
1655
+ }
1656
+
1657
+ // check if last slide
1658
+ slider.active.last = slider.active.index >= getPagerQty() - 1;
1659
+
1660
+ // update the pager with active class
1661
+ if (slider.settings.pager || slider.settings.pagerCustom) {
1662
+ updatePagerActive(slider.active.index);
1663
+ }
1664
+
1665
+ // // check for direction control update
1666
+ if (slider.settings.controls) { updateDirectionControls(); }
1667
+ // if slider is set to mode: "fade"
1668
+ if (slider.settings.mode === 'fade') {
1669
+
1670
+ // if adaptiveHeight is true and next height is different from current height, animate to the new height
1671
+ if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {
1672
+ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1673
+ }
1674
+
1675
+ // fade out the visible child and reset its z-index value
1676
+ slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
1677
+
1678
+ // fade in the newly requested slide
1679
+ slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex + 1).fadeIn(slider.settings.speed, function () {
1680
+ $(this).css('zIndex', slider.settings.slideZIndex);
1681
+ updateAfterSlideTransition();
1682
+ });
1683
+
1684
+ // slider mode is not "fade"
1685
+ } else {
1686
+
1687
+ // if adaptiveHeight is true and next height is different from current height, animate to the new height
1688
+ if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {
1689
+ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1690
+ }
1691
+
1692
+ // if carousel and not infinite loop
1693
+ if (!slider.settings.infiniteLoop && slider.carousel && slider.active.last) {
1694
+
1695
+ if (slider.settings.mode === 'horizontal') {
1696
+ // get the last child position
1697
+ lastChild = slider.children.eq(slider.children.length - 1);
1698
+ position = lastChild.position();
1699
+ // calculate the position of the last slide
1700
+ moveBy = slider.viewport.width() - lastChild.outerWidth();
1701
+ }
1702
+ else {
1703
+ // get last showing index position
1704
+ lastShowingIndex = slider.children.length - slider.settings.minSlides;
1705
+ position = slider.children.eq(lastShowingIndex).position();
1706
+ }
1707
+
1708
+ // horizontal carousel, going previous while on first slide (infiniteLoop mode)
1709
+ } else if (slider.carousel && slider.active.last && direction === 'prev') {
1710
+
1711
+ // get the last child position
1712
+ eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
1713
+ lastChild = el.children('.wpmslider-clone').eq(eq);
1714
+ position = lastChild.position();
1715
+
1716
+ // if infinite loop and "Next" is clicked on the last slide
1717
+ } else if (direction === 'next' && slider.active.index === 0) {
1718
+
1719
+ // get the last clone position
1720
+ position = el.find('> .wpmslider-clone').eq(slider.settings.maxSlides).position();
1721
+ slider.active.last = false;
1722
+
1723
+ // normal non-zero requests
1724
+ } else if (slideIndex >= 0) {
1725
+
1726
+ //parseInt is applied to allow floats for slides/page
1727
+ requestEl = slideIndex * parseInt(getMoveBy());
1728
+ position = slider.children.eq(requestEl).position();
1729
+
1730
+ }
1731
+
1732
+ /* If the position doesn't exist
1733
+ * (e.g. if you destroy the slider on a next click),
1734
+ * it doesn't throw an error.
1735
+ */
1736
+ if (typeof (position) !== 'undefined') {
1737
+ value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top;
1738
+ // plugin values to be animated
1739
+ setPositionProperty(value, 'slide', slider.settings.speed);
1740
+
1741
+ }
1742
+
1743
+ }
1744
+
1745
+ if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); }
1746
+ };
1747
+
1748
+ /**
1749
+ * Transitions to the next slide in the show
1750
+ */
1751
+ el.goToNextSlide = function () {
1752
+ // if infiniteLoop is false and last page is showing, disregard call
1753
+ if (!slider.settings.infiniteLoop && slider.active.last) { return; }
1754
+ if (slider.working === true){ return ; }
1755
+ var pagerIndex = parseInt(slider.active.index) + 1;
1756
+ el.goToSlide(pagerIndex, 'next');
1757
+ };
1758
+
1759
+ /**
1760
+ * Transitions to the prev slide in the show
1761
+ */
1762
+ el.goToPrevSlide = function () {
1763
+ // if infiniteLoop is false and last page is showing, disregard call
1764
+ if (!slider.settings.infiniteLoop && slider.active.index === 0) { return; }
1765
+ if (slider.working === true){ return ;}
1766
+ var pagerIndex = parseInt(slider.active.index) - 1;
1767
+ el.goToSlide(pagerIndex, 'prev');
1768
+ };
1769
+
1770
+ /**
1771
+ * Starts the auto show
1772
+ *
1773
+ * @param preventControlUpdate (boolean)
1774
+ * - if true, auto controls state will not be updated
1775
+ */
1776
+ el.startAuto = function (preventControlUpdate) {
1777
+ // if an interval already exists, disregard call
1778
+ if (slider.interval) {
1779
+ return;
1780
+ }
1781
+
1782
+ // create an interval
1783
+ slider.interval = setInterval(function () {
1784
+ if (slider.settings.autoDirection === 'next') {
1785
+ el.goToNextSlide();
1786
+ }
1787
+ else {
1788
+ el.goToPrevSlide();
1789
+ }
1790
+ }, slider.settings.pause);
1791
+ // callback for when the auto rotate status changes
1792
+ slider.settings.onAutoChange.call(el, true);
1793
+ // if auto controls are displayed and preventControlUpdate is not true
1794
+ if (slider.settings.autoControls && preventControlUpdate !== true) {
1795
+ updateAutoControls('stop');
1796
+ }
1797
+ };
1798
+
1799
+ /**
1800
+ * Stops the auto show
1801
+ *
1802
+ * @param preventControlUpdate (boolean)
1803
+ * - if true, auto controls state will not be updated
1804
+ */
1805
+ el.stopAuto = function (preventControlUpdate) {
1806
+ // if slider is auto paused, just clear that state
1807
+ if (slider.autoPaused) slider.autoPaused = false;
1808
+ // if no interval exists, disregard call
1809
+ if (!slider.interval) { return; }
1810
+ // clear the interval
1811
+ clearInterval(slider.interval);
1812
+ slider.interval = null;
1813
+ // callback for when the auto rotate status changes
1814
+ slider.settings.onAutoChange.call(el, false);
1815
+ // if auto controls are displayed and preventControlUpdate is not true
1816
+ if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('start'); }
1817
+ //clearInterval(el.visibilityInterval);
1818
+ };
1819
+
1820
+ /**
1821
+ * Returns current slide index (zero-based)
1822
+ */
1823
+ el.getCurrentSlide = function () {
1824
+ return slider.active.index;
1825
+ };
1826
+
1827
+ /**
1828
+ * Returns current slide element
1829
+ */
1830
+ el.getCurrentSlideElement = function () {
1831
+ return slider.children.eq(slider.active.index);
1832
+ };
1833
+
1834
+ /**
1835
+ * Returns a slide element
1836
+ * @param index (int)
1837
+ * - The index (zero-based) of the element you want returned.
1838
+ */
1839
+ el.getSlideElement = function (index) {
1840
+ return slider.children.eq(index);
1841
+ };
1842
+
1843
+ /**
1844
+ * Returns number of slides in show
1845
+ */
1846
+ el.getSlideCount = function () {
1847
+ return slider.children.length;
1848
+ };
1849
+
1850
+ /**
1851
+ * Return slider.working variable
1852
+ */
1853
+ el.isWorking = function () {
1854
+ return slider.working;
1855
+ };
1856
+
1857
+ /**
1858
+ * Update all dynamic slider elements
1859
+ */
1860
+ el.redrawSlider = function () {
1861
+ if (slider.debug) console.log(slider.logAs, 'redrawSlider');
1862
+
1863
+ // maybe set/revert carousel
1864
+ updateWidth();
1865
+
1866
+ // adjust the height
1867
+ unsetSlideHeight();
1868
+ setViewportHeight();
1869
+
1870
+ // if stretch, set t-slide height to 100%
1871
+ if (slider.settings.stretch) {
1872
+ setSlideHeight();
1873
+ }
1874
+
1875
+ // resize all children in ratio to new screen size
1876
+ slider.children.add(el.find('.wpmslider-clone')).outerWidth(getSlideWidth2());
1877
+
1878
+ // update the slide position
1879
+ setSlidePosition();
1880
+
1881
+ // if active.last was true before the screen resize, we want
1882
+ // to keep it last no matter what screen size we end on
1883
+ if (slider.active.last) {
1884
+ slider.active.index = getPagerQty() - 1;
1885
+ }
1886
+
1887
+ // if the active index (page) no longer exists due to the resize, simply set the index as last
1888
+ if (slider.active.index >= getPagerQty()) {
1889
+ slider.active.last = true;
1890
+ }
1891
+
1892
+ // if a pager is being displayed and a custom pager is not being used, update it
1893
+ if (slider.settings.pager && !slider.settings.pagerCustom) {
1894
+ populatePager();
1895
+ updatePagerActive(slider.active.index);
1896
+ }
1897
+
1898
+ if (slider.settings.ariaHidden) {
1899
+ applyAriaHiddenAttributes(slider.active.index * getMoveBy());
1900
+ }
1901
+ };
1902
+
1903
+ /**
1904
+ * Destroy the current instance of the slider (revert everything back to original state)
1905
+ */
1906
+ el.destroySlider = function () {
1907
+ // don't do anything if slider has already been destroyed
1908
+ if (!slider.initialized) {
1909
+ return;
1910
+ }
1911
+ slider.initialized = false;
1912
+ $('.wpmslider-clone', this).remove();
1913
+
1914
+ slider.children.each(function () {
1915
+ if ($(this).data('origStyle') !== undefined) {
1916
+ $(this).attr('style', $(this).data('origStyle'));
1917
+ } else {
1918
+ $(this).removeAttr('style');
1919
+ }
1920
+ });
1921
+
1922
+ if ($(this).data('origStyle') !== undefined) {
1923
+ this.attr('style', $(this).data('origStyle'));
1924
+ } else {
1925
+ $(this).removeAttr('style');
1926
+ }
1927
+
1928
+ $(this).unwrap().unwrap();
1929
+
1930
+ if (slider.controls.el) {
1931
+ slider.controls.el.remove();
1932
+ }
1933
+ if (slider.controls.next) {
1934
+ slider.controls.next.remove();
1935
+ }
1936
+ if (slider.controls.prev) {
1937
+ slider.controls.prev.remove();
1938
+ }
1939
+ if (slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom) { slider.pagerEl.remove(); }
1940
+
1941
+ $('.wpmslider-caption', this).remove();
1942
+
1943
+ if (slider.controls.autoEl) {
1944
+ slider.controls.autoEl.remove();
1945
+ }
1946
+
1947
+ clearInterval(slider.interval);
1948
+ clearInterval(slider.visibilityInterval);
1949
+
1950
+ if (slider.settings.responsive) {
1951
+ $(window).off('resize', resizeWindow);
1952
+ }
1953
+
1954
+ if (slider.settings.keyboardEnabled) {
1955
+ $(document).off('keydown', keyPress);
1956
+ }
1957
+
1958
+ //remove self reference in data
1959
+ $(this).removeData('strongSlider');
1960
+ };
1961
+
1962
+ /**
1963
+ * Reload the slider (revert all DOM changes, and re-initialize)
1964
+ */
1965
+ el.reloadSlider = function (settings) {
1966
+ if (settings !== undefined) {
1967
+ options = settings;
1968
+ }
1969
+ el.destroySlider();
1970
+ init();
1971
+ // store reference to self in order to access public functions later
1972
+ $(el).data('strongSlider', this);
1973
+ };
1974
+
1975
+ // Fire it up!
1976
+ init();
1977
+
1978
+ // Store reference to self in order to access public functions later
1979
+ $(el).data('strongSlider', this);
1980
+
1981
+ // Set initialized flag on container
1982
+ viewEl.attr('data-state', 'init');
1983
+
1984
+ if (slider.debug) console.log(slider.logAs, 'viewport', verge.viewportW(), 'x', verge.viewportH());
1985
+
1986
+ // returns the current jQuery object
1987
+ return this;
1988
+ };
1989
+
1990
+ })(jQuery);
public/js/lib/strongslider/jquery.strongslider.min.js CHANGED
@@ -1 +1 @@
1
- (function($){var defaults={debug:false,logAs:"strongSlider",compat:{lazyload:{active:false,classes:{}}},mode:"horizontal",slideSelector:"div.t-slide",infiniteLoop:true,hideControlOnEnd:false,speed:500,easing:null,slideMargin:10,startSlide:0,randomStart:false,captions:false,adaptiveHeight:false,adaptiveHeightSpeed:500,video:false,useCSS:true,preloadImages:"visible",responsive:true,slideZIndex:50,wrapperClass:"wpmslider-wrapper",stretch:false,imagesLoaded:true,touchEnabled:true,swipeThreshold:50,oneToOneTouch:true,preventDefaultSwipeX:true,preventDefaultSwipeY:false,ariaLive:true,ariaHidden:true,keyboardEnabled:false,pager:true,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:true,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:false,startText:"Start",stopText:"Stop",autoControlsCombine:false,autoControlsSelector:null,auto:true,pause:4e3,autoStart:true,autoDirection:"next",stopAutoOnClick:false,autoHover:false,autoDelay:0,autoSlideForOnePage:false,minSlides:1,maxSlides:1,moveSlides:0,onSliderLoad:function(){return true},onSlideBefore:function(){return true},onSlideAfter:function(){return true},onSlideNext:function(){return true},onSlidePrev:function(){return true},onSliderResize:function(){return true},onAutoChange:function(){return true}};$.fn.strongSlider=function(options){if(this.length===0){return this}var slider={},viewEl=this,el=this.find(".wpmslider-content");if($(el).data("strongSlider")){return}var init=function(){if($(el).data("strongSlider")){return}slider.visibilityInterval=0;slider.hidden=false;var sliderVar=viewEl.data("slider-var");var config={};if(typeof window[sliderVar]!=="undefined"){config=window[sliderVar].config}slider.settings=$.extend({},defaults,config,options);slider.debug=slider.settings.debug;slider.logAs=slider.settings.logAs;if(slider.debug)console.log(slider.logAs,"slider.settings",slider.settings);slider.children=el.children(slider.settings.slideSelector);if(slider.children.length<slider.settings.minSlides){slider.settings.minSlides=slider.children.length}if(slider.children.length<slider.settings.maxSlides){slider.settings.maxSlides=slider.children.length}if(slider.settings.randomStart){slider.settings.startSlide=Math.floor(Math.random()*slider.children.length)}slider.active={index:slider.settings.startSlide};setBreakpoint();if(slider.carousel){slider.settings.preloadImages="all"}slider.working=false;slider.controls={};slider.interval=null;slider.animProp=slider.settings.mode==="vertical"?"top":"left";slider.usingCSS=slider.settings.useCSS&&slider.settings.mode!=="fade"&&function(){var div=document.createElement("div"),props=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i=0;i<props.length;i++){if(div.style[props[i]]!==undefined){slider.cssPrefix=props[i].replace("Perspective","").toLowerCase();slider.animProp="-"+slider.cssPrefix+"-transform";return true}}return false}();if(slider.settings.mode==="vertical"){slider.settings.maxSlides=slider.settings.minSlides}el.data("origStyle",el.attr("style"));el.children(slider.settings.slideSelector).each(function(){$(this).data("origStyle",$(this).attr("style"))});if(!el.getSlideCount()){return}if(slider.settings.imagesLoaded){viewEl.imagesLoaded(function(){initVisibilityCheck()})}else{initVisibilityCheck()}};var reallyVisible=function(){return viewEl.is(":visible")&&viewEl.css("visibility")!=="hidden"};var compatCheck=function(){if(slider.settings.compat.lazyload){var inProgress=false;for(var i=0,len=slider.settings.compat.lazyload.classes.length;i<len;i++){var startClass=slider.settings.compat.lazyload.classes[i].start;var finishClass=slider.settings.compat.lazyload.classes[i].finish;if(startClass&&finishClass){if(viewEl.find("img."+startClass).length&&!viewEl.find("img."+finishClass).length){inProgress=true}}else if(startClass){if(viewEl.find("img."+startClass).length){inProgress=true}}else if(finishClass){if(!viewEl.find("img."+finishClass).length){inProgress=true}}}if(inProgress){if(slider.debug)console.log(slider.logAs,"lazy loading...");return false}}if(slider.debug)console.log(slider.logAs,"compat check complete");return true};var initVisibilityCheck=function(){if(reallyVisible()&&compatCheck()){clearInterval(slider.visibilityInterval);setup()}else{if(slider.visibilityInterval===0){slider.visibilityInterval=setInterval(initVisibilityCheck,1e3*4)}}};var setup=function(){var preloadSelector=slider.children.eq(slider.settings.startSlide);el.wrap('<div class="'+slider.settings.wrapperClass+'"><div class="wpmslider-viewport"></div></div>');slider.viewport=el.parent();if(slider.settings.ariaLive){slider.viewport.attr("aria-live","polite")}slider.loader=$('<div class="wpmslider-loading" />');slider.viewport.prepend(slider.loader);el.css({width:slider.settings.mode==="horizontal"?slider.children.length*1e3+215+"%":"auto",position:"relative"});if(slider.usingCSS&&slider.settings.easing){el.css("-"+slider.cssPrefix+"-transition-timing-function",slider.settings.easing)}else if(!slider.settings.easing){slider.settings.easing="swing"}slider.viewport.css({width:"100%",overflow:"hidden",position:"relative"});slider.viewport.parent().css({maxWidth:getViewportMaxWidth2()});if(!slider.settings.pager&&!slider.settings.controls){slider.viewport.parent().css({margin:"0 auto"})}slider.children.css({float:slider.settings.mode==="horizontal"?"left":"none",listStyle:"none",position:"relative"});updateWidth();if(slider.settings.mode==="horizontal"&&slider.settings.slideMargin>0){slider.children.css("marginRight",slider.settings.slideMargin)}if(slider.settings.mode==="vertical"&&slider.settings.slideMargin>0){slider.children.css("marginBottom",slider.settings.slideMargin)}if(slider.settings.mode==="fade"){slider.children.css({position:"absolute",zIndex:0,display:"none"});slider.children.eq(slider.settings.startSlide).css({zIndex:slider.settings.slideZIndex,display:"block"})}else{slider.children.css({display:"block"})}slider.controls.el=$('<div class="wpmslider-controls" />');if(slider.settings.captions){appendCaptions()}slider.active.last=slider.settings.startSlide===getPagerQty()-1;if(slider.settings.video){el.fitVids()}if(slider.settings.preloadImages==="none"){preloadSelector=null}else if(slider.settings.preloadImages==="all"){preloadSelector=slider.children}if(slider.settings.controls){appendControlPrev()}if(slider.settings.auto&&slider.settings.autoControls){appendControlsAuto()}if(slider.settings.pager){appendPager()}if(slider.settings.controls){appendControlNext()}if(slider.settings.controls||slider.settings.autoControls||slider.settings.pager){slider.viewport.after(slider.controls.el)}if(preloadSelector===null){start()}else{loadElements(preloadSelector,start)}};var setBreakpoint=function(){if(slider.debug)console.log(slider.logAs,"setBreakpoint");var currentBreakpoint=slider.settings.breakpoints.single;var breakpoints=slider.settings.breakpoints.multiple;if(slider.settings.type==="show_multiple"){for(var key in breakpoints){if(breakpoints.hasOwnProperty(key)){if(verge.viewportW()>=breakpoints[key].width){currentBreakpoint=breakpoints[key];break}}}}if(slider.debug)console.log("current breakpoint",currentBreakpoint);slider.settings.maxSlides=currentBreakpoint.maxSlides;slider.settings.moveSlides=currentBreakpoint.moveSlides;slider.settings.slideMargin=currentBreakpoint.slideMargin;slider.carousel=slider.settings.minSlides>1||slider.settings.maxSlides>1};var updateWidth=function(){setBreakpoint();slider.children.css("width",getSlideWidth2())};var loadElements=function(selector,callback){var total=selector.find('img:not([src=""]), iframe').length,count=0;if(total===0){callback();return}selector.find('img:not([src=""]), iframe').each(function(){$(this).one("load error",function(){if(++count===total){callback()}}).each(function(){if(this.complete||this.src===""){$(this).trigger("load")}})})};var start=function(){if(slider.settings.infiniteLoop&&slider.settings.mode!=="fade"){var slice=slider.settings.mode==="vertical"?slider.settings.minSlides:slider.settings.maxSlides,sliceAppend=slider.children.slice(0,slice).clone(true).addClass("wpmslider-clone"),slicePrepend=slider.children.slice(-slice).clone(true).addClass("wpmslider-clone");if(slider.settings.ariaHidden){sliceAppend.attr("aria-hidden",true);slicePrepend.attr("aria-hidden",true)}el.append(sliceAppend).prepend(slicePrepend)}slider.loader.remove();if(slider.settings.mode==="vertical"){slider.settings.adaptiveHeight=true}el.redrawSlider();slider.settings.onSliderLoad.call(el,slider.active.index);slider.initialized=true;slider.visibilityInterval=setInterval(visibilityCheck,500);if(slider.settings.responsive){attachListeners()}if(slider.settings.auto&&slider.settings.autoStart&&(getPagerQty()>1||slider.settings.autoSlideForOnePage)){initAuto()}if(slider.settings.pager){updatePagerActive(slider.settings.startSlide)}if(slider.settings.controls){updateDirectionControls()}if(slider.settings.touchEnabled){initTouch()}if(slider.settings.keyboardEnabled){$(document).keydown(keyPress)}};var attachListeners=function(){window.addEventListener("resize",updateLayout,false);window.addEventListener("orientationchange",updateLayout,false);window.addEventListener("toggleFullContent",updateLayout,false);window.addEventListener("blur",function(){pauseEvent("blur")});window.addEventListener("focus",function(){playEvent("blur")})};var updateLayout=_.debounce(function(){if(slider.debug)console.log(slider.logAs,"updateLayout");resizeWindow()},250);var visibilityCheck=function(){if(!slider.settings.auto){return}if(!reallyVisible()){pauseEvent("hide")}else{playEvent("hide")}if(!verge.inViewport(el)){pauseEvent("scroll")}else{playEvent("scroll")}};var pauseEvent=function(action){if(slider.interval){el.stopAuto(true);slider.autoPaused=action;if(slider.debug)console.log(slider.logAs,"pause",action)}};var playEvent=function(action){if(slider.autoPaused===action){el.startAuto(true);slider.autoPaused=null;if(slider.debug)console.log(slider.logAs,"play",action)}};var setSlideHeight=function(){var heights=slider.children.map(function(){return jQuery(this).actual("outerHeight")}).get();var maxHeight=arrayMax(heights);slider.children.height(maxHeight)};var unsetSlideHeight=function(){slider.children.height("auto")};var arrayMax=function(array){return Math.max.apply(Math,array)};var getViewportHeight=function(){var height=0;var children=$();if(slider.settings.mode!=="vertical"&&!slider.settings.adaptiveHeight){children=slider.children}else{if(!slider.carousel){children=slider.children.eq(slider.active.index)}else{var currentIndex=slider.settings.moveSlides===1?slider.active.index:slider.active.index*getMoveBy();children=slider.children.eq(currentIndex);for(var i=1;i<=slider.settings.maxSlides-1;i++){if(currentIndex+i>=slider.children.length){children=children.add(slider.children.eq(i-1))}else{children=children.add(slider.children.eq(currentIndex+i))}}}}if(slider.settings.mode==="vertical"){children.each(function(index){height+=$(this).outerHeight()});if(slider.settings.slideMargin>0){height+=slider.settings.slideMargin*(slider.settings.minSlides-1)}}else{height=Math.max.apply(Math,children.map(function(){return $(this).outerHeight(false)}).get())}if(slider.viewport.css("box-sizing")==="border-box"){height+=parseFloat(slider.viewport.css("padding-top"))+parseFloat(slider.viewport.css("padding-bottom"))+parseFloat(slider.viewport.css("border-top-width"))+parseFloat(slider.viewport.css("border-bottom-width"))}else if(slider.viewport.css("box-sizing")==="padding-box"){height+=parseFloat(slider.viewport.css("padding-top"))+parseFloat(slider.viewport.css("padding-bottom"))}return height};var setViewportHeight=function(){slider.viewport.height(getViewportHeight()+2)};var getViewportMaxWidth2=function(){return"100%"};var getSlideWidth2=function(){var wrapWidth=slider.viewport.width();var margins=slider.settings.slideMargin*(slider.settings.maxSlides-1);return Math.floor((wrapWidth-margins)/slider.settings.maxSlides)};var getNumberSlidesShowing2=function(){return slider.settings.maxSlides};var getPagerQty=function(){var pagerQty=0,breakPoint=0,counter=0;if(slider.settings.moveSlides>0){if(slider.settings.infiniteLoop){pagerQty=Math.ceil(slider.children.length/getMoveBy())}else{while(breakPoint<slider.children.length){++pagerQty;breakPoint=counter+getNumberSlidesShowing2();counter+=slider.settings.moveSlides<=getNumberSlidesShowing2()?slider.settings.moveSlides:getNumberSlidesShowing2()}return counter}}else{pagerQty=Math.ceil(slider.children.length/getNumberSlidesShowing2())}return pagerQty};var getMoveBy=function(){if(slider.settings.moveSlides>0&&slider.settings.moveSlides<=getNumberSlidesShowing2()){return slider.settings.moveSlides}return getNumberSlidesShowing2()};var setSlidePosition=function(){var position,lastChild,lastShowingIndex;if(slider.children.length>slider.settings.maxSlides&&slider.active.last&&!slider.settings.infiniteLoop){if(slider.settings.mode==="horizontal"){lastChild=slider.children.last();position=lastChild.position();setPositionProperty(-(position.left-(slider.viewport.width()-lastChild.outerWidth())),"reset",0)}else if(slider.settings.mode==="vertical"){lastShowingIndex=slider.children.length-slider.settings.minSlides;position=slider.children.eq(lastShowingIndex).position();setPositionProperty(-position.top,"reset",0)}}else{position=slider.children.eq(slider.active.index*getMoveBy()).position();if(slider.active.index===getPagerQty()-1){slider.active.last=true}if(position!==undefined){if(slider.settings.mode==="horizontal"){setPositionProperty(-position.left,"reset",0)}else if(slider.settings.mode==="vertical"){setPositionProperty(-position.top,"reset",0)}else if(slider.settings.mode==="none"){setPositionProperty(-position.top,"reset",0)}}}};var setPositionProperty=function(value,type,duration,params){var animateObj,propValue;if(slider.usingCSS){if(slider.settings.mode==="vertical"){propValue="translateY("+value+"px)"}else if(slider.settings.mode==="horizontal"){propValue="translateX("+value+"px"}else if(slider.settings.mode==="none"){propValue="translateY("+value+"px)";duration=0}el.css("-"+slider.cssPrefix+"-transition-duration",duration/1e3+"s");if(type==="slide"){el.css(slider.animProp,propValue);if(duration!==0){el.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(e){if(!$(e.target).is(el)){return}el.off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd");updateAfterSlideTransition()})}else{updateAfterSlideTransition()}}else if(type==="reset"){el.css(slider.animProp,propValue)}}else{animateObj={};animateObj[slider.animProp]=value;if(type==="slide"){el.animate(animateObj,duration,slider.settings.easing,function(){updateAfterSlideTransition()})}else if(type==="reset"){el.css(slider.animProp,value)}}};var populatePager=function(){var pagerHtml="",linkContent="",pagerQty=getPagerQty();for(var i=0;i<pagerQty;i++){linkContent="";if(slider.settings.buildPager){if(slider.settings.buildPager==="icons"){linkContent=""}if($.isFunction(slider.settings.buildPager)||slider.settings.pagerCustom){linkContent=slider.settings.buildPager(i)}slider.pagerEl.addClass("wpmslider-custom-pager")}else{linkContent=i+1;slider.pagerEl.addClass("wpmslider-default-pager")}pagerHtml+='<div class="wpmslider-pager-item"><a href="" data-slide-index="'+i+'" class="wpmslider-pager-link">'+linkContent+"</a></div>"}slider.pagerEl.html(pagerHtml)};var appendPager=function(){if(!slider.settings.pagerCustom){slider.pagerEl=$('<div class="wpmslider-pager" />');if(slider.settings.pagerSelector){$(slider.settings.pagerSelector).html(slider.pagerEl)}else{slider.controls.el.addClass("wpmslider-has-pager").append(slider.pagerEl)}populatePager()}else{slider.pagerEl=$(slider.settings.pagerCustom)}slider.pagerEl.on("click touchend","a",clickPagerBind)};var appendControlPrev=function(){slider.controls.prev=$('<a class="wpmslider-prev" href="">'+slider.settings.prevText+"</a>");slider.controls.prev.on("click touchend",clickPrevBind);if(slider.settings.prevSelector){$(slider.settings.prevSelector).append(slider.controls.prev)}if(!slider.settings.prevSelector){slider.controls.directionEl=$('<div class="wpmslider-controls-direction" />');slider.controls.directionEl.append(slider.controls.prev);slider.controls.el.addClass("wpmslider-has-controls-direction").append(slider.controls.directionEl)}};var appendControlNext=function(){slider.controls.next=$('<a class="wpmslider-next" href="">'+slider.settings.nextText+"</a>");slider.controls.next.on("click touchend",clickNextBind);if(slider.settings.nextSelector){$(slider.settings.nextSelector).append(slider.controls.next)}if(!slider.settings.nextSelector){slider.controls.directionEl=$('<div class="wpmslider-controls-direction" />');slider.controls.directionEl.append(slider.controls.next);slider.controls.el.addClass("wpmslider-has-controls-direction").append(slider.controls.directionEl)}};var appendControlsAuto=function(){slider.controls.start=$('<div class="wpmslider-controls-auto-item"><a class="wpmslider-start" href="">'+slider.settings.startText+"</a></div>");slider.controls.stop=$('<div class="wpmslider-controls-auto-item"><a class="wpmslider-stop" href="">'+slider.settings.stopText+"</a></div>");slider.controls.autoEl=$('<div class="wpmslider-controls-auto" />');slider.controls.autoEl.on("click",".wpmslider-start",clickStartBind);slider.controls.autoEl.on("click",".wpmslider-stop",clickStopBind);if(slider.settings.autoControlsCombine){slider.controls.autoEl.append(slider.controls.start)}else{slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop)}if(slider.settings.autoControlsSelector){$(slider.settings.autoControlsSelector).html(slider.controls.autoEl)}else{slider.controls.el.addClass("wpmslider-has-controls-auto").append(slider.controls.autoEl)}updateAutoControls(slider.settings.autoStart?"stop":"start")};var appendCaptions=function(){slider.children.each(function(index){var title=$(this).find("img:first").attr("title");if(title!==undefined&&(""+title).length){$(this).append('<div class="wpmslider-caption"><span>'+title+"</span></div>")}})};var clickNextBind=function(e){e.preventDefault();e.stopPropagation();if(slider.controls.el.hasClass("disabled")){return}if(slider.settings.auto&&slider.settings.stopAutoOnClick){if(slider.debug)console.log(slider.logAs,"stop on navigation");el.stopAuto()}el.goToNextSlide()};var clickPrevBind=function(e){e.preventDefault();e.stopPropagation();if(slider.controls.el.hasClass("disabled")){return}if(slider.settings.auto&&slider.settings.stopAutoOnClick){if(slider.debug)console.log(slider.logAs,"stop on navigation");el.stopAuto()}el.goToPrevSlide()};var clickStartBind=function(e){el.startAuto();e.preventDefault();e.stopPropagation()};var clickStopBind=function(e){el.stopAuto();e.preventDefault();e.stopPropagation()};var clickPagerBind=function(e){var pagerLink,pagerIndex;e.preventDefault();e.stopPropagation();if(slider.controls.el.hasClass("disabled")){return}if(slider.settings.auto&&slider.settings.stopAutoOnClick){if(slider.debug)console.log(slider.logAs,"stop on navigation");el.stopAuto()}pagerLink=$(e.currentTarget);if(pagerLink.attr("data-slide-index")!==undefined){pagerIndex=parseInt(pagerLink.attr("data-slide-index"));if(pagerIndex!==slider.active.index){el.goToSlide(pagerIndex)}}};var updatePagerActive=function(slideIndex){var len=slider.children.length;if(slider.settings.pagerType==="short"){if(slider.settings.maxSlides>1){len=Math.ceil(slider.children.length/slider.settings.maxSlides)}slider.pagerEl.html(slideIndex+1+slider.settings.pagerShortSeparator+len);return}slider.pagerEl.find("a").removeClass("active");slider.pagerEl.each(function(i,el){$(el).find("a").eq(slideIndex).addClass("active")})};var updateAfterSlideTransition=function(){if(slider.settings.infiniteLoop){var position="";if(slider.active.index===0){position=slider.children.eq(0).position()}else if(slider.active.index===getPagerQty()-1&&slider.carousel){position=slider.children.eq((getPagerQty()-1)*getMoveBy()).position()}else if(slider.active.index===slider.children.length-1){position=slider.children.eq(slider.children.length-1).position()}if(position){if(slider.settings.mode==="horizontal"){setPositionProperty(-position.left,"reset",0)}else if(slider.settings.mode==="vertical"){setPositionProperty(-position.top,"reset",0)}}}slider.working=false;slider.settings.onSlideAfter.call(el,slider.children.eq(slider.active.index),slider.oldIndex,slider.active.index)};var updateAutoControls=function(state){if(slider.settings.autoControlsCombine){slider.controls.autoEl.html(slider.controls[state])}else{slider.controls.autoEl.find("a").removeClass("active");slider.controls.autoEl.find("a:not(.wpmslider-"+state+")").addClass("active")}};var updateDirectionControls=function(){if(getPagerQty()===1){slider.controls.prev.addClass("disabled");slider.controls.next.addClass("disabled")}else if(!slider.settings.infiniteLoop&&slider.settings.hideControlOnEnd){if(slider.active.index===0){slider.controls.prev.addClass("disabled");slider.controls.next.removeClass("disabled")}else if(slider.active.index===getPagerQty()-1){slider.controls.next.addClass("disabled");slider.controls.prev.removeClass("disabled")}else{slider.controls.prev.removeClass("disabled");slider.controls.next.removeClass("disabled")}}};var initAuto=function(){if(slider.settings.autoDelay>0){setTimeout(el.startAuto,slider.settings.autoDelay)}else{el.startAuto()}if(slider.settings.autoHover){el.hover(function(){pauseEvent("hover")},function(){playEvent("hover")})}};var keyPress=function(e){var activeElementTag=document.activeElement.tagName.toLowerCase(),tagFilters="input|textarea",p=new RegExp(activeElementTag,["i"]),result=p.exec(tagFilters);if(result===null&&verge.inViewport(el)){if(e.keyCode===39){clickNextBind(e);return false}else if(e.keyCode===37){clickPrevBind(e);return false}}};var initTouch=function(){slider.touch={start:{x:0,y:0},end:{x:0,y:0}};slider.viewport.on("touchstart MSPointerDown pointerdown",onTouchStart);slider.viewport.on("click",".wpmslider a",function(e){if(slider.viewport.hasClass("click-disabled")){e.preventDefault();e.stopPropagation();slider.viewport.removeClass("click-disabled")}})};var onTouchStart=function(e){if(e.type!=="touchstart"&&e.button!==0){return}slider.controls.el.addClass("disabled");if(slider.working){e.preventDefault();e.stopPropagation();slider.controls.el.removeClass("disabled")}else{slider.touch.originalPos=el.position();var orig=e.originalEvent,touchPoints=typeof orig.changedTouches!=="undefined"?orig.changedTouches:[orig];var chromePointerEvents=typeof PointerEvent==="function";if(chromePointerEvents){if(orig.pointerId===undefined){return}}slider.touch.start.x=touchPoints[0].pageX;slider.touch.start.y=touchPoints[0].pageY;if(slider.viewport.get(0).setPointerCapture){slider.pointerId=orig.pointerId;slider.viewport.get(0).setPointerCapture(slider.pointerId)}slider.originalClickTarget=orig.originalTarget||orig.target;slider.originalClickButton=orig.button;slider.originalClickButtons=orig.buttons;slider.originalEventType=orig.type;slider.hasMove=false;slider.viewport.on("touchmove MSPointerMove pointermove",onTouchMove);slider.viewport.on("touchend MSPointerUp pointerup",onTouchEnd);slider.viewport.on("MSPointerCancel pointercancel",onPointerCancel)}};var onPointerCancel=function(e){e.preventDefault();setPositionProperty(slider.touch.originalPos.left,"reset",0);slider.controls.el.removeClass("disabled");slider.viewport.off("MSPointerCancel pointercancel",onPointerCancel);slider.viewport.off("touchmove MSPointerMove pointermove",onTouchMove);slider.viewport.off("touchend MSPointerUp pointerup",onTouchEnd);if(slider.viewport.get(0).releasePointerCapture){slider.viewport.get(0).releasePointerCapture(slider.pointerId)}};var onTouchMove=function(e){var orig=e.originalEvent,touchPoints=typeof orig.changedTouches!=="undefined"?orig.changedTouches:[orig],xMovement=Math.abs(touchPoints[0].pageX-slider.touch.start.x),yMovement=Math.abs(touchPoints[0].pageY-slider.touch.start.y),value=0,change=0;slider.hasMove=true;if(xMovement*3>yMovement&&slider.settings.preventDefaultSwipeX){e.preventDefault();e.stopPropagation()}else if(yMovement*3>xMovement&&slider.settings.preventDefaultSwipeY){e.preventDefault();e.stopPropagation()}if(e.type!=="touchmove"){e.preventDefault()}if(slider.settings.mode!=="fade"&&slider.settings.oneToOneTouch){if(slider.settings.mode==="horizontal"){change=touchPoints[0].pageX-slider.touch.start.x;value=slider.touch.originalPos.left+change}else{change=touchPoints[0].pageY-slider.touch.start.y;value=slider.touch.originalPos.top+change}setPositionProperty(value,"reset",0)}};var onTouchEnd=function(e){e.preventDefault();slider.viewport.off("touchmove MSPointerMove pointermove",onTouchMove);slider.controls.el.removeClass("disabled");var orig=e.originalEvent,touchPoints=typeof orig.changedTouches!=="undefined"?orig.changedTouches:[orig],value=0,distance=0;slider.touch.end.x=touchPoints[0].pageX;slider.touch.end.y=touchPoints[0].pageY;if(slider.settings.mode==="fade"){distance=Math.abs(slider.touch.start.x-slider.touch.end.x);if(distance>=slider.settings.swipeThreshold){if(slider.touch.start.x>slider.touch.end.x){el.goToNextSlide()}else{el.goToPrevSlide()}el.stopAuto()}}else{if(slider.settings.mode==="horizontal"){distance=slider.touch.end.x-slider.touch.start.x;value=slider.touch.originalPos.left}else{distance=slider.touch.end.y-slider.touch.start.y;value=slider.touch.originalPos.top}if(!slider.settings.infiniteLoop&&(slider.active.index===0&&distance>0||slider.active.last&&distance<0)){setPositionProperty(value,"reset",200)}else{if(Math.abs(distance)>=slider.settings.swipeThreshold){if(distance<0){el.goToNextSlide()}else{el.goToPrevSlide()}el.stopAuto()}else{setPositionProperty(value,"reset",200)}}}slider.viewport.off("touchend MSPointerUp pointerup",onTouchEnd);if(slider.viewport.get(0).releasePointerCapture){slider.viewport.get(0).releasePointerCapture(slider.pointerId)}if(slider.hasMove===false&&(slider.originalClickButton===0||slider.originalEventType==="touchstart")){$(slider.originalClickTarget).trigger({type:"click",button:slider.originalClickButton,buttons:slider.originalClickButtons})}};var resizeWindow=function(e){if(!slider.initialized){if(slider.debug)console.log(slider.logAs,"slider not initialized");return}if(slider.working){if(slider.debug)console.log(slider.logAs,"slider working");window.setTimeout(resizeWindow,10)}else{el.redrawSlider();slider.settings.onSliderResize.call(el,slider.active.index)}};var applyAriaHiddenAttributes=function(startVisibleIndex){var numberOfSlidesShowing=getNumberSlidesShowing2();if(slider.settings.ariaHidden){slider.children.attr("aria-hidden","true");slider.children.slice(startVisibleIndex,startVisibleIndex+numberOfSlidesShowing).attr("aria-hidden","false")}};var setSlideIndex=function(slideIndex){if(slideIndex<0){if(slider.settings.infiniteLoop){return getPagerQty()-1}else{return slider.active.index}}else if(slideIndex>=getPagerQty()){if(slider.settings.infiniteLoop){return 0}else{return slider.active.index}}else{return slideIndex}};el.goToSlide=function(slideIndex,direction){var performTransition=true,moveBy=0,position={left:0,top:0},lastChild=null,lastShowingIndex,eq,value,requestEl;slider.oldIndex=slider.active.index;slider.active.index=setSlideIndex(slideIndex);if(slider.working||slider.active.index===slider.oldIndex){return}slider.working=true;performTransition=slider.settings.onSlideBefore.call(el,slider.children.eq(slider.active.index),slider.oldIndex,slider.active.index);if(typeof performTransition!=="undefined"&&!performTransition){slider.active.index=slider.oldIndex;slider.working=false;return}if(direction==="next"){if(!slider.settings.onSlideNext.call(el,slider.children.eq(slider.active.index),slider.oldIndex,slider.active.index)){performTransition=false}}else if(direction==="prev"){if(!slider.settings.onSlidePrev.call(el,slider.children.eq(slider.active.index),slider.oldIndex,slider.active.index)){performTransition=false}}slider.active.last=slider.active.index>=getPagerQty()-1;if(slider.settings.pager||slider.settings.pagerCustom){updatePagerActive(slider.active.index)}if(slider.settings.controls){updateDirectionControls()}if(slider.settings.mode==="fade"){if(slider.settings.adaptiveHeight&&slider.viewport.height()!==getViewportHeight()){slider.viewport.animate({height:getViewportHeight()},slider.settings.adaptiveHeightSpeed)}slider.children.filter(":visible").fadeOut(slider.settings.speed).css({zIndex:0});slider.children.eq(slider.active.index).css("zIndex",slider.settings.slideZIndex+1).fadeIn(slider.settings.speed,function(){$(this).css("zIndex",slider.settings.slideZIndex);updateAfterSlideTransition()})}else{if(slider.settings.adaptiveHeight&&slider.viewport.height()!==getViewportHeight()){slider.viewport.animate({height:getViewportHeight()},slider.settings.adaptiveHeightSpeed)}if(!slider.settings.infiniteLoop&&slider.carousel&&slider.active.last){if(slider.settings.mode==="horizontal"){lastChild=slider.children.eq(slider.children.length-1);position=lastChild.position();moveBy=slider.viewport.width()-lastChild.outerWidth()}else{lastShowingIndex=slider.children.length-slider.settings.minSlides;position=slider.children.eq(lastShowingIndex).position()}}else if(slider.carousel&&slider.active.last&&direction==="prev"){eq=slider.settings.moveSlides===1?slider.settings.maxSlides-getMoveBy():(getPagerQty()-1)*getMoveBy()-(slider.children.length-slider.settings.maxSlides);lastChild=el.children(".wpmslider-clone").eq(eq);position=lastChild.position()}else if(direction==="next"&&slider.active.index===0){position=el.find("> .wpmslider-clone").eq(slider.settings.maxSlides).position();slider.active.last=false}else if(slideIndex>=0){requestEl=slideIndex*parseInt(getMoveBy());position=slider.children.eq(requestEl).position()}if(typeof position!=="undefined"){value=slider.settings.mode==="horizontal"?-(position.left-moveBy):-position.top;setPositionProperty(value,"slide",slider.settings.speed)}slider.working=false}if(slider.settings.ariaHidden){applyAriaHiddenAttributes(slider.active.index*getMoveBy())}};el.goToNextSlide=function(){if(!slider.settings.infiniteLoop&&slider.active.last){return}if(slider.working===true){return}var pagerIndex=parseInt(slider.active.index)+1;el.goToSlide(pagerIndex,"next")};el.goToPrevSlide=function(){if(!slider.settings.infiniteLoop&&slider.active.index===0){return}if(slider.working===true){return}var pagerIndex=parseInt(slider.active.index)-1;el.goToSlide(pagerIndex,"prev")};el.startAuto=function(preventControlUpdate){if(slider.interval){return}slider.interval=setInterval(function(){if(slider.settings.autoDirection==="next"){el.goToNextSlide()}else{el.goToPrevSlide()}},slider.settings.pause);slider.settings.onAutoChange.call(el,true);if(slider.settings.autoControls&&preventControlUpdate!==true){updateAutoControls("stop")}};el.stopAuto=function(preventControlUpdate){if(slider.autoPaused)slider.autoPaused=false;if(!slider.interval){return}clearInterval(slider.interval);slider.interval=null;slider.settings.onAutoChange.call(el,false);if(slider.settings.autoControls&&preventControlUpdate!==true){updateAutoControls("start")}};el.getCurrentSlide=function(){return slider.active.index};el.getCurrentSlideElement=function(){return slider.children.eq(slider.active.index)};el.getSlideElement=function(index){return slider.children.eq(index)};el.getSlideCount=function(){return slider.children.length};el.isWorking=function(){return slider.working};el.redrawSlider=function(){if(slider.debug)console.log(slider.logAs,"redrawSlider");updateWidth();unsetSlideHeight();setViewportHeight();if(slider.settings.stretch){setSlideHeight()}slider.children.add(el.find(".wpmslider-clone")).outerWidth(getSlideWidth2());setSlidePosition();if(slider.active.last){slider.active.index=getPagerQty()-1}if(slider.active.index>=getPagerQty()){slider.active.last=true}if(slider.settings.pager&&!slider.settings.pagerCustom){populatePager();updatePagerActive(slider.active.index)}if(slider.settings.ariaHidden){applyAriaHiddenAttributes(slider.active.index*getMoveBy())}};el.destroySlider=function(){if(!slider.initialized){return}slider.initialized=false;$(".wpmslider-clone",this).remove();slider.children.each(function(){if($(this).data("origStyle")!==undefined){$(this).attr("style",$(this).data("origStyle"))}else{$(this).removeAttr("style")}});if($(this).data("origStyle")!==undefined){this.attr("style",$(this).data("origStyle"))}else{$(this).removeAttr("style")}$(this).unwrap().unwrap();if(slider.controls.el){slider.controls.el.remove()}if(slider.controls.next){slider.controls.next.remove()}if(slider.controls.prev){slider.controls.prev.remove()}if(slider.pagerEl&&slider.settings.controls&&!slider.settings.pagerCustom){slider.pagerEl.remove()}$(".wpmslider-caption",this).remove();if(slider.controls.autoEl){slider.controls.autoEl.remove()}clearInterval(slider.interval);clearInterval(slider.visibilityInterval);if(slider.settings.responsive){$(window).off("resize",resizeWindow)}if(slider.settings.keyboardEnabled){$(document).off("keydown",keyPress)}$(this).removeData("strongSlider")};el.reloadSlider=function(settings){if(settings!==undefined){options=settings}el.destroySlider();init();$(el).data("strongSlider",this)};init();$(el).data("strongSlider",this);viewEl.attr("data-state","init");if(slider.debug)console.log(slider.logAs,"viewport",verge.viewportW(),"x",verge.viewportH());return this}})(jQuery);
1
+ !function(G){var J={debug:!1,logAs:"strongSlider",compat:{lazyload:{active:!1,classes:{}}},mode:"horizontal",slideSelector:"div.t-slide",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:10,startSlide:0,randomStart:!1,captions:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,wrapperClass:"wpmslider-wrapper",stretch:!1,imagesLoaded:!0,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,ariaLive:!0,ariaHidden:!0,keyboardEnabled:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!0,pause:4e3,autoStart:!0,autoDirection:"next",stopAutoOnClick:!1,autoHover:!1,autoDelay:0,autoSlideForOnePage:!1,minSlides:1,maxSlides:1,moveSlides:0,onSliderLoad:function(){return!0},onSlideBefore:function(){return!0},onSlideAfter:function(){return!0},onSlideNext:function(){return!0},onSlidePrev:function(){return!0},onSliderResize:function(){return!0},onAutoChange:function(){return!0}};G.fn.strongSlider=function(i){if(0===this.length)return this;var g={},o=this,p=this.find(".wpmslider-content");if(!G(p).data("strongSlider")){var t=function(){if(!G(p).data("strongSlider")){g.visibilityInterval=0,g.hidden=!1;var e=o.data("slider-var"),t={};void 0!==window[e]&&(t=window[e].config),g.settings=G.extend({},J,t,i),g.debug=g.settings.debug,g.logAs=g.settings.logAs,g.debug&&console.log(g.logAs,"slider.settings",g.settings),g.children=p.children(g.settings.slideSelector),g.children.length<g.settings.minSlides&&(g.settings.minSlides=g.children.length),g.children.length<g.settings.maxSlides&&(g.settings.maxSlides=g.children.length),g.settings.randomStart&&(g.settings.startSlide=Math.floor(Math.random()*g.children.length)),g.active={index:g.settings.startSlide},r(),g.carousel&&(g.settings.preloadImages="all"),g.working=!1,g.controls={},g.interval=null,g.animProp="vertical"===g.settings.mode?"top":"left",g.usingCSS=g.settings.useCSS&&"fade"!==g.settings.mode&&function(){for(var e=document.createElement("div"),t=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"],i=0;i<t.length;i++)if(void 0!==e.style[t[i]])return g.cssPrefix=t[i].replace("Perspective","").toLowerCase(),g.animProp="-"+g.cssPrefix+"-transform",!0;return!1}(),"vertical"===g.settings.mode&&(g.settings.maxSlides=g.settings.minSlides),p.data("origStyle",p.attr("style")),p.children(g.settings.slideSelector).each(function(){G(this).data("origStyle",G(this).attr("style"))}),p.getSlideCount()&&(g.settings.imagesLoaded?o.imagesLoaded(function(){n()}):n())}},e=function(){return o.is(":visible")&&"hidden"!==o.css("visibility")},n=function(){e()&&function(){if(g.settings.compat.lazyload){for(var e=!1,t=0,i=g.settings.compat.lazyload.classes.length;t<i;t++){var n=g.settings.compat.lazyload.classes[t].start,s=g.settings.compat.lazyload.classes[t].finish;n&&s?o.find("img."+n).length&&!o.find("img."+s).length&&(e=!0):n?o.find("img."+n).length&&(e=!0):s&&(o.find("img."+s).length||(e=!0))}if(e)return g.debug&&console.log(g.logAs,"lazy loading..."),!1}return g.debug&&console.log(g.logAs,"compat check complete"),!0}()?(clearInterval(g.visibilityInterval),s()):0===g.visibilityInterval&&(g.visibilityInterval=setInterval(n,4e3))},s=function(){var e=g.children.eq(g.settings.startSlide);p.wrap('<div class="'+g.settings.wrapperClass+'"><div class="wpmslider-viewport"></div></div>'),g.viewport=p.parent(),g.settings.ariaLive&&g.viewport.attr("aria-live","polite"),g.loader=G('<div class="wpmslider-loading" />'),g.viewport.prepend(g.loader),p.css({width:"horizontal"===g.settings.mode?1e3*g.children.length+215+"%":"auto",position:"relative"}),g.usingCSS&&g.settings.easing?p.css("-"+g.cssPrefix+"-transition-timing-function",g.settings.easing):g.settings.easing||(g.settings.easing="swing"),g.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),g.viewport.parent().css({maxWidth:w()}),g.settings.pager||g.settings.controls||g.viewport.parent().css({margin:"0 auto"}),g.children.css({float:"horizontal"===g.settings.mode?"left":"none",listStyle:"none",position:"relative"}),a(),"horizontal"===g.settings.mode&&0<g.settings.slideMargin&&g.children.css("marginRight",g.settings.slideMargin),"vertical"===g.settings.mode&&0<g.settings.slideMargin&&g.children.css("marginBottom",g.settings.slideMargin),"fade"===g.settings.mode?(g.children.css({position:"absolute",zIndex:0,display:"none"}),g.children.eq(g.settings.startSlide).css({zIndex:g.settings.slideZIndex,display:"block"})):g.children.css({display:"block"}),g.controls.el=G('<div class="wpmslider-controls" />'),g.settings.captions&&A(),g.active.last=g.settings.startSlide===C()-1,g.settings.video&&p.fitVids(),"none"===g.settings.preloadImages?e=null:"all"===g.settings.preloadImages&&(e=g.children),g.settings.controls&&T(),g.settings.auto&&g.settings.autoControls&&M(),g.settings.pager&&k(),g.settings.controls&&I(),(g.settings.controls||g.settings.autoControls||g.settings.pager)&&g.viewport.after(g.controls.el),null===e?d():l(e,d)},r=function(){g.debug&&console.log(g.logAs,"setBreakpoint");var e=g.settings.breakpoints.single,t=g.settings.breakpoints.multiple;if("show_multiple"===g.settings.type)for(var i in t)if(t.hasOwnProperty(i)&&verge.viewportW()>=t[i].width){e=t[i];break}g.debug&&console.log("current breakpoint",e),g.settings.maxSlides=e.maxSlides,g.settings.moveSlides=e.moveSlides,g.settings.slideMargin=e.slideMargin,g.carousel=1<g.settings.minSlides||1<g.settings.maxSlides},a=function(){r(),g.children.css("width",x())},l=function(e,t){var i=e.find('img:not([src=""]), iframe').length,n=0;0!==i?e.find('img:not([src=""]), iframe').each(function(){G(this).one("load error",function(){++n===i&&t()}).each(function(){(this.complete||""===this.src)&&G(this).trigger("load")})}):t()},d=function(){if(g.settings.infiniteLoop&&"fade"!==g.settings.mode){var e="vertical"===g.settings.mode?g.settings.minSlides:g.settings.maxSlides,t=g.children.slice(0,e).clone(!0).addClass("wpmslider-clone"),i=g.children.slice(-e).clone(!0).addClass("wpmslider-clone");g.settings.ariaHidden&&(t.attr("aria-hidden",!0),i.attr("aria-hidden",!0)),p.append(t).prepend(i)}g.loader.remove(),"vertical"===g.settings.mode&&(g.settings.adaptiveHeight=!0),p.redrawSlider(),g.settings.onSliderLoad.call(p,g.active.index),g.initialized=!0,g.visibilityInterval=setInterval(v,500),g.settings.responsive&&c(),g.settings.auto&&g.settings.autoStart&&(1<C()||g.settings.autoSlideForOnePage)&&W(),g.settings.pager&&O(g.settings.startSlide),g.settings.controls&&N(),g.settings.touchEnabled&&X(),g.settings.keyboardEnabled&&G(document).keydown(Y)},c=function(){window.addEventListener("resize",u,!1),window.addEventListener("orientationchange",u,!1),window.addEventListener("toggleFullContent",u,!1),window.addEventListener("blur",function(){h("blur")}),window.addEventListener("focus",function(){f("blur")})},u=_.debounce(function(){g.debug&&console.log(g.logAs,"updateLayout"),j()},250),v=function(){g.settings.auto&&(e()?f("hide"):h("hide"),verge.inViewport(p)?f("scroll"):h("scroll"))},h=function(e){g.interval&&(p.stopAuto(!0),g.autoPaused=e,g.debug&&console.log(g.logAs,"pause",e))},f=function(e){g.autoPaused===e&&(p.startAuto(!0),g.autoPaused=null,g.debug&&console.log(g.logAs,"play",e))},m=function(e){return Math.max.apply(Math,e)},S=function(){var t=0,e=G();if("vertical"===g.settings.mode||g.settings.adaptiveHeight)if(g.carousel){var i=1===g.settings.moveSlides?g.active.index:g.active.index*y();e=g.children.eq(i);for(var n=1;n<=g.settings.maxSlides-1;n++)e=i+n>=g.children.length?e.add(g.children.eq(n-1)):e.add(g.children.eq(i+n))}else e=g.children.eq(g.active.index);else e=g.children;return"vertical"===g.settings.mode?(e.each(function(e){t+=G(this).outerHeight()}),0<g.settings.slideMargin&&(t+=g.settings.slideMargin*(g.settings.minSlides-1))):t=Math.max.apply(Math,e.map(function(){return G(this).outerHeight(!1)}).get()),"border-box"===g.viewport.css("box-sizing")?t+=parseFloat(g.viewport.css("padding-top"))+parseFloat(g.viewport.css("padding-bottom"))+parseFloat(g.viewport.css("border-top-width"))+parseFloat(g.viewport.css("border-bottom-width")):"padding-box"===g.viewport.css("box-sizing")&&(t+=parseFloat(g.viewport.css("padding-top"))+parseFloat(g.viewport.css("padding-bottom"))),t},w=function(){return"100%"},x=function(){var e=g.viewport.width(),t=g.settings.slideMargin*(g.settings.maxSlides-1);return Math.floor((e-t)/g.settings.maxSlides)},b=function(){return g.settings.maxSlides},C=function(){var e=0,t=0,i=0;if(0<g.settings.moveSlides){if(!g.settings.infiniteLoop){for(;t<g.children.length;)++e,t=i+b(),i+=g.settings.moveSlides<=b()?g.settings.moveSlides:b();return i}e=Math.ceil(g.children.length/y())}else e=Math.ceil(g.children.length/b());return e},y=function(){return 0<g.settings.moveSlides&&g.settings.moveSlides<=b()?g.settings.moveSlides:b()},P=function(e,t,i,n){var s,o;g.usingCSS?("vertical"===g.settings.mode?o="translateY("+e+"px)":"horizontal"===g.settings.mode?o="translateX("+e+"px":"none"===g.settings.mode&&(o="translateY("+e+"px)",i=0),p.css("-"+g.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"===t?(p.css(g.animProp,o),0!==i?p.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(e){G(e.target).is(p)&&(p.off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),F())}):F()):"reset"===t&&p.css(g.animProp,o)):((s={})[g.animProp]=e,"slide"===t?p.animate(s,i,g.settings.easing,function(){F()}):"reset"===t&&p.css(g.animProp,e))},E=function(){for(var e="",t="",i=C(),n=0;n<i;n++)t="",g.settings.buildPager?("icons"===g.settings.buildPager&&(t=""),(G.isFunction(g.settings.buildPager)||g.settings.pagerCustom)&&(t=g.settings.buildPager(n)),g.pagerEl.addClass("wpmslider-custom-pager")):(t=n+1,g.pagerEl.addClass("wpmslider-default-pager")),e+='<div class="wpmslider-pager-item"><a href="" data-slide-index="'+n+'" class="wpmslider-pager-link">'+t+"</a></div>";g.pagerEl.html(e)},k=function(){g.settings.pagerCustom?g.pagerEl=G(g.settings.pagerCustom):(g.pagerEl=G('<div class="wpmslider-pager" />'),g.settings.pagerSelector?G(g.settings.pagerSelector).html(g.pagerEl):g.controls.el.addClass("wpmslider-has-pager").append(g.pagerEl),E()),g.pagerEl.on("click touchend","a",H)},T=function(){g.controls.prev=G('<a class="wpmslider-prev" href="">'+g.settings.prevText+"</a>"),g.controls.prev.on("click touchend",L),g.settings.prevSelector&&G(g.settings.prevSelector).append(g.controls.prev),g.settings.prevSelector||(g.controls.directionEl=G('<div class="wpmslider-controls-direction" />'),g.controls.directionEl.append(g.controls.prev),g.controls.el.addClass("wpmslider-has-controls-direction").append(g.controls.directionEl))},I=function(){g.controls.next=G('<a class="wpmslider-next" href="">'+g.settings.nextText+"</a>"),g.controls.next.on("click touchend",z),g.settings.nextSelector&&G(g.settings.nextSelector).append(g.controls.next),g.settings.nextSelector||(g.controls.directionEl=G('<div class="wpmslider-controls-direction" />'),g.controls.directionEl.append(g.controls.next),g.controls.el.addClass("wpmslider-has-controls-direction").append(g.controls.directionEl))},M=function(){g.controls.start=G('<div class="wpmslider-controls-auto-item"><a class="wpmslider-start" href="">'+g.settings.startText+"</a></div>"),g.controls.stop=G('<div class="wpmslider-controls-auto-item"><a class="wpmslider-stop" href="">'+g.settings.stopText+"</a></div>"),g.controls.autoEl=G('<div class="wpmslider-controls-auto" />'),g.controls.autoEl.on("click",".wpmslider-start",q),g.controls.autoEl.on("click",".wpmslider-stop",D),g.settings.autoControlsCombine?g.controls.autoEl.append(g.controls.start):g.controls.autoEl.append(g.controls.start).append(g.controls.stop),g.settings.autoControlsSelector?G(g.settings.autoControlsSelector).html(g.controls.autoEl):g.controls.el.addClass("wpmslider-has-controls-auto").append(g.controls.autoEl),B(g.settings.autoStart?"stop":"start")},A=function(){g.children.each(function(e){var t=G(this).find("img:first").attr("title");void 0!==t&&(""+t).length&&G(this).append('<div class="wpmslider-caption"><span>'+t+"</span></div>")})},z=function(e){e.preventDefault(),e.stopPropagation(),g.controls.el.hasClass("disabled")||(g.settings.auto&&g.settings.stopAutoOnClick&&(g.debug&&console.log(g.logAs,"stop on navigation"),p.stopAuto()),p.goToNextSlide())},L=function(e){e.preventDefault(),e.stopPropagation(),g.controls.el.hasClass("disabled")||(g.settings.auto&&g.settings.stopAutoOnClick&&(g.debug&&console.log(g.logAs,"stop on navigation"),p.stopAuto()),p.goToPrevSlide())},q=function(e){p.startAuto(),e.preventDefault(),e.stopPropagation()},D=function(e){p.stopAuto(),e.preventDefault(),e.stopPropagation()},H=function(e){var t,i;e.preventDefault(),e.stopPropagation(),g.controls.el.hasClass("disabled")||(g.settings.auto&&g.settings.stopAutoOnClick&&(g.debug&&console.log(g.logAs,"stop on navigation"),p.stopAuto()),void 0!==(t=G(e.currentTarget)).attr("data-slide-index")&&(i=parseInt(t.attr("data-slide-index")))!==g.active.index&&p.goToSlide(i))},O=function(i){var e=g.children.length;if("short"===g.settings.pagerType)return 1<g.settings.maxSlides&&(e=Math.ceil(g.children.length/g.settings.maxSlides)),void g.pagerEl.html(i+1+g.settings.pagerShortSeparator+e);g.pagerEl.find("a").removeClass("active"),g.pagerEl.each(function(e,t){G(t).find("a").eq(i).addClass("active")})},F=function(){if(g.settings.infiniteLoop){var e="";0===g.active.index?e=g.children.eq(0).position():g.active.index===C()-1&&g.carousel?e=g.children.eq((C()-1)*y()).position():g.active.index===g.children.length-1&&(e=g.children.eq(g.children.length-1).position()),e&&("horizontal"===g.settings.mode?P(-e.left,"reset",0):"vertical"===g.settings.mode&&P(-e.top,"reset",0))}g.working=!1,g.settings.onSlideAfter.call(p,g.children.eq(g.active.index),g.oldIndex,g.active.index)},B=function(e){g.settings.autoControlsCombine?g.controls.autoEl.html(g.controls[e]):(g.controls.autoEl.find("a").removeClass("active"),g.controls.autoEl.find("a:not(.wpmslider-"+e+")").addClass("active"))},N=function(){1===C()?(g.controls.prev.addClass("disabled"),g.controls.next.addClass("disabled")):!g.settings.infiniteLoop&&g.settings.hideControlOnEnd&&(0===g.active.index?(g.controls.prev.addClass("disabled"),g.controls.next.removeClass("disabled")):g.active.index===C()-1?(g.controls.next.addClass("disabled"),g.controls.prev.removeClass("disabled")):(g.controls.prev.removeClass("disabled"),g.controls.next.removeClass("disabled")))},W=function(){0<g.settings.autoDelay?setTimeout(p.startAuto,g.settings.autoDelay):p.startAuto(),g.settings.autoHover&&p.hover(function(){h("hover")},function(){f("hover")})},Y=function(e){var t=document.activeElement.tagName.toLowerCase();if(null===new RegExp(t,["i"]).exec("input|textarea")&&verge.inViewport(p)){if(39===e.keyCode)return z(e),!1;if(37===e.keyCode)return L(e),!1}},X=function(){g.touch={start:{x:0,y:0},end:{x:0,y:0}},g.viewport.on("touchstart MSPointerDown pointerdown",R),g.viewport.on("click",".wpmslider a",function(e){g.viewport.hasClass("click-disabled")&&(e.preventDefault(),e.stopPropagation(),g.viewport.removeClass("click-disabled"))})},R=function(e){if(("touchstart"===e.type||0===e.button)&&!e.originalEvent.target.classList.contains("readmore-text"))if(g.controls.el.addClass("disabled"),g.working)e.preventDefault(),e.stopPropagation(),g.controls.el.removeClass("disabled");else{g.touch.originalPos=p.position();var t=e.originalEvent,i=void 0!==t.changedTouches?t.changedTouches:[t];if("function"==typeof PointerEvent&&void 0===t.pointerId)return;g.touch.start.x=i[0].pageX,g.touch.start.y=i[0].pageY,g.viewport.get(0).setPointerCapture&&(g.pointerId=t.pointerId,g.viewport.get(0).setPointerCapture(g.pointerId)),g.originalClickTarget=t.originalTarget||t.target,g.originalClickButton=t.button,g.originalClickButtons=t.buttons,g.originalEventType=t.type,g.hasMove=!1,g.viewport.on("touchmove MSPointerMove pointermove",U),g.viewport.on("touchend MSPointerUp pointerup",V),g.viewport.on("MSPointerCancel pointercancel",Z)}},Z=function(e){e.preventDefault(),P(g.touch.originalPos.left,"reset",0),g.controls.el.removeClass("disabled"),g.viewport.off("MSPointerCancel pointercancel",Z),g.viewport.off("touchmove MSPointerMove pointermove",U),g.viewport.off("touchend MSPointerUp pointerup",V),g.viewport.get(0).releasePointerCapture&&g.viewport.get(0).releasePointerCapture(g.pointerId)},U=function(e){var t=e.originalEvent,i=void 0!==t.changedTouches?t.changedTouches:[t],n=Math.abs(i[0].pageX-g.touch.start.x),s=Math.abs(i[0].pageY-g.touch.start.y),o=0,r=0;g.hasMove=!0,s<3*n&&g.settings.preventDefaultSwipeX?(e.preventDefault(),e.stopPropagation()):n<3*s&&g.settings.preventDefaultSwipeY&&(e.preventDefault(),e.stopPropagation()),"touchmove"!==e.type&&e.preventDefault(),"fade"!==g.settings.mode&&g.settings.oneToOneTouch&&(o="horizontal"===g.settings.mode?(r=i[0].pageX-g.touch.start.x,g.touch.originalPos.left+r):(r=i[0].pageY-g.touch.start.y,g.touch.originalPos.top+r),P(o,"reset",0))},V=function(e){e.preventDefault(),g.viewport.off("touchmove MSPointerMove pointermove",U),g.controls.el.removeClass("disabled");var t=e.originalEvent,i=void 0!==t.changedTouches?t.changedTouches:[t],n=0,s=0;g.touch.end.x=i[0].pageX,g.touch.end.y=i[0].pageY,"fade"===g.settings.mode?(s=Math.abs(g.touch.start.x-g.touch.end.x))>=g.settings.swipeThreshold&&(g.touch.start.x>g.touch.end.x?p.goToNextSlide():p.goToPrevSlide(),p.stopAuto()):(n="horizontal"===g.settings.mode?(s=g.touch.end.x-g.touch.start.x,g.touch.originalPos.left):(s=g.touch.end.y-g.touch.start.y,g.touch.originalPos.top),!g.settings.infiniteLoop&&(0===g.active.index&&0<s||g.active.last&&s<0)?P(n,"reset",200):Math.abs(s)>=g.settings.swipeThreshold?(s<0?p.goToNextSlide():p.goToPrevSlide(),p.stopAuto()):P(n,"reset",200)),g.viewport.off("touchend MSPointerUp pointerup",V),g.viewport.get(0).releasePointerCapture&&g.viewport.get(0).releasePointerCapture(g.pointerId),!1!==g.hasMove||0!==g.originalClickButton&&"touchstart"!==g.originalEventType||G(g.originalClickTarget).trigger({type:"click",button:g.originalClickButton,buttons:g.originalClickButtons})},j=function(e){g.initialized?g.working?(g.debug&&console.log(g.logAs,"slider working"),window.setTimeout(j,10)):(p.redrawSlider(),g.settings.onSliderResize.call(p,g.active.index)):g.debug&&console.log(g.logAs,"slider not initialized")},Q=function(e){var t=b();g.settings.ariaHidden&&(g.children.attr("aria-hidden","true"),g.children.slice(e,e+t).attr("aria-hidden","false"))};return p.goToSlide=function(e,t){var i,n,s,o,r,a=!0,l=0,d={left:0,top:0},c=null;if(g.oldIndex=g.active.index,g.active.index=(r=e)<0?g.settings.infiniteLoop?C()-1:g.active.index:r>=C()?g.settings.infiniteLoop?0:g.active.index:r,!g.working&&g.active.index!==g.oldIndex){if(g.working=!0,void 0!==(a=g.settings.onSlideBefore.call(p,g.children.eq(g.active.index),g.oldIndex,g.active.index))&&!a)return g.active.index=g.oldIndex,void(g.working=!1);"next"===t?g.settings.onSlideNext.call(p,g.children.eq(g.active.index),g.oldIndex,g.active.index)||(a=!1):"prev"===t&&(g.settings.onSlidePrev.call(p,g.children.eq(g.active.index),g.oldIndex,g.active.index)||(a=!1)),g.active.last=g.active.index>=C()-1,(g.settings.pager||g.settings.pagerCustom)&&O(g.active.index),g.settings.controls&&N(),"fade"===g.settings.mode?(g.settings.adaptiveHeight&&g.viewport.height()!==S()&&g.viewport.animate({height:S()},g.settings.adaptiveHeightSpeed),g.children.filter(":visible").fadeOut(g.settings.speed).css({zIndex:0}),g.children.eq(g.active.index).css("zIndex",g.settings.slideZIndex+1).fadeIn(g.settings.speed,function(){G(this).css("zIndex",g.settings.slideZIndex),F()})):(g.settings.adaptiveHeight&&g.viewport.height()!==S()&&g.viewport.animate({height:S()},g.settings.adaptiveHeightSpeed),!g.settings.infiniteLoop&&g.carousel&&g.active.last?"horizontal"===g.settings.mode?(d=(c=g.children.eq(g.children.length-1)).position(),l=g.viewport.width()-c.outerWidth()):(i=g.children.length-g.settings.minSlides,d=g.children.eq(i).position()):g.carousel&&g.active.last&&"prev"===t?(n=1===g.settings.moveSlides?g.settings.maxSlides-y():(C()-1)*y()-(g.children.length-g.settings.maxSlides),d=(c=p.children(".wpmslider-clone").eq(n)).position()):"next"===t&&0===g.active.index?(d=p.find("> .wpmslider-clone").eq(g.settings.maxSlides).position(),g.active.last=!1):0<=e&&(o=e*parseInt(y()),d=g.children.eq(o).position()),void 0!==d&&(s="horizontal"===g.settings.mode?-(d.left-l):-d.top,P(s,"slide",g.settings.speed))),g.settings.ariaHidden&&Q(g.active.index*y())}},p.goToNextSlide=function(){if((g.settings.infiniteLoop||!g.active.last)&&!0!==g.working){var e=parseInt(g.active.index)+1;p.goToSlide(e,"next")}},p.goToPrevSlide=function(){if((g.settings.infiniteLoop||0!==g.active.index)&&!0!==g.working){var e=parseInt(g.active.index)-1;p.goToSlide(e,"prev")}},p.startAuto=function(e){g.interval||(g.interval=setInterval(function(){"next"===g.settings.autoDirection?p.goToNextSlide():p.goToPrevSlide()},g.settings.pause),g.settings.onAutoChange.call(p,!0),g.settings.autoControls&&!0!==e&&B("stop"))},p.stopAuto=function(e){g.autoPaused&&(g.autoPaused=!1),g.interval&&(clearInterval(g.interval),g.interval=null,g.settings.onAutoChange.call(p,!1),g.settings.autoControls&&!0!==e&&B("start"))},p.getCurrentSlide=function(){return g.active.index},p.getCurrentSlideElement=function(){return g.children.eq(g.active.index)},p.getSlideElement=function(e){return g.children.eq(e)},p.getSlideCount=function(){return g.children.length},p.isWorking=function(){return g.working},p.redrawSlider=function(){var e,t,i,n,s;g.debug&&console.log(g.logAs,"redrawSlider"),a(),g.children.height("auto"),g.viewport.height(S()+2),g.settings.stretch&&(e=g.children.map(function(){return jQuery(this).actual("outerHeight")}).get(),t=m(e),g.children.height(t)),g.children.add(p.find(".wpmslider-clone")).outerWidth(x()),g.children.length>g.settings.maxSlides&&g.active.last&&!g.settings.infiniteLoop?"horizontal"===g.settings.mode?(i=(n=g.children.last()).position(),P(-(i.left-(g.viewport.width()-n.outerWidth())),"reset",0)):"vertical"===g.settings.mode&&(s=g.children.length-g.settings.minSlides,i=g.children.eq(s).position(),P(-i.top,"reset",0)):(i=g.children.eq(g.active.index*y()).position(),g.active.index===C()-1&&(g.active.last=!0),void 0!==i&&("horizontal"===g.settings.mode?P(-i.left,"reset",0):"vertical"===g.settings.mode?P(-i.top,"reset",0):"none"===g.settings.mode&&P(-i.top,"reset",0))),g.active.last&&(g.active.index=C()-1),g.active.index>=C()&&(g.active.last=!0),g.settings.pager&&!g.settings.pagerCustom&&(E(),O(g.active.index)),g.settings.ariaHidden&&Q(g.active.index*y())},p.destroySlider=function(){g.initialized&&(g.initialized=!1,G(".wpmslider-clone",this).remove(),g.children.each(function(){void 0!==G(this).data("origStyle")?G(this).attr("style",G(this).data("origStyle")):G(this).removeAttr("style")}),void 0!==G(this).data("origStyle")?this.attr("style",G(this).data("origStyle")):G(this).removeAttr("style"),G(this).unwrap().unwrap(),g.controls.el&&g.controls.el.remove(),g.controls.next&&g.controls.next.remove(),g.controls.prev&&g.controls.prev.remove(),g.pagerEl&&g.settings.controls&&!g.settings.pagerCustom&&g.pagerEl.remove(),G(".wpmslider-caption",this).remove(),g.controls.autoEl&&g.controls.autoEl.remove(),clearInterval(g.interval),clearInterval(g.visibilityInterval),g.settings.responsive&&G(window).off("resize",j),g.settings.keyboardEnabled&&G(document).off("keydown",Y),G(this).removeData("strongSlider"))},p.reloadSlider=function(e){void 0!==e&&(i=e),p.destroySlider(),t(),G(p).data("strongSlider",this)},t(),G(p).data("strongSlider",this),o.attr("data-state","init"),g.debug&&console.log(g.logAs,"viewport",verge.viewportW(),"x",verge.viewportH()),this}}}(jQuery);
public/js/lib/validate/additional-methods.js CHANGED
File without changes
public/js/lib/validate/additional-methods.min.js CHANGED
File without changes
public/js/lib/validate/jquery.validate.js CHANGED
File without changes
public/js/lib/validate/jquery.validate.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ar.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ar.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_az.js CHANGED
File without changes
public/js/lib/validate/localization/messages_az.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_bg.js CHANGED
File without changes
public/js/lib/validate/localization/messages_bg.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_bn_BD.js CHANGED
File without changes
public/js/lib/validate/localization/messages_bn_BD.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ca.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ca.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_cs.js CHANGED
File without changes
public/js/lib/validate/localization/messages_cs.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_da.js CHANGED
File without changes
public/js/lib/validate/localization/messages_da.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_de.js CHANGED
File without changes
public/js/lib/validate/localization/messages_de.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_el.js CHANGED
File without changes
public/js/lib/validate/localization/messages_el.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_es.js CHANGED
File without changes
public/js/lib/validate/localization/messages_es.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_es_AR.js CHANGED
File without changes
public/js/lib/validate/localization/messages_es_AR.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_es_PE.js CHANGED
File without changes
public/js/lib/validate/localization/messages_es_PE.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_et.js CHANGED
File without changes
public/js/lib/validate/localization/messages_et.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_eu.js CHANGED
File without changes
public/js/lib/validate/localization/messages_eu.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_fa.js CHANGED
File without changes
public/js/lib/validate/localization/messages_fa.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_fi.js CHANGED
File without changes
public/js/lib/validate/localization/messages_fi.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_fr.js CHANGED
File without changes
public/js/lib/validate/localization/messages_fr.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ge.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ge.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_gl.js CHANGED
File without changes
public/js/lib/validate/localization/messages_gl.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_he.js CHANGED
File without changes
public/js/lib/validate/localization/messages_he.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_hr.js CHANGED
File without changes
public/js/lib/validate/localization/messages_hr.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_hu.js CHANGED
File without changes
public/js/lib/validate/localization/messages_hu.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_hy_AM.js CHANGED
File without changes
public/js/lib/validate/localization/messages_hy_AM.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_id.js CHANGED
File without changes
public/js/lib/validate/localization/messages_id.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_is.js CHANGED
File without changes
public/js/lib/validate/localization/messages_is.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_it.js CHANGED
File without changes
public/js/lib/validate/localization/messages_it.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ja.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ja.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ka.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ka.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_kk.js CHANGED
File without changes
public/js/lib/validate/localization/messages_kk.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ko.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ko.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_lt.js CHANGED
File without changes
public/js/lib/validate/localization/messages_lt.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_lv.js CHANGED
File without changes
public/js/lib/validate/localization/messages_lv.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_mk.js CHANGED
File without changes
public/js/lib/validate/localization/messages_mk.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_my.js CHANGED
File without changes
public/js/lib/validate/localization/messages_my.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_nl.js CHANGED
File without changes
public/js/lib/validate/localization/messages_nl.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_no.js CHANGED
File without changes
public/js/lib/validate/localization/messages_no.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_pl.js CHANGED
File without changes
public/js/lib/validate/localization/messages_pl.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_pt_BR.js CHANGED
File without changes
public/js/lib/validate/localization/messages_pt_BR.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_pt_PT.js CHANGED
File without changes
public/js/lib/validate/localization/messages_pt_PT.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ro.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ro.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ru.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ru.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_si.js CHANGED
File without changes
public/js/lib/validate/localization/messages_si.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sk.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sk.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sl.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sl.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sr.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sr.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sr_lat.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sr_lat.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sv.js CHANGED
File without changes
public/js/lib/validate/localization/messages_sv.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_th.js CHANGED
File without changes
public/js/lib/validate/localization/messages_th.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_tj.js CHANGED
File without changes
public/js/lib/validate/localization/messages_tj.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_tr.js CHANGED
File without changes
public/js/lib/validate/localization/messages_tr.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_uk.js CHANGED
File without changes
public/js/lib/validate/localization/messages_uk.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ur.js CHANGED
File without changes
public/js/lib/validate/localization/messages_ur.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_vi.js CHANGED
File without changes
public/js/lib/validate/localization/messages_vi.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_zh.js CHANGED
File without changes
public/js/lib/validate/localization/messages_zh.min.js CHANGED
File without changes
public/js/lib/validate/localization/messages_zh_TW.js CHANGED
File without changes
public/js/lib/validate/localization/messages_zh_TW.min.js CHANGED
File without changes
public/js/lib/validate/localization/methods_de.js CHANGED
File without changes
public/js/lib/validate/localization/methods_de.min.js CHANGED
File without changes
public/js/lib/validate/localization/methods_es_CL.js CHANGED
File without changes
public/js/lib/validate/localization/methods_es_CL.min.js CHANGED
File without changes
public/js/lib/validate/localization/methods_fi.js CHANGED
File without changes
public/js/lib/validate/localization/methods_fi.min.js CHANGED
File without changes
public/js/lib/validate/localization/methods_nl.js CHANGED
File without changes
public/js/lib/validate/localization/methods_nl.min.js CHANGED
File without changes
public/js/lib/validate/localization/methods_pt.js CHANGED
File without changes
public/js/lib/validate/localization/methods_pt.min.js CHANGED
File without changes
public/js/lib/verge/verge.js CHANGED
File without changes
public/js/lib/verge/verge.min.js CHANGED
File without changes
public/scss/_partials/_base.scss CHANGED
File without changes
public/scss/_partials/_buttons.scss CHANGED
File without changes
public/scss/_partials/_buttons2.scss CHANGED
File without changes
public/scss/_partials/_buttons3.scss CHANGED
File without changes
public/scss/_partials/_inside.scss CHANGED
File without changes
public/scss/_partials/_outside.scss CHANGED
File without changes
public/scss/_partials/_pager_buttons.scss CHANGED
File without changes
public/scss/_partials/_pager_inside.scss CHANGED
File without changes
public/scss/_partials/_pager_text.scss CHANGED
File without changes
public/scss/_partials/_sides.scss CHANGED
File without changes
public/scss/_partials/_sides_outside.scss CHANGED
File without changes
public/scss/_partials/_sides_pager.scss CHANGED
File without changes
public/scss/_partials/_text.scss CHANGED
File without changes
public/scss/slider-controls-full-buttons.scss CHANGED
File without changes
public/scss/slider-controls-full-buttons2.scss CHANGED
File without changes
public/scss/slider-controls-full-buttons3.scss CHANGED
File without changes
public/scss/slider-controls-full-text.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons2-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons2-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons2.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons3-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons3-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-sides-buttons3.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons2-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons2-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons2.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons3-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons3-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-sides-outside-buttons3.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons2-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons2-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons2.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons3-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons3-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-simple-buttons3.scss CHANGED
File without changes
public/scss/slider-controls-simple-text-pager-buttons.scss CHANGED
File without changes
public/scss/slider-controls-simple-text-pager-text.scss CHANGED
File without changes
public/scss/slider-controls-simple-text.scss CHANGED
File without changes
public/scss/slider-pager-buttons.scss CHANGED
File without changes
public/scss/slider-pager-text.scss CHANGED
File without changes
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: testimonials, testimonial slider, testimonial form, star ratings
4
  Requires at least: 4.6
5
  Requires PHP: 5.6
6
  Tested up to: 5.1
7
- Stable tag: 2.36
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -173,7 +173,7 @@ No. If you already have testimonials in another plugin or theme, you will have t
173
 
174
  == Changelog ==
175
 
176
- * See changelog.txt for previous versions.
177
 
178
  == Upgrade Notice ==
179
 
4
  Requires at least: 4.6
5
  Requires PHP: 5.6
6
  Tested up to: 5.1
7
+ Stable tag: 2.37
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
173
 
174
  == Changelog ==
175
 
176
+ * See [changelog.txt](https://github.com/MachoThemes/strong-testimonials/blob/master/changelog.txt) for previous versions.
177
 
178
  == Upgrade Notice ==
179
 
strong-testimonials.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Collect and display your testimonials or reviews.
6
  * Author: MachoThemes
7
  * Author URI: https://www.machothemes.com/
8
- * Version: 2.36
9
  * Text Domain: strong-testimonials
10
  * Domain Path: /languages
11
  * Requires: 4.6 or higher
@@ -44,7 +44,7 @@ if ( ! defined( 'ABSPATH' ) ) {
44
  exit;
45
  }
46
 
47
- define( 'WPMTST_VERSION', '2.36' );
48
  define( 'WPMTST_PLUGIN', plugin_basename( __FILE__ ) ); // strong-testimonials/strong-testimonials.php
49
  define( 'WPMTST', dirname( WPMTST_PLUGIN ) ); // strong-testimonials
50
  define( 'STRONGPLUGINS_STORE_URL', '#' );
@@ -194,6 +194,10 @@ final class Strong_Testimonials {
194
 
195
  defined( 'WPMTST_TPL' ) || define( 'WPMTST_TPL', WPMTST_DIR . 'templates' );
196
  defined( 'WPMTST_TPL_URI' ) || define( 'WPMTST_TPL_URI', WPMTST_URL . 'templates' );
 
 
 
 
197
  }
198
 
199
  /**
@@ -279,6 +283,7 @@ final class Strong_Testimonials {
279
  require_once WPMTST_ADMIN . 'class-strong-testimonials-admin-list.php';
280
  require_once WPMTST_ADMIN . 'class-strong-testimonials-admin-category-list.php';
281
  require_once WPMTST_ADMIN . 'class-strong-testimonials-post-editor.php';
 
282
 
283
  require_once WPMTST_ADMIN . 'admin.php';
284
  require_once WPMTST_ADMIN . 'admin-notices.php';
5
  * Description: Collect and display your testimonials or reviews.
6
  * Author: MachoThemes
7
  * Author URI: https://www.machothemes.com/
8
+ * Version: 2.37
9
  * Text Domain: strong-testimonials
10
  * Domain Path: /languages
11
  * Requires: 4.6 or higher
44
  exit;
45
  }
46
 
47
+ define( 'WPMTST_VERSION', '2.37' );
48
  define( 'WPMTST_PLUGIN', plugin_basename( __FILE__ ) ); // strong-testimonials/strong-testimonials.php
49
  define( 'WPMTST', dirname( WPMTST_PLUGIN ) ); // strong-testimonials
50
  define( 'STRONGPLUGINS_STORE_URL', '#' );
194
 
195
  defined( 'WPMTST_TPL' ) || define( 'WPMTST_TPL', WPMTST_DIR . 'templates' );
196
  defined( 'WPMTST_TPL_URI' ) || define( 'WPMTST_TPL_URI', WPMTST_URL . 'templates' );
197
+
198
+ defined( 'WPMTST_ASSETS_CSS' ) || define( 'WPMTST_ASSETS_CSS', WPMTST_URL . 'assets/css/' );
199
+ defined( 'WPMTST_ASSETS_JS' ) || define( 'WPMTST_ASSETS_JS', WPMTST_URL . 'assets/js/' );
200
+ defined( 'WPMTST_ASSETS_SRC' ) || define( 'WPMTST_ASSETS_SRC', WPMTST_URL . 'assets/src/' );
201
  }
202
 
203
  /**
283
  require_once WPMTST_ADMIN . 'class-strong-testimonials-admin-list.php';
284
  require_once WPMTST_ADMIN . 'class-strong-testimonials-admin-category-list.php';
285
  require_once WPMTST_ADMIN . 'class-strong-testimonials-post-editor.php';
286
+ require_once WPMTST_ADMIN . 'class-strong-testimonials-exporter.php';
287
 
288
  require_once WPMTST_ADMIN . 'admin.php';
289
  require_once WPMTST_ADMIN . 'admin-notices.php';
templates-scss/_mixins/_testimonial.scss CHANGED
File without changes
templates-scss/_partials/_base.scss CHANGED
File without changes
templates-scss/_partials/_clear.scss CHANGED
File without changes
templates-scss/_partials/_form-wait.scss CHANGED
File without changes
templates-scss/_partials/_pagination-modern.scss CHANGED
File without changes
templates-scss/_partials/_pagination-simple.scss CHANGED
File without changes
templates-scss/_partials/_pagination-standard.scss CHANGED
File without changes
templates-scss/_partials/_responsive-no-heading-background.scss CHANGED
File without changes
templates-scss/_partials/_responsive.scss CHANGED
File without changes
templates-scss/_partials/_rtl.scss CHANGED
File without changes
templates-scss/_partials/_structure-form.scss CHANGED
File without changes
templates-scss/bold/content.scss CHANGED
File without changes
templates-scss/default-form/form.scss CHANGED
File without changes
templates-scss/default/content.scss CHANGED
File without changes
templates-scss/modern/content.scss CHANGED
File without changes
templates-scss/simple-form/form.scss CHANGED
File without changes
templates-scss/simple/content.scss CHANGED
File without changes
templates-scss/small-widget/content.scss CHANGED
File without changes
templates-scss/unstyled-form/form.scss CHANGED
File without changes
templates/bold/config.json CHANGED
File without changes
templates/bold/content.css CHANGED
File without changes
templates/bold/content.php CHANGED
File without changes
templates/default-form/config.json CHANGED
File without changes
templates/default-form/form.css CHANGED
File without changes
templates/default-form/form.php CHANGED
File without changes
templates/default/config.json CHANGED
File without changes
templates/default/content.css CHANGED
File without changes
templates/default/content.php CHANGED
File without changes
templates/default/img/quotes.png CHANGED
File without changes
templates/index.php CHANGED
File without changes
templates/modern/config.json CHANGED
File without changes
templates/modern/content.css CHANGED
File without changes
templates/modern/content.php CHANGED
File without changes
templates/simple-form/config.json CHANGED
File without changes
templates/simple-form/form.css CHANGED
File without changes
templates/simple-form/form.php CHANGED
File without changes
templates/simple/config.json CHANGED
File without changes
templates/simple/content.css CHANGED
File without changes
templates/simple/content.php CHANGED
File without changes
templates/small-widget/config.json CHANGED
File without changes
templates/small-widget/content.css CHANGED
File without changes
templates/small-widget/content.php CHANGED
File without changes
templates/unstyled-form/config.json CHANGED
File without changes
templates/unstyled-form/form.css CHANGED
File without changes
templates/unstyled-form/form.php CHANGED
File without changes
templates/unstyled/config.json CHANGED
File without changes
templates/unstyled/content.php CHANGED
File without changes
uninstall.php CHANGED
File without changes
wpml-config.xml CHANGED
File without changes