Version Description
Download this release
Release Info
Developer | sayful |
Plugin | Carousel Slider |
Version | 1.8.3 |
Comparing to | |
See all releases |
Code changes from version 1.8.2 to 1.8.3
- LICENSE +0 -674
- assets/css/admin.css +1 -1
- assets/css/style.css +1 -1
- assets/js/public/index.php +0 -2
- assets/js/public/script.js +57 -66
- assets/js/vendors/index.php +0 -2
- assets/js/vendors/select2.min.js +0 -3
- assets/js/vendors/wp-color-picker-alpha.min.js +0 -11
- assets/lib/jquery-tiptip/jquery.tipTip.js +191 -0
- assets/{js/vendors → lib/jquery-tiptip}/jquery.tipTip.min.js +0 -0
- assets/lib/magnific-popup/jquery.magnific-popup.js +1860 -0
- assets/{js/vendors → lib/magnific-popup}/jquery.magnific-popup.min.js +0 -0
- assets/lib/owl-carousel/owl.carousel.js +3275 -0
- assets/{js/vendors → lib/owl-carousel}/owl.carousel.min.js +0 -0
- assets/lib/select2/select2.js +5746 -0
- assets/lib/select2/select2.min.js +1 -0
- assets/lib/wp-color-picker-alpha/wp-color-picker-alpha.js +496 -0
- assets/lib/wp-color-picker-alpha/wp-color-picker-alpha.min.js +11 -0
- assets/scss/admin.scss +1 -0
- assets/scss/admin/_documentation.scss +44 -0
- assets/scss/admin/_select2.scss +445 -295
- assets/scss/public/_button.scss +1 -1
- assets/scss/public/_content-carousel.scss +143 -27
- assets/scss/public/_magnific-popup.scss +416 -423
- carousel-slider.php +36 -27
- includes/class-carousel-slider-activator.php +5 -0
- includes/class-carousel-slider-admin.php +38 -38
- includes/class-carousel-slider-credit.php +5 -0
- includes/class-carousel-slider-form.php +66 -43
- includes/{class-carousel-slider-content-carousel.php → class-carousel-slider-hero-carousel.php} +74 -21
- includes/class-carousel-slider-meta-box.php +4 -0
- includes/class-carousel-slider-number-to-word.php +0 -253
- includes/class-carousel-slider-product.php +15 -8
- includes/class-carousel-slider-script.php +165 -151
- includes/class-carousel-slider-structured-data.php +18 -17
- includes/functions-carousel-slider.php +27 -15
- readme.txt +12 -4
- shortcodes/class-carousel-slider-deprecated-shortcode.php +1 -1
- shortcodes/class-carousel-slider-shortcode.php +9 -13
- templates/admin/autoplay.php +6 -0
- templates/admin/documentation.php +1 -47
- templates/admin/general.php +5 -1
- templates/admin/hero-banner-slider.php +37 -20
- templates/admin/images-media.php +6 -0
- templates/admin/images-settings.php +8 -1
- templates/admin/images-url.php +5 -0
- templates/admin/navigation.php +6 -0
- templates/admin/parts/hero-banner/tab-background.php +23 -0
- templates/admin/parts/hero-banner/tab-content.php +6 -0
- templates/admin/parts/hero-banner/tab-link-button-one.php +6 -0
- templates/admin/parts/hero-banner/tab-link-button-two.php +6 -0
- templates/admin/parts/hero-banner/tab-link.php +6 -0
- templates/admin/parts/hero-banner/tab-style.php +6 -25
- templates/admin/post-carousel.php +6 -0
- templates/admin/product-carousel.php +6 -0
- templates/admin/responsive.php +6 -0
- templates/admin/types.php +20 -19
- templates/admin/video-carousel.php +6 -0
- templates/public/hero-banner-slider.php +105 -123
- templates/public/product-carousel-2.php +1 -1
- templates/public/product-carousel.php +1 -1
- widgets/widget-carousel_slider.php +6 -4
LICENSE
DELETED
@@ -1,674 +0,0 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 3, 29 June 2007
|
3 |
-
|
4 |
-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
-
Everyone is permitted to copy and distribute verbatim copies
|
6 |
-
of this license document, but changing it is not allowed.
|
7 |
-
|
8 |
-
Preamble
|
9 |
-
|
10 |
-
The GNU General Public License is a free, copyleft license for
|
11 |
-
software and other kinds of works.
|
12 |
-
|
13 |
-
The licenses for most software and other practical works are designed
|
14 |
-
to take away your freedom to share and change the works. By contrast,
|
15 |
-
the GNU General Public License is intended to guarantee your freedom to
|
16 |
-
share and change all versions of a program--to make sure it remains free
|
17 |
-
software for all its users. We, the Free Software Foundation, use the
|
18 |
-
GNU General Public License for most of our software; it applies also to
|
19 |
-
any other work released this way by its authors. You can apply it to
|
20 |
-
your programs, too.
|
21 |
-
|
22 |
-
When we speak of free software, we are referring to freedom, not
|
23 |
-
price. Our General Public Licenses are designed to make sure that you
|
24 |
-
have the freedom to distribute copies of free software (and charge for
|
25 |
-
them if you wish), that you receive source code or can get it if you
|
26 |
-
want it, that you can change the software or use pieces of it in new
|
27 |
-
free programs, and that you know you can do these things.
|
28 |
-
|
29 |
-
To protect your rights, we need to prevent others from denying you
|
30 |
-
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
-
certain responsibilities if you distribute copies of the software, or if
|
32 |
-
you modify it: responsibilities to respect the freedom of others.
|
33 |
-
|
34 |
-
For example, if you distribute copies of such a program, whether
|
35 |
-
gratis or for a fee, you must pass on to the recipients the same
|
36 |
-
freedoms that you received. You must make sure that they, too, receive
|
37 |
-
or can get the source code. And you must show them these terms so they
|
38 |
-
know their rights.
|
39 |
-
|
40 |
-
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
-
(1) assert copyright on the software, and (2) offer you this License
|
42 |
-
giving you legal permission to copy, distribute and/or modify it.
|
43 |
-
|
44 |
-
For the developers' and authors' protection, the GPL clearly explains
|
45 |
-
that there is no warranty for this free software. For both users' and
|
46 |
-
authors' sake, the GPL requires that modified versions be marked as
|
47 |
-
changed, so that their problems will not be attributed erroneously to
|
48 |
-
authors of previous versions.
|
49 |
-
|
50 |
-
Some devices are designed to deny users access to install or run
|
51 |
-
modified versions of the software inside them, although the manufacturer
|
52 |
-
can do so. This is fundamentally incompatible with the aim of
|
53 |
-
protecting users' freedom to change the software. The systematic
|
54 |
-
pattern of such abuse occurs in the area of products for individuals to
|
55 |
-
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
-
have designed this version of the GPL to prohibit the practice for those
|
57 |
-
products. If such problems arise substantially in other domains, we
|
58 |
-
stand ready to extend this provision to those domains in future versions
|
59 |
-
of the GPL, as needed to protect the freedom of users.
|
60 |
-
|
61 |
-
Finally, every program is threatened constantly by software patents.
|
62 |
-
States should not allow patents to restrict development and use of
|
63 |
-
software on general-purpose computers, but in those that do, we wish to
|
64 |
-
avoid the special danger that patents applied to a free program could
|
65 |
-
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
-
patents cannot be used to render the program non-free.
|
67 |
-
|
68 |
-
The precise terms and conditions for copying, distribution and
|
69 |
-
modification follow.
|
70 |
-
|
71 |
-
TERMS AND CONDITIONS
|
72 |
-
|
73 |
-
0. Definitions.
|
74 |
-
|
75 |
-
"This License" refers to version 3 of the GNU General Public License.
|
76 |
-
|
77 |
-
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
-
works, such as semiconductor masks.
|
79 |
-
|
80 |
-
"The Program" refers to any copyrightable work licensed under this
|
81 |
-
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
-
"recipients" may be individuals or organizations.
|
83 |
-
|
84 |
-
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
-
in a fashion requiring copyright permission, other than the making of an
|
86 |
-
exact copy. The resulting work is called a "modified version" of the
|
87 |
-
earlier work or a work "based on" the earlier work.
|
88 |
-
|
89 |
-
A "covered work" means either the unmodified Program or a work based
|
90 |
-
on the Program.
|
91 |
-
|
92 |
-
To "propagate" a work means to do anything with it that, without
|
93 |
-
permission, would make you directly or secondarily liable for
|
94 |
-
infringement under applicable copyright law, except executing it on a
|
95 |
-
computer or modifying a private copy. Propagation includes copying,
|
96 |
-
distribution (with or without modification), making available to the
|
97 |
-
public, and in some countries other activities as well.
|
98 |
-
|
99 |
-
To "convey" a work means any kind of propagation that enables other
|
100 |
-
parties to make or receive copies. Mere interaction with a user through
|
101 |
-
a computer network, with no transfer of a copy, is not conveying.
|
102 |
-
|
103 |
-
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
-
to the extent that it includes a convenient and prominently visible
|
105 |
-
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
-
tells the user that there is no warranty for the work (except to the
|
107 |
-
extent that warranties are provided), that licensees may convey the
|
108 |
-
work under this License, and how to view a copy of this License. If
|
109 |
-
the interface presents a list of user commands or options, such as a
|
110 |
-
menu, a prominent item in the list meets this criterion.
|
111 |
-
|
112 |
-
1. Source Code.
|
113 |
-
|
114 |
-
The "source code" for a work means the preferred form of the work
|
115 |
-
for making modifications to it. "Object code" means any non-source
|
116 |
-
form of a work.
|
117 |
-
|
118 |
-
A "Standard Interface" means an interface that either is an official
|
119 |
-
standard defined by a recognized standards body, or, in the case of
|
120 |
-
interfaces specified for a particular programming language, one that
|
121 |
-
is widely used among developers working in that language.
|
122 |
-
|
123 |
-
The "System Libraries" of an executable work include anything, other
|
124 |
-
than the work as a whole, that (a) is included in the normal form of
|
125 |
-
packaging a Major Component, but which is not part of that Major
|
126 |
-
Component, and (b) serves only to enable use of the work with that
|
127 |
-
Major Component, or to implement a Standard Interface for which an
|
128 |
-
implementation is available to the public in source code form. A
|
129 |
-
"Major Component", in this context, means a major essential component
|
130 |
-
(kernel, window system, and so on) of the specific operating system
|
131 |
-
(if any) on which the executable work runs, or a compiler used to
|
132 |
-
produce the work, or an object code interpreter used to run it.
|
133 |
-
|
134 |
-
The "Corresponding Source" for a work in object code form means all
|
135 |
-
the source code needed to generate, install, and (for an executable
|
136 |
-
work) run the object code and to modify the work, including scripts to
|
137 |
-
control those activities. However, it does not include the work's
|
138 |
-
System Libraries, or general-purpose tools or generally available free
|
139 |
-
programs which are used unmodified in performing those activities but
|
140 |
-
which are not part of the work. For example, Corresponding Source
|
141 |
-
includes interface definition files associated with source files for
|
142 |
-
the work, and the source code for shared libraries and dynamically
|
143 |
-
linked subprograms that the work is specifically designed to require,
|
144 |
-
such as by intimate data communication or control flow between those
|
145 |
-
subprograms and other parts of the work.
|
146 |
-
|
147 |
-
The Corresponding Source need not include anything that users
|
148 |
-
can regenerate automatically from other parts of the Corresponding
|
149 |
-
Source.
|
150 |
-
|
151 |
-
The Corresponding Source for a work in source code form is that
|
152 |
-
same work.
|
153 |
-
|
154 |
-
2. Basic Permissions.
|
155 |
-
|
156 |
-
All rights granted under this License are granted for the term of
|
157 |
-
copyright on the Program, and are irrevocable provided the stated
|
158 |
-
conditions are met. This License explicitly affirms your unlimited
|
159 |
-
permission to run the unmodified Program. The output from running a
|
160 |
-
covered work is covered by this License only if the output, given its
|
161 |
-
content, constitutes a covered work. This License acknowledges your
|
162 |
-
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
-
|
164 |
-
You may make, run and propagate covered works that you do not
|
165 |
-
convey, without conditions so long as your license otherwise remains
|
166 |
-
in force. You may convey covered works to others for the sole purpose
|
167 |
-
of having them make modifications exclusively for you, or provide you
|
168 |
-
with facilities for running those works, provided that you comply with
|
169 |
-
the terms of this License in conveying all material for which you do
|
170 |
-
not control copyright. Those thus making or running the covered works
|
171 |
-
for you must do so exclusively on your behalf, under your direction
|
172 |
-
and control, on terms that prohibit them from making any copies of
|
173 |
-
your copyrighted material outside their relationship with you.
|
174 |
-
|
175 |
-
Conveying under any other circumstances is permitted solely under
|
176 |
-
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
-
makes it unnecessary.
|
178 |
-
|
179 |
-
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
-
|
181 |
-
No covered work shall be deemed part of an effective technological
|
182 |
-
measure under any applicable law fulfilling obligations under article
|
183 |
-
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
-
similar laws prohibiting or restricting circumvention of such
|
185 |
-
measures.
|
186 |
-
|
187 |
-
When you convey a covered work, you waive any legal power to forbid
|
188 |
-
circumvention of technological measures to the extent such circumvention
|
189 |
-
is effected by exercising rights under this License with respect to
|
190 |
-
the covered work, and you disclaim any intention to limit operation or
|
191 |
-
modification of the work as a means of enforcing, against the work's
|
192 |
-
users, your or third parties' legal rights to forbid circumvention of
|
193 |
-
technological measures.
|
194 |
-
|
195 |
-
4. Conveying Verbatim Copies.
|
196 |
-
|
197 |
-
You may convey verbatim copies of the Program's source code as you
|
198 |
-
receive it, in any medium, provided that you conspicuously and
|
199 |
-
appropriately publish on each copy an appropriate copyright notice;
|
200 |
-
keep intact all notices stating that this License and any
|
201 |
-
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
-
keep intact all notices of the absence of any warranty; and give all
|
203 |
-
recipients a copy of this License along with the Program.
|
204 |
-
|
205 |
-
You may charge any price or no price for each copy that you convey,
|
206 |
-
and you may offer support or warranty protection for a fee.
|
207 |
-
|
208 |
-
5. Conveying Modified Source Versions.
|
209 |
-
|
210 |
-
You may convey a work based on the Program, or the modifications to
|
211 |
-
produce it from the Program, in the form of source code under the
|
212 |
-
terms of section 4, provided that you also meet all of these conditions:
|
213 |
-
|
214 |
-
a) The work must carry prominent notices stating that you modified
|
215 |
-
it, and giving a relevant date.
|
216 |
-
|
217 |
-
b) The work must carry prominent notices stating that it is
|
218 |
-
released under this License and any conditions added under section
|
219 |
-
7. This requirement modifies the requirement in section 4 to
|
220 |
-
"keep intact all notices".
|
221 |
-
|
222 |
-
c) You must license the entire work, as a whole, under this
|
223 |
-
License to anyone who comes into possession of a copy. This
|
224 |
-
License will therefore apply, along with any applicable section 7
|
225 |
-
additional terms, to the whole of the work, and all its parts,
|
226 |
-
regardless of how they are packaged. This License gives no
|
227 |
-
permission to license the work in any other way, but it does not
|
228 |
-
invalidate such permission if you have separately received it.
|
229 |
-
|
230 |
-
d) If the work has interactive user interfaces, each must display
|
231 |
-
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
-
interfaces that do not display Appropriate Legal Notices, your
|
233 |
-
work need not make them do so.
|
234 |
-
|
235 |
-
A compilation of a covered work with other separate and independent
|
236 |
-
works, which are not by their nature extensions of the covered work,
|
237 |
-
and which are not combined with it such as to form a larger program,
|
238 |
-
in or on a volume of a storage or distribution medium, is called an
|
239 |
-
"aggregate" if the compilation and its resulting copyright are not
|
240 |
-
used to limit the access or legal rights of the compilation's users
|
241 |
-
beyond what the individual works permit. Inclusion of a covered work
|
242 |
-
in an aggregate does not cause this License to apply to the other
|
243 |
-
parts of the aggregate.
|
244 |
-
|
245 |
-
6. Conveying Non-Source Forms.
|
246 |
-
|
247 |
-
You may convey a covered work in object code form under the terms
|
248 |
-
of sections 4 and 5, provided that you also convey the
|
249 |
-
machine-readable Corresponding Source under the terms of this License,
|
250 |
-
in one of these ways:
|
251 |
-
|
252 |
-
a) Convey the object code in, or embodied in, a physical product
|
253 |
-
(including a physical distribution medium), accompanied by the
|
254 |
-
Corresponding Source fixed on a durable physical medium
|
255 |
-
customarily used for software interchange.
|
256 |
-
|
257 |
-
b) Convey the object code in, or embodied in, a physical product
|
258 |
-
(including a physical distribution medium), accompanied by a
|
259 |
-
written offer, valid for at least three years and valid for as
|
260 |
-
long as you offer spare parts or customer support for that product
|
261 |
-
model, to give anyone who possesses the object code either (1) a
|
262 |
-
copy of the Corresponding Source for all the software in the
|
263 |
-
product that is covered by this License, on a durable physical
|
264 |
-
medium customarily used for software interchange, for a price no
|
265 |
-
more than your reasonable cost of physically performing this
|
266 |
-
conveying of source, or (2) access to copy the
|
267 |
-
Corresponding Source from a network server at no charge.
|
268 |
-
|
269 |
-
c) Convey individual copies of the object code with a copy of the
|
270 |
-
written offer to provide the Corresponding Source. This
|
271 |
-
alternative is allowed only occasionally and noncommercially, and
|
272 |
-
only if you received the object code with such an offer, in accord
|
273 |
-
with subsection 6b.
|
274 |
-
|
275 |
-
d) Convey the object code by offering access from a designated
|
276 |
-
place (gratis or for a charge), and offer equivalent access to the
|
277 |
-
Corresponding Source in the same way through the same place at no
|
278 |
-
further charge. You need not require recipients to copy the
|
279 |
-
Corresponding Source along with the object code. If the place to
|
280 |
-
copy the object code is a network server, the Corresponding Source
|
281 |
-
may be on a different server (operated by you or a third party)
|
282 |
-
that supports equivalent copying facilities, provided you maintain
|
283 |
-
clear directions next to the object code saying where to find the
|
284 |
-
Corresponding Source. Regardless of what server hosts the
|
285 |
-
Corresponding Source, you remain obligated to ensure that it is
|
286 |
-
available for as long as needed to satisfy these requirements.
|
287 |
-
|
288 |
-
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
-
you inform other peers where the object code and Corresponding
|
290 |
-
Source of the work are being offered to the general public at no
|
291 |
-
charge under subsection 6d.
|
292 |
-
|
293 |
-
A separable portion of the object code, whose source code is excluded
|
294 |
-
from the Corresponding Source as a System Library, need not be
|
295 |
-
included in conveying the object code work.
|
296 |
-
|
297 |
-
A "User Product" is either (1) a "consumer product", which means any
|
298 |
-
tangible personal property which is normally used for personal, family,
|
299 |
-
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
-
into a dwelling. In determining whether a product is a consumer product,
|
301 |
-
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
-
product received by a particular user, "normally used" refers to a
|
303 |
-
typical or common use of that class of product, regardless of the status
|
304 |
-
of the particular user or of the way in which the particular user
|
305 |
-
actually uses, or expects or is expected to use, the product. A product
|
306 |
-
is a consumer product regardless of whether the product has substantial
|
307 |
-
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
-
the only significant mode of use of the product.
|
309 |
-
|
310 |
-
"Installation Information" for a User Product means any methods,
|
311 |
-
procedures, authorization keys, or other information required to install
|
312 |
-
and execute modified versions of a covered work in that User Product from
|
313 |
-
a modified version of its Corresponding Source. The information must
|
314 |
-
suffice to ensure that the continued functioning of the modified object
|
315 |
-
code is in no case prevented or interfered with solely because
|
316 |
-
modification has been made.
|
317 |
-
|
318 |
-
If you convey an object code work under this section in, or with, or
|
319 |
-
specifically for use in, a User Product, and the conveying occurs as
|
320 |
-
part of a transaction in which the right of possession and use of the
|
321 |
-
User Product is transferred to the recipient in perpetuity or for a
|
322 |
-
fixed term (regardless of how the transaction is characterized), the
|
323 |
-
Corresponding Source conveyed under this section must be accompanied
|
324 |
-
by the Installation Information. But this requirement does not apply
|
325 |
-
if neither you nor any third party retains the ability to install
|
326 |
-
modified object code on the User Product (for example, the work has
|
327 |
-
been installed in ROM).
|
328 |
-
|
329 |
-
The requirement to provide Installation Information does not include a
|
330 |
-
requirement to continue to provide support service, warranty, or updates
|
331 |
-
for a work that has been modified or installed by the recipient, or for
|
332 |
-
the User Product in which it has been modified or installed. Access to a
|
333 |
-
network may be denied when the modification itself materially and
|
334 |
-
adversely affects the operation of the network or violates the rules and
|
335 |
-
protocols for communication across the network.
|
336 |
-
|
337 |
-
Corresponding Source conveyed, and Installation Information provided,
|
338 |
-
in accord with this section must be in a format that is publicly
|
339 |
-
documented (and with an implementation available to the public in
|
340 |
-
source code form), and must require no special password or key for
|
341 |
-
unpacking, reading or copying.
|
342 |
-
|
343 |
-
7. Additional Terms.
|
344 |
-
|
345 |
-
"Additional permissions" are terms that supplement the terms of this
|
346 |
-
License by making exceptions from one or more of its conditions.
|
347 |
-
Additional permissions that are applicable to the entire Program shall
|
348 |
-
be treated as though they were included in this License, to the extent
|
349 |
-
that they are valid under applicable law. If additional permissions
|
350 |
-
apply only to part of the Program, that part may be used separately
|
351 |
-
under those permissions, but the entire Program remains governed by
|
352 |
-
this License without regard to the additional permissions.
|
353 |
-
|
354 |
-
When you convey a copy of a covered work, you may at your option
|
355 |
-
remove any additional permissions from that copy, or from any part of
|
356 |
-
it. (Additional permissions may be written to require their own
|
357 |
-
removal in certain cases when you modify the work.) You may place
|
358 |
-
additional permissions on material, added by you to a covered work,
|
359 |
-
for which you have or can give appropriate copyright permission.
|
360 |
-
|
361 |
-
Notwithstanding any other provision of this License, for material you
|
362 |
-
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
-
that material) supplement the terms of this License with terms:
|
364 |
-
|
365 |
-
a) Disclaiming warranty or limiting liability differently from the
|
366 |
-
terms of sections 15 and 16 of this License; or
|
367 |
-
|
368 |
-
b) Requiring preservation of specified reasonable legal notices or
|
369 |
-
author attributions in that material or in the Appropriate Legal
|
370 |
-
Notices displayed by works containing it; or
|
371 |
-
|
372 |
-
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
-
requiring that modified versions of such material be marked in
|
374 |
-
reasonable ways as different from the original version; or
|
375 |
-
|
376 |
-
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
-
authors of the material; or
|
378 |
-
|
379 |
-
e) Declining to grant rights under trademark law for use of some
|
380 |
-
trade names, trademarks, or service marks; or
|
381 |
-
|
382 |
-
f) Requiring indemnification of licensors and authors of that
|
383 |
-
material by anyone who conveys the material (or modified versions of
|
384 |
-
it) with contractual assumptions of liability to the recipient, for
|
385 |
-
any liability that these contractual assumptions directly impose on
|
386 |
-
those licensors and authors.
|
387 |
-
|
388 |
-
All other non-permissive additional terms are considered "further
|
389 |
-
restrictions" within the meaning of section 10. If the Program as you
|
390 |
-
received it, or any part of it, contains a notice stating that it is
|
391 |
-
governed by this License along with a term that is a further
|
392 |
-
restriction, you may remove that term. If a license document contains
|
393 |
-
a further restriction but permits relicensing or conveying under this
|
394 |
-
License, you may add to a covered work material governed by the terms
|
395 |
-
of that license document, provided that the further restriction does
|
396 |
-
not survive such relicensing or conveying.
|
397 |
-
|
398 |
-
If you add terms to a covered work in accord with this section, you
|
399 |
-
must place, in the relevant source files, a statement of the
|
400 |
-
additional terms that apply to those files, or a notice indicating
|
401 |
-
where to find the applicable terms.
|
402 |
-
|
403 |
-
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
-
form of a separately written license, or stated as exceptions;
|
405 |
-
the above requirements apply either way.
|
406 |
-
|
407 |
-
8. Termination.
|
408 |
-
|
409 |
-
You may not propagate or modify a covered work except as expressly
|
410 |
-
provided under this License. Any attempt otherwise to propagate or
|
411 |
-
modify it is void, and will automatically terminate your rights under
|
412 |
-
this License (including any patent licenses granted under the third
|
413 |
-
paragraph of section 11).
|
414 |
-
|
415 |
-
However, if you cease all violation of this License, then your
|
416 |
-
license from a particular copyright holder is reinstated (a)
|
417 |
-
provisionally, unless and until the copyright holder explicitly and
|
418 |
-
finally terminates your license, and (b) permanently, if the copyright
|
419 |
-
holder fails to notify you of the violation by some reasonable means
|
420 |
-
prior to 60 days after the cessation.
|
421 |
-
|
422 |
-
Moreover, your license from a particular copyright holder is
|
423 |
-
reinstated permanently if the copyright holder notifies you of the
|
424 |
-
violation by some reasonable means, this is the first time you have
|
425 |
-
received notice of violation of this License (for any work) from that
|
426 |
-
copyright holder, and you cure the violation prior to 30 days after
|
427 |
-
your receipt of the notice.
|
428 |
-
|
429 |
-
Termination of your rights under this section does not terminate the
|
430 |
-
licenses of parties who have received copies or rights from you under
|
431 |
-
this License. If your rights have been terminated and not permanently
|
432 |
-
reinstated, you do not qualify to receive new licenses for the same
|
433 |
-
material under section 10.
|
434 |
-
|
435 |
-
9. Acceptance Not Required for Having Copies.
|
436 |
-
|
437 |
-
You are not required to accept this License in order to receive or
|
438 |
-
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
-
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
-
to receive a copy likewise does not require acceptance. However,
|
441 |
-
nothing other than this License grants you permission to propagate or
|
442 |
-
modify any covered work. These actions infringe copyright if you do
|
443 |
-
not accept this License. Therefore, by modifying or propagating a
|
444 |
-
covered work, you indicate your acceptance of this License to do so.
|
445 |
-
|
446 |
-
10. Automatic Licensing of Downstream Recipients.
|
447 |
-
|
448 |
-
Each time you convey a covered work, the recipient automatically
|
449 |
-
receives a license from the original licensors, to run, modify and
|
450 |
-
propagate that work, subject to this License. You are not responsible
|
451 |
-
for enforcing compliance by third parties with this License.
|
452 |
-
|
453 |
-
An "entity transaction" is a transaction transferring control of an
|
454 |
-
organization, or substantially all assets of one, or subdividing an
|
455 |
-
organization, or merging organizations. If propagation of a covered
|
456 |
-
work results from an entity transaction, each party to that
|
457 |
-
transaction who receives a copy of the work also receives whatever
|
458 |
-
licenses to the work the party's predecessor in interest had or could
|
459 |
-
give under the previous paragraph, plus a right to possession of the
|
460 |
-
Corresponding Source of the work from the predecessor in interest, if
|
461 |
-
the predecessor has it or can get it with reasonable efforts.
|
462 |
-
|
463 |
-
You may not impose any further restrictions on the exercise of the
|
464 |
-
rights granted or affirmed under this License. For example, you may
|
465 |
-
not impose a license fee, royalty, or other charge for exercise of
|
466 |
-
rights granted under this License, and you may not initiate litigation
|
467 |
-
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
-
any patent claim is infringed by making, using, selling, offering for
|
469 |
-
sale, or importing the Program or any portion of it.
|
470 |
-
|
471 |
-
11. Patents.
|
472 |
-
|
473 |
-
A "contributor" is a copyright holder who authorizes use under this
|
474 |
-
License of the Program or a work on which the Program is based. The
|
475 |
-
work thus licensed is called the contributor's "contributor version".
|
476 |
-
|
477 |
-
A contributor's "essential patent claims" are all patent claims
|
478 |
-
owned or controlled by the contributor, whether already acquired or
|
479 |
-
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
-
by this License, of making, using, or selling its contributor version,
|
481 |
-
but do not include claims that would be infringed only as a
|
482 |
-
consequence of further modification of the contributor version. For
|
483 |
-
purposes of this definition, "control" includes the right to grant
|
484 |
-
patent sublicenses in a manner consistent with the requirements of
|
485 |
-
this License.
|
486 |
-
|
487 |
-
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
-
patent license under the contributor's essential patent claims, to
|
489 |
-
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
-
propagate the contents of its contributor version.
|
491 |
-
|
492 |
-
In the following three paragraphs, a "patent license" is any express
|
493 |
-
agreement or commitment, however denominated, not to enforce a patent
|
494 |
-
(such as an express permission to practice a patent or covenant not to
|
495 |
-
sue for patent infringement). To "grant" such a patent license to a
|
496 |
-
party means to make such an agreement or commitment not to enforce a
|
497 |
-
patent against the party.
|
498 |
-
|
499 |
-
If you convey a covered work, knowingly relying on a patent license,
|
500 |
-
and the Corresponding Source of the work is not available for anyone
|
501 |
-
to copy, free of charge and under the terms of this License, through a
|
502 |
-
publicly available network server or other readily accessible means,
|
503 |
-
then you must either (1) cause the Corresponding Source to be so
|
504 |
-
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
-
patent license for this particular work, or (3) arrange, in a manner
|
506 |
-
consistent with the requirements of this License, to extend the patent
|
507 |
-
license to downstream recipients. "Knowingly relying" means you have
|
508 |
-
actual knowledge that, but for the patent license, your conveying the
|
509 |
-
covered work in a country, or your recipient's use of the covered work
|
510 |
-
in a country, would infringe one or more identifiable patents in that
|
511 |
-
country that you have reason to believe are valid.
|
512 |
-
|
513 |
-
If, pursuant to or in connection with a single transaction or
|
514 |
-
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
-
covered work, and grant a patent license to some of the parties
|
516 |
-
receiving the covered work authorizing them to use, propagate, modify
|
517 |
-
or convey a specific copy of the covered work, then the patent license
|
518 |
-
you grant is automatically extended to all recipients of the covered
|
519 |
-
work and works based on it.
|
520 |
-
|
521 |
-
A patent license is "discriminatory" if it does not include within
|
522 |
-
the scope of its coverage, prohibits the exercise of, or is
|
523 |
-
conditioned on the non-exercise of one or more of the rights that are
|
524 |
-
specifically granted under this License. You may not convey a covered
|
525 |
-
work if you are a party to an arrangement with a third party that is
|
526 |
-
in the business of distributing software, under which you make payment
|
527 |
-
to the third party based on the extent of your activity of conveying
|
528 |
-
the work, and under which the third party grants, to any of the
|
529 |
-
parties who would receive the covered work from you, a discriminatory
|
530 |
-
patent license (a) in connection with copies of the covered work
|
531 |
-
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
-
for and in connection with specific products or compilations that
|
533 |
-
contain the covered work, unless you entered into that arrangement,
|
534 |
-
or that patent license was granted, prior to 28 March 2007.
|
535 |
-
|
536 |
-
Nothing in this License shall be construed as excluding or limiting
|
537 |
-
any implied license or other defenses to infringement that may
|
538 |
-
otherwise be available to you under applicable patent law.
|
539 |
-
|
540 |
-
12. No Surrender of Others' Freedom.
|
541 |
-
|
542 |
-
If conditions are imposed on you (whether by court order, agreement or
|
543 |
-
otherwise) that contradict the conditions of this License, they do not
|
544 |
-
excuse you from the conditions of this License. If you cannot convey a
|
545 |
-
covered work so as to satisfy simultaneously your obligations under this
|
546 |
-
License and any other pertinent obligations, then as a consequence you may
|
547 |
-
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
-
to collect a royalty for further conveying from those to whom you convey
|
549 |
-
the Program, the only way you could satisfy both those terms and this
|
550 |
-
License would be to refrain entirely from conveying the Program.
|
551 |
-
|
552 |
-
13. Use with the GNU Affero General Public License.
|
553 |
-
|
554 |
-
Notwithstanding any other provision of this License, you have
|
555 |
-
permission to link or combine any covered work with a work licensed
|
556 |
-
under version 3 of the GNU Affero General Public License into a single
|
557 |
-
combined work, and to convey the resulting work. The terms of this
|
558 |
-
License will continue to apply to the part which is the covered work,
|
559 |
-
but the special requirements of the GNU Affero General Public License,
|
560 |
-
section 13, concerning interaction through a network will apply to the
|
561 |
-
combination as such.
|
562 |
-
|
563 |
-
14. Revised Versions of this License.
|
564 |
-
|
565 |
-
The Free Software Foundation may publish revised and/or new versions of
|
566 |
-
the GNU General Public License from time to time. Such new versions will
|
567 |
-
be similar in spirit to the present version, but may differ in detail to
|
568 |
-
address new problems or concerns.
|
569 |
-
|
570 |
-
Each version is given a distinguishing version number. If the
|
571 |
-
Program specifies that a certain numbered version of the GNU General
|
572 |
-
Public License "or any later version" applies to it, you have the
|
573 |
-
option of following the terms and conditions either of that numbered
|
574 |
-
version or of any later version published by the Free Software
|
575 |
-
Foundation. If the Program does not specify a version number of the
|
576 |
-
GNU General Public License, you may choose any version ever published
|
577 |
-
by the Free Software Foundation.
|
578 |
-
|
579 |
-
If the Program specifies that a proxy can decide which future
|
580 |
-
versions of the GNU General Public License can be used, that proxy's
|
581 |
-
public statement of acceptance of a version permanently authorizes you
|
582 |
-
to choose that version for the Program.
|
583 |
-
|
584 |
-
Later license versions may give you additional or different
|
585 |
-
permissions. However, no additional obligations are imposed on any
|
586 |
-
author or copyright holder as a result of your choosing to follow a
|
587 |
-
later version.
|
588 |
-
|
589 |
-
15. Disclaimer of Warranty.
|
590 |
-
|
591 |
-
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
-
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
-
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
-
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
-
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
-
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
-
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
-
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
-
|
600 |
-
16. Limitation of Liability.
|
601 |
-
|
602 |
-
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
-
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
-
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
-
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
-
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
-
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
-
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
-
SUCH DAMAGES.
|
611 |
-
|
612 |
-
17. Interpretation of Sections 15 and 16.
|
613 |
-
|
614 |
-
If the disclaimer of warranty and limitation of liability provided
|
615 |
-
above cannot be given local legal effect according to their terms,
|
616 |
-
reviewing courts shall apply local law that most closely approximates
|
617 |
-
an absolute waiver of all civil liability in connection with the
|
618 |
-
Program, unless a warranty or assumption of liability accompanies a
|
619 |
-
copy of the Program in return for a fee.
|
620 |
-
|
621 |
-
END OF TERMS AND CONDITIONS
|
622 |
-
|
623 |
-
How to Apply These Terms to Your New Programs
|
624 |
-
|
625 |
-
If you develop a new program, and you want it to be of the greatest
|
626 |
-
possible use to the public, the best way to achieve this is to make it
|
627 |
-
free software which everyone can redistribute and change under these terms.
|
628 |
-
|
629 |
-
To do so, attach the following notices to the program. It is safest
|
630 |
-
to attach them to the start of each source file to most effectively
|
631 |
-
state the exclusion of warranty; and each file should have at least
|
632 |
-
the "copyright" line and a pointer to where the full notice is found.
|
633 |
-
|
634 |
-
{one line to give the program's name and a brief idea of what it does.}
|
635 |
-
Copyright (C) {year} {name of author}
|
636 |
-
|
637 |
-
This program is free software: you can redistribute it and/or modify
|
638 |
-
it under the terms of the GNU General Public License as published by
|
639 |
-
the Free Software Foundation, either version 3 of the License, or
|
640 |
-
(at your option) any later version.
|
641 |
-
|
642 |
-
This program is distributed in the hope that it will be useful,
|
643 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
-
GNU General Public License for more details.
|
646 |
-
|
647 |
-
You should have received a copy of the GNU General Public License
|
648 |
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
649 |
-
|
650 |
-
Also add information on how to contact you by electronic and paper mail.
|
651 |
-
|
652 |
-
If the program does terminal interaction, make it output a short
|
653 |
-
notice like this when it starts in an interactive mode:
|
654 |
-
|
655 |
-
{project} Copyright (C) {year} {fullname}
|
656 |
-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
-
This is free software, and you are welcome to redistribute it
|
658 |
-
under certain conditions; type `show c' for details.
|
659 |
-
|
660 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
-
parts of the General Public License. Of course, your program's commands
|
662 |
-
might be different; for a GUI interface, you would use an "about box".
|
663 |
-
|
664 |
-
You should also get your employer (if you work as a programmer) or school,
|
665 |
-
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
-
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
-
<http://www.gnu.org/licenses/>.
|
668 |
-
|
669 |
-
The GNU General Public License does not permit incorporating your program
|
670 |
-
into proprietary programs. If your program is a subroutine library, you
|
671 |
-
may consider it more useful to permit linking proprietary applications with
|
672 |
-
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
-
Public License instead of this License. But first, please read
|
674 |
-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
div[id*="_carousel_slider"] .widget-top{background:#ddffff !important;border:1px solid #2196f3 !important}div[id*="_carousel_slider"] .widget-top:hover{background:#ffdddd !important;border:1px solid #f44336 !important}.shapla-toggle{margin:1em 0 !important}.shapla-toggle-title{display:block;padding:15px 10px;outline:0;cursor:pointer;position:relative}.shapla-toggle-title:after{position:absolute;right:15px;font:400 20px/1 dashicons;margin-left:-1px;padding-right:3px;vertical-align:top;content:"\f132"}.shapla-toggle-title.ui-state-active:after{content:"\f460"}.shapla-toggle-content{padding:20px;background-color:#f1f1f1}.shapla-toggle--normal .shapla-toggle-title{background:#9e9e9e;color:white;font-weight:600}.shapla-toggle--stroke .shapla-toggle-title{border:1px solid #363f48;font-weight:600}.shapla-toggle--stroke .shapla-toggle-title:after{color:#363f48}.shapla-toggle--stroke .shapla-toggle-content{padding:20px;background-color:#ffffff;border:1px solid #363f48;border-top:none}.overflowHidden{overflow:hidden}.overflowVisible{overflow:visible}.sp-input-group{margin-bottom:10px}.sp-input-group:after{content:"";display:table;clear:both}.sp-input-label label{font-weight:600;margin-right:30px}.sp-input-label,.sp-input-field{float:left;width:100%}.sp-input-desc{color:#999;font-size:0.9em;line-height:1.3em;margin:10px 30px 10px 0}.sp-input-text{width:100%;padding:8px 8px 8px 16px;height:35px !important}.sp-input-text option{padding:8px 4px}.spacing-text{width:62px}@media only screen and (min-width: 600px){.sp-input-label{width:40%}.sp-input-field{width:60%}}@media only screen and (min-width: 783px){.sp-input-label{width:30%}.sp-input-field{width:70%}.sp-input-text{width:25em}}@media only screen and (min-width: 851px){.sp-input-label,.sp-input-field{width:100%}}@media only screen and (min-width: 1200px){.sp-input-label{width:40%}.sp-input-field{width:60%}}@media only screen and (min-width: 1600px){.sp-input-label{width:30%}.sp-input-field{width:70%}}.carousel_slider_images:before,.carousel_slider_images:after{display:table;content:""}.carousel_slider_images:after{clear:both}.carousel_slider_gallery_btn{border:1px solid #616161;color:#616161;background-color:#f1f1f1;padding:5px 15px;text-decoration:none}.carousel_slider_gallery_btn:hover{background-color:#ffffff;color:#616161}.carousel_slider_gallery_list{margin:15px 0 0 0;padding:0;list-style:none;-webkit-box-sizing:border-box;box-sizing:border-box}.carousel_slider_gallery_list:before,.carousel_slider_gallery_list:after{display:table;content:""}.carousel_slider_gallery_list:after{clear:both}.carousel_slider_gallery_list li{float:left;margin:0;padding:0}.carousel_slider_gallery_list li>img{margin-right:10px;margin-bottom:10px;display:block;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)}#field-_post_date_after,#field-_post_date_before,#field-_post_categories,#field-_post_tags,#field-_post_in{display:none}#field-_product_query,#field-_product_categories,#field-_product_tags,#field-_product_in{display:none}#carousel-slider-navigation-settings p,#carousel-slider-responsive-settings p,#carousel-slider-autoplay-settings p{overflow:hidden}#carousel-slider-navigation-settings input.small-text,#carousel-slider-navigation-settings select.small-text,#carousel-slider-responsive-settings input.small-text,#carousel-slider-responsive-settings select.small-text,#carousel-slider-autoplay-settings input.small-text,#carousel-slider-autoplay-settings select.small-text{float:right}.tab-background .slide_bg_wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;padding:1rem 0}.tab-background .slide_thumb{position:relative;float:left;margin-right:1rem;border:solid 1px #e0e0e0;padding:5px}.tab-background .slide_thumb>div{width:320px;height:180px;background-color:#f1f1f1;background-repeat:no-repeat;background-position:top left;background-size:100% auto}.tab-background .slide_thumb>span{display:inline-block;position:absolute;top:0;right:0;font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:14px;padding:3px 3px;background-color:rgba(0,0,0,0.5);color:#ffffff;cursor:pointer;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.tab-background .slide_thumb>span.hidden{display:none !important}.tab-background .slide_image_settings_line{display:block;margin:0.5rem 0}.tab-background .slide_image_settings_line>span{width:150px;display:inline-block}.ui-datepicker{background-color:#ffffff;border:1px solid #cccccc;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);padding:8px;display:none}.ui-datepicker-header{background-color:#f1f1f1}.ui-datepicker-prev,.ui-datepicker-next{color:#000;padding:6px;cursor:pointer}.ui-datepicker-prev:hover,.ui-datepicker-next:hover{color:#000}.ui-datepicker-prev{float:left}.ui-datepicker-next{float:right}.ui-datepicker-calendar td>a{border:1px solid #ddd;display:block;padding:6px;text-decoration:none;color:#000;background-color:#f1f1f1}.ui-datepicker-calendar td.ui-datepicker-today>a{color:#000;background-color:#ffeb3b}.ui-datepicker-calendar td.ui-datepicker-current-day>a{color:#fff;background-color:#f44336}.sp-wp-editor-container{max-width:560px}.select2-container{-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:block;height:28px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:block;min-height:32px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{-webkit-box-sizing:border-box;box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:0}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:0;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:0;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:0;outline:0;background-image:-webkit-linear-gradient(top, white 50%, #eee 100%);background-image:-o-linear-gradient(top, white 50%, #eee 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(50%, white), to(#eee));background-image:linear-gradient(to bottom, white 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(50%, #eee), to(#ccc));background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, white 0%, #eee 50%);background-image:-o-linear-gradient(top, white 0%, #eee 50%);background-image:-webkit-gradient(linear, left top, left bottom, from(white), color-stop(50%, #eee));background-image:linear-gradient(to bottom, white 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, white 100%);background-image:-o-linear-gradient(top, #eee 50%, white 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(50%, #eee), to(white));background-image:linear-gradient(to bottom, #eee 50%, white 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:0;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:0;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;-webkit-box-shadow:none;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:white;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:white}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}.carousel_slider-modal{display:none;position:fixed;z-index:10000;left:0;top:0;width:100%;height:100%;overflow:hidden;background-color:#000;background-color:rgba(0,0,0,0.8)}.carousel_slider-modal-content{position:relative;background-color:#fefefe;margin:50px auto 18px;padding:0;border:1px solid #23282d;min-height:300px;width:412px;-webkit-box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)}.carousel_slider-modal-header{background-color:#23282d;color:white;font-weight:bold;padding:10px 16px}.carousel_slider-modal-body{overflow-x:hidden;overflow-y:scroll;padding:2px 16px}.carousel_slider-modal-footer{background-color:#23282d;color:white;font-weight:bold;padding:10px 16px}.carousel_slider-modal-footer img{display:none;height:14px;vertical-align:middle;width:14px}.carousel_slider-form{margin-left:-15px;margin-right:-15px}.carousel_slider-fields{background-color:#f1f1f1;margin:15px;padding:15px 25px 15px 15px;position:relative;display:inline-block;float:left}.carousel_slider-fields label.setting{display:block;margin-bottom:5px}.carousel_slider-fields label.setting .name{display:inline-block;vertical-align:top;width:75px}.carousel_slider-fields label.setting input,.carousel_slider-fields label.setting textarea{width:250px}.carousel_slider-fields .actions{position:absolute;right:0;top:0}.carousel_slider-fields .actions>span{background:#fff none repeat scroll 0 0;display:block;float:none;cursor:pointer}.carousel_slider-fields .actions>span .dashicons-plus-alt:hover{color:green}.carousel_slider-fields .actions>span .dashicons-trash:hover{color:red}.carousel_slider-close{color:#f1f1f1;float:right;font-size:28px;font-weight:bold}.carousel_slider-close:hover,.carousel_slider-close:focus{color:#fff;text-decoration:none;cursor:pointer}.carousel_slider_url_images_list{margin:15px 0 0;padding:0;list-style:none}.carousel_slider_url_images_list li{float:left;display:inline-block;margin:0 5px 5px 0}@media only screen and (min-width: 820px){.carousel_slider-modal-content{width:810px}}@media only screen and (min-width: 1230px){.carousel_slider-modal-content{width:1220px}}.modal{bottom:0;left:0;position:absolute;right:0;top:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:none;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;overflow:hidden;position:fixed;z-index:10000}.admin-bar .modal{top:32px}.modal .delete-icon{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0.2);border:none;border-radius:32px;cursor:pointer;display:inline-block;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:1rem;outline:none;position:relative;vertical-align:top;height:20px;width:20px}.modal .delete-icon:before,.modal .delete-icon:after{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);-ms-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center}.modal .delete-icon:before{height:2px;width:50%}.modal .delete-icon:after{height:50%;width:2px}.modal .delete-icon:hover,.modal .delete-icon:focus{background-color:rgba(0,0,0,0.3)}.modal .delete-icon:active{background-color:rgba(0,0,0,0.4)}.modal .delete-icon.is-small{height:16px;width:16px}.modal .delete-icon.is-medium{height:24px;width:24px}.modal .delete-icon.is-large{height:32px;width:32px}.modal.is-active{display:-webkit-box;display:-ms-flexbox;display:flex}.modal-background{bottom:0;left:0;position:absolute;right:0;top:0;background-color:rgba(0,0,0,0.86)}.modal-content,.modal-card{margin:0 20px;max-height:calc(100vh - 160px);overflow:auto;position:relative;width:100%}@media screen and (min-width: 769px), print{.modal-content,.modal-card{margin:0 auto;max-height:calc(100vh - 40px);width:640px}}.modal-close{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0.2);border:none;border-radius:32px;cursor:pointer;display:inline-block;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:1rem;outline:none;position:relative;vertical-align:top;height:20px;width:20px;background:none;height:40px;position:fixed;right:20px;top:20px;width:40px}.modal-close:before,.modal-close:after{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);-ms-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center}.modal-close:before{height:2px;width:50%}.modal-close:after{height:50%;width:2px}.modal-close:hover,.modal-close:focus{background-color:rgba(0,0,0,0.3)}.modal-close:active{background-color:rgba(0,0,0,0.4)}.modal-close.is-small{height:16px;width:16px}.modal-close.is-medium{height:24px;width:24px}.modal-close.is-large{height:32px;width:32px}.modal-card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-height:calc(100vh - 40px);overflow:hidden}.modal-card-head,.modal-card-foot{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#f5f5f5;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;margin:0;padding:20px;position:relative}.modal-card-head{border-bottom:1px solid #f5f5f5;border-top-left-radius:5px;border-top-right-radius:5px}.modal-card-title{color:#212121;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;font-size:1.5rem;line-height:1;margin:0;padding:0}.modal-card-foot{border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:1px solid #f5f5f5}.modal-card-foot .button:not(:last-child){margin-right:10px}.modal-card-body{-webkit-overflow-scrolling:touch;background-color:#fff;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;overflow:auto;margin:0;padding:20px}.cs-tooltip{display:inline-block;width:1.5em;height:1.5em;float:right}.cs-tooltip:after{font-family:Dashicons;speak:none;font-weight:400;text-transform:none;-webkit-font-smoothing:antialiased;width:100%;height:100%;text-align:center;content:"\f223";cursor:help}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:99999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_left{padding-right:5px}#tiptip_content{font-size:11px;color:#fff;text-shadow:0 0 2px #000;padding:4px 8px;border:1px solid rgba(255,255,255,0.25);background-color:#191919;background-color:rgba(25,25,25,0.92);background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;box-shadow:0 0 3px #555;-webkit-box-shadow:0 0 3px #555;-moz-box-shadow:0 0 3px #555}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border-color:transparent;border-style:solid;border-width:6px;height:0;width:0}#tiptip_holder.tip_top #tiptip_arrow{border-top-color:#fff;border-top-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_bottom #tiptip_arrow{border-bottom-color:#fff;border-bottom-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_right #tiptip_arrow{border-right-color:#fff;border-right-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_left #tiptip_arrow{border-left-color:#fff;border-left-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#191919;border-top-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#191919;border-bottom-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#191919;border-right-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#191919;border-left-color:rgba(25,25,25,0.92)}@media screen and (-webkit-min-device-pixel-ratio: 0){#tiptip_content{padding:4px 8px 5px 8px;background-color:rgba(45,45,45,0.88)}#tiptip_holder.tip_bottom #tiptip_arrow_inner{border-bottom-color:rgba(45,45,45,0.88)}#tiptip_holder.tip_top #tiptip_arrow_inner{border-top-color:rgba(20,20,20,0.92)}}.shapla-nav{list-style:none !important;margin:0;padding:0}.shapla-nav:before,.shapla-nav:after{display:table;content:' '}.shapla-nav:after{clear:both}.shapla-nav li{float:left;position:relative;margin:0 1px -1px 0 !important;z-index:1;outline:0}.shapla-nav a{text-decoration:none;display:block;padding:15px 10px;line-height:1;outline:0}.shapla-tab{margin:0 0 2em 0;padding:21px 20px 20px 20px}.shapla-tab p:first-of-type{margin-top:0}.shapla-tab p:last-of-type{margin-bottom:0}.shapla-tabs--normal .shapla-nav a{background:#323232;color:#fff}.shapla-tabs--normal .shapla-nav .ui-tabs-active a{background:#f1f1f1;color:#323232;outline:0}.shapla-tabs--normal .shapla-tab{background:#f1f1f1}.shapla-tabs--stroke .shapla-nav li{margin:0 -1px 0 0 !important}.shapla-tabs--stroke .shapla-nav a{border:1px solid #323232;color:#323232}.shapla-tabs--stroke .shapla-nav .ui-tabs-active a{border-bottom-color:white}.shapla-tabs--stroke .shapla-tab{border:1px solid #323232;margin-top:-1px}
|
1 |
+
div[id*="_carousel_slider"] .widget-top{background:#ddffff !important;border:1px solid #2196f3 !important}div[id*="_carousel_slider"] .widget-top:hover{background:#ffdddd !important;border:1px solid #f44336 !important}.shapla-toggle{margin:1em 0 !important}.shapla-toggle-title{display:block;padding:15px 10px;outline:0;cursor:pointer;position:relative}.shapla-toggle-title:after{position:absolute;right:15px;font:400 20px/1 dashicons;margin-left:-1px;padding-right:3px;vertical-align:top;content:"\f132"}.shapla-toggle-title.ui-state-active:after{content:"\f460"}.shapla-toggle-content{padding:20px;background-color:#f1f1f1}.shapla-toggle--normal .shapla-toggle-title{background:#9e9e9e;color:white;font-weight:600}.shapla-toggle--stroke .shapla-toggle-title{border:1px solid #363f48;font-weight:600}.shapla-toggle--stroke .shapla-toggle-title:after{color:#363f48}.shapla-toggle--stroke .shapla-toggle-content{padding:20px;background-color:#ffffff;border:1px solid #363f48;border-top:none}.overflowHidden{overflow:hidden}.overflowVisible{overflow:visible}.sp-input-group{margin-bottom:10px}.sp-input-group:after{content:"";display:table;clear:both}.sp-input-label label{font-weight:600;margin-right:30px}.sp-input-label,.sp-input-field{float:left;width:100%}.sp-input-desc{color:#999;font-size:0.9em;line-height:1.3em;margin:10px 30px 10px 0}.sp-input-text{width:100%;padding:8px 8px 8px 16px;height:35px !important}.sp-input-text option{padding:8px 4px}.spacing-text{width:62px}@media only screen and (min-width: 600px){.sp-input-label{width:40%}.sp-input-field{width:60%}}@media only screen and (min-width: 783px){.sp-input-label{width:30%}.sp-input-field{width:70%}.sp-input-text{width:25em}}@media only screen and (min-width: 851px){.sp-input-label,.sp-input-field{width:100%}}@media only screen and (min-width: 1200px){.sp-input-label{width:40%}.sp-input-field{width:60%}}@media only screen and (min-width: 1600px){.sp-input-label{width:30%}.sp-input-field{width:70%}}.carousel_slider_images:before,.carousel_slider_images:after{display:table;content:""}.carousel_slider_images:after{clear:both}.carousel_slider_gallery_btn{border:1px solid #616161;color:#616161;background-color:#f1f1f1;padding:5px 15px;text-decoration:none}.carousel_slider_gallery_btn:hover{background-color:#ffffff;color:#616161}.carousel_slider_gallery_list{margin:15px 0 0 0;padding:0;list-style:none;-webkit-box-sizing:border-box;box-sizing:border-box}.carousel_slider_gallery_list:before,.carousel_slider_gallery_list:after{display:table;content:""}.carousel_slider_gallery_list:after{clear:both}.carousel_slider_gallery_list li{float:left;margin:0;padding:0}.carousel_slider_gallery_list li>img{margin-right:10px;margin-bottom:10px;display:block;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)}#field-_post_date_after,#field-_post_date_before,#field-_post_categories,#field-_post_tags,#field-_post_in{display:none}#field-_product_query,#field-_product_categories,#field-_product_tags,#field-_product_in{display:none}#carousel-slider-navigation-settings p,#carousel-slider-responsive-settings p,#carousel-slider-autoplay-settings p{overflow:hidden}#carousel-slider-navigation-settings input.small-text,#carousel-slider-navigation-settings select.small-text,#carousel-slider-responsive-settings input.small-text,#carousel-slider-responsive-settings select.small-text,#carousel-slider-autoplay-settings input.small-text,#carousel-slider-autoplay-settings select.small-text{float:right}.tab-background .slide_bg_wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;padding:1rem 0}.tab-background .slide_thumb{position:relative;float:left;margin-right:1rem;border:solid 1px #e0e0e0;padding:5px}.tab-background .slide_thumb>div{width:320px;height:180px;background-color:#f1f1f1;background-repeat:no-repeat;background-position:top left;background-size:100% auto}.tab-background .slide_thumb>span{display:inline-block;position:absolute;top:0;right:0;font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:14px;padding:3px 3px;background-color:rgba(0,0,0,0.5);color:#ffffff;cursor:pointer;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.tab-background .slide_thumb>span.hidden{display:none !important}.tab-background .slide_image_settings_line{display:block;margin:0.5rem 0}.tab-background .slide_image_settings_line>span{width:150px;display:inline-block}.ui-datepicker{background-color:#ffffff;border:1px solid #cccccc;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);padding:8px;display:none}.ui-datepicker-header{background-color:#f1f1f1}.ui-datepicker-prev,.ui-datepicker-next{color:#000;padding:6px;cursor:pointer}.ui-datepicker-prev:hover,.ui-datepicker-next:hover{color:#000}.ui-datepicker-prev{float:left}.ui-datepicker-next{float:right}.ui-datepicker-calendar td>a{border:1px solid #ddd;display:block;padding:6px;text-decoration:none;color:#000;background-color:#f1f1f1}.ui-datepicker-calendar td.ui-datepicker-today>a{color:#000;background-color:#ffeb3b}.ui-datepicker-calendar td.ui-datepicker-current-day>a{color:#fff;background-color:#f44336}.sp-wp-editor-container{max-width:560px}.select2-container{-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:block;height:28px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:block;min-height:32px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{-webkit-box-sizing:border-box;box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:0}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:0;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:0;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:0;outline:0;background-image:-webkit-linear-gradient(top, white 50%, #eee 100%);background-image:-o-linear-gradient(top, white 50%, #eee 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(50%, white), to(#eee));background-image:linear-gradient(to bottom, white 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(50%, #eee), to(#ccc));background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, white 0%, #eee 50%);background-image:-o-linear-gradient(top, white 0%, #eee 50%);background-image:-webkit-gradient(linear, left top, left bottom, from(white), color-stop(50%, #eee));background-image:linear-gradient(to bottom, white 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, white 100%);background-image:-o-linear-gradient(top, #eee 50%, white 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(50%, #eee), to(white));background-image:linear-gradient(to bottom, #eee 50%, white 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:0;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:0;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;-webkit-box-shadow:none;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:white;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:white}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}.carousel_slider-modal{display:none;position:fixed;z-index:10000;left:0;top:0;width:100%;height:100%;overflow:hidden;background-color:#000;background-color:rgba(0,0,0,0.8)}.carousel_slider-modal-content{position:relative;background-color:#fefefe;margin:50px auto 18px;padding:0;border:1px solid #23282d;min-height:300px;width:412px;-webkit-box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)}.carousel_slider-modal-header{background-color:#23282d;color:white;font-weight:bold;padding:10px 16px}.carousel_slider-modal-body{overflow-x:hidden;overflow-y:scroll;padding:2px 16px}.carousel_slider-modal-footer{background-color:#23282d;color:white;font-weight:bold;padding:10px 16px}.carousel_slider-modal-footer img{display:none;height:14px;vertical-align:middle;width:14px}.carousel_slider-form{margin-left:-15px;margin-right:-15px}.carousel_slider-fields{background-color:#f1f1f1;margin:15px;padding:15px 25px 15px 15px;position:relative;display:inline-block;float:left}.carousel_slider-fields label.setting{display:block;margin-bottom:5px}.carousel_slider-fields label.setting .name{display:inline-block;vertical-align:top;width:75px}.carousel_slider-fields label.setting input,.carousel_slider-fields label.setting textarea{width:250px}.carousel_slider-fields .actions{position:absolute;right:0;top:0}.carousel_slider-fields .actions>span{background:#fff none repeat scroll 0 0;display:block;float:none;cursor:pointer}.carousel_slider-fields .actions>span .dashicons-plus-alt:hover{color:green}.carousel_slider-fields .actions>span .dashicons-trash:hover{color:red}.carousel_slider-close{color:#f1f1f1;float:right;font-size:28px;font-weight:bold}.carousel_slider-close:hover,.carousel_slider-close:focus{color:#fff;text-decoration:none;cursor:pointer}.carousel_slider_url_images_list{margin:15px 0 0;padding:0;list-style:none}.carousel_slider_url_images_list li{float:left;display:inline-block;margin:0 5px 5px 0}@media only screen and (min-width: 820px){.carousel_slider-modal-content{width:810px}}@media only screen and (min-width: 1230px){.carousel_slider-modal-content{width:1220px}}.modal{bottom:0;left:0;position:absolute;right:0;top:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:none;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;overflow:hidden;position:fixed;z-index:10000}.admin-bar .modal{top:32px}.modal .delete-icon{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0.2);border:none;border-radius:32px;cursor:pointer;display:inline-block;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:1rem;outline:none;position:relative;vertical-align:top;height:20px;width:20px}.modal .delete-icon:before,.modal .delete-icon:after{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);-ms-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center}.modal .delete-icon:before{height:2px;width:50%}.modal .delete-icon:after{height:50%;width:2px}.modal .delete-icon:hover,.modal .delete-icon:focus{background-color:rgba(0,0,0,0.3)}.modal .delete-icon:active{background-color:rgba(0,0,0,0.4)}.modal .delete-icon.is-small{height:16px;width:16px}.modal .delete-icon.is-medium{height:24px;width:24px}.modal .delete-icon.is-large{height:32px;width:32px}.modal.is-active{display:-webkit-box;display:-ms-flexbox;display:flex}.modal-background{bottom:0;left:0;position:absolute;right:0;top:0;background-color:rgba(0,0,0,0.86)}.modal-content,.modal-card{margin:0 20px;max-height:calc(100vh - 160px);overflow:auto;position:relative;width:100%}@media screen and (min-width: 769px), print{.modal-content,.modal-card{margin:0 auto;max-height:calc(100vh - 40px);width:640px}}.modal-close{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0.2);border:none;border-radius:32px;cursor:pointer;display:inline-block;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:1rem;outline:none;position:relative;vertical-align:top;height:20px;width:20px;background:none;height:40px;position:fixed;right:20px;top:20px;width:40px}.modal-close:before,.modal-close:after{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;-webkit-transform:translateX(-50%) translateY(-50%) rotate(45deg);-ms-transform:translateX(-50%) translateY(-50%) rotate(45deg);transform:translateX(-50%) translateY(-50%) rotate(45deg);-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center}.modal-close:before{height:2px;width:50%}.modal-close:after{height:50%;width:2px}.modal-close:hover,.modal-close:focus{background-color:rgba(0,0,0,0.3)}.modal-close:active{background-color:rgba(0,0,0,0.4)}.modal-close.is-small{height:16px;width:16px}.modal-close.is-medium{height:24px;width:24px}.modal-close.is-large{height:32px;width:32px}.modal-card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-height:calc(100vh - 40px);overflow:hidden}.modal-card-head,.modal-card-foot{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#f5f5f5;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;margin:0;padding:20px;position:relative}.modal-card-head{border-bottom:1px solid #f5f5f5;border-top-left-radius:5px;border-top-right-radius:5px}.modal-card-title{color:#212121;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;font-size:1.5rem;line-height:1;margin:0;padding:0}.modal-card-foot{border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:1px solid #f5f5f5}.modal-card-foot .button:not(:last-child){margin-right:10px}.modal-card-body{-webkit-overflow-scrolling:touch;background-color:#fff;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;overflow:auto;margin:0;padding:20px}.cs-tooltip{display:inline-block;width:1.5em;height:1.5em;float:right}.cs-tooltip:after{font-family:Dashicons;speak:none;font-weight:400;text-transform:none;-webkit-font-smoothing:antialiased;width:100%;height:100%;text-align:center;content:"\f223";cursor:help}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:99999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_left{padding-right:5px}#tiptip_content{font-size:11px;color:#fff;text-shadow:0 0 2px #000;padding:4px 8px;border:1px solid rgba(255,255,255,0.25);background-color:#191919;background-color:rgba(25,25,25,0.92);background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;box-shadow:0 0 3px #555;-webkit-box-shadow:0 0 3px #555;-moz-box-shadow:0 0 3px #555}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border-color:transparent;border-style:solid;border-width:6px;height:0;width:0}#tiptip_holder.tip_top #tiptip_arrow{border-top-color:#fff;border-top-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_bottom #tiptip_arrow{border-bottom-color:#fff;border-bottom-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_right #tiptip_arrow{border-right-color:#fff;border-right-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_left #tiptip_arrow{border-left-color:#fff;border-left-color:rgba(255,255,255,0.35)}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#191919;border-top-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#191919;border-bottom-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#191919;border-right-color:rgba(25,25,25,0.92)}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#191919;border-left-color:rgba(25,25,25,0.92)}@media screen and (-webkit-min-device-pixel-ratio: 0){#tiptip_content{padding:4px 8px 5px 8px;background-color:rgba(45,45,45,0.88)}#tiptip_holder.tip_bottom #tiptip_arrow_inner{border-bottom-color:rgba(45,45,45,0.88)}#tiptip_holder.tip_top #tiptip_arrow_inner{border-top-color:rgba(20,20,20,0.92)}}.shapla-nav{list-style:none !important;margin:0;padding:0}.shapla-nav:before,.shapla-nav:after{display:table;content:' '}.shapla-nav:after{clear:both}.shapla-nav li{float:left;position:relative;margin:0 1px -1px 0 !important;z-index:1;outline:0}.shapla-nav a{text-decoration:none;display:block;padding:15px 10px;line-height:1;outline:0}.shapla-tab{margin:0 0 2em 0;padding:21px 20px 20px 20px}.shapla-tab p:first-of-type{margin-top:0}.shapla-tab p:last-of-type{margin-bottom:0}.shapla-tabs--normal .shapla-nav a{background:#323232;color:#fff}.shapla-tabs--normal .shapla-nav .ui-tabs-active a{background:#f1f1f1;color:#323232;outline:0}.shapla-tabs--normal .shapla-tab{background:#f1f1f1}.shapla-tabs--stroke .shapla-nav li{margin:0 -1px 0 0 !important}.shapla-tabs--stroke .shapla-nav a{border:1px solid #323232;color:#323232}.shapla-tabs--stroke .shapla-nav .ui-tabs-active a{border-bottom-color:white}.shapla-tabs--stroke .shapla-tab{border:1px solid #323232;margin-top:-1px}.carousel_slider_iframe{position:relative;padding-bottom:56.25%;padding-top:25px;height:0}.carousel_slider_iframe>iframe{position:absolute;top:0;left:0;width:100%;height:100%}.carousel_slider_columns{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-sizing:border-box;box-sizing:border-box}.carousel_slider_column{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;padding:1rem;-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (min-width: 601px){.carousel_slider_column{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%}}@media screen and (min-width: 1025px){.carousel_slider_column{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%}}@media screen and (min-width: 1400px){.carousel_slider_column{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%}}
|
assets/css/style.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.carousel-slider{display:none;width:100%;-webkit-tap-highlight-color:transparent;position:relative;z-index:1}.carousel-slider .owl-stage{position:relative;-ms-touch-action:pan-Y}.carousel-slider .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.carousel-slider .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0px, 0px, 0px)}.carousel-slider .owl-item{position:relative;min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.carousel-slider .owl-item img{display:block;width:100%;-webkit-transform-style:preserve-3d}.carousel-slider .owl-nav.disabled,.carousel-slider .owl-dots.disabled{display:none}.carousel-slider .owl-nav .owl-prev,.carousel-slider .owl-nav .owl-next,.carousel-slider .owl-dot{cursor:hand;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.carousel-slider.owl-loaded{display:block}.carousel-slider.owl-loading{opacity:0;display:block}.carousel-slider.owl-hidden{opacity:0}.carousel-slider.owl-refresh .owl-item{visibility:hidden}.carousel-slider.owl-drag .owl-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.carousel-slider.owl-grab{cursor:-webkit-grab;cursor:grab}.carousel-slider.owl-rtl{direction:rtl}.carousel-slider.owl-rtl .owl-item{float:right}.no-js .carousel-slider{display:block}.carousel-slider .animated{-webkit-animation-duration:1000ms;animation-duration:1000ms;-webkit-animation-fill-mode:both;animation-fill-mode:both}.carousel-slider .owl-animated-in{z-index:0}.carousel-slider .owl-animated-out{z-index:1}.carousel-slider .fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{-webkit-transition:height 500ms ease-in-out;-o-transition:height 500ms ease-in-out;transition:height 500ms ease-in-out}.carousel-slider .owl-item img.owl-lazy{background:url("../img/ajax-loader.gif") no-repeat center;min-width:32px;min-height:32px}.carousel-slider .owl-video-wrapper{position:relative;height:100%;background:#000}.carousel-slider .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url("../img/play.svg") no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;-webkit-transition:-webkit-transform 100ms ease;transition:-webkit-transform 100ms ease;-o-transition:transform 100ms ease;transition:transform 100ms ease;transition:transform 100ms ease, -webkit-transform 100ms ease}.carousel-slider .owl-video-play-icon:hover{-webkit-transform:scale(1.3, 1.3);-ms-transform:scale(1.3, 1.3);transform:scale(1.3, 1.3)}.carousel-slider .owl-video-playing .owl-video-tn,.carousel-slider .owl-video-playing .owl-video-play-icon{display:none}.carousel-slider .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;-webkit-transition:opacity 400ms ease;-o-transition:opacity 400ms ease;transition:opacity 400ms ease}.carousel-slider .owl-video-frame{position:relative;z-index:1;height:100%;width:100%}.carousel-slider .owl-nav .owl-prev,.carousel-slider .owl-nav .owl-next{height:48px;width:48px;display:inline-block;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);opacity:0;margin:0;padding:0;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.carousel-slider .owl-nav .owl-prev{left:0}.carousel-slider .owl-nav .owl-next{right:0}.carousel-slider:hover .owl-nav .owl-prev,.carousel-slider:hover .owl-nav .owl-next{opacity:1}.carousel-slider.arrows-visible-always .owl-prev,.carousel-slider.arrows-visible-always .owl-next{opacity:1}.carousel-slider.arrows-outside .owl-nav .owl-prev{left:-48px}.carousel-slider.arrows-outside .owl-nav .owl-next{right:-48px}.carousel-slider .owl-dots{text-align:center;-webkit-tap-highlight-color:transparent;margin-top:10px}.carousel-slider .owl-dots .owl-dot{display:inline-block;zoom:1;*display:inline}.carousel-slider .owl-dots .owl-dot span{width:10px;height:10px;margin:4px 8px;background-color:#9e9e9e;display:block;-webkit-backface-visibility:visible;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease}.carousel-slider .owl-dots .owl-dot.active span,.carousel-slider .owl-dots .owl-dot:hover span{background-color:#4caf50}.carousel-slider.dots-center .owl-dots{text-align:center}.carousel-slider.dots-left .owl-dots{text-align:left}.carousel-slider.dots-left .owl-dots:first-child span{margin-left:0}.carousel-slider.dots-right .owl-dots{text-align:right}.carousel-slider.dots-right .owl-dots:last-child span{margin-right:0}.carousel-slider.dots-visible-hover .owl-dots{opacity:0}.carousel-slider.dots-visible-hover:hover .owl-dots{opacity:1}.carousel-slider.dots-circle .owl-dots .owl-dot span{border-radius:9999px}.carousel-slider__post{border:1px solid #f1f1f1;float:left;height:450px;width:100%;position:relative;display:block;overflow:hidden}.carousel-slider__post-content{bottom:0;position:absolute;top:0;-webkit-transition:all 0.2s ease 0s;-o-transition:all 0.2s ease 0s;transition:all 0.2s ease 0s;width:100%;display:block}.carousel-slider__post-image{border-bottom:1px solid #f1f1f1;display:block;height:207px;line-height:0;margin:0 auto;overflow:hidden;text-align:center;width:100%;background-color:#f1f1f1;background-size:cover;background-position:center center}.carousel-slider__post-title{display:block;margin:10px 15px 0;max-height:70px}.carousel-slider__post-title h1{color:#4a4a4a;font:bold 18px/1.4em Arial,sans-serif;margin-bottom:0;margin-top:0}.carousel-slider__post-excerpt{color:#7d7d7d;font-size:14px;line-height:1.5em;padding:10px 15px 5px;text-align:left;width:100%;position:absolute;top:285px}.carousel-slider__post-excerpt-overlay{background:transparent none repeat scroll 0 0;display:block;height:20px;width:100%}.carousel-slider__post-meta{bottom:10px;color:#8e8e8e;font-size:12px;left:0;padding:0 15px;position:absolute;width:100%;display:block}.carousel-slider__post-publication-meta{background-color:white;display:block;padding-top:15px;width:100%;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.carousel-slider__post-details-info{display:inline-block}.carousel-slider__post-author{display:block;font-style:normal;line-height:1em;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;margin-bottom:5px}.carousel-slider__post-author-link{color:#8e8e8e;display:inline-block;max-width:175px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.carousel-slider__post-category{color:#4cc1be;text-transform:uppercase;position:absolute;right:15px;top:50px;z-index:1}.carousel-slider__product{position:relative;text-align:center;border:1px solid #f1f1f1}.carousel-slider__product .woocommerce-LoopProduct-link{display:block;overflow:hidden;margin:0 0 .5em}.carousel-slider__product .onsale{border:0 none;line-height:1;margin:0;padding:15px 5px;color:#f1f1f1;background-color:#96588a;position:absolute;left:8px;top:8px;border-radius:50%}.carousel-slider__product h3{padding:.5em 1em;text-align:left;margin:0;font-size:1em;color:#333}.carousel-slider__product a{text-decoration:none;-webkit-box-shadow:none;box-shadow:none}.carousel-slider__product a img{width:100%;height:auto;display:block;-webkit-box-shadow:none;box-shadow:none}.carousel-slider__product strong{display:block}.carousel-slider__product .price{color:#333;display:inline-block;font-weight:normal;margin:.5em 1em;font-size:.857em;float:left}.carousel-slider__product .price del{color:inherit;background-color:transparent;opacity:0.5;display:inline-block}.carousel-slider__product .price ins{color:inherit;background-color:transparent;font-weight:bold}.carousel-slider__product .star-rating{color:#96588a;display:inline-block;margin:.5em 1em;float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:'star'}.carousel-slider__product .star-rating:before{content:"\73\73\73\73\73";float:left;top:0;left:0;position:absolute}.carousel-slider__product .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.carousel-slider__product .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.carousel-slider__product a.add_to_cart_button,.carousel-slider__product a.added_to_cart,.carousel-slider__product a.quick_view{color:#f1f1f1;background-color:#96588a;margin:1em;line-height:1;cursor:pointer;position:relative;text-decoration:none;overflow:visible;padding:.5em 1em;font-weight:normal;border-radius:3px;left:auto;border:0;white-space:nowrap;display:block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.carousel-slider__product a.add_to_cart_button:hover,.carousel-slider__product a.added_to_cart:hover,.carousel-slider__product a.quick_view:hover{color:#f1f1f1;background-color:#96588a;text-decoration:none;background-image:none}.carousel-slider__product a.add_to_cart_button.loading{opacity:0.25;padding-right:2.618em}.carousel-slider__product a.add_to_cart_button.loading:after{font-family:"WooCommerce";content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:normal;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.carousel-slider__product a.add_to_cart_button.added:after{font-family:'WooCommerce';content:"\e017";margin-left:.53em;vertical-align:bottom}.carousel-slider__content .slide-content-inner{padding:0}.carousel-slider__content .slide-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin:0 auto;padding:1rem;max-width:1140px;min-height:300px}.carousel-slider__content .heading-title-wrapper,.carousel-slider__content .description-title-wrapper{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;padding:0}.carousel-slider__content .heading-title,.carousel-slider__content .description-title{margin:0;padding:0}.carousel-slider__content .buttons-wrapper-one{margin-right:0.5rem}.carousel-slider__content .buttons-wrapper-two{margin-left:0.5rem}.carousel-slider__content img{max-width:100%;width:auto !important}.carousel-slider .carousel-slider__item{position:relative}.carousel-slider .carousel-slider__item img{display:block;margin-left:auto;margin-right:auto;max-width:100%;height:auto}.carousel-slider .carousel-slider__caption{position:relative}.carousel-slider .carousel-slider__caption .title{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:#474747;font-size:16px;font-weight:500;margin:10px 0 0;text-align:center}.carousel-slider .carousel-slider__caption .caption{font-size:14px;font-weight:300;margin:10px 0 0;text-align:center}.cs-button{-webkit-appearance:none;-webkit-font-smoothing:inherit;display:inline-block;font-size:1rem;line-height:1;padding:0.75em 1em;border-radius:0;text-decoration:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all 200ms ease-in-out;-o-transition:all 200ms ease-in-out;transition:all 200ms ease-in-out}.cs-button:hover{text-decoration:none}.cs-button--normal{opacity:0.9;filter:alpha(opacity=90)}.cs-button--stroke{background:transparent;border-width:1px;border-style:solid;border-color:transparent}.cs-button--medium{font-size:1.2rem;padding:0.9em 1.2em}.cs-button--large{font-size:1.5rem;padding:0.9em 1.6em}.mfp-bg{top:0;left:0;width:100%;height:100%;z-index:1042;overflow:hidden;position:fixed;background:#0b0b0b;opacity:.8}.mfp-wrap{top:0;left:0;width:100%;height:100%;z-index:1043;position:fixed;outline:none !important;-webkit-backface-visibility:hidden}.mfp-container{text-align:center;position:absolute;width:100%;height:100%;left:0;top:0;padding:0 8px;-webkit-box-sizing:border-box;box-sizing:border-box}.mfp-container:before{content:'';display:inline-block;height:100%;vertical-align:middle}.mfp-align-top .mfp-container:before{display:none}.mfp-content{position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:1045}.mfp-inline-holder .mfp-content,.mfp-ajax-holder .mfp-content{width:100%;cursor:auto}.mfp-ajax-cur{cursor:progress}.mfp-zoom-out-cur,.mfp-zoom-out-cur .mfp-image-holder .mfp-close{cursor:-webkit-zoom-out;cursor:zoom-out}.mfp-zoom{cursor:pointer;cursor:-webkit-zoom-in;cursor:zoom-in}.mfp-auto-cursor .mfp-content{cursor:auto}.mfp-close,.mfp-arrow,.mfp-preloader,.mfp-counter{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none !important}.mfp-preloader{color:#CCC;position:absolute;top:50%;width:auto;text-align:center;margin-top:-0.8em;left:8px;right:8px;z-index:1044}.mfp-preloader a{color:#CCC}.mfp-preloader a:hover{color:#fff}.mfp-s-ready .mfp-preloader{display:none}.mfp-s-error .mfp-content{display:none}button.mfp-close,button.mfp-arrow{overflow:visible;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;display:block;outline:none;padding:0;z-index:1046;-webkit-box-shadow:none;box-shadow:none;-ms-touch-action:manipulation;touch-action:manipulation}button::-moz-focus-inner{padding:0;border:0}.mfp-close{width:44px;height:44px;line-height:44px;position:absolute;right:0;top:0;text-decoration:none;text-align:center;opacity:.65;padding:0 0 18px 10px;color:#fff;font-style:normal;font-size:28px;font-family:Arial, Baskerville, monospace}.mfp-close:hover,.mfp-close:focus{opacity:1}.mfp-close:active{top:1px}.mfp-close-btn-in .mfp-close{color:#333}.mfp-image-holder .mfp-close,.mfp-iframe-holder .mfp-close{color:#fff;right:-6px;text-align:right;padding-right:6px;width:100%}.mfp-counter{position:absolute;top:0;right:0;color:#CCC;font-size:12px;line-height:18px;white-space:nowrap}.mfp-arrow{position:absolute;opacity:.65;margin:0;top:50%;margin-top:-55px;padding:0;width:90px;height:110px;-webkit-tap-highlight-color:transparent}.mfp-arrow:active{margin-top:-54px}.mfp-arrow:hover,.mfp-arrow:focus{opacity:1}.mfp-arrow:before,.mfp-arrow:after{content:'';display:block;width:0;height:0;position:absolute;left:0;top:0;margin-top:35px;margin-left:35px;border:medium inset transparent}.mfp-arrow:after{border-top-width:13px;border-bottom-width:13px;top:8px}.mfp-arrow:before{border-top-width:21px;border-bottom-width:21px;opacity:0.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after{border-right:17px solid #fff;margin-left:31px}.mfp-arrow-left:before{margin-left:25px;border-right:27px solid #3F3F3F}.mfp-arrow-right{right:0}.mfp-arrow-right:after{border-left:17px solid #fff;margin-left:39px}.mfp-arrow-right:before{border-left:27px solid #3F3F3F}.mfp-iframe-holder{padding-top:40px;padding-bottom:40px}.mfp-iframe-holder .mfp-content{line-height:0;width:100%;max-width:900px}.mfp-iframe-holder .mfp-close{top:-40px}.mfp-iframe-scaler{width:100%;height:0;overflow:hidden;padding-top:56.25%}.mfp-iframe-scaler iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;-webkit-box-shadow:0 0 8px rgba(0,0,0,0.6);box-shadow:0 0 8px rgba(0,0,0,0.6);background:#000}img.mfp-img{width:auto;max-width:100%;height:auto;display:block;line-height:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 0 40px;margin:0 auto}.mfp-figure{line-height:0}.mfp-figure:after{content:'';position:absolute;left:0;top:40px;bottom:40px;display:block;right:0;width:auto;height:auto;z-index:-1;-webkit-box-shadow:0 0 8px rgba(0,0,0,0.6);box-shadow:0 0 8px rgba(0,0,0,0.6);background:#444}.mfp-figure small{color:#BDBDBD;display:block;font-size:12px;line-height:14px}.mfp-figure figure{margin:0}.mfp-bottom-bar{margin-top:-36px;position:absolute;top:100%;left:0;width:100%;cursor:auto}.mfp-title{text-align:left;line-height:18px;color:#F3F3F3;word-wrap:break-word;padding-right:36px}.mfp-image-holder .mfp-content{max-width:100%}.mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{top:0;bottom:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:rgba(0,0,0,0.6);bottom:0;margin:0;top:auto;padding:3px 5px;position:fixed;-webkit-box-sizing:border-box;box-sizing:border-box}.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .mfp-close{top:0;right:0;width:35px;height:35px;line-height:35px;background:rgba(0,0,0,0.6);position:fixed;text-align:center;padding:0}}@media all and (max-width: 900px){.mfp-arrow{-webkit-transform:scale(0.75);-ms-transform:scale(0.75);transform:scale(0.75)}.mfp-arrow-left{-webkit-transform-origin:0;-ms-transform-origin:0;transform-origin:0}.mfp-arrow-right{-webkit-transform-origin:100%;-ms-transform-origin:100%;transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}.mfp-with-zoom .mfp-container,.mfp-with-zoom.mfp-bg{opacity:0;-webkit-backface-visibility:hidden;-webkit-transition:all 0.3s ease-out;-o-transition:all 0.3s ease-out;transition:all 0.3s ease-out}.mfp-with-zoom.mfp-ready .mfp-container{opacity:1}.mfp-with-zoom.mfp-ready.mfp-bg{opacity:0.8}.mfp-with-zoom.mfp-removing .mfp-container,.mfp-with-zoom.mfp-removing.mfp-bg{opacity:0}.mfp-content .product{background-color:#ffffff;display:table;margin:0 auto;padding:15px}.mfp-content .product .images{display:inline-block;float:left;max-width:600px}.mfp-content .product .images img{display:block}.mfp-content .product .onsale{left:24px;top:24px;position:absolute}.mfp-content .product .summary{display:inline-block;margin-left:15px;width:300px}.mfp-content .product .product_title,.mfp-content .product .description{margin:1em 0}.mfp-content .product .price{display:inline-block;font-weight:normal;margin:.5em 1em;font-size:.857em;float:left}.mfp-content .product .price del{color:inherit;background-color:transparent;opacity:0.5;display:inline-block}.mfp-content .product .price ins{color:inherit;background-color:transparent;font-weight:bold}.mfp-content .product .star-rating{display:inline-block;margin:.5em 1em;float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:'star'}.mfp-content .product .star-rating:before{content:"\73\73\73\73\73";float:left;top:0;left:0;position:absolute}.mfp-content .product .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.mfp-content .product .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.mfp-content .product a.add_to_cart_button,.mfp-content .product a.added_to_cart{margin:0;line-height:1;cursor:pointer;position:relative;text-decoration:none;overflow:visible;padding:.5em 1em;font-weight:normal;border-radius:3px;left:auto;border:0;white-space:nowrap;display:inline-block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.mfp-content .product a.add_to_cart_button:hover,.mfp-content .product a.added_to_cart:hover{text-decoration:none;background-image:none}.mfp-content .product a.add_to_cart_button.loading{opacity:0.25;padding-right:2.618em}.mfp-content .product a.add_to_cart_button.loading:after{font-family:"WooCommerce";content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:normal;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.mfp-content .product a.add_to_cart_button.added:after{font-family:'WooCommerce';content:"\e017";margin-left:.53em;vertical-align:bottom}.mfp-inline-holder .mfp-content,.mfp-ajax-holder .mfp-content{max-width:945px;margin-top:40px;margin-bottom:40px}@media (max-width: 600px){.mfp-content .product .images{margin-bottom:30px}.mfp-content .product .summary{display:block;margin:0;width:100%}}@media (min-width: 601px){.mfp-content .product .images{display:inline-block;width:49%}.mfp-content .product .summary{display:inline-block;margin:0 0 0 1%;width:49%}}
|
1 |
+
.carousel-slider{display:none;width:100%;-webkit-tap-highlight-color:transparent;position:relative;z-index:1}.carousel-slider .owl-stage{position:relative;-ms-touch-action:pan-Y}.carousel-slider .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.carousel-slider .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0px, 0px, 0px)}.carousel-slider .owl-item{position:relative;min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.carousel-slider .owl-item img{display:block;width:100%;-webkit-transform-style:preserve-3d}.carousel-slider .owl-nav.disabled,.carousel-slider .owl-dots.disabled{display:none}.carousel-slider .owl-nav .owl-prev,.carousel-slider .owl-nav .owl-next,.carousel-slider .owl-dot{cursor:hand;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.carousel-slider.owl-loaded{display:block}.carousel-slider.owl-loading{opacity:0;display:block}.carousel-slider.owl-hidden{opacity:0}.carousel-slider.owl-refresh .owl-item{visibility:hidden}.carousel-slider.owl-drag .owl-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.carousel-slider.owl-grab{cursor:-webkit-grab;cursor:grab}.carousel-slider.owl-rtl{direction:rtl}.carousel-slider.owl-rtl .owl-item{float:right}.no-js .carousel-slider{display:block}.carousel-slider .animated{-webkit-animation-duration:1000ms;animation-duration:1000ms;-webkit-animation-fill-mode:both;animation-fill-mode:both}.carousel-slider .owl-animated-in{z-index:0}.carousel-slider .owl-animated-out{z-index:1}.carousel-slider .fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{-webkit-transition:height 500ms ease-in-out;-o-transition:height 500ms ease-in-out;transition:height 500ms ease-in-out}.carousel-slider .owl-item img.owl-lazy{background:url("../img/ajax-loader.gif") no-repeat center;min-width:32px;min-height:32px}.carousel-slider .owl-video-wrapper{position:relative;height:100%;background:#000}.carousel-slider .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url("../img/play.svg") no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;-webkit-transition:-webkit-transform 100ms ease;transition:-webkit-transform 100ms ease;-o-transition:transform 100ms ease;transition:transform 100ms ease;transition:transform 100ms ease, -webkit-transform 100ms ease}.carousel-slider .owl-video-play-icon:hover{-webkit-transform:scale(1.3, 1.3);-ms-transform:scale(1.3, 1.3);transform:scale(1.3, 1.3)}.carousel-slider .owl-video-playing .owl-video-tn,.carousel-slider .owl-video-playing .owl-video-play-icon{display:none}.carousel-slider .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;-webkit-transition:opacity 400ms ease;-o-transition:opacity 400ms ease;transition:opacity 400ms ease}.carousel-slider .owl-video-frame{position:relative;z-index:1;height:100%;width:100%}.carousel-slider .owl-nav .owl-prev,.carousel-slider .owl-nav .owl-next{height:48px;width:48px;display:inline-block;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);opacity:0;margin:0;padding:0;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.carousel-slider .owl-nav .owl-prev{left:0}.carousel-slider .owl-nav .owl-next{right:0}.carousel-slider:hover .owl-nav .owl-prev,.carousel-slider:hover .owl-nav .owl-next{opacity:1}.carousel-slider.arrows-visible-always .owl-prev,.carousel-slider.arrows-visible-always .owl-next{opacity:1}.carousel-slider.arrows-outside .owl-nav .owl-prev{left:-48px}.carousel-slider.arrows-outside .owl-nav .owl-next{right:-48px}.carousel-slider .owl-dots{text-align:center;-webkit-tap-highlight-color:transparent;margin-top:10px}.carousel-slider .owl-dots .owl-dot{display:inline-block;zoom:1;*display:inline}.carousel-slider .owl-dots .owl-dot span{width:10px;height:10px;margin:4px 8px;background-color:#9e9e9e;display:block;-webkit-backface-visibility:visible;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease}.carousel-slider .owl-dots .owl-dot.active span,.carousel-slider .owl-dots .owl-dot:hover span{background-color:#4caf50}.carousel-slider.dots-center .owl-dots{text-align:center}.carousel-slider.dots-left .owl-dots{text-align:left}.carousel-slider.dots-left .owl-dots:first-child span{margin-left:0}.carousel-slider.dots-right .owl-dots{text-align:right}.carousel-slider.dots-right .owl-dots:last-child span{margin-right:0}.carousel-slider.dots-visible-hover .owl-dots{opacity:0}.carousel-slider.dots-visible-hover:hover .owl-dots{opacity:1}.carousel-slider.dots-circle .owl-dots .owl-dot span{border-radius:9999px}.carousel-slider__post{border:1px solid #f1f1f1;float:left;height:450px;width:100%;position:relative;display:block;overflow:hidden}.carousel-slider__post-content{bottom:0;position:absolute;top:0;-webkit-transition:all 0.2s ease 0s;-o-transition:all 0.2s ease 0s;transition:all 0.2s ease 0s;width:100%;display:block}.carousel-slider__post-image{border-bottom:1px solid #f1f1f1;display:block;height:207px;line-height:0;margin:0 auto;overflow:hidden;text-align:center;width:100%;background-color:#f1f1f1;background-size:cover;background-position:center center}.carousel-slider__post-title{display:block;margin:10px 15px 0;max-height:70px}.carousel-slider__post-title h1{color:#4a4a4a;font:bold 18px/1.4em Arial,sans-serif;margin-bottom:0;margin-top:0}.carousel-slider__post-excerpt{color:#7d7d7d;font-size:14px;line-height:1.5em;padding:10px 15px 5px;text-align:left;width:100%;position:absolute;top:285px}.carousel-slider__post-excerpt-overlay{background:transparent none repeat scroll 0 0;display:block;height:20px;width:100%}.carousel-slider__post-meta{bottom:10px;color:#8e8e8e;font-size:12px;left:0;padding:0 15px;position:absolute;width:100%;display:block}.carousel-slider__post-publication-meta{background-color:white;display:block;padding-top:15px;width:100%;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.carousel-slider__post-details-info{display:inline-block}.carousel-slider__post-author{display:block;font-style:normal;line-height:1em;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;margin-bottom:5px}.carousel-slider__post-author-link{color:#8e8e8e;display:inline-block;max-width:175px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.carousel-slider__post-category{color:#4cc1be;text-transform:uppercase;position:absolute;right:15px;top:50px;z-index:1}.carousel-slider__product{position:relative;text-align:center;border:1px solid #f1f1f1}.carousel-slider__product .woocommerce-LoopProduct-link{display:block;overflow:hidden;margin:0 0 .5em}.carousel-slider__product .onsale{border:0 none;line-height:1;margin:0;padding:15px 5px;color:#f1f1f1;background-color:#96588a;position:absolute;left:8px;top:8px;border-radius:50%}.carousel-slider__product h3{padding:.5em 1em;text-align:left;margin:0;font-size:1em;color:#333}.carousel-slider__product a{text-decoration:none;-webkit-box-shadow:none;box-shadow:none}.carousel-slider__product a img{width:100%;height:auto;display:block;-webkit-box-shadow:none;box-shadow:none}.carousel-slider__product strong{display:block}.carousel-slider__product .price{color:#333;display:inline-block;font-weight:normal;margin:.5em 1em;font-size:.857em;float:left}.carousel-slider__product .price del{color:inherit;background-color:transparent;opacity:0.5;display:inline-block}.carousel-slider__product .price ins{color:inherit;background-color:transparent;font-weight:bold}.carousel-slider__product .star-rating{color:#96588a;display:inline-block;margin:.5em 1em;float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:'star'}.carousel-slider__product .star-rating:before{content:"\73\73\73\73\73";float:left;top:0;left:0;position:absolute}.carousel-slider__product .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.carousel-slider__product .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.carousel-slider__product a.add_to_cart_button,.carousel-slider__product a.added_to_cart,.carousel-slider__product a.quick_view{color:#f1f1f1;background-color:#96588a;margin:1em;line-height:1;cursor:pointer;position:relative;text-decoration:none;overflow:visible;padding:.5em 1em;font-weight:normal;border-radius:3px;left:auto;border:0;white-space:nowrap;display:block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.carousel-slider__product a.add_to_cart_button:hover,.carousel-slider__product a.added_to_cart:hover,.carousel-slider__product a.quick_view:hover{color:#f1f1f1;background-color:#96588a;text-decoration:none;background-image:none}.carousel-slider__product a.add_to_cart_button.loading{opacity:0.25;padding-right:2.618em}.carousel-slider__product a.add_to_cart_button.loading:after{font-family:"WooCommerce";content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:normal;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.carousel-slider__product a.add_to_cart_button.added:after{font-family:'WooCommerce';content:"\e017";margin-left:.53em;vertical-align:bottom}.carousel-slider-hero__cell__background{background-size:cover;background-position:center;background-repeat:no-repeat;min-width:100%;min-height:100%;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;-o-transition-property:transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transition-duration:10s;-o-transition-duration:10s;transition-duration:10s}.carousel-slider-hero__cell__background.carousel-slider-hero-ken-out{-webkit-transform:scale(1.3);-ms-transform:scale(1.3);transform:scale(1.3)}.carousel-slider .active .carousel-slider-hero__cell__background{-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:20s;animation-duration:20s}.carousel-slider .active .carousel-slider-hero__cell__background.carousel-slider-hero-ken-in{-webkit-transform:scale(1.3);-ms-transform:scale(1.3);transform:scale(1.3);-webkit-animation-name:ken-burns-in;animation-name:ken-burns-in}.carousel-slider .active .carousel-slider-hero__cell__background.carousel-slider-hero-ken-out{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-animation-name:ken-burns-out;animation-name:ken-burns-out}.carousel-slider-hero__cell{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;overflow:hidden;height:400px}.carousel-slider-hero__cell:focus{outline:0}.carousel-slider-hero__cell__inner{background-repeat:no-repeat;background-position:center;position:absolute;top:0;left:0;bottom:0;right:0;padding:50px}.carousel-slider-hero__cell__inner,.carousel-slider-hero__cell__inner:hover{color:white;display:-webkit-box;display:-ms-flexbox;display:flex}.carousel-slider-hero__cell__background_overlay{position:absolute;z-index:0;top:0;bottom:0;left:0;right:0}.carousel-slider-hero__cell__content{position:relative;z-index:1;width:100%;max-width:1140px}.carousel-slider-hero__cell__heading{font-size:40px;font-weight:bold;line-height:1}.carousel-slider-hero__cell__description{font-size:20px;line-height:1.4}.carousel-slider-hero__cell__heading:not(:last-child),.carousel-slider-hero__cell__description:not(:last-child){margin-bottom:30px}.carousel-slider-hero__cell__button__one{margin-right:5px}.carousel-slider-hero__cell__button__two{margin-left:5px}.carousel-slider-hero__cell__button__one,.carousel-slider-hero__cell__button__two{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.carousel-slider-hero__cell__inner.carousel-slider--v-position-top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.carousel-slider-hero__cell__inner.carousel-slider--v-position-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.carousel-slider-hero__cell__inner.carousel-slider--v-position-middle{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.carousel-slider-hero__cell__inner.carousel-slider--h-position-left{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.carousel-slider-hero__cell__inner.carousel-slider--h-position-right{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.carousel-slider-hero__cell__inner.carousel-slider--h-position-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.carousel-slider-hero__cell__inner.carousel-slider--text-left{text-align:left}.carousel-slider-hero__cell__inner.carousel-slider--text-right{text-align:right}.carousel-slider-hero__cell__inner.carousel-slider--text-center{text-align:center}@media (max-width: 767px){.carousel-slider-hero__cell__inner{padding:30px}.carousel-slider-hero__cell__heading{font-size:24px;line-height:1;margin-bottom:15px}.carousel-slider-hero__cell__description{font-size:14px;line-height:1.4;margin-bottom:15px}}.carousel-slider .carousel-slider__item{position:relative}.carousel-slider .carousel-slider__item img{display:block;margin-left:auto;margin-right:auto;max-width:100%;height:auto}.carousel-slider .carousel-slider__caption{position:relative}.carousel-slider .carousel-slider__caption .title{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:#474747;font-size:16px;font-weight:500;margin:10px 0 0;text-align:center}.carousel-slider .carousel-slider__caption .caption{font-size:14px;font-weight:300;margin:10px 0 0;text-align:center}.cs-hero-button{-webkit-appearance:none;-webkit-font-smoothing:inherit;display:inline-block;font-size:1rem;line-height:1;padding:0.75em 1em;border-radius:0;text-decoration:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all 200ms ease-in-out;-o-transition:all 200ms ease-in-out;transition:all 200ms ease-in-out}.cs-hero-button:hover{text-decoration:none}.cs-hero-button--normal{opacity:0.9;filter:alpha(opacity=90)}.cs-hero-button--stroke{background:transparent;border-width:1px;border-style:solid;border-color:transparent}.cs-hero-button--medium{font-size:1.2rem;padding:0.9em 1.2em}.cs-hero-button--large{font-size:1.5rem;padding:0.9em 1.6em}.mfp-bg{top:0;left:0;width:100%;height:100%;z-index:1042;overflow:hidden;position:fixed;background:#0b0b0b;opacity:.8}.mfp-wrap{top:0;left:0;width:100%;height:100%;z-index:1043;position:fixed;outline:none !important;-webkit-backface-visibility:hidden}.mfp-container{text-align:center;position:absolute;width:100%;height:100%;left:0;top:0;padding:0 8px;-webkit-box-sizing:border-box;box-sizing:border-box}.mfp-container:before{content:'';display:inline-block;height:100%;vertical-align:middle}.mfp-align-top .mfp-container:before{display:none}.mfp-content{position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:1045}.mfp-inline-holder .mfp-content,.mfp-ajax-holder .mfp-content{width:100%;cursor:auto}.mfp-ajax-cur{cursor:progress}.mfp-zoom-out-cur,.mfp-zoom-out-cur .mfp-image-holder .mfp-close{cursor:-webkit-zoom-out;cursor:zoom-out}.mfp-zoom{cursor:pointer;cursor:-webkit-zoom-in;cursor:zoom-in}.mfp-auto-cursor .mfp-content{cursor:auto}.mfp-close,.mfp-arrow,.mfp-preloader,.mfp-counter{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none !important}.mfp-preloader{color:#CCC;position:absolute;top:50%;width:auto;text-align:center;margin-top:-0.8em;left:8px;right:8px;z-index:1044}.mfp-preloader a{color:#CCC}.mfp-preloader a:hover{color:#fff}.mfp-s-ready .mfp-preloader{display:none}.mfp-s-error .mfp-content{display:none}button.mfp-close,button.mfp-arrow{overflow:visible;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;display:block;outline:none;padding:0;z-index:1046;-webkit-box-shadow:none;box-shadow:none;-ms-touch-action:manipulation;touch-action:manipulation}button::-moz-focus-inner{padding:0;border:0}.mfp-close{width:44px;height:44px;line-height:44px;position:absolute;right:0;top:0;text-decoration:none;text-align:center;opacity:.65;padding:0 0 18px 10px;color:#fff;font-style:normal;font-size:28px;font-family:Arial, Baskerville, monospace}.mfp-close:hover,.mfp-close:focus{opacity:1}.mfp-close:active{top:1px}.mfp-close-btn-in .mfp-close{color:#333}.mfp-image-holder .mfp-close,.mfp-iframe-holder .mfp-close{color:#fff;right:-6px;text-align:right;padding-right:6px;width:100%}.mfp-counter{position:absolute;top:0;right:0;color:#CCC;font-size:12px;line-height:18px;white-space:nowrap}.mfp-arrow{position:absolute;opacity:.65;margin:0;top:50%;margin-top:-55px;padding:0;width:90px;height:110px;-webkit-tap-highlight-color:transparent}.mfp-arrow:active{margin-top:-54px}.mfp-arrow:hover,.mfp-arrow:focus{opacity:1}.mfp-arrow:before,.mfp-arrow:after{content:'';display:block;width:0;height:0;position:absolute;left:0;top:0;margin-top:35px;margin-left:35px;border:medium inset transparent}.mfp-arrow:after{border-top-width:13px;border-bottom-width:13px;top:8px}.mfp-arrow:before{border-top-width:21px;border-bottom-width:21px;opacity:0.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after{border-right:17px solid #fff;margin-left:31px}.mfp-arrow-left:before{margin-left:25px;border-right:27px solid #3F3F3F}.mfp-arrow-right{right:0}.mfp-arrow-right:after{border-left:17px solid #fff;margin-left:39px}.mfp-arrow-right:before{border-left:27px solid #3F3F3F}.mfp-iframe-holder{padding-top:40px;padding-bottom:40px}.mfp-iframe-holder .mfp-content{line-height:0;width:100%;max-width:900px}.mfp-iframe-holder .mfp-close{top:-40px}.mfp-iframe-scaler{width:100%;height:0;overflow:hidden;padding-top:56.25%}.mfp-iframe-scaler iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;-webkit-box-shadow:0 0 8px rgba(0,0,0,0.6);box-shadow:0 0 8px rgba(0,0,0,0.6);background:#000}img.mfp-img{width:auto;max-width:100%;height:auto;display:block;line-height:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 0 40px;margin:0 auto}.mfp-figure{line-height:0}.mfp-figure:after{content:'';position:absolute;left:0;top:40px;bottom:40px;display:block;right:0;width:auto;height:auto;z-index:-1;-webkit-box-shadow:0 0 8px rgba(0,0,0,0.6);box-shadow:0 0 8px rgba(0,0,0,0.6);background:#444}.mfp-figure small{color:#BDBDBD;display:block;font-size:12px;line-height:14px}.mfp-figure figure{margin:0}.mfp-bottom-bar{margin-top:-36px;position:absolute;top:100%;left:0;width:100%;cursor:auto}.mfp-title{text-align:left;line-height:18px;color:#F3F3F3;word-wrap:break-word;padding-right:36px}.mfp-image-holder .mfp-content{max-width:100%}.mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{top:0;bottom:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:rgba(0,0,0,0.6);bottom:0;margin:0;top:auto;padding:3px 5px;position:fixed;-webkit-box-sizing:border-box;box-sizing:border-box}.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .mfp-close{top:0;right:0;width:35px;height:35px;line-height:35px;background:rgba(0,0,0,0.6);position:fixed;text-align:center;padding:0}}@media all and (max-width: 900px){.mfp-arrow{-webkit-transform:scale(0.75);-ms-transform:scale(0.75);transform:scale(0.75)}.mfp-arrow-left{-webkit-transform-origin:0;-ms-transform-origin:0;transform-origin:0}.mfp-arrow-right{-webkit-transform-origin:100%;-ms-transform-origin:100%;transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}.mfp-with-zoom .mfp-container,.mfp-with-zoom.mfp-bg{opacity:0;-webkit-backface-visibility:hidden;-webkit-transition:all 0.3s ease-out;-o-transition:all 0.3s ease-out;transition:all 0.3s ease-out}.mfp-with-zoom.mfp-ready .mfp-container{opacity:1}.mfp-with-zoom.mfp-ready.mfp-bg{opacity:0.8}.mfp-with-zoom.mfp-removing .mfp-container,.mfp-with-zoom.mfp-removing.mfp-bg{opacity:0}.mfp-content .product{background-color:#ffffff;display:table;margin:0 auto;padding:15px}.mfp-content .product .images{display:inline-block;float:left;max-width:600px}.mfp-content .product .images img{display:block}.mfp-content .product .onsale{left:24px;top:24px;position:absolute}.mfp-content .product .summary{display:inline-block;margin-left:15px;width:300px}.mfp-content .product .product_title,.mfp-content .product .description{margin:1em 0}.mfp-content .product .price{display:inline-block;font-weight:normal;margin:.5em 1em;font-size:.857em;float:left}.mfp-content .product .price del{color:inherit;background-color:transparent;opacity:0.5;display:inline-block}.mfp-content .product .price ins{color:inherit;background-color:transparent;font-weight:bold}.mfp-content .product .star-rating{display:inline-block;margin:.5em 1em;float:right;overflow:hidden;position:relative;height:1em;line-height:1;font-size:1em;width:5.4em;font-family:'star'}.mfp-content .product .star-rating:before{content:"\73\73\73\73\73";float:left;top:0;left:0;position:absolute}.mfp-content .product .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}.mfp-content .product .star-rating span:before{content:"\53\53\53\53\53";top:0;position:absolute;left:0}.mfp-content .product a.add_to_cart_button,.mfp-content .product a.added_to_cart{margin:0;line-height:1;cursor:pointer;position:relative;text-decoration:none;overflow:visible;padding:.5em 1em;font-weight:normal;border-radius:3px;left:auto;border:0;white-space:nowrap;display:inline-block;background-image:none;box-shadow:none;-webkit-box-shadow:none;text-shadow:none}.mfp-content .product a.add_to_cart_button:hover,.mfp-content .product a.added_to_cart:hover{text-decoration:none;background-image:none}.mfp-content .product a.add_to_cart_button.loading{opacity:0.25;padding-right:2.618em}.mfp-content .product a.add_to_cart_button.loading:after{font-family:"WooCommerce";content:"\e01c";vertical-align:top;-webkit-font-smoothing:antialiased;font-weight:normal;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.mfp-content .product a.add_to_cart_button.added:after{font-family:'WooCommerce';content:"\e017";margin-left:.53em;vertical-align:bottom}.mfp-inline-holder .mfp-content,.mfp-ajax-holder .mfp-content{max-width:945px;margin-top:40px;margin-bottom:40px}@media (max-width: 600px){.mfp-content .product .images{margin-bottom:30px}.mfp-content .product .summary{display:block;margin:0;width:100%}}@media (min-width: 601px){.mfp-content .product .images{display:inline-block;width:49%}.mfp-content .product .summary{display:inline-block;margin:0 0 0 1%;width:49%}}
|
assets/js/public/index.php
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Code is Poetry
|
|
|
|
assets/js/public/script.js
CHANGED
@@ -1,69 +1,60 @@
|
|
1 |
(function ($) {
|
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 |
-
description = $(this).find('.description-title');
|
43 |
-
descriptionFontSize = description.data('font-size');
|
44 |
-
descriptionFontSizeNum = parseInt(descriptionFontSize);
|
45 |
-
|
46 |
-
if (descriptionFontSizeNum) {
|
47 |
-
if (windowW <= mobile) {
|
48 |
-
descriptionFontSize = descriptionFontSizeNum / 3;
|
49 |
-
descriptionFontSize = descriptionFontSize < minDescFont ? minDescFont : descriptionFontSize;
|
50 |
-
description.css('font-size', descriptionFontSize + 'px');
|
51 |
-
}
|
52 |
-
if (windowW >= tablet && windowW < desktop) {
|
53 |
-
descriptionFontSize = descriptionFontSizeNum / 2;
|
54 |
-
descriptionFontSize = descriptionFontSize < minDescFont ? minDescFont : descriptionFontSize;
|
55 |
-
description.css('font-size', descriptionFontSize + 'px');
|
56 |
-
}
|
57 |
-
if (windowW >= desktop) {
|
58 |
-
description.css('font-size', descriptionFontSize + 'px');
|
59 |
-
}
|
60 |
-
}
|
61 |
-
});
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
window.addEventListener("load", scaleSliderText);
|
66 |
-
window.addEventListener("resize", scaleSliderText);
|
67 |
-
window.addEventListener("orientationchange", scaleSliderText);
|
68 |
-
|
69 |
-
})(jQuery);
|
1 |
(function ($) {
|
2 |
+
$('body').find('.carousel-slider').each(function () {
|
3 |
+
var _this = $(this);
|
4 |
+
var isVideo = _this.data('slide-type') === 'video-carousel';
|
5 |
+
var videoWidth = isVideo ? _this.data('video-width') : false;
|
6 |
+
var videoHeight = isVideo ? _this.data('video-height') : false;
|
7 |
+
var autoWidth = _this.data('auto-width');
|
8 |
+
var stagePadding = parseInt(_this.data('stage-padding'));
|
9 |
+
autoWidth = isVideo ? isVideo : autoWidth;
|
10 |
+
stagePadding = stagePadding > 0 ? stagePadding : 0;
|
11 |
+
|
12 |
+
if (jQuery().owlCarousel) {
|
13 |
+
_this.owlCarousel({
|
14 |
+
stagePadding: stagePadding,
|
15 |
+
nav: _this.data('nav'),
|
16 |
+
dots: _this.data('dots'),
|
17 |
+
margin: _this.data('margin'),
|
18 |
+
loop: _this.data('loop'),
|
19 |
+
autoplay: _this.data('autoplay'),
|
20 |
+
autoplayTimeout: _this.data('autoplay-timeout'),
|
21 |
+
autoplaySpeed: _this.data('autoplay-speed'),
|
22 |
+
autoplayHoverPause: _this.data('autoplay-hover-pause'),
|
23 |
+
slideBy: _this.data('slide-by'),
|
24 |
+
lazyLoad: _this.data('lazy-load'),
|
25 |
+
video: isVideo,
|
26 |
+
videoWidth: videoWidth,
|
27 |
+
videoHeight: videoHeight,
|
28 |
+
autoWidth: autoWidth,
|
29 |
+
navText: [
|
30 |
+
'<svg class="carousel-slider-nav-icon" viewBox="0 0 20 20"><path d="M14 5l-5 5 5 5-1 2-7-7 7-7z"></path></use></svg>',
|
31 |
+
'<svg class="carousel-slider-nav-icon" viewBox="0 0 20 20"><path d="M6 15l5-5-5-5 1-2 7 7-7 7z"></path></svg>'
|
32 |
+
],
|
33 |
+
responsive: {
|
34 |
+
320: {items: _this.data('colums-mobile')},
|
35 |
+
600: {items: _this.data('colums-small-tablet')},
|
36 |
+
768: {items: _this.data('colums-tablet')},
|
37 |
+
993: {items: _this.data('colums-small-desktop')},
|
38 |
+
1200: {items: _this.data('colums-desktop')},
|
39 |
+
1921: {items: _this.data('colums')}
|
40 |
}
|
41 |
+
});
|
42 |
+
}
|
43 |
+
|
44 |
+
if (jQuery().magnificPopup) {
|
45 |
+
var popupType = _this.data('slide-type') === 'product-carousel' ? 'ajax' : 'image';
|
46 |
+
var popupGallery = _this.data('slide-type') !== 'product-carousel';
|
47 |
+
$(this).find('.magnific-popup').magnificPopup({
|
48 |
+
type: popupType,
|
49 |
+
gallery: {
|
50 |
+
enabled: popupGallery
|
51 |
+
},
|
52 |
+
zoom: {
|
53 |
+
enabled: popupGallery,
|
54 |
+
duration: 300,
|
55 |
+
easing: 'ease-in-out'
|
56 |
}
|
57 |
+
});
|
58 |
+
}
|
59 |
+
});
|
60 |
+
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendors/index.php
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Code is Poetry
|
|
|
|
assets/js/vendors/select2.min.js
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
|
2 |
-
if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b),d=g.$element.find("option").filter(function(){return a(this).val()===c.id});if(!d.length){var e=g.option(c);e.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([e])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null;
|
3 |
-
},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
|
|
|
|
|
|
assets/js/vendors/wp-color-picker-alpha.min.js
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
/**!
|
2 |
-
* wp-color-picker-alpha
|
3 |
-
*
|
4 |
-
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
5 |
-
* Only run in input and is defined data alpha in true
|
6 |
-
*
|
7 |
-
* Version: 2.1.2
|
8 |
-
* https://github.com/kallookoo/wp-color-picker-alpha
|
9 |
-
* Licensed under the GPLv2 license.
|
10 |
-
*/
|
11 |
-
!function(t){var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",r='<div class="wp-picker-holder" />',e='<div class="wp-picker-container" />',i='<input type="button" class="button button-small" />',a=void 0!==wpColorPickerL10n.current;if(a)n='<a tabindex="0" class="wp-color-result" />';else var n='<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',l="<label></label>",s='<span class="screen-reader-text"></span>';Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);return this.error?"":(t.length<6&&(t=("00000"+t).substr(-6)),"#"+t)},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_create:function(){if(t.support.iris){var p=this,c=p.element;if(t.extend(p.options,c.data()),"hue"===p.options.type)return p._createHueOnly();p.close=t.proxy(p.close,p),p.initialValue=c.val(),c.addClass("wp-color-picker"),a?(c.hide().wrap(e),p.wrap=c.parent(),p.toggler=t(n).insertBefore(c).css({backgroundColor:p.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),p.pickerContainer=t(r).insertAfter(c),p.button=t(i).addClass("hidden")):(c.parent("label").length||(c.wrap(l),p.wrappingLabelText=t(s).insertBefore(c).text(wpColorPickerL10n.defaultLabel)),p.wrappingLabel=c.parent(),p.wrappingLabel.wrap(e),p.wrap=p.wrappingLabel.parent(),p.toggler=t(n).insertBefore(p.wrappingLabel).css({backgroundColor:p.initialValue}),p.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),p.pickerContainer=t(r).insertAfter(p.wrappingLabel),p.button=t(i)),p.options.defaultColor?(p.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString),a||p.button.attr("aria-label",wpColorPickerL10n.defaultAriaLabel)):(p.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),a||p.button.attr("aria-label",wpColorPickerL10n.clearAriaLabel)),a?c.wrap('<span class="wp-picker-input-wrap" />').after(p.button):(p.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(p.button),p.inputWrapper=c.closest(".wp-picker-input-wrap")),c.iris({target:p.pickerContainer,hide:p.options.hide,width:p.options.width,mode:p.options.mode,palettes:p.options.palettes,change:function(r,e){p.options.alpha?(p.toggler.css({"background-image":"url("+o+")"}),a?p.toggler.html('<span class="color-alpha" />'):(p.toggler.css({position:"relative"}),0==p.toggler.find("span.color-alpha").length&&p.toggler.append('<span class="color-alpha" />')),p.toggler.find("span.color-alpha").css({width:"30px",height:"24px",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:e.color.toString()})):p.toggler.css({backgroundColor:e.color.toString()}),t.isFunction(p.options.change)&&p.options.change.call(this,r,e)}}),c.val(p.initialValue),p._addListeners(),p.options.hide||p.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),o.toggler.click(function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(r){(""===t(this).val()||o.element.hasClass("iris-error"))&&(o.options.alpha?(a&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r))}),o.button.on("click",function(r){t(this).hasClass("wp-picker-clear")?(o.element.val(""),o.options.alpha?(a&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r)):t(this).hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var o=this,r=o.element,e=t('<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>').appendTo(o.picker.find(".iris-picker-inner")),i={aContainer:e,aSlider:e.find(".iris-slider-offset-alpha")};void 0!==r.data("custom-width")?o.options.customWidth=parseInt(r.data("custom-width"))||0:o.options.customWidth=100,o.options.defaultWidth=r.width(),(o._color._alpha<1||-1!=o._color.toString().indexOf("rgb"))&&r.width(parseInt(o.options.defaultWidth+o.options.customWidth)),t.each(i,function(t,r){o.controls[t]=r}),o.controls.square.css({"margin-right":"0"});var a=o.picker.width()-o.controls.square.width()-20,n=a/6,l=a/2-n;t.each(["aContainer","strip"],function(t,r){o.controls[r].width(l).css({"margin-left":n+"px"})}),o._initControls(),o._change()}},_initControls:function(){if(this._super(),this.options.alpha){var t=this;t.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,r){t._color._alpha=parseFloat(r.value/100),t._change.apply(t,arguments)}})}},_change:function(){this._super();var t=this,r=t.element;if(this.options.alpha){var e=t.controls,i=parseInt(100*t._color._alpha),a=t._color.toRgb(),n=["rgb("+a.r+","+a.g+","+a.b+") 0%","rgba("+a.r+","+a.g+","+a.b+", 0) 100%"],l=t.options.defaultWidth,s=t.options.customWidth,p=t.picker.closest(".wp-picker-container").find(".wp-color-result");e.aContainer.css({background:"linear-gradient(to bottom, "+n.join(", ")+"), url("+o+")"}),p.hasClass("wp-picker-open")&&(e.aSlider.slider("value",i),t._color._alpha<1?(e.strip.attr("style",e.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),r.width(parseInt(l+s))):r.width(l))}(r.data("reset-alpha")||!1)&&t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()})},_addInputListeners:function(t){var o=this,r=function(r){var e=new Color(t.val()),i=t.val();t.removeClass("iris-error"),e.error?""!==i&&t.addClass("iris-error"):e.toString()!==o._color.toString()&&("keyup"===r.type&&i.match(/^[0-9a-fA-F]{3}$/)||o._setOption("color",e.toString()))};t.on("change",r).on("keyup",o._debounce(r,100)),o.options.hide&&t.on("focus",function(){o.show()})}})}(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/lib/jquery-tiptip/jquery.tipTip.js
ADDED
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* TipTip
|
3 |
+
* Copyright 2010 Drew Wilson
|
4 |
+
* www.drewwilson.com
|
5 |
+
* code.drewwilson.com/entry/tiptip-jquery-plugin
|
6 |
+
*
|
7 |
+
* Version 1.3 - Updated: Mar. 23, 2010
|
8 |
+
*
|
9 |
+
* This Plug-In will create a custom tooltip to replace the default
|
10 |
+
* browser tooltip. It is extremely lightweight and very smart in
|
11 |
+
* that it detects the edges of the browser window and will make sure
|
12 |
+
* the tooltip stays within the current window size. As a result the
|
13 |
+
* tooltip will adjust itself to be displayed above, below, to the left
|
14 |
+
* or to the right depending on what is necessary to stay within the
|
15 |
+
* browser window. It is completely customizable as well via CSS.
|
16 |
+
*
|
17 |
+
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
|
18 |
+
* http://www.opensource.org/licenses/mit-license.php
|
19 |
+
* http://www.gnu.org/licenses/gpl.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
(function($){
|
23 |
+
$.fn.tipTip = function(options) {
|
24 |
+
var defaults = {
|
25 |
+
activation: "hover",
|
26 |
+
keepAlive: false,
|
27 |
+
maxWidth: "200px",
|
28 |
+
edgeOffset: 3,
|
29 |
+
defaultPosition: "bottom",
|
30 |
+
delay: 400,
|
31 |
+
fadeIn: 200,
|
32 |
+
fadeOut: 200,
|
33 |
+
attribute: "title",
|
34 |
+
content: false, // HTML or String to fill TipTIp with
|
35 |
+
enter: function(){},
|
36 |
+
exit: function(){}
|
37 |
+
};
|
38 |
+
var opts = $.extend(defaults, options);
|
39 |
+
|
40 |
+
// Setup tip tip elements and render them to the DOM
|
41 |
+
if($("#tiptip_holder").length <= 0){
|
42 |
+
var tiptip_holder = $('<div id="tiptip_holder" style="max-width:'+ opts.maxWidth +';"></div>');
|
43 |
+
var tiptip_content = $('<div id="tiptip_content"></div>');
|
44 |
+
var tiptip_arrow = $('<div id="tiptip_arrow"></div>');
|
45 |
+
$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')));
|
46 |
+
} else {
|
47 |
+
var tiptip_holder = $("#tiptip_holder");
|
48 |
+
var tiptip_content = $("#tiptip_content");
|
49 |
+
var tiptip_arrow = $("#tiptip_arrow");
|
50 |
+
}
|
51 |
+
|
52 |
+
return this.each(function(){
|
53 |
+
var org_elem = $(this);
|
54 |
+
if(opts.content){
|
55 |
+
var org_title = opts.content;
|
56 |
+
} else {
|
57 |
+
var org_title = org_elem.attr(opts.attribute);
|
58 |
+
}
|
59 |
+
if(org_title != ""){
|
60 |
+
if(!opts.content){
|
61 |
+
org_elem.removeAttr(opts.attribute); //remove original Attribute
|
62 |
+
}
|
63 |
+
var timeout = false;
|
64 |
+
|
65 |
+
if(opts.activation == "hover"){
|
66 |
+
org_elem.hover(function(){
|
67 |
+
active_tiptip();
|
68 |
+
}, function(){
|
69 |
+
if(!opts.keepAlive){
|
70 |
+
deactive_tiptip();
|
71 |
+
}
|
72 |
+
});
|
73 |
+
if(opts.keepAlive){
|
74 |
+
tiptip_holder.hover(function(){}, function(){
|
75 |
+
deactive_tiptip();
|
76 |
+
});
|
77 |
+
}
|
78 |
+
} else if(opts.activation == "focus"){
|
79 |
+
org_elem.focus(function(){
|
80 |
+
active_tiptip();
|
81 |
+
}).blur(function(){
|
82 |
+
deactive_tiptip();
|
83 |
+
});
|
84 |
+
} else if(opts.activation == "click"){
|
85 |
+
org_elem.click(function(){
|
86 |
+
active_tiptip();
|
87 |
+
return false;
|
88 |
+
}).hover(function(){},function(){
|
89 |
+
if(!opts.keepAlive){
|
90 |
+
deactive_tiptip();
|
91 |
+
}
|
92 |
+
});
|
93 |
+
if(opts.keepAlive){
|
94 |
+
tiptip_holder.hover(function(){}, function(){
|
95 |
+
deactive_tiptip();
|
96 |
+
});
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
function active_tiptip(){
|
101 |
+
opts.enter.call(this);
|
102 |
+
tiptip_content.html(org_title);
|
103 |
+
tiptip_holder.hide().removeAttr("class").css("margin","0");
|
104 |
+
tiptip_arrow.removeAttr("style");
|
105 |
+
|
106 |
+
var top = parseInt(org_elem.offset()['top']);
|
107 |
+
var left = parseInt(org_elem.offset()['left']);
|
108 |
+
var org_width = parseInt(org_elem.outerWidth());
|
109 |
+
var org_height = parseInt(org_elem.outerHeight());
|
110 |
+
var tip_w = tiptip_holder.outerWidth();
|
111 |
+
var tip_h = tiptip_holder.outerHeight();
|
112 |
+
var w_compare = Math.round((org_width - tip_w) / 2);
|
113 |
+
var h_compare = Math.round((org_height - tip_h) / 2);
|
114 |
+
var marg_left = Math.round(left + w_compare);
|
115 |
+
var marg_top = Math.round(top + org_height + opts.edgeOffset);
|
116 |
+
var t_class = "";
|
117 |
+
var arrow_top = "";
|
118 |
+
var arrow_left = Math.round(tip_w - 12) / 2;
|
119 |
+
|
120 |
+
if(opts.defaultPosition == "bottom"){
|
121 |
+
t_class = "_bottom";
|
122 |
+
} else if(opts.defaultPosition == "top"){
|
123 |
+
t_class = "_top";
|
124 |
+
} else if(opts.defaultPosition == "left"){
|
125 |
+
t_class = "_left";
|
126 |
+
} else if(opts.defaultPosition == "right"){
|
127 |
+
t_class = "_right";
|
128 |
+
}
|
129 |
+
|
130 |
+
var right_compare = (w_compare + left) < parseInt($(window).scrollLeft());
|
131 |
+
var left_compare = (tip_w + left) > parseInt($(window).width());
|
132 |
+
|
133 |
+
if((right_compare && w_compare < 0) || (t_class == "_right" && !left_compare) || (t_class == "_left" && left < (tip_w + opts.edgeOffset + 5))){
|
134 |
+
t_class = "_right";
|
135 |
+
arrow_top = Math.round(tip_h - 13) / 2;
|
136 |
+
arrow_left = -12;
|
137 |
+
marg_left = Math.round(left + org_width + opts.edgeOffset);
|
138 |
+
marg_top = Math.round(top + h_compare);
|
139 |
+
} else if((left_compare && w_compare < 0) || (t_class == "_left" && !right_compare)){
|
140 |
+
t_class = "_left";
|
141 |
+
arrow_top = Math.round(tip_h - 13) / 2;
|
142 |
+
arrow_left = Math.round(tip_w);
|
143 |
+
marg_left = Math.round(left - (tip_w + opts.edgeOffset + 5));
|
144 |
+
marg_top = Math.round(top + h_compare);
|
145 |
+
}
|
146 |
+
|
147 |
+
var top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop());
|
148 |
+
var bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0;
|
149 |
+
|
150 |
+
if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){
|
151 |
+
if(t_class == "_top" || t_class == "_bottom"){
|
152 |
+
t_class = "_top";
|
153 |
+
} else {
|
154 |
+
t_class = t_class+"_top";
|
155 |
+
}
|
156 |
+
arrow_top = tip_h;
|
157 |
+
marg_top = Math.round(top - (tip_h + 5 + opts.edgeOffset));
|
158 |
+
} else if(bottom_compare | (t_class == "_top" && bottom_compare) || (t_class == "_bottom" && !top_compare)){
|
159 |
+
if(t_class == "_top" || t_class == "_bottom"){
|
160 |
+
t_class = "_bottom";
|
161 |
+
} else {
|
162 |
+
t_class = t_class+"_bottom";
|
163 |
+
}
|
164 |
+
arrow_top = -12;
|
165 |
+
marg_top = Math.round(top + org_height + opts.edgeOffset);
|
166 |
+
}
|
167 |
+
|
168 |
+
if(t_class == "_right_top" || t_class == "_left_top"){
|
169 |
+
marg_top = marg_top + 5;
|
170 |
+
} else if(t_class == "_right_bottom" || t_class == "_left_bottom"){
|
171 |
+
marg_top = marg_top - 5;
|
172 |
+
}
|
173 |
+
if(t_class == "_left_top" || t_class == "_left_bottom"){
|
174 |
+
marg_left = marg_left + 5;
|
175 |
+
}
|
176 |
+
tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": arrow_top+"px"});
|
177 |
+
tiptip_holder.css({"margin-left": marg_left+"px", "margin-top": marg_top+"px"}).attr("class","tip"+t_class);
|
178 |
+
|
179 |
+
if (timeout){ clearTimeout(timeout); }
|
180 |
+
timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay);
|
181 |
+
}
|
182 |
+
|
183 |
+
function deactive_tiptip(){
|
184 |
+
opts.exit.call(this);
|
185 |
+
if (timeout){ clearTimeout(timeout); }
|
186 |
+
tiptip_holder.fadeOut(opts.fadeOut);
|
187 |
+
}
|
188 |
+
}
|
189 |
+
});
|
190 |
+
}
|
191 |
+
})(jQuery);
|
assets/{js/vendors → lib/jquery-tiptip}/jquery.tipTip.min.js
RENAMED
File without changes
|
assets/lib/magnific-popup/jquery.magnific-popup.js
ADDED
@@ -0,0 +1,1860 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2 |
+
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
+
* Copyright (c) 2016 Dmitry Semenov; */
|
4 |
+
;(function (factory) {
|
5 |
+
if (typeof define === 'function' && define.amd) {
|
6 |
+
// AMD. Register as an anonymous module.
|
7 |
+
define(['jquery'], factory);
|
8 |
+
} else if (typeof exports === 'object') {
|
9 |
+
// Node/CommonJS
|
10 |
+
factory(require('jquery'));
|
11 |
+
} else {
|
12 |
+
// Browser globals
|
13 |
+
factory(window.jQuery || window.Zepto);
|
14 |
+
}
|
15 |
+
}(function($) {
|
16 |
+
|
17 |
+
/*>>core*/
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
* Magnific Popup Core JS file
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Private static constants
|
27 |
+
*/
|
28 |
+
var CLOSE_EVENT = 'Close',
|
29 |
+
BEFORE_CLOSE_EVENT = 'BeforeClose',
|
30 |
+
AFTER_CLOSE_EVENT = 'AfterClose',
|
31 |
+
BEFORE_APPEND_EVENT = 'BeforeAppend',
|
32 |
+
MARKUP_PARSE_EVENT = 'MarkupParse',
|
33 |
+
OPEN_EVENT = 'Open',
|
34 |
+
CHANGE_EVENT = 'Change',
|
35 |
+
NS = 'mfp',
|
36 |
+
EVENT_NS = '.' + NS,
|
37 |
+
READY_CLASS = 'mfp-ready',
|
38 |
+
REMOVING_CLASS = 'mfp-removing',
|
39 |
+
PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
|
40 |
+
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Private vars
|
44 |
+
*/
|
45 |
+
/*jshint -W079 */
|
46 |
+
var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
|
47 |
+
MagnificPopup = function(){},
|
48 |
+
_isJQ = !!(window.jQuery),
|
49 |
+
_prevStatus,
|
50 |
+
_window = $(window),
|
51 |
+
_document,
|
52 |
+
_prevContentType,
|
53 |
+
_wrapClasses,
|
54 |
+
_currPopupType;
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Private functions
|
59 |
+
*/
|
60 |
+
var _mfpOn = function(name, f) {
|
61 |
+
mfp.ev.on(NS + name + EVENT_NS, f);
|
62 |
+
},
|
63 |
+
_getEl = function(className, appendTo, html, raw) {
|
64 |
+
var el = document.createElement('div');
|
65 |
+
el.className = 'mfp-'+className;
|
66 |
+
if(html) {
|
67 |
+
el.innerHTML = html;
|
68 |
+
}
|
69 |
+
if(!raw) {
|
70 |
+
el = $(el);
|
71 |
+
if(appendTo) {
|
72 |
+
el.appendTo(appendTo);
|
73 |
+
}
|
74 |
+
} else if(appendTo) {
|
75 |
+
appendTo.appendChild(el);
|
76 |
+
}
|
77 |
+
return el;
|
78 |
+
},
|
79 |
+
_mfpTrigger = function(e, data) {
|
80 |
+
mfp.ev.triggerHandler(NS + e, data);
|
81 |
+
|
82 |
+
if(mfp.st.callbacks) {
|
83 |
+
// converts "mfpEventName" to "eventName" callback and triggers it if it's present
|
84 |
+
e = e.charAt(0).toLowerCase() + e.slice(1);
|
85 |
+
if(mfp.st.callbacks[e]) {
|
86 |
+
mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
|
87 |
+
}
|
88 |
+
}
|
89 |
+
},
|
90 |
+
_getCloseBtn = function(type) {
|
91 |
+
if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
|
92 |
+
mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
|
93 |
+
_currPopupType = type;
|
94 |
+
}
|
95 |
+
return mfp.currTemplate.closeBtn;
|
96 |
+
},
|
97 |
+
// Initialize Magnific Popup only when called at least once
|
98 |
+
_checkInstance = function() {
|
99 |
+
if(!$.magnificPopup.instance) {
|
100 |
+
/*jshint -W020 */
|
101 |
+
mfp = new MagnificPopup();
|
102 |
+
mfp.init();
|
103 |
+
$.magnificPopup.instance = mfp;
|
104 |
+
}
|
105 |
+
},
|
106 |
+
// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
|
107 |
+
supportsTransitions = function() {
|
108 |
+
var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
|
109 |
+
v = ['ms','O','Moz','Webkit']; // 'v' for vendor
|
110 |
+
|
111 |
+
if( s['transition'] !== undefined ) {
|
112 |
+
return true;
|
113 |
+
}
|
114 |
+
|
115 |
+
while( v.length ) {
|
116 |
+
if( v.pop() + 'Transition' in s ) {
|
117 |
+
return true;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
return false;
|
122 |
+
};
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Public functions
|
128 |
+
*/
|
129 |
+
MagnificPopup.prototype = {
|
130 |
+
|
131 |
+
constructor: MagnificPopup,
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Initializes Magnific Popup plugin.
|
135 |
+
* This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
|
136 |
+
*/
|
137 |
+
init: function() {
|
138 |
+
var appVersion = navigator.appVersion;
|
139 |
+
mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
|
140 |
+
mfp.isAndroid = (/android/gi).test(appVersion);
|
141 |
+
mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
|
142 |
+
mfp.supportsTransition = supportsTransitions();
|
143 |
+
|
144 |
+
// We disable fixed positioned lightbox on devices that don't handle it nicely.
|
145 |
+
// If you know a better way of detecting this - let me know.
|
146 |
+
mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
|
147 |
+
_document = $(document);
|
148 |
+
|
149 |
+
mfp.popupsCache = {};
|
150 |
+
},
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Opens popup
|
154 |
+
* @param data [description]
|
155 |
+
*/
|
156 |
+
open: function(data) {
|
157 |
+
|
158 |
+
var i;
|
159 |
+
|
160 |
+
if(data.isObj === false) {
|
161 |
+
// convert jQuery collection to array to avoid conflicts later
|
162 |
+
mfp.items = data.items.toArray();
|
163 |
+
|
164 |
+
mfp.index = 0;
|
165 |
+
var items = data.items,
|
166 |
+
item;
|
167 |
+
for(i = 0; i < items.length; i++) {
|
168 |
+
item = items[i];
|
169 |
+
if(item.parsed) {
|
170 |
+
item = item.el[0];
|
171 |
+
}
|
172 |
+
if(item === data.el[0]) {
|
173 |
+
mfp.index = i;
|
174 |
+
break;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
} else {
|
178 |
+
mfp.items = $.isArray(data.items) ? data.items : [data.items];
|
179 |
+
mfp.index = data.index || 0;
|
180 |
+
}
|
181 |
+
|
182 |
+
// if popup is already opened - we just update the content
|
183 |
+
if(mfp.isOpen) {
|
184 |
+
mfp.updateItemHTML();
|
185 |
+
return;
|
186 |
+
}
|
187 |
+
|
188 |
+
mfp.types = [];
|
189 |
+
_wrapClasses = '';
|
190 |
+
if(data.mainEl && data.mainEl.length) {
|
191 |
+
mfp.ev = data.mainEl.eq(0);
|
192 |
+
} else {
|
193 |
+
mfp.ev = _document;
|
194 |
+
}
|
195 |
+
|
196 |
+
if(data.key) {
|
197 |
+
if(!mfp.popupsCache[data.key]) {
|
198 |
+
mfp.popupsCache[data.key] = {};
|
199 |
+
}
|
200 |
+
mfp.currTemplate = mfp.popupsCache[data.key];
|
201 |
+
} else {
|
202 |
+
mfp.currTemplate = {};
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
|
208 |
+
mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
|
209 |
+
|
210 |
+
if(mfp.st.modal) {
|
211 |
+
mfp.st.closeOnContentClick = false;
|
212 |
+
mfp.st.closeOnBgClick = false;
|
213 |
+
mfp.st.showCloseBtn = false;
|
214 |
+
mfp.st.enableEscapeKey = false;
|
215 |
+
}
|
216 |
+
|
217 |
+
|
218 |
+
// Building markup
|
219 |
+
// main containers are created only once
|
220 |
+
if(!mfp.bgOverlay) {
|
221 |
+
|
222 |
+
// Dark overlay
|
223 |
+
mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
|
224 |
+
mfp.close();
|
225 |
+
});
|
226 |
+
|
227 |
+
mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
|
228 |
+
if(mfp._checkIfClose(e.target)) {
|
229 |
+
mfp.close();
|
230 |
+
}
|
231 |
+
});
|
232 |
+
|
233 |
+
mfp.container = _getEl('container', mfp.wrap);
|
234 |
+
}
|
235 |
+
|
236 |
+
mfp.contentContainer = _getEl('content');
|
237 |
+
if(mfp.st.preloader) {
|
238 |
+
mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
|
239 |
+
}
|
240 |
+
|
241 |
+
|
242 |
+
// Initializing modules
|
243 |
+
var modules = $.magnificPopup.modules;
|
244 |
+
for(i = 0; i < modules.length; i++) {
|
245 |
+
var n = modules[i];
|
246 |
+
n = n.charAt(0).toUpperCase() + n.slice(1);
|
247 |
+
mfp['init'+n].call(mfp);
|
248 |
+
}
|
249 |
+
_mfpTrigger('BeforeOpen');
|
250 |
+
|
251 |
+
|
252 |
+
if(mfp.st.showCloseBtn) {
|
253 |
+
// Close button
|
254 |
+
if(!mfp.st.closeBtnInside) {
|
255 |
+
mfp.wrap.append( _getCloseBtn() );
|
256 |
+
} else {
|
257 |
+
_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
|
258 |
+
values.close_replaceWith = _getCloseBtn(item.type);
|
259 |
+
});
|
260 |
+
_wrapClasses += ' mfp-close-btn-in';
|
261 |
+
}
|
262 |
+
}
|
263 |
+
|
264 |
+
if(mfp.st.alignTop) {
|
265 |
+
_wrapClasses += ' mfp-align-top';
|
266 |
+
}
|
267 |
+
|
268 |
+
|
269 |
+
|
270 |
+
if(mfp.fixedContentPos) {
|
271 |
+
mfp.wrap.css({
|
272 |
+
overflow: mfp.st.overflowY,
|
273 |
+
overflowX: 'hidden',
|
274 |
+
overflowY: mfp.st.overflowY
|
275 |
+
});
|
276 |
+
} else {
|
277 |
+
mfp.wrap.css({
|
278 |
+
top: _window.scrollTop(),
|
279 |
+
position: 'absolute'
|
280 |
+
});
|
281 |
+
}
|
282 |
+
if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
|
283 |
+
mfp.bgOverlay.css({
|
284 |
+
height: _document.height(),
|
285 |
+
position: 'absolute'
|
286 |
+
});
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
|
291 |
+
if(mfp.st.enableEscapeKey) {
|
292 |
+
// Close on ESC key
|
293 |
+
_document.on('keyup' + EVENT_NS, function(e) {
|
294 |
+
if(e.keyCode === 27) {
|
295 |
+
mfp.close();
|
296 |
+
}
|
297 |
+
});
|
298 |
+
}
|
299 |
+
|
300 |
+
_window.on('resize' + EVENT_NS, function() {
|
301 |
+
mfp.updateSize();
|
302 |
+
});
|
303 |
+
|
304 |
+
|
305 |
+
if(!mfp.st.closeOnContentClick) {
|
306 |
+
_wrapClasses += ' mfp-auto-cursor';
|
307 |
+
}
|
308 |
+
|
309 |
+
if(_wrapClasses)
|
310 |
+
mfp.wrap.addClass(_wrapClasses);
|
311 |
+
|
312 |
+
|
313 |
+
// this triggers recalculation of layout, so we get it once to not to trigger twice
|
314 |
+
var windowHeight = mfp.wH = _window.height();
|
315 |
+
|
316 |
+
|
317 |
+
var windowStyles = {};
|
318 |
+
|
319 |
+
if( mfp.fixedContentPos ) {
|
320 |
+
if(mfp._hasScrollBar(windowHeight)){
|
321 |
+
var s = mfp._getScrollbarSize();
|
322 |
+
if(s) {
|
323 |
+
windowStyles.marginRight = s;
|
324 |
+
}
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
if(mfp.fixedContentPos) {
|
329 |
+
if(!mfp.isIE7) {
|
330 |
+
windowStyles.overflow = 'hidden';
|
331 |
+
} else {
|
332 |
+
// ie7 double-scroll bug
|
333 |
+
$('body, html').css('overflow', 'hidden');
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
|
338 |
+
|
339 |
+
var classesToadd = mfp.st.mainClass;
|
340 |
+
if(mfp.isIE7) {
|
341 |
+
classesToadd += ' mfp-ie7';
|
342 |
+
}
|
343 |
+
if(classesToadd) {
|
344 |
+
mfp._addClassToMFP( classesToadd );
|
345 |
+
}
|
346 |
+
|
347 |
+
// add content
|
348 |
+
mfp.updateItemHTML();
|
349 |
+
|
350 |
+
_mfpTrigger('BuildControls');
|
351 |
+
|
352 |
+
// remove scrollbar, add margin e.t.c
|
353 |
+
$('html').css(windowStyles);
|
354 |
+
|
355 |
+
// add everything to DOM
|
356 |
+
mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
|
357 |
+
|
358 |
+
// Save last focused element
|
359 |
+
mfp._lastFocusedEl = document.activeElement;
|
360 |
+
|
361 |
+
// Wait for next cycle to allow CSS transition
|
362 |
+
setTimeout(function() {
|
363 |
+
|
364 |
+
if(mfp.content) {
|
365 |
+
mfp._addClassToMFP(READY_CLASS);
|
366 |
+
mfp._setFocus();
|
367 |
+
} else {
|
368 |
+
// if content is not defined (not loaded e.t.c) we add class only for BG
|
369 |
+
mfp.bgOverlay.addClass(READY_CLASS);
|
370 |
+
}
|
371 |
+
|
372 |
+
// Trap the focus in popup
|
373 |
+
_document.on('focusin' + EVENT_NS, mfp._onFocusIn);
|
374 |
+
|
375 |
+
}, 16);
|
376 |
+
|
377 |
+
mfp.isOpen = true;
|
378 |
+
mfp.updateSize(windowHeight);
|
379 |
+
_mfpTrigger(OPEN_EVENT);
|
380 |
+
|
381 |
+
return data;
|
382 |
+
},
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Closes the popup
|
386 |
+
*/
|
387 |
+
close: function() {
|
388 |
+
if(!mfp.isOpen) return;
|
389 |
+
_mfpTrigger(BEFORE_CLOSE_EVENT);
|
390 |
+
|
391 |
+
mfp.isOpen = false;
|
392 |
+
// for CSS3 animation
|
393 |
+
if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
|
394 |
+
mfp._addClassToMFP(REMOVING_CLASS);
|
395 |
+
setTimeout(function() {
|
396 |
+
mfp._close();
|
397 |
+
}, mfp.st.removalDelay);
|
398 |
+
} else {
|
399 |
+
mfp._close();
|
400 |
+
}
|
401 |
+
},
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Helper for close() function
|
405 |
+
*/
|
406 |
+
_close: function() {
|
407 |
+
_mfpTrigger(CLOSE_EVENT);
|
408 |
+
|
409 |
+
var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
|
410 |
+
|
411 |
+
mfp.bgOverlay.detach();
|
412 |
+
mfp.wrap.detach();
|
413 |
+
mfp.container.empty();
|
414 |
+
|
415 |
+
if(mfp.st.mainClass) {
|
416 |
+
classesToRemove += mfp.st.mainClass + ' ';
|
417 |
+
}
|
418 |
+
|
419 |
+
mfp._removeClassFromMFP(classesToRemove);
|
420 |
+
|
421 |
+
if(mfp.fixedContentPos) {
|
422 |
+
var windowStyles = {marginRight: ''};
|
423 |
+
if(mfp.isIE7) {
|
424 |
+
$('body, html').css('overflow', '');
|
425 |
+
} else {
|
426 |
+
windowStyles.overflow = '';
|
427 |
+
}
|
428 |
+
$('html').css(windowStyles);
|
429 |
+
}
|
430 |
+
|
431 |
+
_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
|
432 |
+
mfp.ev.off(EVENT_NS);
|
433 |
+
|
434 |
+
// clean up DOM elements that aren't removed
|
435 |
+
mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
|
436 |
+
mfp.bgOverlay.attr('class', 'mfp-bg');
|
437 |
+
mfp.container.attr('class', 'mfp-container');
|
438 |
+
|
439 |
+
// remove close button from target element
|
440 |
+
if(mfp.st.showCloseBtn &&
|
441 |
+
(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
|
442 |
+
if(mfp.currTemplate.closeBtn)
|
443 |
+
mfp.currTemplate.closeBtn.detach();
|
444 |
+
}
|
445 |
+
|
446 |
+
|
447 |
+
if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
|
448 |
+
$(mfp._lastFocusedEl).focus(); // put tab focus back
|
449 |
+
}
|
450 |
+
mfp.currItem = null;
|
451 |
+
mfp.content = null;
|
452 |
+
mfp.currTemplate = null;
|
453 |
+
mfp.prevHeight = 0;
|
454 |
+
|
455 |
+
_mfpTrigger(AFTER_CLOSE_EVENT);
|
456 |
+
},
|
457 |
+
|
458 |
+
updateSize: function(winHeight) {
|
459 |
+
|
460 |
+
if(mfp.isIOS) {
|
461 |
+
// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
|
462 |
+
var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
|
463 |
+
var height = window.innerHeight * zoomLevel;
|
464 |
+
mfp.wrap.css('height', height);
|
465 |
+
mfp.wH = height;
|
466 |
+
} else {
|
467 |
+
mfp.wH = winHeight || _window.height();
|
468 |
+
}
|
469 |
+
// Fixes #84: popup incorrectly positioned with position:relative on body
|
470 |
+
if(!mfp.fixedContentPos) {
|
471 |
+
mfp.wrap.css('height', mfp.wH);
|
472 |
+
}
|
473 |
+
|
474 |
+
_mfpTrigger('Resize');
|
475 |
+
|
476 |
+
},
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Set content of popup based on current index
|
480 |
+
*/
|
481 |
+
updateItemHTML: function() {
|
482 |
+
var item = mfp.items[mfp.index];
|
483 |
+
|
484 |
+
// Detach and perform modifications
|
485 |
+
mfp.contentContainer.detach();
|
486 |
+
|
487 |
+
if(mfp.content)
|
488 |
+
mfp.content.detach();
|
489 |
+
|
490 |
+
if(!item.parsed) {
|
491 |
+
item = mfp.parseEl( mfp.index );
|
492 |
+
}
|
493 |
+
|
494 |
+
var type = item.type;
|
495 |
+
|
496 |
+
_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
|
497 |
+
// BeforeChange event works like so:
|
498 |
+
// _mfpOn('BeforeChange', function(e, prevType, newType) { });
|
499 |
+
|
500 |
+
mfp.currItem = item;
|
501 |
+
|
502 |
+
if(!mfp.currTemplate[type]) {
|
503 |
+
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
504 |
+
|
505 |
+
// allows to modify markup
|
506 |
+
_mfpTrigger('FirstMarkupParse', markup);
|
507 |
+
|
508 |
+
if(markup) {
|
509 |
+
mfp.currTemplate[type] = $(markup);
|
510 |
+
} else {
|
511 |
+
// if there is no markup found we just define that template is parsed
|
512 |
+
mfp.currTemplate[type] = true;
|
513 |
+
}
|
514 |
+
}
|
515 |
+
|
516 |
+
if(_prevContentType && _prevContentType !== item.type) {
|
517 |
+
mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
|
518 |
+
}
|
519 |
+
|
520 |
+
var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
|
521 |
+
mfp.appendContent(newContent, type);
|
522 |
+
|
523 |
+
item.preloaded = true;
|
524 |
+
|
525 |
+
_mfpTrigger(CHANGE_EVENT, item);
|
526 |
+
_prevContentType = item.type;
|
527 |
+
|
528 |
+
// Append container back after its content changed
|
529 |
+
mfp.container.prepend(mfp.contentContainer);
|
530 |
+
|
531 |
+
_mfpTrigger('AfterChange');
|
532 |
+
},
|
533 |
+
|
534 |
+
|
535 |
+
/**
|
536 |
+
* Set HTML content of popup
|
537 |
+
*/
|
538 |
+
appendContent: function(newContent, type) {
|
539 |
+
mfp.content = newContent;
|
540 |
+
|
541 |
+
if(newContent) {
|
542 |
+
if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
|
543 |
+
mfp.currTemplate[type] === true) {
|
544 |
+
// if there is no markup, we just append close button element inside
|
545 |
+
if(!mfp.content.find('.mfp-close').length) {
|
546 |
+
mfp.content.append(_getCloseBtn());
|
547 |
+
}
|
548 |
+
} else {
|
549 |
+
mfp.content = newContent;
|
550 |
+
}
|
551 |
+
} else {
|
552 |
+
mfp.content = '';
|
553 |
+
}
|
554 |
+
|
555 |
+
_mfpTrigger(BEFORE_APPEND_EVENT);
|
556 |
+
mfp.container.addClass('mfp-'+type+'-holder');
|
557 |
+
|
558 |
+
mfp.contentContainer.append(mfp.content);
|
559 |
+
},
|
560 |
+
|
561 |
+
|
562 |
+
/**
|
563 |
+
* Creates Magnific Popup data object based on given data
|
564 |
+
* @param {int} index Index of item to parse
|
565 |
+
*/
|
566 |
+
parseEl: function(index) {
|
567 |
+
var item = mfp.items[index],
|
568 |
+
type;
|
569 |
+
|
570 |
+
if(item.tagName) {
|
571 |
+
item = { el: $(item) };
|
572 |
+
} else {
|
573 |
+
type = item.type;
|
574 |
+
item = { data: item, src: item.src };
|
575 |
+
}
|
576 |
+
|
577 |
+
if(item.el) {
|
578 |
+
var types = mfp.types;
|
579 |
+
|
580 |
+
// check for 'mfp-TYPE' class
|
581 |
+
for(var i = 0; i < types.length; i++) {
|
582 |
+
if( item.el.hasClass('mfp-'+types[i]) ) {
|
583 |
+
type = types[i];
|
584 |
+
break;
|
585 |
+
}
|
586 |
+
}
|
587 |
+
|
588 |
+
item.src = item.el.attr('data-mfp-src');
|
589 |
+
if(!item.src) {
|
590 |
+
item.src = item.el.attr('href');
|
591 |
+
}
|
592 |
+
}
|
593 |
+
|
594 |
+
item.type = type || mfp.st.type || 'inline';
|
595 |
+
item.index = index;
|
596 |
+
item.parsed = true;
|
597 |
+
mfp.items[index] = item;
|
598 |
+
_mfpTrigger('ElementParse', item);
|
599 |
+
|
600 |
+
return mfp.items[index];
|
601 |
+
},
|
602 |
+
|
603 |
+
|
604 |
+
/**
|
605 |
+
* Initializes single popup or a group of popups
|
606 |
+
*/
|
607 |
+
addGroup: function(el, options) {
|
608 |
+
var eHandler = function(e) {
|
609 |
+
e.mfpEl = this;
|
610 |
+
mfp._openClick(e, el, options);
|
611 |
+
};
|
612 |
+
|
613 |
+
if(!options) {
|
614 |
+
options = {};
|
615 |
+
}
|
616 |
+
|
617 |
+
var eName = 'click.magnificPopup';
|
618 |
+
options.mainEl = el;
|
619 |
+
|
620 |
+
if(options.items) {
|
621 |
+
options.isObj = true;
|
622 |
+
el.off(eName).on(eName, eHandler);
|
623 |
+
} else {
|
624 |
+
options.isObj = false;
|
625 |
+
if(options.delegate) {
|
626 |
+
el.off(eName).on(eName, options.delegate , eHandler);
|
627 |
+
} else {
|
628 |
+
options.items = el;
|
629 |
+
el.off(eName).on(eName, eHandler);
|
630 |
+
}
|
631 |
+
}
|
632 |
+
},
|
633 |
+
_openClick: function(e, el, options) {
|
634 |
+
var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
|
635 |
+
|
636 |
+
|
637 |
+
if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
|
638 |
+
return;
|
639 |
+
}
|
640 |
+
|
641 |
+
var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
|
642 |
+
|
643 |
+
if(disableOn) {
|
644 |
+
if($.isFunction(disableOn)) {
|
645 |
+
if( !disableOn.call(mfp) ) {
|
646 |
+
return true;
|
647 |
+
}
|
648 |
+
} else { // else it's number
|
649 |
+
if( _window.width() < disableOn ) {
|
650 |
+
return true;
|
651 |
+
}
|
652 |
+
}
|
653 |
+
}
|
654 |
+
|
655 |
+
if(e.type) {
|
656 |
+
e.preventDefault();
|
657 |
+
|
658 |
+
// This will prevent popup from closing if element is inside and popup is already opened
|
659 |
+
if(mfp.isOpen) {
|
660 |
+
e.stopPropagation();
|
661 |
+
}
|
662 |
+
}
|
663 |
+
|
664 |
+
options.el = $(e.mfpEl);
|
665 |
+
if(options.delegate) {
|
666 |
+
options.items = el.find(options.delegate);
|
667 |
+
}
|
668 |
+
mfp.open(options);
|
669 |
+
},
|
670 |
+
|
671 |
+
|
672 |
+
/**
|
673 |
+
* Updates text on preloader
|
674 |
+
*/
|
675 |
+
updateStatus: function(status, text) {
|
676 |
+
|
677 |
+
if(mfp.preloader) {
|
678 |
+
if(_prevStatus !== status) {
|
679 |
+
mfp.container.removeClass('mfp-s-'+_prevStatus);
|
680 |
+
}
|
681 |
+
|
682 |
+
if(!text && status === 'loading') {
|
683 |
+
text = mfp.st.tLoading;
|
684 |
+
}
|
685 |
+
|
686 |
+
var data = {
|
687 |
+
status: status,
|
688 |
+
text: text
|
689 |
+
};
|
690 |
+
// allows to modify status
|
691 |
+
_mfpTrigger('UpdateStatus', data);
|
692 |
+
|
693 |
+
status = data.status;
|
694 |
+
text = data.text;
|
695 |
+
|
696 |
+
mfp.preloader.html(text);
|
697 |
+
|
698 |
+
mfp.preloader.find('a').on('click', function(e) {
|
699 |
+
e.stopImmediatePropagation();
|
700 |
+
});
|
701 |
+
|
702 |
+
mfp.container.addClass('mfp-s-'+status);
|
703 |
+
_prevStatus = status;
|
704 |
+
}
|
705 |
+
},
|
706 |
+
|
707 |
+
|
708 |
+
/*
|
709 |
+
"Private" helpers that aren't private at all
|
710 |
+
*/
|
711 |
+
// Check to close popup or not
|
712 |
+
// "target" is an element that was clicked
|
713 |
+
_checkIfClose: function(target) {
|
714 |
+
|
715 |
+
if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
|
716 |
+
return;
|
717 |
+
}
|
718 |
+
|
719 |
+
var closeOnContent = mfp.st.closeOnContentClick;
|
720 |
+
var closeOnBg = mfp.st.closeOnBgClick;
|
721 |
+
|
722 |
+
if(closeOnContent && closeOnBg) {
|
723 |
+
return true;
|
724 |
+
} else {
|
725 |
+
|
726 |
+
// We close the popup if click is on close button or on preloader. Or if there is no content.
|
727 |
+
if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
|
728 |
+
return true;
|
729 |
+
}
|
730 |
+
|
731 |
+
// if click is outside the content
|
732 |
+
if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
|
733 |
+
if(closeOnBg) {
|
734 |
+
// last check, if the clicked element is in DOM, (in case it's removed onclick)
|
735 |
+
if( $.contains(document, target) ) {
|
736 |
+
return true;
|
737 |
+
}
|
738 |
+
}
|
739 |
+
} else if(closeOnContent) {
|
740 |
+
return true;
|
741 |
+
}
|
742 |
+
|
743 |
+
}
|
744 |
+
return false;
|
745 |
+
},
|
746 |
+
_addClassToMFP: function(cName) {
|
747 |
+
mfp.bgOverlay.addClass(cName);
|
748 |
+
mfp.wrap.addClass(cName);
|
749 |
+
},
|
750 |
+
_removeClassFromMFP: function(cName) {
|
751 |
+
this.bgOverlay.removeClass(cName);
|
752 |
+
mfp.wrap.removeClass(cName);
|
753 |
+
},
|
754 |
+
_hasScrollBar: function(winHeight) {
|
755 |
+
return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
|
756 |
+
},
|
757 |
+
_setFocus: function() {
|
758 |
+
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
|
759 |
+
},
|
760 |
+
_onFocusIn: function(e) {
|
761 |
+
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
|
762 |
+
mfp._setFocus();
|
763 |
+
return false;
|
764 |
+
}
|
765 |
+
},
|
766 |
+
_parseMarkup: function(template, values, item) {
|
767 |
+
var arr;
|
768 |
+
if(item.data) {
|
769 |
+
values = $.extend(item.data, values);
|
770 |
+
}
|
771 |
+
_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
|
772 |
+
|
773 |
+
$.each(values, function(key, value) {
|
774 |
+
if(value === undefined || value === false) {
|
775 |
+
return true;
|
776 |
+
}
|
777 |
+
arr = key.split('_');
|
778 |
+
if(arr.length > 1) {
|
779 |
+
var el = template.find(EVENT_NS + '-'+arr[0]);
|
780 |
+
|
781 |
+
if(el.length > 0) {
|
782 |
+
var attr = arr[1];
|
783 |
+
if(attr === 'replaceWith') {
|
784 |
+
if(el[0] !== value[0]) {
|
785 |
+
el.replaceWith(value);
|
786 |
+
}
|
787 |
+
} else if(attr === 'img') {
|
788 |
+
if(el.is('img')) {
|
789 |
+
el.attr('src', value);
|
790 |
+
} else {
|
791 |
+
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
|
792 |
+
}
|
793 |
+
} else {
|
794 |
+
el.attr(arr[1], value);
|
795 |
+
}
|
796 |
+
}
|
797 |
+
|
798 |
+
} else {
|
799 |
+
template.find(EVENT_NS + '-'+key).html(value);
|
800 |
+
}
|
801 |
+
});
|
802 |
+
},
|
803 |
+
|
804 |
+
_getScrollbarSize: function() {
|
805 |
+
// thx David
|
806 |
+
if(mfp.scrollbarSize === undefined) {
|
807 |
+
var scrollDiv = document.createElement("div");
|
808 |
+
scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
|
809 |
+
document.body.appendChild(scrollDiv);
|
810 |
+
mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
811 |
+
document.body.removeChild(scrollDiv);
|
812 |
+
}
|
813 |
+
return mfp.scrollbarSize;
|
814 |
+
}
|
815 |
+
|
816 |
+
}; /* MagnificPopup core prototype end */
|
817 |
+
|
818 |
+
|
819 |
+
|
820 |
+
|
821 |
+
/**
|
822 |
+
* Public static functions
|
823 |
+
*/
|
824 |
+
$.magnificPopup = {
|
825 |
+
instance: null,
|
826 |
+
proto: MagnificPopup.prototype,
|
827 |
+
modules: [],
|
828 |
+
|
829 |
+
open: function(options, index) {
|
830 |
+
_checkInstance();
|
831 |
+
|
832 |
+
if(!options) {
|
833 |
+
options = {};
|
834 |
+
} else {
|
835 |
+
options = $.extend(true, {}, options);
|
836 |
+
}
|
837 |
+
|
838 |
+
options.isObj = true;
|
839 |
+
options.index = index || 0;
|
840 |
+
return this.instance.open(options);
|
841 |
+
},
|
842 |
+
|
843 |
+
close: function() {
|
844 |
+
return $.magnificPopup.instance && $.magnificPopup.instance.close();
|
845 |
+
},
|
846 |
+
|
847 |
+
registerModule: function(name, module) {
|
848 |
+
if(module.options) {
|
849 |
+
$.magnificPopup.defaults[name] = module.options;
|
850 |
+
}
|
851 |
+
$.extend(this.proto, module.proto);
|
852 |
+
this.modules.push(name);
|
853 |
+
},
|
854 |
+
|
855 |
+
defaults: {
|
856 |
+
|
857 |
+
// Info about options is in docs:
|
858 |
+
// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
|
859 |
+
|
860 |
+
disableOn: 0,
|
861 |
+
|
862 |
+
key: null,
|
863 |
+
|
864 |
+
midClick: false,
|
865 |
+
|
866 |
+
mainClass: '',
|
867 |
+
|
868 |
+
preloader: true,
|
869 |
+
|
870 |
+
focus: '', // CSS selector of input to focus after popup is opened
|
871 |
+
|
872 |
+
closeOnContentClick: false,
|
873 |
+
|
874 |
+
closeOnBgClick: true,
|
875 |
+
|
876 |
+
closeBtnInside: true,
|
877 |
+
|
878 |
+
showCloseBtn: true,
|
879 |
+
|
880 |
+
enableEscapeKey: true,
|
881 |
+
|
882 |
+
modal: false,
|
883 |
+
|
884 |
+
alignTop: false,
|
885 |
+
|
886 |
+
removalDelay: 0,
|
887 |
+
|
888 |
+
prependTo: null,
|
889 |
+
|
890 |
+
fixedContentPos: 'auto',
|
891 |
+
|
892 |
+
fixedBgPos: 'auto',
|
893 |
+
|
894 |
+
overflowY: 'auto',
|
895 |
+
|
896 |
+
closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>',
|
897 |
+
|
898 |
+
tClose: 'Close (Esc)',
|
899 |
+
|
900 |
+
tLoading: 'Loading...',
|
901 |
+
|
902 |
+
autoFocusLast: true
|
903 |
+
|
904 |
+
}
|
905 |
+
};
|
906 |
+
|
907 |
+
|
908 |
+
|
909 |
+
$.fn.magnificPopup = function(options) {
|
910 |
+
_checkInstance();
|
911 |
+
|
912 |
+
var jqEl = $(this);
|
913 |
+
|
914 |
+
// We call some API method of first param is a string
|
915 |
+
if (typeof options === "string" ) {
|
916 |
+
|
917 |
+
if(options === 'open') {
|
918 |
+
var items,
|
919 |
+
itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
|
920 |
+
index = parseInt(arguments[1], 10) || 0;
|
921 |
+
|
922 |
+
if(itemOpts.items) {
|
923 |
+
items = itemOpts.items[index];
|
924 |
+
} else {
|
925 |
+
items = jqEl;
|
926 |
+
if(itemOpts.delegate) {
|
927 |
+
items = items.find(itemOpts.delegate);
|
928 |
+
}
|
929 |
+
items = items.eq( index );
|
930 |
+
}
|
931 |
+
mfp._openClick({mfpEl:items}, jqEl, itemOpts);
|
932 |
+
} else {
|
933 |
+
if(mfp.isOpen)
|
934 |
+
mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
|
935 |
+
}
|
936 |
+
|
937 |
+
} else {
|
938 |
+
// clone options obj
|
939 |
+
options = $.extend(true, {}, options);
|
940 |
+
|
941 |
+
/*
|
942 |
+
* As Zepto doesn't support .data() method for objects
|
943 |
+
* and it works only in normal browsers
|
944 |
+
* we assign "options" object directly to the DOM element. FTW!
|
945 |
+
*/
|
946 |
+
if(_isJQ) {
|
947 |
+
jqEl.data('magnificPopup', options);
|
948 |
+
} else {
|
949 |
+
jqEl[0].magnificPopup = options;
|
950 |
+
}
|
951 |
+
|
952 |
+
mfp.addGroup(jqEl, options);
|
953 |
+
|
954 |
+
}
|
955 |
+
return jqEl;
|
956 |
+
};
|
957 |
+
|
958 |
+
/*>>core*/
|
959 |
+
|
960 |
+
/*>>inline*/
|
961 |
+
|
962 |
+
var INLINE_NS = 'inline',
|
963 |
+
_hiddenClass,
|
964 |
+
_inlinePlaceholder,
|
965 |
+
_lastInlineElement,
|
966 |
+
_putInlineElementsBack = function() {
|
967 |
+
if(_lastInlineElement) {
|
968 |
+
_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
|
969 |
+
_lastInlineElement = null;
|
970 |
+
}
|
971 |
+
};
|
972 |
+
|
973 |
+
$.magnificPopup.registerModule(INLINE_NS, {
|
974 |
+
options: {
|
975 |
+
hiddenClass: 'hide', // will be appended with `mfp-` prefix
|
976 |
+
markup: '',
|
977 |
+
tNotFound: 'Content not found'
|
978 |
+
},
|
979 |
+
proto: {
|
980 |
+
|
981 |
+
initInline: function() {
|
982 |
+
mfp.types.push(INLINE_NS);
|
983 |
+
|
984 |
+
_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
|
985 |
+
_putInlineElementsBack();
|
986 |
+
});
|
987 |
+
},
|
988 |
+
|
989 |
+
getInline: function(item, template) {
|
990 |
+
|
991 |
+
_putInlineElementsBack();
|
992 |
+
|
993 |
+
if(item.src) {
|
994 |
+
var inlineSt = mfp.st.inline,
|
995 |
+
el = $(item.src);
|
996 |
+
|
997 |
+
if(el.length) {
|
998 |
+
|
999 |
+
// If target element has parent - we replace it with placeholder and put it back after popup is closed
|
1000 |
+
var parent = el[0].parentNode;
|
1001 |
+
if(parent && parent.tagName) {
|
1002 |
+
if(!_inlinePlaceholder) {
|
1003 |
+
_hiddenClass = inlineSt.hiddenClass;
|
1004 |
+
_inlinePlaceholder = _getEl(_hiddenClass);
|
1005 |
+
_hiddenClass = 'mfp-'+_hiddenClass;
|
1006 |
+
}
|
1007 |
+
// replace target inline element with placeholder
|
1008 |
+
_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
mfp.updateStatus('ready');
|
1012 |
+
} else {
|
1013 |
+
mfp.updateStatus('error', inlineSt.tNotFound);
|
1014 |
+
el = $('<div>');
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
item.inlineElement = el;
|
1018 |
+
return el;
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
mfp.updateStatus('ready');
|
1022 |
+
mfp._parseMarkup(template, {}, item);
|
1023 |
+
return template;
|
1024 |
+
}
|
1025 |
+
}
|
1026 |
+
});
|
1027 |
+
|
1028 |
+
/*>>inline*/
|
1029 |
+
|
1030 |
+
/*>>ajax*/
|
1031 |
+
var AJAX_NS = 'ajax',
|
1032 |
+
_ajaxCur,
|
1033 |
+
_removeAjaxCursor = function() {
|
1034 |
+
if(_ajaxCur) {
|
1035 |
+
$(document.body).removeClass(_ajaxCur);
|
1036 |
+
}
|
1037 |
+
},
|
1038 |
+
_destroyAjaxRequest = function() {
|
1039 |
+
_removeAjaxCursor();
|
1040 |
+
if(mfp.req) {
|
1041 |
+
mfp.req.abort();
|
1042 |
+
}
|
1043 |
+
};
|
1044 |
+
|
1045 |
+
$.magnificPopup.registerModule(AJAX_NS, {
|
1046 |
+
|
1047 |
+
options: {
|
1048 |
+
settings: null,
|
1049 |
+
cursor: 'mfp-ajax-cur',
|
1050 |
+
tError: '<a href="%url%">The content</a> could not be loaded.'
|
1051 |
+
},
|
1052 |
+
|
1053 |
+
proto: {
|
1054 |
+
initAjax: function() {
|
1055 |
+
mfp.types.push(AJAX_NS);
|
1056 |
+
_ajaxCur = mfp.st.ajax.cursor;
|
1057 |
+
|
1058 |
+
_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
|
1059 |
+
_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
|
1060 |
+
},
|
1061 |
+
getAjax: function(item) {
|
1062 |
+
|
1063 |
+
if(_ajaxCur) {
|
1064 |
+
$(document.body).addClass(_ajaxCur);
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
mfp.updateStatus('loading');
|
1068 |
+
|
1069 |
+
var opts = $.extend({
|
1070 |
+
url: item.src,
|
1071 |
+
success: function(data, textStatus, jqXHR) {
|
1072 |
+
var temp = {
|
1073 |
+
data:data,
|
1074 |
+
xhr:jqXHR
|
1075 |
+
};
|
1076 |
+
|
1077 |
+
_mfpTrigger('ParseAjax', temp);
|
1078 |
+
|
1079 |
+
mfp.appendContent( $(temp.data), AJAX_NS );
|
1080 |
+
|
1081 |
+
item.finished = true;
|
1082 |
+
|
1083 |
+
_removeAjaxCursor();
|
1084 |
+
|
1085 |
+
mfp._setFocus();
|
1086 |
+
|
1087 |
+
setTimeout(function() {
|
1088 |
+
mfp.wrap.addClass(READY_CLASS);
|
1089 |
+
}, 16);
|
1090 |
+
|
1091 |
+
mfp.updateStatus('ready');
|
1092 |
+
|
1093 |
+
_mfpTrigger('AjaxContentAdded');
|
1094 |
+
},
|
1095 |
+
error: function() {
|
1096 |
+
_removeAjaxCursor();
|
1097 |
+
item.finished = item.loadError = true;
|
1098 |
+
mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
|
1099 |
+
}
|
1100 |
+
}, mfp.st.ajax.settings);
|
1101 |
+
|
1102 |
+
mfp.req = $.ajax(opts);
|
1103 |
+
|
1104 |
+
return '';
|
1105 |
+
}
|
1106 |
+
}
|
1107 |
+
});
|
1108 |
+
|
1109 |
+
/*>>ajax*/
|
1110 |
+
|
1111 |
+
/*>>image*/
|
1112 |
+
var _imgInterval,
|
1113 |
+
_getTitle = function(item) {
|
1114 |
+
if(item.data && item.data.title !== undefined)
|
1115 |
+
return item.data.title;
|
1116 |
+
|
1117 |
+
var src = mfp.st.image.titleSrc;
|
1118 |
+
|
1119 |
+
if(src) {
|
1120 |
+
if($.isFunction(src)) {
|
1121 |
+
return src.call(mfp, item);
|
1122 |
+
} else if(item.el) {
|
1123 |
+
return item.el.attr(src) || '';
|
1124 |
+
}
|
1125 |
+
}
|
1126 |
+
return '';
|
1127 |
+
};
|
1128 |
+
|
1129 |
+
$.magnificPopup.registerModule('image', {
|
1130 |
+
|
1131 |
+
options: {
|
1132 |
+
markup: '<div class="mfp-figure">'+
|
1133 |
+
'<div class="mfp-close"></div>'+
|
1134 |
+
'<figure>'+
|
1135 |
+
'<div class="mfp-img"></div>'+
|
1136 |
+
'<figcaption>'+
|
1137 |
+
'<div class="mfp-bottom-bar">'+
|
1138 |
+
'<div class="mfp-title"></div>'+
|
1139 |
+
'<div class="mfp-counter"></div>'+
|
1140 |
+
'</div>'+
|
1141 |
+
'</figcaption>'+
|
1142 |
+
'</figure>'+
|
1143 |
+
'</div>',
|
1144 |
+
cursor: 'mfp-zoom-out-cur',
|
1145 |
+
titleSrc: 'title',
|
1146 |
+
verticalFit: true,
|
1147 |
+
tError: '<a href="%url%">The image</a> could not be loaded.'
|
1148 |
+
},
|
1149 |
+
|
1150 |
+
proto: {
|
1151 |
+
initImage: function() {
|
1152 |
+
var imgSt = mfp.st.image,
|
1153 |
+
ns = '.image';
|
1154 |
+
|
1155 |
+
mfp.types.push('image');
|
1156 |
+
|
1157 |
+
_mfpOn(OPEN_EVENT+ns, function() {
|
1158 |
+
if(mfp.currItem.type === 'image' && imgSt.cursor) {
|
1159 |
+
$(document.body).addClass(imgSt.cursor);
|
1160 |
+
}
|
1161 |
+
});
|
1162 |
+
|
1163 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1164 |
+
if(imgSt.cursor) {
|
1165 |
+
$(document.body).removeClass(imgSt.cursor);
|
1166 |
+
}
|
1167 |
+
_window.off('resize' + EVENT_NS);
|
1168 |
+
});
|
1169 |
+
|
1170 |
+
_mfpOn('Resize'+ns, mfp.resizeImage);
|
1171 |
+
if(mfp.isLowIE) {
|
1172 |
+
_mfpOn('AfterChange', mfp.resizeImage);
|
1173 |
+
}
|
1174 |
+
},
|
1175 |
+
resizeImage: function() {
|
1176 |
+
var item = mfp.currItem;
|
1177 |
+
if(!item || !item.img) return;
|
1178 |
+
|
1179 |
+
if(mfp.st.image.verticalFit) {
|
1180 |
+
var decr = 0;
|
1181 |
+
// fix box-sizing in ie7/8
|
1182 |
+
if(mfp.isLowIE) {
|
1183 |
+
decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
|
1184 |
+
}
|
1185 |
+
item.img.css('max-height', mfp.wH-decr);
|
1186 |
+
}
|
1187 |
+
},
|
1188 |
+
_onImageHasSize: function(item) {
|
1189 |
+
if(item.img) {
|
1190 |
+
|
1191 |
+
item.hasSize = true;
|
1192 |
+
|
1193 |
+
if(_imgInterval) {
|
1194 |
+
clearInterval(_imgInterval);
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
item.isCheckingImgSize = false;
|
1198 |
+
|
1199 |
+
_mfpTrigger('ImageHasSize', item);
|
1200 |
+
|
1201 |
+
if(item.imgHidden) {
|
1202 |
+
if(mfp.content)
|
1203 |
+
mfp.content.removeClass('mfp-loading');
|
1204 |
+
|
1205 |
+
item.imgHidden = false;
|
1206 |
+
}
|
1207 |
+
|
1208 |
+
}
|
1209 |
+
},
|
1210 |
+
|
1211 |
+
/**
|
1212 |
+
* Function that loops until the image has size to display elements that rely on it asap
|
1213 |
+
*/
|
1214 |
+
findImageSize: function(item) {
|
1215 |
+
|
1216 |
+
var counter = 0,
|
1217 |
+
img = item.img[0],
|
1218 |
+
mfpSetInterval = function(delay) {
|
1219 |
+
|
1220 |
+
if(_imgInterval) {
|
1221 |
+
clearInterval(_imgInterval);
|
1222 |
+
}
|
1223 |
+
// decelerating interval that checks for size of an image
|
1224 |
+
_imgInterval = setInterval(function() {
|
1225 |
+
if(img.naturalWidth > 0) {
|
1226 |
+
mfp._onImageHasSize(item);
|
1227 |
+
return;
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
if(counter > 200) {
|
1231 |
+
clearInterval(_imgInterval);
|
1232 |
+
}
|
1233 |
+
|
1234 |
+
counter++;
|
1235 |
+
if(counter === 3) {
|
1236 |
+
mfpSetInterval(10);
|
1237 |
+
} else if(counter === 40) {
|
1238 |
+
mfpSetInterval(50);
|
1239 |
+
} else if(counter === 100) {
|
1240 |
+
mfpSetInterval(500);
|
1241 |
+
}
|
1242 |
+
}, delay);
|
1243 |
+
};
|
1244 |
+
|
1245 |
+
mfpSetInterval(1);
|
1246 |
+
},
|
1247 |
+
|
1248 |
+
getImage: function(item, template) {
|
1249 |
+
|
1250 |
+
var guard = 0,
|
1251 |
+
|
1252 |
+
// image load complete handler
|
1253 |
+
onLoadComplete = function() {
|
1254 |
+
if(item) {
|
1255 |
+
if (item.img[0].complete) {
|
1256 |
+
item.img.off('.mfploader');
|
1257 |
+
|
1258 |
+
if(item === mfp.currItem){
|
1259 |
+
mfp._onImageHasSize(item);
|
1260 |
+
|
1261 |
+
mfp.updateStatus('ready');
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
item.hasSize = true;
|
1265 |
+
item.loaded = true;
|
1266 |
+
|
1267 |
+
_mfpTrigger('ImageLoadComplete');
|
1268 |
+
|
1269 |
+
}
|
1270 |
+
else {
|
1271 |
+
// if image complete check fails 200 times (20 sec), we assume that there was an error.
|
1272 |
+
guard++;
|
1273 |
+
if(guard < 200) {
|
1274 |
+
setTimeout(onLoadComplete,100);
|
1275 |
+
} else {
|
1276 |
+
onLoadError();
|
1277 |
+
}
|
1278 |
+
}
|
1279 |
+
}
|
1280 |
+
},
|
1281 |
+
|
1282 |
+
// image error handler
|
1283 |
+
onLoadError = function() {
|
1284 |
+
if(item) {
|
1285 |
+
item.img.off('.mfploader');
|
1286 |
+
if(item === mfp.currItem){
|
1287 |
+
mfp._onImageHasSize(item);
|
1288 |
+
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
item.hasSize = true;
|
1292 |
+
item.loaded = true;
|
1293 |
+
item.loadError = true;
|
1294 |
+
}
|
1295 |
+
},
|
1296 |
+
imgSt = mfp.st.image;
|
1297 |
+
|
1298 |
+
|
1299 |
+
var el = template.find('.mfp-img');
|
1300 |
+
if(el.length) {
|
1301 |
+
var img = document.createElement('img');
|
1302 |
+
img.className = 'mfp-img';
|
1303 |
+
if(item.el && item.el.find('img').length) {
|
1304 |
+
img.alt = item.el.find('img').attr('alt');
|
1305 |
+
}
|
1306 |
+
item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
|
1307 |
+
img.src = item.src;
|
1308 |
+
|
1309 |
+
// without clone() "error" event is not firing when IMG is replaced by new IMG
|
1310 |
+
// TODO: find a way to avoid such cloning
|
1311 |
+
if(el.is('img')) {
|
1312 |
+
item.img = item.img.clone();
|
1313 |
+
}
|
1314 |
+
|
1315 |
+
img = item.img[0];
|
1316 |
+
if(img.naturalWidth > 0) {
|
1317 |
+
item.hasSize = true;
|
1318 |
+
} else if(!img.width) {
|
1319 |
+
item.hasSize = false;
|
1320 |
+
}
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
mfp._parseMarkup(template, {
|
1324 |
+
title: _getTitle(item),
|
1325 |
+
img_replaceWith: item.img
|
1326 |
+
}, item);
|
1327 |
+
|
1328 |
+
mfp.resizeImage();
|
1329 |
+
|
1330 |
+
if(item.hasSize) {
|
1331 |
+
if(_imgInterval) clearInterval(_imgInterval);
|
1332 |
+
|
1333 |
+
if(item.loadError) {
|
1334 |
+
template.addClass('mfp-loading');
|
1335 |
+
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
|
1336 |
+
} else {
|
1337 |
+
template.removeClass('mfp-loading');
|
1338 |
+
mfp.updateStatus('ready');
|
1339 |
+
}
|
1340 |
+
return template;
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
mfp.updateStatus('loading');
|
1344 |
+
item.loading = true;
|
1345 |
+
|
1346 |
+
if(!item.hasSize) {
|
1347 |
+
item.imgHidden = true;
|
1348 |
+
template.addClass('mfp-loading');
|
1349 |
+
mfp.findImageSize(item);
|
1350 |
+
}
|
1351 |
+
|
1352 |
+
return template;
|
1353 |
+
}
|
1354 |
+
}
|
1355 |
+
});
|
1356 |
+
|
1357 |
+
/*>>image*/
|
1358 |
+
|
1359 |
+
/*>>zoom*/
|
1360 |
+
var hasMozTransform,
|
1361 |
+
getHasMozTransform = function() {
|
1362 |
+
if(hasMozTransform === undefined) {
|
1363 |
+
hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
|
1364 |
+
}
|
1365 |
+
return hasMozTransform;
|
1366 |
+
};
|
1367 |
+
|
1368 |
+
$.magnificPopup.registerModule('zoom', {
|
1369 |
+
|
1370 |
+
options: {
|
1371 |
+
enabled: false,
|
1372 |
+
easing: 'ease-in-out',
|
1373 |
+
duration: 300,
|
1374 |
+
opener: function(element) {
|
1375 |
+
return element.is('img') ? element : element.find('img');
|
1376 |
+
}
|
1377 |
+
},
|
1378 |
+
|
1379 |
+
proto: {
|
1380 |
+
|
1381 |
+
initZoom: function() {
|
1382 |
+
var zoomSt = mfp.st.zoom,
|
1383 |
+
ns = '.zoom',
|
1384 |
+
image;
|
1385 |
+
|
1386 |
+
if(!zoomSt.enabled || !mfp.supportsTransition) {
|
1387 |
+
return;
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
var duration = zoomSt.duration,
|
1391 |
+
getElToAnimate = function(image) {
|
1392 |
+
var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
|
1393 |
+
transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
|
1394 |
+
cssObj = {
|
1395 |
+
position: 'fixed',
|
1396 |
+
zIndex: 9999,
|
1397 |
+
left: 0,
|
1398 |
+
top: 0,
|
1399 |
+
'-webkit-backface-visibility': 'hidden'
|
1400 |
+
},
|
1401 |
+
t = 'transition';
|
1402 |
+
|
1403 |
+
cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
|
1404 |
+
|
1405 |
+
newImg.css(cssObj);
|
1406 |
+
return newImg;
|
1407 |
+
},
|
1408 |
+
showMainContent = function() {
|
1409 |
+
mfp.content.css('visibility', 'visible');
|
1410 |
+
},
|
1411 |
+
openTimeout,
|
1412 |
+
animatedImg;
|
1413 |
+
|
1414 |
+
_mfpOn('BuildControls'+ns, function() {
|
1415 |
+
if(mfp._allowZoom()) {
|
1416 |
+
|
1417 |
+
clearTimeout(openTimeout);
|
1418 |
+
mfp.content.css('visibility', 'hidden');
|
1419 |
+
|
1420 |
+
// Basically, all code below does is clones existing image, puts in on top of the current one and animated it
|
1421 |
+
|
1422 |
+
image = mfp._getItemToZoom();
|
1423 |
+
|
1424 |
+
if(!image) {
|
1425 |
+
showMainContent();
|
1426 |
+
return;
|
1427 |
+
}
|
1428 |
+
|
1429 |
+
animatedImg = getElToAnimate(image);
|
1430 |
+
|
1431 |
+
animatedImg.css( mfp._getOffset() );
|
1432 |
+
|
1433 |
+
mfp.wrap.append(animatedImg);
|
1434 |
+
|
1435 |
+
openTimeout = setTimeout(function() {
|
1436 |
+
animatedImg.css( mfp._getOffset( true ) );
|
1437 |
+
openTimeout = setTimeout(function() {
|
1438 |
+
|
1439 |
+
showMainContent();
|
1440 |
+
|
1441 |
+
setTimeout(function() {
|
1442 |
+
animatedImg.remove();
|
1443 |
+
image = animatedImg = null;
|
1444 |
+
_mfpTrigger('ZoomAnimationEnded');
|
1445 |
+
}, 16); // avoid blink when switching images
|
1446 |
+
|
1447 |
+
}, duration); // this timeout equals animation duration
|
1448 |
+
|
1449 |
+
}, 16); // by adding this timeout we avoid short glitch at the beginning of animation
|
1450 |
+
|
1451 |
+
|
1452 |
+
// Lots of timeouts...
|
1453 |
+
}
|
1454 |
+
});
|
1455 |
+
_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
|
1456 |
+
if(mfp._allowZoom()) {
|
1457 |
+
|
1458 |
+
clearTimeout(openTimeout);
|
1459 |
+
|
1460 |
+
mfp.st.removalDelay = duration;
|
1461 |
+
|
1462 |
+
if(!image) {
|
1463 |
+
image = mfp._getItemToZoom();
|
1464 |
+
if(!image) {
|
1465 |
+
return;
|
1466 |
+
}
|
1467 |
+
animatedImg = getElToAnimate(image);
|
1468 |
+
}
|
1469 |
+
|
1470 |
+
animatedImg.css( mfp._getOffset(true) );
|
1471 |
+
mfp.wrap.append(animatedImg);
|
1472 |
+
mfp.content.css('visibility', 'hidden');
|
1473 |
+
|
1474 |
+
setTimeout(function() {
|
1475 |
+
animatedImg.css( mfp._getOffset() );
|
1476 |
+
}, 16);
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
});
|
1480 |
+
|
1481 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1482 |
+
if(mfp._allowZoom()) {
|
1483 |
+
showMainContent();
|
1484 |
+
if(animatedImg) {
|
1485 |
+
animatedImg.remove();
|
1486 |
+
}
|
1487 |
+
image = null;
|
1488 |
+
}
|
1489 |
+
});
|
1490 |
+
},
|
1491 |
+
|
1492 |
+
_allowZoom: function() {
|
1493 |
+
return mfp.currItem.type === 'image';
|
1494 |
+
},
|
1495 |
+
|
1496 |
+
_getItemToZoom: function() {
|
1497 |
+
if(mfp.currItem.hasSize) {
|
1498 |
+
return mfp.currItem.img;
|
1499 |
+
} else {
|
1500 |
+
return false;
|
1501 |
+
}
|
1502 |
+
},
|
1503 |
+
|
1504 |
+
// Get element postion relative to viewport
|
1505 |
+
_getOffset: function(isLarge) {
|
1506 |
+
var el;
|
1507 |
+
if(isLarge) {
|
1508 |
+
el = mfp.currItem.img;
|
1509 |
+
} else {
|
1510 |
+
el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
|
1511 |
+
}
|
1512 |
+
|
1513 |
+
var offset = el.offset();
|
1514 |
+
var paddingTop = parseInt(el.css('padding-top'),10);
|
1515 |
+
var paddingBottom = parseInt(el.css('padding-bottom'),10);
|
1516 |
+
offset.top -= ( $(window).scrollTop() - paddingTop );
|
1517 |
+
|
1518 |
+
|
1519 |
+
/*
|
1520 |
+
|
1521 |
+
Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
|
1522 |
+
|
1523 |
+
*/
|
1524 |
+
var obj = {
|
1525 |
+
width: el.width(),
|
1526 |
+
// fix Zepto height+padding issue
|
1527 |
+
height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
|
1528 |
+
};
|
1529 |
+
|
1530 |
+
// I hate to do this, but there is no another option
|
1531 |
+
if( getHasMozTransform() ) {
|
1532 |
+
obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
|
1533 |
+
} else {
|
1534 |
+
obj.left = offset.left;
|
1535 |
+
obj.top = offset.top;
|
1536 |
+
}
|
1537 |
+
return obj;
|
1538 |
+
}
|
1539 |
+
|
1540 |
+
}
|
1541 |
+
});
|
1542 |
+
|
1543 |
+
|
1544 |
+
|
1545 |
+
/*>>zoom*/
|
1546 |
+
|
1547 |
+
/*>>iframe*/
|
1548 |
+
|
1549 |
+
var IFRAME_NS = 'iframe',
|
1550 |
+
_emptyPage = '//about:blank',
|
1551 |
+
|
1552 |
+
_fixIframeBugs = function(isShowing) {
|
1553 |
+
if(mfp.currTemplate[IFRAME_NS]) {
|
1554 |
+
var el = mfp.currTemplate[IFRAME_NS].find('iframe');
|
1555 |
+
if(el.length) {
|
1556 |
+
// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
|
1557 |
+
if(!isShowing) {
|
1558 |
+
el[0].src = _emptyPage;
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
// IE8 black screen bug fix
|
1562 |
+
if(mfp.isIE8) {
|
1563 |
+
el.css('display', isShowing ? 'block' : 'none');
|
1564 |
+
}
|
1565 |
+
}
|
1566 |
+
}
|
1567 |
+
};
|
1568 |
+
|
1569 |
+
$.magnificPopup.registerModule(IFRAME_NS, {
|
1570 |
+
|
1571 |
+
options: {
|
1572 |
+
markup: '<div class="mfp-iframe-scaler">'+
|
1573 |
+
'<div class="mfp-close"></div>'+
|
1574 |
+
'<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
|
1575 |
+
'</div>',
|
1576 |
+
|
1577 |
+
srcAction: 'iframe_src',
|
1578 |
+
|
1579 |
+
// we don't care and support only one default type of URL by default
|
1580 |
+
patterns: {
|
1581 |
+
youtube: {
|
1582 |
+
index: 'youtube.com',
|
1583 |
+
id: 'v=',
|
1584 |
+
src: '//www.youtube.com/embed/%id%?autoplay=1'
|
1585 |
+
},
|
1586 |
+
vimeo: {
|
1587 |
+
index: 'vimeo.com/',
|
1588 |
+
id: '/',
|
1589 |
+
src: '//player.vimeo.com/video/%id%?autoplay=1'
|
1590 |
+
},
|
1591 |
+
gmaps: {
|
1592 |
+
index: '//maps.google.',
|
1593 |
+
src: '%id%&output=embed'
|
1594 |
+
}
|
1595 |
+
}
|
1596 |
+
},
|
1597 |
+
|
1598 |
+
proto: {
|
1599 |
+
initIframe: function() {
|
1600 |
+
mfp.types.push(IFRAME_NS);
|
1601 |
+
|
1602 |
+
_mfpOn('BeforeChange', function(e, prevType, newType) {
|
1603 |
+
if(prevType !== newType) {
|
1604 |
+
if(prevType === IFRAME_NS) {
|
1605 |
+
_fixIframeBugs(); // iframe if removed
|
1606 |
+
} else if(newType === IFRAME_NS) {
|
1607 |
+
_fixIframeBugs(true); // iframe is showing
|
1608 |
+
}
|
1609 |
+
}// else {
|
1610 |
+
// iframe source is switched, don't do anything
|
1611 |
+
//}
|
1612 |
+
});
|
1613 |
+
|
1614 |
+
_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
|
1615 |
+
_fixIframeBugs();
|
1616 |
+
});
|
1617 |
+
},
|
1618 |
+
|
1619 |
+
getIframe: function(item, template) {
|
1620 |
+
var embedSrc = item.src;
|
1621 |
+
var iframeSt = mfp.st.iframe;
|
1622 |
+
|
1623 |
+
$.each(iframeSt.patterns, function() {
|
1624 |
+
if(embedSrc.indexOf( this.index ) > -1) {
|
1625 |
+
if(this.id) {
|
1626 |
+
if(typeof this.id === 'string') {
|
1627 |
+
embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
|
1628 |
+
} else {
|
1629 |
+
embedSrc = this.id.call( this, embedSrc );
|
1630 |
+
}
|
1631 |
+
}
|
1632 |
+
embedSrc = this.src.replace('%id%', embedSrc );
|
1633 |
+
return false; // break;
|
1634 |
+
}
|
1635 |
+
});
|
1636 |
+
|
1637 |
+
var dataObj = {};
|
1638 |
+
if(iframeSt.srcAction) {
|
1639 |
+
dataObj[iframeSt.srcAction] = embedSrc;
|
1640 |
+
}
|
1641 |
+
mfp._parseMarkup(template, dataObj, item);
|
1642 |
+
|
1643 |
+
mfp.updateStatus('ready');
|
1644 |
+
|
1645 |
+
return template;
|
1646 |
+
}
|
1647 |
+
}
|
1648 |
+
});
|
1649 |
+
|
1650 |
+
|
1651 |
+
|
1652 |
+
/*>>iframe*/
|
1653 |
+
|
1654 |
+
/*>>gallery*/
|
1655 |
+
/**
|
1656 |
+
* Get looped index depending on number of slides
|
1657 |
+
*/
|
1658 |
+
var _getLoopedId = function(index) {
|
1659 |
+
var numSlides = mfp.items.length;
|
1660 |
+
if(index > numSlides - 1) {
|
1661 |
+
return index - numSlides;
|
1662 |
+
} else if(index < 0) {
|
1663 |
+
return numSlides + index;
|
1664 |
+
}
|
1665 |
+
return index;
|
1666 |
+
},
|
1667 |
+
_replaceCurrTotal = function(text, curr, total) {
|
1668 |
+
return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
|
1669 |
+
};
|
1670 |
+
|
1671 |
+
$.magnificPopup.registerModule('gallery', {
|
1672 |
+
|
1673 |
+
options: {
|
1674 |
+
enabled: false,
|
1675 |
+
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
|
1676 |
+
preload: [0,2],
|
1677 |
+
navigateByImgClick: true,
|
1678 |
+
arrows: true,
|
1679 |
+
|
1680 |
+
tPrev: 'Previous (Left arrow key)',
|
1681 |
+
tNext: 'Next (Right arrow key)',
|
1682 |
+
tCounter: '%curr% of %total%'
|
1683 |
+
},
|
1684 |
+
|
1685 |
+
proto: {
|
1686 |
+
initGallery: function() {
|
1687 |
+
|
1688 |
+
var gSt = mfp.st.gallery,
|
1689 |
+
ns = '.mfp-gallery';
|
1690 |
+
|
1691 |
+
mfp.direction = true; // true - next, false - prev
|
1692 |
+
|
1693 |
+
if(!gSt || !gSt.enabled ) return false;
|
1694 |
+
|
1695 |
+
_wrapClasses += ' mfp-gallery';
|
1696 |
+
|
1697 |
+
_mfpOn(OPEN_EVENT+ns, function() {
|
1698 |
+
|
1699 |
+
if(gSt.navigateByImgClick) {
|
1700 |
+
mfp.wrap.on('click'+ns, '.mfp-img', function() {
|
1701 |
+
if(mfp.items.length > 1) {
|
1702 |
+
mfp.next();
|
1703 |
+
return false;
|
1704 |
+
}
|
1705 |
+
});
|
1706 |
+
}
|
1707 |
+
|
1708 |
+
_document.on('keydown'+ns, function(e) {
|
1709 |
+
if (e.keyCode === 37) {
|
1710 |
+
mfp.prev();
|
1711 |
+
} else if (e.keyCode === 39) {
|
1712 |
+
mfp.next();
|
1713 |
+
}
|
1714 |
+
});
|
1715 |
+
});
|
1716 |
+
|
1717 |
+
_mfpOn('UpdateStatus'+ns, function(e, data) {
|
1718 |
+
if(data.text) {
|
1719 |
+
data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
|
1720 |
+
}
|
1721 |
+
});
|
1722 |
+
|
1723 |
+
_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
|
1724 |
+
var l = mfp.items.length;
|
1725 |
+
values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
|
1726 |
+
});
|
1727 |
+
|
1728 |
+
_mfpOn('BuildControls' + ns, function() {
|
1729 |
+
if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
|
1730 |
+
var markup = gSt.arrowMarkup,
|
1731 |
+
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1732 |
+
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
1733 |
+
|
1734 |
+
arrowLeft.click(function() {
|
1735 |
+
mfp.prev();
|
1736 |
+
});
|
1737 |
+
arrowRight.click(function() {
|
1738 |
+
mfp.next();
|
1739 |
+
});
|
1740 |
+
|
1741 |
+
mfp.container.append(arrowLeft.add(arrowRight));
|
1742 |
+
}
|
1743 |
+
});
|
1744 |
+
|
1745 |
+
_mfpOn(CHANGE_EVENT+ns, function() {
|
1746 |
+
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
|
1747 |
+
|
1748 |
+
mfp._preloadTimeout = setTimeout(function() {
|
1749 |
+
mfp.preloadNearbyImages();
|
1750 |
+
mfp._preloadTimeout = null;
|
1751 |
+
}, 16);
|
1752 |
+
});
|
1753 |
+
|
1754 |
+
|
1755 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1756 |
+
_document.off(ns);
|
1757 |
+
mfp.wrap.off('click'+ns);
|
1758 |
+
mfp.arrowRight = mfp.arrowLeft = null;
|
1759 |
+
});
|
1760 |
+
|
1761 |
+
},
|
1762 |
+
next: function() {
|
1763 |
+
mfp.direction = true;
|
1764 |
+
mfp.index = _getLoopedId(mfp.index + 1);
|
1765 |
+
mfp.updateItemHTML();
|
1766 |
+
},
|
1767 |
+
prev: function() {
|
1768 |
+
mfp.direction = false;
|
1769 |
+
mfp.index = _getLoopedId(mfp.index - 1);
|
1770 |
+
mfp.updateItemHTML();
|
1771 |
+
},
|
1772 |
+
goTo: function(newIndex) {
|
1773 |
+
mfp.direction = (newIndex >= mfp.index);
|
1774 |
+
mfp.index = newIndex;
|
1775 |
+
mfp.updateItemHTML();
|
1776 |
+
},
|
1777 |
+
preloadNearbyImages: function() {
|
1778 |
+
var p = mfp.st.gallery.preload,
|
1779 |
+
preloadBefore = Math.min(p[0], mfp.items.length),
|
1780 |
+
preloadAfter = Math.min(p[1], mfp.items.length),
|
1781 |
+
i;
|
1782 |
+
|
1783 |
+
for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
|
1784 |
+
mfp._preloadItem(mfp.index+i);
|
1785 |
+
}
|
1786 |
+
for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
|
1787 |
+
mfp._preloadItem(mfp.index-i);
|
1788 |
+
}
|
1789 |
+
},
|
1790 |
+
_preloadItem: function(index) {
|
1791 |
+
index = _getLoopedId(index);
|
1792 |
+
|
1793 |
+
if(mfp.items[index].preloaded) {
|
1794 |
+
return;
|
1795 |
+
}
|
1796 |
+
|
1797 |
+
var item = mfp.items[index];
|
1798 |
+
if(!item.parsed) {
|
1799 |
+
item = mfp.parseEl( index );
|
1800 |
+
}
|
1801 |
+
|
1802 |
+
_mfpTrigger('LazyLoad', item);
|
1803 |
+
|
1804 |
+
if(item.type === 'image') {
|
1805 |
+
item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
|
1806 |
+
item.hasSize = true;
|
1807 |
+
}).on('error.mfploader', function() {
|
1808 |
+
item.hasSize = true;
|
1809 |
+
item.loadError = true;
|
1810 |
+
_mfpTrigger('LazyLoadError', item);
|
1811 |
+
}).attr('src', item.src);
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
|
1815 |
+
item.preloaded = true;
|
1816 |
+
}
|
1817 |
+
}
|
1818 |
+
});
|
1819 |
+
|
1820 |
+
/*>>gallery*/
|
1821 |
+
|
1822 |
+
/*>>retina*/
|
1823 |
+
|
1824 |
+
var RETINA_NS = 'retina';
|
1825 |
+
|
1826 |
+
$.magnificPopup.registerModule(RETINA_NS, {
|
1827 |
+
options: {
|
1828 |
+
replaceSrc: function(item) {
|
1829 |
+
return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
|
1830 |
+
},
|
1831 |
+
ratio: 1 // Function or number. Set to 1 to disable.
|
1832 |
+
},
|
1833 |
+
proto: {
|
1834 |
+
initRetina: function() {
|
1835 |
+
if(window.devicePixelRatio > 1) {
|
1836 |
+
|
1837 |
+
var st = mfp.st.retina,
|
1838 |
+
ratio = st.ratio;
|
1839 |
+
|
1840 |
+
ratio = !isNaN(ratio) ? ratio : ratio();
|
1841 |
+
|
1842 |
+
if(ratio > 1) {
|
1843 |
+
_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
|
1844 |
+
item.img.css({
|
1845 |
+
'max-width': item.img[0].naturalWidth / ratio,
|
1846 |
+
'width': '100%'
|
1847 |
+
});
|
1848 |
+
});
|
1849 |
+
_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
|
1850 |
+
item.src = st.replaceSrc(item, ratio);
|
1851 |
+
});
|
1852 |
+
}
|
1853 |
+
}
|
1854 |
+
|
1855 |
+
}
|
1856 |
+
}
|
1857 |
+
});
|
1858 |
+
|
1859 |
+
/*>>retina*/
|
1860 |
+
_checkInstance(); }));
|
assets/{js/vendors → lib/magnific-popup}/jquery.magnific-popup.min.js
RENAMED
File without changes
|
assets/lib/owl-carousel/owl.carousel.js
ADDED
@@ -0,0 +1,3275 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Owl Carousel v2.2.1
|
3 |
+
* Copyright 2013-2017 David Deutsch
|
4 |
+
* Licensed under ()
|
5 |
+
*/
|
6 |
+
/**
|
7 |
+
* Owl carousel
|
8 |
+
* @version 2.1.6
|
9 |
+
* @author Bartosz Wojciechowski
|
10 |
+
* @author David Deutsch
|
11 |
+
* @license The MIT License (MIT)
|
12 |
+
* @todo Lazy Load Icon
|
13 |
+
* @todo prevent animationend bubling
|
14 |
+
* @todo itemsScaleUp
|
15 |
+
* @todo Test Zepto
|
16 |
+
* @todo stagePadding calculate wrong active classes
|
17 |
+
*/
|
18 |
+
;(function($, window, document, undefined) {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Creates a carousel.
|
22 |
+
* @class The Owl Carousel.
|
23 |
+
* @public
|
24 |
+
* @param {HTMLElement|jQuery} element - The element to create the carousel for.
|
25 |
+
* @param {Object} [options] - The options
|
26 |
+
*/
|
27 |
+
function Owl(element, options) {
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Current settings for the carousel.
|
31 |
+
* @public
|
32 |
+
*/
|
33 |
+
this.settings = null;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Current options set by the caller including defaults.
|
37 |
+
* @public
|
38 |
+
*/
|
39 |
+
this.options = $.extend({}, Owl.Defaults, options);
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Plugin element.
|
43 |
+
* @public
|
44 |
+
*/
|
45 |
+
this.$element = $(element);
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Proxied event handlers.
|
49 |
+
* @protected
|
50 |
+
*/
|
51 |
+
this._handlers = {};
|
52 |
+
|
53 |
+
/**
|
54 |
+
* References to the running plugins of this carousel.
|
55 |
+
* @protected
|
56 |
+
*/
|
57 |
+
this._plugins = {};
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Currently suppressed events to prevent them from beeing retriggered.
|
61 |
+
* @protected
|
62 |
+
*/
|
63 |
+
this._supress = {};
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Absolute current position.
|
67 |
+
* @protected
|
68 |
+
*/
|
69 |
+
this._current = null;
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Animation speed in milliseconds.
|
73 |
+
* @protected
|
74 |
+
*/
|
75 |
+
this._speed = null;
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Coordinates of all items in pixel.
|
79 |
+
* @todo The name of this member is missleading.
|
80 |
+
* @protected
|
81 |
+
*/
|
82 |
+
this._coordinates = [];
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Current breakpoint.
|
86 |
+
* @todo Real media queries would be nice.
|
87 |
+
* @protected
|
88 |
+
*/
|
89 |
+
this._breakpoint = null;
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Current width of the plugin element.
|
93 |
+
*/
|
94 |
+
this._width = null;
|
95 |
+
|
96 |
+
/**
|
97 |
+
* All real items.
|
98 |
+
* @protected
|
99 |
+
*/
|
100 |
+
this._items = [];
|
101 |
+
|
102 |
+
/**
|
103 |
+
* All cloned items.
|
104 |
+
* @protected
|
105 |
+
*/
|
106 |
+
this._clones = [];
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Merge values of all items.
|
110 |
+
* @todo Maybe this could be part of a plugin.
|
111 |
+
* @protected
|
112 |
+
*/
|
113 |
+
this._mergers = [];
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Widths of all items.
|
117 |
+
*/
|
118 |
+
this._widths = [];
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Invalidated parts within the update process.
|
122 |
+
* @protected
|
123 |
+
*/
|
124 |
+
this._invalidated = {};
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Ordered list of workers for the update process.
|
128 |
+
* @protected
|
129 |
+
*/
|
130 |
+
this._pipe = [];
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Current state information for the drag operation.
|
134 |
+
* @todo #261
|
135 |
+
* @protected
|
136 |
+
*/
|
137 |
+
this._drag = {
|
138 |
+
time: null,
|
139 |
+
target: null,
|
140 |
+
pointer: null,
|
141 |
+
stage: {
|
142 |
+
start: null,
|
143 |
+
current: null
|
144 |
+
},
|
145 |
+
direction: null
|
146 |
+
};
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Current state information and their tags.
|
150 |
+
* @type {Object}
|
151 |
+
* @protected
|
152 |
+
*/
|
153 |
+
this._states = {
|
154 |
+
current: {},
|
155 |
+
tags: {
|
156 |
+
'initializing': [ 'busy' ],
|
157 |
+
'animating': [ 'busy' ],
|
158 |
+
'dragging': [ 'interacting' ]
|
159 |
+
}
|
160 |
+
};
|
161 |
+
|
162 |
+
$.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) {
|
163 |
+
this._handlers[handler] = $.proxy(this[handler], this);
|
164 |
+
}, this));
|
165 |
+
|
166 |
+
$.each(Owl.Plugins, $.proxy(function(key, plugin) {
|
167 |
+
this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
|
168 |
+
= new plugin(this);
|
169 |
+
}, this));
|
170 |
+
|
171 |
+
$.each(Owl.Workers, $.proxy(function(priority, worker) {
|
172 |
+
this._pipe.push({
|
173 |
+
'filter': worker.filter,
|
174 |
+
'run': $.proxy(worker.run, this)
|
175 |
+
});
|
176 |
+
}, this));
|
177 |
+
|
178 |
+
this.setup();
|
179 |
+
this.initialize();
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Default options for the carousel.
|
184 |
+
* @public
|
185 |
+
*/
|
186 |
+
Owl.Defaults = {
|
187 |
+
items: 3,
|
188 |
+
loop: false,
|
189 |
+
center: false,
|
190 |
+
rewind: false,
|
191 |
+
|
192 |
+
mouseDrag: true,
|
193 |
+
touchDrag: true,
|
194 |
+
pullDrag: true,
|
195 |
+
freeDrag: false,
|
196 |
+
|
197 |
+
margin: 0,
|
198 |
+
stagePadding: 0,
|
199 |
+
|
200 |
+
merge: false,
|
201 |
+
mergeFit: true,
|
202 |
+
autoWidth: false,
|
203 |
+
|
204 |
+
startPosition: 0,
|
205 |
+
rtl: false,
|
206 |
+
|
207 |
+
smartSpeed: 250,
|
208 |
+
fluidSpeed: false,
|
209 |
+
dragEndSpeed: false,
|
210 |
+
|
211 |
+
responsive: {},
|
212 |
+
responsiveRefreshRate: 200,
|
213 |
+
responsiveBaseElement: window,
|
214 |
+
|
215 |
+
fallbackEasing: 'swing',
|
216 |
+
|
217 |
+
info: false,
|
218 |
+
|
219 |
+
nestedItemSelector: false,
|
220 |
+
itemElement: 'div',
|
221 |
+
stageElement: 'div',
|
222 |
+
|
223 |
+
refreshClass: 'owl-refresh',
|
224 |
+
loadedClass: 'owl-loaded',
|
225 |
+
loadingClass: 'owl-loading',
|
226 |
+
rtlClass: 'owl-rtl',
|
227 |
+
responsiveClass: 'owl-responsive',
|
228 |
+
dragClass: 'owl-drag',
|
229 |
+
itemClass: 'owl-item',
|
230 |
+
stageClass: 'owl-stage',
|
231 |
+
stageOuterClass: 'owl-stage-outer',
|
232 |
+
grabClass: 'owl-grab'
|
233 |
+
};
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Enumeration for width.
|
237 |
+
* @public
|
238 |
+
* @readonly
|
239 |
+
* @enum {String}
|
240 |
+
*/
|
241 |
+
Owl.Width = {
|
242 |
+
Default: 'default',
|
243 |
+
Inner: 'inner',
|
244 |
+
Outer: 'outer'
|
245 |
+
};
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Enumeration for types.
|
249 |
+
* @public
|
250 |
+
* @readonly
|
251 |
+
* @enum {String}
|
252 |
+
*/
|
253 |
+
Owl.Type = {
|
254 |
+
Event: 'event',
|
255 |
+
State: 'state'
|
256 |
+
};
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Contains all registered plugins.
|
260 |
+
* @public
|
261 |
+
*/
|
262 |
+
Owl.Plugins = {};
|
263 |
+
|
264 |
+
/**
|
265 |
+
* List of workers involved in the update process.
|
266 |
+
*/
|
267 |
+
Owl.Workers = [ {
|
268 |
+
filter: [ 'width', 'settings' ],
|
269 |
+
run: function() {
|
270 |
+
this._width = this.$element.width();
|
271 |
+
}
|
272 |
+
}, {
|
273 |
+
filter: [ 'width', 'items', 'settings' ],
|
274 |
+
run: function(cache) {
|
275 |
+
cache.current = this._items && this._items[this.relative(this._current)];
|
276 |
+
}
|
277 |
+
}, {
|
278 |
+
filter: [ 'items', 'settings' ],
|
279 |
+
run: function() {
|
280 |
+
this.$stage.children('.cloned').remove();
|
281 |
+
}
|
282 |
+
}, {
|
283 |
+
filter: [ 'width', 'items', 'settings' ],
|
284 |
+
run: function(cache) {
|
285 |
+
var margin = this.settings.margin || '',
|
286 |
+
grid = !this.settings.autoWidth,
|
287 |
+
rtl = this.settings.rtl,
|
288 |
+
css = {
|
289 |
+
'width': 'auto',
|
290 |
+
'margin-left': rtl ? margin : '',
|
291 |
+
'margin-right': rtl ? '' : margin
|
292 |
+
};
|
293 |
+
|
294 |
+
!grid && this.$stage.children().css(css);
|
295 |
+
|
296 |
+
cache.css = css;
|
297 |
+
}
|
298 |
+
}, {
|
299 |
+
filter: [ 'width', 'items', 'settings' ],
|
300 |
+
run: function(cache) {
|
301 |
+
var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
|
302 |
+
merge = null,
|
303 |
+
iterator = this._items.length,
|
304 |
+
grid = !this.settings.autoWidth,
|
305 |
+
widths = [];
|
306 |
+
|
307 |
+
cache.items = {
|
308 |
+
merge: false,
|
309 |
+
width: width
|
310 |
+
};
|
311 |
+
|
312 |
+
while (iterator--) {
|
313 |
+
merge = this._mergers[iterator];
|
314 |
+
merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge;
|
315 |
+
|
316 |
+
cache.items.merge = merge > 1 || cache.items.merge;
|
317 |
+
|
318 |
+
widths[iterator] = !grid ? this._items[iterator].width() : width * merge;
|
319 |
+
}
|
320 |
+
|
321 |
+
this._widths = widths;
|
322 |
+
}
|
323 |
+
}, {
|
324 |
+
filter: [ 'items', 'settings' ],
|
325 |
+
run: function() {
|
326 |
+
var clones = [],
|
327 |
+
items = this._items,
|
328 |
+
settings = this.settings,
|
329 |
+
// TODO: Should be computed from number of min width items in stage
|
330 |
+
view = Math.max(settings.items * 2, 4),
|
331 |
+
size = Math.ceil(items.length / 2) * 2,
|
332 |
+
repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0,
|
333 |
+
append = '',
|
334 |
+
prepend = '';
|
335 |
+
|
336 |
+
repeat /= 2;
|
337 |
+
|
338 |
+
while (repeat--) {
|
339 |
+
// Switch to only using appended clones
|
340 |
+
clones.push(this.normalize(clones.length / 2, true));
|
341 |
+
append = append + items[clones[clones.length - 1]][0].outerHTML;
|
342 |
+
clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
|
343 |
+
prepend = items[clones[clones.length - 1]][0].outerHTML + prepend;
|
344 |
+
}
|
345 |
+
|
346 |
+
this._clones = clones;
|
347 |
+
|
348 |
+
$(append).addClass('cloned').appendTo(this.$stage);
|
349 |
+
$(prepend).addClass('cloned').prependTo(this.$stage);
|
350 |
+
}
|
351 |
+
}, {
|
352 |
+
filter: [ 'width', 'items', 'settings' ],
|
353 |
+
run: function() {
|
354 |
+
var rtl = this.settings.rtl ? 1 : -1,
|
355 |
+
size = this._clones.length + this._items.length,
|
356 |
+
iterator = -1,
|
357 |
+
previous = 0,
|
358 |
+
current = 0,
|
359 |
+
coordinates = [];
|
360 |
+
|
361 |
+
while (++iterator < size) {
|
362 |
+
previous = coordinates[iterator - 1] || 0;
|
363 |
+
current = this._widths[this.relative(iterator)] + this.settings.margin;
|
364 |
+
coordinates.push(previous + current * rtl);
|
365 |
+
}
|
366 |
+
|
367 |
+
this._coordinates = coordinates;
|
368 |
+
}
|
369 |
+
}, {
|
370 |
+
filter: [ 'width', 'items', 'settings' ],
|
371 |
+
run: function() {
|
372 |
+
var padding = this.settings.stagePadding,
|
373 |
+
coordinates = this._coordinates,
|
374 |
+
css = {
|
375 |
+
'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
|
376 |
+
'padding-left': padding || '',
|
377 |
+
'padding-right': padding || ''
|
378 |
+
};
|
379 |
+
|
380 |
+
this.$stage.css(css);
|
381 |
+
}
|
382 |
+
}, {
|
383 |
+
filter: [ 'width', 'items', 'settings' ],
|
384 |
+
run: function(cache) {
|
385 |
+
var iterator = this._coordinates.length,
|
386 |
+
grid = !this.settings.autoWidth,
|
387 |
+
items = this.$stage.children();
|
388 |
+
|
389 |
+
if (grid && cache.items.merge) {
|
390 |
+
while (iterator--) {
|
391 |
+
cache.css.width = this._widths[this.relative(iterator)];
|
392 |
+
items.eq(iterator).css(cache.css);
|
393 |
+
}
|
394 |
+
} else if (grid) {
|
395 |
+
cache.css.width = cache.items.width;
|
396 |
+
items.css(cache.css);
|
397 |
+
}
|
398 |
+
}
|
399 |
+
}, {
|
400 |
+
filter: [ 'items' ],
|
401 |
+
run: function() {
|
402 |
+
this._coordinates.length < 1 && this.$stage.removeAttr('style');
|
403 |
+
}
|
404 |
+
}, {
|
405 |
+
filter: [ 'width', 'items', 'settings' ],
|
406 |
+
run: function(cache) {
|
407 |
+
cache.current = cache.current ? this.$stage.children().index(cache.current) : 0;
|
408 |
+
cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
|
409 |
+
this.reset(cache.current);
|
410 |
+
}
|
411 |
+
}, {
|
412 |
+
filter: [ 'position' ],
|
413 |
+
run: function() {
|
414 |
+
this.animate(this.coordinates(this._current));
|
415 |
+
}
|
416 |
+
}, {
|
417 |
+
filter: [ 'width', 'position', 'items', 'settings' ],
|
418 |
+
run: function() {
|
419 |
+
var rtl = this.settings.rtl ? 1 : -1,
|
420 |
+
padding = this.settings.stagePadding * 2,
|
421 |
+
begin = this.coordinates(this.current()) + padding,
|
422 |
+
end = begin + this.width() * rtl,
|
423 |
+
inner, outer, matches = [], i, n;
|
424 |
+
|
425 |
+
for (i = 0, n = this._coordinates.length; i < n; i++) {
|
426 |
+
inner = this._coordinates[i - 1] || 0;
|
427 |
+
outer = Math.abs(this._coordinates[i]) + padding * rtl;
|
428 |
+
|
429 |
+
if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
|
430 |
+
|| (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
|
431 |
+
matches.push(i);
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
this.$stage.children('.active').removeClass('active');
|
436 |
+
this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
|
437 |
+
|
438 |
+
if (this.settings.center) {
|
439 |
+
this.$stage.children('.center').removeClass('center');
|
440 |
+
this.$stage.children().eq(this.current()).addClass('center');
|
441 |
+
}
|
442 |
+
}
|
443 |
+
} ];
|
444 |
+
|
445 |
+
/**
|
446 |
+
* Initializes the carousel.
|
447 |
+
* @protected
|
448 |
+
*/
|
449 |
+
Owl.prototype.initialize = function() {
|
450 |
+
this.enter('initializing');
|
451 |
+
this.trigger('initialize');
|
452 |
+
|
453 |
+
this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
|
454 |
+
|
455 |
+
if (this.settings.autoWidth && !this.is('pre-loading')) {
|
456 |
+
var imgs, nestedSelector, width;
|
457 |
+
imgs = this.$element.find('img');
|
458 |
+
nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
|
459 |
+
width = this.$element.children(nestedSelector).width();
|
460 |
+
|
461 |
+
if (imgs.length && width <= 0) {
|
462 |
+
this.preloadAutoWidthImages(imgs);
|
463 |
+
}
|
464 |
+
}
|
465 |
+
|
466 |
+
this.$element.addClass(this.options.loadingClass);
|
467 |
+
|
468 |
+
// create stage
|
469 |
+
this.$stage = $('<' + this.settings.stageElement + ' class="' + this.settings.stageClass + '"/>')
|
470 |
+
.wrap('<div class="' + this.settings.stageOuterClass + '"/>');
|
471 |
+
|
472 |
+
// append stage
|
473 |
+
this.$element.append(this.$stage.parent());
|
474 |
+
|
475 |
+
// append content
|
476 |
+
this.replace(this.$element.children().not(this.$stage.parent()));
|
477 |
+
|
478 |
+
// check visibility
|
479 |
+
if (this.$element.is(':visible')) {
|
480 |
+
// update view
|
481 |
+
this.refresh();
|
482 |
+
} else {
|
483 |
+
// invalidate width
|
484 |
+
this.invalidate('width');
|
485 |
+
}
|
486 |
+
|
487 |
+
this.$element
|
488 |
+
.removeClass(this.options.loadingClass)
|
489 |
+
.addClass(this.options.loadedClass);
|
490 |
+
|
491 |
+
// register event handlers
|
492 |
+
this.registerEventHandlers();
|
493 |
+
|
494 |
+
this.leave('initializing');
|
495 |
+
this.trigger('initialized');
|
496 |
+
};
|
497 |
+
|
498 |
+
/**
|
499 |
+
* Setups the current settings.
|
500 |
+
* @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
|
501 |
+
* @todo Support for media queries by using `matchMedia` would be nice.
|
502 |
+
* @public
|
503 |
+
*/
|
504 |
+
Owl.prototype.setup = function() {
|
505 |
+
var viewport = this.viewport(),
|
506 |
+
overwrites = this.options.responsive,
|
507 |
+
match = -1,
|
508 |
+
settings = null;
|
509 |
+
|
510 |
+
if (!overwrites) {
|
511 |
+
settings = $.extend({}, this.options);
|
512 |
+
} else {
|
513 |
+
$.each(overwrites, function(breakpoint) {
|
514 |
+
if (breakpoint <= viewport && breakpoint > match) {
|
515 |
+
match = Number(breakpoint);
|
516 |
+
}
|
517 |
+
});
|
518 |
+
|
519 |
+
settings = $.extend({}, this.options, overwrites[match]);
|
520 |
+
if (typeof settings.stagePadding === 'function') {
|
521 |
+
settings.stagePadding = settings.stagePadding();
|
522 |
+
}
|
523 |
+
delete settings.responsive;
|
524 |
+
|
525 |
+
// responsive class
|
526 |
+
if (settings.responsiveClass) {
|
527 |
+
this.$element.attr('class',
|
528 |
+
this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
|
529 |
+
);
|
530 |
+
}
|
531 |
+
}
|
532 |
+
|
533 |
+
this.trigger('change', { property: { name: 'settings', value: settings } });
|
534 |
+
this._breakpoint = match;
|
535 |
+
this.settings = settings;
|
536 |
+
this.invalidate('settings');
|
537 |
+
this.trigger('changed', { property: { name: 'settings', value: this.settings } });
|
538 |
+
};
|
539 |
+
|
540 |
+
/**
|
541 |
+
* Updates option logic if necessery.
|
542 |
+
* @protected
|
543 |
+
*/
|
544 |
+
Owl.prototype.optionsLogic = function() {
|
545 |
+
if (this.settings.autoWidth) {
|
546 |
+
this.settings.stagePadding = false;
|
547 |
+
this.settings.merge = false;
|
548 |
+
}
|
549 |
+
};
|
550 |
+
|
551 |
+
/**
|
552 |
+
* Prepares an item before add.
|
553 |
+
* @todo Rename event parameter `content` to `item`.
|
554 |
+
* @protected
|
555 |
+
* @returns {jQuery|HTMLElement} - The item container.
|
556 |
+
*/
|
557 |
+
Owl.prototype.prepare = function(item) {
|
558 |
+
var event = this.trigger('prepare', { content: item });
|
559 |
+
|
560 |
+
if (!event.data) {
|
561 |
+
event.data = $('<' + this.settings.itemElement + '/>')
|
562 |
+
.addClass(this.options.itemClass).append(item)
|
563 |
+
}
|
564 |
+
|
565 |
+
this.trigger('prepared', { content: event.data });
|
566 |
+
|
567 |
+
return event.data;
|
568 |
+
};
|
569 |
+
|
570 |
+
/**
|
571 |
+
* Updates the view.
|
572 |
+
* @public
|
573 |
+
*/
|
574 |
+
Owl.prototype.update = function() {
|
575 |
+
var i = 0,
|
576 |
+
n = this._pipe.length,
|
577 |
+
filter = $.proxy(function(p) { return this[p] }, this._invalidated),
|
578 |
+
cache = {};
|
579 |
+
|
580 |
+
while (i < n) {
|
581 |
+
if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
|
582 |
+
this._pipe[i].run(cache);
|
583 |
+
}
|
584 |
+
i++;
|
585 |
+
}
|
586 |
+
|
587 |
+
this._invalidated = {};
|
588 |
+
|
589 |
+
!this.is('valid') && this.enter('valid');
|
590 |
+
};
|
591 |
+
|
592 |
+
/**
|
593 |
+
* Gets the width of the view.
|
594 |
+
* @public
|
595 |
+
* @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
|
596 |
+
* @returns {Number} - The width of the view in pixel.
|
597 |
+
*/
|
598 |
+
Owl.prototype.width = function(dimension) {
|
599 |
+
dimension = dimension || Owl.Width.Default;
|
600 |
+
switch (dimension) {
|
601 |
+
case Owl.Width.Inner:
|
602 |
+
case Owl.Width.Outer:
|
603 |
+
return this._width;
|
604 |
+
default:
|
605 |
+
return this._width - this.settings.stagePadding * 2 + this.settings.margin;
|
606 |
+
}
|
607 |
+
};
|
608 |
+
|
609 |
+
/**
|
610 |
+
* Refreshes the carousel primarily for adaptive purposes.
|
611 |
+
* @public
|
612 |
+
*/
|
613 |
+
Owl.prototype.refresh = function() {
|
614 |
+
this.enter('refreshing');
|
615 |
+
this.trigger('refresh');
|
616 |
+
|
617 |
+
this.setup();
|
618 |
+
|
619 |
+
this.optionsLogic();
|
620 |
+
|
621 |
+
this.$element.addClass(this.options.refreshClass);
|
622 |
+
|
623 |
+
this.update();
|
624 |
+
|
625 |
+
this.$element.removeClass(this.options.refreshClass);
|
626 |
+
|
627 |
+
this.leave('refreshing');
|
628 |
+
this.trigger('refreshed');
|
629 |
+
};
|
630 |
+
|
631 |
+
/**
|
632 |
+
* Checks window `resize` event.
|
633 |
+
* @protected
|
634 |
+
*/
|
635 |
+
Owl.prototype.onThrottledResize = function() {
|
636 |
+
window.clearTimeout(this.resizeTimer);
|
637 |
+
this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
|
638 |
+
};
|
639 |
+
|
640 |
+
/**
|
641 |
+
* Checks window `resize` event.
|
642 |
+
* @protected
|
643 |
+
*/
|
644 |
+
Owl.prototype.onResize = function() {
|
645 |
+
if (!this._items.length) {
|
646 |
+
return false;
|
647 |
+
}
|
648 |
+
|
649 |
+
if (this._width === this.$element.width()) {
|
650 |
+
return false;
|
651 |
+
}
|
652 |
+
|
653 |
+
if (!this.$element.is(':visible')) {
|
654 |
+
return false;
|
655 |
+
}
|
656 |
+
|
657 |
+
this.enter('resizing');
|
658 |
+
|
659 |
+
if (this.trigger('resize').isDefaultPrevented()) {
|
660 |
+
this.leave('resizing');
|
661 |
+
return false;
|
662 |
+
}
|
663 |
+
|
664 |
+
this.invalidate('width');
|
665 |
+
|
666 |
+
this.refresh();
|
667 |
+
|
668 |
+
this.leave('resizing');
|
669 |
+
this.trigger('resized');
|
670 |
+
};
|
671 |
+
|
672 |
+
/**
|
673 |
+
* Registers event handlers.
|
674 |
+
* @todo Check `msPointerEnabled`
|
675 |
+
* @todo #261
|
676 |
+
* @protected
|
677 |
+
*/
|
678 |
+
Owl.prototype.registerEventHandlers = function() {
|
679 |
+
if ($.support.transition) {
|
680 |
+
this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
|
681 |
+
}
|
682 |
+
|
683 |
+
if (this.settings.responsive !== false) {
|
684 |
+
this.on(window, 'resize', this._handlers.onThrottledResize);
|
685 |
+
}
|
686 |
+
|
687 |
+
if (this.settings.mouseDrag) {
|
688 |
+
this.$element.addClass(this.options.dragClass);
|
689 |
+
this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
|
690 |
+
this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false });
|
691 |
+
}
|
692 |
+
|
693 |
+
if (this.settings.touchDrag){
|
694 |
+
this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
|
695 |
+
this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
|
696 |
+
}
|
697 |
+
};
|
698 |
+
|
699 |
+
/**
|
700 |
+
* Handles `touchstart` and `mousedown` events.
|
701 |
+
* @todo Horizontal swipe threshold as option
|
702 |
+
* @todo #261
|
703 |
+
* @protected
|
704 |
+
* @param {Event} event - The event arguments.
|
705 |
+
*/
|
706 |
+
Owl.prototype.onDragStart = function(event) {
|
707 |
+
var stage = null;
|
708 |
+
|
709 |
+
if (event.which === 3) {
|
710 |
+
return;
|
711 |
+
}
|
712 |
+
|
713 |
+
if ($.support.transform) {
|
714 |
+
stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
|
715 |
+
stage = {
|
716 |
+
x: stage[stage.length === 16 ? 12 : 4],
|
717 |
+
y: stage[stage.length === 16 ? 13 : 5]
|
718 |
+
};
|
719 |
+
} else {
|
720 |
+
stage = this.$stage.position();
|
721 |
+
stage = {
|
722 |
+
x: this.settings.rtl ?
|
723 |
+
stage.left + this.$stage.width() - this.width() + this.settings.margin :
|
724 |
+
stage.left,
|
725 |
+
y: stage.top
|
726 |
+
};
|
727 |
+
}
|
728 |
+
|
729 |
+
if (this.is('animating')) {
|
730 |
+
$.support.transform ? this.animate(stage.x) : this.$stage.stop()
|
731 |
+
this.invalidate('position');
|
732 |
+
}
|
733 |
+
|
734 |
+
this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown');
|
735 |
+
|
736 |
+
this.speed(0);
|
737 |
+
|
738 |
+
this._drag.time = new Date().getTime();
|
739 |
+
this._drag.target = $(event.target);
|
740 |
+
this._drag.stage.start = stage;
|
741 |
+
this._drag.stage.current = stage;
|
742 |
+
this._drag.pointer = this.pointer(event);
|
743 |
+
|
744 |
+
$(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
|
745 |
+
|
746 |
+
$(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) {
|
747 |
+
var delta = this.difference(this._drag.pointer, this.pointer(event));
|
748 |
+
|
749 |
+
$(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
|
750 |
+
|
751 |
+
if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) {
|
752 |
+
return;
|
753 |
+
}
|
754 |
+
|
755 |
+
event.preventDefault();
|
756 |
+
|
757 |
+
this.enter('dragging');
|
758 |
+
this.trigger('drag');
|
759 |
+
}, this));
|
760 |
+
};
|
761 |
+
|
762 |
+
/**
|
763 |
+
* Handles the `touchmove` and `mousemove` events.
|
764 |
+
* @todo #261
|
765 |
+
* @protected
|
766 |
+
* @param {Event} event - The event arguments.
|
767 |
+
*/
|
768 |
+
Owl.prototype.onDragMove = function(event) {
|
769 |
+
var minimum = null,
|
770 |
+
maximum = null,
|
771 |
+
pull = null,
|
772 |
+
delta = this.difference(this._drag.pointer, this.pointer(event)),
|
773 |
+
stage = this.difference(this._drag.stage.start, delta);
|
774 |
+
|
775 |
+
if (!this.is('dragging')) {
|
776 |
+
return;
|
777 |
+
}
|
778 |
+
|
779 |
+
event.preventDefault();
|
780 |
+
|
781 |
+
if (this.settings.loop) {
|
782 |
+
minimum = this.coordinates(this.minimum());
|
783 |
+
maximum = this.coordinates(this.maximum() + 1) - minimum;
|
784 |
+
stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
|
785 |
+
} else {
|
786 |
+
minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
|
787 |
+
maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
|
788 |
+
pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0;
|
789 |
+
stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
|
790 |
+
}
|
791 |
+
|
792 |
+
this._drag.stage.current = stage;
|
793 |
+
|
794 |
+
this.animate(stage.x);
|
795 |
+
};
|
796 |
+
|
797 |
+
/**
|
798 |
+
* Handles the `touchend` and `mouseup` events.
|
799 |
+
* @todo #261
|
800 |
+
* @todo Threshold for click event
|
801 |
+
* @protected
|
802 |
+
* @param {Event} event - The event arguments.
|
803 |
+
*/
|
804 |
+
Owl.prototype.onDragEnd = function(event) {
|
805 |
+
var delta = this.difference(this._drag.pointer, this.pointer(event)),
|
806 |
+
stage = this._drag.stage.current,
|
807 |
+
direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right';
|
808 |
+
|
809 |
+
$(document).off('.owl.core');
|
810 |
+
|
811 |
+
this.$element.removeClass(this.options.grabClass);
|
812 |
+
|
813 |
+
if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) {
|
814 |
+
this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
|
815 |
+
this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction));
|
816 |
+
this.invalidate('position');
|
817 |
+
this.update();
|
818 |
+
|
819 |
+
this._drag.direction = direction;
|
820 |
+
|
821 |
+
if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) {
|
822 |
+
this._drag.target.one('click.owl.core', function() { return false; });
|
823 |
+
}
|
824 |
+
}
|
825 |
+
|
826 |
+
if (!this.is('dragging')) {
|
827 |
+
return;
|
828 |
+
}
|
829 |
+
|
830 |
+
this.leave('dragging');
|
831 |
+
this.trigger('dragged');
|
832 |
+
};
|
833 |
+
|
834 |
+
/**
|
835 |
+
* Gets absolute position of the closest item for a coordinate.
|
836 |
+
* @todo Setting `freeDrag` makes `closest` not reusable. See #165.
|
837 |
+
* @protected
|
838 |
+
* @param {Number} coordinate - The coordinate in pixel.
|
839 |
+
* @param {String} direction - The direction to check for the closest item. Ether `left` or `right`.
|
840 |
+
* @return {Number} - The absolute position of the closest item.
|
841 |
+
*/
|
842 |
+
Owl.prototype.closest = function(coordinate, direction) {
|
843 |
+
var position = -1,
|
844 |
+
pull = 30,
|
845 |
+
width = this.width(),
|
846 |
+
coordinates = this.coordinates();
|
847 |
+
|
848 |
+
if (!this.settings.freeDrag) {
|
849 |
+
// check closest item
|
850 |
+
$.each(coordinates, $.proxy(function(index, value) {
|
851 |
+
// on a left pull, check on current index
|
852 |
+
if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) {
|
853 |
+
position = index;
|
854 |
+
// on a right pull, check on previous index
|
855 |
+
// to do so, subtract width from value and set position = index + 1
|
856 |
+
} else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) {
|
857 |
+
position = index + 1;
|
858 |
+
} else if (this.op(coordinate, '<', value)
|
859 |
+
&& this.op(coordinate, '>', coordinates[index + 1] || value - width)) {
|
860 |
+
position = direction === 'left' ? index + 1 : index;
|
861 |
+
}
|
862 |
+
return position === -1;
|
863 |
+
}, this));
|
864 |
+
}
|
865 |
+
|
866 |
+
if (!this.settings.loop) {
|
867 |
+
// non loop boundries
|
868 |
+
if (this.op(coordinate, '>', coordinates[this.minimum()])) {
|
869 |
+
position = coordinate = this.minimum();
|
870 |
+
} else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
|
871 |
+
position = coordinate = this.maximum();
|
872 |
+
}
|
873 |
+
}
|
874 |
+
|
875 |
+
return position;
|
876 |
+
};
|
877 |
+
|
878 |
+
/**
|
879 |
+
* Animates the stage.
|
880 |
+
* @todo #270
|
881 |
+
* @public
|
882 |
+
* @param {Number} coordinate - The coordinate in pixels.
|
883 |
+
*/
|
884 |
+
Owl.prototype.animate = function(coordinate) {
|
885 |
+
var animate = this.speed() > 0;
|
886 |
+
|
887 |
+
this.is('animating') && this.onTransitionEnd();
|
888 |
+
|
889 |
+
if (animate) {
|
890 |
+
this.enter('animating');
|
891 |
+
this.trigger('translate');
|
892 |
+
}
|
893 |
+
|
894 |
+
if ($.support.transform3d && $.support.transition) {
|
895 |
+
this.$stage.css({
|
896 |
+
transform: 'translate3d(' + coordinate + 'px,0px,0px)',
|
897 |
+
transition: (this.speed() / 1000) + 's'
|
898 |
+
});
|
899 |
+
} else if (animate) {
|
900 |
+
this.$stage.animate({
|
901 |
+
left: coordinate + 'px'
|
902 |
+
}, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
|
903 |
+
} else {
|
904 |
+
this.$stage.css({
|
905 |
+
left: coordinate + 'px'
|
906 |
+
});
|
907 |
+
}
|
908 |
+
};
|
909 |
+
|
910 |
+
/**
|
911 |
+
* Checks whether the carousel is in a specific state or not.
|
912 |
+
* @param {String} state - The state to check.
|
913 |
+
* @returns {Boolean} - The flag which indicates if the carousel is busy.
|
914 |
+
*/
|
915 |
+
Owl.prototype.is = function(state) {
|
916 |
+
return this._states.current[state] && this._states.current[state] > 0;
|
917 |
+
};
|
918 |
+
|
919 |
+
/**
|
920 |
+
* Sets the absolute position of the current item.
|
921 |
+
* @public
|
922 |
+
* @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
|
923 |
+
* @returns {Number} - The absolute position of the current item.
|
924 |
+
*/
|
925 |
+
Owl.prototype.current = function(position) {
|
926 |
+
if (position === undefined) {
|
927 |
+
return this._current;
|
928 |
+
}
|
929 |
+
|
930 |
+
if (this._items.length === 0) {
|
931 |
+
return undefined;
|
932 |
+
}
|
933 |
+
|
934 |
+
position = this.normalize(position);
|
935 |
+
|
936 |
+
if (this._current !== position) {
|
937 |
+
var event = this.trigger('change', { property: { name: 'position', value: position } });
|
938 |
+
|
939 |
+
if (event.data !== undefined) {
|
940 |
+
position = this.normalize(event.data);
|
941 |
+
}
|
942 |
+
|
943 |
+
this._current = position;
|
944 |
+
|
945 |
+
this.invalidate('position');
|
946 |
+
|
947 |
+
this.trigger('changed', { property: { name: 'position', value: this._current } });
|
948 |
+
}
|
949 |
+
|
950 |
+
return this._current;
|
951 |
+
};
|
952 |
+
|
953 |
+
/**
|
954 |
+
* Invalidates the given part of the update routine.
|
955 |
+
* @param {String} [part] - The part to invalidate.
|
956 |
+
* @returns {Array.<String>} - The invalidated parts.
|
957 |
+
*/
|
958 |
+
Owl.prototype.invalidate = function(part) {
|
959 |
+
if ($.type(part) === 'string') {
|
960 |
+
this._invalidated[part] = true;
|
961 |
+
this.is('valid') && this.leave('valid');
|
962 |
+
}
|
963 |
+
return $.map(this._invalidated, function(v, i) { return i });
|
964 |
+
};
|
965 |
+
|
966 |
+
/**
|
967 |
+
* Resets the absolute position of the current item.
|
968 |
+
* @public
|
969 |
+
* @param {Number} position - The absolute position of the new item.
|
970 |
+
*/
|
971 |
+
Owl.prototype.reset = function(position) {
|
972 |
+
position = this.normalize(position);
|
973 |
+
|
974 |
+
if (position === undefined) {
|
975 |
+
return;
|
976 |
+
}
|
977 |
+
|
978 |
+
this._speed = 0;
|
979 |
+
this._current = position;
|
980 |
+
|
981 |
+
this.suppress([ 'translate', 'translated' ]);
|
982 |
+
|
983 |
+
this.animate(this.coordinates(position));
|
984 |
+
|
985 |
+
this.release([ 'translate', 'translated' ]);
|
986 |
+
};
|
987 |
+
|
988 |
+
/**
|
989 |
+
* Normalizes an absolute or a relative position of an item.
|
990 |
+
* @public
|
991 |
+
* @param {Number} position - The absolute or relative position to normalize.
|
992 |
+
* @param {Boolean} [relative=false] - Whether the given position is relative or not.
|
993 |
+
* @returns {Number} - The normalized position.
|
994 |
+
*/
|
995 |
+
Owl.prototype.normalize = function(position, relative) {
|
996 |
+
var n = this._items.length,
|
997 |
+
m = relative ? 0 : this._clones.length;
|
998 |
+
|
999 |
+
if (!this.isNumeric(position) || n < 1) {
|
1000 |
+
position = undefined;
|
1001 |
+
} else if (position < 0 || position >= n + m) {
|
1002 |
+
position = ((position - m / 2) % n + n) % n + m / 2;
|
1003 |
+
}
|
1004 |
+
|
1005 |
+
return position;
|
1006 |
+
};
|
1007 |
+
|
1008 |
+
/**
|
1009 |
+
* Converts an absolute position of an item into a relative one.
|
1010 |
+
* @public
|
1011 |
+
* @param {Number} position - The absolute position to convert.
|
1012 |
+
* @returns {Number} - The converted position.
|
1013 |
+
*/
|
1014 |
+
Owl.prototype.relative = function(position) {
|
1015 |
+
position -= this._clones.length / 2;
|
1016 |
+
return this.normalize(position, true);
|
1017 |
+
};
|
1018 |
+
|
1019 |
+
/**
|
1020 |
+
* Gets the maximum position for the current item.
|
1021 |
+
* @public
|
1022 |
+
* @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
|
1023 |
+
* @returns {Number}
|
1024 |
+
*/
|
1025 |
+
Owl.prototype.maximum = function(relative) {
|
1026 |
+
var settings = this.settings,
|
1027 |
+
maximum = this._coordinates.length,
|
1028 |
+
iterator,
|
1029 |
+
reciprocalItemsWidth,
|
1030 |
+
elementWidth;
|
1031 |
+
|
1032 |
+
if (settings.loop) {
|
1033 |
+
maximum = this._clones.length / 2 + this._items.length - 1;
|
1034 |
+
} else if (settings.autoWidth || settings.merge) {
|
1035 |
+
iterator = this._items.length;
|
1036 |
+
reciprocalItemsWidth = this._items[--iterator].width();
|
1037 |
+
elementWidth = this.$element.width();
|
1038 |
+
while (iterator--) {
|
1039 |
+
reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin;
|
1040 |
+
if (reciprocalItemsWidth > elementWidth) {
|
1041 |
+
break;
|
1042 |
+
}
|
1043 |
+
}
|
1044 |
+
maximum = iterator + 1;
|
1045 |
+
} else if (settings.center) {
|
1046 |
+
maximum = this._items.length - 1;
|
1047 |
+
} else {
|
1048 |
+
maximum = this._items.length - settings.items;
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
if (relative) {
|
1052 |
+
maximum -= this._clones.length / 2;
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
return Math.max(maximum, 0);
|
1056 |
+
};
|
1057 |
+
|
1058 |
+
/**
|
1059 |
+
* Gets the minimum position for the current item.
|
1060 |
+
* @public
|
1061 |
+
* @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
|
1062 |
+
* @returns {Number}
|
1063 |
+
*/
|
1064 |
+
Owl.prototype.minimum = function(relative) {
|
1065 |
+
return relative ? 0 : this._clones.length / 2;
|
1066 |
+
};
|
1067 |
+
|
1068 |
+
/**
|
1069 |
+
* Gets an item at the specified relative position.
|
1070 |
+
* @public
|
1071 |
+
* @param {Number} [position] - The relative position of the item.
|
1072 |
+
* @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
|
1073 |
+
*/
|
1074 |
+
Owl.prototype.items = function(position) {
|
1075 |
+
if (position === undefined) {
|
1076 |
+
return this._items.slice();
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
position = this.normalize(position, true);
|
1080 |
+
return this._items[position];
|
1081 |
+
};
|
1082 |
+
|
1083 |
+
/**
|
1084 |
+
* Gets an item at the specified relative position.
|
1085 |
+
* @public
|
1086 |
+
* @param {Number} [position] - The relative position of the item.
|
1087 |
+
* @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
|
1088 |
+
*/
|
1089 |
+
Owl.prototype.mergers = function(position) {
|
1090 |
+
if (position === undefined) {
|
1091 |
+
return this._mergers.slice();
|
1092 |
+
}
|
1093 |
+
|
1094 |
+
position = this.normalize(position, true);
|
1095 |
+
return this._mergers[position];
|
1096 |
+
};
|
1097 |
+
|
1098 |
+
/**
|
1099 |
+
* Gets the absolute positions of clones for an item.
|
1100 |
+
* @public
|
1101 |
+
* @param {Number} [position] - The relative position of the item.
|
1102 |
+
* @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
|
1103 |
+
*/
|
1104 |
+
Owl.prototype.clones = function(position) {
|
1105 |
+
var odd = this._clones.length / 2,
|
1106 |
+
even = odd + this._items.length,
|
1107 |
+
map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 };
|
1108 |
+
|
1109 |
+
if (position === undefined) {
|
1110 |
+
return $.map(this._clones, function(v, i) { return map(i) });
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
|
1114 |
+
};
|
1115 |
+
|
1116 |
+
/**
|
1117 |
+
* Sets the current animation speed.
|
1118 |
+
* @public
|
1119 |
+
* @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
|
1120 |
+
* @returns {Number} - The current animation speed in milliseconds.
|
1121 |
+
*/
|
1122 |
+
Owl.prototype.speed = function(speed) {
|
1123 |
+
if (speed !== undefined) {
|
1124 |
+
this._speed = speed;
|
1125 |
+
}
|
1126 |
+
|
1127 |
+
return this._speed;
|
1128 |
+
};
|
1129 |
+
|
1130 |
+
/**
|
1131 |
+
* Gets the coordinate of an item.
|
1132 |
+
* @todo The name of this method is missleanding.
|
1133 |
+
* @public
|
1134 |
+
* @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
|
1135 |
+
* @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
|
1136 |
+
*/
|
1137 |
+
Owl.prototype.coordinates = function(position) {
|
1138 |
+
var multiplier = 1,
|
1139 |
+
newPosition = position - 1,
|
1140 |
+
coordinate;
|
1141 |
+
|
1142 |
+
if (position === undefined) {
|
1143 |
+
return $.map(this._coordinates, $.proxy(function(coordinate, index) {
|
1144 |
+
return this.coordinates(index);
|
1145 |
+
}, this));
|
1146 |
+
}
|
1147 |
+
|
1148 |
+
if (this.settings.center) {
|
1149 |
+
if (this.settings.rtl) {
|
1150 |
+
multiplier = -1;
|
1151 |
+
newPosition = position + 1;
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
coordinate = this._coordinates[position];
|
1155 |
+
coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier;
|
1156 |
+
} else {
|
1157 |
+
coordinate = this._coordinates[newPosition] || 0;
|
1158 |
+
}
|
1159 |
+
|
1160 |
+
coordinate = Math.ceil(coordinate);
|
1161 |
+
|
1162 |
+
return coordinate;
|
1163 |
+
};
|
1164 |
+
|
1165 |
+
/**
|
1166 |
+
* Calculates the speed for a translation.
|
1167 |
+
* @protected
|
1168 |
+
* @param {Number} from - The absolute position of the start item.
|
1169 |
+
* @param {Number} to - The absolute position of the target item.
|
1170 |
+
* @param {Number} [factor=undefined] - The time factor in milliseconds.
|
1171 |
+
* @returns {Number} - The time in milliseconds for the translation.
|
1172 |
+
*/
|
1173 |
+
Owl.prototype.duration = function(from, to, factor) {
|
1174 |
+
if (factor === 0) {
|
1175 |
+
return 0;
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
|
1179 |
+
};
|
1180 |
+
|
1181 |
+
/**
|
1182 |
+
* Slides to the specified item.
|
1183 |
+
* @public
|
1184 |
+
* @param {Number} position - The position of the item.
|
1185 |
+
* @param {Number} [speed] - The time in milliseconds for the transition.
|
1186 |
+
*/
|
1187 |
+
Owl.prototype.to = function(position, speed) {
|
1188 |
+
var current = this.current(),
|
1189 |
+
revert = null,
|
1190 |
+
distance = position - this.relative(current),
|
1191 |
+
direction = (distance > 0) - (distance < 0),
|
1192 |
+
items = this._items.length,
|
1193 |
+
minimum = this.minimum(),
|
1194 |
+
maximum = this.maximum();
|
1195 |
+
|
1196 |
+
if (this.settings.loop) {
|
1197 |
+
if (!this.settings.rewind && Math.abs(distance) > items / 2) {
|
1198 |
+
distance += direction * -1 * items;
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
position = current + distance;
|
1202 |
+
revert = ((position - minimum) % items + items) % items + minimum;
|
1203 |
+
|
1204 |
+
if (revert !== position && revert - distance <= maximum && revert - distance > 0) {
|
1205 |
+
current = revert - distance;
|
1206 |
+
position = revert;
|
1207 |
+
this.reset(current);
|
1208 |
+
}
|
1209 |
+
} else if (this.settings.rewind) {
|
1210 |
+
maximum += 1;
|
1211 |
+
position = (position % maximum + maximum) % maximum;
|
1212 |
+
} else {
|
1213 |
+
position = Math.max(minimum, Math.min(maximum, position));
|
1214 |
+
}
|
1215 |
+
|
1216 |
+
this.speed(this.duration(current, position, speed));
|
1217 |
+
this.current(position);
|
1218 |
+
|
1219 |
+
if (this.$element.is(':visible')) {
|
1220 |
+
this.update();
|
1221 |
+
}
|
1222 |
+
};
|
1223 |
+
|
1224 |
+
/**
|
1225 |
+
* Slides to the next item.
|
1226 |
+
* @public
|
1227 |
+
* @param {Number} [speed] - The time in milliseconds for the transition.
|
1228 |
+
*/
|
1229 |
+
Owl.prototype.next = function(speed) {
|
1230 |
+
speed = speed || false;
|
1231 |
+
this.to(this.relative(this.current()) + 1, speed);
|
1232 |
+
};
|
1233 |
+
|
1234 |
+
/**
|
1235 |
+
* Slides to the previous item.
|
1236 |
+
* @public
|
1237 |
+
* @param {Number} [speed] - The time in milliseconds for the transition.
|
1238 |
+
*/
|
1239 |
+
Owl.prototype.prev = function(speed) {
|
1240 |
+
speed = speed || false;
|
1241 |
+
this.to(this.relative(this.current()) - 1, speed);
|
1242 |
+
};
|
1243 |
+
|
1244 |
+
/**
|
1245 |
+
* Handles the end of an animation.
|
1246 |
+
* @protected
|
1247 |
+
* @param {Event} event - The event arguments.
|
1248 |
+
*/
|
1249 |
+
Owl.prototype.onTransitionEnd = function(event) {
|
1250 |
+
|
1251 |
+
// if css2 animation then event object is undefined
|
1252 |
+
if (event !== undefined) {
|
1253 |
+
event.stopPropagation();
|
1254 |
+
|
1255 |
+
// Catch only owl-stage transitionEnd event
|
1256 |
+
if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
|
1257 |
+
return false;
|
1258 |
+
}
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
this.leave('animating');
|
1262 |
+
this.trigger('translated');
|
1263 |
+
};
|
1264 |
+
|
1265 |
+
/**
|
1266 |
+
* Gets viewport width.
|
1267 |
+
* @protected
|
1268 |
+
* @return {Number} - The width in pixel.
|
1269 |
+
*/
|
1270 |
+
Owl.prototype.viewport = function() {
|
1271 |
+
var width;
|
1272 |
+
if (this.options.responsiveBaseElement !== window) {
|
1273 |
+
width = $(this.options.responsiveBaseElement).width();
|
1274 |
+
} else if (window.innerWidth) {
|
1275 |
+
width = window.innerWidth;
|
1276 |
+
} else if (document.documentElement && document.documentElement.clientWidth) {
|
1277 |
+
width = document.documentElement.clientWidth;
|
1278 |
+
} else {
|
1279 |
+
console.warn('Can not detect viewport width.');
|
1280 |
+
}
|
1281 |
+
return width;
|
1282 |
+
};
|
1283 |
+
|
1284 |
+
/**
|
1285 |
+
* Replaces the current content.
|
1286 |
+
* @public
|
1287 |
+
* @param {HTMLElement|jQuery|String} content - The new content.
|
1288 |
+
*/
|
1289 |
+
Owl.prototype.replace = function(content) {
|
1290 |
+
this.$stage.empty();
|
1291 |
+
this._items = [];
|
1292 |
+
|
1293 |
+
if (content) {
|
1294 |
+
content = (content instanceof jQuery) ? content : $(content);
|
1295 |
+
}
|
1296 |
+
|
1297 |
+
if (this.settings.nestedItemSelector) {
|
1298 |
+
content = content.find('.' + this.settings.nestedItemSelector);
|
1299 |
+
}
|
1300 |
+
|
1301 |
+
content.filter(function() {
|
1302 |
+
return this.nodeType === 1;
|
1303 |
+
}).each($.proxy(function(index, item) {
|
1304 |
+
item = this.prepare(item);
|
1305 |
+
this.$stage.append(item);
|
1306 |
+
this._items.push(item);
|
1307 |
+
this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
|
1308 |
+
}, this));
|
1309 |
+
|
1310 |
+
this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
|
1311 |
+
|
1312 |
+
this.invalidate('items');
|
1313 |
+
};
|
1314 |
+
|
1315 |
+
/**
|
1316 |
+
* Adds an item.
|
1317 |
+
* @todo Use `item` instead of `content` for the event arguments.
|
1318 |
+
* @public
|
1319 |
+
* @param {HTMLElement|jQuery|String} content - The item content to add.
|
1320 |
+
* @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
|
1321 |
+
*/
|
1322 |
+
Owl.prototype.add = function(content, position) {
|
1323 |
+
var current = this.relative(this._current);
|
1324 |
+
|
1325 |
+
position = position === undefined ? this._items.length : this.normalize(position, true);
|
1326 |
+
content = content instanceof jQuery ? content : $(content);
|
1327 |
+
|
1328 |
+
this.trigger('add', { content: content, position: position });
|
1329 |
+
|
1330 |
+
content = this.prepare(content);
|
1331 |
+
|
1332 |
+
if (this._items.length === 0 || position === this._items.length) {
|
1333 |
+
this._items.length === 0 && this.$stage.append(content);
|
1334 |
+
this._items.length !== 0 && this._items[position - 1].after(content);
|
1335 |
+
this._items.push(content);
|
1336 |
+
this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
|
1337 |
+
} else {
|
1338 |
+
this._items[position].before(content);
|
1339 |
+
this._items.splice(position, 0, content);
|
1340 |
+
this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
this._items[current] && this.reset(this._items[current].index());
|
1344 |
+
|
1345 |
+
this.invalidate('items');
|
1346 |
+
|
1347 |
+
this.trigger('added', { content: content, position: position });
|
1348 |
+
};
|
1349 |
+
|
1350 |
+
/**
|
1351 |
+
* Removes an item by its position.
|
1352 |
+
* @todo Use `item` instead of `content` for the event arguments.
|
1353 |
+
* @public
|
1354 |
+
* @param {Number} position - The relative position of the item to remove.
|
1355 |
+
*/
|
1356 |
+
Owl.prototype.remove = function(position) {
|
1357 |
+
position = this.normalize(position, true);
|
1358 |
+
|
1359 |
+
if (position === undefined) {
|
1360 |
+
return;
|
1361 |
+
}
|
1362 |
+
|
1363 |
+
this.trigger('remove', { content: this._items[position], position: position });
|
1364 |
+
|
1365 |
+
this._items[position].remove();
|
1366 |
+
this._items.splice(position, 1);
|
1367 |
+
this._mergers.splice(position, 1);
|
1368 |
+
|
1369 |
+
this.invalidate('items');
|
1370 |
+
|
1371 |
+
this.trigger('removed', { content: null, position: position });
|
1372 |
+
};
|
1373 |
+
|
1374 |
+
/**
|
1375 |
+
* Preloads images with auto width.
|
1376 |
+
* @todo Replace by a more generic approach
|
1377 |
+
* @protected
|
1378 |
+
*/
|
1379 |
+
Owl.prototype.preloadAutoWidthImages = function(images) {
|
1380 |
+
images.each($.proxy(function(i, element) {
|
1381 |
+
this.enter('pre-loading');
|
1382 |
+
element = $(element);
|
1383 |
+
$(new Image()).one('load', $.proxy(function(e) {
|
1384 |
+
element.attr('src', e.target.src);
|
1385 |
+
element.css('opacity', 1);
|
1386 |
+
this.leave('pre-loading');
|
1387 |
+
!this.is('pre-loading') && !this.is('initializing') && this.refresh();
|
1388 |
+
}, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina'));
|
1389 |
+
}, this));
|
1390 |
+
};
|
1391 |
+
|
1392 |
+
/**
|
1393 |
+
* Destroys the carousel.
|
1394 |
+
* @public
|
1395 |
+
*/
|
1396 |
+
Owl.prototype.destroy = function() {
|
1397 |
+
|
1398 |
+
this.$element.off('.owl.core');
|
1399 |
+
this.$stage.off('.owl.core');
|
1400 |
+
$(document).off('.owl.core');
|
1401 |
+
|
1402 |
+
if (this.settings.responsive !== false) {
|
1403 |
+
window.clearTimeout(this.resizeTimer);
|
1404 |
+
this.off(window, 'resize', this._handlers.onThrottledResize);
|
1405 |
+
}
|
1406 |
+
|
1407 |
+
for (var i in this._plugins) {
|
1408 |
+
this._plugins[i].destroy();
|
1409 |
+
}
|
1410 |
+
|
1411 |
+
this.$stage.children('.cloned').remove();
|
1412 |
+
|
1413 |
+
this.$stage.unwrap();
|
1414 |
+
this.$stage.children().contents().unwrap();
|
1415 |
+
this.$stage.children().unwrap();
|
1416 |
+
|
1417 |
+
this.$element
|
1418 |
+
.removeClass(this.options.refreshClass)
|
1419 |
+
.removeClass(this.options.loadingClass)
|
1420 |
+
.removeClass(this.options.loadedClass)
|
1421 |
+
.removeClass(this.options.rtlClass)
|
1422 |
+
.removeClass(this.options.dragClass)
|
1423 |
+
.removeClass(this.options.grabClass)
|
1424 |
+
.attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
|
1425 |
+
.removeData('owl.carousel');
|
1426 |
+
};
|
1427 |
+
|
1428 |
+
/**
|
1429 |
+
* Operators to calculate right-to-left and left-to-right.
|
1430 |
+
* @protected
|
1431 |
+
* @param {Number} [a] - The left side operand.
|
1432 |
+
* @param {String} [o] - The operator.
|
1433 |
+
* @param {Number} [b] - The right side operand.
|
1434 |
+
*/
|
1435 |
+
Owl.prototype.op = function(a, o, b) {
|
1436 |
+
var rtl = this.settings.rtl;
|
1437 |
+
switch (o) {
|
1438 |
+
case '<':
|
1439 |
+
return rtl ? a > b : a < b;
|
1440 |
+
case '>':
|
1441 |
+
return rtl ? a < b : a > b;
|
1442 |
+
case '>=':
|
1443 |
+
return rtl ? a <= b : a >= b;
|
1444 |
+
case '<=':
|
1445 |
+
return rtl ? a >= b : a <= b;
|
1446 |
+
default:
|
1447 |
+
break;
|
1448 |
+
}
|
1449 |
+
};
|
1450 |
+
|
1451 |
+
/**
|
1452 |
+
* Attaches to an internal event.
|
1453 |
+
* @protected
|
1454 |
+
* @param {HTMLElement} element - The event source.
|
1455 |
+
* @param {String} event - The event name.
|
1456 |
+
* @param {Function} listener - The event handler to attach.
|
1457 |
+
* @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
|
1458 |
+
*/
|
1459 |
+
Owl.prototype.on = function(element, event, listener, capture) {
|
1460 |
+
if (element.addEventListener) {
|
1461 |
+
element.addEventListener(event, listener, capture);
|
1462 |
+
} else if (element.attachEvent) {
|
1463 |
+
element.attachEvent('on' + event, listener);
|
1464 |
+
}
|
1465 |
+
};
|
1466 |
+
|
1467 |
+
/**
|
1468 |
+
* Detaches from an internal event.
|
1469 |
+
* @protected
|
1470 |
+
* @param {HTMLElement} element - The event source.
|
1471 |
+
* @param {String} event - The event name.
|
1472 |
+
* @param {Function} listener - The attached event handler to detach.
|
1473 |
+
* @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
|
1474 |
+
*/
|
1475 |
+
Owl.prototype.off = function(element, event, listener, capture) {
|
1476 |
+
if (element.removeEventListener) {
|
1477 |
+
element.removeEventListener(event, listener, capture);
|
1478 |
+
} else if (element.detachEvent) {
|
1479 |
+
element.detachEvent('on' + event, listener);
|
1480 |
+
}
|
1481 |
+
};
|
1482 |
+
|
1483 |
+
/**
|
1484 |
+
* Triggers a public event.
|
1485 |
+
* @todo Remove `status`, `relatedTarget` should be used instead.
|
1486 |
+
* @protected
|
1487 |
+
* @param {String} name - The event name.
|
1488 |
+
* @param {*} [data=null] - The event data.
|
1489 |
+
* @param {String} [namespace=carousel] - The event namespace.
|
1490 |
+
* @param {String} [state] - The state which is associated with the event.
|
1491 |
+
* @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not.
|
1492 |
+
* @returns {Event} - The event arguments.
|
1493 |
+
*/
|
1494 |
+
Owl.prototype.trigger = function(name, data, namespace, state, enter) {
|
1495 |
+
var status = {
|
1496 |
+
item: { count: this._items.length, index: this.current() }
|
1497 |
+
}, handler = $.camelCase(
|
1498 |
+
$.grep([ 'on', name, namespace ], function(v) { return v })
|
1499 |
+
.join('-').toLowerCase()
|
1500 |
+
), event = $.Event(
|
1501 |
+
[ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
|
1502 |
+
$.extend({ relatedTarget: this }, status, data)
|
1503 |
+
);
|
1504 |
+
|
1505 |
+
if (!this._supress[name]) {
|
1506 |
+
$.each(this._plugins, function(name, plugin) {
|
1507 |
+
if (plugin.onTrigger) {
|
1508 |
+
plugin.onTrigger(event);
|
1509 |
+
}
|
1510 |
+
});
|
1511 |
+
|
1512 |
+
this.register({ type: Owl.Type.Event, name: name });
|
1513 |
+
this.$element.trigger(event);
|
1514 |
+
|
1515 |
+
if (this.settings && typeof this.settings[handler] === 'function') {
|
1516 |
+
this.settings[handler].call(this, event);
|
1517 |
+
}
|
1518 |
+
}
|
1519 |
+
|
1520 |
+
return event;
|
1521 |
+
};
|
1522 |
+
|
1523 |
+
/**
|
1524 |
+
* Enters a state.
|
1525 |
+
* @param name - The state name.
|
1526 |
+
*/
|
1527 |
+
Owl.prototype.enter = function(name) {
|
1528 |
+
$.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
|
1529 |
+
if (this._states.current[name] === undefined) {
|
1530 |
+
this._states.current[name] = 0;
|
1531 |
+
}
|
1532 |
+
|
1533 |
+
this._states.current[name]++;
|
1534 |
+
}, this));
|
1535 |
+
};
|
1536 |
+
|
1537 |
+
/**
|
1538 |
+
* Leaves a state.
|
1539 |
+
* @param name - The state name.
|
1540 |
+
*/
|
1541 |
+
Owl.prototype.leave = function(name) {
|
1542 |
+
$.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
|
1543 |
+
this._states.current[name]--;
|
1544 |
+
}, this));
|
1545 |
+
};
|
1546 |
+
|
1547 |
+
/**
|
1548 |
+
* Registers an event or state.
|
1549 |
+
* @public
|
1550 |
+
* @param {Object} object - The event or state to register.
|
1551 |
+
*/
|
1552 |
+
Owl.prototype.register = function(object) {
|
1553 |
+
if (object.type === Owl.Type.Event) {
|
1554 |
+
if (!$.event.special[object.name]) {
|
1555 |
+
$.event.special[object.name] = {};
|
1556 |
+
}
|
1557 |
+
|
1558 |
+
if (!$.event.special[object.name].owl) {
|
1559 |
+
var _default = $.event.special[object.name]._default;
|
1560 |
+
$.event.special[object.name]._default = function(e) {
|
1561 |
+
if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) {
|
1562 |
+
return _default.apply(this, arguments);
|
1563 |
+
}
|
1564 |
+
return e.namespace && e.namespace.indexOf('owl') > -1;
|
1565 |
+
};
|
1566 |
+
$.event.special[object.name].owl = true;
|
1567 |
+
}
|
1568 |
+
} else if (object.type === Owl.Type.State) {
|
1569 |
+
if (!this._states.tags[object.name]) {
|
1570 |
+
this._states.tags[object.name] = object.tags;
|
1571 |
+
} else {
|
1572 |
+
this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags);
|
1573 |
+
}
|
1574 |
+
|
1575 |
+
this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) {
|
1576 |
+
return $.inArray(tag, this._states.tags[object.name]) === i;
|
1577 |
+
}, this));
|
1578 |
+
}
|
1579 |
+
};
|
1580 |
+
|
1581 |
+
/**
|
1582 |
+
* Suppresses events.
|
1583 |
+
* @protected
|
1584 |
+
* @param {Array.<String>} events - The events to suppress.
|
1585 |
+
*/
|
1586 |
+
Owl.prototype.suppress = function(events) {
|
1587 |
+
$.each(events, $.proxy(function(index, event) {
|
1588 |
+
this._supress[event] = true;
|
1589 |
+
}, this));
|
1590 |
+
};
|
1591 |
+
|
1592 |
+
/**
|
1593 |
+
* Releases suppressed events.
|
1594 |
+
* @protected
|
1595 |
+
* @param {Array.<String>} events - The events to release.
|
1596 |
+
*/
|
1597 |
+
Owl.prototype.release = function(events) {
|
1598 |
+
$.each(events, $.proxy(function(index, event) {
|
1599 |
+
delete this._supress[event];
|
1600 |
+
}, this));
|
1601 |
+
};
|
1602 |
+
|
1603 |
+
/**
|
1604 |
+
* Gets unified pointer coordinates from event.
|
1605 |
+
* @todo #261
|
1606 |
+
* @protected
|
1607 |
+
* @param {Event} - The `mousedown` or `touchstart` event.
|
1608 |
+
* @returns {Object} - Contains `x` and `y` coordinates of current pointer position.
|
1609 |
+
*/
|
1610 |
+
Owl.prototype.pointer = function(event) {
|
1611 |
+
var result = { x: null, y: null };
|
1612 |
+
|
1613 |
+
event = event.originalEvent || event || window.event;
|
1614 |
+
|
1615 |
+
event = event.touches && event.touches.length ?
|
1616 |
+
event.touches[0] : event.changedTouches && event.changedTouches.length ?
|
1617 |
+
event.changedTouches[0] : event;
|
1618 |
+
|
1619 |
+
if (event.pageX) {
|
1620 |
+
result.x = event.pageX;
|
1621 |
+
result.y = event.pageY;
|
1622 |
+
} else {
|
1623 |
+
result.x = event.clientX;
|
1624 |
+
result.y = event.clientY;
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
return result;
|
1628 |
+
};
|
1629 |
+
|
1630 |
+
/**
|
1631 |
+
* Determines if the input is a Number or something that can be coerced to a Number
|
1632 |
+
* @protected
|
1633 |
+
* @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested
|
1634 |
+
* @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number
|
1635 |
+
*/
|
1636 |
+
Owl.prototype.isNumeric = function(number) {
|
1637 |
+
return !isNaN(parseFloat(number));
|
1638 |
+
};
|
1639 |
+
|
1640 |
+
/**
|
1641 |
+
* Gets the difference of two vectors.
|
1642 |
+
* @todo #261
|
1643 |
+
* @protected
|
1644 |
+
* @param {Object} - The first vector.
|
1645 |
+
* @param {Object} - The second vector.
|
1646 |
+
* @returns {Object} - The difference.
|
1647 |
+
*/
|
1648 |
+
Owl.prototype.difference = function(first, second) {
|
1649 |
+
return {
|
1650 |
+
x: first.x - second.x,
|
1651 |
+
y: first.y - second.y
|
1652 |
+
};
|
1653 |
+
};
|
1654 |
+
|
1655 |
+
/**
|
1656 |
+
* The jQuery Plugin for the Owl Carousel
|
1657 |
+
* @todo Navigation plugin `next` and `prev`
|
1658 |
+
* @public
|
1659 |
+
*/
|
1660 |
+
$.fn.owlCarousel = function(option) {
|
1661 |
+
var args = Array.prototype.slice.call(arguments, 1);
|
1662 |
+
|
1663 |
+
return this.each(function() {
|
1664 |
+
var $this = $(this),
|
1665 |
+
data = $this.data('owl.carousel');
|
1666 |
+
|
1667 |
+
if (!data) {
|
1668 |
+
data = new Owl(this, typeof option == 'object' && option);
|
1669 |
+
$this.data('owl.carousel', data);
|
1670 |
+
|
1671 |
+
$.each([
|
1672 |
+
'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
|
1673 |
+
], function(i, event) {
|
1674 |
+
data.register({ type: Owl.Type.Event, name: event });
|
1675 |
+
data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) {
|
1676 |
+
if (e.namespace && e.relatedTarget !== this) {
|
1677 |
+
this.suppress([ event ]);
|
1678 |
+
data[event].apply(this, [].slice.call(arguments, 1));
|
1679 |
+
this.release([ event ]);
|
1680 |
+
}
|
1681 |
+
}, data));
|
1682 |
+
});
|
1683 |
+
}
|
1684 |
+
|
1685 |
+
if (typeof option == 'string' && option.charAt(0) !== '_') {
|
1686 |
+
data[option].apply(data, args);
|
1687 |
+
}
|
1688 |
+
});
|
1689 |
+
};
|
1690 |
+
|
1691 |
+
/**
|
1692 |
+
* The constructor for the jQuery Plugin
|
1693 |
+
* @public
|
1694 |
+
*/
|
1695 |
+
$.fn.owlCarousel.Constructor = Owl;
|
1696 |
+
|
1697 |
+
})(window.Zepto || window.jQuery, window, document);
|
1698 |
+
|
1699 |
+
/**
|
1700 |
+
* AutoRefresh Plugin
|
1701 |
+
* @version 2.1.0
|
1702 |
+
* @author Artus Kolanowski
|
1703 |
+
* @author David Deutsch
|
1704 |
+
* @license The MIT License (MIT)
|
1705 |
+
*/
|
1706 |
+
;(function($, window, document, undefined) {
|
1707 |
+
|
1708 |
+
/**
|
1709 |
+
* Creates the auto refresh plugin.
|
1710 |
+
* @class The Auto Refresh Plugin
|
1711 |
+
* @param {Owl} carousel - The Owl Carousel
|
1712 |
+
*/
|
1713 |
+
var AutoRefresh = function(carousel) {
|
1714 |
+
/**
|
1715 |
+
* Reference to the core.
|
1716 |
+
* @protected
|
1717 |
+
* @type {Owl}
|
1718 |
+
*/
|
1719 |
+
this._core = carousel;
|
1720 |
+
|
1721 |
+
/**
|
1722 |
+
* Refresh interval.
|
1723 |
+
* @protected
|
1724 |
+
* @type {number}
|
1725 |
+
*/
|
1726 |
+
this._interval = null;
|
1727 |
+
|
1728 |
+
/**
|
1729 |
+
* Whether the element is currently visible or not.
|
1730 |
+
* @protected
|
1731 |
+
* @type {Boolean}
|
1732 |
+
*/
|
1733 |
+
this._visible = null;
|
1734 |
+
|
1735 |
+
/**
|
1736 |
+
* All event handlers.
|
1737 |
+
* @protected
|
1738 |
+
* @type {Object}
|
1739 |
+
*/
|
1740 |
+
this._handlers = {
|
1741 |
+
'initialized.owl.carousel': $.proxy(function(e) {
|
1742 |
+
if (e.namespace && this._core.settings.autoRefresh) {
|
1743 |
+
this.watch();
|
1744 |
+
}
|
1745 |
+
}, this)
|
1746 |
+
};
|
1747 |
+
|
1748 |
+
// set default options
|
1749 |
+
this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
|
1750 |
+
|
1751 |
+
// register event handlers
|
1752 |
+
this._core.$element.on(this._handlers);
|
1753 |
+
};
|
1754 |
+
|
1755 |
+
/**
|
1756 |
+
* Default options.
|
1757 |
+
* @public
|
1758 |
+
*/
|
1759 |
+
AutoRefresh.Defaults = {
|
1760 |
+
autoRefresh: true,
|
1761 |
+
autoRefreshInterval: 500
|
1762 |
+
};
|
1763 |
+
|
1764 |
+
/**
|
1765 |
+
* Watches the element.
|
1766 |
+
*/
|
1767 |
+
AutoRefresh.prototype.watch = function() {
|
1768 |
+
if (this._interval) {
|
1769 |
+
return;
|
1770 |
+
}
|
1771 |
+
|
1772 |
+
this._visible = this._core.$element.is(':visible');
|
1773 |
+
this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
|
1774 |
+
};
|
1775 |
+
|
1776 |
+
/**
|
1777 |
+
* Refreshes the element.
|
1778 |
+
*/
|
1779 |
+
AutoRefresh.prototype.refresh = function() {
|
1780 |
+
if (this._core.$element.is(':visible') === this._visible) {
|
1781 |
+
return;
|
1782 |
+
}
|
1783 |
+
|
1784 |
+
this._visible = !this._visible;
|
1785 |
+
|
1786 |
+
this._core.$element.toggleClass('owl-hidden', !this._visible);
|
1787 |
+
|
1788 |
+
this._visible && (this._core.invalidate('width') && this._core.refresh());
|
1789 |
+
};
|
1790 |
+
|
1791 |
+
/**
|
1792 |
+
* Destroys the plugin.
|
1793 |
+
*/
|
1794 |
+
AutoRefresh.prototype.destroy = function() {
|
1795 |
+
var handler, property;
|
1796 |
+
|
1797 |
+
window.clearInterval(this._interval);
|
1798 |
+
|
1799 |
+
for (handler in this._handlers) {
|
1800 |
+
this._core.$element.off(handler, this._handlers[handler]);
|
1801 |
+
}
|
1802 |
+
for (property in Object.getOwnPropertyNames(this)) {
|
1803 |
+
typeof this[property] != 'function' && (this[property] = null);
|
1804 |
+
}
|
1805 |
+
};
|
1806 |
+
|
1807 |
+
$.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
|
1808 |
+
|
1809 |
+
})(window.Zepto || window.jQuery, window, document);
|
1810 |
+
|
1811 |
+
/**
|
1812 |
+
* Lazy Plugin
|
1813 |
+
* @version 2.1.0
|
1814 |
+
* @author Bartosz Wojciechowski
|
1815 |
+
* @author David Deutsch
|
1816 |
+
* @license The MIT License (MIT)
|
1817 |
+
*/
|
1818 |
+
;(function($, window, document, undefined) {
|
1819 |
+
|
1820 |
+
/**
|
1821 |
+
* Creates the lazy plugin.
|
1822 |
+
* @class The Lazy Plugin
|
1823 |
+
* @param {Owl} carousel - The Owl Carousel
|
1824 |
+
*/
|
1825 |
+
var Lazy = function(carousel) {
|
1826 |
+
|
1827 |
+
/**
|
1828 |
+
* Reference to the core.
|
1829 |
+
* @protected
|
1830 |
+
* @type {Owl}
|
1831 |
+
*/
|
1832 |
+
this._core = carousel;
|
1833 |
+
|
1834 |
+
/**
|
1835 |
+
* Already loaded items.
|
1836 |
+
* @protected
|
1837 |
+
* @type {Array.<jQuery>}
|
1838 |
+
*/
|
1839 |
+
this._loaded = [];
|
1840 |
+
|
1841 |
+
/**
|
1842 |
+
* Event handlers.
|
1843 |
+
* @protected
|
1844 |
+
* @type {Object}
|
1845 |
+
*/
|
1846 |
+
this._handlers = {
|
1847 |
+
'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
|
1848 |
+
if (!e.namespace) {
|
1849 |
+
return;
|
1850 |
+
}
|
1851 |
+
|
1852 |
+
if (!this._core.settings || !this._core.settings.lazyLoad) {
|
1853 |
+
return;
|
1854 |
+
}
|
1855 |
+
|
1856 |
+
if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
|
1857 |
+
var settings = this._core.settings,
|
1858 |
+
n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
|
1859 |
+
i = ((settings.center && n * -1) || 0),
|
1860 |
+
position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
|
1861 |
+
clones = this._core.clones().length,
|
1862 |
+
load = $.proxy(function(i, v) { this.load(v) }, this);
|
1863 |
+
|
1864 |
+
while (i++ < n) {
|
1865 |
+
this.load(clones / 2 + this._core.relative(position));
|
1866 |
+
clones && $.each(this._core.clones(this._core.relative(position)), load);
|
1867 |
+
position++;
|
1868 |
+
}
|
1869 |
+
}
|
1870 |
+
}, this)
|
1871 |
+
};
|
1872 |
+
|
1873 |
+
// set the default options
|
1874 |
+
this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
|
1875 |
+
|
1876 |
+
// register event handler
|
1877 |
+
this._core.$element.on(this._handlers);
|
1878 |
+
};
|
1879 |
+
|
1880 |
+
/**
|
1881 |
+
* Default options.
|
1882 |
+
* @public
|
1883 |
+
*/
|
1884 |
+
Lazy.Defaults = {
|
1885 |
+
lazyLoad: false
|
1886 |
+
};
|
1887 |
+
|
1888 |
+
/**
|
1889 |
+
* Loads all resources of an item at the specified position.
|
1890 |
+
* @param {Number} position - The absolute position of the item.
|
1891 |
+
* @protected
|
1892 |
+
*/
|
1893 |
+
Lazy.prototype.load = function(position) {
|
1894 |
+
var $item = this._core.$stage.children().eq(position),
|
1895 |
+
$elements = $item && $item.find('.owl-lazy');
|
1896 |
+
|
1897 |
+
if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
|
1898 |
+
return;
|
1899 |
+
}
|
1900 |
+
|
1901 |
+
$elements.each($.proxy(function(index, element) {
|
1902 |
+
var $element = $(element), image,
|
1903 |
+
url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src');
|
1904 |
+
|
1905 |
+
this._core.trigger('load', { element: $element, url: url }, 'lazy');
|
1906 |
+
|
1907 |
+
if ($element.is('img')) {
|
1908 |
+
$element.one('load.owl.lazy', $.proxy(function() {
|
1909 |
+
$element.css('opacity', 1);
|
1910 |
+
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
1911 |
+
}, this)).attr('src', url);
|
1912 |
+
} else {
|
1913 |
+
image = new Image();
|
1914 |
+
image.onload = $.proxy(function() {
|
1915 |
+
$element.css({
|
1916 |
+
'background-image': 'url("' + url + '")',
|
1917 |
+
'opacity': '1'
|
1918 |
+
});
|
1919 |
+
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
1920 |
+
}, this);
|
1921 |
+
image.src = url;
|
1922 |
+
}
|
1923 |
+
}, this));
|
1924 |
+
|
1925 |
+
this._loaded.push($item.get(0));
|
1926 |
+
};
|
1927 |
+
|
1928 |
+
/**
|
1929 |
+
* Destroys the plugin.
|
1930 |
+
* @public
|
1931 |
+
*/
|
1932 |
+
Lazy.prototype.destroy = function() {
|
1933 |
+
var handler, property;
|
1934 |
+
|
1935 |
+
for (handler in this.handlers) {
|
1936 |
+
this._core.$element.off(handler, this.handlers[handler]);
|
1937 |
+
}
|
1938 |
+
for (property in Object.getOwnPropertyNames(this)) {
|
1939 |
+
typeof this[property] != 'function' && (this[property] = null);
|
1940 |
+
}
|
1941 |
+
};
|
1942 |
+
|
1943 |
+
$.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
|
1944 |
+
|
1945 |
+
})(window.Zepto || window.jQuery, window, document);
|
1946 |
+
|
1947 |
+
/**
|
1948 |
+
* AutoHeight Plugin
|
1949 |
+
* @version 2.1.0
|
1950 |
+
* @author Bartosz Wojciechowski
|
1951 |
+
* @author David Deutsch
|
1952 |
+
* @license The MIT License (MIT)
|
1953 |
+
*/
|
1954 |
+
;(function($, window, document, undefined) {
|
1955 |
+
|
1956 |
+
/**
|
1957 |
+
* Creates the auto height plugin.
|
1958 |
+
* @class The Auto Height Plugin
|
1959 |
+
* @param {Owl} carousel - The Owl Carousel
|
1960 |
+
*/
|
1961 |
+
var AutoHeight = function(carousel) {
|
1962 |
+
/**
|
1963 |
+
* Reference to the core.
|
1964 |
+
* @protected
|
1965 |
+
* @type {Owl}
|
1966 |
+
*/
|
1967 |
+
this._core = carousel;
|
1968 |
+
|
1969 |
+
/**
|
1970 |
+
* All event handlers.
|
1971 |
+
* @protected
|
1972 |
+
* @type {Object}
|
1973 |
+
*/
|
1974 |
+
this._handlers = {
|
1975 |
+
'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
|
1976 |
+
if (e.namespace && this._core.settings.autoHeight) {
|
1977 |
+
this.update();
|
1978 |
+
}
|
1979 |
+
}, this),
|
1980 |
+
'changed.owl.carousel': $.proxy(function(e) {
|
1981 |
+
if (e.namespace && this._core.settings.autoHeight && e.property.name == 'position'){
|
1982 |
+
this.update();
|
1983 |
+
}
|
1984 |
+
}, this),
|
1985 |
+
'loaded.owl.lazy': $.proxy(function(e) {
|
1986 |
+
if (e.namespace && this._core.settings.autoHeight
|
1987 |
+
&& e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
|
1988 |
+
this.update();
|
1989 |
+
}
|
1990 |
+
}, this)
|
1991 |
+
};
|
1992 |
+
|
1993 |
+
// set default options
|
1994 |
+
this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
|
1995 |
+
|
1996 |
+
// register event handlers
|
1997 |
+
this._core.$element.on(this._handlers);
|
1998 |
+
};
|
1999 |
+
|
2000 |
+
/**
|
2001 |
+
* Default options.
|
2002 |
+
* @public
|
2003 |
+
*/
|
2004 |
+
AutoHeight.Defaults = {
|
2005 |
+
autoHeight: false,
|
2006 |
+
autoHeightClass: 'owl-height'
|
2007 |
+
};
|
2008 |
+
|
2009 |
+
/**
|
2010 |
+
* Updates the view.
|
2011 |
+
*/
|
2012 |
+
AutoHeight.prototype.update = function() {
|
2013 |
+
var start = this._core._current,
|
2014 |
+
end = start + this._core.settings.items,
|
2015 |
+
visible = this._core.$stage.children().toArray().slice(start, end),
|
2016 |
+
heights = [],
|
2017 |
+
maxheight = 0;
|
2018 |
+
|
2019 |
+
$.each(visible, function(index, item) {
|
2020 |
+
heights.push($(item).height());
|
2021 |
+
});
|
2022 |
+
|
2023 |
+
maxheight = Math.max.apply(null, heights);
|
2024 |
+
|
2025 |
+
this._core.$stage.parent()
|
2026 |
+
.height(maxheight)
|
2027 |
+
.addClass(this._core.settings.autoHeightClass);
|
2028 |
+
};
|
2029 |
+
|
2030 |
+
AutoHeight.prototype.destroy = function() {
|
2031 |
+
var handler, property;
|
2032 |
+
|
2033 |
+
for (handler in this._handlers) {
|
2034 |
+
this._core.$element.off(handler, this._handlers[handler]);
|
2035 |
+
}
|
2036 |
+
for (property in Object.getOwnPropertyNames(this)) {
|
2037 |
+
typeof this[property] != 'function' && (this[property] = null);
|
2038 |
+
}
|
2039 |
+
};
|
2040 |
+
|
2041 |
+
$.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
|
2042 |
+
|
2043 |
+
})(window.Zepto || window.jQuery, window, document);
|
2044 |
+
|
2045 |
+
/**
|
2046 |
+
* Video Plugin
|
2047 |
+
* @version 2.1.0
|
2048 |
+
* @author Bartosz Wojciechowski
|
2049 |
+
* @author David Deutsch
|
2050 |
+
* @license The MIT License (MIT)
|
2051 |
+
*/
|
2052 |
+
;(function($, window, document, undefined) {
|
2053 |
+
|
2054 |
+
/**
|
2055 |
+
* Creates the video plugin.
|
2056 |
+
* @class The Video Plugin
|
2057 |
+
* @param {Owl} carousel - The Owl Carousel
|
2058 |
+
*/
|
2059 |
+
var Video = function(carousel) {
|
2060 |
+
/**
|
2061 |
+
* Reference to the core.
|
2062 |
+
* @protected
|
2063 |
+
* @type {Owl}
|
2064 |
+
*/
|
2065 |
+
this._core = carousel;
|
2066 |
+
|
2067 |
+
/**
|
2068 |
+
* Cache all video URLs.
|
2069 |
+
* @protected
|
2070 |
+
* @type {Object}
|
2071 |
+
*/
|
2072 |
+
this._videos = {};
|
2073 |
+
|
2074 |
+
/**
|
2075 |
+
* Current playing item.
|
2076 |
+
* @protected
|
2077 |
+
* @type {jQuery}
|
2078 |
+
*/
|
2079 |
+
this._playing = null;
|
2080 |
+
|
2081 |
+
/**
|
2082 |
+
* All event handlers.
|
2083 |
+
* @todo The cloned content removale is too late
|
2084 |
+
* @protected
|
2085 |
+
* @type {Object}
|
2086 |
+
*/
|
2087 |
+
this._handlers = {
|
2088 |
+
'initialized.owl.carousel': $.proxy(function(e) {
|
2089 |
+
if (e.namespace) {
|
2090 |
+
this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
|
2091 |
+
}
|
2092 |
+
}, this),
|
2093 |
+
'resize.owl.carousel': $.proxy(function(e) {
|
2094 |
+
if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
|
2095 |
+
e.preventDefault();
|
2096 |
+
}
|
2097 |
+
}, this),
|
2098 |
+
'refreshed.owl.carousel': $.proxy(function(e) {
|
2099 |
+
if (e.namespace && this._core.is('resizing')) {
|
2100 |
+
this._core.$stage.find('.cloned .owl-video-frame').remove();
|
2101 |
+
}
|
2102 |
+
}, this),
|
2103 |
+
'changed.owl.carousel': $.proxy(function(e) {
|
2104 |
+
if (e.namespace && e.property.name === 'position' && this._playing) {
|
2105 |
+
this.stop();
|
2106 |
+
}
|
2107 |
+
}, this),
|
2108 |
+
'prepared.owl.carousel': $.proxy(function(e) {
|
2109 |
+
if (!e.namespace) {
|
2110 |
+
return;
|
2111 |
+
}
|
2112 |
+
|
2113 |
+
var $element = $(e.content).find('.owl-video');
|
2114 |
+
|
2115 |
+
if ($element.length) {
|
2116 |
+
$element.css('display', 'none');
|
2117 |
+
this.fetch($element, $(e.content));
|
2118 |
+
}
|
2119 |
+
}, this)
|
2120 |
+
};
|
2121 |
+
|
2122 |
+
// set default options
|
2123 |
+
this._core.options = $.extend({}, Video.Defaults, this._core.options);
|
2124 |
+
|
2125 |
+
// register event handlers
|
2126 |
+
this._core.$element.on(this._handlers);
|
2127 |
+
|
2128 |
+
this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
|
2129 |
+
this.play(e);
|
2130 |
+
}, this));
|
2131 |
+
};
|
2132 |
+
|
2133 |
+
/**
|
2134 |
+
* Default options.
|
2135 |
+
* @public
|
2136 |
+
*/
|
2137 |
+
Video.Defaults = {
|
2138 |
+
video: false,
|
2139 |
+
videoHeight: false,
|
2140 |
+
videoWidth: false
|
2141 |
+
};
|
2142 |
+
|
2143 |
+
/**
|
2144 |
+
* Gets the video ID and the type (YouTube/Vimeo/vzaar only).
|
2145 |
+
* @protected
|
2146 |
+
* @param {jQuery} target - The target containing the video data.
|
2147 |
+
* @param {jQuery} item - The item containing the video.
|
2148 |
+
*/
|
2149 |
+
Video.prototype.fetch = function(target, item) {
|
2150 |
+
var type = (function() {
|
2151 |
+
if (target.attr('data-vimeo-id')) {
|
2152 |
+
return 'vimeo';
|
2153 |
+
} else if (target.attr('data-vzaar-id')) {
|
2154 |
+
return 'vzaar'
|
2155 |
+
} else {
|
2156 |
+
return 'youtube';
|
2157 |
+
}
|
2158 |
+
})(),
|
2159 |
+
id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
|
2160 |
+
width = target.attr('data-width') || this._core.settings.videoWidth,
|
2161 |
+
height = target.attr('data-height') || this._core.settings.videoHeight,
|
2162 |
+
url = target.attr('href');
|
2163 |
+
|
2164 |
+
if (url) {
|
2165 |
+
|
2166 |
+
/*
|
2167 |
+
Parses the id's out of the following urls (and probably more):
|
2168 |
+
https://www.youtube.com/watch?v=:id
|
2169 |
+
https://youtu.be/:id
|
2170 |
+
https://vimeo.com/:id
|
2171 |
+
https://vimeo.com/channels/:channel/:id
|
2172 |
+
https://vimeo.com/groups/:group/videos/:id
|
2173 |
+
https://app.vzaar.com/videos/:id
|
2174 |
+
|
2175 |
+
Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F
|
2176 |
+
*/
|
2177 |
+
|
2178 |
+
id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
|
2179 |
+
|
2180 |
+
if (id[3].indexOf('youtu') > -1) {
|
2181 |
+
type = 'youtube';
|
2182 |
+
} else if (id[3].indexOf('vimeo') > -1) {
|
2183 |
+
type = 'vimeo';
|
2184 |
+
} else if (id[3].indexOf('vzaar') > -1) {
|
2185 |
+
type = 'vzaar';
|
2186 |
+
} else {
|
2187 |
+
throw new Error('Video URL not supported.');
|
2188 |
+
}
|
2189 |
+
id = id[6];
|
2190 |
+
} else {
|
2191 |
+
throw new Error('Missing video URL.');
|
2192 |
+
}
|
2193 |
+
|
2194 |
+
this._videos[url] = {
|
2195 |
+
type: type,
|
2196 |
+
id: id,
|
2197 |
+
width: width,
|
2198 |
+
height: height
|
2199 |
+
};
|
2200 |
+
|
2201 |
+
item.attr('data-video', url);
|
2202 |
+
|
2203 |
+
this.thumbnail(target, this._videos[url]);
|
2204 |
+
};
|
2205 |
+
|
2206 |
+
/**
|
2207 |
+
* Creates video thumbnail.
|
2208 |
+
* @protected
|
2209 |
+
* @param {jQuery} target - The target containing the video data.
|
2210 |
+
* @param {Object} info - The video info object.
|
2211 |
+
* @see `fetch`
|
2212 |
+
*/
|
2213 |
+
Video.prototype.thumbnail = function(target, video) {
|
2214 |
+
var tnLink,
|
2215 |
+
icon,
|
2216 |
+
path,
|
2217 |
+
dimensions = video.width && video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"' : '',
|
2218 |
+
customTn = target.find('img'),
|
2219 |
+
srcType = 'src',
|
2220 |
+
lazyClass = '',
|
2221 |
+
settings = this._core.settings,
|
2222 |
+
create = function(path) {
|
2223 |
+
icon = '<div class="owl-video-play-icon"></div>';
|
2224 |
+
|
2225 |
+
if (settings.lazyLoad) {
|
2226 |
+
tnLink = '<div class="owl-video-tn ' + lazyClass + '" ' + srcType + '="' + path + '"></div>';
|
2227 |
+
} else {
|
2228 |
+
tnLink = '<div class="owl-video-tn" style="opacity:1;background-image:url(' + path + ')"></div>';
|
2229 |
+
}
|
2230 |
+
target.after(tnLink);
|
2231 |
+
target.after(icon);
|
2232 |
+
};
|
2233 |
+
|
2234 |
+
// wrap video content into owl-video-wrapper div
|
2235 |
+
target.wrap('<div class="owl-video-wrapper"' + dimensions + '></div>');
|
2236 |
+
|
2237 |
+
if (this._core.settings.lazyLoad) {
|
2238 |
+
srcType = 'data-src';
|
2239 |
+
lazyClass = 'owl-lazy';
|
2240 |
+
}
|
2241 |
+
|
2242 |
+
// custom thumbnail
|
2243 |
+
if (customTn.length) {
|
2244 |
+
create(customTn.attr(srcType));
|
2245 |
+
customTn.remove();
|
2246 |
+
return false;
|
2247 |
+
}
|
2248 |
+
|
2249 |
+
if (video.type === 'youtube') {
|
2250 |
+
path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
|
2251 |
+
create(path);
|
2252 |
+
} else if (video.type === 'vimeo') {
|
2253 |
+
$.ajax({
|
2254 |
+
type: 'GET',
|
2255 |
+
url: '//vimeo.com/api/v2/video/' + video.id + '.json',
|
2256 |
+
jsonp: 'callback',
|
2257 |
+
dataType: 'jsonp',
|
2258 |
+
success: function(data) {
|
2259 |
+
path = data[0].thumbnail_large;
|
2260 |
+
create(path);
|
2261 |
+
}
|
2262 |
+
});
|
2263 |
+
} else if (video.type === 'vzaar') {
|
2264 |
+
$.ajax({
|
2265 |
+
type: 'GET',
|
2266 |
+
url: '//vzaar.com/api/videos/' + video.id + '.json',
|
2267 |
+
jsonp: 'callback',
|
2268 |
+
dataType: 'jsonp',
|
2269 |
+
success: function(data) {
|
2270 |
+
path = data.framegrab_url;
|
2271 |
+
create(path);
|
2272 |
+
}
|
2273 |
+
});
|
2274 |
+
}
|
2275 |
+
};
|
2276 |
+
|
2277 |
+
/**
|
2278 |
+
* Stops the current video.
|
2279 |
+
* @public
|
2280 |
+
*/
|
2281 |
+
Video.prototype.stop = function() {
|
2282 |
+
this._core.trigger('stop', null, 'video');
|
2283 |
+
this._playing.find('.owl-video-frame').remove();
|
2284 |
+
this._playing.removeClass('owl-video-playing');
|
2285 |
+
this._playing = null;
|
2286 |
+
this._core.leave('playing');
|
2287 |
+
this._core.trigger('stopped', null, 'video');
|
2288 |
+
};
|
2289 |
+
|
2290 |
+
/**
|
2291 |
+
* Starts the current video.
|
2292 |
+
* @public
|
2293 |
+
* @param {Event} event - The event arguments.
|
2294 |
+
*/
|
2295 |
+
Video.prototype.play = function(event) {
|
2296 |
+
var target = $(event.target),
|
2297 |
+
item = target.closest('.' + this._core.settings.itemClass),
|
2298 |
+
video = this._videos[item.attr('data-video')],
|
2299 |
+
width = video.width || '100%',
|
2300 |
+
height = video.height || this._core.$stage.height(),
|
2301 |
+
html;
|
2302 |
+
|
2303 |
+
if (this._playing) {
|
2304 |
+
return;
|
2305 |
+
}
|
2306 |
+
|
2307 |
+
this._core.enter('playing');
|
2308 |
+
this._core.trigger('play', null, 'video');
|
2309 |
+
|
2310 |
+
item = this._core.items(this._core.relative(item.index()));
|
2311 |
+
|
2312 |
+
this._core.reset(item.index());
|
2313 |
+
|
2314 |
+
if (video.type === 'youtube') {
|
2315 |
+
html = '<iframe width="' + width + '" height="' + height + '" src="//www.youtube.com/embed/' +
|
2316 |
+
video.id + '?autoplay=1&rel=0&v=' + video.id + '" frameborder="0" allowfullscreen></iframe>';
|
2317 |
+
} else if (video.type === 'vimeo') {
|
2318 |
+
html = '<iframe src="//player.vimeo.com/video/' + video.id +
|
2319 |
+
'?autoplay=1" width="' + width + '" height="' + height +
|
2320 |
+
'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
|
2321 |
+
} else if (video.type === 'vzaar') {
|
2322 |
+
html = '<iframe frameborder="0"' + 'height="' + height + '"' + 'width="' + width +
|
2323 |
+
'" allowfullscreen mozallowfullscreen webkitAllowFullScreen ' +
|
2324 |
+
'src="//view.vzaar.com/' + video.id + '/player?autoplay=true"></iframe>';
|
2325 |
+
}
|
2326 |
+
|
2327 |
+
$('<div class="owl-video-frame">' + html + '</div>').insertAfter(item.find('.owl-video'));
|
2328 |
+
|
2329 |
+
this._playing = item.addClass('owl-video-playing');
|
2330 |
+
};
|
2331 |
+
|
2332 |
+
/**
|
2333 |
+
* Checks whether an video is currently in full screen mode or not.
|
2334 |
+
* @todo Bad style because looks like a readonly method but changes members.
|
2335 |
+
* @protected
|
2336 |
+
* @returns {Boolean}
|
2337 |
+
*/
|
2338 |
+
Video.prototype.isInFullScreen = function() {
|
2339 |
+
var element = document.fullscreenElement || document.mozFullScreenElement ||
|
2340 |
+
document.webkitFullscreenElement;
|
2341 |
+
|
2342 |
+
return element && $(element).parent().hasClass('owl-video-frame');
|
2343 |
+
};
|
2344 |
+
|
2345 |
+
/**
|
2346 |
+
* Destroys the plugin.
|
2347 |
+
*/
|
2348 |
+
Video.prototype.destroy = function() {
|
2349 |
+
var handler, property;
|
2350 |
+
|
2351 |
+
this._core.$element.off('click.owl.video');
|
2352 |
+
|
2353 |
+
for (handler in this._handlers) {
|
2354 |
+
this._core.$element.off(handler, this._handlers[handler]);
|
2355 |
+
}
|
2356 |
+
for (property in Object.getOwnPropertyNames(this)) {
|
2357 |
+
typeof this[property] != 'function' && (this[property] = null);
|
2358 |
+
}
|
2359 |
+
};
|
2360 |
+
|
2361 |
+
$.fn.owlCarousel.Constructor.Plugins.Video = Video;
|
2362 |
+
|
2363 |
+
})(window.Zepto || window.jQuery, window, document);
|
2364 |
+
|
2365 |
+
/**
|
2366 |
+
* Animate Plugin
|
2367 |
+
* @version 2.1.0
|
2368 |
+
* @author Bartosz Wojciechowski
|
2369 |
+
* @author David Deutsch
|
2370 |
+
* @license The MIT License (MIT)
|
2371 |
+
*/
|
2372 |
+
;(function($, window, document, undefined) {
|
2373 |
+
|
2374 |
+
/**
|
2375 |
+
* Creates the animate plugin.
|
2376 |
+
* @class The Navigation Plugin
|
2377 |
+
* @param {Owl} scope - The Owl Carousel
|
2378 |
+
*/
|
2379 |
+
var Animate = function(scope) {
|
2380 |
+
this.core = scope;
|
2381 |
+
this.core.options = $.extend({}, Animate.Defaults, this.core.options);
|
2382 |
+
this.swapping = true;
|
2383 |
+
this.previous = undefined;
|
2384 |
+
this.next = undefined;
|
2385 |
+
|
2386 |
+
this.handlers = {
|
2387 |
+
'change.owl.carousel': $.proxy(function(e) {
|
2388 |
+
if (e.namespace && e.property.name == 'position') {
|
2389 |
+
this.previous = this.core.current();
|
2390 |
+
this.next = e.property.value;
|
2391 |
+
}
|
2392 |
+
}, this),
|
2393 |
+
'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
|
2394 |
+
if (e.namespace) {
|
2395 |
+
this.swapping = e.type == 'translated';
|
2396 |
+
}
|
2397 |
+
}, this),
|
2398 |
+
'translate.owl.carousel': $.proxy(function(e) {
|
2399 |
+
if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
|
2400 |
+
this.swap();
|
2401 |
+
}
|
2402 |
+
}, this)
|
2403 |
+
};
|
2404 |
+
|
2405 |
+
this.core.$element.on(this.handlers);
|
2406 |
+
};
|
2407 |
+
|
2408 |
+
/**
|
2409 |
+
* Default options.
|
2410 |
+
* @public
|
2411 |
+
*/
|
2412 |
+
Animate.Defaults = {
|
2413 |
+
animateOut: false,
|
2414 |
+
animateIn: false
|
2415 |
+
};
|
2416 |
+
|
2417 |
+
/**
|
2418 |
+
* Toggles the animation classes whenever an translations starts.
|
2419 |
+
* @protected
|
2420 |
+
* @returns {Boolean|undefined}
|
2421 |
+
*/
|
2422 |
+
Animate.prototype.swap = function() {
|
2423 |
+
|
2424 |
+
if (this.core.settings.items !== 1) {
|
2425 |
+
return;
|
2426 |
+
}
|
2427 |
+
|
2428 |
+
if (!$.support.animation || !$.support.transition) {
|
2429 |
+
return;
|
2430 |
+
}
|
2431 |
+
|
2432 |
+
this.core.speed(0);
|
2433 |
+
|
2434 |
+
var left,
|
2435 |
+
clear = $.proxy(this.clear, this),
|
2436 |
+
previous = this.core.$stage.children().eq(this.previous),
|
2437 |
+
next = this.core.$stage.children().eq(this.next),
|
2438 |
+
incoming = this.core.settings.animateIn,
|
2439 |
+
outgoing = this.core.settings.animateOut;
|
2440 |
+
|
2441 |
+
if (this.core.current() === this.previous) {
|
2442 |
+
return;
|
2443 |
+
}
|
2444 |
+
|
2445 |
+
if (outgoing) {
|
2446 |
+
left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
|
2447 |
+
previous.one($.support.animation.end, clear)
|
2448 |
+
.css( { 'left': left + 'px' } )
|
2449 |
+
.addClass('animated owl-animated-out')
|
2450 |
+
.addClass(outgoing);
|
2451 |
+
}
|
2452 |
+
|
2453 |
+
if (incoming) {
|
2454 |
+
next.one($.support.animation.end, clear)
|
2455 |
+
.addClass('animated owl-animated-in')
|
2456 |
+
.addClass(incoming);
|
2457 |
+
}
|
2458 |
+
};
|
2459 |
+
|
2460 |
+
Animate.prototype.clear = function(e) {
|
2461 |
+
$(e.target).css( { 'left': '' } )
|
2462 |
+
.removeClass('animated owl-animated-out owl-animated-in')
|
2463 |
+
.removeClass(this.core.settings.animateIn)
|
2464 |
+
.removeClass(this.core.settings.animateOut);
|
2465 |
+
this.core.onTransitionEnd();
|
2466 |
+
};
|
2467 |
+
|
2468 |
+
/**
|
2469 |
+
* Destroys the plugin.
|
2470 |
+
* @public
|
2471 |
+
*/
|
2472 |
+
Animate.prototype.destroy = function() {
|
2473 |
+
var handler, property;
|
2474 |
+
|
2475 |
+
for (handler in this.handlers) {
|
2476 |
+
this.core.$element.off(handler, this.handlers[handler]);
|
2477 |
+
}
|
2478 |
+
for (property in Object.getOwnPropertyNames(this)) {
|
2479 |
+
typeof this[property] != 'function' && (this[property] = null);
|
2480 |
+
}
|
2481 |
+
};
|
2482 |
+
|
2483 |
+
$.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
|
2484 |
+
|
2485 |
+
})(window.Zepto || window.jQuery, window, document);
|
2486 |
+
|
2487 |
+
/**
|
2488 |
+
* Autoplay Plugin
|
2489 |
+
* @version 2.1.0
|
2490 |
+
* @author Bartosz Wojciechowski
|
2491 |
+
* @author Artus Kolanowski
|
2492 |
+
* @author David Deutsch
|
2493 |
+
* @license The MIT License (MIT)
|
2494 |
+
*/
|
2495 |
+
;(function($, window, document, undefined) {
|
2496 |
+
|
2497 |
+
/**
|
2498 |
+
* Creates the autoplay plugin.
|
2499 |
+
* @class The Autoplay Plugin
|
2500 |
+
* @param {Owl} scope - The Owl Carousel
|
2501 |
+
*/
|
2502 |
+
var Autoplay = function(carousel) {
|
2503 |
+
/**
|
2504 |
+
* Reference to the core.
|
2505 |
+
* @protected
|
2506 |
+
* @type {Owl}
|
2507 |
+
*/
|
2508 |
+
this._core = carousel;
|
2509 |
+
|
2510 |
+
/**
|
2511 |
+
* The autoplay timeout.
|
2512 |
+
* @type {Timeout}
|
2513 |
+
*/
|
2514 |
+
this._timeout = null;
|
2515 |
+
|
2516 |
+
/**
|
2517 |
+
* Indicates whenever the autoplay is paused.
|
2518 |
+
* @type {Boolean}
|
2519 |
+
*/
|
2520 |
+
this._paused = false;
|
2521 |
+
|
2522 |
+
/**
|
2523 |
+
* All event handlers.
|
2524 |
+
* @protected
|
2525 |
+
* @type {Object}
|
2526 |
+
*/
|
2527 |
+
this._handlers = {
|
2528 |
+
'changed.owl.carousel': $.proxy(function(e) {
|
2529 |
+
if (e.namespace && e.property.name === 'settings') {
|
2530 |
+
if (this._core.settings.autoplay) {
|
2531 |
+
this.play();
|
2532 |
+
} else {
|
2533 |
+
this.stop();
|
2534 |
+
}
|
2535 |
+
} else if (e.namespace && e.property.name === 'position') {
|
2536 |
+
//console.log('play?', e);
|
2537 |
+
if (this._core.settings.autoplay) {
|
2538 |
+
this._setAutoPlayInterval();
|
2539 |
+
}
|
2540 |
+
}
|
2541 |
+
}, this),
|
2542 |
+
'initialized.owl.carousel': $.proxy(function(e) {
|
2543 |
+
if (e.namespace && this._core.settings.autoplay) {
|
2544 |
+
this.play();
|
2545 |
+
}
|
2546 |
+
}, this),
|
2547 |
+
'play.owl.autoplay': $.proxy(function(e, t, s) {
|
2548 |
+
if (e.namespace) {
|
2549 |
+
this.play(t, s);
|
2550 |
+
}
|
2551 |
+
}, this),
|
2552 |
+
'stop.owl.autoplay': $.proxy(function(e) {
|
2553 |
+
if (e.namespace) {
|
2554 |
+
this.stop();
|
2555 |
+
}
|
2556 |
+
}, this),
|
2557 |
+
'mouseover.owl.autoplay': $.proxy(function() {
|
2558 |
+
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
2559 |
+
this.pause();
|
2560 |
+
}
|
2561 |
+
}, this),
|
2562 |
+
'mouseleave.owl.autoplay': $.proxy(function() {
|
2563 |
+
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
2564 |
+
this.play();
|
2565 |
+
}
|
2566 |
+
}, this),
|
2567 |
+
'touchstart.owl.core': $.proxy(function() {
|
2568 |
+
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
2569 |
+
this.pause();
|
2570 |
+
}
|
2571 |
+
}, this),
|
2572 |
+
'touchend.owl.core': $.proxy(function() {
|
2573 |
+
if (this._core.settings.autoplayHoverPause) {
|
2574 |
+
this.play();
|
2575 |
+
}
|
2576 |
+
}, this)
|
2577 |
+
};
|
2578 |
+
|
2579 |
+
// register event handlers
|
2580 |
+
this._core.$element.on(this._handlers);
|
2581 |
+
|
2582 |
+
// set default options
|
2583 |
+
this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
|
2584 |
+
};
|
2585 |
+
|
2586 |
+
/**
|
2587 |
+
* Default options.
|
2588 |
+
* @public
|
2589 |
+
*/
|
2590 |
+
Autoplay.Defaults = {
|
2591 |
+
autoplay: false,
|
2592 |
+
autoplayTimeout: 5000,
|
2593 |
+
autoplayHoverPause: false,
|
2594 |
+
autoplaySpeed: false
|
2595 |
+
};
|
2596 |
+
|
2597 |
+
/**
|
2598 |
+
* Starts the autoplay.
|
2599 |
+
* @public
|
2600 |
+
* @param {Number} [timeout] - The interval before the next animation starts.
|
2601 |
+
* @param {Number} [speed] - The animation speed for the animations.
|
2602 |
+
*/
|
2603 |
+
Autoplay.prototype.play = function(timeout, speed) {
|
2604 |
+
this._paused = false;
|
2605 |
+
|
2606 |
+
if (this._core.is('rotating')) {
|
2607 |
+
return;
|
2608 |
+
}
|
2609 |
+
|
2610 |
+
this._core.enter('rotating');
|
2611 |
+
|
2612 |
+
this._setAutoPlayInterval();
|
2613 |
+
};
|
2614 |
+
|
2615 |
+
/**
|
2616 |
+
* Gets a new timeout
|
2617 |
+
* @private
|
2618 |
+
* @param {Number} [timeout] - The interval before the next animation starts.
|
2619 |
+
* @param {Number} [speed] - The animation speed for the animations.
|
2620 |
+
* @return {Timeout}
|
2621 |
+
*/
|
2622 |
+
Autoplay.prototype._getNextTimeout = function(timeout, speed) {
|
2623 |
+
if ( this._timeout ) {
|
2624 |
+
window.clearTimeout(this._timeout);
|
2625 |
+
}
|
2626 |
+
return window.setTimeout($.proxy(function() {
|
2627 |
+
if (this._paused || this._core.is('busy') || this._core.is('interacting') || document.hidden) {
|
2628 |
+
return;
|
2629 |
+
}
|
2630 |
+
this._core.next(speed || this._core.settings.autoplaySpeed);
|
2631 |
+
}, this), timeout || this._core.settings.autoplayTimeout);
|
2632 |
+
};
|
2633 |
+
|
2634 |
+
/**
|
2635 |
+
* Sets autoplay in motion.
|
2636 |
+
* @private
|
2637 |
+
*/
|
2638 |
+
Autoplay.prototype._setAutoPlayInterval = function() {
|
2639 |
+
this._timeout = this._getNextTimeout();
|
2640 |
+
};
|
2641 |
+
|
2642 |
+
/**
|
2643 |
+
* Stops the autoplay.
|
2644 |
+
* @public
|
2645 |
+
*/
|
2646 |
+
Autoplay.prototype.stop = function() {
|
2647 |
+
if (!this._core.is('rotating')) {
|
2648 |
+
return;
|
2649 |
+
}
|
2650 |
+
|
2651 |
+
window.clearTimeout(this._timeout);
|
2652 |
+
this._core.leave('rotating');
|
2653 |
+
};
|
2654 |
+
|
2655 |
+
/**
|
2656 |
+
* Stops the autoplay.
|
2657 |
+
* @public
|
2658 |
+
*/
|
2659 |
+
Autoplay.prototype.pause = function() {
|
2660 |
+
if (!this._core.is('rotating')) {
|
2661 |
+
return;
|
2662 |
+
}
|
2663 |
+
|
2664 |
+
this._paused = true;
|
2665 |
+
};
|
2666 |
+
|
2667 |
+
/**
|
2668 |
+
* Destroys the plugin.
|
2669 |
+
*/
|
2670 |
+
Autoplay.prototype.destroy = function() {
|
2671 |
+
var handler, property;
|
2672 |
+
|
2673 |
+
this.stop();
|
2674 |
+
|
2675 |
+
for (handler in this._handlers) {
|
2676 |
+
this._core.$element.off(handler, this._handlers[handler]);
|
2677 |
+
}
|
2678 |
+
for (property in Object.getOwnPropertyNames(this)) {
|
2679 |
+
typeof this[property] != 'function' && (this[property] = null);
|
2680 |
+
}
|
2681 |
+
};
|
2682 |
+
|
2683 |
+
$.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
|
2684 |
+
|
2685 |
+
})(window.Zepto || window.jQuery, window, document);
|
2686 |
+
|
2687 |
+
/**
|
2688 |
+
* Navigation Plugin
|
2689 |
+
* @version 2.1.0
|
2690 |
+
* @author Artus Kolanowski
|
2691 |
+
* @author David Deutsch
|
2692 |
+
* @license The MIT License (MIT)
|
2693 |
+
*/
|
2694 |
+
;(function($, window, document, undefined) {
|
2695 |
+
'use strict';
|
2696 |
+
|
2697 |
+
/**
|
2698 |
+
* Creates the navigation plugin.
|
2699 |
+
* @class The Navigation Plugin
|
2700 |
+
* @param {Owl} carousel - The Owl Carousel.
|
2701 |
+
*/
|
2702 |
+
var Navigation = function(carousel) {
|
2703 |
+
/**
|
2704 |
+
* Reference to the core.
|
2705 |
+
* @protected
|
2706 |
+
* @type {Owl}
|
2707 |
+
*/
|
2708 |
+
this._core = carousel;
|
2709 |
+
|
2710 |
+
/**
|
2711 |
+
* Indicates whether the plugin is initialized or not.
|
2712 |
+
* @protected
|
2713 |
+
* @type {Boolean}
|
2714 |
+
*/
|
2715 |
+
this._initialized = false;
|
2716 |
+
|
2717 |
+
/**
|
2718 |
+
* The current paging indexes.
|
2719 |
+
* @protected
|
2720 |
+
* @type {Array}
|
2721 |
+
*/
|
2722 |
+
this._pages = [];
|
2723 |
+
|
2724 |
+
/**
|
2725 |
+
* All DOM elements of the user interface.
|
2726 |
+
* @protected
|
2727 |
+
* @type {Object}
|
2728 |
+
*/
|
2729 |
+
this._controls = {};
|
2730 |
+
|
2731 |
+
/**
|
2732 |
+
* Markup for an indicator.
|
2733 |
+
* @protected
|
2734 |
+
* @type {Array.<String>}
|
2735 |
+
*/
|
2736 |
+
this._templates = [];
|
2737 |
+
|
2738 |
+
/**
|
2739 |
+
* The carousel element.
|
2740 |
+
* @type {jQuery}
|
2741 |
+
*/
|
2742 |
+
this.$element = this._core.$element;
|
2743 |
+
|
2744 |
+
/**
|
2745 |
+
* Overridden methods of the carousel.
|
2746 |
+
* @protected
|
2747 |
+
* @type {Object}
|
2748 |
+
*/
|
2749 |
+
this._overrides = {
|
2750 |
+
next: this._core.next,
|
2751 |
+
prev: this._core.prev,
|
2752 |
+
to: this._core.to
|
2753 |
+
};
|
2754 |
+
|
2755 |
+
/**
|
2756 |
+
* All event handlers.
|
2757 |
+
* @protected
|
2758 |
+
* @type {Object}
|
2759 |
+
*/
|
2760 |
+
this._handlers = {
|
2761 |
+
'prepared.owl.carousel': $.proxy(function(e) {
|
2762 |
+
if (e.namespace && this._core.settings.dotsData) {
|
2763 |
+
this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
|
2764 |
+
$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
|
2765 |
+
}
|
2766 |
+
}, this),
|
2767 |
+
'added.owl.carousel': $.proxy(function(e) {
|
2768 |
+
if (e.namespace && this._core.settings.dotsData) {
|
2769 |
+
this._templates.splice(e.position, 0, this._templates.pop());
|
2770 |
+
}
|
2771 |
+
}, this),
|
2772 |
+
'remove.owl.carousel': $.proxy(function(e) {
|
2773 |
+
if (e.namespace && this._core.settings.dotsData) {
|
2774 |
+
this._templates.splice(e.position, 1);
|
2775 |
+
}
|
2776 |
+
}, this),
|
2777 |
+
'changed.owl.carousel': $.proxy(function(e) {
|
2778 |
+
if (e.namespace && e.property.name == 'position') {
|
2779 |
+
this.draw();
|
2780 |
+
}
|
2781 |
+
}, this),
|
2782 |
+
'initialized.owl.carousel': $.proxy(function(e) {
|
2783 |
+
if (e.namespace && !this._initialized) {
|
2784 |
+
this._core.trigger('initialize', null, 'navigation');
|
2785 |
+
this.initialize();
|
2786 |
+
this.update();
|
2787 |
+
this.draw();
|
2788 |
+
this._initialized = true;
|
2789 |
+
this._core.trigger('initialized', null, 'navigation');
|
2790 |
+
}
|
2791 |
+
}, this),
|
2792 |
+
'refreshed.owl.carousel': $.proxy(function(e) {
|
2793 |
+
if (e.namespace && this._initialized) {
|
2794 |
+
this._core.trigger('refresh', null, 'navigation');
|
2795 |
+
this.update();
|
2796 |
+
this.draw();
|
2797 |
+
this._core.trigger('refreshed', null, 'navigation');
|
2798 |
+
}
|
2799 |
+
}, this)
|
2800 |
+
};
|
2801 |
+
|
2802 |
+
// set default options
|
2803 |
+
this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
|
2804 |
+
|
2805 |
+
// register event handlers
|
2806 |
+
this.$element.on(this._handlers);
|
2807 |
+
};
|
2808 |
+
|
2809 |
+
/**
|
2810 |
+
* Default options.
|
2811 |
+
* @public
|
2812 |
+
* @todo Rename `slideBy` to `navBy`
|
2813 |
+
*/
|
2814 |
+
Navigation.Defaults = {
|
2815 |
+
nav: false,
|
2816 |
+
navText: [ 'prev', 'next' ],
|
2817 |
+
navSpeed: false,
|
2818 |
+
navElement: 'div',
|
2819 |
+
navContainer: false,
|
2820 |
+
navContainerClass: 'owl-nav',
|
2821 |
+
navClass: [ 'owl-prev', 'owl-next' ],
|
2822 |
+
slideBy: 1,
|
2823 |
+
dotClass: 'owl-dot',
|
2824 |
+
dotsClass: 'owl-dots',
|
2825 |
+
dots: true,
|
2826 |
+
dotsEach: false,
|
2827 |
+
dotsData: false,
|
2828 |
+
dotsSpeed: false,
|
2829 |
+
dotsContainer: false
|
2830 |
+
};
|
2831 |
+
|
2832 |
+
/**
|
2833 |
+
* Initializes the layout of the plugin and extends the carousel.
|
2834 |
+
* @protected
|
2835 |
+
*/
|
2836 |
+
Navigation.prototype.initialize = function() {
|
2837 |
+
var override,
|
2838 |
+
settings = this._core.settings;
|
2839 |
+
|
2840 |
+
// create DOM structure for relative navigation
|
2841 |
+
this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
|
2842 |
+
: $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
|
2843 |
+
|
2844 |
+
this._controls.$previous = $('<' + settings.navElement + '>')
|
2845 |
+
.addClass(settings.navClass[0])
|
2846 |
+
.html(settings.navText[0])
|
2847 |
+
.prependTo(this._controls.$relative)
|
2848 |
+
.on('click', $.proxy(function(e) {
|
2849 |
+
this.prev(settings.navSpeed);
|
2850 |
+
}, this));
|
2851 |
+
this._controls.$next = $('<' + settings.navElement + '>')
|
2852 |
+
.addClass(settings.navClass[1])
|
2853 |
+
.html(settings.navText[1])
|
2854 |
+
.appendTo(this._controls.$relative)
|
2855 |
+
.on('click', $.proxy(function(e) {
|
2856 |
+
this.next(settings.navSpeed);
|
2857 |
+
}, this));
|
2858 |
+
|
2859 |
+
// create DOM structure for absolute navigation
|
2860 |
+
if (!settings.dotsData) {
|
2861 |
+
this._templates = [ $('<div>')
|
2862 |
+
.addClass(settings.dotClass)
|
2863 |
+
.append($('<span>'))
|
2864 |
+
.prop('outerHTML') ];
|
2865 |
+
}
|
2866 |
+
|
2867 |
+
this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
|
2868 |
+
: $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
|
2869 |
+
|
2870 |
+
this._controls.$absolute.on('click', 'div', $.proxy(function(e) {
|
2871 |
+
var index = $(e.target).parent().is(this._controls.$absolute)
|
2872 |
+
? $(e.target).index() : $(e.target).parent().index();
|
2873 |
+
|
2874 |
+
e.preventDefault();
|
2875 |
+
|
2876 |
+
this.to(index, settings.dotsSpeed);
|
2877 |
+
}, this));
|
2878 |
+
|
2879 |
+
// override public methods of the carousel
|
2880 |
+
for (override in this._overrides) {
|
2881 |
+
this._core[override] = $.proxy(this[override], this);
|
2882 |
+
}
|
2883 |
+
};
|
2884 |
+
|
2885 |
+
/**
|
2886 |
+
* Destroys the plugin.
|
2887 |
+
* @protected
|
2888 |
+
*/
|
2889 |
+
Navigation.prototype.destroy = function() {
|
2890 |
+
var handler, control, property, override;
|
2891 |
+
|
2892 |
+
for (handler in this._handlers) {
|
2893 |
+
this.$element.off(handler, this._handlers[handler]);
|
2894 |
+
}
|
2895 |
+
for (control in this._controls) {
|
2896 |
+
this._controls[control].remove();
|
2897 |
+
}
|
2898 |
+
for (override in this.overides) {
|
2899 |
+
this._core[override] = this._overrides[override];
|
2900 |
+
}
|
2901 |
+
for (property in Object.getOwnPropertyNames(this)) {
|
2902 |
+
typeof this[property] != 'function' && (this[property] = null);
|
2903 |
+
}
|
2904 |
+
};
|
2905 |
+
|
2906 |
+
/**
|
2907 |
+
* Updates the internal state.
|
2908 |
+
* @protected
|
2909 |
+
*/
|
2910 |
+
Navigation.prototype.update = function() {
|
2911 |
+
var i, j, k,
|
2912 |
+
lower = this._core.clones().length / 2,
|
2913 |
+
upper = lower + this._core.items().length,
|
2914 |
+
maximum = this._core.maximum(true),
|
2915 |
+
settings = this._core.settings,
|
2916 |
+
size = settings.center || settings.autoWidth || settings.dotsData
|
2917 |
+
? 1 : settings.dotsEach || settings.items;
|
2918 |
+
|
2919 |
+
if (settings.slideBy !== 'page') {
|
2920 |
+
settings.slideBy = Math.min(settings.slideBy, settings.items);
|
2921 |
+
}
|
2922 |
+
|
2923 |
+
if (settings.dots || settings.slideBy == 'page') {
|
2924 |
+
this._pages = [];
|
2925 |
+
|
2926 |
+
for (i = lower, j = 0, k = 0; i < upper; i++) {
|
2927 |
+
if (j >= size || j === 0) {
|
2928 |
+
this._pages.push({
|
2929 |
+
start: Math.min(maximum, i - lower),
|
2930 |
+
end: i - lower + size - 1
|
2931 |
+
});
|
2932 |
+
if (Math.min(maximum, i - lower) === maximum) {
|
2933 |
+
break;
|
2934 |
+
}
|
2935 |
+
j = 0, ++k;
|
2936 |
+
}
|
2937 |
+
j += this._core.mergers(this._core.relative(i));
|
2938 |
+
}
|
2939 |
+
}
|
2940 |
+
};
|
2941 |
+
|
2942 |
+
/**
|
2943 |
+
* Draws the user interface.
|
2944 |
+
* @todo The option `dotsData` wont work.
|
2945 |
+
* @protected
|
2946 |
+
*/
|
2947 |
+
Navigation.prototype.draw = function() {
|
2948 |
+
var difference,
|
2949 |
+
settings = this._core.settings,
|
2950 |
+
disabled = this._core.items().length <= settings.items,
|
2951 |
+
index = this._core.relative(this._core.current()),
|
2952 |
+
loop = settings.loop || settings.rewind;
|
2953 |
+
|
2954 |
+
this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
|
2955 |
+
|
2956 |
+
if (settings.nav) {
|
2957 |
+
this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
|
2958 |
+
this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
|
2959 |
+
}
|
2960 |
+
|
2961 |
+
this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
|
2962 |
+
|
2963 |
+
if (settings.dots) {
|
2964 |
+
difference = this._pages.length - this._controls.$absolute.children().length;
|
2965 |
+
|
2966 |
+
if (settings.dotsData && difference !== 0) {
|
2967 |
+
this._controls.$absolute.html(this._templates.join(''));
|
2968 |
+
} else if (difference > 0) {
|
2969 |
+
this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
|
2970 |
+
} else if (difference < 0) {
|
2971 |
+
this._controls.$absolute.children().slice(difference).remove();
|
2972 |
+
}
|
2973 |
+
|
2974 |
+
this._controls.$absolute.find('.active').removeClass('active');
|
2975 |
+
this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
|
2976 |
+
}
|
2977 |
+
};
|
2978 |
+
|
2979 |
+
/**
|
2980 |
+
* Extends event data.
|
2981 |
+
* @protected
|
2982 |
+
* @param {Event} event - The event object which gets thrown.
|
2983 |
+
*/
|
2984 |
+
Navigation.prototype.onTrigger = function(event) {
|
2985 |
+
var settings = this._core.settings;
|
2986 |
+
|
2987 |
+
event.page = {
|
2988 |
+
index: $.inArray(this.current(), this._pages),
|
2989 |
+
count: this._pages.length,
|
2990 |
+
size: settings && (settings.center || settings.autoWidth || settings.dotsData
|
2991 |
+
? 1 : settings.dotsEach || settings.items)
|
2992 |
+
};
|
2993 |
+
};
|
2994 |
+
|
2995 |
+
/**
|
2996 |
+
* Gets the current page position of the carousel.
|
2997 |
+
* @protected
|
2998 |
+
* @returns {Number}
|
2999 |
+
*/
|
3000 |
+
Navigation.prototype.current = function() {
|
3001 |
+
var current = this._core.relative(this._core.current());
|
3002 |
+
return $.grep(this._pages, $.proxy(function(page, index) {
|
3003 |
+
return page.start <= current && page.end >= current;
|
3004 |
+
}, this)).pop();
|
3005 |
+
};
|
3006 |
+
|
3007 |
+
/**
|
3008 |
+
* Gets the current succesor/predecessor position.
|
3009 |
+
* @protected
|
3010 |
+
* @returns {Number}
|
3011 |
+
*/
|
3012 |
+
Navigation.prototype.getPosition = function(successor) {
|
3013 |
+
var position, length,
|
3014 |
+
settings = this._core.settings;
|
3015 |
+
|
3016 |
+
if (settings.slideBy == 'page') {
|
3017 |
+
position = $.inArray(this.current(), this._pages);
|
3018 |
+
length = this._pages.length;
|
3019 |
+
successor ? ++position : --position;
|
3020 |
+
position = this._pages[((position % length) + length) % length].start;
|
3021 |
+
} else {
|
3022 |
+
position = this._core.relative(this._core.current());
|
3023 |
+
length = this._core.items().length;
|
3024 |
+
successor ? position += settings.slideBy : position -= settings.slideBy;
|
3025 |
+
}
|
3026 |
+
|
3027 |
+
return position;
|
3028 |
+
};
|
3029 |
+
|
3030 |
+
/**
|
3031 |
+
* Slides to the next item or page.
|
3032 |
+
* @public
|
3033 |
+
* @param {Number} [speed=false] - The time in milliseconds for the transition.
|
3034 |
+
*/
|
3035 |
+
Navigation.prototype.next = function(speed) {
|
3036 |
+
$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
|
3037 |
+
};
|
3038 |
+
|
3039 |
+
/**
|
3040 |
+
* Slides to the previous item or page.
|
3041 |
+
* @public
|
3042 |
+
* @param {Number} [speed=false] - The time in milliseconds for the transition.
|
3043 |
+
*/
|
3044 |
+
Navigation.prototype.prev = function(speed) {
|
3045 |
+
$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
|
3046 |
+
};
|
3047 |
+
|
3048 |
+
/**
|
3049 |
+
* Slides to the specified item or page.
|
3050 |
+
* @public
|
3051 |
+
* @param {Number} position - The position of the item or page.
|
3052 |
+
* @param {Number} [speed] - The time in milliseconds for the transition.
|
3053 |
+
* @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
|
3054 |
+
*/
|
3055 |
+
Navigation.prototype.to = function(position, speed, standard) {
|
3056 |
+
var length;
|
3057 |
+
|
3058 |
+
if (!standard && this._pages.length) {
|
3059 |
+
length = this._pages.length;
|
3060 |
+
$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
|
3061 |
+
} else {
|
3062 |
+
$.proxy(this._overrides.to, this._core)(position, speed);
|
3063 |
+
}
|
3064 |
+
};
|
3065 |
+
|
3066 |
+
$.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
|
3067 |
+
|
3068 |
+
})(window.Zepto || window.jQuery, window, document);
|
3069 |
+
|
3070 |
+
/**
|
3071 |
+
* Hash Plugin
|
3072 |
+
* @version 2.1.0
|
3073 |
+
* @author Artus Kolanowski
|
3074 |
+
* @author David Deutsch
|
3075 |
+
* @license The MIT License (MIT)
|
3076 |
+
*/
|
3077 |
+
;(function($, window, document, undefined) {
|
3078 |
+
'use strict';
|
3079 |
+
|
3080 |
+
/**
|
3081 |
+
* Creates the hash plugin.
|
3082 |
+
* @class The Hash Plugin
|
3083 |
+
* @param {Owl} carousel - The Owl Carousel
|
3084 |
+
*/
|
3085 |
+
var Hash = function(carousel) {
|
3086 |
+
/**
|
3087 |
+
* Reference to the core.
|
3088 |
+
* @protected
|
3089 |
+
* @type {Owl}
|
3090 |
+
*/
|
3091 |
+
this._core = carousel;
|
3092 |
+
|
3093 |
+
/**
|
3094 |
+
* Hash index for the items.
|
3095 |
+
* @protected
|
3096 |
+
* @type {Object}
|
3097 |
+
*/
|
3098 |
+
this._hashes = {};
|
3099 |
+
|
3100 |
+
/**
|
3101 |
+
* The carousel element.
|
3102 |
+
* @type {jQuery}
|
3103 |
+
*/
|
3104 |
+
this.$element = this._core.$element;
|
3105 |
+
|
3106 |
+
/**
|
3107 |
+
* All event handlers.
|
3108 |
+
* @protected
|
3109 |
+
* @type {Object}
|
3110 |
+
*/
|
3111 |
+
this._handlers = {
|
3112 |
+
'initialized.owl.carousel': $.proxy(function(e) {
|
3113 |
+
if (e.namespace && this._core.settings.startPosition === 'URLHash') {
|
3114 |
+
$(window).trigger('hashchange.owl.navigation');
|
3115 |
+
}
|
3116 |
+
}, this),
|
3117 |
+
'prepared.owl.carousel': $.proxy(function(e) {
|
3118 |
+
if (e.namespace) {
|
3119 |
+
var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
|
3120 |
+
|
3121 |
+
if (!hash) {
|
3122 |
+
return;
|
3123 |
+
}
|
3124 |
+
|
3125 |
+
this._hashes[hash] = e.content;
|
3126 |
+
}
|
3127 |
+
}, this),
|
3128 |
+
'changed.owl.carousel': $.proxy(function(e) {
|
3129 |
+
if (e.namespace && e.property.name === 'position') {
|
3130 |
+
var current = this._core.items(this._core.relative(this._core.current())),
|
3131 |
+
hash = $.map(this._hashes, function(item, hash) {
|
3132 |
+
return item === current ? hash : null;
|
3133 |
+
}).join();
|
3134 |
+
|
3135 |
+
if (!hash || window.location.hash.slice(1) === hash) {
|
3136 |
+
return;
|
3137 |
+
}
|
3138 |
+
|
3139 |
+
window.location.hash = hash;
|
3140 |
+
}
|
3141 |
+
}, this)
|
3142 |
+
};
|
3143 |
+
|
3144 |
+
// set default options
|
3145 |
+
this._core.options = $.extend({}, Hash.Defaults, this._core.options);
|
3146 |
+
|
3147 |
+
// register the event handlers
|
3148 |
+
this.$element.on(this._handlers);
|
3149 |
+
|
3150 |
+
// register event listener for hash navigation
|
3151 |
+
$(window).on('hashchange.owl.navigation', $.proxy(function(e) {
|
3152 |
+
var hash = window.location.hash.substring(1),
|
3153 |
+
items = this._core.$stage.children(),
|
3154 |
+
position = this._hashes[hash] && items.index(this._hashes[hash]);
|
3155 |
+
|
3156 |
+
if (position === undefined || position === this._core.current()) {
|
3157 |
+
return;
|
3158 |
+
}
|
3159 |
+
|
3160 |
+
this._core.to(this._core.relative(position), false, true);
|
3161 |
+
}, this));
|
3162 |
+
};
|
3163 |
+
|
3164 |
+
/**
|
3165 |
+
* Default options.
|
3166 |
+
* @public
|
3167 |
+
*/
|
3168 |
+
Hash.Defaults = {
|
3169 |
+
URLhashListener: false
|
3170 |
+
};
|
3171 |
+
|
3172 |
+
/**
|
3173 |
+
* Destroys the plugin.
|
3174 |
+
* @public
|
3175 |
+
*/
|
3176 |
+
Hash.prototype.destroy = function() {
|
3177 |
+
var handler, property;
|
3178 |
+
|
3179 |
+
$(window).off('hashchange.owl.navigation');
|
3180 |
+
|
3181 |
+
for (handler in this._handlers) {
|
3182 |
+
this._core.$element.off(handler, this._handlers[handler]);
|
3183 |
+
}
|
3184 |
+
for (property in Object.getOwnPropertyNames(this)) {
|
3185 |
+
typeof this[property] != 'function' && (this[property] = null);
|
3186 |
+
}
|
3187 |
+
};
|
3188 |
+
|
3189 |
+
$.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
|
3190 |
+
|
3191 |
+
})(window.Zepto || window.jQuery, window, document);
|
3192 |
+
|
3193 |
+
/**
|
3194 |
+
* Support Plugin
|
3195 |
+
*
|
3196 |
+
* @version 2.1.0
|
3197 |
+
* @author Vivid Planet Software GmbH
|
3198 |
+
* @author Artus Kolanowski
|
3199 |
+
* @author David Deutsch
|
3200 |
+
* @license The MIT License (MIT)
|
3201 |
+
*/
|
3202 |
+
;(function($, window, document, undefined) {
|
3203 |
+
|
3204 |
+
var style = $('<support>').get(0).style,
|
3205 |
+
prefixes = 'Webkit Moz O ms'.split(' '),
|
3206 |
+
events = {
|
3207 |
+
transition: {
|
3208 |
+
end: {
|
3209 |
+
WebkitTransition: 'webkitTransitionEnd',
|
3210 |
+
MozTransition: 'transitionend',
|
3211 |
+
OTransition: 'oTransitionEnd',
|
3212 |
+
transition: 'transitionend'
|
3213 |
+
}
|
3214 |
+
},
|
3215 |
+
animation: {
|
3216 |
+
end: {
|
3217 |
+
WebkitAnimation: 'webkitAnimationEnd',
|
3218 |
+
MozAnimation: 'animationend',
|
3219 |
+
OAnimation: 'oAnimationEnd',
|
3220 |
+
animation: 'animationend'
|
3221 |
+
}
|
3222 |
+
}
|
3223 |
+
},
|
3224 |
+
tests = {
|
3225 |
+
csstransforms: function() {
|
3226 |
+
return !!test('transform');
|
3227 |
+
},
|
3228 |
+
csstransforms3d: function() {
|
3229 |
+
return !!test('perspective');
|
3230 |
+
},
|
3231 |
+
csstransitions: function() {
|
3232 |
+
return !!test('transition');
|
3233 |
+
},
|
3234 |
+
cssanimations: function() {
|
3235 |
+
return !!test('animation');
|
3236 |
+
}
|
3237 |
+
};
|
3238 |
+
|
3239 |
+
function test(property, prefixed) {
|
3240 |
+
var result = false,
|
3241 |
+
upper = property.charAt(0).toUpperCase() + property.slice(1);
|
3242 |
+
|
3243 |
+
$.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
|
3244 |
+
if (style[property] !== undefined) {
|
3245 |
+
result = prefixed ? property : true;
|
3246 |
+
return false;
|
3247 |
+
}
|
3248 |
+
});
|
3249 |
+
|
3250 |
+
return result;
|
3251 |
+
}
|
3252 |
+
|
3253 |
+
function prefixed(property) {
|
3254 |
+
return test(property, true);
|
3255 |
+
}
|
3256 |
+
|
3257 |
+
if (tests.csstransitions()) {
|
3258 |
+
/* jshint -W053 */
|
3259 |
+
$.support.transition = new String(prefixed('transition'))
|
3260 |
+
$.support.transition.end = events.transition.end[ $.support.transition ];
|
3261 |
+
}
|
3262 |
+
|
3263 |
+
if (tests.cssanimations()) {
|
3264 |
+
/* jshint -W053 */
|
3265 |
+
$.support.animation = new String(prefixed('animation'))
|
3266 |
+
$.support.animation.end = events.animation.end[ $.support.animation ];
|
3267 |
+
}
|
3268 |
+
|
3269 |
+
if (tests.csstransforms()) {
|
3270 |
+
/* jshint -W053 */
|
3271 |
+
$.support.transform = new String(prefixed('transform'));
|
3272 |
+
$.support.transform3d = tests.csstransforms3d();
|
3273 |
+
}
|
3274 |
+
|
3275 |
+
})(window.Zepto || window.jQuery, window, document);
|
assets/{js/vendors → lib/owl-carousel}/owl.carousel.min.js
RENAMED
File without changes
|
assets/lib/select2/select2.js
ADDED
@@ -0,0 +1,5746 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Select2 4.0.5
|
3 |
+
* https://select2.github.io
|
4 |
+
*
|
5 |
+
* Released under the MIT license
|
6 |
+
* https://github.com/select2/select2/blob/master/LICENSE.md
|
7 |
+
*/
|
8 |
+
(function (factory) {
|
9 |
+
if (typeof define === 'function' && define.amd) {
|
10 |
+
// AMD. Register as an anonymous module.
|
11 |
+
define(['jquery'], factory);
|
12 |
+
} else if (typeof module === 'object' && module.exports) {
|
13 |
+
// Node/CommonJS
|
14 |
+
module.exports = function (root, jQuery) {
|
15 |
+
if (jQuery === undefined) {
|
16 |
+
// require('jQuery') returns a factory that requires window to
|
17 |
+
// build a jQuery instance, we normalize how we use modules
|
18 |
+
// that require this pattern but the window provided is a noop
|
19 |
+
// if it's defined (how jquery works)
|
20 |
+
if (typeof window !== 'undefined') {
|
21 |
+
jQuery = require('jquery');
|
22 |
+
}
|
23 |
+
else {
|
24 |
+
jQuery = require('jquery')(root);
|
25 |
+
}
|
26 |
+
}
|
27 |
+
factory(jQuery);
|
28 |
+
return jQuery;
|
29 |
+
};
|
30 |
+
} else {
|
31 |
+
// Browser globals
|
32 |
+
factory(jQuery);
|
33 |
+
}
|
34 |
+
} (function (jQuery) {
|
35 |
+
// This is needed so we can catch the AMD loader configuration and use it
|
36 |
+
// The inner file should be wrapped (by `banner.start.js`) in a function that
|
37 |
+
// returns the AMD loader references.
|
38 |
+
var S2 =(function () {
|
39 |
+
// Restore the Select2 AMD loader so it can be used
|
40 |
+
// Needed mostly in the language files, where the loader is not inserted
|
41 |
+
if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
|
42 |
+
var S2 = jQuery.fn.select2.amd;
|
43 |
+
}
|
44 |
+
var S2;(function () { if (!S2 || !S2.requirejs) {
|
45 |
+
if (!S2) { S2 = {}; } else { require = S2; }
|
46 |
+
/**
|
47 |
+
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
|
48 |
+
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
|
49 |
+
*/
|
50 |
+
//Going sloppy to avoid 'use strict' string cost, but strict practices should
|
51 |
+
//be followed.
|
52 |
+
/*global setTimeout: false */
|
53 |
+
|
54 |
+
var requirejs, require, define;
|
55 |
+
(function (undef) {
|
56 |
+
var main, req, makeMap, handlers,
|
57 |
+
defined = {},
|
58 |
+
waiting = {},
|
59 |
+
config = {},
|
60 |
+
defining = {},
|
61 |
+
hasOwn = Object.prototype.hasOwnProperty,
|
62 |
+
aps = [].slice,
|
63 |
+
jsSuffixRegExp = /\.js$/;
|
64 |
+
|
65 |
+
function hasProp(obj, prop) {
|
66 |
+
return hasOwn.call(obj, prop);
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Given a relative module name, like ./something, normalize it to
|
71 |
+
* a real name that can be mapped to a path.
|
72 |
+
* @param {String} name the relative name
|
73 |
+
* @param {String} baseName a real name that the name arg is relative
|
74 |
+
* to.
|
75 |
+
* @returns {String} normalized name
|
76 |
+
*/
|
77 |
+
function normalize(name, baseName) {
|
78 |
+
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
|
79 |
+
foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
|
80 |
+
baseParts = baseName && baseName.split("/"),
|
81 |
+
map = config.map,
|
82 |
+
starMap = (map && map['*']) || {};
|
83 |
+
|
84 |
+
//Adjust any relative paths.
|
85 |
+
if (name) {
|
86 |
+
name = name.split('/');
|
87 |
+
lastIndex = name.length - 1;
|
88 |
+
|
89 |
+
// If wanting node ID compatibility, strip .js from end
|
90 |
+
// of IDs. Have to do this here, and not in nameToUrl
|
91 |
+
// because node allows either .js or non .js to map
|
92 |
+
// to same file.
|
93 |
+
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
|
94 |
+
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
|
95 |
+
}
|
96 |
+
|
97 |
+
// Starts with a '.' so need the baseName
|
98 |
+
if (name[0].charAt(0) === '.' && baseParts) {
|
99 |
+
//Convert baseName to array, and lop off the last part,
|
100 |
+
//so that . matches that 'directory' and not name of the baseName's
|
101 |
+
//module. For instance, baseName of 'one/two/three', maps to
|
102 |
+
//'one/two/three.js', but we want the directory, 'one/two' for
|
103 |
+
//this normalization.
|
104 |
+
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
|
105 |
+
name = normalizedBaseParts.concat(name);
|
106 |
+
}
|
107 |
+
|
108 |
+
//start trimDots
|
109 |
+
for (i = 0; i < name.length; i++) {
|
110 |
+
part = name[i];
|
111 |
+
if (part === '.') {
|
112 |
+
name.splice(i, 1);
|
113 |
+
i -= 1;
|
114 |
+
} else if (part === '..') {
|
115 |
+
// If at the start, or previous value is still ..,
|
116 |
+
// keep them so that when converted to a path it may
|
117 |
+
// still work when converted to a path, even though
|
118 |
+
// as an ID it is less than ideal. In larger point
|
119 |
+
// releases, may be better to just kick out an error.
|
120 |
+
if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
|
121 |
+
continue;
|
122 |
+
} else if (i > 0) {
|
123 |
+
name.splice(i - 1, 2);
|
124 |
+
i -= 2;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
//end trimDots
|
129 |
+
|
130 |
+
name = name.join('/');
|
131 |
+
}
|
132 |
+
|
133 |
+
//Apply map config if available.
|
134 |
+
if ((baseParts || starMap) && map) {
|
135 |
+
nameParts = name.split('/');
|
136 |
+
|
137 |
+
for (i = nameParts.length; i > 0; i -= 1) {
|
138 |
+
nameSegment = nameParts.slice(0, i).join("/");
|
139 |
+
|
140 |
+
if (baseParts) {
|
141 |
+
//Find the longest baseName segment match in the config.
|
142 |
+
//So, do joins on the biggest to smallest lengths of baseParts.
|
143 |
+
for (j = baseParts.length; j > 0; j -= 1) {
|
144 |
+
mapValue = map[baseParts.slice(0, j).join('/')];
|
145 |
+
|
146 |
+
//baseName segment has config, find if it has one for
|
147 |
+
//this name.
|
148 |
+
if (mapValue) {
|
149 |
+
mapValue = mapValue[nameSegment];
|
150 |
+
if (mapValue) {
|
151 |
+
//Match, update name to the new value.
|
152 |
+
foundMap = mapValue;
|
153 |
+
foundI = i;
|
154 |
+
break;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
if (foundMap) {
|
161 |
+
break;
|
162 |
+
}
|
163 |
+
|
164 |
+
//Check for a star map match, but just hold on to it,
|
165 |
+
//if there is a shorter segment match later in a matching
|
166 |
+
//config, then favor over this star map.
|
167 |
+
if (!foundStarMap && starMap && starMap[nameSegment]) {
|
168 |
+
foundStarMap = starMap[nameSegment];
|
169 |
+
starI = i;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
if (!foundMap && foundStarMap) {
|
174 |
+
foundMap = foundStarMap;
|
175 |
+
foundI = starI;
|
176 |
+
}
|
177 |
+
|
178 |
+
if (foundMap) {
|
179 |
+
nameParts.splice(0, foundI, foundMap);
|
180 |
+
name = nameParts.join('/');
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
return name;
|
185 |
+
}
|
186 |
+
|
187 |
+
function makeRequire(relName, forceSync) {
|
188 |
+
return function () {
|
189 |
+
//A version of a require function that passes a moduleName
|
190 |
+
//value for items that may need to
|
191 |
+
//look up paths relative to the moduleName
|
192 |
+
var args = aps.call(arguments, 0);
|
193 |
+
|
194 |
+
//If first arg is not require('string'), and there is only
|
195 |
+
//one arg, it is the array form without a callback. Insert
|
196 |
+
//a null so that the following concat is correct.
|
197 |
+
if (typeof args[0] !== 'string' && args.length === 1) {
|
198 |
+
args.push(null);
|
199 |
+
}
|
200 |
+
return req.apply(undef, args.concat([relName, forceSync]));
|
201 |
+
};
|
202 |
+
}
|
203 |
+
|
204 |
+
function makeNormalize(relName) {
|
205 |
+
return function (name) {
|
206 |
+
return normalize(name, relName);
|
207 |
+
};
|
208 |
+
}
|
209 |
+
|
210 |
+
function makeLoad(depName) {
|
211 |
+
return function (value) {
|
212 |
+
defined[depName] = value;
|
213 |
+
};
|
214 |
+
}
|
215 |
+
|
216 |
+
function callDep(name) {
|
217 |
+
if (hasProp(waiting, name)) {
|
218 |
+
var args = waiting[name];
|
219 |
+
delete waiting[name];
|
220 |
+
defining[name] = true;
|
221 |
+
main.apply(undef, args);
|
222 |
+
}
|
223 |
+
|
224 |
+
if (!hasProp(defined, name) && !hasProp(defining, name)) {
|
225 |
+
throw new Error('No ' + name);
|
226 |
+
}
|
227 |
+
return defined[name];
|
228 |
+
}
|
229 |
+
|
230 |
+
//Turns a plugin!resource to [plugin, resource]
|
231 |
+
//with the plugin being undefined if the name
|
232 |
+
//did not have a plugin prefix.
|
233 |
+
function splitPrefix(name) {
|
234 |
+
var prefix,
|
235 |
+
index = name ? name.indexOf('!') : -1;
|
236 |
+
if (index > -1) {
|
237 |
+
prefix = name.substring(0, index);
|
238 |
+
name = name.substring(index + 1, name.length);
|
239 |
+
}
|
240 |
+
return [prefix, name];
|
241 |
+
}
|
242 |
+
|
243 |
+
//Creates a parts array for a relName where first part is plugin ID,
|
244 |
+
//second part is resource ID. Assumes relName has already been normalized.
|
245 |
+
function makeRelParts(relName) {
|
246 |
+
return relName ? splitPrefix(relName) : [];
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Makes a name map, normalizing the name, and using a plugin
|
251 |
+
* for normalization if necessary. Grabs a ref to plugin
|
252 |
+
* too, as an optimization.
|
253 |
+
*/
|
254 |
+
makeMap = function (name, relParts) {
|
255 |
+
var plugin,
|
256 |
+
parts = splitPrefix(name),
|
257 |
+
prefix = parts[0],
|
258 |
+
relResourceName = relParts[1];
|
259 |
+
|
260 |
+
name = parts[1];
|
261 |
+
|
262 |
+
if (prefix) {
|
263 |
+
prefix = normalize(prefix, relResourceName);
|
264 |
+
plugin = callDep(prefix);
|
265 |
+
}
|
266 |
+
|
267 |
+
//Normalize according
|
268 |
+
if (prefix) {
|
269 |
+
if (plugin && plugin.normalize) {
|
270 |
+
name = plugin.normalize(name, makeNormalize(relResourceName));
|
271 |
+
} else {
|
272 |
+
name = normalize(name, relResourceName);
|
273 |
+
}
|
274 |
+
} else {
|
275 |
+
name = normalize(name, relResourceName);
|
276 |
+
parts = splitPrefix(name);
|
277 |
+
prefix = parts[0];
|
278 |
+
name = parts[1];
|
279 |
+
if (prefix) {
|
280 |
+
plugin = callDep(prefix);
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
//Using ridiculous property names for space reasons
|
285 |
+
return {
|
286 |
+
f: prefix ? prefix + '!' + name : name, //fullName
|
287 |
+
n: name,
|
288 |
+
pr: prefix,
|
289 |
+
p: plugin
|
290 |
+
};
|
291 |
+
};
|
292 |
+
|
293 |
+
function makeConfig(name) {
|
294 |
+
return function () {
|
295 |
+
return (config && config.config && config.config[name]) || {};
|
296 |
+
};
|
297 |
+
}
|
298 |
+
|
299 |
+
handlers = {
|
300 |
+
require: function (name) {
|
301 |
+
return makeRequire(name);
|
302 |
+
},
|
303 |
+
exports: function (name) {
|
304 |
+
var e = defined[name];
|
305 |
+
if (typeof e !== 'undefined') {
|
306 |
+
return e;
|
307 |
+
} else {
|
308 |
+
return (defined[name] = {});
|
309 |
+
}
|
310 |
+
},
|
311 |
+
module: function (name) {
|
312 |
+
return {
|
313 |
+
id: name,
|
314 |
+
uri: '',
|
315 |
+
exports: defined[name],
|
316 |
+
config: makeConfig(name)
|
317 |
+
};
|
318 |
+
}
|
319 |
+
};
|
320 |
+
|
321 |
+
main = function (name, deps, callback, relName) {
|
322 |
+
var cjsModule, depName, ret, map, i, relParts,
|
323 |
+
args = [],
|
324 |
+
callbackType = typeof callback,
|
325 |
+
usingExports;
|
326 |
+
|
327 |
+
//Use name if no relName
|
328 |
+
relName = relName || name;
|
329 |
+
relParts = makeRelParts(relName);
|
330 |
+
|
331 |
+
//Call the callback to define the module, if necessary.
|
332 |
+
if (callbackType === 'undefined' || callbackType === 'function') {
|
333 |
+
//Pull out the defined dependencies and pass the ordered
|
334 |
+
//values to the callback.
|
335 |
+
//Default to [require, exports, module] if no deps
|
336 |
+
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
|
337 |
+
for (i = 0; i < deps.length; i += 1) {
|
338 |
+
map = makeMap(deps[i], relParts);
|
339 |
+
depName = map.f;
|
340 |
+
|
341 |
+
//Fast path CommonJS standard dependencies.
|
342 |
+
if (depName === "require") {
|
343 |
+
args[i] = handlers.require(name);
|
344 |
+
} else if (depName === "exports") {
|
345 |
+
//CommonJS module spec 1.1
|
346 |
+
args[i] = handlers.exports(name);
|
347 |
+
usingExports = true;
|
348 |
+
} else if (depName === "module") {
|
349 |
+
//CommonJS module spec 1.1
|
350 |
+
cjsModule = args[i] = handlers.module(name);
|
351 |
+
} else if (hasProp(defined, depName) ||
|
352 |
+
hasProp(waiting, depName) ||
|
353 |
+
hasProp(defining, depName)) {
|
354 |
+
args[i] = callDep(depName);
|
355 |
+
} else if (map.p) {
|
356 |
+
map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
|
357 |
+
args[i] = defined[depName];
|
358 |
+
} else {
|
359 |
+
throw new Error(name + ' missing ' + depName);
|
360 |
+
}
|
361 |
+
}
|
362 |
+
|
363 |
+
ret = callback ? callback.apply(defined[name], args) : undefined;
|
364 |
+
|
365 |
+
if (name) {
|
366 |
+
//If setting exports via "module" is in play,
|
367 |
+
//favor that over return value and exports. After that,
|
368 |
+
//favor a non-undefined return value over exports use.
|
369 |
+
if (cjsModule && cjsModule.exports !== undef &&
|
370 |
+
cjsModule.exports !== defined[name]) {
|
371 |
+
defined[name] = cjsModule.exports;
|
372 |
+
} else if (ret !== undef || !usingExports) {
|
373 |
+
//Use the return value from the function.
|
374 |
+
defined[name] = ret;
|
375 |
+
}
|
376 |
+
}
|
377 |
+
} else if (name) {
|
378 |
+
//May just be an object definition for the module. Only
|
379 |
+
//worry about defining if have a module name.
|
380 |
+
defined[name] = callback;
|
381 |
+
}
|
382 |
+
};
|
383 |
+
|
384 |
+
requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
|
385 |
+
if (typeof deps === "string") {
|
386 |
+
if (handlers[deps]) {
|
387 |
+
//callback in this case is really relName
|
388 |
+
return handlers[deps](callback);
|
389 |
+
}
|
390 |
+
//Just return the module wanted. In this scenario, the
|
391 |
+
//deps arg is the module name, and second arg (if passed)
|
392 |
+
//is just the relName.
|
393 |
+
//Normalize module name, if it contains . or ..
|
394 |
+
return callDep(makeMap(deps, makeRelParts(callback)).f);
|
395 |
+
} else if (!deps.splice) {
|
396 |
+
//deps is a config object, not an array.
|
397 |
+
config = deps;
|
398 |
+
if (config.deps) {
|
399 |
+
req(config.deps, config.callback);
|
400 |
+
}
|
401 |
+
if (!callback) {
|
402 |
+
return;
|
403 |
+
}
|
404 |
+
|
405 |
+
if (callback.splice) {
|
406 |
+
//callback is an array, which means it is a dependency list.
|
407 |
+
//Adjust args if there are dependencies
|
408 |
+
deps = callback;
|
409 |
+
callback = relName;
|
410 |
+
relName = null;
|
411 |
+
} else {
|
412 |
+
deps = undef;
|
413 |
+
}
|
414 |
+
}
|
415 |
+
|
416 |
+
//Support require(['a'])
|
417 |
+
callback = callback || function () {};
|
418 |
+
|
419 |
+
//If relName is a function, it is an errback handler,
|
420 |
+
//so remove it.
|
421 |
+
if (typeof relName === 'function') {
|
422 |
+
relName = forceSync;
|
423 |
+
forceSync = alt;
|
424 |
+
}
|
425 |
+
|
426 |
+
//Simulate async callback;
|
427 |
+
if (forceSync) {
|
428 |
+
main(undef, deps, callback, relName);
|
429 |
+
} else {
|
430 |
+
//Using a non-zero value because of concern for what old browsers
|
431 |
+
//do, and latest browsers "upgrade" to 4 if lower value is used:
|
432 |
+
//http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
|
433 |
+
//If want a value immediately, use require('id') instead -- something
|
434 |
+
//that works in almond on the global level, but not guaranteed and
|
435 |
+
//unlikely to work in other AMD implementations.
|
436 |
+
setTimeout(function () {
|
437 |
+
main(undef, deps, callback, relName);
|
438 |
+
}, 4);
|
439 |
+
}
|
440 |
+
|
441 |
+
return req;
|
442 |
+
};
|
443 |
+
|
444 |
+
/**
|
445 |
+
* Just drops the config on the floor, but returns req in case
|
446 |
+
* the config return value is used.
|
447 |
+
*/
|
448 |
+
req.config = function (cfg) {
|
449 |
+
return req(cfg);
|
450 |
+
};
|
451 |
+
|
452 |
+
/**
|
453 |
+
* Expose module registry for debugging and tooling
|
454 |
+
*/
|
455 |
+
requirejs._defined = defined;
|
456 |
+
|
457 |
+
define = function (name, deps, callback) {
|
458 |
+
if (typeof name !== 'string') {
|
459 |
+
throw new Error('See almond README: incorrect module build, no module name');
|
460 |
+
}
|
461 |
+
|
462 |
+
//This module may not have dependencies
|
463 |
+
if (!deps.splice) {
|
464 |
+
//deps is not an array, so probably means
|
465 |
+
//an object literal or factory function for
|
466 |
+
//the value. Adjust args.
|
467 |
+
callback = deps;
|
468 |
+
deps = [];
|
469 |
+
}
|
470 |
+
|
471 |
+
if (!hasProp(defined, name) && !hasProp(waiting, name)) {
|
472 |
+
waiting[name] = [name, deps, callback];
|
473 |
+
}
|
474 |
+
};
|
475 |
+
|
476 |
+
define.amd = {
|
477 |
+
jQuery: true
|
478 |
+
};
|
479 |
+
}());
|
480 |
+
|
481 |
+
S2.requirejs = requirejs;S2.require = require;S2.define = define;
|
482 |
+
}
|
483 |
+
}());
|
484 |
+
S2.define("almond", function(){});
|
485 |
+
|
486 |
+
/* global jQuery:false, $:false */
|
487 |
+
S2.define('jquery',[],function () {
|
488 |
+
var _$ = jQuery || $;
|
489 |
+
|
490 |
+
if (_$ == null && console && console.error) {
|
491 |
+
console.error(
|
492 |
+
'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
|
493 |
+
'found. Make sure that you are including jQuery before Select2 on your ' +
|
494 |
+
'web page.'
|
495 |
+
);
|
496 |
+
}
|
497 |
+
|
498 |
+
return _$;
|
499 |
+
});
|
500 |
+
|
501 |
+
S2.define('select2/utils',[
|
502 |
+
'jquery'
|
503 |
+
], function ($) {
|
504 |
+
var Utils = {};
|
505 |
+
|
506 |
+
Utils.Extend = function (ChildClass, SuperClass) {
|
507 |
+
var __hasProp = {}.hasOwnProperty;
|
508 |
+
|
509 |
+
function BaseConstructor () {
|
510 |
+
this.constructor = ChildClass;
|
511 |
+
}
|
512 |
+
|
513 |
+
for (var key in SuperClass) {
|
514 |
+
if (__hasProp.call(SuperClass, key)) {
|
515 |
+
ChildClass[key] = SuperClass[key];
|
516 |
+
}
|
517 |
+
}
|
518 |
+
|
519 |
+
BaseConstructor.prototype = SuperClass.prototype;
|
520 |
+
ChildClass.prototype = new BaseConstructor();
|
521 |
+
ChildClass.__super__ = SuperClass.prototype;
|
522 |
+
|
523 |
+
return ChildClass;
|
524 |
+
};
|
525 |
+
|
526 |
+
function getMethods (theClass) {
|
527 |
+
var proto = theClass.prototype;
|
528 |
+
|
529 |
+
var methods = [];
|
530 |
+
|
531 |
+
for (var methodName in proto) {
|
532 |
+
var m = proto[methodName];
|
533 |
+
|
534 |
+
if (typeof m !== 'function') {
|
535 |
+
continue;
|
536 |
+
}
|
537 |
+
|
538 |
+
if (methodName === 'constructor') {
|
539 |
+
continue;
|
540 |
+
}
|
541 |
+
|
542 |
+
methods.push(methodName);
|
543 |
+
}
|
544 |
+
|
545 |
+
return methods;
|
546 |
+
}
|
547 |
+
|
548 |
+
Utils.Decorate = function (SuperClass, DecoratorClass) {
|
549 |
+
var decoratedMethods = getMethods(DecoratorClass);
|
550 |
+
var superMethods = getMethods(SuperClass);
|
551 |
+
|
552 |
+
function DecoratedClass () {
|
553 |
+
var unshift = Array.prototype.unshift;
|
554 |
+
|
555 |
+
var argCount = DecoratorClass.prototype.constructor.length;
|
556 |
+
|
557 |
+
var calledConstructor = SuperClass.prototype.constructor;
|
558 |
+
|
559 |
+
if (argCount > 0) {
|
560 |
+
unshift.call(arguments, SuperClass.prototype.constructor);
|
561 |
+
|
562 |
+
calledConstructor = DecoratorClass.prototype.constructor;
|
563 |
+
}
|
564 |
+
|
565 |
+
calledConstructor.apply(this, arguments);
|
566 |
+
}
|
567 |
+
|
568 |
+
DecoratorClass.displayName = SuperClass.displayName;
|
569 |
+
|
570 |
+
function ctr () {
|
571 |
+
this.constructor = DecoratedClass;
|
572 |
+
}
|
573 |
+
|
574 |
+
DecoratedClass.prototype = new ctr();
|
575 |
+
|
576 |
+
for (var m = 0; m < superMethods.length; m++) {
|
577 |
+
var superMethod = superMethods[m];
|
578 |
+
|
579 |
+
DecoratedClass.prototype[superMethod] =
|
580 |
+
SuperClass.prototype[superMethod];
|
581 |
+
}
|
582 |
+
|
583 |
+
var calledMethod = function (methodName) {
|
584 |
+
// Stub out the original method if it's not decorating an actual method
|
585 |
+
var originalMethod = function () {};
|
586 |
+
|
587 |
+
if (methodName in DecoratedClass.prototype) {
|
588 |
+
originalMethod = DecoratedClass.prototype[methodName];
|
589 |
+
}
|
590 |
+
|
591 |
+
var decoratedMethod = DecoratorClass.prototype[methodName];
|
592 |
+
|
593 |
+
return function () {
|
594 |
+
var unshift = Array.prototype.unshift;
|
595 |
+
|
596 |
+
unshift.call(arguments, originalMethod);
|
597 |
+
|
598 |
+
return decoratedMethod.apply(this, arguments);
|
599 |
+
};
|
600 |
+
};
|
601 |
+
|
602 |
+
for (var d = 0; d < decoratedMethods.length; d++) {
|
603 |
+
var decoratedMethod = decoratedMethods[d];
|
604 |
+
|
605 |
+
DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
|
606 |
+
}
|
607 |
+
|
608 |
+
return DecoratedClass;
|
609 |
+
};
|
610 |
+
|
611 |
+
var Observable = function () {
|
612 |
+
this.listeners = {};
|
613 |
+
};
|
614 |
+
|
615 |
+
Observable.prototype.on = function (event, callback) {
|
616 |
+
this.listeners = this.listeners || {};
|
617 |
+
|
618 |
+
if (event in this.listeners) {
|
619 |
+
this.listeners[event].push(callback);
|
620 |
+
} else {
|
621 |
+
this.listeners[event] = [callback];
|
622 |
+
}
|
623 |
+
};
|
624 |
+
|
625 |
+
Observable.prototype.trigger = function (event) {
|
626 |
+
var slice = Array.prototype.slice;
|
627 |
+
var params = slice.call(arguments, 1);
|
628 |
+
|
629 |
+
this.listeners = this.listeners || {};
|
630 |
+
|
631 |
+
// Params should always come in as an array
|
632 |
+
if (params == null) {
|
633 |
+
params = [];
|
634 |
+
}
|
635 |
+
|
636 |
+
// If there are no arguments to the event, use a temporary object
|
637 |
+
if (params.length === 0) {
|
638 |
+
params.push({});
|
639 |
+
}
|
640 |
+
|
641 |
+
// Set the `_type` of the first object to the event
|
642 |
+
params[0]._type = event;
|
643 |
+
|
644 |
+
if (event in this.listeners) {
|
645 |
+
this.invoke(this.listeners[event], slice.call(arguments, 1));
|
646 |
+
}
|
647 |
+
|
648 |
+
if ('*' in this.listeners) {
|
649 |
+
this.invoke(this.listeners['*'], arguments);
|
650 |
+
}
|
651 |
+
};
|
652 |
+
|
653 |
+
Observable.prototype.invoke = function (listeners, params) {
|
654 |
+
for (var i = 0, len = listeners.length; i < len; i++) {
|
655 |
+
listeners[i].apply(this, params);
|
656 |
+
}
|
657 |
+
};
|
658 |
+
|
659 |
+
Utils.Observable = Observable;
|
660 |
+
|
661 |
+
Utils.generateChars = function (length) {
|
662 |
+
var chars = '';
|
663 |
+
|
664 |
+
for (var i = 0; i < length; i++) {
|
665 |
+
var randomChar = Math.floor(Math.random() * 36);
|
666 |
+
chars += randomChar.toString(36);
|
667 |
+
}
|
668 |
+
|
669 |
+
return chars;
|
670 |
+
};
|
671 |
+
|
672 |
+
Utils.bind = function (func, context) {
|
673 |
+
return function () {
|
674 |
+
func.apply(context, arguments);
|
675 |
+
};
|
676 |
+
};
|
677 |
+
|
678 |
+
Utils._convertData = function (data) {
|
679 |
+
for (var originalKey in data) {
|
680 |
+
var keys = originalKey.split('-');
|
681 |
+
|
682 |
+
var dataLevel = data;
|
683 |
+
|
684 |
+
if (keys.length === 1) {
|
685 |
+
continue;
|
686 |
+
}
|
687 |
+
|
688 |
+
for (var k = 0; k < keys.length; k++) {
|
689 |
+
var key = keys[k];
|
690 |
+
|
691 |
+
// Lowercase the first letter
|
692 |
+
// By default, dash-separated becomes camelCase
|
693 |
+
key = key.substring(0, 1).toLowerCase() + key.substring(1);
|
694 |
+
|
695 |
+
if (!(key in dataLevel)) {
|
696 |
+
dataLevel[key] = {};
|
697 |
+
}
|
698 |
+
|
699 |
+
if (k == keys.length - 1) {
|
700 |
+
dataLevel[key] = data[originalKey];
|
701 |
+
}
|
702 |
+
|
703 |
+
dataLevel = dataLevel[key];
|
704 |
+
}
|
705 |
+
|
706 |
+
delete data[originalKey];
|
707 |
+
}
|
708 |
+
|
709 |
+
return data;
|
710 |
+
};
|
711 |
+
|
712 |
+
Utils.hasScroll = function (index, el) {
|
713 |
+
// Adapted from the function created by @ShadowScripter
|
714 |
+
// and adapted by @BillBarry on the Stack Exchange Code Review website.
|
715 |
+
// The original code can be found at
|
716 |
+
// http://codereview.stackexchange.com/q/13338
|
717 |
+
// and was designed to be used with the Sizzle selector engine.
|
718 |
+
|
719 |
+
var $el = $(el);
|
720 |
+
var overflowX = el.style.overflowX;
|
721 |
+
var overflowY = el.style.overflowY;
|
722 |
+
|
723 |
+
//Check both x and y declarations
|
724 |
+
if (overflowX === overflowY &&
|
725 |
+
(overflowY === 'hidden' || overflowY === 'visible')) {
|
726 |
+
return false;
|
727 |
+
}
|
728 |
+
|
729 |
+
if (overflowX === 'scroll' || overflowY === 'scroll') {
|
730 |
+
return true;
|
731 |
+
}
|
732 |
+
|
733 |
+
return ($el.innerHeight() < el.scrollHeight ||
|
734 |
+
$el.innerWidth() < el.scrollWidth);
|
735 |
+
};
|
736 |
+
|
737 |
+
Utils.escapeMarkup = function (markup) {
|
738 |
+
var replaceMap = {
|
739 |
+
'\\': '\',
|
740 |
+
'&': '&',
|
741 |
+
'<': '<',
|
742 |
+
'>': '>',
|
743 |
+
'"': '"',
|
744 |
+
'\'': ''',
|
745 |
+
'/': '/'
|
746 |
+
};
|
747 |
+
|
748 |
+
// Do not try to escape the markup if it's not a string
|
749 |
+
if (typeof markup !== 'string') {
|
750 |
+
return markup;
|
751 |
+
}
|
752 |
+
|
753 |
+
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
|
754 |
+
return replaceMap[match];
|
755 |
+
});
|
756 |
+
};
|
757 |
+
|
758 |
+
// Append an array of jQuery nodes to a given element.
|
759 |
+
Utils.appendMany = function ($element, $nodes) {
|
760 |
+
// jQuery 1.7.x does not support $.fn.append() with an array
|
761 |
+
// Fall back to a jQuery object collection using $.fn.add()
|
762 |
+
if ($.fn.jquery.substr(0, 3) === '1.7') {
|
763 |
+
var $jqNodes = $();
|
764 |
+
|
765 |
+
$.map($nodes, function (node) {
|
766 |
+
$jqNodes = $jqNodes.add(node);
|
767 |
+
});
|
768 |
+
|
769 |
+
$nodes = $jqNodes;
|
770 |
+
}
|
771 |
+
|
772 |
+
$element.append($nodes);
|
773 |
+
};
|
774 |
+
|
775 |
+
return Utils;
|
776 |
+
});
|
777 |
+
|
778 |
+
S2.define('select2/results',[
|
779 |
+
'jquery',
|
780 |
+
'./utils'
|
781 |
+
], function ($, Utils) {
|
782 |
+
function Results ($element, options, dataAdapter) {
|
783 |
+
this.$element = $element;
|
784 |
+
this.data = dataAdapter;
|
785 |
+
this.options = options;
|
786 |
+
|
787 |
+
Results.__super__.constructor.call(this);
|
788 |
+
}
|
789 |
+
|
790 |
+
Utils.Extend(Results, Utils.Observable);
|
791 |
+
|
792 |
+
Results.prototype.render = function () {
|
793 |
+
var $results = $(
|
794 |
+
'<ul class="select2-results__options" role="tree"></ul>'
|
795 |
+
);
|
796 |
+
|
797 |
+
if (this.options.get('multiple')) {
|
798 |
+
$results.attr('aria-multiselectable', 'true');
|
799 |
+
}
|
800 |
+
|
801 |
+
this.$results = $results;
|
802 |
+
|
803 |
+
return $results;
|
804 |
+
};
|
805 |
+
|
806 |
+
Results.prototype.clear = function () {
|
807 |
+
this.$results.empty();
|
808 |
+
};
|
809 |
+
|
810 |
+
Results.prototype.displayMessage = function (params) {
|
811 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
812 |
+
|
813 |
+
this.clear();
|
814 |
+
this.hideLoading();
|
815 |
+
|
816 |
+
var $message = $(
|
817 |
+
'<li role="treeitem" aria-live="assertive"' +
|
818 |
+
' class="select2-results__option"></li>'
|
819 |
+
);
|
820 |
+
|
821 |
+
var message = this.options.get('translations').get(params.message);
|
822 |
+
|
823 |
+
$message.append(
|
824 |
+
escapeMarkup(
|
825 |
+
message(params.args)
|
826 |
+
)
|
827 |
+
);
|
828 |
+
|
829 |
+
$message[0].className += ' select2-results__message';
|
830 |
+
|
831 |
+
this.$results.append($message);
|
832 |
+
};
|
833 |
+
|
834 |
+
Results.prototype.hideMessages = function () {
|
835 |
+
this.$results.find('.select2-results__message').remove();
|
836 |
+
};
|
837 |
+
|
838 |
+
Results.prototype.append = function (data) {
|
839 |
+
this.hideLoading();
|
840 |
+
|
841 |
+
var $options = [];
|
842 |
+
|
843 |
+
if (data.results == null || data.results.length === 0) {
|
844 |
+
if (this.$results.children().length === 0) {
|
845 |
+
this.trigger('results:message', {
|
846 |
+
message: 'noResults'
|
847 |
+
});
|
848 |
+
}
|
849 |
+
|
850 |
+
return;
|
851 |
+
}
|
852 |
+
|
853 |
+
data.results = this.sort(data.results);
|
854 |
+
|
855 |
+
for (var d = 0; d < data.results.length; d++) {
|
856 |
+
var item = data.results[d];
|
857 |
+
|
858 |
+
var $option = this.option(item);
|
859 |
+
|
860 |
+
$options.push($option);
|
861 |
+
}
|
862 |
+
|
863 |
+
this.$results.append($options);
|
864 |
+
};
|
865 |
+
|
866 |
+
Results.prototype.position = function ($results, $dropdown) {
|
867 |
+
var $resultsContainer = $dropdown.find('.select2-results');
|
868 |
+
$resultsContainer.append($results);
|
869 |
+
};
|
870 |
+
|
871 |
+
Results.prototype.sort = function (data) {
|
872 |
+
var sorter = this.options.get('sorter');
|
873 |
+
|
874 |
+
return sorter(data);
|
875 |
+
};
|
876 |
+
|
877 |
+
Results.prototype.highlightFirstItem = function () {
|
878 |
+
var $options = this.$results
|
879 |
+
.find('.select2-results__option[aria-selected]');
|
880 |
+
|
881 |
+
var $selected = $options.filter('[aria-selected=true]');
|
882 |
+
|
883 |
+
// Check if there are any selected options
|
884 |
+
if ($selected.length > 0) {
|
885 |
+
// If there are selected options, highlight the first
|
886 |
+
$selected.first().trigger('mouseenter');
|
887 |
+
} else {
|
888 |
+
// If there are no selected options, highlight the first option
|
889 |
+
// in the dropdown
|
890 |
+
$options.first().trigger('mouseenter');
|
891 |
+
}
|
892 |
+
|
893 |
+
this.ensureHighlightVisible();
|
894 |
+
};
|
895 |
+
|
896 |
+
Results.prototype.setClasses = function () {
|
897 |
+
var self = this;
|
898 |
+
|
899 |
+
this.data.current(function (selected) {
|
900 |
+
var selectedIds = $.map(selected, function (s) {
|
901 |
+
return s.id.toString();
|
902 |
+
});
|
903 |
+
|
904 |
+
var $options = self.$results
|
905 |
+
.find('.select2-results__option[aria-selected]');
|
906 |
+
|
907 |
+
$options.each(function () {
|
908 |
+
var $option = $(this);
|
909 |
+
|
910 |
+
var item = $.data(this, 'data');
|
911 |
+
|
912 |
+
// id needs to be converted to a string when comparing
|
913 |
+
var id = '' + item.id;
|
914 |
+
|
915 |
+
if ((item.element != null && item.element.selected) ||
|
916 |
+
(item.element == null && $.inArray(id, selectedIds) > -1)) {
|
917 |
+
$option.attr('aria-selected', 'true');
|
918 |
+
} else {
|
919 |
+
$option.attr('aria-selected', 'false');
|
920 |
+
}
|
921 |
+
});
|
922 |
+
|
923 |
+
});
|
924 |
+
};
|
925 |
+
|
926 |
+
Results.prototype.showLoading = function (params) {
|
927 |
+
this.hideLoading();
|
928 |
+
|
929 |
+
var loadingMore = this.options.get('translations').get('searching');
|
930 |
+
|
931 |
+
var loading = {
|
932 |
+
disabled: true,
|
933 |
+
loading: true,
|
934 |
+
text: loadingMore(params)
|
935 |
+
};
|
936 |
+
var $loading = this.option(loading);
|
937 |
+
$loading.className += ' loading-results';
|
938 |
+
|
939 |
+
this.$results.prepend($loading);
|
940 |
+
};
|
941 |
+
|
942 |
+
Results.prototype.hideLoading = function () {
|
943 |
+
this.$results.find('.loading-results').remove();
|
944 |
+
};
|
945 |
+
|
946 |
+
Results.prototype.option = function (data) {
|
947 |
+
var option = document.createElement('li');
|
948 |
+
option.className = 'select2-results__option';
|
949 |
+
|
950 |
+
var attrs = {
|
951 |
+
'role': 'treeitem',
|
952 |
+
'aria-selected': 'false'
|
953 |
+
};
|
954 |
+
|
955 |
+
if (data.disabled) {
|
956 |
+
delete attrs['aria-selected'];
|
957 |
+
attrs['aria-disabled'] = 'true';
|
958 |
+
}
|
959 |
+
|
960 |
+
if (data.id == null) {
|
961 |
+
delete attrs['aria-selected'];
|
962 |
+
}
|
963 |
+
|
964 |
+
if (data._resultId != null) {
|
965 |
+
option.id = data._resultId;
|
966 |
+
}
|
967 |
+
|
968 |
+
if (data.title) {
|
969 |
+
option.title = data.title;
|
970 |
+
}
|
971 |
+
|
972 |
+
if (data.children) {
|
973 |
+
attrs.role = 'group';
|
974 |
+
attrs['aria-label'] = data.text;
|
975 |
+
delete attrs['aria-selected'];
|
976 |
+
}
|
977 |
+
|
978 |
+
for (var attr in attrs) {
|
979 |
+
var val = attrs[attr];
|
980 |
+
|
981 |
+
option.setAttribute(attr, val);
|
982 |
+
}
|
983 |
+
|
984 |
+
if (data.children) {
|
985 |
+
var $option = $(option);
|
986 |
+
|
987 |
+
var label = document.createElement('strong');
|
988 |
+
label.className = 'select2-results__group';
|
989 |
+
|
990 |
+
var $label = $(label);
|
991 |
+
this.template(data, label);
|
992 |
+
|
993 |
+
var $children = [];
|
994 |
+
|
995 |
+
for (var c = 0; c < data.children.length; c++) {
|
996 |
+
var child = data.children[c];
|
997 |
+
|
998 |
+
var $child = this.option(child);
|
999 |
+
|
1000 |
+
$children.push($child);
|
1001 |
+
}
|
1002 |
+
|
1003 |
+
var $childrenContainer = $('<ul></ul>', {
|
1004 |
+
'class': 'select2-results__options select2-results__options--nested'
|
1005 |
+
});
|
1006 |
+
|
1007 |
+
$childrenContainer.append($children);
|
1008 |
+
|
1009 |
+
$option.append(label);
|
1010 |
+
$option.append($childrenContainer);
|
1011 |
+
} else {
|
1012 |
+
this.template(data, option);
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
$.data(option, 'data', data);
|
1016 |
+
|
1017 |
+
return option;
|
1018 |
+
};
|
1019 |
+
|
1020 |
+
Results.prototype.bind = function (container, $container) {
|
1021 |
+
var self = this;
|
1022 |
+
|
1023 |
+
var id = container.id + '-results';
|
1024 |
+
|
1025 |
+
this.$results.attr('id', id);
|
1026 |
+
|
1027 |
+
container.on('results:all', function (params) {
|
1028 |
+
self.clear();
|
1029 |
+
self.append(params.data);
|
1030 |
+
|
1031 |
+
if (container.isOpen()) {
|
1032 |
+
self.setClasses();
|
1033 |
+
self.highlightFirstItem();
|
1034 |
+
}
|
1035 |
+
});
|
1036 |
+
|
1037 |
+
container.on('results:append', function (params) {
|
1038 |
+
self.append(params.data);
|
1039 |
+
|
1040 |
+
if (container.isOpen()) {
|
1041 |
+
self.setClasses();
|
1042 |
+
}
|
1043 |
+
});
|
1044 |
+
|
1045 |
+
container.on('query', function (params) {
|
1046 |
+
self.hideMessages();
|
1047 |
+
self.showLoading(params);
|
1048 |
+
});
|
1049 |
+
|
1050 |
+
container.on('select', function () {
|
1051 |
+
if (!container.isOpen()) {
|
1052 |
+
return;
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
self.setClasses();
|
1056 |
+
self.highlightFirstItem();
|
1057 |
+
});
|
1058 |
+
|
1059 |
+
container.on('unselect', function () {
|
1060 |
+
if (!container.isOpen()) {
|
1061 |
+
return;
|
1062 |
+
}
|
1063 |
+
|
1064 |
+
self.setClasses();
|
1065 |
+
self.highlightFirstItem();
|
1066 |
+
});
|
1067 |
+
|
1068 |
+
container.on('open', function () {
|
1069 |
+
// When the dropdown is open, aria-expended="true"
|
1070 |
+
self.$results.attr('aria-expanded', 'true');
|
1071 |
+
self.$results.attr('aria-hidden', 'false');
|
1072 |
+
|
1073 |
+
self.setClasses();
|
1074 |
+
self.ensureHighlightVisible();
|
1075 |
+
});
|
1076 |
+
|
1077 |
+
container.on('close', function () {
|
1078 |
+
// When the dropdown is closed, aria-expended="false"
|
1079 |
+
self.$results.attr('aria-expanded', 'false');
|
1080 |
+
self.$results.attr('aria-hidden', 'true');
|
1081 |
+
self.$results.removeAttr('aria-activedescendant');
|
1082 |
+
});
|
1083 |
+
|
1084 |
+
container.on('results:toggle', function () {
|
1085 |
+
var $highlighted = self.getHighlightedResults();
|
1086 |
+
|
1087 |
+
if ($highlighted.length === 0) {
|
1088 |
+
return;
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
$highlighted.trigger('mouseup');
|
1092 |
+
});
|
1093 |
+
|
1094 |
+
container.on('results:select', function () {
|
1095 |
+
var $highlighted = self.getHighlightedResults();
|
1096 |
+
|
1097 |
+
if ($highlighted.length === 0) {
|
1098 |
+
return;
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
var data = $highlighted.data('data');
|
1102 |
+
|
1103 |
+
if ($highlighted.attr('aria-selected') == 'true') {
|
1104 |
+
self.trigger('close', {});
|
1105 |
+
} else {
|
1106 |
+
self.trigger('select', {
|
1107 |
+
data: data
|
1108 |
+
});
|
1109 |
+
}
|
1110 |
+
});
|
1111 |
+
|
1112 |
+
container.on('results:previous', function () {
|
1113 |
+
var $highlighted = self.getHighlightedResults();
|
1114 |
+
|
1115 |
+
var $options = self.$results.find('[aria-selected]');
|
1116 |
+
|
1117 |
+
var currentIndex = $options.index($highlighted);
|
1118 |
+
|
1119 |
+
// If we are already at te top, don't move further
|
1120 |
+
if (currentIndex === 0) {
|
1121 |
+
return;
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
var nextIndex = currentIndex - 1;
|
1125 |
+
|
1126 |
+
// If none are highlighted, highlight the first
|
1127 |
+
if ($highlighted.length === 0) {
|
1128 |
+
nextIndex = 0;
|
1129 |
+
}
|
1130 |
+
|
1131 |
+
var $next = $options.eq(nextIndex);
|
1132 |
+
|
1133 |
+
$next.trigger('mouseenter');
|
1134 |
+
|
1135 |
+
var currentOffset = self.$results.offset().top;
|
1136 |
+
var nextTop = $next.offset().top;
|
1137 |
+
var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
|
1138 |
+
|
1139 |
+
if (nextIndex === 0) {
|
1140 |
+
self.$results.scrollTop(0);
|
1141 |
+
} else if (nextTop - currentOffset < 0) {
|
1142 |
+
self.$results.scrollTop(nextOffset);
|
1143 |
+
}
|
1144 |
+
});
|
1145 |
+
|
1146 |
+
container.on('results:next', function () {
|
1147 |
+
var $highlighted = self.getHighlightedResults();
|
1148 |
+
|
1149 |
+
var $options = self.$results.find('[aria-selected]');
|
1150 |
+
|
1151 |
+
var currentIndex = $options.index($highlighted);
|
1152 |
+
|
1153 |
+
var nextIndex = currentIndex + 1;
|
1154 |
+
|
1155 |
+
// If we are at the last option, stay there
|
1156 |
+
if (nextIndex >= $options.length) {
|
1157 |
+
return;
|
1158 |
+
}
|
1159 |
+
|
1160 |
+
var $next = $options.eq(nextIndex);
|
1161 |
+
|
1162 |
+
$next.trigger('mouseenter');
|
1163 |
+
|
1164 |
+
var currentOffset = self.$results.offset().top +
|
1165 |
+
self.$results.outerHeight(false);
|
1166 |
+
var nextBottom = $next.offset().top + $next.outerHeight(false);
|
1167 |
+
var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
|
1168 |
+
|
1169 |
+
if (nextIndex === 0) {
|
1170 |
+
self.$results.scrollTop(0);
|
1171 |
+
} else if (nextBottom > currentOffset) {
|
1172 |
+
self.$results.scrollTop(nextOffset);
|
1173 |
+
}
|
1174 |
+
});
|
1175 |
+
|
1176 |
+
container.on('results:focus', function (params) {
|
1177 |
+
params.element.addClass('select2-results__option--highlighted');
|
1178 |
+
});
|
1179 |
+
|
1180 |
+
container.on('results:message', function (params) {
|
1181 |
+
self.displayMessage(params);
|
1182 |
+
});
|
1183 |
+
|
1184 |
+
if ($.fn.mousewheel) {
|
1185 |
+
this.$results.on('mousewheel', function (e) {
|
1186 |
+
var top = self.$results.scrollTop();
|
1187 |
+
|
1188 |
+
var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
|
1189 |
+
|
1190 |
+
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
|
1191 |
+
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
|
1192 |
+
|
1193 |
+
if (isAtTop) {
|
1194 |
+
self.$results.scrollTop(0);
|
1195 |
+
|
1196 |
+
e.preventDefault();
|
1197 |
+
e.stopPropagation();
|
1198 |
+
} else if (isAtBottom) {
|
1199 |
+
self.$results.scrollTop(
|
1200 |
+
self.$results.get(0).scrollHeight - self.$results.height()
|
1201 |
+
);
|
1202 |
+
|
1203 |
+
e.preventDefault();
|
1204 |
+
e.stopPropagation();
|
1205 |
+
}
|
1206 |
+
});
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
this.$results.on('mouseup', '.select2-results__option[aria-selected]',
|
1210 |
+
function (evt) {
|
1211 |
+
var $this = $(this);
|
1212 |
+
|
1213 |
+
var data = $this.data('data');
|
1214 |
+
|
1215 |
+
if ($this.attr('aria-selected') === 'true') {
|
1216 |
+
if (self.options.get('multiple')) {
|
1217 |
+
self.trigger('unselect', {
|
1218 |
+
originalEvent: evt,
|
1219 |
+
data: data
|
1220 |
+
});
|
1221 |
+
} else {
|
1222 |
+
self.trigger('close', {});
|
1223 |
+
}
|
1224 |
+
|
1225 |
+
return;
|
1226 |
+
}
|
1227 |
+
|
1228 |
+
self.trigger('select', {
|
1229 |
+
originalEvent: evt,
|
1230 |
+
data: data
|
1231 |
+
});
|
1232 |
+
});
|
1233 |
+
|
1234 |
+
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
|
1235 |
+
function (evt) {
|
1236 |
+
var data = $(this).data('data');
|
1237 |
+
|
1238 |
+
self.getHighlightedResults()
|
1239 |
+
.removeClass('select2-results__option--highlighted');
|
1240 |
+
|
1241 |
+
self.trigger('results:focus', {
|
1242 |
+
data: data,
|
1243 |
+
element: $(this)
|
1244 |
+
});
|
1245 |
+
});
|
1246 |
+
};
|
1247 |
+
|
1248 |
+
Results.prototype.getHighlightedResults = function () {
|
1249 |
+
var $highlighted = this.$results
|
1250 |
+
.find('.select2-results__option--highlighted');
|
1251 |
+
|
1252 |
+
return $highlighted;
|
1253 |
+
};
|
1254 |
+
|
1255 |
+
Results.prototype.destroy = function () {
|
1256 |
+
this.$results.remove();
|
1257 |
+
};
|
1258 |
+
|
1259 |
+
Results.prototype.ensureHighlightVisible = function () {
|
1260 |
+
var $highlighted = this.getHighlightedResults();
|
1261 |
+
|
1262 |
+
if ($highlighted.length === 0) {
|
1263 |
+
return;
|
1264 |
+
}
|
1265 |
+
|
1266 |
+
var $options = this.$results.find('[aria-selected]');
|
1267 |
+
|
1268 |
+
var currentIndex = $options.index($highlighted);
|
1269 |
+
|
1270 |
+
var currentOffset = this.$results.offset().top;
|
1271 |
+
var nextTop = $highlighted.offset().top;
|
1272 |
+
var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
|
1273 |
+
|
1274 |
+
var offsetDelta = nextTop - currentOffset;
|
1275 |
+
nextOffset -= $highlighted.outerHeight(false) * 2;
|
1276 |
+
|
1277 |
+
if (currentIndex <= 2) {
|
1278 |
+
this.$results.scrollTop(0);
|
1279 |
+
} else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
|
1280 |
+
this.$results.scrollTop(nextOffset);
|
1281 |
+
}
|
1282 |
+
};
|
1283 |
+
|
1284 |
+
Results.prototype.template = function (result, container) {
|
1285 |
+
var template = this.options.get('templateResult');
|
1286 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1287 |
+
|
1288 |
+
var content = template(result, container);
|
1289 |
+
|
1290 |
+
if (content == null) {
|
1291 |
+
container.style.display = 'none';
|
1292 |
+
} else if (typeof content === 'string') {
|
1293 |
+
container.innerHTML = escapeMarkup(content);
|
1294 |
+
} else {
|
1295 |
+
$(container).append(content);
|
1296 |
+
}
|
1297 |
+
};
|
1298 |
+
|
1299 |
+
return Results;
|
1300 |
+
});
|
1301 |
+
|
1302 |
+
S2.define('select2/keys',[
|
1303 |
+
|
1304 |
+
], function () {
|
1305 |
+
var KEYS = {
|
1306 |
+
BACKSPACE: 8,
|
1307 |
+
TAB: 9,
|
1308 |
+
ENTER: 13,
|
1309 |
+
SHIFT: 16,
|
1310 |
+
CTRL: 17,
|
1311 |
+
ALT: 18,
|
1312 |
+
ESC: 27,
|
1313 |
+
SPACE: 32,
|
1314 |
+
PAGE_UP: 33,
|
1315 |
+
PAGE_DOWN: 34,
|
1316 |
+
END: 35,
|
1317 |
+
HOME: 36,
|
1318 |
+
LEFT: 37,
|
1319 |
+
UP: 38,
|
1320 |
+
RIGHT: 39,
|
1321 |
+
DOWN: 40,
|
1322 |
+
DELETE: 46
|
1323 |
+
};
|
1324 |
+
|
1325 |
+
return KEYS;
|
1326 |
+
});
|
1327 |
+
|
1328 |
+
S2.define('select2/selection/base',[
|
1329 |
+
'jquery',
|
1330 |
+
'../utils',
|
1331 |
+
'../keys'
|
1332 |
+
], function ($, Utils, KEYS) {
|
1333 |
+
function BaseSelection ($element, options) {
|
1334 |
+
this.$element = $element;
|
1335 |
+
this.options = options;
|
1336 |
+
|
1337 |
+
BaseSelection.__super__.constructor.call(this);
|
1338 |
+
}
|
1339 |
+
|
1340 |
+
Utils.Extend(BaseSelection, Utils.Observable);
|
1341 |
+
|
1342 |
+
BaseSelection.prototype.render = function () {
|
1343 |
+
var $selection = $(
|
1344 |
+
'<span class="select2-selection" role="combobox" ' +
|
1345 |
+
' aria-haspopup="true" aria-expanded="false">' +
|
1346 |
+
'</span>'
|
1347 |
+
);
|
1348 |
+
|
1349 |
+
this._tabindex = 0;
|
1350 |
+
|
1351 |
+
if (this.$element.data('old-tabindex') != null) {
|
1352 |
+
this._tabindex = this.$element.data('old-tabindex');
|
1353 |
+
} else if (this.$element.attr('tabindex') != null) {
|
1354 |
+
this._tabindex = this.$element.attr('tabindex');
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
$selection.attr('title', this.$element.attr('title'));
|
1358 |
+
$selection.attr('tabindex', this._tabindex);
|
1359 |
+
|
1360 |
+
this.$selection = $selection;
|
1361 |
+
|
1362 |
+
return $selection;
|
1363 |
+
};
|
1364 |
+
|
1365 |
+
BaseSelection.prototype.bind = function (container, $container) {
|
1366 |
+
var self = this;
|
1367 |
+
|
1368 |
+
var id = container.id + '-container';
|
1369 |
+
var resultsId = container.id + '-results';
|
1370 |
+
|
1371 |
+
this.container = container;
|
1372 |
+
|
1373 |
+
this.$selection.on('focus', function (evt) {
|
1374 |
+
self.trigger('focus', evt);
|
1375 |
+
});
|
1376 |
+
|
1377 |
+
this.$selection.on('blur', function (evt) {
|
1378 |
+
self._handleBlur(evt);
|
1379 |
+
});
|
1380 |
+
|
1381 |
+
this.$selection.on('keydown', function (evt) {
|
1382 |
+
self.trigger('keypress', evt);
|
1383 |
+
|
1384 |
+
if (evt.which === KEYS.SPACE) {
|
1385 |
+
evt.preventDefault();
|
1386 |
+
}
|
1387 |
+
});
|
1388 |
+
|
1389 |
+
container.on('results:focus', function (params) {
|
1390 |
+
self.$selection.attr('aria-activedescendant', params.data._resultId);
|
1391 |
+
});
|
1392 |
+
|
1393 |
+
container.on('selection:update', function (params) {
|
1394 |
+
self.update(params.data);
|
1395 |
+
});
|
1396 |
+
|
1397 |
+
container.on('open', function () {
|
1398 |
+
// When the dropdown is open, aria-expanded="true"
|
1399 |
+
self.$selection.attr('aria-expanded', 'true');
|
1400 |
+
self.$selection.attr('aria-owns', resultsId);
|
1401 |
+
|
1402 |
+
self._attachCloseHandler(container);
|
1403 |
+
});
|
1404 |
+
|
1405 |
+
container.on('close', function () {
|
1406 |
+
// When the dropdown is closed, aria-expanded="false"
|
1407 |
+
self.$selection.attr('aria-expanded', 'false');
|
1408 |
+
self.$selection.removeAttr('aria-activedescendant');
|
1409 |
+
self.$selection.removeAttr('aria-owns');
|
1410 |
+
|
1411 |
+
self.$selection.focus();
|
1412 |
+
|
1413 |
+
self._detachCloseHandler(container);
|
1414 |
+
});
|
1415 |
+
|
1416 |
+
container.on('enable', function () {
|
1417 |
+
self.$selection.attr('tabindex', self._tabindex);
|
1418 |
+
});
|
1419 |
+
|
1420 |
+
container.on('disable', function () {
|
1421 |
+
self.$selection.attr('tabindex', '-1');
|
1422 |
+
});
|
1423 |
+
};
|
1424 |
+
|
1425 |
+
BaseSelection.prototype._handleBlur = function (evt) {
|
1426 |
+
var self = this;
|
1427 |
+
|
1428 |
+
// This needs to be delayed as the active element is the body when the tab
|
1429 |
+
// key is pressed, possibly along with others.
|
1430 |
+
window.setTimeout(function () {
|
1431 |
+
// Don't trigger `blur` if the focus is still in the selection
|
1432 |
+
if (
|
1433 |
+
(document.activeElement == self.$selection[0]) ||
|
1434 |
+
($.contains(self.$selection[0], document.activeElement))
|
1435 |
+
) {
|
1436 |
+
return;
|
1437 |
+
}
|
1438 |
+
|
1439 |
+
self.trigger('blur', evt);
|
1440 |
+
}, 1);
|
1441 |
+
};
|
1442 |
+
|
1443 |
+
BaseSelection.prototype._attachCloseHandler = function (container) {
|
1444 |
+
var self = this;
|
1445 |
+
|
1446 |
+
$(document.body).on('mousedown.select2.' + container.id, function (e) {
|
1447 |
+
var $target = $(e.target);
|
1448 |
+
|
1449 |
+
var $select = $target.closest('.select2');
|
1450 |
+
|
1451 |
+
var $all = $('.select2.select2-container--open');
|
1452 |
+
|
1453 |
+
$all.each(function () {
|
1454 |
+
var $this = $(this);
|
1455 |
+
|
1456 |
+
if (this == $select[0]) {
|
1457 |
+
return;
|
1458 |
+
}
|
1459 |
+
|
1460 |
+
var $element = $this.data('element');
|
1461 |
+
|
1462 |
+
$element.select2('close');
|
1463 |
+
});
|
1464 |
+
});
|
1465 |
+
};
|
1466 |
+
|
1467 |
+
BaseSelection.prototype._detachCloseHandler = function (container) {
|
1468 |
+
$(document.body).off('mousedown.select2.' + container.id);
|
1469 |
+
};
|
1470 |
+
|
1471 |
+
BaseSelection.prototype.position = function ($selection, $container) {
|
1472 |
+
var $selectionContainer = $container.find('.selection');
|
1473 |
+
$selectionContainer.append($selection);
|
1474 |
+
};
|
1475 |
+
|
1476 |
+
BaseSelection.prototype.destroy = function () {
|
1477 |
+
this._detachCloseHandler(this.container);
|
1478 |
+
};
|
1479 |
+
|
1480 |
+
BaseSelection.prototype.update = function (data) {
|
1481 |
+
throw new Error('The `update` method must be defined in child classes.');
|
1482 |
+
};
|
1483 |
+
|
1484 |
+
return BaseSelection;
|
1485 |
+
});
|
1486 |
+
|
1487 |
+
S2.define('select2/selection/single',[
|
1488 |
+
'jquery',
|
1489 |
+
'./base',
|
1490 |
+
'../utils',
|
1491 |
+
'../keys'
|
1492 |
+
], function ($, BaseSelection, Utils, KEYS) {
|
1493 |
+
function SingleSelection () {
|
1494 |
+
SingleSelection.__super__.constructor.apply(this, arguments);
|
1495 |
+
}
|
1496 |
+
|
1497 |
+
Utils.Extend(SingleSelection, BaseSelection);
|
1498 |
+
|
1499 |
+
SingleSelection.prototype.render = function () {
|
1500 |
+
var $selection = SingleSelection.__super__.render.call(this);
|
1501 |
+
|
1502 |
+
$selection.addClass('select2-selection--single');
|
1503 |
+
|
1504 |
+
$selection.html(
|
1505 |
+
'<span class="select2-selection__rendered"></span>' +
|
1506 |
+
'<span class="select2-selection__arrow" role="presentation">' +
|
1507 |
+
'<b role="presentation"></b>' +
|
1508 |
+
'</span>'
|
1509 |
+
);
|
1510 |
+
|
1511 |
+
return $selection;
|
1512 |
+
};
|
1513 |
+
|
1514 |
+
SingleSelection.prototype.bind = function (container, $container) {
|
1515 |
+
var self = this;
|
1516 |
+
|
1517 |
+
SingleSelection.__super__.bind.apply(this, arguments);
|
1518 |
+
|
1519 |
+
var id = container.id + '-container';
|
1520 |
+
|
1521 |
+
this.$selection.find('.select2-selection__rendered').attr('id', id);
|
1522 |
+
this.$selection.attr('aria-labelledby', id);
|
1523 |
+
|
1524 |
+
this.$selection.on('mousedown', function (evt) {
|
1525 |
+
// Only respond to left clicks
|
1526 |
+
if (evt.which !== 1) {
|
1527 |
+
return;
|
1528 |
+
}
|
1529 |
+
|
1530 |
+
self.trigger('toggle', {
|
1531 |
+
originalEvent: evt
|
1532 |
+
});
|
1533 |
+
});
|
1534 |
+
|
1535 |
+
this.$selection.on('focus', function (evt) {
|
1536 |
+
// User focuses on the container
|
1537 |
+
});
|
1538 |
+
|
1539 |
+
this.$selection.on('blur', function (evt) {
|
1540 |
+
// User exits the container
|
1541 |
+
});
|
1542 |
+
|
1543 |
+
container.on('focus', function (evt) {
|
1544 |
+
if (!container.isOpen()) {
|
1545 |
+
self.$selection.focus();
|
1546 |
+
}
|
1547 |
+
});
|
1548 |
+
|
1549 |
+
container.on('selection:update', function (params) {
|
1550 |
+
self.update(params.data);
|
1551 |
+
});
|
1552 |
+
};
|
1553 |
+
|
1554 |
+
SingleSelection.prototype.clear = function () {
|
1555 |
+
this.$selection.find('.select2-selection__rendered').empty();
|
1556 |
+
};
|
1557 |
+
|
1558 |
+
SingleSelection.prototype.display = function (data, container) {
|
1559 |
+
var template = this.options.get('templateSelection');
|
1560 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1561 |
+
|
1562 |
+
return escapeMarkup(template(data, container));
|
1563 |
+
};
|
1564 |
+
|
1565 |
+
SingleSelection.prototype.selectionContainer = function () {
|
1566 |
+
return $('<span></span>');
|
1567 |
+
};
|
1568 |
+
|
1569 |
+
SingleSelection.prototype.update = function (data) {
|
1570 |
+
if (data.length === 0) {
|
1571 |
+
this.clear();
|
1572 |
+
return;
|
1573 |
+
}
|
1574 |
+
|
1575 |
+
var selection = data[0];
|
1576 |
+
|
1577 |
+
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1578 |
+
var formatted = this.display(selection, $rendered);
|
1579 |
+
|
1580 |
+
$rendered.empty().append(formatted);
|
1581 |
+
$rendered.prop('title', selection.title || selection.text);
|
1582 |
+
};
|
1583 |
+
|
1584 |
+
return SingleSelection;
|
1585 |
+
});
|
1586 |
+
|
1587 |
+
S2.define('select2/selection/multiple',[
|
1588 |
+
'jquery',
|
1589 |
+
'./base',
|
1590 |
+
'../utils'
|
1591 |
+
], function ($, BaseSelection, Utils) {
|
1592 |
+
function MultipleSelection ($element, options) {
|
1593 |
+
MultipleSelection.__super__.constructor.apply(this, arguments);
|
1594 |
+
}
|
1595 |
+
|
1596 |
+
Utils.Extend(MultipleSelection, BaseSelection);
|
1597 |
+
|
1598 |
+
MultipleSelection.prototype.render = function () {
|
1599 |
+
var $selection = MultipleSelection.__super__.render.call(this);
|
1600 |
+
|
1601 |
+
$selection.addClass('select2-selection--multiple');
|
1602 |
+
|
1603 |
+
$selection.html(
|
1604 |
+
'<ul class="select2-selection__rendered"></ul>'
|
1605 |
+
);
|
1606 |
+
|
1607 |
+
return $selection;
|
1608 |
+
};
|
1609 |
+
|
1610 |
+
MultipleSelection.prototype.bind = function (container, $container) {
|
1611 |
+
var self = this;
|
1612 |
+
|
1613 |
+
MultipleSelection.__super__.bind.apply(this, arguments);
|
1614 |
+
|
1615 |
+
this.$selection.on('click', function (evt) {
|
1616 |
+
self.trigger('toggle', {
|
1617 |
+
originalEvent: evt
|
1618 |
+
});
|
1619 |
+
});
|
1620 |
+
|
1621 |
+
this.$selection.on(
|
1622 |
+
'click',
|
1623 |
+
'.select2-selection__choice__remove',
|
1624 |
+
function (evt) {
|
1625 |
+
// Ignore the event if it is disabled
|
1626 |
+
if (self.options.get('disabled')) {
|
1627 |
+
return;
|
1628 |
+
}
|
1629 |
+
|
1630 |
+
var $remove = $(this);
|
1631 |
+
var $selection = $remove.parent();
|
1632 |
+
|
1633 |
+
var data = $selection.data('data');
|
1634 |
+
|
1635 |
+
self.trigger('unselect', {
|
1636 |
+
originalEvent: evt,
|
1637 |
+
data: data
|
1638 |
+
});
|
1639 |
+
}
|
1640 |
+
);
|
1641 |
+
};
|
1642 |
+
|
1643 |
+
MultipleSelection.prototype.clear = function () {
|
1644 |
+
this.$selection.find('.select2-selection__rendered').empty();
|
1645 |
+
};
|
1646 |
+
|
1647 |
+
MultipleSelection.prototype.display = function (data, container) {
|
1648 |
+
var template = this.options.get('templateSelection');
|
1649 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1650 |
+
|
1651 |
+
return escapeMarkup(template(data, container));
|
1652 |
+
};
|
1653 |
+
|
1654 |
+
MultipleSelection.prototype.selectionContainer = function () {
|
1655 |
+
var $container = $(
|
1656 |
+
'<li class="select2-selection__choice">' +
|
1657 |
+
'<span class="select2-selection__choice__remove" role="presentation">' +
|
1658 |
+
'×' +
|
1659 |
+
'</span>' +
|
1660 |
+
'</li>'
|
1661 |
+
);
|
1662 |
+
|
1663 |
+
return $container;
|
1664 |
+
};
|
1665 |
+
|
1666 |
+
MultipleSelection.prototype.update = function (data) {
|
1667 |
+
this.clear();
|
1668 |
+
|
1669 |
+
if (data.length === 0) {
|
1670 |
+
return;
|
1671 |
+
}
|
1672 |
+
|
1673 |
+
var $selections = [];
|
1674 |
+
|
1675 |
+
for (var d = 0; d < data.length; d++) {
|
1676 |
+
var selection = data[d];
|
1677 |
+
|
1678 |
+
var $selection = this.selectionContainer();
|
1679 |
+
var formatted = this.display(selection, $selection);
|
1680 |
+
|
1681 |
+
$selection.append(formatted);
|
1682 |
+
$selection.prop('title', selection.title || selection.text);
|
1683 |
+
|
1684 |
+
$selection.data('data', selection);
|
1685 |
+
|
1686 |
+
$selections.push($selection);
|
1687 |
+
}
|
1688 |
+
|
1689 |
+
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1690 |
+
|
1691 |
+
Utils.appendMany($rendered, $selections);
|
1692 |
+
};
|
1693 |
+
|
1694 |
+
return MultipleSelection;
|
1695 |
+
});
|
1696 |
+
|
1697 |
+
S2.define('select2/selection/placeholder',[
|
1698 |
+
'../utils'
|
1699 |
+
], function (Utils) {
|
1700 |
+
function Placeholder (decorated, $element, options) {
|
1701 |
+
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
1702 |
+
|
1703 |
+
decorated.call(this, $element, options);
|
1704 |
+
}
|
1705 |
+
|
1706 |
+
Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
1707 |
+
if (typeof placeholder === 'string') {
|
1708 |
+
placeholder = {
|
1709 |
+
id: '',
|
1710 |
+
text: placeholder
|
1711 |
+
};
|
1712 |
+
}
|
1713 |
+
|
1714 |
+
return placeholder;
|
1715 |
+
};
|
1716 |
+
|
1717 |
+
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1718 |
+
var $placeholder = this.selectionContainer();
|
1719 |
+
|
1720 |
+
$placeholder.html(this.display(placeholder));
|
1721 |
+
$placeholder.addClass('select2-selection__placeholder')
|
1722 |
+
.removeClass('select2-selection__choice');
|
1723 |
+
|
1724 |
+
return $placeholder;
|
1725 |
+
};
|
1726 |
+
|
1727 |
+
Placeholder.prototype.update = function (decorated, data) {
|
1728 |
+
var singlePlaceholder = (
|
1729 |
+
data.length == 1 && data[0].id != this.placeholder.id
|
1730 |
+
);
|
1731 |
+
var multipleSelections = data.length > 1;
|
1732 |
+
|
1733 |
+
if (multipleSelections || singlePlaceholder) {
|
1734 |
+
return decorated.call(this, data);
|
1735 |
+
}
|
1736 |
+
|
1737 |
+
this.clear();
|
1738 |
+
|
1739 |
+
var $placeholder = this.createPlaceholder(this.placeholder);
|
1740 |
+
|
1741 |
+
this.$selection.find('.select2-selection__rendered').append($placeholder);
|
1742 |
+
};
|
1743 |
+
|
1744 |
+
return Placeholder;
|
1745 |
+
});
|
1746 |
+
|
1747 |
+
S2.define('select2/selection/allowClear',[
|
1748 |
+
'jquery',
|
1749 |
+
'../keys'
|
1750 |
+
], function ($, KEYS) {
|
1751 |
+
function AllowClear () { }
|
1752 |
+
|
1753 |
+
AllowClear.prototype.bind = function (decorated, container, $container) {
|
1754 |
+
var self = this;
|
1755 |
+
|
1756 |
+
decorated.call(this, container, $container);
|
1757 |
+
|
1758 |
+
if (this.placeholder == null) {
|
1759 |
+
if (this.options.get('debug') && window.console && console.error) {
|
1760 |
+
console.error(
|
1761 |
+
'Select2: The `allowClear` option should be used in combination ' +
|
1762 |
+
'with the `placeholder` option.'
|
1763 |
+
);
|
1764 |
+
}
|
1765 |
+
}
|
1766 |
+
|
1767 |
+
this.$selection.on('mousedown', '.select2-selection__clear',
|
1768 |
+
function (evt) {
|
1769 |
+
self._handleClear(evt);
|
1770 |
+
});
|
1771 |
+
|
1772 |
+
container.on('keypress', function (evt) {
|
1773 |
+
self._handleKeyboardClear(evt, container);
|
1774 |
+
});
|
1775 |
+
};
|
1776 |
+
|
1777 |
+
AllowClear.prototype._handleClear = function (_, evt) {
|
1778 |
+
// Ignore the event if it is disabled
|
1779 |
+
if (this.options.get('disabled')) {
|
1780 |
+
return;
|
1781 |
+
}
|
1782 |
+
|
1783 |
+
var $clear = this.$selection.find('.select2-selection__clear');
|
1784 |
+
|
1785 |
+
// Ignore the event if nothing has been selected
|
1786 |
+
if ($clear.length === 0) {
|
1787 |
+
return;
|
1788 |
+
}
|
1789 |
+
|
1790 |
+
evt.stopPropagation();
|
1791 |
+
|
1792 |
+
var data = $clear.data('data');
|
1793 |
+
|
1794 |
+
for (var d = 0; d < data.length; d++) {
|
1795 |
+
var unselectData = {
|
1796 |
+
data: data[d]
|
1797 |
+
};
|
1798 |
+
|
1799 |
+
// Trigger the `unselect` event, so people can prevent it from being
|
1800 |
+
// cleared.
|
1801 |
+
this.trigger('unselect', unselectData);
|
1802 |
+
|
1803 |
+
// If the event was prevented, don't clear it out.
|
1804 |
+
if (unselectData.prevented) {
|
1805 |
+
return;
|
1806 |
+
}
|
1807 |
+
}
|
1808 |
+
|
1809 |
+
this.$element.val(this.placeholder.id).trigger('change');
|
1810 |
+
|
1811 |
+
this.trigger('toggle', {});
|
1812 |
+
};
|
1813 |
+
|
1814 |
+
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
|
1815 |
+
if (container.isOpen()) {
|
1816 |
+
return;
|
1817 |
+
}
|
1818 |
+
|
1819 |
+
if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
|
1820 |
+
this._handleClear(evt);
|
1821 |
+
}
|
1822 |
+
};
|
1823 |
+
|
1824 |
+
AllowClear.prototype.update = function (decorated, data) {
|
1825 |
+
decorated.call(this, data);
|
1826 |
+
|
1827 |
+
if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
|
1828 |
+
data.length === 0) {
|
1829 |
+
return;
|
1830 |
+
}
|
1831 |
+
|
1832 |
+
var $remove = $(
|
1833 |
+
'<span class="select2-selection__clear">' +
|
1834 |
+
'×' +
|
1835 |
+
'</span>'
|
1836 |
+
);
|
1837 |
+
$remove.data('data', data);
|
1838 |
+
|
1839 |
+
this.$selection.find('.select2-selection__rendered').prepend($remove);
|
1840 |
+
};
|
1841 |
+
|
1842 |
+
return AllowClear;
|
1843 |
+
});
|
1844 |
+
|
1845 |
+
S2.define('select2/selection/search',[
|
1846 |
+
'jquery',
|
1847 |
+
'../utils',
|
1848 |
+
'../keys'
|
1849 |
+
], function ($, Utils, KEYS) {
|
1850 |
+
function Search (decorated, $element, options) {
|
1851 |
+
decorated.call(this, $element, options);
|
1852 |
+
}
|
1853 |
+
|
1854 |
+
Search.prototype.render = function (decorated) {
|
1855 |
+
var $search = $(
|
1856 |
+
'<li class="select2-search select2-search--inline">' +
|
1857 |
+
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
1858 |
+
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
1859 |
+
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1860 |
+
'</li>'
|
1861 |
+
);
|
1862 |
+
|
1863 |
+
this.$searchContainer = $search;
|
1864 |
+
this.$search = $search.find('input');
|
1865 |
+
|
1866 |
+
var $rendered = decorated.call(this);
|
1867 |
+
|
1868 |
+
this._transferTabIndex();
|
1869 |
+
|
1870 |
+
return $rendered;
|
1871 |
+
};
|
1872 |
+
|
1873 |
+
Search.prototype.bind = function (decorated, container, $container) {
|
1874 |
+
var self = this;
|
1875 |
+
|
1876 |
+
decorated.call(this, container, $container);
|
1877 |
+
|
1878 |
+
container.on('open', function () {
|
1879 |
+
self.$search.trigger('focus');
|
1880 |
+
});
|
1881 |
+
|
1882 |
+
container.on('close', function () {
|
1883 |
+
self.$search.val('');
|
1884 |
+
self.$search.removeAttr('aria-activedescendant');
|
1885 |
+
self.$search.trigger('focus');
|
1886 |
+
});
|
1887 |
+
|
1888 |
+
container.on('enable', function () {
|
1889 |
+
self.$search.prop('disabled', false);
|
1890 |
+
|
1891 |
+
self._transferTabIndex();
|
1892 |
+
});
|
1893 |
+
|
1894 |
+
container.on('disable', function () {
|
1895 |
+
self.$search.prop('disabled', true);
|
1896 |
+
});
|
1897 |
+
|
1898 |
+
container.on('focus', function (evt) {
|
1899 |
+
self.$search.trigger('focus');
|
1900 |
+
});
|
1901 |
+
|
1902 |
+
container.on('results:focus', function (params) {
|
1903 |
+
self.$search.attr('aria-activedescendant', params.id);
|
1904 |
+
});
|
1905 |
+
|
1906 |
+
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
|
1907 |
+
self.trigger('focus', evt);
|
1908 |
+
});
|
1909 |
+
|
1910 |
+
this.$selection.on('focusout', '.select2-search--inline', function (evt) {
|
1911 |
+
self._handleBlur(evt);
|
1912 |
+
});
|
1913 |
+
|
1914 |
+
this.$selection.on('keydown', '.select2-search--inline', function (evt) {
|
1915 |
+
evt.stopPropagation();
|
1916 |
+
|
1917 |
+
self.trigger('keypress', evt);
|
1918 |
+
|
1919 |
+
self._keyUpPrevented = evt.isDefaultPrevented();
|
1920 |
+
|
1921 |
+
var key = evt.which;
|
1922 |
+
|
1923 |
+
if (key === KEYS.BACKSPACE && self.$search.val() === '') {
|
1924 |
+
var $previousChoice = self.$searchContainer
|
1925 |
+
.prev('.select2-selection__choice');
|
1926 |
+
|
1927 |
+
if ($previousChoice.length > 0) {
|
1928 |
+
var item = $previousChoice.data('data');
|
1929 |
+
|
1930 |
+
self.searchRemoveChoice(item);
|
1931 |
+
|
1932 |
+
evt.preventDefault();
|
1933 |
+
}
|
1934 |
+
}
|
1935 |
+
});
|
1936 |
+
|
1937 |
+
// Try to detect the IE version should the `documentMode` property that
|
1938 |
+
// is stored on the document. This is only implemented in IE and is
|
1939 |
+
// slightly cleaner than doing a user agent check.
|
1940 |
+
// This property is not available in Edge, but Edge also doesn't have
|
1941 |
+
// this bug.
|
1942 |
+
var msie = document.documentMode;
|
1943 |
+
var disableInputEvents = msie && msie <= 11;
|
1944 |
+
|
1945 |
+
// Workaround for browsers which do not support the `input` event
|
1946 |
+
// This will prevent double-triggering of events for browsers which support
|
1947 |
+
// both the `keyup` and `input` events.
|
1948 |
+
this.$selection.on(
|
1949 |
+
'input.searchcheck',
|
1950 |
+
'.select2-search--inline',
|
1951 |
+
function (evt) {
|
1952 |
+
// IE will trigger the `input` event when a placeholder is used on a
|
1953 |
+
// search box. To get around this issue, we are forced to ignore all
|
1954 |
+
// `input` events in IE and keep using `keyup`.
|
1955 |
+
if (disableInputEvents) {
|
1956 |
+
self.$selection.off('input.search input.searchcheck');
|
1957 |
+
return;
|
1958 |
+
}
|
1959 |
+
|
1960 |
+
// Unbind the duplicated `keyup` event
|
1961 |
+
self.$selection.off('keyup.search');
|
1962 |
+
}
|
1963 |
+
);
|
1964 |
+
|
1965 |
+
this.$selection.on(
|
1966 |
+
'keyup.search input.search',
|
1967 |
+
'.select2-search--inline',
|
1968 |
+
function (evt) {
|
1969 |
+
// IE will trigger the `input` event when a placeholder is used on a
|
1970 |
+
// search box. To get around this issue, we are forced to ignore all
|
1971 |
+
// `input` events in IE and keep using `keyup`.
|
1972 |
+
if (disableInputEvents && evt.type === 'input') {
|
1973 |
+
self.$selection.off('input.search input.searchcheck');
|
1974 |
+
return;
|
1975 |
+
}
|
1976 |
+
|
1977 |
+
var key = evt.which;
|
1978 |
+
|
1979 |
+
// We can freely ignore events from modifier keys
|
1980 |
+
if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
|
1981 |
+
return;
|
1982 |
+
}
|
1983 |
+
|
1984 |
+
// Tabbing will be handled during the `keydown` phase
|
1985 |
+
if (key == KEYS.TAB) {
|
1986 |
+
return;
|
1987 |
+
}
|
1988 |
+
|
1989 |
+
self.handleSearch(evt);
|
1990 |
+
}
|
1991 |
+
);
|
1992 |
+
};
|
1993 |
+
|
1994 |
+
/**
|
1995 |
+
* This method will transfer the tabindex attribute from the rendered
|
1996 |
+
* selection to the search box. This allows for the search box to be used as
|
1997 |
+
* the primary focus instead of the selection container.
|
1998 |
+
*
|
1999 |
+
* @private
|
2000 |
+
*/
|
2001 |
+
Search.prototype._transferTabIndex = function (decorated) {
|
2002 |
+
this.$search.attr('tabindex', this.$selection.attr('tabindex'));
|
2003 |
+
this.$selection.attr('tabindex', '-1');
|
2004 |
+
};
|
2005 |
+
|
2006 |
+
Search.prototype.createPlaceholder = function (decorated, placeholder) {
|
2007 |
+
this.$search.attr('placeholder', placeholder.text);
|
2008 |
+
};
|
2009 |
+
|
2010 |
+
Search.prototype.update = function (decorated, data) {
|
2011 |
+
var searchHadFocus = this.$search[0] == document.activeElement;
|
2012 |
+
|
2013 |
+
this.$search.attr('placeholder', '');
|
2014 |
+
|
2015 |
+
decorated.call(this, data);
|
2016 |
+
|
2017 |
+
this.$selection.find('.select2-selection__rendered')
|
2018 |
+
.append(this.$searchContainer);
|
2019 |
+
|
2020 |
+
this.resizeSearch();
|
2021 |
+
if (searchHadFocus) {
|
2022 |
+
this.$search.focus();
|
2023 |
+
}
|
2024 |
+
};
|
2025 |
+
|
2026 |
+
Search.prototype.handleSearch = function () {
|
2027 |
+
this.resizeSearch();
|
2028 |
+
|
2029 |
+
if (!this._keyUpPrevented) {
|
2030 |
+
var input = this.$search.val();
|
2031 |
+
|
2032 |
+
this.trigger('query', {
|
2033 |
+
term: input
|
2034 |
+
});
|
2035 |
+
}
|
2036 |
+
|
2037 |
+
this._keyUpPrevented = false;
|
2038 |
+
};
|
2039 |
+
|
2040 |
+
Search.prototype.searchRemoveChoice = function (decorated, item) {
|
2041 |
+
this.trigger('unselect', {
|
2042 |
+
data: item
|
2043 |
+
});
|
2044 |
+
|
2045 |
+
this.$search.val(item.text);
|
2046 |
+
this.handleSearch();
|
2047 |
+
};
|
2048 |
+
|
2049 |
+
Search.prototype.resizeSearch = function () {
|
2050 |
+
this.$search.css('width', '25px');
|
2051 |
+
|
2052 |
+
var width = '';
|
2053 |
+
|
2054 |
+
if (this.$search.attr('placeholder') !== '') {
|
2055 |
+
width = this.$selection.find('.select2-selection__rendered').innerWidth();
|
2056 |
+
} else {
|
2057 |
+
var minimumWidth = this.$search.val().length + 1;
|
2058 |
+
|
2059 |
+
width = (minimumWidth * 0.75) + 'em';
|
2060 |
+
}
|
2061 |
+
|
2062 |
+
this.$search.css('width', width);
|
2063 |
+
};
|
2064 |
+
|
2065 |
+
return Search;
|
2066 |
+
});
|
2067 |
+
|
2068 |
+
S2.define('select2/selection/eventRelay',[
|
2069 |
+
'jquery'
|
2070 |
+
], function ($) {
|
2071 |
+
function EventRelay () { }
|
2072 |
+
|
2073 |
+
EventRelay.prototype.bind = function (decorated, container, $container) {
|
2074 |
+
var self = this;
|
2075 |
+
var relayEvents = [
|
2076 |
+
'open', 'opening',
|
2077 |
+
'close', 'closing',
|
2078 |
+
'select', 'selecting',
|
2079 |
+
'unselect', 'unselecting'
|
2080 |
+
];
|
2081 |
+
|
2082 |
+
var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
|
2083 |
+
|
2084 |
+
decorated.call(this, container, $container);
|
2085 |
+
|
2086 |
+
container.on('*', function (name, params) {
|
2087 |
+
// Ignore events that should not be relayed
|
2088 |
+
if ($.inArray(name, relayEvents) === -1) {
|
2089 |
+
return;
|
2090 |
+
}
|
2091 |
+
|
2092 |
+
// The parameters should always be an object
|
2093 |
+
params = params || {};
|
2094 |
+
|
2095 |
+
// Generate the jQuery event for the Select2 event
|
2096 |
+
var evt = $.Event('select2:' + name, {
|
2097 |
+
params: params
|
2098 |
+
});
|
2099 |
+
|
2100 |
+
self.$element.trigger(evt);
|
2101 |
+
|
2102 |
+
// Only handle preventable events if it was one
|
2103 |
+
if ($.inArray(name, preventableEvents) === -1) {
|
2104 |
+
return;
|
2105 |
+
}
|
2106 |
+
|
2107 |
+
params.prevented = evt.isDefaultPrevented();
|
2108 |
+
});
|
2109 |
+
};
|
2110 |
+
|
2111 |
+
return EventRelay;
|
2112 |
+
});
|
2113 |
+
|
2114 |
+
S2.define('select2/translation',[
|
2115 |
+
'jquery',
|
2116 |
+
'require'
|
2117 |
+
], function ($, require) {
|
2118 |
+
function Translation (dict) {
|
2119 |
+
this.dict = dict || {};
|
2120 |
+
}
|
2121 |
+
|
2122 |
+
Translation.prototype.all = function () {
|
2123 |
+
return this.dict;
|
2124 |
+
};
|
2125 |
+
|
2126 |
+
Translation.prototype.get = function (key) {
|
2127 |
+
return this.dict[key];
|
2128 |
+
};
|
2129 |
+
|
2130 |
+
Translation.prototype.extend = function (translation) {
|
2131 |
+
this.dict = $.extend({}, translation.all(), this.dict);
|
2132 |
+
};
|
2133 |
+
|
2134 |
+
// Static functions
|
2135 |
+
|
2136 |
+
Translation._cache = {};
|
2137 |
+
|
2138 |
+
Translation.loadPath = function (path) {
|
2139 |
+
if (!(path in Translation._cache)) {
|
2140 |
+
var translations = require(path);
|
2141 |
+
|
2142 |
+
Translation._cache[path] = translations;
|
2143 |
+
}
|
2144 |
+
|
2145 |
+
return new Translation(Translation._cache[path]);
|
2146 |
+
};
|
2147 |
+
|
2148 |
+
return Translation;
|
2149 |
+
});
|
2150 |
+
|
2151 |
+
S2.define('select2/diacritics',[
|
2152 |
+
|
2153 |
+
], function () {
|
2154 |
+
var diacritics = {
|
2155 |
+
'\u24B6': 'A',
|
2156 |
+
'\uFF21': 'A',
|
2157 |
+
'\u00C0': 'A',
|
2158 |
+
'\u00C1': 'A',
|
2159 |
+
'\u00C2': 'A',
|
2160 |
+
'\u1EA6': 'A',
|
2161 |
+
'\u1EA4': 'A',
|
2162 |
+
'\u1EAA': 'A',
|
2163 |
+
'\u1EA8': 'A',
|
2164 |
+
'\u00C3': 'A',
|
2165 |
+
'\u0100': 'A',
|
2166 |
+
'\u0102': 'A',
|
2167 |
+
'\u1EB0': 'A',
|
2168 |
+
'\u1EAE': 'A',
|
2169 |
+
'\u1EB4': 'A',
|
2170 |
+
'\u1EB2': 'A',
|
2171 |
+
'\u0226': 'A',
|
2172 |
+
'\u01E0': 'A',
|
2173 |
+
'\u00C4': 'A',
|
2174 |
+
'\u01DE': 'A',
|
2175 |
+
'\u1EA2': 'A',
|
2176 |
+
'\u00C5': 'A',
|
2177 |
+
'\u01FA': 'A',
|
2178 |
+
'\u01CD': 'A',
|
2179 |
+
'\u0200': 'A',
|
2180 |
+
'\u0202': 'A',
|
2181 |
+
'\u1EA0': 'A',
|
2182 |
+
'\u1EAC': 'A',
|
2183 |
+
'\u1EB6': 'A',
|
2184 |
+
'\u1E00': 'A',
|
2185 |
+
'\u0104': 'A',
|
2186 |
+
'\u023A': 'A',
|
2187 |
+
'\u2C6F': 'A',
|
2188 |
+
'\uA732': 'AA',
|
2189 |
+
'\u00C6': 'AE',
|
2190 |
+
'\u01FC': 'AE',
|
2191 |
+
'\u01E2': 'AE',
|
2192 |
+
'\uA734': 'AO',
|
2193 |
+
'\uA736': 'AU',
|
2194 |
+
'\uA738': 'AV',
|
2195 |
+
'\uA73A': 'AV',
|
2196 |
+
'\uA73C': 'AY',
|
2197 |
+
'\u24B7': 'B',
|
2198 |
+
'\uFF22': 'B',
|
2199 |
+
'\u1E02': 'B',
|
2200 |
+
'\u1E04': 'B',
|
2201 |
+
'\u1E06': 'B',
|
2202 |
+
'\u0243': 'B',
|
2203 |
+
'\u0182': 'B',
|
2204 |
+
'\u0181': 'B',
|
2205 |
+
'\u24B8': 'C',
|
2206 |
+
'\uFF23': 'C',
|
2207 |
+
'\u0106': 'C',
|
2208 |
+
'\u0108': 'C',
|
2209 |
+
'\u010A': 'C',
|
2210 |
+
'\u010C': 'C',
|
2211 |
+
'\u00C7': 'C',
|
2212 |
+
'\u1E08': 'C',
|
2213 |
+
'\u0187': 'C',
|
2214 |
+
'\u023B': 'C',
|
2215 |
+
'\uA73E': 'C',
|
2216 |
+
'\u24B9': 'D',
|
2217 |
+
'\uFF24': 'D',
|
2218 |
+
'\u1E0A': 'D',
|
2219 |
+
'\u010E': 'D',
|
2220 |
+
'\u1E0C': 'D',
|
2221 |
+
'\u1E10': 'D',
|
2222 |
+
'\u1E12': 'D',
|
2223 |
+
'\u1E0E': 'D',
|
2224 |
+
'\u0110': 'D',
|
2225 |
+
'\u018B': 'D',
|
2226 |
+
'\u018A': 'D',
|
2227 |
+
'\u0189': 'D',
|
2228 |
+
'\uA779': 'D',
|
2229 |
+
'\u01F1': 'DZ',
|
2230 |
+
'\u01C4': 'DZ',
|
2231 |
+
'\u01F2': 'Dz',
|
2232 |
+
'\u01C5': 'Dz',
|
2233 |
+
'\u24BA': 'E',
|
2234 |
+
'\uFF25': 'E',
|
2235 |
+
'\u00C8': 'E',
|
2236 |
+
'\u00C9': 'E',
|
2237 |
+
'\u00CA': 'E',
|
2238 |
+
'\u1EC0': 'E',
|
2239 |
+
'\u1EBE': 'E',
|
2240 |
+
'\u1EC4': 'E',
|
2241 |
+
'\u1EC2': 'E',
|
2242 |
+
'\u1EBC': 'E',
|
2243 |
+
'\u0112': 'E',
|
2244 |
+
'\u1E14': 'E',
|
2245 |
+
'\u1E16': 'E',
|
2246 |
+
'\u0114': 'E',
|
2247 |
+
'\u0116': 'E',
|
2248 |
+
'\u00CB': 'E',
|
2249 |
+
'\u1EBA': 'E',
|
2250 |
+
'\u011A': 'E',
|
2251 |
+
'\u0204': 'E',
|
2252 |
+
'\u0206': 'E',
|
2253 |
+
'\u1EB8': 'E',
|
2254 |
+
'\u1EC6': 'E',
|
2255 |
+
'\u0228': 'E',
|
2256 |
+
'\u1E1C': 'E',
|
2257 |
+
'\u0118': 'E',
|
2258 |
+
'\u1E18': 'E',
|
2259 |
+
'\u1E1A': 'E',
|
2260 |
+
'\u0190': 'E',
|
2261 |
+
'\u018E': 'E',
|
2262 |
+
'\u24BB': 'F',
|
2263 |
+
'\uFF26': 'F',
|
2264 |
+
'\u1E1E': 'F',
|
2265 |
+
'\u0191': 'F',
|
2266 |
+
'\uA77B': 'F',
|
2267 |
+
'\u24BC': 'G',
|
2268 |
+
'\uFF27': 'G',
|
2269 |
+
'\u01F4': 'G',
|
2270 |
+
'\u011C': 'G',
|
2271 |
+
'\u1E20': 'G',
|
2272 |
+
'\u011E': 'G',
|
2273 |
+
'\u0120': 'G',
|
2274 |
+
'\u01E6': 'G',
|
2275 |
+
'\u0122': 'G',
|
2276 |
+
'\u01E4': 'G',
|
2277 |
+
'\u0193': 'G',
|
2278 |
+
'\uA7A0': 'G',
|
2279 |
+
'\uA77D': 'G',
|
2280 |
+
'\uA77E': 'G',
|
2281 |
+
'\u24BD': 'H',
|
2282 |
+
'\uFF28': 'H',
|
2283 |
+
'\u0124': 'H',
|
2284 |
+
'\u1E22': 'H',
|
2285 |
+
'\u1E26': 'H',
|
2286 |
+
'\u021E': 'H',
|
2287 |
+
'\u1E24': 'H',
|
2288 |
+
'\u1E28': 'H',
|
2289 |
+
'\u1E2A': 'H',
|
2290 |
+
'\u0126': 'H',
|
2291 |
+
'\u2C67': 'H',
|
2292 |
+
'\u2C75': 'H',
|
2293 |
+
'\uA78D': 'H',
|
2294 |
+
'\u24BE': 'I',
|
2295 |
+
'\uFF29': 'I',
|
2296 |
+
'\u00CC': 'I',
|
2297 |
+
'\u00CD': 'I',
|
2298 |
+
'\u00CE': 'I',
|
2299 |
+
'\u0128': 'I',
|
2300 |
+
'\u012A': 'I',
|
2301 |
+
'\u012C': 'I',
|
2302 |
+
'\u0130': 'I',
|
2303 |
+
'\u00CF': 'I',
|
2304 |
+
'\u1E2E': 'I',
|
2305 |
+
'\u1EC8': 'I',
|
2306 |
+
'\u01CF': 'I',
|
2307 |
+
'\u0208': 'I',
|
2308 |
+
'\u020A': 'I',
|
2309 |
+
'\u1ECA': 'I',
|
2310 |
+
'\u012E': 'I',
|
2311 |
+
'\u1E2C': 'I',
|
2312 |
+
'\u0197': 'I',
|
2313 |
+
'\u24BF': 'J',
|
2314 |
+
'\uFF2A': 'J',
|
2315 |
+
'\u0134': 'J',
|
2316 |
+
'\u0248': 'J',
|
2317 |
+
'\u24C0': 'K',
|
2318 |
+
'\uFF2B': 'K',
|
2319 |
+
'\u1E30': 'K',
|
2320 |
+
'\u01E8': 'K',
|
2321 |
+
'\u1E32': 'K',
|
2322 |
+
'\u0136': 'K',
|
2323 |
+
'\u1E34': 'K',
|
2324 |
+
'\u0198': 'K',
|
2325 |
+
'\u2C69': 'K',
|
2326 |
+
'\uA740': 'K',
|
2327 |
+
'\uA742': 'K',
|
2328 |
+
'\uA744': 'K',
|
2329 |
+
'\uA7A2': 'K',
|
2330 |
+
'\u24C1': 'L',
|
2331 |
+
'\uFF2C': 'L',
|
2332 |
+
'\u013F': 'L',
|
2333 |
+
'\u0139': 'L',
|
2334 |
+
'\u013D': 'L',
|
2335 |
+
'\u1E36': 'L',
|
2336 |
+
'\u1E38': 'L',
|
2337 |
+
'\u013B': 'L',
|
2338 |
+
'\u1E3C': 'L',
|
2339 |
+
'\u1E3A': 'L',
|
2340 |
+
'\u0141': 'L',
|
2341 |
+
'\u023D': 'L',
|
2342 |
+
'\u2C62': 'L',
|
2343 |
+
'\u2C60': 'L',
|
2344 |
+
'\uA748': 'L',
|
2345 |
+
'\uA746': 'L',
|
2346 |
+
'\uA780': 'L',
|
2347 |
+
'\u01C7': 'LJ',
|
2348 |
+
'\u01C8': 'Lj',
|
2349 |
+
'\u24C2': 'M',
|
2350 |
+
'\uFF2D': 'M',
|
2351 |
+
'\u1E3E': 'M',
|
2352 |
+
'\u1E40': 'M',
|
2353 |
+
'\u1E42': 'M',
|
2354 |
+
'\u2C6E': 'M',
|
2355 |
+
'\u019C': 'M',
|
2356 |
+
'\u24C3': 'N',
|
2357 |
+
'\uFF2E': 'N',
|
2358 |
+
'\u01F8': 'N',
|
2359 |
+
'\u0143': 'N',
|
2360 |
+
'\u00D1': 'N',
|
2361 |
+
'\u1E44': 'N',
|
2362 |
+
'\u0147': 'N',
|
2363 |
+
'\u1E46': 'N',
|
2364 |
+
'\u0145': 'N',
|
2365 |
+
'\u1E4A': 'N',
|
2366 |
+
'\u1E48': 'N',
|
2367 |
+
'\u0220': 'N',
|
2368 |
+
'\u019D': 'N',
|
2369 |
+
'\uA790': 'N',
|
2370 |
+
'\uA7A4': 'N',
|
2371 |
+
'\u01CA': 'NJ',
|
2372 |
+
'\u01CB': 'Nj',
|
2373 |
+
'\u24C4': 'O',
|
2374 |
+
'\uFF2F': 'O',
|
2375 |
+
'\u00D2': 'O',
|
2376 |
+
'\u00D3': 'O',
|
2377 |
+
'\u00D4': 'O',
|
2378 |
+
'\u1ED2': 'O',
|
2379 |
+
'\u1ED0': 'O',
|
2380 |
+
'\u1ED6': 'O',
|
2381 |
+
'\u1ED4': 'O',
|
2382 |
+
'\u00D5': 'O',
|
2383 |
+
'\u1E4C': 'O',
|
2384 |
+
'\u022C': 'O',
|
2385 |
+
'\u1E4E': 'O',
|
2386 |
+
'\u014C': 'O',
|
2387 |
+
'\u1E50': 'O',
|
2388 |
+
'\u1E52': 'O',
|
2389 |
+
'\u014E': 'O',
|
2390 |
+
'\u022E': 'O',
|
2391 |
+
'\u0230': 'O',
|
2392 |
+
'\u00D6': 'O',
|
2393 |
+
'\u022A': 'O',
|
2394 |
+
'\u1ECE': 'O',
|
2395 |
+
'\u0150': 'O',
|
2396 |
+
'\u01D1': 'O',
|
2397 |
+
'\u020C': 'O',
|
2398 |
+
'\u020E': 'O',
|
2399 |
+
'\u01A0': 'O',
|
2400 |
+
'\u1EDC': 'O',
|
2401 |
+
'\u1EDA': 'O',
|
2402 |
+
'\u1EE0': 'O',
|
2403 |
+
'\u1EDE': 'O',
|
2404 |
+
'\u1EE2': 'O',
|
2405 |
+
'\u1ECC': 'O',
|
2406 |
+
'\u1ED8': 'O',
|
2407 |
+
'\u01EA': 'O',
|
2408 |
+
'\u01EC': 'O',
|
2409 |
+
'\u00D8': 'O',
|
2410 |
+
'\u01FE': 'O',
|
2411 |
+
'\u0186': 'O',
|
2412 |
+
'\u019F': 'O',
|
2413 |
+
'\uA74A': 'O',
|
2414 |
+
'\uA74C': 'O',
|
2415 |
+
'\u01A2': 'OI',
|
2416 |
+
'\uA74E': 'OO',
|
2417 |
+
'\u0222': 'OU',
|
2418 |
+
'\u24C5': 'P',
|
2419 |
+
'\uFF30': 'P',
|
2420 |
+
'\u1E54': 'P',
|
2421 |
+
'\u1E56': 'P',
|
2422 |
+
'\u01A4': 'P',
|
2423 |
+
'\u2C63': 'P',
|
2424 |
+
'\uA750': 'P',
|
2425 |
+
'\uA752': 'P',
|
2426 |
+
'\uA754': 'P',
|
2427 |
+
'\u24C6': 'Q',
|
2428 |
+
'\uFF31': 'Q',
|
2429 |
+
'\uA756': 'Q',
|
2430 |
+
'\uA758': 'Q',
|
2431 |
+
'\u024A': 'Q',
|
2432 |
+
'\u24C7': 'R',
|
2433 |
+
'\uFF32': 'R',
|
2434 |
+
'\u0154': 'R',
|
2435 |
+
'\u1E58': 'R',
|
2436 |
+
'\u0158': 'R',
|
2437 |
+
'\u0210': 'R',
|
2438 |
+
'\u0212': 'R',
|
2439 |
+
'\u1E5A': 'R',
|
2440 |
+
'\u1E5C': 'R',
|
2441 |
+
'\u0156': 'R',
|
2442 |
+
'\u1E5E': 'R',
|
2443 |
+
'\u024C': 'R',
|
2444 |
+
'\u2C64': 'R',
|
2445 |
+
'\uA75A': 'R',
|
2446 |
+
'\uA7A6': 'R',
|
2447 |
+
'\uA782': 'R',
|
2448 |
+
'\u24C8': 'S',
|
2449 |
+
'\uFF33': 'S',
|
2450 |
+
'\u1E9E': 'S',
|
2451 |
+
'\u015A': 'S',
|
2452 |
+
'\u1E64': 'S',
|
2453 |
+
'\u015C': 'S',
|
2454 |
+
'\u1E60': 'S',
|
2455 |
+
'\u0160': 'S',
|
2456 |
+
'\u1E66': 'S',
|
2457 |
+
'\u1E62': 'S',
|
2458 |
+
'\u1E68': 'S',
|
2459 |
+
'\u0218': 'S',
|
2460 |
+
'\u015E': 'S',
|
2461 |
+
'\u2C7E': 'S',
|
2462 |
+
'\uA7A8': 'S',
|
2463 |
+
'\uA784': 'S',
|
2464 |
+
'\u24C9': 'T',
|
2465 |
+
'\uFF34': 'T',
|
2466 |
+
'\u1E6A': 'T',
|
2467 |
+
'\u0164': 'T',
|
2468 |
+
'\u1E6C': 'T',
|
2469 |
+
'\u021A': 'T',
|
2470 |
+
'\u0162': 'T',
|
2471 |
+
'\u1E70': 'T',
|
2472 |
+
'\u1E6E': 'T',
|
2473 |
+
'\u0166': 'T',
|
2474 |
+
'\u01AC': 'T',
|
2475 |
+
'\u01AE': 'T',
|
2476 |
+
'\u023E': 'T',
|
2477 |
+
'\uA786': 'T',
|
2478 |
+
'\uA728': 'TZ',
|
2479 |
+
'\u24CA': 'U',
|
2480 |
+
'\uFF35': 'U',
|
2481 |
+
'\u00D9': 'U',
|
2482 |
+
'\u00DA': 'U',
|
2483 |
+
'\u00DB': 'U',
|
2484 |
+
'\u0168': 'U',
|
2485 |
+
'\u1E78': 'U',
|
2486 |
+
'\u016A': 'U',
|
2487 |
+
'\u1E7A': 'U',
|
2488 |
+
'\u016C': 'U',
|
2489 |
+
'\u00DC': 'U',
|
2490 |
+
'\u01DB': 'U',
|
2491 |
+
'\u01D7': 'U',
|
2492 |
+
'\u01D5': 'U',
|
2493 |
+
'\u01D9': 'U',
|
2494 |
+
'\u1EE6': 'U',
|
2495 |
+
'\u016E': 'U',
|
2496 |
+
'\u0170': 'U',
|
2497 |
+
'\u01D3': 'U',
|
2498 |
+
'\u0214': 'U',
|
2499 |
+
'\u0216': 'U',
|
2500 |
+
'\u01AF': 'U',
|
2501 |
+
'\u1EEA': 'U',
|
2502 |
+
'\u1EE8': 'U',
|
2503 |
+
'\u1EEE': 'U',
|
2504 |
+
'\u1EEC': 'U',
|
2505 |
+
'\u1EF0': 'U',
|
2506 |
+
'\u1EE4': 'U',
|
2507 |
+
'\u1E72': 'U',
|
2508 |
+
'\u0172': 'U',
|
2509 |
+
'\u1E76': 'U',
|
2510 |
+
'\u1E74': 'U',
|
2511 |
+
'\u0244': 'U',
|
2512 |
+
'\u24CB': 'V',
|
2513 |
+
'\uFF36': 'V',
|
2514 |
+
'\u1E7C': 'V',
|
2515 |
+
'\u1E7E': 'V',
|
2516 |
+
'\u01B2': 'V',
|
2517 |
+
'\uA75E': 'V',
|
2518 |
+
'\u0245': 'V',
|
2519 |
+
'\uA760': 'VY',
|
2520 |
+
'\u24CC': 'W',
|
2521 |
+
'\uFF37': 'W',
|
2522 |
+
'\u1E80': 'W',
|
2523 |
+
'\u1E82': 'W',
|
2524 |
+
'\u0174': 'W',
|
2525 |
+
'\u1E86': 'W',
|
2526 |
+
'\u1E84': 'W',
|
2527 |
+
'\u1E88': 'W',
|
2528 |
+
'\u2C72': 'W',
|
2529 |
+
'\u24CD': 'X',
|
2530 |
+
'\uFF38': 'X',
|
2531 |
+
'\u1E8A': 'X',
|
2532 |
+
'\u1E8C': 'X',
|
2533 |
+
'\u24CE': 'Y',
|
2534 |
+
'\uFF39': 'Y',
|
2535 |
+
'\u1EF2': 'Y',
|
2536 |
+
'\u00DD': 'Y',
|
2537 |
+
'\u0176': 'Y',
|
2538 |
+
'\u1EF8': 'Y',
|
2539 |
+
'\u0232': 'Y',
|
2540 |
+
'\u1E8E': 'Y',
|
2541 |
+
'\u0178': 'Y',
|
2542 |
+
'\u1EF6': 'Y',
|
2543 |
+
'\u1EF4': 'Y',
|
2544 |
+
'\u01B3': 'Y',
|
2545 |
+
'\u024E': 'Y',
|
2546 |
+
'\u1EFE': 'Y',
|
2547 |
+
'\u24CF': 'Z',
|
2548 |
+
'\uFF3A': 'Z',
|
2549 |
+
'\u0179': 'Z',
|
2550 |
+
'\u1E90': 'Z',
|
2551 |
+
'\u017B': 'Z',
|
2552 |
+
'\u017D': 'Z',
|
2553 |
+
'\u1E92': 'Z',
|
2554 |
+
'\u1E94': 'Z',
|
2555 |
+
'\u01B5': 'Z',
|
2556 |
+
'\u0224': 'Z',
|
2557 |
+
'\u2C7F': 'Z',
|
2558 |
+
'\u2C6B': 'Z',
|
2559 |
+
'\uA762': 'Z',
|
2560 |
+
'\u24D0': 'a',
|
2561 |
+
'\uFF41': 'a',
|
2562 |
+
'\u1E9A': 'a',
|
2563 |
+
'\u00E0': 'a',
|
2564 |
+
'\u00E1': 'a',
|
2565 |
+
'\u00E2': 'a',
|
2566 |
+
'\u1EA7': 'a',
|
2567 |
+
'\u1EA5': 'a',
|
2568 |
+
'\u1EAB': 'a',
|
2569 |
+
'\u1EA9': 'a',
|
2570 |
+
'\u00E3': 'a',
|
2571 |
+
'\u0101': 'a',
|
2572 |
+
'\u0103': 'a',
|
2573 |
+
'\u1EB1': 'a',
|
2574 |
+
'\u1EAF': 'a',
|
2575 |
+
'\u1EB5': 'a',
|
2576 |
+
'\u1EB3': 'a',
|
2577 |
+
'\u0227': 'a',
|
2578 |
+
'\u01E1': 'a',
|
2579 |
+
'\u00E4': 'a',
|
2580 |
+
'\u01DF': 'a',
|
2581 |
+
'\u1EA3': 'a',
|
2582 |
+
'\u00E5': 'a',
|
2583 |
+
'\u01FB': 'a',
|
2584 |
+
'\u01CE': 'a',
|
2585 |
+
'\u0201': 'a',
|
2586 |
+
'\u0203': 'a',
|
2587 |
+
'\u1EA1': 'a',
|
2588 |
+
'\u1EAD': 'a',
|
2589 |
+
'\u1EB7': 'a',
|
2590 |
+
'\u1E01': 'a',
|
2591 |
+
'\u0105': 'a',
|
2592 |
+
'\u2C65': 'a',
|
2593 |
+
'\u0250': 'a',
|
2594 |
+
'\uA733': 'aa',
|
2595 |
+
'\u00E6': 'ae',
|
2596 |
+
'\u01FD': 'ae',
|
2597 |
+
'\u01E3': 'ae',
|
2598 |
+
'\uA735': 'ao',
|
2599 |
+
'\uA737': 'au',
|
2600 |
+
'\uA739': 'av',
|
2601 |
+
'\uA73B': 'av',
|
2602 |
+
'\uA73D': 'ay',
|
2603 |
+
'\u24D1': 'b',
|
2604 |
+
'\uFF42': 'b',
|
2605 |
+
'\u1E03': 'b',
|
2606 |
+
'\u1E05': 'b',
|
2607 |
+
'\u1E07': 'b',
|
2608 |
+
'\u0180': 'b',
|
2609 |
+
'\u0183': 'b',
|
2610 |
+
'\u0253': 'b',
|
2611 |
+
'\u24D2': 'c',
|
2612 |
+
'\uFF43': 'c',
|
2613 |
+
'\u0107': 'c',
|
2614 |
+
'\u0109': 'c',
|
2615 |
+
'\u010B': 'c',
|
2616 |
+
'\u010D': 'c',
|
2617 |
+
'\u00E7': 'c',
|
2618 |
+
'\u1E09': 'c',
|
2619 |
+
'\u0188': 'c',
|
2620 |
+
'\u023C': 'c',
|
2621 |
+
'\uA73F': 'c',
|
2622 |
+
'\u2184': 'c',
|
2623 |
+
'\u24D3': 'd',
|
2624 |
+
'\uFF44': 'd',
|
2625 |
+
'\u1E0B': 'd',
|
2626 |
+
'\u010F': 'd',
|
2627 |
+
'\u1E0D': 'd',
|
2628 |
+
'\u1E11': 'd',
|
2629 |
+
'\u1E13': 'd',
|
2630 |
+
'\u1E0F': 'd',
|
2631 |
+
'\u0111': 'd',
|
2632 |
+
'\u018C': 'd',
|
2633 |
+
'\u0256': 'd',
|
2634 |
+
'\u0257': 'd',
|
2635 |
+
'\uA77A': 'd',
|
2636 |
+
'\u01F3': 'dz',
|
2637 |
+
'\u01C6': 'dz',
|
2638 |
+
'\u24D4': 'e',
|
2639 |
+
'\uFF45': 'e',
|
2640 |
+
'\u00E8': 'e',
|
2641 |
+
'\u00E9': 'e',
|
2642 |
+
'\u00EA': 'e',
|
2643 |
+
'\u1EC1': 'e',
|
2644 |
+
'\u1EBF': 'e',
|
2645 |
+
'\u1EC5': 'e',
|
2646 |
+
'\u1EC3': 'e',
|
2647 |
+
'\u1EBD': 'e',
|
2648 |
+
'\u0113': 'e',
|
2649 |
+
'\u1E15': 'e',
|
2650 |
+
'\u1E17': 'e',
|
2651 |
+
'\u0115': 'e',
|
2652 |
+
'\u0117': 'e',
|
2653 |
+
'\u00EB': 'e',
|
2654 |
+
'\u1EBB': 'e',
|
2655 |
+
'\u011B': 'e',
|
2656 |
+
'\u0205': 'e',
|
2657 |
+
'\u0207': 'e',
|
2658 |
+
'\u1EB9': 'e',
|
2659 |
+
'\u1EC7': 'e',
|
2660 |
+
'\u0229': 'e',
|
2661 |
+
'\u1E1D': 'e',
|
2662 |
+
'\u0119': 'e',
|
2663 |
+
'\u1E19': 'e',
|
2664 |
+
'\u1E1B': 'e',
|
2665 |
+
'\u0247': 'e',
|
2666 |
+
'\u025B': 'e',
|
2667 |
+
'\u01DD': 'e',
|
2668 |
+
'\u24D5': 'f',
|
2669 |
+
'\uFF46': 'f',
|
2670 |
+
'\u1E1F': 'f',
|
2671 |
+
'\u0192': 'f',
|
2672 |
+
'\uA77C': 'f',
|
2673 |
+
'\u24D6': 'g',
|
2674 |
+
'\uFF47': 'g',
|
2675 |
+
'\u01F5': 'g',
|
2676 |
+
'\u011D': 'g',
|
2677 |
+
'\u1E21': 'g',
|
2678 |
+
'\u011F': 'g',
|
2679 |
+
'\u0121': 'g',
|
2680 |
+
'\u01E7': 'g',
|
2681 |
+
'\u0123': 'g',
|
2682 |
+
'\u01E5': 'g',
|
2683 |
+
'\u0260': 'g',
|
2684 |
+
'\uA7A1': 'g',
|
2685 |
+
'\u1D79': 'g',
|
2686 |
+
'\uA77F': 'g',
|
2687 |
+
'\u24D7': 'h',
|
2688 |
+
'\uFF48': 'h',
|
2689 |
+
'\u0125': 'h',
|
2690 |
+
'\u1E23': 'h',
|
2691 |
+
'\u1E27': 'h',
|
2692 |
+
'\u021F': 'h',
|
2693 |
+
'\u1E25': 'h',
|
2694 |
+
'\u1E29': 'h',
|
2695 |
+
'\u1E2B': 'h',
|
2696 |
+
'\u1E96': 'h',
|
2697 |
+
'\u0127': 'h',
|
2698 |
+
'\u2C68': 'h',
|
2699 |
+
'\u2C76': 'h',
|
2700 |
+
'\u0265': 'h',
|
2701 |
+
'\u0195': 'hv',
|
2702 |
+
'\u24D8': 'i',
|
2703 |
+
'\uFF49': 'i',
|
2704 |
+
'\u00EC': 'i',
|
2705 |
+
'\u00ED': 'i',
|
2706 |
+
'\u00EE': 'i',
|
2707 |
+
'\u0129': 'i',
|
2708 |
+
'\u012B': 'i',
|
2709 |
+
'\u012D': 'i',
|
2710 |
+
'\u00EF': 'i',
|
2711 |
+
'\u1E2F': 'i',
|
2712 |
+
'\u1EC9': 'i',
|
2713 |
+
'\u01D0': 'i',
|
2714 |
+
'\u0209': 'i',
|
2715 |
+
'\u020B': 'i',
|
2716 |
+
'\u1ECB': 'i',
|
2717 |
+
'\u012F': 'i',
|
2718 |
+
'\u1E2D': 'i',
|
2719 |
+
'\u0268': 'i',
|
2720 |
+
'\u0131': 'i',
|
2721 |
+
'\u24D9': 'j',
|
2722 |
+
'\uFF4A': 'j',
|
2723 |
+
'\u0135': 'j',
|
2724 |
+
'\u01F0': 'j',
|
2725 |
+
'\u0249': 'j',
|
2726 |
+
'\u24DA': 'k',
|
2727 |
+
'\uFF4B': 'k',
|
2728 |
+
'\u1E31': 'k',
|
2729 |
+
'\u01E9': 'k',
|
2730 |
+
'\u1E33': 'k',
|
2731 |
+
'\u0137': 'k',
|
2732 |
+
'\u1E35': 'k',
|
2733 |
+
'\u0199': 'k',
|
2734 |
+
'\u2C6A': 'k',
|
2735 |
+
'\uA741': 'k',
|
2736 |
+
'\uA743': 'k',
|
2737 |
+
'\uA745': 'k',
|
2738 |
+
'\uA7A3': 'k',
|
2739 |
+
'\u24DB': 'l',
|
2740 |
+
'\uFF4C': 'l',
|
2741 |
+
'\u0140': 'l',
|
2742 |
+
'\u013A': 'l',
|
2743 |
+
'\u013E': 'l',
|
2744 |
+
'\u1E37': 'l',
|
2745 |
+
'\u1E39': 'l',
|
2746 |
+
'\u013C': 'l',
|
2747 |
+
'\u1E3D': 'l',
|
2748 |
+
'\u1E3B': 'l',
|
2749 |
+
'\u017F': 'l',
|
2750 |
+
'\u0142': 'l',
|
2751 |
+
'\u019A': 'l',
|
2752 |
+
'\u026B': 'l',
|
2753 |
+
'\u2C61': 'l',
|
2754 |
+
'\uA749': 'l',
|
2755 |
+
'\uA781': 'l',
|
2756 |
+
'\uA747': 'l',
|
2757 |
+
'\u01C9': 'lj',
|
2758 |
+
'\u24DC': 'm',
|
2759 |
+
'\uFF4D': 'm',
|
2760 |
+
'\u1E3F': 'm',
|
2761 |
+
'\u1E41': 'm',
|
2762 |
+
'\u1E43': 'm',
|
2763 |
+
'\u0271': 'm',
|
2764 |
+
'\u026F': 'm',
|
2765 |
+
'\u24DD': 'n',
|
2766 |
+
'\uFF4E': 'n',
|
2767 |
+
'\u01F9': 'n',
|
2768 |
+
'\u0144': 'n',
|
2769 |
+
'\u00F1': 'n',
|
2770 |
+
'\u1E45': 'n',
|
2771 |
+
'\u0148': 'n',
|
2772 |
+
'\u1E47': 'n',
|
2773 |
+
'\u0146': 'n',
|
2774 |
+
'\u1E4B': 'n',
|
2775 |
+
'\u1E49': 'n',
|
2776 |
+
'\u019E': 'n',
|
2777 |
+
'\u0272': 'n',
|
2778 |
+
'\u0149': 'n',
|
2779 |
+
'\uA791': 'n',
|
2780 |
+
'\uA7A5': 'n',
|
2781 |
+
'\u01CC': 'nj',
|
2782 |
+
'\u24DE': 'o',
|
2783 |
+
'\uFF4F': 'o',
|
2784 |
+
'\u00F2': 'o',
|
2785 |
+
'\u00F3': 'o',
|
2786 |
+
'\u00F4': 'o',
|
2787 |
+
'\u1ED3': 'o',
|
2788 |
+
'\u1ED1': 'o',
|
2789 |
+
'\u1ED7': 'o',
|
2790 |
+
'\u1ED5': 'o',
|
2791 |
+
'\u00F5': 'o',
|
2792 |
+
'\u1E4D': 'o',
|
2793 |
+
'\u022D': 'o',
|
2794 |
+
'\u1E4F': 'o',
|
2795 |
+
'\u014D': 'o',
|
2796 |
+
'\u1E51': 'o',
|
2797 |
+
'\u1E53': 'o',
|
2798 |
+
'\u014F': 'o',
|
2799 |
+
'\u022F': 'o',
|
2800 |
+
'\u0231': 'o',
|
2801 |
+
'\u00F6': 'o',
|
2802 |
+
'\u022B': 'o',
|
2803 |
+
'\u1ECF': 'o',
|
2804 |
+
'\u0151': 'o',
|
2805 |
+
'\u01D2': 'o',
|
2806 |
+
'\u020D': 'o',
|
2807 |
+
'\u020F': 'o',
|
2808 |
+
'\u01A1': 'o',
|
2809 |
+
'\u1EDD': 'o',
|
2810 |
+
'\u1EDB': 'o',
|
2811 |
+
'\u1EE1': 'o',
|
2812 |
+
'\u1EDF': 'o',
|
2813 |
+
'\u1EE3': 'o',
|
2814 |
+
'\u1ECD': 'o',
|
2815 |
+
'\u1ED9': 'o',
|
2816 |
+
'\u01EB': 'o',
|
2817 |
+
'\u01ED': 'o',
|
2818 |
+
'\u00F8': 'o',
|
2819 |
+
'\u01FF': 'o',
|
2820 |
+
'\u0254': 'o',
|
2821 |
+
'\uA74B': 'o',
|
2822 |
+
'\uA74D': 'o',
|
2823 |
+
'\u0275': 'o',
|
2824 |
+
'\u01A3': 'oi',
|
2825 |
+
'\u0223': 'ou',
|
2826 |
+
'\uA74F': 'oo',
|
2827 |
+
'\u24DF': 'p',
|
2828 |
+
'\uFF50': 'p',
|
2829 |
+
'\u1E55': 'p',
|
2830 |
+
'\u1E57': 'p',
|
2831 |
+
'\u01A5': 'p',
|
2832 |
+
'\u1D7D': 'p',
|
2833 |
+
'\uA751': 'p',
|
2834 |
+
'\uA753': 'p',
|
2835 |
+
'\uA755': 'p',
|
2836 |
+
'\u24E0': 'q',
|
2837 |
+
'\uFF51': 'q',
|
2838 |
+
'\u024B': 'q',
|
2839 |
+
'\uA757': 'q',
|
2840 |
+
'\uA759': 'q',
|
2841 |
+
'\u24E1': 'r',
|
2842 |
+
'\uFF52': 'r',
|
2843 |
+
'\u0155': 'r',
|
2844 |
+
'\u1E59': 'r',
|
2845 |
+
'\u0159': 'r',
|
2846 |
+
'\u0211': 'r',
|
2847 |
+
'\u0213': 'r',
|
2848 |
+
'\u1E5B': 'r',
|
2849 |
+
'\u1E5D': 'r',
|
2850 |
+
'\u0157': 'r',
|
2851 |
+
'\u1E5F': 'r',
|
2852 |
+
'\u024D': 'r',
|
2853 |
+
'\u027D': 'r',
|
2854 |
+
'\uA75B': 'r',
|
2855 |
+
'\uA7A7': 'r',
|
2856 |
+
'\uA783': 'r',
|
2857 |
+
'\u24E2': 's',
|
2858 |
+
'\uFF53': 's',
|
2859 |
+
'\u00DF': 's',
|
2860 |
+
'\u015B': 's',
|
2861 |
+
'\u1E65': 's',
|
2862 |
+
'\u015D': 's',
|
2863 |
+
'\u1E61': 's',
|
2864 |
+
'\u0161': 's',
|
2865 |
+
'\u1E67': 's',
|
2866 |
+
'\u1E63': 's',
|
2867 |
+
'\u1E69': 's',
|
2868 |
+
'\u0219': 's',
|
2869 |
+
'\u015F': 's',
|
2870 |
+
'\u023F': 's',
|
2871 |
+
'\uA7A9': 's',
|
2872 |
+
'\uA785': 's',
|
2873 |
+
'\u1E9B': 's',
|
2874 |
+
'\u24E3': 't',
|
2875 |
+
'\uFF54': 't',
|
2876 |
+
'\u1E6B': 't',
|
2877 |
+
'\u1E97': 't',
|
2878 |
+
'\u0165': 't',
|
2879 |
+
'\u1E6D': 't',
|
2880 |
+
'\u021B': 't',
|
2881 |
+
'\u0163': 't',
|
2882 |
+
'\u1E71': 't',
|
2883 |
+
'\u1E6F': 't',
|
2884 |
+
'\u0167': 't',
|
2885 |
+
'\u01AD': 't',
|
2886 |
+
'\u0288': 't',
|
2887 |
+
'\u2C66': 't',
|
2888 |
+
'\uA787': 't',
|
2889 |
+
'\uA729': 'tz',
|
2890 |
+
'\u24E4': 'u',
|
2891 |
+
'\uFF55': 'u',
|
2892 |
+
'\u00F9': 'u',
|
2893 |
+
'\u00FA': 'u',
|
2894 |
+
'\u00FB': 'u',
|
2895 |
+
'\u0169': 'u',
|
2896 |
+
'\u1E79': 'u',
|
2897 |
+
'\u016B': 'u',
|
2898 |
+
'\u1E7B': 'u',
|
2899 |
+
'\u016D': 'u',
|
2900 |
+
'\u00FC': 'u',
|
2901 |
+
'\u01DC': 'u',
|
2902 |
+
'\u01D8': 'u',
|
2903 |
+
'\u01D6': 'u',
|
2904 |
+
'\u01DA': 'u',
|
2905 |
+
'\u1EE7': 'u',
|
2906 |
+
'\u016F': 'u',
|
2907 |
+
'\u0171': 'u',
|
2908 |
+
'\u01D4': 'u',
|
2909 |
+
'\u0215': 'u',
|
2910 |
+
'\u0217': 'u',
|
2911 |
+
'\u01B0': 'u',
|
2912 |
+
'\u1EEB': 'u',
|
2913 |
+
'\u1EE9': 'u',
|
2914 |
+
'\u1EEF': 'u',
|
2915 |
+
'\u1EED': 'u',
|
2916 |
+
'\u1EF1': 'u',
|
2917 |
+
'\u1EE5': 'u',
|
2918 |
+
'\u1E73': 'u',
|
2919 |
+
'\u0173': 'u',
|
2920 |
+
'\u1E77': 'u',
|
2921 |
+
'\u1E75': 'u',
|
2922 |
+
'\u0289': 'u',
|
2923 |
+
'\u24E5': 'v',
|
2924 |
+
'\uFF56': 'v',
|
2925 |
+
'\u1E7D': 'v',
|
2926 |
+
'\u1E7F': 'v',
|
2927 |
+
'\u028B': 'v',
|
2928 |
+
'\uA75F': 'v',
|
2929 |
+
'\u028C': 'v',
|
2930 |
+
'\uA761': 'vy',
|
2931 |
+
'\u24E6': 'w',
|
2932 |
+
'\uFF57': 'w',
|
2933 |
+
'\u1E81': 'w',
|
2934 |
+
'\u1E83': 'w',
|
2935 |
+
'\u0175': 'w',
|
2936 |
+
'\u1E87': 'w',
|
2937 |
+
'\u1E85': 'w',
|
2938 |
+
'\u1E98': 'w',
|
2939 |
+
'\u1E89': 'w',
|
2940 |
+
'\u2C73': 'w',
|
2941 |
+
'\u24E7': 'x',
|
2942 |
+
'\uFF58': 'x',
|
2943 |
+
'\u1E8B': 'x',
|
2944 |
+
'\u1E8D': 'x',
|
2945 |
+
'\u24E8': 'y',
|
2946 |
+
'\uFF59': 'y',
|
2947 |
+
'\u1EF3': 'y',
|
2948 |
+
'\u00FD': 'y',
|
2949 |
+
'\u0177': 'y',
|
2950 |
+
'\u1EF9': 'y',
|
2951 |
+
'\u0233': 'y',
|
2952 |
+
'\u1E8F': 'y',
|
2953 |
+
'\u00FF': 'y',
|
2954 |
+
'\u1EF7': 'y',
|
2955 |
+
'\u1E99': 'y',
|
2956 |
+
'\u1EF5': 'y',
|
2957 |
+
'\u01B4': 'y',
|
2958 |
+
'\u024F': 'y',
|
2959 |
+
'\u1EFF': 'y',
|
2960 |
+
'\u24E9': 'z',
|
2961 |
+
'\uFF5A': 'z',
|
2962 |
+
'\u017A': 'z',
|
2963 |
+
'\u1E91': 'z',
|
2964 |
+
'\u017C': 'z',
|
2965 |
+
'\u017E': 'z',
|
2966 |
+
'\u1E93': 'z',
|
2967 |
+
'\u1E95': 'z',
|
2968 |
+
'\u01B6': 'z',
|
2969 |
+
'\u0225': 'z',
|
2970 |
+
'\u0240': 'z',
|
2971 |
+
'\u2C6C': 'z',
|
2972 |
+
'\uA763': 'z',
|
2973 |
+
'\u0386': '\u0391',
|
2974 |
+
'\u0388': '\u0395',
|
2975 |
+
'\u0389': '\u0397',
|
2976 |
+
'\u038A': '\u0399',
|
2977 |
+
'\u03AA': '\u0399',
|
2978 |
+
'\u038C': '\u039F',
|
2979 |
+
'\u038E': '\u03A5',
|
2980 |
+
'\u03AB': '\u03A5',
|
2981 |
+
'\u038F': '\u03A9',
|
2982 |
+
'\u03AC': '\u03B1',
|
2983 |
+
'\u03AD': '\u03B5',
|
2984 |
+
'\u03AE': '\u03B7',
|
2985 |
+
'\u03AF': '\u03B9',
|
2986 |
+
'\u03CA': '\u03B9',
|
2987 |
+
'\u0390': '\u03B9',
|
2988 |
+
'\u03CC': '\u03BF',
|
2989 |
+
'\u03CD': '\u03C5',
|
2990 |
+
'\u03CB': '\u03C5',
|
2991 |
+
'\u03B0': '\u03C5',
|
2992 |
+
'\u03C9': '\u03C9',
|
2993 |
+
'\u03C2': '\u03C3'
|
2994 |
+
};
|
2995 |
+
|
2996 |
+
return diacritics;
|
2997 |
+
});
|
2998 |
+
|
2999 |
+
S2.define('select2/data/base',[
|
3000 |
+
'../utils'
|
3001 |
+
], function (Utils) {
|
3002 |
+
function BaseAdapter ($element, options) {
|
3003 |
+
BaseAdapter.__super__.constructor.call(this);
|
3004 |
+
}
|
3005 |
+
|
3006 |
+
Utils.Extend(BaseAdapter, Utils.Observable);
|
3007 |
+
|
3008 |
+
BaseAdapter.prototype.current = function (callback) {
|
3009 |
+
throw new Error('The `current` method must be defined in child classes.');
|
3010 |
+
};
|
3011 |
+
|
3012 |
+
BaseAdapter.prototype.query = function (params, callback) {
|
3013 |
+
throw new Error('The `query` method must be defined in child classes.');
|
3014 |
+
};
|
3015 |
+
|
3016 |
+
BaseAdapter.prototype.bind = function (container, $container) {
|
3017 |
+
// Can be implemented in subclasses
|
3018 |
+
};
|
3019 |
+
|
3020 |
+
BaseAdapter.prototype.destroy = function () {
|
3021 |
+
// Can be implemented in subclasses
|
3022 |
+
};
|
3023 |
+
|
3024 |
+
BaseAdapter.prototype.generateResultId = function (container, data) {
|
3025 |
+
var id = container.id + '-result-';
|
3026 |
+
|
3027 |
+
id += Utils.generateChars(4);
|
3028 |
+
|
3029 |
+
if (data.id != null) {
|
3030 |
+
id += '-' + data.id.toString();
|
3031 |
+
} else {
|
3032 |
+
id += '-' + Utils.generateChars(4);
|
3033 |
+
}
|
3034 |
+
return id;
|
3035 |
+
};
|
3036 |
+
|
3037 |
+
return BaseAdapter;
|
3038 |
+
});
|
3039 |
+
|
3040 |
+
S2.define('select2/data/select',[
|
3041 |
+
'./base',
|
3042 |
+
'../utils',
|
3043 |
+
'jquery'
|
3044 |
+
], function (BaseAdapter, Utils, $) {
|
3045 |
+
function SelectAdapter ($element, options) {
|
3046 |
+
this.$element = $element;
|
3047 |
+
this.options = options;
|
3048 |
+
|
3049 |
+
SelectAdapter.__super__.constructor.call(this);
|
3050 |
+
}
|
3051 |
+
|
3052 |
+
Utils.Extend(SelectAdapter, BaseAdapter);
|
3053 |
+
|
3054 |
+
SelectAdapter.prototype.current = function (callback) {
|
3055 |
+
var data = [];
|
3056 |
+
var self = this;
|
3057 |
+
|
3058 |
+
this.$element.find(':selected').each(function () {
|
3059 |
+
var $option = $(this);
|
3060 |
+
|
3061 |
+
var option = self.item($option);
|
3062 |
+
|
3063 |
+
data.push(option);
|
3064 |
+
});
|
3065 |
+
|
3066 |
+
callback(data);
|
3067 |
+
};
|
3068 |
+
|
3069 |
+
SelectAdapter.prototype.select = function (data) {
|
3070 |
+
var self = this;
|
3071 |
+
|
3072 |
+
data.selected = true;
|
3073 |
+
|
3074 |
+
// If data.element is a DOM node, use it instead
|
3075 |
+
if ($(data.element).is('option')) {
|
3076 |
+
data.element.selected = true;
|
3077 |
+
|
3078 |
+
this.$element.trigger('change');
|
3079 |
+
|
3080 |
+
return;
|
3081 |
+
}
|
3082 |
+
|
3083 |
+
if (this.$element.prop('multiple')) {
|
3084 |
+
this.current(function (currentData) {
|
3085 |
+
var val = [];
|
3086 |
+
|
3087 |
+
data = [data];
|
3088 |
+
data.push.apply(data, currentData);
|
3089 |
+
|
3090 |
+
for (var d = 0; d < data.length; d++) {
|
3091 |
+
var id = data[d].id;
|
3092 |
+
|
3093 |
+
if ($.inArray(id, val) === -1) {
|
3094 |
+
val.push(id);
|
3095 |
+
}
|
3096 |
+
}
|
3097 |
+
|
3098 |
+
self.$element.val(val);
|
3099 |
+
self.$element.trigger('change');
|
3100 |
+
});
|
3101 |
+
} else {
|
3102 |
+
var val = data.id;
|
3103 |
+
|
3104 |
+
this.$element.val(val);
|
3105 |
+
this.$element.trigger('change');
|
3106 |
+
}
|
3107 |
+
};
|
3108 |
+
|
3109 |
+
SelectAdapter.prototype.unselect = function (data) {
|
3110 |
+
var self = this;
|
3111 |
+
|
3112 |
+
if (!this.$element.prop('multiple')) {
|
3113 |
+
return;
|
3114 |
+
}
|
3115 |
+
|
3116 |
+
data.selected = false;
|
3117 |
+
|
3118 |
+
if ($(data.element).is('option')) {
|
3119 |
+
data.element.selected = false;
|
3120 |
+
|
3121 |
+
this.$element.trigger('change');
|
3122 |
+
|
3123 |
+
return;
|
3124 |
+
}
|
3125 |
+
|
3126 |
+
this.current(function (currentData) {
|
3127 |
+
var val = [];
|
3128 |
+
|
3129 |
+
for (var d = 0; d < currentData.length; d++) {
|
3130 |
+
var id = currentData[d].id;
|
3131 |
+
|
3132 |
+
if (id !== data.id && $.inArray(id, val) === -1) {
|
3133 |
+
val.push(id);
|
3134 |
+
}
|
3135 |
+
}
|
3136 |
+
|
3137 |
+
self.$element.val(val);
|
3138 |
+
|
3139 |
+
self.$element.trigger('change');
|
3140 |
+
});
|
3141 |
+
};
|
3142 |
+
|
3143 |
+
SelectAdapter.prototype.bind = function (container, $container) {
|
3144 |
+
var self = this;
|
3145 |
+
|
3146 |
+
this.container = container;
|
3147 |
+
|
3148 |
+
container.on('select', function (params) {
|
3149 |
+
self.select(params.data);
|
3150 |
+
});
|
3151 |
+
|
3152 |
+
container.on('unselect', function (params) {
|
3153 |
+
self.unselect(params.data);
|
3154 |
+
});
|
3155 |
+
};
|
3156 |
+
|
3157 |
+
SelectAdapter.prototype.destroy = function () {
|
3158 |
+
// Remove anything added to child elements
|
3159 |
+
this.$element.find('*').each(function () {
|
3160 |
+
// Remove any custom data set by Select2
|
3161 |
+
$.removeData(this, 'data');
|
3162 |
+
});
|
3163 |
+
};
|
3164 |
+
|
3165 |
+
SelectAdapter.prototype.query = function (params, callback) {
|
3166 |
+
var data = [];
|
3167 |
+
var self = this;
|
3168 |
+
|
3169 |
+
var $options = this.$element.children();
|
3170 |
+
|
3171 |
+
$options.each(function () {
|
3172 |
+
var $option = $(this);
|
3173 |
+
|
3174 |
+
if (!$option.is('option') && !$option.is('optgroup')) {
|
3175 |
+
return;
|
3176 |
+
}
|
3177 |
+
|
3178 |
+
var option = self.item($option);
|
3179 |
+
|
3180 |
+
var matches = self.matches(params, option);
|
3181 |
+
|
3182 |
+
if (matches !== null) {
|
3183 |
+
data.push(matches);
|
3184 |
+
}
|
3185 |
+
});
|
3186 |
+
|
3187 |
+
callback({
|
3188 |
+
results: data
|
3189 |
+
});
|
3190 |
+
};
|
3191 |
+
|
3192 |
+
SelectAdapter.prototype.addOptions = function ($options) {
|
3193 |
+
Utils.appendMany(this.$element, $options);
|
3194 |
+
};
|
3195 |
+
|
3196 |
+
SelectAdapter.prototype.option = function (data) {
|
3197 |
+
var option;
|
3198 |
+
|
3199 |
+
if (data.children) {
|
3200 |
+
option = document.createElement('optgroup');
|
3201 |
+
option.label = data.text;
|
3202 |
+
} else {
|
3203 |
+
option = document.createElement('option');
|
3204 |
+
|
3205 |
+
if (option.textContent !== undefined) {
|
3206 |
+
option.textContent = data.text;
|
3207 |
+
} else {
|
3208 |
+
option.innerText = data.text;
|
3209 |
+
}
|
3210 |
+
}
|
3211 |
+
|
3212 |
+
if (data.id !== undefined) {
|
3213 |
+
option.value = data.id;
|
3214 |
+
}
|
3215 |
+
|
3216 |
+
if (data.disabled) {
|
3217 |
+
option.disabled = true;
|
3218 |
+
}
|
3219 |
+
|
3220 |
+
if (data.selected) {
|
3221 |
+
option.selected = true;
|
3222 |
+
}
|
3223 |
+
|
3224 |
+
if (data.title) {
|
3225 |
+
option.title = data.title;
|
3226 |
+
}
|
3227 |
+
|
3228 |
+
var $option = $(option);
|
3229 |
+
|
3230 |
+
var normalizedData = this._normalizeItem(data);
|
3231 |
+
normalizedData.element = option;
|
3232 |
+
|
3233 |
+
// Override the option's data with the combined data
|
3234 |
+
$.data(option, 'data', normalizedData);
|
3235 |
+
|
3236 |
+
return $option;
|
3237 |
+
};
|
3238 |
+
|
3239 |
+
SelectAdapter.prototype.item = function ($option) {
|
3240 |
+
var data = {};
|
3241 |
+
|
3242 |
+
data = $.data($option[0], 'data');
|
3243 |
+
|
3244 |
+
if (data != null) {
|
3245 |
+
return data;
|
3246 |
+
}
|
3247 |
+
|
3248 |
+
if ($option.is('option')) {
|
3249 |
+
data = {
|
3250 |
+
id: $option.val(),
|
3251 |
+
text: $option.text(),
|
3252 |
+
disabled: $option.prop('disabled'),
|
3253 |
+
selected: $option.prop('selected'),
|
3254 |
+
title: $option.prop('title')
|
3255 |
+
};
|
3256 |
+
} else if ($option.is('optgroup')) {
|
3257 |
+
data = {
|
3258 |
+
text: $option.prop('label'),
|
3259 |
+
children: [],
|
3260 |
+
title: $option.prop('title')
|
3261 |
+
};
|
3262 |
+
|
3263 |
+
var $children = $option.children('option');
|
3264 |
+
var children = [];
|
3265 |
+
|
3266 |
+
for (var c = 0; c < $children.length; c++) {
|
3267 |
+
var $child = $($children[c]);
|
3268 |
+
|
3269 |
+
var child = this.item($child);
|
3270 |
+
|
3271 |
+
children.push(child);
|
3272 |
+
}
|
3273 |
+
|
3274 |
+
data.children = children;
|
3275 |
+
}
|
3276 |
+
|
3277 |
+
data = this._normalizeItem(data);
|
3278 |
+
data.element = $option[0];
|
3279 |
+
|
3280 |
+
$.data($option[0], 'data', data);
|
3281 |
+
|
3282 |
+
return data;
|
3283 |
+
};
|
3284 |
+
|
3285 |
+
SelectAdapter.prototype._normalizeItem = function (item) {
|
3286 |
+
if (!$.isPlainObject(item)) {
|
3287 |
+
item = {
|
3288 |
+
id: item,
|
3289 |
+
text: item
|
3290 |
+
};
|
3291 |
+
}
|
3292 |
+
|
3293 |
+
item = $.extend({}, {
|
3294 |
+
text: ''
|
3295 |
+
}, item);
|
3296 |
+
|
3297 |
+
var defaults = {
|
3298 |
+
selected: false,
|
3299 |
+
disabled: false
|
3300 |
+
};
|
3301 |
+
|
3302 |
+
if (item.id != null) {
|
3303 |
+
item.id = item.id.toString();
|
3304 |
+
}
|
3305 |
+
|
3306 |
+
if (item.text != null) {
|
3307 |
+
item.text = item.text.toString();
|
3308 |
+
}
|
3309 |
+
|
3310 |
+
if (item._resultId == null && item.id && this.container != null) {
|
3311 |
+
item._resultId = this.generateResultId(this.container, item);
|
3312 |
+
}
|
3313 |
+
|
3314 |
+
return $.extend({}, defaults, item);
|
3315 |
+
};
|
3316 |
+
|
3317 |
+
SelectAdapter.prototype.matches = function (params, data) {
|
3318 |
+
var matcher = this.options.get('matcher');
|
3319 |
+
|
3320 |
+
return matcher(params, data);
|
3321 |
+
};
|
3322 |
+
|
3323 |
+
return SelectAdapter;
|
3324 |
+
});
|
3325 |
+
|
3326 |
+
S2.define('select2/data/array',[
|
3327 |
+
'./select',
|
3328 |
+
'../utils',
|
3329 |
+
'jquery'
|
3330 |
+
], function (SelectAdapter, Utils, $) {
|
3331 |
+
function ArrayAdapter ($element, options) {
|
3332 |
+
var data = options.get('data') || [];
|
3333 |
+
|
3334 |
+
ArrayAdapter.__super__.constructor.call(this, $element, options);
|
3335 |
+
|
3336 |
+
this.addOptions(this.convertToOptions(data));
|
3337 |
+
}
|
3338 |
+
|
3339 |
+
Utils.Extend(ArrayAdapter, SelectAdapter);
|
3340 |
+
|
3341 |
+
ArrayAdapter.prototype.select = function (data) {
|
3342 |
+
var $option = this.$element.find('option').filter(function (i, elm) {
|
3343 |
+
return elm.value == data.id.toString();
|
3344 |
+
});
|
3345 |
+
|
3346 |
+
if ($option.length === 0) {
|
3347 |
+
$option = this.option(data);
|
3348 |
+
|
3349 |
+
this.addOptions($option);
|
3350 |
+
}
|
3351 |
+
|
3352 |
+
ArrayAdapter.__super__.select.call(this, data);
|
3353 |
+
};
|
3354 |
+
|
3355 |
+
ArrayAdapter.prototype.convertToOptions = function (data) {
|
3356 |
+
var self = this;
|
3357 |
+
|
3358 |
+
var $existing = this.$element.find('option');
|
3359 |
+
var existingIds = $existing.map(function () {
|
3360 |
+
return self.item($(this)).id;
|
3361 |
+
}).get();
|
3362 |
+
|
3363 |
+
var $options = [];
|
3364 |
+
|
3365 |
+
// Filter out all items except for the one passed in the argument
|
3366 |
+
function onlyItem (item) {
|
3367 |
+
return function () {
|
3368 |
+
return $(this).val() == item.id;
|
3369 |
+
};
|
3370 |
+
}
|
3371 |
+
|
3372 |
+
for (var d = 0; d < data.length; d++) {
|
3373 |
+
var item = this._normalizeItem(data[d]);
|
3374 |
+
|
3375 |
+
// Skip items which were pre-loaded, only merge the data
|
3376 |
+
if ($.inArray(item.id, existingIds) >= 0) {
|
3377 |
+
var $existingOption = $existing.filter(onlyItem(item));
|
3378 |
+
|
3379 |
+
var existingData = this.item($existingOption);
|
3380 |
+
var newData = $.extend(true, {}, item, existingData);
|
3381 |
+
|
3382 |
+
var $newOption = this.option(newData);
|
3383 |
+
|
3384 |
+
$existingOption.replaceWith($newOption);
|
3385 |
+
|
3386 |
+
continue;
|
3387 |
+
}
|
3388 |
+
|
3389 |
+
var $option = this.option(item);
|
3390 |
+
|
3391 |
+
if (item.children) {
|
3392 |
+
var $children = this.convertToOptions(item.children);
|
3393 |
+
|
3394 |
+
Utils.appendMany($option, $children);
|
3395 |
+
}
|
3396 |
+
|
3397 |
+
$options.push($option);
|
3398 |
+
}
|
3399 |
+
|
3400 |
+
return $options;
|
3401 |
+
};
|
3402 |
+
|
3403 |
+
return ArrayAdapter;
|
3404 |
+
});
|
3405 |
+
|
3406 |
+
S2.define('select2/data/ajax',[
|
3407 |
+
'./array',
|
3408 |
+
'../utils',
|
3409 |
+
'jquery'
|
3410 |
+
], function (ArrayAdapter, Utils, $) {
|
3411 |
+
function AjaxAdapter ($element, options) {
|
3412 |
+
this.ajaxOptions = this._applyDefaults(options.get('ajax'));
|
3413 |
+
|
3414 |
+
if (this.ajaxOptions.processResults != null) {
|
3415 |
+
this.processResults = this.ajaxOptions.processResults;
|
3416 |
+
}
|
3417 |
+
|
3418 |
+
AjaxAdapter.__super__.constructor.call(this, $element, options);
|
3419 |
+
}
|
3420 |
+
|
3421 |
+
Utils.Extend(AjaxAdapter, ArrayAdapter);
|
3422 |
+
|
3423 |
+
AjaxAdapter.prototype._applyDefaults = function (options) {
|
3424 |
+
var defaults = {
|
3425 |
+
data: function (params) {
|
3426 |
+
return $.extend({}, params, {
|
3427 |
+
q: params.term
|
3428 |
+
});
|
3429 |
+
},
|
3430 |
+
transport: function (params, success, failure) {
|
3431 |
+
var $request = $.ajax(params);
|
3432 |
+
|
3433 |
+
$request.then(success);
|
3434 |
+
$request.fail(failure);
|
3435 |
+
|
3436 |
+
return $request;
|
3437 |
+
}
|
3438 |
+
};
|
3439 |
+
|
3440 |
+
return $.extend({}, defaults, options, true);
|
3441 |
+
};
|
3442 |
+
|
3443 |
+
AjaxAdapter.prototype.processResults = function (results) {
|
3444 |
+
return results;
|
3445 |
+
};
|
3446 |
+
|
3447 |
+
AjaxAdapter.prototype.query = function (params, callback) {
|
3448 |
+
var matches = [];
|
3449 |
+
var self = this;
|
3450 |
+
|
3451 |
+
if (this._request != null) {
|
3452 |
+
// JSONP requests cannot always be aborted
|
3453 |
+
if ($.isFunction(this._request.abort)) {
|
3454 |
+
this._request.abort();
|
3455 |
+
}
|
3456 |
+
|
3457 |
+
this._request = null;
|
3458 |
+
}
|
3459 |
+
|
3460 |
+
var options = $.extend({
|
3461 |
+
type: 'GET'
|
3462 |
+
}, this.ajaxOptions);
|
3463 |
+
|
3464 |
+
if (typeof options.url === 'function') {
|
3465 |
+
options.url = options.url.call(this.$element, params);
|
3466 |
+
}
|
3467 |
+
|
3468 |
+
if (typeof options.data === 'function') {
|
3469 |
+
options.data = options.data.call(this.$element, params);
|
3470 |
+
}
|
3471 |
+
|
3472 |
+
function request () {
|
3473 |
+
var $request = options.transport(options, function (data) {
|
3474 |
+
var results = self.processResults(data, params);
|
3475 |
+
|
3476 |
+
if (self.options.get('debug') && window.console && console.error) {
|
3477 |
+
// Check to make sure that the response included a `results` key.
|
3478 |
+
if (!results || !results.results || !$.isArray(results.results)) {
|
3479 |
+
console.error(
|
3480 |
+
'Select2: The AJAX results did not return an array in the ' +
|
3481 |
+
'`results` key of the response.'
|
3482 |
+
);
|
3483 |
+
}
|
3484 |
+
}
|
3485 |
+
|
3486 |
+
callback(results);
|
3487 |
+
}, function () {
|
3488 |
+
// Attempt to detect if a request was aborted
|
3489 |
+
// Only works if the transport exposes a status property
|
3490 |
+
if ($request.status && $request.status === '0') {
|
3491 |
+
return;
|
3492 |
+
}
|
3493 |
+
|
3494 |
+
self.trigger('results:message', {
|
3495 |
+
message: 'errorLoading'
|
3496 |
+
});
|
3497 |
+
});
|
3498 |
+
|
3499 |
+
self._request = $request;
|
3500 |
+
}
|
3501 |
+
|
3502 |
+
if (this.ajaxOptions.delay && params.term != null) {
|
3503 |
+
if (this._queryTimeout) {
|
3504 |
+
window.clearTimeout(this._queryTimeout);
|
3505 |
+
}
|
3506 |
+
|
3507 |
+
this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
|
3508 |
+
} else {
|
3509 |
+
request();
|
3510 |
+
}
|
3511 |
+
};
|
3512 |
+
|
3513 |
+
return AjaxAdapter;
|
3514 |
+
});
|
3515 |
+
|
3516 |
+
S2.define('select2/data/tags',[
|
3517 |
+
'jquery'
|
3518 |
+
], function ($) {
|
3519 |
+
function Tags (decorated, $element, options) {
|
3520 |
+
var tags = options.get('tags');
|
3521 |
+
|
3522 |
+
var createTag = options.get('createTag');
|
3523 |
+
|
3524 |
+
if (createTag !== undefined) {
|
3525 |
+
this.createTag = createTag;
|
3526 |
+
}
|
3527 |
+
|
3528 |
+
var insertTag = options.get('insertTag');
|
3529 |
+
|
3530 |
+
if (insertTag !== undefined) {
|
3531 |
+
this.insertTag = insertTag;
|
3532 |
+
}
|
3533 |
+
|
3534 |
+
decorated.call(this, $element, options);
|
3535 |
+
|
3536 |
+
if ($.isArray(tags)) {
|
3537 |
+
for (var t = 0; t < tags.length; t++) {
|
3538 |
+
var tag = tags[t];
|
3539 |
+
var item = this._normalizeItem(tag);
|
3540 |
+
|
3541 |
+
var $option = this.option(item);
|
3542 |
+
|
3543 |
+
this.$element.append($option);
|
3544 |
+
}
|
3545 |
+
}
|
3546 |
+
}
|
3547 |
+
|
3548 |
+
Tags.prototype.query = function (decorated, params, callback) {
|
3549 |
+
var self = this;
|
3550 |
+
|
3551 |
+
this._removeOldTags();
|
3552 |
+
|
3553 |
+
if (params.term == null || params.page != null) {
|
3554 |
+
decorated.call(this, params, callback);
|
3555 |
+
return;
|
3556 |
+
}
|
3557 |
+
|
3558 |
+
function wrapper (obj, child) {
|
3559 |
+
var data = obj.results;
|
3560 |
+
|
3561 |
+
for (var i = 0; i < data.length; i++) {
|
3562 |
+
var option = data[i];
|
3563 |
+
|
3564 |
+
var checkChildren = (
|
3565 |
+
option.children != null &&
|
3566 |
+
!wrapper({
|
3567 |
+
results: option.children
|
3568 |
+
}, true)
|
3569 |
+
);
|
3570 |
+
|
3571 |
+
var optionText = (option.text || '').toUpperCase();
|
3572 |
+
var paramsTerm = (params.term || '').toUpperCase();
|
3573 |
+
|
3574 |
+
var checkText = optionText === paramsTerm;
|
3575 |
+
|
3576 |
+
if (checkText || checkChildren) {
|
3577 |
+
if (child) {
|
3578 |
+
return false;
|
3579 |
+
}
|
3580 |
+
|
3581 |
+
obj.data = data;
|
3582 |
+
callback(obj);
|
3583 |
+
|
3584 |
+
return;
|
3585 |
+
}
|
3586 |
+
}
|
3587 |
+
|
3588 |
+
if (child) {
|
3589 |
+
return true;
|
3590 |
+
}
|
3591 |
+
|
3592 |
+
var tag = self.createTag(params);
|
3593 |
+
|
3594 |
+
if (tag != null) {
|
3595 |
+
var $option = self.option(tag);
|
3596 |
+
$option.attr('data-select2-tag', true);
|
3597 |
+
|
3598 |
+
self.addOptions([$option]);
|
3599 |
+
|
3600 |
+
self.insertTag(data, tag);
|
3601 |
+
}
|
3602 |
+
|
3603 |
+
obj.results = data;
|
3604 |
+
|
3605 |
+
callback(obj);
|
3606 |
+
}
|
3607 |
+
|
3608 |
+
decorated.call(this, params, wrapper);
|
3609 |
+
};
|
3610 |
+
|
3611 |
+
Tags.prototype.createTag = function (decorated, params) {
|
3612 |
+
var term = $.trim(params.term);
|
3613 |
+
|
3614 |
+
if (term === '') {
|
3615 |
+
return null;
|
3616 |
+
}
|
3617 |
+
|
3618 |
+
return {
|
3619 |
+
id: term,
|
3620 |
+
text: term
|
3621 |
+
};
|
3622 |
+
};
|
3623 |
+
|
3624 |
+
Tags.prototype.insertTag = function (_, data, tag) {
|
3625 |
+
data.unshift(tag);
|
3626 |
+
};
|
3627 |
+
|
3628 |
+
Tags.prototype._removeOldTags = function (_) {
|
3629 |
+
var tag = this._lastTag;
|
3630 |
+
|
3631 |
+
var $options = this.$element.find('option[data-select2-tag]');
|
3632 |
+
|
3633 |
+
$options.each(function () {
|
3634 |
+
if (this.selected) {
|
3635 |
+
return;
|
3636 |
+
}
|
3637 |
+
|
3638 |
+
$(this).remove();
|
3639 |
+
});
|
3640 |
+
};
|
3641 |
+
|
3642 |
+
return Tags;
|
3643 |
+
});
|
3644 |
+
|
3645 |
+
S2.define('select2/data/tokenizer',[
|
3646 |
+
'jquery'
|
3647 |
+
], function ($) {
|
3648 |
+
function Tokenizer (decorated, $element, options) {
|
3649 |
+
var tokenizer = options.get('tokenizer');
|
3650 |
+
|
3651 |
+
if (tokenizer !== undefined) {
|
3652 |
+
this.tokenizer = tokenizer;
|
3653 |
+
}
|
3654 |
+
|
3655 |
+
decorated.call(this, $element, options);
|
3656 |
+
}
|
3657 |
+
|
3658 |
+
Tokenizer.prototype.bind = function (decorated, container, $container) {
|
3659 |
+
decorated.call(this, container, $container);
|
3660 |
+
|
3661 |
+
this.$search = container.dropdown.$search || container.selection.$search ||
|
3662 |
+
$container.find('.select2-search__field');
|
3663 |
+
};
|
3664 |
+
|
3665 |
+
Tokenizer.prototype.query = function (decorated, params, callback) {
|
3666 |
+
var self = this;
|
3667 |
+
|
3668 |
+
function createAndSelect (data) {
|
3669 |
+
// Normalize the data object so we can use it for checks
|
3670 |
+
var item = self._normalizeItem(data);
|
3671 |
+
|
3672 |
+
// Check if the data object already exists as a tag
|
3673 |
+
// Select it if it doesn't
|
3674 |
+
var $existingOptions = self.$element.find('option').filter(function () {
|
3675 |
+
return $(this).val() === item.id;
|
3676 |
+
});
|
3677 |
+
|
3678 |
+
// If an existing option wasn't found for it, create the option
|
3679 |
+
if (!$existingOptions.length) {
|
3680 |
+
var $option = self.option(item);
|
3681 |
+
$option.attr('data-select2-tag', true);
|
3682 |
+
|
3683 |
+
self._removeOldTags();
|
3684 |
+
self.addOptions([$option]);
|
3685 |
+
}
|
3686 |
+
|
3687 |
+
// Select the item, now that we know there is an option for it
|
3688 |
+
select(item);
|
3689 |
+
}
|
3690 |
+
|
3691 |
+
function select (data) {
|
3692 |
+
self.trigger('select', {
|
3693 |
+
data: data
|
3694 |
+
});
|
3695 |
+
}
|
3696 |
+
|
3697 |
+
params.term = params.term || '';
|
3698 |
+
|
3699 |
+
var tokenData = this.tokenizer(params, this.options, createAndSelect);
|
3700 |
+
|
3701 |
+
if (tokenData.term !== params.term) {
|
3702 |
+
// Replace the search term if we have the search box
|
3703 |
+
if (this.$search.length) {
|
3704 |
+
this.$search.val(tokenData.term);
|
3705 |
+
this.$search.focus();
|
3706 |
+
}
|
3707 |
+
|
3708 |
+
params.term = tokenData.term;
|
3709 |
+
}
|
3710 |
+
|
3711 |
+
decorated.call(this, params, callback);
|
3712 |
+
};
|
3713 |
+
|
3714 |
+
Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
|
3715 |
+
var separators = options.get('tokenSeparators') || [];
|
3716 |
+
var term = params.term;
|
3717 |
+
var i = 0;
|
3718 |
+
|
3719 |
+
var createTag = this.createTag || function (params) {
|
3720 |
+
return {
|
3721 |
+
id: params.term,
|
3722 |
+
text: params.term
|
3723 |
+
};
|
3724 |
+
};
|
3725 |
+
|
3726 |
+
while (i < term.length) {
|
3727 |
+
var termChar = term[i];
|
3728 |
+
|
3729 |
+
if ($.inArray(termChar, separators) === -1) {
|
3730 |
+
i++;
|
3731 |
+
|
3732 |
+
continue;
|
3733 |
+
}
|
3734 |
+
|
3735 |
+
var part = term.substr(0, i);
|
3736 |
+
var partParams = $.extend({}, params, {
|
3737 |
+
term: part
|
3738 |
+
});
|
3739 |
+
|
3740 |
+
var data = createTag(partParams);
|
3741 |
+
|
3742 |
+
if (data == null) {
|
3743 |
+
i++;
|
3744 |
+
continue;
|
3745 |
+
}
|
3746 |
+
|
3747 |
+
callback(data);
|
3748 |
+
|
3749 |
+
// Reset the term to not include the tokenized portion
|
3750 |
+
term = term.substr(i + 1) || '';
|
3751 |
+
i = 0;
|
3752 |
+
}
|
3753 |
+
|
3754 |
+
return {
|
3755 |
+
term: term
|
3756 |
+
};
|
3757 |
+
};
|
3758 |
+
|
3759 |
+
return Tokenizer;
|
3760 |
+
});
|
3761 |
+
|
3762 |
+
S2.define('select2/data/minimumInputLength',[
|
3763 |
+
|
3764 |
+
], function () {
|
3765 |
+
function MinimumInputLength (decorated, $e, options) {
|
3766 |
+
this.minimumInputLength = options.get('minimumInputLength');
|
3767 |
+
|
3768 |
+
decorated.call(this, $e, options);
|
3769 |
+
}
|
3770 |
+
|
3771 |
+
MinimumInputLength.prototype.query = function (decorated, params, callback) {
|
3772 |
+
params.term = params.term || '';
|
3773 |
+
|
3774 |
+
if (params.term.length < this.minimumInputLength) {
|
3775 |
+
this.trigger('results:message', {
|
3776 |
+
message: 'inputTooShort',
|
3777 |
+
args: {
|
3778 |
+
minimum: this.minimumInputLength,
|
3779 |
+
input: params.term,
|
3780 |
+
params: params
|
3781 |
+
}
|
3782 |
+
});
|
3783 |
+
|
3784 |
+
return;
|
3785 |
+
}
|
3786 |
+
|
3787 |
+
decorated.call(this, params, callback);
|
3788 |
+
};
|
3789 |
+
|
3790 |
+
return MinimumInputLength;
|
3791 |
+
});
|
3792 |
+
|
3793 |
+
S2.define('select2/data/maximumInputLength',[
|
3794 |
+
|
3795 |
+
], function () {
|
3796 |
+
function MaximumInputLength (decorated, $e, options) {
|
3797 |
+
this.maximumInputLength = options.get('maximumInputLength');
|
3798 |
+
|
3799 |
+
decorated.call(this, $e, options);
|
3800 |
+
}
|
3801 |
+
|
3802 |
+
MaximumInputLength.prototype.query = function (decorated, params, callback) {
|
3803 |
+
params.term = params.term || '';
|
3804 |
+
|
3805 |
+
if (this.maximumInputLength > 0 &&
|
3806 |
+
params.term.length > this.maximumInputLength) {
|
3807 |
+
this.trigger('results:message', {
|
3808 |
+
message: 'inputTooLong',
|
3809 |
+
args: {
|
3810 |
+
maximum: this.maximumInputLength,
|
3811 |
+
input: params.term,
|
3812 |
+
params: params
|
3813 |
+
}
|
3814 |
+
});
|
3815 |
+
|
3816 |
+
return;
|
3817 |
+
}
|
3818 |
+
|
3819 |
+
decorated.call(this, params, callback);
|
3820 |
+
};
|
3821 |
+
|
3822 |
+
return MaximumInputLength;
|
3823 |
+
});
|
3824 |
+
|
3825 |
+
S2.define('select2/data/maximumSelectionLength',[
|
3826 |
+
|
3827 |
+
], function (){
|
3828 |
+
function MaximumSelectionLength (decorated, $e, options) {
|
3829 |
+
this.maximumSelectionLength = options.get('maximumSelectionLength');
|
3830 |
+
|
3831 |
+
decorated.call(this, $e, options);
|
3832 |
+
}
|
3833 |
+
|
3834 |
+
MaximumSelectionLength.prototype.query =
|
3835 |
+
function (decorated, params, callback) {
|
3836 |
+
var self = this;
|
3837 |
+
|
3838 |
+
this.current(function (currentData) {
|
3839 |
+
var count = currentData != null ? currentData.length : 0;
|
3840 |
+
if (self.maximumSelectionLength > 0 &&
|
3841 |
+
count >= self.maximumSelectionLength) {
|
3842 |
+
self.trigger('results:message', {
|
3843 |
+
message: 'maximumSelected',
|
3844 |
+
args: {
|
3845 |
+
maximum: self.maximumSelectionLength
|
3846 |
+
}
|
3847 |
+
});
|
3848 |
+
return;
|
3849 |
+
}
|
3850 |
+
decorated.call(self, params, callback);
|
3851 |
+
});
|
3852 |
+
};
|
3853 |
+
|
3854 |
+
return MaximumSelectionLength;
|
3855 |
+
});
|
3856 |
+
|
3857 |
+
S2.define('select2/dropdown',[
|
3858 |
+
'jquery',
|
3859 |
+
'./utils'
|
3860 |
+
], function ($, Utils) {
|
3861 |
+
function Dropdown ($element, options) {
|
3862 |
+
this.$element = $element;
|
3863 |
+
this.options = options;
|
3864 |
+
|
3865 |
+
Dropdown.__super__.constructor.call(this);
|
3866 |
+
}
|
3867 |
+
|
3868 |
+
Utils.Extend(Dropdown, Utils.Observable);
|
3869 |
+
|
3870 |
+
Dropdown.prototype.render = function () {
|
3871 |
+
var $dropdown = $(
|
3872 |
+
'<span class="select2-dropdown">' +
|
3873 |
+
'<span class="select2-results"></span>' +
|
3874 |
+
'</span>'
|
3875 |
+
);
|
3876 |
+
|
3877 |
+
$dropdown.attr('dir', this.options.get('dir'));
|
3878 |
+
|
3879 |
+
this.$dropdown = $dropdown;
|
3880 |
+
|
3881 |
+
return $dropdown;
|
3882 |
+
};
|
3883 |
+
|
3884 |
+
Dropdown.prototype.bind = function () {
|
3885 |
+
// Should be implemented in subclasses
|
3886 |
+
};
|
3887 |
+
|
3888 |
+
Dropdown.prototype.position = function ($dropdown, $container) {
|
3889 |
+
// Should be implmented in subclasses
|
3890 |
+
};
|
3891 |
+
|
3892 |
+
Dropdown.prototype.destroy = function () {
|
3893 |
+
// Remove the dropdown from the DOM
|
3894 |
+
this.$dropdown.remove();
|
3895 |
+
};
|
3896 |
+
|
3897 |
+
return Dropdown;
|
3898 |
+
});
|
3899 |
+
|
3900 |
+
S2.define('select2/dropdown/search',[
|
3901 |
+
'jquery',
|
3902 |
+
'../utils'
|
3903 |
+
], function ($, Utils) {
|
3904 |
+
function Search () { }
|
3905 |
+
|
3906 |
+
Search.prototype.render = function (decorated) {
|
3907 |
+
var $rendered = decorated.call(this);
|
3908 |
+
|
3909 |
+
var $search = $(
|
3910 |
+
'<span class="select2-search select2-search--dropdown">' +
|
3911 |
+
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
3912 |
+
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
3913 |
+
' spellcheck="false" role="textbox" />' +
|
3914 |
+
'</span>'
|
3915 |
+
);
|
3916 |
+
|
3917 |
+
this.$searchContainer = $search;
|
3918 |
+
this.$search = $search.find('input');
|
3919 |
+
|
3920 |
+
$rendered.prepend($search);
|
3921 |
+
|
3922 |
+
return $rendered;
|
3923 |
+
};
|
3924 |
+
|
3925 |
+
Search.prototype.bind = function (decorated, container, $container) {
|
3926 |
+
var self = this;
|
3927 |
+
|
3928 |
+
decorated.call(this, container, $container);
|
3929 |
+
|
3930 |
+
this.$search.on('keydown', function (evt) {
|
3931 |
+
self.trigger('keypress', evt);
|
3932 |
+
|
3933 |
+
self._keyUpPrevented = evt.isDefaultPrevented();
|
3934 |
+
});
|
3935 |
+
|
3936 |
+
// Workaround for browsers which do not support the `input` event
|
3937 |
+
// This will prevent double-triggering of events for browsers which support
|
3938 |
+
// both the `keyup` and `input` events.
|
3939 |
+
this.$search.on('input', function (evt) {
|
3940 |
+
// Unbind the duplicated `keyup` event
|
3941 |
+
$(this).off('keyup');
|
3942 |
+
});
|
3943 |
+
|
3944 |
+
this.$search.on('keyup input', function (evt) {
|
3945 |
+
self.handleSearch(evt);
|
3946 |
+
});
|
3947 |
+
|
3948 |
+
container.on('open', function () {
|
3949 |
+
self.$search.attr('tabindex', 0);
|
3950 |
+
|
3951 |
+
self.$search.focus();
|
3952 |
+
|
3953 |
+
window.setTimeout(function () {
|
3954 |
+
self.$search.focus();
|
3955 |
+
}, 0);
|
3956 |
+
});
|
3957 |
+
|
3958 |
+
container.on('close', function () {
|
3959 |
+
self.$search.attr('tabindex', -1);
|
3960 |
+
|
3961 |
+
self.$search.val('');
|
3962 |
+
});
|
3963 |
+
|
3964 |
+
container.on('focus', function () {
|
3965 |
+
if (!container.isOpen()) {
|
3966 |
+
self.$search.focus();
|
3967 |
+
}
|
3968 |
+
});
|
3969 |
+
|
3970 |
+
container.on('results:all', function (params) {
|
3971 |
+
if (params.query.term == null || params.query.term === '') {
|
3972 |
+
var showSearch = self.showSearch(params);
|
3973 |
+
|
3974 |
+
if (showSearch) {
|
3975 |
+
self.$searchContainer.removeClass('select2-search--hide');
|
3976 |
+
} else {
|
3977 |
+
self.$searchContainer.addClass('select2-search--hide');
|
3978 |
+
}
|
3979 |
+
}
|
3980 |
+
});
|
3981 |
+
};
|
3982 |
+
|
3983 |
+
Search.prototype.handleSearch = function (evt) {
|
3984 |
+
if (!this._keyUpPrevented) {
|
3985 |
+
var input = this.$search.val();
|
3986 |
+
|
3987 |
+
this.trigger('query', {
|
3988 |
+
term: input
|
3989 |
+
});
|
3990 |
+
}
|
3991 |
+
|
3992 |
+
this._keyUpPrevented = false;
|
3993 |
+
};
|
3994 |
+
|
3995 |
+
Search.prototype.showSearch = function (_, params) {
|
3996 |
+
return true;
|
3997 |
+
};
|
3998 |
+
|
3999 |
+
return Search;
|
4000 |
+
});
|
4001 |
+
|
4002 |
+
S2.define('select2/dropdown/hidePlaceholder',[
|
4003 |
+
|
4004 |
+
], function () {
|
4005 |
+
function HidePlaceholder (decorated, $element, options, dataAdapter) {
|
4006 |
+
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
4007 |
+
|
4008 |
+
decorated.call(this, $element, options, dataAdapter);
|
4009 |
+
}
|
4010 |
+
|
4011 |
+
HidePlaceholder.prototype.append = function (decorated, data) {
|
4012 |
+
data.results = this.removePlaceholder(data.results);
|
4013 |
+
|
4014 |
+
decorated.call(this, data);
|
4015 |
+
};
|
4016 |
+
|
4017 |
+
HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
4018 |
+
if (typeof placeholder === 'string') {
|
4019 |
+
placeholder = {
|
4020 |
+
id: '',
|
4021 |
+
text: placeholder
|
4022 |
+
};
|
4023 |
+
}
|
4024 |
+
|
4025 |
+
return placeholder;
|
4026 |
+
};
|
4027 |
+
|
4028 |
+
HidePlaceholder.prototype.removePlaceholder = function (_, data) {
|
4029 |
+
var modifiedData = data.slice(0);
|
4030 |
+
|
4031 |
+
for (var d = data.length - 1; d >= 0; d--) {
|
4032 |
+
var item = data[d];
|
4033 |
+
|
4034 |
+
if (this.placeholder.id === item.id) {
|
4035 |
+
modifiedData.splice(d, 1);
|
4036 |
+
}
|
4037 |
+
}
|
4038 |
+
|
4039 |
+
return modifiedData;
|
4040 |
+
};
|
4041 |
+
|
4042 |
+
return HidePlaceholder;
|
4043 |
+
});
|
4044 |
+
|
4045 |
+
S2.define('select2/dropdown/infiniteScroll',[
|
4046 |
+
'jquery'
|
4047 |
+
], function ($) {
|
4048 |
+
function InfiniteScroll (decorated, $element, options, dataAdapter) {
|
4049 |
+
this.lastParams = {};
|
4050 |
+
|
4051 |
+
decorated.call(this, $element, options, dataAdapter);
|
4052 |
+
|
4053 |
+
this.$loadingMore = this.createLoadingMore();
|
4054 |
+
this.loading = false;
|
4055 |
+
}
|
4056 |
+
|
4057 |
+
InfiniteScroll.prototype.append = function (decorated, data) {
|
4058 |
+
this.$loadingMore.remove();
|
4059 |
+
this.loading = false;
|
4060 |
+
|
4061 |
+
decorated.call(this, data);
|
4062 |
+
|
4063 |
+
if (this.showLoadingMore(data)) {
|
4064 |
+
this.$results.append(this.$loadingMore);
|
4065 |
+
}
|
4066 |
+
};
|
4067 |
+
|
4068 |
+
InfiniteScroll.prototype.bind = function (decorated, container, $container) {
|
4069 |
+
var self = this;
|
4070 |
+
|
4071 |
+
decorated.call(this, container, $container);
|
4072 |
+
|
4073 |
+
container.on('query', function (params) {
|
4074 |
+
self.lastParams = params;
|
4075 |
+
self.loading = true;
|
4076 |
+
});
|
4077 |
+
|
4078 |
+
container.on('query:append', function (params) {
|
4079 |
+
self.lastParams = params;
|
4080 |
+
self.loading = true;
|
4081 |
+
});
|
4082 |
+
|
4083 |
+
this.$results.on('scroll', function () {
|
4084 |
+
var isLoadMoreVisible = $.contains(
|
4085 |
+
document.documentElement,
|
4086 |
+
self.$loadingMore[0]
|
4087 |
+
);
|
4088 |
+
|
4089 |
+
if (self.loading || !isLoadMoreVisible) {
|
4090 |
+
return;
|
4091 |
+
}
|
4092 |
+
|
4093 |
+
var currentOffset = self.$results.offset().top +
|
4094 |
+
self.$results.outerHeight(false);
|
4095 |
+
var loadingMoreOffset = self.$loadingMore.offset().top +
|
4096 |
+
self.$loadingMore.outerHeight(false);
|
4097 |
+
|
4098 |
+
if (currentOffset + 50 >= loadingMoreOffset) {
|
4099 |
+
self.loadMore();
|
4100 |
+
}
|
4101 |
+
});
|
4102 |
+
};
|
4103 |
+
|
4104 |
+
InfiniteScroll.prototype.loadMore = function () {
|
4105 |
+
this.loading = true;
|
4106 |
+
|
4107 |
+
var params = $.extend({}, {page: 1}, this.lastParams);
|
4108 |
+
|
4109 |
+
params.page++;
|
4110 |
+
|
4111 |
+
this.trigger('query:append', params);
|
4112 |
+
};
|
4113 |
+
|
4114 |
+
InfiniteScroll.prototype.showLoadingMore = function (_, data) {
|
4115 |
+
return data.pagination && data.pagination.more;
|
4116 |
+
};
|
4117 |
+
|
4118 |
+
InfiniteScroll.prototype.createLoadingMore = function () {
|
4119 |
+
var $option = $(
|
4120 |
+
'<li ' +
|
4121 |
+
'class="select2-results__option select2-results__option--load-more"' +
|
4122 |
+
'role="treeitem" aria-disabled="true"></li>'
|
4123 |
+
);
|
4124 |
+
|
4125 |
+
var message = this.options.get('translations').get('loadingMore');
|
4126 |
+
|
4127 |
+
$option.html(message(this.lastParams));
|
4128 |
+
|
4129 |
+
return $option;
|
4130 |
+
};
|
4131 |
+
|
4132 |
+
return InfiniteScroll;
|
4133 |
+
});
|
4134 |
+
|
4135 |
+
S2.define('select2/dropdown/attachBody',[
|
4136 |
+
'jquery',
|
4137 |
+
'../utils'
|
4138 |
+
], function ($, Utils) {
|
4139 |
+
function AttachBody (decorated, $element, options) {
|
4140 |
+
this.$dropdownParent = options.get('dropdownParent') || $(document.body);
|
4141 |
+
|
4142 |
+
decorated.call(this, $element, options);
|
4143 |
+
}
|
4144 |
+
|
4145 |
+
AttachBody.prototype.bind = function (decorated, container, $container) {
|
4146 |
+
var self = this;
|
4147 |
+
|
4148 |
+
var setupResultsEvents = false;
|
4149 |
+
|
4150 |
+
decorated.call(this, container, $container);
|
4151 |
+
|
4152 |
+
container.on('open', function () {
|
4153 |
+
self._showDropdown();
|
4154 |
+
self._attachPositioningHandler(container);
|
4155 |
+
|
4156 |
+
if (!setupResultsEvents) {
|
4157 |
+
setupResultsEvents = true;
|
4158 |
+
|
4159 |
+
container.on('results:all', function () {
|
4160 |
+
self._positionDropdown();
|
4161 |
+
self._resizeDropdown();
|
4162 |
+
});
|
4163 |
+
|
4164 |
+
container.on('results:append', function () {
|
4165 |
+
self._positionDropdown();
|
4166 |
+
self._resizeDropdown();
|
4167 |
+
});
|
4168 |
+
}
|
4169 |
+
});
|
4170 |
+
|
4171 |
+
container.on('close', function () {
|
4172 |
+
self._hideDropdown();
|
4173 |
+
self._detachPositioningHandler(container);
|
4174 |
+
});
|
4175 |
+
|
4176 |
+
this.$dropdownContainer.on('mousedown', function (evt) {
|
4177 |
+
evt.stopPropagation();
|
4178 |
+
});
|
4179 |
+
};
|
4180 |
+
|
4181 |
+
AttachBody.prototype.destroy = function (decorated) {
|
4182 |
+
decorated.call(this);
|
4183 |
+
|
4184 |
+
this.$dropdownContainer.remove();
|
4185 |
+
};
|
4186 |
+
|
4187 |
+
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
|
4188 |
+
// Clone all of the container classes
|
4189 |
+
$dropdown.attr('class', $container.attr('class'));
|
4190 |
+
|
4191 |
+
$dropdown.removeClass('select2');
|
4192 |
+
$dropdown.addClass('select2-container--open');
|
4193 |
+
|
4194 |
+
$dropdown.css({
|
4195 |
+
position: 'absolute',
|
4196 |
+
top: -999999
|
4197 |
+
});
|
4198 |
+
|
4199 |
+
this.$container = $container;
|
4200 |
+
};
|
4201 |
+
|
4202 |
+
AttachBody.prototype.render = function (decorated) {
|
4203 |
+
var $container = $('<span></span>');
|
4204 |
+
|
4205 |
+
var $dropdown = decorated.call(this);
|
4206 |
+
$container.append($dropdown);
|
4207 |
+
|
4208 |
+
this.$dropdownContainer = $container;
|
4209 |
+
|
4210 |
+
return $container;
|
4211 |
+
};
|
4212 |
+
|
4213 |
+
AttachBody.prototype._hideDropdown = function (decorated) {
|
4214 |
+
this.$dropdownContainer.detach();
|
4215 |
+
};
|
4216 |
+
|
4217 |
+
AttachBody.prototype._attachPositioningHandler =
|
4218 |
+
function (decorated, container) {
|
4219 |
+
var self = this;
|
4220 |
+
|
4221 |
+
var scrollEvent = 'scroll.select2.' + container.id;
|
4222 |
+
var resizeEvent = 'resize.select2.' + container.id;
|
4223 |
+
var orientationEvent = 'orientationchange.select2.' + container.id;
|
4224 |
+
|
4225 |
+
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4226 |
+
$watchers.each(function () {
|
4227 |
+
$(this).data('select2-scroll-position', {
|
4228 |
+
x: $(this).scrollLeft(),
|
4229 |
+
y: $(this).scrollTop()
|
4230 |
+
});
|
4231 |
+
});
|
4232 |
+
|
4233 |
+
$watchers.on(scrollEvent, function (ev) {
|
4234 |
+
var position = $(this).data('select2-scroll-position');
|
4235 |
+
$(this).scrollTop(position.y);
|
4236 |
+
});
|
4237 |
+
|
4238 |
+
$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
|
4239 |
+
function (e) {
|
4240 |
+
self._positionDropdown();
|
4241 |
+
self._resizeDropdown();
|
4242 |
+
});
|
4243 |
+
};
|
4244 |
+
|
4245 |
+
AttachBody.prototype._detachPositioningHandler =
|
4246 |
+
function (decorated, container) {
|
4247 |
+
var scrollEvent = 'scroll.select2.' + container.id;
|
4248 |
+
var resizeEvent = 'resize.select2.' + container.id;
|
4249 |
+
var orientationEvent = 'orientationchange.select2.' + container.id;
|
4250 |
+
|
4251 |
+
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4252 |
+
$watchers.off(scrollEvent);
|
4253 |
+
|
4254 |
+
$(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
|
4255 |
+
};
|
4256 |
+
|
4257 |
+
AttachBody.prototype._positionDropdown = function () {
|
4258 |
+
var $window = $(window);
|
4259 |
+
|
4260 |
+
var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
|
4261 |
+
var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
|
4262 |
+
|
4263 |
+
var newDirection = null;
|
4264 |
+
|
4265 |
+
var offset = this.$container.offset();
|
4266 |
+
|
4267 |
+
offset.bottom = offset.top + this.$container.outerHeight(false);
|
4268 |
+
|
4269 |
+
var container = {
|
4270 |
+
height: this.$container.outerHeight(false)
|
4271 |
+
};
|
4272 |
+
|
4273 |
+
container.top = offset.top;
|
4274 |
+
container.bottom = offset.top + container.height;
|
4275 |
+
|
4276 |
+
var dropdown = {
|
4277 |
+
height: this.$dropdown.outerHeight(false)
|
4278 |
+
};
|
4279 |
+
|
4280 |
+
var viewport = {
|
4281 |
+
top: $window.scrollTop(),
|
4282 |
+
bottom: $window.scrollTop() + $window.height()
|
4283 |
+
};
|
4284 |
+
|
4285 |
+
var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
|
4286 |
+
var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
|
4287 |
+
|
4288 |
+
var css = {
|
4289 |
+
left: offset.left,
|
4290 |
+
top: container.bottom
|
4291 |
+
};
|
4292 |
+
|
4293 |
+
// Determine what the parent element is to use for calciulating the offset
|
4294 |
+
var $offsetParent = this.$dropdownParent;
|
4295 |
+
|
4296 |
+
// For statically positoned elements, we need to get the element
|
4297 |
+
// that is determining the offset
|
4298 |
+
if ($offsetParent.css('position') === 'static') {
|
4299 |
+
$offsetParent = $offsetParent.offsetParent();
|
4300 |
+
}
|
4301 |
+
|
4302 |
+
var parentOffset = $offsetParent.offset();
|
4303 |
+
|
4304 |
+
css.top -= parentOffset.top;
|
4305 |
+
css.left -= parentOffset.left;
|
4306 |
+
|
4307 |
+
if (!isCurrentlyAbove && !isCurrentlyBelow) {
|
4308 |
+
newDirection = 'below';
|
4309 |
+
}
|
4310 |
+
|
4311 |
+
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
|
4312 |
+
newDirection = 'above';
|
4313 |
+
} else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
|
4314 |
+
newDirection = 'below';
|
4315 |
+
}
|
4316 |
+
|
4317 |
+
if (newDirection == 'above' ||
|
4318 |
+
(isCurrentlyAbove && newDirection !== 'below')) {
|
4319 |
+
css.top = container.top - parentOffset.top - dropdown.height;
|
4320 |
+
}
|
4321 |
+
|
4322 |
+
if (newDirection != null) {
|
4323 |
+
this.$dropdown
|
4324 |
+
.removeClass('select2-dropdown--below select2-dropdown--above')
|
4325 |
+
.addClass('select2-dropdown--' + newDirection);
|
4326 |
+
this.$container
|
4327 |
+
.removeClass('select2-container--below select2-container--above')
|
4328 |
+
.addClass('select2-container--' + newDirection);
|
4329 |
+
}
|
4330 |
+
|
4331 |
+
this.$dropdownContainer.css(css);
|
4332 |
+
};
|
4333 |
+
|
4334 |
+
AttachBody.prototype._resizeDropdown = function () {
|
4335 |
+
var css = {
|
4336 |
+
width: this.$container.outerWidth(false) + 'px'
|
4337 |
+
};
|
4338 |
+
|
4339 |
+
if (this.options.get('dropdownAutoWidth')) {
|
4340 |
+
css.minWidth = css.width;
|
4341 |
+
css.position = 'relative';
|
4342 |
+
css.width = 'auto';
|
4343 |
+
}
|
4344 |
+
|
4345 |
+
this.$dropdown.css(css);
|
4346 |
+
};
|
4347 |
+
|
4348 |
+
AttachBody.prototype._showDropdown = function (decorated) {
|
4349 |
+
this.$dropdownContainer.appendTo(this.$dropdownParent);
|
4350 |
+
|
4351 |
+
this._positionDropdown();
|
4352 |
+
this._resizeDropdown();
|
4353 |
+
};
|
4354 |
+
|
4355 |
+
return AttachBody;
|
4356 |
+
});
|
4357 |
+
|
4358 |
+
S2.define('select2/dropdown/minimumResultsForSearch',[
|
4359 |
+
|
4360 |
+
], function () {
|
4361 |
+
function countResults (data) {
|
4362 |
+
var count = 0;
|
4363 |
+
|
4364 |
+
for (var d = 0; d < data.length; d++) {
|
4365 |
+
var item = data[d];
|
4366 |
+
|
4367 |
+
if (item.children) {
|
4368 |
+
count += countResults(item.children);
|
4369 |
+
} else {
|
4370 |
+
count++;
|
4371 |
+
}
|
4372 |
+
}
|
4373 |
+
|
4374 |
+
return count;
|
4375 |
+
}
|
4376 |
+
|
4377 |
+
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
4378 |
+
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
4379 |
+
|
4380 |
+
if (this.minimumResultsForSearch < 0) {
|
4381 |
+
this.minimumResultsForSearch = Infinity;
|
4382 |
+
}
|
4383 |
+
|
4384 |
+
decorated.call(this, $element, options, dataAdapter);
|
4385 |
+
}
|
4386 |
+
|
4387 |
+
MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
|
4388 |
+
if (countResults(params.data.results) < this.minimumResultsForSearch) {
|
4389 |
+
return false;
|
4390 |
+
}
|
4391 |
+
|
4392 |
+
return decorated.call(this, params);
|
4393 |
+
};
|
4394 |
+
|
4395 |
+
return MinimumResultsForSearch;
|
4396 |
+
});
|
4397 |
+
|
4398 |
+
S2.define('select2/dropdown/selectOnClose',[
|
4399 |
+
|
4400 |
+
], function () {
|
4401 |
+
function SelectOnClose () { }
|
4402 |
+
|
4403 |
+
SelectOnClose.prototype.bind = function (decorated, container, $container) {
|
4404 |
+
var self = this;
|
4405 |
+
|
4406 |
+
decorated.call(this, container, $container);
|
4407 |
+
|
4408 |
+
container.on('close', function (params) {
|
4409 |
+
self._handleSelectOnClose(params);
|
4410 |
+
});
|
4411 |
+
};
|
4412 |
+
|
4413 |
+
SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
|
4414 |
+
if (params && params.originalSelect2Event != null) {
|
4415 |
+
var event = params.originalSelect2Event;
|
4416 |
+
|
4417 |
+
// Don't select an item if the close event was triggered from a select or
|
4418 |
+
// unselect event
|
4419 |
+
if (event._type === 'select' || event._type === 'unselect') {
|
4420 |
+
return;
|
4421 |
+
}
|
4422 |
+
}
|
4423 |
+
|
4424 |
+
var $highlightedResults = this.getHighlightedResults();
|
4425 |
+
|
4426 |
+
// Only select highlighted results
|
4427 |
+
if ($highlightedResults.length < 1) {
|
4428 |
+
return;
|
4429 |
+
}
|
4430 |
+
|
4431 |
+
var data = $highlightedResults.data('data');
|
4432 |
+
|
4433 |
+
// Don't re-select already selected resulte
|
4434 |
+
if (
|
4435 |
+
(data.element != null && data.element.selected) ||
|
4436 |
+
(data.element == null && data.selected)
|
4437 |
+
) {
|
4438 |
+
return;
|
4439 |
+
}
|
4440 |
+
|
4441 |
+
this.trigger('select', {
|
4442 |
+
data: data
|
4443 |
+
});
|
4444 |
+
};
|
4445 |
+
|
4446 |
+
return SelectOnClose;
|
4447 |
+
});
|
4448 |
+
|
4449 |
+
S2.define('select2/dropdown/closeOnSelect',[
|
4450 |
+
|
4451 |
+
], function () {
|
4452 |
+
function CloseOnSelect () { }
|
4453 |
+
|
4454 |
+
CloseOnSelect.prototype.bind = function (decorated, container, $container) {
|
4455 |
+
var self = this;
|
4456 |
+
|
4457 |
+
decorated.call(this, container, $container);
|
4458 |
+
|
4459 |
+
container.on('select', function (evt) {
|
4460 |
+
self._selectTriggered(evt);
|
4461 |
+
});
|
4462 |
+
|
4463 |
+
container.on('unselect', function (evt) {
|
4464 |
+
self._selectTriggered(evt);
|
4465 |
+
});
|
4466 |
+
};
|
4467 |
+
|
4468 |
+
CloseOnSelect.prototype._selectTriggered = function (_, evt) {
|
4469 |
+
var originalEvent = evt.originalEvent;
|
4470 |
+
|
4471 |
+
// Don't close if the control key is being held
|
4472 |
+
if (originalEvent && originalEvent.ctrlKey) {
|
4473 |
+
return;
|
4474 |
+
}
|
4475 |
+
|
4476 |
+
this.trigger('close', {
|
4477 |
+
originalEvent: originalEvent,
|
4478 |
+
originalSelect2Event: evt
|
4479 |
+
});
|
4480 |
+
};
|
4481 |
+
|
4482 |
+
return CloseOnSelect;
|
4483 |
+
});
|
4484 |
+
|
4485 |
+
S2.define('select2/i18n/en',[],function () {
|
4486 |
+
// English
|
4487 |
+
return {
|
4488 |
+
errorLoading: function () {
|
4489 |
+
return 'The results could not be loaded.';
|
4490 |
+
},
|
4491 |
+
inputTooLong: function (args) {
|
4492 |
+
var overChars = args.input.length - args.maximum;
|
4493 |
+
|
4494 |
+
var message = 'Please delete ' + overChars + ' character';
|
4495 |
+
|
4496 |
+
if (overChars != 1) {
|
4497 |
+
message += 's';
|
4498 |
+
}
|
4499 |
+
|
4500 |
+
return message;
|
4501 |
+
},
|
4502 |
+
inputTooShort: function (args) {
|
4503 |
+
var remainingChars = args.minimum - args.input.length;
|
4504 |
+
|
4505 |
+
var message = 'Please enter ' + remainingChars + ' or more characters';
|
4506 |
+
|
4507 |
+
return message;
|
4508 |
+
},
|
4509 |
+
loadingMore: function () {
|
4510 |
+
return 'Loading more results…';
|
4511 |
+
},
|
4512 |
+
maximumSelected: function (args) {
|
4513 |
+
var message = 'You can only select ' + args.maximum + ' item';
|
4514 |
+
|
4515 |
+
if (args.maximum != 1) {
|
4516 |
+
message += 's';
|
4517 |
+
}
|
4518 |
+
|
4519 |
+
return message;
|
4520 |
+
},
|
4521 |
+
noResults: function () {
|
4522 |
+
return 'No results found';
|
4523 |
+
},
|
4524 |
+
searching: function () {
|
4525 |
+
return 'Searching…';
|
4526 |
+
}
|
4527 |
+
};
|
4528 |
+
});
|
4529 |
+
|
4530 |
+
S2.define('select2/defaults',[
|
4531 |
+
'jquery',
|
4532 |
+
'require',
|
4533 |
+
|
4534 |
+
'./results',
|
4535 |
+
|
4536 |
+
'./selection/single',
|
4537 |
+
'./selection/multiple',
|
4538 |
+
'./selection/placeholder',
|
4539 |
+
'./selection/allowClear',
|
4540 |
+
'./selection/search',
|
4541 |
+
'./selection/eventRelay',
|
4542 |
+
|
4543 |
+
'./utils',
|
4544 |
+
'./translation',
|
4545 |
+
'./diacritics',
|
4546 |
+
|
4547 |
+
'./data/select',
|
4548 |
+
'./data/array',
|
4549 |
+
'./data/ajax',
|
4550 |
+
'./data/tags',
|
4551 |
+
'./data/tokenizer',
|
4552 |
+
'./data/minimumInputLength',
|
4553 |
+
'./data/maximumInputLength',
|
4554 |
+
'./data/maximumSelectionLength',
|
4555 |
+
|
4556 |
+
'./dropdown',
|
4557 |
+
'./dropdown/search',
|
4558 |
+
'./dropdown/hidePlaceholder',
|
4559 |
+
'./dropdown/infiniteScroll',
|
4560 |
+
'./dropdown/attachBody',
|
4561 |
+
'./dropdown/minimumResultsForSearch',
|
4562 |
+
'./dropdown/selectOnClose',
|
4563 |
+
'./dropdown/closeOnSelect',
|
4564 |
+
|
4565 |
+
'./i18n/en'
|
4566 |
+
], function ($, require,
|
4567 |
+
|
4568 |
+
ResultsList,
|
4569 |
+
|
4570 |
+
SingleSelection, MultipleSelection, Placeholder, AllowClear,
|
4571 |
+
SelectionSearch, EventRelay,
|
4572 |
+
|
4573 |
+
Utils, Translation, DIACRITICS,
|
4574 |
+
|
4575 |
+
SelectData, ArrayData, AjaxData, Tags, Tokenizer,
|
4576 |
+
MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
|
4577 |
+
|
4578 |
+
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
|
4579 |
+
AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
|
4580 |
+
|
4581 |
+
EnglishTranslation) {
|
4582 |
+
function Defaults () {
|
4583 |
+
this.reset();
|
4584 |
+
}
|
4585 |
+
|
4586 |
+
Defaults.prototype.apply = function (options) {
|
4587 |
+
options = $.extend(true, {}, this.defaults, options);
|
4588 |
+
|
4589 |
+
if (options.dataAdapter == null) {
|
4590 |
+
if (options.ajax != null) {
|
4591 |
+
options.dataAdapter = AjaxData;
|
4592 |
+
} else if (options.data != null) {
|
4593 |
+
options.dataAdapter = ArrayData;
|
4594 |
+
} else {
|
4595 |
+
options.dataAdapter = SelectData;
|
4596 |
+
}
|
4597 |
+
|
4598 |
+
if (options.minimumInputLength > 0) {
|
4599 |
+
options.dataAdapter = Utils.Decorate(
|
4600 |
+
options.dataAdapter,
|
4601 |
+
MinimumInputLength
|
4602 |
+
);
|
4603 |
+
}
|
4604 |
+
|
4605 |
+
if (options.maximumInputLength > 0) {
|
4606 |
+
options.dataAdapter = Utils.Decorate(
|
4607 |
+
options.dataAdapter,
|
4608 |
+
MaximumInputLength
|
4609 |
+
);
|
4610 |
+
}
|
4611 |
+
|
4612 |
+
if (options.maximumSelectionLength > 0) {
|
4613 |
+
options.dataAdapter = Utils.Decorate(
|
4614 |
+
options.dataAdapter,
|
4615 |
+
MaximumSelectionLength
|
4616 |
+
);
|
4617 |
+
}
|
4618 |
+
|
4619 |
+
if (options.tags) {
|
4620 |
+
options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
|
4621 |
+
}
|
4622 |
+
|
4623 |
+
if (options.tokenSeparators != null || options.tokenizer != null) {
|
4624 |
+
options.dataAdapter = Utils.Decorate(
|
4625 |
+
options.dataAdapter,
|
4626 |
+
Tokenizer
|
4627 |
+
);
|
4628 |
+
}
|
4629 |
+
|
4630 |
+
if (options.query != null) {
|
4631 |
+
var Query = require(options.amdBase + 'compat/query');
|
4632 |
+
|
4633 |
+
options.dataAdapter = Utils.Decorate(
|
4634 |
+
options.dataAdapter,
|
4635 |
+
Query
|
4636 |
+
);
|
4637 |
+
}
|
4638 |
+
|
4639 |
+
if (options.initSelection != null) {
|
4640 |
+
var InitSelection = require(options.amdBase + 'compat/initSelection');
|
4641 |
+
|
4642 |
+
options.dataAdapter = Utils.Decorate(
|
4643 |
+
options.dataAdapter,
|
4644 |
+
InitSelection
|
4645 |
+
);
|
4646 |
+
}
|
4647 |
+
}
|
4648 |
+
|
4649 |
+
if (options.resultsAdapter == null) {
|
4650 |
+
options.resultsAdapter = ResultsList;
|
4651 |
+
|
4652 |
+
if (options.ajax != null) {
|
4653 |
+
options.resultsAdapter = Utils.Decorate(
|
4654 |
+
options.resultsAdapter,
|
4655 |
+
InfiniteScroll
|
4656 |
+
);
|
4657 |
+
}
|
4658 |
+
|
4659 |
+
if (options.placeholder != null) {
|
4660 |
+
options.resultsAdapter = Utils.Decorate(
|
4661 |
+
options.resultsAdapter,
|
4662 |
+
HidePlaceholder
|
4663 |
+
);
|
4664 |
+
}
|
4665 |
+
|
4666 |
+
if (options.selectOnClose) {
|
4667 |
+
options.resultsAdapter = Utils.Decorate(
|
4668 |
+
options.resultsAdapter,
|
4669 |
+
SelectOnClose
|
4670 |
+
);
|
4671 |
+
}
|
4672 |
+
}
|
4673 |
+
|
4674 |
+
if (options.dropdownAdapter == null) {
|
4675 |
+
if (options.multiple) {
|
4676 |
+
options.dropdownAdapter = Dropdown;
|
4677 |
+
} else {
|
4678 |
+
var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
|
4679 |
+
|
4680 |
+
options.dropdownAdapter = SearchableDropdown;
|
4681 |
+
}
|
4682 |
+
|
4683 |
+
if (options.minimumResultsForSearch !== 0) {
|
4684 |
+
options.dropdownAdapter = Utils.Decorate(
|
4685 |
+
options.dropdownAdapter,
|
4686 |
+
MinimumResultsForSearch
|
4687 |
+
);
|
4688 |
+
}
|
4689 |
+
|
4690 |
+
if (options.closeOnSelect) {
|
4691 |
+
options.dropdownAdapter = Utils.Decorate(
|
4692 |
+
options.dropdownAdapter,
|
4693 |
+
CloseOnSelect
|
4694 |
+
);
|
4695 |
+
}
|
4696 |
+
|
4697 |
+
if (
|
4698 |
+
options.dropdownCssClass != null ||
|
4699 |
+
options.dropdownCss != null ||
|
4700 |
+
options.adaptDropdownCssClass != null
|
4701 |
+
) {
|
4702 |
+
var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
|
4703 |
+
|
4704 |
+
options.dropdownAdapter = Utils.Decorate(
|
4705 |
+
options.dropdownAdapter,
|
4706 |
+
DropdownCSS
|
4707 |
+
);
|
4708 |
+
}
|
4709 |
+
|
4710 |
+
options.dropdownAdapter = Utils.Decorate(
|
4711 |
+
options.dropdownAdapter,
|
4712 |
+
AttachBody
|
4713 |
+
);
|
4714 |
+
}
|
4715 |
+
|
4716 |
+
if (options.selectionAdapter == null) {
|
4717 |
+
if (options.multiple) {
|
4718 |
+
options.selectionAdapter = MultipleSelection;
|
4719 |
+
} else {
|
4720 |
+
options.selectionAdapter = SingleSelection;
|
4721 |
+
}
|
4722 |
+
|
4723 |
+
// Add the placeholder mixin if a placeholder was specified
|
4724 |
+
if (options.placeholder != null) {
|
4725 |
+
options.selectionAdapter = Utils.Decorate(
|
4726 |
+
options.selectionAdapter,
|
4727 |
+
Placeholder
|
4728 |
+
);
|
4729 |
+
}
|
4730 |
+
|
4731 |
+
if (options.allowClear) {
|
4732 |
+
options.selectionAdapter = Utils.Decorate(
|
4733 |
+
options.selectionAdapter,
|
4734 |
+
AllowClear
|
4735 |
+
);
|
4736 |
+
}
|
4737 |
+
|
4738 |
+
if (options.multiple) {
|
4739 |
+
options.selectionAdapter = Utils.Decorate(
|
4740 |
+
options.selectionAdapter,
|
4741 |
+
SelectionSearch
|
4742 |
+
);
|
4743 |
+
}
|
4744 |
+
|
4745 |
+
if (
|
4746 |
+
options.containerCssClass != null ||
|
4747 |
+
options.containerCss != null ||
|
4748 |
+
options.adaptContainerCssClass != null
|
4749 |
+
) {
|
4750 |
+
var ContainerCSS = require(options.amdBase + 'compat/containerCss');
|
4751 |
+
|
4752 |
+
options.selectionAdapter = Utils.Decorate(
|
4753 |
+
options.selectionAdapter,
|
4754 |
+
ContainerCSS
|
4755 |
+
);
|
4756 |
+
}
|
4757 |
+
|
4758 |
+
options.selectionAdapter = Utils.Decorate(
|
4759 |
+
options.selectionAdapter,
|
4760 |
+
EventRelay
|
4761 |
+
);
|
4762 |
+
}
|
4763 |
+
|
4764 |
+
if (typeof options.language === 'string') {
|
4765 |
+
// Check if the language is specified with a region
|
4766 |
+
if (options.language.indexOf('-') > 0) {
|
4767 |
+
// Extract the region information if it is included
|
4768 |
+
var languageParts = options.language.split('-');
|
4769 |
+
var baseLanguage = languageParts[0];
|
4770 |
+
|
4771 |
+
options.language = [options.language, baseLanguage];
|
4772 |
+
} else {
|
4773 |
+
options.language = [options.language];
|
4774 |
+
}
|
4775 |
+
}
|
4776 |
+
|
4777 |
+
if ($.isArray(options.language)) {
|
4778 |
+
var languages = new Translation();
|
4779 |
+
options.language.push('en');
|
4780 |
+
|
4781 |
+
var languageNames = options.language;
|
4782 |
+
|
4783 |
+
for (var l = 0; l < languageNames.length; l++) {
|
4784 |
+
var name = languageNames[l];
|
4785 |
+
var language = {};
|
4786 |
+
|
4787 |
+
try {
|
4788 |
+
// Try to load it with the original name
|
4789 |
+
language = Translation.loadPath(name);
|
4790 |
+
} catch (e) {
|
4791 |
+
try {
|
4792 |
+
// If we couldn't load it, check if it wasn't the full path
|
4793 |
+
name = this.defaults.amdLanguageBase + name;
|
4794 |
+
language = Translation.loadPath(name);
|
4795 |
+
} catch (ex) {
|
4796 |
+
// The translation could not be loaded at all. Sometimes this is
|
4797 |
+
// because of a configuration problem, other times this can be
|
4798 |
+
// because of how Select2 helps load all possible translation files.
|
4799 |
+
if (options.debug && window.console && console.warn) {
|
4800 |
+
console.warn(
|
4801 |
+
'Select2: The language file for "' + name + '" could not be ' +
|
4802 |
+
'automatically loaded. A fallback will be used instead.'
|
4803 |
+
);
|
4804 |
+
}
|
4805 |
+
|
4806 |
+
continue;
|
4807 |
+
}
|
4808 |
+
}
|
4809 |
+
|
4810 |
+
languages.extend(language);
|
4811 |
+
}
|
4812 |
+
|
4813 |
+
options.translations = languages;
|
4814 |
+
} else {
|
4815 |
+
var baseTranslation = Translation.loadPath(
|
4816 |
+
this.defaults.amdLanguageBase + 'en'
|
4817 |
+
);
|
4818 |
+
var customTranslation = new Translation(options.language);
|
4819 |
+
|
4820 |
+
customTranslation.extend(baseTranslation);
|
4821 |
+
|
4822 |
+
options.translations = customTranslation;
|
4823 |
+
}
|
4824 |
+
|
4825 |
+
return options;
|
4826 |
+
};
|
4827 |
+
|
4828 |
+
Defaults.prototype.reset = function () {
|
4829 |
+
function stripDiacritics (text) {
|
4830 |
+
// Used 'uni range + named function' from http://jsperf.com/diacritics/18
|
4831 |
+
function match(a) {
|
4832 |
+
return DIACRITICS[a] || a;
|
4833 |
+
}
|
4834 |
+
|
4835 |
+
return text.replace(/[^\u0000-\u007E]/g, match);
|
4836 |
+
}
|
4837 |
+
|
4838 |
+
function matcher (params, data) {
|
4839 |
+
// Always return the object if there is nothing to compare
|
4840 |
+
if ($.trim(params.term) === '') {
|
4841 |
+
return data;
|
4842 |
+
}
|
4843 |
+
|
4844 |
+
// Do a recursive check for options with children
|
4845 |
+
if (data.children && data.children.length > 0) {
|
4846 |
+
// Clone the data object if there are children
|
4847 |
+
// This is required as we modify the object to remove any non-matches
|
4848 |
+
var match = $.extend(true, {}, data);
|
4849 |
+
|
4850 |
+
// Check each child of the option
|
4851 |
+
for (var c = data.children.length - 1; c >= 0; c--) {
|
4852 |
+
var child = data.children[c];
|
4853 |
+
|
4854 |
+
var matches = matcher(params, child);
|
4855 |
+
|
4856 |
+
// If there wasn't a match, remove the object in the array
|
4857 |
+
if (matches == null) {
|
4858 |
+
match.children.splice(c, 1);
|
4859 |
+
}
|
4860 |
+
}
|
4861 |
+
|
4862 |
+
// If any children matched, return the new object
|
4863 |
+
if (match.children.length > 0) {
|
4864 |
+
return match;
|
4865 |
+
}
|
4866 |
+
|
4867 |
+
// If there were no matching children, check just the plain object
|
4868 |
+
return matcher(params, match);
|
4869 |
+
}
|
4870 |
+
|
4871 |
+
var original = stripDiacritics(data.text).toUpperCase();
|
4872 |
+
var term = stripDiacritics(params.term).toUpperCase();
|
4873 |
+
|
4874 |
+
// Check if the text contains the term
|
4875 |
+
if (original.indexOf(term) > -1) {
|
4876 |
+
return data;
|
4877 |
+
}
|
4878 |
+
|
4879 |
+
// If it doesn't contain the term, don't return anything
|
4880 |
+
return null;
|
4881 |
+
}
|
4882 |
+
|
4883 |
+
this.defaults = {
|
4884 |
+
amdBase: './',
|
4885 |
+
amdLanguageBase: './i18n/',
|
4886 |
+
closeOnSelect: true,
|
4887 |
+
debug: false,
|
4888 |
+
dropdownAutoWidth: false,
|
4889 |
+
escapeMarkup: Utils.escapeMarkup,
|
4890 |
+
language: EnglishTranslation,
|
4891 |
+
matcher: matcher,
|
4892 |
+
minimumInputLength: 0,
|
4893 |
+
maximumInputLength: 0,
|
4894 |
+
maximumSelectionLength: 0,
|
4895 |
+
minimumResultsForSearch: 0,
|
4896 |
+
selectOnClose: false,
|
4897 |
+
sorter: function (data) {
|
4898 |
+
return data;
|
4899 |
+
},
|
4900 |
+
templateResult: function (result) {
|
4901 |
+
return result.text;
|
4902 |
+
},
|
4903 |
+
templateSelection: function (selection) {
|
4904 |
+
return selection.text;
|
4905 |
+
},
|
4906 |
+
theme: 'default',
|
4907 |
+
width: 'resolve'
|
4908 |
+
};
|
4909 |
+
};
|
4910 |
+
|
4911 |
+
Defaults.prototype.set = function (key, value) {
|
4912 |
+
var camelKey = $.camelCase(key);
|
4913 |
+
|
4914 |
+
var data = {};
|
4915 |
+
data[camelKey] = value;
|
4916 |
+
|
4917 |
+
var convertedData = Utils._convertData(data);
|
4918 |
+
|
4919 |
+
$.extend(this.defaults, convertedData);
|
4920 |
+
};
|
4921 |
+
|
4922 |
+
var defaults = new Defaults();
|
4923 |
+
|
4924 |
+
return defaults;
|
4925 |
+
});
|
4926 |
+
|
4927 |
+
S2.define('select2/options',[
|
4928 |
+
'require',
|
4929 |
+
'jquery',
|
4930 |
+
'./defaults',
|
4931 |
+
'./utils'
|
4932 |
+
], function (require, $, Defaults, Utils) {
|
4933 |
+
function Options (options, $element) {
|
4934 |
+
this.options = options;
|
4935 |
+
|
4936 |
+
if ($element != null) {
|
4937 |
+
this.fromElement($element);
|
4938 |
+
}
|
4939 |
+
|
4940 |
+
this.options = Defaults.apply(this.options);
|
4941 |
+
|
4942 |
+
if ($element && $element.is('input')) {
|
4943 |
+
var InputCompat = require(this.get('amdBase') + 'compat/inputData');
|
4944 |
+
|
4945 |
+
this.options.dataAdapter = Utils.Decorate(
|
4946 |
+
this.options.dataAdapter,
|
4947 |
+
InputCompat
|
4948 |
+
);
|
4949 |
+
}
|
4950 |
+
}
|
4951 |
+
|
4952 |
+
Options.prototype.fromElement = function ($e) {
|
4953 |
+
var excludedData = ['select2'];
|
4954 |
+
|
4955 |
+
if (this.options.multiple == null) {
|
4956 |
+
this.options.multiple = $e.prop('multiple');
|
4957 |
+
}
|
4958 |
+
|
4959 |
+
if (this.options.disabled == null) {
|
4960 |
+
this.options.disabled = $e.prop('disabled');
|
4961 |
+
}
|
4962 |
+
|
4963 |
+
if (this.options.language == null) {
|
4964 |
+
if ($e.prop('lang')) {
|
4965 |
+
this.options.language = $e.prop('lang').toLowerCase();
|
4966 |
+
} else if ($e.closest('[lang]').prop('lang')) {
|
4967 |
+
this.options.language = $e.closest('[lang]').prop('lang');
|
4968 |
+
}
|
4969 |
+
}
|
4970 |
+
|
4971 |
+
if (this.options.dir == null) {
|
4972 |
+
if ($e.prop('dir')) {
|
4973 |
+
this.options.dir = $e.prop('dir');
|
4974 |
+
} else if ($e.closest('[dir]').prop('dir')) {
|
4975 |
+
this.options.dir = $e.closest('[dir]').prop('dir');
|
4976 |
+
} else {
|
4977 |
+
this.options.dir = 'ltr';
|
4978 |
+
}
|
4979 |
+
}
|
4980 |
+
|
4981 |
+
$e.prop('disabled', this.options.disabled);
|
4982 |
+
$e.prop('multiple', this.options.multiple);
|
4983 |
+
|
4984 |
+
if ($e.data('select2Tags')) {
|
4985 |
+
if (this.options.debug && window.console && console.warn) {
|
4986 |
+
console.warn(
|
4987 |
+
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
4988 |
+
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
4989 |
+
'removed in future versions of Select2.'
|
4990 |
+
);
|
4991 |
+
}
|
4992 |
+
|
4993 |
+
$e.data('data', $e.data('select2Tags'));
|
4994 |
+
$e.data('tags', true);
|
4995 |
+
}
|
4996 |
+
|
4997 |
+
if ($e.data('ajaxUrl')) {
|
4998 |
+
if (this.options.debug && window.console && console.warn) {
|
4999 |
+
console.warn(
|
5000 |
+
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
5001 |
+
'`data-ajax--url` and support for the old attribute will be removed' +
|
5002 |
+
' in future versions of Select2.'
|
5003 |
+
);
|
5004 |
+
}
|
5005 |
+
|
5006 |
+
$e.attr('ajax--url', $e.data('ajaxUrl'));
|
5007 |
+
$e.data('ajax--url', $e.data('ajaxUrl'));
|
5008 |
+
}
|
5009 |
+
|
5010 |
+
var dataset = {};
|
5011 |
+
|
5012 |
+
// Prefer the element's `dataset` attribute if it exists
|
5013 |
+
// jQuery 1.x does not correctly handle data attributes with multiple dashes
|
5014 |
+
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
|
5015 |
+
dataset = $.extend(true, {}, $e[0].dataset, $e.data());
|
5016 |
+
} else {
|
5017 |
+
dataset = $e.data();
|
5018 |
+
}
|
5019 |
+
|
5020 |
+
var data = $.extend(true, {}, dataset);
|
5021 |
+
|
5022 |
+
data = Utils._convertData(data);
|
5023 |
+
|
5024 |
+
for (var key in data) {
|
5025 |
+
if ($.inArray(key, excludedData) > -1) {
|
5026 |
+
continue;
|
5027 |
+
}
|
5028 |
+
|
5029 |
+
if ($.isPlainObject(this.options[key])) {
|
5030 |
+
$.extend(this.options[key], data[key]);
|
5031 |
+
} else {
|
5032 |
+
this.options[key] = data[key];
|
5033 |
+
}
|
5034 |
+
}
|
5035 |
+
|
5036 |
+
return this;
|
5037 |
+
};
|
5038 |
+
|
5039 |
+
Options.prototype.get = function (key) {
|
5040 |
+
return this.options[key];
|
5041 |
+
};
|
5042 |
+
|
5043 |
+
Options.prototype.set = function (key, val) {
|
5044 |
+
this.options[key] = val;
|
5045 |
+
};
|
5046 |
+
|
5047 |
+
return Options;
|
5048 |
+
});
|
5049 |
+
|
5050 |
+
S2.define('select2/core',[
|
5051 |
+
'jquery',
|
5052 |
+
'./options',
|
5053 |
+
'./utils',
|
5054 |
+
'./keys'
|
5055 |
+
], function ($, Options, Utils, KEYS) {
|
5056 |
+
var Select2 = function ($element, options) {
|
5057 |
+
if ($element.data('select2') != null) {
|
5058 |
+
$element.data('select2').destroy();
|
5059 |
+
}
|
5060 |
+
|
5061 |
+
this.$element = $element;
|
5062 |
+
|
5063 |
+
this.id = this._generateId($element);
|
5064 |
+
|
5065 |
+
options = options || {};
|
5066 |
+
|
5067 |
+
this.options = new Options(options, $element);
|
5068 |
+
|
5069 |
+
Select2.__super__.constructor.call(this);
|
5070 |
+
|
5071 |
+
// Set up the tabindex
|
5072 |
+
|
5073 |
+
var tabindex = $element.attr('tabindex') || 0;
|
5074 |
+
$element.data('old-tabindex', tabindex);
|
5075 |
+
$element.attr('tabindex', '-1');
|
5076 |
+
|
5077 |
+
// Set up containers and adapters
|
5078 |
+
|
5079 |
+
var DataAdapter = this.options.get('dataAdapter');
|
5080 |
+
this.dataAdapter = new DataAdapter($element, this.options);
|
5081 |
+
|
5082 |
+
var $container = this.render();
|
5083 |
+
|
5084 |
+
this._placeContainer($container);
|
5085 |
+
|
5086 |
+
var SelectionAdapter = this.options.get('selectionAdapter');
|
5087 |
+
this.selection = new SelectionAdapter($element, this.options);
|
5088 |
+
this.$selection = this.selection.render();
|
5089 |
+
|
5090 |
+
this.selection.position(this.$selection, $container);
|
5091 |
+
|
5092 |
+
var DropdownAdapter = this.options.get('dropdownAdapter');
|
5093 |
+
this.dropdown = new DropdownAdapter($element, this.options);
|
5094 |
+
this.$dropdown = this.dropdown.render();
|
5095 |
+
|
5096 |
+
this.dropdown.position(this.$dropdown, $container);
|
5097 |
+
|
5098 |
+
var ResultsAdapter = this.options.get('resultsAdapter');
|
5099 |
+
this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
|
5100 |
+
this.$results = this.results.render();
|
5101 |
+
|
5102 |
+
this.results.position(this.$results, this.$dropdown);
|
5103 |
+
|
5104 |
+
// Bind events
|
5105 |
+
|
5106 |
+
var self = this;
|
5107 |
+
|
5108 |
+
// Bind the container to all of the adapters
|
5109 |
+
this._bindAdapters();
|
5110 |
+
|
5111 |
+
// Register any DOM event handlers
|
5112 |
+
this._registerDomEvents();
|
5113 |
+
|
5114 |
+
// Register any internal event handlers
|
5115 |
+
this._registerDataEvents();
|
5116 |
+
this._registerSelectionEvents();
|
5117 |
+
this._registerDropdownEvents();
|
5118 |
+
this._registerResultsEvents();
|
5119 |
+
this._registerEvents();
|
5120 |
+
|
5121 |
+
// Set the initial state
|
5122 |
+
this.dataAdapter.current(function (initialData) {
|
5123 |
+
self.trigger('selection:update', {
|
5124 |
+
data: initialData
|
5125 |
+
});
|
5126 |
+
});
|
5127 |
+
|
5128 |
+
// Hide the original select
|
5129 |
+
$element.addClass('select2-hidden-accessible');
|
5130 |
+
$element.attr('aria-hidden', 'true');
|
5131 |
+
|
5132 |
+
// Synchronize any monitored attributes
|
5133 |
+
this._syncAttributes();
|
5134 |
+
|
5135 |
+
$element.data('select2', this);
|
5136 |
+
};
|
5137 |
+
|
5138 |
+
Utils.Extend(Select2, Utils.Observable);
|
5139 |
+
|
5140 |
+
Select2.prototype._generateId = function ($element) {
|
5141 |
+
var id = '';
|
5142 |
+
|
5143 |
+
if ($element.attr('id') != null) {
|
5144 |
+
id = $element.attr('id');
|
5145 |
+
} else if ($element.attr('name') != null) {
|
5146 |
+
id = $element.attr('name') + '-' + Utils.generateChars(2);
|
5147 |
+
} else {
|
5148 |
+
id = Utils.generateChars(4);
|
5149 |
+
}
|
5150 |
+
|
5151 |
+
id = id.replace(/(:|\.|\[|\]|,)/g, '');
|
5152 |
+
id = 'select2-' + id;
|
5153 |
+
|
5154 |
+
return id;
|
5155 |
+
};
|
5156 |
+
|
5157 |
+
Select2.prototype._placeContainer = function ($container) {
|
5158 |
+
$container.insertAfter(this.$element);
|
5159 |
+
|
5160 |
+
var width = this._resolveWidth(this.$element, this.options.get('width'));
|
5161 |
+
|
5162 |
+
if (width != null) {
|
5163 |
+
$container.css('width', width);
|
5164 |
+
}
|
5165 |
+
};
|
5166 |
+
|
5167 |
+
Select2.prototype._resolveWidth = function ($element, method) {
|
5168 |
+
var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
|
5169 |
+
|
5170 |
+
if (method == 'resolve') {
|
5171 |
+
var styleWidth = this._resolveWidth($element, 'style');
|
5172 |
+
|
5173 |
+
if (styleWidth != null) {
|
5174 |
+
return styleWidth;
|
5175 |
+
}
|
5176 |
+
|
5177 |
+
return this._resolveWidth($element, 'element');
|
5178 |
+
}
|
5179 |
+
|
5180 |
+
if (method == 'element') {
|
5181 |
+
var elementWidth = $element.outerWidth(false);
|
5182 |
+
|
5183 |
+
if (elementWidth <= 0) {
|
5184 |
+
return 'auto';
|
5185 |
+
}
|
5186 |
+
|
5187 |
+
return elementWidth + 'px';
|
5188 |
+
}
|
5189 |
+
|
5190 |
+
if (method == 'style') {
|
5191 |
+
var style = $element.attr('style');
|
5192 |
+
|
5193 |
+
if (typeof(style) !== 'string') {
|
5194 |
+
return null;
|
5195 |
+
}
|
5196 |
+
|
5197 |
+
var attrs = style.split(';');
|
5198 |
+
|
5199 |
+
for (var i = 0, l = attrs.length; i < l; i = i + 1) {
|
5200 |
+
var attr = attrs[i].replace(/\s/g, '');
|
5201 |
+
var matches = attr.match(WIDTH);
|
5202 |
+
|
5203 |
+
if (matches !== null && matches.length >= 1) {
|
5204 |
+
return matches[1];
|
5205 |
+
}
|
5206 |
+
}
|
5207 |
+
|
5208 |
+
return null;
|
5209 |
+
}
|
5210 |
+
|
5211 |
+
return method;
|
5212 |
+
};
|
5213 |
+
|
5214 |
+
Select2.prototype._bindAdapters = function () {
|
5215 |
+
this.dataAdapter.bind(this, this.$container);
|
5216 |
+
this.selection.bind(this, this.$container);
|
5217 |
+
|
5218 |
+
this.dropdown.bind(this, this.$container);
|
5219 |
+
this.results.bind(this, this.$container);
|
5220 |
+
};
|
5221 |
+
|
5222 |
+
Select2.prototype._registerDomEvents = function () {
|
5223 |
+
var self = this;
|
5224 |
+
|
5225 |
+
this.$element.on('change.select2', function () {
|
5226 |
+
self.dataAdapter.current(function (data) {
|
5227 |
+
self.trigger('selection:update', {
|
5228 |
+
data: data
|
5229 |
+
});
|
5230 |
+
});
|
5231 |
+
});
|
5232 |
+
|
5233 |
+
this.$element.on('focus.select2', function (evt) {
|
5234 |
+
self.trigger('focus', evt);
|
5235 |
+
});
|
5236 |
+
|
5237 |
+
this._syncA = Utils.bind(this._syncAttributes, this);
|
5238 |
+
this._syncS = Utils.bind(this._syncSubtree, this);
|
5239 |
+
|
5240 |
+
if (this.$element[0].attachEvent) {
|
5241 |
+
this.$element[0].attachEvent('onpropertychange', this._syncA);
|
5242 |
+
}
|
5243 |
+
|
5244 |
+
var observer = window.MutationObserver ||
|
5245 |
+
window.WebKitMutationObserver ||
|
5246 |
+
window.MozMutationObserver
|
5247 |
+
;
|
5248 |
+
|
5249 |
+
if (observer != null) {
|
5250 |
+
this._observer = new observer(function (mutations) {
|
5251 |
+
$.each(mutations, self._syncA);
|
5252 |
+
$.each(mutations, self._syncS);
|
5253 |
+
});
|
5254 |
+
this._observer.observe(this.$element[0], {
|
5255 |
+
attributes: true,
|
5256 |
+
childList: true,
|
5257 |
+
subtree: false
|
5258 |
+
});
|
5259 |
+
} else if (this.$element[0].addEventListener) {
|
5260 |
+
this.$element[0].addEventListener(
|
5261 |
+
'DOMAttrModified',
|
5262 |
+
self._syncA,
|
5263 |
+
false
|
5264 |
+
);
|
5265 |
+
this.$element[0].addEventListener(
|
5266 |
+
'DOMNodeInserted',
|
5267 |
+
self._syncS,
|
5268 |
+
false
|
5269 |
+
);
|
5270 |
+
this.$element[0].addEventListener(
|
5271 |
+
'DOMNodeRemoved',
|
5272 |
+
self._syncS,
|
5273 |
+
false
|
5274 |
+
);
|
5275 |
+
}
|
5276 |
+
};
|
5277 |
+
|
5278 |
+
Select2.prototype._registerDataEvents = function () {
|
5279 |
+
var self = this;
|
5280 |
+
|
5281 |
+
this.dataAdapter.on('*', function (name, params) {
|
5282 |
+
self.trigger(name, params);
|
5283 |
+
});
|
5284 |
+
};
|
5285 |
+
|
5286 |
+
Select2.prototype._registerSelectionEvents = function () {
|
5287 |
+
var self = this;
|
5288 |
+
var nonRelayEvents = ['toggle', 'focus'];
|
5289 |
+
|
5290 |
+
this.selection.on('toggle', function () {
|
5291 |
+
self.toggleDropdown();
|
5292 |
+
});
|
5293 |
+
|
5294 |
+
this.selection.on('focus', function (params) {
|
5295 |
+
self.focus(params);
|
5296 |
+
});
|
5297 |
+
|
5298 |
+
this.selection.on('*', function (name, params) {
|
5299 |
+
if ($.inArray(name, nonRelayEvents) !== -1) {
|
5300 |
+
return;
|
5301 |
+
}
|
5302 |
+
|
5303 |
+
self.trigger(name, params);
|
5304 |
+
});
|
5305 |
+
};
|
5306 |
+
|
5307 |
+
Select2.prototype._registerDropdownEvents = function () {
|
5308 |
+
var self = this;
|
5309 |
+
|
5310 |
+
this.dropdown.on('*', function (name, params) {
|
5311 |
+
self.trigger(name, params);
|
5312 |
+
});
|
5313 |
+
};
|
5314 |
+
|
5315 |
+
Select2.prototype._registerResultsEvents = function () {
|
5316 |
+
var self = this;
|
5317 |
+
|
5318 |
+
this.results.on('*', function (name, params) {
|
5319 |
+
self.trigger(name, params);
|
5320 |
+
});
|
5321 |
+
};
|
5322 |
+
|
5323 |
+
Select2.prototype._registerEvents = function () {
|
5324 |
+
var self = this;
|
5325 |
+
|
5326 |
+
this.on('open', function () {
|
5327 |
+
self.$container.addClass('select2-container--open');
|
5328 |
+
});
|
5329 |
+
|
5330 |
+
this.on('close', function () {
|
5331 |
+
self.$container.removeClass('select2-container--open');
|
5332 |
+
});
|
5333 |
+
|
5334 |
+
this.on('enable', function () {
|
5335 |
+
self.$container.removeClass('select2-container--disabled');
|
5336 |
+
});
|
5337 |
+
|
5338 |
+
this.on('disable', function () {
|
5339 |
+
self.$container.addClass('select2-container--disabled');
|
5340 |
+
});
|
5341 |
+
|
5342 |
+
this.on('blur', function () {
|
5343 |
+
self.$container.removeClass('select2-container--focus');
|
5344 |
+
});
|
5345 |
+
|
5346 |
+
this.on('query', function (params) {
|
5347 |
+
if (!self.isOpen()) {
|
5348 |
+
self.trigger('open', {});
|
5349 |
+
}
|
5350 |
+
|
5351 |
+
this.dataAdapter.query(params, function (data) {
|
5352 |
+
self.trigger('results:all', {
|
5353 |
+
data: data,
|
5354 |
+
query: params
|
5355 |
+
});
|
5356 |
+
});
|
5357 |
+
});
|
5358 |
+
|
5359 |
+
this.on('query:append', function (params) {
|
5360 |
+
this.dataAdapter.query(params, function (data) {
|
5361 |
+
self.trigger('results:append', {
|
5362 |
+
data: data,
|
5363 |
+
query: params
|
5364 |
+
});
|
5365 |
+
});
|
5366 |
+
});
|
5367 |
+
|
5368 |
+
this.on('keypress', function (evt) {
|
5369 |
+
var key = evt.which;
|
5370 |
+
|
5371 |
+
if (self.isOpen()) {
|
5372 |
+
if (key === KEYS.ESC || key === KEYS.TAB ||
|
5373 |
+
(key === KEYS.UP && evt.altKey)) {
|
5374 |
+
self.close();
|
5375 |
+
|
5376 |
+
evt.preventDefault();
|
5377 |
+
} else if (key === KEYS.ENTER) {
|
5378 |
+
self.trigger('results:select', {});
|
5379 |
+
|
5380 |
+
evt.preventDefault();
|
5381 |
+
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
|
5382 |
+
self.trigger('results:toggle', {});
|
5383 |
+
|
5384 |
+
evt.preventDefault();
|
5385 |
+
} else if (key === KEYS.UP) {
|
5386 |
+
self.trigger('results:previous', {});
|
5387 |
+
|
5388 |
+
evt.preventDefault();
|
5389 |
+
} else if (key === KEYS.DOWN) {
|
5390 |
+
self.trigger('results:next', {});
|
5391 |
+
|
5392 |
+
evt.preventDefault();
|
5393 |
+
}
|
5394 |
+
} else {
|
5395 |
+
if (key === KEYS.ENTER || key === KEYS.SPACE ||
|
5396 |
+
(key === KEYS.DOWN && evt.altKey)) {
|
5397 |
+
self.open();
|
5398 |
+
|
5399 |
+
evt.preventDefault();
|
5400 |
+
}
|
5401 |
+
}
|
5402 |
+
});
|
5403 |
+
};
|
5404 |
+
|
5405 |
+
Select2.prototype._syncAttributes = function () {
|
5406 |
+
this.options.set('disabled', this.$element.prop('disabled'));
|
5407 |
+
|
5408 |
+
if (this.options.get('disabled')) {
|
5409 |
+
if (this.isOpen()) {
|
5410 |
+
this.close();
|
5411 |
+
}
|
5412 |
+
|
5413 |
+
this.trigger('disable', {});
|
5414 |
+
} else {
|
5415 |
+
this.trigger('enable', {});
|
5416 |
+
}
|
5417 |
+
};
|
5418 |
+
|
5419 |
+
Select2.prototype._syncSubtree = function (evt, mutations) {
|
5420 |
+
var changed = false;
|
5421 |
+
var self = this;
|
5422 |
+
|
5423 |
+
// Ignore any mutation events raised for elements that aren't options or
|
5424 |
+
// optgroups. This handles the case when the select element is destroyed
|
5425 |
+
if (
|
5426 |
+
evt && evt.target && (
|
5427 |
+
evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
|
5428 |
+
)
|
5429 |
+
) {
|
5430 |
+
return;
|
5431 |
+
}
|
5432 |
+
|
5433 |
+
if (!mutations) {
|
5434 |
+
// If mutation events aren't supported, then we can only assume that the
|
5435 |
+
// change affected the selections
|
5436 |
+
changed = true;
|
5437 |
+
} else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
|
5438 |
+
for (var n = 0; n < mutations.addedNodes.length; n++) {
|
5439 |
+
var node = mutations.addedNodes[n];
|
5440 |
+
|
5441 |
+
if (node.selected) {
|
5442 |
+
changed = true;
|
5443 |
+
}
|
5444 |
+
}
|
5445 |
+
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
|
5446 |
+
changed = true;
|
5447 |
+
}
|
5448 |
+
|
5449 |
+
// Only re-pull the data if we think there is a change
|
5450 |
+
if (changed) {
|
5451 |
+
this.dataAdapter.current(function (currentData) {
|
5452 |
+
self.trigger('selection:update', {
|
5453 |
+
data: currentData
|
5454 |
+
});
|
5455 |
+
});
|
5456 |
+
}
|
5457 |
+
};
|
5458 |
+
|
5459 |
+
/**
|
5460 |
+
* Override the trigger method to automatically trigger pre-events when
|
5461 |
+
* there are events that can be prevented.
|
5462 |
+
*/
|
5463 |
+
Select2.prototype.trigger = function (name, args) {
|
5464 |
+
var actualTrigger = Select2.__super__.trigger;
|
5465 |
+
var preTriggerMap = {
|
5466 |
+
'open': 'opening',
|
5467 |
+
'close': 'closing',
|
5468 |
+
'select': 'selecting',
|
5469 |
+
'unselect': 'unselecting'
|
5470 |
+
};
|
5471 |
+
|
5472 |
+
if (args === undefined) {
|
5473 |
+
args = {};
|
5474 |
+
}
|
5475 |
+
|
5476 |
+
if (name in preTriggerMap) {
|
5477 |
+
var preTriggerName = preTriggerMap[name];
|
5478 |
+
var preTriggerArgs = {
|
5479 |
+
prevented: false,
|
5480 |
+
name: name,
|
5481 |
+
args: args
|
5482 |
+
};
|
5483 |
+
|
5484 |
+
actualTrigger.call(this, preTriggerName, preTriggerArgs);
|
5485 |
+
|
5486 |
+
if (preTriggerArgs.prevented) {
|
5487 |
+
args.prevented = true;
|
5488 |
+
|
5489 |
+
return;
|
5490 |
+
}
|
5491 |
+
}
|
5492 |
+
|
5493 |
+
actualTrigger.call(this, name, args);
|
5494 |
+
};
|
5495 |
+
|
5496 |
+
Select2.prototype.toggleDropdown = function () {
|
5497 |
+
if (this.options.get('disabled')) {
|
5498 |
+
return;
|
5499 |
+
}
|
5500 |
+
|
5501 |
+
if (this.isOpen()) {
|
5502 |
+
this.close();
|
5503 |
+
} else {
|
5504 |
+
this.open();
|
5505 |
+
}
|
5506 |
+
};
|
5507 |
+
|
5508 |
+
Select2.prototype.open = function () {
|
5509 |
+
if (this.isOpen()) {
|
5510 |
+
return;
|
5511 |
+
}
|
5512 |
+
|
5513 |
+
this.trigger('query', {});
|
5514 |
+
};
|
5515 |
+
|
5516 |
+
Select2.prototype.close = function () {
|
5517 |
+
if (!this.isOpen()) {
|
5518 |
+
return;
|
5519 |
+
}
|
5520 |
+
|
5521 |
+
this.trigger('close', {});
|
5522 |
+
};
|
5523 |
+
|
5524 |
+
Select2.prototype.isOpen = function () {
|
5525 |
+
return this.$container.hasClass('select2-container--open');
|
5526 |
+
};
|
5527 |
+
|
5528 |
+
Select2.prototype.hasFocus = function () {
|
5529 |
+
return this.$container.hasClass('select2-container--focus');
|
5530 |
+
};
|
5531 |
+
|
5532 |
+
Select2.prototype.focus = function (data) {
|
5533 |
+
// No need to re-trigger focus events if we are already focused
|
5534 |
+
if (this.hasFocus()) {
|
5535 |
+
return;
|
5536 |
+
}
|
5537 |
+
|
5538 |
+
this.$container.addClass('select2-container--focus');
|
5539 |
+
this.trigger('focus', {});
|
5540 |
+
};
|
5541 |
+
|
5542 |
+
Select2.prototype.enable = function (args) {
|
5543 |
+
if (this.options.get('debug') && window.console && console.warn) {
|
5544 |
+
console.warn(
|
5545 |
+
'Select2: The `select2("enable")` method has been deprecated and will' +
|
5546 |
+
' be removed in later Select2 versions. Use $element.prop("disabled")' +
|
5547 |
+
' instead.'
|
5548 |
+
);
|
5549 |
+
}
|
5550 |
+
|
5551 |
+
if (args == null || args.length === 0) {
|
5552 |
+
args = [true];
|
5553 |
+
}
|
5554 |
+
|
5555 |
+
var disabled = !args[0];
|
5556 |
+
|
5557 |
+
this.$element.prop('disabled', disabled);
|
5558 |
+
};
|
5559 |
+
|
5560 |
+
Select2.prototype.data = function () {
|
5561 |
+
if (this.options.get('debug') &&
|
5562 |
+
arguments.length > 0 && window.console && console.warn) {
|
5563 |
+
console.warn(
|
5564 |
+
'Select2: Data can no longer be set using `select2("data")`. You ' +
|
5565 |
+
'should consider setting the value instead using `$element.val()`.'
|
5566 |
+
);
|
5567 |
+
}
|
5568 |
+
|
5569 |
+
var data = [];
|
5570 |
+
|
5571 |
+
this.dataAdapter.current(function (currentData) {
|
5572 |
+
data = currentData;
|
5573 |
+
});
|
5574 |
+
|
5575 |
+
return data;
|
5576 |
+
};
|
5577 |
+
|
5578 |
+
Select2.prototype.val = function (args) {
|
5579 |
+
if (this.options.get('debug') && window.console && console.warn) {
|
5580 |
+
console.warn(
|
5581 |
+
'Select2: The `select2("val")` method has been deprecated and will be' +
|
5582 |
+
' removed in later Select2 versions. Use $element.val() instead.'
|
5583 |
+
);
|
5584 |
+
}
|
5585 |
+
|
5586 |
+
if (args == null || args.length === 0) {
|
5587 |
+
return this.$element.val();
|
5588 |
+
}
|
5589 |
+
|
5590 |
+
var newVal = args[0];
|
5591 |
+
|
5592 |
+
if ($.isArray(newVal)) {
|
5593 |
+
newVal = $.map(newVal, function (obj) {
|
5594 |
+
return obj.toString();
|
5595 |
+
});
|
5596 |
+
}
|
5597 |
+
|
5598 |
+
this.$element.val(newVal).trigger('change');
|
5599 |
+
};
|
5600 |
+
|
5601 |
+
Select2.prototype.destroy = function () {
|
5602 |
+
this.$container.remove();
|
5603 |
+
|
5604 |
+
if (this.$element[0].detachEvent) {
|
5605 |
+
this.$element[0].detachEvent('onpropertychange', this._syncA);
|
5606 |
+
}
|
5607 |
+
|
5608 |
+
if (this._observer != null) {
|
5609 |
+
this._observer.disconnect();
|
5610 |
+
this._observer = null;
|
5611 |
+
} else if (this.$element[0].removeEventListener) {
|
5612 |
+
this.$element[0]
|
5613 |
+
.removeEventListener('DOMAttrModified', this._syncA, false);
|
5614 |
+
this.$element[0]
|
5615 |
+
.removeEventListener('DOMNodeInserted', this._syncS, false);
|
5616 |
+
this.$element[0]
|
5617 |
+
.removeEventListener('DOMNodeRemoved', this._syncS, false);
|
5618 |
+
}
|
5619 |
+
|
5620 |
+
this._syncA = null;
|
5621 |
+
this._syncS = null;
|
5622 |
+
|
5623 |
+
this.$element.off('.select2');
|
5624 |
+
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
5625 |
+
|
5626 |
+
this.$element.removeClass('select2-hidden-accessible');
|
5627 |
+
this.$element.attr('aria-hidden', 'false');
|
5628 |
+
this.$element.removeData('select2');
|
5629 |
+
|
5630 |
+
this.dataAdapter.destroy();
|
5631 |
+
this.selection.destroy();
|
5632 |
+
this.dropdown.destroy();
|
5633 |
+
this.results.destroy();
|
5634 |
+
|
5635 |
+
this.dataAdapter = null;
|
5636 |
+
this.selection = null;
|
5637 |
+
this.dropdown = null;
|
5638 |
+
this.results = null;
|
5639 |
+
};
|
5640 |
+
|
5641 |
+
Select2.prototype.render = function () {
|
5642 |
+
var $container = $(
|
5643 |
+
'<span class="select2 select2-container">' +
|
5644 |
+
'<span class="selection"></span>' +
|
5645 |
+
'<span class="dropdown-wrapper" aria-hidden="true"></span>' +
|
5646 |
+
'</span>'
|
5647 |
+
);
|
5648 |
+
|
5649 |
+
$container.attr('dir', this.options.get('dir'));
|
5650 |
+
|
5651 |
+
this.$container = $container;
|
5652 |
+
|
5653 |
+
this.$container.addClass('select2-container--' + this.options.get('theme'));
|
5654 |
+
|
5655 |
+
$container.data('element', this.$element);
|
5656 |
+
|
5657 |
+
return $container;
|
5658 |
+
};
|
5659 |
+
|
5660 |
+
return Select2;
|
5661 |
+
});
|
5662 |
+
|
5663 |
+
S2.define('jquery-mousewheel',[
|
5664 |
+
'jquery'
|
5665 |
+
], function ($) {
|
5666 |
+
// Used to shim jQuery.mousewheel for non-full builds.
|
5667 |
+
return $;
|
5668 |
+
});
|
5669 |
+
|
5670 |
+
S2.define('jquery.select2',[
|
5671 |
+
'jquery',
|
5672 |
+
'jquery-mousewheel',
|
5673 |
+
|
5674 |
+
'./select2/core',
|
5675 |
+
'./select2/defaults'
|
5676 |
+
], function ($, _, Select2, Defaults) {
|
5677 |
+
if ($.fn.select2 == null) {
|
5678 |
+
// All methods that should return the element
|
5679 |
+
var thisMethods = ['open', 'close', 'destroy'];
|
5680 |
+
|
5681 |
+
$.fn.select2 = function (options) {
|
5682 |
+
options = options || {};
|
5683 |
+
|
5684 |
+
if (typeof options === 'object') {
|
5685 |
+
this.each(function () {
|
5686 |
+
var instanceOptions = $.extend(true, {}, options);
|
5687 |
+
|
5688 |
+
var instance = new Select2($(this), instanceOptions);
|
5689 |
+
});
|
5690 |
+
|
5691 |
+
return this;
|
5692 |
+
} else if (typeof options === 'string') {
|
5693 |
+
var ret;
|
5694 |
+
var args = Array.prototype.slice.call(arguments, 1);
|
5695 |
+
|
5696 |
+
this.each(function () {
|
5697 |
+
var instance = $(this).data('select2');
|
5698 |
+
|
5699 |
+
if (instance == null && window.console && console.error) {
|
5700 |
+
console.error(
|
5701 |
+
'The select2(\'' + options + '\') method was called on an ' +
|
5702 |
+
'element that is not using Select2.'
|
5703 |
+
);
|
5704 |
+
}
|
5705 |
+
|
5706 |
+
ret = instance[options].apply(instance, args);
|
5707 |
+
});
|
5708 |
+
|
5709 |
+
// Check if we should be returning `this`
|
5710 |
+
if ($.inArray(options, thisMethods) > -1) {
|
5711 |
+
return this;
|
5712 |
+
}
|
5713 |
+
|
5714 |
+
return ret;
|
5715 |
+
} else {
|
5716 |
+
throw new Error('Invalid arguments for Select2: ' + options);
|
5717 |
+
}
|
5718 |
+
};
|
5719 |
+
}
|
5720 |
+
|
5721 |
+
if ($.fn.select2.defaults == null) {
|
5722 |
+
$.fn.select2.defaults = Defaults;
|
5723 |
+
}
|
5724 |
+
|
5725 |
+
return Select2;
|
5726 |
+
});
|
5727 |
+
|
5728 |
+
// Return the AMD loader configuration so it can be used outside of this file
|
5729 |
+
return {
|
5730 |
+
define: S2.define,
|
5731 |
+
require: S2.require
|
5732 |
+
};
|
5733 |
+
}());
|
5734 |
+
|
5735 |
+
// Autoload the jQuery bindings
|
5736 |
+
// We know that all of the modules exist above this, so we're safe
|
5737 |
+
var select2 = S2.require('jquery.select2');
|
5738 |
+
|
5739 |
+
// Hold the AMD module references on the jQuery function that was just loaded
|
5740 |
+
// This allows Select2 to use the internal loader outside of this file, such
|
5741 |
+
// as in the language files.
|
5742 |
+
jQuery.fn.select2.amd = S2;
|
5743 |
+
|
5744 |
+
// Return the Select2 instance for anyone who is importing it.
|
5745 |
+
return select2;
|
5746 |
+
}));
|
assets/lib/select2/select2.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
|
assets/lib/wp-color-picker-alpha/wp-color-picker-alpha.js
ADDED
@@ -0,0 +1,496 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**!
|
2 |
+
* wp-color-picker-alpha
|
3 |
+
*
|
4 |
+
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
5 |
+
* Only run in input and is defined data alpha in true
|
6 |
+
*
|
7 |
+
* Version: 2.1.3
|
8 |
+
* https://github.com/kallookoo/wp-color-picker-alpha
|
9 |
+
* Licensed under the GPLv2 license.
|
10 |
+
*/
|
11 |
+
( function( $ ) {
|
12 |
+
// Prevent double-init.
|
13 |
+
if ( $.wp.wpColorPicker.prototype._hasAlpha ) {
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
|
17 |
+
// Variable for some backgrounds ( grid )
|
18 |
+
var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==',
|
19 |
+
// html stuff for wpColorPicker copy of the original color-picker.js
|
20 |
+
_after = '<div class="wp-picker-holder" />',
|
21 |
+
_wrap = '<div class="wp-picker-container" />',
|
22 |
+
_button = '<input type="button" class="button button-small" />',
|
23 |
+
// Prevent CSS issues in < WordPress 4.9
|
24 |
+
_deprecated = ( wpColorPickerL10n.current !== undefined );
|
25 |
+
// Declare some global variables when is deprecated or not
|
26 |
+
if ( _deprecated ) {
|
27 |
+
var _before = '<a tabindex="0" class="wp-color-result" />';
|
28 |
+
} else {
|
29 |
+
var _before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',
|
30 |
+
_wrappingLabel = '<label></label>',
|
31 |
+
_wrappingLabelText = '<span class="screen-reader-text"></span>';
|
32 |
+
}
|
33 |
+
/**
|
34 |
+
* Overwrite Color
|
35 |
+
* for enable support rbga
|
36 |
+
*/
|
37 |
+
Color.fn.toString = function() {
|
38 |
+
if ( this._alpha < 1 )
|
39 |
+
return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
|
40 |
+
|
41 |
+
var hex = parseInt( this._color, 10 ).toString( 16 );
|
42 |
+
|
43 |
+
if ( this.error )
|
44 |
+
return '';
|
45 |
+
|
46 |
+
if ( hex.length < 6 )
|
47 |
+
hex = ( '00000' + hex ).substr( -6 );
|
48 |
+
|
49 |
+
return '#' + hex;
|
50 |
+
};
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Overwrite wpColorPicker
|
54 |
+
*/
|
55 |
+
$.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
|
56 |
+
_hasAlpha: true,
|
57 |
+
/**
|
58 |
+
* @summary Creates the color picker.
|
59 |
+
*
|
60 |
+
* Creates the color picker, sets default values, css classes and wraps it all in HTML.
|
61 |
+
*
|
62 |
+
* @since 3.5.0
|
63 |
+
*
|
64 |
+
* @access private
|
65 |
+
*
|
66 |
+
* @returns {void}
|
67 |
+
*/
|
68 |
+
_create: function() {
|
69 |
+
// Return early if Iris support is missing.
|
70 |
+
if ( ! $.support.iris ) {
|
71 |
+
return;
|
72 |
+
}
|
73 |
+
|
74 |
+
var self = this,
|
75 |
+
el = self.element;
|
76 |
+
|
77 |
+
// Override default options with options bound to the element.
|
78 |
+
$.extend( self.options, el.data() );
|
79 |
+
|
80 |
+
// Create a color picker which only allows adjustments to the hue.
|
81 |
+
if ( self.options.type === 'hue' ) {
|
82 |
+
return self._createHueOnly();
|
83 |
+
}
|
84 |
+
|
85 |
+
// Bind the close event.
|
86 |
+
self.close = $.proxy( self.close, self );
|
87 |
+
|
88 |
+
self.initialValue = el.val();
|
89 |
+
|
90 |
+
// Add a CSS class to the input field.
|
91 |
+
el.addClass( 'wp-color-picker' );
|
92 |
+
|
93 |
+
if ( _deprecated ) {
|
94 |
+
el.hide().wrap( _wrap );
|
95 |
+
self.wrap = el.parent();
|
96 |
+
self.toggler = $( _before )
|
97 |
+
.insertBefore( el )
|
98 |
+
.css( { backgroundColor : self.initialValue } )
|
99 |
+
.attr( 'title', wpColorPickerL10n.pick )
|
100 |
+
.attr( 'data-current', wpColorPickerL10n.current );
|
101 |
+
self.pickerContainer = $( _after ).insertAfter( el );
|
102 |
+
self.button = $( _button ).addClass('hidden');
|
103 |
+
} else {
|
104 |
+
/*
|
105 |
+
* Check if there's already a wrapping label, e.g. in the Customizer.
|
106 |
+
* If there's no label, add a default one to match the Customizer template.
|
107 |
+
*/
|
108 |
+
if ( ! el.parent( 'label' ).length ) {
|
109 |
+
// Wrap the input field in the default label.
|
110 |
+
el.wrap( _wrappingLabel );
|
111 |
+
// Insert the default label text.
|
112 |
+
self.wrappingLabelText = $( _wrappingLabelText )
|
113 |
+
.insertBefore( el )
|
114 |
+
.text( wpColorPickerL10n.defaultLabel );
|
115 |
+
}
|
116 |
+
|
117 |
+
/*
|
118 |
+
* At this point, either it's the standalone version or the Customizer
|
119 |
+
* one, we have a wrapping label to use as hook in the DOM, let's store it.
|
120 |
+
*/
|
121 |
+
self.wrappingLabel = el.parent();
|
122 |
+
|
123 |
+
// Wrap the label in the main wrapper.
|
124 |
+
self.wrappingLabel.wrap( _wrap );
|
125 |
+
// Store a reference to the main wrapper.
|
126 |
+
self.wrap = self.wrappingLabel.parent();
|
127 |
+
// Set up the toggle button and insert it before the wrapping label.
|
128 |
+
self.toggler = $( _before )
|
129 |
+
.insertBefore( self.wrappingLabel )
|
130 |
+
.css( { backgroundColor: self.initialValue } );
|
131 |
+
// Set the toggle button span element text.
|
132 |
+
self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick );
|
133 |
+
// Set up the Iris container and insert it after the wrapping label.
|
134 |
+
self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
|
135 |
+
// Store a reference to the Clear/Default button.
|
136 |
+
self.button = $( _button );
|
137 |
+
}
|
138 |
+
|
139 |
+
// Set up the Clear/Default button.
|
140 |
+
if ( self.options.defaultColor ) {
|
141 |
+
self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString );
|
142 |
+
if ( ! _deprecated ) {
|
143 |
+
self.button.attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel );
|
144 |
+
}
|
145 |
+
} else {
|
146 |
+
self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear );
|
147 |
+
if ( ! _deprecated ) {
|
148 |
+
self.button.attr( 'aria-label', wpColorPickerL10n.clearAriaLabel );
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
if ( _deprecated ) {
|
153 |
+
el.wrap( '<span class="wp-picker-input-wrap" />' ).after( self.button );
|
154 |
+
} else {
|
155 |
+
// Wrap the wrapping label in its wrapper and append the Clear/Default button.
|
156 |
+
self.wrappingLabel
|
157 |
+
.wrap( '<span class="wp-picker-input-wrap hidden" />' )
|
158 |
+
.after( self.button );
|
159 |
+
|
160 |
+
/*
|
161 |
+
* The input wrapper now contains the label+input+Clear/Default button.
|
162 |
+
* Store a reference to the input wrapper: we'll use this to toggle
|
163 |
+
* the controls visibility.
|
164 |
+
*/
|
165 |
+
self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
|
166 |
+
}
|
167 |
+
|
168 |
+
el.iris( {
|
169 |
+
target: self.pickerContainer,
|
170 |
+
hide: self.options.hide,
|
171 |
+
width: self.options.width,
|
172 |
+
mode: self.options.mode,
|
173 |
+
palettes: self.options.palettes,
|
174 |
+
/**
|
175 |
+
* @summary Handles the onChange event if one has been defined in the options.
|
176 |
+
*
|
177 |
+
* Handles the onChange event if one has been defined in the options and additionally
|
178 |
+
* sets the background color for the toggler element.
|
179 |
+
*
|
180 |
+
* @since 3.5.0
|
181 |
+
*
|
182 |
+
* @param {Event} event The event that's being called.
|
183 |
+
* @param {HTMLElement} ui The HTMLElement containing the color picker.
|
184 |
+
*
|
185 |
+
* @returns {void}
|
186 |
+
*/
|
187 |
+
change: function( event, ui ) {
|
188 |
+
if ( self.options.alpha ) {
|
189 |
+
self.toggler.css( { 'background-image' : 'url(' + image + ')' } );
|
190 |
+
if ( _deprecated ) {
|
191 |
+
self.toggler.html( '<span class="color-alpha" />' );
|
192 |
+
} else {
|
193 |
+
self.toggler.css( {
|
194 |
+
'position' : 'relative'
|
195 |
+
} );
|
196 |
+
if ( self.toggler.find('span.color-alpha').length == 0 ) {
|
197 |
+
self.toggler.append('<span class="color-alpha" />');
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
self.toggler.find( 'span.color-alpha' ).css( {
|
202 |
+
'width' : '30px',
|
203 |
+
'height' : '24px',
|
204 |
+
'position' : 'absolute',
|
205 |
+
'top' : 0,
|
206 |
+
'left' : 0,
|
207 |
+
'border-top-left-radius' : '2px',
|
208 |
+
'border-bottom-left-radius' : '2px',
|
209 |
+
'background' : ui.color.toString()
|
210 |
+
} );
|
211 |
+
} else {
|
212 |
+
self.toggler.css( { backgroundColor : ui.color.toString() } );
|
213 |
+
}
|
214 |
+
|
215 |
+
if ( $.isFunction( self.options.change ) ) {
|
216 |
+
self.options.change.call( this, event, ui );
|
217 |
+
}
|
218 |
+
}
|
219 |
+
} );
|
220 |
+
|
221 |
+
el.val( self.initialValue );
|
222 |
+
self._addListeners();
|
223 |
+
|
224 |
+
// Force the color picker to always be closed on initial load.
|
225 |
+
if ( ! self.options.hide ) {
|
226 |
+
self.toggler.click();
|
227 |
+
}
|
228 |
+
},
|
229 |
+
/**
|
230 |
+
* @summary Binds event listeners to the color picker.
|
231 |
+
*
|
232 |
+
* @since 3.5.0
|
233 |
+
*
|
234 |
+
* @access private
|
235 |
+
*
|
236 |
+
* @returns {void}
|
237 |
+
*/
|
238 |
+
_addListeners: function() {
|
239 |
+
var self = this;
|
240 |
+
|
241 |
+
/**
|
242 |
+
* @summary Prevent any clicks inside this widget from leaking to the top and closing it.
|
243 |
+
*
|
244 |
+
* @since 3.5.0
|
245 |
+
*
|
246 |
+
* @param {Event} event The event that's being called.
|
247 |
+
*
|
248 |
+
* @returs {void}
|
249 |
+
*/
|
250 |
+
self.wrap.on( 'click.wpcolorpicker', function( event ) {
|
251 |
+
event.stopPropagation();
|
252 |
+
});
|
253 |
+
|
254 |
+
/**
|
255 |
+
* @summary Open or close the color picker depending on the class.
|
256 |
+
*
|
257 |
+
* @since 3.5
|
258 |
+
*/
|
259 |
+
self.toggler.click( function(){
|
260 |
+
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
|
261 |
+
self.close();
|
262 |
+
} else {
|
263 |
+
self.open();
|
264 |
+
}
|
265 |
+
});
|
266 |
+
|
267 |
+
/**
|
268 |
+
* @summary Checks if value is empty when changing the color in the color picker.
|
269 |
+
*
|
270 |
+
* Checks if value is empty when changing the color in the color picker.
|
271 |
+
* If so, the background color is cleared.
|
272 |
+
*
|
273 |
+
* @since 3.5.0
|
274 |
+
*
|
275 |
+
* @param {Event} event The event that's being called.
|
276 |
+
*
|
277 |
+
* @returns {void}
|
278 |
+
*/
|
279 |
+
self.element.on( 'change', function( event ) {
|
280 |
+
// Empty or Error = clear
|
281 |
+
if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) {
|
282 |
+
if ( self.options.alpha ) {
|
283 |
+
if ( _deprecated ) {
|
284 |
+
self.toggler.removeAttr( 'style' );
|
285 |
+
}
|
286 |
+
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
287 |
+
} else {
|
288 |
+
self.toggler.css( 'backgroundColor', '' );
|
289 |
+
}
|
290 |
+
|
291 |
+
// fire clear callback if we have one
|
292 |
+
if ( $.isFunction( self.options.clear ) )
|
293 |
+
self.options.clear.call( this, event );
|
294 |
+
}
|
295 |
+
} );
|
296 |
+
|
297 |
+
/**
|
298 |
+
* @summary Enables the user to clear or revert the color in the color picker.
|
299 |
+
*
|
300 |
+
* Enables the user to either clear the color in the color picker or revert back to the default color.
|
301 |
+
*
|
302 |
+
* @since 3.5.0
|
303 |
+
*
|
304 |
+
* @param {Event} event The event that's being called.
|
305 |
+
*
|
306 |
+
* @returns {void}
|
307 |
+
*/
|
308 |
+
self.button.on( 'click', function( event ) {
|
309 |
+
if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
|
310 |
+
self.element.val( '' );
|
311 |
+
if ( self.options.alpha ) {
|
312 |
+
if ( _deprecated ) {
|
313 |
+
self.toggler.removeAttr( 'style' );
|
314 |
+
}
|
315 |
+
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
316 |
+
} else {
|
317 |
+
self.toggler.css( 'backgroundColor', '' );
|
318 |
+
}
|
319 |
+
|
320 |
+
if ( $.isFunction( self.options.clear ) )
|
321 |
+
self.options.clear.call( this, event );
|
322 |
+
|
323 |
+
} else if ( $( this ).hasClass( 'wp-picker-default' ) ) {
|
324 |
+
self.element.val( self.options.defaultColor ).change();
|
325 |
+
}
|
326 |
+
});
|
327 |
+
},
|
328 |
+
});
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Overwrite iris
|
332 |
+
*/
|
333 |
+
$.widget( 'a8c.iris', $.a8c.iris, {
|
334 |
+
_create: function() {
|
335 |
+
this._super();
|
336 |
+
|
337 |
+
// Global option for check is mode rbga is enabled
|
338 |
+
this.options.alpha = this.element.data( 'alpha' ) || false;
|
339 |
+
|
340 |
+
// Is not input disabled
|
341 |
+
if ( ! this.element.is( ':input' ) )
|
342 |
+
this.options.alpha = false;
|
343 |
+
|
344 |
+
if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) {
|
345 |
+
var self = this,
|
346 |
+
el = self.element,
|
347 |
+
_html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>',
|
348 |
+
aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ),
|
349 |
+
aSlider = aContainer.find( '.iris-slider-offset-alpha' ),
|
350 |
+
controls = {
|
351 |
+
aContainer : aContainer,
|
352 |
+
aSlider : aSlider
|
353 |
+
};
|
354 |
+
|
355 |
+
if ( typeof el.data( 'custom-width' ) !== 'undefined' ) {
|
356 |
+
self.options.customWidth = parseInt( el.data( 'custom-width' ) ) || 0;
|
357 |
+
} else {
|
358 |
+
self.options.customWidth = 100;
|
359 |
+
}
|
360 |
+
|
361 |
+
// Set default width for input reset
|
362 |
+
self.options.defaultWidth = el.width();
|
363 |
+
|
364 |
+
// Update width for input
|
365 |
+
if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != -1 )
|
366 |
+
el.width( parseInt( self.options.defaultWidth + self.options.customWidth ) );
|
367 |
+
|
368 |
+
// Push new controls
|
369 |
+
$.each( controls, function( k, v ) {
|
370 |
+
self.controls[k] = v;
|
371 |
+
} );
|
372 |
+
|
373 |
+
// Change size strip and add margin for sliders
|
374 |
+
self.controls.square.css( { 'margin-right': '0' } );
|
375 |
+
var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ),
|
376 |
+
stripsMargin = ( emptyWidth / 6 ),
|
377 |
+
stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin );
|
378 |
+
|
379 |
+
$.each( [ 'aContainer', 'strip' ], function( k, v ) {
|
380 |
+
self.controls[v].width( stripsWidth ).css( { 'margin-left' : stripsMargin + 'px' } );
|
381 |
+
} );
|
382 |
+
|
383 |
+
// Add new slider
|
384 |
+
self._initControls();
|
385 |
+
|
386 |
+
// For updated widget
|
387 |
+
self._change();
|
388 |
+
}
|
389 |
+
},
|
390 |
+
_initControls: function() {
|
391 |
+
this._super();
|
392 |
+
|
393 |
+
if ( this.options.alpha ) {
|
394 |
+
var self = this,
|
395 |
+
controls = self.controls;
|
396 |
+
|
397 |
+
controls.aSlider.slider({
|
398 |
+
orientation : 'vertical',
|
399 |
+
min : 0,
|
400 |
+
max : 100,
|
401 |
+
step : 1,
|
402 |
+
value : parseInt( self._color._alpha * 100 ),
|
403 |
+
slide : function( event, ui ) {
|
404 |
+
// Update alpha value
|
405 |
+
self._color._alpha = parseFloat( ui.value / 100 );
|
406 |
+
self._change.apply( self, arguments );
|
407 |
+
}
|
408 |
+
});
|
409 |
+
}
|
410 |
+
},
|
411 |
+
_change: function() {
|
412 |
+
this._super();
|
413 |
+
|
414 |
+
var self = this,
|
415 |
+
el = self.element;
|
416 |
+
|
417 |
+
if ( this.options.alpha ) {
|
418 |
+
var controls = self.controls,
|
419 |
+
alpha = parseInt( self._color._alpha * 100 ),
|
420 |
+
color = self._color.toRgb(),
|
421 |
+
gradient = [
|
422 |
+
'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
|
423 |
+
'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
|
424 |
+
],
|
425 |
+
defaultWidth = self.options.defaultWidth,
|
426 |
+
customWidth = self.options.customWidth,
|
427 |
+
target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
|
428 |
+
|
429 |
+
// Generate background slider alpha, only for CSS3 old browser fuck!! :)
|
430 |
+
controls.aContainer.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' } );
|
431 |
+
|
432 |
+
if ( target.hasClass( 'wp-picker-open' ) ) {
|
433 |
+
// Update alpha value
|
434 |
+
controls.aSlider.slider( 'value', alpha );
|
435 |
+
|
436 |
+
/**
|
437 |
+
* Disabled change opacity in default slider Saturation ( only is alpha enabled )
|
438 |
+
* and change input width for view all value
|
439 |
+
*/
|
440 |
+
if ( self._color._alpha < 1 ) {
|
441 |
+
controls.strip.attr( 'style', controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ) );
|
442 |
+
el.width( parseInt( defaultWidth + customWidth ) );
|
443 |
+
} else {
|
444 |
+
el.width( defaultWidth );
|
445 |
+
}
|
446 |
+
}
|
447 |
+
}
|
448 |
+
|
449 |
+
var reset = el.data( 'reset-alpha' ) || false;
|
450 |
+
|
451 |
+
if ( reset ) {
|
452 |
+
self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
|
453 |
+
self._color._alpha = 1;
|
454 |
+
self.active = 'external';
|
455 |
+
self._change();
|
456 |
+
} );
|
457 |
+
}
|
458 |
+
},
|
459 |
+
_addInputListeners: function( input ) {
|
460 |
+
var self = this,
|
461 |
+
debounceTimeout = 100,
|
462 |
+
callback = function( event ) {
|
463 |
+
var color = new Color( input.val() ),
|
464 |
+
val = input.val();
|
465 |
+
|
466 |
+
input.removeClass( 'iris-error' );
|
467 |
+
// we gave a bad color
|
468 |
+
if ( color.error ) {
|
469 |
+
// don't error on an empty input
|
470 |
+
if ( val !== '' )
|
471 |
+
input.addClass( 'iris-error' );
|
472 |
+
} else {
|
473 |
+
if ( color.toString() !== self._color.toString() ) {
|
474 |
+
// let's not do this on keyup for hex shortcodes
|
475 |
+
if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) )
|
476 |
+
self._setOption( 'color', color.toString() );
|
477 |
+
}
|
478 |
+
}
|
479 |
+
};
|
480 |
+
|
481 |
+
input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );
|
482 |
+
|
483 |
+
// If we initialized hidden, show on first focus. The rest is up to you.
|
484 |
+
if ( self.options.hide ) {
|
485 |
+
input.on( 'focus', function() {
|
486 |
+
self.show();
|
487 |
+
} );
|
488 |
+
}
|
489 |
+
}
|
490 |
+
} );
|
491 |
+
}( jQuery ) );
|
492 |
+
|
493 |
+
// Auto Call plugin is class is color-picker
|
494 |
+
jQuery( document ).ready( function( $ ) {
|
495 |
+
$( '.color-picker' ).wpColorPicker();
|
496 |
+
} );
|
assets/lib/wp-color-picker-alpha/wp-color-picker-alpha.min.js
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**!
|
2 |
+
* wp-color-picker-alpha
|
3 |
+
*
|
4 |
+
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
5 |
+
* Only run in input and is defined data alpha in true
|
6 |
+
*
|
7 |
+
* Version: 2.1.3
|
8 |
+
* https://github.com/kallookoo/wp-color-picker-alpha
|
9 |
+
* Licensed under the GPLv2 license.
|
10 |
+
*/
|
11 |
+
!function(a){if(!a.wp.wpColorPicker.prototype._hasAlpha){var b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",c='<div class="wp-picker-holder" />',d='<div class="wp-picker-container" />',e='<input type="button" class="button button-small" />',f=void 0!==wpColorPickerL10n.current;if(f)var g='<a tabindex="0" class="wp-color-result" />';else var g='<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',h="<label></label>",i='<span class="screen-reader-text"></span>';Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var a=parseInt(this._color,10).toString(16);return this.error?"":(a.length<6&&(a=("00000"+a).substr(-6)),"#"+a)},a.widget("wp.wpColorPicker",a.wp.wpColorPicker,{_hasAlpha:!0,_create:function(){if(a.support.iris){var j=this,k=j.element;if(a.extend(j.options,k.data()),"hue"===j.options.type)return j._createHueOnly();j.close=a.proxy(j.close,j),j.initialValue=k.val(),k.addClass("wp-color-picker"),f?(k.hide().wrap(d),j.wrap=k.parent(),j.toggler=a(g).insertBefore(k).css({backgroundColor:j.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),j.pickerContainer=a(c).insertAfter(k),j.button=a(e).addClass("hidden")):(k.parent("label").length||(k.wrap(h),j.wrappingLabelText=a(i).insertBefore(k).text(wpColorPickerL10n.defaultLabel)),j.wrappingLabel=k.parent(),j.wrappingLabel.wrap(d),j.wrap=j.wrappingLabel.parent(),j.toggler=a(g).insertBefore(j.wrappingLabel).css({backgroundColor:j.initialValue}),j.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),j.pickerContainer=a(c).insertAfter(j.wrappingLabel),j.button=a(e)),j.options.defaultColor?(j.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString),f||j.button.attr("aria-label",wpColorPickerL10n.defaultAriaLabel)):(j.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),f||j.button.attr("aria-label",wpColorPickerL10n.clearAriaLabel)),f?k.wrap('<span class="wp-picker-input-wrap" />').after(j.button):(j.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(j.button),j.inputWrapper=k.closest(".wp-picker-input-wrap")),k.iris({target:j.pickerContainer,hide:j.options.hide,width:j.options.width,mode:j.options.mode,palettes:j.options.palettes,change:function(c,d){j.options.alpha?(j.toggler.css({"background-image":"url("+b+")"}),f?j.toggler.html('<span class="color-alpha" />'):(j.toggler.css({position:"relative"}),0==j.toggler.find("span.color-alpha").length&&j.toggler.append('<span class="color-alpha" />')),j.toggler.find("span.color-alpha").css({width:"30px",height:"24px",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:d.color.toString()})):j.toggler.css({backgroundColor:d.color.toString()}),a.isFunction(j.options.change)&&j.options.change.call(this,c,d)}}),k.val(j.initialValue),j._addListeners(),j.options.hide||j.toggler.click()}},_addListeners:function(){var b=this;b.wrap.on("click.wpcolorpicker",function(a){a.stopPropagation()}),b.toggler.click(function(){b.toggler.hasClass("wp-picker-open")?b.close():b.open()}),b.element.on("change",function(c){(""===a(this).val()||b.element.hasClass("iris-error"))&&(b.options.alpha?(f&&b.toggler.removeAttr("style"),b.toggler.find("span.color-alpha").css("backgroundColor","")):b.toggler.css("backgroundColor",""),a.isFunction(b.options.clear)&&b.options.clear.call(this,c))}),b.button.on("click",function(c){a(this).hasClass("wp-picker-clear")?(b.element.val(""),b.options.alpha?(f&&b.toggler.removeAttr("style"),b.toggler.find("span.color-alpha").css("backgroundColor","")):b.toggler.css("backgroundColor",""),a.isFunction(b.options.clear)&&b.options.clear.call(this,c)):a(this).hasClass("wp-picker-default")&&b.element.val(b.options.defaultColor).change()})}}),a.widget("a8c.iris",a.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),"undefined"!=typeof this.options.alpha&&this.options.alpha){var b=this,c=b.element,d='<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>',e=a(d).appendTo(b.picker.find(".iris-picker-inner")),f=e.find(".iris-slider-offset-alpha"),g={aContainer:e,aSlider:f};"undefined"!=typeof c.data("custom-width")?b.options.customWidth=parseInt(c.data("custom-width"))||0:b.options.customWidth=100,b.options.defaultWidth=c.width(),(b._color._alpha<1||-1!=b._color.toString().indexOf("rgb"))&&c.width(parseInt(b.options.defaultWidth+b.options.customWidth)),a.each(g,function(a,c){b.controls[a]=c}),b.controls.square.css({"margin-right":"0"});var h=b.picker.width()-b.controls.square.width()-20,i=h/6,j=h/2-i;a.each(["aContainer","strip"],function(a,c){b.controls[c].width(j).css({"margin-left":i+"px"})}),b._initControls(),b._change()}},_initControls:function(){if(this._super(),this.options.alpha){var a=this,b=a.controls;b.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*a._color._alpha),slide:function(b,c){a._color._alpha=parseFloat(c.value/100),a._change.apply(a,arguments)}})}},_change:function(){this._super();var a=this,c=a.element;if(this.options.alpha){var d=a.controls,e=parseInt(100*a._color._alpha),f=a._color.toRgb(),g=["rgb("+f.r+","+f.g+","+f.b+") 0%","rgba("+f.r+","+f.g+","+f.b+", 0) 100%"],h=a.options.defaultWidth,i=a.options.customWidth,j=a.picker.closest(".wp-picker-container").find(".wp-color-result");d.aContainer.css({background:"linear-gradient(to bottom, "+g.join(", ")+"), url("+b+")"}),j.hasClass("wp-picker-open")&&(d.aSlider.slider("value",e),a._color._alpha<1?(d.strip.attr("style",d.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),c.width(parseInt(h+i))):c.width(h))}var k=c.data("reset-alpha")||!1;k&&a.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){a._color._alpha=1,a.active="external",a._change()})},_addInputListeners:function(a){var b=this,c=100,d=function(c){var d=new Color(a.val()),e=a.val();a.removeClass("iris-error"),d.error?""!==e&&a.addClass("iris-error"):d.toString()!==b._color.toString()&&("keyup"===c.type&&e.match(/^[0-9a-fA-F]{3}$/)||b._setOption("color",d.toString()))};a.on("change",d).on("keyup",b._debounce(d,c)),b.options.hide&&a.on("focus",function(){b.show()})}})}}(jQuery),jQuery(document).ready(function(a){a(".color-picker").wpColorPicker()});
|
assets/scss/admin.scss
CHANGED
@@ -9,3 +9,4 @@
|
|
9 |
@import 'admin/modal';
|
10 |
@import 'admin/tooltip';
|
11 |
@import 'admin/tab';
|
|
9 |
@import 'admin/modal';
|
10 |
@import 'admin/tooltip';
|
11 |
@import 'admin/tab';
|
12 |
+
@import 'admin/documentation';
|
assets/scss/admin/_documentation.scss
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.carousel_slider_iframe {
|
2 |
+
position: relative;
|
3 |
+
padding-bottom: 56.25%;
|
4 |
+
padding-top: 25px;
|
5 |
+
height: 0;
|
6 |
+
}
|
7 |
+
|
8 |
+
.carousel_slider_iframe > iframe {
|
9 |
+
position: absolute;
|
10 |
+
top: 0;
|
11 |
+
left: 0;
|
12 |
+
width: 100%;
|
13 |
+
height: 100%;
|
14 |
+
}
|
15 |
+
|
16 |
+
.carousel_slider_columns {
|
17 |
+
display: flex;
|
18 |
+
flex-wrap: wrap;
|
19 |
+
box-sizing: border-box;
|
20 |
+
}
|
21 |
+
|
22 |
+
.carousel_slider_column {
|
23 |
+
flex: 0 0 100%;
|
24 |
+
padding: 1rem;
|
25 |
+
box-sizing: border-box;
|
26 |
+
}
|
27 |
+
|
28 |
+
@media screen and (min-width: 601px) {
|
29 |
+
.carousel_slider_column {
|
30 |
+
flex: 0 0 50%;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
@media screen and (min-width: 1025px) {
|
35 |
+
.carousel_slider_column {
|
36 |
+
flex: 0 0 33.333333%;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
@media screen and (min-width: 1400px) {
|
41 |
+
.carousel_slider_column {
|
42 |
+
flex: 0 0 25%;
|
43 |
+
}
|
44 |
+
}
|
assets/scss/admin/_select2.scss
CHANGED
@@ -1,202 +1,266 @@
|
|
1 |
.select2-container {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
8 |
box-sizing: border-box;
|
9 |
cursor: pointer;
|
10 |
display: block;
|
11 |
height: 28px;
|
12 |
user-select: none;
|
13 |
-
-webkit-user-select: none;
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
padding-right: 8px;
|
25 |
-
padding-left: 20px;
|
26 |
-
|
|
|
|
|
27 |
box-sizing: border-box;
|
28 |
cursor: pointer;
|
29 |
display: block;
|
30 |
min-height: 32px;
|
31 |
user-select: none;
|
32 |
-
-webkit-user-select: none;
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
.select2-dropdown {
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
60 |
|
61 |
.select2-results {
|
62 |
-
|
|
|
63 |
|
64 |
.select2-results__options {
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
68 |
|
69 |
.select2-results__option {
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
75 |
|
76 |
.select2-container--open .select2-dropdown {
|
77 |
-
|
|
|
78 |
|
79 |
.select2-container--open .select2-dropdown--above {
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
83 |
|
84 |
.select2-container--open .select2-dropdown--below {
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
88 |
|
89 |
.select2-search--dropdown {
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
93 |
padding: 4px;
|
94 |
width: 100%;
|
95 |
-
box-sizing: border-box;
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
.select2-close-mask {
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
117 |
|
118 |
.select2-hidden-accessible {
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
|
|
127 |
|
128 |
.select2-container--default .select2-selection--single {
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
133 |
color: #444;
|
134 |
-
line-height: 28px;
|
135 |
-
|
|
|
|
|
136 |
cursor: pointer;
|
137 |
float: right;
|
138 |
-
font-weight: bold;
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
142 |
height: 26px;
|
143 |
position: absolute;
|
144 |
top: 1px;
|
145 |
right: 1px;
|
146 |
-
width: 20px;
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
158 |
|
159 |
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
160 |
-
|
|
|
161 |
|
162 |
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
163 |
-
|
164 |
-
|
|
|
165 |
|
166 |
.select2-container--default.select2-container--disabled .select2-selection--single {
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
171 |
|
172 |
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
173 |
-
|
174 |
-
|
|
|
175 |
|
176 |
.select2-container--default .select2-selection--multiple {
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
182 |
box-sizing: border-box;
|
183 |
list-style: none;
|
184 |
margin: 0;
|
185 |
padding: 0 5px;
|
186 |
-
width: 100%;
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
190 |
color: #999;
|
191 |
margin-top: 5px;
|
192 |
-
float: left;
|
193 |
-
|
|
|
|
|
194 |
cursor: pointer;
|
195 |
float: right;
|
196 |
font-weight: bold;
|
197 |
margin-top: 5px;
|
198 |
-
margin-right: 10px;
|
199 |
-
|
|
|
|
|
200 |
background-color: #e4e4e4;
|
201 |
border: 1px solid #aaa;
|
202 |
border-radius: 0;
|
@@ -204,121 +268,165 @@
|
|
204 |
float: left;
|
205 |
margin-right: 5px;
|
206 |
margin-top: 5px;
|
207 |
-
padding: 0 5px;
|
208 |
-
|
|
|
|
|
209 |
color: #999;
|
210 |
cursor: pointer;
|
211 |
display: inline-block;
|
212 |
font-weight: bold;
|
213 |
-
margin-right: 2px;
|
214 |
-
|
215 |
-
|
|
|
|
|
|
|
216 |
|
217 |
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
|
218 |
-
|
|
|
219 |
|
220 |
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
221 |
-
|
222 |
-
|
|
|
223 |
|
224 |
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
225 |
-
|
226 |
-
|
|
|
227 |
|
228 |
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
229 |
-
|
230 |
-
|
|
|
231 |
|
232 |
.select2-container--default.select2-container--disabled .select2-selection--multiple {
|
233 |
-
|
234 |
-
|
|
|
235 |
|
236 |
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
|
237 |
-
|
|
|
238 |
|
239 |
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
|
240 |
-
|
241 |
-
|
|
|
242 |
|
243 |
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
|
244 |
-
|
245 |
-
|
|
|
246 |
|
247 |
.select2-container--default .select2-search--dropdown .select2-search__field {
|
248 |
-
|
|
|
249 |
|
250 |
.select2-container--default .select2-search--inline .select2-search__field {
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
|
|
256 |
|
257 |
.select2-container--default .select2-results > .select2-results__options {
|
258 |
-
|
259 |
-
|
|
|
260 |
|
261 |
.select2-container--default .select2-results__option[role=group] {
|
262 |
-
|
|
|
263 |
|
264 |
.select2-container--default .select2-results__option[aria-disabled=true] {
|
265 |
-
|
|
|
266 |
|
267 |
.select2-container--default .select2-results__option[aria-selected=true] {
|
268 |
-
|
|
|
269 |
|
270 |
.select2-container--default .select2-results__option .select2-results__option {
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
|
|
|
|
|
|
|
|
275 |
margin-left: -1em;
|
276 |
-
padding-left: 2em;
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
|
290 |
.select2-container--default .select2-results__option--highlighted[aria-selected] {
|
291 |
-
|
292 |
-
|
|
|
293 |
|
294 |
.select2-container--default .select2-results__group {
|
295 |
-
|
296 |
-
|
297 |
-
|
|
|
298 |
|
299 |
.select2-container--classic .select2-selection--single {
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
|
|
|
|
|
|
312 |
color: #444;
|
313 |
-
line-height: 28px;
|
314 |
-
|
|
|
|
|
315 |
cursor: pointer;
|
316 |
float: right;
|
317 |
font-weight: bold;
|
318 |
-
margin-right: 10px;
|
319 |
-
|
320 |
-
|
321 |
-
|
|
|
|
|
|
|
|
|
322 |
background-color: #ddd;
|
323 |
border: none;
|
324 |
border-left: 1px solid #aaa;
|
@@ -333,75 +441,95 @@
|
|
333 |
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
334 |
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
|
335 |
background-repeat: repeat-x;
|
336 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0);
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
|
|
|
|
|
|
348 |
|
349 |
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
350 |
-
|
|
|
351 |
|
352 |
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
|
|
360 |
|
361 |
.select2-container--classic.select2-container--open .select2-selection--single {
|
362 |
-
|
363 |
-
|
|
|
|
|
364 |
background: transparent;
|
365 |
-
border: none;
|
366 |
-
|
367 |
-
|
368 |
-
|
|
|
|
|
|
|
369 |
|
370 |
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
|
|
379 |
|
380 |
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
|
|
389 |
|
390 |
.select2-container--classic .select2-selection--multiple {
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
|
|
|
|
|
|
|
|
399 |
list-style: none;
|
400 |
margin: 0;
|
401 |
-
padding: 0 5px;
|
402 |
-
|
403 |
-
|
404 |
-
|
|
|
|
|
|
|
|
|
405 |
background-color: #e4e4e4;
|
406 |
border: 1px solid #aaa;
|
407 |
border-radius: 0;
|
@@ -409,76 +537,98 @@
|
|
409 |
float: left;
|
410 |
margin-right: 5px;
|
411 |
margin-top: 5px;
|
412 |
-
padding: 0 5px;
|
413 |
-
|
|
|
|
|
414 |
color: #888;
|
415 |
cursor: pointer;
|
416 |
display: inline-block;
|
417 |
font-weight: bold;
|
418 |
-
margin-right: 2px;
|
419 |
-
|
420 |
-
|
|
|
|
|
|
|
421 |
|
422 |
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
423 |
-
|
|
|
424 |
|
425 |
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
426 |
-
|
427 |
-
|
|
|
428 |
|
429 |
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
430 |
-
|
431 |
-
|
|
|
432 |
|
433 |
.select2-container--classic.select2-container--open .select2-selection--multiple {
|
434 |
-
|
|
|
435 |
|
436 |
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
|
437 |
-
|
438 |
-
|
439 |
-
|
|
|
440 |
|
441 |
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
|
442 |
-
|
443 |
-
|
444 |
-
|
|
|
445 |
|
446 |
.select2-container--classic .select2-search--dropdown .select2-search__field {
|
447 |
-
|
448 |
-
|
|
|
449 |
|
450 |
.select2-container--classic .select2-search--inline .select2-search__field {
|
451 |
-
|
452 |
-
|
|
|
453 |
|
454 |
.select2-container--classic .select2-dropdown {
|
455 |
-
|
456 |
-
|
|
|
457 |
|
458 |
.select2-container--classic .select2-dropdown--above {
|
459 |
-
|
|
|
460 |
|
461 |
.select2-container--classic .select2-dropdown--below {
|
462 |
-
|
|
|
463 |
|
464 |
.select2-container--classic .select2-results > .select2-results__options {
|
465 |
-
|
466 |
-
|
|
|
467 |
|
468 |
.select2-container--classic .select2-results__option[role=group] {
|
469 |
-
|
|
|
470 |
|
471 |
.select2-container--classic .select2-results__option[aria-disabled=true] {
|
472 |
-
|
|
|
473 |
|
474 |
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
|
475 |
-
|
476 |
-
|
|
|
477 |
|
478 |
.select2-container--classic .select2-results__group {
|
479 |
-
|
480 |
-
|
481 |
-
|
|
|
482 |
|
483 |
.select2-container--classic.select2-container--open .select2-dropdown {
|
484 |
-
|
|
1 |
.select2-container {
|
2 |
+
box-sizing: border-box;
|
3 |
+
display: inline-block;
|
4 |
+
margin: 0;
|
5 |
+
position: relative;
|
6 |
+
vertical-align: middle;
|
7 |
+
}
|
8 |
+
|
9 |
+
.select2-container .select2-selection--single {
|
10 |
box-sizing: border-box;
|
11 |
cursor: pointer;
|
12 |
display: block;
|
13 |
height: 28px;
|
14 |
user-select: none;
|
15 |
+
-webkit-user-select: none;
|
16 |
+
}
|
17 |
+
|
18 |
+
.select2-container .select2-selection--single .select2-selection__rendered {
|
19 |
+
display: block;
|
20 |
+
padding-left: 8px;
|
21 |
+
padding-right: 20px;
|
22 |
+
overflow: hidden;
|
23 |
+
text-overflow: ellipsis;
|
24 |
+
white-space: nowrap;
|
25 |
+
}
|
26 |
+
|
27 |
+
.select2-container .select2-selection--single .select2-selection__clear {
|
28 |
+
position: relative;
|
29 |
+
}
|
30 |
+
|
31 |
+
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
|
32 |
padding-right: 8px;
|
33 |
+
padding-left: 20px;
|
34 |
+
}
|
35 |
+
|
36 |
+
.select2-container .select2-selection--multiple {
|
37 |
box-sizing: border-box;
|
38 |
cursor: pointer;
|
39 |
display: block;
|
40 |
min-height: 32px;
|
41 |
user-select: none;
|
42 |
+
-webkit-user-select: none;
|
43 |
+
}
|
44 |
+
|
45 |
+
.select2-container .select2-selection--multiple .select2-selection__rendered {
|
46 |
+
display: inline-block;
|
47 |
+
overflow: hidden;
|
48 |
+
padding-left: 8px;
|
49 |
+
text-overflow: ellipsis;
|
50 |
+
white-space: nowrap;
|
51 |
+
}
|
52 |
+
|
53 |
+
.select2-container .select2-search--inline {
|
54 |
+
float: left;
|
55 |
+
}
|
56 |
+
|
57 |
+
.select2-container .select2-search--inline .select2-search__field {
|
58 |
+
box-sizing: border-box;
|
59 |
+
border: none;
|
60 |
+
font-size: 100%;
|
61 |
+
margin-top: 5px;
|
62 |
+
padding: 0;
|
63 |
+
}
|
64 |
+
|
65 |
+
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
|
66 |
+
-webkit-appearance: none;
|
67 |
+
}
|
68 |
|
69 |
.select2-dropdown {
|
70 |
+
background-color: white;
|
71 |
+
border: 1px solid #aaa;
|
72 |
+
border-radius: 0;
|
73 |
+
box-sizing: border-box;
|
74 |
+
display: block;
|
75 |
+
position: absolute;
|
76 |
+
left: -100000px;
|
77 |
+
width: 100%;
|
78 |
+
z-index: 1051;
|
79 |
+
}
|
80 |
|
81 |
.select2-results {
|
82 |
+
display: block;
|
83 |
+
}
|
84 |
|
85 |
.select2-results__options {
|
86 |
+
list-style: none;
|
87 |
+
margin: 0;
|
88 |
+
padding: 0;
|
89 |
+
}
|
90 |
|
91 |
.select2-results__option {
|
92 |
+
padding: 6px;
|
93 |
+
user-select: none;
|
94 |
+
-webkit-user-select: none;
|
95 |
+
}
|
96 |
+
|
97 |
+
.select2-results__option[aria-selected] {
|
98 |
+
cursor: pointer;
|
99 |
+
}
|
100 |
|
101 |
.select2-container--open .select2-dropdown {
|
102 |
+
left: 0;
|
103 |
+
}
|
104 |
|
105 |
.select2-container--open .select2-dropdown--above {
|
106 |
+
border-bottom: none;
|
107 |
+
border-bottom-left-radius: 0;
|
108 |
+
border-bottom-right-radius: 0;
|
109 |
+
}
|
110 |
|
111 |
.select2-container--open .select2-dropdown--below {
|
112 |
+
border-top: none;
|
113 |
+
border-top-left-radius: 0;
|
114 |
+
border-top-right-radius: 0;
|
115 |
+
}
|
116 |
|
117 |
.select2-search--dropdown {
|
118 |
+
display: block;
|
119 |
+
padding: 4px;
|
120 |
+
}
|
121 |
+
|
122 |
+
.select2-search--dropdown .select2-search__field {
|
123 |
padding: 4px;
|
124 |
width: 100%;
|
125 |
+
box-sizing: border-box;
|
126 |
+
}
|
127 |
+
|
128 |
+
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
|
129 |
+
-webkit-appearance: none;
|
130 |
+
}
|
131 |
+
|
132 |
+
.select2-search--dropdown.select2-search--hide {
|
133 |
+
display: none;
|
134 |
+
}
|
135 |
|
136 |
.select2-close-mask {
|
137 |
+
border: 0;
|
138 |
+
margin: 0;
|
139 |
+
padding: 0;
|
140 |
+
display: block;
|
141 |
+
position: fixed;
|
142 |
+
left: 0;
|
143 |
+
top: 0;
|
144 |
+
min-height: 100%;
|
145 |
+
min-width: 100%;
|
146 |
+
height: auto;
|
147 |
+
width: auto;
|
148 |
+
opacity: 0;
|
149 |
+
z-index: 99;
|
150 |
+
background-color: #fff;
|
151 |
+
filter: alpha(opacity=0);
|
152 |
+
}
|
153 |
|
154 |
.select2-hidden-accessible {
|
155 |
+
border: 0 !important;
|
156 |
+
clip: rect(0 0 0 0) !important;
|
157 |
+
height: 1px !important;
|
158 |
+
margin: -1px !important;
|
159 |
+
overflow: hidden !important;
|
160 |
+
padding: 0 !important;
|
161 |
+
position: absolute !important;
|
162 |
+
width: 1px !important;
|
163 |
+
}
|
164 |
|
165 |
.select2-container--default .select2-selection--single {
|
166 |
+
background-color: #fff;
|
167 |
+
border: 1px solid #aaa;
|
168 |
+
border-radius: 0;
|
169 |
+
}
|
170 |
+
|
171 |
+
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
172 |
color: #444;
|
173 |
+
line-height: 28px;
|
174 |
+
}
|
175 |
+
|
176 |
+
.select2-container--default .select2-selection--single .select2-selection__clear {
|
177 |
cursor: pointer;
|
178 |
float: right;
|
179 |
+
font-weight: bold;
|
180 |
+
}
|
181 |
+
|
182 |
+
.select2-container--default .select2-selection--single .select2-selection__placeholder {
|
183 |
+
color: #999;
|
184 |
+
}
|
185 |
+
|
186 |
+
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
187 |
height: 26px;
|
188 |
position: absolute;
|
189 |
top: 1px;
|
190 |
right: 1px;
|
191 |
+
width: 20px;
|
192 |
+
}
|
193 |
+
|
194 |
+
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
195 |
+
border-color: #888 transparent transparent transparent;
|
196 |
+
border-style: solid;
|
197 |
+
border-width: 5px 4px 0 4px;
|
198 |
+
height: 0;
|
199 |
+
left: 50%;
|
200 |
+
margin-left: -4px;
|
201 |
+
margin-top: -2px;
|
202 |
+
position: absolute;
|
203 |
+
top: 50%;
|
204 |
+
width: 0;
|
205 |
+
}
|
206 |
|
207 |
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
208 |
+
float: left;
|
209 |
+
}
|
210 |
|
211 |
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
212 |
+
left: 1px;
|
213 |
+
right: auto;
|
214 |
+
}
|
215 |
|
216 |
.select2-container--default.select2-container--disabled .select2-selection--single {
|
217 |
+
background-color: #eee;
|
218 |
+
cursor: default;
|
219 |
+
}
|
220 |
+
|
221 |
+
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
|
222 |
+
display: none;
|
223 |
+
}
|
224 |
|
225 |
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
226 |
+
border-color: transparent transparent #888 transparent;
|
227 |
+
border-width: 0 4px 5px 4px;
|
228 |
+
}
|
229 |
|
230 |
.select2-container--default .select2-selection--multiple {
|
231 |
+
background-color: white;
|
232 |
+
border: 1px solid #aaa;
|
233 |
+
border-radius: 0;
|
234 |
+
cursor: text;
|
235 |
+
}
|
236 |
+
|
237 |
+
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
238 |
box-sizing: border-box;
|
239 |
list-style: none;
|
240 |
margin: 0;
|
241 |
padding: 0 5px;
|
242 |
+
width: 100%;
|
243 |
+
}
|
244 |
+
|
245 |
+
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
246 |
+
list-style: none;
|
247 |
+
}
|
248 |
+
|
249 |
+
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
|
250 |
color: #999;
|
251 |
margin-top: 5px;
|
252 |
+
float: left;
|
253 |
+
}
|
254 |
+
|
255 |
+
.select2-container--default .select2-selection--multiple .select2-selection__clear {
|
256 |
cursor: pointer;
|
257 |
float: right;
|
258 |
font-weight: bold;
|
259 |
margin-top: 5px;
|
260 |
+
margin-right: 10px;
|
261 |
+
}
|
262 |
+
|
263 |
+
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
264 |
background-color: #e4e4e4;
|
265 |
border: 1px solid #aaa;
|
266 |
border-radius: 0;
|
268 |
float: left;
|
269 |
margin-right: 5px;
|
270 |
margin-top: 5px;
|
271 |
+
padding: 0 5px;
|
272 |
+
}
|
273 |
+
|
274 |
+
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
|
275 |
color: #999;
|
276 |
cursor: pointer;
|
277 |
display: inline-block;
|
278 |
font-weight: bold;
|
279 |
+
margin-right: 2px;
|
280 |
+
}
|
281 |
+
|
282 |
+
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
|
283 |
+
color: #333;
|
284 |
+
}
|
285 |
|
286 |
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
|
287 |
+
float: right;
|
288 |
+
}
|
289 |
|
290 |
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
291 |
+
margin-left: 5px;
|
292 |
+
margin-right: auto;
|
293 |
+
}
|
294 |
|
295 |
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
296 |
+
margin-left: 2px;
|
297 |
+
margin-right: auto;
|
298 |
+
}
|
299 |
|
300 |
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
301 |
+
border: solid black 1px;
|
302 |
+
outline: 0;
|
303 |
+
}
|
304 |
|
305 |
.select2-container--default.select2-container--disabled .select2-selection--multiple {
|
306 |
+
background-color: #eee;
|
307 |
+
cursor: default;
|
308 |
+
}
|
309 |
|
310 |
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
|
311 |
+
display: none;
|
312 |
+
}
|
313 |
|
314 |
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
|
315 |
+
border-top-left-radius: 0;
|
316 |
+
border-top-right-radius: 0;
|
317 |
+
}
|
318 |
|
319 |
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
|
320 |
+
border-bottom-left-radius: 0;
|
321 |
+
border-bottom-right-radius: 0;
|
322 |
+
}
|
323 |
|
324 |
.select2-container--default .select2-search--dropdown .select2-search__field {
|
325 |
+
border: 1px solid #aaa;
|
326 |
+
}
|
327 |
|
328 |
.select2-container--default .select2-search--inline .select2-search__field {
|
329 |
+
background: transparent;
|
330 |
+
border: none;
|
331 |
+
outline: 0;
|
332 |
+
box-shadow: none;
|
333 |
+
-webkit-appearance: textfield;
|
334 |
+
}
|
335 |
|
336 |
.select2-container--default .select2-results > .select2-results__options {
|
337 |
+
max-height: 200px;
|
338 |
+
overflow-y: auto;
|
339 |
+
}
|
340 |
|
341 |
.select2-container--default .select2-results__option[role=group] {
|
342 |
+
padding: 0;
|
343 |
+
}
|
344 |
|
345 |
.select2-container--default .select2-results__option[aria-disabled=true] {
|
346 |
+
color: #999;
|
347 |
+
}
|
348 |
|
349 |
.select2-container--default .select2-results__option[aria-selected=true] {
|
350 |
+
background-color: #ddd;
|
351 |
+
}
|
352 |
|
353 |
.select2-container--default .select2-results__option .select2-results__option {
|
354 |
+
padding-left: 1em;
|
355 |
+
}
|
356 |
+
|
357 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
|
358 |
+
padding-left: 0;
|
359 |
+
}
|
360 |
+
|
361 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
|
362 |
margin-left: -1em;
|
363 |
+
padding-left: 2em;
|
364 |
+
}
|
365 |
+
|
366 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
367 |
+
margin-left: -2em;
|
368 |
+
padding-left: 3em;
|
369 |
+
}
|
370 |
+
|
371 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
372 |
+
margin-left: -3em;
|
373 |
+
padding-left: 4em;
|
374 |
+
}
|
375 |
+
|
376 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
377 |
+
margin-left: -4em;
|
378 |
+
padding-left: 5em;
|
379 |
+
}
|
380 |
+
|
381 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
382 |
+
margin-left: -5em;
|
383 |
+
padding-left: 6em;
|
384 |
+
}
|
385 |
|
386 |
.select2-container--default .select2-results__option--highlighted[aria-selected] {
|
387 |
+
background-color: #5897fb;
|
388 |
+
color: white;
|
389 |
+
}
|
390 |
|
391 |
.select2-container--default .select2-results__group {
|
392 |
+
cursor: default;
|
393 |
+
display: block;
|
394 |
+
padding: 6px;
|
395 |
+
}
|
396 |
|
397 |
.select2-container--classic .select2-selection--single {
|
398 |
+
background-color: #f7f7f7;
|
399 |
+
border: 1px solid #aaa;
|
400 |
+
border-radius: 0;
|
401 |
+
outline: 0;
|
402 |
+
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
|
403 |
+
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
|
404 |
+
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
|
405 |
+
background-repeat: repeat-x;
|
406 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0);
|
407 |
+
}
|
408 |
+
|
409 |
+
.select2-container--classic .select2-selection--single:focus {
|
410 |
+
border: 1px solid #5897fb;
|
411 |
+
}
|
412 |
+
|
413 |
+
.select2-container--classic .select2-selection--single .select2-selection__rendered {
|
414 |
color: #444;
|
415 |
+
line-height: 28px;
|
416 |
+
}
|
417 |
+
|
418 |
+
.select2-container--classic .select2-selection--single .select2-selection__clear {
|
419 |
cursor: pointer;
|
420 |
float: right;
|
421 |
font-weight: bold;
|
422 |
+
margin-right: 10px;
|
423 |
+
}
|
424 |
+
|
425 |
+
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
|
426 |
+
color: #999;
|
427 |
+
}
|
428 |
+
|
429 |
+
.select2-container--classic .select2-selection--single .select2-selection__arrow {
|
430 |
background-color: #ddd;
|
431 |
border: none;
|
432 |
border-left: 1px solid #aaa;
|
441 |
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
442 |
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
|
443 |
background-repeat: repeat-x;
|
444 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0);
|
445 |
+
}
|
446 |
+
|
447 |
+
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
|
448 |
+
border-color: #888 transparent transparent transparent;
|
449 |
+
border-style: solid;
|
450 |
+
border-width: 5px 4px 0 4px;
|
451 |
+
height: 0;
|
452 |
+
left: 50%;
|
453 |
+
margin-left: -4px;
|
454 |
+
margin-top: -2px;
|
455 |
+
position: absolute;
|
456 |
+
top: 50%;
|
457 |
+
width: 0;
|
458 |
+
}
|
459 |
|
460 |
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
461 |
+
float: left;
|
462 |
+
}
|
463 |
|
464 |
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
465 |
+
border: none;
|
466 |
+
border-right: 1px solid #aaa;
|
467 |
+
border-radius: 0;
|
468 |
+
border-top-left-radius: 4px;
|
469 |
+
border-bottom-left-radius: 4px;
|
470 |
+
left: 1px;
|
471 |
+
right: auto;
|
472 |
+
}
|
473 |
|
474 |
.select2-container--classic.select2-container--open .select2-selection--single {
|
475 |
+
border: 1px solid #5897fb;
|
476 |
+
}
|
477 |
+
|
478 |
+
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
|
479 |
background: transparent;
|
480 |
+
border: none;
|
481 |
+
}
|
482 |
+
|
483 |
+
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
484 |
+
border-color: transparent transparent #888 transparent;
|
485 |
+
border-width: 0 4px 5px 4px;
|
486 |
+
}
|
487 |
|
488 |
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
|
489 |
+
border-top: none;
|
490 |
+
border-top-left-radius: 0;
|
491 |
+
border-top-right-radius: 0;
|
492 |
+
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
|
493 |
+
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
|
494 |
+
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
|
495 |
+
background-repeat: repeat-x;
|
496 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0);
|
497 |
+
}
|
498 |
|
499 |
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
|
500 |
+
border-bottom: none;
|
501 |
+
border-bottom-left-radius: 0;
|
502 |
+
border-bottom-right-radius: 0;
|
503 |
+
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
|
504 |
+
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
|
505 |
+
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
|
506 |
+
background-repeat: repeat-x;
|
507 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0);
|
508 |
+
}
|
509 |
|
510 |
.select2-container--classic .select2-selection--multiple {
|
511 |
+
background-color: white;
|
512 |
+
border: 1px solid #aaa;
|
513 |
+
border-radius: 0;
|
514 |
+
cursor: text;
|
515 |
+
outline: 0;
|
516 |
+
}
|
517 |
+
|
518 |
+
.select2-container--classic .select2-selection--multiple:focus {
|
519 |
+
border: 1px solid #5897fb;
|
520 |
+
}
|
521 |
+
|
522 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
|
523 |
list-style: none;
|
524 |
margin: 0;
|
525 |
+
padding: 0 5px;
|
526 |
+
}
|
527 |
+
|
528 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
|
529 |
+
display: none;
|
530 |
+
}
|
531 |
+
|
532 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
|
533 |
background-color: #e4e4e4;
|
534 |
border: 1px solid #aaa;
|
535 |
border-radius: 0;
|
537 |
float: left;
|
538 |
margin-right: 5px;
|
539 |
margin-top: 5px;
|
540 |
+
padding: 0 5px;
|
541 |
+
}
|
542 |
+
|
543 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
|
544 |
color: #888;
|
545 |
cursor: pointer;
|
546 |
display: inline-block;
|
547 |
font-weight: bold;
|
548 |
+
margin-right: 2px;
|
549 |
+
}
|
550 |
+
|
551 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
|
552 |
+
color: #555;
|
553 |
+
}
|
554 |
|
555 |
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
556 |
+
float: right;
|
557 |
+
}
|
558 |
|
559 |
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
560 |
+
margin-left: 5px;
|
561 |
+
margin-right: auto;
|
562 |
+
}
|
563 |
|
564 |
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
565 |
+
margin-left: 2px;
|
566 |
+
margin-right: auto;
|
567 |
+
}
|
568 |
|
569 |
.select2-container--classic.select2-container--open .select2-selection--multiple {
|
570 |
+
border: 1px solid #5897fb;
|
571 |
+
}
|
572 |
|
573 |
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
|
574 |
+
border-top: none;
|
575 |
+
border-top-left-radius: 0;
|
576 |
+
border-top-right-radius: 0;
|
577 |
+
}
|
578 |
|
579 |
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
|
580 |
+
border-bottom: none;
|
581 |
+
border-bottom-left-radius: 0;
|
582 |
+
border-bottom-right-radius: 0;
|
583 |
+
}
|
584 |
|
585 |
.select2-container--classic .select2-search--dropdown .select2-search__field {
|
586 |
+
border: 1px solid #aaa;
|
587 |
+
outline: 0;
|
588 |
+
}
|
589 |
|
590 |
.select2-container--classic .select2-search--inline .select2-search__field {
|
591 |
+
outline: 0;
|
592 |
+
box-shadow: none;
|
593 |
+
}
|
594 |
|
595 |
.select2-container--classic .select2-dropdown {
|
596 |
+
background-color: white;
|
597 |
+
border: 1px solid transparent;
|
598 |
+
}
|
599 |
|
600 |
.select2-container--classic .select2-dropdown--above {
|
601 |
+
border-bottom: none;
|
602 |
+
}
|
603 |
|
604 |
.select2-container--classic .select2-dropdown--below {
|
605 |
+
border-top: none;
|
606 |
+
}
|
607 |
|
608 |
.select2-container--classic .select2-results > .select2-results__options {
|
609 |
+
max-height: 200px;
|
610 |
+
overflow-y: auto;
|
611 |
+
}
|
612 |
|
613 |
.select2-container--classic .select2-results__option[role=group] {
|
614 |
+
padding: 0;
|
615 |
+
}
|
616 |
|
617 |
.select2-container--classic .select2-results__option[aria-disabled=true] {
|
618 |
+
color: grey;
|
619 |
+
}
|
620 |
|
621 |
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
|
622 |
+
background-color: #3875d7;
|
623 |
+
color: white;
|
624 |
+
}
|
625 |
|
626 |
.select2-container--classic .select2-results__group {
|
627 |
+
cursor: default;
|
628 |
+
display: block;
|
629 |
+
padding: 6px;
|
630 |
+
}
|
631 |
|
632 |
.select2-container--classic.select2-container--open .select2-dropdown {
|
633 |
+
border-color: #5897fb;
|
634 |
+
}
|
assets/scss/public/_button.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.cs-button {
|
2 |
-webkit-appearance: none;
|
3 |
-webkit-font-smoothing: inherit;
|
4 |
display: inline-block;
|
1 |
+
.cs-hero-button {
|
2 |
-webkit-appearance: none;
|
3 |
-webkit-font-smoothing: inherit;
|
4 |
display: inline-block;
|
assets/scss/public/_content-carousel.scss
CHANGED
@@ -1,46 +1,162 @@
|
|
1 |
-
.carousel-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
6 |
|
7 |
-
|
|
|
8 |
display: flex;
|
9 |
-
flex-direction: column;
|
10 |
justify-content: center;
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
}
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
&-title-wrapper {
|
20 |
-
display: inline-flex;
|
21 |
-
padding: 0;
|
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 |
-
}
|
1 |
+
.carousel-slider-hero {
|
2 |
+
// Cell background
|
3 |
+
&__cell__background {
|
4 |
+
background-size: cover;
|
5 |
+
background-position: center;
|
6 |
+
background-repeat: no-repeat;
|
7 |
+
min-width: 100%;
|
8 |
+
min-height: 100%;
|
9 |
+
transition-property: transform;
|
10 |
+
transition-duration: 10s;
|
11 |
|
12 |
+
&.carousel-slider-hero-ken-out {
|
13 |
+
transform: scale(1.3);
|
14 |
+
}
|
15 |
+
|
16 |
+
// Active Slide
|
17 |
+
.carousel-slider .active & {
|
18 |
+
animation-timing-function: linear;
|
19 |
+
animation-duration: 20s;
|
20 |
+
|
21 |
+
&.carousel-slider-hero-ken-in {
|
22 |
+
transform: scale(1.3);
|
23 |
+
animation-name: ken-burns-in;
|
24 |
+
}
|
25 |
+
|
26 |
+
&.carousel-slider-hero-ken-out {
|
27 |
+
transform: scale(1);
|
28 |
+
animation-name: ken-burns-out;
|
29 |
+
}
|
30 |
+
}
|
31 |
}
|
32 |
|
33 |
+
// Cell
|
34 |
+
&__cell {
|
35 |
display: flex;
|
|
|
36 |
justify-content: center;
|
37 |
+
align-items: center;
|
38 |
+
position: relative;
|
39 |
+
overflow: hidden;
|
40 |
+
height: 400px;
|
|
|
41 |
|
42 |
+
&:focus {
|
43 |
+
outline: 0;
|
|
|
|
|
|
|
44 |
}
|
45 |
+
}
|
46 |
+
|
47 |
+
// Slide Inner
|
48 |
+
&__cell__inner {
|
49 |
+
background-repeat: no-repeat;
|
50 |
+
background-position: center;
|
51 |
+
position: absolute;
|
52 |
+
top: 0;
|
53 |
+
left: 0;
|
54 |
+
bottom: 0;
|
55 |
+
right: 0;
|
56 |
+
padding: 50px;
|
57 |
|
58 |
+
&, &:hover {
|
59 |
+
color: white;
|
60 |
+
display: flex;
|
61 |
}
|
62 |
}
|
63 |
|
64 |
+
&__cell__background_overlay {
|
65 |
+
position: absolute;
|
66 |
+
z-index: 0;
|
67 |
+
top: 0;
|
68 |
+
bottom: 0;
|
69 |
+
left: 0;
|
70 |
+
right: 0;
|
71 |
+
}
|
72 |
+
|
73 |
+
&__cell__content {
|
74 |
+
position: relative;
|
75 |
+
z-index: 1;
|
76 |
+
width: 100%;
|
77 |
+
max-width: 1140px;
|
78 |
+
}
|
79 |
+
|
80 |
+
&__cell__heading {
|
81 |
+
font-size: 40px;
|
82 |
+
font-weight: bold;
|
83 |
+
line-height: 1;
|
84 |
+
}
|
85 |
+
|
86 |
+
&__cell__description {
|
87 |
+
font-size: 20px;
|
88 |
+
line-height: 1.4;
|
89 |
+
}
|
90 |
+
|
91 |
+
&__cell__heading:not(:last-child),
|
92 |
+
&__cell__description:not(:last-child) {
|
93 |
+
margin-bottom: 30px;
|
94 |
+
}
|
95 |
+
|
96 |
+
&__cell__button__one {
|
97 |
+
margin-right: 5px;
|
98 |
+
}
|
99 |
+
&__cell__button__two {
|
100 |
+
margin-left: 5px;
|
101 |
+
}
|
102 |
+
&__cell__button__one,
|
103 |
+
&__cell__button__two {
|
104 |
+
display: inline-flex;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
.carousel-slider-hero__cell__inner {
|
109 |
+
&.carousel-slider--v-position {
|
110 |
+
&-top {
|
111 |
+
align-items: flex-start;
|
112 |
+
}
|
113 |
+
&-bottom {
|
114 |
+
align-items: flex-end;
|
115 |
+
}
|
116 |
+
&-middle {
|
117 |
+
align-items: center;
|
118 |
+
}
|
119 |
+
}
|
120 |
|
121 |
+
&.carousel-slider--h-position {
|
122 |
+
&-left {
|
123 |
+
justify-content: flex-start;
|
124 |
+
}
|
125 |
+
&-right {
|
126 |
+
justify-content: flex-end;
|
127 |
+
}
|
128 |
+
&-center {
|
129 |
+
justify-content: center;
|
130 |
}
|
131 |
+
}
|
132 |
|
133 |
+
&.carousel-slider--text {
|
134 |
+
&-left {
|
135 |
+
text-align: left;
|
136 |
+
}
|
137 |
+
&-right {
|
138 |
+
text-align: right;
|
139 |
}
|
140 |
+
&-center {
|
141 |
+
text-align: center;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
@media (max-width: 767px) {
|
147 |
+
.carousel-slider-hero__cell__inner {
|
148 |
+
padding: 30px;
|
149 |
+
}
|
150 |
|
151 |
+
.carousel-slider-hero__cell__heading {
|
152 |
+
font-size: 24px;
|
153 |
+
line-height: 1;
|
154 |
+
margin-bottom: 15px;
|
155 |
}
|
156 |
|
157 |
+
.carousel-slider-hero__cell__description {
|
158 |
+
font-size: 14px;
|
159 |
+
line-height: 1.4;
|
160 |
+
margin-bottom: 15px;
|
161 |
}
|
162 |
+
}
|
assets/scss/public/_magnific-popup.scss
CHANGED
@@ -5,46 +5,45 @@
|
|
5 |
////////////////////////
|
6 |
|
7 |
// overlay
|
8 |
-
$mfp-overlay-color:
|
9 |
-
$mfp-overlay-opacity:
|
10 |
-
$mfp-shadow:
|
11 |
|
12 |
// spacing
|
13 |
-
$mfp-popup-padding-left:
|
14 |
-
$mfp-popup-padding-left-mobile:
|
15 |
|
16 |
-
$mfp-z-index-base:
|
17 |
|
18 |
// controls
|
19 |
-
$mfp-include-arrows:
|
20 |
-
$mfp-controls-opacity:
|
21 |
-
$mfp-controls-color:
|
22 |
-
$mfp-controls-border-color:
|
23 |
-
$mfp-inner-close-icon-color:
|
24 |
-
$mfp-controls-text-color:
|
25 |
-
$mfp-controls-text-color-hover:
|
26 |
|
27 |
// Iframe-type options
|
28 |
-
$mfp-include-iframe-type:
|
29 |
-
$mfp-iframe-padding-top:
|
30 |
-
$mfp-iframe-background:
|
31 |
-
$mfp-iframe-max-width:
|
32 |
-
$mfp-iframe-ratio:
|
33 |
|
34 |
// Image-type options
|
35 |
-
$mfp-include-image-type:
|
36 |
-
$mfp-image-background:
|
37 |
-
$mfp-image-padding-top:
|
38 |
-
$mfp-image-padding-bottom:
|
39 |
-
$mfp-include-mobile-layout-for-image: true !default;
|
40 |
|
41 |
// Image caption options
|
42 |
-
$mfp-caption-title-color:
|
43 |
-
$mfp-caption-subtitle-color:
|
44 |
|
45 |
// A11y
|
46 |
-
$mfp-use-visuallyhidden:
|
47 |
-
|
48 |
|
49 |
////////////////////////
|
50 |
//
|
@@ -68,543 +67,537 @@ $mfp-use-visuallyhidden: false !default; // Hi
|
|
68 |
//
|
69 |
////////////////////////
|
70 |
|
71 |
-
|
72 |
-
|
73 |
////////////////////////
|
74 |
// 1. General styles
|
75 |
////////////////////////
|
76 |
|
77 |
// Transluscent overlay
|
78 |
.mfp-bg {
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
}
|
90 |
|
91 |
// Wrapper for popup
|
92 |
.mfp-wrap {
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
}
|
102 |
|
103 |
// Root container
|
104 |
.mfp-container {
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
}
|
114 |
|
115 |
// Vertical centerer helper
|
116 |
.mfp-container {
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
}
|
124 |
|
125 |
// Remove vertical centering when popup has class `mfp-align-top`
|
126 |
.mfp-align-top {
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
130 |
}
|
131 |
-
}
|
132 |
}
|
133 |
|
134 |
// Popup content holder
|
135 |
.mfp-content {
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
}
|
|
|
143 |
.mfp-inline-holder,
|
144 |
.mfp-ajax-holder {
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
}
|
150 |
|
151 |
// Cursors
|
152 |
.mfp-ajax-cur {
|
153 |
-
|
154 |
}
|
|
|
155 |
.mfp-zoom-out-cur {
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
}
|
|
|
162 |
.mfp-zoom {
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
}
|
|
|
168 |
.mfp-auto-cursor {
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
}
|
173 |
|
174 |
.mfp-close,
|
175 |
.mfp-arrow,
|
176 |
.mfp-preloader,
|
177 |
.mfp-counter {
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
}
|
182 |
|
183 |
// Hide the image during the loading
|
184 |
.mfp-loading {
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
}
|
189 |
|
190 |
// Helper class that hides stuff
|
191 |
@if $mfp-use-visuallyhidden {
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
} @else {
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
}
|
208 |
|
209 |
-
|
210 |
////////////////////////
|
211 |
// 2. Appearance
|
212 |
////////////////////////
|
213 |
|
214 |
// Preloader and text that displays error messages
|
215 |
.mfp-preloader {
|
216 |
-
color: $mfp-controls-text-color;
|
217 |
-
position: absolute;
|
218 |
-
top: 50%;
|
219 |
-
width: auto;
|
220 |
-
text-align: center;
|
221 |
-
margin-top: -0.8em;
|
222 |
-
left: 8px;
|
223 |
-
right: 8px;
|
224 |
-
z-index: $mfp-z-index-base + 4;
|
225 |
-
a {
|
226 |
color: $mfp-controls-text-color;
|
227 |
-
|
228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
}
|
230 |
-
}
|
231 |
}
|
232 |
|
233 |
// Hide preloader when content successfully loaded
|
234 |
.mfp-s-ready {
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
}
|
239 |
|
240 |
// Hide content when it was not loaded
|
241 |
.mfp-s-error {
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
}
|
246 |
|
247 |
// CSS-reset for buttons
|
248 |
button {
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
}
|
268 |
|
269 |
-
|
270 |
// Close icon
|
271 |
.mfp-close {
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
font-style: normal;
|
286 |
-
font-size: 28px;
|
287 |
-
font-family: Arial, Baskerville, monospace;
|
288 |
-
|
289 |
-
&:hover,
|
290 |
-
&:focus {
|
291 |
-
opacity: 1;
|
292 |
-
}
|
293 |
|
294 |
-
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
}
|
|
|
298 |
.mfp-close-btn-in {
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
}
|
|
|
303 |
.mfp-image-holder,
|
304 |
.mfp-iframe-holder {
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
}
|
313 |
|
314 |
// "1 of X" counter
|
315 |
.mfp-counter {
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
}
|
324 |
|
325 |
// Navigation arrows
|
326 |
@if $mfp-include-arrows {
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
}
|
357 |
|
358 |
-
|
359 |
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
&:before {
|
366 |
-
border-top-width: 21px;
|
367 |
-
border-bottom-width: 21px;
|
368 |
-
opacity: 0.7;
|
369 |
-
}
|
370 |
|
371 |
-
|
|
|
|
|
|
|
|
|
372 |
|
373 |
-
.mfp-arrow-left {
|
374 |
-
left: 0;
|
375 |
-
&:after {
|
376 |
-
border-right: 17px solid $mfp-controls-color;
|
377 |
-
margin-left: 31px;
|
378 |
}
|
379 |
-
&:before {
|
380 |
-
margin-left: 25px;
|
381 |
-
border-right: 27px solid $mfp-controls-border-color;
|
382 |
-
}
|
383 |
-
}
|
384 |
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
|
|
|
|
|
|
|
|
|
|
390 |
}
|
391 |
-
|
392 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
}
|
394 |
-
}
|
395 |
}
|
396 |
|
397 |
-
|
398 |
-
|
399 |
// Iframe content type
|
400 |
@if $mfp-include-iframe-type {
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
|
|
|
|
|
|
|
|
408 |
}
|
409 |
-
.mfp-
|
410 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
}
|
412 |
-
}
|
413 |
-
.mfp-iframe-scaler {
|
414 |
-
width: 100%;
|
415 |
-
height: 0;
|
416 |
-
overflow: hidden;
|
417 |
-
padding-top: $mfp-iframe-ratio * 100%;
|
418 |
-
iframe {
|
419 |
-
position: absolute;
|
420 |
-
display: block;
|
421 |
-
top: 0;
|
422 |
-
left: 0;
|
423 |
-
width: 100%;
|
424 |
-
height: 100%;
|
425 |
-
box-shadow: $mfp-shadow;
|
426 |
-
background: $mfp-iframe-background;
|
427 |
-
}
|
428 |
-
}
|
429 |
}
|
430 |
|
431 |
-
|
432 |
-
|
433 |
// Image content type
|
434 |
@if $mfp-include-image-type {
|
435 |
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
/* The shadow behind the image */
|
451 |
-
.mfp-figure {
|
452 |
-
line-height: 0;
|
453 |
-
&:after {
|
454 |
-
content: '';
|
455 |
-
position: absolute;
|
456 |
-
left: 0;
|
457 |
-
top: $mfp-image-padding-top;
|
458 |
-
bottom: $mfp-image-padding-bottom;
|
459 |
-
display: block;
|
460 |
-
right: 0;
|
461 |
-
width: auto;
|
462 |
-
height: auto;
|
463 |
-
z-index: -1;
|
464 |
-
box-shadow: $mfp-shadow;
|
465 |
-
background: $mfp-image-background;
|
466 |
-
}
|
467 |
-
small {
|
468 |
-
color: $mfp-caption-subtitle-color;
|
469 |
-
display: block;
|
470 |
-
font-size: 12px;
|
471 |
-
line-height: 14px;
|
472 |
-
}
|
473 |
-
figure {
|
474 |
-
margin: 0;
|
475 |
-
}
|
476 |
-
}
|
477 |
-
.mfp-bottom-bar {
|
478 |
-
margin-top: -$mfp-image-padding-bottom + 4;
|
479 |
-
position: absolute;
|
480 |
-
top: 100%;
|
481 |
-
left: 0;
|
482 |
-
width: 100%;
|
483 |
-
cursor: auto;
|
484 |
-
}
|
485 |
-
.mfp-title {
|
486 |
-
text-align: left;
|
487 |
-
line-height: 18px;
|
488 |
-
color: $mfp-caption-title-color;
|
489 |
-
word-wrap: break-word;
|
490 |
-
padding-right: 36px; // leave some space for counter at right side
|
491 |
-
}
|
492 |
|
493 |
-
|
494 |
-
.mfp-
|
495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
496 |
}
|
497 |
-
}
|
498 |
|
499 |
-
.mfp-gallery {
|
500 |
.mfp-image-holder {
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
}
|
505 |
-
}
|
506 |
-
|
507 |
|
508 |
-
|
509 |
-
@media screen and (max-width: 800px) and (orientation:landscape), screen and (max-height: 300px) {
|
510 |
-
/**
|
511 |
-
* Remove all paddings around the image on small screen
|
512 |
-
*/
|
513 |
-
.mfp-img-mobile {
|
514 |
.mfp-image-holder {
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
img {
|
519 |
-
&.mfp-img {
|
520 |
-
padding: 0;
|
521 |
-
}
|
522 |
-
}
|
523 |
-
.mfp-figure {
|
524 |
-
// The shadow behind the image
|
525 |
-
&:after {
|
526 |
-
top: 0;
|
527 |
-
bottom: 0;
|
528 |
-
}
|
529 |
-
small {
|
530 |
-
display: inline;
|
531 |
-
margin-left: 5px;
|
532 |
-
}
|
533 |
}
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
560 |
}
|
561 |
-
}
|
562 |
}
|
563 |
-
}
|
564 |
}
|
565 |
|
566 |
-
|
567 |
-
|
568 |
// Scale navigation arrows and reduce padding from sides
|
569 |
@media all and (max-width: 900px) {
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
}
|
587 |
|
588 |
-
|
589 |
.mfp-with-zoom .mfp-container,
|
590 |
.mfp-with-zoom.mfp-bg {
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
}
|
599 |
|
600 |
.mfp-with-zoom.mfp-ready .mfp-container {
|
601 |
opacity: 1;
|
602 |
}
|
|
|
603 |
.mfp-with-zoom.mfp-ready.mfp-bg {
|
604 |
opacity: 0.8;
|
605 |
}
|
606 |
|
607 |
.mfp-with-zoom.mfp-removing .mfp-container,
|
608 |
.mfp-with-zoom.mfp-removing.mfp-bg {
|
609 |
-
|
610 |
}
|
5 |
////////////////////////
|
6 |
|
7 |
// overlay
|
8 |
+
$mfp-overlay-color: #0b0b0b !default; // Color of overlay screen
|
9 |
+
$mfp-overlay-opacity: 0.8 !default; // Opacity of overlay screen
|
10 |
+
$mfp-shadow: 0 0 8px rgba(0, 0, 0, 0.6) !default; // Shadow on image or iframe
|
11 |
|
12 |
// spacing
|
13 |
+
$mfp-popup-padding-left: 8px !default; // Padding from left and from right side
|
14 |
+
$mfp-popup-padding-left-mobile: 6px !default; // Same as above, but is applied when width of window is less than 800px
|
15 |
|
16 |
+
$mfp-z-index-base: 1040 !default; // Base z-index of popup
|
17 |
|
18 |
// controls
|
19 |
+
$mfp-include-arrows: true !default; // Include styles for nav arrows
|
20 |
+
$mfp-controls-opacity: 0.65 !default; // Opacity of controls
|
21 |
+
$mfp-controls-color: #FFF !default; // Color of controls
|
22 |
+
$mfp-controls-border-color: #3F3F3F !default; // Border color of controls
|
23 |
+
$mfp-inner-close-icon-color: #333 !default; // Color of close button when inside
|
24 |
+
$mfp-controls-text-color: #CCC !default; // Color of preloader and "1 of X" indicator
|
25 |
+
$mfp-controls-text-color-hover: #FFF !default; // Hover color of preloader and "1 of X" indicator
|
26 |
|
27 |
// Iframe-type options
|
28 |
+
$mfp-include-iframe-type: true !default; // Enable Iframe-type popups
|
29 |
+
$mfp-iframe-padding-top: 40px !default; // Iframe padding top
|
30 |
+
$mfp-iframe-background: #000 !default; // Background color of iframes
|
31 |
+
$mfp-iframe-max-width: 900px !default; // Maximum width of iframes
|
32 |
+
$mfp-iframe-ratio: 9/16 !default; // Ratio of iframe (9/16 = widescreen, 3/4 = standard, etc.)
|
33 |
|
34 |
// Image-type options
|
35 |
+
$mfp-include-image-type: true !default; // Enable Image-type popups
|
36 |
+
$mfp-image-background: #444 !default;
|
37 |
+
$mfp-image-padding-top: 40px !default; // Image padding top
|
38 |
+
$mfp-image-padding-bottom: 40px !default; // Image padding bottom
|
39 |
+
$mfp-include-mobile-layout-for-image: true !default; // Removes paddings from top and bottom
|
40 |
|
41 |
// Image caption options
|
42 |
+
$mfp-caption-title-color: #F3F3F3 !default; // Caption title color
|
43 |
+
$mfp-caption-subtitle-color: #BDBDBD !default; // Caption subtitle color
|
44 |
|
45 |
// A11y
|
46 |
+
$mfp-use-visuallyhidden: false !default; // Hide content from browsers, but make it available for screen readers
|
|
|
47 |
|
48 |
////////////////////////
|
49 |
//
|
67 |
//
|
68 |
////////////////////////
|
69 |
|
|
|
|
|
70 |
////////////////////////
|
71 |
// 1. General styles
|
72 |
////////////////////////
|
73 |
|
74 |
// Transluscent overlay
|
75 |
.mfp-bg {
|
76 |
+
top: 0;
|
77 |
+
left: 0;
|
78 |
+
width: 100%;
|
79 |
+
height: 100%;
|
80 |
+
z-index: $mfp-z-index-base + 2;
|
81 |
+
overflow: hidden;
|
82 |
+
position: fixed;
|
83 |
+
|
84 |
+
background: $mfp-overlay-color;
|
85 |
+
opacity: $mfp-overlay-opacity;
|
86 |
}
|
87 |
|
88 |
// Wrapper for popup
|
89 |
.mfp-wrap {
|
90 |
+
top: 0;
|
91 |
+
left: 0;
|
92 |
+
width: 100%;
|
93 |
+
height: 100%;
|
94 |
+
z-index: $mfp-z-index-base + 3;
|
95 |
+
position: fixed;
|
96 |
+
outline: none !important;
|
97 |
+
-webkit-backface-visibility: hidden; // fixes webkit bug that can cause "false" scrollbar
|
98 |
}
|
99 |
|
100 |
// Root container
|
101 |
.mfp-container {
|
102 |
+
text-align: center;
|
103 |
+
position: absolute;
|
104 |
+
width: 100%;
|
105 |
+
height: 100%;
|
106 |
+
left: 0;
|
107 |
+
top: 0;
|
108 |
+
padding: 0 $mfp-popup-padding-left;
|
109 |
+
box-sizing: border-box;
|
110 |
}
|
111 |
|
112 |
// Vertical centerer helper
|
113 |
.mfp-container {
|
114 |
+
&:before {
|
115 |
+
content: '';
|
116 |
+
display: inline-block;
|
117 |
+
height: 100%;
|
118 |
+
vertical-align: middle;
|
119 |
+
}
|
120 |
}
|
121 |
|
122 |
// Remove vertical centering when popup has class `mfp-align-top`
|
123 |
.mfp-align-top {
|
124 |
+
.mfp-container {
|
125 |
+
&:before {
|
126 |
+
display: none;
|
127 |
+
}
|
128 |
}
|
|
|
129 |
}
|
130 |
|
131 |
// Popup content holder
|
132 |
.mfp-content {
|
133 |
+
position: relative;
|
134 |
+
display: inline-block;
|
135 |
+
vertical-align: middle;
|
136 |
+
margin: 0 auto;
|
137 |
+
text-align: left;
|
138 |
+
z-index: $mfp-z-index-base + 5;
|
139 |
}
|
140 |
+
|
141 |
.mfp-inline-holder,
|
142 |
.mfp-ajax-holder {
|
143 |
+
.mfp-content {
|
144 |
+
width: 100%;
|
145 |
+
cursor: auto;
|
146 |
+
}
|
147 |
}
|
148 |
|
149 |
// Cursors
|
150 |
.mfp-ajax-cur {
|
151 |
+
cursor: progress;
|
152 |
}
|
153 |
+
|
154 |
.mfp-zoom-out-cur {
|
155 |
+
&, .mfp-image-holder .mfp-close {
|
156 |
+
cursor: -moz-zoom-out;
|
157 |
+
cursor: -webkit-zoom-out;
|
158 |
+
cursor: zoom-out;
|
159 |
+
}
|
160 |
}
|
161 |
+
|
162 |
.mfp-zoom {
|
163 |
+
cursor: pointer;
|
164 |
+
cursor: -webkit-zoom-in;
|
165 |
+
cursor: -moz-zoom-in;
|
166 |
+
cursor: zoom-in;
|
167 |
}
|
168 |
+
|
169 |
.mfp-auto-cursor {
|
170 |
+
.mfp-content {
|
171 |
+
cursor: auto;
|
172 |
+
}
|
173 |
}
|
174 |
|
175 |
.mfp-close,
|
176 |
.mfp-arrow,
|
177 |
.mfp-preloader,
|
178 |
.mfp-counter {
|
179 |
+
-webkit-user-select: none;
|
180 |
+
-moz-user-select: none;
|
181 |
+
user-select: none;
|
182 |
}
|
183 |
|
184 |
// Hide the image during the loading
|
185 |
.mfp-loading {
|
186 |
+
&.mfp-figure {
|
187 |
+
display: none;
|
188 |
+
}
|
189 |
}
|
190 |
|
191 |
// Helper class that hides stuff
|
192 |
@if $mfp-use-visuallyhidden {
|
193 |
+
// From HTML5 Boilerplate https://github.com/h5bp/html5-boilerplate/blob/v4.2.0/doc/css.md#visuallyhidden
|
194 |
+
.mfp-hide {
|
195 |
+
border: 0 !important;
|
196 |
+
clip: rect(0 0 0 0) !important;
|
197 |
+
height: 1px !important;
|
198 |
+
margin: -1px !important;
|
199 |
+
overflow: hidden !important;
|
200 |
+
padding: 0 !important;
|
201 |
+
position: absolute !important;
|
202 |
+
width: 1px !important;
|
203 |
+
}
|
204 |
} @else {
|
205 |
+
.mfp-hide {
|
206 |
+
display: none !important;
|
207 |
+
}
|
208 |
}
|
209 |
|
|
|
210 |
////////////////////////
|
211 |
// 2. Appearance
|
212 |
////////////////////////
|
213 |
|
214 |
// Preloader and text that displays error messages
|
215 |
.mfp-preloader {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
color: $mfp-controls-text-color;
|
217 |
+
position: absolute;
|
218 |
+
top: 50%;
|
219 |
+
width: auto;
|
220 |
+
text-align: center;
|
221 |
+
margin-top: -0.8em;
|
222 |
+
left: 8px;
|
223 |
+
right: 8px;
|
224 |
+
z-index: $mfp-z-index-base + 4;
|
225 |
+
a {
|
226 |
+
color: $mfp-controls-text-color;
|
227 |
+
&:hover {
|
228 |
+
color: $mfp-controls-text-color-hover;
|
229 |
+
}
|
230 |
}
|
|
|
231 |
}
|
232 |
|
233 |
// Hide preloader when content successfully loaded
|
234 |
.mfp-s-ready {
|
235 |
+
.mfp-preloader {
|
236 |
+
display: none;
|
237 |
+
}
|
238 |
}
|
239 |
|
240 |
// Hide content when it was not loaded
|
241 |
.mfp-s-error {
|
242 |
+
.mfp-content {
|
243 |
+
display: none;
|
244 |
+
}
|
245 |
}
|
246 |
|
247 |
// CSS-reset for buttons
|
248 |
button {
|
249 |
+
&.mfp-close,
|
250 |
+
&.mfp-arrow {
|
251 |
+
overflow: visible;
|
252 |
+
cursor: pointer;
|
253 |
+
background: transparent;
|
254 |
+
border: 0;
|
255 |
+
-webkit-appearance: none;
|
256 |
+
display: block;
|
257 |
+
outline: none;
|
258 |
+
padding: 0;
|
259 |
+
z-index: $mfp-z-index-base + 6;
|
260 |
+
box-shadow: none;
|
261 |
+
touch-action: manipulation;
|
262 |
+
}
|
263 |
+
&::-moz-focus-inner {
|
264 |
+
padding: 0;
|
265 |
+
border: 0
|
266 |
+
}
|
267 |
}
|
268 |
|
|
|
269 |
// Close icon
|
270 |
.mfp-close {
|
271 |
+
width: 44px;
|
272 |
+
height: 44px;
|
273 |
+
line-height: 44px;
|
274 |
+
|
275 |
+
position: absolute;
|
276 |
+
right: 0;
|
277 |
+
top: 0;
|
278 |
+
text-decoration: none;
|
279 |
+
text-align: center;
|
280 |
+
opacity: $mfp-controls-opacity;
|
281 |
+
padding: 0 0 18px 10px;
|
282 |
+
color: $mfp-controls-color;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
|
284 |
+
font-style: normal;
|
285 |
+
font-size: 28px;
|
286 |
+
font-family: Arial, Baskerville, monospace;
|
287 |
+
|
288 |
+
&:hover,
|
289 |
+
&:focus {
|
290 |
+
opacity: 1;
|
291 |
+
}
|
292 |
+
|
293 |
+
&:active {
|
294 |
+
top: 1px;
|
295 |
+
}
|
296 |
}
|
297 |
+
|
298 |
.mfp-close-btn-in {
|
299 |
+
.mfp-close {
|
300 |
+
color: $mfp-inner-close-icon-color;
|
301 |
+
}
|
302 |
}
|
303 |
+
|
304 |
.mfp-image-holder,
|
305 |
.mfp-iframe-holder {
|
306 |
+
.mfp-close {
|
307 |
+
color: $mfp-controls-color;
|
308 |
+
right: -6px;
|
309 |
+
text-align: right;
|
310 |
+
padding-right: 6px;
|
311 |
+
width: 100%;
|
312 |
+
}
|
313 |
}
|
314 |
|
315 |
// "1 of X" counter
|
316 |
.mfp-counter {
|
317 |
+
position: absolute;
|
318 |
+
top: 0;
|
319 |
+
right: 0;
|
320 |
+
color: $mfp-controls-text-color;
|
321 |
+
font-size: 12px;
|
322 |
+
line-height: 18px;
|
323 |
+
white-space: nowrap;
|
324 |
}
|
325 |
|
326 |
// Navigation arrows
|
327 |
@if $mfp-include-arrows {
|
328 |
+
.mfp-arrow {
|
329 |
+
position: absolute;
|
330 |
+
opacity: $mfp-controls-opacity;
|
331 |
+
top: 50%;
|
332 |
+
margin: -55px 0 0;
|
333 |
+
padding: 0;
|
334 |
+
width: 90px;
|
335 |
+
height: 110px;
|
336 |
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
337 |
+
&:active {
|
338 |
+
margin-top: -54px;
|
339 |
+
}
|
340 |
+
&:hover,
|
341 |
+
&:focus {
|
342 |
+
opacity: 1;
|
343 |
+
}
|
344 |
+
&:before,
|
345 |
+
&:after {
|
346 |
+
content: '';
|
347 |
+
display: block;
|
348 |
+
width: 0;
|
349 |
+
height: 0;
|
350 |
+
position: absolute;
|
351 |
+
left: 0;
|
352 |
+
top: 0;
|
353 |
+
margin-top: 35px;
|
354 |
+
margin-left: 35px;
|
355 |
+
border: medium inset transparent;
|
356 |
+
}
|
|
|
357 |
|
358 |
+
&:after {
|
359 |
|
360 |
+
border-top-width: 13px;
|
361 |
+
border-bottom-width: 13px;
|
362 |
+
top: 8px;
|
363 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
|
365 |
+
&:before {
|
366 |
+
border-top-width: 21px;
|
367 |
+
border-bottom-width: 21px;
|
368 |
+
opacity: 0.7;
|
369 |
+
}
|
370 |
|
|
|
|
|
|
|
|
|
|
|
371 |
}
|
|
|
|
|
|
|
|
|
|
|
372 |
|
373 |
+
.mfp-arrow-left {
|
374 |
+
left: 0;
|
375 |
+
&:after {
|
376 |
+
border-right: 17px solid $mfp-controls-color;
|
377 |
+
margin-left: 31px;
|
378 |
+
}
|
379 |
+
&:before {
|
380 |
+
margin-left: 25px;
|
381 |
+
border-right: 27px solid $mfp-controls-border-color;
|
382 |
+
}
|
383 |
}
|
384 |
+
|
385 |
+
.mfp-arrow-right {
|
386 |
+
right: 0;
|
387 |
+
&:after {
|
388 |
+
border-left: 17px solid $mfp-controls-color;
|
389 |
+
margin-left: 39px
|
390 |
+
}
|
391 |
+
&:before {
|
392 |
+
border-left: 27px solid $mfp-controls-border-color;
|
393 |
+
}
|
394 |
}
|
|
|
395 |
}
|
396 |
|
|
|
|
|
397 |
// Iframe content type
|
398 |
@if $mfp-include-iframe-type {
|
399 |
+
.mfp-iframe-holder {
|
400 |
+
padding-top: $mfp-iframe-padding-top;
|
401 |
+
padding-bottom: $mfp-iframe-padding-top;
|
402 |
+
.mfp-content {
|
403 |
+
line-height: 0;
|
404 |
+
width: 100%;
|
405 |
+
max-width: $mfp-iframe-max-width;
|
406 |
+
}
|
407 |
+
.mfp-close {
|
408 |
+
top: -40px;
|
409 |
+
}
|
410 |
}
|
411 |
+
.mfp-iframe-scaler {
|
412 |
+
width: 100%;
|
413 |
+
height: 0;
|
414 |
+
overflow: hidden;
|
415 |
+
padding-top: $mfp-iframe-ratio * 100%;
|
416 |
+
iframe {
|
417 |
+
position: absolute;
|
418 |
+
display: block;
|
419 |
+
top: 0;
|
420 |
+
left: 0;
|
421 |
+
width: 100%;
|
422 |
+
height: 100%;
|
423 |
+
box-shadow: $mfp-shadow;
|
424 |
+
background: $mfp-iframe-background;
|
425 |
+
}
|
426 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
}
|
428 |
|
|
|
|
|
429 |
// Image content type
|
430 |
@if $mfp-include-image-type {
|
431 |
|
432 |
+
/* Main image in popup */
|
433 |
+
img {
|
434 |
+
&.mfp-img {
|
435 |
+
width: auto;
|
436 |
+
max-width: 100%;
|
437 |
+
height: auto;
|
438 |
+
display: block;
|
439 |
+
line-height: 0;
|
440 |
+
box-sizing: border-box;
|
441 |
+
padding: $mfp-image-padding-top 0 $mfp-image-padding-bottom;
|
442 |
+
margin: 0 auto;
|
443 |
+
}
|
444 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
445 |
|
446 |
+
/* The shadow behind the image */
|
447 |
+
.mfp-figure {
|
448 |
+
line-height: 0;
|
449 |
+
&:after {
|
450 |
+
content: '';
|
451 |
+
position: absolute;
|
452 |
+
left: 0;
|
453 |
+
top: $mfp-image-padding-top;
|
454 |
+
bottom: $mfp-image-padding-bottom;
|
455 |
+
display: block;
|
456 |
+
right: 0;
|
457 |
+
width: auto;
|
458 |
+
height: auto;
|
459 |
+
z-index: -1;
|
460 |
+
box-shadow: $mfp-shadow;
|
461 |
+
background: $mfp-image-background;
|
462 |
+
}
|
463 |
+
small {
|
464 |
+
color: $mfp-caption-subtitle-color;
|
465 |
+
display: block;
|
466 |
+
font-size: 12px;
|
467 |
+
line-height: 14px;
|
468 |
+
}
|
469 |
+
figure {
|
470 |
+
margin: 0;
|
471 |
+
}
|
472 |
+
}
|
473 |
+
.mfp-bottom-bar {
|
474 |
+
margin-top: -$mfp-image-padding-bottom + 4;
|
475 |
+
position: absolute;
|
476 |
+
top: 100%;
|
477 |
+
left: 0;
|
478 |
+
width: 100%;
|
479 |
+
cursor: auto;
|
480 |
+
}
|
481 |
+
.mfp-title {
|
482 |
+
text-align: left;
|
483 |
+
line-height: 18px;
|
484 |
+
color: $mfp-caption-title-color;
|
485 |
+
word-wrap: break-word;
|
486 |
+
padding-right: 36px; // leave some space for counter at right side
|
487 |
}
|
|
|
488 |
|
|
|
489 |
.mfp-image-holder {
|
490 |
+
.mfp-content {
|
491 |
+
max-width: 100%;
|
492 |
+
}
|
493 |
}
|
|
|
|
|
494 |
|
495 |
+
.mfp-gallery {
|
|
|
|
|
|
|
|
|
|
|
496 |
.mfp-image-holder {
|
497 |
+
.mfp-figure {
|
498 |
+
cursor: pointer;
|
499 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
}
|
501 |
+
}
|
502 |
+
|
503 |
+
@if $mfp-include-mobile-layout-for-image {
|
504 |
+
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
|
505 |
+
/**
|
506 |
+
* Remove all paddings around the image on small screen
|
507 |
+
*/
|
508 |
+
.mfp-img-mobile {
|
509 |
+
.mfp-image-holder {
|
510 |
+
padding-left: 0;
|
511 |
+
padding-right: 0;
|
512 |
+
}
|
513 |
+
img {
|
514 |
+
&.mfp-img {
|
515 |
+
padding: 0;
|
516 |
+
}
|
517 |
+
}
|
518 |
+
.mfp-figure {
|
519 |
+
// The shadow behind the image
|
520 |
+
&:after {
|
521 |
+
top: 0;
|
522 |
+
bottom: 0;
|
523 |
+
}
|
524 |
+
small {
|
525 |
+
display: inline;
|
526 |
+
margin-left: 5px;
|
527 |
+
}
|
528 |
+
}
|
529 |
+
.mfp-bottom-bar {
|
530 |
+
background: rgba(0, 0, 0, 0.6);
|
531 |
+
bottom: 0;
|
532 |
+
margin: 0;
|
533 |
+
top: auto;
|
534 |
+
padding: 3px 5px;
|
535 |
+
position: fixed;
|
536 |
+
box-sizing: border-box;
|
537 |
+
&:empty {
|
538 |
+
padding: 0;
|
539 |
+
}
|
540 |
+
}
|
541 |
+
.mfp-counter {
|
542 |
+
right: 5px;
|
543 |
+
top: 3px;
|
544 |
+
}
|
545 |
+
.mfp-close {
|
546 |
+
top: 0;
|
547 |
+
right: 0;
|
548 |
+
width: 35px;
|
549 |
+
height: 35px;
|
550 |
+
line-height: 35px;
|
551 |
+
background: rgba(0, 0, 0, 0.6);
|
552 |
+
position: fixed;
|
553 |
+
text-align: center;
|
554 |
+
padding: 0;
|
555 |
+
}
|
556 |
+
}
|
557 |
}
|
|
|
558 |
}
|
|
|
559 |
}
|
560 |
|
|
|
|
|
561 |
// Scale navigation arrows and reduce padding from sides
|
562 |
@media all and (max-width: 900px) {
|
563 |
+
.mfp-arrow {
|
564 |
+
-webkit-transform: scale(0.75);
|
565 |
+
transform: scale(0.75);
|
566 |
+
}
|
567 |
+
.mfp-arrow-left {
|
568 |
+
-webkit-transform-origin: 0;
|
569 |
+
transform-origin: 0;
|
570 |
+
}
|
571 |
+
.mfp-arrow-right {
|
572 |
+
-webkit-transform-origin: 100%;
|
573 |
+
transform-origin: 100%;
|
574 |
+
}
|
575 |
+
.mfp-container {
|
576 |
+
padding-left: $mfp-popup-padding-left-mobile;
|
577 |
+
padding-right: $mfp-popup-padding-left-mobile;
|
578 |
+
}
|
579 |
}
|
580 |
|
|
|
581 |
.mfp-with-zoom .mfp-container,
|
582 |
.mfp-with-zoom.mfp-bg {
|
583 |
+
opacity: 0;
|
584 |
+
-webkit-backface-visibility: hidden;
|
585 |
+
/* ideally, transition speed should match zoom duration */
|
586 |
+
-webkit-transition: all 0.3s ease-out;
|
587 |
+
-moz-transition: all 0.3s ease-out;
|
588 |
+
-o-transition: all 0.3s ease-out;
|
589 |
+
transition: all 0.3s ease-out;
|
590 |
}
|
591 |
|
592 |
.mfp-with-zoom.mfp-ready .mfp-container {
|
593 |
opacity: 1;
|
594 |
}
|
595 |
+
|
596 |
.mfp-with-zoom.mfp-ready.mfp-bg {
|
597 |
opacity: 0.8;
|
598 |
}
|
599 |
|
600 |
.mfp-with-zoom.mfp-removing .mfp-container,
|
601 |
.mfp-with-zoom.mfp-removing.mfp-bg {
|
602 |
+
opacity: 0;
|
603 |
}
|
carousel-slider.php
CHANGED
@@ -3,12 +3,15 @@
|
|
3 |
* Plugin Name: Carousel Slider
|
4 |
* Plugin URI: http://wordpress.org/plugins/carousel-slider
|
5 |
* Description: The Easiest Way to Create SEO friendly Image, Logo, Video, Post and WooCommerce Product Carousel.
|
6 |
-
* Version: 1.8.
|
7 |
* Author: Sayful Islam
|
8 |
* Author URI: https://sayfulislam.com
|
9 |
* Requires at least: 4.4
|
10 |
* Tested up to: 4.9
|
11 |
*
|
|
|
|
|
|
|
12 |
* Text Domain: carousel-slider
|
13 |
*
|
14 |
* License: GPLv3
|
@@ -26,10 +29,32 @@ if ( ! defined( 'WPINC' ) ) {
|
|
26 |
if ( ! class_exists( 'Carousel_Slider' ) ) {
|
27 |
|
28 |
final class Carousel_Slider {
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
private $plugin_name = 'carousel-slider';
|
30 |
-
private $version = '1.8.2';
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
/**
|
35 |
* Main Carousel_Slider Instance
|
@@ -85,9 +110,8 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
85 |
/**
|
86 |
* Include admin and front facing files
|
87 |
*/
|
88 |
-
|
89 |
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-i18n.php';
|
90 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-number-to-word.php';
|
91 |
require_once CAROUSEL_SLIDER_INCLUDES . '/functions-carousel-slider.php';
|
92 |
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-activator.php';
|
93 |
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-product.php';
|
@@ -95,30 +119,15 @@ if ( ! class_exists( 'Carousel_Slider' ) ) {
|
|
95 |
require_once CAROUSEL_SLIDER_WIDGETS . '/widget-carousel_slider.php';
|
96 |
|
97 |
if ( is_admin() ) {
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
-
if ( ! is_admin() ) {
|
101 |
-
$this->frontend_includes();
|
102 |
-
}
|
103 |
-
}
|
104 |
|
105 |
-
/**
|
106 |
-
* Include admin files
|
107 |
-
*/
|
108 |
-
public function admin_includes() {
|
109 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-credit.php';
|
110 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-vc-element.php';
|
111 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-documentation.php';
|
112 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-form.php';
|
113 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-admin.php';
|
114 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-content-carousel.php';
|
115 |
-
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-meta-box.php';
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Load front facing files
|
120 |
-
*/
|
121 |
-
public function frontend_includes() {
|
122 |
require_once CAROUSEL_SLIDER_PATH . '/shortcodes/class-carousel-slider-shortcode.php';
|
123 |
require_once CAROUSEL_SLIDER_PATH . '/shortcodes/class-carousel-slider-deprecated-shortcode.php';
|
124 |
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-structured-data.php';
|
3 |
* Plugin Name: Carousel Slider
|
4 |
* Plugin URI: http://wordpress.org/plugins/carousel-slider
|
5 |
* Description: The Easiest Way to Create SEO friendly Image, Logo, Video, Post and WooCommerce Product Carousel.
|
6 |
+
* Version: 1.8.3
|
7 |
* Author: Sayful Islam
|
8 |
* Author URI: https://sayfulislam.com
|
9 |
* Requires at least: 4.4
|
10 |
* Tested up to: 4.9
|
11 |
*
|
12 |
+
* WC requires at least: 2.5
|
13 |
+
* WC tested up to: 3.2
|
14 |
+
*
|
15 |
* Text Domain: carousel-slider
|
16 |
*
|
17 |
* License: GPLv3
|
29 |
if ( ! class_exists( 'Carousel_Slider' ) ) {
|
30 |
|
31 |
final class Carousel_Slider {
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Plugin name slug
|
35 |
+
*
|
36 |
+
* @var string
|
37 |
+
*/
|
38 |
private $plugin_name = 'carousel-slider';
|
|
|
39 |
|
40 |
+
/**
|
41 |
+
* Plugin version
|
42 |
+
*
|
43 |
+
* @var string
|
44 |
+
*/
|
45 |
+
private $version = '1.8.3';
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Minimum PHP version required
|
49 |
+
*
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
private $min_php = '5.3.0';
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @var object
|
56 |
+
*/
|
57 |
+
protected static $instance;
|
58 |
|
59 |
/**
|
60 |
* Main Carousel_Slider Instance
|
110 |
/**
|
111 |
* Include admin and front facing files
|
112 |
*/
|
113 |
+
private function includes() {
|
114 |
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-i18n.php';
|
|
|
115 |
require_once CAROUSEL_SLIDER_INCLUDES . '/functions-carousel-slider.php';
|
116 |
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-activator.php';
|
117 |
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-product.php';
|
119 |
require_once CAROUSEL_SLIDER_WIDGETS . '/widget-carousel_slider.php';
|
120 |
|
121 |
if ( is_admin() ) {
|
122 |
+
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-credit.php';
|
123 |
+
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-documentation.php';
|
124 |
+
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-vc-element.php';
|
125 |
+
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-form.php';
|
126 |
+
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-admin.php';
|
127 |
+
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-meta-box.php';
|
128 |
+
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-hero-carousel.php';
|
129 |
}
|
|
|
|
|
|
|
|
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
require_once CAROUSEL_SLIDER_PATH . '/shortcodes/class-carousel-slider-shortcode.php';
|
132 |
require_once CAROUSEL_SLIDER_PATH . '/shortcodes/class-carousel-slider-deprecated-shortcode.php';
|
133 |
require_once CAROUSEL_SLIDER_INCLUDES . '/class-carousel-slider-structured-data.php';
|
includes/class-carousel-slider-activator.php
CHANGED
@@ -1,4 +1,9 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Fired during plugin activation.
|
4 |
* This class defines all code necessary to run during the plugin's activation.
|
1 |
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
|
7 |
/**
|
8 |
* Fired during plugin activation.
|
9 |
* This class defines all code necessary to run during the plugin's activation.
|
includes/class-carousel-slider-admin.php
CHANGED
@@ -132,6 +132,7 @@ if ( ! class_exists( 'Carousel_Slider_Admin' ) ):
|
|
132 |
* @param $post_id
|
133 |
*/
|
134 |
public function columns_content( $column, $post_id ) {
|
|
|
135 |
switch ( $column ) {
|
136 |
|
137 |
case 'usage':
|
@@ -145,12 +146,11 @@ if ( ! class_exists( 'Carousel_Slider_Admin' ) ):
|
|
145 |
style="background-color: #f1f1f1;min-width: 250px;padding: 5px 8px;"
|
146 |
>
|
147 |
<?php
|
148 |
-
|
149 |
break;
|
150 |
|
151 |
case 'slide_type':
|
152 |
$slide_type = get_post_meta( get_the_ID(), '_slide_type', true );
|
153 |
-
echo
|
154 |
|
155 |
break;
|
156 |
default :
|
@@ -368,47 +368,47 @@ if ( ! class_exists( 'Carousel_Slider_Admin' ) ):
|
|
368 |
$_slides = array_map( function ( $slide ) {
|
369 |
$_slide = array(
|
370 |
// Slide Content
|
371 |
-
'slide_heading'
|
372 |
-
'slide_description'
|
373 |
// Slide Background
|
374 |
-
'img_id'
|
375 |
-
'img_bg_position'
|
376 |
-
'img_bg_size'
|
377 |
-
'
|
|
|
|
|
378 |
// Slide Style
|
379 |
-
'content_alignment'
|
380 |
-
'heading_font_size'
|
381 |
-
'heading_gutter'
|
382 |
-
'heading_color'
|
383 |
-
'
|
384 |
-
'
|
385 |
-
'
|
386 |
-
'description_color' => carousel_slider_sanitize_color( $slide['description_color'] ),
|
387 |
-
'description_background_color' => carousel_slider_sanitize_color( $slide['description_background_color'] ),
|
388 |
// Slide Link
|
389 |
-
'link_type'
|
390 |
-
'slide_link'
|
391 |
-
'link_target'
|
392 |
// Slide Button #1
|
393 |
-
'button_one_text'
|
394 |
-
'button_one_url'
|
395 |
-
'button_one_target'
|
396 |
-
'button_one_type'
|
397 |
-
'button_one_size'
|
398 |
-
'button_one_border_width'
|
399 |
-
'button_one_border_radius'
|
400 |
-
'button_one_bg_color'
|
401 |
-
'button_one_color'
|
402 |
// Slide Button #2
|
403 |
-
'button_two_text'
|
404 |
-
'button_two_url'
|
405 |
-
'button_two_target'
|
406 |
-
'button_two_type'
|
407 |
-
'button_two_size'
|
408 |
-
'button_two_border_width'
|
409 |
-
'button_two_border_radius'
|
410 |
-
'button_two_bg_color'
|
411 |
-
'button_two_color'
|
412 |
);
|
413 |
|
414 |
return $_slide;
|
132 |
* @param $post_id
|
133 |
*/
|
134 |
public function columns_content( $column, $post_id ) {
|
135 |
+
$slide_types = carousel_slider_slide_type( false );
|
136 |
switch ( $column ) {
|
137 |
|
138 |
case 'usage':
|
146 |
style="background-color: #f1f1f1;min-width: 250px;padding: 5px 8px;"
|
147 |
>
|
148 |
<?php
|
|
|
149 |
break;
|
150 |
|
151 |
case 'slide_type':
|
152 |
$slide_type = get_post_meta( get_the_ID(), '_slide_type', true );
|
153 |
+
echo isset( $slide_types[ $slide_type ] ) ? esc_attr( $slide_types[ $slide_type ] ) : '';
|
154 |
|
155 |
break;
|
156 |
default :
|
368 |
$_slides = array_map( function ( $slide ) {
|
369 |
$_slide = array(
|
370 |
// Slide Content
|
371 |
+
'slide_heading' => wp_kses_post( $slide['slide_heading'] ),
|
372 |
+
'slide_description' => wp_kses_post( $slide['slide_description'] ),
|
373 |
// Slide Background
|
374 |
+
'img_id' => intval( $slide['img_id'] ),
|
375 |
+
'img_bg_position' => sanitize_text_field( $slide['img_bg_position'] ),
|
376 |
+
'img_bg_size' => sanitize_text_field( $slide['img_bg_size'] ),
|
377 |
+
'ken_burns_effect' => sanitize_text_field( $slide['ken_burns_effect'] ),
|
378 |
+
'bg_color' => carousel_slider_sanitize_color( $slide['bg_color'] ),
|
379 |
+
'bg_overlay' => carousel_slider_sanitize_color( $slide['bg_overlay'] ),
|
380 |
// Slide Style
|
381 |
+
'content_alignment' => sanitize_text_field( $slide['content_alignment'] ),
|
382 |
+
'heading_font_size' => intval( $slide['heading_font_size'] ),
|
383 |
+
'heading_gutter' => sanitize_text_field( $slide['heading_gutter'] ),
|
384 |
+
'heading_color' => carousel_slider_sanitize_color( $slide['heading_color'] ),
|
385 |
+
'description_font_size' => intval( $slide['description_font_size'] ),
|
386 |
+
'description_gutter' => sanitize_text_field( $slide['description_gutter'] ),
|
387 |
+
'description_color' => carousel_slider_sanitize_color( $slide['description_color'] ),
|
|
|
|
|
388 |
// Slide Link
|
389 |
+
'link_type' => sanitize_text_field( $slide['link_type'] ),
|
390 |
+
'slide_link' => esc_url_raw( $slide['slide_link'] ),
|
391 |
+
'link_target' => sanitize_text_field( $slide['link_target'] ),
|
392 |
// Slide Button #1
|
393 |
+
'button_one_text' => sanitize_text_field( $slide['button_one_text'] ),
|
394 |
+
'button_one_url' => esc_url_raw( $slide['button_one_url'] ),
|
395 |
+
'button_one_target' => sanitize_text_field( $slide['button_one_target'] ),
|
396 |
+
'button_one_type' => sanitize_text_field( $slide['button_one_type'] ),
|
397 |
+
'button_one_size' => sanitize_text_field( $slide['button_one_size'] ),
|
398 |
+
'button_one_border_width' => sanitize_text_field( $slide['button_one_border_width'] ),
|
399 |
+
'button_one_border_radius' => sanitize_text_field( $slide['button_one_border_radius'] ),
|
400 |
+
'button_one_bg_color' => carousel_slider_sanitize_color( $slide['button_one_bg_color'] ),
|
401 |
+
'button_one_color' => carousel_slider_sanitize_color( $slide['button_one_color'] ),
|
402 |
// Slide Button #2
|
403 |
+
'button_two_text' => sanitize_text_field( $slide['button_two_text'] ),
|
404 |
+
'button_two_url' => esc_url_raw( $slide['button_two_url'] ),
|
405 |
+
'button_two_target' => sanitize_text_field( $slide['button_two_target'] ),
|
406 |
+
'button_two_type' => sanitize_text_field( $slide['button_two_type'] ),
|
407 |
+
'button_two_size' => sanitize_text_field( $slide['button_two_size'] ),
|
408 |
+
'button_two_border_width' => sanitize_text_field( $slide['button_two_border_width'] ),
|
409 |
+
'button_two_border_radius' => sanitize_text_field( $slide['button_two_border_radius'] ),
|
410 |
+
'button_two_bg_color' => carousel_slider_sanitize_color( $slide['button_two_bg_color'] ),
|
411 |
+
'button_two_color' => carousel_slider_sanitize_color( $slide['button_two_color'] ),
|
412 |
);
|
413 |
|
414 |
return $_slide;
|
includes/class-carousel-slider-credit.php
CHANGED
@@ -1,4 +1,9 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
if ( ! class_exists( 'Carousel_Slider_Credit' ) ):
|
3 |
|
4 |
class Carousel_Slider_Credit {
|
1 |
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
|
7 |
if ( ! class_exists( 'Carousel_Slider_Credit' ) ):
|
8 |
|
9 |
class Carousel_Slider_Credit {
|
includes/class-carousel-slider-form.php
CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
4 |
die;
|
5 |
}
|
6 |
|
7 |
-
if ( ! class_exists( 'Carousel_Slider_Form' ) )
|
8 |
|
9 |
class Carousel_Slider_Form {
|
10 |
|
@@ -19,10 +19,11 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
19 |
}
|
20 |
|
21 |
list( $name, $value ) = $this->field_common( $args );
|
|
|
22 |
|
23 |
echo $this->field_before( $args );
|
24 |
-
echo sprintf( '<input type="text" class="
|
25 |
-
echo $this->field_after();
|
26 |
}
|
27 |
|
28 |
/**
|
@@ -41,7 +42,7 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
41 |
|
42 |
echo $this->field_before( $args );
|
43 |
echo sprintf( '<textarea class="sp-input-textarea" id="%2$s" name="%3$s" cols="%4$d" rows="%5$d">%1$s</textarea>', esc_textarea( $value ), $args['id'], $name, $cols, $rows );
|
44 |
-
echo $this->field_after();
|
45 |
}
|
46 |
|
47 |
/**
|
@@ -59,7 +60,7 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
59 |
|
60 |
echo $this->field_before( $args );
|
61 |
echo sprintf( '<input type="text" class="color-picker" value="%1$s" id="%2$s" name="%3$s" data-alpha="true" data-default-color="%4$s">', $value, $args['id'], $name, $std_value );
|
62 |
-
echo $this->field_after();
|
63 |
}
|
64 |
|
65 |
/**
|
@@ -77,7 +78,7 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
77 |
|
78 |
echo $this->field_before( $args );
|
79 |
echo sprintf( '<input type="text" class="sp-input-text datepicker" value="%1$s" id="%2$s" name="%3$s">', $value, $args['id'], $name, $std_value );
|
80 |
-
echo $this->field_after();
|
81 |
}
|
82 |
|
83 |
/**
|
@@ -91,12 +92,11 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
91 |
}
|
92 |
|
93 |
list( $name, $value ) = $this->field_common( $args );
|
94 |
-
$
|
95 |
-
$max = isset( $args['max'] ) ? $args['max'] : null;
|
96 |
|
97 |
echo $this->field_before( $args );
|
98 |
-
echo sprintf( '<input type="number" class="
|
99 |
-
echo $this->field_after();
|
100 |
}
|
101 |
|
102 |
/**
|
@@ -115,8 +115,8 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
115 |
|
116 |
echo $this->field_before( $args );
|
117 |
echo sprintf( '<input type="hidden" name="%1$s" value="off">', $name );
|
118 |
-
echo sprintf( '<label for="%2$s"><input type="checkbox"
|
119 |
-
echo $this->field_after();
|
120 |
}
|
121 |
|
122 |
/**
|
@@ -130,17 +130,17 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
130 |
}
|
131 |
|
132 |
list( $name, $value ) = $this->field_common( $args );
|
133 |
-
$checked = ( $value == 'on' ) ? ' checked' : '';
|
134 |
$multiple = isset( $args['multiple'] ) ? 'multiple' : '';
|
|
|
135 |
|
136 |
echo $this->field_before( $args );
|
137 |
-
echo sprintf( '<select name="%1$s" id="%2$s" class="
|
138 |
foreach ( $args['options'] as $key => $option ) {
|
139 |
$selected = ( $value == $key ) ? ' selected="selected"' : '';
|
140 |
-
echo
|
141 |
}
|
142 |
echo '</select>';
|
143 |
-
echo $this->field_after();
|
144 |
}
|
145 |
|
146 |
/**
|
@@ -160,7 +160,7 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
160 |
$post_type = isset( $args['post_type'] ) ? $args['post_type'] : 'post';
|
161 |
|
162 |
echo $this->field_before( $args );
|
163 |
-
echo
|
164 |
$posts = get_posts( array(
|
165 |
'post_type' => $post_type,
|
166 |
'post_status' => 'publish',
|
@@ -169,10 +169,10 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
169 |
|
170 |
foreach ( $posts as $post ) {
|
171 |
$selected = in_array( $post->ID, $value ) ? ' selected="selected"' : '';
|
172 |
-
echo
|
173 |
}
|
174 |
echo '</select>';
|
175 |
-
echo $this->field_after();
|
176 |
}
|
177 |
|
178 |
/**
|
@@ -215,7 +215,7 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
215 |
);
|
216 |
$html .= sprintf( '<ul class="carousel_slider_gallery_list">%s</ul>', $output );
|
217 |
$html .= '</div>';
|
218 |
-
$html .= $this->field_after();
|
219 |
echo $html;
|
220 |
}
|
221 |
|
@@ -228,7 +228,12 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
228 |
if ( ! isset( $args['id'], $args['name'] ) ) {
|
229 |
return;
|
230 |
}
|
231 |
-
|
|
|
|
|
|
|
|
|
|
|
232 |
|
233 |
$btn_text = $value ? __( 'Edit URLs', 'carousel-slider' ) : __( 'Add URLs', 'carousel-slider' );
|
234 |
|
@@ -237,11 +242,11 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
237 |
$html .= '<ul class="carousel_slider_url_images_list">';
|
238 |
if ( is_array( $value ) && count( $value ) > 0 ) {
|
239 |
foreach ( $value as $image ) {
|
240 |
-
$html .=
|
241 |
}
|
242 |
}
|
243 |
$html .= '</ul>';
|
244 |
-
$html .= $this->field_after();
|
245 |
echo $html;
|
246 |
}
|
247 |
|
@@ -255,7 +260,7 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
255 |
echo $this->field_before( $args );
|
256 |
echo sprintf( '<input type="text" class="sp-input-text" value="%1$s" id="%2$s" name="%3$s">', $value, $args['id'], $name );
|
257 |
echo sprintf( '<input type="button" class="button" id="carousel_slider_video_btn" value="%s">', __( 'Browse', 'carousel-slider' ) );
|
258 |
-
echo $this->field_after();
|
259 |
}
|
260 |
|
261 |
/**
|
@@ -281,7 +286,7 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
281 |
$height = get_option( "{$_size}_size_h" );
|
282 |
$crop = (bool) get_option( "{$_size}_crop" ) ? 'hard' : 'soft';
|
283 |
|
284 |
-
$sizes[ $_size ] = "{$_size} - {$width}x{$height}";
|
285 |
|
286 |
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
|
287 |
|
@@ -289,7 +294,7 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
289 |
$height = $_wp_additional_image_sizes[ $_size ]['height'];
|
290 |
$crop = $_wp_additional_image_sizes[ $_size ]['crop'] ? 'hard' : 'soft';
|
291 |
|
292 |
-
$sizes[ $_size ] = "{$_size} - {$width}x{$height}";
|
293 |
}
|
294 |
}
|
295 |
|
@@ -297,13 +302,13 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
297 |
|
298 |
|
299 |
echo $this->field_before( $args );
|
300 |
-
echo
|
301 |
foreach ( $sizes as $key => $option ) {
|
302 |
$selected = ( $value == $key ) ? ' selected="selected"' : '';
|
303 |
-
echo
|
304 |
}
|
305 |
echo '</select>';
|
306 |
-
echo $this->field_after();
|
307 |
}
|
308 |
|
309 |
/**
|
@@ -332,16 +337,15 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
332 |
|
333 |
echo $this->field_before( $args );
|
334 |
|
335 |
-
echo
|
336 |
-
|
337 |
foreach ( $terms as $term ) {
|
338 |
$title = sprintf( '%s (%s)', $term->name, $term->count );
|
339 |
$selected = in_array( $term->term_id, $value ) ? ' selected="selected"' : '';
|
340 |
-
echo
|
341 |
}
|
342 |
echo '</select>';
|
343 |
|
344 |
-
echo $this->field_after();
|
345 |
}
|
346 |
|
347 |
/**
|
@@ -378,26 +382,45 @@ if ( ! class_exists( 'Carousel_Slider_Form' ) ):
|
|
378 |
* @return string
|
379 |
*/
|
380 |
private function field_before( $args ) {
|
381 |
-
$
|
382 |
-
$
|
383 |
-
$
|
384 |
if ( ! empty( $args['desc'] ) ) {
|
385 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
}
|
387 |
-
$table .= '</div>';
|
388 |
-
$table .= sprintf( '<div class="sp-input-field">' );
|
389 |
|
390 |
-
return $
|
391 |
}
|
392 |
|
393 |
/**
|
394 |
* Generate field after template
|
395 |
*
|
|
|
|
|
396 |
* @return string
|
397 |
*/
|
398 |
-
private function field_after() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
return '</div></div>';
|
400 |
}
|
401 |
}
|
402 |
-
|
403 |
-
endif;
|
4 |
die;
|
5 |
}
|
6 |
|
7 |
+
if ( ! class_exists( 'Carousel_Slider_Form' ) ) {
|
8 |
|
9 |
class Carousel_Slider_Form {
|
10 |
|
19 |
}
|
20 |
|
21 |
list( $name, $value ) = $this->field_common( $args );
|
22 |
+
$class = isset( $args['class'] ) ? esc_attr( $args['class'] ) : 'sp-input-text';
|
23 |
|
24 |
echo $this->field_before( $args );
|
25 |
+
echo sprintf( '<input type="text" class="' . $class . '" value="%1$s" id="%2$s" name="%3$s">', $value, $args['id'], $name );
|
26 |
+
echo $this->field_after( $args );
|
27 |
}
|
28 |
|
29 |
/**
|
42 |
|
43 |
echo $this->field_before( $args );
|
44 |
echo sprintf( '<textarea class="sp-input-textarea" id="%2$s" name="%3$s" cols="%4$d" rows="%5$d">%1$s</textarea>', esc_textarea( $value ), $args['id'], $name, $cols, $rows );
|
45 |
+
echo $this->field_after( $args );
|
46 |
}
|
47 |
|
48 |
/**
|
60 |
|
61 |
echo $this->field_before( $args );
|
62 |
echo sprintf( '<input type="text" class="color-picker" value="%1$s" id="%2$s" name="%3$s" data-alpha="true" data-default-color="%4$s">', $value, $args['id'], $name, $std_value );
|
63 |
+
echo $this->field_after( $args );
|
64 |
}
|
65 |
|
66 |
/**
|
78 |
|
79 |
echo $this->field_before( $args );
|
80 |
echo sprintf( '<input type="text" class="sp-input-text datepicker" value="%1$s" id="%2$s" name="%3$s">', $value, $args['id'], $name, $std_value );
|
81 |
+
echo $this->field_after( $args );
|
82 |
}
|
83 |
|
84 |
/**
|
92 |
}
|
93 |
|
94 |
list( $name, $value ) = $this->field_common( $args );
|
95 |
+
$class = isset( $args['class'] ) ? esc_attr( $args['class'] ) : 'sp-input-text';
|
|
|
96 |
|
97 |
echo $this->field_before( $args );
|
98 |
+
echo sprintf( '<input type="number" class="' . $class . '" value="%1$s" id="%2$s" name="%3$s">', $value, $args['id'], $name );
|
99 |
+
echo $this->field_after( $args );
|
100 |
}
|
101 |
|
102 |
/**
|
115 |
|
116 |
echo $this->field_before( $args );
|
117 |
echo sprintf( '<input type="hidden" name="%1$s" value="off">', $name );
|
118 |
+
echo sprintf( '<label for="%2$s"><input type="checkbox" ' . $checked . ' value="on" id="%2$s" name="%1$s">%3$s</label>', $name, $args['id'], $label );
|
119 |
+
echo $this->field_after( $args );
|
120 |
}
|
121 |
|
122 |
/**
|
130 |
}
|
131 |
|
132 |
list( $name, $value ) = $this->field_common( $args );
|
|
|
133 |
$multiple = isset( $args['multiple'] ) ? 'multiple' : '';
|
134 |
+
$class = isset( $args['class'] ) ? esc_attr( $args['class'] ) : 'select2 sp-input-text';
|
135 |
|
136 |
echo $this->field_before( $args );
|
137 |
+
echo sprintf( '<select name="%1$s" id="%2$s" class="' . $class . '" %3$s>', $name, $args['id'], $multiple );
|
138 |
foreach ( $args['options'] as $key => $option ) {
|
139 |
$selected = ( $value == $key ) ? ' selected="selected"' : '';
|
140 |
+
echo '<option value="' . $key . '" ' . $selected . '>' . $option . '</option>';
|
141 |
}
|
142 |
echo '</select>';
|
143 |
+
echo $this->field_after( $args );
|
144 |
}
|
145 |
|
146 |
/**
|
160 |
$post_type = isset( $args['post_type'] ) ? $args['post_type'] : 'post';
|
161 |
|
162 |
echo $this->field_before( $args );
|
163 |
+
echo '<select name="' . $name . '" id="' . $args['id'] . '" class="select2 sp-input-text" ' . $multiple . '>';
|
164 |
$posts = get_posts( array(
|
165 |
'post_type' => $post_type,
|
166 |
'post_status' => 'publish',
|
169 |
|
170 |
foreach ( $posts as $post ) {
|
171 |
$selected = in_array( $post->ID, $value ) ? ' selected="selected"' : '';
|
172 |
+
echo '<option value="' . $post->ID . '" ' . $selected . '>' . $post->post_title . '</option>';
|
173 |
}
|
174 |
echo '</select>';
|
175 |
+
echo $this->field_after( $args );
|
176 |
}
|
177 |
|
178 |
/**
|
215 |
);
|
216 |
$html .= sprintf( '<ul class="carousel_slider_gallery_list">%s</ul>', $output );
|
217 |
$html .= '</div>';
|
218 |
+
$html .= $this->field_after( $args );
|
219 |
echo $html;
|
220 |
}
|
221 |
|
228 |
if ( ! isset( $args['id'], $args['name'] ) ) {
|
229 |
return;
|
230 |
}
|
231 |
+
|
232 |
+
global $post;
|
233 |
+
|
234 |
+
$std_value = isset( $args['std'] ) ? $args['std'] : '';
|
235 |
+
$meta = get_post_meta( $post->ID, $args['id'], true );
|
236 |
+
$value = ! empty( $meta ) ? $meta : $std_value;
|
237 |
|
238 |
$btn_text = $value ? __( 'Edit URLs', 'carousel-slider' ) : __( 'Add URLs', 'carousel-slider' );
|
239 |
|
242 |
$html .= '<ul class="carousel_slider_url_images_list">';
|
243 |
if ( is_array( $value ) && count( $value ) > 0 ) {
|
244 |
foreach ( $value as $image ) {
|
245 |
+
$html .= '<li><img src="' . $image['url'] . '" alt="' . $image['alt'] . '" width="75" height="75"></li>';
|
246 |
}
|
247 |
}
|
248 |
$html .= '</ul>';
|
249 |
+
$html .= $this->field_after( $args );
|
250 |
echo $html;
|
251 |
}
|
252 |
|
260 |
echo $this->field_before( $args );
|
261 |
echo sprintf( '<input type="text" class="sp-input-text" value="%1$s" id="%2$s" name="%3$s">', $value, $args['id'], $name );
|
262 |
echo sprintf( '<input type="button" class="button" id="carousel_slider_video_btn" value="%s">', __( 'Browse', 'carousel-slider' ) );
|
263 |
+
echo $this->field_after( $args );
|
264 |
}
|
265 |
|
266 |
/**
|
286 |
$height = get_option( "{$_size}_size_h" );
|
287 |
$crop = (bool) get_option( "{$_size}_crop" ) ? 'hard' : 'soft';
|
288 |
|
289 |
+
$sizes[ $_size ] = "{$_size} - $crop:{$width}x{$height}";
|
290 |
|
291 |
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
|
292 |
|
294 |
$height = $_wp_additional_image_sizes[ $_size ]['height'];
|
295 |
$crop = $_wp_additional_image_sizes[ $_size ]['crop'] ? 'hard' : 'soft';
|
296 |
|
297 |
+
$sizes[ $_size ] = "{$_size} - $crop:{$width}x{$height}";
|
298 |
}
|
299 |
}
|
300 |
|
302 |
|
303 |
|
304 |
echo $this->field_before( $args );
|
305 |
+
echo '<select name="' . $name . '" id="' . $args['id'] . '" class="select2 sp-input-text">';
|
306 |
foreach ( $sizes as $key => $option ) {
|
307 |
$selected = ( $value == $key ) ? ' selected="selected"' : '';
|
308 |
+
echo '<option value="' . $key . '" ' . $selected . '>' . $option . '</option>';
|
309 |
}
|
310 |
echo '</select>';
|
311 |
+
echo $this->field_after( $args );
|
312 |
}
|
313 |
|
314 |
/**
|
337 |
|
338 |
echo $this->field_before( $args );
|
339 |
|
340 |
+
echo '<select name="' . $name . '" id="' . $args['id'] . '" class="select2 sp-input-text" ' . $multiple . '>';
|
|
|
341 |
foreach ( $terms as $term ) {
|
342 |
$title = sprintf( '%s (%s)', $term->name, $term->count );
|
343 |
$selected = in_array( $term->term_id, $value ) ? ' selected="selected"' : '';
|
344 |
+
echo '<option value="' . $term->term_id . '" ' . $selected . '>' . $title . '</option>';
|
345 |
}
|
346 |
echo '</select>';
|
347 |
|
348 |
+
echo $this->field_after( $args );
|
349 |
}
|
350 |
|
351 |
/**
|
382 |
* @return string
|
383 |
*/
|
384 |
private function field_before( $args ) {
|
385 |
+
$_normal = sprintf( '<div class="sp-input-group" id="field-%s">', $args['id'] );
|
386 |
+
$_normal .= sprintf( '<div class="sp-input-label">' );
|
387 |
+
$_normal .= sprintf( '<label for="%1$s">%2$s</label>', $args['id'], $args['name'] );
|
388 |
if ( ! empty( $args['desc'] ) ) {
|
389 |
+
$_normal .= sprintf( '<p class="sp-input-desc">%s</p>', $args['desc'] );
|
390 |
+
}
|
391 |
+
$_normal .= '</div>';
|
392 |
+
$_normal .= sprintf( '<div class="sp-input-field">' );
|
393 |
+
|
394 |
+
if ( isset( $args['context'] ) && 'side' == $args['context'] ) {
|
395 |
+
$_side = '<p id="field-' . $args['id'] . '">';
|
396 |
+
$_side .= '<label for="' . $args['id'] . '"><strong>' . $args['name'] . '</strong></label>';
|
397 |
+
|
398 |
+
return $_side;
|
399 |
}
|
|
|
|
|
400 |
|
401 |
+
return $_normal;
|
402 |
}
|
403 |
|
404 |
/**
|
405 |
* Generate field after template
|
406 |
*
|
407 |
+
* @param array $args
|
408 |
+
*
|
409 |
* @return string
|
410 |
*/
|
411 |
+
private function field_after( $args = array() ) {
|
412 |
+
|
413 |
+
if ( isset( $args['context'] ) && 'side' == $args['context'] ) {
|
414 |
+
$_side = '';
|
415 |
+
if ( ! empty( $args['desc'] ) ) {
|
416 |
+
$_side .= '<span class="cs-tooltip" title="' . esc_attr( $args['desc'] ) . '"></span>';
|
417 |
+
}
|
418 |
+
$_side .= '</p>';
|
419 |
+
|
420 |
+
return $_side;
|
421 |
+
}
|
422 |
+
|
423 |
return '</div></div>';
|
424 |
}
|
425 |
}
|
426 |
+
}
|
|
includes/{class-carousel-slider-content-carousel.php → class-carousel-slider-hero-carousel.php}
RENAMED
@@ -1,15 +1,19 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
if ( ! class_exists( '
|
4 |
|
5 |
-
class
|
6 |
|
7 |
protected static $instance = null;
|
8 |
|
9 |
/**
|
10 |
* Ensures only one instance of this class is loaded or can be loaded.
|
11 |
*
|
12 |
-
* @return
|
13 |
*/
|
14 |
public static function init() {
|
15 |
if ( is_null( self::$instance ) ) {
|
@@ -24,6 +28,11 @@ if ( ! class_exists( 'Carousel_Slider_Content_Carousel' ) ):
|
|
24 |
}
|
25 |
|
26 |
public function add_slide_template() {
|
|
|
|
|
|
|
|
|
|
|
27 |
$post_id = absint( $_POST['post_id'] );
|
28 |
$task = isset( $_POST['task'] ) ? esc_attr( $_POST['task'] ) : 'add-slide';
|
29 |
$slide_pos = isset( $_POST['slide_pos'] ) ? absint( $_POST['slide_pos'] ) : null;
|
@@ -49,27 +58,57 @@ if ( ! class_exists( 'Carousel_Slider_Content_Carousel' ) ):
|
|
49 |
$slider = $this->move_slide_bottom( $slider, $slide_pos, $post_id );
|
50 |
}
|
51 |
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
54 |
}
|
55 |
|
56 |
private function content_slide_default() {
|
57 |
$data = array(
|
58 |
-
|
59 |
-
'
|
60 |
-
'
|
61 |
-
|
62 |
-
'
|
63 |
-
'
|
64 |
-
'
|
65 |
-
'
|
66 |
-
'
|
67 |
-
'
|
68 |
-
|
69 |
-
'
|
70 |
-
'
|
71 |
-
'
|
72 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
);
|
74 |
|
75 |
return $data;
|
@@ -192,8 +231,22 @@ if ( ! class_exists( 'Carousel_Slider_Content_Carousel' ) ):
|
|
192 |
|
193 |
return $slider;
|
194 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
|
197 |
endif;
|
198 |
|
199 |
-
|
1 |
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
|
7 |
+
if ( ! class_exists( 'Carousel_Slider_Hero_Carousel' ) ):
|
8 |
|
9 |
+
class Carousel_Slider_Hero_Carousel {
|
10 |
|
11 |
protected static $instance = null;
|
12 |
|
13 |
/**
|
14 |
* Ensures only one instance of this class is loaded or can be loaded.
|
15 |
*
|
16 |
+
* @return Carousel_Slider_Hero_Carousel
|
17 |
*/
|
18 |
public static function init() {
|
19 |
if ( is_null( self::$instance ) ) {
|
28 |
}
|
29 |
|
30 |
public function add_slide_template() {
|
31 |
+
|
32 |
+
if ( ! isset( $_POST['post_id'] ) ) {
|
33 |
+
$this->send_json( __( 'Required attribute is not set properly.', 'carousel-slider' ), 422 );
|
34 |
+
}
|
35 |
+
|
36 |
$post_id = absint( $_POST['post_id'] );
|
37 |
$task = isset( $_POST['task'] ) ? esc_attr( $_POST['task'] ) : 'add-slide';
|
38 |
$slide_pos = isset( $_POST['slide_pos'] ) ? absint( $_POST['slide_pos'] ) : null;
|
58 |
$slider = $this->move_slide_bottom( $slider, $slide_pos, $post_id );
|
59 |
}
|
60 |
|
61 |
+
if ( isset( $slider ) ) {
|
62 |
+
$this->send_json( $slider );
|
63 |
+
}
|
64 |
+
|
65 |
+
$this->send_json( __( 'Required action is unauthorized.', 'carousel-slider' ), 401 );
|
66 |
}
|
67 |
|
68 |
private function content_slide_default() {
|
69 |
$data = array(
|
70 |
+
// Slide Content
|
71 |
+
'slide_heading' => 'Slide Heading',
|
72 |
+
'slide_description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas, magnam!',
|
73 |
+
// Slide Background
|
74 |
+
'img_id' => '',
|
75 |
+
'img_bg_position' => 'center center',
|
76 |
+
'img_bg_size' => 'cover',
|
77 |
+
'bg_color' => 'rgba(0,0,0,0.6)',
|
78 |
+
'ken_burns_effect' => '',
|
79 |
+
'bg_overlay' => '',
|
80 |
+
// Slide Style
|
81 |
+
'content_alignment' => 'center',
|
82 |
+
'heading_font_size' => '40',
|
83 |
+
'heading_gutter' => '30px',
|
84 |
+
'heading_color' => '#ffffff',
|
85 |
+
'description_font_size' => '20',
|
86 |
+
'description_gutter' => '30px',
|
87 |
+
'description_color' => '#ffffff',
|
88 |
+
// Slide Link
|
89 |
+
'link_type' => 'none',
|
90 |
+
'slide_link' => '',
|
91 |
+
'link_target' => '_self',
|
92 |
+
// Slide Button #1
|
93 |
+
'button_one_text' => '',
|
94 |
+
'button_one_url' => '',
|
95 |
+
'button_one_target' => '_self',
|
96 |
+
'button_one_type' => 'stroke',
|
97 |
+
'button_one_size' => 'medium',
|
98 |
+
'button_one_border_width' => '3px',
|
99 |
+
'button_one_border_radius' => '0px',
|
100 |
+
'button_one_bg_color' => '#ffffff',
|
101 |
+
'button_one_color' => '#323232',
|
102 |
+
// Slide Button #2
|
103 |
+
'button_two_text' => '',
|
104 |
+
'button_two_url' => '',
|
105 |
+
'button_two_target' => '_self',
|
106 |
+
'button_two_type' => 'stroke',
|
107 |
+
'button_two_size' => 'medium',
|
108 |
+
'button_two_border_width' => '3px',
|
109 |
+
'button_two_border_radius' => '0px',
|
110 |
+
'button_two_bg_color' => '#ffffff',
|
111 |
+
'button_two_color' => '#323232',
|
112 |
);
|
113 |
|
114 |
return $data;
|
231 |
|
232 |
return $slider;
|
233 |
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Send json response with status code
|
237 |
+
*
|
238 |
+
* @param string $response
|
239 |
+
* @param int $status_code
|
240 |
+
*/
|
241 |
+
private function send_json( $response, $status_code = 200 ) {
|
242 |
+
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
243 |
+
status_header( $status_code );
|
244 |
+
|
245 |
+
echo wp_json_encode( $response );
|
246 |
+
die;
|
247 |
+
}
|
248 |
}
|
249 |
|
250 |
endif;
|
251 |
|
252 |
+
Carousel_Slider_Hero_Carousel::init();
|
includes/class-carousel-slider-meta-box.php
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
2 |
|
3 |
if ( ! class_exists( 'Carousel_Slider_Meta_Box' ) ):
|
4 |
|
1 |
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
|
7 |
if ( ! class_exists( 'Carousel_Slider_Meta_Box' ) ):
|
8 |
|
includes/class-carousel-slider-number-to-word.php
DELETED
@@ -1,253 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Convert a number into English text.
|
5 |
-
*/
|
6 |
-
class Carousel_Slider_Number_To_Word {
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Carousel_Slider_Number_To_Word constructor.
|
10 |
-
*
|
11 |
-
* @param null $number
|
12 |
-
*/
|
13 |
-
public function __construct( $number = null ) {
|
14 |
-
if ( is_integer( $number ) ) {
|
15 |
-
return $this->convert( $number );
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Convert number into english word
|
21 |
-
*
|
22 |
-
* @param $number
|
23 |
-
*
|
24 |
-
* @return string
|
25 |
-
*/
|
26 |
-
public function convert( $number ) {
|
27 |
-
$split_string = explode( ".", (string) $number );
|
28 |
-
$integer = isset( $split_string[0] ) ? $split_string[0] : null;
|
29 |
-
$fraction = isset( $split_string[1] ) ? $split_string[1] : null;
|
30 |
-
// list( $integer, $fraction ) = explode( ".", (string) $number );
|
31 |
-
|
32 |
-
$output = "";
|
33 |
-
|
34 |
-
if ( $integer{0} == "-" ) {
|
35 |
-
$output = "negative ";
|
36 |
-
$integer = ltrim( $integer, "-" );
|
37 |
-
} else if ( $integer{0} == "+" ) {
|
38 |
-
$output = "positive ";
|
39 |
-
$integer = ltrim( $integer, "+" );
|
40 |
-
}
|
41 |
-
|
42 |
-
if ( $integer{0} == "0" ) {
|
43 |
-
$output .= "zero";
|
44 |
-
} else {
|
45 |
-
$integer = str_pad( $integer, 36, "0", STR_PAD_LEFT );
|
46 |
-
$group = rtrim( chunk_split( $integer, 3, " " ), " " );
|
47 |
-
$groups = explode( " ", $group );
|
48 |
-
|
49 |
-
$groups2 = array();
|
50 |
-
foreach ( $groups as $g ) {
|
51 |
-
$groups2[] = $this->convert_three_digit( $g{0}, $g{1}, $g{2} );
|
52 |
-
}
|
53 |
-
|
54 |
-
for ( $z = 0; $z < count( $groups2 ); $z ++ ) {
|
55 |
-
if ( $groups2[ $z ] != "" ) {
|
56 |
-
$output .= $groups2[ $z ] . $this->convert_group( 11 - $z ) . (
|
57 |
-
$z < 11
|
58 |
-
&& ! array_search( '', array_slice( $groups2, $z + 1, - 1 ) )
|
59 |
-
&& $groups2[11] != ''
|
60 |
-
&& $groups[11]{0} == '0'
|
61 |
-
? " and "
|
62 |
-
: ", "
|
63 |
-
);
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
$output = rtrim( $output, ", " );
|
68 |
-
}
|
69 |
-
|
70 |
-
if ( $fraction > 0 ) {
|
71 |
-
$output .= " point";
|
72 |
-
for ( $i = 0; $i < strlen( $fraction ); $i ++ ) {
|
73 |
-
$output .= " " . $this->convert_digit( $fraction{$i} );
|
74 |
-
}
|
75 |
-
}
|
76 |
-
|
77 |
-
return $output;
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Convert three digits into english word
|
82 |
-
*
|
83 |
-
* @param $digit1
|
84 |
-
* @param $digit2
|
85 |
-
* @param $digit3
|
86 |
-
*
|
87 |
-
* @return string
|
88 |
-
*/
|
89 |
-
private function convert_three_digit( $digit1, $digit2, $digit3 ) {
|
90 |
-
$buffer = "";
|
91 |
-
|
92 |
-
if ( $digit1 == "0" && $digit2 == "0" && $digit3 == "0" ) {
|
93 |
-
return "";
|
94 |
-
}
|
95 |
-
|
96 |
-
if ( $digit1 != "0" ) {
|
97 |
-
$buffer .= $this->convert_digit( $digit1 ) . " hundred";
|
98 |
-
if ( $digit2 != "0" || $digit3 != "0" ) {
|
99 |
-
$buffer .= " and ";
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
if ( $digit2 != "0" ) {
|
104 |
-
$buffer .= $this->convert_two_digit( $digit2, $digit3 );
|
105 |
-
} else if ( $digit3 != "0" ) {
|
106 |
-
$buffer .= $this->convert_digit( $digit3 );
|
107 |
-
}
|
108 |
-
|
109 |
-
return $buffer;
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Convert single digit into english word
|
114 |
-
*
|
115 |
-
* @param $digit
|
116 |
-
*
|
117 |
-
* @return string
|
118 |
-
*/
|
119 |
-
private function convert_digit( $digit ) {
|
120 |
-
switch ( $digit ) {
|
121 |
-
case "0":
|
122 |
-
return "zero";
|
123 |
-
case "1":
|
124 |
-
return "one";
|
125 |
-
case "2":
|
126 |
-
return "two";
|
127 |
-
case "3":
|
128 |
-
return "three";
|
129 |
-
case "4":
|
130 |
-
return "four";
|
131 |
-
case "5":
|
132 |
-
return "five";
|
133 |
-
case "6":
|
134 |
-
return "six";
|
135 |
-
case "7":
|
136 |
-
return "seven";
|
137 |
-
case "8":
|
138 |
-
return "eight";
|
139 |
-
case "9":
|
140 |
-
return "nine";
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* Convert two digits into english word
|
146 |
-
*
|
147 |
-
* @param $digit1
|
148 |
-
* @param $digit2
|
149 |
-
*
|
150 |
-
* @return string
|
151 |
-
*/
|
152 |
-
private function convert_two_digit( $digit1, $digit2 ) {
|
153 |
-
if ( $digit2 == "0" ) {
|
154 |
-
switch ( $digit1 ) {
|
155 |
-
case "1":
|
156 |
-
return "ten";
|
157 |
-
case "2":
|
158 |
-
return "twenty";
|
159 |
-
case "3":
|
160 |
-
return "thirty";
|
161 |
-
case "4":
|
162 |
-
return "forty";
|
163 |
-
case "5":
|
164 |
-
return "fifty";
|
165 |
-
case "6":
|
166 |
-
return "sixty";
|
167 |
-
case "7":
|
168 |
-
return "seventy";
|
169 |
-
case "8":
|
170 |
-
return "eighty";
|
171 |
-
case "9":
|
172 |
-
return "ninety";
|
173 |
-
}
|
174 |
-
} else if ( $digit1 == "1" ) {
|
175 |
-
switch ( $digit2 ) {
|
176 |
-
case "1":
|
177 |
-
return "eleven";
|
178 |
-
case "2":
|
179 |
-
return "twelve";
|
180 |
-
case "3":
|
181 |
-
return "thirteen";
|
182 |
-
case "4":
|
183 |
-
return "fourteen";
|
184 |
-
case "5":
|
185 |
-
return "fifteen";
|
186 |
-
case "6":
|
187 |
-
return "sixteen";
|
188 |
-
case "7":
|
189 |
-
return "seventeen";
|
190 |
-
case "8":
|
191 |
-
return "eighteen";
|
192 |
-
case "9":
|
193 |
-
return "nineteen";
|
194 |
-
}
|
195 |
-
} else {
|
196 |
-
$temp = $this->convert_digit( $digit2 );
|
197 |
-
switch ( $digit1 ) {
|
198 |
-
case "2":
|
199 |
-
return "twenty-$temp";
|
200 |
-
case "3":
|
201 |
-
return "thirty-$temp";
|
202 |
-
case "4":
|
203 |
-
return "forty-$temp";
|
204 |
-
case "5":
|
205 |
-
return "fifty-$temp";
|
206 |
-
case "6":
|
207 |
-
return "sixty-$temp";
|
208 |
-
case "7":
|
209 |
-
return "seventy-$temp";
|
210 |
-
case "8":
|
211 |
-
return "eighty-$temp";
|
212 |
-
case "9":
|
213 |
-
return "ninety-$temp";
|
214 |
-
}
|
215 |
-
}
|
216 |
-
}
|
217 |
-
|
218 |
-
/**
|
219 |
-
* Convert group into english word
|
220 |
-
*
|
221 |
-
* @param $index
|
222 |
-
*
|
223 |
-
* @return string
|
224 |
-
*/
|
225 |
-
private function convert_group( $index ) {
|
226 |
-
switch ( $index ) {
|
227 |
-
case 11:
|
228 |
-
return " decillion";
|
229 |
-
case 10:
|
230 |
-
return " nonillion";
|
231 |
-
case 9:
|
232 |
-
return " octillion";
|
233 |
-
case 8:
|
234 |
-
return " septillion";
|
235 |
-
case 7:
|
236 |
-
return " sextillion";
|
237 |
-
case 6:
|
238 |
-
return " quintrillion";
|
239 |
-
case 5:
|
240 |
-
return " quadrillion";
|
241 |
-
case 4:
|
242 |
-
return " trillion";
|
243 |
-
case 3:
|
244 |
-
return " billion";
|
245 |
-
case 2:
|
246 |
-
return " million";
|
247 |
-
case 1:
|
248 |
-
return " thousand";
|
249 |
-
case 0:
|
250 |
-
return "";
|
251 |
-
}
|
252 |
-
}
|
253 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-carousel-slider-product.php
CHANGED
@@ -18,6 +18,11 @@
|
|
18 |
* @method products_by_tags()
|
19 |
*/
|
20 |
|
|
|
|
|
|
|
|
|
|
|
21 |
if ( ! class_exists( 'Carousel_Slider_Product' ) ):
|
22 |
|
23 |
class Carousel_Slider_Product {
|
@@ -26,8 +31,8 @@ if ( ! class_exists( 'Carousel_Slider_Product' ) ):
|
|
26 |
* Product carousel quick view
|
27 |
*/
|
28 |
public static function init() {
|
29 |
-
add_action( 'carousel_slider_after_shop_loop_item', array( __CLASS__, '
|
30 |
-
add_action( 'carousel_slider_after_shop_loop_item', array( __CLASS__, '
|
31 |
|
32 |
add_action( 'wp_ajax_carousel_slider_quick_view', array( __CLASS__, 'quick_view' ) );
|
33 |
add_action( 'wp_ajax_nopriv_carousel_slider_quick_view', array( __CLASS__, 'quick_view' ) );
|
@@ -37,15 +42,16 @@ if ( ! class_exists( 'Carousel_Slider_Product' ) ):
|
|
37 |
* Show YITH Wishlist button on product slider
|
38 |
*
|
39 |
* @param WC_Product $product
|
|
|
40 |
* @param $slider_id
|
41 |
*/
|
42 |
-
public static function wish_list_button( $product, $slider_id ) {
|
43 |
$_product_wish_list = get_post_meta( $slider_id, '_product_wishlist', true );
|
44 |
|
45 |
-
if ( version_compare( WC_VERSION, '2.7.0', '>=' ) ) {
|
46 |
$product_id = $product->get_id();
|
47 |
} else {
|
48 |
-
$product_id = $
|
49 |
}
|
50 |
|
51 |
if ( class_exists( 'YITH_WCWL' ) && $_product_wish_list == 'on' ) {
|
@@ -57,17 +63,18 @@ if ( ! class_exists( 'Carousel_Slider_Product' ) ):
|
|
57 |
* Show quick view button on product slider
|
58 |
*
|
59 |
* @param WC_Product $product
|
|
|
60 |
* @param $slider_id
|
61 |
*/
|
62 |
-
public static function quick_view_button( $product, $slider_id ) {
|
63 |
$_show_btn = get_post_meta( $slider_id, '_product_quick_view', true );
|
64 |
|
65 |
if ( $_show_btn == 'on' ) {
|
66 |
|
67 |
-
if ( version_compare( WC_VERSION, '2.7.0', '>=' ) ) {
|
68 |
$product_id = $product->get_id();
|
69 |
} else {
|
70 |
-
$product_id = $
|
71 |
}
|
72 |
|
73 |
wp_enqueue_script( 'magnific-popup' );
|
18 |
* @method products_by_tags()
|
19 |
*/
|
20 |
|
21 |
+
// If this file is called directly, abort.
|
22 |
+
if ( ! defined( 'WPINC' ) ) {
|
23 |
+
die;
|
24 |
+
}
|
25 |
+
|
26 |
if ( ! class_exists( 'Carousel_Slider_Product' ) ):
|
27 |
|
28 |
class Carousel_Slider_Product {
|
31 |
* Product carousel quick view
|
32 |
*/
|
33 |
public static function init() {
|
34 |
+
add_action( 'carousel_slider_after_shop_loop_item', array( __CLASS__, 'quick_view_button' ), 10, 3 );
|
35 |
+
add_action( 'carousel_slider_after_shop_loop_item', array( __CLASS__, 'wish_list_button' ), 12, 3 );
|
36 |
|
37 |
add_action( 'wp_ajax_carousel_slider_quick_view', array( __CLASS__, 'quick_view' ) );
|
38 |
add_action( 'wp_ajax_nopriv_carousel_slider_quick_view', array( __CLASS__, 'quick_view' ) );
|
42 |
* Show YITH Wishlist button on product slider
|
43 |
*
|
44 |
* @param WC_Product $product
|
45 |
+
* @param WP_Post $post
|
46 |
* @param $slider_id
|
47 |
*/
|
48 |
+
public static function wish_list_button( $product, $post, $slider_id ) {
|
49 |
$_product_wish_list = get_post_meta( $slider_id, '_product_wishlist', true );
|
50 |
|
51 |
+
if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.7.0', '>=' ) ) {
|
52 |
$product_id = $product->get_id();
|
53 |
} else {
|
54 |
+
$product_id = $post->ID;
|
55 |
}
|
56 |
|
57 |
if ( class_exists( 'YITH_WCWL' ) && $_product_wish_list == 'on' ) {
|
63 |
* Show quick view button on product slider
|
64 |
*
|
65 |
* @param WC_Product $product
|
66 |
+
* @param WP_Post $post
|
67 |
* @param $slider_id
|
68 |
*/
|
69 |
+
public static function quick_view_button( $product, $post, $slider_id ) {
|
70 |
$_show_btn = get_post_meta( $slider_id, '_product_quick_view', true );
|
71 |
|
72 |
if ( $_show_btn == 'on' ) {
|
73 |
|
74 |
+
if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.7.0', '>=' ) ) {
|
75 |
$product_id = $product->get_id();
|
76 |
} else {
|
77 |
+
$product_id = $post->ID;
|
78 |
}
|
79 |
|
80 |
wp_enqueue_script( 'magnific-popup' );
|
includes/class-carousel-slider-script.php
CHANGED
@@ -1,4 +1,9 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
if ( ! class_exists( 'Carousel_Slider_Script' ) ):
|
3 |
|
4 |
class Carousel_Slider_Script {
|
@@ -19,6 +24,9 @@ if ( ! class_exists( 'Carousel_Slider_Script' ) ):
|
|
19 |
}
|
20 |
|
21 |
public function __construct() {
|
|
|
|
|
|
|
22 |
add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ), 15 );
|
23 |
add_action( 'wp_footer', array( $this, 'inline_script' ), 30 );
|
24 |
|
@@ -26,43 +34,95 @@ if ( ! class_exists( 'Carousel_Slider_Script' ) ):
|
|
26 |
add_action( 'admin_footer', array( $this, 'gallery_url_template' ), 5 );
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
/**
|
30 |
* Load frontend scripts
|
31 |
*/
|
32 |
public function frontend_scripts() {
|
33 |
-
|
34 |
-
|
35 |
-
CAROUSEL_SLIDER_ASSETS . '/css/style.css',
|
36 |
-
array(),
|
37 |
-
CAROUSEL_SLIDER_VERSION,
|
38 |
-
'all'
|
39 |
-
);
|
40 |
-
wp_register_script(
|
41 |
-
'owl-carousel',
|
42 |
-
CAROUSEL_SLIDER_ASSETS . '/js/vendors/owl.carousel.min.js',
|
43 |
-
array( 'jquery' ),
|
44 |
-
'2.2.1',
|
45 |
-
true
|
46 |
-
);
|
47 |
-
wp_register_script(
|
48 |
-
'magnific-popup',
|
49 |
-
CAROUSEL_SLIDER_ASSETS . '/js/vendors/jquery.magnific-popup.min.js',
|
50 |
-
array(),
|
51 |
-
'1.1.0',
|
52 |
-
true
|
53 |
-
);
|
54 |
-
wp_register_script(
|
55 |
-
'carousel-slider-hero',
|
56 |
-
CAROUSEL_SLIDER_ASSETS . '/js/public/script.js',
|
57 |
-
array(),
|
58 |
-
CAROUSEL_SLIDER_VERSION,
|
59 |
-
true
|
60 |
-
);
|
61 |
-
|
62 |
-
if ( $this->should_load_scripts() ) {
|
63 |
-
wp_enqueue_style( 'carousel-slider' );
|
64 |
-
wp_enqueue_script( 'owl-carousel' );
|
65 |
}
|
|
|
|
|
|
|
66 |
}
|
67 |
|
68 |
/**
|
@@ -73,137 +133,91 @@ if ( ! class_exists( 'Carousel_Slider_Script' ) ):
|
|
73 |
public function admin_scripts( $hook ) {
|
74 |
global $post;
|
75 |
|
76 |
-
|
|
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
wp_enqueue_style( 'wp-color-picker' );
|
81 |
-
wp_enqueue_style(
|
82 |
-
'carousel-slider-admin',
|
83 |
-
CAROUSEL_SLIDER_ASSETS . '/css/admin.css',
|
84 |
-
array(),
|
85 |
-
CAROUSEL_SLIDER_VERSION,
|
86 |
-
'all'
|
87 |
-
);
|
88 |
-
wp_enqueue_script(
|
89 |
-
'select2',
|
90 |
-
CAROUSEL_SLIDER_ASSETS . '/js/vendors/select2.min.js',
|
91 |
-
array( 'jquery' ),
|
92 |
-
'4.0.3',
|
93 |
-
true
|
94 |
-
);
|
95 |
-
wp_enqueue_script(
|
96 |
-
'tip-tip',
|
97 |
-
CAROUSEL_SLIDER_ASSETS . '/js/vendors/jquery.tipTip.min.js',
|
98 |
-
array( 'jquery' ),
|
99 |
-
CAROUSEL_SLIDER_VERSION,
|
100 |
-
true
|
101 |
-
);
|
102 |
-
wp_enqueue_script(
|
103 |
-
'wp-color-picker-alpha',
|
104 |
-
CAROUSEL_SLIDER_ASSETS . '/js/vendors/wp-color-picker-alpha.min.js',
|
105 |
-
array( 'wp-color-picker' ),
|
106 |
-
'1.2.2',
|
107 |
-
true
|
108 |
-
);
|
109 |
-
wp_enqueue_script(
|
110 |
-
'carousel-slider-admin',
|
111 |
-
CAROUSEL_SLIDER_ASSETS . '/js/admin.min.js',
|
112 |
-
array(
|
113 |
-
'jquery',
|
114 |
-
'wp-color-picker-alpha',
|
115 |
-
'jquery-ui-accordion',
|
116 |
-
'jquery-ui-datepicker',
|
117 |
-
'jquery-ui-sortable',
|
118 |
-
'jquery-ui-tabs',
|
119 |
-
'tip-tip',
|
120 |
-
'select2'
|
121 |
-
),
|
122 |
-
CAROUSEL_SLIDER_VERSION,
|
123 |
-
true
|
124 |
-
);
|
125 |
-
}
|
126 |
}
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
* Load front end inline script
|
131 |
*/
|
132 |
public function inline_script() {
|
133 |
-
if ( $this->should_load_scripts() )
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
<path d="M6 15l5-5-5-5 1-2 7 7-7 7z"></path>
|
141 |
-
</symbol>
|
142 |
-
</svg>
|
143 |
-
<script type="text/javascript">
|
144 |
-
jQuery(document).ready(function ($) {
|
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 |
/**
|
1 |
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
|
7 |
if ( ! class_exists( 'Carousel_Slider_Script' ) ):
|
8 |
|
9 |
class Carousel_Slider_Script {
|
24 |
}
|
25 |
|
26 |
public function __construct() {
|
27 |
+
add_action( 'wp_loaded', array( $this, 'register_styles' ) );
|
28 |
+
add_action( 'wp_loaded', array( $this, 'register_scripts' ) );
|
29 |
+
|
30 |
add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ), 15 );
|
31 |
add_action( 'wp_footer', array( $this, 'inline_script' ), 30 );
|
32 |
|
34 |
add_action( 'admin_footer', array( $this, 'gallery_url_template' ), 5 );
|
35 |
}
|
36 |
|
37 |
+
public function register_styles() {
|
38 |
+
$suffix = ( defined( "SCRIPT_DEBUG" ) && SCRIPT_DEBUG ) ? '' : '.min';
|
39 |
+
|
40 |
+
$styles = array(
|
41 |
+
'carousel-slider' => array(
|
42 |
+
'src' => CAROUSEL_SLIDER_ASSETS . '/css/style.css',
|
43 |
+
'dependency' => array(),
|
44 |
+
'version' => CAROUSEL_SLIDER_VERSION,
|
45 |
+
'media' => 'all',
|
46 |
+
),
|
47 |
+
'carousel-slider-admin' => array(
|
48 |
+
'src' => CAROUSEL_SLIDER_ASSETS . '/css/admin.css',
|
49 |
+
'dependency' => array( 'wp-color-picker' ),
|
50 |
+
'version' => CAROUSEL_SLIDER_VERSION,
|
51 |
+
'media' => 'all',
|
52 |
+
),
|
53 |
+
);
|
54 |
+
|
55 |
+
foreach ( $styles as $handle => $style ) {
|
56 |
+
wp_register_style( $handle, $style['src'], $style['dependency'], $style['version'], $style['media'] );
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
public function register_scripts() {
|
61 |
+
$suffix = ( defined( "SCRIPT_DEBUG" ) && SCRIPT_DEBUG ) ? '' : '.min';
|
62 |
+
|
63 |
+
$scripts = array(
|
64 |
+
'select2' => array(
|
65 |
+
'src' => CAROUSEL_SLIDER_ASSETS . '/lib/select2/select2' . $suffix . '.js',
|
66 |
+
'dependency' => array( 'jquery' ),
|
67 |
+
'version' => '4.0.5',
|
68 |
+
'in_footer' => true,
|
69 |
+
),
|
70 |
+
'jquery-tiptip' => array(
|
71 |
+
'src' => CAROUSEL_SLIDER_ASSETS . '/lib/jquery-tiptip/jquery.tipTip' . $suffix . '.js',
|
72 |
+
'dependency' => array( 'jquery' ),
|
73 |
+
'version' => '1.3',
|
74 |
+
'in_footer' => true,
|
75 |
+
),
|
76 |
+
'wp-color-picker-alpha' => array(
|
77 |
+
'src' => CAROUSEL_SLIDER_ASSETS . '/lib/wp-color-picker-alpha/wp-color-picker-alpha' . $suffix . '.js',
|
78 |
+
'dependency' => array( 'jquery', 'wp-color-picker' ),
|
79 |
+
'version' => '2.1.3',
|
80 |
+
'in_footer' => true,
|
81 |
+
),
|
82 |
+
'carousel-slider-admin' => array(
|
83 |
+
'src' => CAROUSEL_SLIDER_ASSETS . '/js/admin' . $suffix . '.js',
|
84 |
+
'dependency' => array(
|
85 |
+
'jquery',
|
86 |
+
'select2',
|
87 |
+
'wp-color-picker-alpha',
|
88 |
+
'jquery-ui-accordion',
|
89 |
+
'jquery-ui-datepicker',
|
90 |
+
'jquery-ui-sortable',
|
91 |
+
'jquery-ui-tabs',
|
92 |
+
'jquery-tiptip',
|
93 |
+
),
|
94 |
+
'version' => CAROUSEL_SLIDER_VERSION,
|
95 |
+
'in_footer' => true,
|
96 |
+
),
|
97 |
+
'owl-carousel' => array(
|
98 |
+
'src' => CAROUSEL_SLIDER_ASSETS . '/lib/owl-carousel/owl.carousel' . $suffix . '.js',
|
99 |
+
'dependency' => array( 'jquery' ),
|
100 |
+
'version' => '2.2.1',
|
101 |
+
'in_footer' => true,
|
102 |
+
),
|
103 |
+
'magnific-popup' => array(
|
104 |
+
'src' => CAROUSEL_SLIDER_ASSETS . '/lib/magnific-popup/jquery.magnific-popup' . $suffix . '.js',
|
105 |
+
'dependency' => array( 'jquery' ),
|
106 |
+
'version' => '1.1.0',
|
107 |
+
'in_footer' => true,
|
108 |
+
),
|
109 |
+
);
|
110 |
+
|
111 |
+
foreach ( $scripts as $handle => $script ) {
|
112 |
+
wp_register_script( $handle, $script['src'], $script['dependency'], $script['version'], $script['in_footer'] );
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
/**
|
117 |
* Load frontend scripts
|
118 |
*/
|
119 |
public function frontend_scripts() {
|
120 |
+
if ( ! $this->should_load_scripts() ) {
|
121 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
}
|
123 |
+
|
124 |
+
wp_enqueue_style( 'carousel-slider' );
|
125 |
+
wp_enqueue_script( 'owl-carousel' );
|
126 |
}
|
127 |
|
128 |
/**
|
133 |
public function admin_scripts( $hook ) {
|
134 |
global $post;
|
135 |
|
136 |
+
$_is_carousel = is_a( $post, 'WP_Post' ) && ( 'carousels' == $post->post_type );
|
137 |
+
$_is_doc = ( 'carousels_page_carousel-slider-documentation' == $hook );
|
138 |
|
139 |
+
if ( ! $_is_carousel && ! $_is_doc ) {
|
140 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
+
|
143 |
+
wp_enqueue_media();
|
144 |
+
wp_enqueue_style( 'carousel-slider-admin' );
|
145 |
+
wp_enqueue_script( 'carousel-slider-admin' );
|
146 |
}
|
147 |
|
148 |
/**
|
149 |
* Load front end inline script
|
150 |
*/
|
151 |
public function inline_script() {
|
152 |
+
if ( ! $this->should_load_scripts() ) {
|
153 |
+
return;
|
154 |
+
}
|
155 |
+
?>
|
156 |
+
<script type="text/javascript">
|
157 |
+
(function ($) {
|
158 |
+
'use strict';
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
+
$('body').find('.carousel-slider').each(function () {
|
161 |
+
var _this = $(this);
|
162 |
+
var isVideo = _this.data('slide-type') === 'video-carousel';
|
163 |
+
var videoWidth = isVideo ? _this.data('video-width') : false;
|
164 |
+
var videoHeight = isVideo ? _this.data('video-height') : false;
|
165 |
+
var autoWidth = _this.data('auto-width');
|
166 |
+
var stagePadding = parseInt(_this.data('stage-padding'));
|
167 |
+
autoWidth = isVideo ? isVideo : autoWidth;
|
168 |
+
stagePadding = stagePadding > 0 ? stagePadding : 0;
|
169 |
|
170 |
+
if (jQuery().owlCarousel) {
|
171 |
+
_this.owlCarousel({
|
172 |
+
stagePadding: stagePadding,
|
173 |
+
nav: _this.data('nav'),
|
174 |
+
dots: _this.data('dots'),
|
175 |
+
margin: _this.data('margin'),
|
176 |
+
loop: _this.data('loop'),
|
177 |
+
autoplay: _this.data('autoplay'),
|
178 |
+
autoplayTimeout: _this.data('autoplay-timeout'),
|
179 |
+
autoplaySpeed: _this.data('autoplay-speed'),
|
180 |
+
autoplayHoverPause: _this.data('autoplay-hover-pause'),
|
181 |
+
slideBy: _this.data('slide-by'),
|
182 |
+
lazyLoad: _this.data('lazy-load'),
|
183 |
+
video: isVideo,
|
184 |
+
videoWidth: videoWidth,
|
185 |
+
videoHeight: videoHeight,
|
186 |
+
autoWidth: autoWidth,
|
187 |
+
navText: [
|
188 |
+
'<svg class="carousel-slider-nav-icon" viewBox="0 0 20 20"><path d="M14 5l-5 5 5 5-1 2-7-7 7-7z"></path></use></svg>',
|
189 |
+
'<svg class="carousel-slider-nav-icon" viewBox="0 0 20 20"><path d="M6 15l5-5-5-5 1-2 7 7-7 7z"></path></svg>'
|
190 |
+
],
|
191 |
+
responsive: {
|
192 |
+
320: {items: _this.data('colums-mobile')},
|
193 |
+
600: {items: _this.data('colums-small-tablet')},
|
194 |
+
768: {items: _this.data('colums-tablet')},
|
195 |
+
993: {items: _this.data('colums-small-desktop')},
|
196 |
+
1200: {items: _this.data('colums-desktop')},
|
197 |
+
1921: {items: _this.data('colums')}
|
198 |
+
}
|
199 |
+
});
|
200 |
+
}
|
201 |
|
202 |
+
if (jQuery().magnificPopup) {
|
203 |
+
var popupType = _this.data('slide-type') === 'product-carousel' ? 'ajax' : 'image';
|
204 |
+
var popupGallery = _this.data('slide-type') !== 'product-carousel';
|
205 |
+
$(this).find('.magnific-popup').magnificPopup({
|
206 |
+
type: popupType,
|
207 |
+
gallery: {
|
208 |
+
enabled: popupGallery
|
209 |
+
},
|
210 |
+
zoom: {
|
211 |
+
enabled: popupGallery,
|
212 |
+
duration: 300,
|
213 |
+
easing: 'ease-in-out'
|
214 |
+
}
|
215 |
+
});
|
216 |
+
}
|
|
|
217 |
});
|
218 |
+
})(jQuery);
|
219 |
+
</script>
|
220 |
+
<?php
|
221 |
}
|
222 |
|
223 |
/**
|
includes/class-carousel-slider-structured-data.php
CHANGED
@@ -20,17 +20,6 @@ if ( ! class_exists( 'Carousel_Slider_Structured_Data' ) ):
|
|
20 |
private $_image_data = array();
|
21 |
private $_post_data = array();
|
22 |
|
23 |
-
/**
|
24 |
-
* Constructor.
|
25 |
-
*/
|
26 |
-
public function __construct() {
|
27 |
-
add_action( 'carousel_slider_image_gallery_loop', array( $this, 'generate_image_data' ) );
|
28 |
-
add_action( 'carousel_slider_post_loop', array( $this, 'generate_post_data' ) );
|
29 |
-
add_action( 'carousel_slider_product_loop', array( $this, 'generate_product_data' ) );
|
30 |
-
// Output structured data.
|
31 |
-
add_action( 'wp_footer', array( $this, 'output_structured_data' ), 90 );
|
32 |
-
}
|
33 |
-
|
34 |
/**
|
35 |
* Ensures only one instance of this class is loaded or can be loaded.
|
36 |
*
|
@@ -44,6 +33,17 @@ if ( ! class_exists( 'Carousel_Slider_Structured_Data' ) ):
|
|
44 |
return self::$instance;
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
/**
|
48 |
* Outputs structured data.
|
49 |
*
|
@@ -288,18 +288,19 @@ if ( ! class_exists( 'Carousel_Slider_Structured_Data' ) ):
|
|
288 |
* Hooked into `carousel_slider_product_loop` action hook.
|
289 |
*
|
290 |
* @param WC_Product $product Product data (default: null).
|
|
|
291 |
*/
|
292 |
-
public function generate_product_data( $product
|
293 |
-
if ( !
|
294 |
-
|
295 |
}
|
296 |
|
297 |
-
if ( version_compare( WC_VERSION, "3.0.0", ">=" ) ) {
|
298 |
$name = $product->get_name();
|
299 |
$permalink = get_permalink( $product->get_id() );
|
300 |
} else {
|
301 |
-
$name = get_the_title( $
|
302 |
-
$permalink = get_permalink( $
|
303 |
}
|
304 |
|
305 |
$markup['@type'] = 'Product';
|
20 |
private $_image_data = array();
|
21 |
private $_post_data = array();
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
/**
|
24 |
* Ensures only one instance of this class is loaded or can be loaded.
|
25 |
*
|
33 |
return self::$instance;
|
34 |
}
|
35 |
|
36 |
+
/**
|
37 |
+
* Constructor.
|
38 |
+
*/
|
39 |
+
public function __construct() {
|
40 |
+
add_action( 'carousel_slider_image_gallery_loop', array( $this, 'generate_image_data' ) );
|
41 |
+
add_action( 'carousel_slider_post_loop', array( $this, 'generate_post_data' ) );
|
42 |
+
add_action( 'carousel_slider_product_loop', array( $this, 'generate_product_data' ), 10, 2 );
|
43 |
+
// Output structured data.
|
44 |
+
add_action( 'wp_footer', array( $this, 'output_structured_data' ), 90 );
|
45 |
+
}
|
46 |
+
|
47 |
/**
|
48 |
* Outputs structured data.
|
49 |
*
|
288 |
* Hooked into `carousel_slider_product_loop` action hook.
|
289 |
*
|
290 |
* @param WC_Product $product Product data (default: null).
|
291 |
+
* @param WP_Post $post
|
292 |
*/
|
293 |
+
public function generate_product_data( $product, $post ) {
|
294 |
+
if ( ! $product instanceof WC_Product ) {
|
295 |
+
return;
|
296 |
}
|
297 |
|
298 |
+
if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, "3.0.0", ">=" ) ) {
|
299 |
$name = $product->get_name();
|
300 |
$permalink = get_permalink( $product->get_id() );
|
301 |
} else {
|
302 |
+
$name = get_the_title( $post->ID );
|
303 |
+
$permalink = get_permalink( $post->ID );
|
304 |
}
|
305 |
|
306 |
$markup['@type'] = 'Product';
|
includes/functions-carousel-slider.php
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
2 |
|
3 |
if ( ! function_exists( 'carousel_slider_is_url' ) ) {
|
4 |
/**
|
@@ -432,13 +436,13 @@ if ( ! function_exists( 'carousel_slider_inline_style' ) ) {
|
|
432 |
|
433 |
if ( $_btn_1_type == 'stroke' ) {
|
434 |
echo "
|
435 |
-
#id-{$id} .cs-button-{$slide_id}-1 {
|
436 |
border: {$_btn_1_border_width} solid {$_btn_1_bg_color};
|
437 |
border-radius: {$_btn_1_border_radius};
|
438 |
background-color: transparent;
|
439 |
color: {$_btn_1_bg_color};
|
440 |
}
|
441 |
-
#id-{$id} .cs-button-{$slide_id}-1:hover {
|
442 |
border: {$_btn_1_border_width} solid {$_btn_1_bg_color};
|
443 |
background-color: {$_btn_1_bg_color};
|
444 |
color: {$_btn_1_color};
|
@@ -446,7 +450,7 @@ if ( ! function_exists( 'carousel_slider_inline_style' ) ) {
|
|
446 |
";
|
447 |
} else {
|
448 |
echo "
|
449 |
-
#id-{$id} .cs-button-{$slide_id}-1 {
|
450 |
background-color: {$_btn_1_bg_color};
|
451 |
border: {$_btn_1_border_width} solid {$_btn_1_bg_color};
|
452 |
border-radius: {$_btn_1_border_radius};
|
@@ -462,13 +466,13 @@ if ( ! function_exists( 'carousel_slider_inline_style' ) ) {
|
|
462 |
$_btn_2_border_radius = ! empty( $slide['button_two_border_radius'] ) ? esc_attr( $slide['button_two_border_radius'] ) : '3px';
|
463 |
if ( $_btn_2_type == 'stroke' ) {
|
464 |
echo "
|
465 |
-
#id-{$id} .cs-button-{$slide_id}-2 {
|
466 |
border: {$_btn_2_border_width} solid {$_btn_2_bg_color};
|
467 |
border-radius: {$_btn_2_border_radius};
|
468 |
background-color: transparent;
|
469 |
color: {$_btn_2_bg_color};
|
470 |
}
|
471 |
-
#id-{$id} .cs-button-{$slide_id}-2:hover {
|
472 |
border: {$_btn_2_border_width} solid {$_btn_2_bg_color};
|
473 |
background-color: {$_btn_2_bg_color};
|
474 |
color: {$_btn_2_color};
|
@@ -476,7 +480,7 @@ if ( ! function_exists( 'carousel_slider_inline_style' ) ) {
|
|
476 |
";
|
477 |
} else {
|
478 |
echo "
|
479 |
-
#id-{$id} .cs-button-{$slide_id}-2 {
|
480 |
background-color: {$_btn_2_bg_color};
|
481 |
border: {$_btn_2_border_width} solid {$_btn_2_bg_color};
|
482 |
border-radius: {$_btn_2_border_radius};
|
@@ -496,17 +500,25 @@ if ( ! function_exists( 'carousel_slider_slide_type' ) ) {
|
|
496 |
/**
|
497 |
* Get carousel slider available slide type
|
498 |
*
|
|
|
|
|
499 |
* @return array
|
500 |
*/
|
501 |
-
function carousel_slider_slide_type() {
|
502 |
-
|
503 |
-
'image-carousel',
|
504 |
-
'image-carousel-url',
|
505 |
-
'post-carousel',
|
506 |
-
'product-carousel',
|
507 |
-
'video-carousel',
|
508 |
-
'hero-banner-slider'
|
509 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
510 |
}
|
511 |
}
|
512 |
|
1 |
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
|
7 |
if ( ! function_exists( 'carousel_slider_is_url' ) ) {
|
8 |
/**
|
436 |
|
437 |
if ( $_btn_1_type == 'stroke' ) {
|
438 |
echo "
|
439 |
+
#id-{$id} .cs-hero-button-{$slide_id}-1 {
|
440 |
border: {$_btn_1_border_width} solid {$_btn_1_bg_color};
|
441 |
border-radius: {$_btn_1_border_radius};
|
442 |
background-color: transparent;
|
443 |
color: {$_btn_1_bg_color};
|
444 |
}
|
445 |
+
#id-{$id} .cs-hero-button-{$slide_id}-1:hover {
|
446 |
border: {$_btn_1_border_width} solid {$_btn_1_bg_color};
|
447 |
background-color: {$_btn_1_bg_color};
|
448 |
color: {$_btn_1_color};
|
450 |
";
|
451 |
} else {
|
452 |
echo "
|
453 |
+
#id-{$id} .cs-hero-button-{$slide_id}-1 {
|
454 |
background-color: {$_btn_1_bg_color};
|
455 |
border: {$_btn_1_border_width} solid {$_btn_1_bg_color};
|
456 |
border-radius: {$_btn_1_border_radius};
|
466 |
$_btn_2_border_radius = ! empty( $slide['button_two_border_radius'] ) ? esc_attr( $slide['button_two_border_radius'] ) : '3px';
|
467 |
if ( $_btn_2_type == 'stroke' ) {
|
468 |
echo "
|
469 |
+
#id-{$id} .cs-hero-button-{$slide_id}-2 {
|
470 |
border: {$_btn_2_border_width} solid {$_btn_2_bg_color};
|
471 |
border-radius: {$_btn_2_border_radius};
|
472 |
background-color: transparent;
|
473 |
color: {$_btn_2_bg_color};
|
474 |
}
|
475 |
+
#id-{$id} .cs-hero-button-{$slide_id}-2:hover {
|
476 |
border: {$_btn_2_border_width} solid {$_btn_2_bg_color};
|
477 |
background-color: {$_btn_2_bg_color};
|
478 |
color: {$_btn_2_color};
|
480 |
";
|
481 |
} else {
|
482 |
echo "
|
483 |
+
#id-{$id} .cs-hero-button-{$slide_id}-2 {
|
484 |
background-color: {$_btn_2_bg_color};
|
485 |
border: {$_btn_2_border_width} solid {$_btn_2_bg_color};
|
486 |
border-radius: {$_btn_2_border_radius};
|
500 |
/**
|
501 |
* Get carousel slider available slide type
|
502 |
*
|
503 |
+
* @param bool $key_only
|
504 |
+
*
|
505 |
* @return array
|
506 |
*/
|
507 |
+
function carousel_slider_slide_type( $key_only = true ) {
|
508 |
+
$types = apply_filters( 'carousel_slider_slide_type', array(
|
509 |
+
'image-carousel' => __( 'Image Carousel', 'carousel-slider' ),
|
510 |
+
'image-carousel-url' => __( 'Image Carousel (URL)', 'carousel-slider' ),
|
511 |
+
'post-carousel' => __( 'Post Carousel', 'carousel-slider' ),
|
512 |
+
'product-carousel' => __( 'Product Carousel', 'carousel-slider' ),
|
513 |
+
'video-carousel' => __( 'Video Carousel', 'carousel-slider' ),
|
514 |
+
'hero-banner-slider' => __( 'Hero Carousel', 'carousel-slider' ),
|
515 |
+
) );
|
516 |
+
|
517 |
+
if ( $key_only ) {
|
518 |
+
return array_keys( $types );
|
519 |
+
}
|
520 |
+
|
521 |
+
return $types;
|
522 |
}
|
523 |
}
|
524 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: woocommerce, shortcode, images, carousel, carousel slider, image carousel,
|
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 4.9
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 1.8.
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
10 |
|
@@ -15,15 +15,15 @@ Create SEO friendly Image, Logo, Video, Post, WooCommerce Product Carousel and S
|
|
15 |
**Create SEO friendly Image, Logo, Video, Post, WooCommerce Product Carousel and Slider.**
|
16 |
Carousel Slider is a touch enabled WordPress plugin that lets you create highly customizable, stylish responsive carousel slider. With Carousel Slider, you can create image carousel using media gallery or custom url, post carousel, video carousel. We have integrated [Owl Carousel 2](http://www.owlcarousel.owlgraphic.com/) into our plugin for the ultimate device support.
|
17 |
|
18 |
-
|
19 |
> Looking for a free minimal WordPress theme. Try [Shapla](https://wordpress.org/themes/shapla/)
|
20 |
|
|
|
21 |
**If you like this plugin, please give us [5 star](https://wordpress.org/support/plugin/carousel-slider/reviews/?rate=5#new-post) to encourage for future improvement.**
|
22 |
|
23 |
|
24 |
-
> What's new in version 1.8
|
25 |
|
26 |
-
> **Hero Banner Slider
|
27 |
> More control over Arrow Navigation
|
28 |
> More control over Bullet/Dot Navigation
|
29 |
> Alpha color picker for choosing color
|
@@ -119,6 +119,14 @@ Now you can use the following function at your theme template file replacing `YO
|
|
119 |
|
120 |
== Changelog ==
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
= version 1.8.2 - 2017-11-03 =
|
123 |
* Fixed - Fixed color overlapping issue on WordPress 3.9
|
124 |
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 4.9
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 1.8.3
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
10 |
|
15 |
**Create SEO friendly Image, Logo, Video, Post, WooCommerce Product Carousel and Slider.**
|
16 |
Carousel Slider is a touch enabled WordPress plugin that lets you create highly customizable, stylish responsive carousel slider. With Carousel Slider, you can create image carousel using media gallery or custom url, post carousel, video carousel. We have integrated [Owl Carousel 2](http://www.owlcarousel.owlgraphic.com/) into our plugin for the ultimate device support.
|
17 |
|
|
|
18 |
> Looking for a free minimal WordPress theme. Try [Shapla](https://wordpress.org/themes/shapla/)
|
19 |
|
20 |
+
|
21 |
**If you like this plugin, please give us [5 star](https://wordpress.org/support/plugin/carousel-slider/reviews/?rate=5#new-post) to encourage for future improvement.**
|
22 |
|
23 |
|
24 |
+
> What's new in version 1.8?
|
25 |
|
26 |
+
> **Hero Banner Slider** with background image, title, description, call to action buttons and more
|
27 |
> More control over Arrow Navigation
|
28 |
> More control over Bullet/Dot Navigation
|
29 |
> Alpha color picker for choosing color
|
119 |
|
120 |
== Changelog ==
|
121 |
|
122 |
+
= version 1.8.3 - 2017-12-08 =
|
123 |
+
* Added - Background Overlay color for hero carousel.
|
124 |
+
* Added - Ken Burns Effect for hero carousel.
|
125 |
+
* Tweak - Update hero carousel style.
|
126 |
+
* Removed - Heading and Description background color.
|
127 |
+
* Dev - Load non-minified version when script debug is enabled.
|
128 |
+
* Dev - Update core code.
|
129 |
+
|
130 |
= version 1.8.2 - 2017-11-03 =
|
131 |
* Fixed - Fixed color overlapping issue on WordPress 3.9
|
132 |
|
shortcodes/class-carousel-slider-deprecated-shortcode.php
CHANGED
@@ -151,7 +151,7 @@ if ( ! class_exists( 'Carousel_Slider_Deprecated_Shortcode' ) ):
|
|
151 |
), $attributes ) );
|
152 |
|
153 |
if ( ! $this->is_valid_url( $img_link ) ) {
|
154 |
-
return;
|
155 |
}
|
156 |
|
157 |
if ( $this->is_valid_url( $href ) ) {
|
151 |
), $attributes ) );
|
152 |
|
153 |
if ( ! $this->is_valid_url( $img_link ) ) {
|
154 |
+
return '';
|
155 |
}
|
156 |
|
157 |
if ( $this->is_valid_url( $href ) ) {
|
shortcodes/class-carousel-slider-shortcode.php
CHANGED
@@ -33,11 +33,10 @@ if ( ! class_exists( 'Carousel_Slider_Shortcode' ) ):
|
|
33 |
* A shortcode for rendering the carousel slide.
|
34 |
*
|
35 |
* @param array $attributes Shortcode attributes.
|
36 |
-
* @param string $content The text content for shortcode. Not used.
|
37 |
*
|
38 |
* @return string The shortcode output
|
39 |
*/
|
40 |
-
public function carousel_slide( $attributes
|
41 |
if ( empty( $attributes['id'] ) ) {
|
42 |
return '';
|
43 |
}
|
@@ -109,13 +108,12 @@ if ( ! class_exists( 'Carousel_Slider_Shortcode' ) ):
|
|
109 |
|
110 |
if ( $slide_type == 'hero-banner-slider' ) {
|
111 |
|
112 |
-
wp_enqueue_script( 'carousel-slider-hero' );
|
113 |
ob_start();
|
114 |
require CAROUSEL_SLIDER_TEMPLATES . '/public/hero-banner-slider.php';
|
115 |
$html = ob_get_contents();
|
116 |
ob_end_clean();
|
117 |
|
118 |
-
return apply_filters( '
|
119 |
}
|
120 |
|
121 |
return '';
|
@@ -129,13 +127,11 @@ if ( ! class_exists( 'Carousel_Slider_Shortcode' ) ):
|
|
129 |
* @return array
|
130 |
*/
|
131 |
private function carousel_options( $id ) {
|
132 |
-
$
|
133 |
-
$
|
134 |
-
$
|
135 |
-
$
|
136 |
-
$
|
137 |
-
$_bullet_position = get_post_meta( $id, '_bullet_position', true );
|
138 |
-
$_bullet_shape = get_post_meta( $id, '_bullet_shape', true );
|
139 |
|
140 |
$class = 'owl-carousel carousel-slider';
|
141 |
|
@@ -258,7 +254,7 @@ if ( ! class_exists( 'Carousel_Slider_Shortcode' ) ):
|
|
258 |
*/
|
259 |
public function video_url( $url ) {
|
260 |
if ( ! $this->is_valid_url( $url ) ) {
|
261 |
-
return;
|
262 |
}
|
263 |
|
264 |
$url = esc_url( $url );
|
@@ -271,7 +267,7 @@ if ( ! class_exists( 'Carousel_Slider_Shortcode' ) ):
|
|
271 |
return '<div class="item-video"><a class="owl-video" href="' . $url . '"></a></div>';
|
272 |
}
|
273 |
|
274 |
-
return;
|
275 |
}
|
276 |
|
277 |
/**
|
33 |
* A shortcode for rendering the carousel slide.
|
34 |
*
|
35 |
* @param array $attributes Shortcode attributes.
|
|
|
36 |
*
|
37 |
* @return string The shortcode output
|
38 |
*/
|
39 |
+
public function carousel_slide( $attributes ) {
|
40 |
if ( empty( $attributes['id'] ) ) {
|
41 |
return '';
|
42 |
}
|
108 |
|
109 |
if ( $slide_type == 'hero-banner-slider' ) {
|
110 |
|
|
|
111 |
ob_start();
|
112 |
require CAROUSEL_SLIDER_TEMPLATES . '/public/hero-banner-slider.php';
|
113 |
$html = ob_get_contents();
|
114 |
ob_end_clean();
|
115 |
|
116 |
+
return apply_filters( 'Carousel_Slider_Hero_Carousel', $html, $id );
|
117 |
}
|
118 |
|
119 |
return '';
|
127 |
* @return array
|
128 |
*/
|
129 |
private function carousel_options( $id ) {
|
130 |
+
$_nav_button = get_post_meta( $id, '_nav_button', true );
|
131 |
+
$_arrow_position = get_post_meta( $id, '_arrow_position', true );
|
132 |
+
$_dot_nav = get_post_meta( $id, '_dot_nav', true );
|
133 |
+
$_bullet_position = get_post_meta( $id, '_bullet_position', true );
|
134 |
+
$_bullet_shape = get_post_meta( $id, '_bullet_shape', true );
|
|
|
|
|
135 |
|
136 |
$class = 'owl-carousel carousel-slider';
|
137 |
|
254 |
*/
|
255 |
public function video_url( $url ) {
|
256 |
if ( ! $this->is_valid_url( $url ) ) {
|
257 |
+
return '';
|
258 |
}
|
259 |
|
260 |
$url = esc_url( $url );
|
267 |
return '<div class="item-video"><a class="owl-video" href="' . $url . '"></a></div>';
|
268 |
}
|
269 |
|
270 |
+
return '';
|
271 |
}
|
272 |
|
273 |
/**
|
templates/admin/autoplay.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="open" class="shapla-toggle shapla-toggle--stroke">
|
2 |
<span class="shapla-toggle-title">
|
3 |
<?php esc_html_e( 'Autoplay Settings', 'carousel-slider' ); ?>
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="open" class="shapla-toggle shapla-toggle--stroke">
|
8 |
<span class="shapla-toggle-title">
|
9 |
<?php esc_html_e( 'Autoplay Settings', 'carousel-slider' ); ?>
|
templates/admin/documentation.php
CHANGED
@@ -4,55 +4,9 @@ if ( ! defined( 'WPINC' ) ) {
|
|
4 |
die;
|
5 |
}
|
6 |
?>
|
7 |
-
<style type="text/css">
|
8 |
-
.carousel_slider_iframe {
|
9 |
-
position: relative;
|
10 |
-
padding-bottom: 56.25%; /* height / width * 100 */
|
11 |
-
padding-top: 25px;
|
12 |
-
height: 0;
|
13 |
-
}
|
14 |
-
|
15 |
-
.carousel_slider_iframe > iframe {
|
16 |
-
position: absolute;
|
17 |
-
top: 0;
|
18 |
-
left: 0;
|
19 |
-
width: 100%;
|
20 |
-
height: 100%;
|
21 |
-
}
|
22 |
-
|
23 |
-
.carousel_slider_columns {
|
24 |
-
display: flex;
|
25 |
-
flex-wrap: wrap;
|
26 |
-
box-sizing: border-box;
|
27 |
-
}
|
28 |
-
|
29 |
-
.carousel_slider_column {
|
30 |
-
flex: 0 0 100%;
|
31 |
-
padding: 1rem;
|
32 |
-
box-sizing: border-box;
|
33 |
-
}
|
34 |
-
|
35 |
-
@media screen and (min-width: 601px) {
|
36 |
-
.carousel_slider_column {
|
37 |
-
flex: 0 0 50%;
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
@media screen and (min-width: 1025px) {
|
42 |
-
.carousel_slider_column {
|
43 |
-
flex: 0 0 33.333333%;
|
44 |
-
}
|
45 |
-
}
|
46 |
-
|
47 |
-
@media screen and (min-width: 1400px) {
|
48 |
-
.carousel_slider_column {
|
49 |
-
flex: 0 0 25%;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
</style>
|
53 |
<div class="wrap">
|
54 |
<h1 class="wp-heading">
|
55 |
-
|
56 |
</h1>
|
57 |
<hr class="clear">
|
58 |
<div class="postbox">
|
4 |
die;
|
5 |
}
|
6 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
<div class="wrap">
|
8 |
<h1 class="wp-heading">
|
9 |
+
<?php esc_html_e( 'Carousel Slider Documentation', 'carousel-slider' ); ?>
|
10 |
</h1>
|
11 |
<hr class="clear">
|
12 |
<div class="postbox">
|
templates/admin/general.php
CHANGED
@@ -1,10 +1,14 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
2 |
|
3 |
$this->form->image_sizes( array(
|
4 |
'id' => esc_html__( '_image_size', 'carousel-slider' ),
|
5 |
'name' => esc_html__( 'Carousel Image size', 'carousel-slider' ),
|
6 |
'desc' => sprintf(
|
7 |
-
esc_html__( '
|
8 |
'<a target="_blank" href="' . get_admin_url() . 'options-media.php">', '</a>'
|
9 |
),
|
10 |
) );
|
1 |
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
|
7 |
$this->form->image_sizes( array(
|
8 |
'id' => esc_html__( '_image_size', 'carousel-slider' ),
|
9 |
'name' => esc_html__( 'Carousel Image size', 'carousel-slider' ),
|
10 |
'desc' => sprintf(
|
11 |
+
esc_html__( 'Choose "original uploaded image" for full size image or your desired image size for carousel image. You can change the default size for thumbnail, medium and large from %1$s Settings >> Media %2$s.', 'carousel-slider' ),
|
12 |
'<a target="_blank" href="' . get_admin_url() . 'options-media.php">', '</a>'
|
13 |
),
|
14 |
) );
|
templates/admin/hero-banner-slider.php
CHANGED
@@ -1,8 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="open" id="section_content_carousel" class="shapla-toggle shapla-toggle--stroke"
|
2 |
style="display: <?php echo $slide_type != 'hero-banner-slider' ? 'none' : 'block'; ?>">
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
<div class="shapla-toggle-inner">
|
7 |
<div class="shapla-toggle-content">
|
8 |
<button class="button carousel-slider__add-slide" data-post-id="<?php echo $post->ID; ?>">Add Slide</button>
|
@@ -18,40 +24,51 @@
|
|
18 |
|
19 |
// Get WordPress media upload URL
|
20 |
$upload_link = esc_url( get_upload_iframe_src( 'image', $post->ID ) );
|
21 |
-
$num_to_word = new Carousel_Slider_Number_To_Word;
|
22 |
|
23 |
if ( is_array( $content_sliders ) && count( $content_sliders ) > 0 ) {
|
24 |
$total_sliders = count( $content_sliders );
|
25 |
foreach ( $content_sliders as $slide_num => $content_slider ) {
|
26 |
-
$_to_word = str_replace( array( ' ', ' - ' ), '_', $num_to_word->convert( $slide_num ) );
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
// Slide Content
|
32 |
$_slide_heading = isset( $content_slider['slide_heading'] ) ? $content_slider['slide_heading'] : '';
|
33 |
$_slide_description = isset( $content_slider['slide_description'] ) ? $content_slider['slide_description'] : '';
|
34 |
// Slide Background
|
35 |
-
$_img_bg_position
|
36 |
-
$_img_bg_size
|
37 |
-
$_bg_color
|
38 |
-
$_img_id
|
39 |
-
$
|
40 |
-
$
|
|
|
|
|
41 |
// Slide Link
|
42 |
$_link_type = ! empty( $content_slider['link_type'] ) ? esc_attr( $content_slider['link_type'] ) : 'full';
|
43 |
$_slide_link = ! empty( $content_slider['slide_link'] ) ? esc_url( $content_slider['slide_link'] ) : '';
|
44 |
$_link_target = ! empty( $content_slider['link_target'] ) ? esc_attr( $content_slider['link_target'] ) : '_blank';
|
45 |
// Slide Style
|
46 |
$_content_alignment = ! empty( $content_slider['content_alignment'] ) ? esc_attr( $content_slider['content_alignment'] ) : 'left';
|
47 |
-
$_heading_font_size = ! empty( $content_slider['heading_font_size'] ) ? absint( $content_slider['heading_font_size'] ) : '
|
48 |
-
$_heading_gutter = ! empty( $content_slider['heading_gutter'] ) ? esc_attr( $content_slider['heading_gutter'] ) : '
|
49 |
$_heading_color = ! empty( $content_slider['heading_color'] ) ? esc_attr( $content_slider['heading_color'] ) : '#ffffff';
|
50 |
-
$
|
51 |
-
$
|
52 |
-
$_description_gutter = ! empty( $content_slider['description_gutter'] ) ? esc_attr( $content_slider['description_gutter'] ) : '1rem';
|
53 |
$_desc_color = ! empty( $content_slider['description_color'] ) ? esc_attr( $content_slider['description_color'] ) : '#ffffff';
|
54 |
-
$_desc_bg_color = ! empty( $content_slider['description_background_color'] ) ? esc_attr( $content_slider['description_background_color'] ) : '';
|
55 |
|
56 |
$_btn_1_text = ! empty( $content_slider['button_one_text'] ) ? esc_attr( $content_slider['button_one_text'] ) : '';
|
57 |
$_btn_1_url = ! empty( $content_slider['button_one_url'] ) ? esc_attr( $content_slider['button_one_url'] ) : '';
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="open" id="section_content_carousel" class="shapla-toggle shapla-toggle--stroke"
|
8 |
style="display: <?php echo $slide_type != 'hero-banner-slider' ? 'none' : 'block'; ?>">
|
9 |
+
<span class="shapla-toggle-title">
|
10 |
+
<?php esc_html_e( 'Hero Banner Slider', 'carousel-slider' ); ?>
|
11 |
+
</span>
|
12 |
<div class="shapla-toggle-inner">
|
13 |
<div class="shapla-toggle-content">
|
14 |
<button class="button carousel-slider__add-slide" data-post-id="<?php echo $post->ID; ?>">Add Slide</button>
|
24 |
|
25 |
// Get WordPress media upload URL
|
26 |
$upload_link = esc_url( get_upload_iframe_src( 'image', $post->ID ) );
|
|
|
27 |
|
28 |
if ( is_array( $content_sliders ) && count( $content_sliders ) > 0 ) {
|
29 |
$total_sliders = count( $content_sliders );
|
30 |
foreach ( $content_sliders as $slide_num => $content_slider ) {
|
|
|
31 |
|
32 |
+
$_all_bg_position = array(
|
33 |
+
'left top' => 'left top',
|
34 |
+
'left center' => 'left center',
|
35 |
+
'left bottom' => 'left bottom',
|
36 |
+
'center top' => 'center top',
|
37 |
+
'center center' => 'center', // Default
|
38 |
+
'center bottom' => 'center bottom',
|
39 |
+
'right top' => 'right top',
|
40 |
+
'right center' => 'right center',
|
41 |
+
'right bottom' => 'right bottom',
|
42 |
+
);
|
43 |
+
$_all_bg_size = array(
|
44 |
+
'auto' => 'auto',
|
45 |
+
'contain' => 'contain',
|
46 |
+
'cover' => 'cover', // Default
|
47 |
+
);
|
48 |
// Slide Content
|
49 |
$_slide_heading = isset( $content_slider['slide_heading'] ) ? $content_slider['slide_heading'] : '';
|
50 |
$_slide_description = isset( $content_slider['slide_description'] ) ? $content_slider['slide_description'] : '';
|
51 |
// Slide Background
|
52 |
+
$_img_bg_position = ! empty( $content_slider['img_bg_position'] ) ? esc_attr( $content_slider['img_bg_position'] ) : 'center center';
|
53 |
+
$_img_bg_size = ! empty( $content_slider['img_bg_size'] ) ? esc_attr( $content_slider['img_bg_size'] ) : 'cover';
|
54 |
+
$_bg_color = ! empty( $content_slider['bg_color'] ) ? esc_attr( $content_slider['bg_color'] ) : '';
|
55 |
+
$_img_id = ! empty( $content_slider['img_id'] ) ? absint( $content_slider['img_id'] ) : 0;
|
56 |
+
$_ken_burns_effect = ! empty( $content_slider['ken_burns_effect'] ) ? esc_attr( $content_slider['ken_burns_effect'] ) : '';
|
57 |
+
$_bg_overlay = ! empty( $content_slider['bg_overlay'] ) ? esc_attr( $content_slider['bg_overlay'] ) : '';
|
58 |
+
$_img_src = wp_get_attachment_image_src( $_img_id, 'full' );
|
59 |
+
$_have_img = is_array( $_img_src );
|
60 |
// Slide Link
|
61 |
$_link_type = ! empty( $content_slider['link_type'] ) ? esc_attr( $content_slider['link_type'] ) : 'full';
|
62 |
$_slide_link = ! empty( $content_slider['slide_link'] ) ? esc_url( $content_slider['slide_link'] ) : '';
|
63 |
$_link_target = ! empty( $content_slider['link_target'] ) ? esc_attr( $content_slider['link_target'] ) : '_blank';
|
64 |
// Slide Style
|
65 |
$_content_alignment = ! empty( $content_slider['content_alignment'] ) ? esc_attr( $content_slider['content_alignment'] ) : 'left';
|
66 |
+
$_heading_font_size = ! empty( $content_slider['heading_font_size'] ) ? absint( $content_slider['heading_font_size'] ) : '40';
|
67 |
+
$_heading_gutter = ! empty( $content_slider['heading_gutter'] ) ? esc_attr( $content_slider['heading_gutter'] ) : '30px';
|
68 |
$_heading_color = ! empty( $content_slider['heading_color'] ) ? esc_attr( $content_slider['heading_color'] ) : '#ffffff';
|
69 |
+
$_desc_font_size = ! empty( $content_slider['description_font_size'] ) ? absint( $content_slider['description_font_size'] ) : '20';
|
70 |
+
$_description_gutter = ! empty( $content_slider['description_gutter'] ) ? esc_attr( $content_slider['description_gutter'] ) : '30px';
|
|
|
71 |
$_desc_color = ! empty( $content_slider['description_color'] ) ? esc_attr( $content_slider['description_color'] ) : '#ffffff';
|
|
|
72 |
|
73 |
$_btn_1_text = ! empty( $content_slider['button_one_text'] ) ? esc_attr( $content_slider['button_one_text'] ) : '';
|
74 |
$_btn_1_url = ! empty( $content_slider['button_one_url'] ) ? esc_attr( $content_slider['button_one_url'] ) : '';
|
templates/admin/images-media.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="open" id="section_images_settings" class="shapla-toggle shapla-toggle--stroke"
|
2 |
style="display: <?php echo $slide_type != 'image-carousel' ? 'none' : 'block'; ?>">
|
3 |
<span class="shapla-toggle-title">
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="open" id="section_images_settings" class="shapla-toggle shapla-toggle--stroke"
|
8 |
style="display: <?php echo $slide_type != 'image-carousel' ? 'none' : 'block'; ?>">
|
9 |
<span class="shapla-toggle-title">
|
templates/admin/images-settings.php
CHANGED
@@ -1,4 +1,11 @@
|
|
1 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<div data-id="open" id="section_images_general_settings" class="shapla-toggle shapla-toggle--stroke"
|
3 |
style="display: <?php echo ! $img_settings ? 'none' : 'block'; ?>">
|
4 |
<span class="shapla-toggle-title">
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
|
7 |
+
$img_settings = ( $slide_type == 'image-carousel' ) || ( $slide_type == 'image-carousel-url' ) ? true : false;
|
8 |
+
?>
|
9 |
<div data-id="open" id="section_images_general_settings" class="shapla-toggle shapla-toggle--stroke"
|
10 |
style="display: <?php echo ! $img_settings ? 'none' : 'block'; ?>">
|
11 |
<span class="shapla-toggle-title">
|
templates/admin/images-url.php
CHANGED
@@ -1,4 +1,9 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
$_images_urls = get_post_meta( $post->ID, '_images_urls', true );
|
3 |
$btn_text = $_images_urls ? 'Edit URLs' : 'Add URLs';
|
4 |
?>
|
1 |
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
|
7 |
$_images_urls = get_post_meta( $post->ID, '_images_urls', true );
|
8 |
$btn_text = $_images_urls ? 'Edit URLs' : 'Add URLs';
|
9 |
?>
|
templates/admin/navigation.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="open" class="shapla-toggle shapla-toggle--stroke">
|
2 |
<span class="shapla-toggle-title">
|
3 |
<?php esc_html_e( 'Navigation Settings', 'carousel-slider' ); ?>
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="open" class="shapla-toggle shapla-toggle--stroke">
|
8 |
<span class="shapla-toggle-title">
|
9 |
<?php esc_html_e( 'Navigation Settings', 'carousel-slider' ); ?>
|
templates/admin/parts/hero-banner/tab-background.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div id="carousel-slider-tab-background" class="shapla-tab tab-background">
|
2 |
<div class="slide_bg_wrapper">
|
3 |
<div class="slide-media-left">
|
@@ -51,12 +57,29 @@
|
|
51 |
</select>
|
52 |
</div>
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
<div class="slide_image_settings_line">
|
55 |
<span><?php esc_html_e( 'Background Color:', 'carousel-slider' ); ?></span>
|
56 |
<input type="text" name="carousel_slider_content[<?php echo $slide_num; ?>][bg_color]"
|
57 |
class="slide-color-picker" value="<?php echo $_bg_color; ?>"
|
58 |
data-alpha="true" data-default-color="rgba(255,255,255,0.5)">
|
59 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
</div>
|
61 |
|
62 |
</div>
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div id="carousel-slider-tab-background" class="shapla-tab tab-background">
|
8 |
<div class="slide_bg_wrapper">
|
9 |
<div class="slide-media-left">
|
57 |
</select>
|
58 |
</div>
|
59 |
|
60 |
+
<div class="slide_image_settings_line">
|
61 |
+
<span><?php esc_html_e( 'Ken Burns Effect:', 'carousel-slider' ); ?></span>
|
62 |
+
<select class="background_image_size"
|
63 |
+
name="carousel_slider_content[<?php echo $slide_num; ?>][ken_burns_effect]">
|
64 |
+
<option value="">None</option>
|
65 |
+
<option value="zoom-in" <?php selected( 'zoom-in', $_ken_burns_effect ); ?>>Zoom In</option>
|
66 |
+
<option value="zoom-out" <?php selected( 'zoom-out', $_ken_burns_effect ); ?>>Zoom Out</option>
|
67 |
+
</select>
|
68 |
+
</div>
|
69 |
+
|
70 |
<div class="slide_image_settings_line">
|
71 |
<span><?php esc_html_e( 'Background Color:', 'carousel-slider' ); ?></span>
|
72 |
<input type="text" name="carousel_slider_content[<?php echo $slide_num; ?>][bg_color]"
|
73 |
class="slide-color-picker" value="<?php echo $_bg_color; ?>"
|
74 |
data-alpha="true" data-default-color="rgba(255,255,255,0.5)">
|
75 |
</div>
|
76 |
+
|
77 |
+
<div class="slide_image_settings_line">
|
78 |
+
<span><?php esc_html_e( 'Background Overlay:', 'carousel-slider' ); ?></span>
|
79 |
+
<input type="text" name="carousel_slider_content[<?php echo $slide_num; ?>][bg_overlay]"
|
80 |
+
class="slide-color-picker" value="<?php echo $_bg_overlay; ?>"
|
81 |
+
data-alpha="true" data-default-color="rgba(0,0,0,0.5)">
|
82 |
+
</div>
|
83 |
</div>
|
84 |
|
85 |
</div>
|
templates/admin/parts/hero-banner/tab-content.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div id="carousel-slider-tab-content" class="shapla-tab tab-content">
|
2 |
|
3 |
<div class="sp-input-group" id="field-_slide_heading">
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div id="carousel-slider-tab-content" class="shapla-tab tab-content">
|
8 |
|
9 |
<div class="sp-input-group" id="field-_slide_heading">
|
templates/admin/parts/hero-banner/tab-link-button-one.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="closed" id="content_carousel_button_one" class="shapla-toggle shapla-toggle--stroke">
|
2 |
<span class="shapla-toggle-title">
|
3 |
<?php esc_html_e( 'Button #1', 'carousel-slider' ); ?>
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="closed" id="content_carousel_button_one" class="shapla-toggle shapla-toggle--stroke">
|
8 |
<span class="shapla-toggle-title">
|
9 |
<?php esc_html_e( 'Button #1', 'carousel-slider' ); ?>
|
templates/admin/parts/hero-banner/tab-link-button-two.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="closed" id="content_carousel_button_one" class="shapla-toggle shapla-toggle--stroke">
|
2 |
<span class="shapla-toggle-title">
|
3 |
<?php esc_html_e( 'Button #2', 'carousel-slider' ); ?>
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="closed" id="content_carousel_button_one" class="shapla-toggle shapla-toggle--stroke">
|
8 |
<span class="shapla-toggle-title">
|
9 |
<?php esc_html_e( 'Button #2', 'carousel-slider' ); ?>
|
templates/admin/parts/hero-banner/tab-link.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div id="carousel-slider-tab-link" class="shapla-tab tab-content-link">
|
2 |
|
3 |
<div class="sp-input-group" id="field-_link_type">
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div id="carousel-slider-tab-link" class="shapla-tab tab-content-link">
|
8 |
|
9 |
<div class="sp-input-group" id="field-_link_type">
|
templates/admin/parts/hero-banner/tab-style.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div id="carousel-slider-tab-style" class="shapla-tab tab-style">
|
2 |
|
3 |
<div class="sp-input-group" id="field-_content_alignment">
|
@@ -51,19 +57,6 @@
|
|
51 |
</div>
|
52 |
</div>
|
53 |
|
54 |
-
<div class="sp-input-group" id="field-_heading_background_color">
|
55 |
-
<div class="sp-input-label">
|
56 |
-
<label for="_heading_background_color"><?php esc_html_e( 'Heading Background Color', 'carousel-slider' ); ?></label>
|
57 |
-
<p class="sp-input-desc"><?php esc_html_e( 'If you would like a semi-transparent background behind your heading, Choose from here. If you would not like, leave it blank. Default: rgba(0,0,0, 0.4)', 'carousel-slider' ); ?></p>
|
58 |
-
</div>
|
59 |
-
<div class="sp-input-field">
|
60 |
-
<input type="text" id="_heading_background_color"
|
61 |
-
class="color-picker" data-alpha="true"
|
62 |
-
data-default-color="rgba(0,0,0, 0.4)" value="<?php echo $_heading_bg_color; ?>"
|
63 |
-
name="carousel_slider_content[<?php echo $slide_num; ?>][heading_background_color]">
|
64 |
-
</div>
|
65 |
-
</div>
|
66 |
-
|
67 |
<div class="sp-input-group" id="field-_description_font_size">
|
68 |
<div class="sp-input-label">
|
69 |
<label for="_description_font_size"><?php esc_html_e( 'Description Font Size', 'carousel-slider' ); ?></label>
|
@@ -100,18 +93,6 @@
|
|
100 |
</div>
|
101 |
</div>
|
102 |
|
103 |
-
<div class="sp-input-group" id="field-_description_background_color">
|
104 |
-
<div class="sp-input-label">
|
105 |
-
<label for="_description_background_color"><?php esc_html_e( 'Description Background Color', 'carousel-slider' ); ?></label>
|
106 |
-
<p class="sp-input-desc"><?php esc_html_e( 'If you would like a semi-transparent background behind your description, Choose from here. If you would not like, leave it blank. Default: rgba(0,0,0, 0.4)', 'carousel-slider' ); ?></p>
|
107 |
-
</div>
|
108 |
-
<div class="sp-input-field">
|
109 |
-
<input type="text" id="_description_background_color"
|
110 |
-
class="color-picker" data-alpha="true"
|
111 |
-
data-default-color="rgba(0,0,0, 0.4)" value="<?php echo $_desc_bg_color; ?>"
|
112 |
-
name="carousel_slider_content[<?php echo $slide_num; ?>][description_background_color]">
|
113 |
-
</div>
|
114 |
-
</div>
|
115 |
|
116 |
</div>
|
117 |
<!-- .tab-style -->
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div id="carousel-slider-tab-style" class="shapla-tab tab-style">
|
8 |
|
9 |
<div class="sp-input-group" id="field-_content_alignment">
|
57 |
</div>
|
58 |
</div>
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
<div class="sp-input-group" id="field-_description_font_size">
|
61 |
<div class="sp-input-label">
|
62 |
<label for="_description_font_size"><?php esc_html_e( 'Description Font Size', 'carousel-slider' ); ?></label>
|
93 |
</div>
|
94 |
</div>
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
</div>
|
98 |
<!-- .tab-style -->
|
templates/admin/post-carousel.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="open" id="section_post_query" class="shapla-toggle shapla-toggle--stroke"
|
2 |
style="display: <?php echo $slide_type != 'post-carousel' ? 'none' : 'block'; ?>">
|
3 |
<span class="shapla-toggle-title">
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="open" id="section_post_query" class="shapla-toggle shapla-toggle--stroke"
|
8 |
style="display: <?php echo $slide_type != 'post-carousel' ? 'none' : 'block'; ?>">
|
9 |
<span class="shapla-toggle-title">
|
templates/admin/product-carousel.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="open" id="section_product_query" class="shapla-toggle shapla-toggle--stroke"
|
2 |
style="display: <?php echo $slide_type != 'product-carousel' ? 'none' : 'block'; ?>">
|
3 |
<span class="shapla-toggle-title">
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="open" id="section_product_query" class="shapla-toggle shapla-toggle--stroke"
|
8 |
style="display: <?php echo $slide_type != 'product-carousel' ? 'none' : 'block'; ?>">
|
9 |
<span class="shapla-toggle-title">
|
templates/admin/responsive.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="open" class="shapla-toggle shapla-toggle--stroke">
|
2 |
<span class="shapla-toggle-title">
|
3 |
<?php esc_html_e( 'Responsive Settings', 'carousel-slider' ); ?>
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="open" class="shapla-toggle shapla-toggle--stroke">
|
8 |
<span class="shapla-toggle-title">
|
9 |
<?php esc_html_e( 'Responsive Settings', 'carousel-slider' ); ?>
|
templates/admin/types.php
CHANGED
@@ -1,3 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div class="sp-input-group" style="margin: 10px 0 30px;">
|
2 |
<div class="sp-input-label">
|
3 |
<label for="_carousel_slider_slide_type">
|
@@ -6,25 +13,19 @@
|
|
6 |
</div>
|
7 |
<div class="sp-input-field">
|
8 |
<select name="carousel_slider[_slide_type]" id="_carousel_slider_slide_type" class="sp-input-text">
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
<option value="product-carousel" <?php echo $slide_type == 'product-carousel' ? 'selected' : ''; ?> <?php echo $disabled; ?>>
|
23 |
-
<?php esc_html_e( 'WooCommerce Product Carousel', 'carousel-slider' ); ?>
|
24 |
-
</option>
|
25 |
-
<option value="hero-banner-slider"<?php echo $slide_type == 'hero-banner-slider' ? 'selected' : ''; ?>>
|
26 |
-
<?php esc_html_e( 'Hero Banner Slider (beta)', 'carousel-slider' ); ?>
|
27 |
-
</option>
|
28 |
</select>
|
29 |
</div>
|
30 |
</div>
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
$slide_types = carousel_slider_slide_type( false );
|
7 |
+
?>
|
8 |
<div class="sp-input-group" style="margin: 10px 0 30px;">
|
9 |
<div class="sp-input-label">
|
10 |
<label for="_carousel_slider_slide_type">
|
13 |
</div>
|
14 |
<div class="sp-input-field">
|
15 |
<select name="carousel_slider[_slide_type]" id="_carousel_slider_slide_type" class="sp-input-text">
|
16 |
+
<?php
|
17 |
+
foreach ( $slide_types as $slug => $label ) {
|
18 |
+
$selected = ( $slug == $slide_type ) ? 'selected' : '';
|
19 |
+
|
20 |
+
if ( 'product-carousel' == $slug ) {
|
21 |
+
$disabled = carousel_slider_is_woocommerce_active() ? '' : 'disabled';
|
22 |
+
echo '<option value="' . $slug . '" ' . $selected . ' ' . $disabled . '>' . $label . '</option>';
|
23 |
+
continue;
|
24 |
+
}
|
25 |
+
|
26 |
+
echo '<option value="' . $slug . '" ' . $selected . '>' . $label . '</option>';
|
27 |
+
}
|
28 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
</select>
|
30 |
</div>
|
31 |
</div>
|
templates/admin/video-carousel.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div data-id="open" id="section_video_settings" class="shapla-toggle shapla-toggle--stroke"
|
2 |
style="display: <?php echo $slide_type != 'video-carousel' ? 'none' : 'block'; ?>">
|
3 |
<span class="shapla-toggle-title">
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
?>
|
7 |
<div data-id="open" id="section_video_settings" class="shapla-toggle shapla-toggle--stroke"
|
8 |
style="display: <?php echo $slide_type != 'video-carousel' ? 'none' : 'block'; ?>">
|
9 |
<span class="shapla-toggle-title">
|
templates/public/hero-banner-slider.php
CHANGED
@@ -8,34 +8,16 @@ $content_sliders = get_post_meta( $id, '_content_slider', true );
|
|
8 |
$settings = get_post_meta( $id, '_content_slider_settings', true );
|
9 |
$_lazy_load_image = get_post_meta( $id, '_lazy_load_image', true );
|
10 |
$_be_lazy = in_array( $_lazy_load_image, array( 'on', 'off' ) ) ? $_lazy_load_image : 'on';
|
|
|
|
|
11 |
?>
|
12 |
<div class="carousel-slider-outer carousel-slider-outer-contents carousel-slider-outer-<?php echo $id; ?>">
|
13 |
<?php carousel_slider_inline_style( $id ); ?>
|
14 |
-
<div <?php echo
|
15 |
<?php
|
16 |
foreach ( $content_sliders as $slide_id => $slide ):
|
17 |
|
18 |
-
|
19 |
-
$_slide_heading = isset( $slide['slide_heading'] ) ? $slide['slide_heading'] : '';
|
20 |
-
$_slide_description = isset( $slide['slide_description'] ) ? $slide['slide_description'] : '';
|
21 |
-
// Slide Style
|
22 |
-
$_content_alignment = ! empty( $slide['content_alignment'] ) ? esc_attr( $slide['content_alignment'] ) : 'left';
|
23 |
-
$_heading_font_size = ! empty( $slide['heading_font_size'] ) ? esc_attr( $slide['heading_font_size'] ) : '60px';
|
24 |
-
$_heading_gutter = ! empty( $slide['heading_gutter'] ) ? esc_attr( $slide['heading_gutter'] ) : '1rem';
|
25 |
-
$_heading_color = ! empty( $slide['heading_color'] ) ? esc_attr( $slide['heading_color'] ) : '#ffffff';
|
26 |
-
$_heading_bg_color = ! empty( $slide['heading_background_color'] ) ? esc_attr( $slide['heading_background_color'] ) : '';
|
27 |
-
$_desc_font_size = ! empty( $slide['description_font_size'] ) ? esc_attr( $slide['description_font_size'] ) : '24px';
|
28 |
-
$_description_gutter = ! empty( $slide['description_gutter'] ) ? esc_attr( $slide['description_gutter'] ) : '1rem';
|
29 |
-
$_desc_color = ! empty( $slide['description_color'] ) ? esc_attr( $slide['description_color'] ) : '#ffffff';
|
30 |
-
$_desc_bg_color = ! empty( $slide['description_background_color'] ) ? esc_attr( $slide['description_background_color'] ) : '';
|
31 |
-
|
32 |
-
// Slide Background
|
33 |
-
$_img_bg_position = ! empty( $slide['img_bg_position'] ) ? esc_attr( $slide['img_bg_position'] ) : 'center center';
|
34 |
-
$_img_bg_size = ! empty( $slide['img_bg_size'] ) ? esc_attr( $slide['img_bg_size'] ) : 'contain';
|
35 |
-
$_bg_color = ! empty( $slide['bg_color'] ) ? esc_attr( $slide['bg_color'] ) : '';
|
36 |
-
$_img_id = ! empty( $slide['img_id'] ) ? absint( $slide['img_id'] ) : 0;
|
37 |
-
$_img_src = wp_get_attachment_image_src( $_img_id, 'full' );
|
38 |
-
$_have_img = is_array( $_img_src );
|
39 |
|
40 |
$_link_type = isset( $slide['link_type'] ) && in_array( $slide['link_type'],
|
41 |
array( 'full', 'button' ) ) ? $slide['link_type'] : 'full';
|
@@ -43,42 +25,60 @@ $_be_lazy = in_array( $_lazy_load_image, array( 'on', 'off' ) ) ? $_lazy
|
|
43 |
$_link_target = ! empty( $slide['link_target'] ) && in_array( $slide['link_target'],
|
44 |
array( '_self', '_blank' ) ) ? esc_url( $slide['link_target'] ) : '_self';
|
45 |
|
46 |
-
|
47 |
-
$
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
// Slide
|
56 |
-
$
|
57 |
-
$
|
58 |
-
$
|
59 |
-
$
|
60 |
-
$
|
61 |
-
$
|
62 |
-
$
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
$
|
67 |
-
$
|
68 |
-
$
|
69 |
if ( $_have_img && $_be_lazy == 'off' ) {
|
70 |
-
$
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
-
|
|
|
|
|
76 |
if ( $_content_alignment == 'left' ) {
|
77 |
-
$
|
78 |
} elseif ( $_content_alignment == 'right' ) {
|
79 |
-
$
|
80 |
} else {
|
81 |
-
$
|
82 |
}
|
83 |
|
84 |
$slide_padding = isset( $settings['slide_padding'] ) && is_array( $settings['slide_padding'] ) ? $settings['slide_padding'] : array();
|
@@ -87,107 +87,89 @@ $_be_lazy = in_array( $_lazy_load_image, array( 'on', 'off' ) ) ? $_lazy
|
|
87 |
$_padding_bottom = isset( $slide_padding['bottom'] ) ? esc_attr( $slide_padding['bottom'] ) : '1rem';
|
88 |
$_padding_left = isset( $slide_padding['left'] ) ? esc_attr( $slide_padding['left'] ) : '3rem';
|
89 |
|
90 |
-
$
|
91 |
-
$
|
92 |
-
$content_style .= 'padding: ' . $_padding_top . ' ' . $_padding_right . ' ' . $_padding_bottom . ' ' . $_padding_left . '';
|
93 |
|
94 |
-
$html = '';
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
|
100 |
-
|
101 |
-
$html .= '<div class="carousel-slider__content owl-lazy" data-src="' . $_img_src[0] . '" id="slide-item-' . $id . '-' . $slide_id . '" style="' . $canvas_style . '">';
|
102 |
-
} else {
|
103 |
-
$html .= '<div class="carousel-slider__content" id="slide-item-' . $id . '-' . $slide_id . '" style="' . $canvas_style . '">';
|
104 |
}
|
105 |
-
$html .= '<div class="slide-content-inner" style="' . $content_inner_style . '">';
|
106 |
-
$html .= '<div class="slide-content" style="' . $content_style . '">';
|
107 |
-
|
108 |
-
// Slide heading
|
109 |
-
if ( $_slide_heading ) {
|
110 |
-
$heading_style = '';
|
111 |
-
$heading_wrapper_style = '';
|
112 |
-
$heading_style .= 'font-size: ' . $_heading_font_size . ';';
|
113 |
-
$heading_style .= 'color: ' . $_heading_color . ';';
|
114 |
-
if ( ! empty( $_heading_bg_color ) ) {
|
115 |
-
$heading_wrapper_style .= 'background-color: ' . $_heading_bg_color . ';';
|
116 |
-
$heading_wrapper_style .= 'padding: 0 1rem;';
|
117 |
-
}
|
118 |
|
119 |
-
|
|
|
120 |
|
121 |
-
|
122 |
-
$html .= '<div class="heading-title-wrapper" style="' . $heading_wrapper_style . '">';
|
123 |
-
$html .= '<h2 class="heading-title" data-font-size="' . absint( $_heading_font_size ) . '" style="' . $heading_style . '">' . wp_kses_post( $_slide_heading ) . "</h2>";
|
124 |
-
$html .= '</div>';
|
125 |
-
$html .= '</div>';
|
126 |
-
}
|
127 |
|
128 |
-
// Slide
|
129 |
-
|
130 |
-
$desc_style = '';
|
131 |
-
$desc_wrapper_style = '';
|
132 |
-
$desc_style .= 'font-size: ' . $_desc_font_size . ';';
|
133 |
-
$desc_style .= 'color: ' . $_desc_color . ';';
|
134 |
-
|
135 |
-
$desc_wrapper_style .= 'margin-bottom: ' . $_description_gutter . ';';
|
136 |
-
if ( ! empty( $_desc_bg_color ) ) {
|
137 |
-
$desc_wrapper_style .= 'background-color: ' . $_desc_bg_color . ';';
|
138 |
-
$desc_wrapper_style .= 'padding: 0 1rem;';
|
139 |
-
}
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
|
|
|
|
|
|
147 |
|
148 |
// Buttons
|
149 |
if ( $_link_type == 'button' ) {
|
150 |
-
$html .= '<div class="
|
151 |
-
|
152 |
// Slide Button #1
|
|
|
|
|
|
|
|
|
|
|
153 |
if ( carousel_slider_is_url( $_btn_1_url ) ) {
|
154 |
-
$_btn_1_class = 'button cs-button';
|
155 |
-
$_btn_1_class .= ' cs-button-' . $slide_id . '-1';
|
156 |
-
$_btn_1_class .= ' cs-button
|
157 |
-
$_btn_1_class .= ' cs-button
|
158 |
-
|
159 |
-
$html .= '<span class="
|
160 |
-
$html .= '<a class="' . $_btn_1_class . '"
|
161 |
-
$_btn_1_bg_color . '" data-btn-color="' . $_btn_1_color . '" href="' .
|
162 |
$_btn_1_url . '" target="' . $_btn_1_target . '">' . esc_attr( $_btn_1_text ) . "</a>";
|
163 |
$html .= '</span>';
|
164 |
}
|
|
|
165 |
// Slide Button #2
|
|
|
|
|
|
|
|
|
|
|
166 |
if ( carousel_slider_is_url( $_btn_2_url ) ) {
|
167 |
-
$_btn_2_class = 'button cs-button';
|
168 |
-
$_btn_2_class .= ' cs-button-' . $slide_id . '-2';
|
169 |
-
$_btn_2_class .= ' cs-button
|
170 |
-
$_btn_2_class .= ' cs-button
|
171 |
|
172 |
-
$html .= '<span class="
|
173 |
$html .= '<a class="' . $_btn_2_class . '" href="' . $_btn_2_url . '" target="' . $_btn_2_target . '">' . esc_attr( $_btn_2_text ) . "</a>";
|
174 |
$html .= '</span>';
|
175 |
}
|
176 |
-
|
177 |
-
$html .= '</div>';
|
178 |
}
|
179 |
|
180 |
-
$html .= '</div>'; // .
|
181 |
-
$html .= '</div>'; // .
|
182 |
-
$html .= '</div>'; // .carousel-slider__content
|
183 |
|
184 |
if ( $_link_type == 'full' && carousel_slider_is_url( $_slide_link ) ) {
|
185 |
-
$html .= '</a>';
|
|
|
|
|
186 |
}
|
187 |
|
188 |
echo apply_filters( 'carousel_slider_content', $html, $slide_id, $slide );
|
189 |
endforeach;
|
190 |
?>
|
191 |
-
|
192 |
</div>
|
193 |
-
</div>
|
8 |
$settings = get_post_meta( $id, '_content_slider_settings', true );
|
9 |
$_lazy_load_image = get_post_meta( $id, '_lazy_load_image', true );
|
10 |
$_be_lazy = in_array( $_lazy_load_image, array( 'on', 'off' ) ) ? $_lazy_load_image : 'on';
|
11 |
+
$slide_options = join( " ", $this->carousel_options( $id ) );
|
12 |
+
|
13 |
?>
|
14 |
<div class="carousel-slider-outer carousel-slider-outer-contents carousel-slider-outer-<?php echo $id; ?>">
|
15 |
<?php carousel_slider_inline_style( $id ); ?>
|
16 |
+
<div <?php echo $slide_options; ?>>
|
17 |
<?php
|
18 |
foreach ( $content_sliders as $slide_id => $slide ):
|
19 |
|
20 |
+
$html = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
$_link_type = isset( $slide['link_type'] ) && in_array( $slide['link_type'],
|
23 |
array( 'full', 'button' ) ) ? $slide['link_type'] : 'full';
|
25 |
$_link_target = ! empty( $slide['link_target'] ) && in_array( $slide['link_target'],
|
26 |
array( '_self', '_blank' ) ) ? esc_url( $slide['link_target'] ) : '_self';
|
27 |
|
28 |
+
$_cell_style = '';
|
29 |
+
$_cell_style .= isset( $settings['slide_height'] ) ? 'height: ' . $settings['slide_height'] . ';' : '';
|
30 |
+
|
31 |
+
if ( $_link_type == 'full' && carousel_slider_is_url( $_slide_link ) ) {
|
32 |
+
$html .= '<a class="carousel-slider-hero__cell" style="' . $_cell_style . '" href="' . $_slide_link . '" target="' . $_link_target . '">';
|
33 |
+
} else {
|
34 |
+
$html .= '<div class="carousel-slider-hero__cell" style="' . $_cell_style . '">';
|
35 |
+
}
|
36 |
+
|
37 |
+
// Slide Background
|
38 |
+
$_img_bg_position = ! empty( $slide['img_bg_position'] ) ? esc_attr( $slide['img_bg_position'] ) : 'center center';
|
39 |
+
$_img_bg_size = ! empty( $slide['img_bg_size'] ) ? esc_attr( $slide['img_bg_size'] ) : 'contain';
|
40 |
+
$_bg_color = ! empty( $slide['bg_color'] ) ? esc_attr( $slide['bg_color'] ) : '';
|
41 |
+
$_bg_overlay = ! empty( $slide['bg_overlay'] ) ? esc_attr( $slide['bg_overlay'] ) : '';
|
42 |
+
$_ken_burns_effect = ! empty( $slide['ken_burns_effect'] ) ? esc_attr( $slide['ken_burns_effect'] ) : '';
|
43 |
+
$_img_id = ! empty( $slide['img_id'] ) ? absint( $slide['img_id'] ) : 0;
|
44 |
+
$_img_src = wp_get_attachment_image_src( $_img_id, 'full' );
|
45 |
+
$_have_img = is_array( $_img_src );
|
46 |
+
|
47 |
+
// Slide background
|
48 |
+
$_slide_bg_style = '';
|
49 |
+
$_slide_bg_style .= 'background-position: ' . $_img_bg_position . ';';
|
50 |
+
$_slide_bg_style .= 'background-size: ' . $_img_bg_size . ';';
|
51 |
if ( $_have_img && $_be_lazy == 'off' ) {
|
52 |
+
$_slide_bg_style .= 'background-image: url(' . $_img_src[0] . ');';
|
53 |
+
}
|
54 |
+
if ( ! empty( $_bg_color ) ) {
|
55 |
+
$_slide_bg_style .= 'background-color: ' . $_bg_color . ';';
|
56 |
}
|
57 |
|
58 |
+
// Background class
|
59 |
+
$_slide_bg_class = 'carousel-slider-hero__cell__background';
|
60 |
+
|
61 |
+
if ( 'zoom-in' == $_ken_burns_effect ) {
|
62 |
+
$_slide_bg_class .= ' carousel-slider-hero-ken-in';
|
63 |
+
} elseif ( 'zoom-out' == $_ken_burns_effect ) {
|
64 |
+
$_slide_bg_class .= ' carousel-slider-hero-ken-out';
|
65 |
+
}
|
66 |
+
|
67 |
+
if ( $_be_lazy == 'on' ) {
|
68 |
+
$html .= '<div class="' . $_slide_bg_class . ' owl-lazy" data-src="' . $_img_src[0] . '" id="slide-item-' . $id . '-' . $slide_id . '" style="' . $_slide_bg_style . '"></div>';
|
69 |
+
} else {
|
70 |
+
$html .= '<div class="' . $_slide_bg_class . '" id="slide-item-' . $id . '-' . $slide_id . '" style="' . $_slide_bg_style . '"></div>';
|
71 |
+
}
|
72 |
|
73 |
+
// Cell Inner
|
74 |
+
$_content_alignment = ! empty( $slide['content_alignment'] ) ? esc_attr( $slide['content_alignment'] ) : 'left';
|
75 |
+
$_cell_inner_class = 'carousel-slider-hero__cell__inner carousel-slider--h-position-center';
|
76 |
if ( $_content_alignment == 'left' ) {
|
77 |
+
$_cell_inner_class .= ' carousel-slider--v-position-middle carousel-slider--text-left';
|
78 |
} elseif ( $_content_alignment == 'right' ) {
|
79 |
+
$_cell_inner_class .= ' carousel-slider--v-position-middle carousel-slider--text-right';
|
80 |
} else {
|
81 |
+
$_cell_inner_class .= ' carousel-slider--v-position-middle carousel-slider--text-center';
|
82 |
}
|
83 |
|
84 |
$slide_padding = isset( $settings['slide_padding'] ) && is_array( $settings['slide_padding'] ) ? $settings['slide_padding'] : array();
|
87 |
$_padding_bottom = isset( $slide_padding['bottom'] ) ? esc_attr( $slide_padding['bottom'] ) : '1rem';
|
88 |
$_padding_left = isset( $slide_padding['left'] ) ? esc_attr( $slide_padding['left'] ) : '3rem';
|
89 |
|
90 |
+
$_cell_inner_style = '';
|
91 |
+
$_cell_inner_style .= 'padding: ' . $_padding_top . ' ' . $_padding_right . ' ' . $_padding_bottom . ' ' . $_padding_left . '';
|
|
|
92 |
|
93 |
+
$html .= '<div class="' . $_cell_inner_class . '" style="' . $_cell_inner_style . '">';
|
94 |
|
95 |
+
// Background Overlay
|
96 |
+
if ( ! empty( $_bg_overlay ) ) {
|
97 |
+
$_bg_overlay_style = 'background-color: ' . $_bg_overlay . ';';
|
98 |
|
99 |
+
$html .= '<div class="carousel-slider-hero__cell__background_overlay" style="' . $_bg_overlay_style . '"></div>';
|
|
|
|
|
|
|
100 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
+
$_content_style = '';
|
103 |
+
$_content_style .= isset( $settings['content_width'] ) ? 'max-width: ' . $settings['content_width'] . ';' : '850px;';
|
104 |
|
105 |
+
$html .= '<div class="carousel-slider-hero__cell__content" style="' . $_content_style . '">';
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
+
// Slide Heading
|
108 |
+
$_slide_heading = isset( $slide['slide_heading'] ) ? $slide['slide_heading'] : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
+
$html .= '<div class="carousel-slider-hero__cell__heading">';
|
111 |
+
$html .= wp_kses_post( $_slide_heading );
|
112 |
+
$html .= '</div>'; // .carousel-slider-hero__cell__heading
|
113 |
+
|
114 |
+
$_slide_description = isset( $slide['slide_description'] ) ? $slide['slide_description'] : '';
|
115 |
+
|
116 |
+
$html .= '<div class="carousel-slider-hero__cell__description">';
|
117 |
+
$html .= wp_kses_post( $_slide_description );
|
118 |
+
$html .= '</div>'; // .carousel-slider-hero__cell__content
|
119 |
|
120 |
// Buttons
|
121 |
if ( $_link_type == 'button' ) {
|
122 |
+
$html .= '<div class="carousel-slider-hero__cell__buttons">';
|
123 |
+
|
124 |
// Slide Button #1
|
125 |
+
$_btn_1_text = ! empty( $slide['button_one_text'] ) ? esc_attr( $slide['button_one_text'] ) : '';
|
126 |
+
$_btn_1_url = ! empty( $slide['button_one_url'] ) ? esc_url( $slide['button_one_url'] ) : '';
|
127 |
+
$_btn_1_target = ! empty( $slide['button_one_target'] ) ? esc_attr( $slide['button_one_target'] ) : '_self';
|
128 |
+
$_btn_1_type = ! empty( $slide['button_one_type'] ) ? esc_attr( $slide['button_one_type'] ) : 'normal';
|
129 |
+
$_btn_1_size = ! empty( $slide['button_one_size'] ) ? esc_attr( $slide['button_one_size'] ) : 'medium';
|
130 |
if ( carousel_slider_is_url( $_btn_1_url ) ) {
|
131 |
+
$_btn_1_class = 'button cs-hero-button';
|
132 |
+
$_btn_1_class .= ' cs-hero-button-' . $slide_id . '-1';
|
133 |
+
$_btn_1_class .= ' cs-hero-button-' . $_btn_1_type;
|
134 |
+
$_btn_1_class .= ' cs-hero-button-' . $_btn_1_size;
|
135 |
+
|
136 |
+
$html .= '<span class="carousel-slider-hero__cell__button__one">';
|
137 |
+
$html .= '<a class="' . $_btn_1_class . '" href="' .
|
|
|
138 |
$_btn_1_url . '" target="' . $_btn_1_target . '">' . esc_attr( $_btn_1_text ) . "</a>";
|
139 |
$html .= '</span>';
|
140 |
}
|
141 |
+
|
142 |
// Slide Button #2
|
143 |
+
$_btn_2_text = ! empty( $slide['button_two_text'] ) ? esc_attr( $slide['button_two_text'] ) : '';
|
144 |
+
$_btn_2_url = ! empty( $slide['button_two_url'] ) ? esc_url( $slide['button_two_url'] ) : '';
|
145 |
+
$_btn_2_target = ! empty( $slide['button_two_target'] ) ? esc_attr( $slide['button_two_target'] ) : '_self';
|
146 |
+
$_btn_2_size = ! empty( $slide['button_two_size'] ) ? esc_attr( $slide['button_two_size'] ) : 'medium';
|
147 |
+
$_btn_2_type = ! empty( $slide['button_two_type'] ) ? esc_attr( $slide['button_two_type'] ) : 'normal';
|
148 |
if ( carousel_slider_is_url( $_btn_2_url ) ) {
|
149 |
+
$_btn_2_class = 'button cs-hero-button';
|
150 |
+
$_btn_2_class .= ' cs-hero-button-' . $slide_id . '-2';
|
151 |
+
$_btn_2_class .= ' cs-hero-button-' . $_btn_2_type;
|
152 |
+
$_btn_2_class .= ' cs-hero-button-' . $_btn_2_size;
|
153 |
|
154 |
+
$html .= '<span class="carousel-slider-hero__cell__button__two">';
|
155 |
$html .= '<a class="' . $_btn_2_class . '" href="' . $_btn_2_url . '" target="' . $_btn_2_target . '">' . esc_attr( $_btn_2_text ) . "</a>";
|
156 |
$html .= '</span>';
|
157 |
}
|
158 |
+
|
159 |
+
$html .= '</div>'; // .carousel-slider-hero__cell__button
|
160 |
}
|
161 |
|
162 |
+
$html .= '</div>'; // .carousel-slider-hero__cell__content
|
163 |
+
$html .= '</div>'; // .carousel-slider-hero__cell__inner
|
|
|
164 |
|
165 |
if ( $_link_type == 'full' && carousel_slider_is_url( $_slide_link ) ) {
|
166 |
+
$html .= '</a>'; // .carousel-slider-hero__cell
|
167 |
+
} else {
|
168 |
+
$html .= '</div>'; // .carousel-slider-hero__cell
|
169 |
}
|
170 |
|
171 |
echo apply_filters( 'carousel_slider_content', $html, $slide_id, $slide );
|
172 |
endforeach;
|
173 |
?>
|
|
|
174 |
</div>
|
175 |
+
</div>
|
templates/public/product-carousel-2.php
CHANGED
@@ -40,7 +40,7 @@ if ( ! carousel_slider_is_woocommerce_active() ) {
|
|
40 |
do_action( 'woocommerce_after_shop_loop_item_title' );
|
41 |
do_action( 'woocommerce_after_shop_loop_item' );
|
42 |
|
43 |
-
do_action( 'carousel_slider_after_shop_loop_item', $product, $id );
|
44 |
|
45 |
echo '</div>';
|
46 |
|
40 |
do_action( 'woocommerce_after_shop_loop_item_title' );
|
41 |
do_action( 'woocommerce_after_shop_loop_item' );
|
42 |
|
43 |
+
do_action( 'carousel_slider_after_shop_loop_item', $product, $post, $id );
|
44 |
|
45 |
echo '</div>';
|
46 |
|
templates/public/product-carousel.php
CHANGED
@@ -39,7 +39,7 @@ $_product_quick_view = get_post_meta( $id, '_product_quick_view', true );
|
|
39 |
<?php foreach ( $posts as $post ): setup_postdata( $post ); ?>
|
40 |
<?php
|
41 |
$product = wc_get_product( $post->ID );
|
42 |
-
do_action( 'carousel_slider_product_loop', $product );
|
43 |
?>
|
44 |
<div class="product carousel-slider__product">
|
45 |
<?php
|
39 |
<?php foreach ( $posts as $post ): setup_postdata( $post ); ?>
|
40 |
<?php
|
41 |
$product = wc_get_product( $post->ID );
|
42 |
+
do_action( 'carousel_slider_product_loop', $product, $post );
|
43 |
?>
|
44 |
<div class="product carousel-slider__product">
|
45 |
<?php
|
widgets/widget-carousel_slider.php
CHANGED
@@ -48,7 +48,7 @@ class Carousel_Slider_Widget extends WP_Widget {
|
|
48 |
*
|
49 |
* @param array $instance Current settings.
|
50 |
*
|
51 |
-
* @return
|
52 |
*/
|
53 |
public function form( $instance ) {
|
54 |
$carousels = $this->carousels_list();
|
@@ -122,8 +122,10 @@ class Carousel_Slider_Widget extends WP_Widget {
|
|
122 |
|
123 |
return $old_instance;
|
124 |
}
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
|
127 |
-
add_action( 'widgets_init',
|
128 |
-
register_widget( 'Carousel_Slider_Widget' );
|
129 |
-
} );
|
48 |
*
|
49 |
* @param array $instance Current settings.
|
50 |
*
|
51 |
+
* @return void
|
52 |
*/
|
53 |
public function form( $instance ) {
|
54 |
$carousels = $this->carousels_list();
|
122 |
|
123 |
return $old_instance;
|
124 |
}
|
125 |
+
|
126 |
+
public static function register() {
|
127 |
+
register_widget( __CLASS__ );
|
128 |
+
}
|
129 |
}
|
130 |
|
131 |
+
add_action( 'widgets_init', array( 'Carousel_Slider_Widget', 'register' ) );
|
|
|
|