-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwordpres-theplus-post.js
More file actions
232 lines (232 loc) · 13.9 KB
/
wordpres-theplus-post.js
File metadata and controls
232 lines (232 loc) · 13.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
(function(a) {
"use strict";
a(document).ready(function() {
a(".tpgb-tabs-wrapper").each(function() {
var b = a(this)
, c = b.data("tab-hover")
, d = b.find(".tpgb-tab-header");
"no" == c && (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream ? d.on("touchstart", function() {
var c = a(this).data("tab")
, d = a(this).closest(".tpgb-tabs-wrapper")
, e = a(d).children(".tpgb-tabs-nav").children(".tpgb-tab-li").children(".tpgb-tab-header")
, f = a(d).children(".tpgb-tabs-content-wrapper").children(".tpgb-tab-content");
if (a(d).find(">.tpgb-tabs-nav-wrapper .tpgb-tab-header").removeClass("active default-active").addClass("inactive"),
a(this).addClass("active").removeClass("inactive"),
a(d).find(">.tpgb-tabs-content-wrapper>.tpgb-tab-content").removeClass("active").addClass("inactive"),
a(">.tpgb-tabs-content-wrapper>.tpgb-tab-content[data-tab='" + c + "']", d).addClass("active").removeClass("inactive"),
a(".tpgb-tab-content[data-tab='" + c + "']").find(".tpgb-carousel").length) {
var g = document.querySelectorAll(".tpgb-tab-content[data-tab='" + c + "'] .tpgb-carousel");
g.forEach(function(a) {
var b = slideStore.get(a);
b.refresh()
})
}
if (a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope .post-loop-inner", b).length) {
a("body").height() <= a(window).height() && a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope").each(function() {
a(this).find(".post-lazy-load").length && "function" == typeof tpgb_lazy_load_ajax && tpgb_lazy_load_ajax(a(this))
});
let d = a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope .post-loop-inner", b);
d.isotope({
itemSelector: ".grid-item",
resizable: !0,
sortBy: "original-order",
resizesContainer: !0,
initLayout: !1
}),
d.isotope("layout"),
setTimeout(function() {
d.isotope("layout")
}, 50),
"no" == d.data("anim") && d.isotope({
transitionDuration: 0
}),
0 == d.height() && (d.css("opacity", 0),
d.isotope("once", "layoutComplete", function() {
d.css("opacity", 1)
}))
}
if (a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-metro .post-loop-inner", b).length && (a("body").height() <= a(window).height() && a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-metro").each(function() {
a(this).find(".post-lazy-load").length && "function" == typeof tpgb_lazy_load_ajax && tpgb_lazy_load_ajax(a(this))
}),
setTimeout(function() {
tpgb_metro_layout("")
}, 30)),
a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-equal-height", b).length && setTimeout(function() {
var d = a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-equal-height", b);
if ("function" == typeof equalHeightFun) {
var e = d[0] ? d[0] : "";
equalHeightFun(e)
}
}, 30),
a(".tpgb-tab-content[data-tab='" + c + "'] .tp-expand", b).length) {
var h = a(".tpgb-tab-content[data-tab='" + c + "'] .tp-expand", b);
h.each(function() {
"function" == typeof tpgb_unfold && tpgb_unfold(a(this)[0])
})
}
a(f).each(function() {
a(this).removeClass("default-active")
}),
a(">.tpgb-tabs-content-wrapper>.tpgb-tab-content[data-tab='" + c + "'] .pt_tpgb_before_after", d).length && size_Elements()
}) : d.on("click", function() {
var c = a(this).data("tab")
, d = a(this).closest(".tpgb-tabs-wrapper")
, e = a(d).children(".tpgb-tabs-nav").children(".tpgb-tab-li").children(".tpgb-tab-header")
, f = a(d).children(".tpgb-tabs-content-wrapper").children(".tpgb-tab-content");
if (a(d).find(">.tpgb-tabs-nav-wrapper .tpgb-tab-header").removeClass("active default-active").addClass("inactive"),
a(this).addClass("active").removeClass("inactive"),
a(d).find(">.tpgb-tabs-content-wrapper>.tpgb-tab-content").removeClass("active").addClass("inactive"),
a(">.tpgb-tabs-content-wrapper>.tpgb-tab-content[data-tab='" + c + "']", d).addClass("active").removeClass("inactive"),
a(".tpgb-tab-content[data-tab='" + c + "']").find(".tpgb-carousel").length) {
var g = document.querySelectorAll(".tpgb-tab-content[data-tab='" + c + "'] .tpgb-carousel");
g.forEach(function(a) {
var b = slideStore.get(a);
b.refresh()
})
}
if (a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope .post-loop-inner", b).length) {
a("body").height() <= a(window).height() && a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope").each(function() {
a(this).find(".post-lazy-load").length && "function" == typeof tpgb_lazy_load_ajax && tpgb_lazy_load_ajax(a(this))
});
let d = a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope .post-loop-inner", b);
d.isotope({
itemSelector: ".grid-item",
resizable: !0,
sortBy: "original-order",
resizesContainer: !0,
initLayout: !1
}),
d.isotope("layout"),
setTimeout(function() {
d.isotope("layout")
}, 50),
"no" == d.data("anim") && d.isotope({
transitionDuration: 0
}),
0 == d.height() && (d.css("opacity", 0),
d.isotope("once", "layoutComplete", function() {
d.css("opacity", 1)
}))
}
if (a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-metro .post-loop-inner", b).length && (a("body").height() <= a(window).height() && a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-metro").each(function() {
a(this).find(".post-lazy-load").length && "function" == typeof tpgb_lazy_load_ajax && tpgb_lazy_load_ajax(a(this))
}),
setTimeout(function() {
tpgb_metro_layout("")
}, 30)),
a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-equal-height", b).length && setTimeout(function() {
var d = a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-equal-height", b);
if ("function" == typeof equalHeightFun) {
var e = d[0] ? d[0] : "";
equalHeightFun(e)
}
}, 30),
a(".tpgb-tab-content[data-tab='" + c + "'] .tp-expand", b).length) {
var h = a(".tpgb-tab-content[data-tab='" + c + "'] .tp-expand", b);
h.each(function() {
"function" == typeof tpgb_unfold && tpgb_unfold(a(this)[0])
})
}
a(f).each(function() {
a(this).removeClass("default-active")
}),
a(">.tpgb-tabs-content-wrapper>.tpgb-tab-content[data-tab='" + c + "'] .pt_tpgb_before_after", d).length && size_Elements()
})),
"yes" == c && d.on("mouseover", function() {
var c = a(this).data("tab")
, d = a(this).closest(".tpgb-tabs-wrapper")
, e = a(d).children(".tpgb-tabs-nav").children(".tpgb-tab-li").children(".tpgb-tab-header")
, f = a(d).children(".tpgb-tabs-content-wrapper").children(".tpgb-tab-content");
if (a(d).find(">.tpgb-tabs-nav-wrapper .tpgb-tab-header").removeClass("active default-active").addClass("inactive"),
a(this).addClass("active").removeClass("inactive"),
a(d).find(">.tpgb-tabs-content-wrapper>.tpgb-tab-content").removeClass("active").addClass("inactive"),
a(">.tpgb-tabs-content-wrapper>.tpgb-tab-content[data-tab='" + c + "']", d).addClass("active").removeClass("inactive"),
a(".tpgb-tab-content[data-tab='" + c + "']").find(".tpgb-carousel").length) {
var g = document.querySelectorAll(".tpgb-tab-content[data-tab='" + c + "'] .tpgb-carousel");
g.forEach(function(a) {
var b = slideStore.get(a);
b.refresh()
})
}
if (a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope .post-loop-inner", b).length) {
a("body").height() <= a(window).height() && a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope").each(function() {
a(this).find(".post-lazy-load").length && "function" == typeof tpgb_lazy_load_ajax && tpgb_lazy_load_ajax(a(this))
});
let d = a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-isotope .post-loop-inner", b);
d.isotope({
itemSelector: ".grid-item",
resizable: !0,
sortBy: "original-order",
resizesContainer: !0,
initLayout: !1
}),
d.isotope("layout"),
setTimeout(function() {
d.isotope("layout")
}, 50),
"no" == d.data("anim") && d.isotope({
transitionDuration: 0
}),
0 == d.height() && (d.css("opacity", 0),
d.isotope("once", "layoutComplete", function() {
d.css("opacity", 1)
}))
}
if (a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-metro .post-loop-inner", b).length && (a("body").height() <= a(window).height() && a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-metro").each(function() {
a(this).find(".post-lazy-load").length && "function" == typeof tpgb_lazy_load_ajax && tpgb_lazy_load_ajax(a(this))
}),
setTimeout(function() {
tpgb_metro_layout("")
}, 30)),
a(f).each(function() {
a(this).removeClass("default-active")
}),
a(">.tpgb-tabs-content-wrapper>.tpgb-tab-content[data-tab='" + c + "'] .pt_tpgb_before_after", d).length && size_Elements(),
a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-equal-height", b).length && setTimeout(function() {
var d = a(" .tpgb-tab-content[data-tab='" + c + "'] .tpgb-equal-height", b);
if ("function" == typeof equalHeightFun) {
var e = d[0] ? d[0] : "";
equalHeightFun(e)
}
}, 30),
a(".tpgb-tab-content[data-tab='" + c + "'] .tp-expand", b).length) {
var h = a(".tpgb-tab-content[data-tab='" + c + "'] .tp-expand", b);
h.each(function() {
"function" == typeof tpgb_unfold && tpgb_unfold(a(this)[0])
})
}
});
var e = window.location.hash;
if ("" != e && e != null && !a(e).hasClass("active") && a(e).length) {
a("html, body").animate({
scrollTop: a(e).offset().top
}, 1500),
a(e + ".tpgb-tab-header").trigger("click");
var f = a(e).data("tab");
a(".tab-mobile-title[data-tab='" + f + "']").trigger("click")
}
}),
0 < a(".tpgb-tabs-wrapper.swiper-container").length && new Swiper(".tpgb-tabs-wrapper.swiper-container",{
slidesPerView: "auto",
mousewheelControl: !0,
freeMode: !0
}),
a(".tpgb-tabs-wrapper").hasClass("mobile-accordion") && (a(window).on("resize", function() {
600 >= a(window).innerWidth() && a(".tpgb-tabs-wrapper").addClass("mobile-accordion-tab")
}),
a(".tpgb-tabs-content-wrapper .tab-mobile-title").on("click", function() {
var b = a(this).data("tab")
, c = a(this).closest(".tpgb-tabs-wrapper")
, d = a(c).children(".tpgb-tabs-content-wrapper").children(".tab-mobile-title")
, e = a(c).children(".tpgb-tabs-content-wrapper").children(".tpgb-tab-content");
a(c).find(">.tpgb-tabs-content-wrapper .tab-mobile-title").removeClass("active default-active").addClass("inactive"),
a(this).addClass("active").removeClass("inactive"),
a(c).find(">.tpgb-tabs-content-wrapper>.tpgb-tab-content").removeClass("active").addClass("inactive"),
a(">.tpgb-tabs-content-wrapper>.tpgb-tab-content[data-tab='" + b + "']", c).addClass("active").removeClass("inactive"),
a(e).each(function() {
a(this).removeClass("default-active")
})
}))
})
}
)(jQuery);