PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 2.38
Strong Testimonials v2.38
3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / admin / js / admin-compat.js
strong-testimonials / admin / js Last commit date
lib 7 years ago addon-licenses.js 7 years ago admin-compat.js 7 years ago admin-fields.js 7 years ago admin-form.js 7 years ago admin-global.js 7 years ago admin-order.js 7 years ago custom-spinner.js 7 years ago help.js 7 years ago rating-edit.js 7 years ago view-category-filter.js 7 years ago views.js 7 years ago
admin-compat.js
131 lines
1 /**
2 * Compatibility settings tab
3 */
4
5 ;(function ($) {
6
7 var currentSettings = {}
8 var quick = 200
9
10 // Store current setting(s)
11 function saveCurrentSettings () {
12 $('[data-radio-group]').each(function (index, el) {
13 var radioGroup = $(this).data('radioGroup')
14 currentSettings[radioGroup] = {
15 value: $(this).find(':checked').val(),
16 forced: false
17 }
18 })
19 }
20
21 // Update display based on current selections
22 function updateDisplay () {
23 // matchMethodSetting()
24 highlightRadioLabel()
25 toggle()
26 }
27
28 // Toggle dependent inputs
29 function toggle () {
30 $('[data-group]').each(function (index, el) {
31 var group = $(this).data('group')
32 var $sub = $("[data-sub='" + group + "']")
33 if ($(this).is(':checked')) {
34 $sub.fadeIn()
35 } else {
36 $sub.fadeOut(quick)
37 }
38 })
39 }
40
41 // Update available options --- not currently used
42 /*
43 function matchMethodSetting () {
44 if ($('#prerender-current').is(':checked')) {
45 saveCurrentSettings()
46 $('#method-none').prop('checked', true)
47 $('#method-universal').prop('disabled', true)
48 $('#method-observer').prop('disabled', true)
49 $('#method-event').prop('disabled', true)
50 $('#method-script').prop('disabled', true)
51 currentSettings['method'].forced = true
52 } else {
53 if (currentSettings['method'].forced) {
54 $('#method-' + currentSettings['method'].value).prop('checked', true)
55 $('#method-universal').prop('disabled', false)
56 $('#method-observer').prop('disabled', false)
57 $('#method-event').prop('disabled', false)
58 $('#method-script').prop('disabled', false)
59 currentSettings['method'].forced = false
60 }
61 }
62 }
63 */
64
65 // UI
66 function highlightRadioLabel () {
67 $('input:radio:checked').closest('label').addClass('current')
68 $('input:radio:not(:checked)').closest('label').removeClass('current')
69 }
70
71 // Number spinner
72 function initSpinner () {
73 $("input[type='number']").each(function () {
74 $(this).number();
75 });
76 }
77
78 // Presets
79 function setScenario1() {
80 $('#page-loading-general').click()
81 $('#prerender-all').click().prop('checked', true)
82 $('#method-universal').click().prop('checked', true)
83 }
84
85 function setScenarioDefault() {
86 $('#prerender-current').click()
87 $('#method-none').click()
88 }
89
90 // Listen for change
91 $('.form-table').on('change', function (e) {
92 updateDisplay()
93 var currentType = $("input[name='wpmtst_compat_options[page_loading]']:checked").val()
94 switch (currentType) {
95 case 'general':
96 setScenario1()
97 break;
98 case 'advanced':
99 break;
100 default:
101 setScenarioDefault()
102 }
103 })
104
105 // Listen for presets
106 $('#set-scenario-1').on('click', function(e) {
107 $(this).blur()
108 setScenario1()
109 e.preventDefault()
110 })
111
112 // Listen for [Add Row]
113 $('#add-pair').on('click', function (e) {
114 var $this = $(this);
115 var key = $this.closest('.lazyload-pairs').find('.pair').length;
116 var data = {
117 'action': 'wpmtst_add_lazyload_pair',
118 'key': key,
119 };
120 $.get(ajaxurl, data, function (response) {
121 $this.parent().before(response.data).prev().find('input').first().focus();
122 });
123 });
124
125 // Start
126 saveCurrentSettings()
127 updateDisplay()
128 initSpinner()
129
130 })(jQuery)
131