Speed Booster Pack - Version 4.0.0

Version Description

Speed Booster Pack v4.0 is written from scratch! With the new options framework, your current options will be migrated to the new codebase but make sure you review your options after updating the plugin to the latest version.

Download this release

Release Info

Developer optimocha
Plugin Icon 128x128 Speed Booster Pack
Version 4.0.0
Comparing to
See all releases

Code changes from version 3.8.6 to 4.0.0

Files changed (95) hide show
  1. LICENSE.txt +339 -0
  2. README.txt +128 -0
  3. admin/class-speed-booster-pack-admin.php +953 -0
  4. admin/css/speed-booster-pack-admin.css +26 -0
  5. admin/images/icon.svg +1 -0
  6. admin/index.php +1 -0
  7. admin/js/speed-booster-pack-admin.js +32 -0
  8. advanced-cache.php +152 -0
  9. css/style.css +0 -489
  10. inc/class-sbp-utils.php +0 -20
  11. inc/core.php +0 -1187
  12. inc/css-optimizer.php +0 -234
  13. inc/helpers.php +0 -50
  14. inc/images/icon-128x128.jpg +0 -0
  15. inc/images/icon-16x16.png +0 -0
  16. inc/images/logo.png +0 -0
  17. inc/images/optimocha.png +0 -0
  18. inc/images/shortpixel.png +0 -0
  19. inc/images/wp-engine.png +0 -0
  20. inc/js/admin-scripts.js +0 -107
  21. inc/js/analytics.js +0 -73
  22. inc/js/inspage.js +0 -2
  23. inc/js/lazyload.js +0 -4
  24. inc/js/plugin-install.js +0 -55
  25. inc/settings.php +0 -174
  26. inc/template/analytics/google-analytics.php +0 -42
  27. inc/template/analytics/gtag.php +0 -27
  28. inc/template/analytics/gtm.php +0 -21
  29. inc/template/analytics/minimal-analytics.php +0 -28
  30. inc/template/notice.php +0 -32
  31. inc/template/notices/beta_testers.php +0 -5
  32. inc/template/notices/migrate_js_to_footer.php +0 -4
  33. inc/template/notices/translate.php +0 -8
  34. inc/template/options.php +0 -752
  35. includes/class-speed-booster-pack-activator.php +43 -0
  36. includes/class-speed-booster-pack-deactivator.php +50 -0
  37. includes/class-speed-booster-pack-i18n.php +47 -0
  38. includes/class-speed-booster-pack-loader.php +137 -0
  39. includes/class-speed-booster-pack.php +303 -0
  40. includes/classes/class-sbp-abstract-module.php +14 -0
  41. includes/classes/class-sbp-cache.php +691 -0
  42. includes/classes/class-sbp-cdn.php +83 -0
  43. includes/classes/class-sbp-cloudflare.php +116 -0
  44. includes/classes/class-sbp-compatibility-checker.php +150 -0
  45. includes/classes/class-sbp-css-minifier.php +213 -0
  46. includes/classes/class-sbp-custom-code-manager.php +61 -0
  47. {inc → includes/classes}/class-sbp-font-optimizer.php +29 -36
  48. inc/sbp-minifier.php → includes/classes/class-sbp-html-minifier.php +23 -50
  49. includes/classes/class-sbp-js-optimizer.php +301 -0
  50. includes/classes/class-sbp-lazy-loader.php +143 -0
  51. includes/classes/class-sbp-localize-tracker.php +171 -0
  52. includes/classes/class-sbp-migrator.php +214 -0
  53. {inc → includes/classes}/class-sbp-preboost.php +16 -64
  54. includes/classes/class-sbp-special.php +126 -0
  55. includes/classes/class-sbp-tweaks.php +309 -0
  56. includes/classes/class-sbp-utils.php +43 -0
  57. includes/index.php +1 -0
  58. includes/libs/announce4wp/announce4wp-client.php +159 -0
  59. includes/libs/codestar-framework/assets/css/style-rtl.css +585 -0
  60. includes/libs/codestar-framework/assets/css/style-rtl.min.css +1 -0
  61. includes/libs/codestar-framework/assets/css/style.css +4212 -0
  62. includes/libs/codestar-framework/assets/css/style.min.css +1 -0
  63. includes/libs/codestar-framework/assets/images/checkerboard.png +0 -0
  64. includes/libs/codestar-framework/assets/images/wp-logo.svg +1 -0
  65. includes/libs/codestar-framework/assets/images/wp-plugin-logo.svg +1 -0
  66. includes/libs/codestar-framework/assets/js/gutenberg.js +79 -0
  67. includes/libs/codestar-framework/assets/js/main.js +3321 -0
  68. includes/libs/codestar-framework/assets/js/main.min.js +3 -0
  69. includes/libs/codestar-framework/assets/js/plugins.js +2092 -0
  70. includes/libs/codestar-framework/assets/js/plugins.min.js +3 -0
  71. includes/libs/codestar-framework/assets/scss/style-rtl.scss +720 -0
  72. includes/libs/codestar-framework/assets/scss/style.scss +96 -0
  73. includes/libs/codestar-framework/assets/scss/vendor/_base.scss +461 -0
  74. includes/libs/codestar-framework/assets/scss/vendor/_chosen.scss +405 -0
  75. includes/libs/codestar-framework/assets/scss/vendor/_customizer.scss +179 -0
  76. includes/libs/codestar-framework/assets/scss/vendor/_fields.scss +2237 -0
  77. includes/libs/codestar-framework/assets/scss/vendor/_helper.scss +139 -0
  78. includes/libs/codestar-framework/assets/scss/vendor/_mixins.scss +3 -0
  79. includes/libs/codestar-framework/assets/scss/vendor/_modal.scss +330 -0
  80. includes/libs/codestar-framework/assets/scss/vendor/_navmenu.scss +60 -0
  81. includes/libs/codestar-framework/assets/scss/vendor/_profile.scss +67 -0
  82. includes/libs/codestar-framework/assets/scss/vendor/_responsive.scss +166 -0
  83. includes/libs/codestar-framework/assets/scss/vendor/_taxonomy.scss +114 -0
  84. includes/libs/codestar-framework/assets/scss/vendor/_themes.scss +223 -0
  85. includes/libs/codestar-framework/assets/scss/vendor/_welcome.scss +346 -0
  86. includes/libs/codestar-framework/assets/scss/vendor/_widget.scss +49 -0
  87. includes/libs/codestar-framework/classes/abstract.class.php +137 -0
  88. includes/libs/codestar-framework/classes/admin-options.class.php +717 -0
  89. includes/libs/codestar-framework/classes/comment-options.class.php +343 -0
  90. includes/libs/codestar-framework/classes/customize-options.class.php +280 -0
  91. includes/libs/codestar-framework/classes/fields.class.php +379 -0
  92. includes/libs/codestar-framework/classes/metabox-options.class.php +412 -0
  93. includes/libs/codestar-framework/classes/nav-menu-options.class.php +254 -0
  94. includes/libs/codestar-framework/classes/profile-options.class.php +244 -0
  95. includes/libs/codestar-framework/classes/setup.class.php +365 -0
LICENSE.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
README.txt ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Speed Booster Pack ⚡ PageSpeed Optimization Suite ===
2
+ Plugin Name: Speed Booster Pack ⚡ PageSpeed Optimization Suite
3
+ Contributors: optimocha, speedboosterpack
4
+ Tags: speed, pagespeed, optimization, performance, cache
5
+ Requires at least: 4.6
6
+ Tested up to: 5.5
7
+ Requires PHP: 5.6
8
+ Stable tag: 4.0.0
9
+ License: GPLv3 or later
10
+ License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
+
12
+ PageSpeed optimization is vital for SEO: A faster website equals better conversions. Optimize & cache your site with this smart plugin!
13
+
14
+ == Description ==
15
+
16
+ WordPress is, hands down, the most popular content management system in the world. But like all giants, WordPress gets bigger and bigger every release; and it needs you to stay healthy and fast. Otherwise, your website can get slower and nobody likes slow websites. *NOBODY*. Not only your visitors hate your website, but also search engines (especially Google) penalizes you and drop your search engine rankings.
17
+
18
+ Improving your site's speed will get you a better score on major speed testing services such as [Google PageSpeed](https://developers.google.com/speed/pagespeed/insights/), [GTmetrix](https://gtmetrix.com/), [Pingdom](https://tools.pingdom.com/), [WebPageTest](https://www.webpagetest.org/) and will also improve your overall site's usability. This will help Google and other search engines to rank your site higher in search results thus sending more traffic.
19
+
20
+ **Speed Booster Pack** is maintained & operated by **[Optimocha](https://optimocha.com/)**, a company that offers special speed optimization services filled with people who *obsess* about speed!
21
+
22
+ ### Benefits of Speed Booster Pack
23
+
24
+ Each second of delay can cause up to 20% loss in conversion rates ([source: Google](https://web.dev/why-speed-matters/)). "Conversion" means *converting* visitors to something more than a "visitor": leads, customers, subscribers, followers... you name it.
25
+
26
+ You might lose more than half of your visitors if your website loads **slower than three seconds**! ([source: Google again](https://www.blog.google/products/admanager/the-need-for-mobile-speed/)) More than half of your potential customers might get back to the search results page and navigate to your competitor. This is a huge problem, and it's hugely overlooked among other SEO-related concerns. People don't realize how important speed is, in the eyes of search engines.
27
+
28
+ That's where Speed Booster Pack comes in: With its ever-evolving codebase, Speed Booster Pack aims to increase your site performance, page load times and PageSpeed (Lighthouse) scores! Optimocha, the company behind Speed Booster Pack, has a team with a pathological obsession for speed; so you can be sure that your site will be in good hands.
29
+
30
+ ### How to optimize PageSpeed scores with Speed Booster Pack
31
+
32
+ With our huge set of features, of course!
33
+
34
+ 🌟 **Caching**: Cache your pages into static HTML files, reduce database queries, get a faster website almost immediately. What's not to love about caching?
35
+ ⭐ **Custom Code Manager**: Hey, you know that huge live chat widget, or the weird script that you really, *really* have to load? Well, you can probably delay them so the rest of the page can load first.
36
+ ⭐ **Optimize Google Fonts**: Did you know that there are better ways to load Google fonts? We like to brag about finding one of the best ways.
37
+ ⭐ **Localize Google Analytics & Tag Manager**: Tracker scripts aren't the worst things that'll slow your pages down, but they cause the most "recommendations". Localizing Google Analytics and/or Google Tag Manager is a good idea to speed up your website then, right? Right?
38
+ 🌟 **Lazy Load**: It's a disheartening issue that page speed tools encourage laziness... Just kidding, we love being lazy. And search engines will love your pages when you enable lazy loading for images, videos and iframes (except for the above-the-fold stuff, trust us).
39
+ 🌟 **Optimize JavaScript**: You know that totally-not-cryptic "Remove Render-Blocking JavaScript" recommendation? Speed Booster Pack can help defer them all until after the whole HTML is rendered, or at least move all scripts to footer. Works like a charm.
40
+ ⭐ **Optimize CSS**: Who needs all those different CSS files when you can inline them all into your page source? Especially when your CSS footprint is so small?
41
+ 🌟 **Preload Assets**: Have some fonts that load in all your pages, or a script, or some CSS files? Preloading them will help modern browsers serve your pages way faster!
42
+ ⭐ **Enable CDN**: Integrate your content delivery network to your website by rewriting all static asset URLs with your CDN domain.
43
+ ⭐ **Cloudflare Integration**: Connect to your Cloudflare account so you can clear your cache every time your page cache is cleared.
44
+ 🌟 **Plugin-specific Optimizations**: Disable WooCommerce cart fragments, dequeue Jetpack's devicepx script, and more to come!
45
+ 🌟 **Dequeue Core Scripts/Styles**: Dashicons, jQuery Migrate, emoji script, post embed script... If you don't need them, you can now choose to prevent them from loading in the first place... which can get you to the first place on your Google SERPs.
46
+ ⭐ **Declutter HEAD**: Do you think all that useless junk in your <head> should be gone? Us too! You know what they say: A clear <head> works faster.
47
+ ⭐ **Other Features**: Minify HTML, enable instant.page, trim query strings, disable self pingbacks, optimize the Heartbeat API, set a limit for post revisions, change autosave interval... Did we forget anything?
48
+
49
+ We're constantly working on new features so stay tuned for more and more on every major release!
50
+
51
+ For complete usage instructions, you can visit the [Speed Booster Pack documentation](https://speedboosterpack.com/docs/) page.
52
+
53
+ ### Translators are always welcome & always rewarded!
54
+
55
+ More than half of WordPress users don't speak English, and missing out so much! That's why Optimocha is always looking for volunteers to [translate Speed Booster Pack](https://translate.wordpress.org/projects/wp-plugins/speed-booster-pack/) so more and more people can benefit from its goodness. Oh, and we reward the people who help us! Reach out to us to become a translation editor in your language, and get rewarded with special discount codes of our services!
56
+
57
+ ### About [Optimocha](https://optimocha.com/) Speed Optimization Services
58
+
59
+ Speed optimization plugins might do a great job at optimizing your website and increasing your PageSpeed scores, but even they can't perform well on websites with poor setups. There are lots of factors to think about when it comes to web performance optimization. That's where we, as Optimocha, come in: We log in to your website; create a specialized optimization report considering all your plugins, your theme settings, your hosting environment and your whole content; then we get our hands dirty to get your website as fast as possible. To learn more about our services and get in touch with us, here are some links:
60
+
61
+ * [One-time speed optimization services](https://optimocha.com/speed-optimization-for-wordpress/)
62
+ * [Monthly speed optimization & maintenance services](https://optimocha.com/monthly-wordpress-optimization-maintenance/)
63
+ * [Contact Optimocha](https://optimocha.com/contact/)
64
+
65
+ ### Disclaimer
66
+
67
+ Even though the plugin works perfectly well on most WordPress websites, it's not perfect. We just need to make sure that we're on the same page: This plugin, no matter how hard we work on it, might have bugs in it and your site has an off chance to have issues with the plugin. It doesn't do anything permanent to your pages' source codes, so deactivating the plugin and clearing your browser & server caches will solve any kind of issue it might cause. Other than that, we won't be able to take responsibility if something else clashes with Speed Booster Pack.
68
+
69
+ == Installation ==
70
+
71
+ 1. Download the plugin (.zip file) on your hard drive.
72
+ 2. Unzip the zip file contents.
73
+ 3. Upload the `speed-booster-pack` folder to the `/wp-content/plugins/` directory.
74
+ 4. Activate the plugin through the 'Plugins' menu in WordPress.
75
+ 5. A new sub menu item `Speed Booster` will appear in your main Settings menu.
76
+
77
+ == Frequently Asked Questions ==
78
+
79
+ For complete usage instructions, you can visit the [Speed Booster Pack documentation](https://speedboosterpack.com/docs/) page.
80
+
81
+ = I like your plugin, how do I thank you? =
82
+
83
+ We don't accept any donations, if that's what you're asking! 😊 But we do like to have our users [review the plugin](https://wordpress.org/support/plugin/speed-booster-pack/reviews/#new-post) with a fair star rating. And we always appreciate you recommending our plugin to other people!
84
+
85
+ = I have a bug report! =
86
+
87
+ We love you already! ❤ Please issue your bug report [over GitHub](https://github.com/optimocha/speed-booster-pack/) so we can get started squashing it. **If it's a legitimate bug, you'll be awarded with discount coupons to our services!**
88
+
89
+ = This plugin broke my site! =
90
+
91
+ It's possible that the theme or your plugins might be using some old code that isn't compatible with Speed Booster Pack's code. If that's the case, try disabling some features in the Advanced tab. If that doesn't work, try deactivating the plugin and clear your browser & server caches. If that does the trick, reach out to us so we can help you. If the site is *still* broken, though, there's obviously another reason for your site breaking because everything Speed Booster Pack does, it does it on-the-fly. Deactivating the plugin (and clearing your caches) will make everything go away.
92
+
93
+ = I need more than Speed Booster Pack! =
94
+
95
+ Our main business is special speed optimization services, tailored for every website we work on. [On our website](https://optimocha.com/), you can review our speed optimization packages and contact us.
96
+
97
+ = How often do you update the plugin? =
98
+
99
+ All the time! We're always looking for new ways to get this plugin to a better state: We code new features, we fix existing bugs, and we try our best to make Speed Booster Pack more and more popular. And we always appreciate a helping hand: If you've got a new feature to offer, [you can suggest it over here](https://speedboosterpack.com/contact/). If we eventually make it happen and/or you help us make it happen, you'll be rewarded with handsome discount coupons or even free speed optimization services!
100
+
101
+ == Screenshots ==
102
+ 1. Plugin options page
103
+
104
+ == Upgrade Notice ==
105
+
106
+ Speed Booster Pack v4.0 is written from scratch! With the new options framework, your current options will be migrated to the new codebase but make sure you review your options after updating the plugin to the latest version.
107
+
108
+ == Changelog ==
109
+
110
+ = 4.0.0 =
111
+
112
+ *Release Date: 18 July 2020*
113
+
114
+ **Speed Booster Pack v4.0 is written from scratch!** Almost all of our codebase is rewritten, great new features are added, and we have an awesome new options panel to show them all!
115
+
116
+ * **NEW - Caching**: With this new feature, you can now enable page and browser caching which will greatly reduce database queries and help browsers cache static assets more efficiently.
117
+ * **NEW - JavaScript deferring**: You can now choose to move JS to the footer **or** defer parsing of JavaScript.
118
+ * **NEW - Custom Code Manager**: You can now add custom JavaScript code and make them run deferred.
119
+ * **NEW - Cloudflare Integration**: User your Cloudflare API key to connect your caching system to Cloudflare, so each time your cache is cleared, Cloudflare's cache will be purged as well.
120
+ * **NEW - Analytics Localizer**: You can now serve Google Analytics or Google Tag Manager scripts (analytics.js, gtag.js, or gtm.js) from your own server, and still keep it working.
121
+ * **NEW**: The brand new admin panel created with the Codestar Framework will help you review and understand Speed Booster Pack's options more easily.
122
+ * **Improved - Google Fonts optimization**: Our refactored code helps Google Fonts load even faster now.
123
+ * **Improved - Compatibility**: Active plugins with features similar to Speed Booster Pack will throw a dismissible notice to warn the user to be careful about the overlapping features.
124
+ * **Fixed**: The Preboost feature outputted code without the `crossorigin` attribute, which is now fixed.
125
+ * **Fixed**: The lazy load feature caused mixed content warnings in some edge cases, which is now fixed.
126
+ * **Updated**: Updated external libraries (lazyload.js and instantpage.js) to their latest versions.
127
+
128
+ *You can read the rest of the changelog on the [Speed Booster Pack documentation](https://speedboosterpack.com/docs/) page.
admin/class-speed-booster-pack-admin.php ADDED
@@ -0,0 +1,953 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The admin-specific functionality of the plugin.
5
+ *
6
+ * @link https://optimocha.com
7
+ * @since 4.0.0
8
+ *
9
+ * @package Speed_Booster_Pack
10
+ * @subpackage Speed_Booster_Pack/admin
11
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+
18
+ /**
19
+ * Returns absolute value of a number. Returns 1 if value is zero.
20
+ *
21
+ * @param $value
22
+ *
23
+ * @return float|int
24
+ * @since 4.0.0
25
+ *
26
+ */
27
+ function sbp_posabs( $value ) {
28
+ if ( 0 == $value ) {
29
+ return 1;
30
+ }
31
+
32
+ return absint( $value );
33
+ }
34
+
35
+ /**
36
+ * Removes http(s?):// and trailing slash from the url
37
+ *
38
+ * @param $url
39
+ *
40
+ * @return string
41
+ * @since 4.0.0
42
+ *
43
+ */
44
+ function sbp_clear_cdn_url( $url ) {
45
+ return preg_replace( "#^[^:/.]*[:/]+#i", "", rtrim( $url, '/' ) );
46
+ }
47
+
48
+ /**
49
+ * Removes http:// from the url
50
+ *
51
+ * @param $url
52
+ *
53
+ * @return string
54
+ * @since 4.0.0
55
+ *
56
+ */
57
+ function sbp_clear_http( $url ) {
58
+ return str_replace( "http://", "//", $url );
59
+ }
60
+
61
+ /**
62
+ * Sanitizes excluded URLs for caching
63
+ *
64
+ * @param $urls
65
+ *
66
+ * @return string
67
+ * @since 4.0.0
68
+ *
69
+ */
70
+ function sbp_sanitize_caching_urls( $urls ) {
71
+ $urls = \SpeedBooster\SBP_Utils::explode_lines( $urls );
72
+ foreach ( $urls as &$url ) {
73
+ $url = ltrim( $url, 'https://' );
74
+ $url = ltrim( $url, 'http://' );
75
+ $url = ltrim( $url, '//' );
76
+ $url = rtrim( $url, '/' );
77
+ }
78
+
79
+ return implode( PHP_EOL, $urls );
80
+ }
81
+
82
+ /**
83
+ * The admin-specific functionality of the plugin.
84
+ *
85
+ * Defines the plugin name, version, and two examples hooks for how to
86
+ * enqueue the admin-specific stylesheet and JavaScript.
87
+ *
88
+ * @package Speed_Booster_Pack
89
+ * @subpackage Speed_Booster_Pack/admin
90
+ * @author Optimocha <info@speedboosterpack.com>
91
+ */
92
+ class Speed_Booster_Pack_Admin {
93
+
94
+ /**
95
+ * The ID of this plugin.
96
+ *
97
+ * @since 4.0.0
98
+ * @access private
99
+ * @var string $plugin_name The ID of this plugin.
100
+ */
101
+ private $plugin_name;
102
+
103
+ /**
104
+ * The version of this plugin.
105
+ *
106
+ * @since 4.0.0
107
+ * @access private
108
+ * @var string $version The current version of this plugin.
109
+ */
110
+ private $version;
111
+
112
+ private $cloudflare_warning = false;
113
+
114
+ /**
115
+ * Initialize the class and set its properties.
116
+ *
117
+ * @param string $plugin_name The name of this plugin.
118
+ * @param string $version The version of this plugin.
119
+ *
120
+ * @since 4.0.0
121
+ */
122
+ public function __construct( $plugin_name, $version ) {
123
+
124
+ $this->plugin_name = $plugin_name;
125
+ $this->version = $version;
126
+
127
+ $this->load_dependencies();
128
+
129
+ // TODO: the Cloudflare credentials warning doesn't show up after saving, but after saving + refreshing.
130
+ add_action( 'csf_loaded', '\SpeedBooster\SBP_Cloudflare::check_credentials' );
131
+
132
+ add_action( 'csf_sbp_options_save_before', '\SpeedBooster\SBP_Cloudflare::reset_transient' );
133
+
134
+ add_action( 'csf_sbp_options_saved', '\SpeedBooster\SBP_Cache::clear_total_cache' );
135
+
136
+ add_action( 'csf_sbp_options_save_before', '\SpeedBooster\SBP_Cache::options_saved_listener' );
137
+
138
+ add_action( 'csf_sbp_options_saved', '\SpeedBooster\SBP_Cache::generate_htaccess' );
139
+
140
+ add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_links' ], 90 );
141
+
142
+ $this->set_flash_notices();
143
+
144
+ $this->initialize_announce4wp();
145
+
146
+ $this->create_settings_page();
147
+
148
+ add_action( 'admin_enqueue_scripts', 'add_thickbox' );
149
+
150
+ }
151
+
152
+ /**
153
+ * Register the stylesheets for the admin area.
154
+ *
155
+ * @since 4.0.0
156
+ */
157
+ public function enqueue_styles() {
158
+
159
+ wp_enqueue_style( $this->plugin_name, SBP_URL . 'admin/css/speed-booster-pack-admin.css', array(), $this->version, 'all' );
160
+
161
+ }
162
+
163
+ /**
164
+ * Register the JavaScript for the admin area.
165
+ *
166
+ * @since 4.0.0
167
+ */
168
+ public function enqueue_scripts() {
169
+ wp_enqueue_script( $this->plugin_name, SBP_URL . 'admin/js/speed-booster-pack-admin.js', array( 'jquery' ), $this->version, false );
170
+ }
171
+
172
+ public function load_dependencies() {
173
+ require_once SBP_LIB_PATH . 'codestar-framework/codestar-framework.php';
174
+ require_once SBP_LIB_PATH . 'announce4wp/announce4wp-client.php';
175
+ }
176
+
177
+ public function create_settings_page() {
178
+ // Check core class for avoid errors
179
+ if ( class_exists( 'CSF' ) ) {
180
+
181
+ // Set a unique slug-like ID
182
+ $prefix = 'sbp_options';
183
+
184
+ // Create options
185
+ CSF::createOptions( $prefix,
186
+ [
187
+ // framework title
188
+ 'framework_title' => SBP_PLUGIN_NAME . ' <small>by <a href="' . SBP_OWNER_HOME . '" rel="external noopener" target="_blank">' . SBP_OWNER_NAME . '</a></small>',
189
+ 'framework_class' => 'sbp-settings',
190
+
191
+ // menu settings
192
+ 'menu_title' => 'Speed Booster',
193
+ 'menu_icon' => SBP_URL . 'admin/images/icon.svg',
194
+ 'menu_slug' => 'sbp-settings',
195
+ 'menu_type' => 'menu',
196
+ 'menu_capability' => 'manage_options',
197
+
198
+ 'theme' => 'light',
199
+ 'ajax_save' => false,
200
+ 'show_search' => false,
201
+ 'show_reset_section' => false,
202
+ 'show_all_options' => false,
203
+
204
+ // menu extras
205
+ 'show_bar_menu' => false,
206
+ 'show_sub_menu' => true,
207
+ 'admin_bar_menu_icon' => '',
208
+ 'admin_bar_menu_priority' => 80,
209
+
210
+ /* translators: 1: plugin name 2: opening tag for the hyperlink 3: closing tag for the hyperlink */
211
+ 'footer_credit' => sprintf( __( 'Thank you for using %1$s! If you like our plugin, be sure to %2$sleave a fair review%3$s.', 'speed-booster-pack' ), SBP_PLUGIN_NAME, '<a href="https://wordpress.org/support/plugin/speed-booster-pack/reviews/#new-post" rel="external noopener" target="_blank">', '</a>' ),
212
+ ] );
213
+
214
+ /* BEGIN Section: Dashboard */
215
+ CSF::createSection(
216
+ $prefix,
217
+ [
218
+ 'title' => __( 'Dashboard', 'speed-booster-pack' ),
219
+ 'id' => 'dashboard',
220
+ 'class' => 'dashboard',
221
+ 'icon' => 'fa fa-tachometer-alt',
222
+ 'fields' => [
223
+
224
+ [
225
+ 'type' => 'heading',
226
+ /* translators: %s = Speed Booster Pack */
227
+ 'content' => sprintf( __( 'Welcome to %s!', 'speed-booster-pack' ), SBP_PLUGIN_NAME ),
228
+ ],
229
+ [
230
+ 'type' => 'content',
231
+ /* translators: %s = Speed Booster Pack */
232
+ 'content' => sprintf( __( 'Thank you for installing %s! We really hope you\'ll like our plugin and greatly benefit from it. On this page, you\'ll find a small introduction to the plugin\'s features, and a few other things. Let\'s begin!', 'speed-booster-pack' ), SBP_PLUGIN_NAME ),
233
+ ],
234
+ [
235
+ 'type' => 'subheading',
236
+ 'content' => __( 'Heads up: This plugin is ALWAYS in beta!', 'speed-booster-pack' ),
237
+ ],
238
+ [
239
+ 'type' => 'content',
240
+ /* translators: 1. Speed Booster Pack 2. link to the speedboosterpack.com contact form 3. link to the GitHub page */
241
+ 'content' => sprintf( __( 'We\'re constantly adding new features to %1$s, and improving existing ones. While it\'s safe to use on live websites, there are a lot of moving parts and there\'s a chance that it might cause conflicts. After configuring %1$s, make sure you check your website as a visitor and confirm all\'s well. If you find a bug, you can let us know about it via our contact form on %2$s or create an issue on %3$s.', 'speed-booster-pack' ), SBP_PLUGIN_NAME, '<a href="https://speedboosterpack.com/contact/" rel="external noopener" target="_blank">speedboosterpack.com</a>', '<a href="https://github.com/optimocha/speed-booster-pack/" rel="external noopener" target="_blank">GitHub</a>' )
242
+ ],
243
+ [
244
+ 'type' => 'subheading',
245
+ /* translators: %s = Speed Booster Pack */
246
+ 'content' => sprintf( __( 'Features and benefits of %s', 'speed-booster-pack' ), SBP_PLUGIN_NAME ),
247
+ ],
248
+ [
249
+ 'type' => 'content',
250
+ /* translators: %s = Speed Booster Pack */
251
+ 'content' => '<p>' . __( 'Each module of this plugin has different sets of really cool features that can help speed up your website:', 'speed-booster-pack' ) . '</p>' . '<ul><li>' .
252
+ '<strong>' . __( 'Caching', 'speed-booster-pack' ) . '</strong>: ' . __( 'This module caches your pages into static HTML files, greatly reducing database queries. It also helps browsers cache static assets more efficiently.', 'speed-booster-pack' ) . '</li><li>' .
253
+ '<strong>' . __( 'Assets', 'speed-booster-pack' ) . '</strong>: ' . __( 'This module helps you optimize the static assets in your pages by minifying HTML and CSS, lazy loading media (images, videos and iframes), deferring JavaScript, optimizing Google fonts and preloading any asset you want.', 'speed-booster-pack' ) . '</li><li>' .
254
+ '<strong>' . __( 'Special', 'speed-booster-pack' ) . '</strong>: ' . __( 'This module has features for specific cases like CDN usage, localizing tracker scripts, adding custom JavaScript code and optimizations for some popular plugins.', 'speed-booster-pack' ) . '</li><li>' .
255
+ '<strong>' . __( 'Tweaks', 'speed-booster-pack' ) . '</strong>: ' . __( 'This module lets you tweak the WordPress core and your page sources by dequeueing core scripts/styles, decluttering &lt;head&gt;, optimizing revisions and the Heartbeat API and so on.', 'speed-booster-pack' ) . '</li></ul>' .
256
+ '<p>' . __( 'Feel free to experiment, and don\'t forget to create exclude rules when necessary!', 'speed-booster-pack' ) . '</p>',
257
+ ],
258
+ [
259
+ 'type' => 'subheading',
260
+ 'content' => __( 'Upcoming features', 'speed-booster-pack' ),
261
+ ],
262
+ [
263
+ 'type' => 'content',
264
+ /* translators: 1. opening tag for the newsletter hyperlink 2. closing tag for the hyperlink */
265
+ 'content' => sprintf( __( 'Like we mentioned above, we\'re constantly working on making our plugin better on every release. If you\'d like to be the first to know about improvements before they\'re released, plus more tips &amp; tricks about web performance optimization, %1$syou can sign up for our weekly newsletter here%2$s!', 'speed-booster-pack' ), '<a href="https://speedboosterpack.com/static/newsletter.php?KeepThis=true&TB_iframe=true&height=500&width=400" class="thickbox">', '</a>' )
266
+ ],
267
+ [
268
+ 'type' => 'subheading',
269
+ 'content' => __( 'That\'s it, enjoy!', 'speed-booster-pack' ),
270
+ ],
271
+ [
272
+ 'type' => 'content',
273
+ 'content' => '<p>' . __( 'We really hope that you\'ll enjoy working with our plugin. Always remember that this is a powerful tool, and using powerful tools might hurt you if you\'re not careful. Have fun!', 'speed-booster-pack' ) . '</p>' .
274
+ /* translators: %s = Optimocha */
275
+ '<p style="font-style:italic;">' . sprintf( __( 'Your friends at %s', 'speed-booster-pack' ), SBP_OWNER_NAME ) . '</p>' .
276
+ /* translators: 1. Speed Booster Pack 2. link to the plugin's reviews page on wp.org */
277
+ '<p>' . sprintf( __( 'Almost forgot: If you like %1$s, it would mean a lot to us if you gave a fair rating on %2$s, because highly rated plugins are shown to more users on the WordPress plugin directory, meaning that we\'ll have no choice but to take better care of %1$s!', 'speed-booster-pack' ), SBP_PLUGIN_NAME, '<a href="https://wordpress.org/support/plugin/speed-booster-pack/reviews/#new-post" rel="external noopener" target="_blank">wordpress.org</a>' ) . '</p>',
278
+ ],
279
+ [
280
+ 'type' => 'subheading',
281
+ 'content' => __( 'If you\'re looking for professional help...', 'speed-booster-pack' ),
282
+ ],
283
+ [
284
+ 'type' => 'content',
285
+ /* translators: 1: plugin owner's name (Optimocha) 2: Speed Booster Pack (Speed Booster Pack) 3: hyperlink to the owner's website */
286
+ 'content' => sprintf( __( 'As %1$s, we like to brag about completing hundreds of tailored speed optimization jobs for different websites. (This experience is actually the source of the know-how that helps %2$s get better on every release!) If you\'re willing to invest in speeding up your website, not just with %2$s but as a whole, feel free to contact us on %3$s and benefit from our expertise on speed optimization!', 'speed-booster-pack' ), SBP_OWNER_NAME, SBP_PLUGIN_NAME, '<a href="' . SBP_OWNER_HOME . '" rel="external noopener" target="_blank">' . strtolower( SBP_OWNER_NAME ) . '.com</a>' ),
287
+ ],
288
+
289
+ ],
290
+ ]
291
+ );
292
+ /* END Section: Dashboard */
293
+
294
+ /* BEGIN Section: Caching */
295
+ $cloudflare_fields = [];
296
+ $cloudflare_transient = get_transient( 'sbp_cloudflare_status' );
297
+
298
+ if ( '0' === $cloudflare_transient ) {
299
+ $cloudflare_fields[] = [
300
+ 'type' => 'submessage',
301
+ 'style' => 'danger',
302
+ 'content' => __( 'Your Cloudflare credentials are incorrect.', 'speed-booster-pack' ),
303
+ ];
304
+ }
305
+
306
+ $cloudflare_fields = array_merge( $cloudflare_fields,
307
+ [
308
+ [
309
+ 'title' => __( 'Connect to Cloudflare', 'speed-booster-pack' ),
310
+ 'id' => 'cloudflare_enable',
311
+ 'type' => 'switcher',
312
+ ],
313
+ [
314
+ 'title' => __( 'Cloudflare global API key', 'speed-booster-pack' ),
315
+ 'id' => 'cloudflare_api',
316
+ 'type' => 'text',
317
+ 'desc' => '<a href="https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys#12345682" rel="external noopener" target="_blank">' . __( 'You can find it using this tutorial.', 'speed-booster-pack' ) . '</a>',
318
+ ],
319
+ [
320
+ 'title' => __( 'Cloudflare email address', 'speed-booster-pack' ),
321
+ 'id' => 'cloudflare_email',
322
+ 'type' => 'text',
323
+ 'desc' => __( 'The email address you signed up for Cloudflare with.', 'speed-booster-pack' ),
324
+ ],
325
+ [
326
+ 'title' => __( 'Cloudflare zone ID', 'speed-booster-pack' ),
327
+ 'id' => 'cloudflare_zone',
328
+ 'type' => 'text',
329
+ 'desc' => __( 'You can find your zone ID in the Overview tab on your Cloudflare panel.', 'speed-booster-pack' ),
330
+ ],
331
+ ] );
332
+
333
+ $cache_fields = array_merge( [
334
+ [
335
+ 'id' => 'module_caching',
336
+ 'class' => 'module-caching',
337
+ 'type' => 'switcher',
338
+ /* translators: used like "Enable/Disable XXX" where "XXX" is the module name. */
339
+ 'title' => __( 'Enable/Disable', 'speed-booster-pack' ) . ' ' . __( 'Caching', 'speed-booster-pack' ),
340
+ 'label' => __( 'Enables or disables the whole module without resetting its settings.', 'speed-booster-pack' ),
341
+ ],
342
+ [
343
+ 'title' => __( 'Cache expiry time', 'speed-booster-pack' ),
344
+ 'id' => 'caching_expiry',
345
+ 'type' => 'spinner',
346
+ 'min' => '1',
347
+ 'unit' => __( 'hours', 'speed-booster-pack' ),
348
+ 'desc' => __( 'How many hours to expire a cached page (1 or higher). Expired cache files are regenerated automatically.', 'speed-booster-pack' ),
349
+ 'default' => '10',
350
+ 'sanitize' => 'sbp_posabs',
351
+ 'dependency' => [ 'module_caching', '==', '1', '', 'visible' ],
352
+ ],
353
+ [
354
+ 'id' => 'caching_separate_mobile',
355
+ 'type' => 'switcher',
356
+ 'title' => __( 'Separate mobile cache', 'speed-booster-pack' ),
357
+ 'desc' => __( 'Creates separate cache files for mobile and desktop. Useful if you have mobile-specific plugins or themes. Not necessary if you have a responsive theme.', 'speed-booster-pack' ),
358
+ 'dependency' => [ 'module_caching', '==', '1', '', 'visible' ],
359
+ ],
360
+ [
361
+ 'id' => 'caching_exclude_urls',
362
+ 'class' => 'caching-exclude-urls',
363
+ 'type' => 'code_editor',
364
+ 'title' => __( 'Exclude URLs', 'speed-booster-pack' ),
365
+ 'desc' => __( 'Enter one URL per line to exclude them from caching. Cart and Checkout pages of WooCommerce are always excluded, so you don\'t have to set them in here.', 'speed-booster-pack' ),
366
+ 'dependency' => [ 'module_caching', '==', '1', '', 'visible' ],
367
+ 'sanitize' => 'sbp_sanitize_caching_urls',
368
+ ],
369
+ [
370
+ 'id' => 'caching_include_query_strings',
371
+ 'class' => 'caching-include-query-strings',
372
+ 'type' => 'code_editor',
373
+ 'title' => __( 'Cached query strings', 'speed-booster-pack' ),
374
+ 'desc' => __( 'Enter one query string per line to cache URLs with those query strings.', 'speed-booster-pack' ) . '<br />' .
375
+ /* translators: 1. <code> 2. </code> */
376
+ sprintf( __( 'For example, after adding "foo" to the list, %1$sexample.com/blog-post/?foo=bar%2$s will be cached.', 'speed-booster-pack' ), '<code>', '</code>' ),
377
+ 'default' => 'utm_source',
378
+ 'dependency' => [ 'module_caching', '==', '1', '', 'visible' ],
379
+ ],
380
+ ],
381
+ $cloudflare_fields );
382
+
383
+ $is_hosting_restricted = false;
384
+ $restricted_hosting_error = '';
385
+
386
+ if ( isset( $_SERVER['KINSTA_CACHE_ZONE'] ) ) {
387
+ $is_hosting_restricted = true;
388
+ $restricted_hosting_error = __( 'Since you\'re using Kinsta, cache feature is completely disabled to ensure compatibility with Kinsta\'s internal caching system.', 'speed-booster-pack' );
389
+ }
390
+
391
+ if ( defined( "IS_PRESSABLE" ) && IS_PRESSABLE ) {
392
+ $is_hosting_restricted = true;
393
+ $restricted_hosting_error = __( 'Since you\'re using Pressable, cache feature is completely disabled to ensure compatibility with Pressable\'s internal caching system.', 'speed-booster-pack' );
394
+ }
395
+
396
+ if ( ! $is_hosting_restricted && is_multisite() ) {
397
+ $multisite_warning = [
398
+ 'type' => 'submessage',
399
+ 'style' => 'warning',
400
+ /* translators: %s = hyperlink to the contact form */
401
+ 'content' => sprintf( __( 'Caching in Speed Booster Pack isn\'t tested with WordPress Multisite, proceed with caution! We\'d appreciate getting feedback from you if you find any bugs over at %s.', 'speed-booster-pack' ), '<a href="https://speedboosterpack.com/contact/?sbp_version=' . SBP_VERSION . '" rel="external noopener" target="_blank">speedboosterpack.com</a>' ),
402
+ ];
403
+
404
+ array_unshift( $cache_fields, $multisite_warning );
405
+ }
406
+
407
+ if ( $is_hosting_restricted ) {
408
+ $restricted_hosting_notice = [
409
+ [
410
+ 'type' => 'submessage',
411
+ 'style' => 'success',
412
+ 'class' => 'kinsta-warning',
413
+ 'content' => $restricted_hosting_error,
414
+ ],
415
+ ];
416
+ $cache_fields = array_merge( $restricted_hosting_notice, $cache_fields );
417
+ }
418
+
419
+ CSF::createSection(
420
+ $prefix,
421
+ [
422
+ 'title' => __( 'Caching', 'speed-booster-pack' ),
423
+ 'id' => 'caching',
424
+ 'icon' => 'fa fa-server',
425
+ 'class' => $is_hosting_restricted ? 'inactive-section' : '',
426
+ 'fields' => $cache_fields,
427
+ ]
428
+ );
429
+ /* END Section: Caching */
430
+
431
+ /* BEGIN Section: Assets */
432
+ CSF::createSection(
433
+ $prefix,
434
+ [
435
+ 'title' => __( 'Assets', 'speed-booster-pack' ),
436
+ 'id' => 'assets',
437
+ 'icon' => 'fa fa-code',
438
+ 'fields' => [
439
+
440
+ [
441
+ /* translators: used like "Enable/Disable XXX" where "XXX" is the module name. */
442
+ 'title' => __( 'Enable/Disable', 'speed-booster-pack' ) . ' ' . __( 'Assets', 'speed-booster-pack' ),
443
+ 'id' => 'module_assets',
444
+ 'type' => 'switcher',
445
+ 'label' => __( 'Enables or disables the whole module without resetting its settings.', 'speed-booster-pack' ),
446
+ 'default' => true,
447
+ ],
448
+ [
449
+ 'title' => __( 'Minify HTML', 'speed-booster-pack' ),
450
+ 'id' => 'minify_html',
451
+ 'type' => 'switcher',
452
+ 'desc' => __( 'Removes all whitespace characters from the HTML output, minimizing the HTML size.', 'speed-booster-pack' ),
453
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
454
+ ],
455
+ [
456
+ 'title' => __( 'Optimize Google Fonts', 'speed-booster-pack' ),
457
+ 'id' => 'optimize_gfonts',
458
+ 'type' => 'switcher',
459
+ 'desc' => __( 'Combines all Google Fonts URLs into a single URL and optimizes loading of that URL.', 'speed-booster-pack' ),
460
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
461
+ ],
462
+ [
463
+ 'title' => __( 'Lazy load media', 'speed-booster-pack' ),
464
+ 'id' => 'lazyload',
465
+ 'type' => 'switcher',
466
+ 'desc' => __( 'Defers loading of images, videos and iframes to page onload.', 'speed-booster-pack' ),
467
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
468
+ ],
469
+ [
470
+ 'title' => __( 'Lazy load exclusions', 'speed-booster-pack' ),
471
+ 'id' => 'lazyload_exclude',
472
+ 'class' => 'lazyload-exclude',
473
+ 'type' => 'code_editor',
474
+ 'desc' => __( 'Excluding important images at the top of your pages (like your logo and such) is a good idea. One URL per line.', 'speed-booster-pack' ),
475
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
476
+ 'sanitize' => 'sbp_clear_http',
477
+ ],
478
+ [
479
+ 'title' => __( 'Optimize JavaScript', 'speed-booster-pack' ),
480
+ 'id' => 'js_optimize',
481
+ 'desc' => __( 'Loads JavaScript better, avoiding render blocking issues. Moving all tags to the footer (before the &lt;/body&gt; tag) causes less issues but if you know what you\'re doing, deferring JS tags makes your website work faster. Use the exclusions list to keep certain scripts from breaking your site!', 'speed-booster-pack' ),
482
+ 'type' => 'button_set',
483
+ 'options' => [
484
+ 'off' => __( 'Off', 'speed-booster-pack' ),
485
+ 'defer' => __( 'Defer', 'speed-booster-pack' ),
486
+ 'move' => __( 'Move to footer', 'speed-booster-pack' ),
487
+ ],
488
+ 'default' => 'off',
489
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
490
+ ],
491
+ [
492
+ 'title' => __( 'JavaScript exclusions', 'speed-booster-pack' ),
493
+ 'id' => 'js_exclude',
494
+ 'class' => 'js-exclude',
495
+ 'type' => 'code_editor',
496
+ 'desc' => __( 'If you encounter JavaScript errors on your error console, you can exclude JS file URLs or parts of inline JS here. One rule per line. Since each line will be taken as separate exclude rules, don\'t paste entire blocks of inline JS!', 'speed-booster-pack' ),
497
+ 'default' => 'js/jquery/jquery.js',
498
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
499
+ ],
500
+ [
501
+ 'title' => __( 'Inline all CSS', 'speed-booster-pack' ),
502
+ 'id' => 'css_inline',
503
+ 'type' => 'switcher',
504
+ 'desc' => __( 'Inlines all CSS files into the HTML output. Useful for lightweight designs but might be harmful for websites with over 500KB of total CSS.', 'speed-booster-pack' ),
505
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
506
+ ],
507
+ [
508
+ 'title' => __( 'Minify all inlined CSS', 'speed-booster-pack' ),
509
+ 'id' => 'css_minify',
510
+ 'type' => 'switcher',
511
+ 'desc' => __( 'Minifies the already inlined CSS.', 'speed-booster-pack' ),
512
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
513
+ ],
514
+ [
515
+ 'title' => __( 'CSS exclusions', 'speed-booster-pack' ),
516
+ 'id' => 'css_exclude',
517
+ 'class' => 'css-exclude',
518
+ 'type' => 'code_editor',
519
+ 'desc' => __( 'If your design breaks after enabling the CSS options above, you can exclude CSS file URLs here. One rule per line.', 'speed-booster-pack' ),
520
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
521
+ ],
522
+ [
523
+ 'title' => __( 'Preload assets', 'speed-booster-pack' ),
524
+ 'id' => 'preboost',
525
+ 'class' => 'preboost',
526
+ 'type' => 'fieldset',
527
+ 'fields' => [
528
+ [
529
+ 'id' => 'preboost_enable',
530
+ 'type' => 'switcher',
531
+ 'label' => __( 'Enable preloading of the assets specified below.', 'speed-booster-pack' ),
532
+ ],
533
+ [
534
+ 'id' => 'preboost_include',
535
+ 'type' => 'code_editor',
536
+ 'desc' => __( 'Enter full URLs of the assets you want to preload. One URL per line.', 'speed-booster-pack' ),
537
+ ],
538
+ ],
539
+ 'dependency' => [ 'module_assets', '==', '1', '', 'visible' ],
540
+ ],
541
+
542
+ ],
543
+ ]
544
+ );
545
+ /* END Section: Assets */
546
+
547
+ /* BEGIN Section: Special */
548
+ CSF::createSection(
549
+ $prefix,
550
+ [
551
+ 'title' => __( 'Special', 'speed-booster-pack' ),
552
+ 'id' => 'special',
553
+ 'icon' => 'fa fa-bolt',
554
+ 'fields' => [
555
+
556
+ [
557
+ /* translators: used like "Enable/Disable XXX" where "XXX" is the module name. */
558
+ 'title' => __( 'Enable/Disable', 'speed-booster-pack' ) . ' ' . __( 'Special', 'speed-booster-pack' ),
559
+ 'id' => 'module_special',
560
+ 'class' => 'module-special',
561
+ 'type' => 'switcher',
562
+ 'label' => __( 'Enables or disables the whole module without resetting its settings.', 'speed-booster-pack' ),
563
+ 'default' => true,
564
+ ],
565
+
566
+ [
567
+ 'title' => __( 'Enable CDN', 'speed-booster-pack' ),
568
+ 'id' => 'cdn_url',
569
+ 'class' => 'cdn-url',
570
+ 'type' => 'text',
571
+ 'before' => 'http(s)://&nbsp;',
572
+ 'after' => '&nbsp;/',
573
+ 'desc' => __( 'Rewrites all asset URLs with the specified CDN domain. Enter the CDN domain without a protocol or a trailing slash; a relative protocol will be automatically added to all changed asset URLs.', 'speed-booster-pack' ),
574
+ 'dependency' => [ 'module_special', '==', '1', '', 'visible' ],
575
+ 'sanitize' => 'sbp_clear_cdn_url',
576
+ ],
577
+ [
578
+ 'title' => __( 'Localize Google Analytics & Google Tag Manager', 'speed-booster-pack' ),
579
+ 'id' => 'localize_tracking_scripts',
580
+ 'type' => 'switcher',
581
+ 'desc' => __( 'Searches for Google Analytics or Google Tag Manager scripts (analytics.js, gtag.js or gtm.js) in your page sources, and replaces them with a locally saved script.', 'speed-booster-pack' ),
582
+ 'dependency' => [ 'module_special', '==', '1', '', 'visible' ],
583
+ ],
584
+ [
585
+ 'title' => __( 'Custom code manager', 'speed-booster-pack' ),
586
+ 'id' => 'custom_codes',
587
+ 'type' => 'group',
588
+ 'before' => '<p>' . __( 'Code blocks added with this tool can be loaded in the header, the footer and can even be delayed.', 'speed-booster-pack' ) . '</p>',
589
+ 'accordion_title_number' => true,
590
+ 'accordion_title_auto' => false,
591
+ 'fields' => [
592
+ [
593
+ 'id' => 'custom_codes_item',
594
+ 'type' => 'code_editor',
595
+ 'before' => '&lt;script&gt;',
596
+ 'after' => '&lt;/script&gt;',
597
+ /* translators: %s = script tag */
598
+ 'desc' => sprintf( __( 'Paste the inline JavaScript here. DON\'T include the %s tags or else you might break it!', 'speed-booster-pack' ), '<code>&lt;script&gt;</code>' ),
599
+ ],
600
+ [
601
+ 'title' => __( 'Placement', 'speed-booster-pack' ),
602
+ 'id' => 'custom_codes_place',
603
+ 'desc' => __( 'Set this to "Footer" to place the code before &lt;/body&gt;, or "Header" to place it before &lt;/head&gt;.', 'speed-booster-pack' ),
604
+ 'type' => 'button_set',
605
+ 'options' => [
606
+ 'footer' => __( 'Footer', 'speed-booster-pack' ),
607
+ 'header' => __( 'Header', 'speed-booster-pack' ),
608
+ ],
609
+ 'default' => 'footer',
610
+ ],
611
+ [
612
+ 'title' => __( 'Loading method', 'speed-booster-pack' ),
613
+ 'id' => 'custom_codes_method',
614
+ 'desc' => __( 'Set this to "onload" to defer the code to page onload, or "4-second delay" to defer it to four seconds after onload. When in doubt, set it to "Normal".', 'speed-booster-pack' ),
615
+ 'type' => 'button_set',
616
+ 'options' => [
617
+ 'normal' => __( 'Normal', 'speed-booster-pack' ),
618
+ 'onload' => __( 'onload', 'speed-booster-pack' ),
619
+ 'delayed' => __( '4-second delay', 'speed-booster-pack' ),
620
+ ],
621
+ 'default' => 'normal',
622
+ ],
623
+ ],
624
+ 'dependency' => [ 'module_special', '==', '1', '', 'visible' ],
625
+ ],
626
+ [
627
+ 'title' => 'Jetpack: ' . __( 'Dequeue the devicepx script', 'speed-booster-pack' ),
628
+ 'id' => 'jetpack_dequeue_devicepx',
629
+ 'type' => 'switcher',
630
+ /* translators: %s = devicepx-jetpack.js */
631
+ 'desc' => sprintf( __( 'The %s file replaces images served via Jetpack\'s Photon CDN with their higher-quality equivalents. If you don\'t need this feature, you can dequeue the file and save an extra HTTP request and an extra DNS connection.', 'speed-booster-pack' ), '<code>devicepx-jetpack.js</code>' ),
632
+ 'dependency' => [ 'module_special', '==', '1', '', 'visible' ],
633
+ ],
634
+ [
635
+ 'title' => 'WooCommerce: ' . __( 'Disable cart fragments', 'speed-booster-pack' ),
636
+ 'id' => 'woocommerce_disable_cart_fragments',
637
+ 'type' => 'switcher',
638
+ /* translators: %s = cart-fragments.js */
639
+ 'desc' => sprintf( __( 'Dequeues the %s file if the visitor\'s cart is empty, preventing an unnecessary and slow AJAX request.', 'speed-booster-pack' ), '<code>cart-fragments.js</code>' ),
640
+ 'dependency' => [ 'module_special', '==', '1', '', 'visible' ],
641
+ ],
642
+ [
643
+ 'title' => 'WooCommerce: ' . __( 'Optimize non-WooCommerce pages', 'speed-booster-pack' ),
644
+ 'id' => 'woocommerce_optimize_nonwc_pages',
645
+ 'type' => 'switcher',
646
+ 'desc' => __( 'Prevents loading of WooCommerce-related scripts and styles on non-WooCommerce pages.', 'speed-booster-pack' ),
647
+ 'dependency' => [ 'module_special', '==', '1', '', 'visible' ],
648
+ ],
649
+ [
650
+ 'title' => 'WooCommerce: ' . __( 'Disable password strength meter', 'speed-booster-pack' ),
651
+ 'id' => 'woocommerce_disable_password_meter',
652
+ 'type' => 'switcher',
653
+ 'desc' => __( 'Disables the password strength meter for password inputs during a WooCommerce checkout.', 'speed-booster-pack' ),
654
+ 'dependency' => [ 'module_special', '==', '1', '', 'visible' ],
655
+ ],
656
+
657
+ ],
658
+ ]
659
+ );
660
+ /* END Section: Special */
661
+
662
+ /* BEGIN Section: Tweaks */
663
+ CSF::createSection(
664
+ $prefix,
665
+ [
666
+ 'title' => __( 'Tweaks', 'speed-booster-pack' ),
667
+ 'id' => 'tweaks',
668
+ 'icon' => 'fa fa-sliders-h',
669
+ 'fields' => [
670
+
671
+
672
+ [
673
+ /* translators: used like "Enable/Disable XXX" where "XXX" is the module name. */
674
+ 'title' => __( 'Enable/Disable', 'speed-booster-pack' ) . ' ' . __( 'Tweaks', 'speed-booster-pack' ),
675
+ 'id' => 'module_tweaks',
676
+ 'class' => 'module-tweaks',
677
+ 'type' => 'switcher',
678
+ 'label' => __( 'Enables or disables the whole module without resetting its settings.', 'speed-booster-pack' ),
679
+ 'default' => true,
680
+ ],
681
+ [
682
+ 'title' => __( 'Enable instant.page', 'speed-booster-pack' ),
683
+ 'id' => 'instant_page',
684
+ 'type' => 'switcher',
685
+ /* translators: %s = hyperlink to the instant.page website */
686
+ 'desc' => sprintf( __( 'Enqueues %s (locally), which basically boosts the speed of navigating through your whole website.', 'speed-booster-pack' ), '<a href="https://instant.page/" rel="external noopener" target="_blank">instant.page</a>' ),
687
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
688
+ ],
689
+ [
690
+ 'title' => __( 'Trim query strings', 'speed-booster-pack' ),
691
+ 'id' => 'trim_query_strings',
692
+ 'type' => 'switcher',
693
+ 'desc' => __( 'Removes the query strings (characters that come after the question mark) at the end of enqueued asset URLs.', 'speed-booster-pack' ),
694
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
695
+ ],
696
+ [
697
+ 'title' => __( 'Disable self pingbacks', 'speed-booster-pack' ),
698
+ 'id' => 'disable_self_pingbacks',
699
+ 'type' => 'switcher',
700
+ 'desc' => __( 'Disabling this will prevent pinging this website to ping itself (its other posts etc.) during publishing, which will improve the speed of publishing posts or pages.', 'speed-booster-pack' ),
701
+ 'default' => true,
702
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
703
+ ],
704
+ [
705
+ 'title' => __( 'Dequeue emoji scripts', 'speed-booster-pack' ),
706
+ 'id' => 'dequeue_emoji_scripts',
707
+ 'type' => 'switcher',
708
+ 'desc' => __( 'Removes the unnecessary emoji scripts from your website front-end. Doesn\'t remove emojis, don\'t worry.', 'speed-booster-pack' ),
709
+ 'default' => true,
710
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
711
+ ],
712
+ [
713
+ 'title' => __( 'Dequeue the post embed script', 'speed-booster-pack' ),
714
+ 'id' => 'disable_post_embeds',
715
+ 'type' => 'switcher',
716
+ 'desc' => __( 'Disables embedding posts from WordPress-based websites (including your own) which converts URLs into heavy iframes.', 'speed-booster-pack' ),
717
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
718
+ ],
719
+ [
720
+ 'title' => __( 'Dequeue jQuery Migrate', 'speed-booster-pack' ),
721
+ 'id' => 'dequeue_jquery_migrate',
722
+ 'type' => 'switcher',
723
+ 'desc' => __( 'If you\'re sure that the jQuery plugins used in your website work with jQuery 1.9 and above, this is totally safe to enable.', 'speed-booster-pack' ),
724
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
725
+ ],
726
+ [
727
+ 'title' => __( 'Dequeue Dashicons CSS', 'speed-booster-pack' ),
728
+ 'id' => 'dequeue_dashicons',
729
+ 'type' => 'switcher',
730
+ /* translators: 1. <strong> 2. </strong> */
731
+ 'desc' => sprintf( __( 'Removes dashicons.css from your front-end for your visitors. Since Dashicons are required for the admin bar, %1$sdashicons.css will not be removed for logged-in users%2$s.', 'speed-booster-pack' ), '<strong>', '</strong>' ),
732
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
733
+ ],
734
+ [
735
+ 'title' => __( 'Dequeue Gutenberg CSS', 'speed-booster-pack' ),
736
+ 'id' => 'dequeue_block_library',
737
+ 'type' => 'switcher',
738
+ 'desc' => __( 'If you\'re not using the block editor (Gutenberg) in your posts/pages, this is a safe setting to enable.', 'speed-booster-pack' ),
739
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
740
+ ],
741
+ [
742
+ 'title' => __( 'Heartbeat settings', 'speed-booster-pack' ),
743
+ 'id' => 'heartbeat_settings',
744
+ /* translators: 1. opening tag for the hyperlink to the Heartbeat API 2. closing tag for the hyperlink */
745
+ 'desc' => sprintf( __( 'Controls the %1$sHeartbeat API%2$s, which checks if the user is still logged-in or not every 15 to 60 seconds.', 'speed-booster-pack' ), '<a href="https://developer.wordpress.org/plugins/javascript/heartbeat-api/" rel="external noopener" target="_blank">', '</a>' ) . '<br />' . __( '"Enabled" lets it run like usual, "Optimized" sets both intervals to 120 seconds, and "Disabled" disables the Heartbeat API completely.', 'speed-booster-pack' ),
746
+ 'type' => 'button_set',
747
+ 'options' => [
748
+ 'enabled' => __( 'Enabled', 'speed-booster-pack' ),
749
+ 'optimized' => __( 'Optimized', 'speed-booster-pack' ),
750
+ 'disabled' => __( 'Disabled', 'speed-booster-pack' ),
751
+ ],
752
+ 'default' => 'enabled',
753
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
754
+ ],
755
+ [
756
+ 'title' => __( 'Limit post revisions', 'speed-booster-pack' ),
757
+ 'id' => 'post_revisions',
758
+ 'type' => 'spinner',
759
+ 'unit' => __( 'revisions', 'speed-booster-pack' ),
760
+ /* translators: 1. opening tag for the hyperlink to the support article for revisions 2. closing tag for the hyperlink */
761
+ 'desc' => sprintf( __( 'Limits the number of %1$spost revisions%2$s saved for each post. Keeping 3 or 5 revisions for each post should be enough for most sites. Set it to 0 to disable post revisions completely.', 'speed-booster-pack' ), '<a href="https://wordpress.org/support/article/revisions/" rel="external noopener" target="_blank">', '</a>' ) . '<br />'
762
+ /* translators: 1. WP_POST_REVISIONS 2. wp-config.php */
763
+ . sprintf( __( 'Note: If the %1$s constant is set in your %2$s file, it will override this setting.', 'speed-booster-pack' ), '<code>WP_POST_REVISIONS</code>', '<code>wp-config.php</code>' ),
764
+ 'sanitize' => 'absint',
765
+ 'default' => '99',
766
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
767
+ ],
768
+ [
769
+ 'title' => __( 'Autosave interval', 'speed-booster-pack' ),
770
+ 'id' => 'autosave_interval',
771
+ 'type' => 'spinner',
772
+ 'min' => '1',
773
+ 'unit' => __( 'minutes', 'speed-booster-pack' ),
774
+ 'desc' => __( 'Sets how frequent the content is saved automatically while editing. WordPress sets it to 1 minute by default, and you can\'t set it to a shorter interval.', 'speed-booster-pack' ) . '<br />'
775
+ /* translators: 1. AUTOSAVE_INTERVAL 2. wp-config.php */
776
+ . sprintf( __( 'Note: If the %1$s constant is set in your %2$s file, it will override this setting.', 'speed-booster-pack' ), '<code>AUTOSAVE_INTERVAL</code>', '<code>wp-config.php</code>' ),
777
+ 'sanitize' => 'sbp_posabs',
778
+ 'default' => '1',
779
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
780
+ ],
781
+ [
782
+ /* translators: %s = <head> */
783
+ 'title' => sprintf( __( 'Declutter %s', 'speed-booster-pack' ), '<code>&lt;head&gt;</code>' ),
784
+ 'id' => 'declutter_head',
785
+ 'class' => 'declutter-head',
786
+ 'type' => 'fieldset',
787
+ 'before' => '<p>' . __( 'Enabling these options removes corresponding elements from your HTML source code. If you don\'t know what they are, it\'s probably safer for you to keep them disabled.', 'speed-booster-pack' ) . '</p>',
788
+ 'fields' => [
789
+
790
+ [
791
+ 'title' => __( 'Shortlinks', 'speed-booster-pack' ),
792
+ 'id' => 'declutter_shortlinks',
793
+ 'type' => 'switcher',
794
+ 'label' => '<link rel=\'shortlink\' href=\'...\' />',
795
+ ],
796
+ [
797
+ 'title' => __( 'Next/previous posts links', 'speed-booster-pack' ),
798
+ 'id' => 'declutter_adjacent_posts_links',
799
+ 'type' => 'switcher',
800
+ 'label' => "<link rel='next (or prev)' title='...' href='...' />",
801
+ ],
802
+ [
803
+ 'title' => __( 'WLW Manifest link', 'speed-booster-pack' ),
804
+ 'id' => 'declutter_wlw',
805
+ 'type' => 'switcher',
806
+ 'label' => '<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="..." />',
807
+ ],
808
+ [
809
+ 'title' => __( 'Really Simple Discovery (RSD) link', 'speed-booster-pack' ),
810
+ 'id' => 'declutter_rsd',
811
+ 'type' => 'switcher',
812
+ 'label' => '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="..." />',
813
+ ],
814
+ [
815
+ 'title' => __( 'REST API links', 'speed-booster-pack' ),
816
+ 'id' => 'declutter_rest_api_links',
817
+ 'type' => 'switcher',
818
+ 'label' => "<link rel='https://api.w.org/' href='...' />",
819
+ ],
820
+ [
821
+ 'title' => __( 'RSS feed links', 'speed-booster-pack' ),
822
+ 'id' => 'declutter_feed_links',
823
+ 'type' => 'switcher',
824
+ 'label' => '<link rel="alternate" type="application/rss+xml" title="..." href="..." />',
825
+ ],
826
+ [
827
+ 'title' => __( 'WordPress version', 'speed-booster-pack' ),
828
+ 'id' => 'declutter_wp_version',
829
+ 'type' => 'switcher',
830
+ 'label' => '<meta name="generator" content="WordPress X.X" />',
831
+ ],
832
+ ],
833
+ 'dependency' => [ 'module_tweaks', '==', '1', '', 'visible' ],
834
+ ],
835
+
836
+ ],
837
+ ]
838
+ );
839
+ /* END Section: Tweaks */
840
+
841
+ /* BEGIN Section: Tools */
842
+ CSF::createSection(
843
+ $prefix,
844
+ array(
845
+ 'title' => __( 'Tools', 'speed-booster-pack' ),
846
+ 'id' => 'tools',
847
+ 'icon' => 'fa fa-tools',
848
+ 'fields' => array(
849
+ array(
850
+ 'type' => 'subheading',
851
+ /* translators: %s = Speed Booster Pack */
852
+ 'content' => sprintf( __( 'Backup %s Settings', 'speed-booster-pack' ), SBP_PLUGIN_NAME ),
853
+ ),
854
+ array(
855
+ 'id' => 'backup',
856
+ 'type' => 'backup',
857
+ 'title' => '',
858
+ ),
859
+
860
+ ),
861
+ )
862
+ );
863
+ /* END Section: Tools */
864
+
865
+ /* BEGIN Section: About */
866
+ /* BEYNTODO: İçerik yaz! */
867
+ CSF::createSection(
868
+ $prefix,
869
+ array(
870
+ 'title' => __( 'About', 'speed-booster-pack' ),
871
+ 'id' => 'about',
872
+ 'class' => 'about',
873
+ 'icon' => 'fa fa-info-circle',
874
+ 'fields' => array(
875
+
876
+ [
877
+ 'type' => 'heading',
878
+ /* translators: %s = Optimocha */
879
+ 'content' => sprintf( __( 'About %s', 'speed-booster-pack' ), SBP_OWNER_NAME ),
880
+ ],
881
+ [
882
+ 'type' => 'content',
883
+ /* translators: 1. Optimocha 2. Speed Booster Pack */
884
+ 'content' => '<p>' . sprintf( __( 'We are %1$s, a small team of speed optimization experts. Along with hundreds of websites we finished optimizing, we acquired %2$s in 2019 and we\'re working hard to make this plugin the best speed optimization plugin for WordPress ever since!', 'speed-booster-pack' ), SBP_OWNER_NAME, SBP_PLUGIN_NAME ) . '</p><ul><li><a href="https://optimocha.com/speed-optimization-for-wordpress/" rel="external noopener" target="_blank">' .
885
+ __( 'Visit our website', 'speed-booster-pack' ) . '</a></li><li><a href="https://optimocha.com/" rel="external noopener" target="_blank">' .
886
+ __( 'Learn more about our tailored Complete Speed Optimization services', 'speed-booster-pack' ) . '</a></li><li><a href="https://optimocha.com/contact/" rel="external noopener" target="_blank">' .
887
+ __( 'Contact us', 'speed-booster-pack' ) . '</a></li></ul>',
888
+ ],
889
+ [
890
+ 'type' => 'subheading',
891
+ 'content' => __( 'Special thanks', 'speed-booster-pack' ),
892
+ ],
893
+ [
894
+ 'type' => 'content',
895
+ /* translators: 1. Speed Booster Pack 2. link to the speedboosterpack.com contact form 3. link to the GitHub page */
896
+ 'content' => __( 'We made use of the following libraries and frameworks in Speed Booster Pack, so we\'d like to give them a shout out and thank them:', 'speed-booster-pack' ) .
897
+ '<ul>
898
+ <li><a href="https://instant.page/" rel="external noopener" target="_blank">instant.page</a></li>
899
+ <li><a href="https://github.com/verlok/vanilla-lazyload" rel="external noopener" target="_blank">LazyLoad by Andrea Verlicchi</a></li>
900
+ <li><a href="https://codestarframework.com/" rel="external noopener" target="_blank">CodeStar Framework</a></li>
901
+ </ul>',
902
+ ],
903
+ [
904
+ 'title' => __( 'Allow external notices', 'speed-booster-pack' ),
905
+ 'id' => 'enable_external_notices',
906
+ 'type' => 'switcher',
907
+ 'label' => __( '', 'speed-booster-pack' ),
908
+ /* translators: %s = hyperlink to speedboosterpack.com */
909
+ 'desc' => sprintf( __( 'Fetches notices from %s, and shows them in a non-obtrusive manner. We intend to send essential notices only, and we hate spam as much as you do, but if you don\'t want to get them, you can disable this setting.', 'speed-booster-pack' ), '<a href="https://speedboosterpack.com/" rel="external noopener" target="_blank">speedboosterpack.com</a>' ),
910
+ 'default' => true,
911
+ ],
912
+ ),
913
+ )
914
+ );
915
+ /* END Section: About */
916
+ }
917
+ }
918
+
919
+ public function add_admin_bar_links( WP_Admin_Bar $admin_bar ) {
920
+
921
+ if ( current_user_can( 'manage_options' ) && sbp_get_option( 'module_caching' ) && ! isset( $_SERVER['KINSTA_CACHE_ZONE'] ) ) {
922
+ $clear_cache_url = wp_nonce_url( add_query_arg( 'sbp_action', 'sbp_clear_cache' ), 'sbp_clear_total_cache', 'sbp_nonce' );
923
+ $sbp_admin_menu = [
924
+ 'id' => 'speed_booster_pack',
925
+ 'title' => __( 'Clear Cache', 'speed-booster-pack' ),
926
+ 'href' => $clear_cache_url,
927
+ ];
928
+
929
+ $admin_bar->add_menu( $sbp_admin_menu );
930
+ }
931
+
932
+ }
933
+
934
+ public function set_flash_notices() {
935
+ $notice = get_transient( 'sbp_notice_cache' );
936
+ if ( $notice ) {
937
+ add_action( 'admin_notices', [ $this, 'show_cache_notice' ] );
938
+ delete_transient( 'sbp_notice_cache' );
939
+ }
940
+ }
941
+
942
+ public function show_cache_notice() {
943
+ echo '<div class="notice notice-success is-dismissible">
944
+ <p><strong>' . SBP_PLUGIN_NAME . ':</strong> ' . __( 'Cache cleared.', 'speed-booster-pack' ) . '</p>
945
+ </div>';
946
+ }
947
+
948
+ private function initialize_announce4wp() {
949
+ if ( sbp_get_option( 'enable_external_notices' ) ) {
950
+ new Announce4WP_Client( 'speed-booster-pack.php', SBP_PLUGIN_NAME, "sbp", "https://speedboosterpack.com/wp-json/a4wp/v1/" . SBP_VERSION . "/news.json", "toplevel_page_sbp-settings" );
951
+ }
952
+ }
953
+ }
admin/css/speed-booster-pack-admin.css ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .sbp-settings .declutter-head .csf-fieldset-content > .csf-field {padding:10px;}
2
+ .sbp-settings .csf-field-spinner .csf--unit {padding:0 10px;}
3
+ .sbp-settings .text-input-before, .sbp-settings .text-input-after {line-height:2;}
4
+ .sbp-settings .csf-field-group .csf-cloneable-header-icon {vertical-align:middle;}
5
+ .sbp-settings input.disabled, .sbp-settings input:disabled {background:#FFF;border:1px solid #7e8993;color:inherit;box-shadow:0 0 0 transparent;}
6
+ .sbp-settings .ui-spinner .ui-button {min-height:30px;box-shadow:none;}
7
+ .sbp-settings .inactive-section > div {opacity:.7;filter:grayscale(1) blur(0.05px); pointer-events: none;}
8
+ .sbp-settings .inactive-section .kinsta-warning {opacity:1;filter:none;}
9
+
10
+ .sbp-settings .cdn-url .csf-before-text, .sbp-settings .cdn-url .csf-after-text {display:inline-block;line-height:2;font-family:monospace;}
11
+ .sbp-settings .cdn-url input {font-family:monospace;}
12
+ .sbp-settings .preboost .csf-fieldset-content>.csf-field {padding:15px 0;}
13
+ .sbp-settings .preboost .csf-fieldset-content>:first-child {padding-top:0;}
14
+ .sbp-settings .preboost .csf-fieldset-content {border:0;box-shadow:none;}
15
+
16
+ .sbp-settings .csf-field-code_editor .CodeMirror {height:190px;}
17
+ .sbp-settings .csf-desc-text {color:#777;}
18
+ .sbp-settings .csf-section.dashboard ul, .sbp-settings .csf-section.about ul {list-style:disc inside;}
19
+ .sbp-settings .csf-section.dashboard .csf-field-content {padding:1rem 2rem;}
20
+ .sbp-settings .csf-section.dashboard .csf-field+.csf-field {border:0;}
21
+
22
+ /*.sbp-settings .csf-section.dashboard .csf-field-heading, .sbp-settings .csf-section.dashboard .csf-field-subheading {background:#F7F7F7;}
23
+ .sbp-settings .csf-field-heading, .sbp-settings .csf-field-subheading {background:#FFF;}
24
+ */
25
+
26
+ .sbp-settings {max-width:75rem;}
admin/images/icon.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><path d="M5.12 12.61l.37-2.32 1.46.84 1.46.85-1.83 1.48-1.82 1.47.36-2.32z" id="a"/><path d="M6.47 13.39l.37-2.32 1.46.85 1.46.84-1.83 1.48-1.82 1.47.36-2.32z" id="b"/><path d="M5.41 13.68l.37-2.32 1.46.84 1.46.84-1.83 1.48L5.04 16l.37-2.32z" id="c"/><path d="M12.35 6.78l-1.91 6.76-2.98-1.72-2.99-1.72 4.9-5.04 4.9-5.04-1.92 6.76z" id="d"/><path d="M6.44 7.43L1.72 9.46l5.32 3.08 5.32 3.07-.59-5.11-.6-5.11-4.73 2.04z" id="e"/><path d="M9.4 12.55l.41 3.41-3.56-2.06-3.55-2.05 3.15-1.35L9 9.15l.4 3.4z" id="f"/></defs><use xlink:href="#a" fill="#fafafa"/><use xlink:href="#b" fill="#fafafa"/><use xlink:href="#c" fill="#fafafa"/><use xlink:href="#d" fill="#fafafa"/><g><use xlink:href="#e" fill="#fafafa"/></g><g><use xlink:href="#f" fill="#fafafa"/></g></svg>
admin/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/js/speed-booster-pack-admin.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * All of the code for your admin-facing JavaScript source
6
+ * should reside in this file.
7
+ *
8
+ * Note: It has been assumed you will write jQuery code here, so the
9
+ * $ function reference has been prepared for usage within the scope
10
+ * of this function.
11
+ *
12
+ * This enables you to define handlers, for when the DOM is ready:
13
+ *
14
+ * $(function() {
15
+ *
16
+ * });
17
+ *
18
+ * When the window is loaded:
19
+ *
20
+ * $( window ).load(function() {
21
+ *
22
+ * });
23
+ *
24
+ * ...and/or other possibilities.
25
+ *
26
+ * Ideally, it is not considered best practise to attach more than a
27
+ * single DOM-ready or window-load handler for a particular page.
28
+ * Although scripts in the WordPress core, Plugins and Themes may be
29
+ * practising this, we should strive to set a better example in our own work.
30
+ */
31
+
32
+ })( jQuery );
advanced-cache.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // check if request method is GET
4
+ if ( ! isset( $_SERVER['REQUEST_METHOD'] ) || $_SERVER['REQUEST_METHOD'] != 'GET' ) {
5
+ return false;
6
+ }
7
+
8
+ // Check if user logged in
9
+ if ( ! empty( $_COOKIE ) ) {
10
+ $cookies_regex = '/^(comment_author|wordpress_logged_in|wp-postpass)_/';
11
+
12
+ foreach ( $_COOKIE as $key => $value ) {
13
+ if ( preg_match( $cookies_regex, $key ) ) {
14
+ return false;
15
+ }
16
+ }
17
+ }
18
+
19
+ // Get settings
20
+ $settings_file = WP_CONTENT_DIR . '/cache/speed-booster/settings.json';
21
+ $settings = sbp_parse_settings_file( $settings_file );
22
+
23
+ if ( ! $settings ) {
24
+ return false;
25
+ }
26
+
27
+ // Set default file name
28
+ $filename = 'index.html';
29
+
30
+ // Check for query strings
31
+ if ( ! empty( $_GET ) && isset( $settings['caching_include_query_strings'] ) ) {
32
+ // Get included rules
33
+ $include_query_strings = sbp_explode_lines( $settings['caching_include_query_strings'] );
34
+
35
+ $query_string_file_name = '';
36
+ // Put all query string parameters in order to generate same filename even if parameter order is different
37
+ ksort( $_GET );
38
+
39
+ foreach ( $_GET as $key => $value ) {
40
+ if ( in_array( $key, $include_query_strings ) ) {
41
+ $query_string_file_name .= "$key-$value-";
42
+ } else {
43
+ return false;
44
+ }
45
+ }
46
+
47
+ if ( '' !== $query_string_file_name ) {
48
+ $query_string_file_name .= '.html';
49
+ $filename = md5( $query_string_file_name );
50
+ }
51
+ }
52
+
53
+ // base path
54
+ $cache_file_path = get_cache_file_path() . $filename;
55
+ if ( ! is_readable( $cache_file_path ) ) {
56
+ return false;
57
+ }
58
+
59
+ // Check if cache file is expired
60
+ if ( isset( $settings['caching_expiry'] ) && ! empty( $settings['caching_expiry'] ) ) {
61
+ $caching_expiry = $settings['caching_expiry'] * HOUR_IN_SECONDS;
62
+ if ( ( filemtime( $cache_file_path ) + $caching_expiry ) < time() ) {
63
+ return false;
64
+ }
65
+ }
66
+
67
+ if ( isset( $settings['caching_exclude_urls'] ) ) {
68
+ $exclude_urls = sbp_explode_lines( $settings['caching_exclude_urls'] );
69
+ $current_url = rtrim( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '/' );
70
+ if ( count( $exclude_urls ) > 0 && in_array( $current_url, $exclude_urls ) ) {
71
+ return false;
72
+ }
73
+ }
74
+
75
+ // output cached file
76
+ readfile( $cache_file_path );
77
+ exit;
78
+
79
+ /**
80
+ * Copied from WordPress wp_is_mobile
81
+ *
82
+ * @return bool
83
+ */
84
+ function sbp_is_mobile() {
85
+ if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
86
+ $is_mobile = false;
87
+ } elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) !== false // Many mobile devices (all iPhone, iPad, etc.)
88
+ || strpos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) !== false
89
+ || strpos( $_SERVER['HTTP_USER_AGENT'], 'Silk/' ) !== false
90
+ || strpos( $_SERVER['HTTP_USER_AGENT'], 'Kindle' ) !== false
91
+ || strpos( $_SERVER['HTTP_USER_AGENT'], 'BlackBerry' ) !== false
92
+ || strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mini' ) !== false
93
+ || strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mobi' ) !== false ) {
94
+ $is_mobile = true;
95
+ } else {
96
+ $is_mobile = false;
97
+ }
98
+
99
+ return $is_mobile;
100
+ }
101
+
102
+
103
+ // generate cache path
104
+ function get_cache_file_path() {
105
+ global $settings;
106
+ $cache_dir = WP_CONTENT_DIR . '/cache/speed-booster';
107
+
108
+ if ( sbp_is_mobile() && isset( $settings['caching_separate_mobile'] ) && $settings['caching_separate_mobile'] ) {
109
+ $cache_dir = WP_CONTENT_DIR . '/cache/speed-booster/mobile';
110
+ }
111
+
112
+ $path = sprintf(
113
+ '%s%s%s%s',
114
+ $cache_dir,
115
+ DIRECTORY_SEPARATOR,
116
+ parse_url(
117
+ 'http://' . strtolower( $_SERVER['HTTP_HOST'] ),
118
+ PHP_URL_HOST
119
+ ),
120
+ parse_url(
121
+ $_SERVER['REQUEST_URI'],
122
+ PHP_URL_PATH
123
+ )
124
+ );
125
+
126
+ if ( is_file( $path ) > 0 ) {
127
+ wp_die( 'Error occured on SBP cache. Please contact you webmaster.' );
128
+ }
129
+
130
+ return rtrim( $path, "/" ) . "/";
131
+ }
132
+
133
+ // read settings file
134
+ function sbp_parse_settings_file( $settings_file ) {
135
+ if ( ! file_exists( $settings_file ) ) {
136
+ return false;
137
+ }
138
+
139
+ if ( ! $settings = json_decode( file_get_contents( $settings_file ), true ) ) {
140
+ return false;
141
+ }
142
+
143
+ return $settings;
144
+ }
145
+
146
+ function sbp_explode_lines( $text ) {
147
+ if ( $text === '' ) {
148
+ return [];
149
+ }
150
+
151
+ return array_map( 'trim', explode( PHP_EOL, $text ) );
152
+ }
css/style.css DELETED
@@ -1,489 +0,0 @@
1
- /* `border-box`... ALL THE THINGS! */
2
- html {
3
- box-sizing: border-box;
4
- }
5
-
6
- :target:before {
7
- content:"";
8
- display:block;
9
- height:90px;
10
- margin-top:-90px;
11
- }
12
-
13
- *,
14
- *:before,
15
- *:after {
16
- box-sizing: inherit;
17
- }
18
-
19
- .clearfix:after {content:"";display:table;clear:both;}
20
-
21
- .wrap .admin-page-title {
22
- margin:0 0 10px 10px;
23
- line-height:1;
24
- }
25
-
26
- .wrap .sb-pack .col-main {
27
- float:left;
28
- width:70%;
29
- }
30
-
31
- .wrap .sb-pack .col-side {
32
- float:left;
33
- width:25%;
34
- margin-left:1%;
35
- overflow-wrap:break-word;
36
- }
37
-
38
- .wrap .sb-pack input[type=text], .wrap .sb-pack textarea {
39
- font-family:monospace;
40
- }
41
-
42
- .wrap .sb-pack input[type=text] {
43
- width:20rem;
44
- }
45
-
46
- .wrap .sb-pack input[type=submit] {
47
- font-family:inherit;
48
- }
49
-
50
- .wrap .sb-pack .about-wrap {
51
- margin:10px;
52
- }
53
-
54
- .wrap .sb-pack .sbp-inline-wrap {
55
- display: inline-block;
56
- margin-right: 10px;
57
- vertical-align: top;
58
- }
59
-
60
- .wrap .sb-pack .sbp-all-enqueued {
61
- background-color: #fcfcfc;
62
- padding: 5px 0px 10px;
63
- border: 1px solid #ddd;
64
- width: auto;
65
- font-family:monospace;
66
- }
67
-
68
- .wrap .sb-pack .sbp-width {
69
- min-width: 200px;
70
- width: auto;
71
- padding: 0 20px;
72
- }
73
-
74
- .wrap .sb-pack .sbp-title-scripts {
75
- min-width: 200px;
76
- width: auto;
77
- display: inline-block;
78
- font-weight: 700;
79
- padding: 0 20px;
80
- }
81
-
82
- .wrap .sb-pack .sbp-columns1 {
83
- display: inline-block;
84
- }
85
-
86
- .wrap .sb-pack .sbp-columns2 {
87
- display: inline-block;
88
- max-width: 73%;
89
- }
90
-
91
- .wrap .sb-pack p {
92
- color: #464646;
93
- }
94
-
95
- .wrap .sb-pack .sbp-div-head {
96
- border-bottom: 1px solid #e1e1e1;
97
- margin: 0 0 5px;
98
- padding: 0 0 5px;
99
- }
100
-
101
- .wrap .sb-pack .sbp-box {
102
- background: #fff;
103
- border: 1px solid #e5e5e5;
104
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
105
- padding: 15px;
106
- margin: 15px 0;
107
- position: relative;
108
- text-align: center;
109
- }
110
-
111
- /* sbp-tooltips */
112
- /**
113
- * Tooltip Styles
114
- */
115
-
116
- /* Base styles for the element that has a tooltip */
117
- [data-tooltip] {
118
- position: relative;
119
- cursor: pointer;
120
- }
121
-
122
- /* Base styles for the entire tooltip */
123
- [data-tooltip]:before,
124
- [data-tooltip]:after {
125
- position: absolute;
126
- visibility: hidden;
127
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
128
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
129
- opacity: 0;
130
- -webkit-transition: opacity 0.2s ease-in-out,
131
- visibility 0.2s ease-in-out,
132
- -webkit-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
133
- -moz-transition: opacity 0.2s ease-in-out,
134
- visibility 0.2s ease-in-out,
135
- -moz-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
136
- transition: opacity 0.2s ease-in-out,
137
- visibility 0.2s ease-in-out,
138
- transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
139
- -webkit-transform: translate3d(0, 0, 0);
140
- -moz-transform: translate3d(0, 0, 0);
141
- transform: translate3d(0, 0, 0);
142
- pointer-events: none;
143
- }
144
-
145
- /* Show the entire tooltip on hover and focus */
146
- [data-tooltip]:hover:before,
147
- [data-tooltip]:hover:after,
148
- [data-tooltip]:focus:before,
149
- [data-tooltip]:focus:after {
150
- visibility: visible;
151
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
152
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
153
- opacity: 1;
154
- }
155
-
156
- /* Base styles for the tooltip's directional arrow */
157
- [data-tooltip]:before {
158
- z-index: 1001;
159
- border: 6px solid transparent;
160
- background: transparent;
161
- content: "";
162
- }
163
-
164
- /* Base styles for the tooltip's content area */
165
- [data-tooltip]:after {
166
- z-index: 1000;
167
- padding: 8px;
168
- width: 360px;
169
- background-color: #000;
170
- background-color: hsla(0, 0%, 20%, 1);
171
- color: #fff;
172
- content: attr(data-tooltip);
173
- line-height: 1.75;
174
- }
175
-
176
- /* Directions */
177
-
178
- /* Top (default) */
179
- [data-tooltip]:before,
180
- [data-tooltip]:after {
181
- bottom: 100%;
182
- left: 50%;
183
- }
184
-
185
- [data-tooltip]:before {
186
- margin-left: -6px;
187
- margin-bottom: -12px;
188
- border-top-color: #000;
189
- border-top-color: hsla(0, 0%, 20%, 0.9);
190
- }
191
-
192
- /* Horizontally align top/bottom tooltips */
193
- [data-tooltip]:after {
194
- margin-left: -80px;
195
- }
196
-
197
- [data-tooltip]:hover:before,
198
- [data-tooltip]:hover:after,
199
- [data-tooltip]:focus:before,
200
- [data-tooltip]:focus:after {
201
- -webkit-transform: translateY(-12px);
202
- -moz-transform: translateY(-12px);
203
- transform: translateY(-12px);
204
- }
205
-
206
- /* Left */
207
-
208
- /* Bottom */
209
-
210
- /* Right */
211
- .tooltip-right:before,
212
- .tooltip-right:after {
213
- bottom: 50%;
214
- left: 100%;
215
- }
216
-
217
- .tooltip-right:before {
218
- margin-bottom: 0;
219
- margin-left: -12px;
220
- border-top-color: transparent;
221
- border-right-color: #000;
222
- border-right-color: hsla(0, 0%, 20%, 0.9);
223
- }
224
-
225
- .tooltip-right:hover:before,
226
- .tooltip-right:hover:after,
227
- .tooltip-right:focus:before,
228
- .tooltip-right:focus:after {
229
- -webkit-transform: translateX(12px);
230
- -moz-transform: translateX(12px);
231
- transform: translateX(12px);
232
- }
233
-
234
- /* Move directional arrows down a bit for left/right tooltips */
235
- .tooltip-right:before {
236
- top: 3px;
237
- }
238
-
239
- /* Vertically center tooltip content for left/right tooltips */
240
- .tooltip-right:after {
241
- margin-left: 0;
242
- margin-bottom: -16px;
243
- }
244
-
245
-
246
- /* Welcome Logo*/
247
- .wp-badge.sbp-welcome-logo {
248
- background-color: #fff;
249
- background-image: url(../inc/images/icon-128x128.jpg);
250
- background-position: center center;
251
- background-size: 70%;
252
- background-repeat: no-repeat;
253
- padding-top: 160px;
254
- }
255
-
256
-
257
- /* Update design */
258
- .sb-pack .label-text {
259
- display:inline-block;
260
- min-width: 350px;
261
- }
262
-
263
- .sb-pack .onoffswitch-wrapper {
264
- position: relative;
265
- width:100%;
266
- margin-bottom:15px;
267
- }
268
-
269
- .sb-pack .onoffswitch-wrapper:last-child {
270
- margin-bottom:0;
271
- }
272
-
273
- .sb-pack .onoffswitch-wrapper span.chekbox-title {
274
- vertical-align: middle;
275
- display:inline-block;
276
- min-width: 350px;
277
- }
278
-
279
- .sb-pack .onoffswitch {
280
- position: relative;
281
- width: 52px;
282
- display: inline-block;
283
- -webkit-user-select: none;
284
- -moz-user-select: none;
285
- -ms-user-select: none;
286
- vertical-align:middle;
287
- }
288
-
289
- .epsilon-toggle {
290
- position: relative;
291
- user-select: none;
292
- display:inline-block;
293
- vertical-align: middle;
294
- }
295
-
296
- .epsilon-toggle__items {
297
- box-sizing: border-box;
298
- }
299
-
300
- .epsilon-toggle__input[type=checkbox] {
301
- border-radius: 2px;
302
- border: 2px solid #6c7781;
303
- margin-right: 12px;
304
- transition: none;
305
- height: 100%;
306
- left: 0;
307
- top: 0;
308
- margin: 0;
309
- padding: 0;
310
- opacity: 0;
311
- position: absolute;
312
- width: 100%;
313
- z-index: 1;
314
- }
315
-
316
- .epsilon-toggle__track {
317
- background-color: #fff;
318
- border: 2px solid #6c7781;
319
- border-radius: 9px;
320
- display: inline-block;
321
- height: 18px;
322
- width: 36px;
323
- vertical-align: top;
324
- transition: background .2s ease;
325
- }
326
-
327
- .epsilon-toggle__thumb {
328
- background-color: #6c7781;
329
- border: 5px solid #6c7781;
330
- border-radius: 50%;
331
- display: block;
332
- height: 10px;
333
- width: 10px;
334
- position: absolute;
335
- left: 4px;
336
- top: 4px;
337
- transition: transform .2s ease;
338
- }
339
-
340
- .epsilon-toggle__off {
341
- position: absolute;
342
- right: 6px;
343
- top: 6px;
344
- color: #6c7781;
345
- fill: currentColor;
346
- }
347
-
348
- .epsilon-toggle__on {
349
- position: absolute;
350
- top: 6px;
351
- left: 8px;
352
- border: 1px solid #fff;
353
- outline: 1px solid transparent;
354
- outline-offset: -1px;
355
- display: none;
356
- }
357
-
358
- .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__track {
359
- background-color: #11a0d2;
360
- border: 9px solid transparent;
361
- }
362
-
363
- .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__thumb {
364
- background-color: #fff;
365
- border-width: 0;
366
- transform: translateX(18px);
367
- }
368
-
369
- .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__off {
370
- display: none;
371
- }
372
-
373
- .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__on {
374
- display: inline-block;
375
- }
376
-
377
- .sb-pack-tab .tooltip-right {
378
- display:inline-block;
379
- vertical-align: middle;
380
- }
381
-
382
- /* Box */
383
- .sbp-box {
384
- margin-top: 15px;
385
- text-align: center;
386
- background: #FFF;
387
- position: relative;
388
- border: 1px solid rgba(0, 0, 0, .1);
389
- }
390
-
391
- .sbp-box img {
392
- width: 125px;
393
- height: 125px;
394
- margin: 0 auto;
395
- margin-bottom: 15px;
396
- display: block;
397
- border: none;
398
- }
399
-
400
- .sbp-box__name {
401
- margin-bottom: 10px;
402
- padding: 0 26px;
403
- font-weight: 600;
404
- }
405
-
406
- .sbp-box__description {
407
- font-size: 0.875em;
408
- margin-bottom: 15px;
409
- font-style: italic;
410
- padding-bottom:30px;
411
- }
412
-
413
- .sbp-box__action-bar {
414
- padding: 15px;
415
- -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
416
- box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
417
- white-space: nowrap;
418
- text-overflow: ellipsis;
419
- background: rgba(255, 255, 255, .65);
420
- text-align: left;
421
- }
422
-
423
- .sbp-box__action-button {
424
- position: absolute;
425
- bottom: 0px;
426
- right: 0px;
427
- padding: 9px 10px 10px;
428
- background: #f6f6f6;
429
- border-top: 1px solid rgba(0, 0, 0, .1);
430
- text-align: center;
431
- width: 100%;
432
- }
433
-
434
- .sbp-static-notice, .sbp-warning {
435
- position: relative;
436
- display: inline-block;
437
- width: 100%;
438
- padding:1rem;
439
- margin: 10px 0 0;
440
- line-height:1.5;
441
- border: 1px solid #e4e0e0;
442
- background: #fff;
443
- color: #0f81aa;
444
- box-shadow: 3px 4px 6px -6px #c3bcbc;
445
- }
446
-
447
- .sbp-static-notice.bg-red, .sbp-warning.bg-red {
448
- background-color: #EF5350;
449
- color: #ffffff;
450
- }
451
-
452
- .sbp-warning {
453
- margin: 0 0 10px;
454
- }
455
-
456
- .nav-tab, .nav-tab .dashicons {line-height:1;}
457
- .nav-tab .dashicons {vertical-align:text-top;}
458
- .nav-tab .dashicons-admin-generic {color:#4CAF50;}
459
- .nav-tab .dashicons-admin-settings {color:#b71c1c;}
460
- .nav-tab .dashicons-admin-site-alt {color:#607D8B;}
461
- .nav-tab .dashicons-chart-area {color:#FF9800;}
462
- .nav-tab .dashicons-dashboard {color:#2196F3;}
463
-
464
- .sb-pack .postbox {margin:1rem 0;}
465
- .sb-pack .postbox .hndle {font-size:1rem;line-height:2;padding:.5rem 1rem;margin:0;}
466
- .sb-pack .postbox .inside {padding:1rem;margin:0;}
467
- .sb-pack .postbox .inside p {margin:0 0 1rem;}
468
- .sb-pack .postbox .inside .button {margin-bottom:.5rem;}
469
- .sb-pack .postbox .inside p:last-child {margin:0;}
470
-
471
- .feature-box .inside .feature-box-image {width:7rem;height:auto;display:block;}
472
- .feature-box .inside .feature-box-left {float:left;margin-right:1rem;}
473
- .feature-box .inside .feature-box-right {float:left;width:calc(100% - 9rem);}
474
- .feature-box .inside .feature-box-title {padding:0;line-height:1;margin:0 0 1rem;}
475
- .feature-box .inside .feature-box-description {font-size:120%;line-height:1.5;}
476
- .feature-box .inside .feature-box-button {}
477
-
478
- @media only screen and (max-width:960px) {
479
- .wrap .sb-pack .col-main, .wrap .sb-pack .col-side {
480
- width:100%;
481
- margin-left:0;
482
- margin-right:0;
483
- float:none;
484
- }
485
- }
486
-
487
- .minimal-analytics-warning {
488
- display: none;
489
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class-sbp-utils.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- die;
6
- }
7
-
8
- class SBP_Utils {
9
- public static function get_file_extension( $url ) {
10
- // Remove Query String
11
- if ( strpos( $url, "?" ) !== false ) {
12
- $url = substr( $url, 0, strpos( $url, "?" ) );
13
- }
14
- if ( strpos( $url, "#" ) !== false ) {
15
- $url = substr( $url, 0, strpos( $url, "#" ) );
16
- }
17
-
18
- return pathinfo( $url, PATHINFO_EXTENSION );
19
- }
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/core.php DELETED
@@ -1,1187 +0,0 @@
1
- <?php
2
-
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- die;
6
- }
7
-
8
- /*--------------------------------------------------------------------------------------------------------
9
- Plugin Core Functions
10
- ---------------------------------------------------------------------------------------------------------*/
11
-
12
- if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
13
-
14
- class Speed_Booster_Pack_Core {
15
- private $remote_analytics_script = [
16
- 'gtm' => 'https://www.googletagmanager.com/gtm.js?id=',
17
- 'analytics' => 'https://www.google-analytics.com/analytics.js',
18
- 'gtag' => 'https://www.googletagmanager.com/gtag/js',
19
- 'minimal' => null,
20
- ];
21
- private $local_analytics_script_url;
22
- private $local_analytics_script_path;
23
-
24
- const SCRIPT_TYPES = [
25
- "application/ecmascript",
26
- "application/javascript",
27
- "application/x-ecmascript",
28
- "application/x-javascript",
29
- "text/ecmascript",
30
- "text/javascript",
31
- "text/javascript1.0",
32
- "text/javascript1.1",
33
- "text/javascript1.2",
34
- "text/javascript1.3",
35
- "text/javascript1.4",
36
- "text/javascript1.5",
37
- "text/jscript",
38
- "text/livescript",
39
- "text/x-ecmascript",
40
- "text/x-javascript",
41
- ];
42
-
43
- public function __construct() {
44
-
45
- global $sbp_options, $sbp_cache;
46
-
47
- $tracking_script = @$sbp_options['sbp_ga_tracking_script'];
48
- $tracking_id = @$sbp_options['sbp_ga_tracking_id'];
49
-
50
- switch ( $tracking_script ) {
51
- case "analytics":
52
- $this->local_analytics_script_url = SBP_CACHE_URL . '/' . $tracking_script . '.js';
53
- $this->local_analytics_script_path = SBP_CACHE_DIR . '/' . $tracking_script . '.js';
54
- break;
55
- case "gtag":
56
- case "gtm":
57
- $this->local_analytics_script_url = SBP_CACHE_URL . '/' . $tracking_script . '_' . $tracking_id . '.js';
58
- $this->local_analytics_script_path = SBP_CACHE_DIR . '/' . $tracking_script . '_' . $tracking_id . '.js';
59
- break;
60
- case "minimal":
61
- $this->local_analytics_script_path = null;
62
- $this->local_analytics_script_url = null;
63
- break;
64
- }
65
-
66
- $is_using_new_js_mover = ! ( get_option( 'sbp_js_footer_exceptions1' ) || get_option( 'sbp_js_footer_exceptions2' ) || get_option( 'sbp_js_footer_exceptions3' ) || get_option( 'sbp_js_footer_exceptions4' ) );
67
- if ( $is_using_new_js_mover ) {
68
- if ( isset( $sbp_options['jquery_to_footer'] ) ) {
69
- add_action( 'wp_enqueue_scripts', [ $this, 'sbp_move_scripts_to_footer' ] );
70
- }
71
- } else {
72
- add_action( 'wp_enqueue_scripts', [ $this, 'sbp_move_scripts_to_footer_deprecated' ] );
73
-
74
- if ( ! is_admin() and isset( $sbp_options['jquery_to_footer'] ) ) {
75
- add_action( 'wp_head', [ $this, 'sbp_scripts_to_head_deprecated' ] );
76
- }
77
- }
78
-
79
- add_action( 'after_setup_theme', [ $this, 'sbp_junk_header_tags' ] );
80
- add_action( 'init', [ $this, 'sbp_init' ] );
81
-
82
- //enable cdn rewrite
83
- if ( isset( $sbp_options['sbp_enable_cdn'] ) && $sbp_options['sbp_enable_cdn'] == "1" && isset( $sbp_options['sbp_cdn_url'] ) ) {
84
- add_action( 'template_redirect', [ $this, 'sbp_cdn_rewrite' ] );
85
- }
86
-
87
-
88
- //enable lazy loading
89
- if ( isset( $sbp_options['sbp_enable_lazy_load'] ) ) {
90
- add_action( 'template_redirect', [ $this, 'sbp_lazy_load' ] );
91
- add_action( 'wp_enqueue_scripts', [ $this, 'sbp_lazy_load_script' ] );
92
- add_action( 'enqueue_embed_scripts', [ $this, 'sbp_lazy_load_script' ] );
93
- }
94
-
95
- // WooCommerce optimizing features
96
- if ( $this->sbp_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
97
- /**
98
- * @since 3.8.3
99
- */
100
- if ( isset( $sbp_options['dequeue_wc_scripts'] ) ) {
101
- add_action( 'wp_enqueue_scripts', [ $this, 'sbp_dequeue_wc_scripts' ] );
102
- }
103
-
104
- /**
105
- * @since 3.8
106
- */
107
- // Disable Cart Fragments
108
- if ( isset( $sbp_options['disable_cart_fragments'] ) ) {
109
- add_action( 'wp_enqueue_scripts', [ $this, 'sbp_disable_cart_fragments' ], 999 );
110
- }
111
-
112
- /**
113
- * Disable password strength meter
114
- * @since 3.8.3
115
- */
116
- if ( isset( $sbp_options['disable_password_strength_meter'] ) ) {
117
- add_action( 'wp_print_scripts', [ $this, 'sbp_disable_password_strength_meter' ], 100 );
118
- }
119
- }
120
-
121
- // Start GA
122
- if ( isset( $sbp_options['sbp_enable_local_analytics'] ) && $sbp_options['sbp_enable_local_analytics'] == "1" ) {
123
-
124
- if ( ! wp_next_scheduled( 'sbp_update_analytics_script' ) ) {
125
- wp_schedule_event( time(), 'daily', 'sbp_update_analytics_script' );
126
- }
127
-
128
- if ( isset( $sbp_options['sbp_monsterinsights'] ) && $sbp_options['sbp_monsterinsights'] == "1" ) {
129
- add_filter( 'monsterinsights_frontend_output_analytics_src',
130
- WP_CONTENT_URL . $this->local_analytics_script_url,
131
- 1000 );
132
- } else {
133
-
134
- if ( isset( $sbp_options['sbp_tracking_position'] ) && $sbp_options['sbp_tracking_position'] == 'footer' ) {
135
- $tracking_code_position = 'wp_footer';
136
- } else {
137
- $tracking_code_position = 'wp_head';
138
- }
139
- add_action( $tracking_code_position, [ $this, 'sbp_print_ga' ], 0 );
140
- }
141
- } else {
142
-
143
- if ( wp_next_scheduled( 'sbp_update_analytics_script' ) ) {
144
- wp_clear_scheduled_hook( 'sbp_update_analytics_script' );
145
- }
146
- }
147
-
148
- add_action( 'sbp_update_analytics_script', [ $this, 'sbp_update_analytics_script' ] );
149
- // End GA
150
-
151
- $this->sbp_css_optimizer(); // CSS Optimizer functions
152
-
153
- // Minifier
154
- if ( ! is_admin() and isset( $sbp_options['minify_html_js'] ) ) {
155
- $this->sbp_minifier();
156
- }
157
-
158
- // Defer parsing of JavaScript
159
- if ( ! is_admin() and isset( $sbp_options['defer_parsing'] ) ) {
160
- add_filter( 'script_loader_tag', [ $this, 'sbp_defer_parsing_of_js' ], 10, 3 );
161
- }
162
-
163
- // Remove query strings from static resources
164
- if ( ! is_admin() and isset( $sbp_options['query_strings'] ) ) {
165
- add_filter( 'script_loader_src', [ $this, 'sbp_remove_query_strings' ], 15, 1 );
166
- add_filter( 'style_loader_src', [ $this, 'sbp_remove_query_strings' ], 15, 1 );
167
- }
168
-
169
- /**
170
- * @since 3.7
171
- */
172
- // Disable emojis
173
- if ( ! is_admin() && isset( $sbp_options['remove_emojis'] ) ) {
174
- add_action( 'init', [ $this, 'sbp_disable_emojis' ] );
175
- }
176
-
177
- /**
178
- * @since 3.8
179
- */
180
- // Enable Instant Page
181
- if ( isset( $sbp_options['enable_instant_page'] ) ) {
182
- add_action( 'wp_enqueue_scripts', [ $this, 'sbp_enable_instant_page' ] );
183
- }
184
-
185
- // Disable Self Pingbacks
186
- if ( isset( $sbp_options['disable_self_pingbacks'] ) ) {
187
- add_action( 'pre_ping', [ $this, 'sbp_remove_self_ping' ] );
188
- }
189
-
190
- // Remove REST API Links
191
- if ( isset( $sbp_options['remove_rest_api_links'] ) ) {
192
- remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
193
- }
194
-
195
- //Disable Dash icons
196
- if ( isset( $sbp_options['disable_dashicons'] ) ) {
197
- add_action( 'wp_enqueue_scripts', [ $this, 'sbp_disable_dash_icons' ] );
198
- }
199
-
200
- if ( isset( $sbp_options['disable_google_maps'] ) ) {
201
- add_action( 'wp_loaded', [ $this, 'sbp_disable_google_maps' ] );
202
- }
203
-
204
- if ( isset( $sbp_options['disable_heartbeat'] ) ) {
205
- add_action( 'init', [ $this, 'sbp_disable_heartbeat' ], 1 );
206
- }
207
-
208
- if ( ! empty( $sbp_options['heartbeat_frequency'] ) ) {
209
- add_filter( 'heartbeat_settings', [ $this, 'sbp_heartbeat_frequency' ], 1 );
210
- }
211
-
212
- if ( ! empty( $sbp_options['limit_post_revisions'] ) && ! defined( 'WP_POST_REVISIONS' ) ) {
213
- define( 'WP_POST_REVISIONS', $sbp_options['limit_post_revisions'] );
214
- }
215
-
216
- if ( ! empty( $sbp_options['autosave_interval'] ) && ! defined( 'AUTOSAVE_INTERVAL' ) ) {
217
- define( 'AUTOSAVE_INTERVAL', $sbp_options['autosave_interval'] );
218
- }
219
-
220
- /**
221
- * @since 3.8.1
222
- */
223
- if ( ! empty( $sbp_options['remove_jquery_migrate'] ) ) {
224
- add_action( 'wp_default_scripts', [ $this, 'sbp_remove_jquery_migrate' ] );
225
- }
226
- } // END public public function __construct
227
-
228
- /**
229
- * Check if a plugin is active or not.
230
- * @since 3.8.3
231
- */
232
- function sbp_is_plugin_active( $path ) {
233
- return in_array( $path, apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
234
- }
235
-
236
- /**
237
- * Dequeue WooCommerce scripts on non-WC pages.
238
- * @since 3.8.3
239
- */
240
- function sbp_dequeue_wc_scripts() {
241
- // check for woocommerce is currently inactive
242
- if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
243
- // dequeue WooCommerce styles
244
- wp_dequeue_style( 'woocommerce_chosen_styles' );
245
- wp_dequeue_style( 'woocommerce_fancybox_styles' );
246
- wp_dequeue_style( 'woocommerce_frontend_styles' );
247
- wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
248
-
249
- // dequeue WooCommerce scripts
250
- wp_dequeue_script( 'wc-add-to-cart' );
251
- wp_dequeue_script( 'wc-add-to-cart-variation' );
252
- wp_dequeue_script( 'wc-cart' );
253
- wp_dequeue_script( 'wc-cart-fragments' );
254
- wp_dequeue_script( 'wc-checkout' );
255
- wp_dequeue_script( 'wc-chosen' );
256
- wp_dequeue_script( 'wc-single-product' );
257
- wp_dequeue_script( 'wc-single-product' );
258
- wp_dequeue_script( 'wc_price_slider' );
259
- wp_dequeue_script( 'woocommerce' );
260
- }
261
- }
262
-
263
- /**
264
- * @since 3.8.1
265
- */
266
- /*--------------------------------------------------------------------------------------------------------
267
- Remove JQuery Migrate
268
- ---------------------------------------------------------------------------------------------------------*/
269
- function sbp_remove_jquery_migrate( $scripts ) {
270
- if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
271
- $jquery_script = $scripts->registered['jquery'];
272
-
273
- if ( $jquery_script->deps ) { // Check whether the script has any dependencies
274
- $jquery_script->deps = array_diff( $jquery_script->deps, [ 'jquery-migrate' ] );
275
- }
276
- }
277
- }
278
-
279
- /*--------------------------------------------------------------------------------------------------------
280
- Disable Dash icons
281
- ---------------------------------------------------------------------------------------------------------*/
282
- function sbp_disable_dash_icons() {
283
- if ( ! is_user_logged_in() ) {
284
- wp_dequeue_style( 'dashicons' );
285
- wp_deregister_style( 'dashicons' );
286
- }
287
- }
288
-
289
- /*--------------------------------------------------------------------------------------------------------
290
- Disable Heartbeat
291
- ---------------------------------------------------------------------------------------------------------*/
292
-
293
- function sbp_disable_heartbeat() {
294
- wp_deregister_script( 'heartbeat' );
295
- }
296
-
297
- /*--------------------------------------------------------------------------------------------------------
298
- Heartbeat Frequency
299
- ---------------------------------------------------------------------------------------------------------*/
300
-
301
- function sbp_heartbeat_frequency() {
302
- global $sbp_options;
303
- $settings['interval'] = $sbp_options['heartbeat_frequency']; //Anything between 15-120
304
-
305
- return $settings;
306
- }
307
-
308
- /*--------------------------------------------------------------------------------------------------------
309
- Disable Google Maps
310
- ---------------------------------------------------------------------------------------------------------*/
311
-
312
- function sbp_disable_google_maps() {
313
- ob_start( [ $this, 'sbp_disable_google_maps_regex' ] );
314
- }
315
-
316
- function sbp_disable_google_maps_regex( $html ) {
317
- $html = preg_replace( '/<script[^<>]*\/\/maps.(googleapis|google|gstatic).com\/[^<>]*><\/script>/i',
318
- '',
319
- $html );
320
-
321
- return $html;
322
- }
323
-
324
- /*--------------------------------------------------------------------------------------------------------
325
- Disable Password Strength Meter
326
- ---------------------------------------------------------------------------------------------------------*/
327
-
328
- function sbp_disable_password_strength_meter() {
329
- global $wp;
330
-
331
- $wp_check = isset( $wp->query_vars['lost-password'] ) || ( isset( $_GET['action'] ) && $_GET['action'] === 'lostpassword' ) || is_page( 'lost_password' );
332
-
333
- $wc_check = ( ( is_account_page() || is_checkout() ) );
334
-
335
- if ( ! $wp_check && ! $wc_check ) {
336
- if ( wp_script_is( 'zxcvbn-async', 'enqueued' ) ) {
337
- wp_dequeue_script( 'zxcvbn-async' );
338
- }
339
-
340
- if ( wp_script_is( 'password-strength-meter', 'enqueued' ) ) {
341
- wp_dequeue_script( 'password-strength-meter' );
342
- }
343
-
344
- if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
345
- wp_dequeue_script( 'wc-password-strength-meter' );
346
- }
347
- }
348
- }
349
-
350
- /*--------------------------------------------------------------------------------------------------------
351
- Init the CSS Optimizer actions
352
- ---------------------------------------------------------------------------------------------------------*/
353
-
354
- function sbp_init() {
355
-
356
- global $sbp_options;
357
-
358
- if ( ! is_admin() and isset( $sbp_options['sbp_css_async'] ) ) {
359
- add_action( 'wp_print_styles', [ $this, 'sbp_print_styles' ], 10 );
360
- add_action( 'wp_footer', [ $this, 'sbp_print_delayed_styles' ], 11 );
361
- }
362
-
363
- }
364
-
365
-
366
- /*--------------------------------------------------------------------------------------------------------
367
- ACTION wp_print_styles
368
- ---------------------------------------------------------------------------------------------------------*/
369
-
370
- function sbp_print_styles() {
371
- global $sbp_styles_are_async;
372
- global $sbp_styles;
373
- global $sbp_options;
374
-
375
- if ( isset( $sbp_options['sbp_css_minify'] ) ) {
376
- $minify = true;
377
- } else {
378
- $minify = false;
379
- }
380
-
381
- $sbp_styles_are_async = true;
382
-
383
- $sbp_styles = sbp_generate_styles_list();
384
-
385
- if ( ! isset( $sbp_options['sbp_footer_css'] ) ) {
386
-
387
- $not_inlined = [];
388
-
389
- foreach ( $sbp_styles as $style ) {
390
- echo "<style type=\"text/css\" " . ( $style['media'] ? "media=\"{$style['media']}\"" : '' ) . ">";
391
- if ( ! sbp_inline_css( $style['src'], $minify ) ) {
392
- $not_inlined[] = $style;
393
- }
394
- echo "</style>";
395
- }
396
- if ( ! empty( $not_inlined ) ) {
397
- foreach ( $not_inlined as $style ) {
398
- ?>
399
- <link rel="stylesheet" href="<?php echo $style['src'] ?>" type="text/css" <?php echo $style['media'] ? "media=\"{$style['media']}\"" : '' ?> /><?php
400
- }
401
- }
402
- }
403
-
404
- sbp_unregister_styles();
405
- }
406
-
407
-
408
- /*--------------------------------------------------------------------------------------------------------
409
- ACTION wp_footer
410
- ---------------------------------------------------------------------------------------------------------*/
411
-
412
- function sbp_print_delayed_styles() {
413
- global $sbp_styles;
414
- global $sbp_options;
415
-
416
- if ( isset( $sbp_options['sbp_css_minify'] ) ) {
417
- $minify = true;
418
- } else {
419
- $minify = false;
420
- }
421
-
422
- if ( isset( $sbp_options['sbp_footer_css'] ) ) {
423
-
424
- $not_inlined = [];
425
- foreach ( $sbp_styles as $style ) {
426
- echo "<style type=\"text/css\" " . ( $style['media'] ? "media=\"{$style['media']}\"" : '' ) . ">";
427
- if ( ! sbp_inline_css( $style['src'], $minify ) ) {
428
- $not_inlined[] = $style;
429
- }
430
- echo "</style>";
431
- }
432
- if ( ! empty( $not_inlined ) ) {
433
- foreach ( $not_inlined as $style ) {
434
- ?>
435
- <link rel="stylesheet" href="<?php echo $style['src'] ?>"
436
- type="text/css" <?php echo $style['media'] ? "media=\"{$style['media']}\"" : '' ?> /><?php
437
- }
438
- }
439
- }
440
- }
441
-
442
-
443
- /*--------------------------------------------------------------------------------------------------------
444
- Moves scripts to the footer to decrease page load times, while keeping stylesheets in the header
445
- ---------------------------------------------------------------------------------------------------------*/
446
-
447
- function sbp_move_scripts_to_footer_deprecated() {
448
-
449
- global $sbp_options;
450
-
451
- if ( ! is_admin() and isset( $sbp_options['jquery_to_footer'] ) ) {
452
-
453
- remove_action( 'wp_head', 'wp_print_scripts' );
454
- remove_action( 'wp_head', 'wp_print_head_scripts', 9 );
455
- remove_action( 'wp_head', 'wp_enqueue_scripts', 1 );
456
-
457
- }
458
-
459
- } // END function sbp_move_scripts_to_footer
460
-
461
- public function sbp_move_scripts_to_footer() {
462
- ob_start( [ $this, 'sbp_move_scripts_to_footer_worker' ] );
463
- }
464
-
465
- public function sbp_move_scripts_to_footer_worker( $html ) {
466
- $scripts_to_move = $this->sbp_get_scripts_to_move( $html );
467
- $this->sbp_remove_scripts_to_move( $html, $scripts_to_move );
468
-
469
- return $html;
470
- }
471
-
472
- private function sbp_remove_scripts_to_move( &$html, $scripts ) {
473
- foreach ( $scripts as $script ) {
474
- $html = str_ireplace( $script, '', $html );
475
- }
476
-
477
- $html = str_ireplace( '</body>', implode( PHP_EOL, $scripts ) . PHP_EOL . '</body>', $html );
478
- }
479
-
480
- private function sbp_get_scripts_to_move( $html ) {
481
- global $sbp_js_footer_exceptions;
482
- $sbp_js_footer_exceptions = array_filter( $sbp_js_footer_exceptions );
483
- preg_match_all( '/<!--[\s\S]*?-->|<script[\s\S]*?>[\s\S]*?<\/script>/im', $html, $result );
484
- $scripts = $result[0];
485
- $includedScripts = [];
486
- // Check types
487
- foreach ( $scripts as $script ) {
488
- preg_match( '/<script[\s\S]*?type=[\'|"](.*?)[\'|"][\s\S]*?>/im', $script, $result );
489
- if ( substr( $script, 0, 4 ) != '<!--' ) {
490
- if ( count( $result ) == 0 ) {
491
- $includedScripts[] = $script;
492
- } else {
493
- $type = trim( str_replace( [ '"', "'" ], '', $result[1] ) );
494
- if ( in_array( $type, self::SCRIPT_TYPES ) ) {
495
- $includedScripts[] = $script;
496
- }
497
- }
498
- }
499
- }
500
-
501
- for ( $i = 0; $i < count( $includedScripts ); $i ++ ) {
502
- // Check if in excluded scripts
503
- $script = $includedScripts[ $i ];
504
- $script = trim( str_replace( [ '\n', '\r' ], '', $script ) );
505
- preg_match( '/<script[\s\S]*?src=?[\'|"](.*?)[\'|"][\s\S]*?>/im', $script, $result );
506
- if ( isset( $result[1] ) && trim( $result[1] ) ) {
507
- $src = $result[1];
508
-
509
- $src = str_replace( [ '\r', '\n' ], '', $src );
510
- foreach ( $sbp_js_footer_exceptions as $exception ) {
511
- if ( strpos( $src, $exception ) !== false ) {
512
- unset( $includedScripts[ $i ] );
513
- }
514
- }
515
-
516
- }
517
- unset( $result );
518
- preg_match( '/<script[\s\S]*?>(.*?)<\/script>/ims', $script, $result );
519
- if ( isset( $result[1] ) && trim( $result[1] ) ) {
520
- foreach ( $sbp_js_footer_exceptions as $exception ) {
521
- if ( substr( $exception, 0, 1 ) !== '/' && strpos( trim( $result[1] ),
522
- trim( $exception ) ) !== false ) {
523
- unset( $includedScripts[ $i ] );
524
- }
525
- }
526
- }
527
- }
528
-
529
- return $includedScripts;
530
- }
531
-
532
- public function sbp_scripts_to_head_deprecated() {
533
-
534
- /**
535
- * Default: add jQuery to header always
536
- *
537
- * @since 3.7
538
- */
539
- global $wp_scripts;
540
- $js_footer_exceptions1 = '';
541
- $js_footer_exceptions2 = '';
542
- $js_footer_exceptions3 = '';
543
- $js_footer_exceptions4 = '';
544
-
545
- if ( get_option( 'sbp_js_footer_exceptions1' ) ) {
546
- $js_footer_exceptions1 = get_option( 'sbp_js_footer_exceptions1' );
547
- }
548
-
549
- if ( get_option( 'sbp_js_footer_exceptions2' ) ) {
550
- $js_footer_exceptions2 = get_option( 'sbp_js_footer_exceptions2' );
551
- }
552
-
553
- if ( get_option( 'sbp_js_footer_exceptions3' ) ) {
554
- $js_footer_exceptions3 = get_option( 'sbp_js_footer_exceptions3' );
555
- }
556
-
557
- if ( get_option( 'sbp_js_footer_exceptions4' ) ) {
558
- $js_footer_exceptions4 = get_option( 'sbp_js_footer_exceptions4' );
559
- }
560
-
561
- $sbp_enq = 'enqueued';
562
- $sbp_reg = 'registered';
563
- $sbp_done = 'done';
564
-
565
- /**
566
- * Echo jQuery in header all the time, if none of the other options contain in
567
- *
568
- * @since 3.7
569
- *
570
- * New solution, going forward so not to crash so many sites anymore
571
- *
572
- * This should come BEFORE the fallback function, since jQuery should be ALWAYS
573
- * the first loaded script.
574
- *
575
- */
576
- if ( $js_footer_exceptions1 !== 'jquery-core' || $js_footer_exceptions2 !== 'jquery-core' || $js_footer_exceptions3 !== 'jquery-core' || $js_footer_exceptions4 !== 'jquery-core' ) {
577
-
578
- // if the script actually exists, dequeue it and re-add it for header inclusion
579
- $script_src = $wp_scripts->registered['jquery-core']->src;
580
-
581
- if ( strpos( $script_src,
582
- 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
583
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
584
- } else {
585
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
586
- }
587
-
588
- $wp_scripts->registered['jquery-core']->src = null;
589
- }
590
-
591
-
592
- /**
593
- * Echo the scripts in the header
594
- *
595
- * @since 3.7
596
- *
597
- * Fallback for previous plugin users
598
- *
599
- */
600
- if ( array_key_exists( $js_footer_exceptions1, $wp_scripts->registered ) ) {
601
- $script_src = '';
602
- // if the script actually exists, dequeue it and re-add it for header inclusion
603
- $script_src = $wp_scripts->registered[ $js_footer_exceptions1 ]->src;
604
-
605
- if ( strpos( $script_src,
606
- 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
607
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
608
- } else {
609
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
610
- }
611
- }
612
-
613
- if ( array_key_exists( $js_footer_exceptions2, $wp_scripts->registered ) ) {
614
- $script_src = '';
615
- // if the script actually exists, dequeue it and re-add it for header inclusion
616
- $script_src = $wp_scripts->registered[ $js_footer_exceptions2 ]->src;
617
-
618
- if ( strpos( $script_src, 'wp-includes' ) == true ) {
619
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
620
- } else {
621
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
622
- }
623
- }
624
-
625
- if ( array_key_exists( $js_footer_exceptions3, $wp_scripts->registered ) ) {
626
- $script_src = '';
627
- // if the script actually exists, dequeue it and re-add it for header inclusion
628
- $script_src = $wp_scripts->registered[ $js_footer_exceptions3 ]->src;
629
-
630
- if ( strpos( $script_src, 'wp-includes' ) == true ) {
631
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
632
- } else {
633
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
634
- }
635
-
636
- }
637
-
638
- if ( array_key_exists( $js_footer_exceptions4, $wp_scripts->registered ) ) {
639
- $script_src = '';
640
- // if the script actually exists, dequeue it and re-add it for header inclusion
641
- $script_src = $wp_scripts->registered[ $js_footer_exceptions4 ]->src;
642
-
643
- if ( strpos( $script_src,
644
- 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
645
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
646
- } else {
647
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
648
- }
649
- }
650
-
651
-
652
- /**
653
- * De-register the scripts from other parts of the site since they're already echo-ed in the header
654
- */
655
- /*--------------------------------------------------------------------------------------------------------*/
656
- if ( ! empty( $sbp_js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_enq ) ) {
657
- wp_dequeue_script( $js_footer_exceptions1 );
658
- }
659
- if ( ! empty( $sbp_js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_enq ) ) {
660
- wp_dequeue_script( $js_footer_exceptions2 );
661
- }
662
- if ( ! empty( $sbp_js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_enq ) ) {
663
- wp_dequeue_script( $sbp_js_footer_exceptions3 );
664
- }
665
- if ( ! empty( $sbp_js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_enq ) ) {
666
- wp_dequeue_script( $sbp_js_footer_exceptions4 );
667
- }
668
- /*--------------------------------------------------------------------------------------------------------*/
669
- if ( ! empty( $js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_reg ) ) {
670
- wp_deregister_script( $js_footer_exceptions1 );
671
- }
672
- if ( ! empty( $js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_reg ) ) {
673
- wp_deregister_script( $js_footer_exceptions2 );
674
- }
675
- if ( ! empty( $js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_reg ) ) {
676
- wp_deregister_script( $js_footer_exceptions3 );
677
- }
678
- if ( ! empty( $js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_reg ) ) {
679
- wp_deregister_script( $js_footer_exceptions4 );
680
- }
681
- /*--------------------------------------------------------------------------------------------------------*/
682
- if ( ! empty( $js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_done ) ) {
683
- wp_deregister_script( $js_footer_exceptions1 );
684
- }
685
- if ( ! empty( $js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_done ) ) {
686
- wp_deregister_script( $js_footer_exceptions2 );
687
- }
688
- if ( ! empty( $js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_done ) ) {
689
- wp_deregister_script( $js_footer_exceptions3 );
690
- }
691
- if ( ! empty( $js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_done ) ) {
692
- wp_deregister_script( $js_footer_exceptions4 );
693
- }
694
-
695
- }
696
-
697
-
698
- /*--------------------------------------------------------------------------------------------------------
699
- Minify HTML and Javascripts
700
- ---------------------------------------------------------------------------------------------------------*/
701
-
702
- function sbp_minifier() {
703
-
704
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/sbp-minifier.php' );
705
- } // End function sbp_minifier()
706
-
707
-
708
- /*--------------------------------------------------------------------------------------------------------
709
- CSS Optimizer
710
- ---------------------------------------------------------------------------------------------------------*/
711
-
712
- function sbp_css_optimizer() {
713
-
714
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/css-optimizer.php' );
715
-
716
- } // End function sbp_css_optimizer()
717
-
718
- /*--------------------------------------------------------------------------------------------------------
719
- Defer parsing of JavaScript and exclusion files
720
- ---------------------------------------------------------------------------------------------------------*/
721
-
722
- function sbp_defer_parsing_of_js( $tag, $handle, $src ) {
723
-
724
- $defer_exclude1 = '';
725
- $defer_exclude2 = '';
726
- $defer_exclude3 = '';
727
- $defer_exclude4 = '';
728
-
729
- if ( get_option( 'sbp_defer_exceptions1' ) ) {
730
- $defer_exclude1 = get_option( 'sbp_defer_exceptions1' );
731
- }
732
-
733
- if ( get_option( 'sbp_defer_exceptions2' ) ) {
734
- $defer_exclude2 = get_option( 'sbp_defer_exceptions2' );
735
- }
736
-
737
- if ( get_option( 'sbp_defer_exceptions3' ) ) {
738
- $defer_exclude3 = get_option( 'sbp_defer_exceptions3' );
739
- }
740
-
741
- if ( get_option( 'sbp_defer_exceptions4' ) ) {
742
- $defer_exclude4 = get_option( 'sbp_defer_exceptions4' );
743
- }
744
-
745
- $array_with_values[] = $defer_exclude1;
746
- $array_with_values[] = $defer_exclude2;
747
- $array_with_values[] = $defer_exclude3;
748
- $array_with_values[] = $defer_exclude4;
749
-
750
- $array_with_values = apply_filters( 'sbp_exclude_defer_scripts',
751
- $array_with_values ); // possibility of extending this via filters
752
- $array_with_values = array_filter( $array_with_values ); // remove empty entries
753
-
754
-
755
- if ( ! in_array( $handle, $array_with_values ) ) {
756
- return '<script src="' . $src . '" defer="defer" type="text/javascript"></script>' . "\n";
757
- }
758
-
759
- return $tag;
760
-
761
- } // END function sbp_defer_parsing_of_js
762
-
763
-
764
- /*--------------------------------------------------------------------------------------------------------
765
- Remove query strings from static resources
766
- ---------------------------------------------------------------------------------------------------------*/
767
-
768
- function sbp_remove_query_strings( $src ) { // remove "?ver" string
769
-
770
- $output = preg_split( "/(\?rev|&ver|\?ver)/", $src );
771
-
772
- return $output[0];
773
-
774
- }
775
-
776
- /*--------------------------------------------------------------------------------------------------------
777
- Disable Emoji
778
- ---------------------------------------------------------------------------------------------------------*/
779
- function sbp_disable_emojis() {
780
- remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
781
- remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
782
- remove_filter( 'embed_head', 'print_emoji_detection_script' );
783
- remove_action( 'wp_print_styles', 'print_emoji_styles' );
784
- remove_action( 'admin_print_styles', 'print_emoji_styles' );
785
- remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
786
- remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
787
- remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
788
-
789
- add_filter( 'tiny_mce_plugins', [ $this, 'sbp_disable_emojis_tinymce' ] );
790
- add_filter( 'wp_resource_hints', [ $this, 'sbp_disable_emojis_dns_prefetch' ], 10, 2 );
791
- }
792
-
793
- function sbp_disable_emojis_tinymce( $plugins ) {
794
- if ( is_array( $plugins ) ) {
795
- return array_diff( $plugins, [ 'wpemoji' ] );
796
- } else {
797
- return [];
798
- }
799
- }
800
-
801
- function sbp_disable_emojis_dns_prefetch( $urls, $relation_type ) {
802
- if ( 'dns-prefetch' == $relation_type ) {
803
- $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2.2.1/svg/' );
804
- $urls = array_diff( $urls, [ $emoji_svg_url ] );
805
- }
806
-
807
- return $urls;
808
- }
809
-
810
- /*--------------------------------------------------------------------------------------------------------
811
- Disable Self Pingbacks
812
- ---------------------------------------------------------------------------------------------------------*/
813
-
814
- function sbp_remove_self_ping( &$links ) {
815
-
816
- $home = get_option( 'home' );
817
- foreach ( $links as $l => $link ) {
818
- if ( 0 === strpos( $link, $home ) ) {
819
- unset( $links[ $l ] );
820
- }
821
- }
822
-
823
- }
824
-
825
- /*--------------------------------------------------------------------------------------------------------
826
- Disable Cart Fragments
827
- ---------------------------------------------------------------------------------------------------------*/
828
-
829
- function sbp_disable_cart_fragments() {
830
- global $wp_scripts;
831
-
832
- $handle = 'wc-cart-fragments';
833
-
834
- $load_cart_fragments_path = $wp_scripts->registered[ $handle ]->src;
835
- $wp_scripts->registered[ $handle ]->src = null;
836
- wp_add_inline_script(
837
- 'jquery',
838
- '
839
- function sbp_getCookie(name) {
840
- var v = document.cookie.match("(^|;) ?" + name + "=([^;]*)(;|$)");
841
- return v ? v[2] : null;
842
- }
843
-
844
- function sbp_check_wc_cart_script() {
845
- var cart_src = "' . $load_cart_fragments_path . '";
846
- var script_id = "sbp_loaded_wc_cart_fragments";
847
-
848
- if( document.getElementById(script_id) !== null ) {
849
- return false;
850
- }
851
-
852
- if( sbp_getCookie("woocommerce_cart_hash") ) {
853
- var script = document.createElement("script");
854
- script.id = script_id;
855
- script.src = cart_src;
856
- script.async = true;
857
- document.head.appendChild(script);
858
- }
859
- }
860
-
861
- sbp_check_wc_cart_script();
862
- document.addEventListener("click", function(){setTimeout(sbp_check_wc_cart_script,1000);});
863
- '
864
- );
865
- }
866
-
867
- /*--------------------------------------------------------------------------------------------------------
868
- Enable Instant Page
869
- ---------------------------------------------------------------------------------------------------------*/
870
-
871
- function sbp_enable_instant_page() {
872
- wp_enqueue_script( 'sbp-ins-page', plugins_url( 'js/inspage.js', __FILE__ ), false, '2.0.0', true );
873
- }
874
-
875
- /*--------------------------------------------------------------------------------------------------------
876
- Remove junk header tags
877
- ---------------------------------------------------------------------------------------------------------*/
878
-
879
- public function sbp_junk_header_tags() {
880
-
881
- global $sbp_options;
882
-
883
- // Remove Adjacent Posts links PREV/NEXT
884
- if ( isset( $sbp_options['remove_adjacent'] ) ) {
885
- remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
886
- }
887
-
888
- // Remove Windows Live Writer Manifest Link
889
- if ( isset( $sbp_options['wml_link'] ) ) {
890
- remove_action( 'wp_head', 'wlwmanifest_link' );
891
- }
892
-
893
- // Remove RSD (Really Simple Discovery) Link
894
- if ( isset( $sbp_options['rsd_link'] ) ) {
895
- remove_action( 'wp_head', 'rsd_link' );
896
- }
897
-
898
- // Remove WordPress Shortlinks from WP Head
899
- if ( isset( $sbp_options['remove_wsl'] ) ) {
900
- remove_action( 'wp_head', 'wp_shortlink_wp_head' );
901
- }
902
-
903
- // Remove WP Generator/Version - for security reasons and cleaning the header
904
- if ( isset( $sbp_options['wp_generator'] ) ) {
905
- remove_action( 'wp_head', 'wp_generator' );
906
- }
907
-
908
- // Remove all feeds
909
- if ( isset( $sbp_options['remove_all_feeds'] ) ) {
910
- remove_action( 'wp_head',
911
- 'feed_links_extra',
912
- 3 ); // remove the feed links from the extra feeds such as category feeds
913
- remove_action( 'wp_head',
914
- 'feed_links',
915
- 2 ); // remove the feed links from the general feeds: Post and Comment Feed
916
- }
917
-
918
- } // END public function sbp_junk_header_tags
919
-
920
- /*--------------------------------
921
- Lazy Loader (native with polyfill)
922
- ---------------------------------*/
923
-
924
- function sbp_lazy_load_script() {
925
- wp_enqueue_script( 'sbp-lazy-load', plugins_url( 'js/lazyload.js', __FILE__ ), false, '15.1.1', true );
926
- wp_add_inline_script( 'sbp-lazy-load',
927
- '
928
- (function() {
929
- var ll = new LazyLoad({
930
- elements_selector: "[loading=lazy]",
931
- use_native: true
932
- });
933
- })();
934
- ' );
935
- }
936
-
937
- function sbp_lazy_load() {
938
- ob_start( [ $this, 'sbp_lazy_loader' ] );
939
- }
940
-
941
- function sbp_lazy_loader( $html ) {
942
- // Find noscripts
943
- $noscript_placeholder = '<!--SBP_NOSCRIPT_PLACEHOLDER-->';
944
- $regex = '/<noscript(.*?)>(.*?)<\/noscript>/si';
945
- preg_match_all($regex, $html, $matches);
946
- $noscripts = $matches[0];
947
- if (count($noscripts) > 0) {
948
- $html = preg_replace( $regex, $noscript_placeholder, $html );
949
- }
950
-
951
- $lazyload_exclusions = array_filter( explode( PHP_EOL, get_option( 'sbp_lazyload_exclusions' ) ) );
952
- $lazyload_exclusions[] = 'data-no-lazy';
953
- $lazyload_exclusions[] = 'skip-lazy';
954
- $lazyload_exclusions[] = 'loading=';
955
- $placeholder = 'data:image/svg+xml,%3Csvg%20xmlns%3D%27http://www.w3.org/2000/svg%27%20viewBox%3D%270%200%203%202%27%3E%3C/svg%3E';
956
-
957
- // Find all images
958
- preg_match_all( '/<(img|source|iframe)(.*?) (src=)[\'|"](.*?)[\'|"](.*?)>/is', $html, $source_elements );
959
-
960
- // If no exclusions exists, don't waste time to determine what to exclude. Go to else block and preg_replace all the content
961
-
962
- $elements_to_be_changed = [];
963
-
964
- // Determine which images will be changed
965
- foreach ( $source_elements[0] as $element ) {
966
- $exclude_element = false;
967
- if ( count( $lazyload_exclusions ) > 0 ) {
968
- foreach ( $lazyload_exclusions as $exclusion ) {
969
- $exclusion = trim( $exclusion );
970
- if ( false !== strpos( $element, $exclusion ) ) {
971
- $exclude_element = true;
972
- }
973
- }
974
- }
975
-
976
- // If not excluded element, put it into the to be changed list.
977
- if ( false === $exclude_element ) {
978
- $elements_to_be_changed[] = $element;
979
- }
980
- }
981
-
982
- // Clean the possible repeated elements
983
- $elements_to_be_changed = array_unique( $elements_to_be_changed );
984
-
985
- // Process all elements marked as to be changed
986
- foreach ( $elements_to_be_changed as $element ) {
987
- $newElement = preg_replace( "/<(img|source|iframe)(.*?) (src=)(.*?)>/is",
988
- '<$1$2 $3"' . $placeholder . '" data-$3$4>',
989
- $element );
990
- $newElement = preg_replace( "/<(img|source|iframe)(.*?) (srcset=)(.*?)>/is",
991
- '<$1$2 $3"' . $placeholder . '" data-$3$4>',
992
- $newElement );
993
- $newElement = preg_replace( "/<(img|source|iframe)(.*?) ?(\/?)>/is",
994
- '<$1$2 loading="lazy" $3>',
995
- $newElement );
996
-
997
- $html = str_replace( $element, $newElement, $html );
998
- }
999
-
1000
- // Re-add noscripts in order
1001
- foreach ($noscripts as $noscript) {
1002
- $pos = strpos($html, $noscript_placeholder);
1003
- if (false !== $pos) {
1004
- $html = substr_replace($html, $noscript, $pos, strlen($noscript_placeholder));
1005
- }
1006
- }
1007
-
1008
- return $html;
1009
- }
1010
-
1011
-
1012
- /*--------------------------------
1013
- CDN Rewrite URLs
1014
- ---------------------------------*/
1015
-
1016
- function sbp_cdn_rewrite() {
1017
- ob_start( [ $this, 'sbp_cdn_rewriter' ] );
1018
- }
1019
-
1020
- function sbp_cdn_rewriter( $html ) {
1021
- global $sbp_options;
1022
- $sbp_cdn_directories = $sbp_options['sbp_cdn_included_directories'];
1023
-
1024
- //Prep Site URL
1025
- $escapedSiteURL = quotemeta( get_option( 'home' ) );
1026
- $regExURL = '(https?:|)' . substr( $escapedSiteURL, strpos( $escapedSiteURL, '//' ) );
1027
-
1028
- //Prep Included Directories
1029
- $directories = 'wp\-content|wp\-includes';
1030
- if ( ! empty( $sbp_cdn_directories ) ) {
1031
- $directoriesArray = array_map( 'trim', explode( ',', $sbp_cdn_directories ) );
1032
- if ( count( $directoriesArray ) > 0 ) {
1033
- $directories = implode( '|', array_map( 'quotemeta', array_filter( $directoriesArray ) ) );
1034
- }
1035
- }
1036
-
1037
- //Rewrite URLs + Return
1038
- $regEx = '#(?<=[(\"\'])(?:' . $regExURL . ')?/(?:((?:' . $directories . ')[^\"\')]+)|([^/\"\']+\.[^/\"\')]+))(?=[\"\')])#';
1039
- $cdnHTML = preg_replace_callback( $regEx, [ $this, 'sbp_cdn_rewrite_url' ], $html );
1040
-
1041
- return $cdnHTML;
1042
- }
1043
-
1044
- function sbp_cdn_rewrite_url( $url ) {
1045
- global $sbp_options;
1046
- $sbp_cdn_url = $sbp_options['sbp_cdn_url'];
1047
- $sbp_cdn_excluded = $sbp_options['sbp_cdn_exclusions'];
1048
-
1049
- //Make Sure CDN URL is Set
1050
- if ( ! empty( $sbp_cdn_url ) ) {
1051
-
1052
- //Don't Rewrite if Excluded
1053
- if ( ! empty( $sbp_cdn_excluded ) ) {
1054
- $exclusions = array_map( 'trim', explode( ',', $sbp_cdn_excluded ) );
1055
- foreach ( $exclusions as $exclusion ) {
1056
- if ( ! empty( $exclusion ) && stristr( $url[0], $exclusion ) != false ) {
1057
- return $url[0];
1058
- }
1059
- }
1060
- }
1061
-
1062
- //Don't Rewrite if Previewing
1063
- if ( is_admin_bar_showing() && isset( $_GET['preview'] ) && $_GET['preview'] == 'true' ) {
1064
- return $url[0];
1065
- }
1066
-
1067
- //Prep Site URL
1068
- $siteURL = get_option( 'home' );
1069
- $siteURL = substr( $siteURL, strpos( $siteURL, '//' ) );
1070
-
1071
- //Replace URL w/ No HTTP/S Prefix
1072
- if ( strpos( $url[0], '//' ) === 0 ) {
1073
- return str_replace( $siteURL, $sbp_cdn_url, $url[0] );
1074
- }
1075
-
1076
- //Found Site URL, Replace Non Relative URL w/ HTTP/S Prefix
1077
- if ( strstr( $url[0], $siteURL ) ) {
1078
- return str_replace( [ 'http:' . $siteURL, 'https:' . $siteURL ], $sbp_cdn_url, $url[0] );
1079
- }
1080
-
1081
- //Replace Relative URL
1082
- return $sbp_cdn_url . $url[0];
1083
- }
1084
-
1085
- //Return Original URL
1086
- return $url[0];
1087
- }
1088
-
1089
- /*--------------------------------------------
1090
- File processor
1091
- --------------------------------------------*/
1092
-
1093
- function sbp_file_process() {
1094
- global $wp_filesystem;
1095
-
1096
- require_once( ABSPATH . '/wp-admin/includes/file.php' );
1097
- WP_Filesystem();
1098
-
1099
- return $wp_filesystem;
1100
- }
1101
-
1102
- /*--------------------------------------------
1103
- Google Analytics
1104
- --------------------------------------------*/
1105
-
1106
- //update analytics.js
1107
- function sbp_update_analytics_script( $script = 'analytics' ) {
1108
- global $sbp_options;
1109
-
1110
- // There is no external js files for minimal analytics and gtm
1111
- if ( 'minimal' == $script ) {
1112
- return false;
1113
- }
1114
-
1115
- $wp_filesystem = $this->sbp_file_process();
1116
- $remote_script = $this->remote_analytics_script[ $script ];
1117
- $tracking_id = $sbp_options['sbp_ga_tracking_id'];
1118
-
1119
- switch ( $script ) {
1120
- case "gtm":
1121
- case "gtag":
1122
- $remote_script = $remote_script . $tracking_id;
1123
- $this->local_analytics_script_path = SBP_CACHE_DIR . '/' . $script . '_' . $tracking_id . '.js';
1124
- break;
1125
- case "analytics":
1126
- $this->local_analytics_script_path = SBP_CACHE_DIR . '/' . $script . '.js';
1127
- break;
1128
- }
1129
-
1130
- if ( ! $wp_filesystem->exists( SBP_CACHE_DIR ) ) {
1131
- $wp_filesystem->mkdir( SBP_CACHE_DIR, FS_CHMOD_DIR );
1132
- $wp_filesystem->mkdir( SBP_CACHE_DIR, FS_CHMOD_DIR );
1133
- }
1134
-
1135
- $file_content = $wp_filesystem->get_contents( $remote_script );
1136
-
1137
- return $wp_filesystem->put_contents( $this->local_analytics_script_path,
1138
- $file_content,
1139
- FS_CHMOD_FILE );
1140
- }
1141
-
1142
-
1143
- //print analytics script
1144
- function sbp_print_ga() {
1145
- global $sbp_options;
1146
- $tracking_script = isset( $sbp_options['sbp_ga_tracking_script'] ) ? $sbp_options['sbp_ga_tracking_script'] : 'analytics';
1147
-
1148
- $update = $this->sbp_update_analytics_script( $tracking_script );
1149
-
1150
- //dont print for logged in admins
1151
- if ( current_user_can( 'manage_options' ) && empty( $sbp_options['sbp_track_loggedin_admins'] ) ) {
1152
- return;
1153
- }
1154
-
1155
- if ( isset( $sbp_options['sbp_ga_tracking_id'] ) && ! empty( $sbp_options['sbp_ga_tracking_id'] ) ) {
1156
- // Get Script URL
1157
- $wp_filesystem = $this->sbp_file_process();
1158
- $ga_script = $this->local_analytics_script_url;
1159
- $tracking_id = $sbp_options['sbp_ga_tracking_id'];
1160
-
1161
- if ( null === $this->local_analytics_script_path || ! $wp_filesystem->exists( $this->local_analytics_script_path ) ) {
1162
- if ( ! $this->sbp_update_analytics_script( $sbp_options['sbp_ga_tracking_script'] ) ) {
1163
- $ga_script = $this->remote_analytics_script[ $sbp_options['sbp_ga_tracking_script'] ];
1164
- }
1165
- }
1166
-
1167
- echo "\n\n<!-- Local Analytics generated with Speed Booster Pack by Optimocha. -->\n";
1168
- switch ( $sbp_options['sbp_ga_tracking_script'] ) {
1169
- case "gtm":
1170
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/template/analytics/gtm.php' );
1171
- break;
1172
- case "analytics":
1173
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/template/analytics/google-analytics.php' );
1174
- break;
1175
- case "gtag":
1176
- $script_src = SBP_CACHE_URL . '/gtag_' . $tracking_id . '.js';
1177
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/template/analytics/gtag.php' );
1178
- break;
1179
- case "minimal":
1180
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/template/analytics/minimal-analytics.php' );
1181
- break;
1182
- }
1183
- }
1184
- }
1185
-
1186
- } // END class Speed_Booster_Pack_Core
1187
- } // END if(!class_exists('Speed_Booster_Pack_Core'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/css-optimizer.php DELETED
@@ -1,234 +0,0 @@
1
- <?php
2
-
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- die;
6
- }
7
-
8
- /*--------------------------------------------------------------------------------------------------------
9
- CSS OPTIMIZER - Generate Styles List
10
- ---------------------------------------------------------------------------------------------------------*/
11
-
12
- function sbp_generate_styles_list() {
13
-
14
- global $wp_styles;
15
-
16
- $list = [];
17
- if ( isset( $wp_styles->queue ) && is_array( $wp_styles->queue ) ) {
18
- foreach ( $wp_styles->queue as $style ) {
19
- if ( is_css_excluded( $style ) ) {
20
- // load excluded stylesheet in render-blocking manner
21
- } else {
22
- $list[] = [
23
- 'src' => $wp_styles->registered[ $style ]->src,
24
- 'media' => $wp_styles->registered[ $style ]->args,
25
- ];
26
- }
27
- }
28
- }
29
-
30
- return $list;
31
-
32
- } // END function sbp_generate_styles_list
33
-
34
-
35
- /*--------------------------------------------------------------------------------------------------------
36
- CSS OPTIMIZER - Deregister all styles
37
- ---------------------------------------------------------------------------------------------------------*/
38
-
39
- function sbp_unregister_styles() {
40
-
41
- global $wp_styles;
42
-
43
- if ( isset( $wp_styles->queue ) && is_array( $wp_styles->queue ) ) {
44
-
45
- foreach ( $wp_styles->queue as $style ) {
46
- if ( is_css_excluded( $style ) ) {
47
- continue;
48
- }
49
-
50
- wp_dequeue_style( $style );
51
- wp_deregister_style( $style );
52
- }
53
- }
54
-
55
- } // END function sbp_unregister_styles
56
-
57
-
58
- /*--------------------------------------------------------------------------------------------------------
59
- CSS OPTIMIZER - Generate inline styles
60
- ---------------------------------------------------------------------------------------------------------*/
61
-
62
- function sbp_inline_css( $url, $minify = true ) {
63
- $base_url = get_bloginfo( 'wpurl' );
64
- $path = false;
65
-
66
- if ( strpos( $url, $base_url ) !== false ) {
67
-
68
- $path = str_replace( $base_url, rtrim( ABSPATH, '/' ), $url );
69
-
70
- } elseif ( $url[0] == '/' && $url[1] != '/' ) {
71
-
72
- $path = rtrim( ABSPATH, '/' ) . $url;
73
- $url = $base_url . $url;
74
- }
75
-
76
- if ( $path && file_exists( $path ) ) {
77
-
78
- $css = file_get_contents( $path );
79
-
80
- if ( $minify ) {
81
- $css = sbp_minify_css( $css );
82
- }
83
-
84
- $css = sbp_rebuilding_css_urls( $css, $url );
85
-
86
- echo $css;
87
-
88
- return true;
89
-
90
- } else {
91
-
92
- return false;
93
- }
94
-
95
- } // END function sbp_inline_css
96
-
97
-
98
- /*--------------------------------------------------------------------------------------------------------
99
- CSS OPTIMIZER - Rebuilding CSS URLs
100
- ---------------------------------------------------------------------------------------------------------*/
101
-
102
- function sbp_rebuilding_css_urls( $css, $url ) {
103
- $css_dir = substr( $url, 0, strrpos( $url, '/' ) );
104
-
105
- // remove empty url() declarations
106
- $css = preg_replace( "/url\(\s?\)/", "", $css );
107
- // new regex expression
108
- $css = preg_replace( "/url(?!\(['\"]?(data:|http:|https:))\(['\"]?([^\/][^'\"\)]*)['\"]?\)/i",
109
- "url({$css_dir}/$2)",
110
- $css );
111
-
112
-
113
- return $css;
114
- }
115
-
116
-
117
- /*--------------------------------------------------------------------------------------------------------
118
- CSS OPTIMIZER - Minify All CSS
119
- ---------------------------------------------------------------------------------------------------------*/
120
-
121
-
122
- function sbp_minify_css( $css ) {
123
-
124
- $css = sbp_remove_multiline_comments( $css );
125
- $css = str_replace( [ "\t", "\n", "\r" ], ' ', $css );
126
- $cnt = 1;
127
-
128
- while ( $cnt > 0 ) {
129
- $css = str_replace( ' ', ' ', $css, $cnt );
130
- }
131
-
132
- $css = str_replace( [ ' {', '{ ' ], '{', $css );
133
- $css = str_replace( [ ' }', '} ', ';}' ], '}', $css );
134
- $css = str_replace( ': ', ':', $css );
135
- $css = str_replace( '; ', ';', $css );
136
- $css = str_replace( ', ', ',', $css );
137
-
138
- return $css;
139
- }
140
-
141
-
142
- /*--------------------------------------------------------------------------------------------------------
143
- CSS OPTIMIZER - Remove multi-line comments from CSS
144
- ---------------------------------------------------------------------------------------------------------*/
145
-
146
- function sbp_remove_multiline_comments( $code, $method = 0 ) {
147
-
148
- switch ( $method ) {
149
- case 1:
150
- {
151
-
152
- $code = preg_replace( '/\s*(?!<\")\/\*[^\*]+\*\/(?!\")\s*/', '', $code );
153
- break;
154
- }
155
-
156
- case 0:
157
-
158
- default :
159
- {
160
-
161
- $open_pos = strpos( $code, '/*' );
162
- while ( $open_pos !== false ) {
163
- $close_pos = strpos( $code, '*/', $open_pos ) + 2;
164
- if ( $close_pos ) {
165
- $code = substr( $code, 0, $open_pos ) . substr( $code, $close_pos );
166
- } else {
167
- $code = substr( $code, 0, $open_pos );
168
- }
169
-
170
- $open_pos = strpos( $code, '/*', $open_pos );
171
- }
172
-
173
- break;
174
- }
175
- }
176
-
177
- return $code;
178
- }
179
-
180
-
181
- /*--------------------------------------------------------------------------------------------------------
182
- CSS OPTIMIZER - get stylesheets exception list
183
- ---------------------------------------------------------------------------------------------------------*/
184
-
185
- function sbp_style_exceptions() {
186
-
187
- /**
188
- * Never include these CSS handles/files
189
- *
190
- * @since 3.7
191
- */
192
- $default = [
193
- 'admin-bar',
194
- 'dashicons',
195
- 'fonts.googleapis.com'
196
- ];
197
-
198
- $array = explode( "\n", get_option( 'sbp_css_exceptions' ) );
199
- $css_exceptions = [];
200
- foreach ( $array as $key => $ex ) {
201
- if ( trim( $ex ) != '' ) {
202
- $css_exceptions[ $key ] = trim( $ex );
203
-
204
- }
205
- }
206
-
207
- // merge defaults with our actual exceptions
208
- $css_exceptions = array_merge( $css_exceptions, $default );
209
-
210
- return (array) $css_exceptions;
211
- }
212
-
213
-
214
- /*--------------------------------------------------------------------------------------------------------
215
- CSS OPTIMIZER - get stylesheets exception names
216
- ---------------------------------------------------------------------------------------------------------*/
217
-
218
- function is_css_excluded( $file ) {
219
- global $wp_styles;
220
- $css_exceptions = sbp_style_exceptions();
221
-
222
- if ( is_string( $file ) && isset( $wp_styles->registered[ $file ] ) ) {
223
- $filename = $file;
224
- $file = $wp_styles->registered[ $file ];
225
- }
226
-
227
- foreach ( $css_exceptions as $ex ) {
228
- if ( $file->handle == $ex || ( strpos( $ex, '.' ) !== false && strpos( $file->src, $ex ) !== false ) ) {
229
- return true;
230
- }
231
- }
232
-
233
- return false;
234
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/helpers.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- die;
5
- }
6
-
7
- /**
8
- * @param string $notice_key
9
- * @param string $display_page
10
- *
11
- * @return int|bool|null
12
- */
13
- function sbp_should_display_notice( $notice_key, $display_page = 'toplevel_page_sbp-options' ) {
14
- // Check if it's dismissed
15
- if ( current_user_can( 'manage_options' ) ) {
16
- $notices = get_user_meta( get_current_user_id(), 'sbp_notices', true );
17
- if ( isset( $notices[ $notice_key ] ) ) {
18
- return $notices[ $notice_key ];
19
- }
20
- }
21
-
22
- // Check the page
23
- $screen = get_current_screen();
24
- if ( $screen->id != $display_page && $display_page != 'all' ) {
25
- return false;
26
- }
27
-
28
- return true;
29
- }
30
-
31
- /**
32
- * @param string $key
33
- * @param bool|int $id
34
- *
35
- * @return void
36
- */
37
- function sbp_dismiss_notice( $key = null, $id = false ) {
38
- if ( $key === "" ) {
39
- $key = $_GET['notice_key'];
40
- }
41
-
42
- if ( current_user_can( 'manage_options' ) ) {
43
- $notices = get_user_meta( get_current_user_id(), 'sbp_notices', true );
44
- if ( ! $notices ) {
45
- $notices = [];
46
- }
47
- $notices[ $key ] = $id;
48
- update_user_meta( get_current_user_id(), 'sbp_notices', $notices );
49
- }
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/images/icon-128x128.jpg DELETED
Binary file
inc/images/icon-16x16.png DELETED
Binary file
inc/images/logo.png DELETED
Binary file
inc/images/optimocha.png DELETED
Binary file
inc/images/shortpixel.png DELETED
Binary file
inc/images/wp-engine.png DELETED
Binary file
inc/js/admin-scripts.js DELETED
@@ -1,107 +0,0 @@
1
- /**
2
- * The contents of this script only gets loaded on the plugin page
3
- */
4
- (function( $ ) {
5
-
6
- 'use strict';
7
-
8
- /**
9
- * Function used to handle admin UI postboxes
10
- */
11
- function admin_postboxes() {
12
-
13
- postboxes.add_postbox_toggles( pagenow );
14
-
15
- // set cursor to pointer
16
- $( '.postbox .hndle' ).css( 'cursor', 'pointer' );
17
- }
18
-
19
-
20
-
21
- /**
22
- * Handle UI tab switching via jQuery instead of relying on CSS only
23
- */
24
- function admin_tab_switching() {
25
-
26
- var nav_tab_selector = '.nav-tab-wrapper a';
27
- var initial_tab_href = '';
28
-
29
- // get the first tab href
30
- if (window.location.hash) {
31
- initial_tab_href = window.location.hash;
32
- } else {
33
- initial_tab_href = localStorage.getItem('sbp-current-page') || $(nav_tab_selector + ':first').attr('href');
34
- }
35
-
36
- // make all the tabs, except the first one hidden
37
- $( '.sb-pack-tab' ).each( function( index, value ) {
38
- if ( '#' + $( this ).attr( 'id' ) !== initial_tab_href ) {
39
- $( this ).hide();
40
- }
41
- } );
42
-
43
- $( nav_tab_selector ).removeClass( 'nav-tab-active' ); // remove class from previous selector
44
- $( nav_tab_selector + '[href=' + initial_tab_href + ']' ).addClass( 'nav-tab-active' ); // remove class from previous selector
45
- window.location.hash = initial_tab_href;
46
-
47
- /**
48
- * Listen for click events on nav-tab links
49
- */
50
- $( nav_tab_selector ).click( function( event ) {
51
-
52
- $( nav_tab_selector ).removeClass( 'nav-tab-active' ); // remove class from previous selector
53
- $( this ).addClass( 'nav-tab-active' ).blur(); // add class to currently clicked selector
54
-
55
- var clicked_tab = $( this ).attr( 'href' );
56
- localStorage.setItem('sbp-current-page', clicked_tab);
57
-
58
- $( '.sb-pack-tab' ).each( function( index, value ) {
59
- if ( '#' + $( this ).attr( 'id' ) !== clicked_tab ) {
60
- $( this ).hide();
61
- }
62
-
63
- $( clicked_tab ).fadeIn();
64
-
65
- } );
66
-
67
- // prevent default behavior
68
- // event.preventDefault();
69
-
70
- } );
71
- }
72
-
73
- $( document ).ready( function() {
74
- admin_postboxes();
75
- admin_tab_switching();
76
-
77
-
78
- if ($('[name*="sbp_ga_tracking_script"]:checked').val() == 'minimal') {
79
- $('.minimal-analytics-warning').stop().show(0);
80
- }
81
-
82
- // Local analytics
83
- $('[name*="sbp_ga_tracking_script"]').on('change', function(e) {
84
- if (e.target.value === 'minimal') {
85
- $('.minimal-analytics-warning').stop().slideDown();
86
- } else {
87
- $('.minimal-analytics-warning').stop().slideUp();
88
- }
89
- });
90
-
91
- var $elems = $('[name*="sbp_settings[sbp_disable_display_features]"], [name*="sbp_settings[sbp_anonymize_ip]"], [name*="sbp_settings[sbp_track_loggedin_admins]"]');
92
-
93
- if ($('[name*="sbp_ga_tracking_script"]:checked').val() == 'minimal' || $('[name*="sbp_ga_tracking_script"]:checked').val() == 'gtm') {
94
- $elems.parent().parent().parent().stop().hide();
95
- }
96
-
97
- // Local analytics
98
- $('[name*="sbp_ga_tracking_script"]').on('change', function(e) {
99
- if (e.target.value === 'minimal' || e.target.value === 'gtm') {
100
- $elems.parent().parent().parent().stop().slideUp();
101
- } else {
102
- $elems.parent().parent().parent().stop().slideDown();
103
- }
104
- });
105
- } );
106
-
107
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/js/analytics.js DELETED
@@ -1,73 +0,0 @@
1
- (function(){var k=this||self,l=function(a,b){a=a.split(".");var c=k;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}:c[d]=b};var n=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},p=function(a){for(var b in a)if(a.hasOwnProperty(b))return!0;return!1};var q=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;var r=window,u=document,v=function(a,b){u.addEventListener?u.addEventListener(a,b,!1):u.attachEvent&&u.attachEvent("on"+a,b)};var w=/:[0-9]+$/,y=function(a,b){b&&(b=String(b).toLowerCase());if("protocol"===b||"port"===b)a.protocol=x(a.protocol)||x(r.location.protocol);"port"===b?a.port=String(Number(a.hostname?a.port:r.location.port)||("http"==a.protocol?80:"https"==a.protocol?443:"")):"host"===b&&(a.hostname=(a.hostname||r.location.hostname).replace(w,"").toLowerCase());var c=x(a.protocol);b&&(b=String(b).toLowerCase());switch(b){case "url_no_fragment":b="";a&&a.href&&(b=a.href.indexOf("#"),b=0>b?a.href:a.href.substr(0,
2
- b));a=b;break;case "protocol":a=c;break;case "host":a=a.hostname.replace(w,"").toLowerCase();break;case "port":a=String(Number(a.port)||("http"==c?80:"https"==c?443:""));break;case "path":a="/"==a.pathname.substr(0,1)?a.pathname:"/"+a.pathname;a=a.split("/");a:if(b=a[a.length-1],c=[],Array.prototype.indexOf)b=c.indexOf(b),b="number"==typeof b?b:-1;else{for(var d=0;d<c.length;d++)if(c[d]===b){b=d;break a}b=-1}0<=b&&(a[a.length-1]="");a=a.join("/");break;case "query":a=a.search.replace("?","");break;
3
- case "extension":a=a.pathname.split(".");a=1<a.length?a[a.length-1]:"";a=a.split("/")[0];break;case "fragment":a=a.hash.replace("#","");break;default:a=a&&a.href}return a},x=function(a){return a?a.replace(":","").toLowerCase():""},z=function(a){var b=u.createElement("a");a&&(b.href=a);a=b.pathname;"/"!==a[0]&&(a="/"+a);var c=b.hostname.replace(w,"");return{href:b.href,protocol:b.protocol,host:b.host,hostname:c,pathname:a,search:b.search,hash:b.hash,port:b.port}};function A(){for(var a=B,b={},c=0;c<a.length;++c)b[a[c]]=c;return b}function C(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";a+=a.toLowerCase()+"0123456789-_";return a+"."}
4
- var B,D,E=function(a){B=B||C();D=D||A();for(var b=[],c=0;c<a.length;c+=3){var d=c+1<a.length,e=c+2<a.length,f=a.charCodeAt(c),g=d?a.charCodeAt(c+1):0,h=e?a.charCodeAt(c+2):0,m=f>>2;f=(f&3)<<4|g>>4;g=(g&15)<<2|h>>6;h&=63;e||(h=64,d||(g=64));b.push(B[m],B[f],B[g],B[h])}return b.join("")},F=function(a){function b(m){for(;d<a.length;){var t=a.charAt(d++),J=D[t];if(null!=J)return J;if(!/^[\s\xa0]*$/.test(t))throw Error("Unknown base64 encoding at char: "+t);}return m}B=B||C();D=D||A();for(var c="",d=0;;){var e=
5
- b(-1),f=b(0),g=b(64),h=b(64);if(64===h&&-1===e)return c;c+=String.fromCharCode(e<<2|f>>4);64!=g&&(c+=String.fromCharCode(f<<4&240|g>>2),64!=h&&(c+=String.fromCharCode(g<<6&192|h)))}};var G;function H(a,b){if(!a||b===u.location.hostname)return!1;for(var c=0;c<a.length;c++)if(a[c]instanceof RegExp){if(a[c].test(b))return!0}else if(0<=b.indexOf(a[c]))return!0;return!1}var I=function(){var a={};var b=r.google_tag_data;r.google_tag_data=void 0===b?a:b;a=r.google_tag_data;b=a.gl;b&&b.decorators||(b={decorators:[]},a.gl=b);return b};var K=/(.*?)\*(.*?)\*(.*)/,L=/([^?#]+)(\?[^#]*)?(#.*)?/,M=/(.*?)(^|&)_gl=([^&]*)&?(.*)/,O=function(a){var b=[],c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];void 0!==d&&d===d&&null!==d&&"[object Object]"!==d.toString()&&(b.push(c),b.push(E(String(d))))}a=b.join("*");return["1",N(a),a].join("*")},N=function(a,b){a=[window.navigator.userAgent,(new Date).getTimezoneOffset(),window.navigator.userLanguage||window.navigator.language,Math.floor((new Date).getTime()/60/1E3)-(void 0===b?0:b),a].join("*");
6
- if(!(b=G)){b=Array(256);for(var c=0;256>c;c++){for(var d=c,e=0;8>e;e++)d=d&1?d>>>1^3988292384:d>>>1;b[c]=d}}G=b;b=4294967295;for(c=0;c<a.length;c++)b=b>>>8^G[(b^a.charCodeAt(c))&255];return((b^-1)>>>0).toString(36)},R=function(a){return function(b){var c=z(r.location.href),d=c.search.replace("?","");a:{var e=d.split("&");for(var f=0;f<e.length;f++){var g=e[f].split("=");if("_gl"===decodeURIComponent(g[0]).replace(/\+/g," ")){e=g.slice(1).join("=");break a}}e=void 0}b.query=P(e||"")||{};e=y(c,"fragment");
7
- f=e.match(M);b.fragment=P(f&&f[3]||"")||{};a&&Q(c,d,e)}};function S(a){var b=M.exec(a);if(b){var c=b[2],d=b[4];a=b[1];d&&(a=a+c+d)}return a}
8
- var Q=function(a,b,c){function d(e,f){e=S(e);e.length&&(e=f+e);return e}r.history&&r.history.replaceState&&(M.test(b)||M.test(c))&&(a=y(a,"path"),b=d(b,"?"),c=d(c,"#"),r.history.replaceState({},void 0,""+a+b+c))},P=function(a){var b=void 0===b?3:b;try{if(a){a:{for(var c=0;3>c;++c){var d=K.exec(a);if(d){var e=d;break a}a=decodeURIComponent(a)}e=void 0}if(e&&"1"===e[1]){var f=e[2],g=e[3];a:{for(e=0;e<b;++e)if(f===N(g,e)){var h=!0;break a}h=!1}if(h){b={};var m=g?g.split("*"):[];for(g=0;g<m.length;g+=
9
- 2)b[m[g]]=F(m[g+1]);return b}}}}catch(t){}};function T(a,b,c){function d(h){h=S(h);var m=h.charAt(h.length-1);h&&"&"!==m&&(h+="&");return h+g}c=void 0===c?!1:c;var e=L.exec(b);if(!e)return"";b=e[1];var f=e[2]||"";e=e[3]||"";var g="_gl="+a;c?e="#"+d(e.substring(1)):f="?"+d(f.substring(1));return""+b+f+e}
10
- function U(a,b,c){for(var d={},e={},f=I().decorators,g=0;g<f.length;++g){var h=f[g];(!c||h.forms)&&H(h.domains,b)&&(h.fragment?n(e,h.callback()):n(d,h.callback()))}p(d)&&(b=O(d),c?V(b,a):W(b,a,!1));!c&&p(e)&&(c=O(e),W(c,a,!0))}function W(a,b,c){b.href&&(a=T(a,b.href,void 0===c?!1:c),q.test(a)&&(b.href=a))}
11
- function V(a,b){if(b&&b.action){var c=(b.method||"").toLowerCase();if("get"===c){c=b.childNodes||[];for(var d=!1,e=0;e<c.length;e++){var f=c[e];if("_gl"===f.name){f.setAttribute("value",a);d=!0;break}}d||(c=u.createElement("input"),c.setAttribute("type","hidden"),c.setAttribute("name","_gl"),c.setAttribute("value",a),b.appendChild(c))}else"post"===c&&(a=T(a,b.action),q.test(a)&&(b.action=a))}}
12
- var X=function(a){try{a:{var b=a.target||a.srcElement||{};for(a=100;b&&0<a;){if(b.href&&b.nodeName.match(/^a(?:rea)?$/i)){var c=b;break a}b=b.parentNode;a--}c=null}if(c){var d=c.protocol;"http:"!==d&&"https:"!==d||U(c,c.hostname,!1)}}catch(e){}},Y=function(a){try{var b=a.target||a.srcElement||{};if(b.action){var c=y(z(b.action),"host");U(b,c,!0)}}catch(d){}};l("google_tag_data.glBridge.auto",function(a,b,c,d){var e=I();e.init||(v("mousedown",X),v("keyup",X),v("submit",Y),e.init=!0);a={callback:a,domains:b,fragment:"fragment"===c,forms:!!d};I().decorators.push(a)});l("google_tag_data.glBridge.decorate",function(a,b,c){c=!!c;a=O(a);if(b.tagName){if("a"==b.tagName.toLowerCase())return W(a,b,c);if("form"==b.tagName.toLowerCase())return V(a,b)}if("string"==typeof b)return T(a,b,c)});l("google_tag_data.glBridge.generate",O);
13
- l("google_tag_data.glBridge.get",function(a,b){var c=R(!!b);b=I();b.data||(b.data={query:{},fragment:{}},c(b.data));c={};if(b=b.data)n(c,b.query),a&&n(c,b.fragment);return c});})(window);
14
- (function(){function La(a){var b=1,c;if(a)for(b=0,c=a.length-1;0<=c;c--){var d=a.charCodeAt(c);b=(b<<6&268435455)+d+(d<<14);d=b&266338304;b=0!=d?b^d>>21:b}return b};var $c=function(a){this.w=a||[]};$c.prototype.set=function(a){this.w[a]=!0};$c.prototype.encode=function(){for(var a=[],b=0;b<this.w.length;b++)this.w[b]&&(a[Math.floor(b/6)]^=1<<b%6);for(b=0;b<a.length;b++)a[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(a[b]||0);return a.join("")+"~"};var ha=window.GoogleAnalyticsObject,Qa;if(Qa=void 0!=ha)Qa=-1<(ha.constructor+"").indexOf("String");var Za;if(Za=Qa){var te=window.GoogleAnalyticsObject;Za=te?te.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""):""}var gb=Za||"ga",jd=/^(?:utma\.)?\d+\.\d+$/,kd=/^amp-[\w.-]{22,64}$/,Ba=!1;var vd=new $c;function J(a){vd.set(a)}var Td=function(a){a=Dd(a);a=new $c(a);for(var b=vd.w.slice(),c=0;c<a.w.length;c++)b[c]=b[c]||a.w[c];return(new $c(b)).encode()},Dd=function(a){a=a.get(Gd);ka(a)||(a=[]);return a};var ea=function(a){return"function"==typeof a},ka=function(a){return"[object Array]"==Object.prototype.toString.call(Object(a))},qa=function(a){return void 0!=a&&-1<(a.constructor+"").indexOf("String")},D=function(a,b){return 0==a.indexOf(b)},sa=function(a){return a?a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""):""},ra=function(){for(var a=O.navigator.userAgent+(M.cookie?M.cookie:"")+(M.referrer?M.referrer:""),b=a.length,c=O.history.length;0<c;)a+=c--^b++;return[hd()^La(a)&2147483647,Math.round((new Date).getTime()/
15
- 1E3)].join(".")},ta=function(a){var b=M.createElement("img");b.width=1;b.height=1;b.src=a;return b},ua=function(){},K=function(a){if(encodeURIComponent instanceof Function)return encodeURIComponent(a);J(28);return a},L=function(a,b,c,d){try{a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent&&a.attachEvent("on"+b,c)}catch(e){J(27)}},f=/^[\w\-:/.?=&%!\[\]]+$/,Nd=/^[\w+/_-]+[=]{0,2}$/,wa=function(a,b,c){if(a){var d=M.querySelector&&M.querySelector("script[nonce]")||null;d=d?d.nonce||d.getAttribute&&
16
- d.getAttribute("nonce")||"":"";if(c){var e=c="";b&&f.test(b)&&(c=' id="'+b+'"');d&&Nd.test(d)&&(e=' nonce="'+d+'"');f.test(a)&&M.write("<script"+c+e+' src="'+a+'">\x3c/script>')}else c=M.createElement("script"),c.type="text/javascript",c.async=!0,c.src=a,b&&(c.id=b),d&&c.setAttribute("nonce",d),a=M.getElementsByTagName("script")[0],a.parentNode.insertBefore(c,a)}},be=function(a,b){return E(M.location[b?"href":"search"],a)},E=function(a,b){return(a=a.match("(?:&|#|\\?)"+K(b).replace(/([.*+?^=!:${}()|\[\]\/\\])/g,
17
- "\\$1")+"=([^&#]*)"))&&2==a.length?a[1]:""},xa=function(){var a=""+M.location.hostname;return 0==a.indexOf("www.")?a.substring(4):a},de=function(a,b){var c=a.indexOf(b);if(5==c||6==c)if(a=a.charAt(c+b.length),"/"==a||"?"==a||""==a||":"==a)return!0;return!1},ya=function(a,b){var c=M.referrer;if(/^(https?|android-app):\/\//i.test(c)){if(a)return c;a="//"+M.location.hostname;if(!de(c,a))return b&&(b=a.replace(/\./g,"-")+".cdn.ampproject.org",de(c,b))?void 0:c}},za=function(a,b){if(1==b.length&&null!=
18
- b[0]&&"object"===typeof b[0])return b[0];for(var c={},d=Math.min(a.length+1,b.length),e=0;e<d;e++)if("object"===typeof b[e]){for(var g in b[e])b[e].hasOwnProperty(g)&&(c[g]=b[e][g]);break}else e<a.length&&(c[a[e]]=b[e]);return c};var ee=function(){this.keys=[];this.values={};this.m={}};ee.prototype.set=function(a,b,c){this.keys.push(a);c?this.m[":"+a]=b:this.values[":"+a]=b};ee.prototype.get=function(a){return this.m.hasOwnProperty(":"+a)?this.m[":"+a]:this.values[":"+a]};ee.prototype.map=function(a){for(var b=0;b<this.keys.length;b++){var c=this.keys[b],d=this.get(c);d&&a(c,d)}};var O=window,M=document,va=function(a,b){return setTimeout(a,b)};var F=window,Ea=document,G=function(a){var b=F._gaUserPrefs;if(b&&b.ioo&&b.ioo()||a&&!0===F["ga-disable-"+a])return!0;try{var c=F.external;if(c&&c._gaUserPrefs&&"oo"==c._gaUserPrefs)return!0}catch(g){}a=[];b=String(Ea.cookie||document.cookie).split(";");for(c=0;c<b.length;c++){var d=b[c].split("="),e=d[0].replace(/^\s*|\s*$/g,"");e&&"AMP_TOKEN"==e&&((d=d.slice(1).join("=").replace(/^\s*|\s*$/g,""))&&(d=decodeURIComponent(d)),a.push(d))}for(b=0;b<a.length;b++)if("$OPT_OUT"==a[b])return!0;return Ea.getElementById("__gaOptOutExtension")?
19
- !0:!1};var Ca=function(a){var b=[],c=M.cookie.split(";");a=new RegExp("^\\s*"+a+"=\\s*(.*?)\\s*$");for(var d=0;d<c.length;d++){var e=c[d].match(a);e&&b.push(e[1])}return b},zc=function(a,b,c,d,e,g){e=G(e)?!1:eb.test(M.location.hostname)||"/"==c&&vc.test(d)?!1:!0;if(!e)return!1;b&&1200<b.length&&(b=b.substring(0,1200));c=a+"="+b+"; path="+c+"; ";g&&(c+="expires="+(new Date((new Date).getTime()+g)).toGMTString()+"; ");d&&"none"!==d&&(c+="domain="+d+";");d=M.cookie;M.cookie=c;if(!(d=d!=M.cookie))a:{a=Ca(a);
20
- for(d=0;d<a.length;d++)if(b==a[d]){d=!0;break a}d=!1}return d},Cc=function(a){return encodeURIComponent?encodeURIComponent(a).replace(/\(/g,"%28").replace(/\)/g,"%29"):a},vc=/^(www\.)?google(\.com?)?(\.[a-z]{2})?$/,eb=/(^|\.)doubleclick\.net$/i;var oc,Id=/^.*Version\/?(\d+)[^\d].*$/i,ne=function(){if(void 0!==O.__ga4__)return O.__ga4__;if(void 0===oc){var a=O.navigator.userAgent;if(a){var b=a;try{b=decodeURIComponent(a)}catch(c){}if(a=!(0<=b.indexOf("Chrome"))&&!(0<=b.indexOf("CriOS"))&&(0<=b.indexOf("Safari/")||0<=b.indexOf("Safari,")))b=Id.exec(b),a=11<=(b?Number(b[1]):-1);oc=a}else oc=!1}return oc};var Fa,Ga,fb,Ab,ja=/^https?:\/\/[^/]*cdn\.ampproject\.org\//,Ue=/^(?:www\.|m\.|amp\.)+/,Ub=[],da=function(a){a:{if(ja.test(M.referrer)){var b=M.location.hostname.replace(Ue,"");b:{var c=M.referrer;c=c.replace(/^https?:\/\//,"");var d=c.replace(/^[^/]+/,"").split("/"),e=d[2];d=(d="s"==e?d[3]:e)?decodeURIComponent(d):d;if(!d){if(0==c.indexOf("xn--")){c="";break b}(c=c.match(/(.*)\.cdn\.ampproject\.org\/?$/))&&2==c.length&&(d=c[1].replace(/-/g,".").replace(/\.\./g,"-"))}c=d?d.replace(Ue,""):""}if(b==
21
- c){b=!0;break a}else J(78)}b=!1}if(b&&!1!==a[Kd]&&(void 0===Ab&&(b=(b=De.get())&&b._ga||void 0)&&(Ab=b,J(81)),void 0!==Ab))return a[Q]||(a[Q]=Ab),!1;if(a[Kd]){J(67);if(a[ac]&&"cookie"!=a[ac])return!1;if(void 0!==Ab)a[Q]||(a[Q]=Ab);else{a:if(b=String(a[W]||xa()),c=String(a[Yb]||"/"),d=Ca(String(a[U]||"_ga")),b=na(d,b,c),!b||jd.test(b))b=!0;else if(b=Ca("AMP_TOKEN"),0==b.length)b=!0;else{if(1==b.length&&(b=decodeURIComponent(b[0]),"$RETRIEVING"==b||"$OPT_OUT"==b||"$ERROR"==b||"$NOT_FOUND"==b)){b=!0;
22
- break a}b=!1}if(b&&tc(ic,String(a[Na])))return!0}}return!1},ic=function(){Z.D([ua])},tc=function(a,b){var c=Ca("AMP_TOKEN");if(1<c.length)return J(55),!1;c=decodeURIComponent(c[0]||"");if("$OPT_OUT"==c||"$ERROR"==c||G(b))return J(62),!1;if(!ja.test(M.referrer)&&"$NOT_FOUND"==c)return J(68),!1;if(void 0!==Ab)return J(56),va(function(){a(Ab)},0),!0;if(Fa)return Ub.push(a),!0;if("$RETRIEVING"==c)return J(57),va(function(){tc(a,b)},1E4),!0;Fa=!0;c&&"$"!=c[0]||(xc("$RETRIEVING",3E4),setTimeout(Mc,3E4),
23
- c="");return Pc(c,b)?(Ub.push(a),!0):!1},Pc=function(a,b,c){if(!window.JSON)return J(58),!1;var d=O.XMLHttpRequest;if(!d)return J(59),!1;var e=new d;if(!("withCredentials"in e))return J(60),!1;e.open("POST",(c||"https://ampcid.google.com/v1/publisher:getClientId")+"?key=AIzaSyA65lEHUEizIsNtlbNo-l2K18dT680nsaM",!0);e.withCredentials=!0;e.setRequestHeader("Content-Type","text/plain");e.onload=function(){Fa=!1;if(4==e.readyState){try{200!=e.status&&(J(61),Qc("","$ERROR",3E4));var g=JSON.parse(e.responseText);
24
- g.optOut?(J(63),Qc("","$OPT_OUT",31536E6)):g.clientId?Qc(g.clientId,g.securityToken,31536E6):!c&&g.alternateUrl?(Ga&&clearTimeout(Ga),Fa=!0,Pc(a,b,g.alternateUrl)):(J(64),Qc("","$NOT_FOUND",36E5))}catch(ca){J(65),Qc("","$ERROR",3E4)}e=null}};d={originScope:"AMP_ECID_GOOGLE"};a&&(d.securityToken=a);e.send(JSON.stringify(d));Ga=va(function(){J(66);Qc("","$ERROR",3E4)},1E4);return!0},Mc=function(){Fa=!1},xc=function(a,b){if(void 0===fb){fb="";for(var c=id(),d=0;d<c.length;d++){var e=c[d];if(zc("AMP_TOKEN",
25
- encodeURIComponent(a),"/",e,"",b)){fb=e;return}}}zc("AMP_TOKEN",encodeURIComponent(a),"/",fb,"",b)},Qc=function(a,b,c){Ga&&clearTimeout(Ga);b&&xc(b,c);Ab=a;b=Ub;Ub=[];for(c=0;c<b.length;c++)b[c](a)};var oe=function(){return(Ba||"https:"==M.location.protocol?"https:":"http:")+"//www.google-analytics.com"},Da=function(a){this.name="len";this.message=a+"-8192"},ba=function(a,b,c){c=c||ua;if(2036>=b.length)wc(a,b,c);else if(8192>=b.length)x(a,b,c)||wd(a,b,c)||wc(a,b,c);else throw ge("len",b.length),new Da(b.length);},pe=function(a,b,c,d){d=d||ua;wd(a+"?"+b,"",d,c)},wc=function(a,b,c){var d=ta(a+"?"+b);d.onload=d.onerror=function(){d.onload=null;d.onerror=null;c()}},wd=function(a,b,c,d){var e=O.XMLHttpRequest;
26
- if(!e)return!1;var g=new e;if(!("withCredentials"in g))return!1;a=a.replace(/^http:/,"https:");g.open("POST",a,!0);g.withCredentials=!0;g.setRequestHeader("Content-Type","text/plain");g.onreadystatechange=function(){if(4==g.readyState){if(d)try{var ca=g.responseText;if(1>ca.length)ge("xhr","ver","0"),c();else if("1"!=ca.charAt(0))ge("xhr","ver",String(ca.length)),c();else if(3<d.count++)ge("xhr","tmr",""+d.count),c();else if(1==ca.length)c();else{var l=ca.charAt(1);if("d"==l)pe("https://stats.g.doubleclick.net/j/collect",
27
- d.U,d,c);else if("g"==l){wc("https://www.google.%/ads/ga-audiences".replace("%","com"),d.google,c);var k=ca.substring(2);k&&(/^[a-z.]{1,6}$/.test(k)?wc("https://www.google.%/ads/ga-audiences".replace("%",k),d.google,ua):ge("tld","bcc",k))}else ge("xhr","brc",l),c()}}catch(w){ge("xhr","rsp"),c()}else c();g=null}};g.send(b);return!0},x=function(a,b,c){return O.navigator.sendBeacon?O.navigator.sendBeacon(a,b)?(c(),!0):!1:!1},ge=function(a,b,c){1<=100*Math.random()||G("?")||(a=["t=error","_e="+a,"_v=j75",
28
- "sr=1"],b&&a.push("_f="+b),c&&a.push("_m="+K(c.substring(0,100))),a.push("aip=1"),a.push("z="+hd()),wc("https://www.google-analytics.com/u/d",a.join("&"),ua))};var h=function(a){var b=O.gaData=O.gaData||{};return b[a]=b[a]||{}};var Ha=function(){this.M=[]};Ha.prototype.add=function(a){this.M.push(a)};Ha.prototype.D=function(a){try{for(var b=0;b<this.M.length;b++){var c=a.get(this.M[b]);c&&ea(c)&&c.call(O,a)}}catch(d){}b=a.get(Ia);b!=ua&&ea(b)&&(a.set(Ia,ua,!0),setTimeout(b,10))};function Ja(a){if(100!=a.get(Ka)&&La(P(a,Q))%1E4>=100*R(a,Ka))throw"abort";}function Ma(a){if(G(P(a,Na)))throw"abort";}function Oa(){var a=M.location.protocol;if("http:"!=a&&"https:"!=a)throw"abort";}
29
- function Pa(a){try{O.navigator.sendBeacon?J(42):O.XMLHttpRequest&&"withCredentials"in new O.XMLHttpRequest&&J(40)}catch(c){}a.set(ld,Td(a),!0);a.set(Ac,R(a,Ac)+1);var b=[];ue.map(function(c,d){d.F&&(c=a.get(c),void 0!=c&&c!=d.defaultValue&&("boolean"==typeof c&&(c*=1),b.push(d.F+"="+K(""+c))))});b.push("z="+Bd());a.set(Ra,b.join("&"),!0)}
30
- function Sa(a){var b=P(a,gd)||oe()+"/collect",c=a.get(qe),d=P(a,fa);!d&&a.get(Vd)&&(d="beacon");if(c)pe(b,P(a,Ra),c,a.Z(Ia));else if(d){c=d;d=P(a,Ra);var e=a.Z(Ia);e=e||ua;"image"==c?wc(b,d,e):"xhr"==c&&wd(b,d,e)||"beacon"==c&&x(b,d,e)||ba(b,d,e)}else ba(b,P(a,Ra),a.Z(Ia));b=P(a,Na);b=h(b);c=b.hitcount;b.hitcount=c?c+1:1;b=P(a,Na);delete h(b).pending_experiments;a.set(Ia,ua,!0)}
31
- function Hc(a){(O.gaData=O.gaData||{}).expId&&a.set(Nc,(O.gaData=O.gaData||{}).expId);(O.gaData=O.gaData||{}).expVar&&a.set(Oc,(O.gaData=O.gaData||{}).expVar);var b=P(a,Na);if(b=h(b).pending_experiments){var c=[];for(d in b)b.hasOwnProperty(d)&&b[d]&&c.push(encodeURIComponent(d)+"."+encodeURIComponent(b[d]));var d=c.join("!")}else d=void 0;d&&a.set(m,d,!0)}function cd(){if(O.navigator&&"preview"==O.navigator.loadPurpose)throw"abort";}
32
- function yd(a){var b=O.gaDevIds;ka(b)&&0!=b.length&&a.set("&did",b.join(","),!0)}function vb(a){if(!a.get(Na))throw"abort";};var hd=function(){return Math.round(2147483647*Math.random())},Bd=function(){try{var a=new Uint32Array(1);O.crypto.getRandomValues(a);return a[0]&2147483647}catch(b){return hd()}};function Ta(a){var b=R(a,Ua);500<=b&&J(15);var c=P(a,Va);if("transaction"!=c&&"item"!=c){c=R(a,Wa);var d=(new Date).getTime(),e=R(a,Xa);0==e&&a.set(Xa,d);e=Math.round(2*(d-e)/1E3);0<e&&(c=Math.min(c+e,20),a.set(Xa,d));if(0>=c)throw"abort";a.set(Wa,--c)}a.set(Ua,++b)};var Ya=function(){this.data=new ee};Ya.prototype.get=function(a){var b=$a(a),c=this.data.get(a);b&&void 0==c&&(c=ea(b.defaultValue)?b.defaultValue():b.defaultValue);return b&&b.Z?b.Z(this,a,c):c};var P=function(a,b){a=a.get(b);return void 0==a?"":""+a},R=function(a,b){a=a.get(b);return void 0==a||""===a?0:Number(a)};Ya.prototype.Z=function(a){return(a=this.get(a))&&ea(a)?a:ua};
33
- Ya.prototype.set=function(a,b,c){if(a)if("object"==typeof a)for(var d in a)a.hasOwnProperty(d)&&ab(this,d,a[d],c);else ab(this,a,b,c)};var ab=function(a,b,c,d){if(void 0!=c)switch(b){case Na:wb.test(c)}var e=$a(b);e&&e.o?e.o(a,b,c,d):a.data.set(b,c,d)};var ue=new ee,ve=[],bb=function(a,b,c,d,e){this.name=a;this.F=b;this.Z=d;this.o=e;this.defaultValue=c},$a=function(a){var b=ue.get(a);if(!b)for(var c=0;c<ve.length;c++){var d=ve[c],e=d[0].exec(a);if(e){b=d[1](e);ue.set(b.name,b);break}}return b},yc=function(a){var b;ue.map(function(c,d){d.F==a&&(b=d)});return b&&b.name},S=function(a,b,c,d,e){a=new bb(a,b,c,d,e);ue.set(a.name,a);return a.name},cb=function(a,b){ve.push([new RegExp("^"+a+"$"),b])},T=function(a,b,c){return S(a,b,c,void 0,db)},db=function(){};var hb=T("apiVersion","v"),ib=T("clientVersion","_v");S("anonymizeIp","aip");var jb=S("adSenseId","a"),Va=S("hitType","t"),Ia=S("hitCallback"),Ra=S("hitPayload");S("nonInteraction","ni");S("currencyCode","cu");S("dataSource","ds");var Vd=S("useBeacon",void 0,!1),fa=S("transport");S("sessionControl","sc","");S("sessionGroup","sg");S("queueTime","qt");var Ac=S("_s","_s");S("screenName","cd");var kb=S("location","dl",""),lb=S("referrer","dr"),mb=S("page","dp","");S("hostname","dh");
34
- var nb=S("language","ul"),ob=S("encoding","de");S("title","dt",function(){return M.title||void 0});cb("contentGroup([0-9]+)",function(a){return new bb(a[0],"cg"+a[1])});var pb=S("screenColors","sd"),qb=S("screenResolution","sr"),rb=S("viewportSize","vp"),sb=S("javaEnabled","je"),tb=S("flashVersion","fl");S("campaignId","ci");S("campaignName","cn");S("campaignSource","cs");S("campaignMedium","cm");S("campaignKeyword","ck");S("campaignContent","cc");
35
- var ub=S("eventCategory","ec"),xb=S("eventAction","ea"),yb=S("eventLabel","el"),zb=S("eventValue","ev"),Bb=S("socialNetwork","sn"),Cb=S("socialAction","sa"),Db=S("socialTarget","st"),Eb=S("l1","plt"),Fb=S("l2","pdt"),Gb=S("l3","dns"),Hb=S("l4","rrt"),Ib=S("l5","srt"),Jb=S("l6","tcp"),Kb=S("l7","dit"),Lb=S("l8","clt"),Ve=S("l9","_gst"),We=S("l10","_gbt"),Xe=S("l11","_cst"),Ye=S("l12","_cbt"),Mb=S("timingCategory","utc"),Nb=S("timingVar","utv"),Ob=S("timingLabel","utl"),Pb=S("timingValue","utt");
36
- S("appName","an");S("appVersion","av","");S("appId","aid","");S("appInstallerId","aiid","");S("exDescription","exd");S("exFatal","exf");var Nc=S("expId","xid"),Oc=S("expVar","xvar"),m=S("exp","exp"),Rc=S("_utma","_utma"),Sc=S("_utmz","_utmz"),Tc=S("_utmht","_utmht"),Ua=S("_hc",void 0,0),Xa=S("_ti",void 0,0),Wa=S("_to",void 0,20);cb("dimension([0-9]+)",function(a){return new bb(a[0],"cd"+a[1])});cb("metric([0-9]+)",function(a){return new bb(a[0],"cm"+a[1])});S("linkerParam",void 0,void 0,Bc,db);
37
- var Ze=T("_cd2l",void 0,!1),ld=S("usage","_u"),Gd=S("_um");S("forceSSL",void 0,void 0,function(){return Ba},function(a,b,c){J(34);Ba=!!c});var ed=S("_j1","jid"),ia=S("_j2","gjid");cb("\\&(.*)",function(a){var b=new bb(a[0],a[1]),c=yc(a[0].substring(1));c&&(b.Z=function(d){return d.get(c)},b.o=function(d,e,g,ca){d.set(c,g,ca)},b.F=void 0);return b});
38
- var Qb=T("_oot"),dd=S("previewTask"),Rb=S("checkProtocolTask"),md=S("validationTask"),Sb=S("checkStorageTask"),Uc=S("historyImportTask"),Tb=S("samplerTask"),Vb=S("_rlt"),Wb=S("buildHitTask"),Xb=S("sendHitTask"),Vc=S("ceTask"),zd=S("devIdTask"),Cd=S("timingTask"),Ld=S("displayFeaturesTask"),oa=S("customTask"),V=T("name"),Q=T("clientId","cid"),n=T("clientIdTime"),xd=T("storedClientId"),Ad=S("userId","uid"),Na=T("trackingId","tid"),U=T("cookieName",void 0,"_ga"),W=T("cookieDomain"),Yb=T("cookiePath",
39
- void 0,"/"),Zb=T("cookieExpires",void 0,63072E3),Hd=T("cookieUpdate",void 0,!0),$b=T("legacyCookieDomain"),Wc=T("legacyHistoryImport",void 0,!0),ac=T("storage",void 0,"cookie"),bc=T("allowLinker",void 0,!1),cc=T("allowAnchor",void 0,!0),Ka=T("sampleRate","sf",100),dc=T("siteSpeedSampleRate",void 0,1),ec=T("alwaysSendReferrer",void 0,!1),I=T("_gid","_gid"),la=T("_gcn"),Kd=T("useAmpClientId"),ce=T("_gclid"),fe=T("_gt"),he=T("_ge",void 0,7776E6),ie=T("_gclsrc"),je=T("storeGac",void 0,!0),gd=S("transportUrl"),
40
- Md=S("_r","_r"),qe=S("_dp"),Ud=S("allowAdFeatures",void 0,!0);function X(a,b,c,d){b[a]=function(){try{return d&&J(d),c.apply(this,arguments)}catch(e){throw ge("exc",a,e&&e.name),e;}}};var Od=function(){this.V=100;this.$=this.fa=!1;this.oa="detourexp";this.groups=1},Ed=function(a){var b=new Od,c;if(b.fa&&b.$)return 0;b.$=!0;if(a){if(b.oa&&void 0!==a.get(b.oa))return R(a,b.oa);if(0==a.get(dc))return 0}if(0==b.V)return 0;void 0===c&&(c=Bd());return 0==c%b.V?Math.floor(c/b.V)%b.groups+1:0};function fc(){var a,b;if((b=(b=O.navigator)?b.plugins:null)&&b.length)for(var c=0;c<b.length&&!a;c++){var d=b[c];-1<d.name.indexOf("Shockwave Flash")&&(a=d.description)}if(!a)try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=e.GetVariable("$version")}catch(g){}if(!a)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),a="WIN 6,0,21,0",e.AllowScriptAccess="always",a=e.GetVariable("$version")}catch(g){}if(!a)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),a=e.GetVariable("$version")}catch(g){}a&&
41
- (e=a.match(/[\d]+/g))&&3<=e.length&&(a=e[0]+"."+e[1]+" r"+e[2]);return a||void 0};var aa=function(a){var b=Math.min(R(a,dc),100);return La(P(a,Q))%100>=b?!1:!0},gc=function(a){var b={};if(Ec(b)||Fc(b)){var c=b[Eb];void 0==c||Infinity==c||isNaN(c)||(0<c?(Y(b,Gb),Y(b,Jb),Y(b,Ib),Y(b,Fb),Y(b,Hb),Y(b,Kb),Y(b,Lb),Y(b,Ve),Y(b,We),Y(b,Xe),Y(b,Ye),va(function(){a(b)},10)):L(O,"load",function(){gc(a)},!1))}},Ec=function(a){var b=O.performance||O.webkitPerformance;b=b&&b.timing;if(!b)return!1;var c=b.navigationStart;if(0==c)return!1;a[Eb]=b.loadEventStart-c;a[Gb]=b.domainLookupEnd-b.domainLookupStart;
42
- a[Jb]=b.connectEnd-b.connectStart;a[Ib]=b.responseStart-b.requestStart;a[Fb]=b.responseEnd-b.responseStart;a[Hb]=b.fetchStart-c;a[Kb]=b.domInteractive-c;a[Lb]=b.domContentLoadedEventStart-c;a[Ve]=N.L-c;a[We]=N.ya-c;O.google_tag_manager&&O.google_tag_manager._li&&(b=O.google_tag_manager._li,a[Xe]=b.cst,a[Ye]=b.cbt);return!0},Fc=function(a){if(O.top!=O)return!1;var b=O.external,c=b&&b.onloadT;b&&!b.isValidLoadTime&&(c=void 0);2147483648<c&&(c=void 0);0<c&&b.setPageReadyTime();if(void 0==c)return!1;
43
- a[Eb]=c;return!0},Y=function(a,b){var c=a[b];if(isNaN(c)||Infinity==c||0>c)a[b]=void 0},Fd=function(a){return function(b){if("pageview"==b.get(Va)&&!a.I){a.I=!0;var c=aa(b),d=0<E(P(b,kb),"gclid").length;(c||d)&&gc(function(e){c&&a.send("timing",e);d&&a.send("adtiming",e)})}}};var hc=!1,mc=function(a){if("cookie"==P(a,ac)){if(a.get(Hd)||P(a,xd)!=P(a,Q)){var b=1E3*R(a,Zb);ma(a,Q,U,b)}ma(a,I,la,864E5);if(a.get(je)){var c=P(a,ce);if(c){var d=Math.min(R(a,he),1E3*R(a,Zb));d=Math.min(d,1E3*R(a,fe)+d-(new Date).getTime());a.data.set(he,d);b={};var e=P(a,fe),g=P(a,ie),ca=kc(P(a,Yb)),l=lc(P(a,W));a=P(a,Na);g&&"aw.ds"!=g?b&&(b.ua=!0):(c=["1",e,Cc(c)].join("."),0<d&&(b&&(b.ta=!0),zc("_gac_"+Cc(a),c,ca,l,a,d)));le(b)}}else J(75)}},ma=function(a,b,c,d){var e=nd(a,b);if(e){c=P(a,c);
44
- var g=kc(P(a,Yb)),ca=lc(P(a,W)),l=P(a,Na);if("auto"!=ca)zc(c,e,g,ca,l,d)&&(hc=!0);else{J(32);for(var k=id(),w=0;w<k.length;w++)if(ca=k[w],a.data.set(W,ca),e=nd(a,b),zc(c,e,g,ca,l,d)){hc=!0;return}a.data.set(W,"auto")}}},nc=function(a){if("cookie"==P(a,ac)&&!hc&&(mc(a),!hc))throw"abort";},Yc=function(a){if(a.get(Wc)){var b=P(a,W),c=P(a,$b)||xa(),d=Xc("__utma",c,b);d&&(J(19),a.set(Tc,(new Date).getTime(),!0),a.set(Rc,d.R),(b=Xc("__utmz",c,b))&&d.hash==b.hash&&a.set(Sc,b.R))}},nd=function(a,b){b=Cc(P(a,
45
- b));var c=lc(P(a,W)).split(".").length;a=jc(P(a,Yb));1<a&&(c+="-"+a);return b?["GA1",c,b].join("."):""},Xd=function(a,b){return na(b,P(a,W),P(a,Yb))},na=function(a,b,c){if(!a||1>a.length)J(12);else{for(var d=[],e=0;e<a.length;e++){var g=a[e];var ca=g.split(".");var l=ca.shift();("GA1"==l||"1"==l)&&1<ca.length?(g=ca.shift().split("-"),1==g.length&&(g[1]="1"),g[0]*=1,g[1]*=1,ca={H:g,s:ca.join(".")}):ca=kd.test(g)?{H:[0,0],s:g}:void 0;ca&&d.push(ca)}if(1==d.length)return J(13),d[0].s;if(0==d.length)J(12);
46
- else{J(14);d=Gc(d,lc(b).split(".").length,0);if(1==d.length)return d[0].s;d=Gc(d,jc(c),1);1<d.length&&J(41);return d[0]&&d[0].s}}},Gc=function(a,b,c){for(var d=[],e=[],g,ca=0;ca<a.length;ca++){var l=a[ca];l.H[c]==b?d.push(l):void 0==g||l.H[c]<g?(e=[l],g=l.H[c]):l.H[c]==g&&e.push(l)}return 0<d.length?d:e},lc=function(a){return 0==a.indexOf(".")?a.substr(1):a},id=function(){var a=[],b=xa().split(".");if(4==b.length){var c=b[b.length-1];if(parseInt(c,10)==c)return["none"]}for(c=b.length-2;0<=c;c--)a.push(b.slice(c).join("."));
47
- b=M.location.hostname;eb.test(b)||vc.test(b)||a.push("none");return a},kc=function(a){if(!a)return"/";1<a.length&&a.lastIndexOf("/")==a.length-1&&(a=a.substr(0,a.length-1));0!=a.indexOf("/")&&(a="/"+a);return a},jc=function(a){a=kc(a);return"/"==a?1:a.split("/").length},le=function(a){a.ta&&J(77);a.na&&J(74);a.pa&&J(73);a.ua&&J(69)};function Xc(a,b,c){"none"==b&&(b="");var d=[],e=Ca(a);a="__utma"==a?6:2;for(var g=0;g<e.length;g++){var ca=(""+e[g]).split(".");ca.length>=a&&d.push({hash:ca[0],R:e[g],O:ca})}if(0!=d.length)return 1==d.length?d[0]:Zc(b,d)||Zc(c,d)||Zc(null,d)||d[0]}function Zc(a,b){if(null==a)var c=a=1;else c=La(a),a=La(D(a,".")?a.substring(1):"."+a);for(var d=0;d<b.length;d++)if(b[d].hash==c||b[d].hash==a)return b[d]};var od=new RegExp(/^https?:\/\/([^\/:]+)/),De=O.google_tag_data.glBridge,pd=/(.*)([?&#])(?:_ga=[^&#]*)(?:&?)(.*)/,me=/(.*)([?&#])(?:_gac=[^&#]*)(?:&?)(.*)/;function Bc(a){if(a.get(Ze))return J(35),De.generate($e(a));var b=P(a,Q),c=P(a,I)||"";b="_ga=2."+K(pa(c+b,0)+"."+c+"-"+b);(a=af(a))?(J(44),a="&_gac=1."+K([pa(a.qa,0),a.timestamp,a.qa].join("."))):a="";return b+a}
48
- function Ic(a,b){var c=new Date,d=O.navigator,e=d.plugins||[];a=[a,d.userAgent,c.getTimezoneOffset(),c.getYear(),c.getDate(),c.getHours(),c.getMinutes()+b];for(b=0;b<e.length;++b)a.push(e[b].description);return La(a.join("."))}function pa(a,b){var c=new Date,d=O.navigator,e=c.getHours()+Math.floor((c.getMinutes()+b)/60);return La([a,d.userAgent,d.language||"",c.getTimezoneOffset(),c.getYear(),c.getDate()+Math.floor(e/24),(24+e)%24,(60+c.getMinutes()+b)%60].join("."))}
49
- var Dc=function(a){J(48);this.target=a;this.T=!1};Dc.prototype.ca=function(a,b){if(a){if(this.target.get(Ze))return De.decorate($e(this.target),a,b);if(a.tagName){if("a"==a.tagName.toLowerCase()){a.href&&(a.href=qd(this,a.href,b));return}if("form"==a.tagName.toLowerCase())return rd(this,a)}if("string"==typeof a)return qd(this,a,b)}};
50
- var qd=function(a,b,c){var d=pd.exec(b);d&&3<=d.length&&(b=d[1]+(d[3]?d[2]+d[3]:""));(d=me.exec(b))&&3<=d.length&&(b=d[1]+(d[3]?d[2]+d[3]:""));a=a.target.get("linkerParam");var e=b.indexOf("?");d=b.indexOf("#");c?b+=(-1==d?"#":"&")+a:(c=-1==e?"?":"&",b=-1==d?b+(c+a):b.substring(0,d)+c+a+b.substring(d));b=b.replace(/&+_ga=/,"&_ga=");return b=b.replace(/&+_gac=/,"&_gac=")},rd=function(a,b){if(b&&b.action)if("get"==b.method.toLowerCase()){a=a.target.get("linkerParam").split("&");for(var c=0;c<a.length;c++){var d=
51
- a[c].split("="),e=d[1];d=d[0];for(var g=b.childNodes||[],ca=!1,l=0;l<g.length;l++)if(g[l].name==d){g[l].setAttribute("value",e);ca=!0;break}ca||(g=M.createElement("input"),g.setAttribute("type","hidden"),g.setAttribute("name",d),g.setAttribute("value",e),b.appendChild(g))}}else"post"==b.method.toLowerCase()&&(b.action=qd(a,b.action))};
52
- Dc.prototype.S=function(a,b,c){function d(g){try{g=g||O.event;a:{var ca=g.target||g.srcElement;for(g=100;ca&&0<g;){if(ca.href&&ca.nodeName.match(/^a(?:rea)?$/i)){var l=ca;break a}ca=ca.parentNode;g--}l={}}("http:"==l.protocol||"https:"==l.protocol)&&sd(a,l.hostname||"")&&l.href&&(l.href=qd(e,l.href,b))}catch(k){J(26)}}var e=this;this.target.get(Ze)?De.auto(function(){return $e(e.target)},a,b?"fragment":"",c):(this.T||(this.T=!0,L(M,"mousedown",d,!1),L(M,"keyup",d,!1)),c&&L(M,"submit",function(g){g=
53
- g||O.event;if((g=g.target||g.srcElement)&&g.action){var ca=g.action.match(od);ca&&sd(a,ca[1])&&rd(e,g)}}))};function sd(a,b){if(b==M.location.hostname)return!1;for(var c=0;c<a.length;c++)if(a[c]instanceof RegExp){if(a[c].test(b))return!0}else if(0<=b.indexOf(a[c]))return!0;return!1}function ke(a,b){return b!=Ic(a,0)&&b!=Ic(a,-1)&&b!=Ic(a,-2)&&b!=pa(a,0)&&b!=pa(a,-1)&&b!=pa(a,-2)}function $e(a){var b=af(a);return{_ga:a.get(Q),_gid:a.get(I)||void 0,_gac:b?[b.qa,b.timestamp].join("."):void 0}}
54
- function af(a){function b(e){return void 0==e||""===e?0:Number(e)}var c=a.get(ce);if(c&&a.get(je)){var d=b(a.get(fe));if(1E3*d+b(a.get(he))<=(new Date).getTime())J(76);else return{timestamp:d,qa:c}}};var p=/^(GTM|OPT)-[A-Z0-9]+$/,q=/;_gaexp=[^;]*/g,r=/;((__utma=)|([^;=]+=GAX?\d+\.))[^;]*/g,Aa=/^https?:\/\/[\w\-.]+\.google.com(:\d+)?\/optimize\/opt-launch\.html\?.*$/,t=function(a){function b(d,e){e&&(c+="&"+d+"="+K(e))}var c="https://www.google-analytics.com/gtm/js?id="+K(a.id);"dataLayer"!=a.B&&b("l",a.B);b("t",a.target);b("cid",a.clientId);b("cidt",a.ka);b("gac",a.la);b("aip",a.ia);a.sync&&b("m","sync");b("cycle",a.G);a.qa&&b("gclid",a.qa);Aa.test(M.referrer)&&b("cb",String(hd()));return c};var Jd=function(a,b,c){this.aa=b;(b=c)||(b=(b=P(a,V))&&"t0"!=b?Wd.test(b)?"_gat_"+Cc(P(a,Na)):"_gat_"+Cc(b):"_gat");this.Y=b;this.ra=null},Rd=function(a,b){var c=b.get(Wb);b.set(Wb,function(e){Pd(a,e,ed);Pd(a,e,ia);var g=c(e);Qd(a,e);return g});var d=b.get(Xb);b.set(Xb,function(e){var g=d(e);if(se(e)){if(ne()!==H(a,e)){J(80);var ca={U:re(a,e,1),google:re(a,e,2),count:0};pe("https://stats.g.doubleclick.net/j/collect",ca.U,ca)}else ta(re(a,e,0));e.set(ed,"",!0)}return g})},Pd=function(a,b,c){!1===b.get(Ud)||
55
- b.get(c)||("1"==Ca(a.Y)[0]?b.set(c,"",!0):b.set(c,""+hd(),!0))},Qd=function(a,b){se(b)&&zc(a.Y,"1",P(b,Yb),P(b,W),P(b,Na),6E4)},se=function(a){return!!a.get(ed)&&!1!==a.get(Ud)},re=function(a,b,c){var d=new ee,e=function(ca){$a(ca).F&&d.set($a(ca).F,b.get(ca))};e(hb);e(ib);e(Na);e(Q);e(ed);if(0==c||1==c)e(Ad),e(ia),e(I);d.set($a(ld).F,Td(b));var g="";d.map(function(ca,l){g+=K(ca)+"=";g+=K(""+l)+"&"});g+="z="+hd();0==c?g=a.aa+g:1==c?g="t=dc&aip=1&_r=3&"+g:2==c&&(g="t=sr&aip=1&_r=4&slf_rd=1&"+g);return g},
56
- H=function(a,b){null===a.ra&&(a.ra=1===Ed(b),a.ra&&J(33));return a.ra},Wd=/^gtm\d+$/;var fd=function(a,b){a=a.b;if(!a.get("dcLoaded")){var c=new $c(Dd(a));c.set(29);a.set(Gd,c.w);b=b||{};var d;b[U]&&(d=Cc(b[U]));b=new Jd(a,"https://stats.g.doubleclick.net/r/collect?t=dc&aip=1&_r=3&",d);Rd(b,a);a.set("dcLoaded",!0)}};var Sd=function(a){if(!a.get("dcLoaded")&&"cookie"==a.get(ac)){var b=new Jd(a);Pd(b,a,ed);Pd(b,a,ia);Qd(b,a);if(se(a)){var c=ne()!==H(b,a);a.set(Md,1,!0);c?(J(79),a.set(gd,oe()+"/j/collect",!0),a.set(qe,{U:re(b,a,1),google:re(b,a,2),count:0},!0)):a.set(gd,oe()+"/r/collect",!0)}}};var Lc=function(){var a=O.gaGlobal=O.gaGlobal||{};return a.hid=a.hid||hd()};var ad,bd=function(a,b,c){if(!ad){var d=M.location.hash;var e=O.name,g=/^#?gaso=([^&]*)/;if(e=(d=(d=d&&d.match(g)||e&&e.match(g))?d[1]:Ca("GASO")[0]||"")&&d.match(/^(?:!([-0-9a-z.]{1,40})!)?([-.\w]{10,1200})$/i))zc("GASO",""+d,c,b,a,0),window._udo||(window._udo=b),window._utcp||(window._utcp=c),a=e[1],wa("https://www.google.com/analytics/web/inpage/pub/inpage.js?"+(a?"prefix="+a+"&":"")+hd(),"_gasojs");ad=!0}};var wb=/^(UA|YT|MO|GP)-(\d+)-(\d+)$/,pc=function(a){function b(e,g){d.b.data.set(e,g)}function c(e,g){b(e,g);d.filters.add(e)}var d=this;this.b=new Ya;this.filters=new Ha;b(V,a[V]);b(Na,sa(a[Na]));b(U,a[U]);b(W,a[W]||xa());b(Yb,a[Yb]);b(Zb,a[Zb]);b(Hd,a[Hd]);b($b,a[$b]);b(Wc,a[Wc]);b(bc,a[bc]);b(cc,a[cc]);b(Ka,a[Ka]);b(dc,a[dc]);b(ec,a[ec]);b(ac,a[ac]);b(Ad,a[Ad]);b(n,a[n]);b(Kd,a[Kd]);b(je,a[je]);b(Ze,a[Ze]);b(hb,1);b(ib,"j75");c(Qb,Ma);c(oa,ua);c(dd,cd);c(Rb,Oa);c(md,vb);c(Sb,nc);c(Uc,Yc);c(Tb,
57
- Ja);c(Vb,Ta);c(Vc,Hc);c(zd,yd);c(Ld,Sd);c(Wb,Pa);c(Xb,Sa);c(Cd,Fd(this));Kc(this.b);Jc(this.b,a[Q]);this.b.set(jb,Lc());bd(P(this.b,Na),P(this.b,W),P(this.b,Yb))},Jc=function(a,b){var c=P(a,U);a.data.set(la,"_ga"==c?"_gid":c+"_gid");if("cookie"==P(a,ac)){hc=!1;c=Ca(P(a,U));c=Xd(a,c);if(!c){c=P(a,W);var d=P(a,$b)||xa();c=Xc("__utma",d,c);void 0!=c?(J(10),c=c.O[1]+"."+c.O[2]):c=void 0}c&&(hc=!0);if(d=c&&!a.get(Hd))if(d=c.split("."),2!=d.length)d=!1;else if(d=Number(d[1])){var e=R(a,Zb);d=d+e<(new Date).getTime()/
58
- 1E3}else d=!1;d&&(c=void 0);c&&(a.data.set(xd,c),a.data.set(Q,c),c=Ca(P(a,la)),(c=Xd(a,c))&&a.data.set(I,c));if(a.get(je)&&(c=a.get(ce),d=a.get(ie),!c||d&&"aw.ds"!=d)){c={};if(M){d=[];e=M.cookie.split(";");for(var g=/^\s*_gac_(UA-\d+-\d+)=\s*(.+?)\s*$/,ca=0;ca<e.length;ca++){var l=e[ca].match(g);l&&d.push({ja:l[1],value:l[2]})}e={};if(d&&d.length)for(g=0;g<d.length;g++)(ca=d[g].value.split("."),"1"!=ca[0]||3!=ca.length)?c&&(c.na=!0):ca[1]&&(e[d[g].ja]?c&&(c.pa=!0):e[d[g].ja]=[],e[d[g].ja].push({timestamp:ca[1],
59
- qa:ca[2]}));d=e}else d={};d=d[P(a,Na)];le(c);d&&0!=d.length&&(c=d[0],a.data.set(fe,c.timestamp),a.data.set(ce,c.qa))}}if(a.get(Hd)&&(c=be("_ga",!!a.get(cc)),g=be("_gl",!!a.get(cc)),d=De.get(a.get(cc)),e=d._ga,g&&0<g.indexOf("_ga*")&&!e&&J(30),g=d.gclid,ca=d._gac,c||e||g||ca))if(c&&e&&J(36),a.get(bc)){if(e&&(J(38),a.data.set(Q,e),d._gid&&(J(51),a.data.set(I,d._gid))),g?(J(82),a.data.set(ce,g),d.gclsrc&&a.data.set(ie,d.gclsrc)):ca&&(d=ca.split("."))&&2===d.length&&(J(37),a.data.set(ce,d[0]),a.data.set(fe,
60
- d[1])),c)b:if(d=c.indexOf("."),-1==d)J(22);else{e=c.substring(0,d);g=c.substring(d+1);d=g.indexOf(".");c=g.substring(0,d);g=g.substring(d+1);if("1"==e){if(d=g,ke(d,c)){J(23);break b}}else if("2"==e){d=g.indexOf("-");e="";0<d?(e=g.substring(0,d),d=g.substring(d+1)):d=g.substring(1);if(ke(e+d,c)){J(53);break b}e&&(J(2),a.data.set(I,e))}else{J(22);break b}J(11);a.data.set(Q,d);if(c=be("_gac",!!a.get(cc)))c=c.split("."),"1"!=c[0]||4!=c.length?J(72):ke(c[3],c[1])?J(71):(a.data.set(ce,c[3]),a.data.set(fe,
61
- c[2]),J(70))}}else J(21);b&&(J(9),a.data.set(Q,K(b)));a.get(Q)||((b=(b=O.gaGlobal&&O.gaGlobal.vid)&&-1!=b.search(jd)?b:void 0)?(J(17),a.data.set(Q,b)):(J(8),a.data.set(Q,ra())));a.get(I)||(J(3),a.data.set(I,ra()));mc(a)},Kc=function(a){var b=O.navigator,c=O.screen,d=M.location;a.set(lb,ya(!!a.get(ec),!!a.get(Kd)));if(d){var e=d.pathname||"";"/"!=e.charAt(0)&&(J(31),e="/"+e);a.set(kb,d.protocol+"//"+d.hostname+e+d.search)}c&&a.set(qb,c.width+"x"+c.height);c&&a.set(pb,c.colorDepth+"-bit");c=M.documentElement;
62
- var g=(e=M.body)&&e.clientWidth&&e.clientHeight,ca=[];c&&c.clientWidth&&c.clientHeight&&("CSS1Compat"===M.compatMode||!g)?ca=[c.clientWidth,c.clientHeight]:g&&(ca=[e.clientWidth,e.clientHeight]);c=0>=ca[0]||0>=ca[1]?"":ca.join("x");a.set(rb,c);a.set(tb,fc());a.set(ob,M.characterSet||M.charset);a.set(sb,b&&"function"===typeof b.javaEnabled&&b.javaEnabled()||!1);a.set(nb,(b&&(b.language||b.browserLanguage)||"").toLowerCase());a.data.set(ce,be("gclid",!0));a.data.set(ie,be("gclsrc",!0));a.data.set(fe,
63
- Math.round((new Date).getTime()/1E3));if(d&&a.get(cc)&&(b=M.location.hash)){b=b.split(/[?&#]+/);d=[];for(c=0;c<b.length;++c)(D(b[c],"utm_id")||D(b[c],"utm_campaign")||D(b[c],"utm_source")||D(b[c],"utm_medium")||D(b[c],"utm_term")||D(b[c],"utm_content")||D(b[c],"gclid")||D(b[c],"dclid")||D(b[c],"gclsrc"))&&d.push(b[c]);0<d.length&&(b="#"+d.join("&"),a.set(kb,a.get(kb)+b))}};pc.prototype.get=function(a){return this.b.get(a)};pc.prototype.set=function(a,b){this.b.set(a,b)};
64
- var qc={pageview:[mb],event:[ub,xb,yb,zb],social:[Bb,Cb,Db],timing:[Mb,Nb,Pb,Ob]};pc.prototype.send=function(a){if(!(1>arguments.length)){if("string"===typeof arguments[0]){var b=arguments[0];var c=[].slice.call(arguments,1)}else b=arguments[0]&&arguments[0][Va],c=arguments;b&&(c=za(qc[b]||[],c),c[Va]=b,this.b.set(c,void 0,!0),this.filters.D(this.b),this.b.data.m={})}};pc.prototype.ma=function(a,b){var c=this;u(a,c,b)||(v(a,function(){u(a,c,b)}),y(String(c.get(V)),a,void 0,b,!0))};var rc=function(a){if("prerender"==M.visibilityState)return!1;a();return!0},z=function(a){if(!rc(a)){J(16);var b=!1,c=function(){if(!b&&rc(a)){b=!0;var d=c,e=M;e.removeEventListener?e.removeEventListener("visibilitychange",d,!1):e.detachEvent&&e.detachEvent("onvisibilitychange",d)}};L(M,"visibilitychange",c)}};var td=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/,sc=function(a){if(ea(a[0]))this.u=a[0];else{var b=td.exec(a[0]);null!=b&&4==b.length&&(this.c=b[1]||"t0",this.K=b[2]||"",this.C=b[3],this.a=[].slice.call(a,1),this.K||(this.A="create"==this.C,this.i="require"==this.C,this.g="provide"==this.C,this.ba="remove"==this.C),this.i&&(3<=this.a.length?(this.X=this.a[1],this.W=this.a[2]):this.a[1]&&(qa(this.a[1])?this.X=this.a[1]:this.W=this.a[1])));b=a[1];a=a[2];if(!this.C)throw"abort";if(this.i&&(!qa(b)||""==b))throw"abort";
65
- if(this.g&&(!qa(b)||""==b||!ea(a)))throw"abort";if(ud(this.c)||ud(this.K))throw"abort";if(this.g&&"t0"!=this.c)throw"abort";}};function ud(a){return 0<=a.indexOf(".")||0<=a.indexOf(":")};var Yd,Zd,$d,A;Yd=new ee;$d=new ee;A=new ee;Zd={ec:45,ecommerce:46,linkid:47};
66
- var u=function(a,b,c){b==N||b.get(V);var d=Yd.get(a);if(!ea(d))return!1;b.plugins_=b.plugins_||new ee;if(b.plugins_.get(a))return!0;b.plugins_.set(a,new d(b,c||{}));return!0},y=function(a,b,c,d,e){if(!ea(Yd.get(b))&&!$d.get(b)){Zd.hasOwnProperty(b)&&J(Zd[b]);if(p.test(b)){J(52);a=N.j(a);if(!a)return!0;c=d||{};d={id:b,B:c.dataLayer||"dataLayer",ia:!!a.get("anonymizeIp"),sync:e,G:!1};a.get("&gtm")==b&&(d.G=!0);var g=String(a.get("name"));"t0"!=g&&(d.target=g);G(String(a.get("trackingId")))||(d.clientId=
67
- String(a.get(Q)),d.ka=Number(a.get(n)),c=c.palindrome?r:q,c=(c=M.cookie.replace(/^|(; +)/g,";").match(c))?c.sort().join("").substring(1):void 0,d.la=c,d.qa=E(a.b.get(kb)||"","gclid"));a=d.B;c=(new Date).getTime();O[a]=O[a]||[];c={"gtm.start":c};e||(c.event="gtm.js");O[a].push(c);c=t(d)}!c&&Zd.hasOwnProperty(b)?(J(39),c=b+".js"):J(43);c&&(c&&0<=c.indexOf("/")||(c=(Ba||"https:"==M.location.protocol?"https:":"http:")+"//www.google-analytics.com/plugins/ua/"+c),d=ae(c),a=d.protocol,c=M.location.protocol,
68
- ("https:"==a||a==c||("http:"!=a?0:"http:"==c))&&B(d)&&(wa(d.url,void 0,e),$d.set(b,!0)))}},v=function(a,b){var c=A.get(a)||[];c.push(b);A.set(a,c)},C=function(a,b){Yd.set(a,b);b=A.get(a)||[];for(var c=0;c<b.length;c++)b[c]();A.set(a,[])},B=function(a){var b=ae(M.location.href);if(D(a.url,"https://www.google-analytics.com/gtm/js?id="))return!0;if(a.query||0<=a.url.indexOf("?")||0<=a.path.indexOf("://"))return!1;if(a.host==b.host&&a.port==b.port)return!0;b="http:"==a.protocol?80:443;return"www.google-analytics.com"==
69
- a.host&&(a.port||b)==b&&D(a.path,"/plugins/")?!0:!1},ae=function(a){function b(l){var k=l.hostname||"",w=0<=k.indexOf("]");k=k.split(w?"]":":")[0].toLowerCase();w&&(k+="]");w=(l.protocol||"").toLowerCase();w=1*l.port||("http:"==w?80:"https:"==w?443:"");l=l.pathname||"";D(l,"/")||(l="/"+l);return[k,""+w,l]}var c=M.createElement("a");c.href=M.location.href;var d=(c.protocol||"").toLowerCase(),e=b(c),g=c.search||"",ca=d+"//"+e[0]+(e[1]?":"+e[1]:"");D(a,"//")?a=d+a:D(a,"/")?a=ca+a:!a||D(a,"?")?a=ca+e[2]+
70
- (a||g):0>a.split("/")[0].indexOf(":")&&(a=ca+e[2].substring(0,e[2].lastIndexOf("/"))+"/"+a);c.href=a;d=b(c);return{protocol:(c.protocol||"").toLowerCase(),host:d[0],port:d[1],path:d[2],query:c.search||"",url:a||""}};var Z={ga:function(){Z.f=[]}};Z.ga();Z.D=function(a){var b=Z.J.apply(Z,arguments);b=Z.f.concat(b);for(Z.f=[];0<b.length&&!Z.v(b[0])&&!(b.shift(),0<Z.f.length););Z.f=Z.f.concat(b)};Z.J=function(a){for(var b=[],c=0;c<arguments.length;c++)try{var d=new sc(arguments[c]);d.g?C(d.a[0],d.a[1]):(d.i&&(d.ha=y(d.c,d.a[0],d.X,d.W)),b.push(d))}catch(e){}return b};
71
- Z.v=function(a){try{if(a.u)a.u.call(O,N.j("t0"));else{var b=a.c==gb?N:N.j(a.c);if(a.A){if("t0"==a.c&&(b=N.create.apply(N,a.a),null===b))return!0}else if(a.ba)N.remove(a.c);else if(b)if(a.i){if(a.ha&&(a.ha=y(a.c,a.a[0],a.X,a.W)),!u(a.a[0],b,a.W))return!0}else if(a.K){var c=a.C,d=a.a,e=b.plugins_.get(a.K);e[c].apply(e,d)}else b[a.C].apply(b,a.a)}}catch(g){}};var N=function(a){J(1);Z.D.apply(Z,[arguments])};N.h={};N.P=[];N.L=0;N.ya=0;N.answer=42;var uc=[Na,W,V];N.create=function(a){var b=za(uc,[].slice.call(arguments));b[V]||(b[V]="t0");var c=""+b[V];if(N.h[c])return N.h[c];if(da(b))return null;b=new pc(b);N.h[c]=b;N.P.push(b);return b};N.remove=function(a){for(var b=0;b<N.P.length;b++)if(N.P[b].get(V)==a){N.P.splice(b,1);N.h[a]=null;break}};N.j=function(a){return N.h[a]};N.getAll=function(){return N.P.slice(0)};
72
- N.N=function(){"ga"!=gb&&J(49);var a=O[gb];if(!a||42!=a.answer){N.L=a&&a.l;N.ya=1*new Date;N.loaded=!0;var b=O[gb]=N;X("create",b,b.create);X("remove",b,b.remove);X("getByName",b,b.j,5);X("getAll",b,b.getAll,6);b=pc.prototype;X("get",b,b.get,7);X("set",b,b.set,4);X("send",b,b.send);X("requireSync",b,b.ma);b=Ya.prototype;X("get",b,b.get);X("set",b,b.set);if("https:"!=M.location.protocol&&!Ba){a:{b=M.getElementsByTagName("script");for(var c=0;c<b.length&&100>c;c++){var d=b[c].src;if(d&&0==d.indexOf("https://www.google-analytics.com/analytics")){b=
73
- !0;break a}}b=!1}b&&(Ba=!0)}(O.gaplugins=O.gaplugins||{}).Linker=Dc;b=Dc.prototype;C("linker",Dc);X("decorate",b,b.ca,20);X("autoLink",b,b.S,25);C("displayfeatures",fd);C("adfeatures",fd);a=a&&a.q;ka(a)?Z.D.apply(N,a):J(50)}};N.da=function(){for(var a=N.getAll(),b=0;b<a.length;b++)a[b].get(V)};var we=N.N,xe=O[gb];xe&&xe.r?we():z(we);z(function(){Z.D(["provide","render",ua])});})(window);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/js/inspage.js DELETED
@@ -1,2 +0,0 @@
1
- /*! instant.page v3.0.0 - (C) 2019 Alexandre Dieulot - https://instant.page/license */
2
- let t,e;const n=new Set,o=document.createElement("link"),s=o.relList&&o.relList.supports&&o.relList.supports("prefetch")&&window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype,i="instantAllowQueryString"in document.body.dataset,r="instantAllowExternalLinks"in document.body.dataset,a="instantWhitelist"in document.body.dataset;let c=65,d=!1,l=!1,u=!1;if("instantIntensity"in document.body.dataset){const t=document.body.dataset.instantIntensity;if("mousedown"==t.substr(0,"mousedown".length))d=!0,"mousedown-only"==t&&(l=!0);else if("viewport"==t.substr(0,"viewport".length))navigator.connection&&(navigator.connection.saveData||navigator.connection.effectiveType.includes("2g"))||("viewport"==t?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(u=!0):"viewport-all"==t&&(u=!0));else{const e=parseInt(t);isNaN(e)||(c=e)}}if(s){const n={capture:!0,passive:!0};if(l||document.addEventListener("touchstart",function(t){e=performance.now();const n=t.target.closest("a");if(!f(n))return;h(n.href)},n),d?document.addEventListener("mousedown",function(t){const e=t.target.closest("a");if(!f(e))return;h(e.href)},n):document.addEventListener("mouseover",function(n){if(performance.now()-e<1100)return;const o=n.target.closest("a");if(!f(o))return;o.addEventListener("mouseout",m,{passive:!0}),t=setTimeout(()=>{h(o.href),t=void 0},c)},n),u){let t;(t=window.requestIdleCallback?t=>{requestIdleCallback(t,{timeout:1500})}:t=>{t()})(()=>{const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const n=e.target;t.unobserve(n),h(n.href)}})});document.querySelectorAll("a").forEach(e=>{f(e)&&t.observe(e)})})}}function m(e){e.relatedTarget&&e.target.closest("a")==e.relatedTarget.closest("a")||t&&(clearTimeout(t),t=void 0)}function f(t){if(t&&t.href&&(!a||"instant"in t.dataset)&&(r||t.origin==location.origin||"instant"in t.dataset)&&["http:","https:"].includes(t.protocol)&&("http:"!=t.protocol||"https:"!=location.protocol)&&(i||!t.search||"instant"in t.dataset)&&!(t.hash&&t.pathname+t.search==location.pathname+location.search||"noInstant"in t.dataset))return!0}function h(t){if(n.has(t))return;const e=document.createElement("link");e.rel="prefetch",e.href=t,document.head.appendChild(e),n.add(t)}
 
 
inc/js/lazyload.js DELETED
@@ -1,4 +0,0 @@
1
- /* lazyload.js - v15.1.1
2
- * https://github.com/verlok/lazyload
3
- * Copyright (c) 2020 Andrea Verlicchi; Licensed MIT */
4
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).LazyLoad=n()}(this,(function(){"use strict";function t(){return(t=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t}).apply(this,arguments)}var n="undefined"!=typeof window,e=n&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),a=n&&"IntersectionObserver"in window,o=n&&"classList"in document.createElement("p"),i=n&&window.devicePixelRatio>1,r={elements_selector:"img",container:e||n?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,auto_unobserve:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,use_native:!1},l=function(n){return t({},r,n)},c=function(t,n){var e,a=new t(n);try{e=new CustomEvent("LazyLoad::Initialized",{detail:{instance:a}})}catch(t){(e=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:a})}window.dispatchEvent(e)},s=function(t,n){return t.getAttribute("data-"+n)},u=function(t,n,e){var a="data-"+n;null!==e?t.setAttribute(a,e):t.removeAttribute(a)},d=function(t,n){return u(t,"ll-status",n)},f=function(t,n){return u(t,"ll-timeout",n)},_=function(t){return s(t,"ll-timeout")},g=function(t,n,e,a){t&&(void 0===a?void 0===e?t(n):t(n,e):t(n,e,a))},v=function(t,n){o?t.classList.add(n):t.className+=(t.className?" ":"")+n},p=function(t,n){o?t.classList.remove(n):t.className=t.className.replace(new RegExp("(^|\\s+)"+n+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},b=function(t){return t.llTempImage},h=function(t){t&&(t.loadingCount+=1)},m=function(t){for(var n,e=[],a=0;n=t.children[a];a+=1)"SOURCE"===n.tagName&&e.push(n);return e},y=function(t,n,e){e&&t.setAttribute(n,e)},E=function(t,n){y(t,"sizes",s(t,n.data_sizes)),y(t,"srcset",s(t,n.data_srcset)),y(t,"src",s(t,n.data_src))},w={IMG:function(t,n){var e=t.parentNode;e&&"PICTURE"===e.tagName&&m(e).forEach((function(t){E(t,n)}));E(t,n)},IFRAME:function(t,n){y(t,"src",s(t,n.data_src))},VIDEO:function(t,n){m(t).forEach((function(t){y(t,"src",s(t,n.data_src))})),y(t,"poster",s(t,n.data_poster)),y(t,"src",s(t,n.data_src)),t.load()}},I=function(t,n,e){var a=w[t.tagName];a&&(a(t,n),h(e),v(t,n.class_loading),d(t,"loading"),g(n.callback_loading,t,e),g(n.callback_reveal,t,e))},k=["IMG","IFRAME","VIDEO"],L=function(t,n){!n||n.toLoadCount||n.loadingCount||g(t.callback_finish,n)},C=function(t,n,e){t.addEventListener(n,e)},A=function(t,n,e){t.removeEventListener(n,e)},z=function(t,n,e){A(t,"load",n),A(t,"loadeddata",n),A(t,"error",e)},O=function(t,n,e){!function(t){delete t.llTempImage}(t),function(t,n){n&&(n.loadingCount-=1)}(0,e),p(t,n.class_loading)},N=function(t,n,e){var a=b(t)||t,o=function o(r){!function(t,n,e,a){O(n,e,a),v(n,e.class_loaded),d(n,"loaded"),g(e.callback_loaded,n,a),L(e,a)}(0,t,n,e),z(a,o,i)},i=function i(r){!function(t,n,e,a){O(n,e,a),v(n,e.class_error),d(n,"error"),g(e.callback_error,n,a),L(e,a)}(0,t,n,e),z(a,o,i)};!function(t,n,e){C(t,"load",n),C(t,"loadeddata",n),C(t,"error",e)}(a,o,i)},x=function(t,n){n&&(n.toLoadCount-=1)},M=function(t,n,e){!function(t){t.llTempImage=document.createElement("img")}(t),N(t,n,e),function(t,n,e){var a=s(t,n.data_bg),o=s(t,n.data_bg_hidpi),r=i&&o?o:a;r&&(t.style.backgroundImage='url("'.concat(r,'")'),b(t).setAttribute("src",r),h(e),v(t,n.class_loading),d(t,"loading"),g(n.callback_loading,t,e),g(n.callback_reveal,t,e))}(t,n,e),function(t,n,e){var a=s(t,n.data_bg_multi),o=s(t,n.data_bg_multi_hidpi),r=i&&o?o:a;r&&(t.style.backgroundImage=r,v(t,n.class_applied),d(t,"applied"),g(n.callback_applied,t,e))}(t,n,e)},R=function(t,n,e){!function(t){return k.indexOf(t.tagName)>-1}(t)?M(t,n,e):function(t,n,e){N(t,n,e),I(t,n,e)}(t,n,e),x(0,e),function(t,n){if(n){var e=n._observer;e&&n._settings.auto_unobserve&&e.unobserve(t)}}(t,e),L(n,e)},T=function(t){var n=_(t);n&&(clearTimeout(n),f(t,null))},j=function(t,n,e){var a=e._settings;g(a.callback_enter,t,n,e),a.load_delay?function(t,n,e){var a=n.load_delay,o=_(t);o||(o=setTimeout((function(){R(t,n,e),T(t)}),a),f(t,o))}(t,a,e):R(t,a,e)},F=["IMG","IFRAME"],G=function(t){return t.use_native&&"loading"in HTMLImageElement.prototype},P=function(t,n,e){t.forEach((function(t){-1!==F.indexOf(t.tagName)&&(t.setAttribute("loading","lazy"),function(t,n,e){N(t,n,e),I(t,n,e),x(0,e),d(t,"native"),L(n,e)}(t,n,e))})),e.toLoadCount=0},D=function(t,n){!function(t){t.disconnect()}(t),function(t,n){n.forEach((function(n){t.observe(n),d(n,"observed")}))}(t,n)},S=function(t){var n;a&&!G(t._settings)&&(t._observer=new IntersectionObserver((function(n){n.forEach((function(n){return function(t){return t.isIntersecting||t.intersectionRatio>0}(n)?j(n.target,n,t):function(t,n,e){var a=e._settings;g(a.callback_exit,t,n,e),a.load_delay&&T(t)}(n.target,n,t)}))}),{root:(n=t._settings).container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}))},U=function(t){return Array.prototype.slice.call(t)},V=function(t){return t.container.querySelectorAll(t.elements_selector)},$=function(t){return!function(t){return null!==s(t,"ll-status")}(t)||function(t){return"observed"===s(t,"ll-status")}(t)},q=function(t){return function(t){return"error"===s(t,"ll-status")}(t)},H=function(t,n){return function(t){return U(t).filter($)}(t||V(n))},B=function(t){var n,e=t._settings;(n=V(e),U(n).filter(q)).forEach((function(t){p(t,e.class_error),function(t){u(t,"ll-status",null)}(t)})),t.update()},J=function(t,e){var a;this._settings=l(t),this.loadingCount=0,S(this),a=this,n&&window.addEventListener("online",(function(t){B(a)})),this.update(e)};return J.prototype={update:function(t){var n=this._settings,o=H(t,n);this.toLoadCount=o.length,!e&&a?G(n)?P(o,n,this):D(this._observer,o):this.loadAll(o)},destroy:function(){this._observer&&this._observer.disconnect(),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){var n=this,e=this._settings;H(t,e).forEach((function(t){R(t,e,n)}))},load:function(t){R(t,this._settings,this)}},J.load=function(t,n){var e=l(n);R(t,e)},n&&function(t,n){if(n)if(n.length)for(var e,a=0;e=n[a];a+=1)c(t,e);else c(t,n)}(J,window.lazyLoadOptions),J}));
 
 
 
 
inc/js/plugin-install.js DELETED
@@ -1,55 +0,0 @@
1
- (function( wp, $ ) {
2
- 'use strict';
3
-
4
- if ( ! wp ) {
5
- return;
6
- }
7
-
8
- function activatePlugin( url, el ) {
9
- var message = el.data( 'message' );
10
-
11
- $.ajax( {
12
- async: true,
13
- type: 'GET',
14
- dataType: 'html',
15
- url: url,
16
- success: function() {
17
- el.removeClass( 'sbp-updating' );
18
- el.text( message );
19
- }
20
- } );
21
- }
22
-
23
- $( function() {
24
- $( document ).on( 'click', '.sbp-plugin-button', function( event ) {
25
- var action = $( this ).data( 'action' ),
26
- url = $( this ).attr( 'href' ),
27
- slug = $( this ).data( 'slug' );
28
-
29
- event.preventDefault();
30
-
31
- if ( 'install' === action ) {
32
-
33
- $( this ).addClass( 'sbp-updating disbpled' );
34
-
35
- wp.updates.installPlugin( {
36
- slug: slug
37
- } );
38
-
39
- } else if ( 'activate' === action ) {
40
-
41
- $( this ).addClass( 'sbp-updating disbpled' );
42
- activatePlugin( url, $( this ) );
43
-
44
- }
45
-
46
- } );
47
-
48
- $( document ).on( 'wp-plugin-install-success', function( response, data ) {
49
- var el = $( '.sbp-plugin-button[data-slug="' + data.slug + '"]' );
50
- event.preventDefault();
51
- activatePlugin( data.activateUrl, el );
52
- } );
53
-
54
- } );
55
- })( window.wp, jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/settings.php DELETED
@@ -1,174 +0,0 @@
1
- <?php
2
-
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- die;
6
- }
7
-
8
- if ( ! class_exists( 'Speed_Booster_Pack_Options' ) ) {
9
-
10
- class Speed_Booster_Pack_Options {
11
-
12
- private $sbp_options;
13
- private $exclude_from_move = [
14
- 'html5.js',
15
- 'show_ads.js',
16
- 'histats.com/js',
17
- 'ws.amazon.com/widgets',
18
- '/ads/',
19
- 'intensedebate.com',
20
- 'scripts.chitika.net/',
21
- 'jotform.com/',
22
- 'gist.github.com',
23
- 'forms.aweber.com',
24
- 'video.unrulymedia.com',
25
- 'stats.wp.com',
26
- 'stats.wordpress.com',
27
- 'widget.rafflecopter.com',
28
- 'widget-prime.rafflecopter.com',
29
- 'releases.flowplayer.org',
30
- 'c.ad6media.fr',
31
- 'cdn.stickyadstv.com',
32
- 'www.smava.de',
33
- 'contextual.media.net',
34
- 'app.getresponse.com',
35
- 'adserver.reklamstore.com',
36
- 's0.wp.com',
37
- 'wprp.zemanta.com',
38
- 'files.bannersnack.com',
39
- 'smarticon.geotrust.com',
40
- 'js.gleam.io',
41
- 'ir-na.amazon-adsystem.com',
42
- 'web.ventunotech.com',
43
- 'verify.authorize.net',
44
- 'ads.themoneytizer.com',
45
- 'embed.finanzcheck.de',
46
- 'imagesrv.adition.com',
47
- 'js.juicyads.com',
48
- 'form.jotformeu.com',
49
- 'speakerdeck.com',
50
- 'content.jwplatform.com',
51
- 'ads.investingchannel.com',
52
- 'app.ecwid.com',
53
- 'www.industriejobs.de',
54
- 's.gravatar.com',
55
- 'googlesyndication.com',
56
- 'a.optmstr.com',
57
- 'a.optmnstr.com',
58
- 'a.opmnstr.com',
59
- 'adthrive.com',
60
- 'mediavine.com',
61
- 'js.hsforms.net',
62
- 'googleadservices.com',
63
- 'f.convertkit.com',
64
- 'recaptcha/api.js',
65
- 'mailmunch.co',
66
- 'apps.shareaholic.com',
67
- 'dsms0mj1bbhn4.cloudfront.net',
68
- 'nutrifox.com',
69
- 'code.tidio.co',
70
- 'www.uplaunch.com',
71
- 'widget.reviewability.com',
72
- 'embed-cdn.gettyimages.com/widgets.js',
73
- 'app.mailerlite.com',
74
- 'ck.page',
75
- 'window.adsbygoogle',
76
- 'google_ad_client',
77
- 'googletag.display',
78
- 'document.write',
79
- 'google_ad',
80
- 'adsbygoogle',
81
- ];
82
-
83
- /*--------------------------------------------------------------------------------------------------------
84
- Construct the plugin object
85
- ---------------------------------------------------------------------------------------------------------*/
86
-
87
- public function __construct() {
88
-
89
- add_action( 'admin_init', [ $this, 'sbp_admin_init' ] );
90
- add_action( 'admin_menu', [ $this, 'sbp_add_menu' ] );
91
-
92
- global $sbp_js_footer_exceptions;
93
- $sbp_js_footer_exceptions = explode( PHP_EOL, get_option( 'sbp_js_footer_exceptions' ) );
94
- $sbp_js_footer_exceptions = array_map( function ( $item ) {
95
- $item = trim( $item );
96
-
97
- return $item;
98
- },
99
- $sbp_js_footer_exceptions );
100
- $sbp_js_footer_exceptions = array_merge( $this->exclude_from_move, $sbp_js_footer_exceptions );
101
- } // END public function __construct
102
-
103
-
104
- public function sbp_admin_init() {
105
-
106
- register_setting( 'speed_booster_settings_group', 'sbp_settings' );
107
- register_setting( 'speed_booster_settings_group', 'sbp_css_exceptions' );
108
- register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions' );
109
- register_setting( 'speed_booster_settings_group', 'sbp_lazyload_exclusions' );
110
- register_setting( 'speed_booster_settings_group', 'sbp_preboost' );
111
-
112
- } // END public function admin_init
113
-
114
- /*--------------------------------------------------------------------------------------------------------
115
- // Add a page to manage the plugin's settings
116
- ---------------------------------------------------------------------------------------------------------*/
117
-
118
- public function sbp_add_menu() {
119
-
120
- global $sbp_settings_page;
121
- $sbp_settings_page = add_menu_page( __( 'Speed Booster Options', 'speed-booster-pack' ),
122
- __( 'Speed Booster', 'speed-booster-pack' ),
123
- 'manage_options',
124
- 'sbp-options',
125
- [
126
- $this,
127
- 'sbp_plugin_settings_page',
128
- ],
129
- plugin_dir_url( __FILE__ ) . 'images/icon-16x16.png' );
130
-
131
- } // END public function add_menu()
132
-
133
-
134
- public function sbp_plugin_settings_page() {
135
- if ( ! current_user_can( 'manage_options' ) ) {
136
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
137
- }
138
-
139
-
140
- /*--------------------------------------------------------------------------------------------------------
141
- Global Variables used on options HTML page
142
- ---------------------------------------------------------------------------------------------------------*/
143
-
144
- global $sbp_options;
145
-
146
- $this->plugin_url = plugin_dir_url( dirname( __FILE__ ) );
147
-
148
- // fallback for stylesheets exception handle
149
- $css_exceptions = get_option( 'sbp_css_exceptions' );
150
-
151
- // fallback for javascript exception handle
152
- $js_footer_exceptions = get_option( 'sbp_js_footer_exceptions' );
153
-
154
-
155
- $js_footer_exceptions1 = get_option( 'sbp_js_footer_exceptions1' );
156
- $js_footer_exceptions2 = get_option( 'sbp_js_footer_exceptions2' );
157
- $js_footer_exceptions3 = get_option( 'sbp_js_footer_exceptions3' );
158
- $js_footer_exceptions4 = get_option( 'sbp_js_footer_exceptions4' );
159
-
160
- $lazyload_exclusions = get_option( 'sbp_lazyload_exclusions' );
161
- $sbp_preboost = get_option( 'sbp_preboost' );
162
-
163
-
164
- /*--------------------------------------------------------------------------------------------------------*/
165
-
166
-
167
- // Render the plugin options page HTML
168
- include( SPEED_BOOSTER_PACK_PATH . 'inc/template/options.php' );
169
-
170
- } // END public function sbp_plugin_settings_page()
171
-
172
- } // END class Speed_Booster_Pack_Options
173
-
174
- } // END if(!class_exists('Speed_Booster_Pack_Options'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/template/analytics/google-analytics.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- // Security control for vulnerability attempts
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- die;
5
- }
6
- ?>
7
- <!-- Speed Booster Pack - Google Analytics -->
8
- <script>
9
- (function (i, s, o, g, r, a, m) {
10
- i['GoogleAnalyticsObject'] = r;
11
- i[r] = i[r] || function () {
12
- (i[r].q = i[r].q || []).push(arguments)
13
- }, i[r].l = 1 * new Date();
14
- a = s.createElement(o), m = s.getElementsByTagName(o)[0];
15
- a.async = 1;
16
- a.src = g;
17
- m.parentNode.insertBefore(a, m)
18
- })(window, document, 'script', '<?php echo $ga_script; ?>', 'ga');
19
- ga('create', '<?php echo esc_attr($sbp_options['sbp_ga_tracking_id']); ?>', 'auto');
20
-
21
- //disable display features
22
- <?php
23
- if ( ! empty( $sbp_options['sbp_disable_display_features'] ) && $sbp_options['sbp_disable_display_features'] == "1" ) {
24
- echo "ga('set', 'allowAdFeatures', false);\n";
25
- }
26
-
27
- //anonymize ip
28
- if ( ! empty( $sbp_options['sbp_anonymize_ip'] ) && $sbp_options['sbp_anonymize_ip'] == "1" ) {
29
- echo "ga('set', 'anonymizeIp', true);\n";
30
- }
31
- ?>
32
-
33
- ga('send', 'pageview');
34
-
35
- <?php
36
- //adjusted bounce rate
37
- if ( ! empty( $sbp_options['sbp_bounce_rate'] ) ) {
38
- echo 'setTimeout("ga(' . "'send','event','adjusted bounce rate','" . esc_attr($sbp_options['sbp_bounce_rate']) . " seconds')" . '"' . "," . esc_attr($sbp_options['sbp_bounce_rate'] * 1000) . ");\n";
39
- }
40
- ?>
41
-
42
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/template/analytics/gtag.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- // Security control for vulnerability attempts
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- die;
5
- }
6
- ?>
7
-
8
- <!-- Global site tag (gtag.js) - Google Analytics -->
9
- <script async src="<?php echo $script_src; ?>"></script>
10
- <script>
11
- window.dataLayer = window.dataLayer || [];
12
- function gtag(){dataLayer.push(arguments);}
13
- gtag('js', new Date());
14
-
15
- gtag('config', '<?php echo esc_attr($tracking_id); ?>');
16
-
17
- <?php
18
- if ( ! empty( $sbp_options['sbp_disable_display_features'] ) && $sbp_options['sbp_disable_display_features'] == "1" ) {
19
- echo "gtag('config', '" . esc_attr($tracking_id) . "', { 'allow_ad_personalization_signals': false });\n";
20
- }
21
-
22
- //anonymize ip
23
- if ( ! empty( $sbp_options['sbp_anonymize_ip'] ) && $sbp_options['sbp_anonymize_ip'] == "1" ) {
24
- echo "gtag('config', '" . esc_attr($tracking_id) . "', { 'anonymize_ip': true });\n";
25
- }
26
- ?>
27
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/template/analytics/gtm.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- // Security control for vulnerability attempts
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- die;
5
- }
6
- ?>
7
-
8
- <!-- Speed Booster Pack -->
9
- <!-- Google Tag Manager -->
10
- <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
11
- new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
12
- j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
13
- '<?php echo $ga_script; ?>';f.parentNode.insertBefore(j,f);
14
- })(window,document,'script','dataLayer','<?php echo esc_attr($tracking_id); ?>');</script>
15
- <!-- End Google Tag Manager -->
16
-
17
- <!-- Google Tag Manager (noscript) -->
18
- <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo $tracking_id; ?>"
19
- height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
20
- <!-- End Google Tag Manager (noscript) -->
21
- <!-- /Speed Booster Pack -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/template/analytics/minimal-analytics.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- // Security control for vulnerability attempts
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- die;
5
- }
6
- ?>
7
-
8
- <!-- Minimal Analytics -->
9
- <script>
10
- (function(a,b,c){var d=a.history,e=document,f=navigator||{},g=localStorage,
11
- h=encodeURIComponent,i=d.pushState,k=function(){return Math.random().toString(36)},
12
- l=function(){return g.cid||(g.cid=k()),g.cid},m=function(r){var s=[];for(var t in r)
13
- r.hasOwnProperty(t)&&void 0!==r[t]&&s.push(h(t)+"="+h(r[t]));return s.join("&")},
14
- n=function(r,s,t,u,v,w,x){var z="https://www.google-analytics.com/collect",
15
- A=m({v:"1",ds:"web",aip:c.anonymizeIp?1:void 0,tid:b,cid:l(),t:r||"pageview",
16
- sd:c.colorDepth&&screen.colorDepth?screen.colorDepth+"-bits":void 0,dr:e.referrer||
17
- void 0,dt:e.title,dl:e.location.origin+e.location.pathname+e.location.search,ul:c.language?
18
- (f.language||"").toLowerCase():void 0,de:c.characterSet?e.characterSet:void 0,
19
- sr:c.screenSize?(a.screen||{}).width+"x"+(a.screen||{}).height:void 0,vp:c.screenSize&&
20
- a.visualViewport?(a.visualViewport||{}).width+"x"+(a.visualViewport||{}).height:void 0,
21
- ec:s||void 0,ea:t||void 0,el:u||void 0,ev:v||void 0,exd:w||void 0,exf:"undefined"!=typeof x&&
22
- !1==!!x?0:void 0});if(f.sendBeacon)f.sendBeacon(z,A);else{var y=new XMLHttpRequest;
23
- y.open("POST",z,!0),y.send(A)}};d.pushState=function(r){return"function"==typeof d.onpushstate&&
24
- d.onpushstate({state:r}),setTimeout(n,c.delay||10),i.apply(d,arguments)},n(),
25
- a.ma={trackEvent:function o(r,s,t,u){return n("event",r,s,t,u)},
26
- trackException:function q(r,s){return n("exception",null,null,null,null,r,s)}}})
27
- (window,"<?php echo $tracking_id; ?>",{anonymizeIp:true,colorDepth:true,characterSet:true,screenSize:true,language:true});
28
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/template/notice.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
-
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- die;
6
- }
7
-
8
- ?>
9
- <div class="notice sbp-notice is-dismissible" data-notice="welcome" id="sbp-notice">
10
- <img src="<?php echo esc_url( plugins_url( 'images/logo.png', dirname( __FILE__ ) ) ); ?>" width="80">
11
- <h1><?php esc_html_e( 'Welcome to Speed Booster Pack', 'speed-booster-pack' ); ?></h1>
12
- <p><?php printf( esc_html__( 'Thank you for installing Speed Booster Pack! Check out the %sPlugin settings%s for new features that can make your site load faster.',
13
- 'speed-booster-pack' ),
14
- '<a href="admin.php?page=sbp-options">',
15
- '</a>' ); ?></p>
16
- <p>
17
- <a href="admin.php?page=sbp-options" class="button button-primary button-hero"><?php esc_html_e( 'Get started',
18
- 'speed-booster-pack' ); ?></a>
19
- <a href="https://optimocha.com/?ref=sbp" class="button button-primary button-hero"
20
- target="_blank"><?php esc_html_e( 'Pro Optimization Service', 'speed-booster-pack' ); ?></a>
21
- </p>
22
- </div>
23
- <style>
24
- .sbp-notice {
25
- background: #e9eff3;
26
- border: 10px solid #fff;
27
- color: #608299;
28
- padding: 30px;
29
- text-align: center;
30
- position: relative;
31
- }
32
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/template/notices/beta_testers.php DELETED
@@ -1,5 +0,0 @@
1
- <div class="notice notice-info sbp-notice is-dismissible" data-notice="beta_testers">
2
- <p>
3
- <?php _e( 'We\'re rewriting Speed Booster Pack <strong>completely from scratch</strong>, and we need BETA testers.', 'speed-booster-pack' ); ?> <a href="https://github.com/optimocha/speed-booster-pack/"><?php _e( 'Click here to start testing Speed Booster Pack v4.0!', 'speed-booster-pack' ); ?></a>
4
- </p>
5
- </div>
 
 
 
 
 
inc/template/notices/migrate_js_to_footer.php DELETED
@@ -1,4 +0,0 @@
1
- <div class="notice notice-warning">
2
- <p><?php _e( '<strong>ATTENTION:</strong> In Speed Booster Pack settings, we\'ve written the JS optimization feature from scratch, and it seems that option is active in your website. To help you switch to the newly written code, we\'ve also made a migration button in the "Advanced Settings" tab.', 'speed-booster-pack' ); ?></p>
3
- <p><a href="admin.php?page=sbp-options#advanced-options" target="_blank"><?php _e( 'Migrate Now', 'speed-booster-pack' ); ?></a></p>
4
- </div>
 
 
 
 
inc/template/notices/translate.php DELETED
@@ -1,8 +0,0 @@
1
- <div class="notice notice-info sbp-notice is-dismissible" data-notice="translate">
2
- <p>
3
- <?php echo wp_sprintf( 'Would you like to translate Speed Booster Pack into <b>%s</b>? Approved translators get huge discounts for Optimocha\'s speed optimization services.', $language_list[ get_user_locale() ]['english_name'] ); ?>
4
- </p>
5
- <p>
6
- <a href="https://translate.wordpress.org/projects/wp-plugins/speed-booster-pack" target="_blank" rel="external noopener">Click here to start translating</a>, and after you're an approved translator, <a href="">click here to contact us to talk about your discount</a>!
7
- </p>
8
- </div>
 
 
 
 
 
 
 
 
inc/template/options.php DELETED
@@ -1,752 +0,0 @@
1
- <?php
2
-
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- die;
6
- }
7
-
8
- // handle closed postboxes
9
- $user_id = get_current_user_id();
10
- $option_name = 'closedpostboxes_' . 'toplevel_page_sbp-options'; // use the "pagehook" ID
11
- $option_arr = get_user_option( $option_name, $user_id ); // get the options for that page
12
-
13
-
14
- if ( is_array( $option_arr ) && in_array( 'exclude-from-footer', $option_arr ) ) {
15
- $closed = true;
16
- }
17
-
18
-
19
- if ( is_array( $option_arr ) && in_array( 'defer-from-footer', $option_arr ) ) {
20
- $closed_defer = true;
21
- }
22
-
23
- if ( isset( $_POST['migrate_js_mover'] ) ) {
24
- for ( $i = 1; $i <= 4; $i ++ ) {
25
- unregister_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions' . $i );
26
- delete_option( 'sbp_js_footer_exceptions' . $i );
27
- }
28
- }
29
-
30
- ?>
31
-
32
- <div class="wrap">
33
-
34
- <div class="sb-pack clearfix">
35
-
36
- <div class="col-main">
37
-
38
- <h1 class="admin-page-title"><?php echo esc_html( get_admin_page_title() ); ?></h1>
39
-
40
- <h2 class="nav-tab-wrapper wp-clearfix">
41
- <a class="nav-tab" href="#general-options"><span class="dashicons dashicons-admin-generic"></span> <?php _e( 'General', 'speed-booster-pack' ); ?></a>
42
- <a class="nav-tab" href="#advanced-options"><span class="dashicons dashicons-admin-settings"></span> <?php _e( 'Advanced', 'speed-booster-pack' ); ?></a>
43
- <a class="nav-tab" href="#cdn-options"><span class="dashicons dashicons-admin-site-alt"></span> <?php _e( 'CDN', 'speed-booster-pack' ); ?></a>
44
- <a class="nav-tab" href="#google-analytics"><span class="dashicons dashicons-chart-area"></span> <?php _e( 'Google Analytics', 'speed-booster-pack' ); ?></a>
45
- <a class="nav-tab" href="#optimize-more"><span class="dashicons dashicons-dashboard"></span> <?php _e( 'Optimize More', 'speed-booster-pack' ); ?></a>
46
- </h2>
47
-
48
- <form method="post" action="admin.php?page=sbp-options" id="migrate_js_mover_form">
49
- <input type="hidden" name="migrate_js_mover" value="1">
50
- </form>
51
-
52
- <form method="post" id="sbp-form" action="options.php">
53
-
54
- <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
55
- <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
56
- <?php settings_fields( 'speed_booster_settings_group' ); ?>
57
-
58
- <?php
59
- $is_using_new_version = ! ( get_option( 'sbp_js_footer_exceptions1' ) || get_option( 'sbp_js_footer_exceptions2' ) || get_option( 'sbp_js_footer_exceptions3' ) || get_option( 'sbp_js_footer_exceptions4' ) );
60
- $jquery_exceptions = [
61
- 'type' => 'section',
62
- 'label' => __( 'JavaScript Optimization', 'speed-booster-pack' ),
63
- 'items' => [
64
- 'break_warning' => [
65
- 'type' => 'warning',
66
- 'text' => __( 'This feature has the MOST potential to break your site! Please use with caution and test your website after enabling this option. Excluding inline scripts and/or JavaScript file URLs below might help fix the issues you might encounter.', 'speed-booster-pack' ),
67
- ],
68
- 'jquery_to_footer' => [
69
- 'type' => 'checkbox',
70
- 'label' => __( 'Move scripts to footer', 'speed-booster-pack' ),
71
- 'tooltip' => __( 'This option move all scripts to the footer while keeping stylesheets in the header to improve page loading speed and get a higher score on the major speed testing sites such as GTmetrix or other website speed testing tools', 'speed-booster-pack' ),
72
- 'options_group' => 'sbp_settings',
73
- ],
74
- ],
75
- ];
76
-
77
- if ( ! $is_using_new_version ) {
78
- for ( $i = 1; $i < 5; $i ++ ) {
79
- $jquery_exceptions['items']["sbp_js_footer_exceptions$i"] = [
80
- 'name' => "sbp_js_footer_exceptions$i",
81
- 'type' => 'text',
82
- ];
83
- }
84
- } else {
85
- $jquery_exceptions['items']['sbp_js_footer_exceptions'] = [
86
- 'label' => __( 'Each line will be taken as a separate exclusion rule; you can exclude URLs, parts of URLs or parts of inline scripts. DON\'T enter whole blocks of inline scripts!', 'speed-booster-pack' ),
87
- 'type' => 'textarea',
88
- 'name' => 'sbp_js_footer_exceptions'
89
- ];
90
- }
91
-
92
- $sbp_options_array = [
93
- //general options panel
94
- 'general-options' => [
95
- //General section
96
- 'sections' => [
97
- [
98
- 'type' => 'section',
99
- 'label' => __( 'Safe Optimizations', 'speed-booster-pack' ),
100
- 'items' => [
101
- 'query_strings' => [
102
- 'type' => 'checkbox',
103
- 'label' => __( 'Remove query strings', 'speed-booster-pack' ),
104
- 'tooltip' => __( 'Since most proxies do not cache resources with a ? in their URL, this option allows you to remove any query strings (version numbers) from static resources like CSS & JS files, thus improving your speed scores in services like GTmetrix, PageSpeed, YSlow and Pingdom.', 'speed-booster-pack' ),
105
- 'options_group' => 'sbp_settings',
106
- ],
107
- 'remove_emojis' => [
108
- 'type' => 'checkbox',
109
- 'label' => __( 'Remove WordPress Emoji scripts', 'speed-booster-pack' ),
110
- 'tooltip' => __( 'Emojis are fun and all, but if you are aren’t using them they actually load a JavaScript file (wp-emoji-release.min.js) on every page of your website. For a lot of businesses, this is not needed and simply adds load time to your site. So we recommend disabling this.', 'speed-booster-pack' ),
111
- 'options_group' => 'sbp_settings',
112
- ],
113
- 'remove_wsl' => [
114
- 'type' => 'checkbox',
115
- 'label' => __( 'Remove WordPress Shortlink', 'speed-booster-pack' ),
116
- 'tooltip' => __( 'WordPress URL shortening is sometimes useful, but it automatically adds an ugly code in your header, so you can remove it.', 'speed-booster-pack' ),
117
- 'options_group' => 'sbp_settings',
118
- ],
119
- 'remove_adjacent' => [
120
- 'type' => 'checkbox',
121
- 'label' => __( 'Remove Adjacent Posts Links', 'speed-booster-pack' ),
122
- 'tooltip' => __( 'WordPress incorrectly implements this feature that supposedly should fix a pagination issues but it messes up, so there is no reason to keep these around. However, some browsers may use Adjacent Posts Links to navigate your site, although you can remove it if you run a well designed theme.', 'speed-booster-pack' ),
123
- 'options_group' => 'sbp_settings',
124
- ],
125
- 'wml_link' => [
126
- 'type' => 'checkbox',
127
- 'label' => __( 'Remove Windows Live Writer Manifest', 'speed-booster-pack' ),
128
- 'tooltip' => __( 'Windows Live Writer (WLW) is a Microsoft application for composing and managing blog posts offline and publish them later. If you are not using Windows Live Writer application, you can remove it from the WP head.', 'speed-booster-pack' ),
129
- 'options_group' => 'sbp_settings',
130
- ],
131
- 'wp_generator' => [
132
- 'type' => 'checkbox',
133
- 'label' => __( 'Remove WordPress Version', 'speed-booster-pack' ),
134
- 'tooltip' => __( 'Remove the META tag that reveals the WordPress version you use. Not exactly a speed-related matter, but you should consider it as an important security measure.', 'speed-booster-pack' ),
135
- 'options_group' => 'sbp_settings',
136
- ],
137
- 'disable_self_pingbacks' => [
138
- 'type' => 'checkbox',
139
- 'label' => __( 'Disable Self Pingbacks', 'speed-booster-pack' ),
140
- 'tooltip' => __( 'A pingback is a special type of comment that’s created when you link to another blog post, as long as the other blog is set to accept pingbacks.', 'speed-booster-pack' ),
141
- 'options_group' => 'sbp_settings',
142
- ],
143
- 'remove_jquery_migrate' => [
144
- 'type' => 'checkbox',
145
- 'label' => __( 'Remove jQuery Migrate', 'speed-booster-pack' ),
146
- 'tooltip' => __( 'Remove the jquery-migrate.js script that helps older jQuery plugins to be compatible with new jQuery versions. You safely turn this setting on if your jQuery plugins are all new.', 'speed-booster-pack' ),
147
- 'options_group' => 'sbp_settings',
148
- ],
149
- 'disable_dashicons' => [
150
- 'type' => 'checkbox',
151
- 'label' => __( 'Remove Dashicons', 'speed-booster-pack' ),
152
- 'tooltip' => __( 'Remove Dashicons from front end.', 'speed-booster-pack' ),
153
- 'options_group' => 'sbp_settings',
154
- ],
155
- 'disable_heartbeat' => [
156
- 'type' => 'checkbox',
157
- 'label' => __( 'Disable Heartbeat', 'speed-booster-pack' ),
158
- 'tooltip' => __( 'Disable heartbeat everywhere ( used for autosaving and revision tracking ).', 'speed-booster-pack' ),
159
- 'options_group' => 'sbp_settings',
160
- ],
161
- 'heartbeat_frequency' => [
162
- 'type' => 'select',
163
- 'label' => __( 'Heartbeat frequency', 'speed-booster-pack' ),
164
- 'tooltip' => __( 'Controls how often the WordPress Heartbeat API is allowed to run. ', 'speed-booster-pack' ),
165
- 'options' => [
166
- '15' => '15',
167
- '30' => '30',
168
- '45' => '45',
169
- '60' => '60',
170
- ],
171
- 'options_group' => 'sbp_settings',
172
- ],
173
- 'limit_post_revisions' => [
174
- 'type' => 'select',
175
- 'label' => __( 'Limit Post Revisions', 'speed-booster-pack' ),
176
- 'tooltip' => __( 'Controls how many revisions WordPress will save ', 'speed-booster-pack' ),
177
- 'options' => [
178
- '1' => '1',
179
- '2' => '2',
180
- '3' => '3',
181
- '4' => '4',
182
- '5' => '5',
183
- '10' => '10',
184
- '15' => '15',
185
- '20' => '20',
186
- '25' => '25',
187
- '30' => '30',
188
- 'false' => 'Disable',
189
- ],
190
- 'options_group' => 'sbp_settings',
191
- ],
192
- 'autosave_interval' => [
193
- 'type' => 'select',
194
- 'label' => __( 'Autosave interval', 'speed-booster-pack' ),
195
- 'tooltip' => __( 'Controls how WordPress will autosave posts and pages while editing.', 'speed-booster-pack' ),
196
- 'options' => [
197
- '1' => __( '1 minute', 'speed-booster-pack' ),
198
- '2' => __( '2 minutes', 'speed-booster-pack' ),
199
- '3' => __( '3 minutes', 'speed-booster-pack' ),
200
- '4' => __( '4 minutes', 'speed-booster-pack' ),
201
- '5' => __( '5 minutes', 'speed-booster-pack' ),
202
- ],
203
- 'options_group' => 'sbp_settings',
204
- ],
205
- ],
206
- ],
207
- ],
208
- ],
209
- //advanced options panel
210
- 'advanced-options' => [
211
- 'sections' => [
212
- [
213
- 'type' => 'section',
214
- 'label' => __( 'Advanced Optimizations', 'speed-booster-pack' ),
215
- 'items' => [
216
- 'sbp_optimize_fonts' => [
217
- 'type' => 'checkbox',
218
- 'label' => __( '(BETA)', 'speed-booster-pack' ) . ' ' . __( 'Optimize Google Fonts', 'speed-booster-pack' ),
219
- 'tooltip' => __( 'This feature effectively gathers all the Google Font URLs in your pages together, combines all of them in one URL and adds the famous "font-display:swap" CSS feature.', 'speed-booster-pack' ),
220
- 'options_group' => 'sbp_settings',
221
- ],
222
- 'enable_instant_page' => [
223
- 'type' => 'checkbox',
224
- 'label' => __( 'Enable instant.page', 'speed-booster-pack' ),
225
- 'tooltip' => __( 'Check this option if you want to use the instant.page link preloader. This is a new and experimental feature; use with caution. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
226
- 'options_group' => 'sbp_settings',
227
- ],
228
- 'disable_cart_fragments' => [
229
- 'type' => 'checkbox',
230
- 'label' => __( 'WooCommerce: Disable cart fragments', 'speed-booster-pack' ),
231
- 'tooltip' => __( 'Check this option to disable WooCommerce&#39;s &quot;cart fragments&quot; script, which overrides all caching function to update cart totals on each page load in your theme header. This is a new and experimental feature; use with caution. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
232
- 'options_group' => 'sbp_settings',
233
- ],
234
- 'dequeue_wc_scripts' => [
235
- 'type' => 'checkbox',
236
- 'label' => __( '(BETA)', 'speed-booster-pack' ) . ' ' . __( 'Remove WooCommerce scripts in non-WC pages', 'speed-booster-pack' ),
237
- 'tooltip' => __( 'Check this option if you want to remove WooCommerce scripts in non-WooCommerce pages. This is a new and experimental feature; use with caution. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
238
- 'options_group' => 'sbp_settings',
239
- ],
240
- 'disable_password_strength_meter' => [
241
- 'type' => 'checkbox',
242
- 'label' => __( '(BETA)', 'speed-booster-pack' ) . ' ' . __( 'WooCommerce: Disable password strength meter', 'speed-booster-pack' ),
243
- 'tooltip' => __( 'Check this option if you want to disable WooCommerce password strength meter. This is a new and experimental feature; use with caution. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
244
- 'options_group' => 'sbp_settings',
245
- ],
246
- 'disable_google_maps' => [
247
- 'type' => 'checkbox',
248
- 'label' => __( 'Remove Google Maps', 'speed-booster-pack' ),
249
- 'tooltip' => __( 'Remove Google Maps from front end. ', 'speed-booster-pack' ),
250
- 'options_group' => 'sbp_settings',
251
- ],
252
- 'remove_rest_api_links' => [
253
- 'type' => 'checkbox',
254
- 'label' => __( 'Remove REST API Links', 'speed-booster-pack' ),
255
- 'tooltip' => __( 'The WordPress REST API provides API endpoints for WordPress data types that allow developers to interact with sites remotely by sending and receiving JSON (JavaScript Object Notation) objects.', 'speed-booster-pack' ),
256
- 'options_group' => 'sbp_settings',
257
- ],
258
- 'remove_all_feeds' => [
259
- 'type' => 'checkbox',
260
- 'label' => __( 'Remove all RSS feed links', 'speed-booster-pack' ),
261
- 'tooltip' => __( 'This option will remove all RSS feed links to cleanup your WordPress header. It is also useful on Unicorn – The W3C Markup Validation Service to get rid out the “feed does not validate” error.', 'speed-booster-pack' ),
262
- 'options_group' => 'sbp_settings',
263
- ],
264
- 'minify_html_js' => [
265
- 'type' => 'checkbox',
266
- 'label' => __( 'Minify HTML', 'speed-booster-pack' ),
267
- 'tooltip' => __( 'Activate this option only if you don’t want to use other minify plugins or other speed optimization plugin that has minify option included. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
268
- 'options_group' => 'sbp_settings',
269
- ],
270
- ],
271
- ],
272
- [
273
- 'type' => 'section',
274
- 'label' => __( 'Lazy Load', 'speed-booster-pack' ),
275
- 'items' => [
276
- 'sbp_enable_lazy_load' => [
277
- 'type' => 'checkbox',
278
- 'label' => __( '(BETA)', 'speed-booster-pack' ) . ' ' . __( 'Enable lazy loading of images, videos and iframes', 'speed-booster-pack' ),
279
- 'tooltip' => __( 'Check this option if you want to enable native lazy loading with fallback.', 'speed-booster-pack' ),
280
- 'options_group' => 'sbp_settings',
281
- ],
282
- 'sbp_lazyload_exclusions' => [
283
- 'type' => 'textarea',
284
- 'name' => 'lazyload_exclusions',
285
- 'label' => __( 'Exclude assets from lazy load', 'speed-booster-pack' ),
286
- 'description' => __( 'Exclude assets from being lazy loaded by id, class, src or srcset.', 'speed-booster-pack' ),
287
- ],
288
- ],
289
- ],
290
- $jquery_exceptions,
291
- [
292
- 'type' => 'section',
293
- 'label' => __( 'CSS Optimization', 'speed-booster-pack' ),
294
- 'items' => [
295
- 'sbp_css_async' => [
296
- 'type' => 'checkbox',
297
- 'label' => __( 'Inline all CSS', 'speed-booster-pack' ),
298
- 'tooltip' => __( 'Checking this option will inline the contents of all your stylesheets. This helps with the annoying render blocking error Google Page Speed Insights displays.', 'speed-booster-pack' ),
299
- 'options_group' => 'sbp_settings',
300
- ],
301
- 'sbp_css_minify' => [
302
- 'type' => 'checkbox',
303
- 'label' => __( 'Minify all (previously) inlined CSS', 'speed-booster-pack' ),
304
- 'tooltip' => __( 'Minifying all inlined CSS styles will optimize the CSS delivery and will eliminate the annoying message on Google Page Speed regarding to render-blocking css.', 'speed-booster-pack' ),
305
- 'options_group' => 'sbp_settings',
306
- ],
307
- 'sbp_footer_css' => [
308
- 'type' => 'checkbox',
309
- 'label' => __( 'Move all inlined CSS into the footer', 'speed-booster-pack' ),
310
- 'tooltip' => __( 'Inserting all CSS styles inline to the footer is a sensitive option that will eliminate render-blocking CSS warning in Google Page Speed test. If there is something broken after activation, you need to disable this option. Please note that before enabling this sensitive option, it is strongly recommended that you also enable the “ Move scripts to the footer” option.', 'speed-booster-pack' ),
311
- 'options_group' => 'sbp_settings',
312
- ],
313
- 'sbp_css_exceptions' => [
314
- 'type' => 'textarea',
315
- 'name' => 'css_exceptions',
316
- 'label' => __( 'Exclude styles from being inlined and/or minified option: ', 'speed-booster-pack' ),
317
- 'description' => __( 'Enter one by line, the handles of CSS files or the final part of the style URL.', 'speed-booster-pack' ),
318
- ],
319
- ],
320
- ],
321
- [
322
- 'type' => 'section',
323
- 'label' => __( 'PreBoost: Asset Preloader', 'speed-booster-pack' ),
324
- 'items' => [
325
- 'sbp_enable_preboost' => [
326
- 'type' => 'checkbox',
327
- 'label' => __( 'Preload assets', 'speed-booster-pack' ),
328
- 'tooltip' => __( 'Generates &lt;link rel=\'preload\'&gt; tags', 'speed-booster-pack' ),
329
- 'options_group' => 'sbp_settings',
330
- ],
331
- 'sbp_preboost' => [
332
- 'type' => 'textarea',
333
- 'name' => 'sbp_preboost',
334
- 'label' => __( 'Preload', 'speed-booster-pack' ),
335
- 'description' => __( 'Enter full URLs of the assets you want to preload. One URL per line.', 'speed-booster-pack' ),
336
- ],
337
- ],
338
- ]
339
- ],
340
- ],
341
- 'cdn-options' => [
342
- 'sections' => [
343
- [
344
- 'type' => 'section',
345
- 'label' => __( 'CDN', 'speed-booster-pack' ),
346
- 'description' => __( 'CDN options that allow you to rewrite your site URLs with your CDN URLs.', 'speed-booster-pack' ),
347
- 'items' => [
348
- 'sbp_enable_cdn' => [
349
- 'type' => 'checkbox',
350
- 'label' => __( 'Enable CDN Rewrite', 'speed-booster-pack' ),
351
- 'tooltip' => __( 'Enables rewriting of your site URLs with your CDN URLs', 'speed-booster-pack' ),
352
- 'options_group' => 'sbp_settings',
353
- ],
354
- 'sbp_cdn_url' => [
355
- 'type' => 'text',
356
- 'label' => __( 'CDN URL', 'speed-booster-pack' ),
357
- 'tooltip' => __( 'Enter your CDN URL without the trailing slash. Example: https://cdn.example.com', 'speed-booster-pack' ),
358
- 'options_group' => 'sbp_settings',
359
- ],
360
- 'sbp_cdn_included_directories' => [
361
- 'type' => 'text',
362
- 'label' => __( 'Included Directories', 'speed-booster-pack' ),
363
- 'tooltip' => __( 'Enter any directories you would like to be included in CDN rewriting, separated by commas (,). Default: wp-content,wp-includes', 'speed-booster-pack' ),
364
- 'options_group' => 'sbp_settings',
365
- 'default' => 'wp-content,wp-includes',
366
- ],
367
- 'sbp_cdn_exclusions' => [
368
- 'type' => 'text',
369
- 'label' => __( 'CDN Exclusions', 'speed-booster-pack' ),
370
- 'tooltip' => __( 'Enter any directories or file extensions you would like to be excluded from CDN rewriting, separated by commas (,). Default: .php', 'speed-booster-pack' ),
371
- 'options_group' => 'sbp_settings',
372
- 'default' => '.php',
373
- ],
374
- ],
375
- ],
376
- ],
377
- ],
378
- 'google-analytics' => [
379
- 'sections' => [
380
- [
381
- 'type' => 'section',
382
- 'label' => __( 'Google Analytics', 'speed-booster-pack' ),
383
- 'description' => __( 'Optimization options for Google Analytics.', 'speed-booster-pack' ),
384
- 'items' => [
385
- 'local_analytics_warning' => [
386
- 'type' => 'warning',
387
- 'text' => __( 'Enabling the Local Analytics option doesn\'t remove other Google Analytics scripts added via other plugins or theme options.',
388
- 'speed-booster-pack' ),
389
- 'icon' => 'dashicons-warning',
390
- ],
391
- 'minimal_analytics_warning' => [
392
- 'type' => 'warning',
393
- 'text' => __( 'Minimal Analytics (by David Künnen) is an experimental script which doesn\'t use the regular Google Analytics JS file, but is much lighter (1.5KB). Use with caution!',
394
- 'speed-booster-pack' ),
395
- 'icon' => 'dashicons-warning',
396
- 'class' => 'minimal-analytics-warning',
397
- ],
398
- 'sbp_enable_local_analytics' => [
399
- 'type' => 'checkbox',
400
- 'label' => __( 'Enable Local Analytics', 'speed-booster-pack' ),
401
- 'tooltip' => __( 'Enable syncing of the Google Analytics script to your own server.', 'speed-booster-pack' ),
402
- 'options_group' => 'sbp_settings',
403
- ],
404
- 'sbp_ga_tracking_id' => [
405
- 'type' => 'text',
406
- 'label' => __( 'Tracking ID', 'speed-booster-pack' ),
407
- 'tooltip' => __( 'Enter your Google Analytics tracking ID', 'speed-booster-pack' ),
408
- 'options_group' => 'sbp_settings',
409
- 'placeholder' => 'GTM-XXXXX or UA-XXXXX-X',
410
- ],
411
- 'sbp_ga_tracking_script' => [
412
- 'type' => 'radio',
413
- 'label' => __( 'Select Script', 'speed-booster-pack' ),
414
- 'tooltip' => __( 'Select which Google Analytics script you want to use.',
415
- 'speed-booster-pack' ),
416
- 'options_group' => 'sbp_settings',
417
- 'options' => [
418
- 'gtm' => 'Google Tag Manager',
419
- 'analytics' => 'Google Analytics',
420
- 'gtag' => 'Global Site Tag',
421
- 'minimal' => 'Minimal Analytics',
422
- ],
423
- ],
424
- 'sbp_tracking_position' => [
425
- 'type' => 'select',
426
- 'label' => __( 'Tracking code position', 'speed-booster-pack' ),
427
- 'tooltip' => __( 'Load the script in the header or footer of the site.', 'speed-booster-pack' ),
428
- 'options_group' => 'sbp_settings',
429
- 'options' => [
430
- 'footer' => 'Footer (Default)',
431
- 'header' => 'Header',
432
- ],
433
- ],
434
- 'sbp_disable_display_features' => [
435
- 'type' => 'checkbox',
436
- 'label' => __( 'Disable Display Features', 'speed-booster-pack' ),
437
- 'tooltip' => __( 'Disable marketing and advertising which generates a 2nd HTTP request', 'speed-booster-pack' ),
438
- 'options_group' => 'sbp_settings',
439
- ],
440
- 'sbp_anonymize_ip' => [
441
- 'type' => 'checkbox',
442
- 'label' => __( 'Anonymize IP', 'speed-booster-pack' ),
443
- 'tooltip' => __( 'Shorten visitor IP to comply with privacy restrictions in some countries.', 'speed-booster-pack' ),
444
- 'options_group' => 'sbp_settings',
445
- ],
446
- 'sbp_track_loggedin_admins' => [
447
- 'type' => 'checkbox',
448
- 'label' => __( 'Track Admins', 'speed-booster-pack' ),
449
- 'tooltip' => __( 'Include logged in WordPress admins in your GA report.', 'speed-booster-pack' ),
450
- 'options_group' => 'sbp_settings',
451
- ],
452
- 'sbp_bounce_rate' => [
453
- 'type' => 'text',
454
- 'label' => __( 'Adjust Bounce Rate', 'speed-booster-pack' ),
455
- 'tooltip' => __( 'Set a timeout limit in seconds to better evaluate the quality of your traffic (1 - 100)', 'speed-booster-pack' ),
456
- 'options_group' => 'sbp_settings',
457
- ],
458
- 'sbp_monsterinsights' => [
459
- 'type' => 'checkbox',
460
- 'label' => __( 'MonsterInsights Integration', 'speed-booster-pack' ),
461
- 'tooltip' => __( 'Allows MonsterInsights to manage your Google Analytics while still using the locally hosted analytics.js generated by Speed Booster Pack', 'speed-booster-pack' ),
462
- 'options_group' => 'sbp_settings',
463
- ],
464
- ],
465
- ],
466
- ],
467
- ],
468
- ];
469
-
470
- $sbp_alert_box = '<div class="sbp-static-notice bg-red"><span class="dashicons dashicons-warning"></span> ' . __( 'Activating these settings might cause conflicts with other plugins or your theme, resulting in broken styles or scripts. Use with caution!', 'speed-booster-pack' ) . '</div>';
471
- $sbp_deprecated_js_footer_alert_box = '<div class="sbp-static-notice bg-yellow"><span class="dashicons dashicons-warning"></span> ' . __( 'We recoded the feature that moves all inline scripts and JavaScript files to footer. The old code is deprecated now and will be removed in the new versions. Right now, you\'re using the old feature and it\'s still working, but you need to migrate to the new feature as soon as possible. And make sure that you jot down the current JS optimization exclusion settings!', 'speed-booster-pack' ) . '<br /><br /><button type="submit" form="migrate_js_mover_form" class="button button-primary">' . __( 'Migrate to the new feature now!', 'speed-booster-pack' ) . '</button></div>';
472
-
473
- ?>
474
-
475
- <?php
476
-
477
- //Start the tabs
478
- foreach ( $sbp_options_array as $k => $values ) { ?>
479
- <!-- Tab sections -->
480
- <div id="<?php echo $k; ?>" class="sb-pack-tab">
481
-
482
- <?php
483
-
484
- if ( $k == 'advanced-options' || $k == 'google-analytics' || $k == 'cdn-options' ) {
485
- echo $sbp_alert_box;
486
- }
487
-
488
- if ( $k == 'advanced-options' ) {
489
- if ( ! $is_using_new_version ) {
490
- echo $sbp_deprecated_js_footer_alert_box;
491
- }
492
- }
493
-
494
- ?>
495
-
496
- <?php if ( isset( $values['label'] ) ) { ?>
497
- <h3><?php echo $values['label']; ?></h3>
498
- <?php
499
- }
500
-
501
-
502
- //Start the sections
503
- foreach ( $values['sections'] as $section => $section_value ) {
504
-
505
- ?>
506
- <div class="postbox" id="<?php echo $k . "-" . $section; ?>">
507
- <h3 class="hndle ui-sortable-handle"
508
- style="cursor: pointer;"><?php echo ( isset( $section_value['label'] ) ) ? $section_value['label'] : ""; ?></h3>
509
- <div class="inside">
510
- <?php
511
-
512
- //Start the options
513
- foreach ( $section_value['items'] as $item => $item_value ) {
514
-
515
- if ( 'checkbox' == $item_value['type'] ) { ?>
516
- <div class="onoffswitch-wrapper">
517
- <?php if ( isset( $item_value['tooltip'] ) ) { ?>
518
- <span class="tooltip-right"
519
- data-tooltip="<?php echo $item_value['tooltip']; ?>">
520
- <i class="dashicons dashicons-editor-help"></i>
521
- </span>
522
- <?php } ?>
523
- <span class="chekbox-title"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></span>
524
-
525
- <div class="onoffswitch">
526
- <div class="epsilon-toggle">
527
- <input class="epsilon-toggle__input" type="checkbox" id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" value="1" <?php checked( 1, isset( $sbp_options[ $item ] ) ); ?> >
528
- <div class="epsilon-toggle__items">
529
- <span class="epsilon-toggle__track"></span>
530
- <span class="epsilon-toggle__thumb"></span>
531
- <svg class="epsilon-toggle__off" width="6" height="6" aria-hidden="true" role="img" focusable="false" viewBox="0 0 6 6">
532
- <path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path>
533
- </svg>
534
- <svg class="epsilon-toggle__on" width="2" height="6" aria-hidden="true" role="img" focusable="false" viewBox="0 0 2 6">
535
- <path d="M0 0h2v6H0z"></path>
536
- </svg>
537
- </div>
538
- </div>
539
- <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"></label>
540
- </div>
541
- </div>
542
- <?php }
543
- if ( 'select' == $item_value['type'] ) { ?>
544
- <p>
545
- <?php if ( isset( $item_value['tooltip'] ) ) { ?>
546
- <span class="tooltip-right" data-tooltip="<?php echo $item_value['tooltip']; ?>"><i class="dashicons dashicons-editor-help"></i></span>
547
- <?php } ?>
548
- <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" class="<?php echo ( isset( $item_value['label'] ) ) ? 'label-text' : ''; ?>"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></label>
549
- <select id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>">
550
- <?php
551
- foreach ( $item_value['options'] as $option_k => $op_v ) {
552
- ?>
553
- <option value="<?php echo $option_k; ?>" <?php selected(
554
- $option_k,
555
- $sbp_options[ $item ],
556
- true
557
- ); ?> ><?php echo $op_v; ?></option>
558
- <?php
559
- }
560
- ?>
561
- </select>
562
- </p>
563
- <?php }
564
-
565
- if ( 'radio' == $item_value['type'] ) { ?>
566
- <p>
567
- <div style="width: min-width: 350px; float: left; display: inline-block;">
568
- <?php if ( isset( $item_value['tooltip'] ) ) { ?>
569
- <span class="tooltip-right"
570
- data-tooltip="<?php echo $item_value['tooltip']; ?>">
571
- <i class="dashicons dashicons-editor-help"></i>
572
- </span>
573
- <?php } ?>
574
- <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"
575
- class="<?php echo ( isset( $item_value['label'] ) ) ? 'label-text' : ''; ?>"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></label>
576
- </div>
577
- <div style="display: inline-block; float: left; padding-left: 5px;">
578
- <?php
579
- foreach ( $item_value['options'] as $option_k => $op_v ) {
580
- ?>
581
- <label><input type="radio" value="<?php echo $option_k; ?>" class="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" <?php checked( $option_k, @$sbp_options[ $item ], true ); ?>> <?php echo @$op_v; ?>
582
- </label><br/>
583
- <?php
584
- }
585
- ?>
586
- </div>
587
- <div style="clear: both;"></div>
588
- </p>
589
- <?php }
590
-
591
- if ( 'link' == $item_value['type'] ) { ?>
592
- <p>
593
- <a href="<?php echo $item_value['url']; ?>" class="button <?php echo $item_value['class']; ?>"><?php echo $item_value['text']; ?></a>
594
- </p>
595
- <?php }
596
-
597
- if ( 'text' == $item_value['type'] ) { ?>
598
- <p>
599
- <?php
600
- $default_value = ( isset( $item_value['default'] ) ) ? $item_value['default'] : "";
601
- if ( isset( $item_value['options_group'] ) ) {
602
- $op_text = ( isset( $sbp_options[ $item ] ) && "" != $sbp_options[ $item ] ) ? $sbp_options[ $item ] : $default_value;
603
- } else {
604
- $op_text = ( get_option( $item ) ) ? get_option( $item ) : $default_value;
605
- }
606
-
607
- ?>
608
- <?php if ( isset( $item_value['tooltip'] ) ) { ?>
609
- <span class="tooltip-right" data-tooltip="<?php echo $item_value['tooltip']; ?>"><i class="dashicons dashicons-editor-help"></i></span>
610
- <?php } ?>
611
- <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" class="<?php echo ( isset( $item_value['label'] ) ) ? 'label-text' : ''; ?>"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></label>
612
-
613
- <input id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" type="text" value="<?php echo esc_attr( $op_text ); ?>"/>
614
- </p>
615
- <?php }
616
-
617
- if ( 'textarea' === $item_value['type'] && 'lazyload_exclusions' === $item_value['name'] ) { ?>
618
- <h4><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></h4>
619
- <p>
620
- <textarea cols="50" rows="3" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" id="<?php echo $item; ?>"><?php echo wp_kses_post( $lazyload_exclusions ); ?></textarea>
621
- </p>
622
- <p class="description">
623
- <?php echo isset( $item_value['description'] ) ? $item_value['description'] : ''; ?>
624
- </p>
625
- <?php }
626
-
627
- if ( 'textarea' === $item_value['type'] && 'css_exceptions' === $item_value['name'] ) { ?>
628
- <h4><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></h4>
629
- <p>
630
- <textarea cols="50" rows="3" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" id="<?php echo $item; ?>"><?php echo wp_kses_post( $css_exceptions ); ?></textarea>
631
- </p>
632
- <p class="description">
633
- <?php echo isset( $item_value['description'] ) ? $item_value['description'] : ''; ?>
634
- </p>
635
- <?php }
636
-
637
- if ( 'textarea' === $item_value['type'] && 'sbp_preboost' === $item_value['name'] ) { ?>
638
- <h4><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></h4>
639
- <p>
640
- <textarea cols="50" rows="3" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" id="<?php echo $item; ?>"><?php echo wp_kses_post( $sbp_preboost ); ?></textarea>
641
- </p>
642
- <p class="description">
643
- <?php echo isset( $item_value['description'] ) ? $item_value['description'] : ''; ?>
644
- </p>
645
- <?php }
646
-
647
- if ( 'textarea' === $item_value['type'] && 'sbp_js_footer_exceptions' === $item_value['name'] ) { ?>
648
- <h4><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></h4>
649
- <p>
650
- <textarea cols="50" rows="3" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" id="<?php echo $item; ?>"><?php echo wp_kses_post( $js_footer_exceptions ); ?></textarea>
651
- </p>
652
- <p class="description">
653
- <?php echo isset( $item_value['description'] ) ? $item_value['description'] : ''; ?>
654
- </p>
655
- <?php }
656
-
657
- if ( 'warning' == $item_value['type'] ) {
658
- ?>
659
- <div class="sbp-warning <?php echo isset( $item_value['background'] ) ? $item_value['background'] : 'bg-red' ?> <?php echo isset( $item_value['class'] ) ? $item_value['class'] : null; ?>">
660
- <?php if ( isset( $item_value['icon'] ) ): ?>
661
- <span class="dashicons <?php echo $item_value['icon'] ?>"></span>
662
- <?php endif; ?>
663
- <?php echo $item_value['text']; ?>
664
- </div>
665
- <?php
666
- }
667
- }
668
- ?>
669
- </div>
670
- </div>
671
- <?php
672
- }
673
- ?>
674
- </div> <!-- Tab sections -->
675
- <?php } ?>
676
-
677
- <div id="optimize-more" class="sb-pack-tab">
678
- <div class="feature-box postbox">
679
- <div class="inside clearfix">
680
- <img class="feature-box-left feature-box-image" src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/optimocha.png" alt="Optimocha"/>
681
- <div class="feature-box-right">
682
- <h2 class="feature-box-title"><?php _e( 'Speed up your website with Optimocha', 'speed-booster-pack' ) ?></h2>
683
- <p class="feature-box-description"><?php _e( 'Optimocha is a tailored speed optimization service where you can get your website optimized by a speed optimization expert. With a one-time "investment", your website will be taken care of real people. <strong>A significant speed improvement is guaranteed</strong>, so can be sure that your investment will return to you with a faster website!', 'speed-booster-pack' ); ?></p>
684
- <p class="feature-box-description"><?php _e( 'Or, if you\'d like to have someone maintain your website speed, keep everything up-to-date and ensure your website is secure all the time; you can purchase Optimocha\'s monthly optimization &amp; maintenance packages. <strong>Annual payments have more and more benefits</strong>, be sure to check them out!', 'speed-booster-pack' ); ?></p>
685
- <p class="feature-box-button">
686
- <a href="https://optimocha.com/?ref=sbp" target="_blank" class="button button-primary button-large"><?php _e( "Speed Up Your Website!", 'speed-booster-pack' ); ?></a>
687
- </p>
688
- </div>
689
- </div>
690
- </div>
691
-
692
- <div class="feature-box postbox">
693
- <div class="inside clearfix">
694
- <img class="feature-box-left feature-box-image" src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/shortpixel.png" alt="ShortPixel"/>
695
- <div class="feature-box-right">
696
- <h2 class="feature-box-title"><?php _e( 'Optimize your images with ShortPixel', 'speed-booster-pack' ) ?></h2>
697
- <p class="feature-box-description"><?php _e( 'Image optimization is essential for all websites - especially for sites with lots of images! ShortPixel Image Optimizer is probably the best image optimization plugin you can use in the WordPress ecosystem. By clicking the link below, <strong>you will get 50% more image optimization credits for the same price</strong>! The image optimization credits are good for unlimited websites and do not expire, so you can use your API key in all your websites, anytime you want.', 'speed-booster-pack' ); ?></p>
698
- <p class="feature-box-button">
699
- <a href="https://optimocha.com/go/shortpixel" target="_blank" class="button button-primary button-large"><?php _e( "Optimize Your Images!", 'speed-booster-pack' ); ?></a>
700
- </p>
701
- </div>
702
- </div>
703
- </div>
704
-
705
- <div class="feature-box postbox">
706
- <div class="inside clearfix">
707
- <img class="feature-box-left feature-box-image" src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/wp-engine.png" alt="WP Engine"/>
708
- <div class="feature-box-right">
709
- <h2 class="feature-box-title"><?php _e( 'Get better hosting at WP Engine', 'speed-booster-pack' ) ?></h2>
710
- <p class="feature-box-description"><?php _e( 'Choosing a good web hosting company make such a big difference, but often overlooked. It\'s understandable that people like to try cheap hosting packages in very large hosting companies, but if you\'re looking for a WordPress-centric hosting company with servers specially optimized for WordPress websites, be sure to check out WP Engine. Clicking the link below, <strong>you can get up to three months for free on annual payments!</strong>', 'speed-booster-pack' ); ?></p>
711
- <p class="feature-box-button">
712
- <a href="https://optimocha.com/go/wpengine" target="_blank" class="button button-primary button-large"><?php _e( "Get Better Hosting!", 'speed-booster-pack' ); ?></a>
713
- </p>
714
- </div>
715
- </div>
716
- </div>
717
-
718
- </div><!--#optimize-more-->
719
-
720
- <div>
721
- <?php submit_button( __( 'Save Changes', 'speed-booster-pack' ), 'primary large', 'submit', false ); ?>
722
- </div>
723
-
724
- </form>
725
-
726
- </div><!--/.col-main-->
727
-
728
- <div class="col-side">
729
-
730
- <div class="postbox">
731
- <h3 class="hndle"><?php _e( 'Invest in More Speed!', 'speed-booster-pack' ); ?></h3>
732
- <div class="inside">
733
- <p><?php _e( 'People abandon pages that take more than a few seconds to load, which means slow pages lose you visitors (and money). You don’t want that to happen, do you?', 'speed-booster-pack' ) ?></p>
734
- <p><?php _e( 'If you’re ready to <em>invest</em> in speeding up your website, click below for our professional, tailored speed optimization services!', 'speed-booster-pack' ); ?></a></p>
735
- <p style="text-align:center">
736
- <a href="https://optimocha.com/?ref=sbp" target="_blank" class="button button-primary button-large"><?php _e( "Speed Up Your Website!", 'speed-booster-pack' ); ?></a>
737
- </p>
738
- </div>
739
- </div>
740
-
741
- <div class="postbox">
742
- <h3 class="hndle"><?php _e( 'Test Your Website', 'speed-booster-pack' ); ?></h3>
743
- <div class="inside">
744
- <p><?php _e( 'It\'s always a good idea to keep testing your website so you can track your website\'s speed. Click the buttons below to see how well your website performs in various speed test tools!', 'speed-booster-pack' ) ?></p>
745
- <p style="text-align:center">
746
- <a href="https://gtmetrix.com/?url=<?php echo home_url( '/' ); ?>" target="_blank" class="button button-secondary"><?php _e( "Test on GTmetrix", 'speed-booster-pack' ); ?></a>&nbsp;<a href="https://developers.google.com/speed/pagespeed/insights/?url=<?php echo home_url( '/' ); ?>" target="_blank" class="button button-secondary"><?php _e( "Test on Google PageSpeed", 'speed-booster-pack' ); ?></a>
747
- </p>
748
- </div>
749
- </div>
750
- </div>
751
- </div><!--/.sb-pack-->
752
- </div> <!-- end wrap div -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-speed-booster-pack-activator.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Fired during plugin activation
5
+ *
6
+ * @link https://optimocha.com
7
+ * @since 4.0.0
8
+ *
9
+ * @package Speed_Booster_Pack
10
+ * @subpackage Speed_Booster_Pack/includes
11
+ */
12
+
13
+ use SpeedBooster\SBP_Cache;
14
+
15
+ // If this file is called directly, abort.
16
+ if ( ! defined( 'WPINC' ) ) {
17
+ die;
18
+ }
19
+
20
+ /**
21
+ * Fired during plugin activation.
22
+ *
23
+ * This class defines all code necessary to run during the plugin's activation.
24
+ *
25
+ * @since 4.0.0
26
+ * @package Speed_Booster_Pack
27
+ * @subpackage Speed_Booster_Pack/includes
28
+ * @author Optimocha <info@speedboosterpack.com>
29
+ */
30
+ class Speed_Booster_Pack_Activator {
31
+
32
+ /**
33
+ * Short Description. (use period)
34
+ *
35
+ * Long Description.
36
+ *
37
+ * @since 4.0.0
38
+ */
39
+ public static function activate() {
40
+ SBP_Cache::generate_htaccess();
41
+ }
42
+
43
+ }
includes/class-speed-booster-pack-deactivator.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Fired during plugin deactivation
5
+ *
6
+ * @link https://optimocha.com
7
+ * @since 4.0.0
8
+ *
9
+ * @package Speed_Booster_Pack
10
+ * @subpackage Speed_Booster_Pack/includes
11
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+
18
+ use SpeedBooster\SBP_Cache;
19
+
20
+ /**
21
+ * Fired during plugin deactivation.
22
+ *
23
+ * This class defines all code necessary to run during the plugin's deactivation.
24
+ *
25
+ * @since 4.0.0
26
+ * @package Speed_Booster_Pack
27
+ * @subpackage Speed_Booster_Pack/includes
28
+ * @author Optimocha <info@speedboosterpack.com>
29
+ */
30
+ class Speed_Booster_Pack_Deactivator {
31
+
32
+ /**
33
+ * Short Description. (use period)
34
+ *
35
+ * Long Description.
36
+ *
37
+ * @since 4.0.0
38
+ */
39
+ public static function deactivate() {
40
+ SBP_Cache::clear_total_cache();
41
+ SBP_Cache::set_wp_cache_constant( false );
42
+ SBP_Cache::clean_htaccess();
43
+
44
+ $adv_cache_file = WP_CONTENT_DIR . '/advanced-cache.php';
45
+ if( file_exists( $adv_cache_file ) ) {
46
+ unlink( $adv_cache_file );
47
+ }
48
+ }
49
+
50
+ }
includes/class-speed-booster-pack-i18n.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Define the internationalization functionality
5
+ *
6
+ * Loads and defines the internationalization files for this plugin
7
+ * so that it is ready for translation.
8
+ *
9
+ * @link https://optimocha.com
10
+ * @since 4.0.0
11
+ *
12
+ * @package Speed_Booster_Pack
13
+ * @subpackage Speed_Booster_Pack/includes
14
+ */
15
+
16
+ // If this file is called directly, abort.
17
+ if ( ! defined( 'WPINC' ) ) {
18
+ die;
19
+ }
20
+
21
+ /**
22
+ * Define the internationalization functionality.
23
+ *
24
+ * Loads and defines the internationalization files for this plugin
25
+ * so that it is ready for translation.
26
+ *
27
+ * @since 4.0.0
28
+ * @package Speed_Booster_Pack
29
+ * @subpackage Speed_Booster_Pack/includes
30
+ * @author Optimocha <info@speedboosterpack.com>
31
+ */
32
+ class Speed_Booster_Pack_i18n {
33
+
34
+
35
+ /**
36
+ * Load the plugin text domain for translation.
37
+ *
38
+ * @since 4.0.0
39
+ */
40
+ public function load_plugin_textdomain() {
41
+
42
+ load_plugin_textdomain( 'speed-booster-pack' );
43
+
44
+ }
45
+
46
+
47
+ }
includes/class-speed-booster-pack-loader.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Register all actions and filters for the plugin
5
+ *
6
+ * @link https://optimocha.com
7
+ * @since 4.0.0
8
+ *
9
+ * @package Speed_Booster_Pack
10
+ * @subpackage Speed_Booster_Pack/includes
11
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+
18
+ /**
19
+ * Register all actions and filters for the plugin.
20
+ *
21
+ * Maintain a list of all hooks that are registered throughout
22
+ * the plugin, and register them with the WordPress API. Call the
23
+ * run function to execute the list of actions and filters.
24
+ *
25
+ * @package Speed_Booster_Pack
26
+ * @subpackage Speed_Booster_Pack/includes
27
+ * @author Optimocha <info@speedboosterpack.com>
28
+ */
29
+ class Speed_Booster_Pack_Loader {
30
+
31
+ /**
32
+ * The array of actions registered with WordPress.
33
+ *
34
+ * @since 4.0.0
35
+ * @access protected
36
+ * @var array $actions The actions registered with WordPress to fire when the plugin loads.
37
+ */
38
+ protected $actions;
39
+
40
+ /**
41
+ * The array of filters registered with WordPress.
42
+ *
43
+ * @since 4.0.0
44
+ * @access protected
45
+ * @var array $filters The filters registered with WordPress to fire when the plugin loads.
46
+ */
47
+ protected $filters;
48
+
49
+ /**
50
+ * Initialize the collections used to maintain the actions and filters.
51
+ *
52
+ * @since 4.0.0
53
+ */
54
+ public function __construct() {
55
+
56
+ $this->actions = array();
57
+ $this->filters = array();
58
+
59
+ }
60
+
61
+ /**
62
+ * Add a new action to the collection to be registered with WordPress.
63
+ *
64
+ * @param string $hook The name of the WordPress action that is being registered.
65
+ * @param object $component A reference to the instance of the object on which the action is defined.
66
+ * @param string $callback The name of the function definition on the $component.
67
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
68
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
69
+ *
70
+ * @since 4.0.0
71
+ */
72
+ public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
73
+ $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
74
+ }
75
+
76
+ /**
77
+ * Add a new filter to the collection to be registered with WordPress.
78
+ *
79
+ * @param string $hook The name of the WordPress filter that is being registered.
80
+ * @param object $component A reference to the instance of the object on which the filter is defined.
81
+ * @param string $callback The name of the function definition on the $component.
82
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
83
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
84
+ *
85
+ * @since 4.0.0
86
+ */
87
+ public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
88
+ $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
89
+ }
90
+
91
+ /**
92
+ * A utility function that is used to register the actions and hooks into a single
93
+ * collection.
94
+ *
95
+ * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
96
+ * @param string $hook The name of the WordPress filter that is being registered.
97
+ * @param object $component A reference to the instance of the object on which the filter is defined.
98
+ * @param string $callback The name of the function definition on the $component.
99
+ * @param int $priority The priority at which the function should be fired.
100
+ * @param int $accepted_args The number of arguments that should be passed to the $callback.
101
+ *
102
+ * @return array The collection of actions and filters registered with WordPress.
103
+ * @since 4.0.0
104
+ * @access private
105
+ */
106
+ private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
107
+
108
+ $hooks[] = array(
109
+ 'hook' => $hook,
110
+ 'component' => $component,
111
+ 'callback' => $callback,
112
+ 'priority' => $priority,
113
+ 'accepted_args' => $accepted_args
114
+ );
115
+
116
+ return $hooks;
117
+
118
+ }
119
+
120
+ /**
121
+ * Register the filters and actions with WordPress.
122
+ *
123
+ * @since 4.0.0
124
+ */
125
+ public function run() {
126
+
127
+ foreach ( $this->filters as $hook ) {
128
+ add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
129
+ }
130
+
131
+ foreach ( $this->actions as $hook ) {
132
+ add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
133
+ }
134
+
135
+ }
136
+
137
+ }
includes/class-speed-booster-pack.php ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The file that defines the core plugin class
4
+ *
5
+ * A class definition that includes attributes and functions used across both the
6
+ * public-facing side of the site and the admin area.
7
+ *
8
+ * @link https://optimocha.com
9
+ * @since 4.0.0
10
+ *
11
+ * @package Speed_Booster_Pack
12
+ * @subpackage Speed_Booster_Pack/includes
13
+ */
14
+
15
+ // If this file is called directly, abort.
16
+ if ( ! defined( 'WPINC' ) ) {
17
+ die;
18
+ }
19
+
20
+ use SpeedBooster\SBP_Cache;
21
+ use SpeedBooster\SBP_CDN;
22
+ use SpeedBooster\SBP_Compatibility_Checker;
23
+ use SpeedBooster\SBP_CSS_Minifier;
24
+ use SpeedBooster\SBP_Custom_Code_Manager;
25
+ use SpeedBooster\SBP_Font_Optimizer;
26
+ use SpeedBooster\SBP_HTML_Minifier;
27
+ use SpeedBooster\SBP_JS_Optimizer;
28
+ use SpeedBooster\SBP_Lazy_Loader;
29
+ use SpeedBooster\SBP_Localize_Tracker;
30
+ use SpeedBooster\SBP_Migrator;
31
+ use SpeedBooster\SBP_Preboost;
32
+ use SpeedBooster\SBP_Special;
33
+ use SpeedBooster\SBP_Cloudflare;
34
+ use SpeedBooster\SBP_Tweaks;
35
+
36
+ /**
37
+ * The core plugin class.
38
+ *
39
+ * This is used to define internationalization, admin-specific hooks, and
40
+ * public-facing site hooks.
41
+ *
42
+ * Also maintains the unique identifier of this plugin as well as the current
43
+ * version of the plugin.
44
+ *
45
+ * @since 4.0.0
46
+ * @package Speed_Booster_Pack
47
+ * @subpackage Speed_Booster_Pack/includes
48
+ * @author Optimocha <info@speedboosterpack.com>
49
+ */
50
+ class Speed_Booster_Pack {
51
+
52
+ /**
53
+ * The loader that's responsible for maintaining and registering all hooks that power
54
+ * the plugin.
55
+ *
56
+ * @since 4.0.0
57
+ * @access protected
58
+ * @var Speed_Booster_Pack_Loader $loader Maintains and registers all hooks for the plugin.
59
+ */
60
+ protected $loader;
61
+
62
+ /**
63
+ * The unique identifier of this plugin.
64
+ *
65
+ * @since 4.0.0
66
+ * @access protected
67
+ * @var string $plugin_name The string used to uniquely identify this plugin.
68
+ */
69
+ protected $plugin_name;
70
+
71
+ /**
72
+ * The current version of the plugin.
73
+ *
74
+ * @since 4.0.0
75
+ * @access protected
76
+ * @var string $version The current version of the plugin.
77
+ */
78
+ protected $version;
79
+
80
+ /**
81
+ * Define the core functionality of the plugin.
82
+ *
83
+ * Set the plugin name and the plugin version that can be used throughout the plugin.
84
+ * Load the dependencies, define the locale, and set the hooks for the admin area and
85
+ * the public-facing side of the site.
86
+ *
87
+ * @since 4.0.0
88
+ */
89
+ public function __construct() {
90
+ if ( defined( 'SBP_VERSION' ) ) {
91
+ $this->version = SBP_VERSION;
92
+ } else {
93
+ $this->version = '4.0.0';
94
+ }
95
+ $this->plugin_name = 'speed-booster-pack';
96
+
97
+ $this->load_dependencies();
98
+ $this->set_locale();
99
+ $this->init_modules();
100
+ $this->define_admin_hooks();
101
+ $this->define_public_hooks();
102
+ }
103
+
104
+ private function should_plugin_run() {
105
+ $query_strings_to_exclude = [
106
+ "sbp_disable" => "1", // speed booster pack
107
+ "elementor-preview" => "elementor", // elementor
108
+ "ai-debug-blocks" => "1", // ad inserter
109
+ "ao_noptimize" => "1", // autoptimize
110
+ "ao_noptirocket" => "1", // autoptimize & wp rocket
111
+ "brizy" => "edit", // brizy builder
112
+ "bt-beaverbuildertheme" => "show", // beaver builder 2
113
+ "ct_builder" => "true", // oxygen builder
114
+ "customize_changeset_uuid" => null, // wordpress core customizer
115
+ "et_fb" => "1", // divi builder
116
+ "fb-edit" => "1", // fusion builder
117
+ "fl_builder" => null, // beaver builder 1
118
+ "PageSpeed" => "off", // mod_pagespeed
119
+ "preview" => "true", // wordpress core preview
120
+ "siteorigin_panels_live_editor" => null, // siteorigin page builder
121
+ "tb_preview" => "1", // themify builder
122
+ "tipi_builder" => "1", // tipi builder
123
+ "tve" => "true", // thrive architect
124
+ "vc_action" => "vc_inline", // wpbakery page builder
125
+ ];
126
+
127
+ foreach ( $query_strings_to_exclude as $query_string => $value ) {
128
+ if ( isset( $_GET[ $query_string ] ) && ( $value == $_GET[ $query_string ] || null == $value ) ) {
129
+ return false;
130
+ }
131
+ }
132
+
133
+ return true;
134
+ }
135
+
136
+ /**
137
+ * Instantiate all classes.
138
+ * Every class has inner documentation.
139
+ */
140
+ private function init_modules() {
141
+ if ( ! $this->should_plugin_run() ) {
142
+ return false;
143
+ }
144
+ new SBP_Migrator();
145
+ new SBP_JS_Optimizer();
146
+ new SBP_Tweaks();
147
+ new SBP_Font_Optimizer();
148
+ new SBP_Compatibility_Checker();
149
+ new SBP_Preboost();
150
+ new SBP_Lazy_Loader();
151
+ new SBP_CSS_Minifier();
152
+ new SBP_HTML_Minifier();
153
+ new SBP_Localize_Tracker();
154
+ new SBP_Special();
155
+ new SBP_CDN();
156
+ new SBP_Custom_Code_Manager();
157
+ new SBP_Cloudflare();
158
+ new SBP_Cache();
159
+ }
160
+
161
+ /**
162
+ * Load the required dependencies for this plugin.
163
+ *
164
+ * Include the following files that make up the plugin:
165
+ *
166
+ * - Speed_Booster_Pack_Loader. Orchestrates the hooks of the plugin.
167
+ * - Speed_Booster_Pack_i18n. Defines internationalization functionality.
168
+ * - Speed_Booster_Pack_Admin. Defines all hooks for the admin area.
169
+ * - Speed_Booster_Pack_Public. Defines all hooks for the public side of the site.
170
+ *
171
+ * Create an instance of the loader which will be used to register the hooks
172
+ * with WordPress.
173
+ *
174
+ * @since 4.0.0
175
+ * @access private
176
+ */
177
+ private function load_dependencies() {
178
+ /**
179
+ * The class responsible for orchestrating the actions and filters of the
180
+ * core plugin.
181
+ */
182
+ require_once SBP_INC_PATH . 'class-speed-booster-pack-loader.php';
183
+
184
+ /**
185
+ * The class responsible for defining internationalization functionality
186
+ * of the plugin.
187
+ */
188
+ require_once SBP_INC_PATH . 'class-speed-booster-pack-i18n.php';
189
+
190
+ /**
191
+ * The class responsible for defining all actions that occur in the admin area.
192
+ */
193
+ require_once SBP_PATH . 'admin/class-speed-booster-pack-admin.php';
194
+
195
+ /**
196
+ * The class responsible for defining all actions that occur in the public-facing
197
+ * side of the site.
198
+ */
199
+ require_once SBP_PATH . 'public/class-speed-booster-pack-public.php';
200
+
201
+ $this->loader = new Speed_Booster_Pack_Loader();
202
+ }
203
+
204
+ /**
205
+ * Define the locale for this plugin for internationalization.
206
+ *
207
+ * Uses the Speed_Booster_Pack_i18n class in order to set the domain and to register the hook
208
+ * with WordPress.
209
+ *
210
+ * @since 4.0.0
211
+ * @access private
212
+ */
213
+ private function set_locale() {
214
+
215
+ $plugin_i18n = new Speed_Booster_Pack_i18n();
216
+
217
+ $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
218
+
219
+ }
220
+
221
+ /**
222
+ * Register all of the hooks related to the admin area functionality
223
+ * of the plugin.
224
+ *
225
+ * @since 4.0.0
226
+ * @access private
227
+ */
228
+ private function define_admin_hooks() {
229
+
230
+ $plugin_admin = new Speed_Booster_Pack_Admin( $this->get_plugin_name(), $this->get_version() );
231
+
232
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
233
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
234
+
235
+ // TODO: Move this function to the Utilities class.
236
+ add_action( 'upgrader_process_complete',
237
+ function ( $upgrader_object, $hook_extra ) {
238
+ $our_plugin = 'speed-booster-pack/speed-booster-pack.php';
239
+ if ( $hook_extra['action'] == 'update' && $hook_extra['type'] == 'plugin' && isset( $hook_extra['plugins'] ) ) {
240
+ if ( in_array( $our_plugin, $hook_extra['plugins'] ) ) {
241
+ SBP_Cache::generate_htaccess();
242
+ }
243
+ }
244
+ },
245
+ 10,
246
+ 2 );
247
+
248
+ }
249
+
250
+ /**
251
+ * Register all of the hooks related to the public-facing functionality
252
+ * of the plugin.
253
+ *
254
+ * @since 4.0.0
255
+ * @access private
256
+ */
257
+ private function define_public_hooks() {
258
+ $plugin_public = new Speed_Booster_Pack_Public( $this->get_plugin_name(), $this->get_version() );
259
+
260
+ $this->loader->add_action( 'template_redirect', $plugin_public, 'template_redirect', 9999999 );
261
+ }
262
+
263
+ /**
264
+ * Run the loader to execute all of the hooks with WordPress.
265
+ *
266
+ * @since 4.0.0
267
+ */
268
+ public function run() {
269
+ $this->loader->run();
270
+ }
271
+
272
+ /**
273
+ * The name of the plugin used to uniquely identify it within the context of
274
+ * WordPress and to define internationalization functionality.
275
+ *
276
+ * @return string The name of the plugin.
277
+ * @since 4.0.0
278
+ */
279
+ public function get_plugin_name() {
280
+ return $this->plugin_name;
281
+ }
282
+
283
+ /**
284
+ * The reference to the class that orchestrates the hooks with the plugin.
285
+ *
286
+ * @return Speed_Booster_Pack_Loader Orchestrates the hooks of the plugin.
287
+ * @since 4.0.0
288
+ */
289
+ public function get_loader() {
290
+ return $this->loader;
291
+ }
292
+
293
+ /**
294
+ * Retrieve the version number of the plugin.
295
+ *
296
+ * @return string The version number of the plugin.
297
+ * @since 4.0.0
298
+ */
299
+ public function get_version() {
300
+ return $this->version;
301
+ }
302
+
303
+ }
includes/classes/class-sbp-abstract-module.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ // Just in case. Maybe we will need it in the future
11
+ abstract class SBP_Abstract_Module {
12
+ public function __construct() {
13
+ }
14
+ }
includes/classes/class-sbp-cache.php ADDED
@@ -0,0 +1,691 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Cache extends SBP_Abstract_Module {
11
+ /**
12
+ * Name of the cached file
13
+ *
14
+ * @var string $file_name
15
+ */
16
+ private $file_name = 'index.html';
17
+
18
+ public function __construct() {
19
+ if ( ! sbp_get_option( 'module_caching' ) || isset( $_SERVER['KINSTA_CACHE_ZONE'] ) || ( defined( 'IS_PRESSABLE' ) && IS_PRESSABLE ) ) {
20
+ return;
21
+ }
22
+
23
+ $this->clear_cache_hooks();
24
+
25
+ // Clear cache hook
26
+ add_action( 'init', [ $this, 'clear_cache_request' ] );
27
+
28
+ // Handle The Cache
29
+ add_filter( 'sbp_output_buffer', [ $this, 'handle_cache' ], 1000 );
30
+ }
31
+
32
+ /**
33
+ * Decides to run cache or not.
34
+ *
35
+ * @return bool
36
+ */
37
+ private function should_bypass_cache() {
38
+
39
+ // Do not cache for logged in users
40
+ if ( is_user_logged_in() ) {
41
+ return true;
42
+ }
43
+
44
+ // Check for several special pages
45
+ if ( is_search() || is_404() || is_feed() || is_trackback() || is_robots() || is_preview() || post_password_required() ) {
46
+ return true;
47
+ }
48
+
49
+ // DONOTCACHEPAGE
50
+ if ( defined( 'DONOTCACHEPAGE' ) && DONOTCACHEPAGE === true ) {
51
+ return true;
52
+ }
53
+
54
+ // Woocommerce checkout check
55
+ if ( function_exists( 'is_checkout' ) ) {
56
+ if ( is_checkout() ) {
57
+ return true;
58
+ }
59
+ }
60
+
61
+ // Woocommerce cart check
62
+ if ( function_exists( 'is_cart' ) ) {
63
+ if ( is_cart() ) {
64
+ return true;
65
+ }
66
+ }
67
+
68
+ // Check request method. Only cache get methods
69
+ if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
70
+ return true;
71
+ }
72
+
73
+ if ( ! empty( $_GET ) ) {
74
+ $include_query_strings = SBP_Utils::explode_lines( sbp_get_option( 'caching_include_query_strings' ) );
75
+
76
+ foreach ( $_GET as $key => $value ) {
77
+ if ( ! in_array( $key, $include_query_strings ) ) {
78
+ return true;
79
+ }
80
+ }
81
+ }
82
+
83
+ // Check for exclude URLs
84
+ if ( sbp_get_option( 'caching_exclude_urls' ) ) {
85
+ $exclude_urls = array_map( 'trim', explode( PHP_EOL, sbp_get_option( 'caching_exclude_urls' ) ) );
86
+ $exclude_urls[] = '/favicon.ico';
87
+ $current_url = rtrim( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '/' );
88
+ if ( count( $exclude_urls ) > 0 && in_array( $current_url, $exclude_urls ) ) {
89
+ return true;
90
+ }
91
+ }
92
+
93
+ return false;
94
+
95
+ }
96
+
97
+ /**
98
+ * Handles the HTTP request to catch cache clear action
99
+ */
100
+ public function clear_cache_request() {
101
+ if ( isset( $_GET['sbp_action'] ) && $_GET['sbp_action'] == 'sbp_clear_cache' && current_user_can( 'manage_options' ) && isset( $_GET['sbp_nonce'] ) && wp_verify_nonce( $_GET['sbp_nonce'], 'sbp_clear_total_cache' ) ) {
102
+ $redirect_url = remove_query_arg( [ 'sbp_action', 'sbp_nonce' ] );
103
+ self::clear_total_cache();
104
+ SBP_Cloudflare::clear_cache();
105
+ set_transient( 'sbp_notice_cache', '1', 60 );
106
+ wp_redirect( $redirect_url );
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Return WP_Filesystem instance
112
+ *
113
+ * @return mixed
114
+ */
115
+ private function get_filesystem() {
116
+ global $wp_filesystem;
117
+
118
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
119
+ WP_Filesystem();
120
+
121
+ return $wp_filesystem;
122
+ }
123
+
124
+ /**
125
+ * Clears all cache files and regenerates settings.json file
126
+ */
127
+ public static function clear_total_cache() {
128
+ self::delete_dir( SBP_CACHE_DIR );
129
+ self::create_settings_json();
130
+ }
131
+
132
+ /**
133
+ * Deletes directories recursively
134
+ *
135
+ * @param $dir
136
+ */
137
+ public static function delete_dir( $dir ) {
138
+ if ( ! is_dir( $dir ) ) {
139
+ return;
140
+ }
141
+
142
+ $dir_objects = @scandir( $dir );
143
+ $objects = array_filter( $dir_objects,
144
+ function ( $object ) {
145
+ return $object != '.' && $object != '..';
146
+ } );
147
+
148
+ if ( empty( $objects ) ) {
149
+ return;
150
+ }
151
+
152
+ foreach ( $objects as $object ) {
153
+ $object = $dir . DIRECTORY_SEPARATOR . $object;
154
+
155
+ if ( is_dir( $object ) ) {
156
+ self::delete_dir( $object );
157
+ } else {
158
+ @unlink( $object );
159
+ }
160
+ }
161
+
162
+ @rmdir( $dir );
163
+
164
+ clearstatcache();
165
+ }
166
+
167
+ /**
168
+ * Do all the dirty work about cache.
169
+ * First, checks query strings if they're in included query string rules or not.
170
+ * Second, checks if current url is excluded or not.
171
+ * Third, reads cache files, checks the expire time of file
172
+ * Fourth, if file doesn't exists, creates the cache file
173
+ *
174
+ * @param $html
175
+ *
176
+ * @return bool|mixed|void
177
+ */
178
+ public function handle_cache( $html ) {
179
+ if ( true === $this->should_bypass_cache() ) {
180
+ return $html;
181
+ }
182
+
183
+ $wp_filesystem = $this->get_filesystem();
184
+
185
+ if ( ! $wp_filesystem->exists( SBP_CACHE_DIR . 'settings.json' ) ) {
186
+ self::create_settings_json();
187
+ }
188
+
189
+ // Check for query strings
190
+ if ( ! empty( $_GET ) ) {
191
+ // Get included rules
192
+ $include_query_strings = SBP_Utils::explode_lines( sbp_get_option( 'caching_include_query_strings' ) );
193
+
194
+ $query_string_file_name = 'index';
195
+ // Order get parameters alphabetically (to get same filename for every order of query parameters)
196
+ ksort( $_GET );
197
+ foreach ( $_GET as $key => $value ) {
198
+ if ( in_array( $key, $include_query_strings ) ) {
199
+ $query_string_file_name .= "-$key-$value";
200
+ }
201
+ }
202
+ if ( '' !== $query_string_file_name ) {
203
+ $query_string_file_name .= '.html';
204
+ $this->file_name = md5( $query_string_file_name );
205
+ }
206
+ }
207
+
208
+ // Read cache file
209
+ $cache_file_path = $this->get_cache_file_path() . $this->file_name;
210
+
211
+ $caching_expiry = sbp_get_option( 'caching_expiry' ) * HOUR_IN_SECONDS;
212
+
213
+ $has_file_expired = $wp_filesystem->mtime( $cache_file_path ) + $caching_expiry < time();
214
+
215
+ if ( $wp_filesystem->exists( $cache_file_path ) && ! $has_file_expired ) {
216
+ return $wp_filesystem->get_contents( $cache_file_path );
217
+ }
218
+
219
+ // Apply filters
220
+ $html = apply_filters( 'sbp_cache_before_create', $html );
221
+ $this->create_cache_file( $html );
222
+
223
+ return $html;
224
+ }
225
+
226
+ /**
227
+ * Generates a cache file for visited page
228
+ *
229
+ * @param $html
230
+ */
231
+ private function create_cache_file( $html ) {
232
+ $dir_path = $this->get_cache_file_path();
233
+ $file_path = $dir_path . $this->file_name;
234
+ $sbp_cache_signature = PHP_EOL . '<!-- Cached by Speed Booster Pack -->';
235
+
236
+ wp_mkdir_p( $dir_path );
237
+ $file = @fopen( $file_path, 'w+' );
238
+ fwrite( $file, $html . $sbp_cache_signature );
239
+ fclose( $file );
240
+ }
241
+
242
+ /**
243
+ * Returns cache file path according to current URL
244
+ *
245
+ * @param null $post_url
246
+ * @param bool $is_mobile
247
+ *
248
+ * @return string
249
+ */
250
+ private function get_cache_file_path( $post_url = null, $is_mobile = false ) {
251
+ $cache_dir = SBP_CACHE_DIR;
252
+ if ( ( wp_is_mobile() && sbp_get_option( 'caching_separate_mobile' ) ) || true === $is_mobile ) {
253
+ $cache_dir = SBP_CACHE_DIR . 'mobile';
254
+ }
255
+
256
+ $path = sprintf(
257
+ '%s%s%s%s',
258
+ $cache_dir,
259
+ DIRECTORY_SEPARATOR,
260
+ parse_url(
261
+ $post_url ? $post_url : 'http://' . strtolower( $_SERVER['HTTP_HOST'] ),
262
+ PHP_URL_HOST
263
+ ),
264
+ parse_url(
265
+ $post_url ? $post_url : $_SERVER['REQUEST_URI'],
266
+ PHP_URL_PATH
267
+ )
268
+ );
269
+
270
+ if ( is_file( $path ) > 0 ) {
271
+ wp_die( 'Error occured on SBP cache. Please contact you webmaster.' );
272
+ }
273
+
274
+ return rtrim( $path, "/" ) . "/";
275
+ }
276
+
277
+ /**
278
+ * Parts of this function was inspired from Cache Enabler's codebase.
279
+ *
280
+ * @param bool $wp_cache
281
+ */
282
+ public static function set_wp_cache_constant( $wp_cache = true ) {
283
+ if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
284
+ $wp_config_file = ABSPATH . 'wp-config.php';
285
+ } else {
286
+ $wp_config_file = dirname( ABSPATH ) . '/wp-config.php';
287
+ }
288
+
289
+ if ( file_exists( $wp_config_file ) && is_writable( $wp_config_file ) ) {
290
+ // get wp config as array
291
+ $wp_config = file( $wp_config_file );
292
+
293
+ if ( $wp_cache ) {
294
+ $append_line = PHP_EOL . PHP_EOL . "define('WP_CACHE', true); // Added by Speed Booster Pack" . PHP_EOL;
295
+ } else {
296
+ $append_line = '';
297
+ }
298
+
299
+ $found_wp_cache = false;
300
+
301
+ foreach ( $wp_config as &$line ) {
302
+ if ( preg_match( '/^\s*define\s*\(\s*[\'\"]WP_CACHE[\'\"]\s*,.*\)\s*;/', $line ) ) {
303
+ $line = $append_line;
304
+ $found_wp_cache = true;
305
+ break;
306
+ }
307
+ }
308
+
309
+ // append wp cache constant if not found yet
310
+ if ( ! $found_wp_cache && $wp_cache ) {
311
+ array_shift( $wp_config );
312
+ array_unshift( $wp_config, "<?php", $append_line );
313
+ }
314
+
315
+ // write wp-config.php file
316
+ $fh = @fopen( $wp_config_file, 'w' );
317
+ foreach ( $wp_config as $ln ) {
318
+ @fwrite( $fh, $ln );
319
+ }
320
+
321
+ @fclose( $fh );
322
+ }
323
+ }
324
+
325
+ /**
326
+ * Generates advanced-cache.php and settings.json on CSF options save.
327
+ *
328
+ * @param $saved_data
329
+ */
330
+ public static function options_saved_listener( $saved_data ) {
331
+ $advanced_cache_path = WP_CONTENT_DIR . '/advanced-cache.php';
332
+
333
+ if ( ! isset( $_SERVER['KINSTA_CACHE_ZONE'] ) && ( ! defined( 'IS_PRESSABLE' ) || ! IS_PRESSABLE ) ) {
334
+
335
+ if ( sbp_get_option( 'module_caching' ) !== $saved_data['module_caching'] ) {
336
+
337
+ // Delete or recreate advanced-cache.php
338
+ if ( $saved_data['module_caching'] ) {
339
+ $sbp_advanced_cache = SBP_PATH . '/advanced-cache.php';
340
+
341
+ SBP_Cache::set_wp_cache_constant( true );
342
+
343
+ file_put_contents( WP_CONTENT_DIR . '/advanced-cache.php', file_get_contents( $sbp_advanced_cache ) );
344
+
345
+ self::create_settings_json( $saved_data );
346
+ } else {
347
+ SBP_Cache::set_wp_cache_constant( false );
348
+ if ( file_exists( $advanced_cache_path ) ) {
349
+ if ( ! unlink( $advanced_cache_path ) ) {
350
+ return wp_send_json_error( [ 'notice' => esc_html__( 'advanced-cache.php can not be removed. Please remove it manually.', 'speed-booster-pack' ), 'errors' => [] ] );
351
+ }
352
+ }
353
+ }
354
+ }
355
+ } else {
356
+ if ( file_exists( $advanced_cache_path ) ) {
357
+ @unlink( $advanced_cache_path );
358
+ }
359
+ }
360
+ }
361
+
362
+ /**
363
+ * Generates settings.json file from current options
364
+ *
365
+ * @param null $saved_data
366
+ */
367
+ public static function create_settings_json( $options = null ) {
368
+ global $wp_filesystem;
369
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
370
+ WP_Filesystem();
371
+
372
+ wp_mkdir_p( WP_CONTENT_DIR . '/cache/speed-booster' );
373
+ $settings = [
374
+ 'caching_include_query_strings' => $options !== null ? $options['caching_include_query_strings'] : sbp_get_option( 'caching_include_query_strings' ),
375
+ 'caching_expiry' => $options !== null ? $options['caching_expiry'] : sbp_get_option( 'caching_expiry' ),
376
+ 'caching_exclude_urls' => $options !== null ? $options['caching_exclude_urls'] : sbp_get_option( 'caching_exclude_urls' ),
377
+ 'caching_separate_mobile' => $options !== null ? $options['caching_separate_mobile'] : sbp_get_option( 'caching_separate_mobile' ),
378
+ ];
379
+
380
+ $wp_filesystem->put_contents( WP_CONTENT_DIR . '/cache/speed-booster/settings.json', json_encode( $settings ) );
381
+ }
382
+
383
+ public function clear_homepage_cache() {
384
+ global $wp_filesystem;
385
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
386
+ WP_Filesystem();
387
+
388
+ $home_cache = $this->get_cache_file_path( get_home_url() ) . 'index.html';
389
+ $mobile_home_cache = $this->get_cache_file_path( get_home_url(), true ) . 'index.html';
390
+
391
+ // Find index.html files
392
+ if ( $wp_filesystem->exists( $home_cache ) ) {
393
+ @unlink( $home_cache );
394
+ }
395
+
396
+ if ( $wp_filesystem->exists( $mobile_home_cache ) ) {
397
+ @unlink( $mobile_home_cache );
398
+ }
399
+ }
400
+
401
+ public function clear_post_by_id( $post_id ) {
402
+ global $wp_filesystem;
403
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
404
+ WP_Filesystem();
405
+
406
+ $home_cache = $this->get_cache_file_path( get_permalink( $post_id ) ) . 'index.html';
407
+ $mobile_home_cache = $this->get_cache_file_path( get_permalink( $post_id ), true ) . 'index.html';
408
+
409
+ // Find index.html files
410
+ if ( $wp_filesystem->exists( $home_cache ) ) {
411
+ @unlink( $home_cache );
412
+ }
413
+
414
+ if ( $wp_filesystem->exists( $mobile_home_cache ) ) {
415
+ @unlink( $mobile_home_cache );
416
+ }
417
+ }
418
+
419
+ public static function generate_htaccess( $saved_data = [] ) {
420
+ global $is_apache;
421
+
422
+ if ( ! $is_apache ) {
423
+ return;
424
+ }
425
+
426
+ $sbp_htaccess_block = '# BEGIN Speed Booster Pack
427
+ # SBP ' . SBP_VERSION . '
428
+
429
+ ## SECTION: General stuff
430
+
431
+ # UTF-8 config
432
+ AddDefaultCharset UTF-8
433
+ <IfModule mod_mime.c>
434
+ AddCharset UTF-8 .appcache .bbaw .css .htc .ics .js .json .manifest .map .markdown .md .mjs .topojson .vtt .vcard .vcf .webmanifest .xloc
435
+ </IfModule>
436
+ # FileETag config
437
+ <IfModule mod_headers.c>
438
+ Header unset ETag
439
+ </IfModule>
440
+ FileETag None
441
+ # Cache-Control config
442
+ <FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml|css|htc|js|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$">
443
+ <IfModule mod_headers.c>
444
+ Header unset Pragma
445
+ Header append Cache-Control "public"
446
+ </IfModule>
447
+ </FilesMatch>
448
+
449
+ ## SECTION: Compression (DEFLATE)
450
+
451
+ <IfModule mod_deflate.c>
452
+ <IfModule mod_setenvif.c>
453
+ <IfModule mod_headers.c>
454
+ SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
455
+ RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
456
+ SetEnvIfNoCase Request_URI \
457
+ \.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp|pdf)$ no-gzip dont-vary
458
+ </IfModule>
459
+ </IfModule>
460
+ <IfModule mod_filter.c>
461
+ AddOutputFilterByType DEFLATE "application/atom+xml" \
462
+ "application/javascript" \
463
+ "application/json" \
464
+ "application/ld+json" \
465
+ "application/manifest+json" \
466
+ "application/rdf+xml" \
467
+ "application/rss+xml" \
468
+ "application/schema+json" \
469
+ "application/geo+json" \
470
+ "application/vnd.ms-fontobject" \
471
+ "application/wasm" \
472
+ "application/x-font-ttf" \
473
+ "application/x-javascript" \
474
+ "application/x-web-app-manifest+json" \
475
+ "application/xhtml+xml" \
476
+ "application/xml" \
477
+ "font/eot" \
478
+ "font/opentype" \
479
+ "font/otf" \
480
+ "font/ttf" \
481
+ "image/bmp" \
482
+ "image/svg+xml" \
483
+ "image/vnd.microsoft.icon" \
484
+ "text/cache-manifest" \
485
+ "text/calendar" \
486
+ "text/css" \
487
+ "text/html" \
488
+ "text/javascript" \
489
+ "text/plain" \
490
+ "text/markdown" \
491
+ "text/vcard" \
492
+ "text/vnd.rim.location.xloc" \
493
+ "text/vtt" \
494
+ "text/x-component" \
495
+ "text/x-cross-domain-policy" \
496
+ "text/xml"
497
+
498
+ </IfModule>
499
+ <IfModule mod_mime.c>
500
+ AddEncoding gzip svgz
501
+ </IfModule>
502
+ </IfModule>
503
+
504
+ ## SECTION: Cache expiration
505
+
506
+ <IfModule mod_expires.c>
507
+ ExpiresActive on
508
+ ExpiresDefault "access plus 1 month"
509
+ # HTML
510
+ ExpiresByType text/html "access plus 0 seconds"
511
+ # CSS
512
+ ExpiresByType text/css "access plus 1 year"
513
+ # JavaScript
514
+ ExpiresByType application/javascript "access plus 1 year"
515
+ ExpiresByType application/x-javascript "access plus 1 year"
516
+ ExpiresByType text/javascript "access plus 1 year"
517
+ # Media files
518
+ ExpiresByType audio/ogg "access plus 1 month"
519
+ ExpiresByType image/bmp "access plus 1 month"
520
+ ExpiresByType image/gif "access plus 1 month"
521
+ ExpiresByType image/jpeg "access plus 1 month"
522
+ ExpiresByType image/png "access plus 1 month"
523
+ ExpiresByType image/apng "access plus 1 month"
524
+ ExpiresByType image/svg+xml "access plus 1 month"
525
+ ExpiresByType image/webp "access plus 1 month"
526
+ ExpiresByType video/mp4 "access plus 1 month"
527
+ ExpiresByType video/ogg "access plus 1 month"
528
+ ExpiresByType video/webm "access plus 1 month"
529
+ # Web fonts
530
+ ExpiresByType font/collection "access plus 1 month"
531
+ ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
532
+ ExpiresByType font/eot "access plus 1 month"
533
+ ExpiresByType font/opentype "access plus 1 month"
534
+ ExpiresByType font/otf "access plus 1 month"
535
+ ExpiresByType application/x-font-ttf "access plus 1 month"
536
+ ExpiresByType font/ttf "access plus 1 month"
537
+ ExpiresByType application/font-woff "access plus 1 month"
538
+ ExpiresByType application/x-font-woff "access plus 1 month"
539
+ ExpiresByType font/woff "access plus 1 month"
540
+ ExpiresByType application/font-woff2 "access plus 1 month"
541
+ ExpiresByType font/woff2 "access plus 1 month"
542
+ # Data interchange
543
+ ExpiresByType application/atom+xml "access plus 1 hour"
544
+ ExpiresByType application/rdf+xml "access plus 1 hour"
545
+ ExpiresByType application/rss+xml "access plus 1 hour"
546
+ ExpiresByType application/json "access plus 0 seconds"
547
+ ExpiresByType application/ld+json "access plus 0 seconds"
548
+ ExpiresByType application/schema+json "access plus 0 seconds"
549
+ ExpiresByType application/geo+json "access plus 0 seconds"
550
+ ExpiresByType application/xml "access plus 0 seconds"
551
+ ExpiresByType text/calendar "access plus 0 seconds"
552
+ ExpiresByType text/xml "access plus 0 seconds"
553
+ # Other
554
+ ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
555
+ ExpiresByType image/x-icon "access plus 1 week"
556
+ ExpiresByType text/x-cross-domain-policy "access plus 1 week"
557
+ ExpiresByType application/manifest+json "access plus 1 week"
558
+ ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
559
+ ExpiresByType text/cache-manifest "access plus 0 seconds"
560
+ </IfModule>
561
+
562
+ # END Speed Booster Pack';
563
+
564
+ global $wp_filesystem;
565
+
566
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
567
+ WP_Filesystem();
568
+
569
+ $htaccess_file_path = get_home_path() . '/.htaccess';
570
+
571
+ if ( $wp_filesystem->exists( $htaccess_file_path ) ) {
572
+ $current_htaccess = trim( self::get_default_htaccess() );
573
+
574
+ if ( ( isset( $saved_data['module_caching'] ) && $saved_data['module_caching'] ) || ( $saved_data == [] && sbp_get_option( 'module_caching' ) ) ) {
575
+ $current_htaccess = str_replace( "# BEGIN WordPress", $sbp_htaccess_block . PHP_EOL . PHP_EOL . "# BEGIN WordPress", $current_htaccess );
576
+ }
577
+
578
+ $wp_filesystem->put_contents( $htaccess_file_path, $current_htaccess );
579
+ }
580
+ }
581
+
582
+ public static function get_default_htaccess() {
583
+ global $wp_filesystem;
584
+
585
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
586
+ WP_Filesystem();
587
+
588
+ $htaccess_file_path = get_home_path() . '/.htaccess';
589
+
590
+ if ( $wp_filesystem->exists( $htaccess_file_path ) ) {
591
+ $current_htaccess = trim( $wp_filesystem->get_contents( $htaccess_file_path ) );
592
+ $current_htaccess = preg_replace( '/(# BEGIN Speed Booster Pack.*?# END Speed Booster Pack' . PHP_EOL . PHP_EOL . ')/msi', '', $current_htaccess );
593
+
594
+ return $current_htaccess;
595
+ }
596
+
597
+ return false;
598
+ }
599
+
600
+ /**
601
+ * Removes Speed Booster Pack's htaccess content and returns that modified htaccess code.
602
+ * Returns false if htaccess file doesn't exists
603
+ */
604
+ public static function clean_htaccess() {
605
+ global $wp_filesystem;
606
+
607
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
608
+ WP_Filesystem();
609
+
610
+ $htaccess_file_path = get_home_path() . '/.htaccess';
611
+
612
+ if ( $wp_filesystem->exists( $htaccess_file_path ) ) {
613
+ $current_htaccess = self::get_default_htaccess();
614
+ $wp_filesystem->put_contents( get_home_path() . '/.htaccess', $current_htaccess );
615
+ }
616
+ }
617
+
618
+ private function clear_cache_hooks() {
619
+ add_action( '_core_updated_successfully', 'SpeedBooster\SBP_Cache::clear_total_cache' );
620
+ add_action( 'switch_theme', 'SpeedBooster\SBP_Cache::clear_total_cache' );
621
+ add_action( 'save_post', 'SpeedBooster\SBP_Cache::clear_total_cache' );
622
+ add_action( 'autoptimize_action_cachepurged', 'SpeedBooster\SBP_Cache::clear_total_cache' );
623
+ add_action( 'upgrader_process_complete', 'SpeedBooster\SBP_Cache::clear_total_cache' );
624
+ add_action( 'woocommerce_thankyou', [ $this, 'woocommerce_cache_clean' ] );
625
+ add_action( 'woocommerce_product_set_stock', 'SpeedBooster\SBP_Cache::clear_total_cache' );
626
+ add_action( 'woocommerce_product_set_stock_status', 'SpeedBooster\SBP_Cache::clear_total_cache' );
627
+ add_action( 'woocommerce_variation_set_stock', 'SpeedBooster\SBP_Cache::clear_total_cache' );
628
+ add_action( 'woocommerce_variation_set_stock_status', 'SpeedBooster\SBP_Cache::clear_total_cache' );
629
+ add_action( 'wp_update_nav_menu', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When a custom menu is update.
630
+ add_action( 'update_option_sidebars_widgets', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When you change the order of widgets.
631
+ add_action( 'update_option_category_base', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When category permalink prefix is update.
632
+ add_action( 'update_option_tag_base', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When tag permalink prefix is update.
633
+ add_action( 'permalink_structure_changed', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When permalink structure is update.
634
+ add_action( 'edited_terms', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When a term is updated.
635
+ add_action( 'customize_save', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When customizer is saved.
636
+ add_action( 'comment_post', [ $this, 'comment_action' ] );
637
+ add_action(
638
+ 'wp_trash_post',
639
+ function ( $post_id ) {
640
+ if ( get_post_status( $post_id ) == 'publish' ) {
641
+ self::clear_total_cache();
642
+ }
643
+ }
644
+ );
645
+
646
+ // add_action( 'user_register', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When a user is added.
647
+ // add_action( 'profile_update', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When a user is updated.
648
+ // add_action( 'deleted_user', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When a user is deleted.
649
+ // add_action( 'create_term', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When a term is created.
650
+ // add_action( 'delete_term', 'SpeedBooster\SBP_Cache::clear_total_cache' ); // When a term is deleted.
651
+
652
+ if ( is_admin() ) {
653
+ add_action( 'wpmu_new_blog', 'SpeedBooster\SBP_Cache::clear_total_cache' );
654
+ add_action( 'delete_blog', 'SpeedBooster\SBP_Cache::clear_total_cache' );
655
+ add_action( 'transition_comment_status', [ $this, 'comment_transition' ], 10, 3 );
656
+ add_action( 'edit_comment', [ $this, 'comment_action' ] );
657
+ }
658
+
659
+ }
660
+
661
+ public function comment_transition( $new_status, $old_status, $comment ) {
662
+ self::clear_post_by_id( $comment->comment_post_ID );
663
+ }
664
+
665
+ public function comment_action( $comment_id ) {
666
+ $comment = get_comment( $comment_id );
667
+
668
+ if ( $comment->comment_approved ) {
669
+ self::clear_post_by_id( $comment->comment_post_ID );
670
+ }
671
+ }
672
+
673
+ public function woocommerce_cache_clean( $order_id ) {
674
+ if ( ! $order_id ) {
675
+ return;
676
+ }
677
+
678
+ $order = wc_get_order( $order_id );
679
+
680
+ $items = $order->get_items();
681
+ foreach ( $items as $item_id => $item ) {
682
+ $product_id = $item['product_id'];
683
+ self::clear_post_by_id( $product_id );
684
+
685
+ if ( $item['variation_id'] > 0 ) {
686
+ $variation_id = $item['variation_id'];
687
+ self::clear_post_by_id( $variation_id );
688
+ }
689
+ }
690
+ }
691
+ }
includes/classes/class-sbp-cdn.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_CDN extends SBP_Abstract_Module {
11
+
12
+ public function __construct() {
13
+ if ( ! sbp_get_option( 'module_special' ) || ! sbp_get_option( 'cdn_url' ) ) {
14
+ return;
15
+ }
16
+
17
+ add_filter( 'sbp_output_buffer', [ $this, 'cdn_rewriter' ] );
18
+ }
19
+
20
+ public function cdn_rewriter( $html ) {
21
+ $included_directories = 'wp\-content|wp\-includes';
22
+
23
+ //Prep Included Directories
24
+ $included_directories = apply_filters( 'sbp_cdn_included_directories', $included_directories );
25
+
26
+ //Prep Site URL
27
+ $escaped_site_url = quotemeta( get_option( 'home' ) );
28
+ $regex_url = '(https?:|)' . substr( $escaped_site_url, strpos( $escaped_site_url, '//' ) );
29
+
30
+
31
+ //Rewrite URLs + Return
32
+ $regex = '#(?<=[(\"\'])(?:' . $regex_url . ')?/(?:((?:' . $included_directories . ')[^\"\')]+)|([^/\"\']+\.[^/\"\')]+))(?=[\"\')])#';
33
+ $cdn_html = preg_replace_callback( $regex, [ $this, 'rewrite_url' ], $html );
34
+
35
+ return $cdn_html;
36
+ }
37
+
38
+ public function rewrite_url( $url ) {
39
+ $excluded_file_extensions = [
40
+ 'php',
41
+ ];
42
+
43
+ $new_filters = apply_filters( 'sbp_cdn_excluded_extensions', $excluded_file_extensions );
44
+ $excluded_file_extensions = array_merge( $excluded_file_extensions, $new_filters );
45
+ $excluded_file_extensions = array_unique( $excluded_file_extensions );
46
+
47
+ // Simply check if it's php or not
48
+ $file_extension = SBP_Utils::get_file_extension_from_url( $url[0] );
49
+ if ( in_array( $file_extension, $excluded_file_extensions ) ) {
50
+ return $url[0];
51
+ }
52
+
53
+ $sbp_cdn_url = sbp_get_option( 'cdn_url' );
54
+
55
+ //Make Sure CDN URL is Set
56
+ if ( ! empty( $sbp_cdn_url ) ) {
57
+ //Don't Rewrite if Previewing
58
+ if ( is_admin_bar_showing() && isset( $_GET['preview'] ) && $_GET['preview'] == 'true' ) {
59
+ return $url[0];
60
+ }
61
+
62
+ //Prep Site URL
63
+ $site_url = get_option( 'home' );
64
+ $site_url = substr( $site_url, strpos( $site_url, '//' ) );
65
+
66
+ //Replace URL w/ No HTTP/S Prefix
67
+ if ( strpos( $url[0], '//' ) === 0 ) {
68
+ return str_replace( $site_url, $sbp_cdn_url, $url[0] );
69
+ }
70
+
71
+ //Found Site URL, Replace Non Relative URL w/ HTTP/S Prefix
72
+ if ( strstr( $url[0], $site_url ) ) {
73
+ return str_replace( [ 'http:' . $site_url, 'https:' . $site_url ], $sbp_cdn_url, $url[0] );
74
+ }
75
+
76
+ //Replace Relative URL
77
+ return $sbp_cdn_url . $url[0];
78
+ }
79
+
80
+ //Return Original URL
81
+ return $url[0];
82
+ }
83
+ }
includes/classes/class-sbp-cloudflare.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Cloudflare extends SBP_Abstract_Module {
11
+ private static $api_url = 'https://api.cloudflare.com/client/v4/zones/';
12
+
13
+ public function __construct() {
14
+ if ( ! sbp_get_option( 'cloudflare_enable' ) ) {
15
+ return;
16
+ }
17
+ }
18
+
19
+ public static function clear_cache() {
20
+ if ( sbp_get_option( 'cloudflare_enable' ) ) {
21
+ $email = sbp_get_option( 'cloudflare_email' );
22
+ $api_key = sbp_get_option( 'cloudflare_api' );
23
+ $zone = sbp_get_option( 'cloudflare_zone' );
24
+
25
+ $headers = [
26
+ 'x_auth_key' => 'X-Auth-Key: ' . $api_key,
27
+ 'x_auth_email' => 'X-Auth-Email: ' . $email,
28
+ ];
29
+
30
+ $result = self::send_request( $zone, '/purge_cache', [ 'purge_everything' => true ], $headers, 'POST' );
31
+ if ( true === $result['success'] ) {
32
+ return true;
33
+ }
34
+ }
35
+
36
+ return false;
37
+ }
38
+
39
+ public static function reset_transient( $saved_data = [] ) {
40
+ if ( sbp_get_option( 'cloudflare_zone' ) != $saved_data['cloudflare_zone'] ||
41
+ sbp_get_option( 'cloudflare_email' ) != $saved_data['cloudflare_email'] ||
42
+ sbp_get_option( 'cloudflare_api' ) != $saved_data['cloudflare_api'] ) {
43
+ delete_transient( 'sbp_cloudflare_status' );
44
+ }
45
+ }
46
+
47
+ public static function check_credentials() {
48
+ $email = sbp_get_option( 'cloudflare_email' );
49
+ $api_key = sbp_get_option( 'cloudflare_api' );
50
+ $zone = sbp_get_option( 'cloudflare_zone' );
51
+
52
+ if ( ! $email || ! $api_key || ! $zone ) {
53
+ return;
54
+ }
55
+
56
+ if ( 1 != get_transient( 'sbp_cloudflare_status' ) && ! empty( $zone ) ) {
57
+
58
+ $headers = [
59
+ 'x_auth_key' => 'X-Auth-Key: ' . $api_key,
60
+ 'x_auth_email' => 'X-Auth-Email: ' . $email,
61
+ ];
62
+
63
+ $result = self::send_request( $zone, '', [], $headers );
64
+
65
+ if ( true !== $result['success'] ) {
66
+ set_transient( 'sbp_cloudflare_status', 0 );
67
+ } else {
68
+ set_transient( 'sbp_cloudflare_status', 1 );
69
+ }
70
+ }
71
+ }
72
+
73
+ /**
74
+ * @param $zone
75
+ * @param $path
76
+ * @param array $post_fields
77
+ * @param array $headers Valid HTTP headers to add.
78
+ * @param string $method
79
+ *
80
+ * @return array|bool[]|mixed
81
+ */
82
+ private static function send_request( $zone, $path, $post_fields = [], $headers = [], $method = 'GET' ) {
83
+ if ( ! function_exists( 'curl_init' ) ) {
84
+ return [ 'success' => false ];
85
+ }
86
+
87
+ $curl_connection = curl_init();
88
+
89
+ $default_headers = [
90
+ 'content_type' => 'Content-Type: application/json',
91
+ ];
92
+
93
+ $headers = array_filter( array_values( array_merge( $default_headers, $headers ) ) );
94
+
95
+ $fields = wp_json_encode( $post_fields );
96
+
97
+ curl_setopt( $curl_connection, CURLOPT_URL, self::$api_url . $zone . $path );
98
+ curl_setopt( $curl_connection, CURLOPT_CUSTOMREQUEST, $method );
99
+ curl_setopt( $curl_connection, CURLOPT_POSTFIELDS, $fields );
100
+ curl_setopt( $curl_connection, CURLOPT_RETURNTRANSFER, true );
101
+ curl_setopt( $curl_connection, CURLOPT_HTTPHEADER, $headers );
102
+ curl_setopt( $curl_connection, CURLOPT_CONNECTTIMEOUT, 5 );
103
+ curl_setopt( $curl_connection, CURLOPT_TIMEOUT, 10 );
104
+ curl_setopt( $curl_connection, CURLOPT_USERAGENT, '"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36"' );
105
+
106
+ $request_response = curl_exec( $curl_connection );
107
+ $result = json_decode( $request_response, true );
108
+ curl_close( $curl_connection );
109
+
110
+ if ( ! is_array( $result ) ) {
111
+ return [ 'success' => false, 'errors' => [ __( 'Cloudflare didn\'t respond correctly.', 'speed-booster-pack' ) ] ];
112
+ }
113
+
114
+ return $result;
115
+ }
116
+ }
includes/classes/class-sbp-compatibility-checker.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Compatibility_Checker extends SBP_Abstract_Module {
11
+ private $plugins_list = [
12
+ 'wp-http-compression/wp-http-compression.php',
13
+ 'wordpress-gzip-compression/ezgz.php',
14
+ 'gzip-ninja-speed-compression/gzip-ninja-speed.php',
15
+ 'wp-performance-score-booster/wp-performance-score-booster.php',
16
+ 'remove-query-strings-from-static-resources/remove-query-strings.php',
17
+ 'query-strings-remover/query-strings-remover.php',
18
+ 'wp-ffpc/wp-ffpc.php',
19
+ 'far-future-expiry-header/far-future-expiration.php',
20
+ 'combine-css/combine-css.php',
21
+ 'super-static-cache/super-static-cache.php',
22
+ 'wpcompressor/wpcompressor.php',
23
+ 'check-and-enable-gzip-compression/richards-toolbox.php',
24
+ 'leverage-browser-caching-ninjas/leverage-browser-caching-ninja.php',
25
+ 'force-gzip/force-gzip.php',
26
+ 'enable-gzip-compression/enable-gzip-compression.php',
27
+ 'leverage-browser-caching/leverage-browser-caching.php',
28
+ 'add-expires-headers/add-expires-headers.php',
29
+ 'swift-performance-lite/performance.php',
30
+ 'swift-performance/performance.php',
31
+ 'w3-total-cache/w3-total-cache.php',
32
+ 'wp-super-cache/wp-cache.php',
33
+ 'litespeed-cache/litespeed-cache.php',
34
+ 'quick-cache/quick-cache.php',
35
+ 'hyper-cache/plugin.php',
36
+ 'hyper-cache-extended/plugin.php',
37
+ 'wp-fast-cache/wp-fast-cache.php',
38
+ 'flexicache/wp-plugin.php',
39
+ 'wp-fastest-cache/wpFastestCache.php',
40
+ 'lite-cache/plugin.php',
41
+ 'gator-cache/gator-cache.php',
42
+ 'cache-enabler/cache-enabler.php',
43
+ 'wp-rocket/wp-rocket.php',
44
+ 'bj-lazy-load/bj-lazy-load.php',
45
+ 'lazy-load/lazy-load.php',
46
+ 'jquery-image-lazy-loading/jq_img_lazy_load.php',
47
+ 'advanced-lazy-load/advanced_lazyload.php',
48
+ 'crazy-lazy/crazy-lazy.php',
49
+ 'specify-image-dimensions/specify-image-dimensions.php',
50
+ 'lazy-load-for-videos/codeispoetry.php',
51
+ 'wp-rocket/wp-rocket.php',
52
+ 'wp-super-minify/wp-super-minify.php',
53
+ 'bwp-minify/bwp-minify.php',
54
+ 'wp-minify/wp-minify.php',
55
+ 'scripts-gzip/scripts_gzip.php',
56
+ 'minqueue/plugin.php',
57
+ 'dependency-minification/dependency-minification.php',
58
+ 'fast-velocity-minify/fvm.php',
59
+ 'async-js-and-css/asyncJSandCSS.php',
60
+ 'merge-minify-refresh/merge-minify-refresh.php',
61
+ 'wp-html-compression/wp-html-compression.php',
62
+ 'wp-compress-html/wp_compress_html.php',
63
+ 'wp-js/wp-js.php',
64
+ 'combine-js/combine-js.php',
65
+ 'footer-javascript/footer-javascript.php',
66
+ 'scripts-to-footerphp/scripts-to-footer.php',
67
+ ];
68
+
69
+ private $active_plugins = [];
70
+
71
+ public function __construct() {
72
+ $extra_plugins_list = [];
73
+ $extra_plugins_list = apply_filters( 'sbp_incompatible_plugins', $extra_plugins_list );
74
+ $this->plugins_list = array_merge( $this->plugins_list, $extra_plugins_list );
75
+
76
+ add_action( 'admin_enqueue_scripts', [ $this, 'add_dismiss_notice_script' ] );
77
+ add_action( 'wp_ajax_sbp_dismiss_compat_notice', [ $this, 'dismiss_notice' ] );
78
+
79
+ add_action( 'admin_init', [ $this, 'check_plugins_active' ] );
80
+ add_action( 'admin_notices', [ $this, 'compatibility_notices' ] );
81
+ }
82
+
83
+ public function compatibility_notices() {
84
+ if ( get_current_screen()->id !== 'plugins' && get_current_screen()->id != 'toplevel_page_sbp-settings' ) {
85
+ return;
86
+ }
87
+
88
+ $plugins = $this->active_plugins;
89
+ if ( 0 === count( $plugins ) ) {
90
+ return;
91
+ }
92
+
93
+ foreach ( $this->active_plugins as $plugin ) {
94
+ $slash_position = strpos( $plugin, '/' );
95
+ $notice_id = $slash_position ? substr( $plugin, 0, $slash_position ) : $plugin;
96
+
97
+ $dismissed_notices = get_user_meta( get_current_user_id(), 'sbp_dismissed_compat_notices', true );
98
+ $dismissed_notices = $dismissed_notices == '' ? [] : $dismissed_notices;
99
+ if ( $dismissed_notices && is_array( $dismissed_notices ) && in_array( $notice_id, $dismissed_notices ) ) {
100
+ continue;
101
+ }
102
+
103
+ $plugin_name = get_plugin_data( WP_CONTENT_DIR . '/plugins/' . $plugin )['Name'];
104
+ echo '<div class="notice notice-warning is-dismissible sbp-compatibility-notice" data-notice-id="' . $notice_id . '">
105
+ <p>
106
+ ' . sprintf( __( 'The "%1$s" plugin has similar features to %2$s\'s, which might cause overlaps or even conflicts. Make sure you\'re not using the similar features of each plugin at the same time, test thoroughly and deactivate %1$s if necessary.', 'speed-booster-pack' ), "<strong>$plugin_name</strong>", SBP_PLUGIN_NAME ) . '
107
+ </p>
108
+ </div>';
109
+ }
110
+ }
111
+
112
+ public function check_plugins_active() {
113
+ foreach ( $this->plugins_list as $plugin ) {
114
+ if ( is_plugin_active( $plugin ) ) {
115
+ $this->active_plugins[] = $plugin;
116
+ }
117
+ }
118
+
119
+ $this->active_plugins = array_unique( $this->active_plugins );
120
+ }
121
+
122
+ public function add_dismiss_notice_script() {
123
+ $script = '
124
+ jQuery(function() {
125
+ jQuery(document).on("click", ".sbp-compatibility-notice .notice-dismiss", function() {
126
+ jQuery.ajax({
127
+ url: ajaxurl,
128
+ type: "POST",
129
+ data: {
130
+ action: "sbp_dismiss_compat_notice",
131
+ notice_id: jQuery(this).parent().attr("data-notice-id")
132
+ }
133
+ });
134
+ });
135
+ })
136
+ ';
137
+ wp_add_inline_script( 'jquery', $script );
138
+ }
139
+
140
+ public function dismiss_notice() {
141
+ if ( current_user_can( 'manage_options' ) && isset( $_POST['notice_id'] ) && isset( $_POST['action'] ) && $_POST['action'] == 'sbp_dismiss_compat_notice' ) {
142
+ $id = $_POST['notice_id'];
143
+ $dismiss_options = get_user_meta( get_current_user_id(), 'sbp_dismissed_compat_notices', true );
144
+ $dismiss_options = $dismiss_options == '' ? [] : $dismiss_options;
145
+ $dismiss_options[] = $id;
146
+ $dismiss_options = array_unique( $dismiss_options );
147
+ update_user_meta( get_current_user_id(), 'sbp_dismissed_compat_notices', $dismiss_options );
148
+ }
149
+ }
150
+ }
includes/classes/class-sbp-css-minifier.php ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_CSS_Minifier extends SBP_Abstract_Module {
11
+ private $styles_list = [];
12
+ private $exceptions = [
13
+ 'admin-bar',
14
+ 'dashicons',
15
+ ];
16
+
17
+ public function __construct() {
18
+ if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'css_inline' ) ) {
19
+ return;
20
+ }
21
+
22
+ $this->set_exceptions();
23
+
24
+ add_action( 'wp_print_styles', [ $this, 'print_styles' ] );
25
+ }
26
+
27
+ public function print_styles() {
28
+ if ( sbp_get_option( 'css_minify' ) ) {
29
+ $minify = true;
30
+ } else {
31
+ $minify = false;
32
+ }
33
+
34
+ $this->generate_styles_list();
35
+
36
+ $not_inlined = [];
37
+
38
+ foreach ( $this->styles_list as $style ) {
39
+ echo "<style type=\"text/css\" " . ( $style['media'] ? "media=\"{$style['media']}\"" : '' ) . ">";
40
+ if ( ! $this->inline_css( $style['src'], $minify ) ) {
41
+ $not_inlined[] = $style;
42
+ }
43
+ echo "</style>";
44
+ }
45
+ if ( ! empty( $not_inlined ) ) {
46
+ foreach ( $not_inlined as $style ) {
47
+ ?>
48
+ <link rel="stylesheet" href="<?php echo $style['src'] ?>" type="text/css" <?php echo $style['media'] ? "media=\"{$style['media']}\"" : '' ?> /><?php
49
+ }
50
+ }
51
+
52
+ $this->unregister_styles();
53
+ }
54
+
55
+ private function set_exceptions() {
56
+ $sbp_exceptions = SBP_Utils::explode_lines( sbp_get_option( 'css_exclude' ) );
57
+ $this->exceptions = array_merge( $sbp_exceptions, $this->exceptions );
58
+
59
+ foreach ( $this->exceptions as $key => $exception ) {
60
+ if ( trim( $exception ) != '' ) {
61
+ $css_exceptions[ $key ] = trim( $exception );
62
+ }
63
+ }
64
+ }
65
+
66
+ private function generate_styles_list() {
67
+ global $wp_styles;
68
+
69
+ if ( isset( $wp_styles->queue ) && is_array( $wp_styles->queue ) ) {
70
+ foreach ( $wp_styles->queue as $style ) {
71
+ if ( ! $this->is_css_excluded( $style ) ) {
72
+ $this->styles_list[] = [
73
+ 'src' => $wp_styles->registered[ $style ]->src,
74
+ 'media' => $wp_styles->registered[ $style ]->args,
75
+ ];
76
+ }
77
+ }
78
+ }
79
+ }
80
+
81
+ private function unregister_styles() {
82
+ global $wp_styles;
83
+
84
+ if ( isset( $wp_styles->queue ) && is_array( $wp_styles->queue ) ) {
85
+ foreach ( $wp_styles->queue as $style ) {
86
+ if ( $this->is_css_excluded( $style ) ) {
87
+ continue;
88
+ }
89
+
90
+ wp_dequeue_style( $style );
91
+ wp_deregister_style( $style );
92
+ }
93
+ }
94
+ }
95
+
96
+ private function inline_css( $url, $minify = true ) {
97
+ $base_url = get_bloginfo( 'wpurl' );
98
+ $path = false;
99
+
100
+ if ( strpos( $url, $base_url ) !== false ) {
101
+
102
+ $path = str_replace( $base_url, rtrim( ABSPATH, '/' ), $url );
103
+
104
+ } elseif ( $url[0] == '/' && $url[1] != '/' ) {
105
+
106
+ $path = rtrim( ABSPATH, '/' ) . $url;
107
+ $url = $base_url . $url;
108
+ }
109
+
110
+ if ( $path && file_exists( $path ) ) {
111
+
112
+ $css = file_get_contents( $path );
113
+
114
+ if ( $minify ) {
115
+ $css = $this->minify_css( $css );
116
+ }
117
+
118
+ $css = $this->rebuilding_css_urls( $css, $url );
119
+
120
+ echo $css;
121
+
122
+ return true;
123
+
124
+ } else {
125
+
126
+ return false;
127
+ }
128
+
129
+ }
130
+
131
+ private function rebuilding_css_urls( $css, $url ) {
132
+ $css_dir = substr( $url, 0, strrpos( $url, '/' ) );
133
+
134
+ // remove empty url() declarations
135
+ $css = preg_replace( "/url\(\s?\)/", "", $css );
136
+ // new regex expression
137
+ $css = preg_replace( "/url(?!\(['\"]?(data:|http:|https:))\(['\"]?([^\/][^'\"\)]*)['\"]?\)/i",
138
+ "url({$css_dir}/$2)",
139
+ $css );
140
+
141
+
142
+ return $css;
143
+ }
144
+
145
+ private function minify_css( $css ) {
146
+
147
+ $css = $this->remove_multiline_comments( $css );
148
+ $css = str_replace( [ "\t", "\n", "\r" ], ' ', $css );
149
+ $cnt = 1;
150
+
151
+ while ( $cnt > 0 ) {
152
+ $css = str_replace( ' ', ' ', $css, $cnt );
153
+ }
154
+
155
+ $css = str_replace( [ ' {', '{ ' ], '{', $css );
156
+ $css = str_replace( [ ' }', '} ', ';}' ], '}', $css );
157
+ $css = str_replace( ': ', ':', $css );
158
+ $css = str_replace( '; ', ';', $css );
159
+ $css = str_replace( ', ', ',', $css );
160
+
161
+ return $css;
162
+ }
163
+
164
+ private function remove_multiline_comments( $code, $method = 0 ) {
165
+
166
+ switch ( $method ) {
167
+ case 1:
168
+ {
169
+
170
+ $code = preg_replace( '/\s*(?!<\")\/\*[^\*]+\*\/(?!\")\s*/', '', $code );
171
+ break;
172
+ }
173
+
174
+ case 0:
175
+
176
+ default :
177
+ {
178
+
179
+ $open_pos = strpos( $code, '/*' );
180
+ while ( $open_pos !== false ) {
181
+ $close_pos = strpos( $code, '*/', $open_pos ) + 2;
182
+ if ( $close_pos ) {
183
+ $code = substr( $code, 0, $open_pos ) . substr( $code, $close_pos );
184
+ } else {
185
+ $code = substr( $code, 0, $open_pos );
186
+ }
187
+
188
+ $open_pos = strpos( $code, '/*', $open_pos );
189
+ }
190
+
191
+ break;
192
+ }
193
+ }
194
+
195
+ return $code;
196
+ }
197
+
198
+ private function is_css_excluded( $file ) {
199
+ global $wp_styles;
200
+
201
+ if ( is_string( $file ) && isset( $wp_styles->registered[ $file ] ) ) {
202
+ $file = $wp_styles->registered[ $file ];
203
+ }
204
+
205
+ foreach ( $this->exceptions as $exception ) {
206
+ if ( $file->handle == $exception || strpos( $file->src, $exception ) !== false ) {
207
+ return true;
208
+ }
209
+ }
210
+
211
+ return false;
212
+ }
213
+ }
includes/classes/class-sbp-custom-code-manager.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Custom_Code_Manager extends SBP_Abstract_Module {
11
+
12
+ public function __construct() {
13
+ if ( ! sbp_get_option( 'module_special' ) ) {
14
+ return;
15
+ }
16
+
17
+ $this->add_script_tags();
18
+ }
19
+
20
+ private function add_script_tags() {
21
+ $scripts = sbp_get_option( 'custom_codes' );
22
+ if ( $scripts ) {
23
+ foreach ( $scripts as $script ) {
24
+ if ( '' === $script['custom_codes_item'] ) {
25
+ return;
26
+ }
27
+ if ( 'footer' === $script['custom_codes_place'] ) {
28
+ $hook = 'wp_footer';
29
+ } else {
30
+ $hook = 'wp_head';
31
+ }
32
+
33
+ add_action( $hook, function () use ( $script ) {
34
+
35
+ $output = '<script type="text/javascript">' . PHP_EOL;
36
+
37
+ switch ( $script['custom_codes_method'] ) {
38
+ case "onload":
39
+ $output .= 'window.addEventListener( \'DOMContentLoaded\', function(e) {' . PHP_EOL;
40
+ $output .= $script['custom_codes_item'] . PHP_EOL;
41
+ $output .= '});' . PHP_EOL;
42
+ break;
43
+ case "delayed":
44
+ $output .= 'window.addEventListener( \'DOMContentLoaded\', function(e) { setTimeout(function(){' . PHP_EOL;
45
+ $output .= $script['custom_codes_item'] . PHP_EOL;
46
+ $output .= '},4000);});' . PHP_EOL;
47
+ break;
48
+ default:
49
+ $output .= $script['custom_codes_item'];
50
+ break;
51
+ }
52
+
53
+ $output .= '</script>';
54
+
55
+ echo $output;
56
+ } );
57
+ }
58
+ }
59
+ }
60
+
61
+ }
{inc → includes/classes}/class-sbp-font-optimizer.php RENAMED
@@ -1,23 +1,30 @@
1
  <?php
2
 
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
 
 
5
  die;
6
  }
7
 
8
- class SBP_Font_Optimizer {
9
  private $families;
10
  private $subsets;
11
 
12
  public function __construct() {
13
- add_action( 'template_redirect', [ $this, 'start_buffer' ] );
 
 
 
 
14
  }
15
 
16
- public function start_buffer() {
17
- if ( ! $this->should_run() ) {
18
  return;
19
  }
20
- ob_start( [ $this, 'process_google_fonts' ] );
 
21
  }
22
 
23
  public function process_google_fonts( $html ) {
@@ -48,20 +55,6 @@ class SBP_Font_Optimizer {
48
  return $html;
49
  }
50
 
51
- private function should_run() {
52
- global $sbp_options;
53
-
54
- if ( is_embed() ) {
55
- return false;
56
- }
57
-
58
- if ( ! isset( $sbp_options['sbp_optimize_fonts'] ) || ! $sbp_options['sbp_optimize_fonts'] ) {
59
- return false;
60
- }
61
-
62
- return true;
63
- }
64
-
65
  private function parse_attributes( $url ) {
66
  $url = htmlspecialchars_decode( $url );
67
  parse_str( parse_url( $url )['query'], $attributes );
@@ -73,14 +66,14 @@ class SBP_Font_Optimizer {
73
  $families = explode( '|', $family ); // if there is no pipe, explode will return 1 element array
74
  foreach ( $families as $family ) {
75
  if ( strpos( $family, ':' ) !== false ) {
76
- $family = explode( ':', $family );
77
- $name = $family[0];
78
  $this->families[ $name ]['name'] = $name;
79
 
80
  // Explode sizes
81
- $sizes = $family[1];
82
- $sizes = explode( ',', $sizes );
83
- foreach ($sizes as $size) {
84
  $this->families[ $name ]['sizes'][] = $size;
85
  }
86
  } else {
@@ -102,8 +95,8 @@ class SBP_Font_Optimizer {
102
  $families = [];
103
  foreach ( $this->families as $family ) {
104
  if ( isset( $family['sizes'] ) && ! empty( $family['sizes'] ) ) {
105
- $family['sizes'] = array_unique($family['sizes']);
106
- $families[] .= $family['name'] . ":" . implode( ',', $family['sizes'] );
107
  } else {
108
  $families[] .= $family['name'];
109
  }
@@ -115,16 +108,16 @@ class SBP_Font_Optimizer {
115
  $subsets = implode( ",", array_unique( $this->subsets ) );
116
 
117
  $attributes = []; // Don't put attributes that doesn't exists
118
- if ($families) {
119
- $attributes[] = 'family=' . esc_attr($families);
120
  }
121
- if ($subsets) {
122
- $attributes[] = 'subset=' . esc_attr($subsets);
123
  }
124
  $attributes[] = 'display=swap';
125
 
126
- return '<link href="https://fonts.googleapis.com/css?' . implode('&', $attributes) . '" rel="stylesheet">';
127
- }
128
- }
129
 
130
- new SBP_Font_Optimizer();
 
 
1
  <?php
2
 
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
  die;
8
  }
9
 
10
+ class SBP_Font_Optimizer extends SBP_Abstract_Module {
11
  private $families;
12
  private $subsets;
13
 
14
  public function __construct() {
15
+ if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'optimize_gfonts' ) ) {
16
+ return;
17
+ }
18
+
19
+ add_action( 'init', [ $this, 'run' ] );
20
  }
21
 
22
+ public function run() {
23
+ if ( is_embed() ) {
24
  return;
25
  }
26
+
27
+ add_filter( 'sbp_output_buffer', [ $this, 'process_google_fonts' ], 10 );
28
  }
29
 
30
  public function process_google_fonts( $html ) {
55
  return $html;
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  private function parse_attributes( $url ) {
59
  $url = htmlspecialchars_decode( $url );
60
  parse_str( parse_url( $url )['query'], $attributes );
66
  $families = explode( '|', $family ); // if there is no pipe, explode will return 1 element array
67
  foreach ( $families as $family ) {
68
  if ( strpos( $family, ':' ) !== false ) {
69
+ $family = explode( ':', $family );
70
+ $name = $family[0];
71
  $this->families[ $name ]['name'] = $name;
72
 
73
  // Explode sizes
74
+ $sizes = $family[1];
75
+ $sizes = explode( ',', $sizes );
76
+ foreach ( $sizes as $size ) {
77
  $this->families[ $name ]['sizes'][] = $size;
78
  }
79
  } else {
95
  $families = [];
96
  foreach ( $this->families as $family ) {
97
  if ( isset( $family['sizes'] ) && ! empty( $family['sizes'] ) ) {
98
+ $family['sizes'] = array_unique( $family['sizes'] );
99
+ $families[] .= $family['name'] . ":" . implode( ',', $family['sizes'] );
100
  } else {
101
  $families[] .= $family['name'];
102
  }
108
  $subsets = implode( ",", array_unique( $this->subsets ) );
109
 
110
  $attributes = []; // Don't put attributes that doesn't exists
111
+ if ( $families ) {
112
+ $attributes[] = 'family=' . esc_attr( $families );
113
  }
114
+ if ( $subsets ) {
115
+ $attributes[] = 'subset=' . esc_attr( $subsets );
116
  }
117
  $attributes[] = 'display=swap';
118
 
119
+ $final_gfont_url = 'https://fonts.googleapis.com/css?' . implode( '&', $attributes );
 
 
120
 
121
+ return '<link rel="preload" as="style" href="' . $final_gfont_url . '" />' . PHP_EOL . '<link rel="stylesheet" href="' . $final_gfont_url . '" media="print" onload="this.media=\'all\'">';
122
+ }
123
+ }
inc/sbp-minifier.php → includes/classes/class-sbp-html-minifier.php RENAMED
@@ -1,42 +1,38 @@
1
  <?php
2
 
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
 
 
5
  die;
6
  }
7
 
8
- /*--------------------------------------------------------------------------------------------------------
9
- MINIFIER - increase your page load speed by minifying JavaScript and HTML
10
- ---------------------------------------------------------------------------------------------------------*/
11
-
12
-
13
- class SBP_HTML_Minifier {
14
- // Minify settings
15
- protected $minify_css = true;
16
- protected $minify_js = false;
17
- protected $info_comment = true;
18
- protected $remove_comments = true;
19
 
20
- // Minify variables
21
- protected $html;
22
 
23
- public function __construct( $html ) {
24
- if ( ! empty( $html ) ) {
25
- $this->parseHTML( $html );
26
  }
 
 
27
  }
28
 
29
- public function parseHTML( $html ) {
30
- $this->html = $this->minifyHTML( $html );
 
31
 
32
- if ( $this->info_comment ) {
33
- $this->html .= "\n" . $this->bottomComment( $html, $this->html );
34
- }
35
  }
36
 
37
- protected function minifyHTML( $html ) {
38
  $pattern = '/<(?<script>script).*?<\/script\s*>|<(?<style>style).*?<\/style\s*>|<!(?<comment>--).*?-->|<(?<tag>[\/\w.:-]*)(?:".*?"|\'.*?\'|[^\'">]+)*>|(?<text>((<[^!\/\w.:-])?[^<]*)+)|/si';
39
- preg_match_all( $pattern, $html, $matches, PREG_SET_ORDER );
40
  $overriding = false;
41
  $raw_tag = false;
42
  // Variable reused for output
@@ -90,10 +86,10 @@ class SBP_HTML_Minifier {
90
  $html .= $content;
91
  }
92
 
93
- return $html;
94
  }
95
 
96
- protected function removeWhiteSpace( $str ) {
97
  $str = str_replace( "\t", ' ', $str );
98
  $str = str_replace( "\n", '', $str );
99
  $str = str_replace( "\r", '', $str );
@@ -104,27 +100,4 @@ class SBP_HTML_Minifier {
104
 
105
  return $str;
106
  }
107
-
108
- protected function bottomComment( $raw, $minified ) {
109
- $raw = strlen( $raw );
110
- $minified = strlen( $minified );
111
- $savings = ( $raw - $minified ) / $raw * 100;
112
- $savings = round( $savings, 2 );
113
-
114
- return '<!-- HTML minified; size reduced ' . $savings . '% (from ' . $raw . ' bytes down to ' . $minified . ' bytes) -->';
115
- }
116
-
117
- public function __toString() {
118
- return $this->html;
119
- }
120
- }
121
-
122
- function sbp_html_minifier_finish( $html ) {
123
- return new SBP_HTML_Minifier( $html );
124
- }
125
-
126
- function sbp_html_minifier_start() {
127
- ob_start( 'sbp_html_minifier_finish' );
128
  }
129
-
130
- add_action( 'get_header', 'sbp_html_minifier_start' );
1
  <?php
2
 
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
  die;
8
  }
9
 
10
+ class SBP_HTML_Minifier extends SBP_Abstract_Module {
11
+ private $minify_css = true;
12
+ private $minify_js = false;
13
+ private $info_comment = true;
14
+ private $remove_comments = true;
 
 
 
 
 
 
15
 
16
+ private $html;
 
17
 
18
+ public function __construct() {
19
+ if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'minify_html' ) ) {
20
+ return;
21
  }
22
+
23
+ add_filter( 'sbp_output_buffer', [ $this, 'handle_html_minify' ], 11 );
24
  }
25
 
26
+ public function handle_html_minify( $html ) {
27
+ $this->html = $html;
28
+ $this->minifyHTML();
29
 
30
+ return $this->html;
 
 
31
  }
32
 
33
+ private function minifyHTML() {
34
  $pattern = '/<(?<script>script).*?<\/script\s*>|<(?<style>style).*?<\/style\s*>|<!(?<comment>--).*?-->|<(?<tag>[\/\w.:-]*)(?:".*?"|\'.*?\'|[^\'">]+)*>|(?<text>((<[^!\/\w.:-])?[^<]*)+)|/si';
35
+ preg_match_all( $pattern, $this->html, $matches, PREG_SET_ORDER );
36
  $overriding = false;
37
  $raw_tag = false;
38
  // Variable reused for output
86
  $html .= $content;
87
  }
88
 
89
+ $this->html = $html;
90
  }
91
 
92
+ private function removeWhiteSpace( $str ) {
93
  $str = str_replace( "\t", ' ', $str );
94
  $str = str_replace( "\n", '', $str );
95
  $str = str_replace( "\r", '', $str );
100
 
101
  return $str;
102
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
 
 
includes/classes/class-sbp-js-optimizer.php ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ /**
11
+ * Optimize JavaScripts. Move JS files to footer or add defer attribute to all script tags.
12
+ *
13
+ * Class SBP_JS_Optimizer
14
+ * @package SpeedBooster
15
+ */
16
+ class SBP_JS_Optimizer extends SBP_Abstract_Module {
17
+ /**
18
+ * If script tag has any other type attribute except below types, it won't be optimized.
19
+ */
20
+ const SCRIPT_TYPES = [
21
+ "application/ecmascript",
22
+ "application/javascript",
23
+ "application/x-ecmascript",
24
+ "application/x-javascript",
25
+ "text/ecmascript",
26
+ "text/javascript",
27
+ "text/javascript1.0",
28
+ "text/javascript1.1",
29
+ "text/javascript1.2",
30
+ "text/javascript1.3",
31
+ "text/javascript1.4",
32
+ "text/javascript1.5",
33
+ "text/jscript",
34
+ "text/livescript",
35
+ "text/x-ecmascript",
36
+ "text/x-javascript",
37
+ ];
38
+
39
+ /**
40
+ * JS files in this list won't be optimized.
41
+ *
42
+ * @var string[] $default_excludes
43
+ */
44
+ private $default_excludes = [
45
+ 'html5.js',
46
+ 'show_ads.js',
47
+ 'histats.com/js',
48
+ 'ws.amazon.com/widgets',
49
+ '/ads/',
50
+ 'intensedebate.com',
51
+ 'scripts.chitika.net/',
52
+ 'jotform.com/',
53
+ 'gist.github.com',
54
+ 'forms.aweber.com',
55
+ 'video.unrulymedia.com',
56
+ 'stats.wp.com',
57
+ 'stats.wordpress.com',
58
+ 'widget.rafflecopter.com',
59
+ 'widget-prime.rafflecopter.com',
60
+ 'releases.flowplayer.org',
61
+ 'c.ad6media.fr',
62
+ 'cdn.stickyadstv.com',
63
+ 'www.smava.de',
64
+ 'contextual.media.net',
65
+ 'app.getresponse.com',
66
+ 'adserver.reklamstore.com',
67
+ 's0.wp.com',
68
+ 'wprp.zemanta.com',
69
+ 'files.bannersnack.com',
70
+ 'smarticon.geotrust.com',
71
+ 'js.gleam.io',
72
+ 'ir-na.amazon-adsystem.com',
73
+ 'web.ventunotech.com',
74
+ 'verify.authorize.net',
75
+ 'ads.themoneytizer.com',
76
+ 'embed.finanzcheck.de',
77
+ 'imagesrv.adition.com',
78
+ 'js.juicyads.com',
79
+ 'form.jotformeu.com',
80
+ 'speakerdeck.com',
81
+ 'content.jwplatform.com',
82
+ 'ads.investingchannel.com',
83
+ 'app.ecwid.com',
84
+ 'www.industriejobs.de',
85
+ 's.gravatar.com',
86
+ 'googlesyndication.com',
87
+ 'a.optmstr.com',
88
+ 'a.optmnstr.com',
89
+ 'a.opmnstr.com',
90
+ 'adthrive.com',
91
+ 'mediavine.com',
92
+ 'js.hsforms.net',
93
+ 'googleadservices.com',
94
+ 'f.convertkit.com',
95
+ 'recaptcha/api.js',
96
+ 'mailmunch.co',
97
+ 'apps.shareaholic.com',
98
+ 'dsms0mj1bbhn4.cloudfront.net',
99
+ 'nutrifox.com',
100
+ 'code.tidio.co',
101
+ 'www.uplaunch.com',
102
+ 'widget.reviewability.com',
103
+ 'embed-cdn.gettyimages.com/widgets.js',
104
+ 'app.mailerlite.com',
105
+ 'ck.page',
106
+ 'window.adsbygoogle',
107
+ 'google_ad_client',
108
+ 'googletag.display',
109
+ 'document.write',
110
+ 'google_ad',
111
+ 'adsbygoogle',
112
+ '<!--',
113
+ 'JS_Optimizer_Comment_Placeholder',
114
+ ];
115
+
116
+ /**
117
+ * Comment lines
118
+ *
119
+ * @var array $comments
120
+ */
121
+ private $comments = [];
122
+
123
+ /**
124
+ * This array will keep the whole script tags in the html code except ones with defer attribute
125
+ * @var array $all_scripts
126
+ */
127
+ private $all_scripts = []; // scripts that doesn't have defer attribute
128
+
129
+ /**
130
+ * This array will keep all the scripts that's not in the exclusion list
131
+ * @var array $included_scripts
132
+ */
133
+ private $included_scripts = [];
134
+
135
+ /**
136
+ * This array will keep changed versions of $included_scripts
137
+ * @var array $changed_scripts
138
+ */
139
+ private $changed_scripts = [];
140
+
141
+ /**
142
+ * Placeholder for comment lines
143
+ * @var string $comment_placeholder
144
+ */
145
+ private $comment_placeholder = '<!-- SBP/JS_Optimizer_Comment_Placeholder -->';
146
+
147
+ /**
148
+ * JavaScript exclusion rules
149
+ *
150
+ * @var array $exclude_rules
151
+ */
152
+ private $exclude_rules = [];
153
+
154
+ /**
155
+ * Property to decide if scripts will be deferred ro moved to footer (default is off, which means no optimization)
156
+ *
157
+ * @var mixed|null $optimize_strategy
158
+ */
159
+ private $optimize_strategy = 'off';
160
+
161
+ public function __construct() {
162
+ $this->optimize_strategy = sbp_get_option( 'js_optimize' );
163
+
164
+ if ( ! sbp_get_option( 'module_assets' ) || $this->optimize_strategy == 'off' ) {
165
+ return;
166
+ }
167
+
168
+ $this->exclude_rules = array_merge( SBP_Utils::explode_lines( sbp_get_option( 'js_exclude' ) ), $this->default_excludes );
169
+
170
+ add_filter( 'sbp_output_buffer', [ $this, 'optimize_scripts' ] );
171
+ }
172
+
173
+ public function optimize_scripts( $html ) {
174
+ $this->replace_comments_with_placeholders( $html );
175
+ $this->find_scripts_without_defer( $html );
176
+ $this->check_script_types();
177
+ $this->remove_excluded_scripts();
178
+
179
+ if ( $this->optimize_strategy == 'move' ) {
180
+ $this->move_scripts( $html );
181
+ } elseif ( $this->optimize_strategy == 'defer' ) {
182
+ $this->add_defer_attribute();
183
+ $this->convert_inline_to_base64();
184
+ $html = str_replace( $this->included_scripts, $this->changed_scripts, $html );
185
+ }
186
+
187
+ $this->replace_placeholders_with_comments( $html );
188
+
189
+ return $html;
190
+ }
191
+
192
+ /**
193
+ * Replaces all comment lines with placeholders. So comment scripts won't be affected from optimization
194
+ *
195
+ * @param $html
196
+ */
197
+ private function replace_comments_with_placeholders( &$html ) {
198
+ preg_match_all( '/<!--[\s\S]*?-->/im', $html, $result );
199
+ if ( count( $result[0] ) > 0 ) {
200
+ $comments = $result[0];
201
+
202
+ foreach ( $comments as $comment ) {
203
+ $this->comments[] = $comment;
204
+ $html = str_replace( $comment, $this->comment_placeholder, $html );
205
+ }
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Replaced comment lines will be reverted after JS optimization process
211
+ *
212
+ * @param $html
213
+ */
214
+ private function replace_placeholders_with_comments( &$html ) {
215
+ foreach ( $this->comments as $comment ) {
216
+ $pos = strpos( $html, $this->comment_placeholder );
217
+ if ( $pos !== false ) {
218
+ $html = substr_replace( $html, $comment, $pos, strlen( $this->comment_placeholder ) );
219
+ }
220
+ }
221
+ }
222
+
223
+ /**
224
+ * Finds all scripts without defer attribute
225
+ *
226
+ * @param $html
227
+ */
228
+ private function find_scripts_without_defer( &$html ) {
229
+ preg_match_all( '/<script(((?!\bdefer\b).)*?)>(?:(.*?))<\/script>/mis', $html, $scripts );
230
+ if ( count( $scripts[0] ) ) {
231
+ $this->all_scripts = $scripts[0];
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Checks the script type. If it's in the SCRIPT_TYPES list or doesn't exists, script tag will be added to included scripts
237
+ */
238
+ private function check_script_types() {
239
+ foreach ( $this->all_scripts as $script ) {
240
+ preg_match( '/<script[\s\S]*?type=[\'|"](.*?)[\'|"][\s\S]*?>/im', $script, $result );
241
+ // If type is not exists or type is in SCRIPT_TYPES constant, then add scripts to running scripts
242
+ if ( count( $result ) == 0 ) {
243
+ $this->included_scripts[] = $script;
244
+ } else {
245
+ $type = trim( str_replace( [ '"', "'" ], '', $result[1] ) );
246
+ if ( in_array( $type, self::SCRIPT_TYPES ) ) {
247
+ $this->included_scripts[] = $script;
248
+ }
249
+ }
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Removes excluded script tags from included_scripts array
255
+ */
256
+ private function remove_excluded_scripts() {
257
+ $script_count = count( $this->included_scripts );
258
+ for ( $i = 0; $i < $script_count; $i ++ ) {
259
+ foreach ( $this->exclude_rules as $rule ) {
260
+ if ( strpos( $this->included_scripts[ $i ], $rule ) !== false ) {
261
+ unset( $this->included_scripts[ $i ] );
262
+ }
263
+ }
264
+ }
265
+ }
266
+
267
+ /**
268
+ * Removes all script tags in included_scripts array and puts them right before the </body> tag.
269
+ *
270
+ * @param $html
271
+ */
272
+ private function move_scripts( &$html ) {
273
+ foreach ( $this->included_scripts as $script ) {
274
+ $html = str_ireplace( $script, '', $html );
275
+ }
276
+
277
+ $html = str_ireplace( '</body>', implode( PHP_EOL, $this->included_scripts ) . PHP_EOL . '</body>', $html );
278
+ }
279
+
280
+ private function add_defer_attribute() {
281
+ foreach ( $this->included_scripts as $script ) {
282
+ if ( str_ireplace( array( ' async', ' defer', 'data-noptimize="1"', 'data-cfasync="false"', 'data-pagespeed-no-defer' ), '', $script ) === $script ) {
283
+ $this->changed_scripts[] = str_ireplace( '<script', '<script defer', $script );
284
+ } else {
285
+ $this->changed_scripts[] = $script;
286
+ }
287
+ }
288
+ }
289
+
290
+ private function convert_inline_to_base64() {
291
+ foreach ( $this->changed_scripts as &$script ) {
292
+ preg_match( '/<script((?:(?!src=).)*?)>(.*?)<\/script>/mis', $script, $matches );
293
+ if ( isset( $matches[2] ) && str_replace( array( 'data-noptimize="1"', 'data-cfasync="false"', 'data-pagespeed-no-defer' ), '', $matches[0] ) === $matches[0] ) {
294
+ $script_content = $matches[2];
295
+ $base64_script = base64_encode( $script_content );
296
+ $script = str_replace( $script_content, '', $script );
297
+ $script = str_replace( '<script defer', '<script defer src="data:text/javascript;base64,' . $base64_script . '"', $script );
298
+ }
299
+ }
300
+ }
301
+ }
includes/classes/class-sbp-lazy-loader.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Lazy_Loader extends SBP_Abstract_Module {
11
+ private $noscript_placeholder = '<!--SBP_NOSCRIPT_PLACEHOLDER-->';
12
+ private $noscripts = [];
13
+
14
+ public function __construct() {
15
+ if ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'lazyload' ) ) {
16
+ return;
17
+ }
18
+
19
+ add_action( 'wp_enqueue_scripts', [ $this, 'add_lazy_load_script' ] );
20
+ add_filter( 'sbp_output_buffer', [ $this, 'lazy_load_handler' ] );
21
+ }
22
+
23
+ function add_lazy_load_script() {
24
+ wp_enqueue_script( 'sbp-lazy-load', SBP_URL . 'public/js/lazyload.js', false, '17.1.0', true );
25
+ wp_add_inline_script( 'sbp-lazy-load',
26
+ '
27
+ (function() {
28
+ var ll = new LazyLoad({
29
+ elements_selector: "[loading=lazy]",
30
+ use_native: true
31
+ });
32
+ })();
33
+ ' );
34
+ }
35
+
36
+ function lazy_load_handler( $html ) {
37
+ $this->replace_with_noscripts( $html );
38
+
39
+ $lazyload_exclusions = SBP_Utils::explode_lines( sbp_get_option( 'lazyload_exclude' ) );
40
+ // Add default lazyload exclusions
41
+ $lazyload_exclusions[] = 'data-no-lazy';
42
+ $lazyload_exclusions[] = 'skip-lazy';
43
+ $lazyload_exclusions[] = 'loading=eager';
44
+ $lazyload_exclusions[] = 'loading="eager';
45
+ $lazyload_exclusions[] = "loading='eager";
46
+ $lazyload_exclusions[] = 'loading=auto';
47
+ $lazyload_exclusions[] = 'loading="auto';
48
+ $lazyload_exclusions[] = "loading='auto";
49
+ $lazyload_exclusions = apply_filters( 'sbp_lazyload_exclusions', $lazyload_exclusions );
50
+ $placeholder = 'data:image/svg+xml,%3Csvg%20xmlns%3D%27http://www.w3.org/2000/svg%27%20viewBox%3D%270%200%203%202%27%3E%3C/svg%3E';
51
+
52
+ // Find all images
53
+ preg_match_all( '/<(img|source|iframe)(.*?) (src=)[\'|"](.*?)[\'|"](.*?)>/is', $html, $resource_elements );
54
+
55
+ $elements_to_be_changed = [];
56
+
57
+ // Determine which images will be changed
58
+ foreach ( $resource_elements[0] as $element ) {
59
+ $exclude_element = false;
60
+ if ( count( $lazyload_exclusions ) > 0 ) {
61
+ foreach ( $lazyload_exclusions as $exclusion ) {
62
+ $exclusion = trim( $exclusion );
63
+ if ( false !== strpos( $element, $exclusion ) ) {
64
+ $exclude_element = true;
65
+ }
66
+ }
67
+ }
68
+
69
+ // If not excluded element, put it into the to be changed list.
70
+ if ( false === $exclude_element ) {
71
+ $elements_to_be_changed[] = $element;
72
+ }
73
+ }
74
+
75
+ // Clean the possible repeated elements
76
+ $elements_to_be_changed = array_unique( $elements_to_be_changed );
77
+
78
+ // Process all elements marked as to be changed
79
+ foreach ( $elements_to_be_changed as $element ) {
80
+ // Change src with placeholder
81
+ $newElement = preg_replace(
82
+ "/<(img|source|iframe)(.*?) (src=)(.*?)>/is",
83
+ '<$1$2 $3"' . $placeholder . '" data-$3$4>',
84
+ $element
85
+ );
86
+
87
+ // change srcset
88
+ $newElement = preg_replace(
89
+ "/<(img|source|iframe)(.*?) (srcset=)(.*?)>/is",
90
+ '<$1$2 $3"' . $placeholder . '" data-$3$4>',
91
+ $newElement
92
+ );
93
+
94
+ // add loading attribute, but only if the tag doesn't have one
95
+ if( ! strpos( $newElement, 'loading=' ) ) {
96
+ $newElement = preg_replace(
97
+ "/<(img|source|iframe)(.*?) ?(\/?)>/is",
98
+ '<$1$2 loading="lazy" $3>',
99
+ $newElement
100
+ );
101
+ }
102
+
103
+ // prevent mixed content errors
104
+ $newElement = str_replace( 'http://', '//', $newElement );
105
+
106
+ $html = str_replace( $element, $newElement, $html );
107
+ }
108
+
109
+ $this->add_noscripts( $html );
110
+
111
+ return $html;
112
+ }
113
+
114
+ /**
115
+ * Replaces noscript tags with placeholder and sets the noscripts property
116
+ *
117
+ * @param $html
118
+ *
119
+ * @return mixed
120
+ */
121
+ private function replace_with_noscripts( &$html ) {
122
+ $regex = '/<noscript(.*?)>(.*?)<\/noscript>/si';
123
+ preg_match_all( $regex, $html, $matches );
124
+ $this->noscripts = $matches[0];
125
+ if ( count( $this->noscripts ) > 0 ) {
126
+ $html = preg_replace( $regex, $this->noscript_placeholder, $html );
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Replaces noscript placeholders with noscripts.
132
+ *
133
+ * @param $html
134
+ */
135
+ private function add_noscripts( &$html ) {
136
+ foreach ( $this->noscripts as $noscript ) {
137
+ $pos = strpos( $html, $this->noscript_placeholder );
138
+ if ( false !== $pos ) {
139
+ $html = substr_replace( $html, $noscript, $pos, strlen( $this->noscript_placeholder ) );
140
+ }
141
+ }
142
+ }
143
+ }
includes/classes/class-sbp-localize-tracker.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Localize_Tracker extends SBP_Abstract_Module {
11
+ private $file_name = '';
12
+ private $dir_path = SBP_CACHE_DIR . 'analytics/';
13
+ private $dir_url = SBP_CACHE_URL . 'analytics/';
14
+ private $analytics_url = 'https://www.google-analytics.com/analytics.js';
15
+ private $gtm_url = 'https://www.googletagmanager.com/gtm.js?id=';
16
+ private $gtag_url = 'https://www.googletagmanager.com/gtag/js?id=';
17
+ private $transient_name = '';
18
+
19
+ public function __construct() {
20
+ if ( ! sbp_get_option( 'module_special' ) || ! sbp_get_option( 'localize_tracking_scripts' ) ) {
21
+ return;
22
+ }
23
+
24
+ add_filter( 'sbp_output_buffer', [ $this, 'replace_url' ] );
25
+ }
26
+
27
+ public function replace_url( $html ) {
28
+ $html = $this->replace_analytics( $html );
29
+ $html = $this->replace_gtm( $html );
30
+ $html = $this->replace_gtag( $html );
31
+
32
+ return $html;
33
+ }
34
+
35
+ private function replace_analytics( $html ) {
36
+ // Set file path, file url and file name
37
+ $this->file_name = 'analytics.js';
38
+ $this->transient_name = 'sbp_analytics_ga';
39
+
40
+ // Check if script tags exists
41
+ preg_match_all( '/<script[^>]*?>(.*)<\/script>/Umsi', $html, $matches );
42
+
43
+ if ( ! $matches[0] ) {
44
+ return $html;
45
+ }
46
+
47
+ // Check if file exists or expired and save new file
48
+ if ( ! $this->check_file() ) {
49
+ if ( ! $this->save_file( $this->analytics_url ) ) {
50
+ return $html;
51
+ }
52
+ }
53
+
54
+
55
+ // Find Google Analytics script
56
+ $html = preg_replace( '/(?:https?:)?\/\/www\.google-analytics\.com\/analytics\.js/i', $this->dir_url . $this->file_name, $html );
57
+
58
+ return $html;
59
+ }
60
+
61
+ private function replace_gtm( $html ) {
62
+ // Get GTM id
63
+ preg_match_all( "/<script>\(function\(w,d,s,l,i\)(.*?)\'(GTM-[A-Z0-9a-z]+)\'(.*?)<\/script>/Umsi", $html, $matches );
64
+
65
+ if ( ! $matches[2] || ! $matches[2][0] ) {
66
+ return $html;
67
+ }
68
+
69
+ $id = $matches[2][0];
70
+
71
+ // Set file path, file url and file name
72
+ $this->file_name = 'gtm-' . $id . '.js';
73
+ $this->transient_name = 'sbp_analytics_gtm';
74
+
75
+ // Set file url
76
+ $this->gtm_url .= $id;
77
+
78
+ // Check if file exists or expired and save new file
79
+ if ( ! $this->check_file() ) {
80
+ if ( ! $this->save_file( $this->gtm_url ) ) {
81
+ return $html;
82
+ }
83
+ }
84
+
85
+ // Find Google Analytics script
86
+ $html = preg_replace( '/(http(s)?:\/\/www\.googletagmanager\.com\/gtm\.js\?id=\'\+i\+dl)/Umsi', $this->dir_url . $this->file_name . "'", $html );
87
+
88
+ return $html;
89
+ }
90
+
91
+ private function replace_gtag( $html ) {
92
+
93
+ // Get Gtag id
94
+ preg_match_all( '/src=\"https:\/\/www\.googletagmanager\.com\/gtag\/js\?id=([A-Za-z0-9-_]+)"/Umsi', $html, $matches );
95
+
96
+ if ( ! $matches[1] || ! $matches[1][0] ) {
97
+ return $html;
98
+ }
99
+
100
+ $id = $matches[1][0];
101
+
102
+ // Set file path, file url and file name
103
+ $this->file_name = 'gtag-' . $id . '.js';
104
+ $this->transient_name = 'sbp_analytics_gtag';
105
+
106
+ // Set file url
107
+ $this->gtag_url .= $id;
108
+
109
+ // Check if file exists or expired and save new file
110
+ if ( ! $this->check_file() ) {
111
+ if ( ! $this->save_file( $this->gtag_url ) ) {
112
+ return $html;
113
+ }
114
+ }
115
+
116
+ // Find Gtag script
117
+ $html = preg_replace( '/src=\"https:\/\/www\.googletagmanager\.com\/gtag\/js\?id=([A-Za-z0-9-_]+)"/Umsi', 'src="' . $this->dir_url . $this->file_name . '"', $html );
118
+
119
+ return $html;
120
+ }
121
+
122
+ private function save_file( $url ) {
123
+ global $wp_filesystem;
124
+
125
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
126
+ WP_Filesystem();
127
+
128
+ $remote_response = wp_remote_get( $url );
129
+
130
+ if ( wp_remote_retrieve_response_code( $remote_response ) !== 200 ) {
131
+ return false;
132
+ }
133
+
134
+ // Fetch file
135
+ $content = wp_remote_retrieve_body( $remote_response );
136
+
137
+ if ( ! $content ) {
138
+ return false;
139
+ }
140
+
141
+ // Check if file exists
142
+ if ( ! $wp_filesystem->exists( $this->dir_path ) ) {
143
+ $wp_filesystem->mkdir( $this->dir_path, FS_CHMOD_DIR );
144
+ }
145
+
146
+ set_transient( $this->transient_name, '1', 60 * 60 * 24 );
147
+
148
+ return $wp_filesystem->put_contents( $this->dir_path . $this->file_name, $content );
149
+ }
150
+
151
+ private function check_file() {
152
+ global $wp_filesystem;
153
+
154
+ require_once( ABSPATH . '/wp-admin/includes/file.php' );
155
+ WP_Filesystem();
156
+
157
+ $file = $this->dir_path . $this->file_name;
158
+
159
+ // Check if file exists
160
+ if ( ! $wp_filesystem->exists( $file ) ) {
161
+ return false;
162
+ }
163
+
164
+ // If transient doesn't exists, download and rewrite the file
165
+ if ( ! get_transient( $this->transient_name ) ) {
166
+ return false;
167
+ }
168
+
169
+ return true;
170
+ }
171
+ }
includes/classes/class-sbp-migrator.php ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Migrator {
11
+ private $sbp_settings; // Old options
12
+ private $sbp_options; // New options
13
+ private $options_name_matches = [
14
+ 'query_strings' => 'trim_query_strings',
15
+ 'remove_emojis' => 'dequeue_emoji_scripts',
16
+ 'disable_self_pingbacks' => 'disable_self_pingbacks',
17
+ 'remove_jquery_migrate' => 'dequeue_jquery_migrate',
18
+ 'disable_dashicons' => 'dequeue_dashicons',
19
+ 'limit_post_revisions' => 'post_revisions',
20
+ 'autosave_interval' => 'autosave_interval',
21
+ 'sbp_optimize_fonts' => 'optimize_gfonts',
22
+ 'enable_instant_page' => 'instant_page',
23
+ 'disable_cart_fragments' => 'woocommerce_disable_cart_fragments',
24
+ 'dequeue_wc_scripts' => 'woocommerce_optimize_nonwc_pages',
25
+ 'disable_password_strength_meter' => 'woocommerce_disable_password_meter',
26
+ 'minify_html_js' => 'minify_html',
27
+ 'sbp_enable_lazy_load' => 'lazyload',
28
+ 'sbp_enable_local_analytics' => 'localize_tracking_scripts',
29
+ 'jquery_to_footer' => 'js_move',
30
+ 'sbp_css_async' => 'css_inline',
31
+ 'sbp_css_minify' => 'css_minify',
32
+ 'sbp_enable_preboost' => 'preboost',
33
+ ];
34
+
35
+ public function __construct() {
36
+ add_action( 'init', [ $this, 'check_migrate_notice' ] );
37
+
38
+ add_action( 'wp_ajax_sbp_dismiss_migrator_notice', [ $this, 'dismiss_upgrade_notice' ] );
39
+
40
+ $this->sbp_settings = get_option( 'sbp_settings' );
41
+ if ( $this->sbp_settings ) {
42
+ $this->sbp_options = get_option( 'sbp_options' );
43
+ add_action( 'admin_init', [ $this, 'handle_migrate_request' ] );
44
+ }
45
+ }
46
+
47
+ public function check_migrate_notice() {
48
+ if ( get_transient( 'sbp_upgraded_notice' ) && current_user_can( 'manage_options' ) ) {
49
+ add_action( 'admin_enqueue_scripts',
50
+ function () {
51
+ $dismiss_notice_script = 'jQuery(function() {
52
+ jQuery(".dismiss-migrator-notice").on("click", function() {
53
+ jQuery.ajax({
54
+ url: ajaxurl,
55
+ type: "POST",
56
+ data: {
57
+ action: "sbp_dismiss_migrator_notice",
58
+ }
59
+ });
60
+ });
61
+ })';
62
+ wp_add_inline_script( 'jquery', $dismiss_notice_script, 'footer' );
63
+ } );
64
+ add_action( 'admin_notices', [ $this, 'display_update_notice' ] );
65
+ }
66
+ }
67
+
68
+ public function handle_migrate_request() {
69
+ $this->migrate_options();
70
+ $this->delete_old_options();
71
+ set_transient( 'sbp_upgraded_notice', 1 );
72
+ }
73
+
74
+ private function migrate_options() {
75
+ $this->migrate_standard_options();
76
+ $this->add_tracking_scripts();
77
+ $this->migrate_declutter_settings();
78
+ $this->migrate_cdn_settings();
79
+ $this->migrate_exclude_rules();
80
+ update_option( 'sbp_options', $this->sbp_options );
81
+ wp_redirect( admin_url( 'admin.php?page=sbp-settings' ) );
82
+ }
83
+
84
+ public function add_tracking_scripts() {
85
+ if ( ! isset( $this->sbp_settings['sbp_enable_local_analytics'] ) || ! $this->sbp_settings['sbp_enable_local_analytics'] ) {
86
+ return;
87
+ }
88
+
89
+ // Check for tracking scripts
90
+ if ( isset( $this->sbp_settings['sbp_ga_tracking_id'] ) && $tracking_id = $this->sbp_settings['sbp_ga_tracking_id'] ) {
91
+ if ( strpos( $tracking_id, "GTM-" ) === 0 || strpos( $tracking_id, 'UA-' ) === 0 ) {
92
+ $analytics_script = '';
93
+ if ( strpos( $tracking_id, "GTM-" ) === 0 ) {
94
+ $analytics_script = "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
95
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
96
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
97
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
98
+ })(window,document,'script','dataLayer','$tracking_id');";
99
+ } else {
100
+ $analytics_script = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
101
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
102
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
103
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
104
+
105
+ ga('create', '$tracking_id', 'auto');
106
+ ga('send', 'pageview');";
107
+ }
108
+
109
+ // Create tracking script in custom code manager
110
+ $custom_codes = [];
111
+ $custom_codes[] = [
112
+ 'custom_codes_item' => $analytics_script,
113
+ 'custom_codes_place' => 'footer',
114
+ 'custom_codes_method' => 'normal',
115
+ ];
116
+ $this->sbp_options['custom_codes'] = $custom_codes;
117
+ // Just in case. If migration works twice for any reason, custom code won't be added again.
118
+ $this->sbp_settings['sbp_ga_tracking_id'] = '';
119
+ }
120
+ }
121
+ }
122
+
123
+ private function migrate_standard_options() {
124
+ foreach ( $this->options_name_matches as $old_option_name => $new_option_name ) {
125
+ $this->sbp_options[ $new_option_name ] = (int) ( isset( $this->sbp_settings[ $old_option_name ] ) ? $this->sbp_settings[ $old_option_name ] : 0 );
126
+ }
127
+ }
128
+
129
+ private function migrate_cdn_settings() {
130
+ if ( isset( $this->sbp_settings['sbp_cdn_url'] ) && $this->sbp_settings['sbp_cdn_url'] ) {
131
+ $old_cdn_url = $this->sbp_settings['sbp_cdn_url'];
132
+ // Remove protocol and trailing slash
133
+ $new_cdn_url = ltrim( $old_cdn_url, 'https://' );
134
+ $new_cdn_url = ltrim( $new_cdn_url, 'http://' );
135
+ $new_cdn_url = ltrim( $new_cdn_url, '//' );
136
+ $new_cdn_url = rtrim( $new_cdn_url, '/' );
137
+ $this->sbp_options['cdn_url'] = $new_cdn_url;
138
+ }
139
+ }
140
+
141
+ private function migrate_exclude_rules() {
142
+ $exclude_options = [
143
+ 'sbp_lazyload_exclusions' => 'lazyload_exclude',
144
+ 'sbp_js_footer_exceptions' => 'js_exclude',
145
+ 'sbp_css_exceptions' => 'css_exclude',
146
+ ];
147
+
148
+ foreach ( $exclude_options as $old_option => $new_option ) {
149
+ if ( $old_option_value = get_option( $old_option ) ) {
150
+ $this->sbp_options[ $new_option ] = $old_option_value;
151
+ }
152
+ }
153
+
154
+ if ( get_option( 'sbp_preboost' ) ) {
155
+ $this->sbp_options['preboost'] = [
156
+ 'preboost_include' => get_option( 'sbp_preboost' ),
157
+ 'preboost_enable' => "1",
158
+ ];
159
+ }
160
+
161
+ // Check for js_exceptions$n
162
+ if ( ! get_option( 'sbp_js_footer_exceptions' ) ) {
163
+ $js_exceptions = '';
164
+ for ( $i = 1; $i < 4; $i ++ ) {
165
+ $option_name = 'sbp_defer_exceptions' . $i;
166
+ if ( $exception = get_option( $option_name ) ) {
167
+ $js_exceptions .= $exception . PHP_EOL;
168
+ }
169
+ }
170
+ $this->sbp_options['js_exclude'] = $js_exceptions;
171
+ }
172
+ }
173
+
174
+ private function migrate_declutter_settings() {
175
+ $declutter_settings = [
176
+ 'remove_wsl' => 'declutter_wlw',
177
+ 'remove_adjacent' => 'declutter_adjacent_posts_links',
178
+ 'wml_link' => 'declutter_shortlinks',
179
+ 'wp_generator' => 'declutter_wp_version',
180
+ 'remove_rest_api_links' => 'declutter_rest_api_links',
181
+ 'remove_all_feeds' => 'declutter_feed_links',
182
+ ];
183
+
184
+ foreach ( $declutter_settings as $old_option => $new_option ) {
185
+ if ( isset( $this->sbp_settings[ $old_option ] ) && $this->sbp_settings[ $old_option ] ) {
186
+ $this->sbp_options['declutter_head'][ $new_option ] = $this->sbp_settings[ $old_option ];
187
+ }
188
+ }
189
+ }
190
+
191
+ public function display_update_notice() {
192
+ if ( get_transient( 'sbp_upgraded_notice' ) ) {
193
+ echo '<div class="notice notice-success is-dismissible dismiss-migrator-notice"><p>' . sprintf( __( 'With the new version of %s, your settings are migrated to the plugin\'s new options framework. <a href="%s">Click here to review %1$s\'s options.</a>', 'speed-booster-pack' ), SBP_PLUGIN_NAME, admin_url( 'admin.php?page=sbp-settings' ) ) . '</p></div>';
194
+ }
195
+ }
196
+
197
+ public function delete_old_options() {
198
+ delete_option( 'sbp_settings' );
199
+ delete_option( 'sbp_css_exceptions' );
200
+ delete_option( 'sbp_js_footer_exceptions' );
201
+ delete_option( 'sbp_lazyload_exclusions' );
202
+ delete_option( 'sbp_defer_exceptions1' );
203
+ delete_option( 'sbp_defer_exceptions2' );
204
+ delete_option( 'sbp_defer_exceptions3' );
205
+ delete_option( 'sbp_defer_exceptions4' );
206
+ delete_option( 'sbp_preboost' );
207
+ }
208
+
209
+ public function dismiss_upgrade_notice() {
210
+ if ( current_user_can( 'manage_options' ) ) {
211
+ delete_transient( 'sbp_upgraded_notice' );
212
+ }
213
+ }
214
+ }
{inc → includes/classes}/class-sbp-preboost.php RENAMED
@@ -1,11 +1,13 @@
1
  <?php
2
 
3
- // Security control for vulnerability attempts
4
- if ( ! defined( 'ABSPATH' ) ) {
 
 
5
  die;
6
  }
7
 
8
- class SBP_Preboost {
9
  private $extension_type_matches = [
10
  'css' => 'style',
11
  'js' => 'script',
@@ -34,22 +36,13 @@ class SBP_Preboost {
34
  private $appending_script = "";
35
 
36
  public function __construct() {
37
- if ( ! $this->should_run() ) {
38
  return;
39
  }
40
 
41
  add_action( 'wp_head', [ $this, 'add_preload_tags' ] );
42
  }
43
 
44
- private function should_run() {
45
- global $sbp_options;
46
- if ( isset( $sbp_options['sbp_enable_preboost'] ) && $sbp_options['sbp_enable_preboost'] != true ) {
47
- return false;
48
- }
49
-
50
- return true;
51
- }
52
-
53
  public function add_preload_tags() {
54
  // Apply filters to mime types and matches
55
  $this->extension_type_matches = apply_filters( 'sbp_preboost_extension_type_matches', $this->extension_type_matches );
@@ -61,46 +54,23 @@ class SBP_Preboost {
61
  }
62
 
63
  private function prepare_preload_tags() {
64
- $sbp_preboost = get_option( 'sbp_preboost' );
65
-
66
- $rules = array_filter( explode( PHP_EOL, $sbp_preboost ) );
67
-
68
- if ( count( $rules ) ) {
69
- foreach ( $rules as $rule ) {
70
- // Trim spaces
71
- if ( ! trim( $rule ) ) {
72
- continue;
73
- }
74
-
75
- // Parse URL and Type
76
- $rule = trim( ltrim( $rule, ">>" ) );
77
- $url = $this->get_url( $rule );
78
- $type = $this->get_type( $rule );
79
-
80
- // Check for illegal characters
81
- if ( false !== strpos( $url, '>' ) ) {
82
- continue;
83
- }
84
-
85
- // Check one last time if it's empty or not
86
- if ( empty( trim( $url ) ) ) {
87
- continue;
88
- }
89
 
90
- $mime_type = $this->get_mime_type( SBP_Utils::get_file_extension( $rule ) );
 
 
 
91
  $mime_type_attribute = $mime_type ? " type='" . esc_attr( $mime_type ) . "'" : '';
92
- $link_tag = "<link rel='preload' href='" . esc_url($url) . "' as='" . esc_attr( $type ) . "'$mime_type_attribute />";
93
  $this->appending_script .= $link_tag . PHP_EOL;
94
  }
95
  }
96
  }
97
 
98
  private function get_type( $url ) {
99
- if ( $this->get_explicit_type( $url ) ) {
100
- return $this->get_explicit_type( $url );
101
- }
102
-
103
- $extension = strtolower( SBP_Utils::get_file_extension( $url ) );
104
  if ( array_key_exists( $extension, $this->extension_type_matches ) ) {
105
  return $this->extension_type_matches[ $extension ];
106
  }
@@ -108,22 +78,6 @@ class SBP_Preboost {
108
  return "other";
109
  }
110
 
111
- private function get_explicit_type( $entry ) {
112
- if ( strpos( $entry, ">>" ) !== false ) {
113
- return explode( ">>", $entry )[0];
114
- }
115
-
116
- return false;
117
- }
118
-
119
- private function get_url( $entry ) {
120
- if ( $this->get_explicit_type( $entry ) !== false ) {
121
- return explode( ">>", $entry )[1];
122
- }
123
-
124
- return $entry;
125
- }
126
-
127
  private function get_mime_type( $extension ) {
128
  if ( array_key_exists( $extension, $this->extension_mime_types ) ) {
129
  return $this->extension_mime_types[ $extension ];
@@ -132,6 +86,4 @@ class SBP_Preboost {
132
  return false;
133
  }
134
 
135
- }
136
-
137
- new SBP_Preboost();
1
  <?php
2
 
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
  die;
8
  }
9
 
10
+ class SBP_Preboost extends SBP_Abstract_Module {
11
  private $extension_type_matches = [
12
  'css' => 'style',
13
  'js' => 'script',
36
  private $appending_script = "";
37
 
38
  public function __construct() {
39
+ if ( is_array( sbp_get_option( 'preboost' ) ) && ( ! sbp_get_option( 'module_assets' ) || ! sbp_get_option( 'preboost' )['preboost_enable'] ) ) {
40
  return;
41
  }
42
 
43
  add_action( 'wp_head', [ $this, 'add_preload_tags' ] );
44
  }
45
 
 
 
 
 
 
 
 
 
 
46
  public function add_preload_tags() {
47
  // Apply filters to mime types and matches
48
  $this->extension_type_matches = apply_filters( 'sbp_preboost_extension_type_matches', $this->extension_type_matches );
54
  }
55
 
56
  private function prepare_preload_tags() {
57
+ if( isset( sbp_get_option( 'preboost' )['preboost_include'] ) ) {
58
+ $urls = SBP_Utils::explode_lines( sbp_get_option( 'preboost' )['preboost_include'] );
59
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
+ if ( isset( $urls ) && count( $urls ) ) {
62
+ foreach ( $urls as $url ) {
63
+ $type = $this->get_type( $url );
64
+ $mime_type = $this->get_mime_type( SBP_Utils::get_file_extension_from_url( $url ) );
65
  $mime_type_attribute = $mime_type ? " type='" . esc_attr( $mime_type ) . "'" : '';
66
+ $link_tag = "<link rel='preload' href='" . esc_url( $url ) . "' as='" . esc_attr( $type ) . "'$mime_type_attribute crossorigin />";
67
  $this->appending_script .= $link_tag . PHP_EOL;
68
  }
69
  }
70
  }
71
 
72
  private function get_type( $url ) {
73
+ $extension = strtolower( SBP_Utils::get_file_extension_from_url( $url ) );
 
 
 
 
74
  if ( array_key_exists( $extension, $this->extension_type_matches ) ) {
75
  return $this->extension_type_matches[ $extension ];
76
  }
78
  return "other";
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  private function get_mime_type( $extension ) {
82
  if ( array_key_exists( $extension, $this->extension_mime_types ) ) {
83
  return $this->extension_mime_types[ $extension ];
86
  return false;
87
  }
88
 
89
+ }
 
 
includes/classes/class-sbp-special.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ use SpeedBooster\SBP_Utils;
6
+
7
+ // If this file is called directly, abort.
8
+ if ( ! defined( 'WPINC' ) ) {
9
+ die;
10
+ }
11
+
12
+ class SBP_Special extends SBP_Abstract_Module {
13
+ public function __construct() {
14
+ if ( ! sbp_get_option( 'module_special' ) ) {
15
+ return;
16
+ }
17
+
18
+ $this->jetpack_dequeue_devicepx();
19
+ $this->woocommerce_disable_cart_fragments();
20
+ $this->optimize_nonwc_pages();
21
+ $this->remove_wc_password_strength_meter();
22
+ }
23
+
24
+ /**
25
+ * Dequeues Jetpack's devicepx-jetpack.js file
26
+ */
27
+ private function jetpack_dequeue_devicepx() {
28
+ if ( sbp_get_option( 'jetpack_dequeue_devicepx' ) ) {
29
+ add_action( 'wp_enqueue_scripts', [ $this, 'jetpack_dequeue_devicepx_handle' ] );
30
+ }
31
+ }
32
+
33
+ public function jetpack_dequeue_devicepx_handle() {
34
+ if ( SBP_Utils::is_plugin_active( 'jetpack/jetpack.php' ) ) {
35
+ wp_dequeue_script( 'devicepx' );
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Removes WooCommerce scripts from non-woocommerce pages
41
+ */
42
+ private function optimize_nonwc_pages() {
43
+ if ( function_exists( 'is_woocommerce' ) && sbp_get_option( 'woocommerce_optimize_nonwc_pages' ) ) {
44
+ add_action( 'wp_enqueue_scripts', [ $this, 'optimize_nonwc_pages_handle' ] );
45
+ }
46
+ }
47
+
48
+ public function optimize_nonwc_pages_handle() {
49
+ if ( SBP_Utils::is_plugin_active( 'woocommerce/woocommerce.php' ) && sbp_get_option( 'woocommerce_optimize_nonwc_pages' ) ) {
50
+ if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
51
+ // dequeue WooCommerce styles
52
+ wp_dequeue_style( 'woocommerce_chosen_styles' );
53
+ wp_dequeue_style( 'woocommerce_fancybox_styles' );
54
+ wp_dequeue_style( 'woocommerce_frontend_styles' );
55
+ wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
56
+
57
+ // dequeue WooCommerce scripts
58
+ wp_dequeue_script( 'wc-add-to-cart' );
59
+ wp_dequeue_script( 'wc-add-to-cart-variation' );
60
+ wp_dequeue_script( 'wc-cart' );
61
+ wp_dequeue_script( 'wc-cart-fragments' );
62
+ wp_dequeue_script( 'wc-checkout' );
63
+ wp_dequeue_script( 'wc-chosen' );
64
+ wp_dequeue_script( 'wc-single-product' );
65
+ wp_dequeue_script( 'wc-single-product' );
66
+ wp_dequeue_script( 'wc_price_slider' );
67
+ wp_dequeue_script( 'woocommerce' );
68
+ }
69
+ }
70
+ }
71
+
72
+ private function woocommerce_disable_cart_fragments() {
73
+ if ( sbp_get_option( 'woocommerce_disable_cart_fragments' ) ) {
74
+ add_action( 'wp_enqueue_scripts', [ $this, 'woocommerce_disable_cart_fragments_handle' ], 999 );
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Removes cart-fragments.js
80
+ */
81
+ public function woocommerce_disable_cart_fragments_handle() {
82
+ if ( SBP_Utils::is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
83
+ global $wp_scripts;
84
+ $handle = 'wc-cart-fragments';
85
+ if ( isset( $wp_scripts->registered[ $handle ] ) ) {
86
+ $load_cart_fragments_path = $wp_scripts->registered[ $handle ]->src;
87
+ $wp_scripts->registered[ $handle ]->src = null;
88
+ wp_add_inline_script(
89
+ 'jquery',
90
+ 'function sbp_getCookie(c){var e=document.cookie.match("(^|;) ?"+c+"=([^;]*)(;|$)");return e?e[2]:null}function sbp_check_wc_cart_script(){var c="sbp_loaded_wc_cart_fragments";if(null!==document.getElementById(c))return!1;if(sbp_getCookie("woocommerce_cart_hash")){var e=document.createElement("script");e.id=c,e.src="' . $load_cart_fragments_path . '",e.async=!0,document.head.appendChild(e)}}sbp_check_wc_cart_script(),document.addEventListener("click",function(){setTimeout(sbp_check_wc_cart_script,1e3)});'
91
+ );
92
+ }
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Removes password strength meter in WooCommerce checkout process
98
+ */
99
+ private function remove_wc_password_strength_meter() {
100
+ if ( function_exists( 'is_account_page' ) && sbp_get_option( 'woocommerce_disable_password_meter' ) ) {
101
+ add_action( 'wp_print_scripts', [ $this, 'remove_wc_password_strength_meter_handle' ], 100 );
102
+ }
103
+ }
104
+
105
+ public function remove_wc_password_strength_meter_handle() {
106
+ global $wp;
107
+
108
+ $wp_check = isset( $wp->query_vars['lost-password'] ) || ( isset( $_GET['action'] ) && $_GET['action'] === 'lostpassword' ) || is_page( 'lost_password' );
109
+
110
+ $wc_check = ( ( is_account_page() || is_checkout() ) );
111
+
112
+ if ( ! $wp_check && ! $wc_check ) {
113
+ if ( wp_script_is( 'zxcvbn-async', 'enqueued' ) ) {
114
+ wp_dequeue_script( 'zxcvbn-async' );
115
+ }
116
+
117
+ if ( wp_script_is( 'password-strength-meter', 'enqueued' ) ) {
118
+ wp_dequeue_script( 'password-strength-meter' );
119
+ }
120
+
121
+ if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
122
+ wp_dequeue_script( 'wc-password-strength-meter' );
123
+ }
124
+ }
125
+ }
126
+ }
includes/classes/class-sbp-tweaks.php ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Tweaks extends SBP_Abstract_Module {
11
+ private $tweak_settings = [
12
+ 'trim_query_strings' => 'trim_query_strings',
13
+ 'dequeue_emoji_scripts' => 'dequeue_emoji_scripts',
14
+ 'disable_self_pingbacks' => 'disable_self_pingbacks',
15
+ 'dequeue_jquery_migrate' => 'dequeue_jquery_migrate',
16
+ 'dequeue_dashicons' => 'dequeue_dashicons',
17
+ 'post_revisions' => 'post_revisions',
18
+ 'autosave_interval' => 'autosave_interval',
19
+ 'dequeue_block_library' => 'dequeue_block_library',
20
+ 'disable_post_embeds' => 'disable_post_embeds',
21
+ 'instant_page' => 'instant_page',
22
+ 'heartbeat_settings' => 'heartbeat_settings',
23
+ 'declutter_head' => [
24
+ 'declutter_shortlinks' => 'declutter_shortlinks',
25
+ 'declutter_adjacent_posts_links' => 'declutter_adjacent_posts_links',
26
+ 'declutter_wlw' => 'declutter_wlw',
27
+ 'declutter_rsd' => 'declutter_rsd',
28
+ 'declutter_rest_api_links' => 'declutter_rest_api_links',
29
+ 'declutter_feed_links' => 'declutter_feed_links',
30
+ 'declutter_wp_version' => 'declutter_wp_version',
31
+ ],
32
+ ];
33
+
34
+ public function __construct() {
35
+ if ( ! sbp_get_option( 'module_tweaks' ) ) {
36
+ return;
37
+ }
38
+
39
+ $this->call_option_methods( $this->tweak_settings );
40
+ }
41
+
42
+ private function call_option_methods( $settings, $parent = null ) {
43
+ foreach ( $settings as $option_name => $function ) {
44
+ if ( is_array( $settings[ $option_name ] ) ) {
45
+ $this->call_option_methods( $settings[ $option_name ], $option_name );
46
+ } else {
47
+ if ( null !== $parent ) {
48
+ if ( is_array( sbp_get_option( $parent ) ) && isset( sbp_get_option( $parent )[ $option_name ] ) ) {
49
+ $this->$function();
50
+ }
51
+ } else {
52
+ if ( sbp_get_option( $option_name ) ) {
53
+ $this->$function();
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Hook trim_query_string_process to proper actions
62
+ */
63
+ private function trim_query_strings() {
64
+ if ( ! is_admin() ) {
65
+ if ( sbp_get_option( 'trim_query_strings' ) ) {
66
+ add_action( 'script_loader_src', [ $this, 'trim_query_strings_handle' ], 15 );
67
+ }
68
+
69
+ if ( sbp_get_option( 'trim_query_strings' ) ) {
70
+ add_action( 'style_loader_src', [ $this, 'trim_query_strings_handle' ], 15 );
71
+ }
72
+ }
73
+ }
74
+
75
+ // Remove Query Strings
76
+
77
+ /**
78
+ * Removes query string parameters (rev and ver) from styles and scripts
79
+ *
80
+ * @param $src
81
+ *
82
+ * @return mixed|string
83
+ */
84
+ public function trim_query_strings_handle( $src ) {
85
+ return preg_split( "/(\?rev|&ver|\?ver)/", $src )[0];
86
+ }
87
+
88
+ // Remove Emoji Scripts
89
+
90
+ private function dequeue_emoji_scripts() {
91
+ add_action( 'init', [ $this, 'dequeue_emoji_scripts_handle' ] );
92
+ }
93
+
94
+ /**
95
+ * Removes WordPress emoji script
96
+ */
97
+ public function dequeue_emoji_scripts_handle() {
98
+ if ( ! is_admin() ) {
99
+ remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
100
+ remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
101
+ remove_filter( 'embed_head', 'print_emoji_detection_script' );
102
+ remove_action( 'wp_print_styles', 'print_emoji_styles' );
103
+ remove_action( 'admin_print_styles', 'print_emoji_styles' );
104
+ remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
105
+ remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
106
+ remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
107
+
108
+ add_filter( 'tiny_mce_plugins', [ $this, 'disable_emojis_tinymce' ] );
109
+ add_filter( 'wp_resource_hints', [ $this, 'disable_emojis_dns_prefetch' ], 10, 2 );
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Disables emojis in Tinymce
115
+ *
116
+ * @param $plugins
117
+ *
118
+ * @return array
119
+ */
120
+ public function disable_emojis_tinymce( $plugins ) {
121
+ if ( is_array( $plugins ) ) {
122
+ return array_diff( $plugins, [ 'wpemoji' ] );
123
+ } else {
124
+ return [];
125
+ }
126
+ }
127
+
128
+ /**
129
+ * @param $urls
130
+ * @param $relation_type
131
+ *
132
+ * @return array
133
+ */
134
+ public function disable_emojis_dns_prefetch( $urls, $relation_type ) {
135
+ if ( 'dns-prefetch' == $relation_type ) {
136
+ $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2.2.1/svg/' );
137
+ $urls = array_diff( $urls, [ $emoji_svg_url ] );
138
+ }
139
+
140
+ return $urls;
141
+ }
142
+
143
+ // Disable Self Pingback
144
+
145
+ private function disable_self_pingbacks() {
146
+ add_action( 'pre_ping', [ $this, 'disable_self_pingbacks_handle' ] );
147
+ }
148
+
149
+ /**
150
+ * @param $links
151
+ */
152
+ public function disable_self_pingbacks_handle( &$links ) {
153
+ $home = get_option( 'home' );
154
+ foreach ( $links as $l => $link ) {
155
+ if ( 0 === strpos( $link, $home ) ) {
156
+ unset( $links[ $l ] );
157
+ }
158
+ }
159
+ }
160
+
161
+ // Remove jQuery Migrate
162
+
163
+ private function dequeue_jquery_migrate() {
164
+ add_action( 'wp_default_scripts', [ $this, 'dequeue_jquery_migrate_handle' ] );
165
+ }
166
+
167
+ /**
168
+ * @param $scripts
169
+ */
170
+ public function dequeue_jquery_migrate_handle( $scripts ) {
171
+ if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
172
+ $jquery_script = $scripts->registered['jquery'];
173
+
174
+ if ( $jquery_script->deps ) { // Check whether the script has any dependencies
175
+ $jquery_script->deps = array_diff( $jquery_script->deps, [ 'jquery-migrate' ] );
176
+ }
177
+ }
178
+ }
179
+
180
+ // Remove Dash Icons
181
+ private function dequeue_dashicons() {
182
+ add_action( 'wp_enqueue_scripts', [ $this, 'dequeue_dashicons_handle' ] );
183
+ }
184
+
185
+ public function dequeue_dashicons_handle() {
186
+ if ( ! is_user_logged_in() ) {
187
+ wp_dequeue_style( 'dashicons' );
188
+ wp_deregister_style( 'dashicons' );
189
+ }
190
+ }
191
+
192
+ private function declutter_shortlinks() {
193
+ remove_action( 'wp_head', 'wp_shortlink_wp_head' );
194
+ }
195
+
196
+ private function declutter_adjacent_posts_links() {
197
+ remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
198
+ }
199
+
200
+ private function declutter_wlw() {
201
+ remove_action( 'wp_head', 'wlwmanifest_link' );
202
+ }
203
+
204
+ private function declutter_rsd() {
205
+ remove_action( 'wp_head', 'rsd_link' );
206
+ }
207
+
208
+ private function declutter_wp_version() {
209
+ remove_action( 'wp_head', 'wp_generator' );
210
+ }
211
+
212
+ private function post_revisions() {
213
+ if ( ! empty( sbp_get_option( 'post_revisions' ) ) && ! defined( 'WP_POST_REVISIONS' ) ) {
214
+ define( 'WP_POST_REVISIONS', sbp_get_option( 'post_revisions' ) );
215
+ }
216
+ }
217
+
218
+ private function autosave_interval() {
219
+ if ( ! empty( sbp_get_option( 'autosave_interval' ) ) && ! defined( 'AUTOSAVE_INTERVAL' ) ) {
220
+ define( 'AUTOSAVE_INTERVAL', sbp_get_option( 'autosave_interval' ) );
221
+ }
222
+ }
223
+
224
+ private function dequeue_block_library() {
225
+ add_action( 'wp_enqueue_scripts', [ $this, 'dequeue_block_library_handle' ] );
226
+ }
227
+
228
+ public function dequeue_block_library_handle() {
229
+ wp_dequeue_style( 'wp-block-library' );
230
+ wp_dequeue_style( 'wp-block-library-theme' );
231
+ }
232
+
233
+ private function disable_post_embeds() {
234
+ add_action( 'init', [ $this, 'remove_embeds_from_init' ], 9999 );
235
+
236
+ }
237
+
238
+ public function remove_embeds_from_init() {
239
+ // Remove the REST API endpoint.
240
+ remove_action( 'rest_api_init', 'wp_oembed_register_route' );
241
+
242
+ // Turn off oEmbed auto discovery.
243
+ add_filter( 'embed_oembed_discover', '__return_false' );
244
+
245
+ // Don't filter oEmbed results.
246
+ remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 );
247
+
248
+ // Remove oEmbed discovery links.
249
+ remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
250
+
251
+ // Remove oEmbed-specific JavaScript from the front-end and back-end.
252
+ remove_action( 'wp_head', 'wp_oembed_add_host_js' );
253
+
254
+ // Remove all embeds rewrite rules.
255
+ add_filter( 'rewrite_rules_array', [ $this, 'disable_embeds_rewrites' ] );
256
+
257
+ // Remove filter of the oEmbed result before any HTTP requests are made.
258
+ remove_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result', 10 );
259
+ }
260
+
261
+ public function disable_embeds_rewrites( $rules ) {
262
+ foreach ( $rules as $rule => $rewrite ) {
263
+ if ( false !== strpos( $rewrite, 'embed=true' ) ) {
264
+ unset( $rules[ $rule ] );
265
+ }
266
+ }
267
+
268
+ return $rules;
269
+ }
270
+
271
+ public function disable_post_embeds_handle() {
272
+ wp_dequeue_script( 'wp-embed' );
273
+ }
274
+
275
+ private function heartbeat_settings() {
276
+ switch ( sbp_get_option( 'heartbeat_settings' ) ) {
277
+ case "optimized":
278
+ add_filter( 'heartbeat_settings', [ $this, 'heartbeat_settings_handle' ] );
279
+ break;
280
+ case "disabled":
281
+ add_action( 'init', wp_deregister_script( 'heartbeat' ) );
282
+ break;
283
+ }
284
+ }
285
+
286
+ public function heartbeat_settings_handle() {
287
+ $settings['interval'] = sbp_get_option( 'heartbeat_frequency' );
288
+
289
+ return $settings;
290
+ }
291
+
292
+ // Instant Page
293
+ private function instant_page() {
294
+ add_action( 'wp_enqueue_scripts', [ $this, 'instant_page_handle' ] );
295
+ }
296
+
297
+ public function instant_page_handle() {
298
+ wp_enqueue_script( 'sbp-ins-page', SBP_URL . 'public/js/inspage.js', false, '5.1.0', true );
299
+ }
300
+
301
+ private function declutter_feed_links() {
302
+ remove_action( 'wp_head', 'feed_links_extra', 3 );
303
+ remove_action( 'wp_head', 'feed_links', 2 );
304
+ }
305
+
306
+ private function declutter_rest_api_links() {
307
+ remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
308
+ }
309
+ }
includes/classes/class-sbp-utils.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SpeedBooster;
4
+
5
+ // If this file is called directly, abort.
6
+ if ( ! defined( 'WPINC' ) ) {
7
+ die;
8
+ }
9
+
10
+ class SBP_Utils extends SBP_Abstract_Module {
11
+ public static function explode_lines( $text, $unique = true ) {
12
+ if ( '' === $text ) {
13
+ return [];
14
+ }
15
+
16
+ if ( true === $unique ) {
17
+ return array_filter( array_unique( array_map( 'trim', explode( PHP_EOL, $text ) ) ) );
18
+ } else {
19
+ return array_filter( array_map( 'trim', explode( PHP_EOL, $text ) ) );
20
+ }
21
+ }
22
+
23
+ public static function get_file_extension_from_url( $url ) {
24
+ // Remove Query String
25
+ if ( strpos( $url, "?" ) !== false ) {
26
+ $url = substr( $url, 0, strpos( $url, "?" ) );
27
+ }
28
+ if ( strpos( $url, "#" ) !== false ) {
29
+ $url = substr( $url, 0, strpos( $url, "#" ) );
30
+ }
31
+
32
+ return pathinfo( $url, PATHINFO_EXTENSION );
33
+ }
34
+
35
+ /**
36
+ * Check if a plugin is active or not.
37
+ * @since 3.8.3
38
+ */
39
+ public static function is_plugin_active( $path ) {
40
+ return in_array( $path, get_option( 'active_plugins' ) );
41
+ }
42
+
43
+ }
includes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
includes/libs/announce4wp/announce4wp-client.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists( "Announce4WP_Client" ) ) {
4
+ class Announce4WP_Client {
5
+ private $api_endpoint_url = '';
6
+ private $service_id = '';
7
+ private $transient_name = '';
8
+ private $settings_screen = '';
9
+ private $plugin_name = '';
10
+ private $plugin_file_name = '';
11
+
12
+ public function __construct( $plugin_file_name, $plugin_name, $service_id, $api_endpoint_url, $settings_screen ) {
13
+ $this->service_id = $service_id;
14
+ $this->api_endpoint_url = $api_endpoint_url;
15
+ $this->settings_screen = $settings_screen;
16
+ $this->plugin_file_name = $plugin_file_name;
17
+ $this->plugin_name = $plugin_name;
18
+ $this->transient_name = 'a4wp_' . $this->service_id . '_announcements';
19
+
20
+ add_action( 'admin_init', [ $this, 'save_notices' ] );
21
+
22
+ // Enqueue Dismiss Script
23
+ add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
24
+
25
+ // Admin Notices
26
+ add_action( 'admin_notices', [ $this, 'display_notices' ] );
27
+
28
+ // Dismiss Notice Action
29
+ add_action( 'wp_ajax_a4wp_dismiss_notice', [ $this, 'dismiss_notice' ] );
30
+ }
31
+
32
+ public function save_notices() {
33
+ if ( ! current_user_can( 'manage_options' ) ) {
34
+ return;
35
+ }
36
+
37
+ if ( get_transient( $this->transient_name ) ) {
38
+ return;
39
+ }
40
+
41
+ $remote_notices = $this->fetch_notices();
42
+ if ( ! $remote_notices ) {
43
+ return;
44
+ }
45
+
46
+ // Update transient
47
+ set_transient( $this->transient_name, $remote_notices, 12 * HOUR_IN_SECONDS );
48
+ }
49
+
50
+ private function fetch_notices() {
51
+ $notices = wp_remote_get( $this->api_endpoint_url );
52
+ if ( $notices instanceof WP_Error ) {
53
+ return false;
54
+ }
55
+ $notices = json_decode( $notices['body'], true );
56
+
57
+ return $notices;
58
+ }
59
+
60
+ public function enqueue_scripts() {
61
+ wp_add_inline_script( 'jquery',
62
+ 'jQuery(document).on(\'click\', \'.a4wp-notice .notice-dismiss\', function() {
63
+ var $notice = jQuery(this).parent();
64
+ var notice_id = $notice.data(\'notice-id\');
65
+ var service_id = $notice.data(\'service-id\');
66
+ var data = {action: \'a4wp_dismiss_notice\', notice_id: notice_id, service_id: service_id};
67
+ jQuery.get(ajaxurl, data);
68
+ });' );
69
+ }
70
+
71
+ public function dismiss_notice() {
72
+ if ( current_user_can( 'manage_options' ) && isset( $_GET['action'] ) && $_GET['action'] == 'a4wp_dismiss_notice' ) {
73
+ $id = $_GET['notice_id'];
74
+ $service_id = $_GET['service_id'];
75
+ if ( ! $service_id || $service_id != $this->service_id ) {
76
+ return;
77
+ }
78
+ $last_ids = get_user_meta( get_current_user_id(), $this->service_id . '_dismissed_notices', true );
79
+ $last_ids = $last_ids == '' ? [] : $last_ids;
80
+ $last_ids[ $this->service_id ][] = $id;
81
+ $last_ids[ $this->service_id ] = array_unique( $last_ids[ $this->service_id ] );
82
+ update_user_meta( get_current_user_id(), $this->service_id . '_dismissed_notices', $last_ids );
83
+ }
84
+ }
85
+
86
+ private function parse_attributes( $rules ) {
87
+ if ( ! $rules ) {
88
+ return [];
89
+ }
90
+
91
+ $attributes = [];
92
+ foreach ( $rules as $rule ) {
93
+ if ( strpos( $rule, ":" ) !== false ) {
94
+ list( $type, $rule ) = explode( ":", $rule );
95
+ $attributes[ $type ] = $rule;
96
+ }
97
+ }
98
+
99
+ return $attributes;
100
+ }
101
+
102
+ public function display_notices() {
103
+ $announcements = get_transient( $this->transient_name );
104
+ if ( is_array( $announcements ) && isset( $announcements['normal_notices'] ) ) {
105
+ foreach ( $announcements['normal_notices'] as $notice ) {
106
+ $attributes = $this->parse_attributes( $notice['rules'] );
107
+ $this->print_notice( $attributes, $notice );
108
+ }
109
+ }
110
+
111
+ if ( is_array( $announcements ) && isset( $announcements["important_notices"] ) ) {
112
+ foreach ( $announcements["important_notices"] as $notice ) {
113
+ $attributes = $this->parse_attributes( $notice['rules'] );
114
+ $this->print_notice( $attributes, $notice, true );
115
+ }
116
+ }
117
+ }
118
+
119
+ private function print_notice( $attributes, $notice, $is_important = false ) {
120
+ $type = isset( $attributes['type'] ) ? $attributes['type'] : 'notice-info';
121
+ if ( true === $is_important ) {
122
+ $should_display = $this->should_display( $attributes );
123
+ } else {
124
+ $should_display = $this->should_display( $attributes, $notice );
125
+ }
126
+ if ( $should_display ) {
127
+ echo '<div class="notice a4wp-notice ' . $type . ' ' . ( ! $is_important ? 'is-dismissible' : null ) . '" data-service-id="' . $this->service_id . '" data-notice-id="' . $notice['id'] . '">';
128
+ echo ( $notice['title'] ) ? '<p style="font-size:120%;font-weight:700;">' . $notice['title'] . '</p>' : null;
129
+ echo ( $notice['content'] ) ? '<p>' . $notice['content'] . '</p>' : null;
130
+ echo '</div>';
131
+ }
132
+ }
133
+
134
+ /**
135
+ * @param $attributes
136
+ * @param null $notice required for notices
137
+ *
138
+ * @return bool
139
+ */
140
+ private function should_display( $attributes, $notice = null ) {
141
+ // Check Page
142
+ $page = isset( $attributes['page'] ) ? $attributes['page'] : $this->settings_screen;
143
+ if ( $page != "all" && $page != get_current_screen()->id ) {
144
+ return false;
145
+ }
146
+
147
+ if ( null !== $notice ) {
148
+ $dismissed_ids = get_user_meta( get_current_user_id(), $this->service_id . '_dismissed_notices', true );
149
+ if ( is_array( $dismissed_ids ) ) {
150
+ if ( isset( $dismissed_ids[ $this->service_id ] ) && in_array( $notice['id'], $dismissed_ids[ $this->service_id ] ) ) {
151
+ return false;
152
+ }
153
+ }
154
+ }
155
+
156
+ return true;
157
+ }
158
+ }
159
+ }
includes/libs/codestar-framework/assets/css/style-rtl.css ADDED
@@ -0,0 +1,585 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * ---------------------------------------------------------
4
+ * CODESTAR FRAMEWORK RTL CSS MAP
5
+ * ---------------------------------------------------------
6
+ *
7
+ * 01. Base
8
+ * 01. 01. Header
9
+ * 01. 02. Header Buttons
10
+ * 01. 03. Navigation
11
+ * 01. 04. Content
12
+ * 01. 05. Section
13
+ * 01. 06. Show All Options
14
+ * 01. 07. Search Input
15
+ * 01. 08. Copyright
16
+ * 01. 09. Metabox
17
+ * 02. Fields
18
+ * 02. 01. Field: typography
19
+ * 02. 02. Field: checkbox, radio
20
+ * 02. 03. Field: switcher
21
+ * 02. 04. Field: upload
22
+ * 02. 05. Field: group
23
+ * 02. 06. Field: repeater
24
+ * 02. 07. Field: help
25
+ * 02. 08. Field: icon
26
+ * 02. 09. Field: gallery
27
+ * 02. 10. Field: sorter
28
+ * 02. 11. Field: tabbed
29
+ * 02. 12. Field: media
30
+ * 02. 13. Field: notice
31
+ * 02. 14. Field: border, spacing, dimensions
32
+ * 02. 15. Field: background
33
+ * 02. 16. Field: spinner
34
+ * 02. 17. Field: slider
35
+ * 02. 18. Field: button_set
36
+ * 02. 19. Field: link_color
37
+ * 02. 20. Field: color_group
38
+ * 02. 21. Field: palette
39
+ * 02. 22. Field: accordion
40
+ * 02. 23. Field: date
41
+ * 02. 24. Field: map
42
+ * 02. 25. Field: sortable
43
+ * 02. 26. Field: number
44
+ * 03. Taxonomy
45
+ * 04. Profile
46
+ * 05. Nav Menu
47
+ * 06. Modal
48
+ * 07. Customizer
49
+ * 08. Responsive
50
+ * 09. Others
51
+ *
52
+ * ---------------------------------------------------------
53
+ *
54
+ */
55
+ /**
56
+ * 01. Base
57
+ */
58
+ .csf-options {
59
+ margin-left: 20px;
60
+ margin-right: 0;
61
+ }
62
+
63
+ /**
64
+ * 01. 01. Header
65
+ */
66
+ .csf-header h1 {
67
+ float: right;
68
+ }
69
+ .csf-header fieldset {
70
+ float: left;
71
+ }
72
+
73
+ /**
74
+ * 01. 02. Header Buttons
75
+ */
76
+ .csf-buttons {
77
+ float: left;
78
+ direction: ltr;
79
+ }
80
+
81
+ .csf-header-left {
82
+ float: right;
83
+ }
84
+
85
+ .csf-header-right {
86
+ float: left;
87
+ }
88
+
89
+ /**
90
+ * 01. 03. Navigation
91
+ */
92
+ .csf-nav {
93
+ float: right;
94
+ }
95
+ .csf-nav ul {
96
+ clear: right;
97
+ }
98
+ .csf-nav ul li .csf-active:after {
99
+ right: auto;
100
+ left: 0;
101
+ border-left-color: #fff;
102
+ border-right-color: transparent;
103
+ }
104
+ .csf-nav ul li .csf-arrow:after {
105
+ content: "\f053";
106
+ right: auto;
107
+ left: 10px;
108
+ }
109
+ .csf-nav ul li.csf-tab-expanded .csf-arrow:after {
110
+ -moz-transform: rotate(-90deg);
111
+ -ms-transform: rotate(-90deg);
112
+ -webkit-transform: rotate(-90deg);
113
+ transform: rotate(-90deg);
114
+ }
115
+ .csf-nav ul ul li a {
116
+ padding-right: 25px;
117
+ padding-left: 15px;
118
+ }
119
+ .csf-nav ul ul:before {
120
+ left: auto;
121
+ right: 15px;
122
+ }
123
+ .csf-nav .csf-tab-icon {
124
+ margin-left: 5px;
125
+ margin-right: 0;
126
+ }
127
+
128
+ .csf-nav-background {
129
+ left: auto;
130
+ right: 0;
131
+ }
132
+
133
+ /**
134
+ * 01. 04. Content
135
+ */
136
+ .csf-content {
137
+ margin-left: 0;
138
+ margin-right: 225px;
139
+ }
140
+
141
+ /**
142
+ * 01. 05. Section
143
+ */
144
+ .csf-sections {
145
+ float: right;
146
+ }
147
+
148
+ /**
149
+ * 01. 06. Show all options
150
+ */
151
+ .csf-show-all .csf-content {
152
+ margin-right: 0;
153
+ overflow: hidden;
154
+ }
155
+
156
+ .csf-expand-all {
157
+ float: right;
158
+ right: auto;
159
+ left: 40px;
160
+ margin-right: 0;
161
+ margin-left: 4px;
162
+ }
163
+
164
+ /**
165
+ * 01. 07. Search Input
166
+ */
167
+ .csf-search {
168
+ float: right;
169
+ }
170
+ .csf-search input {
171
+ margin: 0 0 0 5px;
172
+ }
173
+
174
+ /**
175
+ * 01. 08. Copyright
176
+ */
177
+ .csf-copyright {
178
+ float: right;
179
+ }
180
+
181
+ /**
182
+ * 01. 09. Metabox
183
+ */
184
+ .csf-metabox {
185
+ margin: -6px -12px -12px -12px;
186
+ }
187
+ .csf-metabox .csf-section-title {
188
+ padding: 20px;
189
+ }
190
+
191
+ .csf-section-title .csf-section-icon {
192
+ margin-left: 5px;
193
+ margin-right: 0;
194
+ }
195
+
196
+ /**
197
+ * 02. Fields
198
+ */
199
+ .csf-field .csf-title {
200
+ float: right;
201
+ }
202
+ .csf-field .csf-fieldset {
203
+ float: left;
204
+ }
205
+
206
+ .csf-pseudo-field {
207
+ padding: 0 0 0 5px !important;
208
+ }
209
+
210
+ /**
211
+ * 02. 01. Field: typography
212
+ */
213
+ .csf-field-typography select {
214
+ margin: 0;
215
+ width: 100%;
216
+ }
217
+ .csf-field-typography .csf--blocks-inputs .csf--blocks {
218
+ flex-direction: row-reverse;
219
+ }
220
+
221
+ /**
222
+ * 02. 02. Field: checkbox, radio
223
+ */
224
+ .csf-field-checkbox ul ul li,
225
+ .csf-field-radio ul ul li {
226
+ margin-left: 0;
227
+ margin-right: 8px;
228
+ }
229
+ .csf-field-checkbox ul ul li:first-child,
230
+ .csf-field-radio ul ul li:first-child {
231
+ margin-right: 0;
232
+ }
233
+ .csf-field-checkbox .csf--inline-list li,
234
+ .csf-field-radio .csf--inline-list li {
235
+ margin-right: 0;
236
+ margin-left: 15px;
237
+ }
238
+ .csf-field-checkbox .csf--text,
239
+ .csf-field-radio .csf--text {
240
+ margin-left: 0;
241
+ margin-right: 5px;
242
+ }
243
+
244
+ /**
245
+ * 02. 03. Field: switcher
246
+ */
247
+ .csf-field-switcher .csf--switcher {
248
+ float: right;
249
+ }
250
+ .csf-field-switcher .csf--label {
251
+ float: right;
252
+ margin-left: 0;
253
+ margin-right: 5px;
254
+ }
255
+
256
+ /**
257
+ * 02. 04. Field: upload
258
+ */
259
+ .csf-field-upload .csf--remove,
260
+ .csf-field-upload .csf--button {
261
+ margin-left: 0;
262
+ margin-right: 5px;
263
+ }
264
+
265
+ /**
266
+ * 02. 05. Field: group
267
+ */
268
+ .csf-field-group .csf-cloneable-title {
269
+ padding: 15px 10px 15px 65px;
270
+ }
271
+ .csf-field-group .csf-cloneable-helper {
272
+ right: auto;
273
+ left: 10px;
274
+ }
275
+
276
+ /**
277
+ * 02. 06. Field: repeater
278
+ */
279
+ .csf-field-repeater .csf-repeater-helper {
280
+ border-left: 0;
281
+ border-right: 1px solid #eee;
282
+ }
283
+
284
+ /**
285
+ * 02. 07. Field: help
286
+ */
287
+ .csf-help {
288
+ right: auto;
289
+ left: 5px;
290
+ }
291
+
292
+ /**
293
+ * 02. 08. Field: icon
294
+ */
295
+ .csf-field-icon .button {
296
+ margin-right: 0;
297
+ margin-left: 5px;
298
+ }
299
+ .csf-field-icon .csf-icon-preview i {
300
+ margin-right: 0;
301
+ margin-left: 5px;
302
+ }
303
+
304
+ /**
305
+ * 02. 09. Field: gallery
306
+ */
307
+ .csf-field-gallery ul li {
308
+ margin-right: 0;
309
+ margin-left: 5px;
310
+ }
311
+ .csf-field-gallery .button {
312
+ margin-right: 0;
313
+ margin-left: 5px;
314
+ }
315
+
316
+ /**
317
+ * 02. 11. Field: tabbed
318
+ */
319
+ .csf-field-tabbed .csf-tabbed-nav .csf--icon {
320
+ padding-right: 0;
321
+ padding-left: 5px;
322
+ }
323
+ .csf-field-tabbed .csf-tabbed-nav a {
324
+ margin-right: 0;
325
+ margin-left: 5px;
326
+ }
327
+
328
+ /**
329
+ * 02. 12. Field: media
330
+ */
331
+ .csf-field-media .button {
332
+ margin-left: 0;
333
+ margin-right: 7px;
334
+ }
335
+ .csf-field-media .hidden + .button {
336
+ margin-right: 0;
337
+ }
338
+
339
+ /**
340
+ * 02. 13. Field: notice
341
+ */
342
+ .csf-notice {
343
+ border-left: none;
344
+ border-right-style: solid;
345
+ border-right-width: 4px;
346
+ }
347
+
348
+ /**
349
+ * 02. 14. Field: border, spacing, dimensions
350
+ */
351
+ .csf-field-dimensions .csf--input,
352
+ .csf-field-dimensions .csf-fieldset,
353
+ .csf-field-spacing .csf--input,
354
+ .csf-field-spacing .csf-fieldset,
355
+ .csf-field-border .csf--input,
356
+ .csf-field-border .csf-fieldset {
357
+ direction: ltr;
358
+ }
359
+ .csf-field-dimensions .csf--inputs,
360
+ .csf-field-dimensions .csf--color,
361
+ .csf-field-spacing .csf--inputs,
362
+ .csf-field-spacing .csf--color,
363
+ .csf-field-border .csf--inputs,
364
+ .csf-field-border .csf--color {
365
+ float: right;
366
+ }
367
+ .csf-field-dimensions .csf--color,
368
+ .csf-field-spacing .csf--color,
369
+ .csf-field-border .csf--color {
370
+ margin-right: 4px;
371
+ direction: rtl;
372
+ }
373
+
374
+ /**
375
+ * 02. 15. Field: background
376
+ */
377
+ .csf-field-background .csf--block {
378
+ float: right;
379
+ }
380
+ .csf-field-background .csf--select,
381
+ .csf-field-background .csf--media {
382
+ padding-right: 0;
383
+ }
384
+ .csf-field-background .csf--title {
385
+ margin-right: 0;
386
+ margin-left: 5px;
387
+ }
388
+
389
+ /**
390
+ * 02. 16. Field: spinner
391
+ */
392
+ .csf-field-spinner .csf--spin {
393
+ float: right;
394
+ direction: ltr;
395
+ }
396
+
397
+ /**
398
+ * 02. 17. Field: slider
399
+ */
400
+ .csf-field-slider .csf-slider-ui {
401
+ direction: ltr;
402
+ margin-right: 0;
403
+ margin-left: 15px;
404
+ }
405
+ .csf-field-slider .csf--input {
406
+ direction: ltr;
407
+ }
408
+
409
+ /**
410
+ * 02. 18. Field: button_set
411
+ */
412
+ .csf-field-button_set .csf--button-group {
413
+ float: right;
414
+ }
415
+
416
+ /**
417
+ * 02. 19. Field: link_color
418
+ */
419
+ .csf-field-link_color .csf--left {
420
+ float: right;
421
+ margin-right: 0;
422
+ margin-left: 10px;
423
+ }
424
+
425
+ /**
426
+ * 02. 20. Field: color_group
427
+ */
428
+ .csf-field-color_group .csf--left {
429
+ float: right;
430
+ margin-right: 0;
431
+ margin-left: 10px;
432
+ }
433
+
434
+ /**
435
+ * 02. 21. Field: palette
436
+ */
437
+ .csf-field-palette .csf--palette {
438
+ margin-right: 0;
439
+ margin-left: 10px;
440
+ }
441
+
442
+ /**
443
+ * 02. 22. Field: accordion
444
+ */
445
+ .csf-field-accordion .csf--icon {
446
+ margin-right: 0;
447
+ margin-left: 2px;
448
+ }
449
+
450
+ /**
451
+ * 02. 23. Field: date
452
+ */
453
+ .csf-field-date .csf--to {
454
+ margin-left: 0;
455
+ margin-right: 7px;
456
+ }
457
+
458
+ /**
459
+ * 02. 24. Field: map
460
+ */
461
+ .csf-field-map .csf--map-input:last-child {
462
+ padding-left: 0;
463
+ padding-right: 10px;
464
+ }
465
+
466
+ /**
467
+ * 02. 25. Field: sortable
468
+ */
469
+ .csf-field-sortable .csf--sortable-helper {
470
+ border-left: none;
471
+ border-right: 1px solid #eee;
472
+ }
473
+
474
+ /**
475
+ * 02. 26. Field: number
476
+ */
477
+ .csf-field-number .csf--wrap {
478
+ float: right;
479
+ }
480
+
481
+ /**
482
+ * 03. Taxonomy
483
+ */
484
+ .csf-taxonomy-add-fields {
485
+ margin-right: 0;
486
+ margin-left: 30px;
487
+ }
488
+ .csf-taxonomy-add-fields .csf-field > .csf-fieldset > .csf-help {
489
+ left: -5px;
490
+ right: auto;
491
+ }
492
+
493
+ .csf-taxonomy-edit-fields {
494
+ margin-right: 0;
495
+ margin-left: 35px;
496
+ }
497
+ .csf-taxonomy-edit-fields .csf-field > .csf-fieldset > .csf-help {
498
+ right: auto;
499
+ left: -5px;
500
+ }
501
+
502
+ /**
503
+ * 04. Profile
504
+ */
505
+ .csf-profile-options > h2 > .fa {
506
+ padding-right: 0;
507
+ padding-left: 7px;
508
+ }
509
+ .csf-profile-options > .csf-field > .csf-fieldset > .csf-help {
510
+ left: -5px;
511
+ right: auto;
512
+ }
513
+
514
+ /**
515
+ * 05. Nav Menu
516
+ */
517
+ .csf-nav-menu-options > .csf-fields {
518
+ margin-left: 0;
519
+ margin-right: -10px;
520
+ }
521
+
522
+ .csf-nav-menu-title {
523
+ padding-left: 14px;
524
+ padding-right: 12px;
525
+ }
526
+
527
+ .csf-nav-menu-icon {
528
+ margin-right: 0;
529
+ margin-left: 5px;
530
+ }
531
+
532
+ /**
533
+ * 06. Modal
534
+ */
535
+ .csf-modal-content .csf-field {
536
+ padding: 15px 15px 15px 30px;
537
+ }
538
+
539
+ .csf-modal-title {
540
+ padding: 0 16px 0 36px;
541
+ }
542
+
543
+ .csf-modal-close {
544
+ right: auto;
545
+ left: 0;
546
+ }
547
+
548
+ /**
549
+ * 07. Customizer
550
+ */
551
+ .control-section .csf-field .csf-fieldset {
552
+ margin-right: 0;
553
+ }
554
+
555
+ /**
556
+ * 08. Responsive
557
+ */
558
+ @media only screen and (max-width: 1200px) {
559
+ .csf-metabox .csf-field .csf-fieldset {
560
+ margin-left: 0;
561
+ }
562
+ }
563
+ @media only screen and (max-width: 782px) {
564
+ .csf .csf-fieldset,
565
+ .csf .csf-content {
566
+ margin-right: 0;
567
+ }
568
+ }
569
+ /**
570
+ * 09. Others
571
+ */
572
+ .csf-field .csf--transparent-slider {
573
+ margin-left: 0;
574
+ margin-right: 2px;
575
+ }
576
+ .csf-field .csf--transparent-slider .ui-slider-handle {
577
+ margin: 0 -11px;
578
+ }
579
+ .csf-field .csf--transparent-offset {
580
+ background-position: center right;
581
+ }
582
+ .csf-field .csf--transparent-text {
583
+ right: auto;
584
+ left: 10px;
585
+ }
includes/libs/codestar-framework/assets/css/style-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .csf-options{margin-left:20px;margin-right:0}.csf-header h1{float:right}.csf-header fieldset{float:left}.csf-buttons{float:left;direction:ltr}.csf-header-left{float:right}.csf-header-right{float:left}.csf-nav{float:right}.csf-nav ul{clear:right}.csf-nav ul li .csf-active:after{right:auto;left:0;border-left-color:#fff;border-right-color:transparent}.csf-nav ul li .csf-arrow:after{content:"\f053";right:auto;left:10px}.csf-nav ul li.csf-tab-expanded .csf-arrow:after{-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.csf-nav ul ul li a{padding-right:25px;padding-left:15px}.csf-nav ul ul:before{left:auto;right:15px}.csf-nav .csf-tab-icon{margin-left:5px;margin-right:0}.csf-nav-background{left:auto;right:0}.csf-content{margin-left:0;margin-right:225px}.csf-sections{float:right}.csf-show-all .csf-content{margin-right:0;overflow:hidden}.csf-expand-all{float:right;right:auto;left:40px;margin-right:0;margin-left:4px}.csf-search{float:right}.csf-search input{margin:0 0 0 5px}.csf-copyright{float:right}.csf-metabox{margin:-6px -12px -12px -12px}.csf-metabox .csf-section-title{padding:20px}.csf-section-title .csf-section-icon{margin-left:5px;margin-right:0}.csf-field .csf-title{float:right}.csf-field .csf-fieldset{float:left}.csf-pseudo-field{padding:0 0 0 5px!important}.csf-field-typography select{margin:0;width:100%}.csf-field-typography .csf--blocks-inputs .csf--blocks{flex-direction:row-reverse}.csf-field-checkbox ul ul li,.csf-field-radio ul ul li{margin-left:0;margin-right:8px}.csf-field-checkbox ul ul li:first-child,.csf-field-radio ul ul li:first-child{margin-right:0}.csf-field-checkbox .csf--inline-list li,.csf-field-radio .csf--inline-list li{margin-right:0;margin-left:15px}.csf-field-checkbox .csf--text,.csf-field-radio .csf--text{margin-left:0;margin-right:5px}.csf-field-switcher .csf--switcher{float:right}.csf-field-switcher .csf--label{float:right;margin-left:0;margin-right:5px}.csf-field-upload .csf--button,.csf-field-upload .csf--remove{margin-left:0;margin-right:5px}.csf-field-group .csf-cloneable-title{padding:15px 10px 15px 65px}.csf-field-group .csf-cloneable-helper{right:auto;left:10px}.csf-field-repeater .csf-repeater-helper{border-left:0;border-right:1px solid #eee}.csf-help{right:auto;left:5px}.csf-field-icon .button{margin-right:0;margin-left:5px}.csf-field-icon .csf-icon-preview i{margin-right:0;margin-left:5px}.csf-field-gallery ul li{margin-right:0;margin-left:5px}.csf-field-gallery .button{margin-right:0;margin-left:5px}.csf-field-tabbed .csf-tabbed-nav .csf--icon{padding-right:0;padding-left:5px}.csf-field-tabbed .csf-tabbed-nav a{margin-right:0;margin-left:5px}.csf-field-media .button{margin-left:0;margin-right:7px}.csf-field-media .hidden+.button{margin-right:0}.csf-notice{border-left:none;border-right-style:solid;border-right-width:4px}.csf-field-border .csf--input,.csf-field-border .csf-fieldset,.csf-field-dimensions .csf--input,.csf-field-dimensions .csf-fieldset,.csf-field-spacing .csf--input,.csf-field-spacing .csf-fieldset{direction:ltr}.csf-field-border .csf--color,.csf-field-border .csf--inputs,.csf-field-dimensions .csf--color,.csf-field-dimensions .csf--inputs,.csf-field-spacing .csf--color,.csf-field-spacing .csf--inputs{float:right}.csf-field-border .csf--color,.csf-field-dimensions .csf--color,.csf-field-spacing .csf--color{margin-right:4px;direction:rtl}.csf-field-background .csf--block{float:right}.csf-field-background .csf--media,.csf-field-background .csf--select{padding-right:0}.csf-field-background .csf--title{margin-right:0;margin-left:5px}.csf-field-spinner .csf--spin{float:right;direction:ltr}.csf-field-slider .csf-slider-ui{direction:ltr;margin-right:0;margin-left:15px}.csf-field-slider .csf--input{direction:ltr}.csf-field-button_set .csf--button-group{float:right}.csf-field-link_color .csf--left{float:right;margin-right:0;margin-left:10px}.csf-field-color_group .csf--left{float:right;margin-right:0;margin-left:10px}.csf-field-palette .csf--palette{margin-right:0;margin-left:10px}.csf-field-accordion .csf--icon{margin-right:0;margin-left:2px}.csf-field-date .csf--to{margin-left:0;margin-right:7px}.csf-field-map .csf--map-input:last-child{padding-left:0;padding-right:10px}.csf-field-sortable .csf--sortable-helper{border-left:none;border-right:1px solid #eee}.csf-field-number .csf--wrap{float:right}.csf-taxonomy-add-fields{margin-right:0;margin-left:30px}.csf-taxonomy-add-fields .csf-field>.csf-fieldset>.csf-help{left:-5px;right:auto}.csf-taxonomy-edit-fields{margin-right:0;margin-left:35px}.csf-taxonomy-edit-fields .csf-field>.csf-fieldset>.csf-help{right:auto;left:-5px}.csf-profile-options>h2>.fa{padding-right:0;padding-left:7px}.csf-profile-options>.csf-field>.csf-fieldset>.csf-help{left:-5px;right:auto}.csf-nav-menu-options>.csf-fields{margin-left:0;margin-right:-10px}.csf-nav-menu-title{padding-left:14px;padding-right:12px}.csf-nav-menu-icon{margin-right:0;margin-left:5px}.csf-modal-content .csf-field{padding:15px 15px 15px 30px}.csf-modal-title{padding:0 16px 0 36px}.csf-modal-close{right:auto;left:0}.control-section .csf-field .csf-fieldset{margin-right:0}@media only screen and (max-width:1200px){.csf-metabox .csf-field .csf-fieldset{margin-left:0}}@media only screen and (max-width:782px){.csf .csf-content,.csf .csf-fieldset{margin-right:0}}.csf-field .csf--transparent-slider{margin-left:0;margin-right:2px}.csf-field .csf--transparent-slider .ui-slider-handle{margin:0 -11px}.csf-field .csf--transparent-offset{background-position:center right}.csf-field .csf--transparent-text{right:auto;left:10px}
includes/libs/codestar-framework/assets/css/style.css ADDED
@@ -0,0 +1,4212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * ---------------------------------------------------------
4
+ * CODESTAR FRAMEWORK CSS MAP
5
+ * ---------------------------------------------------------
6
+ *
7
+ * 01. Base
8
+ * 01. 01. Header
9
+ * 01. 02. Sticky
10
+ * 01. 03. Header Buttons
11
+ * 01. 04. Navigation
12
+ * 01. 05. Wrapper
13
+ * 01. 06. Content
14
+ * 01. 07. Section
15
+ * 01. 08. Footer
16
+ * 01. 09. Copyright
17
+ * 01. 10. Show All Options
18
+ * 01. 11. Search Input
19
+ * 01. 12. Metabox
20
+ * 01. 13. Comment Metabox
21
+ * 01. 14. Help Tooltip
22
+ * 02. Themes
23
+ * 02. 01. Theme Dark
24
+ * 02. 02. Theme Light
25
+ * 03. Fields
26
+ * 03. 01. Field
27
+ * 03. 02. Field: accordion
28
+ * 03. 03. Field: background
29
+ * 03. 04. Field: backup
30
+ * 03. 05. Field: border, spacing, dimensions
31
+ * 03. 06. Field: button_set
32
+ * 03. 07. Field: checkbox, radio
33
+ * 03. 08. Field: code_editor
34
+ * 03. 09. Field: color
35
+ * 03. 10. Field: color_group
36
+ * 03. 11. Field: fieldset
37
+ * 03. 12. Field: date
38
+ * 03. 13. Field: gallery
39
+ * 03. 14. Field: group
40
+ * 03. 15. Field: icon
41
+ * 03. 16. Field: image_select
42
+ * 03. 17. Field: link_color
43
+ * 03. 18. Field: map
44
+ * 03. 19. Field: media
45
+ * 03. 20. Field: palette
46
+ * 03. 21. Field: repeater
47
+ * 03. 22. Field: select
48
+ * 03. 23. Field: slider
49
+ * 03. 24. Field: sortable
50
+ * 03. 25. Field: sorter
51
+ * 03. 26. Field: spinner
52
+ * 03. 27. Field: switcher
53
+ * 03. 28. Field: tabbed
54
+ * 03. 29. Field: text
55
+ * 03. 30. Field: textarea
56
+ * 03. 31. Field: typography
57
+ * 03. 32. Field: upload
58
+ * 03. 33. Field: wp_editor
59
+ * 03. 34. Field: heading
60
+ * 03. 35. Field: subheading
61
+ * 03. 36. Field: submessage
62
+ * 03. 37. Field: notice
63
+ * 03. 38. Field: number
64
+ * 03. 39. Field: others
65
+ * 04. Widget
66
+ * 05. Customizer
67
+ * 06. Taxonomy
68
+ * 07. Profile
69
+ * 08. Nav Menu
70
+ * 09. Modal
71
+ * 09. 01. Shortcode Modal
72
+ * 09. 02. Gutenberg Modal
73
+ * 09. 03. Icon Modal
74
+ * 10. Helper
75
+ * 11. Welcome Page
76
+ * 12. Responsive
77
+ * 13. Others
78
+ *
79
+ * ---------------------------------------------------------
80
+ *
81
+ */
82
+ /**
83
+ * 01. Base
84
+ */
85
+ .csf {
86
+ position: relative;
87
+ }
88
+ .csf label {
89
+ padding: 0;
90
+ margin: 0;
91
+ display: inline-block;
92
+ }
93
+
94
+ .csf-ab-icon {
95
+ top: 2px;
96
+ }
97
+
98
+ #screen-meta-links + .csf-options {
99
+ margin-top: 40px;
100
+ }
101
+
102
+ .csf-options {
103
+ margin-top: 20px;
104
+ margin-right: 20px;
105
+ }
106
+
107
+ /**
108
+ * 01. 01. Header
109
+ */
110
+ .csf-header {
111
+ position: relative;
112
+ }
113
+
114
+ .csf-header-inner {
115
+ padding: 25px;
116
+ transition: box-shadow .3s ease;
117
+ }
118
+ .csf-header-inner h1 {
119
+ float: left;
120
+ font-size: 1.5em;
121
+ line-height: 26px;
122
+ font-weight: 400;
123
+ margin: 0;
124
+ }
125
+ .csf-header-inner h1 small {
126
+ font-size: 11px;
127
+ font-weight: 500;
128
+ }
129
+
130
+ /**
131
+ * 01. 02. Sticky
132
+ */
133
+ .csf-sticky .csf-header-inner {
134
+ position: fixed;
135
+ z-index: 99;
136
+ top: 32px;
137
+ -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
138
+ -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
139
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
140
+ }
141
+
142
+ /**
143
+ * 01. 03. Header Buttons
144
+ */
145
+ .csf-buttons {
146
+ float: right;
147
+ -moz-transition: opacity 0.2s;
148
+ -o-transition: opacity 0.2s;
149
+ -webkit-transition: opacity 0.2s;
150
+ transition: opacity 0.2s;
151
+ }
152
+ .csf-buttons .button {
153
+ margin: 0 2px;
154
+ line-height: 26px;
155
+ }
156
+ .csf-buttons .button:focus {
157
+ outline: none !important;
158
+ box-shadow: none !important;
159
+ }
160
+ .csf-buttons .csf-save {
161
+ min-width: 72px;
162
+ }
163
+
164
+ .csf-header-left {
165
+ float: left;
166
+ }
167
+
168
+ .csf-header-right {
169
+ float: right;
170
+ }
171
+
172
+ /**
173
+ * 01. 04. Navigation
174
+ */
175
+ .csf-nav {
176
+ display: block;
177
+ position: relative;
178
+ z-index: 10;
179
+ float: left;
180
+ width: 225px;
181
+ }
182
+ .csf-nav ul {
183
+ clear: left;
184
+ margin: 0;
185
+ list-style-type: none;
186
+ }
187
+ .csf-nav ul li {
188
+ margin-bottom: 0;
189
+ }
190
+ .csf-nav ul li a {
191
+ font-size: 13px;
192
+ position: relative;
193
+ display: block;
194
+ padding: 14px 12px;
195
+ text-decoration: none;
196
+ transition-property: color;
197
+ transition-duration: 0.2s;
198
+ transition-timing-function: ease;
199
+ }
200
+ .csf-nav ul li a:focus {
201
+ outline: none;
202
+ -moz-box-shadow: none;
203
+ -webkit-box-shadow: none;
204
+ box-shadow: none;
205
+ }
206
+ .csf-nav ul li .csf-arrow:after {
207
+ content: "\f054";
208
+ display: inline-block;
209
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
210
+ font-weight: 900;
211
+ font-size: 9px;
212
+ line-height: 1;
213
+ position: absolute;
214
+ right: 10px;
215
+ top: 50%;
216
+ margin-top: -4px;
217
+ -moz-transform: rotate(0);
218
+ -ms-transform: rotate(0);
219
+ -webkit-transform: rotate(0);
220
+ transform: rotate(0);
221
+ }
222
+ .csf-nav ul li.csf-tab-expanded .csf-arrow:after {
223
+ -moz-transform: rotate(90deg);
224
+ -ms-transform: rotate(90deg);
225
+ -webkit-transform: rotate(90deg);
226
+ transform: rotate(90deg);
227
+ }
228
+ .csf-nav ul li.csf-tab-expanded ul {
229
+ display: block;
230
+ }
231
+ .csf-nav ul ul {
232
+ display: none;
233
+ position: relative;
234
+ }
235
+ .csf-nav ul ul li a {
236
+ font-size: 12px;
237
+ padding: 12px 14px 12px 24px;
238
+ }
239
+ .csf-nav .csf-tab-icon {
240
+ width: 20px;
241
+ margin-right: 5px;
242
+ font-size: 13px;
243
+ text-align: center;
244
+ }
245
+ .csf-nav .csf-label-error {
246
+ margin-left: 4px;
247
+ vertical-align: top;
248
+ }
249
+
250
+ .csf-nav-background {
251
+ position: absolute;
252
+ top: 0;
253
+ left: 0;
254
+ bottom: 0;
255
+ z-index: 9;
256
+ width: 225px;
257
+ }
258
+
259
+ /**
260
+ * 01. 05. Wrapper
261
+ */
262
+ .csf-wrapper {
263
+ position: relative;
264
+ }
265
+
266
+ /**
267
+ * 01. 06. Content
268
+ */
269
+ .csf-content {
270
+ position: relative;
271
+ margin-left: 225px;
272
+ background-color: #fff;
273
+ -moz-transition: opacity 0.2s;
274
+ -o-transition: opacity 0.2s;
275
+ -webkit-transition: opacity 0.2s;
276
+ transition: opacity 0.2s;
277
+ }
278
+
279
+ /**
280
+ * 01. 07. Section
281
+ */
282
+ .csf-sections {
283
+ float: left;
284
+ width: 100%;
285
+ }
286
+
287
+ .csf-section {
288
+ display: none;
289
+ }
290
+
291
+ .csf-section-title {
292
+ display: none;
293
+ padding: 20px 30px;
294
+ background-color: #f5f5f5;
295
+ border-top: 1px solid #eee;
296
+ border-bottom: 1px solid #eee;
297
+ }
298
+ .csf-section-title h3 {
299
+ margin: 0;
300
+ padding: 0;
301
+ font-size: 13px;
302
+ font-weight: bold;
303
+ text-transform: uppercase;
304
+ }
305
+ .csf-section-title .csf-section-icon {
306
+ margin-right: 5px;
307
+ }
308
+
309
+ /**
310
+ * 01. 08. Footer
311
+ */
312
+ .csf-footer {
313
+ padding: 20px;
314
+ font-size: 11px;
315
+ }
316
+
317
+ /**
318
+ * 01. 09. Copyright
319
+ */
320
+ .csf-copyright {
321
+ float: left;
322
+ margin-top: 5px;
323
+ }
324
+
325
+ /**
326
+ * 01. 10. Show All Options
327
+ */
328
+ .csf-search-all .csf-nav-background,
329
+ .csf-search-all .csf-nav,
330
+ .csf-show-all .csf-nav-background,
331
+ .csf-show-all .csf-nav {
332
+ display: none;
333
+ }
334
+ .csf-search-all .csf-content,
335
+ .csf-show-all .csf-content {
336
+ margin-left: 0;
337
+ }
338
+ .csf-search-all .csf-section-title,
339
+ .csf-search-all .csf-section,
340
+ .csf-show-all .csf-section-title,
341
+ .csf-show-all .csf-section {
342
+ display: block !important;
343
+ }
344
+
345
+ .csf-search-all .csf-section-title {
346
+ display: none !important;
347
+ }
348
+
349
+ .csf-expand-all {
350
+ float: left;
351
+ padding: 0 8px;
352
+ margin-right: 4px;
353
+ z-index: 1;
354
+ font-size: 13px;
355
+ line-height: 30px;
356
+ cursor: pointer;
357
+ user-select: none;
358
+ -moz-border-radius: 2px;
359
+ -webkit-border-radius: 2px;
360
+ border-radius: 2px;
361
+ -moz-transition: all 0.2s;
362
+ -o-transition: all 0.2s;
363
+ -webkit-transition: all 0.2s;
364
+ transition: all 0.2s;
365
+ }
366
+ .csf-expand-all span {
367
+ font-size: 11px;
368
+ vertical-align: middle;
369
+ }
370
+
371
+ /**
372
+ * 01. 11. Search Input
373
+ */
374
+ .csf-search {
375
+ float: left;
376
+ }
377
+ .csf-search input {
378
+ margin: 0 2px 0 0;
379
+ border: none;
380
+ font-size: 12px;
381
+ line-height: 30px;
382
+ min-height: 30px;
383
+ text-align: inherit;
384
+ padding: 0 10px;
385
+ -moz-border-radius: 2px;
386
+ -webkit-border-radius: 2px;
387
+ border-radius: 2px;
388
+ -moz-box-shadow: none;
389
+ -webkit-box-shadow: none;
390
+ box-shadow: none;
391
+ }
392
+ .csf-search input:focus {
393
+ -moz-box-shadow: none;
394
+ -webkit-box-shadow: none;
395
+ box-shadow: none;
396
+ }
397
+
398
+ .csf-saving .csf-buttons,
399
+ .csf-saving .csf-content {
400
+ cursor: default;
401
+ pointer-events: none;
402
+ opacity: 0.5;
403
+ }
404
+
405
+ /**
406
+ * 01. 12. Metabox
407
+ */
408
+ .csf-metabox {
409
+ margin: -6px -12px -12px -12px;
410
+ }
411
+ .csf-metabox .csf-field {
412
+ padding: 20px;
413
+ }
414
+ .csf-metabox .csf-section-title {
415
+ padding: 20px;
416
+ }
417
+
418
+ .block-editor-page .csf-metabox {
419
+ margin: -6px -14px -14px -14px;
420
+ }
421
+
422
+ .block-editor-editor-skeleton__content .csf-metabox {
423
+ border-left: 1px solid #e2e4e7;
424
+ border-right: 1px solid #e2e4e7;
425
+ }
426
+
427
+ .csf-sections-restore {
428
+ float: left;
429
+ width: 100%;
430
+ position: relative;
431
+ z-index: 1000000;
432
+ text-align: right;
433
+ border-top: 1px solid #eee;
434
+ }
435
+ .csf-sections-restore .csf-button-cancel,
436
+ .csf-sections-restore input {
437
+ display: none;
438
+ }
439
+ .csf-sections-restore label {
440
+ padding: 10px;
441
+ }
442
+ .csf-sections-restore span {
443
+ -webkit-user-select: none;
444
+ user-select: none;
445
+ }
446
+ .csf-sections-restore input:checked ~ .csf-button-restore {
447
+ display: none;
448
+ }
449
+ .csf-sections-restore input:checked ~ .csf-button-cancel {
450
+ display: inline-block;
451
+ }
452
+
453
+ #side-sortables .csf-section-title {
454
+ padding: 12px;
455
+ }
456
+ #side-sortables .csf-field {
457
+ padding: 10px 15px;
458
+ }
459
+ #side-sortables .csf-field .csf-title {
460
+ float: none;
461
+ width: 100%;
462
+ margin-bottom: 6px;
463
+ }
464
+ #side-sortables .csf-field .csf-fieldset {
465
+ float: none;
466
+ width: 100%;
467
+ }
468
+ #side-sortables .csf-field-text input {
469
+ width: 100%;
470
+ }
471
+ #side-sortables .csf-notice {
472
+ padding: 10px 15px;
473
+ }
474
+
475
+ /**
476
+ * 01. 13. Comment Metabox
477
+ */
478
+ .csf-comment-metabox {
479
+ margin: -6px -12px -12px -12px;
480
+ }
481
+ .csf-comment-metabox .csf-field {
482
+ padding: 20px;
483
+ }
484
+ .csf-comment-metabox .csf-section-title {
485
+ padding: 20px;
486
+ }
487
+
488
+ /**
489
+ * 01. 14. Help Tooltip
490
+ */
491
+ .csf-tooltip {
492
+ position: absolute;
493
+ z-index: 5000001;
494
+ font-size: 12px;
495
+ line-height: 1.4;
496
+ text-align: center;
497
+ text-decoration: none;
498
+ padding: 6px 12px;
499
+ max-width: 200px;
500
+ color: #fff;
501
+ background-color: #000;
502
+ background-color: rgba(0, 0, 0, 0.85);
503
+ -moz-border-radius: 4px;
504
+ -webkit-border-radius: 4px;
505
+ border-radius: 4px;
506
+ }
507
+
508
+ /**
509
+ * 02. Themes
510
+ */
511
+ /**
512
+ * 02. 01. Theme Dark
513
+ */
514
+ .csf-theme-dark .csf-header-inner {
515
+ background-color: #050505;
516
+ }
517
+ .csf-theme-dark .csf-header-inner h1 {
518
+ color: #fff;
519
+ }
520
+ .csf-theme-dark .csf-header-inner h1 small {
521
+ color: #555;
522
+ }
523
+ .csf-theme-dark .csf-expand-all {
524
+ color: #999;
525
+ background-color: #222;
526
+ }
527
+ .csf-theme-dark .csf-expand-all:hover {
528
+ color: #fff;
529
+ background-color: #333;
530
+ }
531
+ .csf-theme-dark .csf-search input {
532
+ color: #fff;
533
+ background-color: #222;
534
+ }
535
+ .csf-theme-dark .csf-search:focus {
536
+ background-color: #444;
537
+ }
538
+ .csf-theme-dark .csf-search::-webkit-input-placeholder {
539
+ color: #666;
540
+ }
541
+ .csf-theme-dark .csf-nav ul li a {
542
+ color: #999;
543
+ background-color: #222;
544
+ border-bottom: 1px solid #2f2f2f;
545
+ }
546
+ .csf-theme-dark .csf-nav ul li a:hover {
547
+ color: #fff;
548
+ }
549
+ .csf-theme-dark .csf-nav ul li .csf-active {
550
+ color: #fff;
551
+ background-color: #111;
552
+ }
553
+ .csf-theme-dark .csf-nav ul li .csf-active:after {
554
+ content: " ";
555
+ position: absolute;
556
+ right: 0;
557
+ top: 50%;
558
+ height: 0;
559
+ width: 0;
560
+ pointer-events: none;
561
+ border: solid transparent;
562
+ border-right-color: #fff;
563
+ border-width: 4px;
564
+ margin-top: -4px;
565
+ }
566
+ .csf-theme-dark .csf-nav ul ul li a {
567
+ background-color: #191919;
568
+ border-bottom: 1px solid #2f2f2f;
569
+ }
570
+ .csf-theme-dark .csf-nav ul ul li .csf-active {
571
+ background-color: #101010;
572
+ }
573
+ .csf-theme-dark .csf-nav ul ul:before {
574
+ background-color: rgba(34, 34, 34, 0.75);
575
+ }
576
+ .csf-theme-dark .csf-nav > ul > li:last-child > a {
577
+ border-bottom: none;
578
+ }
579
+ .csf-theme-dark .csf-nav-background {
580
+ background-color: #222;
581
+ }
582
+ .csf-theme-dark .csf-footer {
583
+ color: #555;
584
+ background-color: #050505;
585
+ }
586
+
587
+ /**
588
+ * 02. 02. Theme Light
589
+ */
590
+ .csf-theme-light .csf-container {
591
+ border: 1px solid #ccd0d4;
592
+ -moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.04);
593
+ -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.04);
594
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.04);
595
+ }
596
+ .csf-theme-light .csf-header-inner {
597
+ border-bottom: 1px solid #ccd0d4;
598
+ background-color: #f5f5f5;
599
+ background: linear-gradient(#fefefe, #f5f5f5);
600
+ }
601
+ .csf-theme-light .csf-header-inner h1 small {
602
+ color: #999;
603
+ }
604
+ .csf-theme-light .csf-expand-all {
605
+ color: #999;
606
+ background-color: #eee;
607
+ }
608
+ .csf-theme-light .csf-expand-all:hover {
609
+ color: #555;
610
+ }
611
+ .csf-theme-light .csf-search input {
612
+ color: #555;
613
+ background-color: #eee;
614
+ }
615
+ .csf-theme-light .csf-search input::-webkit-input-placeholder {
616
+ color: #999;
617
+ }
618
+ .csf-theme-light .csf-nav ul li a {
619
+ color: #666;
620
+ background-color: #f5f5f5;
621
+ border-bottom: 1px solid #ccd0d4;
622
+ }
623
+ .csf-theme-light .csf-nav ul li a:hover {
624
+ color: #222;
625
+ }
626
+ .csf-theme-light .csf-nav ul li .csf-active {
627
+ color: #222;
628
+ background-color: #fff;
629
+ }
630
+ .csf-theme-light .csf-nav ul li .csf-active:after {
631
+ content: "";
632
+ position: absolute;
633
+ top: 0;
634
+ bottom: 0;
635
+ right: -1px;
636
+ width: 1px;
637
+ background-color: #fff;
638
+ }
639
+ .csf-theme-light .csf-nav ul ul li a {
640
+ background-color: #eee;
641
+ border-bottom: 1px solid #ccd0d4;
642
+ }
643
+ .csf-theme-light .csf-nav > ul > li:last-child > a {
644
+ border-bottom: none;
645
+ }
646
+ .csf-theme-light .csf-nav-background {
647
+ background-color: #f5f5f5;
648
+ border-right: 1px solid #ccd0d4;
649
+ }
650
+ .csf-theme-light .csf-footer {
651
+ color: #555;
652
+ border-top: 1px solid #ccd0d4;
653
+ background-color: #f5f5f5;
654
+ background: linear-gradient(#fafafa, #f5f5f5);
655
+ }
656
+
657
+ /**
658
+ * 03. Fields
659
+ */
660
+ .csf-field {
661
+ position: relative;
662
+ padding: 30px;
663
+ }
664
+ .csf-field + .csf-field {
665
+ border-top: 1px solid #eee;
666
+ }
667
+ .csf-field p:first-child {
668
+ margin-top: 0;
669
+ }
670
+ .csf-field p:last-child {
671
+ margin-bottom: 0;
672
+ }
673
+ .csf-field:after, .csf-field:before {
674
+ content: " ";
675
+ display: table;
676
+ }
677
+ .csf-field:after {
678
+ clear: both;
679
+ }
680
+ .csf-field h4 {
681
+ margin-top: 0;
682
+ }
683
+ .csf-field .csf-title {
684
+ position: relative;
685
+ width: 20%;
686
+ float: left;
687
+ }
688
+ .csf-field .csf-title h4 {
689
+ margin: 0;
690
+ color: #23282d;
691
+ }
692
+ .csf-field .csf-fieldset {
693
+ float: right;
694
+ width: calc(80% - 20px);
695
+ }
696
+
697
+ .csf-pseudo-field {
698
+ padding: 0 5px 0 0 !important;
699
+ display: inline-block;
700
+ }
701
+ .csf-pseudo-field + .csf-pseudo-field {
702
+ border: 0;
703
+ }
704
+ .csf-pseudo-field pre {
705
+ display: none;
706
+ }
707
+
708
+ /**
709
+ * 03. 02. Field: accordion
710
+ */
711
+ .csf-field-accordion .csf-accordion-item {
712
+ position: relative;
713
+ margin-bottom: 5px;
714
+ }
715
+ .csf-field-accordion .csf-accordion-item:last-child {
716
+ margin-bottom: 0;
717
+ }
718
+ .csf-field-accordion .csf-accordion-item h4 {
719
+ font-size: 1em;
720
+ }
721
+ .csf-field-accordion .csf-accordion-title {
722
+ display: block;
723
+ cursor: pointer;
724
+ position: relative;
725
+ margin: 0;
726
+ padding: 15px;
727
+ min-height: 0;
728
+ font-size: 100%;
729
+ user-select: none;
730
+ border: 1px solid #ccd0d4;
731
+ background-color: #fafafa;
732
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
733
+ transition: border-color .15s;
734
+ }
735
+ .csf-field-accordion .csf-accordion-title:active, .csf-field-accordion .csf-accordion-title:hover, .csf-field-accordion .csf-accordion-title:focus {
736
+ outline: none;
737
+ border-color: #999;
738
+ }
739
+ .csf-field-accordion .csf-accordion-title .csf--icon {
740
+ width: 20px;
741
+ text-align: center;
742
+ margin-right: 2px;
743
+ }
744
+ .csf-field-accordion .csf-accordion-icon {
745
+ width: 16px;
746
+ text-align: center;
747
+ }
748
+ .csf-field-accordion .csf-accordion-content {
749
+ display: none;
750
+ padding: 0;
751
+ border: 1px solid #ccd0d4;
752
+ border-top: none;
753
+ background-color: #fff;
754
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
755
+ }
756
+ .csf-field-accordion .csf-accordion-content > .csf-field {
757
+ padding: 15px;
758
+ }
759
+ .csf-field-accordion .csf-accordion-open {
760
+ display: block;
761
+ }
762
+
763
+ /**
764
+ * 03. 03. Field: background
765
+ */
766
+ .csf-field-background .csf-field {
767
+ border: 0 !important;
768
+ padding: 0;
769
+ margin-bottom: 6px;
770
+ margin-right: 6px;
771
+ }
772
+ .csf-field-background .csf--title {
773
+ color: #777;
774
+ font-size: 12px;
775
+ }
776
+ .csf-field-background .csf--background-colors {
777
+ display: flex;
778
+ flex-wrap: wrap;
779
+ }
780
+ .csf-field-background .csf--background-attributes {
781
+ display: flex;
782
+ flex-wrap: wrap;
783
+ }
784
+ .csf-field-background .csf--background-attributes select {
785
+ min-width: 100%;
786
+ margin: 0;
787
+ }
788
+ .csf-field-background .csf--background-attributes .csf-field {
789
+ flex: 1;
790
+ }
791
+ .csf-field-background .csf--attributes-hidden {
792
+ display: none;
793
+ }
794
+
795
+ /**
796
+ * 03. 04. Field: backup
797
+ */
798
+ .csf-field-backup textarea {
799
+ width: 100%;
800
+ min-height: 200px;
801
+ margin-bottom: 5px;
802
+ }
803
+ .csf-field-backup small {
804
+ display: inline-block;
805
+ margin: 5px;
806
+ }
807
+ .csf-field-backup hr {
808
+ margin: 20px 0;
809
+ border: none;
810
+ border-bottom: 1px solid #e5e5e5;
811
+ }
812
+
813
+ /**
814
+ * 03. 05. Field: border, spacing, dimensions
815
+ */
816
+ .csf-field-border .csf--inputs,
817
+ .csf-field-spacing .csf--inputs,
818
+ .csf-field-dimensions .csf--inputs {
819
+ float: left;
820
+ display: flex;
821
+ flex-wrap: wrap;
822
+ }
823
+ .csf-field-border .csf--input,
824
+ .csf-field-spacing .csf--input,
825
+ .csf-field-dimensions .csf--input {
826
+ display: flex;
827
+ padding-right: 6px;
828
+ padding-bottom: 4px;
829
+ box-sizing: border-box;
830
+ }
831
+ .csf-field-border .csf--input select,
832
+ .csf-field-spacing .csf--input select,
833
+ .csf-field-dimensions .csf--input select {
834
+ margin: 0;
835
+ }
836
+ .csf-field-border .csf--input input,
837
+ .csf-field-spacing .csf--input input,
838
+ .csf-field-dimensions .csf--input input {
839
+ position: relative;
840
+ z-index: 1;
841
+ margin: 0;
842
+ width: 65px;
843
+ max-width: 100%;
844
+ text-align: center;
845
+ }
846
+ .csf-field-border .csf--color,
847
+ .csf-field-spacing .csf--color,
848
+ .csf-field-dimensions .csf--color {
849
+ float: left;
850
+ }
851
+ .csf-field-border .csf--label,
852
+ .csf-field-spacing .csf--label,
853
+ .csf-field-dimensions .csf--label {
854
+ display: flex;
855
+ flex-direction: column;
856
+ justify-content: center;
857
+ user-select: none;
858
+ min-width: 20px;
859
+ max-width: 100%;
860
+ padding: 0 4px;
861
+ font-size: 12px;
862
+ text-align: center;
863
+ color: #555;
864
+ border: 1px solid #7B776C;
865
+ background-color: #f5f5f5;
866
+ }
867
+ .csf-field-border .csf--icon,
868
+ .csf-field-spacing .csf--icon,
869
+ .csf-field-dimensions .csf--icon {
870
+ border-right: 0;
871
+ border-radius: 4px 0 0 4px;
872
+ }
873
+ .csf-field-border .csf--icon + input,
874
+ .csf-field-spacing .csf--icon + input,
875
+ .csf-field-dimensions .csf--icon + input {
876
+ border-top-left-radius: 0;
877
+ border-bottom-left-radius: 0;
878
+ }
879
+ .csf-field-border .csf--unit,
880
+ .csf-field-spacing .csf--unit,
881
+ .csf-field-dimensions .csf--unit {
882
+ border-left: 0;
883
+ border-radius: 0 4px 4px 0;
884
+ }
885
+ .csf-field-border .csf--is-unit,
886
+ .csf-field-spacing .csf--is-unit,
887
+ .csf-field-dimensions .csf--is-unit {
888
+ border-top-right-radius: 0;
889
+ border-bottom-right-radius: 0;
890
+ }
891
+
892
+ /**
893
+ * 03. 06. Field: button_set
894
+ */
895
+ .csf-field-button_set .csf--buttons {
896
+ display: inline-block;
897
+ }
898
+ .csf-field-button_set .csf--button {
899
+ position: relative;
900
+ z-index: 1;
901
+ float: left;
902
+ cursor: pointer;
903
+ padding: 7px 14px;
904
+ min-width: 40px;
905
+ text-align: center;
906
+ color: #555;
907
+ border: 1px solid #cccccc;
908
+ background-color: #f7f7f7;
909
+ user-select: none;
910
+ -webkit-user-select: none;
911
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
912
+ }
913
+ .csf-field-button_set .csf--button:first-child {
914
+ border-radius: 4px 0 0 4px;
915
+ }
916
+ .csf-field-button_set .csf--button:last-child {
917
+ border-radius: 0 4px 4px 0;
918
+ }
919
+ .csf-field-button_set .csf--button:not(:first-child) {
920
+ margin-left: -1px;
921
+ }
922
+ .csf-field-button_set .csf--button:hover {
923
+ background-color: #eee;
924
+ }
925
+ .csf-field-button_set .csf--active:hover,
926
+ .csf-field-button_set .csf--active {
927
+ z-index: 2;
928
+ color: #fff;
929
+ border-color: #006799;
930
+ background-color: #0085ba;
931
+ }
932
+ .csf-field-button_set input {
933
+ display: none;
934
+ }
935
+
936
+ /**
937
+ * 03. 07. Field: checkbox, radio
938
+ */
939
+ .csf-field-checkbox ul,
940
+ .csf-field-radio ul {
941
+ margin: 0;
942
+ padding: 0;
943
+ list-style-type: none;
944
+ overflow-y: auto;
945
+ max-height: 305px;
946
+ }
947
+ .csf-field-checkbox ul li,
948
+ .csf-field-radio ul li {
949
+ margin-bottom: 6px;
950
+ }
951
+ .csf-field-checkbox ul ul,
952
+ .csf-field-radio ul ul {
953
+ max-height: none;
954
+ }
955
+ .csf-field-checkbox ul ul li,
956
+ .csf-field-radio ul ul li {
957
+ margin-left: 8px;
958
+ }
959
+ .csf-field-checkbox ul ul li:first-child,
960
+ .csf-field-radio ul ul li:first-child {
961
+ margin-left: 0;
962
+ }
963
+ .csf-field-checkbox input,
964
+ .csf-field-radio input {
965
+ margin: 0 1px;
966
+ }
967
+ .csf-field-checkbox .csf--inline-list li,
968
+ .csf-field-radio .csf--inline-list li {
969
+ display: inline-block;
970
+ margin-right: 15px;
971
+ }
972
+ .csf-field-checkbox .csf--text,
973
+ .csf-field-radio .csf--text {
974
+ margin-left: 5px;
975
+ vertical-align: middle;
976
+ }
977
+ .csf-field-checkbox .csf-checker,
978
+ .csf-field-radio .csf-checker {
979
+ cursor: pointer;
980
+ }
981
+
982
+ /**
983
+ * 03. 08. Field: code_editor
984
+ */
985
+ .csf-field-code_editor .CodeMirror {
986
+ width: 100%;
987
+ height: 400px;
988
+ }
989
+ .csf-field-code_editor .cm-s-default {
990
+ border: 1px solid #ccd0d4;
991
+ }
992
+ .csf-field-code_editor textarea {
993
+ width: 100%;
994
+ height: 400px;
995
+ }
996
+
997
+ /**
998
+ * 03. 09. Field: color
999
+ */
1000
+ .csf-field-color > input {
1001
+ opacity: 0.75;
1002
+ width: 115px;
1003
+ max-width: 100%;
1004
+ }
1005
+ .csf-field-color .button.wp-picker-clear {
1006
+ padding: 0 8px;
1007
+ margin-left: 6px;
1008
+ line-height: 2.54545455;
1009
+ min-height: 30px;
1010
+ }
1011
+
1012
+ /**
1013
+ * 03. 10. Field: color_group
1014
+ */
1015
+ .csf-field-color_group .csf--left {
1016
+ float: left;
1017
+ margin-right: 10px;
1018
+ margin-bottom: 5px;
1019
+ }
1020
+ .csf-field-color_group .csf--title {
1021
+ color: #999;
1022
+ margin-bottom: 5px;
1023
+ }
1024
+
1025
+ /**
1026
+ * 03. 11. Field: fieldset
1027
+ */
1028
+ .csf-field-fieldset .csf-fieldset-content {
1029
+ border: 1px solid #ccd0d4;
1030
+ background-color: #fff;
1031
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1032
+ }
1033
+ .csf-field-fieldset .csf-fieldset-content > .csf-field {
1034
+ padding: 15px;
1035
+ }
1036
+ .csf-field-fieldset .csf-field-subheading {
1037
+ font-size: 13px;
1038
+ }
1039
+
1040
+ /**
1041
+ * 03. 12. Field: date
1042
+ */
1043
+ .csf-field-date input {
1044
+ margin: 0;
1045
+ }
1046
+ .csf-field-date .csf--to {
1047
+ margin-left: 7px;
1048
+ }
1049
+
1050
+ .csf-datepicker-wrapper {
1051
+ margin-top: 5px;
1052
+ width: auto;
1053
+ background-color: #fff;
1054
+ z-index: 9999999 !important;
1055
+ -moz-box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
1056
+ -webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
1057
+ box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
1058
+ }
1059
+ .csf-datepicker-wrapper * {
1060
+ float: none;
1061
+ margin: 0;
1062
+ padding: 0;
1063
+ font-family: inherit;
1064
+ font-weight: normal;
1065
+ font-style: normal;
1066
+ text-decoration: none;
1067
+ border: 0;
1068
+ border-radius: 0;
1069
+ box-shadow: none;
1070
+ }
1071
+ .csf-datepicker-wrapper .ui-widget-header,
1072
+ .csf-datepicker-wrapper .ui-datepicker-header {
1073
+ color: #fff;
1074
+ background: #00a0d2;
1075
+ }
1076
+ .csf-datepicker-wrapper .ui-datepicker-header .ui-state-hover {
1077
+ cursor: pointer;
1078
+ }
1079
+ .csf-datepicker-wrapper .ui-datepicker-title {
1080
+ font-size: 14px;
1081
+ line-height: 40px;
1082
+ text-align: center;
1083
+ }
1084
+ .csf-datepicker-wrapper .ui-datepicker-prev,
1085
+ .csf-datepicker-wrapper .ui-datepicker-next {
1086
+ position: static;
1087
+ top: auto;
1088
+ left: auto;
1089
+ right: auto;
1090
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1091
+ font-weight: 900;
1092
+ font-size: 12px;
1093
+ text-align: center;
1094
+ width: 41px;
1095
+ height: 40px;
1096
+ line-height: 40px;
1097
+ color: #fff;
1098
+ background-color: rgba(255, 255, 255, 0.1);
1099
+ text-rendering: auto;
1100
+ -webkit-font-smoothing: antialiased;
1101
+ -moz-osx-font-smoothing: grayscale;
1102
+ }
1103
+ .csf-datepicker-wrapper .ui-datepicker-next span,
1104
+ .csf-datepicker-wrapper .ui-datepicker-prev span {
1105
+ display: none;
1106
+ }
1107
+ .csf-datepicker-wrapper .ui-datepicker-prev {
1108
+ float: left;
1109
+ }
1110
+ .csf-datepicker-wrapper .ui-datepicker-next {
1111
+ float: right;
1112
+ }
1113
+ .csf-datepicker-wrapper .ui-datepicker-prev:before {
1114
+ content: '\f053';
1115
+ }
1116
+ .csf-datepicker-wrapper .ui-datepicker-next:before {
1117
+ content: '\f054';
1118
+ }
1119
+ .csf-datepicker-wrapper .ui-datepicker-prev-hover,
1120
+ .csf-datepicker-wrapper .ui-datepicker-next-hover {
1121
+ opacity: 0.75;
1122
+ }
1123
+ .csf-datepicker-wrapper tbody .ui-datepicker-week-col {
1124
+ background-color: #f7f7f7;
1125
+ }
1126
+ .csf-datepicker-wrapper .ui-datepicker-buttonpane {
1127
+ padding: 10px;
1128
+ text-align: center;
1129
+ background-color: #f7f7f7;
1130
+ }
1131
+ .csf-datepicker-wrapper .ui-datepicker-buttonpane button {
1132
+ cursor: pointer;
1133
+ margin: 0 5px;
1134
+ padding: 7px 14px;
1135
+ border: 1px solid #eee;
1136
+ background-color: #fff;
1137
+ }
1138
+ .csf-datepicker-wrapper select {
1139
+ margin: 0 4px;
1140
+ }
1141
+ .csf-datepicker-wrapper select option {
1142
+ color: #555;
1143
+ }
1144
+ .csf-datepicker-wrapper table {
1145
+ font-size: 13px;
1146
+ border-collapse: collapse;
1147
+ width: 100%;
1148
+ }
1149
+ .csf-datepicker-wrapper thead {
1150
+ color: #fff;
1151
+ background: #32373c;
1152
+ }
1153
+ .csf-datepicker-wrapper th {
1154
+ text-align: center;
1155
+ padding: 7px;
1156
+ border: 1px solid #444;
1157
+ }
1158
+ .csf-datepicker-wrapper td {
1159
+ text-align: center;
1160
+ border: 1px solid #f4f4f4;
1161
+ }
1162
+ .csf-datepicker-wrapper td.ui-datepicker-other-month {
1163
+ border: transparent;
1164
+ }
1165
+ .csf-datepicker-wrapper td .ui-state-default {
1166
+ color: #555;
1167
+ width: auto;
1168
+ display: block;
1169
+ padding: 6px 12px;
1170
+ }
1171
+ .csf-datepicker-wrapper td .ui-state-active,
1172
+ .csf-datepicker-wrapper td .ui-state-hover {
1173
+ color: #fff;
1174
+ background-color: #0073aa;
1175
+ }
1176
+ .csf-datepicker-wrapper td.ui-state-disabled .ui-state-default {
1177
+ opacity: 0.5;
1178
+ }
1179
+
1180
+ /**
1181
+ * 03. 13. Field: gallery
1182
+ */
1183
+ .csf-field-gallery input {
1184
+ display: none;
1185
+ }
1186
+ .csf-field-gallery ul {
1187
+ margin: 0;
1188
+ padding: 0;
1189
+ list-style-type: none;
1190
+ }
1191
+ .csf-field-gallery ul li {
1192
+ display: inline-block;
1193
+ position: relative;
1194
+ padding: 4px;
1195
+ margin: 0 5px 10px 0;
1196
+ border: 1px solid #ccc;
1197
+ background-color: #f9f9f9;
1198
+ -moz-border-radius: 2px;
1199
+ -webkit-border-radius: 2px;
1200
+ border-radius: 2px;
1201
+ -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1202
+ -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1203
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1204
+ }
1205
+ .csf-field-gallery ul li img {
1206
+ max-height: 60px;
1207
+ display: inline-block;
1208
+ vertical-align: middle;
1209
+ }
1210
+ .csf-field-gallery .button {
1211
+ margin-right: 5px;
1212
+ margin-bottom: 5px;
1213
+ }
1214
+
1215
+ /**
1216
+ * 03. 14. Field: group
1217
+ */
1218
+ .csf-field-group .csf-cloneable-hidden {
1219
+ display: none !important;
1220
+ }
1221
+ .csf-field-group .csf-cloneable-wrapper {
1222
+ position: relative;
1223
+ }
1224
+ .csf-field-group .csf-cloneable-item {
1225
+ display: none;
1226
+ position: relative;
1227
+ margin-bottom: 5px;
1228
+ }
1229
+ .csf-field-group .csf-cloneable-item h4 {
1230
+ font-size: 1em;
1231
+ }
1232
+ .csf-field-group .ui-accordion .csf-cloneable-item {
1233
+ display: block;
1234
+ }
1235
+ .csf-field-group .csf-cloneable-content {
1236
+ border: 1px solid #ccd0d4;
1237
+ background-color: #fff;
1238
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1239
+ }
1240
+ .csf-field-group .csf-cloneable-content > .csf-field {
1241
+ padding: 15px;
1242
+ }
1243
+ .csf-field-group .csf-cloneable-title {
1244
+ display: block;
1245
+ cursor: pointer;
1246
+ position: relative;
1247
+ user-select: none;
1248
+ margin: 0;
1249
+ padding: 15px 65px 15px 10px;
1250
+ min-height: 0;
1251
+ font-size: 100%;
1252
+ border: 1px solid #ccd0d4;
1253
+ background-color: #fafafa;
1254
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1255
+ transition: border-color .15s;
1256
+ }
1257
+ .csf-field-group .csf-cloneable-title:active, .csf-field-group .csf-cloneable-title:hover, .csf-field-group .csf-cloneable-title:focus {
1258
+ border-color: #999;
1259
+ outline: none;
1260
+ }
1261
+ .csf-field-group .csf-cloneable-helper {
1262
+ position: absolute;
1263
+ top: 12px;
1264
+ right: 10px;
1265
+ z-index: 1;
1266
+ font-size: 14px;
1267
+ line-height: 1em;
1268
+ }
1269
+ .csf-field-group .csf-cloneable-helper i {
1270
+ display: inline-block;
1271
+ cursor: pointer;
1272
+ padding: 5px;
1273
+ color: #999;
1274
+ }
1275
+ .csf-field-group .csf-cloneable-helper i:hover {
1276
+ color: #555;
1277
+ }
1278
+ .csf-field-group .csf-cloneable-content {
1279
+ padding: 0;
1280
+ border-top: 0;
1281
+ }
1282
+ .csf-field-group .csf-cloneable-title-prefix,
1283
+ .csf-field-group .csf-cloneable-title-number {
1284
+ margin-right: 5px;
1285
+ }
1286
+ .csf-field-group .csf-cloneable-alert {
1287
+ display: none;
1288
+ margin-bottom: 5px;
1289
+ padding: 10px 20px;
1290
+ color: #a94442;
1291
+ border: 1px solid #ebccd1;
1292
+ background-color: #f2dede;
1293
+ }
1294
+ .csf-field-group .widget-placeholder {
1295
+ margin-bottom: 10px;
1296
+ border: 1px dashed #f1c40f;
1297
+ background-color: #fffae4;
1298
+ }
1299
+ .csf-field-group .csf-cloneable-header-icon {
1300
+ display: inline-block;
1301
+ text-align: center;
1302
+ font-size: 14px;
1303
+ width: 17px;
1304
+ text-indent: 0;
1305
+ vertical-align: text-top;
1306
+ }
1307
+ .csf-field-group .csf-cloneable-placeholder {
1308
+ background-color: #ddd;
1309
+ margin-top: 4px;
1310
+ width: 100px;
1311
+ height: 10px;
1312
+ font-size: 10px;
1313
+ line-height: 10px;
1314
+ display: inline-block;
1315
+ vertical-align: top;
1316
+ border-radius: 2px;
1317
+ }
1318
+
1319
+ /**
1320
+ * 03. 15. Field: icon
1321
+ */
1322
+ .csf-field-icon input {
1323
+ display: none;
1324
+ }
1325
+ .csf-field-icon .button {
1326
+ margin-right: 5px;
1327
+ }
1328
+ .csf-field-icon .csf-icon-preview i {
1329
+ display: inline-block;
1330
+ font-size: 16px;
1331
+ width: 30px;
1332
+ height: 28px;
1333
+ line-height: 28px;
1334
+ margin-right: 5px;
1335
+ text-align: center;
1336
+ vertical-align: top;
1337
+ color: #555;
1338
+ border: 1px solid #ccc;
1339
+ background-color: #f7f7f7;
1340
+ -moz-border-radius: 3px;
1341
+ -webkit-border-radius: 3px;
1342
+ border-radius: 3px;
1343
+ -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1344
+ -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1345
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
1346
+ -moz-box-sizing: content-box;
1347
+ -webkit-box-sizing: content-box;
1348
+ box-sizing: content-box;
1349
+ }
1350
+
1351
+ /**
1352
+ * 03. 16. Field: image_select
1353
+ */
1354
+ .csf-field-image_select .csf--image {
1355
+ cursor: pointer;
1356
+ position: relative;
1357
+ display: inline-block;
1358
+ max-width: 100%;
1359
+ margin: 0 5px 5px 0;
1360
+ vertical-align: bottom;
1361
+ border: 2px solid transparent;
1362
+ background-color: #fff;
1363
+ user-select: none;
1364
+ -webkit-user-select: none;
1365
+ -moz-transition: all 0.2s;
1366
+ -o-transition: all 0.2s;
1367
+ -webkit-transition: all 0.2s;
1368
+ transition: all 0.2s;
1369
+ }
1370
+ .csf-field-image_select .csf--image:before {
1371
+ position: absolute;
1372
+ top: 0;
1373
+ left: 0;
1374
+ text-align: center;
1375
+ font-size: 10px;
1376
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1377
+ font-weight: 900;
1378
+ content: "\f00c";
1379
+ width: 16px;
1380
+ height: 16px;
1381
+ line-height: 14px;
1382
+ opacity: 0;
1383
+ color: #fff;
1384
+ background-color: #222;
1385
+ transition: opacity .2s;
1386
+ }
1387
+ .csf-field-image_select .csf--active {
1388
+ border-color: #222;
1389
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
1390
+ }
1391
+ .csf-field-image_select .csf--active:before {
1392
+ opacity: 1;
1393
+ }
1394
+ .csf-field-image_select img {
1395
+ vertical-align: top;
1396
+ }
1397
+ .csf-field-image_select input {
1398
+ display: none;
1399
+ }
1400
+
1401
+ /**
1402
+ * 03. 17. Field: link_color
1403
+ */
1404
+ .csf-field-link_color .csf--left {
1405
+ float: left;
1406
+ margin-right: 10px;
1407
+ margin-bottom: 5px;
1408
+ }
1409
+ .csf-field-link_color .csf--title {
1410
+ color: #777;
1411
+ margin-bottom: 5px;
1412
+ }
1413
+
1414
+ /**
1415
+ * 03. 18. Field: map
1416
+ */
1417
+ .csf-field-map input {
1418
+ width: 100%;
1419
+ }
1420
+ .csf-field-map input[type="text"].ui-autocomplete-loading {
1421
+ background-position-x: calc(100% - 5px);
1422
+ }
1423
+ .csf-field-map .csf--map-search + .csf--map-osm-wrap {
1424
+ margin-top: 10px;
1425
+ }
1426
+ .csf-field-map .csf--map-osm-wrap {
1427
+ position: relative;
1428
+ padding: 5px;
1429
+ border: 1px solid #eee;
1430
+ background-color: #fff;
1431
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1432
+ }
1433
+ .csf-field-map .csf--map-osm {
1434
+ position: relative;
1435
+ z-index: 1;
1436
+ min-height: 250px;
1437
+ }
1438
+ .csf-field-map .csf--map-inputs {
1439
+ margin-top: 10px;
1440
+ display: flex;
1441
+ justify-content: space-between;
1442
+ }
1443
+ .csf-field-map .csf--map-input {
1444
+ flex: 1;
1445
+ }
1446
+ .csf-field-map .csf--map-input:last-child {
1447
+ padding-left: 10px;
1448
+ }
1449
+ .csf-field-map label {
1450
+ display: block;
1451
+ color: #777;
1452
+ font-size: 12px;
1453
+ margin: 0 0 2px 0;
1454
+ }
1455
+
1456
+ .csf-map-ui-autocomplate {
1457
+ z-index: 999999;
1458
+ border-radius: 4px;
1459
+ overflow: hidden;
1460
+ }
1461
+
1462
+ /**
1463
+ * 03. 19. Field: media
1464
+ */
1465
+ .csf-field-media .csf--placeholder {
1466
+ display: flex;
1467
+ align-items: flex-start;
1468
+ }
1469
+ .csf-field-media .csf--placeholder input {
1470
+ width: 100%;
1471
+ margin: 0;
1472
+ }
1473
+ .csf-field-media .button {
1474
+ margin-left: 5px;
1475
+ }
1476
+ .csf-field-media .hidden + .button {
1477
+ margin-left: 0;
1478
+ }
1479
+ .csf-field-media .csf--preview {
1480
+ position: relative;
1481
+ }
1482
+ .csf-field-media .csf--preview .fa-times {
1483
+ position: absolute;
1484
+ z-index: 1;
1485
+ right: 4px;
1486
+ top: 4px;
1487
+ font-size: 14px;
1488
+ width: 22px;
1489
+ height: 22px;
1490
+ line-height: 22px;
1491
+ text-align: center;
1492
+ text-decoration: none;
1493
+ color: #fff;
1494
+ background-color: #dd3333;
1495
+ opacity: 0.8;
1496
+ transition: all .2s;
1497
+ }
1498
+ .csf-field-media .csf--preview .fa-times:hover {
1499
+ opacity: 1;
1500
+ }
1501
+ .csf-field-media .csf--preview .fa-times:focus {
1502
+ box-shadow: none;
1503
+ }
1504
+
1505
+ /**
1506
+ * 03. 20. Field: palette
1507
+ */
1508
+ .csf-field-palette .csf--palette {
1509
+ position: relative;
1510
+ display: inline-block;
1511
+ cursor: pointer;
1512
+ border: 2px solid #ddd;
1513
+ margin-right: 10px;
1514
+ margin-bottom: 10px;
1515
+ user-select: none;
1516
+ -webkit-user-select: none;
1517
+ transition: all .2s;
1518
+ }
1519
+ .csf-field-palette .csf--palette span {
1520
+ vertical-align: middle;
1521
+ display: inline-block;
1522
+ width: 22px;
1523
+ height: 60px;
1524
+ line-height: 60px;
1525
+ overflow: hidden;
1526
+ text-indent: -999px;
1527
+ }
1528
+ .csf-field-palette .csf--palette:before {
1529
+ position: absolute;
1530
+ top: 0;
1531
+ left: 0;
1532
+ text-align: center;
1533
+ font-size: 10px;
1534
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1535
+ font-weight: 900;
1536
+ content: "\f00c";
1537
+ width: 16px;
1538
+ height: 16px;
1539
+ line-height: 14px;
1540
+ opacity: 0;
1541
+ color: #fff;
1542
+ background-color: #222;
1543
+ transition: opacity .2s;
1544
+ }
1545
+ .csf-field-palette .csf--active {
1546
+ border-color: #222;
1547
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
1548
+ }
1549
+ .csf-field-palette .csf--active:before {
1550
+ opacity: 1;
1551
+ }
1552
+ .csf-field-palette input {
1553
+ display: none;
1554
+ }
1555
+
1556
+ /**
1557
+ * 03. 21. Field: repeater
1558
+ */
1559
+ .csf-field-repeater .csf-field-text input {
1560
+ width: 100%;
1561
+ }
1562
+ .csf-field-repeater .csf-repeater-hidden {
1563
+ display: none !important;
1564
+ }
1565
+ .csf-field-repeater .csf-repeater-wrapper .csf-repeater-item {
1566
+ display: table;
1567
+ width: 100%;
1568
+ margin-bottom: 5px;
1569
+ border: 1px solid #eee;
1570
+ }
1571
+ .csf-field-repeater .csf-repeater-wrapper .csf-repeater-item h4 {
1572
+ font-size: 1em;
1573
+ }
1574
+ .csf-field-repeater .csf-repeater-content {
1575
+ width: 100%;
1576
+ display: table-cell;
1577
+ vertical-align: middle;
1578
+ background-color: #fff;
1579
+ }
1580
+ .csf-field-repeater .csf-repeater-content > .csf-field {
1581
+ padding: 15px;
1582
+ }
1583
+ .csf-field-repeater .csf-repeater-helper {
1584
+ width: 100%;
1585
+ display: table-cell;
1586
+ vertical-align: middle;
1587
+ text-align: center;
1588
+ font-size: 14px;
1589
+ line-height: 1em;
1590
+ border-left: 1px solid #eee;
1591
+ background-color: #f7f7f7;
1592
+ }
1593
+ .csf-field-repeater .csf-repeater-helper i {
1594
+ display: inline-block;
1595
+ cursor: pointer;
1596
+ color: #999;
1597
+ padding: 5px;
1598
+ }
1599
+ .csf-field-repeater .csf-repeater-helper i:hover {
1600
+ color: #555;
1601
+ }
1602
+ .csf-field-repeater .csf-repeater-helper-inner {
1603
+ width: 75px;
1604
+ }
1605
+ .csf-field-repeater .csf-repeater-alert {
1606
+ display: none;
1607
+ margin-bottom: 5px;
1608
+ padding: 10px 20px;
1609
+ color: #a94442;
1610
+ border: 1px solid #ebccd1;
1611
+ background-color: #f2dede;
1612
+ }
1613
+ .csf-field-repeater .widget-placeholder {
1614
+ height: 50px;
1615
+ margin-bottom: 3px;
1616
+ border: 1px dashed #f1c40f;
1617
+ background-color: #fffae4;
1618
+ }
1619
+ .csf-field-repeater .ui-sortable-helper {
1620
+ height: 50px !important;
1621
+ overflow: hidden !important;
1622
+ border-color: #ccc !important;
1623
+ background-color: #eee !important;
1624
+ opacity: 0.5;
1625
+ }
1626
+ .csf-field-repeater .ui-sortable-helper .csf-repeater-helper,
1627
+ .csf-field-repeater .ui-sortable-helper .csf-repeater-content {
1628
+ display: none;
1629
+ }
1630
+
1631
+ /**
1632
+ * 03. 22. Field: select
1633
+ */
1634
+ .csf-field-select .csf-fieldset {
1635
+ min-height: 30px;
1636
+ }
1637
+ .csf-field-select .csf-chosen {
1638
+ display: none;
1639
+ }
1640
+ .csf-field-select select {
1641
+ max-width: 100%;
1642
+ margin: 0;
1643
+ }
1644
+
1645
+ /**
1646
+ * 03. 23. Field: slider
1647
+ */
1648
+ .csf-field-slider .csf--wrap {
1649
+ display: flex;
1650
+ align-items: center;
1651
+ }
1652
+ .csf-field-slider .csf--input {
1653
+ display: flex;
1654
+ }
1655
+ .csf-field-slider .csf--unit {
1656
+ display: flex;
1657
+ justify-content: center;
1658
+ flex-direction: column;
1659
+ user-select: none;
1660
+ padding: 0 6px;
1661
+ font-size: 11px;
1662
+ line-height: 1;
1663
+ border-radius: 0 4px 4px 0;
1664
+ color: #555;
1665
+ border: 1px solid #7e8993;
1666
+ border-left: 0;
1667
+ background-color: #f5f5f5;
1668
+ }
1669
+ .csf-field-slider .csf-slider-ui {
1670
+ margin-right: 15px;
1671
+ }
1672
+ .csf-field-slider input[type=number] {
1673
+ position: relative;
1674
+ z-index: 1;
1675
+ margin: 0;
1676
+ width: 50px;
1677
+ text-align: center;
1678
+ }
1679
+ .csf-field-slider .csf--is-unit {
1680
+ border-top-right-radius: 0;
1681
+ border-bottom-right-radius: 0;
1682
+ }
1683
+ .csf-field-slider .ui-slider {
1684
+ position: relative;
1685
+ width: 100%;
1686
+ height: 3px;
1687
+ border: none;
1688
+ background: #ddd;
1689
+ border-radius: 2px;
1690
+ }
1691
+ .csf-field-slider .ui-slider-range {
1692
+ height: 3px;
1693
+ border: none;
1694
+ background: #333;
1695
+ border-radius: 2px;
1696
+ }
1697
+ .csf-field-slider .ui-slider-handle {
1698
+ position: absolute;
1699
+ width: 16px;
1700
+ height: 16px;
1701
+ top: -7px;
1702
+ margin-left: -8px;
1703
+ border: none;
1704
+ background: #333;
1705
+ border-radius: 2px;
1706
+ }
1707
+ .csf-field-slider .ui-state-active,
1708
+ .csf-field-slider .ui-slider-handle:hover {
1709
+ cursor: pointer;
1710
+ background: #111;
1711
+ }
1712
+
1713
+ /**
1714
+ * 03. 24. Field: sortable
1715
+ */
1716
+ .csf-field-sortable .csf-field-text input {
1717
+ width: 100%;
1718
+ max-width: 100%;
1719
+ }
1720
+ .csf-field-sortable .csf-sortable .csf-sortable-item {
1721
+ display: table;
1722
+ width: 100%;
1723
+ margin-bottom: 5px;
1724
+ border: 1px solid #eee;
1725
+ }
1726
+ .csf-field-sortable .csf-sortable .csf-sortable-item h4 {
1727
+ font-size: 1em;
1728
+ }
1729
+ .csf-field-sortable .csf-sortable-content {
1730
+ width: 100%;
1731
+ display: table-cell;
1732
+ vertical-align: middle;
1733
+ background-color: #fff;
1734
+ }
1735
+ .csf-field-sortable .csf-sortable-content > .csf-field {
1736
+ padding: 15px;
1737
+ }
1738
+ .csf-field-sortable .csf-sortable-helper {
1739
+ width: 100%;
1740
+ display: table-cell;
1741
+ vertical-align: middle;
1742
+ text-align: center;
1743
+ font-size: 14px;
1744
+ line-height: 1em;
1745
+ border-left: 1px solid #eee;
1746
+ background-color: #f7f7f7;
1747
+ }
1748
+ .csf-field-sortable .csf-sortable-helper i {
1749
+ display: inline-block;
1750
+ cursor: pointer;
1751
+ width: 50px;
1752
+ color: #555;
1753
+ }
1754
+ .csf-field-sortable .csf-sortable-helper i:hover {
1755
+ opacity: 0.5;
1756
+ }
1757
+ .csf-field-sortable .widget-placeholder {
1758
+ height: 50px;
1759
+ margin-bottom: 3px;
1760
+ border: 1px dashed #f1c40f;
1761
+ background-color: #fffae4;
1762
+ }
1763
+ .csf-field-sortable .ui-sortable-helper {
1764
+ height: 50px !important;
1765
+ overflow: hidden !important;
1766
+ border-color: #ccc !important;
1767
+ background-color: #eee !important;
1768
+ opacity: 0.5;
1769
+ }
1770
+ .csf-field-sortable .ui-sortable-helper .csf-sortable-helper,
1771
+ .csf-field-sortable .ui-sortable-helper .csf-sortable-content {
1772
+ display: none;
1773
+ }
1774
+
1775
+ /**
1776
+ * 03. 25. Field: sorter
1777
+ */
1778
+ .csf-field-sorter .ui-sortable-placeholder {
1779
+ height: 20px;
1780
+ border: 1px dashed #f1c40f;
1781
+ background-color: #fffae4;
1782
+ }
1783
+ .csf-field-sorter .csf-modules {
1784
+ float: left;
1785
+ width: 50%;
1786
+ box-sizing: border-box;
1787
+ }
1788
+ .csf-field-sorter .csf-modules:first-child {
1789
+ padding-right: 15px;
1790
+ }
1791
+ .csf-field-sorter .csf-modules:last-child {
1792
+ padding-left: 15px;
1793
+ }
1794
+ .csf-field-sorter .csf-disabled,
1795
+ .csf-field-sorter .csf-enabled {
1796
+ padding: 5px 15px;
1797
+ border: 1px dashed #ddd;
1798
+ background-color: #fff;
1799
+ }
1800
+ .csf-field-sorter .csf-disabled li {
1801
+ -moz-transition: opacity 0.15s;
1802
+ -o-transition: opacity 0.15s;
1803
+ -webkit-transition: opacity 0.15s;
1804
+ transition: opacity 0.15s;
1805
+ opacity: 0.5;
1806
+ }
1807
+ .csf-field-sorter .csf-disabled .ui-sortable-helper {
1808
+ opacity: 1;
1809
+ }
1810
+ .csf-field-sorter .csf-sorter-title {
1811
+ font-size: 13px;
1812
+ font-weight: 600;
1813
+ padding: 10px;
1814
+ text-align: center;
1815
+ border: 1px dashed #ddd;
1816
+ border-bottom: none;
1817
+ background-color: #f8f8f8;
1818
+ text-transform: uppercase;
1819
+ }
1820
+ .csf-field-sorter ul {
1821
+ list-style-type: none;
1822
+ margin: 0;
1823
+ padding: 0;
1824
+ min-height: 62px;
1825
+ }
1826
+ .csf-field-sorter ul li {
1827
+ margin: 10px 0;
1828
+ padding: 10px 15px;
1829
+ cursor: move;
1830
+ font-weight: bold;
1831
+ text-align: center;
1832
+ border: 1px solid #e5e5e5;
1833
+ background-color: #fafafa;
1834
+ -moz-transition: border-color 0.15s;
1835
+ -o-transition: border-color 0.15s;
1836
+ -webkit-transition: border-color 0.15s;
1837
+ transition: border-color 0.15s;
1838
+ }
1839
+ .csf-field-sorter ul li:hover {
1840
+ border-color: #bbb;
1841
+ }
1842
+
1843
+ /**
1844
+ * 03. 26. Field: spinner
1845
+ */
1846
+ .csf-field-spinner .csf--spin {
1847
+ display: flex;
1848
+ }
1849
+ .csf-field-spinner .ui-spinner {
1850
+ display: flex;
1851
+ }
1852
+ .csf-field-spinner .ui-button-text-only {
1853
+ display: flex;
1854
+ flex-direction: column;
1855
+ justify-content: center;
1856
+ text-align: center;
1857
+ min-width: 20px;
1858
+ padding: 0 4px;
1859
+ color: #555;
1860
+ border: 1px solid #7e8993;
1861
+ background-color: #f5f5f5;
1862
+ }
1863
+ .csf-field-spinner .ui-button {
1864
+ cursor: pointer;
1865
+ }
1866
+ .csf-field-spinner .ui-button:hover {
1867
+ background-color: #e7e7e7;
1868
+ }
1869
+ .csf-field-spinner .ui-button:active {
1870
+ background-color: #ddd;
1871
+ }
1872
+ .csf-field-spinner .ui-button:before {
1873
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1874
+ font-weight: 900;
1875
+ font-size: 14px;
1876
+ line-height: 14px;
1877
+ }
1878
+ .csf-field-spinner .ui-spinner-down {
1879
+ order: 1;
1880
+ border-right: 0;
1881
+ border-radius: 4px 0 0 4px;
1882
+ }
1883
+ .csf-field-spinner .ui-spinner-down:before {
1884
+ content: "\f0d9";
1885
+ }
1886
+ .csf-field-spinner .ui-spinner-input {
1887
+ order: 2;
1888
+ }
1889
+ .csf-field-spinner .csf--unit {
1890
+ order: 3;
1891
+ border-left: 0;
1892
+ user-select: none;
1893
+ }
1894
+ .csf-field-spinner .ui-spinner-up {
1895
+ order: 4;
1896
+ border-left: 0;
1897
+ border-radius: 0 4px 4px 0;
1898
+ }
1899
+ .csf-field-spinner .ui-spinner-up:before {
1900
+ content: "\f0da";
1901
+ }
1902
+ .csf-field-spinner input {
1903
+ position: relative;
1904
+ z-index: 1;
1905
+ width: 50px;
1906
+ text-align: center;
1907
+ margin: 0;
1908
+ padding: 0 8px;
1909
+ border-radius: 0;
1910
+ }
1911
+ .csf-field-spinner .ui-button-text {
1912
+ display: none;
1913
+ }
1914
+
1915
+ /**
1916
+ * 03. 27. Field: switcher
1917
+ */
1918
+ .csf-field-switcher .csf--switcher {
1919
+ float: left;
1920
+ cursor: pointer;
1921
+ position: relative;
1922
+ width: 60px;
1923
+ height: 26px;
1924
+ padding: 0;
1925
+ margin: 0;
1926
+ overflow: hidden;
1927
+ border-radius: 4px;
1928
+ background-color: #ed6f6f;
1929
+ user-select: none;
1930
+ -webkit-user-select: none;
1931
+ }
1932
+ .csf-field-switcher .csf--ball {
1933
+ position: absolute;
1934
+ top: 4px;
1935
+ left: 4px;
1936
+ width: 24px;
1937
+ height: 18px;
1938
+ background-color: #fff;
1939
+ border-radius: 4px;
1940
+ transition: all .1s;
1941
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15);
1942
+ }
1943
+ .csf-field-switcher .csf--on,
1944
+ .csf-field-switcher .csf--off {
1945
+ position: absolute;
1946
+ top: 0;
1947
+ left: 0;
1948
+ right: 0;
1949
+ font-size: 11px;
1950
+ line-height: 26px;
1951
+ font-weight: 500;
1952
+ font-style: normal;
1953
+ text-align: center;
1954
+ text-transform: uppercase;
1955
+ color: #fff;
1956
+ padding-right: 28px;
1957
+ opacity: 0;
1958
+ transition: all .1s;
1959
+ }
1960
+ .csf-field-switcher .csf--off {
1961
+ padding-right: 0;
1962
+ padding-left: 28px;
1963
+ opacity: 1;
1964
+ }
1965
+ .csf-field-switcher .csf--active {
1966
+ background: #4fb845;
1967
+ }
1968
+ .csf-field-switcher .csf--active .csf--on {
1969
+ opacity: 1;
1970
+ }
1971
+ .csf-field-switcher .csf--active .csf--off {
1972
+ opacity: 0;
1973
+ }
1974
+ .csf-field-switcher .csf--active .csf--ball {
1975
+ left: 100%;
1976
+ margin-left: -28px;
1977
+ }
1978
+ .csf-field-switcher .csf--label {
1979
+ float: left;
1980
+ margin-top: 4px;
1981
+ margin-left: 8px;
1982
+ font-weight: 400;
1983
+ color: #999;
1984
+ }
1985
+ .csf-field-switcher input {
1986
+ display: none;
1987
+ }
1988
+
1989
+ /**
1990
+ * 03. 28. Field: tabbed
1991
+ */
1992
+ .csf-field-tabbed .csf-tabbed-content {
1993
+ border: 1px solid #ccd0d4;
1994
+ background-color: #fff;
1995
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1996
+ }
1997
+ .csf-field-tabbed .csf-tabbed-content > .csf-field {
1998
+ padding: 15px;
1999
+ }
2000
+ .csf-field-tabbed .csf-tabbed-nav .csf--icon {
2001
+ padding-right: 5px;
2002
+ }
2003
+ .csf-field-tabbed .csf-tabbed-nav a {
2004
+ display: inline-block;
2005
+ padding: 12px 15px;
2006
+ margin-top: 1px;
2007
+ margin-right: 5px;
2008
+ margin-bottom: -1px;
2009
+ position: relative;
2010
+ text-decoration: none;
2011
+ color: #444;
2012
+ font-weight: 600;
2013
+ border: 1px solid #ccd0d4;
2014
+ background-color: #f3f3f3;
2015
+ transition: all .2s;
2016
+ }
2017
+ .csf-field-tabbed .csf-tabbed-nav a:hover {
2018
+ background-color: #f9f9f9;
2019
+ }
2020
+ .csf-field-tabbed .csf-tabbed-nav a.csf-tabbed-active {
2021
+ background-color: #fff;
2022
+ border-bottom-color: #fff;
2023
+ }
2024
+ .csf-field-tabbed .csf-tabbed-nav a:focus {
2025
+ outline: none;
2026
+ -moz-box-shadow: none;
2027
+ -webkit-box-shadow: none;
2028
+ box-shadow: none;
2029
+ }
2030
+
2031
+ /**
2032
+ * 03. 29. Field: text
2033
+ */
2034
+ .csf-field-text input {
2035
+ width: 50%;
2036
+ max-width: 100%;
2037
+ margin: 0;
2038
+ }
2039
+
2040
+ /**
2041
+ * 03. 30. Field: textarea
2042
+ */
2043
+ .csf-field-textarea textarea {
2044
+ width: 100%;
2045
+ max-width: 100%;
2046
+ min-height: 125px;
2047
+ }
2048
+ .csf-field-textarea .csf-shortcode-button {
2049
+ margin-bottom: 10px;
2050
+ margin-right: 5px;
2051
+ }
2052
+
2053
+ /**
2054
+ * 03. 31. Field: typography
2055
+ */
2056
+ .csf-field-typography textarea,
2057
+ .csf-field-typography select {
2058
+ min-width: 100%;
2059
+ margin: 0;
2060
+ }
2061
+ .csf-field-typography .csf--title {
2062
+ color: #777;
2063
+ margin: 0 0 2px 0;
2064
+ font-size: 12px;
2065
+ }
2066
+ .csf-field-typography .csf--title small {
2067
+ vertical-align: top;
2068
+ }
2069
+ .csf-field-typography .csf--blocks {
2070
+ display: flex;
2071
+ flex-wrap: wrap;
2072
+ }
2073
+ .csf-field-typography .csf--block {
2074
+ flex: 1;
2075
+ padding-right: 6px;
2076
+ padding-bottom: 6px;
2077
+ }
2078
+ .csf-field-typography .csf--input {
2079
+ margin: 0;
2080
+ min-width: 100%;
2081
+ }
2082
+ .csf-field-typography .csf--input-wrap {
2083
+ position: relative;
2084
+ }
2085
+ .csf-field-typography .csf--unit {
2086
+ position: absolute;
2087
+ z-index: 1;
2088
+ right: 4px;
2089
+ top: 4px;
2090
+ bottom: 4px;
2091
+ padding: 2px 6px;
2092
+ color: #666;
2093
+ font-size: 11px;
2094
+ line-height: 1;
2095
+ border-radius: 2px;
2096
+ background: #eee;
2097
+ user-select: none;
2098
+ display: flex;
2099
+ justify-content: center;
2100
+ flex-direction: column;
2101
+ }
2102
+ .csf-field-typography .csf--preview {
2103
+ font-size: 16px;
2104
+ line-height: 20px;
2105
+ padding: 20px;
2106
+ color: #222;
2107
+ border: 1px solid #eee;
2108
+ background-color: #fff;
2109
+ border-radius: 2.5px;
2110
+ user-select: none;
2111
+ -webkit-user-select: none;
2112
+ transition: background-color .2s, border-color .2s;
2113
+ }
2114
+ .csf-field-typography .csf--block-preview {
2115
+ cursor: pointer;
2116
+ position: relative;
2117
+ overflow: hidden;
2118
+ margin-top: 10px;
2119
+ max-width: 100%;
2120
+ }
2121
+ .csf-field-typography .csf--black-background {
2122
+ border-color: #000;
2123
+ background-color: #000;
2124
+ }
2125
+ .csf-field-typography .csf--toggle {
2126
+ position: absolute;
2127
+ top: 5px;
2128
+ right: 10px;
2129
+ color: #999;
2130
+ }
2131
+ .csf-field-typography .csf--block-extra-styles {
2132
+ margin-top: 5px;
2133
+ }
2134
+
2135
+ /**
2136
+ * 03. 32. Field: upload
2137
+ */
2138
+ .csf-field-upload input {
2139
+ width: 100%;
2140
+ margin: 0;
2141
+ }
2142
+ .csf-field-upload .csf--wrap {
2143
+ display: flex;
2144
+ align-items: flex-start;
2145
+ }
2146
+ .csf-field-upload .button {
2147
+ margin-left: 5px;
2148
+ }
2149
+
2150
+ /**
2151
+ * 03. 33. Field: wp_editor
2152
+ */
2153
+ .csf-field-wp_editor .csf-wp-editor {
2154
+ float: left;
2155
+ width: 100%;
2156
+ }
2157
+ .csf-field-wp_editor .mce-toolbar-grp {
2158
+ border: none;
2159
+ }
2160
+ .csf-field-wp_editor .mce-btn.mce-active button,
2161
+ .csf-field-wp_editor .mce-btn.mce-active:hover button,
2162
+ .csf-field-wp_editor .mce-btn.mce-active i,
2163
+ .csf-field-wp_editor .mce-btn.mce-active:hover i {
2164
+ color: #23282d;
2165
+ }
2166
+ .csf-field-wp_editor .wp-media-buttons {
2167
+ position: relative;
2168
+ z-index: 2;
2169
+ }
2170
+ .csf-field-wp_editor .wp-editor-tabs {
2171
+ position: relative;
2172
+ z-index: 1;
2173
+ }
2174
+ .csf-field-wp_editor .csf-no-tinymce {
2175
+ border: 1px solid #e5e5e5;
2176
+ }
2177
+ .csf-field-wp_editor .csf-no-quicktags .wp-media-buttons {
2178
+ float: none;
2179
+ display: block;
2180
+ }
2181
+ .csf-field-wp_editor .csf-no-quicktags .mce-tinymce {
2182
+ box-shadow: none;
2183
+ border: 1px solid #e5e5e5;
2184
+ }
2185
+ .csf-field-wp_editor textarea {
2186
+ width: 100%;
2187
+ max-width: 100%;
2188
+ margin: 0;
2189
+ box-shadow: none;
2190
+ }
2191
+
2192
+ /**
2193
+ * 03. 34. Field: heading
2194
+ */
2195
+ .csf-field-heading {
2196
+ font-size: 1.5em;
2197
+ font-weight: bold;
2198
+ color: #23282d;
2199
+ background-color: #f5f5f5;
2200
+ }
2201
+
2202
+ /**
2203
+ * 03. 35. Field: subheading
2204
+ */
2205
+ .csf-field-subheading {
2206
+ font-size: 14px;
2207
+ font-weight: bold;
2208
+ padding-top: 17px;
2209
+ padding-bottom: 17px;
2210
+ color: #23282d;
2211
+ background-color: #f7f7f7;
2212
+ }
2213
+
2214
+ /**
2215
+ * 03. 36. Field: submessage
2216
+ */
2217
+ .csf-field-submessage {
2218
+ padding: 0 !important;
2219
+ border: 0 !important;
2220
+ }
2221
+ .csf-field-submessage + .csf-field {
2222
+ border-top: 0 !important;
2223
+ }
2224
+
2225
+ .csf-submessage {
2226
+ font-size: 12px;
2227
+ padding: 17px 30px;
2228
+ border-top: 1px solid transparent;
2229
+ border-bottom: 1px solid transparent;
2230
+ }
2231
+
2232
+ .csf-submessage-success {
2233
+ color: #3c763d;
2234
+ border-color: #d6e9c6;
2235
+ background-color: #dff0d8;
2236
+ }
2237
+
2238
+ .csf-submessage-info {
2239
+ color: #31708f;
2240
+ border-color: #bce8f1;
2241
+ background-color: #d9edf7;
2242
+ }
2243
+
2244
+ .csf-submessage-warning {
2245
+ color: #8a6d3b;
2246
+ border-color: #faebcc;
2247
+ background-color: #fcf8e3;
2248
+ }
2249
+
2250
+ .csf-submessage-danger {
2251
+ color: #a94442;
2252
+ border-color: #ebccd1;
2253
+ background-color: #f2dede;
2254
+ }
2255
+
2256
+ .csf-submessage-normal {
2257
+ color: #23282d;
2258
+ border-color: #eee;
2259
+ background-color: #f7f7f7;
2260
+ }
2261
+
2262
+ /**
2263
+ * 03. 37. Field: notice
2264
+ */
2265
+ .csf-field-notice {
2266
+ background-color: #f7f7f7;
2267
+ }
2268
+
2269
+ .csf-notice {
2270
+ padding: 12px;
2271
+ background-color: #fff;
2272
+ border-left-style: solid;
2273
+ border-left-width: 4px;
2274
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
2275
+ }
2276
+
2277
+ .csf-notice-success {
2278
+ border-color: #46b450;
2279
+ }
2280
+
2281
+ .csf-notice-info {
2282
+ border-color: #339fd4;
2283
+ }
2284
+
2285
+ .csf-notice-warning {
2286
+ border-color: #ffbc00;
2287
+ }
2288
+
2289
+ .csf-notice-danger {
2290
+ border-color: #dc3232;
2291
+ }
2292
+
2293
+ .csf-notice-normal {
2294
+ border-color: #222;
2295
+ }
2296
+
2297
+ /**
2298
+ * 03. 38. Field: number
2299
+ */
2300
+ .csf-field-number input {
2301
+ width: 100%;
2302
+ margin: 0;
2303
+ }
2304
+ .csf-field-number .csf--wrap {
2305
+ position: relative;
2306
+ float: left;
2307
+ width: 100px;
2308
+ }
2309
+ .csf-field-number .csf--unit {
2310
+ position: absolute;
2311
+ z-index: 1;
2312
+ right: 4px;
2313
+ top: 4px;
2314
+ bottom: 4px;
2315
+ padding: 2px 6px;
2316
+ color: #666;
2317
+ font-size: 11px;
2318
+ line-height: 1;
2319
+ border-radius: 2px;
2320
+ background: #eee;
2321
+ user-select: none;
2322
+ display: flex;
2323
+ justify-content: center;
2324
+ flex-direction: column;
2325
+ }
2326
+
2327
+ /**
2328
+ * 03. 39. others
2329
+ */
2330
+ .csf-help {
2331
+ cursor: help;
2332
+ position: absolute;
2333
+ top: 0;
2334
+ right: 0;
2335
+ padding: 5px;
2336
+ font-size: 13px;
2337
+ color: #aaa;
2338
+ }
2339
+ .csf-help .csf-help-text {
2340
+ display: none;
2341
+ }
2342
+
2343
+ .csf-image-preview {
2344
+ display: inline-block;
2345
+ position: relative;
2346
+ padding: 4px;
2347
+ min-width: 44px;
2348
+ min-height: 22px;
2349
+ margin-bottom: 10px;
2350
+ border: 1px solid #ccc;
2351
+ background-color: #f9f9f9;
2352
+ -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
2353
+ -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
2354
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
2355
+ }
2356
+ .csf-image-preview img {
2357
+ max-height: 90px;
2358
+ display: inline-block;
2359
+ vertical-align: middle;
2360
+ }
2361
+
2362
+ .csf-field-custom .csf-field {
2363
+ padding: 0;
2364
+ }
2365
+
2366
+ .csf-field .chosen-container-single .chosen-single {
2367
+ height: 28px;
2368
+ line-height: 26px;
2369
+ }
2370
+ .csf-field .chosen-container-single .chosen-single abbr {
2371
+ top: 0;
2372
+ right: 20px;
2373
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2374
+ font-weight: 900;
2375
+ font-size: 12px;
2376
+ height: 100%;
2377
+ width: 18px;
2378
+ color: #aaa;
2379
+ text-align: center;
2380
+ background: none;
2381
+ }
2382
+ .csf-field .chosen-container-single .chosen-single abbr:before {
2383
+ content: "\f00d";
2384
+ }
2385
+ .csf-field .chosen-container-single .chosen-single abbr:hover {
2386
+ color: #555;
2387
+ }
2388
+ .csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
2389
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2390
+ font-weight: 900;
2391
+ font-size: 12px;
2392
+ height: 100%;
2393
+ width: 18px;
2394
+ color: #aaa;
2395
+ text-align: center;
2396
+ background: none;
2397
+ }
2398
+ .csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before {
2399
+ content: "\f00d";
2400
+ display: inline-block;
2401
+ padding-top: 3px;
2402
+ }
2403
+ .csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
2404
+ color: #555;
2405
+ }
2406
+ .csf-field .chosen-container-single .chosen-single div b {
2407
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2408
+ font-weight: 900;
2409
+ font-size: 14px;
2410
+ color: #aaa;
2411
+ background: none;
2412
+ }
2413
+ .csf-field .chosen-container-single .chosen-single div b:before {
2414
+ content: "\f107";
2415
+ }
2416
+ .csf-field .chosen-container-single .chosen-single div b:hover {
2417
+ color: #555;
2418
+ }
2419
+ .csf-field .chosen-container-multi .chosen-choices li.search-choice-placeholder {
2420
+ border: 1px dashed #aaa;
2421
+ margin: 3px 5px 3px 0;
2422
+ }
2423
+ .csf-field .chosen-container-multi .ui-sortable li.search-choice span {
2424
+ cursor: move;
2425
+ }
2426
+ .csf-field .chosen-container-active.chosen-with-drop .chosen-single div b:before {
2427
+ content: "\f106";
2428
+ }
2429
+ .csf-field .chosen-container-single .chosen-single-with-deselect span {
2430
+ margin-right: 40px;
2431
+ }
2432
+ .csf-field .chosen-container-single .chosen-search input[type="text"] {
2433
+ background: none;
2434
+ }
2435
+ .csf-field .chosen-container-single .chosen-search:before {
2436
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2437
+ font-weight: 900;
2438
+ font-size: 11px;
2439
+ content: "\f002";
2440
+ position: absolute;
2441
+ right: 12px;
2442
+ top: 10px;
2443
+ color: #aaa;
2444
+ }
2445
+ .csf-field .wp-picker-container {
2446
+ display: inline-block;
2447
+ }
2448
+ .csf-field .wp-picker-container .wp-color-result.button {
2449
+ margin-bottom: 0;
2450
+ }
2451
+ .csf-field .csf--transparent-wrap {
2452
+ display: none;
2453
+ position: relative;
2454
+ top: -1px;
2455
+ width: 235px;
2456
+ padding: 9px 10px;
2457
+ border: 1px solid #dfdfdf;
2458
+ border-top: none;
2459
+ background-color: #fff;
2460
+ }
2461
+ .csf-field .wp-picker-active .csf--transparent-wrap {
2462
+ display: block;
2463
+ }
2464
+ .csf-field .csf--transparent-slider {
2465
+ position: absolute;
2466
+ width: 190px;
2467
+ margin-left: 2px;
2468
+ height: 18px;
2469
+ }
2470
+ .csf-field .csf--transparent-slider .ui-slider-handle {
2471
+ position: absolute;
2472
+ top: -3px;
2473
+ bottom: -3px;
2474
+ z-index: 5;
2475
+ border-color: #aaa;
2476
+ border-style: solid;
2477
+ border-width: 4px 3px;
2478
+ width: 10px;
2479
+ height: 16px;
2480
+ margin: 0 -5px;
2481
+ background: none;
2482
+ cursor: ew-resize;
2483
+ opacity: 0.9;
2484
+ -moz-border-radius: 4px;
2485
+ -webkit-border-radius: 4px;
2486
+ border-radius: 4px;
2487
+ -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
2488
+ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
2489
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
2490
+ }
2491
+ .csf-field .csf--transparent-slider .ui-slider-handle:before {
2492
+ content: " ";
2493
+ position: absolute;
2494
+ left: -2px;
2495
+ right: -2px;
2496
+ top: -3px;
2497
+ bottom: -3px;
2498
+ border: 2px solid #fff;
2499
+ -moz-border-radius: 3px;
2500
+ -webkit-border-radius: 3px;
2501
+ border-radius: 3px;
2502
+ }
2503
+ .csf-field .csf--transparent-offset {
2504
+ height: 18px;
2505
+ width: 200px;
2506
+ background: url(../images/checkerboard.png) repeat-y center left scroll #fff;
2507
+ -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.4) inset;
2508
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.4) inset;
2509
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.4) inset;
2510
+ -moz-border-radius: 2px;
2511
+ -webkit-border-radius: 2px;
2512
+ border-radius: 2px;
2513
+ }
2514
+ .csf-field .csf--transparent-text {
2515
+ position: absolute;
2516
+ top: 12px;
2517
+ right: 10px;
2518
+ width: 30px;
2519
+ font-size: 12px;
2520
+ line-height: 12px;
2521
+ text-align: center;
2522
+ color: #999;
2523
+ }
2524
+ .csf-field .csf--transparent-button {
2525
+ cursor: pointer;
2526
+ user-select: none;
2527
+ margin-top: 10px;
2528
+ font-size: 11px;
2529
+ text-align: center;
2530
+ border-radius: 2px;
2531
+ padding: 3px 7px;
2532
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
2533
+ letter-spacing: 0.2px;
2534
+ color: #777;
2535
+ border: 1px solid #ccc;
2536
+ background-color: #f7f7f7;
2537
+ transition: background-color .2s, border-color .2s, color .2s;
2538
+ }
2539
+ .csf-field .csf--transparent-active .wp-color-result {
2540
+ background-image: url(../images/checkerboard.png);
2541
+ background-size: 135px;
2542
+ background-position: center left;
2543
+ background-color: transparent !important;
2544
+ }
2545
+ .csf-field .csf--transparent-active .csf--transparent-button {
2546
+ color: #fff;
2547
+ border-color: #3ea032;
2548
+ background-color: #4fb845;
2549
+ }
2550
+ .csf-field .csf--transparent-active .fa:before {
2551
+ content: "\f205";
2552
+ }
2553
+
2554
+ /**
2555
+ * 04. Widget
2556
+ */
2557
+ .csf-widgets > .csf-field {
2558
+ position: relative;
2559
+ top: -1px;
2560
+ margin-right: -15px;
2561
+ margin-left: -15px;
2562
+ padding: 12px 15px;
2563
+ }
2564
+ .csf-widgets > .csf-field .csf-field {
2565
+ margin-left: 0;
2566
+ margin-right: 0;
2567
+ }
2568
+ .csf-widgets > .csf-field .csf-title {
2569
+ float: none;
2570
+ width: 100%;
2571
+ margin-bottom: 5px;
2572
+ }
2573
+ .csf-widgets > .csf-field .csf-fieldset {
2574
+ float: none;
2575
+ width: 100%;
2576
+ }
2577
+ .csf-widgets .csf-field-text input {
2578
+ width: 100%;
2579
+ }
2580
+ .csf-widgets .csf-field-notice .csf-notice {
2581
+ padding: 15px;
2582
+ }
2583
+
2584
+ .control-section .csf-widgets > .csf-field {
2585
+ margin-right: -10px;
2586
+ margin-left: -10px;
2587
+ padding: 10px 12px;
2588
+ }
2589
+
2590
+ /**
2591
+ * 05. Widget
2592
+ */
2593
+ .control-section .csf-field {
2594
+ padding: 0;
2595
+ }
2596
+ .control-section .csf-field .csf-title {
2597
+ float: none;
2598
+ width: 100%;
2599
+ margin-bottom: 6px;
2600
+ }
2601
+ .control-section .csf-field .csf-title h4 {
2602
+ display: block;
2603
+ font-size: 13px;
2604
+ line-height: 1;
2605
+ font-weight: 600;
2606
+ color: inherit;
2607
+ }
2608
+ .control-section .csf-field .csf-fieldset {
2609
+ float: none;
2610
+ width: 100%;
2611
+ }
2612
+ .control-section .csf-help {
2613
+ top: -5px;
2614
+ right: -5px;
2615
+ }
2616
+ .control-section .csf-field-select select {
2617
+ width: 100%;
2618
+ }
2619
+ .control-section .csf-field-heading {
2620
+ color: inherit;
2621
+ font-size: 14px;
2622
+ line-height: 1em;
2623
+ margin-right: -15px;
2624
+ margin-left: -15px;
2625
+ padding: 15px;
2626
+ }
2627
+ .control-section .csf-field-subheading {
2628
+ color: inherit;
2629
+ font-size: 11px;
2630
+ margin-right: -15px;
2631
+ margin-left: -15px;
2632
+ padding: 10px 15px;
2633
+ }
2634
+ .control-section .csf-subtitle-text {
2635
+ margin-top: 4px;
2636
+ font-size: 12px;
2637
+ }
2638
+ .control-section .csf-field-submessage .csf-submessage {
2639
+ margin-right: -15px;
2640
+ margin-left: -15px;
2641
+ padding: 15px;
2642
+ }
2643
+ .control-section .csf-fieldset .csf-field-submessage .csf-submessage,
2644
+ .control-section .csf-fieldset .csf-field-heading,
2645
+ .control-section .csf-fieldset .csf-field-subheading {
2646
+ margin-left: 0;
2647
+ margin-right: 0;
2648
+ }
2649
+ .control-section .csf-field-date .csf--to {
2650
+ margin-left: 0;
2651
+ }
2652
+ .control-section .csf-field-sorter ul li {
2653
+ padding: 5px;
2654
+ }
2655
+ .control-section .csf-field-sorter .csf-modules {
2656
+ float: none;
2657
+ width: 100%;
2658
+ }
2659
+ .control-section .csf-field-sorter .csf-modules:first-child {
2660
+ padding-right: 0;
2661
+ padding-bottom: 15px;
2662
+ }
2663
+ .control-section .csf-field-background .csf--background-attributes {
2664
+ flex-direction: column;
2665
+ }
2666
+ .control-section .csf-field-spacing input {
2667
+ width: 90px;
2668
+ }
2669
+ .control-section .csf-field-border .csf--input {
2670
+ flex: 1 50%;
2671
+ }
2672
+ .control-section .csf-field-border input,
2673
+ .control-section .csf-field-border select {
2674
+ width: 100%;
2675
+ }
2676
+ .control-section .csf-field-spinner input {
2677
+ width: 50px;
2678
+ }
2679
+ .control-section .csf-field-number .csf--wrap {
2680
+ width: 100%;
2681
+ }
2682
+ .control-section .csf-field-backup .csf-export-data {
2683
+ display: none;
2684
+ }
2685
+ .control-section .csf-field-fieldset .csf-fieldset-content {
2686
+ border-color: #e5e5e5;
2687
+ }
2688
+ .control-section .csf-tabbed-content > .csf-field,
2689
+ .control-section .csf-sortable-content > .csf-field,
2690
+ .control-section .csf-repeater-content > .csf-field,
2691
+ .control-section .csf-fieldset-content > .csf-field,
2692
+ .control-section .csf-cloneable-content > .csf-field,
2693
+ .control-section .csf-accordion-content > .csf-field {
2694
+ padding: 10px;
2695
+ }
2696
+ .control-section .csf-tabbed-content > .csf-field .csf-title,
2697
+ .control-section .csf-sortable-content > .csf-field .csf-title,
2698
+ .control-section .csf-repeater-content > .csf-field .csf-title,
2699
+ .control-section .csf-fieldset-content > .csf-field .csf-title,
2700
+ .control-section .csf-cloneable-content > .csf-field .csf-title,
2701
+ .control-section .csf-accordion-content > .csf-field .csf-title {
2702
+ margin-bottom: 5px;
2703
+ }
2704
+ .control-section .csf-tabbed-content > .csf-field h4,
2705
+ .control-section .csf-sortable-content > .csf-field h4,
2706
+ .control-section .csf-repeater-content > .csf-field h4,
2707
+ .control-section .csf-fieldset-content > .csf-field h4,
2708
+ .control-section .csf-cloneable-content > .csf-field h4,
2709
+ .control-section .csf-accordion-content > .csf-field h4 {
2710
+ font-size: 12px;
2711
+ }
2712
+ .control-section .csf-depend-hidden.csf-depend-on {
2713
+ display: none !important;
2714
+ }
2715
+ .control-section .csf-depend-visible.csf-depend-on {
2716
+ border-top: 0 !important;
2717
+ }
2718
+
2719
+ /**
2720
+ * 06. Taxonomy
2721
+ */
2722
+ .csf-taxonomy {
2723
+ max-width: 95%;
2724
+ }
2725
+ .csf-taxonomy > .csf-field {
2726
+ border-top: none !important;
2727
+ }
2728
+ .csf-taxonomy > .csf-field-heading {
2729
+ font-size: 1.1em;
2730
+ padding: 20px !important;
2731
+ border: 1px solid #ddd;
2732
+ }
2733
+ .csf-taxonomy > .csf-field-subheading {
2734
+ font-size: 12px;
2735
+ padding: 15px !important;
2736
+ border: 1px solid #ddd;
2737
+ }
2738
+ .csf-taxonomy > .csf-field-submessage .csf-submessage {
2739
+ padding: 15px;
2740
+ border-left-width: 1px;
2741
+ border-left-style: solid;
2742
+ border-right-width: 1px;
2743
+ border-right-style: solid;
2744
+ }
2745
+ .csf-taxonomy > .csf-field-notice {
2746
+ background-color: transparent;
2747
+ }
2748
+ .csf-taxonomy .csf-section-title {
2749
+ display: block;
2750
+ padding: 15px;
2751
+ background-color: #f9f9f9;
2752
+ border: 1px solid #e5e5e5;
2753
+ -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
2754
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
2755
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
2756
+ }
2757
+
2758
+ .csf-taxonomy-add-fields > .csf-field {
2759
+ padding: 8px 0;
2760
+ }
2761
+ .csf-taxonomy-add-fields > .csf-field > .csf-title {
2762
+ float: none;
2763
+ width: 100%;
2764
+ padding: 2px 2px 4px 0;
2765
+ }
2766
+ .csf-taxonomy-add-fields > .csf-field > .csf-title h4 {
2767
+ font-size: 12px;
2768
+ font-weight: normal;
2769
+ }
2770
+ .csf-taxonomy-add-fields > .csf-field > .csf-fieldset {
2771
+ float: none;
2772
+ width: 100%;
2773
+ }
2774
+ .csf-taxonomy-add-fields > .csf-field > .csf-fieldset > .csf-help {
2775
+ right: -5px;
2776
+ }
2777
+ .csf-taxonomy-add-fields + p.submit {
2778
+ margin-top: 0;
2779
+ }
2780
+
2781
+ .csf-taxonomy-edit-fields > .csf-field {
2782
+ padding: 20px 0;
2783
+ }
2784
+ .csf-taxonomy-edit-fields > .csf-field > .csf-title {
2785
+ width: 200px;
2786
+ }
2787
+ .csf-taxonomy-edit-fields > .csf-field > .csf-title h4 {
2788
+ font-size: 14px;
2789
+ font-weight: 600;
2790
+ line-height: 1.3;
2791
+ display: inline-block;
2792
+ vertical-align: middle;
2793
+ }
2794
+ .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset {
2795
+ width: calc(100% - 220px);
2796
+ }
2797
+ .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset > .csf-help {
2798
+ top: -5px;
2799
+ right: -5px;
2800
+ }
2801
+ .csf-taxonomy-edit-fields > .csf-field-submessage {
2802
+ margin: 20px 0;
2803
+ }
2804
+ .csf-taxonomy-edit-fields > .csf-field-subheading,
2805
+ .csf-taxonomy-edit-fields > .csf-field-heading {
2806
+ margin: 20px 0;
2807
+ border: 1px solid #ddd;
2808
+ }
2809
+
2810
+ /**
2811
+ * 08. Nav Menu
2812
+ */
2813
+ .csf-nav-menu-options {
2814
+ clear: both;
2815
+ float: left;
2816
+ width: 100%;
2817
+ }
2818
+ .csf-nav-menu-options > .csf-fields {
2819
+ margin-left: -10px;
2820
+ margin-top: 10px;
2821
+ margin-bottom: 10px;
2822
+ border-top: 1px solid #eee;
2823
+ border-bottom: 1px solid #eee;
2824
+ }
2825
+ .csf-nav-menu-options > .csf-fields > .csf-field {
2826
+ padding: 12px 14px 12px 12px;
2827
+ }
2828
+ .csf-nav-menu-options > .csf-fields > .csf-field .csf-title {
2829
+ float: none;
2830
+ width: 100%;
2831
+ margin-bottom: 5px;
2832
+ }
2833
+ .csf-nav-menu-options > .csf-fields > .csf-field .csf-fieldset {
2834
+ float: none;
2835
+ width: 100%;
2836
+ }
2837
+ .csf-nav-menu-options .csf-field-text input {
2838
+ width: 100%;
2839
+ }
2840
+ .csf-nav-menu-options .csf-field-notice .csf-notice {
2841
+ padding: 15px;
2842
+ }
2843
+
2844
+ .csf-nav-menu-title {
2845
+ padding: 12px 14px 12px 12px;
2846
+ background-color: #f5f5f5;
2847
+ border-top: 1px solid #eee;
2848
+ border-bottom: 1px solid #eee;
2849
+ }
2850
+ .csf-nav-menu-title:first-child {
2851
+ border-top: 0;
2852
+ }
2853
+ .csf-nav-menu-title h4 {
2854
+ margin: 0;
2855
+ padding: 0;
2856
+ color: #23282d;
2857
+ }
2858
+
2859
+ .csf-nav-menu-icon {
2860
+ margin-right: 5px;
2861
+ }
2862
+
2863
+ /**
2864
+ * 06. Profile
2865
+ */
2866
+ .csf-profile-options > h2 > .fa {
2867
+ padding-right: 7px;
2868
+ }
2869
+ .csf-profile-options > .csf-field {
2870
+ max-width: 750px;
2871
+ padding: 15px 0;
2872
+ border-top: none !important;
2873
+ }
2874
+ .csf-profile-options > .csf-field > .csf-title {
2875
+ width: 200px;
2876
+ }
2877
+ .csf-profile-options > .csf-field > .csf-title h4 {
2878
+ font-size: 14px;
2879
+ font-weight: 600;
2880
+ line-height: 1.3;
2881
+ display: inline-block;
2882
+ vertical-align: middle;
2883
+ }
2884
+ .csf-profile-options > .csf-field > .csf-fieldset {
2885
+ width: calc(100% - 220px);
2886
+ }
2887
+ .csf-profile-options > .csf-field > .csf-fieldset > .csf-help {
2888
+ top: -15px;
2889
+ right: -5px;
2890
+ }
2891
+ .csf-profile-options > .csf-field-heading {
2892
+ font-size: 1.1em;
2893
+ }
2894
+ .csf-profile-options > .csf-field-subheading {
2895
+ font-size: 12px;
2896
+ }
2897
+ .csf-profile-options > .csf-field-subheading,
2898
+ .csf-profile-options > .csf-field-heading {
2899
+ margin: 10px 0;
2900
+ padding: 15px !important;
2901
+ border: 1px solid #ddd;
2902
+ }
2903
+ .csf-profile-options > .csf-field-submessage {
2904
+ margin: 20px 0;
2905
+ }
2906
+ .csf-profile-options > .csf-field-submessage .csf-submessage {
2907
+ padding: 10px;
2908
+ border-left-width: 1px;
2909
+ border-left-style: solid;
2910
+ border-right-width: 1px;
2911
+ border-right-style: solid;
2912
+ }
2913
+ .csf-profile-options > .csf-field-notice {
2914
+ background-color: transparent;
2915
+ }
2916
+
2917
+ /**
2918
+ * 09. Modal
2919
+ */
2920
+ .csf-modal {
2921
+ position: fixed;
2922
+ z-index: 100101;
2923
+ top: 0;
2924
+ left: 0;
2925
+ width: 100%;
2926
+ height: 100%;
2927
+ }
2928
+ .csf-modal.hidden {
2929
+ display: none;
2930
+ }
2931
+
2932
+ .csf-modal-icon {
2933
+ z-index: 100102;
2934
+ }
2935
+
2936
+ .csf-modal-table {
2937
+ display: table;
2938
+ width: 100%;
2939
+ height: 100%;
2940
+ }
2941
+
2942
+ .csf-modal-table-cell {
2943
+ display: table-cell;
2944
+ vertical-align: middle;
2945
+ margin: 100px 0;
2946
+ }
2947
+
2948
+ .csf-modal-inner {
2949
+ position: relative;
2950
+ z-index: 10;
2951
+ width: 760px;
2952
+ height: 750px;
2953
+ margin: 0 auto;
2954
+ background-color: #fff;
2955
+ }
2956
+
2957
+ .csf-modal-content {
2958
+ position: relative;
2959
+ overflow: hidden;
2960
+ overflow-y: auto;
2961
+ height: 595px;
2962
+ }
2963
+ .csf-modal-content .csf-shortcode-button {
2964
+ display: none;
2965
+ }
2966
+ .csf-modal-content .csf-field {
2967
+ padding: 15px 30px 15px 15px;
2968
+ }
2969
+ .csf-modal-content a:active, .csf-modal-content a:focus {
2970
+ outline: none;
2971
+ -moz-box-shadow: none;
2972
+ -webkit-box-shadow: none;
2973
+ box-shadow: none;
2974
+ }
2975
+ .csf-modal-content h4 {
2976
+ font-size: 13px;
2977
+ }
2978
+ .csf-modal-content h4 small {
2979
+ font-style: italic;
2980
+ font-weight: 400;
2981
+ color: #aaa;
2982
+ }
2983
+
2984
+ .csf-modal-title {
2985
+ position: relative;
2986
+ background-color: #fcfcfc;
2987
+ border-bottom: 1px solid #ddd;
2988
+ height: 36px;
2989
+ font-size: 16px;
2990
+ font-weight: 600;
2991
+ line-height: 36px;
2992
+ margin: 0;
2993
+ padding: 0 36px 0 16px;
2994
+ }
2995
+
2996
+ .csf-modal-header {
2997
+ width: 100%;
2998
+ padding: 14px 0;
2999
+ background-color: #f5f5f5;
3000
+ border-bottom: 1px solid #eee;
3001
+ }
3002
+ .csf-modal-header select {
3003
+ display: block;
3004
+ width: 250px;
3005
+ margin: 0 auto;
3006
+ font-size: 13px;
3007
+ line-height: 1;
3008
+ height: 30px;
3009
+ min-height: 30px;
3010
+ background-color: #fff;
3011
+ }
3012
+
3013
+ .csf-modal-close {
3014
+ color: #666;
3015
+ padding: 0;
3016
+ position: absolute;
3017
+ top: 0;
3018
+ right: 0;
3019
+ width: 36px;
3020
+ height: 36px;
3021
+ text-align: center;
3022
+ background: none;
3023
+ border: none;
3024
+ cursor: pointer;
3025
+ }
3026
+ .csf-modal-close:before {
3027
+ font: normal 20px/36px dashicons;
3028
+ content: "\f158";
3029
+ vertical-align: top;
3030
+ width: 36px;
3031
+ height: 36px;
3032
+ }
3033
+ .csf-modal-close:hover {
3034
+ opacity: 0.5;
3035
+ }
3036
+
3037
+ .csf-modal-insert-wrapper {
3038
+ text-align: center;
3039
+ width: 100%;
3040
+ padding: 15px 0;
3041
+ background-color: #f5f5f5;
3042
+ border-top: 1px solid #eee;
3043
+ }
3044
+
3045
+ .csf-modal-overlay {
3046
+ position: absolute;
3047
+ top: 0;
3048
+ left: 0;
3049
+ width: 100%;
3050
+ height: 100%;
3051
+ background-color: #000;
3052
+ opacity: 0.5;
3053
+ }
3054
+
3055
+ /**
3056
+ * 09. 01. Shortcode Modal
3057
+ */
3058
+ .csf--repeatable {
3059
+ padding: 15px 15px 0 15px;
3060
+ }
3061
+
3062
+ .csf--repeat-button-block {
3063
+ text-align: center;
3064
+ padding-bottom: 15px;
3065
+ }
3066
+
3067
+ .csf--repeat-shortcode {
3068
+ position: relative;
3069
+ margin-bottom: 15px;
3070
+ border: 1px dashed #ddd;
3071
+ }
3072
+ .csf--repeat-shortcode:first-child .csf-repeat-remove {
3073
+ display: none;
3074
+ }
3075
+ .csf--repeat-shortcode .csf-repeat-remove {
3076
+ position: absolute;
3077
+ right: 10px;
3078
+ top: 10px;
3079
+ z-index: 10;
3080
+ cursor: pointer;
3081
+ display: inline-block;
3082
+ font-size: 11px;
3083
+ width: 18px;
3084
+ height: 18px;
3085
+ line-height: 18px;
3086
+ text-align: center;
3087
+ border-radius: 2px;
3088
+ color: #fff;
3089
+ background-color: #e14d43;
3090
+ opacity: 0.5;
3091
+ }
3092
+ .csf--repeat-shortcode .csf-repeat-remove:hover {
3093
+ opacity: 1;
3094
+ }
3095
+
3096
+ .csf-shortcode-single .csf-modal-inner {
3097
+ height: 750px;
3098
+ }
3099
+ .csf-shortcode-single .csf-modal-content {
3100
+ height: 652px;
3101
+ }
3102
+
3103
+ .elementor-editor-active .csf-shortcode-button {
3104
+ margin-left: 5px;
3105
+ }
3106
+ .elementor-editor-active .csf-modal .hidden {
3107
+ display: none !important;
3108
+ }
3109
+
3110
+ /**
3111
+ * 09. 02. Gutenberg Modal
3112
+ */
3113
+ .csf-shortcode-block {
3114
+ text-align: center;
3115
+ padding: 14px;
3116
+ font-size: 13px;
3117
+ background-color: #f5f5f5;
3118
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
3119
+ }
3120
+
3121
+ .csf-shortcode-block .components-button {
3122
+ margin-bottom: 10px;
3123
+ }
3124
+
3125
+ /**
3126
+ * 09. 03. Icon Modal
3127
+ */
3128
+ .csf-modal-icon .csf-icon-title {
3129
+ padding: 15px 0;
3130
+ margin: 4px;
3131
+ font-size: 14px;
3132
+ font-weight: bold;
3133
+ text-align: center;
3134
+ border: 1px solid #eee;
3135
+ background-color: #f7f7f7;
3136
+ }
3137
+ .csf-modal-icon .csf-modal-header {
3138
+ text-align: center;
3139
+ }
3140
+ .csf-modal-icon .csf-icon-search {
3141
+ width: 50%;
3142
+ height: 40px;
3143
+ line-height: 40px;
3144
+ }
3145
+ .csf-modal-icon i {
3146
+ cursor: pointer;
3147
+ display: inline-block;
3148
+ margin: 4px;
3149
+ width: 35px;
3150
+ height: 35px;
3151
+ line-height: 35px;
3152
+ font-size: 16px;
3153
+ color: #555;
3154
+ text-align: center;
3155
+ border: 1px solid #ccc;
3156
+ background-color: #f7f7f7;
3157
+ -moz-border-radius: 2px;
3158
+ -webkit-border-radius: 2px;
3159
+ border-radius: 2px;
3160
+ -moz-box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
3161
+ -webkit-box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
3162
+ box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
3163
+ }
3164
+ .csf-modal-icon i:hover {
3165
+ color: #fff;
3166
+ border-color: #222;
3167
+ background-color: #222;
3168
+ }
3169
+ .csf-modal-icon .csf-modal-content {
3170
+ padding: 10px;
3171
+ height: 618px;
3172
+ }
3173
+ .csf-modal-icon .csf-error-text {
3174
+ padding: 10px;
3175
+ }
3176
+
3177
+ .csf-modal-loading {
3178
+ display: none;
3179
+ position: absolute;
3180
+ left: 15px;
3181
+ top: 15px;
3182
+ }
3183
+
3184
+ .csf-loading {
3185
+ position: relative;
3186
+ width: 20px;
3187
+ height: 20px;
3188
+ background: #ccc;
3189
+ -moz-border-radius: 20px;
3190
+ -webkit-border-radius: 20px;
3191
+ border-radius: 20px;
3192
+ -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
3193
+ -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
3194
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
3195
+ }
3196
+ .csf-loading:after {
3197
+ position: absolute;
3198
+ top: 50%;
3199
+ left: 50%;
3200
+ width: 4px;
3201
+ height: 4px;
3202
+ content: "";
3203
+ margin-top: -2px;
3204
+ margin-left: -2px;
3205
+ background-color: white;
3206
+ -moz-animation-duration: 0.5s;
3207
+ -webkit-animation-duration: 0.5s;
3208
+ animation-duration: 0.5s;
3209
+ -moz-animation-iteration-count: infinite;
3210
+ -webkit-animation-iteration-count: infinite;
3211
+ animation-iteration-count: infinite;
3212
+ -moz-animation-timing-function: linear;
3213
+ -webkit-animation-timing-function: linear;
3214
+ animation-timing-function: linear;
3215
+ -moz-animation-name: csfLoader;
3216
+ -webkit-animation-name: csfLoader;
3217
+ animation-name: csfLoader;
3218
+ -moz-border-radius: 4px;
3219
+ -webkit-border-radius: 4px;
3220
+ border-radius: 4px;
3221
+ }
3222
+
3223
+ @-moz-keyframes csfLoader {
3224
+ 0% {
3225
+ -moz-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3226
+ transform: rotate(0deg) translateX(-6px) rotate(0deg);
3227
+ }
3228
+ 100% {
3229
+ -moz-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3230
+ transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3231
+ }
3232
+ }
3233
+ @-webkit-keyframes csfLoader {
3234
+ 0% {
3235
+ -webkit-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3236
+ transform: rotate(0deg) translateX(-6px) rotate(0deg);
3237
+ }
3238
+ 100% {
3239
+ -webkit-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3240
+ transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3241
+ }
3242
+ }
3243
+ @keyframes csfLoader {
3244
+ 0% {
3245
+ -moz-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3246
+ -ms-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3247
+ -webkit-transform: rotate(0deg) translateX(-6px) rotate(0deg);
3248
+ transform: rotate(0deg) translateX(-6px) rotate(0deg);
3249
+ }
3250
+ 100% {
3251
+ -moz-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3252
+ -ms-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3253
+ -webkit-transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3254
+ transform: rotate(360deg) translateX(-6px) rotate(-360deg);
3255
+ }
3256
+ }
3257
+ /**
3258
+ * 10. Helper
3259
+ */
3260
+ .csf-subtitle-text {
3261
+ margin-top: 6px;
3262
+ font-weight: 400;
3263
+ color: #999;
3264
+ }
3265
+
3266
+ .csf-desc-text {
3267
+ clear: both;
3268
+ float: left;
3269
+ width: 100%;
3270
+ margin-top: 6px;
3271
+ font-weight: 400;
3272
+ color: #999;
3273
+ }
3274
+
3275
+ .csf-error-text {
3276
+ margin-top: 6px;
3277
+ color: #d02c21;
3278
+ }
3279
+
3280
+ .csf-before-text {
3281
+ margin-bottom: 6px;
3282
+ }
3283
+
3284
+ .csf-after-text {
3285
+ margin-top: 6px;
3286
+ }
3287
+
3288
+ .csf-metabox-hide {
3289
+ display: none !important;
3290
+ }
3291
+
3292
+ .csf-metabox-show {
3293
+ display: block !important;
3294
+ }
3295
+
3296
+ .csf-depend-hidden.csf-depend-on {
3297
+ display: none;
3298
+ }
3299
+
3300
+ .csf-depend-visible.csf-depend-on {
3301
+ display: block;
3302
+ opacity: 0.75;
3303
+ filter: grayscale(1);
3304
+ user-select: none;
3305
+ border-top: 1px solid #eee;
3306
+ }
3307
+ .csf-depend-visible.csf-depend-on .clear:before {
3308
+ content: "";
3309
+ left: 0;
3310
+ top: 0;
3311
+ right: 0;
3312
+ bottom: 0;
3313
+ position: absolute;
3314
+ background-color: #eee;
3315
+ opacity: 0.25;
3316
+ z-index: 10;
3317
+ }
3318
+
3319
+ .csf-warning-primary {
3320
+ color: #fff !important;
3321
+ border-color: #dc3545 !important;
3322
+ background: #dc3545 !important;
3323
+ }
3324
+ .csf-warning-primary:hover, .csf-warning-primary:focus {
3325
+ border-color: #bd2130 !important;
3326
+ background: #bd2130 !important;
3327
+ }
3328
+ .csf-warning-primary:focus {
3329
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #bd2130 !important;
3330
+ }
3331
+ .csf-warning-primary:active {
3332
+ border-color: #bd2130 !important;
3333
+ background: #bd2130 !important;
3334
+ }
3335
+
3336
+ .csf-form-result {
3337
+ display: none;
3338
+ float: left;
3339
+ padding: 0 8px;
3340
+ margin-right: 4px;
3341
+ font-size: 11px;
3342
+ line-height: 30px;
3343
+ user-select: none;
3344
+ border-radius: 2px;
3345
+ }
3346
+
3347
+ .csf-form-show {
3348
+ display: block;
3349
+ }
3350
+
3351
+ .csf-form-success {
3352
+ color: #fff;
3353
+ background-color: #46b450;
3354
+ }
3355
+
3356
+ .csf-form-warning {
3357
+ color: #8a6d3b;
3358
+ background-color: #faebcc;
3359
+ }
3360
+
3361
+ .csf-label-error {
3362
+ position: relative;
3363
+ top: -2px;
3364
+ display: inline-block;
3365
+ font-size: 10px;
3366
+ line-height: 10px;
3367
+ height: 10px;
3368
+ width: 10px;
3369
+ padding: 1px;
3370
+ font-style: normal;
3371
+ text-align: center;
3372
+ color: #fff;
3373
+ vertical-align: middle;
3374
+ background-color: #e10000;
3375
+ -moz-border-radius: 2px;
3376
+ -webkit-border-radius: 2px;
3377
+ border-radius: 2px;
3378
+ }
3379
+
3380
+ .csf-no-option {
3381
+ padding: 30px;
3382
+ }
3383
+
3384
+ .csf-input-number {
3385
+ -moz-appearance: textfield;
3386
+ }
3387
+
3388
+ .csf-input-number::-webkit-inner-spin-button,
3389
+ .csf-input-number::-webkit-outer-spin-button {
3390
+ -webkit-appearance: none;
3391
+ margin: 0;
3392
+ }
3393
+
3394
+ /**
3395
+ * 11. Welcome Page
3396
+ */
3397
+ .csf-welcome-wrap {
3398
+ position: relative;
3399
+ margin: 25px 40px 0 20px;
3400
+ font-size: 15px;
3401
+ max-width: 1200px;
3402
+ }
3403
+ .csf-welcome-wrap p {
3404
+ font-size: 14px;
3405
+ line-height: 1.5;
3406
+ }
3407
+ .csf-welcome-wrap h1 {
3408
+ margin: 0.2em 200px 0 0;
3409
+ padding: 0;
3410
+ color: #32373c;
3411
+ line-height: 1.2em;
3412
+ font-size: 2.8em;
3413
+ font-weight: 400;
3414
+ }
3415
+ .csf-welcome-wrap .csf-logo {
3416
+ position: absolute;
3417
+ overflow: hidden;
3418
+ top: 0;
3419
+ right: 0;
3420
+ height: 160px;
3421
+ width: 140px;
3422
+ background-image: linear-gradient(45deg, #2d67cb, #ad19f3);
3423
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), inset 0 0 0 4px rgba(0, 0, 0, 0.25);
3424
+ }
3425
+ .csf-welcome-wrap .csf-logo .csf--effects i {
3426
+ position: absolute;
3427
+ width: 200px;
3428
+ height: 100px;
3429
+ background-color: rgba(0, 0, 0, 0.15);
3430
+ transform: rotate(-45deg);
3431
+ }
3432
+ .csf-welcome-wrap .csf-logo .csf--effects i:nth-child(1) {
3433
+ bottom: -20px;
3434
+ right: -70px;
3435
+ }
3436
+ .csf-welcome-wrap .csf-logo .csf--effects i:nth-child(2) {
3437
+ bottom: -35px;
3438
+ right: -80px;
3439
+ }
3440
+ .csf-welcome-wrap .csf-logo .csf--effects i:nth-child(3) {
3441
+ bottom: -50px;
3442
+ right: -90px;
3443
+ }
3444
+ .csf-welcome-wrap .csf-logo .csf--effects i:nth-child(4) {
3445
+ bottom: -65px;
3446
+ right: -100px;
3447
+ }
3448
+ .csf-welcome-wrap .csf-logo .csf--wp-logos {
3449
+ position: relative;
3450
+ padding-top: 25px;
3451
+ text-align: center;
3452
+ }
3453
+ .csf-welcome-wrap .csf-logo .csf--wp-logo {
3454
+ position: absolute;
3455
+ left: 20px;
3456
+ width: 20px;
3457
+ height: 20px;
3458
+ background-repeat: no-repeat;
3459
+ background-position: center center;
3460
+ background-image: url(../images/wp-logo.svg);
3461
+ }
3462
+ .csf-welcome-wrap .csf-logo .csf--wp-plugin-logo {
3463
+ display: inline-block;
3464
+ width: 50px;
3465
+ height: 50px;
3466
+ border: 3px solid #fff;
3467
+ background-size: 40px;
3468
+ background-repeat: no-repeat;
3469
+ background-position: center center;
3470
+ background-image: url(../images/wp-plugin-logo.svg);
3471
+ border-radius: 100%;
3472
+ vertical-align: middle;
3473
+ }
3474
+ .csf-welcome-wrap .csf-logo .csf--text {
3475
+ position: absolute;
3476
+ left: 0;
3477
+ right: 0;
3478
+ top: 90px;
3479
+ color: #fff;
3480
+ font-size: 13px;
3481
+ line-height: 1.2em;
3482
+ font-weight: 600;
3483
+ text-align: center;
3484
+ text-transform: uppercase;
3485
+ text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.25);
3486
+ }
3487
+ .csf-welcome-wrap .csf-logo .csf--version {
3488
+ top: auto;
3489
+ left: auto;
3490
+ right: 8px;
3491
+ bottom: 4px;
3492
+ font-size: 11px;
3493
+ text-transform: lowercase;
3494
+ }
3495
+ .csf-welcome-wrap .csf-about-text {
3496
+ font-weight: 400;
3497
+ line-height: 1.6em;
3498
+ font-size: 19px;
3499
+ margin: 1em 200px 1em 0;
3500
+ color: #555d66;
3501
+ }
3502
+ .csf-welcome-wrap .csf-demo-button {
3503
+ margin: 1em 200px 2em 0;
3504
+ }
3505
+ .csf-welcome-wrap .nav-tab-wrapper {
3506
+ margin-bottom: 20px;
3507
+ }
3508
+ .csf-welcome-wrap ul {
3509
+ list-style-type: disc;
3510
+ padding-left: 15px;
3511
+ }
3512
+ .csf-welcome-wrap .csf--col {
3513
+ float: left;
3514
+ padding-right: 20px;
3515
+ box-sizing: border-box;
3516
+ }
3517
+ .csf-welcome-wrap .csf--col-2 {
3518
+ width: 50%;
3519
+ }
3520
+ .csf-welcome-wrap .csf--col-3 {
3521
+ width: 33.333%;
3522
+ }
3523
+ .csf-welcome-wrap .csf--col-4 {
3524
+ width: 25%;
3525
+ }
3526
+ .csf-welcome-wrap .csf--col-5 {
3527
+ width: 20%;
3528
+ }
3529
+ .csf-welcome-wrap .csf--col-last {
3530
+ padding-right: 0;
3531
+ }
3532
+ .csf-welcome-wrap .csf--col-upgrade {
3533
+ padding: 10px 0;
3534
+ text-align: center;
3535
+ border-top: 1px solid #e5e5e5;
3536
+ }
3537
+
3538
+ .csf--table-compare thead td,
3539
+ .csf--table-compare tfoot td {
3540
+ text-align: center;
3541
+ }
3542
+ .csf--table-compare td {
3543
+ font-size: 14px;
3544
+ text-align: center;
3545
+ vertical-align: middle;
3546
+ padding: 10px;
3547
+ }
3548
+ .csf--table-compare td:first-child {
3549
+ text-align: left;
3550
+ }
3551
+ .csf--table-compare tfoot td {
3552
+ padding: 15px 0;
3553
+ }
3554
+ .csf--table-compare .fa {
3555
+ font-size: 18px;
3556
+ }
3557
+ .csf--table-compare .fa-check-circle {
3558
+ color: #46b450;
3559
+ }
3560
+ .csf--table-compare .fa-times-circle {
3561
+ color: #dc3232;
3562
+ }
3563
+
3564
+ .csf-welcome-cols {
3565
+ clear: both;
3566
+ margin: 20px 0;
3567
+ background-color: #fff;
3568
+ padding: 0 0;
3569
+ border-radius: 2px;
3570
+ border: 1px solid #e5e5e5;
3571
+ }
3572
+ .csf-welcome-cols .csf--col {
3573
+ width: 33.333%;
3574
+ float: left;
3575
+ padding: 20px;
3576
+ text-align: center;
3577
+ box-sizing: border-box;
3578
+ min-height: 200px;
3579
+ border-right: 1px solid #e5e5e5;
3580
+ }
3581
+ .csf-welcome-cols .csf--left,
3582
+ .csf-welcome-cols .csf--block {
3583
+ float: left;
3584
+ width: 20%;
3585
+ padding: 0 30px;
3586
+ text-align: center;
3587
+ box-sizing: border-box;
3588
+ }
3589
+ .csf-welcome-cols .csf--block {
3590
+ width: 80%;
3591
+ }
3592
+ .csf-welcome-cols .csf--col-first {
3593
+ border-bottom: 1px solid #e5e5e5;
3594
+ }
3595
+ .csf-welcome-cols .csf--last {
3596
+ border-right: none;
3597
+ }
3598
+ .csf-welcome-cols .csf--space {
3599
+ height: 20px;
3600
+ }
3601
+ .csf-welcome-cols .csf--icon {
3602
+ display: inline-block;
3603
+ font-size: 20px;
3604
+ width: 30px;
3605
+ height: 30px;
3606
+ line-height: 30px;
3607
+ text-align: center;
3608
+ margin-bottom: 10px;
3609
+ color: #fff;
3610
+ background-color: #555;
3611
+ border-radius: 30px;
3612
+ }
3613
+ .csf-welcome-cols .csf--active {
3614
+ background-color: #5cb85c;
3615
+ }
3616
+ .csf-welcome-cols .csf--deactive {
3617
+ background-color: #e14d43;
3618
+ }
3619
+ .csf-welcome-cols .csf--title {
3620
+ font-weight: bold;
3621
+ display: block;
3622
+ }
3623
+ .csf-welcome-cols p:last-child {
3624
+ margin-bottom: 0;
3625
+ }
3626
+
3627
+ .csf-features-cols .csf--key-features {
3628
+ width: 30%;
3629
+ }
3630
+ .csf-features-cols .csf--available-fields {
3631
+ width: 70%;
3632
+ }
3633
+
3634
+ .csf-code-block {
3635
+ margin: 20px 0;
3636
+ padding: 5px 20px;
3637
+ background-color: #fff;
3638
+ border-radius: 2px;
3639
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
3640
+ }
3641
+ .csf-code-block pre {
3642
+ font-size: 13px;
3643
+ color: #0073aa;
3644
+ }
3645
+ .csf-code-block pre span {
3646
+ color: #999;
3647
+ }
3648
+
3649
+ .csf--table-fields td {
3650
+ font-size: 14px;
3651
+ }
3652
+
3653
+ .csf--upgrade a {
3654
+ color: #5cb85c;
3655
+ font-weight: bold;
3656
+ }
3657
+ .csf--upgrade a:focus, .csf--upgrade a:hover {
3658
+ color: #4aa14a;
3659
+ outline: none;
3660
+ box-shadow: none;
3661
+ }
3662
+
3663
+ @media only screen and (max-width: 782px) {
3664
+ .csf-welcome-cols .csf--col {
3665
+ width: 100%;
3666
+ min-height: auto;
3667
+ border-right: none;
3668
+ border-bottom: 1px solid #e5e5e5;
3669
+ }
3670
+
3671
+ .csf-features-cols .csf--key-features {
3672
+ width: 100%;
3673
+ }
3674
+ .csf-features-cols .csf--available-fields {
3675
+ width: 100%;
3676
+ }
3677
+ }
3678
+ /**
3679
+ * 12. Responsive
3680
+ */
3681
+ @media only screen and (max-width: 1200px) {
3682
+ .csf-metabox .csf-field .csf-title {
3683
+ float: none;
3684
+ width: 100%;
3685
+ margin-bottom: 10px;
3686
+ }
3687
+ .csf-metabox .csf-field .csf-fieldset {
3688
+ float: none;
3689
+ width: 100%;
3690
+ }
3691
+ }
3692
+ @media only screen and (max-width: 782px) {
3693
+ .csf-header-inner {
3694
+ text-align: center;
3695
+ }
3696
+ .csf-header-inner h1 {
3697
+ width: 100%;
3698
+ margin-bottom: 10px;
3699
+ }
3700
+
3701
+ .csf-form-result {
3702
+ float: none;
3703
+ margin-right: 0;
3704
+ margin-bottom: 10px;
3705
+ }
3706
+
3707
+ .csf-search,
3708
+ .csf-header-right,
3709
+ .csf-header-left {
3710
+ width: 100%;
3711
+ }
3712
+
3713
+ .csf-search {
3714
+ text-align: center;
3715
+ margin-bottom: 15px;
3716
+ }
3717
+
3718
+ .csf-footer {
3719
+ text-align: center;
3720
+ }
3721
+
3722
+ .csf-buttons {
3723
+ float: none;
3724
+ }
3725
+
3726
+ .csf-copyright {
3727
+ float: none;
3728
+ margin-top: 10px;
3729
+ }
3730
+
3731
+ .csf-nav,
3732
+ .csf-expand-all,
3733
+ .csf-reset-section,
3734
+ .csf-nav-background {
3735
+ display: none !important;
3736
+ }
3737
+
3738
+ .csf-content {
3739
+ margin-left: 0;
3740
+ }
3741
+
3742
+ .csf-section-title,
3743
+ .csf-section {
3744
+ display: block !important;
3745
+ }
3746
+
3747
+ .csf-field .csf-title {
3748
+ float: none;
3749
+ width: 100%;
3750
+ margin-bottom: 10px;
3751
+ }
3752
+ .csf-field .csf-fieldset {
3753
+ float: none;
3754
+ width: 100%;
3755
+ }
3756
+
3757
+ .csf-field-color .button.wp-picker-clear {
3758
+ padding: 0 8px;
3759
+ line-height: 2.14285714;
3760
+ min-height: 32px;
3761
+ }
3762
+
3763
+ .csf-modal-inner {
3764
+ width: 350px;
3765
+ height: 400px;
3766
+ }
3767
+
3768
+ .csf-modal-content {
3769
+ height: 237px;
3770
+ }
3771
+
3772
+ .csf-icon-dialog .csf-modal-inner {
3773
+ width: 305px;
3774
+ height: 380px;
3775
+ }
3776
+ .csf-icon-dialog .csf-modal-content {
3777
+ height: 267px;
3778
+ }
3779
+
3780
+ .csf-modal-icon .csf-modal-inner {
3781
+ width: 330px;
3782
+ height: 385px;
3783
+ }
3784
+ .csf-modal-icon .csf-modal-content {
3785
+ height: 252px;
3786
+ }
3787
+
3788
+ .csf-profile-options > .csf-field > .csf-title,
3789
+ .csf-taxonomy-edit-fields > .csf-field > .csf-title {
3790
+ float: none;
3791
+ width: 100%;
3792
+ margin-bottom: 10px;
3793
+ }
3794
+ .csf-profile-options > .csf-field > .csf-fieldset,
3795
+ .csf-taxonomy-edit-fields > .csf-field > .csf-fieldset {
3796
+ float: none;
3797
+ width: 100%;
3798
+ }
3799
+
3800
+ .csf-nav-menu-options > .csf-fields {
3801
+ margin-left: -10px;
3802
+ margin-right: -10px;
3803
+ }
3804
+ .csf-nav-menu-options > .csf-fields > .csf-field {
3805
+ padding: 10px;
3806
+ }
3807
+ }
3808
+ /**
3809
+ * Chosen JS Styles
3810
+ */
3811
+ .chosen-container {
3812
+ position: relative;
3813
+ display: inline-block;
3814
+ vertical-align: middle;
3815
+ font-size: 13px;
3816
+ user-select: none;
3817
+ }
3818
+
3819
+ .chosen-container * {
3820
+ box-sizing: border-box;
3821
+ }
3822
+
3823
+ .chosen-container .chosen-drop {
3824
+ position: absolute;
3825
+ top: 100%;
3826
+ z-index: 1010;
3827
+ width: 100%;
3828
+ border: 1px solid #aaa;
3829
+ border-top: 0;
3830
+ background: #fff;
3831
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
3832
+ clip: rect(0, 0, 0, 0);
3833
+ clip-path: inset(100% 100%);
3834
+ }
3835
+
3836
+ .chosen-container.chosen-with-drop .chosen-drop {
3837
+ clip: auto;
3838
+ clip-path: none;
3839
+ }
3840
+
3841
+ .chosen-container a {
3842
+ cursor: pointer;
3843
+ }
3844
+
3845
+ .chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
3846
+ margin-right: 4px;
3847
+ overflow: hidden;
3848
+ white-space: nowrap;
3849
+ text-overflow: ellipsis;
3850
+ font-weight: normal;
3851
+ color: #999999;
3852
+ }
3853
+
3854
+ .chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
3855
+ content: ":";
3856
+ padding-left: 2px;
3857
+ vertical-align: top;
3858
+ }
3859
+
3860
+ .chosen-container-single .chosen-single {
3861
+ position: relative;
3862
+ display: block;
3863
+ overflow: hidden;
3864
+ padding: 0 0 0 8px;
3865
+ height: 25px;
3866
+ border: 1px solid #aaa;
3867
+ border-radius: 5px;
3868
+ background-color: #fff;
3869
+ background: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
3870
+ background-clip: padding-box;
3871
+ box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
3872
+ color: #444;
3873
+ text-decoration: none;
3874
+ white-space: nowrap;
3875
+ line-height: 24px;
3876
+ }
3877
+
3878
+ .chosen-container-single .chosen-default {
3879
+ color: #999;
3880
+ }
3881
+
3882
+ .chosen-container-single .chosen-single span {
3883
+ display: block;
3884
+ overflow: hidden;
3885
+ margin-right: 26px;
3886
+ text-overflow: ellipsis;
3887
+ white-space: nowrap;
3888
+ }
3889
+
3890
+ .chosen-container-single .chosen-single-with-deselect span {
3891
+ margin-right: 38px;
3892
+ }
3893
+
3894
+ .chosen-container-single .chosen-single abbr {
3895
+ position: absolute;
3896
+ top: 6px;
3897
+ right: 26px;
3898
+ display: block;
3899
+ width: 12px;
3900
+ height: 12px;
3901
+ font-size: 1px;
3902
+ }
3903
+
3904
+ .chosen-container-single .chosen-single div {
3905
+ position: absolute;
3906
+ top: 0;
3907
+ right: 0;
3908
+ display: block;
3909
+ width: 18px;
3910
+ height: 100%;
3911
+ }
3912
+
3913
+ .chosen-container-single .chosen-single div b {
3914
+ display: block;
3915
+ width: 100%;
3916
+ height: 100%;
3917
+ }
3918
+
3919
+ .chosen-container-single .chosen-search {
3920
+ position: relative;
3921
+ z-index: 1010;
3922
+ margin: 0;
3923
+ padding: 3px 4px;
3924
+ white-space: nowrap;
3925
+ }
3926
+
3927
+ .chosen-container-single .chosen-search input[type="text"] {
3928
+ margin: 1px 0;
3929
+ padding: 4px 20px 4px 5px;
3930
+ width: 100%;
3931
+ height: auto;
3932
+ outline: 0;
3933
+ border: 1px solid #aaa;
3934
+ font-size: 1em;
3935
+ font-family: sans-serif;
3936
+ line-height: normal;
3937
+ border-radius: 0;
3938
+ }
3939
+
3940
+ .chosen-container-single .chosen-drop {
3941
+ margin-top: -1px;
3942
+ border-radius: 0 0 4px 4px;
3943
+ background-clip: padding-box;
3944
+ }
3945
+
3946
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
3947
+ position: absolute;
3948
+ clip: rect(0, 0, 0, 0);
3949
+ clip-path: inset(100% 100%);
3950
+ }
3951
+
3952
+ .chosen-container .chosen-results {
3953
+ color: #444;
3954
+ position: relative;
3955
+ overflow-x: hidden;
3956
+ overflow-y: auto;
3957
+ margin: 0 4px 4px 0;
3958
+ padding: 0 0 0 4px;
3959
+ max-height: 240px;
3960
+ -webkit-overflow-scrolling: touch;
3961
+ }
3962
+
3963
+ .chosen-container .chosen-results li {
3964
+ display: none;
3965
+ margin: 0;
3966
+ padding: 5px 6px;
3967
+ list-style: none;
3968
+ line-height: 15px;
3969
+ word-wrap: break-word;
3970
+ -webkit-touch-callout: none;
3971
+ }
3972
+
3973
+ .chosen-container .chosen-results li.active-result {
3974
+ display: list-item;
3975
+ cursor: pointer;
3976
+ }
3977
+
3978
+ .chosen-container .chosen-results li.disabled-result {
3979
+ display: list-item;
3980
+ color: #ccc;
3981
+ cursor: default;
3982
+ }
3983
+
3984
+ .chosen-container .chosen-results li.highlighted {
3985
+ background-color: #3875d7;
3986
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
3987
+ color: #fff;
3988
+ }
3989
+
3990
+ .chosen-container .chosen-results li.no-results {
3991
+ color: #777;
3992
+ display: list-item;
3993
+ background: #f4f4f4;
3994
+ }
3995
+
3996
+ .chosen-container .chosen-results li.group-result {
3997
+ display: list-item;
3998
+ font-weight: bold;
3999
+ cursor: default;
4000
+ }
4001
+
4002
+ .chosen-container .chosen-results li.group-option {
4003
+ padding-left: 15px;
4004
+ }
4005
+
4006
+ .chosen-container .chosen-results li em {
4007
+ font-style: normal;
4008
+ text-decoration: underline;
4009
+ }
4010
+
4011
+ .chosen-container-multi .chosen-choices {
4012
+ position: relative;
4013
+ overflow: hidden;
4014
+ margin: 0;
4015
+ padding: 0 5px;
4016
+ width: 100%;
4017
+ height: auto;
4018
+ border: 1px solid #aaa;
4019
+ background-color: #fff;
4020
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
4021
+ cursor: text;
4022
+ }
4023
+
4024
+ .chosen-container-multi .chosen-choices li {
4025
+ float: left;
4026
+ list-style: none;
4027
+ }
4028
+
4029
+ .chosen-container-multi .chosen-choices li.search-field {
4030
+ margin: 0;
4031
+ padding: 0;
4032
+ white-space: nowrap;
4033
+ }
4034
+
4035
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
4036
+ margin: 1px 0;
4037
+ padding: 0;
4038
+ outline: 0;
4039
+ border: 0 !important;
4040
+ background: transparent !important;
4041
+ box-shadow: none;
4042
+ color: #999;
4043
+ font-size: 100%;
4044
+ font-family: sans-serif;
4045
+ line-height: normal;
4046
+ border-radius: 0;
4047
+ width: 25px;
4048
+ height: 25px;
4049
+ min-height: 25px;
4050
+ }
4051
+
4052
+ .chosen-container-multi .chosen-choices li.search-choice {
4053
+ position: relative;
4054
+ margin: 3px 5px 3px 0;
4055
+ padding: 3px 20px 3px 6px;
4056
+ border: 1px solid #aaa;
4057
+ max-width: 100%;
4058
+ border-radius: 3px;
4059
+ background-color: #eeeeee;
4060
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
4061
+ background-size: 100% 19px;
4062
+ background-repeat: repeat-x;
4063
+ background-clip: padding-box;
4064
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
4065
+ color: #333;
4066
+ line-height: 13px;
4067
+ cursor: default;
4068
+ }
4069
+
4070
+ .chosen-container-multi .chosen-choices li.search-choice span {
4071
+ word-wrap: break-word;
4072
+ white-space: nowrap;
4073
+ }
4074
+
4075
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
4076
+ position: absolute;
4077
+ top: 0;
4078
+ right: 0;
4079
+ display: block;
4080
+ width: 12px;
4081
+ height: 12px;
4082
+ font-size: 1px;
4083
+ }
4084
+
4085
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
4086
+ padding-right: 5px;
4087
+ border: 1px solid #ccc;
4088
+ background-color: #e4e4e4;
4089
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
4090
+ color: #666;
4091
+ }
4092
+
4093
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
4094
+ background: #d4d4d4;
4095
+ }
4096
+
4097
+ .chosen-container-multi .chosen-results {
4098
+ margin: 0;
4099
+ padding: 0;
4100
+ }
4101
+
4102
+ .chosen-container-multi .chosen-drop .result-selected {
4103
+ display: list-item;
4104
+ color: #ccc;
4105
+ cursor: default;
4106
+ }
4107
+
4108
+ .chosen-container-active .chosen-single {
4109
+ border: 1px solid #5897fb;
4110
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
4111
+ }
4112
+
4113
+ .chosen-container-active.chosen-with-drop .chosen-single {
4114
+ border: 1px solid #aaa;
4115
+ border-bottom-right-radius: 0;
4116
+ border-bottom-left-radius: 0;
4117
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
4118
+ box-shadow: 0 1px 0 #fff inset;
4119
+ }
4120
+
4121
+ .chosen-container-active.chosen-with-drop .chosen-single div {
4122
+ border-left: none;
4123
+ background: transparent;
4124
+ }
4125
+
4126
+ .chosen-container-active .chosen-choices {
4127
+ border: 1px solid #5897fb;
4128
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
4129
+ }
4130
+
4131
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
4132
+ color: #222 !important;
4133
+ }
4134
+
4135
+ .chosen-disabled {
4136
+ opacity: 0.5 !important;
4137
+ cursor: default;
4138
+ }
4139
+
4140
+ .chosen-disabled .chosen-single {
4141
+ cursor: default;
4142
+ }
4143
+
4144
+ .chosen-disabled .chosen-choices .search-choice .search-choice-close {
4145
+ cursor: default;
4146
+ }
4147
+
4148
+ .chosen-rtl {
4149
+ text-align: right;
4150
+ }
4151
+
4152
+ .chosen-rtl .chosen-single {
4153
+ overflow: visible;
4154
+ padding: 0 8px 0 0;
4155
+ }
4156
+
4157
+ .chosen-rtl .chosen-single span {
4158
+ margin-right: 0;
4159
+ margin-left: 26px;
4160
+ direction: rtl;
4161
+ }
4162
+
4163
+ .chosen-rtl .chosen-single-with-deselect span {
4164
+ margin-left: 38px;
4165
+ }
4166
+
4167
+ .chosen-rtl .chosen-single div {
4168
+ right: auto;
4169
+ left: 3px;
4170
+ }
4171
+
4172
+ .chosen-rtl .chosen-single abbr {
4173
+ right: auto;
4174
+ left: 26px;
4175
+ }
4176
+
4177
+ .chosen-rtl .chosen-choices li {
4178
+ float: right;
4179
+ }
4180
+
4181
+ .chosen-rtl .chosen-choices li.search-field input[type="text"] {
4182
+ direction: rtl;
4183
+ }
4184
+
4185
+ .chosen-rtl .chosen-choices li.search-choice {
4186
+ margin: 3px 5px 3px 0;
4187
+ padding: 3px 5px 3px 19px;
4188
+ }
4189
+
4190
+ .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
4191
+ right: auto;
4192
+ left: 4px;
4193
+ }
4194
+
4195
+ .chosen-rtl.chosen-container-single .chosen-results {
4196
+ margin: 0 0 4px 4px;
4197
+ padding: 0 4px 0 0;
4198
+ }
4199
+
4200
+ .chosen-rtl .chosen-results li.group-option {
4201
+ padding-right: 15px;
4202
+ padding-left: 0;
4203
+ }
4204
+
4205
+ .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
4206
+ border-right: none;
4207
+ }
4208
+
4209
+ .chosen-rtl .chosen-search input[type="text"] {
4210
+ padding: 4px 5px 4px 20px;
4211
+ direction: rtl;
4212
+ }
includes/libs/codestar-framework/assets/css/style.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .csf{position:relative}.csf label{padding:0;margin:0;display:inline-block}.csf-ab-icon{top:2px}#screen-meta-links+.csf-options{margin-top:40px}.csf-options{margin-top:20px;margin-right:20px}.csf-header{position:relative}.csf-header-inner{padding:25px;transition:box-shadow .3s ease}.csf-header-inner h1{float:left;font-size:1.5em;line-height:26px;font-weight:400;margin:0}.csf-header-inner h1 small{font-size:11px;font-weight:500}.csf-sticky .csf-header-inner{position:fixed;z-index:99;top:32px;-moz-box-shadow:0 5px 10px rgba(0,0,0,.1);-webkit-box-shadow:0 5px 10px rgba(0,0,0,.1);box-shadow:0 5px 10px rgba(0,0,0,.1)}.csf-buttons{float:right;-moz-transition:opacity .2s;-o-transition:opacity .2s;-webkit-transition:opacity .2s;transition:opacity .2s}.csf-buttons .button{margin:0 2px;line-height:26px}.csf-buttons .button:focus{outline:0!important;box-shadow:none!important}.csf-buttons .csf-save{min-width:72px}.csf-header-left{float:left}.csf-header-right{float:right}.csf-nav{display:block;position:relative;z-index:10;float:left;width:225px}.csf-nav ul{clear:left;margin:0;list-style-type:none}.csf-nav ul li{margin-bottom:0}.csf-nav ul li a{font-size:13px;position:relative;display:block;padding:14px 12px;text-decoration:none;transition-property:color;transition-duration:.2s;transition-timing-function:ease}.csf-nav ul li a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-nav ul li .csf-arrow:after{content:"\f054";display:inline-block;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:9px;line-height:1;position:absolute;right:10px;top:50%;margin-top:-4px;-moz-transform:rotate(0);-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0)}.csf-nav ul li.csf-tab-expanded .csf-arrow:after{-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}.csf-nav ul li.csf-tab-expanded ul{display:block}.csf-nav ul ul{display:none;position:relative}.csf-nav ul ul li a{font-size:12px;padding:12px 14px 12px 24px}.csf-nav .csf-tab-icon{width:20px;margin-right:5px;font-size:13px;text-align:center}.csf-nav .csf-label-error{margin-left:4px;vertical-align:top}.csf-nav-background{position:absolute;top:0;left:0;bottom:0;z-index:9;width:225px}.csf-wrapper{position:relative}.csf-content{position:relative;margin-left:225px;background-color:#fff;-moz-transition:opacity .2s;-o-transition:opacity .2s;-webkit-transition:opacity .2s;transition:opacity .2s}.csf-sections{float:left;width:100%}.csf-section{display:none}.csf-section-title{display:none;padding:20px 30px;background-color:#f5f5f5;border-top:1px solid #eee;border-bottom:1px solid #eee}.csf-section-title h3{margin:0;padding:0;font-size:13px;font-weight:700;text-transform:uppercase}.csf-section-title .csf-section-icon{margin-right:5px}.csf-footer{padding:20px;font-size:11px}.csf-copyright{float:left;margin-top:5px}.csf-search-all .csf-nav,.csf-search-all .csf-nav-background,.csf-show-all .csf-nav,.csf-show-all .csf-nav-background{display:none}.csf-search-all .csf-content,.csf-show-all .csf-content{margin-left:0}.csf-search-all .csf-section,.csf-search-all .csf-section-title,.csf-show-all .csf-section,.csf-show-all .csf-section-title{display:block!important}.csf-search-all .csf-section-title{display:none!important}.csf-expand-all{float:left;padding:0 8px;margin-right:4px;z-index:1;font-size:13px;line-height:30px;cursor:pointer;user-select:none;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-transition:all .2s;-o-transition:all .2s;-webkit-transition:all .2s;transition:all .2s}.csf-expand-all span{font-size:11px;vertical-align:middle}.csf-search{float:left}.csf-search input{margin:0 2px 0 0;border:none;font-size:12px;line-height:30px;min-height:30px;text-align:inherit;padding:0 10px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-search input:focus{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-saving .csf-buttons,.csf-saving .csf-content{cursor:default;pointer-events:none;opacity:.5}.csf-metabox{margin:-6px -12px -12px -12px}.csf-metabox .csf-field{padding:20px}.csf-metabox .csf-section-title{padding:20px}.block-editor-page .csf-metabox{margin:-6px -14px -14px -14px}.block-editor-editor-skeleton__content .csf-metabox{border-left:1px solid #e2e4e7;border-right:1px solid #e2e4e7}.csf-sections-restore{float:left;width:100%;position:relative;z-index:1000000;text-align:right;border-top:1px solid #eee}.csf-sections-restore .csf-button-cancel,.csf-sections-restore input{display:none}.csf-sections-restore label{padding:10px}.csf-sections-restore span{-webkit-user-select:none;user-select:none}.csf-sections-restore input:checked~.csf-button-restore{display:none}.csf-sections-restore input:checked~.csf-button-cancel{display:inline-block}#side-sortables .csf-section-title{padding:12px}#side-sortables .csf-field{padding:10px 15px}#side-sortables .csf-field .csf-title{float:none;width:100%;margin-bottom:6px}#side-sortables .csf-field .csf-fieldset{float:none;width:100%}#side-sortables .csf-field-text input{width:100%}#side-sortables .csf-notice{padding:10px 15px}.csf-comment-metabox{margin:-6px -12px -12px -12px}.csf-comment-metabox .csf-field{padding:20px}.csf-comment-metabox .csf-section-title{padding:20px}.csf-tooltip{position:absolute;z-index:5000001;font-size:12px;line-height:1.4;text-align:center;text-decoration:none;padding:6px 12px;max-width:200px;color:#fff;background-color:#000;background-color:rgba(0,0,0,.85);-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.csf-theme-dark .csf-header-inner{background-color:#050505}.csf-theme-dark .csf-header-inner h1{color:#fff}.csf-theme-dark .csf-header-inner h1 small{color:#555}.csf-theme-dark .csf-expand-all{color:#999;background-color:#222}.csf-theme-dark .csf-expand-all:hover{color:#fff;background-color:#333}.csf-theme-dark .csf-search input{color:#fff;background-color:#222}.csf-theme-dark .csf-search:focus{background-color:#444}.csf-theme-dark .csf-search::-webkit-input-placeholder{color:#666}.csf-theme-dark .csf-nav ul li a{color:#999;background-color:#222;border-bottom:1px solid #2f2f2f}.csf-theme-dark .csf-nav ul li a:hover{color:#fff}.csf-theme-dark .csf-nav ul li .csf-active{color:#fff;background-color:#111}.csf-theme-dark .csf-nav ul li .csf-active:after{content:" ";position:absolute;right:0;top:50%;height:0;width:0;pointer-events:none;border:solid transparent;border-right-color:#fff;border-width:4px;margin-top:-4px}.csf-theme-dark .csf-nav ul ul li a{background-color:#191919;border-bottom:1px solid #2f2f2f}.csf-theme-dark .csf-nav ul ul li .csf-active{background-color:#101010}.csf-theme-dark .csf-nav ul ul:before{background-color:rgba(34,34,34,.75)}.csf-theme-dark .csf-nav>ul>li:last-child>a{border-bottom:none}.csf-theme-dark .csf-nav-background{background-color:#222}.csf-theme-dark .csf-footer{color:#555;background-color:#050505}.csf-theme-light .csf-container{border:1px solid #ccd0d4;-moz-box-shadow:0 0 15px rgba(0,0,0,.04);-webkit-box-shadow:0 0 15px rgba(0,0,0,.04);box-shadow:0 0 15px rgba(0,0,0,.04)}.csf-theme-light .csf-header-inner{border-bottom:1px solid #ccd0d4;background-color:#f5f5f5;background:linear-gradient(#fefefe,#f5f5f5)}.csf-theme-light .csf-header-inner h1 small{color:#999}.csf-theme-light .csf-expand-all{color:#999;background-color:#eee}.csf-theme-light .csf-expand-all:hover{color:#555}.csf-theme-light .csf-search input{color:#555;background-color:#eee}.csf-theme-light .csf-search input::-webkit-input-placeholder{color:#999}.csf-theme-light .csf-nav ul li a{color:#666;background-color:#f5f5f5;border-bottom:1px solid #ccd0d4}.csf-theme-light .csf-nav ul li a:hover{color:#222}.csf-theme-light .csf-nav ul li .csf-active{color:#222;background-color:#fff}.csf-theme-light .csf-nav ul li .csf-active:after{content:"";position:absolute;top:0;bottom:0;right:-1px;width:1px;background-color:#fff}.csf-theme-light .csf-nav ul ul li a{background-color:#eee;border-bottom:1px solid #ccd0d4}.csf-theme-light .csf-nav>ul>li:last-child>a{border-bottom:none}.csf-theme-light .csf-nav-background{background-color:#f5f5f5;border-right:1px solid #ccd0d4}.csf-theme-light .csf-footer{color:#555;border-top:1px solid #ccd0d4;background-color:#f5f5f5;background:linear-gradient(#fafafa,#f5f5f5)}.csf-field{position:relative;padding:30px}.csf-field+.csf-field{border-top:1px solid #eee}.csf-field p:first-child{margin-top:0}.csf-field p:last-child{margin-bottom:0}.csf-field:after,.csf-field:before{content:" ";display:table}.csf-field:after{clear:both}.csf-field h4{margin-top:0}.csf-field .csf-title{position:relative;width:20%;float:left}.csf-field .csf-title h4{margin:0;color:#23282d}.csf-field .csf-fieldset{float:right;width:calc(80% - 20px)}.csf-pseudo-field{padding:0 5px 0 0!important;display:inline-block}.csf-pseudo-field+.csf-pseudo-field{border:0}.csf-pseudo-field pre{display:none}.csf-field-accordion .csf-accordion-item{position:relative;margin-bottom:5px}.csf-field-accordion .csf-accordion-item:last-child{margin-bottom:0}.csf-field-accordion .csf-accordion-item h4{font-size:1em}.csf-field-accordion .csf-accordion-title{display:block;cursor:pointer;position:relative;margin:0;padding:15px;min-height:0;font-size:100%;user-select:none;border:1px solid #ccd0d4;background-color:#fafafa;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:border-color .15s}.csf-field-accordion .csf-accordion-title:active,.csf-field-accordion .csf-accordion-title:focus,.csf-field-accordion .csf-accordion-title:hover{outline:0;border-color:#999}.csf-field-accordion .csf-accordion-title .csf--icon{width:20px;text-align:center;margin-right:2px}.csf-field-accordion .csf-accordion-icon{width:16px;text-align:center}.csf-field-accordion .csf-accordion-content{display:none;padding:0;border:1px solid #ccd0d4;border-top:none;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-accordion .csf-accordion-content>.csf-field{padding:15px}.csf-field-accordion .csf-accordion-open{display:block}.csf-field-background .csf-field{border:0!important;padding:0;margin-bottom:6px;margin-right:6px}.csf-field-background .csf--title{color:#777;font-size:12px}.csf-field-background .csf--background-colors{display:flex;flex-wrap:wrap}.csf-field-background .csf--background-attributes{display:flex;flex-wrap:wrap}.csf-field-background .csf--background-attributes select{min-width:100%;margin:0}.csf-field-background .csf--background-attributes .csf-field{flex:1}.csf-field-background .csf--attributes-hidden{display:none}.csf-field-backup textarea{width:100%;min-height:200px;margin-bottom:5px}.csf-field-backup small{display:inline-block;margin:5px}.csf-field-backup hr{margin:20px 0;border:none;border-bottom:1px solid #e5e5e5}.csf-field-border .csf--inputs,.csf-field-dimensions .csf--inputs,.csf-field-spacing .csf--inputs{float:left;display:flex;flex-wrap:wrap}.csf-field-border .csf--input,.csf-field-dimensions .csf--input,.csf-field-spacing .csf--input{display:flex;padding-right:6px;padding-bottom:4px;box-sizing:border-box}.csf-field-border .csf--input select,.csf-field-dimensions .csf--input select,.csf-field-spacing .csf--input select{margin:0}.csf-field-border .csf--input input,.csf-field-dimensions .csf--input input,.csf-field-spacing .csf--input input{position:relative;z-index:1;margin:0;width:65px;max-width:100%;text-align:center}.csf-field-border .csf--color,.csf-field-dimensions .csf--color,.csf-field-spacing .csf--color{float:left}.csf-field-border .csf--label,.csf-field-dimensions .csf--label,.csf-field-spacing .csf--label{display:flex;flex-direction:column;justify-content:center;user-select:none;min-width:20px;max-width:100%;padding:0 4px;font-size:12px;text-align:center;color:#555;border:1px solid #7b776c;background-color:#f5f5f5}.csf-field-border .csf--icon,.csf-field-dimensions .csf--icon,.csf-field-spacing .csf--icon{border-right:0;border-radius:4px 0 0 4px}.csf-field-border .csf--icon+input,.csf-field-dimensions .csf--icon+input,.csf-field-spacing .csf--icon+input{border-top-left-radius:0;border-bottom-left-radius:0}.csf-field-border .csf--unit,.csf-field-dimensions .csf--unit,.csf-field-spacing .csf--unit{border-left:0;border-radius:0 4px 4px 0}.csf-field-border .csf--is-unit,.csf-field-dimensions .csf--is-unit,.csf-field-spacing .csf--is-unit{border-top-right-radius:0;border-bottom-right-radius:0}.csf-field-button_set .csf--buttons{display:inline-block}.csf-field-button_set .csf--button{position:relative;z-index:1;float:left;cursor:pointer;padding:7px 14px;min-width:40px;text-align:center;color:#555;border:1px solid #ccc;background-color:#f7f7f7;user-select:none;-webkit-user-select:none;box-shadow:0 1px 0 rgba(0,0,0,.1)}.csf-field-button_set .csf--button:first-child{border-radius:4px 0 0 4px}.csf-field-button_set .csf--button:last-child{border-radius:0 4px 4px 0}.csf-field-button_set .csf--button:not(:first-child){margin-left:-1px}.csf-field-button_set .csf--button:hover{background-color:#eee}.csf-field-button_set .csf--active,.csf-field-button_set .csf--active:hover{z-index:2;color:#fff;border-color:#006799;background-color:#0085ba}.csf-field-button_set input{display:none}.csf-field-checkbox ul,.csf-field-radio ul{margin:0;padding:0;list-style-type:none;overflow-y:auto;max-height:305px}.csf-field-checkbox ul li,.csf-field-radio ul li{margin-bottom:6px}.csf-field-checkbox ul ul,.csf-field-radio ul ul{max-height:none}.csf-field-checkbox ul ul li,.csf-field-radio ul ul li{margin-left:8px}.csf-field-checkbox ul ul li:first-child,.csf-field-radio ul ul li:first-child{margin-left:0}.csf-field-checkbox input,.csf-field-radio input{margin:0 1px}.csf-field-checkbox .csf--inline-list li,.csf-field-radio .csf--inline-list li{display:inline-block;margin-right:15px}.csf-field-checkbox .csf--text,.csf-field-radio .csf--text{margin-left:5px;vertical-align:middle}.csf-field-checkbox .csf-checker,.csf-field-radio .csf-checker{cursor:pointer}.csf-field-code_editor .CodeMirror{width:100%;height:400px}.csf-field-code_editor .cm-s-default{border:1px solid #ccd0d4}.csf-field-code_editor textarea{width:100%;height:400px}.csf-field-color>input{opacity:.75;width:115px;max-width:100%}.csf-field-color .button.wp-picker-clear{padding:0 8px;margin-left:6px;line-height:2.54545455;min-height:30px}.csf-field-color_group .csf--left{float:left;margin-right:10px;margin-bottom:5px}.csf-field-color_group .csf--title{color:#999;margin-bottom:5px}.csf-field-fieldset .csf-fieldset-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-fieldset .csf-fieldset-content>.csf-field{padding:15px}.csf-field-fieldset .csf-field-subheading{font-size:13px}.csf-field-date input{margin:0}.csf-field-date .csf--to{margin-left:7px}.csf-datepicker-wrapper{margin-top:5px;width:auto;background-color:#fff;z-index:9999999!important;-moz-box-shadow:0 0 30px rgba(0,0,0,.15);-webkit-box-shadow:0 0 30px rgba(0,0,0,.15);box-shadow:0 0 30px rgba(0,0,0,.15)}.csf-datepicker-wrapper *{float:none;margin:0;padding:0;font-family:inherit;font-weight:400;font-style:normal;text-decoration:none;border:0;border-radius:0;box-shadow:none}.csf-datepicker-wrapper .ui-datepicker-header,.csf-datepicker-wrapper .ui-widget-header{color:#fff;background:#00a0d2}.csf-datepicker-wrapper .ui-datepicker-header .ui-state-hover{cursor:pointer}.csf-datepicker-wrapper .ui-datepicker-title{font-size:14px;line-height:40px;text-align:center}.csf-datepicker-wrapper .ui-datepicker-next,.csf-datepicker-wrapper .ui-datepicker-prev{position:static;top:auto;left:auto;right:auto;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:12px;text-align:center;width:41px;height:40px;line-height:40px;color:#fff;background-color:rgba(255,255,255,.1);text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.csf-datepicker-wrapper .ui-datepicker-next span,.csf-datepicker-wrapper .ui-datepicker-prev span{display:none}.csf-datepicker-wrapper .ui-datepicker-prev{float:left}.csf-datepicker-wrapper .ui-datepicker-next{float:right}.csf-datepicker-wrapper .ui-datepicker-prev:before{content:'\f053'}.csf-datepicker-wrapper .ui-datepicker-next:before{content:'\f054'}.csf-datepicker-wrapper .ui-datepicker-next-hover,.csf-datepicker-wrapper .ui-datepicker-prev-hover{opacity:.75}.csf-datepicker-wrapper tbody .ui-datepicker-week-col{background-color:#f7f7f7}.csf-datepicker-wrapper .ui-datepicker-buttonpane{padding:10px;text-align:center;background-color:#f7f7f7}.csf-datepicker-wrapper .ui-datepicker-buttonpane button{cursor:pointer;margin:0 5px;padding:7px 14px;border:1px solid #eee;background-color:#fff}.csf-datepicker-wrapper select{margin:0 4px}.csf-datepicker-wrapper select option{color:#555}.csf-datepicker-wrapper table{font-size:13px;border-collapse:collapse;width:100%}.csf-datepicker-wrapper thead{color:#fff;background:#32373c}.csf-datepicker-wrapper th{text-align:center;padding:7px;border:1px solid #444}.csf-datepicker-wrapper td{text-align:center;border:1px solid #f4f4f4}.csf-datepicker-wrapper td.ui-datepicker-other-month{border:transparent}.csf-datepicker-wrapper td .ui-state-default{color:#555;width:auto;display:block;padding:6px 12px}.csf-datepicker-wrapper td .ui-state-active,.csf-datepicker-wrapper td .ui-state-hover{color:#fff;background-color:#0073aa}.csf-datepicker-wrapper td.ui-state-disabled .ui-state-default{opacity:.5}.csf-field-gallery input{display:none}.csf-field-gallery ul{margin:0;padding:0;list-style-type:none}.csf-field-gallery ul li{display:inline-block;position:relative;padding:4px;margin:0 5px 10px 0;border:1px solid #ccc;background-color:#f9f9f9;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08)}.csf-field-gallery ul li img{max-height:60px;display:inline-block;vertical-align:middle}.csf-field-gallery .button{margin-right:5px;margin-bottom:5px}.csf-field-group .csf-cloneable-hidden{display:none!important}.csf-field-group .csf-cloneable-wrapper{position:relative}.csf-field-group .csf-cloneable-item{display:none;position:relative;margin-bottom:5px}.csf-field-group .csf-cloneable-item h4{font-size:1em}.csf-field-group .ui-accordion .csf-cloneable-item{display:block}.csf-field-group .csf-cloneable-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-group .csf-cloneable-content>.csf-field{padding:15px}.csf-field-group .csf-cloneable-title{display:block;cursor:pointer;position:relative;user-select:none;margin:0;padding:15px 65px 15px 10px;min-height:0;font-size:100%;border:1px solid #ccd0d4;background-color:#fafafa;box-shadow:0 1px 1px rgba(0,0,0,.04);transition:border-color .15s}.csf-field-group .csf-cloneable-title:active,.csf-field-group .csf-cloneable-title:focus,.csf-field-group .csf-cloneable-title:hover{border-color:#999;outline:0}.csf-field-group .csf-cloneable-helper{position:absolute;top:12px;right:10px;z-index:1;font-size:14px;line-height:1em}.csf-field-group .csf-cloneable-helper i{display:inline-block;cursor:pointer;padding:5px;color:#999}.csf-field-group .csf-cloneable-helper i:hover{color:#555}.csf-field-group .csf-cloneable-content{padding:0;border-top:0}.csf-field-group .csf-cloneable-title-number,.csf-field-group .csf-cloneable-title-prefix{margin-right:5px}.csf-field-group .csf-cloneable-alert{display:none;margin-bottom:5px;padding:10px 20px;color:#a94442;border:1px solid #ebccd1;background-color:#f2dede}.csf-field-group .widget-placeholder{margin-bottom:10px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-group .csf-cloneable-header-icon{display:inline-block;text-align:center;font-size:14px;width:17px;text-indent:0;vertical-align:text-top}.csf-field-group .csf-cloneable-placeholder{background-color:#ddd;margin-top:4px;width:100px;height:10px;font-size:10px;line-height:10px;display:inline-block;vertical-align:top;border-radius:2px}.csf-field-icon input{display:none}.csf-field-icon .button{margin-right:5px}.csf-field-icon .csf-icon-preview i{display:inline-block;font-size:16px;width:30px;height:28px;line-height:28px;margin-right:5px;text-align:center;vertical-align:top;color:#555;border:1px solid #ccc;background-color:#f7f7f7;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.csf-field-image_select .csf--image{cursor:pointer;position:relative;display:inline-block;max-width:100%;margin:0 5px 5px 0;vertical-align:bottom;border:2px solid transparent;background-color:#fff;user-select:none;-webkit-user-select:none;-moz-transition:all .2s;-o-transition:all .2s;-webkit-transition:all .2s;transition:all .2s}.csf-field-image_select .csf--image:before{position:absolute;top:0;left:0;text-align:center;font-size:10px;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;content:"\f00c";width:16px;height:16px;line-height:14px;opacity:0;color:#fff;background-color:#222;transition:opacity .2s}.csf-field-image_select .csf--active{border-color:#222;box-shadow:0 0 20px rgba(0,0,0,.2)}.csf-field-image_select .csf--active:before{opacity:1}.csf-field-image_select img{vertical-align:top}.csf-field-image_select input{display:none}.csf-field-link_color .csf--left{float:left;margin-right:10px;margin-bottom:5px}.csf-field-link_color .csf--title{color:#777;margin-bottom:5px}.csf-field-map input{width:100%}.csf-field-map input[type=text].ui-autocomplete-loading{background-position-x:calc(100% - 5px)}.csf-field-map .csf--map-search+.csf--map-osm-wrap{margin-top:10px}.csf-field-map .csf--map-osm-wrap{position:relative;padding:5px;border:1px solid #eee;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-map .csf--map-osm{position:relative;z-index:1;min-height:250px}.csf-field-map .csf--map-inputs{margin-top:10px;display:flex;justify-content:space-between}.csf-field-map .csf--map-input{flex:1}.csf-field-map .csf--map-input:last-child{padding-left:10px}.csf-field-map label{display:block;color:#777;font-size:12px;margin:0 0 2px 0}.csf-map-ui-autocomplate{z-index:999999;border-radius:4px;overflow:hidden}.csf-field-media .csf--placeholder{display:flex;align-items:flex-start}.csf-field-media .csf--placeholder input{width:100%;margin:0}.csf-field-media .button{margin-left:5px}.csf-field-media .hidden+.button{margin-left:0}.csf-field-media .csf--preview{position:relative}.csf-field-media .csf--preview .fa-times{position:absolute;z-index:1;right:4px;top:4px;font-size:14px;width:22px;height:22px;line-height:22px;text-align:center;text-decoration:none;color:#fff;background-color:#d33;opacity:.8;transition:all .2s}.csf-field-media .csf--preview .fa-times:hover{opacity:1}.csf-field-media .csf--preview .fa-times:focus{box-shadow:none}.csf-field-palette .csf--palette{position:relative;display:inline-block;cursor:pointer;border:2px solid #ddd;margin-right:10px;margin-bottom:10px;user-select:none;-webkit-user-select:none;transition:all .2s}.csf-field-palette .csf--palette span{vertical-align:middle;display:inline-block;width:22px;height:60px;line-height:60px;overflow:hidden;text-indent:-999px}.csf-field-palette .csf--palette:before{position:absolute;top:0;left:0;text-align:center;font-size:10px;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;content:"\f00c";width:16px;height:16px;line-height:14px;opacity:0;color:#fff;background-color:#222;transition:opacity .2s}.csf-field-palette .csf--active{border-color:#222;box-shadow:0 0 20px rgba(0,0,0,.2)}.csf-field-palette .csf--active:before{opacity:1}.csf-field-palette input{display:none}.csf-field-repeater .csf-field-text input{width:100%}.csf-field-repeater .csf-repeater-hidden{display:none!important}.csf-field-repeater .csf-repeater-wrapper .csf-repeater-item{display:table;width:100%;margin-bottom:5px;border:1px solid #eee}.csf-field-repeater .csf-repeater-wrapper .csf-repeater-item h4{font-size:1em}.csf-field-repeater .csf-repeater-content{width:100%;display:table-cell;vertical-align:middle;background-color:#fff}.csf-field-repeater .csf-repeater-content>.csf-field{padding:15px}.csf-field-repeater .csf-repeater-helper{width:100%;display:table-cell;vertical-align:middle;text-align:center;font-size:14px;line-height:1em;border-left:1px solid #eee;background-color:#f7f7f7}.csf-field-repeater .csf-repeater-helper i{display:inline-block;cursor:pointer;color:#999;padding:5px}.csf-field-repeater .csf-repeater-helper i:hover{color:#555}.csf-field-repeater .csf-repeater-helper-inner{width:75px}.csf-field-repeater .csf-repeater-alert{display:none;margin-bottom:5px;padding:10px 20px;color:#a94442;border:1px solid #ebccd1;background-color:#f2dede}.csf-field-repeater .widget-placeholder{height:50px;margin-bottom:3px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-repeater .ui-sortable-helper{height:50px!important;overflow:hidden!important;border-color:#ccc!important;background-color:#eee!important;opacity:.5}.csf-field-repeater .ui-sortable-helper .csf-repeater-content,.csf-field-repeater .ui-sortable-helper .csf-repeater-helper{display:none}.csf-field-select .csf-fieldset{min-height:30px}.csf-field-select .csf-chosen{display:none}.csf-field-select select{max-width:100%;margin:0}.csf-field-slider .csf--wrap{display:flex;align-items:center}.csf-field-slider .csf--input{display:flex}.csf-field-slider .csf--unit{display:flex;justify-content:center;flex-direction:column;user-select:none;padding:0 6px;font-size:11px;line-height:1;border-radius:0 4px 4px 0;color:#555;border:1px solid #7e8993;border-left:0;background-color:#f5f5f5}.csf-field-slider .csf-slider-ui{margin-right:15px}.csf-field-slider input[type=number]{position:relative;z-index:1;margin:0;width:50px;text-align:center}.csf-field-slider .csf--is-unit{border-top-right-radius:0;border-bottom-right-radius:0}.csf-field-slider .ui-slider{position:relative;width:100%;height:3px;border:none;background:#ddd;border-radius:2px}.csf-field-slider .ui-slider-range{height:3px;border:none;background:#333;border-radius:2px}.csf-field-slider .ui-slider-handle{position:absolute;width:16px;height:16px;top:-7px;margin-left:-8px;border:none;background:#333;border-radius:2px}.csf-field-slider .ui-slider-handle:hover,.csf-field-slider .ui-state-active{cursor:pointer;background:#111}.csf-field-sortable .csf-field-text input{width:100%;max-width:100%}.csf-field-sortable .csf-sortable .csf-sortable-item{display:table;width:100%;margin-bottom:5px;border:1px solid #eee}.csf-field-sortable .csf-sortable .csf-sortable-item h4{font-size:1em}.csf-field-sortable .csf-sortable-content{width:100%;display:table-cell;vertical-align:middle;background-color:#fff}.csf-field-sortable .csf-sortable-content>.csf-field{padding:15px}.csf-field-sortable .csf-sortable-helper{width:100%;display:table-cell;vertical-align:middle;text-align:center;font-size:14px;line-height:1em;border-left:1px solid #eee;background-color:#f7f7f7}.csf-field-sortable .csf-sortable-helper i{display:inline-block;cursor:pointer;width:50px;color:#555}.csf-field-sortable .csf-sortable-helper i:hover{opacity:.5}.csf-field-sortable .widget-placeholder{height:50px;margin-bottom:3px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-sortable .ui-sortable-helper{height:50px!important;overflow:hidden!important;border-color:#ccc!important;background-color:#eee!important;opacity:.5}.csf-field-sortable .ui-sortable-helper .csf-sortable-content,.csf-field-sortable .ui-sortable-helper .csf-sortable-helper{display:none}.csf-field-sorter .ui-sortable-placeholder{height:20px;border:1px dashed #f1c40f;background-color:#fffae4}.csf-field-sorter .csf-modules{float:left;width:50%;box-sizing:border-box}.csf-field-sorter .csf-modules:first-child{padding-right:15px}.csf-field-sorter .csf-modules:last-child{padding-left:15px}.csf-field-sorter .csf-disabled,.csf-field-sorter .csf-enabled{padding:5px 15px;border:1px dashed #ddd;background-color:#fff}.csf-field-sorter .csf-disabled li{-moz-transition:opacity .15s;-o-transition:opacity .15s;-webkit-transition:opacity .15s;transition:opacity .15s;opacity:.5}.csf-field-sorter .csf-disabled .ui-sortable-helper{opacity:1}.csf-field-sorter .csf-sorter-title{font-size:13px;font-weight:600;padding:10px;text-align:center;border:1px dashed #ddd;border-bottom:none;background-color:#f8f8f8;text-transform:uppercase}.csf-field-sorter ul{list-style-type:none;margin:0;padding:0;min-height:62px}.csf-field-sorter ul li{margin:10px 0;padding:10px 15px;cursor:move;font-weight:700;text-align:center;border:1px solid #e5e5e5;background-color:#fafafa;-moz-transition:border-color .15s;-o-transition:border-color .15s;-webkit-transition:border-color .15s;transition:border-color .15s}.csf-field-sorter ul li:hover{border-color:#bbb}.csf-field-spinner .csf--spin{display:flex}.csf-field-spinner .ui-spinner{display:flex}.csf-field-spinner .ui-button-text-only{display:flex;flex-direction:column;justify-content:center;text-align:center;min-width:20px;padding:0 4px;color:#555;border:1px solid #7e8993;background-color:#f5f5f5}.csf-field-spinner .ui-button{cursor:pointer}.csf-field-spinner .ui-button:hover{background-color:#e7e7e7}.csf-field-spinner .ui-button:active{background-color:#ddd}.csf-field-spinner .ui-button:before{font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:14px;line-height:14px}.csf-field-spinner .ui-spinner-down{order:1;border-right:0;border-radius:4px 0 0 4px}.csf-field-spinner .ui-spinner-down:before{content:"\f0d9"}.csf-field-spinner .ui-spinner-input{order:2}.csf-field-spinner .csf--unit{order:3;border-left:0;user-select:none}.csf-field-spinner .ui-spinner-up{order:4;border-left:0;border-radius:0 4px 4px 0}.csf-field-spinner .ui-spinner-up:before{content:"\f0da"}.csf-field-spinner input{position:relative;z-index:1;width:50px;text-align:center;margin:0;padding:0 8px;border-radius:0}.csf-field-spinner .ui-button-text{display:none}.csf-field-switcher .csf--switcher{float:left;cursor:pointer;position:relative;width:60px;height:26px;padding:0;margin:0;overflow:hidden;border-radius:4px;background-color:#ed6f6f;user-select:none;-webkit-user-select:none}.csf-field-switcher .csf--ball{position:absolute;top:4px;left:4px;width:24px;height:18px;background-color:#fff;border-radius:4px;transition:all .1s;box-shadow:1px 1px 1px rgba(0,0,0,.15)}.csf-field-switcher .csf--off,.csf-field-switcher .csf--on{position:absolute;top:0;left:0;right:0;font-size:11px;line-height:26px;font-weight:500;font-style:normal;text-align:center;text-transform:uppercase;color:#fff;padding-right:28px;opacity:0;transition:all .1s}.csf-field-switcher .csf--off{padding-right:0;padding-left:28px;opacity:1}.csf-field-switcher .csf--active{background:#4fb845}.csf-field-switcher .csf--active .csf--on{opacity:1}.csf-field-switcher .csf--active .csf--off{opacity:0}.csf-field-switcher .csf--active .csf--ball{left:100%;margin-left:-28px}.csf-field-switcher .csf--label{float:left;margin-top:4px;margin-left:8px;font-weight:400;color:#999}.csf-field-switcher input{display:none}.csf-field-tabbed .csf-tabbed-content{border:1px solid #ccd0d4;background-color:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-field-tabbed .csf-tabbed-content>.csf-field{padding:15px}.csf-field-tabbed .csf-tabbed-nav .csf--icon{padding-right:5px}.csf-field-tabbed .csf-tabbed-nav a{display:inline-block;padding:12px 15px;margin-top:1px;margin-right:5px;margin-bottom:-1px;position:relative;text-decoration:none;color:#444;font-weight:600;border:1px solid #ccd0d4;background-color:#f3f3f3;transition:all .2s}.csf-field-tabbed .csf-tabbed-nav a:hover{background-color:#f9f9f9}.csf-field-tabbed .csf-tabbed-nav a.csf-tabbed-active{background-color:#fff;border-bottom-color:#fff}.csf-field-tabbed .csf-tabbed-nav a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-field-text input{width:50%;max-width:100%;margin:0}.csf-field-textarea textarea{width:100%;max-width:100%;min-height:125px}.csf-field-textarea .csf-shortcode-button{margin-bottom:10px;margin-right:5px}.csf-field-typography select,.csf-field-typography textarea{min-width:100%;margin:0}.csf-field-typography .csf--title{color:#777;margin:0 0 2px 0;font-size:12px}.csf-field-typography .csf--title small{vertical-align:top}.csf-field-typography .csf--blocks{display:flex;flex-wrap:wrap}.csf-field-typography .csf--block{flex:1;padding-right:6px;padding-bottom:6px}.csf-field-typography .csf--input{margin:0;min-width:100%}.csf-field-typography .csf--input-wrap{position:relative}.csf-field-typography .csf--unit{position:absolute;z-index:1;right:4px;top:4px;bottom:4px;padding:2px 6px;color:#666;font-size:11px;line-height:1;border-radius:2px;background:#eee;user-select:none;display:flex;justify-content:center;flex-direction:column}.csf-field-typography .csf--preview{font-size:16px;line-height:20px;padding:20px;color:#222;border:1px solid #eee;background-color:#fff;border-radius:2.5px;user-select:none;-webkit-user-select:none;transition:background-color .2s,border-color .2s}.csf-field-typography .csf--block-preview{cursor:pointer;position:relative;overflow:hidden;margin-top:10px;max-width:100%}.csf-field-typography .csf--black-background{border-color:#000;background-color:#000}.csf-field-typography .csf--toggle{position:absolute;top:5px;right:10px;color:#999}.csf-field-typography .csf--block-extra-styles{margin-top:5px}.csf-field-upload input{width:100%;margin:0}.csf-field-upload .csf--wrap{display:flex;align-items:flex-start}.csf-field-upload .button{margin-left:5px}.csf-field-wp_editor .csf-wp-editor{float:left;width:100%}.csf-field-wp_editor .mce-toolbar-grp{border:none}.csf-field-wp_editor .mce-btn.mce-active button,.csf-field-wp_editor .mce-btn.mce-active i,.csf-field-wp_editor .mce-btn.mce-active:hover button,.csf-field-wp_editor .mce-btn.mce-active:hover i{color:#23282d}.csf-field-wp_editor .wp-media-buttons{position:relative;z-index:2}.csf-field-wp_editor .wp-editor-tabs{position:relative;z-index:1}.csf-field-wp_editor .csf-no-tinymce{border:1px solid #e5e5e5}.csf-field-wp_editor .csf-no-quicktags .wp-media-buttons{float:none;display:block}.csf-field-wp_editor .csf-no-quicktags .mce-tinymce{box-shadow:none;border:1px solid #e5e5e5}.csf-field-wp_editor textarea{width:100%;max-width:100%;margin:0;box-shadow:none}.csf-field-heading{font-size:1.5em;font-weight:700;color:#23282d;background-color:#f5f5f5}.csf-field-subheading{font-size:14px;font-weight:700;padding-top:17px;padding-bottom:17px;color:#23282d;background-color:#f7f7f7}.csf-field-submessage{padding:0!important;border:0!important}.csf-field-submessage+.csf-field{border-top:0!important}.csf-submessage{font-size:12px;padding:17px 30px;border-top:1px solid transparent;border-bottom:1px solid transparent}.csf-submessage-success{color:#3c763d;border-color:#d6e9c6;background-color:#dff0d8}.csf-submessage-info{color:#31708f;border-color:#bce8f1;background-color:#d9edf7}.csf-submessage-warning{color:#8a6d3b;border-color:#faebcc;background-color:#fcf8e3}.csf-submessage-danger{color:#a94442;border-color:#ebccd1;background-color:#f2dede}.csf-submessage-normal{color:#23282d;border-color:#eee;background-color:#f7f7f7}.csf-field-notice{background-color:#f7f7f7}.csf-notice{padding:12px;background-color:#fff;border-left-style:solid;border-left-width:4px;box-shadow:0 1px 1px rgba(0,0,0,.1)}.csf-notice-success{border-color:#46b450}.csf-notice-info{border-color:#339fd4}.csf-notice-warning{border-color:#ffbc00}.csf-notice-danger{border-color:#dc3232}.csf-notice-normal{border-color:#222}.csf-field-number input{width:100%;margin:0}.csf-field-number .csf--wrap{position:relative;float:left;width:100px}.csf-field-number .csf--unit{position:absolute;z-index:1;right:4px;top:4px;bottom:4px;padding:2px 6px;color:#666;font-size:11px;line-height:1;border-radius:2px;background:#eee;user-select:none;display:flex;justify-content:center;flex-direction:column}.csf-help{cursor:help;position:absolute;top:0;right:0;padding:5px;font-size:13px;color:#aaa}.csf-help .csf-help-text{display:none}.csf-image-preview{display:inline-block;position:relative;padding:4px;min-width:44px;min-height:22px;margin-bottom:10px;border:1px solid #ccc;background-color:#f9f9f9;-moz-box-shadow:0 1px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.08);box-shadow:0 1px 0 rgba(0,0,0,.08)}.csf-image-preview img{max-height:90px;display:inline-block;vertical-align:middle}.csf-field-custom .csf-field{padding:0}.csf-field .chosen-container-single .chosen-single{height:28px;line-height:26px}.csf-field .chosen-container-single .chosen-single abbr{top:0;right:20px;font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:12px;height:100%;width:18px;color:#aaa;text-align:center;background:0 0}.csf-field .chosen-container-single .chosen-single abbr:before{content:"\f00d"}.csf-field .chosen-container-single .chosen-single abbr:hover{color:#555}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close{font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:12px;height:100%;width:18px;color:#aaa;text-align:center;background:0 0}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before{content:"\f00d";display:inline-block;padding-top:3px}.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{color:#555}.csf-field .chosen-container-single .chosen-single div b{font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:14px;color:#aaa;background:0 0}.csf-field .chosen-container-single .chosen-single div b:before{content:"\f107"}.csf-field .chosen-container-single .chosen-single div b:hover{color:#555}.csf-field .chosen-container-multi .chosen-choices li.search-choice-placeholder{border:1px dashed #aaa;margin:3px 5px 3px 0}.csf-field .chosen-container-multi .ui-sortable li.search-choice span{cursor:move}.csf-field .chosen-container-active.chosen-with-drop .chosen-single div b:before{content:"\f106"}.csf-field .chosen-container-single .chosen-single-with-deselect span{margin-right:40px}.csf-field .chosen-container-single .chosen-search input[type=text]{background:0 0}.csf-field .chosen-container-single .chosen-search:before{font-family:"Font Awesome 5 Pro","Font Awesome 5 Free",FontAwesome;font-weight:900;font-size:11px;content:"\f002";position:absolute;right:12px;top:10px;color:#aaa}.csf-field .wp-picker-container{display:inline-block}.csf-field .wp-picker-container .wp-color-result.button{margin-bottom:0}.csf-field .csf--transparent-wrap{display:none;position:relative;top:-1px;width:235px;padding:9px 10px;border:1px solid #dfdfdf;border-top:none;background-color:#fff}.csf-field .wp-picker-active .csf--transparent-wrap{display:block}.csf-field .csf--transparent-slider{position:absolute;width:190px;margin-left:2px;height:18px}.csf-field .csf--transparent-slider .ui-slider-handle{position:absolute;top:-3px;bottom:-3px;z-index:5;border-color:#aaa;border-style:solid;border-width:4px 3px;width:10px;height:16px;margin:0 -5px;background:0 0;cursor:ew-resize;opacity:.9;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-moz-box-shadow:0 1px 2px rgba(0,0,0,.2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 1px 2px rgba(0,0,0,.2)}.csf-field .csf--transparent-slider .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.csf-field .csf--transparent-offset{height:18px;width:200px;background:url(../images/checkerboard.png) repeat-y center left scroll #fff;-moz-box-shadow:0 0 5px rgba(0,0,0,.4) inset;-webkit-box-shadow:0 0 5px rgba(0,0,0,.4) inset;box-shadow:0 0 5px rgba(0,0,0,.4) inset;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-field .csf--transparent-text{position:absolute;top:12px;right:10px;width:30px;font-size:12px;line-height:12px;text-align:center;color:#999}.csf-field .csf--transparent-button{cursor:pointer;user-select:none;margin-top:10px;font-size:11px;text-align:center;border-radius:2px;padding:3px 7px;box-shadow:0 1px 0 rgba(0,0,0,.1);letter-spacing:.2px;color:#777;border:1px solid #ccc;background-color:#f7f7f7;transition:background-color .2s,border-color .2s,color .2s}.csf-field .csf--transparent-active .wp-color-result{background-image:url(../images/checkerboard.png);background-size:135px;background-position:center left;background-color:transparent!important}.csf-field .csf--transparent-active .csf--transparent-button{color:#fff;border-color:#3ea032;background-color:#4fb845}.csf-field .csf--transparent-active .fa:before{content:"\f205"}.csf-widgets>.csf-field{position:relative;top:-1px;margin-right:-15px;margin-left:-15px;padding:12px 15px}.csf-widgets>.csf-field .csf-field{margin-left:0;margin-right:0}.csf-widgets>.csf-field .csf-title{float:none;width:100%;margin-bottom:5px}.csf-widgets>.csf-field .csf-fieldset{float:none;width:100%}.csf-widgets .csf-field-text input{width:100%}.csf-widgets .csf-field-notice .csf-notice{padding:15px}.control-section .csf-widgets>.csf-field{margin-right:-10px;margin-left:-10px;padding:10px 12px}.control-section .csf-field{padding:0}.control-section .csf-field .csf-title{float:none;width:100%;margin-bottom:6px}.control-section .csf-field .csf-title h4{display:block;font-size:13px;line-height:1;font-weight:600;color:inherit}.control-section .csf-field .csf-fieldset{float:none;width:100%}.control-section .csf-help{top:-5px;right:-5px}.control-section .csf-field-select select{width:100%}.control-section .csf-field-heading{color:inherit;font-size:14px;line-height:1em;margin-right:-15px;margin-left:-15px;padding:15px}.control-section .csf-field-subheading{color:inherit;font-size:11px;margin-right:-15px;margin-left:-15px;padding:10px 15px}.control-section .csf-subtitle-text{margin-top:4px;font-size:12px}.control-section .csf-field-submessage .csf-submessage{margin-right:-15px;margin-left:-15px;padding:15px}.control-section .csf-fieldset .csf-field-heading,.control-section .csf-fieldset .csf-field-subheading,.control-section .csf-fieldset .csf-field-submessage .csf-submessage{margin-left:0;margin-right:0}.control-section .csf-field-date .csf--to{margin-left:0}.control-section .csf-field-sorter ul li{padding:5px}.control-section .csf-field-sorter .csf-modules{float:none;width:100%}.control-section .csf-field-sorter .csf-modules:first-child{padding-right:0;padding-bottom:15px}.control-section .csf-field-background .csf--background-attributes{flex-direction:column}.control-section .csf-field-spacing input{width:90px}.control-section .csf-field-border .csf--input{flex:1 50%}.control-section .csf-field-border input,.control-section .csf-field-border select{width:100%}.control-section .csf-field-spinner input{width:50px}.control-section .csf-field-number .csf--wrap{width:100%}.control-section .csf-field-backup .csf-export-data{display:none}.control-section .csf-field-fieldset .csf-fieldset-content{border-color:#e5e5e5}.control-section .csf-accordion-content>.csf-field,.control-section .csf-cloneable-content>.csf-field,.control-section .csf-fieldset-content>.csf-field,.control-section .csf-repeater-content>.csf-field,.control-section .csf-sortable-content>.csf-field,.control-section .csf-tabbed-content>.csf-field{padding:10px}.control-section .csf-accordion-content>.csf-field .csf-title,.control-section .csf-cloneable-content>.csf-field .csf-title,.control-section .csf-fieldset-content>.csf-field .csf-title,.control-section .csf-repeater-content>.csf-field .csf-title,.control-section .csf-sortable-content>.csf-field .csf-title,.control-section .csf-tabbed-content>.csf-field .csf-title{margin-bottom:5px}.control-section .csf-accordion-content>.csf-field h4,.control-section .csf-cloneable-content>.csf-field h4,.control-section .csf-fieldset-content>.csf-field h4,.control-section .csf-repeater-content>.csf-field h4,.control-section .csf-sortable-content>.csf-field h4,.control-section .csf-tabbed-content>.csf-field h4{font-size:12px}.control-section .csf-depend-hidden.csf-depend-on{display:none!important}.control-section .csf-depend-visible.csf-depend-on{border-top:0!important}.csf-taxonomy{max-width:95%}.csf-taxonomy>.csf-field{border-top:none!important}.csf-taxonomy>.csf-field-heading{font-size:1.1em;padding:20px!important;border:1px solid #ddd}.csf-taxonomy>.csf-field-subheading{font-size:12px;padding:15px!important;border:1px solid #ddd}.csf-taxonomy>.csf-field-submessage .csf-submessage{padding:15px;border-left-width:1px;border-left-style:solid;border-right-width:1px;border-right-style:solid}.csf-taxonomy>.csf-field-notice{background-color:transparent}.csf-taxonomy .csf-section-title{display:block;padding:15px;background-color:#f9f9f9;border:1px solid #e5e5e5;-moz-box-shadow:0 1px 1px rgba(0,0,0,.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04)}.csf-taxonomy-add-fields>.csf-field{padding:8px 0}.csf-taxonomy-add-fields>.csf-field>.csf-title{float:none;width:100%;padding:2px 2px 4px 0}.csf-taxonomy-add-fields>.csf-field>.csf-title h4{font-size:12px;font-weight:400}.csf-taxonomy-add-fields>.csf-field>.csf-fieldset{float:none;width:100%}.csf-taxonomy-add-fields>.csf-field>.csf-fieldset>.csf-help{right:-5px}.csf-taxonomy-add-fields+p.submit{margin-top:0}.csf-taxonomy-edit-fields>.csf-field{padding:20px 0}.csf-taxonomy-edit-fields>.csf-field>.csf-title{width:200px}.csf-taxonomy-edit-fields>.csf-field>.csf-title h4{font-size:14px;font-weight:600;line-height:1.3;display:inline-block;vertical-align:middle}.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset{width:calc(100% - 220px)}.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset>.csf-help{top:-5px;right:-5px}.csf-taxonomy-edit-fields>.csf-field-submessage{margin:20px 0}.csf-taxonomy-edit-fields>.csf-field-heading,.csf-taxonomy-edit-fields>.csf-field-subheading{margin:20px 0;border:1px solid #ddd}.csf-nav-menu-options{clear:both;float:left;width:100%}.csf-nav-menu-options>.csf-fields{margin-left:-10px;margin-top:10px;margin-bottom:10px;border-top:1px solid #eee;border-bottom:1px solid #eee}.csf-nav-menu-options>.csf-fields>.csf-field{padding:12px 14px 12px 12px}.csf-nav-menu-options>.csf-fields>.csf-field .csf-title{float:none;width:100%;margin-bottom:5px}.csf-nav-menu-options>.csf-fields>.csf-field .csf-fieldset{float:none;width:100%}.csf-nav-menu-options .csf-field-text input{width:100%}.csf-nav-menu-options .csf-field-notice .csf-notice{padding:15px}.csf-nav-menu-title{padding:12px 14px 12px 12px;background-color:#f5f5f5;border-top:1px solid #eee;border-bottom:1px solid #eee}.csf-nav-menu-title:first-child{border-top:0}.csf-nav-menu-title h4{margin:0;padding:0;color:#23282d}.csf-nav-menu-icon{margin-right:5px}.csf-profile-options>h2>.fa{padding-right:7px}.csf-profile-options>.csf-field{max-width:750px;padding:15px 0;border-top:none!important}.csf-profile-options>.csf-field>.csf-title{width:200px}.csf-profile-options>.csf-field>.csf-title h4{font-size:14px;font-weight:600;line-height:1.3;display:inline-block;vertical-align:middle}.csf-profile-options>.csf-field>.csf-fieldset{width:calc(100% - 220px)}.csf-profile-options>.csf-field>.csf-fieldset>.csf-help{top:-15px;right:-5px}.csf-profile-options>.csf-field-heading{font-size:1.1em}.csf-profile-options>.csf-field-subheading{font-size:12px}.csf-profile-options>.csf-field-heading,.csf-profile-options>.csf-field-subheading{margin:10px 0;padding:15px!important;border:1px solid #ddd}.csf-profile-options>.csf-field-submessage{margin:20px 0}.csf-profile-options>.csf-field-submessage .csf-submessage{padding:10px;border-left-width:1px;border-left-style:solid;border-right-width:1px;border-right-style:solid}.csf-profile-options>.csf-field-notice{background-color:transparent}.csf-modal{position:fixed;z-index:100101;top:0;left:0;width:100%;height:100%}.csf-modal.hidden{display:none}.csf-modal-icon{z-index:100102}.csf-modal-table{display:table;width:100%;height:100%}.csf-modal-table-cell{display:table-cell;vertical-align:middle;margin:100px 0}.csf-modal-inner{position:relative;z-index:10;width:760px;height:750px;margin:0 auto;background-color:#fff}.csf-modal-content{position:relative;overflow:hidden;overflow-y:auto;height:595px}.csf-modal-content .csf-shortcode-button{display:none}.csf-modal-content .csf-field{padding:15px 30px 15px 15px}.csf-modal-content a:active,.csf-modal-content a:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.csf-modal-content h4{font-size:13px}.csf-modal-content h4 small{font-style:italic;font-weight:400;color:#aaa}.csf-modal-title{position:relative;background-color:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:16px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}.csf-modal-header{width:100%;padding:14px 0;background-color:#f5f5f5;border-bottom:1px solid #eee}.csf-modal-header select{display:block;width:250px;margin:0 auto;font-size:13px;line-height:1;height:30px;min-height:30px;background-color:#fff}.csf-modal-close{color:#666;padding:0;position:absolute;top:0;right:0;width:36px;height:36px;text-align:center;background:0 0;border:none;cursor:pointer}.csf-modal-close:before{font:normal 20px/36px dashicons;content:"\f158";vertical-align:top;width:36px;height:36px}.csf-modal-close:hover{opacity:.5}.csf-modal-insert-wrapper{text-align:center;width:100%;padding:15px 0;background-color:#f5f5f5;border-top:1px solid #eee}.csf-modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:.5}.csf--repeatable{padding:15px 15px 0 15px}.csf--repeat-button-block{text-align:center;padding-bottom:15px}.csf--repeat-shortcode{position:relative;margin-bottom:15px;border:1px dashed #ddd}.csf--repeat-shortcode:first-child .csf-repeat-remove{display:none}.csf--repeat-shortcode .csf-repeat-remove{position:absolute;right:10px;top:10px;z-index:10;cursor:pointer;display:inline-block;font-size:11px;width:18px;height:18px;line-height:18px;text-align:center;border-radius:2px;color:#fff;background-color:#e14d43;opacity:.5}.csf--repeat-shortcode .csf-repeat-remove:hover{opacity:1}.csf-shortcode-single .csf-modal-inner{height:750px}.csf-shortcode-single .csf-modal-content{height:652px}.elementor-editor-active .csf-shortcode-button{margin-left:5px}.elementor-editor-active .csf-modal .hidden{display:none!important}.csf-shortcode-block{text-align:center;padding:14px;font-size:13px;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.csf-shortcode-block .components-button{margin-bottom:10px}.csf-modal-icon .csf-icon-title{padding:15px 0;margin:4px;font-size:14px;font-weight:700;text-align:center;border:1px solid #eee;background-color:#f7f7f7}.csf-modal-icon .csf-modal-header{text-align:center}.csf-modal-icon .csf-icon-search{width:50%;height:40px;line-height:40px}.csf-modal-icon i{cursor:pointer;display:inline-block;margin:4px;width:35px;height:35px;line-height:35px;font-size:16px;color:#555;text-align:center;border:1px solid #ccc;background-color:#f7f7f7;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:1px 1px 0 rgba(0,0,0,.05);-webkit-box-shadow:1px 1px 0 rgba(0,0,0,.05);box-shadow:1px 1px 0 rgba(0,0,0,.05)}.csf-modal-icon i:hover{color:#fff;border-color:#222;background-color:#222}.csf-modal-icon .csf-modal-content{padding:10px;height:618px}.csf-modal-icon .csf-error-text{padding:10px}.csf-modal-loading{display:none;position:absolute;left:15px;top:15px}.csf-loading{position:relative;width:20px;height:20px;background:#ccc;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;-moz-box-shadow:0 2px 5px rgba(0,0,0,.07);-webkit-box-shadow:0 2px 5px rgba(0,0,0,.07);box-shadow:0 2px 5px rgba(0,0,0,.07)}.csf-loading:after{position:absolute;top:50%;left:50%;width:4px;height:4px;content:"";margin-top:-2px;margin-left:-2px;background-color:#fff;-moz-animation-duration:.5s;-webkit-animation-duration:.5s;animation-duration:.5s;-moz-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-moz-animation-timing-function:linear;-webkit-animation-timing-function:linear;animation-timing-function:linear;-moz-animation-name:csfLoader;-webkit-animation-name:csfLoader;animation-name:csfLoader;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}@-moz-keyframes csfLoader{0%{-moz-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-moz-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}@-webkit-keyframes csfLoader{0%{-webkit-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-webkit-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}@keyframes csfLoader{0%{-moz-transform:rotate(0) translateX(-6px) rotate(0);-ms-transform:rotate(0) translateX(-6px) rotate(0);-webkit-transform:rotate(0) translateX(-6px) rotate(0);transform:rotate(0) translateX(-6px) rotate(0)}100%{-moz-transform:rotate(360deg) translateX(-6px) rotate(-360deg);-ms-transform:rotate(360deg) translateX(-6px) rotate(-360deg);-webkit-transform:rotate(360deg) translateX(-6px) rotate(-360deg);transform:rotate(360deg) translateX(-6px) rotate(-360deg)}}.csf-subtitle-text{margin-top:6px;font-weight:400;color:#999}.csf-desc-text{clear:both;float:left;width:100%;margin-top:6px;font-weight:400;color:#999}.csf-error-text{margin-top:6px;color:#d02c21}.csf-before-text{margin-bottom:6px}.csf-after-text{margin-top:6px}.csf-metabox-hide{display:none!important}.csf-metabox-show{display:block!important}.csf-depend-hidden.csf-depend-on{display:none}.csf-depend-visible.csf-depend-on{display:block;opacity:.75;filter:grayscale(1);user-select:none;border-top:1px solid #eee}.csf-depend-visible.csf-depend-on .clear:before{content:"";left:0;top:0;right:0;bottom:0;position:absolute;background-color:#eee;opacity:.25;z-index:10}.csf-warning-primary{color:#fff!important;border-color:#dc3545!important;background:#dc3545!important}.csf-warning-primary:focus,.csf-warning-primary:hover{border-color:#bd2130!important;background:#bd2130!important}.csf-warning-primary:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #bd2130!important}.csf-warning-primary:active{border-color:#bd2130!important;background:#bd2130!important}.csf-form-result{display:none;float:left;padding:0 8px;margin-right:4px;font-size:11px;line-height:30px;user-select:none;border-radius:2px}.csf-form-show{display:block}.csf-form-success{color:#fff;background-color:#46b450}.csf-form-warning{color:#8a6d3b;background-color:#faebcc}.csf-label-error{position:relative;top:-2px;display:inline-block;font-size:10px;line-height:10px;height:10px;width:10px;padding:1px;font-style:normal;text-align:center;color:#fff;vertical-align:middle;background-color:#e10000;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}.csf-no-option{padding:30px}.csf-input-number{-moz-appearance:textfield}.csf-input-number::-webkit-inner-spin-button,.csf-input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.csf-welcome-wrap{position:relative;margin:25px 40px 0 20px;font-size:15px;max-width:1200px}.csf-welcome-wrap p{font-size:14px;line-height:1.5}.csf-welcome-wrap h1{margin:.2em 200px 0 0;padding:0;color:#32373c;line-height:1.2em;font-size:2.8em;font-weight:400}.csf-welcome-wrap .csf-logo{position:absolute;overflow:hidden;top:0;right:0;height:160px;width:140px;background-image:linear-gradient(45deg,#2d67cb,#ad19f3);box-shadow:0 1px 4px rgba(0,0,0,.25),inset 0 0 0 4px rgba(0,0,0,.25)}.csf-welcome-wrap .csf-logo .csf--effects i{position:absolute;width:200px;height:100px;background-color:rgba(0,0,0,.15);transform:rotate(-45deg)}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(1){bottom:-20px;right:-70px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(2){bottom:-35px;right:-80px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(3){bottom:-50px;right:-90px}.csf-welcome-wrap .csf-logo .csf--effects i:nth-child(4){bottom:-65px;right:-100px}.csf-welcome-wrap .csf-logo .csf--wp-logos{position:relative;padding-top:25px;text-align:center}.csf-welcome-wrap .csf-logo .csf--wp-logo{position:absolute;left:20px;width:20px;height:20px;background-repeat:no-repeat;background-position:center center;background-image:url(../images/wp-logo.svg)}.csf-welcome-wrap .csf-logo .csf--wp-plugin-logo{display:inline-block;width:50px;height:50px;border:3px solid #fff;background-size:40px;background-repeat:no-repeat;background-position:center center;background-image:url(../images/wp-plugin-logo.svg);border-radius:100%;vertical-align:middle}.csf-welcome-wrap .csf-logo .csf--text{position:absolute;left:0;right:0;top:90px;color:#fff;font-size:13px;line-height:1.2em;font-weight:600;text-align:center;text-transform:uppercase;text-shadow:1px 1px 0 rgba(0,0,0,.25)}.csf-welcome-wrap .csf-logo .csf--version{top:auto;left:auto;right:8px;bottom:4px;font-size:11px;text-transform:lowercase}.csf-welcome-wrap .csf-about-text{font-weight:400;line-height:1.6em;font-size:19px;margin:1em 200px 1em 0;color:#555d66}.csf-welcome-wrap .csf-demo-button{margin:1em 200px 2em 0}.csf-welcome-wrap .nav-tab-wrapper{margin-bottom:20px}.csf-welcome-wrap ul{list-style-type:disc;padding-left:15px}.csf-welcome-wrap .csf--col{float:left;padding-right:20px;box-sizing:border-box}.csf-welcome-wrap .csf--col-2{width:50%}.csf-welcome-wrap .csf--col-3{width:33.333%}.csf-welcome-wrap .csf--col-4{width:25%}.csf-welcome-wrap .csf--col-5{width:20%}.csf-welcome-wrap .csf--col-last{padding-right:0}.csf-welcome-wrap .csf--col-upgrade{padding:10px 0;text-align:center;border-top:1px solid #e5e5e5}.csf--table-compare tfoot td,.csf--table-compare thead td{text-align:center}.csf--table-compare td{font-size:14px;text-align:center;vertical-align:middle;padding:10px}.csf--table-compare td:first-child{text-align:left}.csf--table-compare tfoot td{padding:15px 0}.csf--table-compare .fa{font-size:18px}.csf--table-compare .fa-check-circle{color:#46b450}.csf--table-compare .fa-times-circle{color:#dc3232}.csf-welcome-cols{clear:both;margin:20px 0;background-color:#fff;padding:0 0;border-radius:2px;border:1px solid #e5e5e5}.csf-welcome-cols .csf--col{width:33.333%;float:left;padding:20px;text-align:center;box-sizing:border-box;min-height:200px;border-right:1px solid #e5e5e5}.csf-welcome-cols .csf--block,.csf-welcome-cols .csf--left{float:left;width:20%;padding:0 30px;text-align:center;box-sizing:border-box}.csf-welcome-cols .csf--block{width:80%}.csf-welcome-cols .csf--col-first{border-bottom:1px solid #e5e5e5}.csf-welcome-cols .csf--last{border-right:none}.csf-welcome-cols .csf--space{height:20px}.csf-welcome-cols .csf--icon{display:inline-block;font-size:20px;width:30px;height:30px;line-height:30px;text-align:center;margin-bottom:10px;color:#fff;background-color:#555;border-radius:30px}.csf-welcome-cols .csf--active{background-color:#5cb85c}.csf-welcome-cols .csf--deactive{background-color:#e14d43}.csf-welcome-cols .csf--title{font-weight:700;display:block}.csf-welcome-cols p:last-child{margin-bottom:0}.csf-features-cols .csf--key-features{width:30%}.csf-features-cols .csf--available-fields{width:70%}.csf-code-block{margin:20px 0;padding:5px 20px;background-color:#fff;border-radius:2px;box-shadow:0 1px 1px rgba(0,0,0,.15)}.csf-code-block pre{font-size:13px;color:#0073aa}.csf-code-block pre span{color:#999}.csf--table-fields td{font-size:14px}.csf--upgrade a{color:#5cb85c;font-weight:700}.csf--upgrade a:focus,.csf--upgrade a:hover{color:#4aa14a;outline:0;box-shadow:none}@media only screen and (max-width:782px){.csf-welcome-cols .csf--col{width:100%;min-height:auto;border-right:none;border-bottom:1px solid #e5e5e5}.csf-features-cols .csf--key-features{width:100%}.csf-features-cols .csf--available-fields{width:100%}}@media only screen and (max-width:1200px){.csf-metabox .csf-field .csf-title{float:none;width:100%;margin-bottom:10px}.csf-metabox .csf-field .csf-fieldset{float:none;width:100%}}@media only screen and (max-width:782px){.csf-header-inner{text-align:center}.csf-header-inner h1{width:100%;margin-bottom:10px}.csf-form-result{float:none;margin-right:0;margin-bottom:10px}.csf-header-left,.csf-header-right,.csf-search{width:100%}.csf-search{text-align:center;margin-bottom:15px}.csf-footer{text-align:center}.csf-buttons{float:none}.csf-copyright{float:none;margin-top:10px}.csf-expand-all,.csf-nav,.csf-nav-background,.csf-reset-section{display:none!important}.csf-content{margin-left:0}.csf-section,.csf-section-title{display:block!important}.csf-field .csf-title{float:none;width:100%;margin-bottom:10px}.csf-field .csf-fieldset{float:none;width:100%}.csf-field-color .button.wp-picker-clear{padding:0 8px;line-height:2.14285714;min-height:32px}.csf-modal-inner{width:350px;height:400px}.csf-modal-content{height:237px}.csf-icon-dialog .csf-modal-inner{width:305px;height:380px}.csf-icon-dialog .csf-modal-content{height:267px}.csf-modal-icon .csf-modal-inner{width:330px;height:385px}.csf-modal-icon .csf-modal-content{height:252px}.csf-profile-options>.csf-field>.csf-title,.csf-taxonomy-edit-fields>.csf-field>.csf-title{float:none;width:100%;margin-bottom:10px}.csf-profile-options>.csf-field>.csf-fieldset,.csf-taxonomy-edit-fields>.csf-field>.csf-fieldset{float:none;width:100%}.csf-nav-menu-options>.csf-fields{margin-left:-10px;margin-right:-10px}.csf-nav-menu-options>.csf-fields>.csf-field{padding:10px}}.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;user-select:none}.chosen-container *{box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15);clip:rect(0,0,0,0);clip-path:inset(100% 100%)}.chosen-container.chosen-with-drop .chosen-drop{clip:auto;clip-path:none}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;font-size:1px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;clip:rect(0,0,0,0);clip-path:inset(100% 100%)}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;outline:0;border:0!important;background:0 0!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px;height:25px;min-height:25px}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 6px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:0;right:0;display:block;width:12px;height:12px;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;border-bottom-right-radius:0;border-bottom-left-radius:0;background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:none;background:0 0}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:none}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;direction:rtl}
includes/libs/codestar-framework/assets/images/checkerboard.png ADDED
Binary file
includes/libs/codestar-framework/assets/images/wp-logo.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><g fill="#fff"><path d="M20 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10 10-4.48 10-10zM10 1.01c4.97 0 8.99 4.02 8.99 8.99s-4.02 8.99-8.99 8.99S1.01 14.97 1.01 10 5.03 1.01 10 1.01zM8.01 14.82L4.96 6.61c.49-.03 1.05-.08 1.05-.08.43-.05.38-1.01-.06-.99 0 0-1.29.1-2.13.1-.15 0-.33 0-.52-.01 1.44-2.17 3.9-3.6 6.7-3.6 2.09 0 3.99.79 5.41 2.09-.6-.08-1.45.35-1.45 1.42 0 .66.38 1.22.79 1.88.31.54.5 1.22.5 2.21 0 1.34-1.27 4.48-1.27 4.48l-2.71-7.5c.48-.03.75-.16.75-.16.43-.05.38-1.1-.05-1.08 0 0-1.3.11-2.14.11-.78 0-2.11-.11-2.11-.11-.43-.02-.48 1.06-.05 1.08l.84.08 1.12 3.04zm6.02 2.15L16.64 10s.67-1.69.39-3.81c.63 1.14.94 2.42.94 3.81 0 2.96-1.56 5.58-3.94 6.97zM2.68 6.77L6.5 17.25c-2.67-1.3-4.47-4.08-4.47-7.25 0-1.16.2-2.23.65-3.23zm7.45 4.53l2.29 6.25c-.75.27-1.57.42-2.42.42-.72 0-1.41-.11-2.06-.3z"/></g></g></svg>
includes/libs/codestar-framework/assets/images/wp-plugin-logo.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><g fill="#fff"><path d="M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z"/></g></g></svg>
includes/libs/codestar-framework/assets/js/gutenberg.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * -----------------------------------------------------------
4
+ *
5
+ * Codestar Framework Gutenberg Block
6
+ * A Simple and Lightweight WordPress Option Framework
7
+ *
8
+ * -----------------------------------------------------------
9
+ *
10
+ */
11
+ ( function( blocks, blockEditor, element, components ) {
12
+
13
+ if( !window.csf_gutenberg_blocks ) { return; }
14
+
15
+ window.csf_gutenberg_blocks.forEach( function( block ) {
16
+
17
+ var registerBlockType = blocks.registerBlockType;
18
+ var PlainText = blockEditor.PlainText;
19
+ var createElement = element.createElement;
20
+ var RawHTML = element.RawHTML;
21
+ var Button = components.Button;
22
+
23
+ registerBlockType('csf-gutenberg-block/block-'+block.hash, {
24
+ title: block.gutenberg.title,
25
+ icon: block.gutenberg.icon,
26
+ category: block.gutenberg.category,
27
+ description: block.gutenberg.description,
28
+ keywords: block.gutenberg.keywords,
29
+ supports: {
30
+ html: false,
31
+ className: false,
32
+ customClassName: false,
33
+ },
34
+ attributes: {
35
+ shortcode: {
36
+ string: 'string',
37
+ source: 'text',
38
+ }
39
+ },
40
+ edit: function (props) {
41
+ return (
42
+ createElement('div', {className: 'csf-shortcode-block'},
43
+
44
+ createElement(Button, {
45
+ 'data-modal-id': block.modal_id,
46
+ 'data-gutenberg-id': block.hash,
47
+ className: 'is-secondary csf-shortcode-button',
48
+ onClick: function () {
49
+ window.csf_gutenberg_props = props;
50
+ },
51
+ }, block.button_title ),
52
+
53
+ createElement(PlainText, {
54
+ placeholder: block.gutenberg.placeholder,
55
+ className: 'input-control',
56
+ onChange: function (value) {
57
+ props.setAttributes({
58
+ shortcode: value
59
+ });
60
+ },
61
+ value: props.attributes.shortcode
62
+ })
63
+
64
+ )
65
+ );
66
+ },
67
+ save: function (props) {
68
+ return createElement(RawHTML, {}, props.attributes.shortcode);
69
+ }
70
+ });
71
+
72
+ });
73
+
74
+ })(
75
+ window.wp.blocks,
76
+ window.wp.blockEditor,
77
+ window.wp.element,
78
+ window.wp.components
79
+ );
includes/libs/codestar-framework/assets/js/main.js ADDED
@@ -0,0 +1,3321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * -----------------------------------------------------------
4
+ *
5
+ * Codestar Framework
6
+ * A Simple and Lightweight WordPress Option Framework
7
+ *
8
+ * -----------------------------------------------------------
9
+ *
10
+ */
11
+ ;(function( $, window, document, undefined ) {
12
+ 'use strict';
13
+
14
+ //
15
+ // Constants
16
+ //
17
+ var CSF = CSF || {};
18
+
19
+ CSF.funcs = {};
20
+
21
+ CSF.vars = {
22
+ onloaded: false,
23
+ $body: $('body'),
24
+ $window: $(window),
25
+ $document: $(document),
26
+ $form_warning: null,
27
+ is_confirm: false,
28
+ form_modified: false,
29
+ code_themes: [],
30
+ is_rtl: $('body').hasClass('rtl'),
31
+ };
32
+
33
+ //
34
+ // Helper Functions
35
+ //
36
+ CSF.helper = {
37
+
38
+ //
39
+ // Generate UID
40
+ //
41
+ uid: function( prefix ) {
42
+ return ( prefix || '' ) + Math.random().toString(36).substr(2, 9);
43
+ },
44
+
45
+ // Quote regular expression characters
46
+ //
47
+ preg_quote: function( str ) {
48
+ return (str+'').replace(/(\[|\-|\])/g, "\\$1");
49
+ },
50
+
51
+ //
52
+ // Reneme input names
53
+ //
54
+ name_nested_replace: function( $selector, field_id ) {
55
+
56
+ var checks = [];
57
+ var regex = new RegExp('('+ CSF.helper.preg_quote(field_id) +')\\[(\\d+)\\]', 'g');
58
+
59
+ $selector.find(':radio').each(function() {
60
+ if ( this.checked || this.orginal_checked ) {
61
+ this.orginal_checked = true;
62
+ }
63
+ });
64
+
65
+ $selector.each( function( index ) {
66
+ $(this).find(':input').each(function() {
67
+ this.name = this.name.replace(regex, field_id +'['+ index +']');
68
+ if ( this.orginal_checked ) {
69
+ this.checked = true;
70
+ }
71
+ });
72
+ });
73
+
74
+ },
75
+
76
+ //
77
+ // Debounce
78
+ //
79
+ debounce: function( callback, threshold, immediate ) {
80
+ var timeout;
81
+ return function() {
82
+ var context = this, args = arguments;
83
+ var later = function() {
84
+ timeout = null;
85
+ if ( !immediate ) {
86
+ callback.apply(context, args);
87
+ }
88
+ };
89
+ var callNow = ( immediate && !timeout );
90
+ clearTimeout( timeout );
91
+ timeout = setTimeout( later, threshold );
92
+ if ( callNow ) {
93
+ callback.apply(context, args);
94
+ }
95
+ };
96
+ },
97
+
98
+ };
99
+
100
+ //
101
+ // Custom clone for textarea and select clone() bug
102
+ //
103
+ $.fn.csf_clone = function() {
104
+
105
+ var base = $.fn.clone.apply(this, arguments),
106
+ clone = this.find('select').add(this.filter('select')),
107
+ cloned = base.find('select').add(base.filter('select'));
108
+
109
+ for( var i = 0; i < clone.length; ++i ) {
110
+ for( var j = 0; j < clone[i].options.length; ++j ) {
111
+
112
+ if ( clone[i].options[j].selected === true ) {
113
+ cloned[i].options[j].selected = true;
114
+ }
115
+
116
+ }
117
+ }
118
+
119
+ this.find(':radio').each( function() {
120
+ this.orginal_checked = this.checked;
121
+ });
122
+
123
+ return base;
124
+
125
+ };
126
+
127
+ //
128
+ // Expand All Options
129
+ //
130
+ $.fn.csf_expand_all = function() {
131
+ return this.each( function() {
132
+ $(this).on('click', function( e ) {
133
+
134
+ e.preventDefault();
135
+ $('.csf-wrapper').toggleClass('csf-show-all');
136
+ $('.csf-section').csf_reload_script();
137
+ $(this).find('.fa').toggleClass('fa-indent').toggleClass('fa-outdent');
138
+
139
+ });
140
+ });
141
+ };
142
+
143
+ //
144
+ // Options Navigation
145
+ //
146
+ $.fn.csf_nav_options = function() {
147
+ return this.each( function() {
148
+
149
+ var $nav = $(this),
150
+ $links = $nav.find('a'),
151
+ $last;
152
+
153
+ $(window).on('hashchange csf.hashchange', function() {
154
+
155
+ var hash = window.location.hash.replace('#tab=', '');
156
+ var slug = hash ? hash : $links.first().attr('href').replace('#tab=', '');
157
+ var $link = $('[data-tab-id="'+slug+'"]');
158
+
159
+ if ( $link.length ) {
160
+
161
+ $link.closest('.csf-tab-item').addClass('csf-tab-expanded').siblings().removeClass('csf-tab-expanded');
162
+
163
+ if( $link.next().is('ul') ) {
164
+
165
+ $link = $link.next().find('li').first().find('a');
166
+ slug = $link.data('tab-id');
167
+
168
+ }
169
+
170
+ $links.removeClass('csf-active');
171
+ $link.addClass('csf-active');
172
+
173
+ if ( $last ) {
174
+ $last.hide();
175
+ }
176
+
177
+ var $section = $('[data-section-id="'+slug+'"]');
178
+
179
+ $section.show();
180
+ $section.csf_reload_script();
181
+
182
+ $('.csf-section-id').val( $section.index() );
183
+
184
+ $last = $section;
185
+
186
+ }
187
+
188
+ }).trigger('csf.hashchange');
189
+
190
+ });
191
+ };
192
+
193
+ //
194
+ // Metabox Tabs
195
+ //
196
+ $.fn.csf_nav_metabox = function() {
197
+ return this.each( function() {
198
+
199
+ var $nav = $(this),
200
+ $links = $nav.find('a'),
201
+ $sections = $nav.parent().find('.csf-section'),
202
+ $last;
203
+
204
+ $links.each( function( index ) {
205
+
206
+ $(this).on('click', function( e ) {
207
+
208
+ e.preventDefault();
209
+
210
+ var $link = $(this);
211
+
212
+ $links.removeClass('csf-active');
213
+ $link.addClass('csf-active');
214
+
215
+ if ( $last !== undefined ) {
216
+ $last.hide();
217
+ }
218
+
219
+ var $section = $sections.eq(index);
220
+
221
+ $section.show();
222
+ $section.csf_reload_script();
223
+
224
+ $last = $section;
225
+
226
+ });
227
+
228
+ });
229
+
230
+ $links.first().trigger('click');
231
+
232
+ });
233
+ };
234
+
235
+ //
236
+ // Metabox Page Templates Listener
237
+ //
238
+ $.fn.csf_page_templates = function() {
239
+ if ( this.length ) {
240
+
241
+ $(document).on('change', '.editor-page-attributes__template select, #page_template', function() {
242
+
243
+ var maybe_value = $(this).val() || 'default';
244
+
245
+ $('.csf-page-templates').removeClass('csf-metabox-show').addClass('csf-metabox-hide');
246
+ $('.csf-page-'+maybe_value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,'-')).removeClass('csf-metabox-hide').addClass('csf-metabox-show');
247
+
248
+ });
249
+
250
+ }
251
+ };
252
+
253
+ //
254
+ // Metabox Post Formats Listener
255
+ //
256
+ $.fn.csf_post_formats = function() {
257
+ if ( this.length ) {
258
+
259
+ $(document).on('change', '.editor-post-format select, #formatdiv input[name="post_format"]', function() {
260
+
261
+ var maybe_value = $(this).val() || 'default';
262
+
263
+ // Fallback for classic editor version
264
+ maybe_value = ( maybe_value === '0' ) ? 'default' : maybe_value;
265
+
266
+ $('.csf-post-formats').removeClass('csf-metabox-show').addClass('csf-metabox-hide');
267
+ $('.csf-post-format-'+maybe_value).removeClass('csf-metabox-hide').addClass('csf-metabox-show');
268
+
269
+ });
270
+
271
+ }
272
+ };
273
+
274
+ //
275
+ // Search
276
+ //
277
+ $.fn.csf_search = function() {
278
+ return this.each( function() {
279
+
280
+ var $this = $(this),
281
+ $input = $this.find('input');
282
+
283
+ $input.on('change keyup', function() {
284
+
285
+ var value = $(this).val(),
286
+ $wrapper = $('.csf-wrapper'),
287
+ $section = $wrapper.find('.csf-section'),
288
+ $fields = $section.find('> .csf-field:not(.csf-depend-on)'),
289
+ $titles = $fields.find('> .csf-title, .csf-search-tags');
290
+
291
+ if ( value.length > 3 ) {
292
+
293
+ $fields.addClass('csf-metabox-hide');
294
+ $wrapper.addClass('csf-search-all');
295
+
296
+ $titles.each( function() {
297
+
298
+ var $title = $(this);
299
+
300
+ if ( $title.text().match( new RegExp('.*?' + value + '.*?', 'i') ) ) {
301
+
302
+ var $field = $title.closest('.csf-field');
303
+
304
+ $field.removeClass('csf-metabox-hide');
305
+ $field.parent().csf_reload_script();
306
+
307
+ }
308
+
309
+ });
310
+
311
+ } else {
312
+
313
+ $fields.removeClass('csf-metabox-hide');
314
+ $wrapper.removeClass('csf-search-all');
315
+
316
+ }
317
+
318
+ });
319
+
320
+ });
321
+ };
322
+
323
+ //
324
+ // Sticky Header
325
+ //
326
+ $.fn.csf_sticky = function() {
327
+ return this.each( function() {
328
+
329
+ var $this = $(this),
330
+ $window = $(window),
331
+ $inner = $this.find('.csf-header-inner'),
332
+ padding = parseInt( $inner.css('padding-left') ) + parseInt( $inner.css('padding-right') ),
333
+ offset = 32,
334
+ scrollTop = 0,
335
+ lastTop = 0,
336
+ ticking = false,
337
+ stickyUpdate = function() {
338
+
339
+ var offsetTop = $this.offset().top,
340
+ stickyTop = Math.max(offset, offsetTop - scrollTop ),
341
+ winWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
342
+
343
+ if ( stickyTop <= offset && winWidth > 782 ) {
344
+ $inner.css({width: $this.outerWidth()-padding});
345
+ $this.css({height: $this.outerHeight()}).addClass( 'csf-sticky' );
346
+ } else {
347
+ $inner.removeAttr('style');
348
+ $this.removeAttr('style').removeClass( 'csf-sticky' );
349
+ }
350
+
351
+ },
352
+ requestTick = function() {
353
+
354
+ if ( !ticking ) {
355
+ requestAnimationFrame( function() {
356
+ stickyUpdate();
357
+ ticking = false;
358
+ });
359
+ }
360
+
361
+ ticking = true;
362
+
363
+ },
364
+ onSticky = function() {
365
+
366
+ scrollTop = $window.scrollTop();
367
+ requestTick();
368
+
369
+ };
370
+
371
+ $window.on( 'scroll resize', onSticky);
372
+
373
+ onSticky();
374
+
375
+ });
376
+ };
377
+
378
+ //
379
+ // Dependency System
380
+ //
381
+ $.fn.csf_dependency = function() {
382
+ return this.each( function() {
383
+
384
+ var $this = $(this),
385
+ $fields = $this.children('[data-controller]');
386
+
387
+ if( $fields.length ) {
388
+
389
+ var normal_ruleset = $.csf_deps.createRuleset(),
390
+ global_ruleset = $.csf_deps.createRuleset(),
391
+ normal_depends = [],
392
+ global_depends = [];
393
+
394
+ $fields.each( function() {
395
+
396
+ var $field = $(this),
397
+ controllers = $field.data('controller').split('|'),
398
+ conditions = $field.data('condition').split('|'),
399
+ values = $field.data('value').toString().split('|'),
400
+ is_global = $field.data('depend-global') ? true : false,
401
+ ruleset = ( is_global ) ? global_ruleset : normal_ruleset;
402
+
403
+ $.each(controllers, function( index, depend_id ) {
404
+
405
+ var value = values[index] || '',
406
+ condition = conditions[index] || conditions[0];
407
+
408
+ ruleset = ruleset.createRule('[data-depend-id="'+ depend_id +'"]', condition, value);
409
+
410
+ ruleset.include($field);
411
+
412
+ if ( is_global ) {
413
+ global_depends.push(depend_id);
414
+ } else {
415
+ normal_depends.push(depend_id);
416
+ }
417
+
418
+ });
419
+
420
+ });
421
+
422
+ if ( normal_depends.length ) {
423
+ $.csf_deps.enable($this, normal_ruleset, normal_depends);
424
+ }
425
+
426
+ if ( global_depends.length ) {
427
+ $.csf_deps.enable(CSF.vars.$body, global_ruleset, global_depends);
428
+ }
429
+
430
+ }
431
+
432
+ });
433
+ };
434
+
435
+ //
436
+ // Field: accordion
437
+ //
438
+ $.fn.csf_field_accordion = function() {
439
+ return this.each( function() {
440
+
441
+ var $titles = $(this).find('.csf-accordion-title');
442
+
443
+ $titles.on('click', function() {
444
+
445
+ var $title = $(this),
446
+ $icon = $title.find('.csf-accordion-icon'),
447
+ $content = $title.next();
448
+
449
+ if ( $icon.hasClass('fa-angle-right') ) {
450
+ $icon.removeClass('fa-angle-right').addClass('fa-angle-down');
451
+ } else {
452
+ $icon.removeClass('fa-angle-down').addClass('fa-angle-right');
453
+ }
454
+
455
+ if ( !$content.data( 'opened' ) ) {
456
+
457
+ $content.csf_reload_script();
458
+ $content.data( 'opened', true );
459
+
460
+ }
461
+
462
+ $content.toggleClass('csf-accordion-open');
463
+
464
+ });
465
+
466
+ });
467
+ };
468
+
469
+ //
470
+ // Field: backup
471
+ //
472
+ $.fn.csf_field_backup = function() {
473
+ return this.each( function() {
474
+
475
+ if ( window.wp.customize === undefined ) { return; }
476
+
477
+ var base = this,
478
+ $this = $(this),
479
+ $body = $('body'),
480
+ $import = $this.find('.csf-import'),
481
+ $reset = $this.find('.csf-reset');
482
+
483
+ base.notification = function( message_text ) {
484
+
485
+ if ( wp.customize.notifications && wp.customize.OverlayNotification ) {
486
+
487
+ // clear if there is any saved data.
488
+ if ( !wp.customize.state('saved').get() ) {
489
+ wp.customize.state('changesetStatus').set('trash');
490
+ wp.customize.each( function( setting ) { setting._dirty = false; });
491
+ wp.customize.state('saved').set(true);
492
+ }
493
+
494
+ // then show a notification overlay
495
+ wp.customize.notifications.add( new wp.customize.OverlayNotification('csf_field_backup_notification', {
496
+ type: 'info',
497
+ message: message_text,
498
+ loading: true
499
+ }));
500
+
501
+ }
502
+
503
+ };
504
+
505
+ $reset.on('click', function( e ) {
506
+
507
+ e.preventDefault();
508
+
509
+ if ( CSF.vars.is_confirm ) {
510
+
511
+ base.notification( window.csf_vars.i18n.reset_notification );
512
+
513
+ window.wp.ajax.post('csf-reset', {
514
+ unique: $reset.data('unique'),
515
+ nonce: $reset.data('nonce')
516
+ })
517
+ .done( function( response ) {
518
+ window.location.reload(true);
519
+ })
520
+ .fail( function( response ) {
521
+ alert( response.error );
522
+ wp.customize.notifications.remove('csf_field_backup_notification');
523
+ });
524
+
525
+ }
526
+
527
+ });
528
+
529
+ $import.on('click', function( e ) {
530
+
531
+ e.preventDefault();
532
+
533
+ if ( CSF.vars.is_confirm ) {
534
+
535
+ base.notification( window.csf_vars.i18n.import_notification );
536
+
537
+ window.wp.ajax.post( 'csf-import', {
538
+ unique: $import.data('unique'),
539
+ nonce: $import.data('nonce'),
540
+ data: $this.find('.csf-import-data').val()
541
+ }).done( function( response ) {
542
+ window.location.reload(true);
543
+ }).fail( function( response ) {
544
+ alert( response.error );
545
+ wp.customize.notifications.remove('csf_field_backup_notification');
546
+ });
547
+
548
+ }
549
+
550
+ });
551
+
552
+ });
553
+ };
554
+
555
+ //
556
+ // Field: background
557
+ //
558
+ $.fn.csf_field_background = function() {
559
+ return this.each( function() {
560
+ $(this).find('.csf--background-image').csf_reload_script();
561
+ });
562
+ };
563
+
564
+ //
565
+ // Field: code_editor
566
+ //
567
+ $.fn.csf_field_code_editor = function() {
568
+ return this.each( function() {
569
+
570
+ if ( typeof CodeMirror !== 'function' ) { return; }
571
+
572
+ var $this = $(this),
573
+ $textarea = $this.find('textarea'),
574
+ $inited = $this.find('.CodeMirror'),
575
+ data_editor = $textarea.data('editor');
576
+
577
+ if ( $inited.length ) {
578
+ $inited.remove();
579
+ }
580
+
581
+ var interval = setInterval(function () {
582
+ if ( $this.is(':visible') ) {
583
+
584
+ var code_editor = CodeMirror.fromTextArea( $textarea[0], data_editor );
585
+
586
+ // load code-mirror theme css.
587
+ if ( data_editor.theme !== 'default' && CSF.vars.code_themes.indexOf(data_editor.theme) === -1 ) {
588
+
589
+ var $cssLink = $('<link>');
590
+
591
+ $('#csf-codemirror-css').after( $cssLink );
592
+
593
+ $cssLink.attr({
594
+ rel: 'stylesheet',
595
+ id: 'csf-codemirror-'+ data_editor.theme +'-css',
596
+ href: data_editor.cdnURL +'/theme/'+ data_editor.theme +'.min.css',
597
+ type: 'text/css',
598
+ media: 'all'
599
+ });
600
+
601
+ CSF.vars.code_themes.push(data_editor.theme);
602
+
603
+ }
604
+
605
+ CodeMirror.modeURL = data_editor.cdnURL +'/mode/%N/%N.min.js';
606
+ CodeMirror.autoLoadMode(code_editor, data_editor.mode);
607
+
608
+ code_editor.on( 'change', function( editor, event ) {
609
+ $textarea.val( code_editor.getValue() ).trigger('change');
610
+ });
611
+
612
+ clearInterval(interval);
613
+
614
+ }
615
+ });
616
+
617
+ });
618
+ };
619
+
620
+ //
621
+ // Field: date
622
+ //
623
+ $.fn.csf_field_date = function() {
624
+ return this.each( function() {
625
+
626
+ var $this = $(this),
627
+ $inputs = $this.find('input'),
628
+ settings = $this.find('.csf-date-settings').data('settings'),
629
+ wrapper = '<div class="csf-datepicker-wrapper"></div>',
630
+ $datepicker;
631
+
632
+ var defaults = {
633
+ showAnim: '',
634
+ beforeShow: function(input, inst) {
635
+ $(inst.dpDiv).addClass('csf-datepicker-wrapper');
636
+ },
637
+ onClose: function( input, inst ) {
638
+ $(inst.dpDiv).removeClass('csf-datepicker-wrapper');
639
+ },
640
+ };
641
+
642
+ settings = $.extend({}, settings, defaults);
643
+
644
+ if ( $inputs.length === 2 ) {
645
+
646
+ settings = $.extend({}, settings, {
647
+ onSelect: function( selectedDate ) {
648
+
649
+ var $this = $(this),
650
+ $from = $inputs.first(),
651
+ option = ( $inputs.first().attr('id') === $(this).attr('id') ) ? 'minDate' : 'maxDate',
652
+ date = $.datepicker.parseDate( settings.dateFormat, selectedDate );
653
+
654
+ $inputs.not(this).datepicker('option', option, date );
655
+
656
+ }
657
+ });
658
+
659
+ }
660
+
661
+ $inputs.each( function(){
662
+
663
+ var $input = $(this);
664
+
665
+ if ( $input.hasClass('hasDatepicker') ) {
666
+ $input.removeAttr('id').removeClass('hasDatepicker');
667
+ }
668
+
669
+ $input.datepicker(settings);
670
+
671
+ });
672
+
673
+ });
674
+ };
675
+
676
+ //
677
+ // Field: fieldset
678
+ //
679
+ $.fn.csf_field_fieldset = function() {
680
+ return this.each( function() {
681
+ $(this).find('.csf-fieldset-content').csf_reload_script();
682
+ });
683
+ };
684
+
685
+ //
686
+ // Field: gallery
687
+ //
688
+ $.fn.csf_field_gallery = function() {
689
+ return this.each( function() {
690
+
691
+ var $this = $(this),
692
+ $edit = $this.find('.csf-edit-gallery'),
693
+ $clear = $this.find('.csf-clear-gallery'),
694
+ $list = $this.find('ul'),
695
+ $input = $this.find('input'),
696
+ $img = $this.find('img'),
697
+ wp_media_frame;
698
+
699
+ $this.on('click', '.csf-button, .csf-edit-gallery', function( e ) {
700
+
701
+ var $el = $(this),
702
+ ids = $input.val(),
703
+ what = ( $el.hasClass('csf-edit-gallery') ) ? 'edit' : 'add',
704
+ state = ( what === 'add' && !ids.length ) ? 'gallery' : 'gallery-edit';
705
+
706
+ e.preventDefault();
707
+
708
+ if ( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) { return; }
709
+
710
+ // Open media with state
711
+ if ( state === 'gallery' ) {
712
+
713
+ wp_media_frame = window.wp.media({
714
+ library: {
715
+ type: 'image'
716
+ },
717
+ frame: 'post',
718
+ state: 'gallery',
719
+ multiple: true
720
+ });
721
+
722
+ wp_media_frame.open();
723
+
724
+ } else {
725
+
726
+ wp_media_frame = window.wp.media.gallery.edit( '[gallery ids="'+ ids +'"]' );
727
+
728
+ if ( what === 'add' ) {
729
+ wp_media_frame.setState('gallery-library');
730
+ }
731
+
732
+ }
733
+
734
+ // Media Update
735
+ wp_media_frame.on( 'update', function( selection ) {
736
+
737
+ $list.empty();
738
+
739
+ var selectedIds = selection.models.map( function( attachment ) {
740
+
741
+ var item = attachment.toJSON();
742
+ var thumb = ( item.sizes && item.sizes.thumbnail && item.sizes.thumbnail.url ) ? item.sizes.thumbnail.url : item.url;
743
+
744
+ $list.append('<li><img src="'+ thumb +'"></li>');
745
+
746
+ return item.id;
747
+
748
+ });
749
+
750
+ $input.val( selectedIds.join( ',' ) ).trigger('change');
751
+ $clear.removeClass('hidden');
752
+ $edit.removeClass('hidden');
753
+
754
+ });
755
+
756
+ });
757
+
758
+ $clear.on('click', function( e ) {
759
+ e.preventDefault();
760
+ $list.empty();
761
+ $input.val('').trigger('change');
762
+ $clear.addClass('hidden');
763
+ $edit.addClass('hidden');
764
+ });
765
+
766
+ });
767
+
768
+ };
769
+
770
+ //
771
+ // Field: group
772
+ //
773
+ $.fn.csf_field_group = function() {
774
+ return this.each( function() {
775
+
776
+ var $this = $(this),
777
+ $fieldset = $this.children('.csf-fieldset'),
778
+ $group = $fieldset.length ? $fieldset : $this,
779
+ $wrapper = $group.children('.csf-cloneable-wrapper'),
780
+ $hidden = $group.children('.csf-cloneable-hidden'),
781
+ $max = $group.children('.csf-cloneable-max'),
782
+ $min = $group.children('.csf-cloneable-min'),
783
+ field_id = $wrapper.data('field-id'),
784
+ unique_id = $wrapper.data('unique-id'),
785
+ is_number = Boolean( Number( $wrapper.data('title-number') ) ),
786
+ max = parseInt( $wrapper.data('max') ),
787
+ min = parseInt( $wrapper.data('min') );
788
+
789
+ // clear accordion arrows if multi-instance
790
+ if ( $wrapper.hasClass('ui-accordion') ) {
791
+ $wrapper.find('.ui-accordion-header-icon').remove();
792
+ }
793
+
794
+ var update_title_numbers = function( $selector ) {
795
+ $selector.find('.csf-cloneable-title-number').each( function( index ) {
796
+ $(this).html( ( $(this).closest('.csf-cloneable-item').index()+1 ) + '.' );
797
+ });
798
+ };
799
+
800
+ $wrapper.accordion({
801
+ header: '> .csf-cloneable-item > .csf-cloneable-title',
802
+ collapsible : true,
803
+ active: false,
804
+ animate: false,
805
+ heightStyle: 'content',
806
+ icons: {
807
+ 'header': 'csf-cloneable-header-icon fas fa-angle-right',
808
+ 'activeHeader': 'csf-cloneable-header-icon fas fa-angle-down'
809
+ },
810
+ activate: function( event, ui ) {
811
+
812
+ var $panel = ui.newPanel;
813
+ var $header = ui.newHeader;
814
+
815
+ if ( $panel.length && !$panel.data( 'opened' ) ) {
816
+
817
+ var $fields = $panel.children();
818
+ var $first = $fields.first().find(':input').first();
819
+ var $title = $header.find('.csf-cloneable-value');
820
+
821
+ $first.on('change keyup', function( event ) {
822
+ $title.text($first.val());
823
+ });
824
+
825
+ $panel.csf_reload_script();
826
+ $panel.data( 'opened', true );
827
+ $panel.data( 'retry', false );
828
+
829
+ } else if ( $panel.data( 'retry' ) ) {
830
+
831
+ $panel.csf_reload_script_retry();
832
+ $panel.data( 'retry', false );
833
+
834
+ }
835
+
836
+ }
837
+ });
838
+
839
+ $wrapper.sortable({
840
+ axis: 'y',
841
+ handle: '.csf-cloneable-title,.csf-cloneable-sort',
842
+ helper: 'original',
843
+ cursor: 'move',
844
+ placeholder: 'widget-placeholder',
845
+ start: function( event, ui ) {
846
+
847
+ $wrapper.accordion({ active:false });
848
+ $wrapper.sortable('refreshPositions');
849
+ ui.item.children('.csf-cloneable-content').data('retry', true);
850
+
851
+ },
852
+ update: function( event, ui ) {
853
+
854
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-cloneable-item'), field_id );
855
+ $wrapper.csf_customizer_refresh();
856
+
857
+ if ( is_number ) {
858
+ update_title_numbers($wrapper);
859
+ }
860
+
861
+ },
862
+ });
863
+
864
+ $group.children('.csf-cloneable-add').on('click', function( e ) {
865
+
866
+ e.preventDefault();
867
+
868
+ var count = $wrapper.children('.csf-cloneable-item').length;
869
+
870
+ $min.hide();
871
+
872
+ if ( max && (count+1) > max ) {
873
+ $max.show();
874
+ return;
875
+ }
876
+
877
+ var new_field_id = unique_id + field_id + '['+ count +']';
878
+
879
+ var $cloned_item = $hidden.csf_clone(true);
880
+
881
+ $cloned_item.removeClass('csf-cloneable-hidden');
882
+
883
+ $cloned_item.find(':input[name!="_pseudo"]').each( function() {
884
+ this.name = new_field_id + this.name.replace( ( this.name.startsWith('_nonce') ? '_nonce' : unique_id ), '');
885
+ });
886
+
887
+ $cloned_item.find('.csf-data-wrapper').each( function(){
888
+ $(this).attr('data-unique-id', new_field_id );
889
+ });
890
+
891
+ $wrapper.append($cloned_item);
892
+ $wrapper.accordion('refresh');
893
+ $wrapper.accordion({active: count});
894
+ $wrapper.csf_customizer_refresh();
895
+ $wrapper.csf_customizer_listen({closest: true});
896
+
897
+ if ( is_number ) {
898
+ update_title_numbers($wrapper);
899
+ }
900
+
901
+ });
902
+
903
+ var event_clone = function( e ) {
904
+
905
+ e.preventDefault();
906
+
907
+ var count = $wrapper.children('.csf-cloneable-item').length;
908
+
909
+ $min.hide();
910
+
911
+ if ( max && (count+1) > max ) {
912
+ $max.show();
913
+ return;
914
+ }
915
+
916
+ var $this = $(this),
917
+ $parent = $this.parent().parent(),
918
+ $cloned_helper = $parent.children('.csf-cloneable-helper').csf_clone(true),
919
+ $cloned_title = $parent.children('.csf-cloneable-title').csf_clone(),
920
+ $cloned_content = $parent.children('.csf-cloneable-content').csf_clone(),
921
+ cloned_regex = new RegExp('('+ CSF.helper.preg_quote(field_id) +')\\[(\\d+)\\]', 'g');
922
+
923
+ $cloned_content.find('.csf-data-wrapper').each( function(){
924
+ var $this = $(this);
925
+ $this.attr('data-unique-id', $this.attr('data-unique-id').replace(cloned_regex, field_id +'['+ ($parent.index()+1) +']') );
926
+ });
927
+
928
+ var $cloned = $('<div class="csf-cloneable-item" />');
929
+
930
+ $cloned.append($cloned_helper);
931
+ $cloned.append($cloned_title);
932
+ $cloned.append($cloned_content);
933
+
934
+ $wrapper.children().eq($parent.index()).after($cloned);
935
+
936
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-cloneable-item'), field_id );
937
+
938
+ $wrapper.accordion('refresh');
939
+ $wrapper.csf_customizer_refresh();
940
+ $wrapper.csf_customizer_listen({closest: true});
941
+
942
+ if ( is_number ) {
943
+ update_title_numbers($wrapper);
944
+ }
945
+
946
+ };
947
+
948
+ $wrapper.children('.csf-cloneable-item').children('.csf-cloneable-helper').on('click', '.csf-cloneable-clone', event_clone);
949
+ $group.children('.csf-cloneable-hidden').children('.csf-cloneable-helper').on('click', '.csf-cloneable-clone', event_clone);
950
+
951
+ var event_remove = function( e ) {
952
+
953
+ e.preventDefault();
954
+
955
+ var count = $wrapper.children('.csf-cloneable-item').length;
956
+
957
+ $max.hide();
958
+ $min.hide();
959
+
960
+ if ( min && (count-1) < min ) {
961
+ $min.show();
962
+ return;
963
+ }
964
+
965
+ $(this).closest('.csf-cloneable-item').remove();
966
+
967
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-cloneable-item'), field_id );
968
+
969
+ $wrapper.csf_customizer_refresh();
970
+
971
+ if ( is_number ) {
972
+ update_title_numbers($wrapper);
973
+ }
974
+
975
+ };
976
+
977
+ $wrapper.children('.csf-cloneable-item').children('.csf-cloneable-helper').on('click', '.csf-cloneable-remove', event_remove);
978
+ $group.children('.csf-cloneable-hidden').children('.csf-cloneable-helper').on('click', '.csf-cloneable-remove', event_remove);
979
+
980
+ });
981
+ };
982
+
983
+ //
984
+ // Field: icon
985
+ //
986
+ $.fn.csf_field_icon = function() {
987
+ return this.each( function() {
988
+
989
+ var $this = $(this);
990
+
991
+ $this.on('click', '.csf-icon-add', function( e ) {
992
+
993
+ e.preventDefault();
994
+
995
+ var $button = $(this);
996
+ var $modal = $('#csf-modal-icon');
997
+
998
+ $modal.removeClass('hidden');
999
+
1000
+ CSF.vars.$icon_target = $this;
1001
+
1002
+ if ( !CSF.vars.icon_modal_loaded ) {
1003
+
1004
+ $modal.find('.csf-modal-loading').show();
1005
+
1006
+ window.wp.ajax.post( 'csf-get-icons', {
1007
+ nonce: $button.data('nonce')
1008
+ }).done( function( response ) {
1009
+
1010
+ $modal.find('.csf-modal-loading').hide();
1011
+
1012
+ CSF.vars.icon_modal_loaded = true;
1013
+
1014
+ var $load = $modal.find('.csf-modal-load').html( response.content );
1015
+
1016
+ $load.on('click', 'i', function( e ) {
1017
+
1018
+ e.preventDefault();
1019
+
1020
+ var icon = $(this).attr('title');
1021
+
1022
+ CSF.vars.$icon_target.find('i').removeAttr('class').addClass(icon);
1023
+ CSF.vars.$icon_target.find('input').val(icon).trigger('change');
1024
+ CSF.vars.$icon_target.find('.csf-icon-preview').removeClass('hidden');
1025
+ CSF.vars.$icon_target.find('.csf-icon-remove').removeClass('hidden');
1026
+
1027
+ $modal.addClass('hidden');
1028
+
1029
+ });
1030
+
1031
+ $modal.on('change keyup', '.csf-icon-search', function() {
1032
+
1033
+ var value = $(this).val(),
1034
+ $icons = $load.find('i');
1035
+
1036
+ $icons.each( function() {
1037
+
1038
+ var $elem = $(this);
1039
+
1040
+ if ( $elem.attr('title').search( new RegExp( value, 'i' ) ) < 0 ) {
1041
+ $elem.hide();
1042
+ } else {
1043
+ $elem.show();
1044
+ }
1045
+
1046
+ });
1047
+
1048
+ });
1049
+
1050
+ $modal.on('click', '.csf-modal-close, .csf-modal-overlay', function() {
1051
+ $modal.addClass('hidden');
1052
+ });
1053
+
1054
+ }).fail( function( response ) {
1055
+ $modal.find('.csf-modal-loading').hide();
1056
+ $modal.find('.csf-modal-load').html( response.error );
1057
+ $modal.on('click', function() {
1058
+ $modal.addClass('hidden');
1059
+ });
1060
+ });
1061
+ }
1062
+
1063
+ });
1064
+
1065
+ $this.on('click', '.csf-icon-remove', function( e ) {
1066
+ e.preventDefault();
1067
+ $this.find('.csf-icon-preview').addClass('hidden');
1068
+ $this.find('input').val('').trigger('change');
1069
+ $(this).addClass('hidden');
1070
+ });
1071
+
1072
+ });
1073
+ };
1074
+
1075
+ //
1076
+ // Field: map
1077
+ //
1078
+ $.fn.csf_field_map = function() {
1079
+ return this.each( function() {
1080
+
1081
+ if ( typeof L === 'undefined' ) { return; }
1082
+
1083
+ var $this = $(this),
1084
+ $map = $this.find('.csf--map-osm'),
1085
+ $search_input = $this.find('.csf--map-search input'),
1086
+ $latitude = $this.find('.csf--latitude'),
1087
+ $longitude = $this.find('.csf--longitude'),
1088
+ $zoom = $this.find('.csf--zoom'),
1089
+ map_data = $map.data( 'map' );
1090
+
1091
+ var mapInit = L.map( $map.get(0), map_data);
1092
+
1093
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
1094
+ attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
1095
+ }).addTo(mapInit);
1096
+
1097
+ var mapMarker = L.marker(map_data.center,{draggable: true}).addTo(mapInit);
1098
+
1099
+ var update_latlng = function( data ) {
1100
+ $latitude.val( data.lat );
1101
+ $longitude.val( data.lng );
1102
+ $zoom.val( mapInit.getZoom() );
1103
+ };
1104
+
1105
+ mapInit.on( 'click', function ( data ) {
1106
+ mapMarker.setLatLng( data.latlng );
1107
+ update_latlng( data.latlng );
1108
+ });
1109
+
1110
+ mapInit.on( 'zoom', function () {
1111
+ update_latlng( mapMarker.getLatLng() );
1112
+ });
1113
+
1114
+ mapMarker.on( 'drag', function () {
1115
+ update_latlng( mapMarker.getLatLng() );
1116
+ });
1117
+
1118
+ if ( ! $search_input.length ) {
1119
+ $search_input = $( '[data-depend-id="'+ $this.find('.csf--address-field').data( 'address-field' ) +'"]' );
1120
+ }
1121
+
1122
+ var cache = {};
1123
+
1124
+ $search_input.autocomplete({
1125
+ source: function ( request, response ) {
1126
+
1127
+ var term = request.term;
1128
+
1129
+ if ( term in cache ) {
1130
+ response( cache[term] );
1131
+ return;
1132
+ }
1133
+
1134
+ $.get( 'https://nominatim.openstreetmap.org/search', {
1135
+ format: 'json',
1136
+ q: term,
1137
+ }, function( results ) {
1138
+
1139
+ var data;
1140
+
1141
+ if ( results.length ) {
1142
+ data = results.map( function( item ) {
1143
+ return {
1144
+ value: item.display_name,
1145
+ label: item.display_name,
1146
+ lat: item.lat,
1147
+ lon: item.lon
1148
+ };
1149
+ }, 'json');
1150
+ } else {
1151
+ data = [{
1152
+ value: 'no-data',
1153
+ label: 'No Results.'
1154
+ }];
1155
+ }
1156
+
1157
+ cache[term] = data;
1158
+ response(data);
1159
+
1160
+ });
1161
+
1162
+ },
1163
+ select: function ( event, ui ) {
1164
+
1165
+ if ( ui.item.value === 'no-data' ) { return false; }
1166
+
1167
+ var latLng = L.latLng( ui.item.lat, ui.item.lon );
1168
+
1169
+ mapInit.panTo( latLng );
1170
+ mapMarker.setLatLng( latLng );
1171
+ update_latlng( latLng );
1172
+
1173
+ },
1174
+ create: function (event, ui) {
1175
+ $(this).autocomplete('widget').addClass('csf-map-ui-autocomplate');
1176
+ }
1177
+ });
1178
+
1179
+ var input_update_latlng = function() {
1180
+
1181
+ var latLng = L.latLng( $latitude.val(), $longitude.val() );
1182
+
1183
+ mapInit.panTo( latLng );
1184
+ mapMarker.setLatLng( latLng );
1185
+
1186
+ };
1187
+
1188
+ $latitude.on('change', input_update_latlng );
1189
+ $longitude.on('change', input_update_latlng );
1190
+
1191
+ });
1192
+ };
1193
+
1194
+ //
1195
+ // Field: media
1196
+ //
1197
+ $.fn.csf_field_media = function() {
1198
+ return this.each( function() {
1199
+
1200
+ var $this = $(this),
1201
+ $upload_button = $this.find('.csf--button'),
1202
+ $remove_button = $this.find('.csf--remove'),
1203
+ $library = $upload_button.data('library') && $upload_button.data('library').split(',') || '',
1204
+ $auto_attributes = ( $this.hasClass('csf-assign-field-background') ) ? $this.closest('.csf-field-background').find('.csf--auto-attributes') : false,
1205
+ wp_media_frame;
1206
+
1207
+ $upload_button.on('click', function( e ) {
1208
+
1209
+ e.preventDefault();
1210
+
1211
+ if ( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) {
1212
+ return;
1213
+ }
1214
+
1215
+ if ( wp_media_frame ) {
1216
+ wp_media_frame.open();
1217
+ return;
1218
+ }
1219
+
1220
+ wp_media_frame = window.wp.media({
1221
+ library: {
1222
+ type: $library
1223
+ }
1224
+ });
1225
+
1226
+ wp_media_frame.on( 'select', function() {
1227
+
1228
+ var thumbnail;
1229
+ var attributes = wp_media_frame.state().get('selection').first().attributes;
1230
+ var preview_size = $upload_button.data('preview-size') || 'thumbnail';
1231
+
1232
+ if ( $library.length && $library.indexOf(attributes.subtype) === -1 && $library.indexOf(attributes.type) === -1 ) {
1233
+ return;
1234
+ }
1235
+
1236
+ $this.find('.csf--id').val( attributes.id );
1237
+ $this.find('.csf--width').val( attributes.width );
1238
+ $this.find('.csf--height').val( attributes.height );
1239
+ $this.find('.csf--alt').val( attributes.alt );
1240
+ $this.find('.csf--title').val( attributes.title );
1241
+ $this.find('.csf--description').val( attributes.description );
1242
+
1243
+ if ( typeof attributes.sizes !== 'undefined' && typeof attributes.sizes.thumbnail !== 'undefined' && preview_size === 'thumbnail' ) {
1244
+ thumbnail = attributes.sizes.thumbnail.url;
1245
+ } else if ( typeof attributes.sizes !== 'undefined' && typeof attributes.sizes.full !== 'undefined' ) {
1246
+ thumbnail = attributes.sizes.full.url;
1247
+ } else {
1248
+ thumbnail = attributes.icon;
1249
+ }
1250
+
1251
+ if ( $auto_attributes ) {
1252
+ $auto_attributes.removeClass('csf--attributes-hidden');
1253
+ }
1254
+
1255
+ $remove_button.removeClass('hidden');
1256
+
1257
+ $this.find('.csf--preview').removeClass('hidden');
1258
+ $this.find('.csf--src').attr('src', thumbnail);
1259
+ $this.find('.csf--thumbnail').val( thumbnail );
1260
+ $this.find('.csf--url').val( attributes.url ).trigger('change');
1261
+
1262
+ });
1263
+
1264
+ wp_media_frame.open();
1265
+
1266
+ });
1267
+
1268
+ $remove_button.on('click', function( e ) {
1269
+
1270
+ e.preventDefault();
1271
+
1272
+ if ( $auto_attributes ) {
1273
+ $auto_attributes.addClass('csf--attributes-hidden');
1274
+ }
1275
+
1276
+ $remove_button.addClass('hidden');
1277
+ $this.find('input').val('');
1278
+ $this.find('.csf--preview').addClass('hidden');
1279
+ $this.find('.csf--url').trigger('change');
1280
+
1281
+ });
1282
+
1283
+ });
1284
+
1285
+ };
1286
+
1287
+ //
1288
+ // Field: repeater
1289
+ //
1290
+ $.fn.csf_field_repeater = function() {
1291
+ return this.each( function() {
1292
+
1293
+ var $this = $(this),
1294
+ $fieldset = $this.children('.csf-fieldset'),
1295
+ $repeater = $fieldset.length ? $fieldset : $this,
1296
+ $wrapper = $repeater.children('.csf-repeater-wrapper'),
1297
+ $hidden = $repeater.children('.csf-repeater-hidden'),
1298
+ $max = $repeater.children('.csf-repeater-max'),
1299
+ $min = $repeater.children('.csf-repeater-min'),
1300
+ field_id = $wrapper.data('field-id'),
1301
+ unique_id = $wrapper.data('unique-id'),
1302
+ max = parseInt( $wrapper.data('max') ),
1303
+ min = parseInt( $wrapper.data('min') );
1304
+
1305
+
1306
+ $wrapper.children('.csf-repeater-item').children('.csf-repeater-content').csf_reload_script();
1307
+
1308
+ $wrapper.sortable({
1309
+ axis: 'y',
1310
+ handle: '.csf-repeater-sort',
1311
+ helper: 'original',
1312
+ cursor: 'move',
1313
+ placeholder: 'widget-placeholder',
1314
+ update: function( event, ui ) {
1315
+
1316
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-repeater-item'), field_id );
1317
+ $wrapper.csf_customizer_refresh();
1318
+ ui.item.csf_reload_script_retry();
1319
+
1320
+ }
1321
+ });
1322
+
1323
+ $repeater.children('.csf-repeater-add').on('click', function( e ) {
1324
+
1325
+ e.preventDefault();
1326
+
1327
+ var count = $wrapper.children('.csf-repeater-item').length;
1328
+
1329
+ $min.hide();
1330
+
1331
+ if ( max && (count+1) > max ) {
1332
+ $max.show();
1333
+ return;
1334
+ }
1335
+
1336
+ var new_field_id = unique_id + field_id + '['+ count +']';
1337
+
1338
+ var $cloned_item = $hidden.csf_clone(true);
1339
+
1340
+ $cloned_item.removeClass('csf-repeater-hidden');
1341
+
1342
+ $cloned_item.find(':input[name!="_pseudo"]').each( function() {
1343
+ this.name = new_field_id + this.name.replace( ( this.name.startsWith('_nonce') ? '_nonce' : unique_id ), '');
1344
+ });
1345
+
1346
+ $cloned_item.find('.csf-data-wrapper').each( function(){
1347
+ $(this).attr('data-unique-id', new_field_id );
1348
+ });
1349
+
1350
+ $wrapper.append($cloned_item);
1351
+ $cloned_item.children('.csf-repeater-content').csf_reload_script();
1352
+ $wrapper.csf_customizer_refresh();
1353
+ $wrapper.csf_customizer_listen({closest: true});
1354
+
1355
+ });
1356
+
1357
+ var event_clone = function( e ) {
1358
+
1359
+ e.preventDefault();
1360
+
1361
+ var count = $wrapper.children('.csf-repeater-item').length;
1362
+
1363
+ $min.hide();
1364
+
1365
+ if ( max && (count+1) > max ) {
1366
+ $max.show();
1367
+ return;
1368
+ }
1369
+
1370
+ var $this = $(this),
1371
+ $parent = $this.parent().parent().parent(),
1372
+ $cloned_content = $parent.children('.csf-repeater-content').csf_clone(),
1373
+ $cloned_helper = $parent.children('.csf-repeater-helper').csf_clone(true),
1374
+ cloned_regex = new RegExp('('+ CSF.helper.preg_quote(field_id) +')\\[(\\d+)\\]', 'g');
1375
+
1376
+ $cloned_content.find('.csf-data-wrapper').each( function(){
1377
+ var $this = $(this);
1378
+ $this.attr('data-unique-id', $this.attr('data-unique-id').replace(cloned_regex, field_id +'['+ ($parent.index()+1) +']') );
1379
+ });
1380
+
1381
+ var $cloned = $('<div class="csf-repeater-item" />');
1382
+
1383
+ $cloned.append($cloned_content);
1384
+ $cloned.append($cloned_helper);
1385
+
1386
+ $wrapper.children().eq($parent.index()).after($cloned);
1387
+
1388
+ $cloned.children('.csf-repeater-content').csf_reload_script();
1389
+
1390
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-repeater-item'), field_id );
1391
+
1392
+ $wrapper.csf_customizer_refresh();
1393
+ $wrapper.csf_customizer_listen({closest: true});
1394
+
1395
+ };
1396
+
1397
+ $wrapper.children('.csf-repeater-item').children('.csf-repeater-helper').on('click', '.csf-repeater-clone', event_clone);
1398
+ $repeater.children('.csf-repeater-hidden').children('.csf-repeater-helper').on('click', '.csf-repeater-clone', event_clone);
1399
+
1400
+ var event_remove = function( e ) {
1401
+
1402
+ e.preventDefault();
1403
+
1404
+ var count = $wrapper.children('.csf-repeater-item').length;
1405
+
1406
+ $max.hide();
1407
+ $min.hide();
1408
+
1409
+ if ( min && (count-1) < min ) {
1410
+ $min.show();
1411
+ return;
1412
+ }
1413
+
1414
+ $(this).closest('.csf-repeater-item').remove();
1415
+
1416
+ CSF.helper.name_nested_replace( $wrapper.children('.csf-repeater-item'), field_id );
1417
+
1418
+ $wrapper.csf_customizer_refresh();
1419
+
1420
+ };
1421
+
1422
+ $wrapper.children('.csf-repeater-item').children('.csf-repeater-helper').on('click', '.csf-repeater-remove', event_remove);
1423
+ $repeater.children('.csf-repeater-hidden').children('.csf-repeater-helper').on('click', '.csf-repeater-remove', event_remove);
1424
+
1425
+ });
1426
+ };
1427
+
1428
+ //
1429
+ // Field: slider
1430
+ //
1431
+ $.fn.csf_field_slider = function() {
1432
+ return this.each( function() {
1433
+
1434
+ var $this = $(this),
1435
+ $input = $this.find('input'),
1436
+ $slider = $this.find('.csf-slider-ui'),
1437
+ data = $input.data(),
1438
+ value = $input.val() || 0;
1439
+
1440
+ if ( $slider.hasClass('ui-slider') ) {
1441
+ $slider.empty();
1442
+ }
1443
+
1444
+ $slider.slider({
1445
+ range: 'min',
1446
+ value: value,
1447
+ min: data.min,
1448
+ max: data.max,
1449
+ step: data.step,
1450
+ slide: function( e, o ) {
1451
+ $input.val( o.value ).trigger('change');
1452
+ }
1453
+ });
1454
+
1455
+ $input.on('keyup', function() {
1456
+ $slider.slider('value', $input.val());
1457
+ });
1458
+
1459
+ });
1460
+ };
1461
+
1462
+ //
1463
+ // Field: sortable
1464
+ //
1465
+ $.fn.csf_field_sortable = function() {
1466
+ return this.each( function() {
1467
+
1468
+ var $sortable = $(this).find('.csf-sortable');
1469
+
1470
+ $sortable.sortable({
1471
+ axis: 'y',
1472
+ helper: 'original',
1473
+ cursor: 'move',
1474
+ placeholder: 'widget-placeholder',
1475
+ update: function( event, ui ) {
1476
+ $sortable.csf_customizer_refresh();
1477
+ }
1478
+ });
1479
+
1480
+ $sortable.find('.csf-sortable-content').csf_reload_script();
1481
+
1482
+ });
1483
+ };
1484
+
1485
+ //
1486
+ // Field: sorter
1487
+ //
1488
+ $.fn.csf_field_sorter = function() {
1489
+ return this.each( function() {
1490
+
1491
+ var $this = $(this),
1492
+ $enabled = $this.find('.csf-enabled'),
1493
+ $has_disabled = $this.find('.csf-disabled'),
1494
+ $disabled = ( $has_disabled.length ) ? $has_disabled : false;
1495
+
1496
+ $enabled.sortable({
1497
+ connectWith: $disabled,
1498
+ placeholder: 'ui-sortable-placeholder',
1499
+ update: function( event, ui ) {
1500
+
1501
+ var $el = ui.item.find('input');
1502
+
1503
+ if ( ui.item.parent().hasClass('csf-enabled') ) {
1504
+ $el.attr('name', $el.attr('name').replace('disabled', 'enabled'));
1505
+ } else {
1506
+ $el.attr('name', $el.attr('name').replace('enabled', 'disabled'));
1507
+ }
1508
+
1509
+ $this.csf_customizer_refresh();
1510
+
1511
+ }
1512
+ });
1513
+
1514
+ if ( $disabled ) {
1515
+
1516
+ $disabled.sortable({
1517
+ connectWith: $enabled,
1518
+ placeholder: 'ui-sortable-placeholder',
1519
+ update: function( event, ui ) {
1520
+ $this.csf_customizer_refresh();
1521
+ }
1522
+ });
1523
+
1524
+ }
1525
+
1526
+ });
1527
+ };
1528
+
1529
+ //
1530
+ // Field: spinner
1531
+ //
1532
+ $.fn.csf_field_spinner = function() {
1533
+ return this.each( function() {
1534
+
1535
+ var $this = $(this),
1536
+ $input = $this.find('input'),
1537
+ $inited = $this.find('.ui-spinner-button'),
1538
+ $unit = $input.data('unit');
1539
+
1540
+ if ( $inited.length ) {
1541
+ $inited.remove();
1542
+ }
1543
+
1544
+ $input.spinner({
1545
+ max: $input.data('max') || 100,
1546
+ min: $input.data('min') || 0,
1547
+ step: $input.data('step') || 1,
1548
+ create: function( event, ui ) {
1549
+ if ( $unit.length ) {
1550
+ $this.find('.ui-spinner-up').after('<span class="ui-button-text-only csf--unit">'+ $unit +'</span>');
1551
+ }
1552
+ },
1553
+ spin: function (event, ui ) {
1554
+ $input.val(ui.value).trigger('change');
1555
+ }
1556
+ });
1557
+
1558
+ });
1559
+ };
1560
+
1561
+ //
1562
+ // Field: switcher
1563
+ //
1564
+ $.fn.csf_field_switcher = function() {
1565
+ return this.each( function() {
1566
+
1567
+ var $switcher = $(this).find('.csf--switcher');
1568
+
1569
+ $switcher.on('click', function() {
1570
+
1571
+ var value = 0;
1572
+ var $input = $switcher.find('input');
1573
+
1574
+ if ( $switcher.hasClass('csf--active') ) {
1575
+ $switcher.removeClass('csf--active');
1576
+ } else {
1577
+ value = 1;
1578
+ $switcher.addClass('csf--active');
1579
+ }
1580
+
1581
+ $input.val(value).trigger('change');
1582
+
1583
+ });
1584
+
1585
+ });
1586
+ };
1587
+
1588
+ //
1589
+ // Field: tabbed
1590
+ //
1591
+ $.fn.csf_field_tabbed = function() {
1592
+ return this.each( function() {
1593
+
1594
+ var $this = $(this),
1595
+ $links = $this.find('.csf-tabbed-nav a'),
1596
+ $contents = $this.find('.csf-tabbed-content');
1597
+
1598
+ $contents.eq(0).csf_reload_script();
1599
+
1600
+ $links.on( 'click', function( e ) {
1601
+
1602
+ e.preventDefault();
1603
+
1604
+ var $link = $(this),
1605
+ index = $link.index(),
1606
+ $content = $contents.eq(index);
1607
+
1608
+ $link.addClass('csf-tabbed-active').siblings().removeClass('csf-tabbed-active');
1609
+ $content.csf_reload_script();
1610
+ $content.removeClass('hidden').siblings().addClass('hidden');
1611
+
1612
+ });
1613
+
1614
+ });
1615
+ };
1616
+
1617
+ //
1618
+ // Field: typography
1619
+ //
1620
+ $.fn.csf_field_typography = function() {
1621
+ return this.each(function () {
1622
+
1623
+ var base = this;
1624
+ var $this = $(this);
1625
+ var loaded_fonts = [];
1626
+ var webfonts = csf_typography_json.webfonts;
1627
+ var googlestyles = csf_typography_json.googlestyles;
1628
+ var defaultstyles = csf_typography_json.defaultstyles;
1629
+
1630
+ //
1631
+ //
1632
+ // Sanitize google font subset
1633
+ base.sanitize_subset = function( subset ) {
1634
+ subset = subset.replace('-ext', ' Extended');
1635
+ subset = subset.charAt(0).toUpperCase() + subset.slice(1);
1636
+ return subset;
1637
+ };
1638
+
1639
+ //
1640
+ //
1641
+ // Sanitize google font styles (weight and style)
1642
+ base.sanitize_style = function( style ) {
1643
+ return googlestyles[style] ? googlestyles[style] : style;
1644
+ };
1645
+
1646
+ //
1647
+ //
1648
+ // Load google font
1649
+ base.load_google_font = function( font_family, weight, style ) {
1650
+
1651
+ if ( font_family && typeof WebFont === 'object' ) {
1652
+
1653
+ weight = weight ? weight.replace('normal', '') : '';
1654
+ style = style ? style.replace('normal', '') : '';
1655
+
1656
+ if ( weight || style ) {
1657
+ font_family = font_family +':'+ weight + style;
1658
+ }
1659
+
1660
+ if ( loaded_fonts.indexOf( font_family ) === -1 ) {
1661
+ WebFont.load({ google: { families: [font_family] } });
1662
+ }
1663
+
1664
+ loaded_fonts.push( font_family );
1665
+
1666
+ }
1667
+
1668
+ };
1669
+
1670
+ //
1671
+ //
1672
+ // Append select options
1673
+ base.append_select_options = function( $select, options, condition, type, is_multi ) {
1674
+
1675
+ $select.find('option').not(':first').remove();
1676
+
1677
+ var opts = '';
1678
+
1679
+ $.each( options, function( key, value ) {
1680
+
1681
+ var selected;
1682
+ var name = value;
1683
+
1684
+ // is_multi
1685
+ if ( is_multi ) {
1686
+ selected = ( condition && condition.indexOf(value) !== -1 ) ? ' selected' : '';
1687
+ } else {
1688
+ selected = ( condition && condition === value ) ? ' selected' : '';
1689
+ }
1690
+
1691
+ if ( type === 'subset' ) {
1692
+ name = base.sanitize_subset( value );
1693
+ } else if ( type === 'style' ){
1694
+ name = base.sanitize_style( value );
1695
+ }
1696
+
1697
+ opts += '<option value="'+ value +'"'+ selected +'>'+ name +'</option>';
1698
+
1699
+ });
1700
+
1701
+ $select.append(opts).trigger('csf.change').trigger('chosen:updated');
1702
+
1703
+ };
1704
+
1705
+ base.init = function () {
1706
+
1707
+ //
1708
+ //
1709
+ // Constants
1710
+ var selected_styles = [];
1711
+ var $typography = $this.find('.csf--typography');
1712
+ var $type = $this.find('.csf--type');
1713
+ var $styles = $this.find('.csf--block-font-style');
1714
+ var unit = $typography.data('unit');
1715
+ var line_height_unit = $typography.data('line-height-unit');
1716
+ var exclude_fonts = $typography.data('exclude') ? $typography.data('exclude').split(',') : [];
1717
+
1718
+ //
1719
+ //
1720
+ // Chosen init
1721
+ if ( $this.find('.csf--chosen').length ) {
1722
+
1723
+ var $chosen_selects = $this.find('select');
1724
+
1725
+ $chosen_selects.each( function(){
1726
+
1727
+ var $chosen_select = $(this),
1728
+ $chosen_inited = $chosen_select.parent().find('.chosen-container');
1729
+
1730
+ if ( $chosen_inited.length ) {
1731
+ $chosen_inited.remove();
1732
+ }
1733
+
1734
+ $chosen_select.chosen({
1735
+ allow_single_deselect: true,
1736
+ disable_search_threshold: 15,
1737
+ width: '100%'
1738
+ });
1739
+
1740
+ });
1741
+
1742
+ }
1743
+
1744
+ //
1745
+ //
1746
+ // Font family select
1747
+ var $font_family_select = $this.find('.csf--font-family');
1748
+ var first_font_family = $font_family_select.val();
1749
+
1750
+ // Clear default font family select options
1751
+ $font_family_select.find('option').not(':first-child').remove();
1752
+
1753
+ var opts = '';
1754
+
1755
+ $.each(webfonts, function( type, group ) {
1756
+
1757
+ // Check for exclude fonts
1758
+ if ( exclude_fonts && exclude_fonts.indexOf(type) !== -1 ) { return; }
1759
+
1760
+ opts += '<optgroup label="' + group.label + '">';
1761
+
1762
+ $.each(group.fonts, function( key, value ) {
1763
+
1764
+ // use key if value is object
1765
+ value = ( typeof value === 'object' ) ? key : value;
1766
+ var selected = ( value === first_font_family ) ? ' selected' : '';
1767
+ opts += '<option value="'+ value +'" data-type="'+ type +'"'+ selected +'>'+ value +'</option>';
1768
+
1769
+ });
1770
+
1771
+ opts += '</optgroup>';
1772
+
1773
+ });
1774
+
1775
+ // Append google font select options
1776
+ $font_family_select.append(opts).trigger('chosen:updated');
1777
+
1778
+ //
1779
+ //
1780
+ // Font style select
1781
+ var $font_style_block = $this.find('.csf--block-font-style');
1782
+
1783
+ if ( $font_style_block.length ) {
1784
+
1785
+ var $font_style_select = $this.find('.csf--font-style-select');
1786
+ var first_style_value = $font_style_select.val() ? $font_style_select.val().replace(/normal/g, '' ) : '';
1787
+
1788
+ //
1789
+ // Font Style on on change listener
1790
+ $font_style_select.on('change csf.change', function( event ) {
1791
+
1792
+ var style_value = $font_style_select.val();
1793
+
1794
+ // set a default value
1795
+ if ( !style_value && selected_styles && selected_styles.indexOf('normal') === -1 ) {
1796
+ style_value = selected_styles[0];
1797
+ }
1798
+
1799
+ // set font weight, for eg. replacing 800italic to 800
1800
+ var font_normal = ( style_value && style_value !== 'italic' && style_value === 'normal' ) ? 'normal' : '';
1801
+ var font_weight = ( style_value && style_value !== 'italic' && style_value !== 'normal' ) ? style_value.replace('italic', '') : font_normal;
1802
+ var font_style = ( style_value && style_value.substr(-6) === 'italic' ) ? 'italic' : '';
1803
+
1804
+ $this.find('.csf--font-weight').val( font_weight );
1805
+ $this.find('.csf--font-style').val( font_style );
1806
+
1807
+ });
1808
+
1809
+ //
1810
+ //
1811
+ // Extra font style select
1812
+ var $extra_font_style_block = $this.find('.csf--block-extra-styles');
1813
+
1814
+ if ( $extra_font_style_block.length ) {
1815
+ var $extra_font_style_select = $this.find('.csf--extra-styles');
1816
+ var first_extra_style_value = $extra_font_style_select.val();
1817
+ }
1818
+
1819
+ }
1820
+
1821
+ //
1822
+ //
1823
+ // Subsets select
1824
+ var $subset_block = $this.find('.csf--block-subset');
1825
+ if ( $subset_block.length ) {
1826
+ var $subset_select = $this.find('.csf--subset');
1827
+ var first_subset_select_value = $subset_select.val();
1828
+ var subset_multi_select = $subset_select.data('multiple') || false;
1829
+ }
1830
+
1831
+ //
1832
+ //
1833
+ // Backup font family
1834
+ var $backup_font_family_block = $this.find('.csf--block-backup-font-family');
1835
+
1836
+ //
1837
+ //
1838
+ // Font Family on Change Listener
1839
+ $font_family_select.on('change csf.change', function( event ) {
1840
+
1841
+ // Hide subsets on change
1842
+ if ( $subset_block.length ) {
1843
+ $subset_block.addClass('hidden');
1844
+ }
1845
+
1846
+ // Hide extra font style on change
1847
+ if ( $extra_font_style_block.length ) {
1848
+ $extra_font_style_block.addClass('hidden');
1849
+ }
1850
+
1851
+ // Hide backup font family on change
1852
+ if ( $backup_font_family_block.length ) {
1853
+ $backup_font_family_block.addClass('hidden');
1854
+ }
1855
+
1856
+ var $selected = $font_family_select.find(':selected');
1857
+ var value = $selected.val();
1858
+ var type = $selected.data('type');
1859
+
1860
+ if ( type && value ) {
1861
+
1862
+ // Show backup fonts if font type google or custom
1863
+ if ( ( type === 'google' || type === 'custom' ) && $backup_font_family_block.length ) {
1864
+ $backup_font_family_block.removeClass('hidden');
1865
+ }
1866
+
1867
+ // Appending font style select options
1868
+ if ( $font_style_block.length ) {
1869
+
1870
+ // set styles for multi and normal style selectors
1871
+ var styles = defaultstyles;
1872
+
1873
+ // Custom or gogle font styles
1874
+ if ( type === 'google' && webfonts[type].fonts[value][0] ) {
1875
+ styles = webfonts[type].fonts[value][0];
1876
+ } else if ( type === 'custom' && webfonts[type].fonts[value] ) {
1877
+ styles = webfonts[type].fonts[value];
1878
+ }
1879
+
1880
+ selected_styles = styles;
1881
+
1882
+ // Set selected style value for avoid load errors
1883
+ var set_auto_style = ( styles.indexOf('normal') !== -1 ) ? 'normal' : styles[0];
1884
+ var set_style_value = ( first_style_value && styles.indexOf(first_style_value) !== -1 ) ? first_style_value : set_auto_style;
1885
+
1886
+ // Append style select options
1887
+ base.append_select_options( $font_style_select, styles, set_style_value, 'style' );
1888
+
1889
+ // Clear first value
1890
+ first_style_value = false;
1891
+
1892
+ // Show style select after appended
1893
+ $font_style_block.removeClass('hidden');
1894
+
1895
+ // Appending extra font style select options
1896
+ if ( type === 'google' && $extra_font_style_block.length && styles.length > 1 ) {
1897
+
1898
+ // Append extra-style select options
1899
+ base.append_select_options( $extra_font_style_select, styles, first_extra_style_value, 'style', true );
1900
+
1901
+ // Clear first value
1902
+ first_extra_style_value = false;
1903
+
1904
+ // Show style select after appended
1905
+ $extra_font_style_block.removeClass('hidden');
1906
+
1907
+ }
1908
+
1909
+ }
1910
+
1911
+ // Appending google fonts subsets select options
1912
+ if ( type === 'google' && $subset_block.length && webfonts[type].fonts[value][1] ) {
1913
+
1914
+ var subsets = webfonts[type].fonts[value][1];
1915
+ var set_auto_subset = ( subsets.length < 2 && subsets[0] !== 'latin' ) ? subsets[0] : '';
1916
+ var set_subset_value = ( first_subset_select_value && subsets.indexOf(first_subset_select_value) !== -1 ) ? first_subset_select_value : set_auto_subset;
1917
+
1918
+ // check for multiple subset select
1919
+ set_subset_value = ( subset_multi_select && first_subset_select_value ) ? first_subset_select_value : set_subset_value;
1920
+
1921
+ base.append_select_options( $subset_select, subsets, set_subset_value, 'subset', subset_multi_select );
1922
+
1923
+ first_subset_select_value = false;
1924
+
1925
+ $subset_block.removeClass('hidden');
1926
+
1927
+ }
1928
+
1929
+ } else {
1930
+
1931
+ // Clear Styles
1932
+ $styles.find(':input').val('');
1933
+
1934
+ // Clear subsets options if type and value empty
1935
+ if ( $subset_block.length ) {
1936
+ $subset_select.find('option').not(':first-child').remove();
1937
+ $subset_select.trigger('chosen:updated');
1938
+ }
1939
+
1940
+ // Clear font styles options if type and value empty
1941
+ if ( $font_style_block.length ) {
1942
+ $font_style_select.find('option').not(':first-child').remove();
1943
+ $font_style_select.trigger('chosen:updated');
1944
+ }
1945
+
1946
+ }
1947
+
1948
+ // Update font type input value
1949
+ $type.val(type);
1950
+
1951
+ }).trigger('csf.change');
1952
+
1953
+ //
1954
+ //
1955
+ // Preview
1956
+ var $preview_block = $this.find('.csf--block-preview');
1957
+
1958
+ if ( $preview_block.length ) {
1959
+
1960
+ var $preview = $this.find('.csf--preview');
1961
+
1962
+ // Set preview styles on change
1963
+ $this.on('change', CSF.helper.debounce( function( event ) {
1964
+
1965
+ $preview_block.removeClass('hidden');
1966
+
1967
+ var font_family = $font_family_select.val(),
1968
+ font_weight = $this.find('.csf--font-weight').val(),
1969
+ font_style = $this.find('.csf--font-style').val(),
1970
+ font_size = $this.find('.csf--font-size').val(),
1971
+ font_variant = $this.find('.csf--font-variant').val(),
1972
+ line_height = $this.find('.csf--line-height').val(),
1973
+ text_align = $this.find('.csf--text-align').val(),
1974
+ text_transform = $this.find('.csf--text-transform').val(),
1975
+ text_decoration = $this.find('.csf--text-decoration').val(),
1976
+ text_color = $this.find('.csf--color').val(),
1977
+ word_spacing = $this.find('.csf--word-spacing').val(),
1978
+ letter_spacing = $this.find('.csf--letter-spacing').val(),
1979
+ custom_style = $this.find('.csf--custom-style').val(),
1980
+ type = $this.find('.csf--type').val();
1981
+
1982
+ if ( type === 'google' ) {
1983
+ base.load_google_font(font_family, font_weight, font_style);
1984
+ }
1985
+
1986
+ var properties = {};
1987
+
1988
+ if ( font_family ) { properties.fontFamily = font_family; }
1989
+ if ( font_weight ) { properties.fontWeight = font_weight; }
1990
+ if ( font_style ) { properties.fontStyle = font_style; }
1991
+ if ( font_variant ) { properties.fontVariant = font_variant; }
1992
+ if ( font_size ) { properties.fontSize = font_size + unit; }
1993
+ if ( line_height ) { properties.lineHeight = line_height + line_height_unit; }
1994
+ if ( letter_spacing ) { properties.letterSpacing = letter_spacing + unit; }
1995
+ if ( word_spacing ) { properties.wordSpacing = word_spacing + unit; }
1996
+ if ( text_align ) { properties.textAlign = text_align; }
1997
+ if ( text_transform ) { properties.textTransform = text_transform; }
1998
+ if ( text_decoration ) { properties.textDecoration = text_decoration; }
1999
+ if ( text_color ) { properties.color = text_color; }
2000
+
2001
+ $preview.removeAttr('style');
2002
+
2003
+ // Customs style attribute
2004
+ if ( custom_style ) { $preview.attr('style', custom_style); }
2005
+
2006
+ $preview.css(properties);
2007
+
2008
+ }, 100 ) );
2009
+
2010
+ // Preview black and white backgrounds trigger
2011
+ $preview_block.on('click', function() {
2012
+
2013
+ $preview.toggleClass('csf--black-background');
2014
+
2015
+ var $toggle = $preview_block.find('.csf--toggle');
2016
+
2017
+ if ( $toggle.hasClass('fa-toggle-off') ) {
2018
+ $toggle.removeClass('fa-toggle-off').addClass('fa-toggle-on');
2019
+ } else {
2020
+ $toggle.removeClass('fa-toggle-on').addClass('fa-toggle-off');
2021
+ }
2022
+
2023
+ });
2024
+
2025
+ if ( !$preview_block.hasClass('hidden') ) {
2026
+ $this.trigger('change');
2027
+ }
2028
+
2029
+ }
2030
+
2031
+ };
2032
+
2033
+ base.init();
2034
+
2035
+ });
2036
+ };
2037
+
2038
+ //
2039
+ // Field: upload
2040
+ //
2041
+ $.fn.csf_field_upload = function() {
2042
+ return this.each( function() {
2043
+
2044
+ var $this = $(this),
2045
+ $input = $this.find('input'),
2046
+ $upload_button = $this.find('.csf--button'),
2047
+ $remove_button = $this.find('.csf--remove'),
2048
+ $library = $upload_button.data('library') && $upload_button.data('library').split(',') || '',
2049
+ wp_media_frame;
2050
+
2051
+ $input.on('change', function( e ) {
2052
+ if ( $input.val() ) {
2053
+ $remove_button.removeClass('hidden');
2054
+ } else {
2055
+ $remove_button.addClass('hidden');
2056
+ }
2057
+ });
2058
+
2059
+ $upload_button.on('click', function( e ) {
2060
+
2061
+ e.preventDefault();
2062
+
2063
+ if ( typeof window.wp === 'undefined' || ! window.wp.media || ! window.wp.media.gallery ) {
2064
+ return;
2065
+ }
2066
+
2067
+ if ( wp_media_frame ) {
2068
+ wp_media_frame.open();
2069
+ return;
2070
+ }
2071
+
2072
+ wp_media_frame = window.wp.media({
2073
+ library: {
2074
+ type: $library
2075
+ },
2076
+ });
2077
+
2078
+ wp_media_frame.on( 'select', function() {
2079
+
2080
+ var attributes = wp_media_frame.state().get('selection').first().attributes;
2081
+
2082
+ if ( $library.length && $library.indexOf(attributes.subtype) === -1 && $library.indexOf(attributes.type) === -1 ) {
2083
+ return;
2084
+ }
2085
+
2086
+ $input.val(attributes.url).trigger('change');
2087
+
2088
+ });
2089
+
2090
+ wp_media_frame.open();
2091
+
2092
+ });
2093
+
2094
+ $remove_button.on('click', function( e ) {
2095
+ e.preventDefault();
2096
+ $input.val('').trigger('change');
2097
+ });
2098
+
2099
+ });
2100
+
2101
+ };
2102
+
2103
+ //
2104
+ // Field: wp_editor
2105
+ //
2106
+ $.fn.csf_field_wp_editor = function() {
2107
+ return this.each( function() {
2108
+
2109
+ if ( typeof window.wp.editor === 'undefined' || typeof window.tinyMCEPreInit === 'undefined' || typeof window.tinyMCEPreInit.mceInit.csf_wp_editor === 'undefined' ) {
2110
+ return;
2111
+ }
2112
+
2113
+ var $this = $(this),
2114
+ $editor = $this.find('.csf-wp-editor'),
2115
+ $textarea = $this.find('textarea');
2116
+
2117
+ // If there is wp-editor remove it for avoid dupliated wp-editor conflicts.
2118
+ var $has_wp_editor = $this.find('.wp-editor-wrap').length || $this.find('.mce-container').length;
2119
+
2120
+ if ( $has_wp_editor ) {
2121
+ $editor.empty();
2122
+ $editor.append($textarea);
2123
+ $textarea.css('display', '');
2124
+ }
2125
+
2126
+ // Generate a unique id
2127
+ var uid = CSF.helper.uid('csf-editor-');
2128
+
2129
+ $textarea.attr('id', uid);
2130
+
2131
+ // Get default editor settings
2132
+ var default_editor_settings = {
2133
+ tinymce: window.tinyMCEPreInit.mceInit.csf_wp_editor,
2134
+ quicktags: window.tinyMCEPreInit.qtInit.csf_wp_editor
2135
+ };
2136
+
2137
+ // Get default editor settings
2138
+ var field_editor_settings = $editor.data('editor-settings');
2139
+
2140
+ // Add on change event handle
2141
+ var editor_on_change = function( editor ) {
2142
+ editor.on('change', CSF.helper.debounce( function() {
2143
+ editor.save();
2144
+ $textarea.trigger('change');
2145
+ }, 250 ) );
2146
+ };
2147
+
2148
+ // Callback for old wp editor
2149
+ var wpEditor = wp.oldEditor ? wp.oldEditor : wp.editor;
2150
+
2151
+ if ( wpEditor && wpEditor.hasOwnProperty('autop') ) {
2152
+ wp.editor.autop = wpEditor.autop;
2153
+ wp.editor.removep = wpEditor.removep;
2154
+ wp.editor.initialize = wpEditor.initialize;
2155
+ }
2156
+
2157
+ // Extend editor selector and on change event handler
2158
+ default_editor_settings.tinymce = $.extend( {}, default_editor_settings.tinymce, { selector: '#'+ uid, setup: editor_on_change } );
2159
+
2160
+ // Override editor tinymce settings
2161
+ if ( field_editor_settings.tinymce === false ) {
2162
+ default_editor_settings.tinymce = false;
2163
+ $editor.addClass('csf-no-tinymce');
2164
+ }
2165
+
2166
+ // Override editor quicktags settings
2167
+ if ( field_editor_settings.quicktags === false ) {
2168
+ default_editor_settings.quicktags = false;
2169
+ $editor.addClass('csf-no-quicktags');
2170
+ }
2171
+
2172
+ // Wait until :visible
2173
+ var interval = setInterval(function () {
2174
+ if ( $this.is(':visible') ) {
2175
+ window.wp.editor.initialize(uid, default_editor_settings);
2176
+ clearInterval(interval);
2177
+ }
2178
+ });
2179
+
2180
+ // Add Media buttons
2181
+ if ( field_editor_settings.media_buttons && window.csf_media_buttons ) {
2182
+
2183
+ var $editor_buttons = $editor.find('.wp-media-buttons');
2184
+
2185
+ if ( $editor_buttons.length ) {
2186
+
2187
+ $editor_buttons.find('.csf-shortcode-button').data('editor-id', uid);
2188
+
2189
+ } else {
2190
+
2191
+ var $media_buttons = $(window.csf_media_buttons);
2192
+
2193
+ $media_buttons.find('.csf-shortcode-button').data('editor-id', uid);
2194
+
2195
+ $editor.prepend( $media_buttons );
2196
+
2197
+ }
2198
+
2199
+ }
2200
+
2201
+ });
2202
+
2203
+ };
2204
+
2205
+ //
2206
+ // Confirm
2207
+ //
2208
+ $.fn.csf_confirm = function() {
2209
+ return this.each( function() {
2210
+ $(this).on('click', function( e ) {
2211
+
2212
+ var confirm_text = $(this).data('confirm') || window.csf_vars.i18n.confirm;
2213
+ var confirm_answer = confirm( confirm_text );
2214
+
2215
+ if ( confirm_answer ) {
2216
+ CSF.vars.is_confirm = true;
2217
+ CSF.vars.form_modified = false;
2218
+ } else {
2219
+ e.preventDefault();
2220
+ return false;
2221
+ }
2222
+
2223
+ });
2224
+ });
2225
+ };
2226
+
2227
+ $.fn.serializeObject = function(){
2228
+
2229
+ var obj = {};
2230
+
2231
+ $.each( this.serializeArray(), function(i,o){
2232
+ var n = o.name,
2233
+ v = o.value;
2234
+
2235
+ obj[n] = obj[n] === undefined ? v
2236
+ : $.isArray( obj[n] ) ? obj[n].concat( v )
2237
+ : [ obj[n], v ];
2238
+ });
2239
+
2240
+ return obj;
2241
+
2242
+ };
2243
+
2244
+ //
2245
+ // Options Save
2246
+ //
2247
+ $.fn.csf_save = function() {
2248
+ return this.each( function() {
2249
+
2250
+ var $this = $(this),
2251
+ $buttons = $('.csf-save'),
2252
+ $panel = $('.csf-options'),
2253
+ flooding = false,
2254
+ timeout;
2255
+
2256
+ $this.on('click', function( e ) {
2257
+
2258
+ if ( !flooding ) {
2259
+
2260
+ var $text = $this.data('save'),
2261
+ $value = $this.val();
2262
+
2263
+ $buttons.attr('value', $text);
2264
+
2265
+ if ( $this.hasClass('csf-save-ajax') ) {
2266
+
2267
+ e.preventDefault();
2268
+
2269
+ $panel.addClass('csf-saving');
2270
+ $buttons.prop('disabled', true);
2271
+
2272
+ window.wp.ajax.post( 'csf_'+ $panel.data('unique') +'_ajax_save', {
2273
+ data: $('#csf-form').serializeJSONCSF()
2274
+ })
2275
+ .done( function( response ) {
2276
+
2277
+ // clear errors
2278
+ $('.csf-error').remove();
2279
+
2280
+ if ( Object.keys( response.errors ).length ) {
2281
+
2282
+ var error_icon = '<i class="csf-label-error csf-error">!</i>';
2283
+
2284
+ $.each(response.errors, function( key, error_message ) {
2285
+
2286
+ var $field = $('[data-depend-id="'+ key +'"]'),
2287
+ $link = $('#csf-tab-link-'+ ($field.closest('.csf-section').index()+1)),
2288
+ $tab = $link.closest('.csf-tab-depth-0');
2289
+
2290
+ $field.closest('.csf-fieldset').append( '<p class="csf-error csf-error-text">'+ error_message +'</p>' );
2291
+
2292
+ if ( !$link.find('.csf-error').length ) {
2293
+ $link.append( error_icon );
2294
+ }
2295
+
2296
+ if ( !$tab.find('.csf-arrow .csf-error').length ) {
2297
+ $tab.find('.csf-arrow').append( error_icon );
2298
+ }
2299
+
2300
+ });
2301
+
2302
+ }
2303
+
2304
+ $panel.removeClass('csf-saving');
2305
+ $buttons.prop('disabled', false).attr('value', $value);
2306
+ flooding = false;
2307
+
2308
+ CSF.vars.form_modified = false;
2309
+ CSF.vars.$form_warning.hide();
2310
+
2311
+ clearTimeout(timeout);
2312
+
2313
+ var $result_success = $('.csf-form-success');
2314
+ $result_success.empty().append(response.notice).fadeIn('fast', function() {
2315
+ timeout = setTimeout( function() {
2316
+ $result_success.fadeOut('fast');
2317
+ }, 1000);
2318
+ });
2319
+
2320
+ })
2321
+ .fail( function( response ) {
2322
+ alert( response.error );
2323
+ });
2324
+
2325
+ } else {
2326
+
2327
+ CSF.vars.form_modified = false;
2328
+
2329
+ }
2330
+
2331
+ }
2332
+
2333
+ flooding = true;
2334
+
2335
+ });
2336
+
2337
+ });
2338
+ };
2339
+
2340
+ //
2341
+ // Option Framework
2342
+ //
2343
+ $.fn.csf_options = function() {
2344
+ return this.each( function() {
2345
+
2346
+ var $this = $(this),
2347
+ $content = $this.find('.csf-content'),
2348
+ $form_success = $this.find('.csf-form-success'),
2349
+ $form_warning = $this.find('.csf-form-warning'),
2350
+ $save_button = $this.find('.csf-header .csf-save');
2351
+
2352
+ CSF.vars.$form_warning = $form_warning;
2353
+
2354
+ // Shows a message white leaving theme options without saving
2355
+ if ( $form_warning.length ) {
2356
+
2357
+ window.onbeforeunload = function() {
2358
+ return ( CSF.vars.form_modified ) ? true : undefined;
2359
+ };
2360
+
2361
+ $content.on('change keypress', ':input', function() {
2362
+ if ( !CSF.vars.form_modified ) {
2363
+ $form_success.hide();
2364
+ $form_warning.fadeIn('fast');
2365
+ CSF.vars.form_modified = true;
2366
+ }
2367
+ });
2368
+
2369
+ }
2370
+
2371
+ if ( $form_success.hasClass('csf-form-show') ) {
2372
+ setTimeout( function() {
2373
+ $form_success.fadeOut('fast');
2374
+ }, 1000);
2375
+ }
2376
+
2377
+ $(document).keydown(function (event) {
2378
+ if ( ( event.ctrlKey || event.metaKey ) && event.which === 83 ) {
2379
+ $save_button.trigger('click');
2380
+ event.preventDefault();
2381
+ return false;
2382
+ }
2383
+ });
2384
+
2385
+ });
2386
+ };
2387
+
2388
+ //
2389
+ // Taxonomy Framework
2390
+ //
2391
+ $.fn.csf_taxonomy = function() {
2392
+ return this.each( function() {
2393
+
2394
+ var $this = $(this),
2395
+ $form = $this.parents('form');
2396
+
2397
+ if ( $form.attr('id') === 'addtag' ) {
2398
+
2399
+ var $submit = $form.find('#submit'),
2400
+ $cloned = $this.find('.csf-field').csf_clone();
2401
+
2402
+ $submit.on( 'click', function() {
2403
+
2404
+ if ( !$form.find('.form-required').hasClass('form-invalid') ) {
2405
+
2406
+ $this.data('inited', false);
2407
+
2408
+ $this.empty();
2409
+
2410
+ $this.html( $cloned );
2411
+
2412
+ $cloned = $cloned.csf_clone();
2413
+
2414
+ $this.csf_reload_script();
2415
+
2416
+ }
2417
+
2418
+ });
2419
+
2420
+ }
2421
+
2422
+ });
2423
+ };
2424
+
2425
+ //
2426
+ // Shortcode Framework
2427
+ //
2428
+ $.fn.csf_shortcode = function() {
2429
+
2430
+ var base = this;
2431
+
2432
+ base.shortcode_parse = function( serialize, key ) {
2433
+
2434
+ var shortcode = '';
2435
+
2436
+ $.each(serialize, function( shortcode_key, shortcode_values ) {
2437
+
2438
+ key = ( key ) ? key : shortcode_key;
2439
+
2440
+ shortcode += '[' + key;
2441
+
2442
+ $.each(shortcode_values, function( shortcode_tag, shortcode_value ) {
2443
+
2444
+ if ( shortcode_tag === 'content' ) {
2445
+
2446
+ shortcode += ']';
2447
+ shortcode += shortcode_value;
2448
+ shortcode += '[/'+ key +'';
2449
+
2450
+ } else {
2451
+
2452
+ shortcode += base.shortcode_tags( shortcode_tag, shortcode_value );
2453
+
2454
+ }
2455
+
2456
+ });
2457
+
2458
+ shortcode += ']';
2459
+
2460
+ });
2461
+
2462
+ return shortcode;
2463
+
2464
+ };
2465
+
2466
+ base.shortcode_tags = function( shortcode_tag, shortcode_value ) {
2467
+
2468
+ var shortcode = '';
2469
+
2470
+ if ( shortcode_value !== '' ) {
2471
+
2472
+ if ( typeof shortcode_value === 'object' && !$.isArray( shortcode_value ) ) {
2473
+
2474
+ $.each(shortcode_value, function( sub_shortcode_tag, sub_shortcode_value ) {
2475
+
2476
+ // sanitize spesific key/value
2477
+ switch( sub_shortcode_tag ) {
2478
+
2479
+ case 'background-image':
2480
+ sub_shortcode_value = ( sub_shortcode_value.url ) ? sub_shortcode_value.url : '';
2481
+ break;
2482
+
2483
+ }
2484
+
2485
+ if ( sub_shortcode_value !== '' ) {
2486
+ shortcode += ' ' + sub_shortcode_tag.replace('-', '_') + '="' + sub_shortcode_value.toString() + '"';
2487
+ }
2488
+
2489
+ });
2490
+
2491
+ } else {
2492
+
2493
+ shortcode += ' ' + shortcode_tag.replace('-', '_') + '="' + shortcode_value.toString() + '"';
2494
+
2495
+ }
2496
+
2497
+ }
2498
+
2499
+ return shortcode;
2500
+
2501
+ };
2502
+
2503
+ base.insertAtChars = function( _this, currentValue ) {
2504
+
2505
+ var obj = ( typeof _this[0].name !== 'undefined' ) ? _this[0] : _this;
2506
+
2507
+ if ( obj.value.length && typeof obj.selectionStart !== 'undefined' ) {
2508
+ obj.focus();
2509
+ return obj.value.substring( 0, obj.selectionStart ) + currentValue + obj.value.substring( obj.selectionEnd, obj.value.length );
2510
+ } else {
2511
+ obj.focus();
2512
+ return currentValue;
2513
+ }
2514
+
2515
+ };
2516
+
2517
+ base.send_to_editor = function( html, editor_id ) {
2518
+
2519
+ var tinymce_editor;
2520
+
2521
+ if ( typeof tinymce !== 'undefined' ) {
2522
+ tinymce_editor = tinymce.get( editor_id );
2523
+ }
2524
+
2525
+ if ( tinymce_editor && !tinymce_editor.isHidden() ) {
2526
+ tinymce_editor.execCommand( 'mceInsertContent', false, html );
2527
+ } else {
2528
+ var $editor = $('#'+editor_id);
2529
+ $editor.val( base.insertAtChars( $editor, html ) ).trigger('change');
2530
+ }
2531
+
2532
+ };
2533
+
2534
+ return this.each( function() {
2535
+
2536
+ var $modal = $(this),
2537
+ $load = $modal.find('.csf-modal-load'),
2538
+ $content = $modal.find('.csf-modal-content'),
2539
+ $insert = $modal.find('.csf-modal-insert'),
2540
+ $loading = $modal.find('.csf-modal-loading'),
2541
+ $select = $modal.find('select'),
2542
+ modal_id = $modal.data('modal-id'),
2543
+ nonce = $modal.data('nonce'),
2544
+ editor_id,
2545
+ target_id,
2546
+ gutenberg_id,
2547
+ sc_key,
2548
+ sc_name,
2549
+ sc_view,
2550
+ sc_group,
2551
+ $cloned,
2552
+ $button;
2553
+
2554
+ $(document).on('click', '.csf-shortcode-button[data-modal-id="'+ modal_id +'"]', function( e ) {
2555
+
2556
+ e.preventDefault();
2557
+
2558
+ $button = $(this);
2559
+ editor_id = $button.data('editor-id') || false;
2560
+ target_id = $button.data('target-id') || false;
2561
+ gutenberg_id = $button.data('gutenberg-id') || false;
2562
+
2563
+ $modal.removeClass('hidden');
2564
+
2565
+ // single usage trigger first shortcode
2566
+ if ( $modal.hasClass('csf-shortcode-single') && sc_name === undefined ) {
2567
+ $select.trigger('change');
2568
+ }
2569
+
2570
+ });
2571
+
2572
+ $select.on( 'change', function() {
2573
+
2574
+ var $option = $(this);
2575
+ var $selected = $option.find(':selected');
2576
+
2577
+ sc_key = $option.val();
2578
+ sc_name = $selected.data('shortcode');
2579
+ sc_view = $selected.data('view') || 'normal';
2580
+ sc_group = $selected.data('group') || sc_name;
2581
+
2582
+ $load.empty();
2583
+
2584
+ if ( sc_key ) {
2585
+
2586
+ $loading.show();
2587
+
2588
+ window.wp.ajax.post( 'csf-get-shortcode-'+ modal_id, {
2589
+ shortcode_key: sc_key,
2590
+ nonce: nonce
2591
+ })
2592
+ .done( function( response ) {
2593
+
2594
+ $loading.hide();
2595
+
2596
+ var $appended = $(response.content).appendTo($load);
2597
+
2598
+ $insert.parent().removeClass('hidden');
2599
+
2600
+ $cloned = $appended.find('.csf--repeat-shortcode').csf_clone();
2601
+
2602
+ $appended.csf_reload_script();
2603
+ $appended.find('.csf-fields').csf_reload_script();
2604
+
2605
+ });
2606
+
2607
+ } else {
2608
+
2609
+ $insert.parent().addClass('hidden');
2610
+
2611
+ }
2612
+
2613
+ });
2614
+
2615
+ $insert.on('click', function( e ) {
2616
+
2617
+ e.preventDefault();
2618
+
2619
+ if ( $insert.prop('disabled') || $insert.attr('disabled') ) { return; }
2620
+
2621
+ var shortcode = '';
2622
+ var serialize = $modal.find('.csf-field:not(.csf-depend-on)').find(':input:not(.ignore)').serializeObjectCSF();
2623
+
2624
+ switch ( sc_view ) {
2625
+
2626
+ case 'contents':
2627
+ var contentsObj = ( sc_name ) ? serialize[sc_name] : serialize;
2628
+ $.each(contentsObj, function( sc_key, sc_value ) {
2629
+ var sc_tag = ( sc_name ) ? sc_name : sc_key;
2630
+ shortcode += '['+ sc_tag +']'+ sc_value +'[/'+ sc_tag +']';
2631
+ });
2632
+ break;
2633
+
2634
+ case 'group':
2635
+
2636
+ shortcode += '[' + sc_name;
2637
+ $.each(serialize[sc_name], function( sc_key, sc_value ) {
2638
+ shortcode += base.shortcode_tags( sc_key, sc_value );
2639
+ });
2640
+ shortcode += ']';
2641
+ shortcode += base.shortcode_parse( serialize[sc_group], sc_group );
2642
+ shortcode += '[/' + sc_name + ']';
2643
+
2644
+ break;
2645
+
2646
+ case 'repeater':
2647
+ shortcode += base.shortcode_parse( serialize[sc_group], sc_group );
2648
+ break;
2649
+
2650
+ default:
2651
+ shortcode += base.shortcode_parse( serialize );
2652
+ break;
2653
+
2654
+ }
2655
+
2656
+ shortcode = ( shortcode === '' ) ? '['+ sc_name +']' : shortcode;
2657
+
2658
+ if ( gutenberg_id ) {
2659
+
2660
+ var content = window.csf_gutenberg_props.attributes.hasOwnProperty('shortcode') ? window.csf_gutenberg_props.attributes.shortcode : '';
2661
+ window.csf_gutenberg_props.setAttributes({shortcode: content + shortcode});
2662
+
2663
+ } else if ( editor_id ) {
2664
+
2665
+ base.send_to_editor( shortcode, editor_id );
2666
+
2667
+ } else {
2668
+
2669
+ var $textarea = (target_id) ? $(target_id) : $button.parent().find('textarea');
2670
+ $textarea.val( base.insertAtChars( $textarea, shortcode ) ).trigger('change');
2671
+
2672
+ }
2673
+
2674
+ $modal.addClass('hidden');
2675
+
2676
+ });
2677
+
2678
+ $modal.on('click', '.csf--repeat-button', function( e ) {
2679
+
2680
+ e.preventDefault();
2681
+
2682
+ var $repeatable = $modal.find('.csf--repeatable');
2683
+ var $new_clone = $cloned.csf_clone();
2684
+ var $remove_btn = $new_clone.find('.csf-repeat-remove');
2685
+
2686
+ var $appended = $new_clone.appendTo( $repeatable );
2687
+
2688
+ $new_clone.find('.csf-fields').csf_reload_script();
2689
+
2690
+ CSF.helper.name_nested_replace( $modal.find('.csf--repeat-shortcode'), sc_group );
2691
+
2692
+ $remove_btn.on('click', function() {
2693
+
2694
+ $new_clone.remove();
2695
+
2696
+ CSF.helper.name_nested_replace( $modal.find('.csf--repeat-shortcode'), sc_group );
2697
+
2698
+ });
2699
+
2700
+ });
2701
+
2702
+ $modal.on('click', '.csf-modal-close, .csf-modal-overlay', function() {
2703
+ $modal.addClass('hidden');
2704
+ });
2705
+
2706
+ });
2707
+ };
2708
+
2709
+ //
2710
+ // WP Color Picker
2711
+ //
2712
+ if ( typeof Color === 'function' ) {
2713
+
2714
+ Color.prototype.toString = function() {
2715
+
2716
+ if ( this._alpha < 1 ) {
2717
+ return this.toCSS('rgba', this._alpha).replace(/\s+/g, '');
2718
+ }
2719
+
2720
+ var hex = parseInt( this._color, 10 ).toString( 16 );
2721
+
2722
+ if ( this.error ) { return ''; }
2723
+
2724
+ if ( hex.length < 6 ) {
2725
+ for (var i = 6 - hex.length - 1; i >= 0; i--) {
2726
+ hex = '0' + hex;
2727
+ }
2728
+ }
2729
+
2730
+ return '#' + hex;
2731
+
2732
+ };
2733
+
2734
+ }
2735
+
2736
+ CSF.funcs.parse_color = function( color ) {
2737
+
2738
+ var value = color.replace(/\s+/g, ''),
2739
+ trans = ( value.indexOf('rgba') !== -1 ) ? parseFloat( value.replace(/^.*,(.+)\)/, '$1') * 100 ) : 100,
2740
+ rgba = ( trans < 100 ) ? true : false;
2741
+
2742
+ return { value: value, transparent: trans, rgba: rgba };
2743
+
2744
+ };
2745
+
2746
+ $.fn.csf_color = function() {
2747
+ return this.each( function() {
2748
+
2749
+ var $input = $(this),
2750
+ picker_color = CSF.funcs.parse_color( $input.val() ),
2751
+ palette_color = window.csf_vars.color_palette.length ? window.csf_vars.color_palette : true,
2752
+ $container;
2753
+
2754
+ // Destroy and Reinit
2755
+ if ( $input.hasClass('wp-color-picker') ) {
2756
+ $input.closest('.wp-picker-container').after($input).remove();
2757
+ }
2758
+
2759
+ $input.wpColorPicker({
2760
+ palettes: palette_color,
2761
+ change: function( event, ui ) {
2762
+
2763
+ var ui_color_value = ui.color.toString();
2764
+
2765
+ $container.removeClass('csf--transparent-active');
2766
+ $container.find('.csf--transparent-offset').css('background-color', ui_color_value);
2767
+ $input.val(ui_color_value).trigger('change');
2768
+
2769
+ },
2770
+ create: function() {
2771
+
2772
+ $container = $input.closest('.wp-picker-container');
2773
+
2774
+ var a8cIris = $input.data('a8cIris'),
2775
+ $transparent_wrap = $('<div class="csf--transparent-wrap">' +
2776
+ '<div class="csf--transparent-slider"></div>' +
2777
+ '<div class="csf--transparent-offset"></div>' +
2778
+ '<div class="csf--transparent-text"></div>' +
2779
+ '<div class="csf--transparent-button">transparent <i class="fas fa-toggle-off"></i></div>' +
2780
+ '</div>').appendTo( $container.find('.wp-picker-holder') ),
2781
+ $transparent_slider = $transparent_wrap.find('.csf--transparent-slider'),
2782
+ $transparent_text = $transparent_wrap.find('.csf--transparent-text'),
2783
+ $transparent_offset = $transparent_wrap.find('.csf--transparent-offset'),
2784
+ $transparent_button = $transparent_wrap.find('.csf--transparent-button');
2785
+
2786
+ if ( $input.val() === 'transparent' ) {
2787
+ $container.addClass('csf--transparent-active');
2788
+ }
2789
+
2790
+ $transparent_button.on('click', function() {
2791
+ if ( $input.val() !== 'transparent' ) {
2792
+ $input.val('transparent').trigger('change').removeClass('iris-error');
2793
+ $container.addClass('csf--transparent-active');
2794
+ } else {
2795
+ $input.val( a8cIris._color.toString() ).trigger('change');
2796
+ $container.removeClass('csf--transparent-active');
2797
+ }
2798
+ });
2799
+
2800
+ $transparent_slider.slider({
2801
+ value: picker_color.transparent,
2802
+ step: 1,
2803
+ min: 0,
2804
+ max: 100,
2805
+ slide: function( event, ui ) {
2806
+
2807
+ var slide_value = parseFloat( ui.value / 100 );
2808
+ a8cIris._color._alpha = slide_value;
2809
+ $input.wpColorPicker( 'color', a8cIris._color.toString() );
2810
+ $transparent_text.text( ( slide_value === 1 || slide_value === 0 ? '' : slide_value ) );
2811
+
2812
+ },
2813
+ create: function() {
2814
+
2815
+ var slide_value = parseFloat( picker_color.transparent / 100 ),
2816
+ text_value = slide_value < 1 ? slide_value : '';
2817
+
2818
+ $transparent_text.text(text_value);
2819
+ $transparent_offset.css('background-color', picker_color.value);
2820
+
2821
+ $container.on('click', '.wp-picker-clear', function() {
2822
+
2823
+ a8cIris._color._alpha = 1;
2824
+ $transparent_text.text('');
2825
+ $transparent_slider.slider('option', 'value', 100);
2826
+ $container.removeClass('csf--transparent-active');
2827
+ $input.trigger('change');
2828
+
2829
+ });
2830
+
2831
+ $container.on('click', '.wp-picker-default', function() {
2832
+
2833
+ var default_color = CSF.funcs.parse_color( $input.data('default-color') ),
2834
+ default_value = parseFloat( default_color.transparent / 100 ),
2835
+ default_text = default_value < 1 ? default_value : '';
2836
+
2837
+ a8cIris._color._alpha = default_value;
2838
+ $transparent_text.text(default_text);
2839
+ $transparent_slider.slider('option', 'value', default_color.transparent);
2840
+
2841
+ });
2842
+
2843
+ }
2844
+ });
2845
+ }
2846
+ });
2847
+
2848
+ });
2849
+ };
2850
+
2851
+ //
2852
+ // ChosenJS
2853
+ //
2854
+ $.fn.csf_chosen = function() {
2855
+ return this.each( function() {
2856
+
2857
+ var $this = $(this),
2858
+ $inited = $this.parent().find('.chosen-container'),
2859
+ is_sortable = $this.hasClass('csf-chosen-sortable') || false,
2860
+ is_ajax = $this.hasClass('csf-chosen-ajax') || false,
2861
+ is_multiple = $this.attr('multiple') || false,
2862
+ set_width = is_multiple ? '100%' : 'auto',
2863
+ set_options = $.extend({
2864
+ allow_single_deselect: true,
2865
+ disable_search_threshold: 10,
2866
+ width: set_width,
2867
+ no_results_text: window.csf_vars.i18n.no_results_text,
2868
+ }, $this.data('chosen-settings'));
2869
+
2870
+ if ( $inited.length ) {
2871
+ $inited.remove();
2872
+ }
2873
+
2874
+ // Chosen ajax
2875
+ if ( is_ajax ) {
2876
+
2877
+ var set_ajax_options = $.extend({
2878
+ data: {
2879
+ type: 'post',
2880
+ nonce: '',
2881
+ },
2882
+ allow_single_deselect: true,
2883
+ disable_search_threshold: -1,
2884
+ width: '100%',
2885
+ min_length: 3,
2886
+ type_delay: 500,
2887
+ typing_text: window.csf_vars.i18n.typing_text,
2888
+ searching_text: window.csf_vars.i18n.searching_text,
2889
+ no_results_text: window.csf_vars.i18n.no_results_text,
2890
+ }, $this.data('chosen-settings'));
2891
+
2892
+ $this.CSFAjaxChosen(set_ajax_options);
2893
+
2894
+ } else {
2895
+
2896
+ $this.chosen(set_options);
2897
+
2898
+ }
2899
+
2900
+ // Chosen keep options order
2901
+ if ( is_multiple ) {
2902
+
2903
+ var $hidden_select = $this.parent().find('.csf-hide-select');
2904
+ var $hidden_value = $hidden_select.val() || [];
2905
+
2906
+ $this.on('change', function(obj, result) {
2907
+
2908
+ if ( result && result.selected ) {
2909
+ $hidden_select.append( '<option value="'+ result.selected +'" selected="selected">'+ result.selected +'</option>' );
2910
+ } else if ( result && result.deselected ) {
2911
+ $hidden_select.find('option[value="'+ result.deselected +'"]').remove();
2912
+ }
2913
+
2914
+ // Force customize refresh
2915
+ if ( window.wp.customize !== undefined && $hidden_select.children().length === 0 && $hidden_select.data('customize-setting-link') ) {
2916
+ window.wp.customize.control( $hidden_select.data('customize-setting-link') ).setting.set('');
2917
+ }
2918
+
2919
+ $hidden_select.trigger('change');
2920
+
2921
+ });
2922
+
2923
+ // Chosen order abstract
2924
+ $this.CSFChosenOrder($hidden_value, true);
2925
+
2926
+ }
2927
+
2928
+ // Chosen sortable
2929
+ if ( is_sortable ) {
2930
+
2931
+ var $chosen_container = $this.parent().find('.chosen-container');
2932
+ var $chosen_choices = $chosen_container.find('.chosen-choices');
2933
+
2934
+ $chosen_choices.bind('mousedown', function( event ) {
2935
+ if ( $(event.target).is('span') ) {
2936
+ event.stopPropagation();
2937
+ }
2938
+ });
2939
+
2940
+ $chosen_choices.sortable({
2941
+ items: 'li:not(.search-field)',
2942
+ helper: 'orginal',
2943
+ cursor: 'move',
2944
+ placeholder: 'search-choice-placeholder',
2945
+ start: function(e,ui) {
2946
+ ui.placeholder.width( ui.item.innerWidth() );
2947
+ ui.placeholder.height( ui.item.innerHeight() );
2948
+ },
2949
+ update: function( e, ui ) {
2950
+
2951
+ var select_options = '';
2952
+ var chosen_object = $this.data('chosen');
2953
+ var $prev_select = $this.parent().find('.csf-hide-select');
2954
+
2955
+ $chosen_choices.find('.search-choice-close').each( function() {
2956
+ var option_array_index = $(this).data('option-array-index');
2957
+ $.each(chosen_object.results_data, function(index, data) {
2958
+ if ( data.array_index === option_array_index ){
2959
+ select_options += '<option value="'+ data.value +'" selected>'+ data.value +'</option>';
2960
+ }
2961
+ });
2962
+ });
2963
+
2964
+ $prev_select.children().remove();
2965
+ $prev_select.append(select_options);
2966
+ $prev_select.trigger('change');
2967
+
2968
+ }
2969
+ });
2970
+
2971
+ }
2972
+
2973
+ });
2974
+ };
2975
+
2976
+ //
2977
+ // Helper Checkbox Checker
2978
+ //
2979
+ $.fn.csf_checkbox = function() {
2980
+ return this.each( function() {
2981
+
2982
+ var $this = $(this),
2983
+ $input = $this.find('.csf--input'),
2984
+ $checkbox = $this.find('.csf--checkbox');
2985
+
2986
+ $checkbox.on('click', function() {
2987
+ $input.val( Number( $checkbox.prop('checked') ) ).trigger('change');
2988
+ });
2989
+
2990
+ });
2991
+ };
2992
+
2993
+ //
2994
+ // Siblings
2995
+ //
2996
+ $.fn.csf_siblings = function() {
2997
+ return this.each( function() {
2998
+
2999
+ var $this = $(this),
3000
+ $siblings = $this.find('.csf--sibling'),
3001
+ multiple = $this.data('multiple') || false;
3002
+
3003
+ $siblings.on('click', function() {
3004
+
3005
+ var $sibling = $(this);
3006
+
3007
+ if ( multiple ) {
3008
+
3009
+ if ( $sibling.hasClass('csf--active') ) {
3010
+ $sibling.removeClass('csf--active');
3011
+ $sibling.find('input').prop('checked', false).trigger('change');
3012
+ } else {
3013
+ $sibling.addClass('csf--active');
3014
+ $sibling.find('input').prop('checked', true).trigger('change');
3015
+ }
3016
+
3017
+ } else {
3018
+
3019
+ $this.find('input').prop('checked', false);
3020
+ $sibling.find('input').prop('checked', true).trigger('change');
3021
+ $sibling.addClass('csf--active').siblings().removeClass('csf--active');
3022
+
3023
+ }
3024
+
3025
+ });
3026
+
3027
+ });
3028
+ };
3029
+
3030
+ //
3031
+ // Help Tooltip
3032
+ //
3033
+ $.fn.csf_help = function() {
3034
+ return this.each( function() {
3035
+
3036
+ var $this = $(this),
3037
+ $tooltip,
3038
+ offset_left;
3039
+
3040
+ $this.on({
3041
+ mouseenter: function() {
3042
+
3043
+ $tooltip = $( '<div class="csf-tooltip"></div>' ).html( $this.find('.csf-help-text').html() ).appendTo('body');
3044
+ offset_left = ( CSF.vars.is_rtl ) ? ( $this.offset().left + 24 ) : ( $this.offset().left - $tooltip.outerWidth() );
3045
+
3046
+ $tooltip.css({
3047
+ top: $this.offset().top - ( ( $tooltip.outerHeight() / 2 ) - 14 ),
3048
+ left: offset_left,
3049
+ });
3050
+
3051
+ },
3052
+ mouseleave: function() {
3053
+
3054
+ if ( $tooltip !== undefined ) {
3055
+ $tooltip.remove();
3056
+ }
3057
+
3058
+ }
3059
+
3060
+ });
3061
+
3062
+ });
3063
+ };
3064
+
3065
+ //
3066
+ // Customize Refresh
3067
+ //
3068
+ $.fn.csf_customizer_refresh = function() {
3069
+ return this.each( function() {
3070
+
3071
+ var $this = $(this),
3072
+ $complex = $this.closest('.csf-customize-complex');
3073
+
3074
+ if ( $complex.length ) {
3075
+
3076
+ var $input = $complex.find(':input'),
3077
+ $unique = $complex.data('unique-id'),
3078
+ $option = $complex.data('option-id'),
3079
+ obj = $input.serializeObjectCSF(),
3080
+ data = ( !$.isEmptyObject(obj) ) ? obj[$unique][$option] : '',
3081
+ control = window.wp.customize.control($unique +'['+ $option +']');
3082
+
3083
+ // clear the value to force refresh.
3084
+ control.setting._value = null;
3085
+
3086
+ control.setting.set( data );
3087
+
3088
+ } else {
3089
+
3090
+ $this.find(':input').first().trigger('change');
3091
+
3092
+ }
3093
+
3094
+ $(document).trigger('csf-customizer-refresh', $this);
3095
+
3096
+ });
3097
+ };
3098
+
3099
+ //
3100
+ // Customize Listen Form Elements
3101
+ //
3102
+ $.fn.csf_customizer_listen = function( options ) {
3103
+
3104
+ var settings = $.extend({
3105
+ closest: false,
3106
+ }, options );
3107
+
3108
+ return this.each( function() {
3109
+
3110
+ if ( window.wp.customize === undefined ) { return; }
3111
+
3112
+ var $this = ( settings.closest ) ? $(this).closest('.csf-customize-complex') : $(this),
3113
+ $input = $this.find(':input'),
3114
+ unique_id = $this.data('unique-id'),
3115
+ option_id = $this.data('option-id');
3116
+
3117
+ if ( unique_id === undefined ) { return; }
3118
+
3119
+ $input.on('change keyup', CSF.helper.debounce( function() {
3120
+
3121
+ var obj = $this.find(':input').serializeObjectCSF();
3122
+ var val = ( !$.isEmptyObject(obj) && obj[unique_id] && obj[unique_id][option_id] ) ? obj[unique_id][option_id] : '';
3123
+
3124
+ window.wp.customize.control( unique_id +'['+ option_id +']' ).setting.set( val );
3125
+
3126
+ }, 250 ) );
3127
+
3128
+ });
3129
+ };
3130
+
3131
+ //
3132
+ // Customizer Listener for Reload JS
3133
+ //
3134
+ $(document).on('expanded', '.control-section', function() {
3135
+
3136
+ var $this = $(this);
3137
+
3138
+ if ( $this.hasClass('open') && !$this.data('inited') ) {
3139
+
3140
+ var $fields = $this.find('.csf-customize-field');
3141
+ var $complex = $this.find('.csf-customize-complex');
3142
+
3143
+ if ( $fields.length ) {
3144
+ $this.csf_dependency();
3145
+ $fields.csf_reload_script({dependency: false});
3146
+ $complex.csf_customizer_listen();
3147
+ }
3148
+
3149
+ $this.data('inited', true);
3150
+
3151
+ }
3152
+
3153
+ });
3154
+
3155
+ //
3156
+ // Window on resize
3157
+ //
3158
+ CSF.vars.$window.on('resize csf.resize', CSF.helper.debounce( function( event ) {
3159
+
3160
+ var window_width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? CSF.vars.$window.width() : window.innerWidth;
3161
+
3162
+ if ( window_width <= 782 && !CSF.vars.onloaded ) {
3163
+ $('.csf-section').csf_reload_script();
3164
+ CSF.vars.onloaded = true;
3165
+ }
3166
+
3167
+ }, 200)).trigger('csf.resize');
3168
+
3169
+ //
3170
+ // Widgets Framework
3171
+ //
3172
+ $.fn.csf_widgets = function() {
3173
+ if ( this.length ) {
3174
+
3175
+ $(document).on('widget-added widget-updated', function( event, $widget ) {
3176
+ $widget.find('.csf-fields').csf_reload_script();
3177
+ });
3178
+
3179
+ $('.widgets-sortables, .control-section-sidebar').on('sortstop', function( event, ui ) {
3180
+ ui.item.find('.csf-fields').csf_reload_script_retry();
3181
+ });
3182
+
3183
+ $(document).on('click', '.widget-top', function( event ) {
3184
+ $(this).parent().find('.csf-fields').csf_reload_script();
3185
+ });
3186
+
3187
+ }
3188
+ };
3189
+
3190
+ //
3191
+ // Nav Menu Options Framework
3192
+ //
3193
+ $.fn.csf_nav_menu = function() {
3194
+ return this.each( function() {
3195
+
3196
+ var $navmenu = $(this);
3197
+
3198
+ $navmenu.on('click', 'a.item-edit', function() {
3199
+ $(this).closest('li.menu-item').find('.csf-fields').csf_reload_script();
3200
+ });
3201
+
3202
+ $navmenu.on('sortstop', function( event, ui ) {
3203
+ ui.item.find('.csf-fields').csf_reload_script_retry();
3204
+ });
3205
+
3206
+ });
3207
+ };
3208
+
3209
+ //
3210
+ // Retry Plugins
3211
+ //
3212
+ $.fn.csf_reload_script_retry = function() {
3213
+ return this.each( function() {
3214
+
3215
+ var $this = $(this);
3216
+
3217
+ if ( $this.data('inited') ) {
3218
+ $this.children('.csf-field-wp_editor').csf_field_wp_editor();
3219
+ }
3220
+
3221
+ });
3222
+ };
3223
+
3224
+ //
3225
+ // Reload Plugins
3226
+ //
3227
+ $.fn.csf_reload_script = function( options ) {
3228
+
3229
+ var settings = $.extend({
3230
+ dependency: true,
3231
+ }, options );
3232
+
3233
+ return this.each( function() {
3234
+
3235
+ var $this = $(this);
3236
+
3237
+ // Avoid for conflicts
3238
+ if ( !$this.data('inited') ) {
3239
+
3240
+ // Field plugins
3241
+ $this.children('.csf-field-accordion').csf_field_accordion();
3242
+ $this.children('.csf-field-backup').csf_field_backup();
3243
+ $this.children('.csf-field-background').csf_field_background();
3244
+ $this.children('.csf-field-code_editor').csf_field_code_editor();
3245
+ $this.children('.csf-field-date').csf_field_date();
3246
+ $this.children('.csf-field-fieldset').csf_field_fieldset();
3247
+ $this.children('.csf-field-gallery').csf_field_gallery();
3248
+ $this.children('.csf-field-group').csf_field_group();
3249
+ $this.children('.csf-field-icon').csf_field_icon();
3250
+ $this.children('.csf-field-media').csf_field_media();
3251
+ $this.children('.csf-field-map').csf_field_map();
3252
+ $this.children('.csf-field-repeater').csf_field_repeater();
3253
+ $this.children('.csf-field-slider').csf_field_slider();
3254
+ $this.children('.csf-field-sortable').csf_field_sortable();
3255
+ $this.children('.csf-field-sorter').csf_field_sorter();
3256
+ $this.children('.csf-field-spinner').csf_field_spinner();
3257
+ $this.children('.csf-field-switcher').csf_field_switcher();
3258
+ $this.children('.csf-field-tabbed').csf_field_tabbed();
3259
+ $this.children('.csf-field-typography').csf_field_typography();
3260
+ $this.children('.csf-field-upload').csf_field_upload();
3261
+ $this.children('.csf-field-wp_editor').csf_field_wp_editor();
3262
+
3263
+ // Field colors
3264
+ $this.children('.csf-field-border').find('.csf-color').csf_color();
3265
+ $this.children('.csf-field-background').find('.csf-color').csf_color();
3266
+ $this.children('.csf-field-color').find('.csf-color').csf_color();
3267
+ $this.children('.csf-field-color_group').find('.csf-color').csf_color();
3268
+ $this.children('.csf-field-link_color').find('.csf-color').csf_color();
3269
+ $this.children('.csf-field-typography').find('.csf-color').csf_color();
3270
+
3271
+ // Field chosenjs
3272
+ $this.children('.csf-field-select').find('.csf-chosen').csf_chosen();
3273
+
3274
+ // Field Checkbox
3275
+ $this.children('.csf-field-checkbox').find('.csf-checkbox').csf_checkbox();
3276
+
3277
+ // Field Siblings
3278
+ $this.children('.csf-field-button_set').find('.csf-siblings').csf_siblings();
3279
+ $this.children('.csf-field-image_select').find('.csf-siblings').csf_siblings();
3280
+ $this.children('.csf-field-palette').find('.csf-siblings').csf_siblings();
3281
+
3282
+ // Help Tooptip
3283
+ $this.children('.csf-field').find('.csf-help').csf_help();
3284
+
3285
+ if ( settings.dependency ) {
3286
+ $this.csf_dependency();
3287
+ }
3288
+
3289
+ $this.data('inited', true);
3290
+
3291
+ $(document).trigger('csf-reload-script', $this);
3292
+
3293
+ }
3294
+
3295
+ });
3296
+ };
3297
+
3298
+ //
3299
+ // Document ready and run scripts
3300
+ //
3301
+ $(document).ready( function() {
3302
+
3303
+ $('.csf-save').csf_save();
3304
+ $('.csf-options').csf_options();
3305
+ $('.csf-sticky-header').csf_sticky();
3306
+ $('.csf-nav-options').csf_nav_options();
3307
+ $('.csf-nav-metabox').csf_nav_metabox();
3308
+ $('.csf-taxonomy').csf_taxonomy();
3309
+ $('.csf-page-templates').csf_page_templates();
3310
+ $('.csf-post-formats').csf_post_formats();
3311
+ $('.csf-shortcode').csf_shortcode();
3312
+ $('.csf-search').csf_search();
3313
+ $('.csf-confirm').csf_confirm();
3314
+ $('.csf-expand-all').csf_expand_all();
3315
+ $('.csf-onload').csf_reload_script();
3316
+ $('.widget').csf_widgets();
3317
+ $('#menu-to-edit').csf_nav_menu();
3318
+
3319
+ });
3320
+
3321
+ })( jQuery, window, document );
includes/libs/codestar-framework/assets/js/main.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.7*/
2
+
3
+ !function(A,_,b,y){"use strict";var E=E||{};E.funcs={},E.vars={onloaded:!1,$body:A("body"),$window:A(_),$document:A(b),$form_warning:null,is_confirm:!1,form_modified:!1,code_themes:[],is_rtl:A("body").hasClass("rtl")},E.helper={uid:function(e){return(e||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(e){return(e+"").replace(/(\[|\-|\])/g,"\\$1")},name_nested_replace:function(e,t){var n=new RegExp("("+E.helper.preg_quote(t)+")\\[(\\d+)\\]","g");e.find(":radio").each(function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)}),e.each(function(e){A(this).find(":input").each(function(){this.name=this.name.replace(n,t+"["+e+"]"),this.orginal_checked&&(this.checked=!0)})})},debounce:function(i,a,s){var c;return function(){var e=this,t=arguments,n=s&&!c;clearTimeout(c),c=setTimeout(function(){c=null,s||i.apply(e,t)},a),n&&i.apply(e,t)}}},A.fn.csf_clone=function(){for(var e=A.fn.clone.apply(this,arguments),t=this.find("select").add(this.filter("select")),n=e.find("select").add(e.filter("select")),i=0;i<t.length;++i)for(var a=0;a<t[i].options.length;++a)!0===t[i].options[a].selected&&(n[i].options[a].selected=!0);return this.find(":radio").each(function(){this.orginal_checked=this.checked}),e},A.fn.csf_expand_all=function(){return this.each(function(){A(this).on("click",function(e){e.preventDefault(),A(".csf-wrapper").toggleClass("csf-show-all"),A(".csf-section").csf_reload_script(),A(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")})})},A.fn.csf_nav_options=function(){return this.each(function(){var a,s=A(this).find("a");A(_).on("hashchange csf.hashchange",function(){var e=_.location.hash.replace("#tab=",""),t=e||s.first().attr("href").replace("#tab=",""),n=A('[data-tab-id="'+t+'"]');if(n.length){n.closest(".csf-tab-item").addClass("csf-tab-expanded").siblings().removeClass("csf-tab-expanded"),n.next().is("ul")&&(t=(n=n.next().find("li").first().find("a")).data("tab-id")),s.removeClass("csf-active"),n.addClass("csf-active"),a&&a.hide();var i=A('[data-section-id="'+t+'"]');i.show(),i.csf_reload_script(),A(".csf-section-id").val(i.index()),a=i}}).trigger("csf.hashchange")})},A.fn.csf_nav_metabox=function(){return this.each(function(){var a,e=A(this),s=e.find("a"),c=e.parent().find(".csf-section");s.each(function(i){A(this).on("click",function(e){e.preventDefault();var t=A(this);s.removeClass("csf-active"),t.addClass("csf-active"),a!==y&&a.hide();var n=c.eq(i);n.show(),n.csf_reload_script(),a=n})}),s.first().trigger("click")})},A.fn.csf_page_templates=function(){this.length&&A(b).on("change",".editor-page-attributes__template select, #page_template",function(){var e=A(this).val()||"default";A(".csf-page-templates").removeClass("csf-metabox-show").addClass("csf-metabox-hide"),A(".csf-page-"+e.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("csf-metabox-hide").addClass("csf-metabox-show")})},A.fn.csf_post_formats=function(){this.length&&A(b).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',function(){var e=A(this).val()||"default";e="0"===e?"default":e,A(".csf-post-formats").removeClass("csf-metabox-show").addClass("csf-metabox-hide"),A(".csf-post-format-"+e).removeClass("csf-metabox-hide").addClass("csf-metabox-show")})},A.fn.csf_search=function(){return this.each(function(){A(this).find("input").on("change keyup",function(){var n=A(this).val(),e=A(".csf-wrapper"),t=e.find(".csf-section").find("> .csf-field:not(.csf-depend-on)"),i=t.find("> .csf-title, .csf-search-tags");3<n.length?(t.addClass("csf-metabox-hide"),e.addClass("csf-search-all"),i.each(function(){var e=A(this);if(e.text().match(new RegExp(".*?"+n+".*?","i"))){var t=e.closest(".csf-field");t.removeClass("csf-metabox-hide"),t.parent().csf_reload_script()}})):(t.removeClass("csf-metabox-hide"),e.removeClass("csf-search-all"))})})},A.fn.csf_sticky=function(){return this.each(function(){var i=A(this),e=A(_),a=i.find(".csf-header-inner"),s=parseInt(a.css("padding-left"))+parseInt(a.css("padding-right")),c=0,r=!1,t=function(){r||requestAnimationFrame(function(){var e,t,n;e=i.offset().top,t=Math.max(32,e-c),n=Math.max(b.documentElement.clientWidth,_.innerWidth||0),t<=32&&782<n?(a.css({width:i.outerWidth()-s}),i.css({height:i.outerHeight()}).addClass("csf-sticky")):(a.removeAttr("style"),i.removeAttr("style").removeClass("csf-sticky")),r=!1}),r=!0},n=function(){c=e.scrollTop(),t()};e.on("scroll resize",n),n()})},A.fn.csf_dependency=function(){return this.each(function(){var e=A(this),t=e.children("[data-controller]");if(t.length){var n=A.csf_deps.createRuleset(),i=A.csf_deps.createRuleset(),f=[],l=[];t.each(function(){var a=A(this),e=a.data("controller").split("|"),s=a.data("condition").split("|"),c=a.data("value").toString().split("|"),r=!!a.data("depend-global"),o=r?i:n;A.each(e,function(e,t){var n=c[e]||"",i=s[e]||s[0];(o=o.createRule('[data-depend-id="'+t+'"]',i,n)).include(a),r?l.push(t):f.push(t)})}),f.length&&A.csf_deps.enable(e,n,f),l.length&&A.csf_deps.enable(E.vars.$body,i,l)}})},A.fn.csf_field_accordion=function(){return this.each(function(){A(this).find(".csf-accordion-title").on("click",function(){var e=A(this),t=e.find(".csf-accordion-icon"),n=e.next();t.hasClass("fa-angle-right")?t.removeClass("fa-angle-right").addClass("fa-angle-down"):t.removeClass("fa-angle-down").addClass("fa-angle-right"),n.data("opened")||(n.csf_reload_script(),n.data("opened",!0)),n.toggleClass("csf-accordion-open")})})},A.fn.csf_field_backup=function(){return this.each(function(){if(_.wp.customize!==y){var t=this,n=A(this),i=(A("body"),n.find(".csf-import")),a=n.find(".csf-reset");t.notification=function(e){wp.customize.notifications&&wp.customize.OverlayNotification&&(wp.customize.state("saved").get()||(wp.customize.state("changesetStatus").set("trash"),wp.customize.each(function(e){e._dirty=!1}),wp.customize.state("saved").set(!0)),wp.customize.notifications.add(new wp.customize.OverlayNotification("csf_field_backup_notification",{type:"info",message:e,loading:!0})))},a.on("click",function(e){e.preventDefault(),E.vars.is_confirm&&(t.notification(_.csf_vars.i18n.reset_notification),_.wp.ajax.post("csf-reset",{unique:a.data("unique"),nonce:a.data("nonce")}).done(function(e){_.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))}),i.on("click",function(e){e.preventDefault(),E.vars.is_confirm&&(t.notification(_.csf_vars.i18n.import_notification),_.wp.ajax.post("csf-import",{unique:i.data("unique"),nonce:i.data("nonce"),data:n.find(".csf-import-data").val()}).done(function(e){_.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))})}})},A.fn.csf_field_background=function(){return this.each(function(){A(this).find(".csf--background-image").csf_reload_script()})},A.fn.csf_field_code_editor=function(){return this.each(function(){if("function"==typeof CodeMirror){var t=A(this),i=t.find("textarea"),e=t.find(".CodeMirror"),a=i.data("editor");e.length&&e.remove();var s=setInterval(function(){if(t.is(":visible")){var n=CodeMirror.fromTextArea(i[0],a);if("default"!==a.theme&&-1===E.vars.code_themes.indexOf(a.theme)){var e=A("<link>");A("#csf-codemirror-css").after(e),e.attr({rel:"stylesheet",id:"csf-codemirror-"+a.theme+"-css",href:a.cdnURL+"/theme/"+a.theme+".min.css",type:"text/css",media:"all"}),E.vars.code_themes.push(a.theme)}CodeMirror.modeURL=a.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(n,a.mode),n.on("change",function(e,t){i.val(n.getValue()).trigger("change")}),clearInterval(s)}})}})},A.fn.csf_field_date=function(){return this.each(function(){var e=A(this),i=e.find("input"),a=e.find(".csf-date-settings").data("settings"),t={showAnim:"",beforeShow:function(e,t){A(t.dpDiv).addClass("csf-datepicker-wrapper")},onClose:function(e,t){A(t.dpDiv).removeClass("csf-datepicker-wrapper")}};a=A.extend({},a,t),2===i.length&&(a=A.extend({},a,{onSelect:function(e){A(this),i.first();var t=i.first().attr("id")===A(this).attr("id")?"minDate":"maxDate",n=A.datepicker.parseDate(a.dateFormat,e);i.not(this).datepicker("option",t,n)}})),i.each(function(){var e=A(this);e.hasClass("hasDatepicker")&&e.removeAttr("id").removeClass("hasDatepicker"),e.datepicker(a)})})},A.fn.csf_field_fieldset=function(){return this.each(function(){A(this).find(".csf-fieldset-content").csf_reload_script()})},A.fn.csf_field_gallery=function(){return this.each(function(){var s,e=A(this),c=e.find(".csf-edit-gallery"),r=e.find(".csf-clear-gallery"),o=e.find("ul"),f=e.find("input");e.find("img");e.on("click",".csf-button, .csf-edit-gallery",function(e){var t=A(this),n=f.val(),i=t.hasClass("csf-edit-gallery")?"edit":"add",a="add"!==i||n.length?"gallery-edit":"gallery";e.preventDefault(),void 0!==_.wp&&_.wp.media&&_.wp.media.gallery&&("gallery"===a?(s=_.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(s=_.wp.media.gallery.edit('[gallery ids="'+n+'"]'),"add"===i&&s.setState("gallery-library")),s.on("update",function(e){o.empty();var t=e.models.map(function(e){var t=e.toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url?t.sizes.thumbnail.url:t.url;return o.append('<li><img src="'+n+'"></li>'),t.id});f.val(t.join(",")).trigger("change"),r.removeClass("hidden"),c.removeClass("hidden")}))}),r.on("click",function(e){e.preventDefault(),o.empty(),f.val("").trigger("change"),r.addClass("hidden"),c.addClass("hidden")})})},A.fn.csf_field_group=function(){return this.each(function(){var e=A(this),t=e.children(".csf-fieldset"),n=t.length?t:e,o=n.children(".csf-cloneable-wrapper"),a=n.children(".csf-cloneable-hidden"),f=n.children(".csf-cloneable-max"),l=n.children(".csf-cloneable-min"),d=o.data("field-id"),s=o.data("unique-id"),h=Boolean(Number(o.data("title-number"))),p=parseInt(o.data("max")),i=parseInt(o.data("min"));o.hasClass("ui-accordion")&&o.find(".ui-accordion-header-icon").remove();var u=function(e){e.find(".csf-cloneable-title-number").each(function(e){A(this).html(A(this).closest(".csf-cloneable-item").index()+1+".")})};o.accordion({header:"> .csf-cloneable-item > .csf-cloneable-title",collapsible:!0,active:!1,animate:!1,heightStyle:"content",icons:{header:"csf-cloneable-header-icon fas fa-angle-right",activeHeader:"csf-cloneable-header-icon fas fa-angle-down"},activate:function(e,t){var n=t.newPanel,i=t.newHeader;if(n.length&&!n.data("opened")){var a=n.children().first().find(":input").first(),s=i.find(".csf-cloneable-value");a.on("change keyup",function(e){s.text(a.val())}),n.csf_reload_script(),n.data("opened",!0),n.data("retry",!1)}else n.data("retry")&&(n.csf_reload_script_retry(),n.data("retry",!1))}}),o.sortable({axis:"y",handle:".csf-cloneable-title,.csf-cloneable-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",start:function(e,t){o.accordion({active:!1}),o.sortable("refreshPositions"),t.item.children(".csf-cloneable-content").data("retry",!0)},update:function(e,t){E.helper.name_nested_replace(o.children(".csf-cloneable-item"),d),o.csf_customizer_refresh(),h&&u(o)}}),n.children(".csf-cloneable-add").on("click",function(e){e.preventDefault();var t=o.children(".csf-cloneable-item").length;if(l.hide(),p&&p<t+1)f.show();else{var n=s+d+"["+t+"]",i=a.csf_clone(!0);i.removeClass("csf-cloneable-hidden"),i.find(':input[name!="_pseudo"]').each(function(){this.name=n+this.name.replace(this.name.startsWith("_nonce")?"_nonce":s,"")}),i.find(".csf-data-wrapper").each(function(){A(this).attr("data-unique-id",n)}),o.append(i),o.accordion("refresh"),o.accordion({active:t}),o.csf_customizer_refresh(),o.csf_customizer_listen({closest:!0}),h&&u(o)}});var c=function(e){e.preventDefault();var t=o.children(".csf-cloneable-item").length;if(l.hide(),p&&p<t+1)f.show();else{var n=A(this).parent().parent(),i=n.children(".csf-cloneable-helper").csf_clone(!0),a=n.children(".csf-cloneable-title").csf_clone(),s=n.children(".csf-cloneable-content").csf_clone(),c=new RegExp("("+E.helper.preg_quote(d)+")\\[(\\d+)\\]","g");s.find(".csf-data-wrapper").each(function(){var e=A(this);e.attr("data-unique-id",e.attr("data-unique-id").replace(c,d+"["+(n.index()+1)+"]"))});var r=A('<div class="csf-cloneable-item" />');r.append(i),r.append(a),r.append(s),o.children().eq(n.index()).after(r),E.helper.name_nested_replace(o.children(".csf-cloneable-item"),d),o.accordion("refresh"),o.csf_customizer_refresh(),o.csf_customizer_listen({closest:!0}),h&&u(o)}};o.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",c),n.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",c);var r=function(e){e.preventDefault();var t=o.children(".csf-cloneable-item").length;f.hide(),l.hide(),i&&t-1<i?l.show():(A(this).closest(".csf-cloneable-item").remove(),E.helper.name_nested_replace(o.children(".csf-cloneable-item"),d),o.csf_customizer_refresh(),h&&u(o))};o.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",r),n.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",r)})},A.fn.csf_field_icon=function(){return this.each(function(){var n=A(this);n.on("click",".csf-icon-add",function(e){e.preventDefault();var t=A(this),i=A("#csf-modal-icon");i.removeClass("hidden"),E.vars.$icon_target=n,E.vars.icon_modal_loaded||(i.find(".csf-modal-loading").show(),_.wp.ajax.post("csf-get-icons",{nonce:t.data("nonce")}).done(function(e){i.find(".csf-modal-loading").hide(),E.vars.icon_modal_loaded=!0;var n=i.find(".csf-modal-load").html(e.content);n.on("click","i",function(e){e.preventDefault();var t=A(this).attr("title");E.vars.$icon_target.find("i").removeAttr("class").addClass(t),E.vars.$icon_target.find("input").val(t).trigger("change"),E.vars.$icon_target.find(".csf-icon-preview").removeClass("hidden"),E.vars.$icon_target.find(".csf-icon-remove").removeClass("hidden"),i.addClass("hidden")}),i.on("change keyup",".csf-icon-search",function(){var t=A(this).val();n.find("i").each(function(){var e=A(this);e.attr("title").search(new RegExp(t,"i"))<0?e.hide():e.show()})}),i.on("click",".csf-modal-close, .csf-modal-overlay",function(){i.addClass("hidden")})}).fail(function(e){i.find(".csf-modal-loading").hide(),i.find(".csf-modal-load").html(e.error),i.on("click",function(){i.addClass("hidden")})}))}),n.on("click",".csf-icon-remove",function(e){e.preventDefault(),n.find(".csf-icon-preview").addClass("hidden"),n.find("input").val("").trigger("change"),A(this).addClass("hidden")})})},A.fn.csf_field_map=function(){return this.each(function(){if("undefined"!=typeof L){var e=A(this),t=e.find(".csf--map-osm"),n=e.find(".csf--map-search input"),i=e.find(".csf--latitude"),a=e.find(".csf--longitude"),s=e.find(".csf--zoom"),c=t.data("map"),r=L.map(t.get(0),c);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(r);var o=L.marker(c.center,{draggable:!0}).addTo(r),f=function(e){i.val(e.lat),a.val(e.lng),s.val(r.getZoom())};r.on("click",function(e){o.setLatLng(e.latlng),f(e.latlng)}),r.on("zoom",function(){f(o.getLatLng())}),o.on("drag",function(){f(o.getLatLng())}),n.length||(n=A('[data-depend-id="'+e.find(".csf--address-field").data("address-field")+'"]'));var l={};n.autocomplete({source:function(e,n){var i=e.term;i in l?n(l[i]):A.get("https://nominatim.openstreetmap.org/search",{format:"json",q:i},function(e){var t;t=e.length?e.map(function(e){return{value:e.display_name,label:e.display_name,lat:e.lat,lon:e.lon}},"json"):[{value:"no-data",label:"No Results."}],l[i]=t,n(t)})},select:function(e,t){if("no-data"===t.item.value)return!1;var n=L.latLng(t.item.lat,t.item.lon);r.panTo(n),o.setLatLng(n),f(n)},create:function(e,t){A(this).autocomplete("widget").addClass("csf-map-ui-autocomplate")}});var d=function(){var e=L.latLng(i.val(),a.val());r.panTo(e),o.setLatLng(e)};i.on("change",d),a.on("change",d)}})},A.fn.csf_field_media=function(){return this.each(function(){var i,a=A(this),s=a.find(".csf--button"),c=a.find(".csf--remove"),r=s.data("library")&&s.data("library").split(",")||"",o=!!a.hasClass("csf-assign-field-background")&&a.closest(".csf-field-background").find(".csf--auto-attributes");s.on("click",function(e){e.preventDefault(),void 0!==_.wp&&_.wp.media&&_.wp.media.gallery&&(i||(i=_.wp.media({library:{type:r}})).on("select",function(){var e,t=i.state().get("selection").first().attributes,n=s.data("preview-size")||"thumbnail";r.length&&-1===r.indexOf(t.subtype)&&-1===r.indexOf(t.type)||(a.find(".csf--id").val(t.id),a.find(".csf--width").val(t.width),a.find(".csf--height").val(t.height),a.find(".csf--alt").val(t.alt),a.find(".csf--title").val(t.title),a.find(".csf--description").val(t.description),e=void 0!==t.sizes&&void 0!==t.sizes.thumbnail&&"thumbnail"===n?t.sizes.thumbnail.url:void 0!==t.sizes&&void 0!==t.sizes.full?t.sizes.full.url:t.icon,o&&o.removeClass("csf--attributes-hidden"),c.removeClass("hidden"),a.find(".csf--preview").removeClass("hidden"),a.find(".csf--src").attr("src",e),a.find(".csf--thumbnail").val(e),a.find(".csf--url").val(t.url).trigger("change"))}),i.open())}),c.on("click",function(e){e.preventDefault(),o&&o.addClass("csf--attributes-hidden"),c.addClass("hidden"),a.find("input").val(""),a.find(".csf--preview").addClass("hidden"),a.find(".csf--url").trigger("change")})})},A.fn.csf_field_repeater=function(){return this.each(function(){var e=A(this),t=e.children(".csf-fieldset"),n=t.length?t:e,r=n.children(".csf-repeater-wrapper"),a=n.children(".csf-repeater-hidden"),o=n.children(".csf-repeater-max"),f=n.children(".csf-repeater-min"),l=r.data("field-id"),s=r.data("unique-id"),d=parseInt(r.data("max")),i=parseInt(r.data("min"));r.children(".csf-repeater-item").children(".csf-repeater-content").csf_reload_script(),r.sortable({axis:"y",handle:".csf-repeater-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){E.helper.name_nested_replace(r.children(".csf-repeater-item"),l),r.csf_customizer_refresh(),t.item.csf_reload_script_retry()}}),n.children(".csf-repeater-add").on("click",function(e){e.preventDefault();var t=r.children(".csf-repeater-item").length;if(f.hide(),d&&d<t+1)o.show();else{var n=s+l+"["+t+"]",i=a.csf_clone(!0);i.removeClass("csf-repeater-hidden"),i.find(':input[name!="_pseudo"]').each(function(){this.name=n+this.name.replace(this.name.startsWith("_nonce")?"_nonce":s,"")}),i.find(".csf-data-wrapper").each(function(){A(this).attr("data-unique-id",n)}),r.append(i),i.children(".csf-repeater-content").csf_reload_script(),r.csf_customizer_refresh(),r.csf_customizer_listen({closest:!0})}});var c=function(e){e.preventDefault();var t=r.children(".csf-repeater-item").length;if(f.hide(),d&&d<t+1)o.show();else{var n=A(this).parent().parent().parent(),i=n.children(".csf-repeater-content").csf_clone(),a=n.children(".csf-repeater-helper").csf_clone(!0),s=new RegExp("("+E.helper.preg_quote(l)+")\\[(\\d+)\\]","g");i.find(".csf-data-wrapper").each(function(){var e=A(this);e.attr("data-unique-id",e.attr("data-unique-id").replace(s,l+"["+(n.index()+1)+"]"))});var c=A('<div class="csf-repeater-item" />');c.append(i),c.append(a),r.children().eq(n.index()).after(c),c.children(".csf-repeater-content").csf_reload_script(),E.helper.name_nested_replace(r.children(".csf-repeater-item"),l),r.csf_customizer_refresh(),r.csf_customizer_listen({closest:!0})}};r.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-clone",c),n.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-clone",c);var h=function(e){e.preventDefault();var t=r.children(".csf-repeater-item").length;o.hide(),f.hide(),i&&t-1<i?f.show():(A(this).closest(".csf-repeater-item").remove(),E.helper.name_nested_replace(r.children(".csf-repeater-item"),l),r.csf_customizer_refresh())};r.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-remove",h),n.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-remove",h)})},A.fn.csf_field_slider=function(){return this.each(function(){var e=A(this),n=e.find("input"),t=e.find(".csf-slider-ui"),i=n.data(),a=n.val()||0;t.hasClass("ui-slider")&&t.empty(),t.slider({range:"min",value:a,min:i.min,max:i.max,step:i.step,slide:function(e,t){n.val(t.value).trigger("change")}}),n.on("keyup",function(){t.slider("value",n.val())})})},A.fn.csf_field_sortable=function(){return this.each(function(){var n=A(this).find(".csf-sortable");n.sortable({axis:"y",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){n.csf_customizer_refresh()}}),n.find(".csf-sortable-content").csf_reload_script()})},A.fn.csf_field_sorter=function(){return this.each(function(){var i=A(this),e=i.find(".csf-enabled"),t=i.find(".csf-disabled"),n=!!t.length&&t;e.sortable({connectWith:n,placeholder:"ui-sortable-placeholder",update:function(e,t){var n=t.item.find("input");t.item.parent().hasClass("csf-enabled")?n.attr("name",n.attr("name").replace("disabled","enabled")):n.attr("name",n.attr("name").replace("enabled","disabled")),i.csf_customizer_refresh()}}),n&&n.sortable({connectWith:e,placeholder:"ui-sortable-placeholder",update:function(e,t){i.csf_customizer_refresh()}})})},A.fn.csf_field_spinner=function(){return this.each(function(){var n=A(this),i=n.find("input"),e=n.find(".ui-spinner-button"),a=i.data("unit");e.length&&e.remove(),i.spinner({max:i.data("max")||100,min:i.data("min")||0,step:i.data("step")||1,create:function(e,t){a.length&&n.find(".ui-spinner-up").after('<span class="ui-button-text-only csf--unit">'+a+"</span>")},spin:function(e,t){i.val(t.value).trigger("change")}})})},A.fn.csf_field_switcher=function(){return this.each(function(){var n=A(this).find(".csf--switcher");n.on("click",function(){var e=0,t=n.find("input");n.hasClass("csf--active")?n.removeClass("csf--active"):(e=1,n.addClass("csf--active")),t.val(e).trigger("change")})})},A.fn.csf_field_tabbed=function(){return this.each(function(){var e=A(this),t=e.find(".csf-tabbed-nav a"),a=e.find(".csf-tabbed-content");a.eq(0).csf_reload_script(),t.on("click",function(e){e.preventDefault();var t=A(this),n=t.index(),i=a.eq(n);t.addClass("csf-tabbed-active").siblings().removeClass("csf-tabbed-active"),i.csf_reload_script(),i.removeClass("hidden").siblings().addClass("hidden")})})},A.fn.csf_field_typography=function(){return this.each(function(){var S=this,j=A(this),i=[],L=csf_typography_json.webfonts,t=csf_typography_json.googlestyles,I=csf_typography_json.defaultstyles;S.sanitize_subset=function(e){return e=(e=e.replace("-ext"," Extended")).charAt(0).toUpperCase()+e.slice(1)},S.sanitize_style=function(e){return t[e]?t[e]:e},S.load_google_font=function(e,t,n){e&&"object"==typeof WebFont&&(t=t?t.replace("normal",""):"",n=n?n.replace("normal",""):"",(t||n)&&(e=e+":"+t+n),-1===i.indexOf(e)&&WebFont.load({google:{families:[e]}}),i.push(e))},S.append_select_options=function(e,t,a,s,c){e.find("option").not(":first").remove();var r="";A.each(t,function(e,t){var n,i=t;n=c?a&&-1!==a.indexOf(t)?" selected":"":a&&a===t?" selected":"","subset"===s?i=S.sanitize_subset(t):"style"===s&&(i=S.sanitize_style(t)),r+='<option value="'+t+'"'+n+">"+i+"</option>"}),e.append(r).trigger("csf.change").trigger("chosen:updated")},S.init=function(){var l=[],e=j.find(".csf--typography"),d=j.find(".csf--type"),h=j.find(".csf--block-font-style"),v=e.data("unit"),g=e.data("line-height-unit"),t=e.data("exclude")?e.data("exclude").split(","):[];j.find(".csf--chosen").length&&j.find("select").each(function(){var e=A(this),t=e.parent().find(".chosen-container");t.length&&t.remove(),e.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})});var m=j.find(".csf--font-family"),i=m.val();m.find("option").not(":first-child").remove();var a="";A.each(L,function(n,e){t&&-1!==t.indexOf(n)||(a+='<optgroup label="'+e.label+'">',A.each(e.fonts,function(e,t){a+='<option value="'+(t="object"==typeof t?e:t)+'" data-type="'+n+'"'+(t===i?" selected":"")+">"+t+"</option>"}),a+="</optgroup>")}),m.append(a).trigger("chosen:updated");var p=j.find(".csf--block-font-style");if(p.length){var u=j.find(".csf--font-style-select"),_=u.val()?u.val().replace(/normal/g,""):"";u.on("change csf.change",function(e){var t=u.val();!t&&l&&-1===l.indexOf("normal")&&(t=l[0]);var n=t&&"italic"!==t&&"normal"===t?"normal":"",i=t&&"italic"!==t&&"normal"!==t?t.replace("italic",""):n,a=t&&"italic"===t.substr(-6)?"italic":"";j.find(".csf--font-weight").val(i),j.find(".csf--font-style").val(a)});var b=j.find(".csf--block-extra-styles");if(b.length)var y=j.find(".csf--extra-styles"),w=y.val()}var C=j.find(".csf--block-subset");if(C.length)var x=j.find(".csf--subset"),k=x.val(),z=x.data("multiple")||!1;var D=j.find(".csf--block-backup-font-family");m.on("change csf.change",function(e){C.length&&C.addClass("hidden"),b.length&&b.addClass("hidden"),D.length&&D.addClass("hidden");var t=m.find(":selected"),n=t.val(),i=t.data("type");if(i&&n){if("google"!==i&&"custom"!==i||!D.length||D.removeClass("hidden"),p.length){var a=I;"google"===i&&L[i].fonts[n][0]?a=L[i].fonts[n][0]:"custom"===i&&L[i].fonts[n]&&(a=L[i].fonts[n]);var s=-1!==(l=a).indexOf("normal")?"normal":a[0],c=_&&-1!==a.indexOf(_)?_:s;S.append_select_options(u,a,c,"style"),_=!1,p.removeClass("hidden"),"google"===i&&b.length&&1<a.length&&(S.append_select_options(y,a,w,"style",!0),w=!1,b.removeClass("hidden"))}if("google"===i&&C.length&&L[i].fonts[n][1]){var r=L[i].fonts[n][1],o=r.length<2&&"latin"!==r[0]?r[0]:"",f=k&&-1!==r.indexOf(k)?k:o;f=z&&k?k:f,S.append_select_options(x,r,f,"subset",z),k=!1,C.removeClass("hidden")}}else h.find(":input").val(""),C.length&&(x.find("option").not(":first-child").remove(),x.trigger("chosen:updated")),p.length&&(u.find("option").not(":first-child").remove(),u.trigger("chosen:updated"));d.val(i)}).trigger("csf.change");var q=j.find(".csf--block-preview");if(q.length){var O=j.find(".csf--preview");j.on("change",E.helper.debounce(function(e){q.removeClass("hidden");var t=m.val(),n=j.find(".csf--font-weight").val(),i=j.find(".csf--font-style").val(),a=j.find(".csf--font-size").val(),s=j.find(".csf--font-variant").val(),c=j.find(".csf--line-height").val(),r=j.find(".csf--text-align").val(),o=j.find(".csf--text-transform").val(),f=j.find(".csf--text-decoration").val(),l=j.find(".csf--color").val(),d=j.find(".csf--word-spacing").val(),h=j.find(".csf--letter-spacing").val(),p=j.find(".csf--custom-style").val();"google"===j.find(".csf--type").val()&&S.load_google_font(t,n,i);var u={};t&&(u.fontFamily=t),n&&(u.fontWeight=n),i&&(u.fontStyle=i),s&&(u.fontVariant=s),a&&(u.fontSize=a+v),c&&(u.lineHeight=c+g),h&&(u.letterSpacing=h+v),d&&(u.wordSpacing=d+v),r&&(u.textAlign=r),o&&(u.textTransform=o),f&&(u.textDecoration=f),l&&(u.color=l),O.removeAttr("style"),p&&O.attr("style",p),O.css(u)},100)),q.on("click",function(){O.toggleClass("csf--black-background");var e=q.find(".csf--toggle");e.hasClass("fa-toggle-off")?e.removeClass("fa-toggle-off").addClass("fa-toggle-on"):e.removeClass("fa-toggle-on").addClass("fa-toggle-off")}),q.hasClass("hidden")||j.trigger("change")}},S.init()})},A.fn.csf_field_upload=function(){return this.each(function(){var t,e=A(this),n=e.find("input"),i=e.find(".csf--button"),a=e.find(".csf--remove"),s=i.data("library")&&i.data("library").split(",")||"";n.on("change",function(e){n.val()?a.removeClass("hidden"):a.addClass("hidden")}),i.on("click",function(e){e.preventDefault(),void 0!==_.wp&&_.wp.media&&_.wp.media.gallery&&(t||(t=_.wp.media({library:{type:s}})).on("select",function(){var e=t.state().get("selection").first().attributes;s.length&&-1===s.indexOf(e.subtype)&&-1===s.indexOf(e.type)||n.val(e.url).trigger("change")}),t.open())}),a.on("click",function(e){e.preventDefault(),n.val("").trigger("change")})})},A.fn.csf_field_wp_editor=function(){return this.each(function(){if(void 0!==_.wp.editor&&void 0!==_.tinyMCEPreInit&&void 0!==_.tinyMCEPreInit.mceInit.csf_wp_editor){var e=A(this),t=e.find(".csf-wp-editor"),n=e.find("textarea");(e.find(".wp-editor-wrap").length||e.find(".mce-container").length)&&(t.empty(),t.append(n),n.css("display",""));var i=E.helper.uid("csf-editor-");n.attr("id",i);var a={tinymce:_.tinyMCEPreInit.mceInit.csf_wp_editor,quicktags:_.tinyMCEPreInit.qtInit.csf_wp_editor},s=t.data("editor-settings"),c=wp.oldEditor?wp.oldEditor:wp.editor;c&&c.hasOwnProperty("autop")&&(wp.editor.autop=c.autop,wp.editor.removep=c.removep,wp.editor.initialize=c.initialize),a.tinymce=A.extend({},a.tinymce,{selector:"#"+i,setup:function(e){e.on("change",E.helper.debounce(function(){e.save(),n.trigger("change")},250))}}),!1===s.tinymce&&(a.tinymce=!1,t.addClass("csf-no-tinymce")),!1===s.quicktags&&(a.quicktags=!1,t.addClass("csf-no-quicktags"));var r=setInterval(function(){e.is(":visible")&&(_.wp.editor.initialize(i,a),clearInterval(r))});if(s.media_buttons&&_.csf_media_buttons){var o=t.find(".wp-media-buttons");if(o.length)o.find(".csf-shortcode-button").data("editor-id",i);else{var f=A(_.csf_media_buttons);f.find(".csf-shortcode-button").data("editor-id",i),t.prepend(f)}}}})},A.fn.csf_confirm=function(){return this.each(function(){A(this).on("click",function(e){var t=A(this).data("confirm")||_.csf_vars.i18n.confirm;if(!confirm(t))return e.preventDefault(),!1;E.vars.is_confirm=!0,E.vars.form_modified=!1})})},A.fn.serializeObject=function(){var a={};return A.each(this.serializeArray(),function(e,t){var n=t.name,i=t.value;a[n]=a[n]===y?i:A.isArray(a[n])?a[n].concat(i):[a[n],i]}),a},A.fn.csf_save=function(){return this.each(function(){var i,a=A(this),c=A(".csf-save"),r=A(".csf-options"),o=!1;a.on("click",function(e){if(!o){var t=a.data("save"),n=a.val();c.attr("value",t),a.hasClass("csf-save-ajax")?(e.preventDefault(),r.addClass("csf-saving"),c.prop("disabled",!0),_.wp.ajax.post("csf_"+r.data("unique")+"_ajax_save",{data:A("#csf-form").serializeJSONCSF()}).done(function(e){if(A(".csf-error").remove(),Object.keys(e.errors).length){var s='<i class="csf-label-error csf-error">!</i>';A.each(e.errors,function(e,t){var n=A('[data-depend-id="'+e+'"]'),i=A("#csf-tab-link-"+(n.closest(".csf-section").index()+1)),a=i.closest(".csf-tab-depth-0");n.closest(".csf-fieldset").append('<p class="csf-error csf-error-text">'+t+"</p>"),i.find(".csf-error").length||i.append(s),a.find(".csf-arrow .csf-error").length||a.find(".csf-arrow").append(s)})}r.removeClass("csf-saving"),c.prop("disabled",!1).attr("value",n),o=!1,E.vars.form_modified=!1,E.vars.$form_warning.hide(),clearTimeout(i);var t=A(".csf-form-success");t.empty().append(e.notice).fadeIn("fast",function(){i=setTimeout(function(){t.fadeOut("fast")},1e3)})}).fail(function(e){alert(e.error)})):E.vars.form_modified=!1}o=!0})})},A.fn.csf_options=function(){return this.each(function(){var e=A(this),t=e.find(".csf-content"),n=e.find(".csf-form-success"),i=e.find(".csf-form-warning"),a=e.find(".csf-header .csf-save");(E.vars.$form_warning=i).length&&(_.onbeforeunload=function(){return!!E.vars.form_modified||y},t.on("change keypress",":input",function(){E.vars.form_modified||(n.hide(),i.fadeIn("fast"),E.vars.form_modified=!0)})),n.hasClass("csf-form-show")&&setTimeout(function(){n.fadeOut("fast")},1e3),A(b).keydown(function(e){if((e.ctrlKey||e.metaKey)&&83===e.which)return a.trigger("click"),e.preventDefault(),!1})})},A.fn.csf_taxonomy=function(){return this.each(function(){var e=A(this),t=e.parents("form");if("addtag"===t.attr("id")){var n=t.find("#submit"),i=e.find(".csf-field").csf_clone();n.on("click",function(){t.find(".form-required").hasClass("form-invalid")||(e.data("inited",!1),e.empty(),e.html(i),i=i.csf_clone(),e.csf_reload_script())})}})},A.fn.csf_shortcode=function(){var m=this;return m.shortcode_parse=function(e,n){var i="";return A.each(e,function(e,t){i+="["+(n=n||e),A.each(t,function(e,t){"content"===e?(i+="]",i+=t,i+="[/"+n):i+=m.shortcode_tags(e,t)}),i+="]"}),i},m.shortcode_tags=function(e,t){var n="";return""!==t&&("object"!=typeof t||A.isArray(t)?n+=" "+e.replace("-","_")+'="'+t.toString()+'"':A.each(t,function(e,t){switch(e){case"background-image":t=t.url?t.url:""}""!==t&&(n+=" "+e.replace("-","_")+'="'+t.toString()+'"')})),n},m.insertAtChars=function(e,t){var n=void 0!==e[0].name?e[0]:e;return n.value.length&&void 0!==n.selectionStart?(n.focus(),n.value.substring(0,n.selectionStart)+t+n.value.substring(n.selectionEnd,n.value.length)):(n.focus(),t)},m.send_to_editor=function(e,t){var n;if("undefined"!=typeof tinymce&&(n=tinymce.get(t)),n&&!n.isHidden())n.execCommand("mceInsertContent",!1,e);else{var i=A("#"+t);i.val(m.insertAtChars(i,e)).trigger("change")}},this.each(function(){var c,r,o,n,f,l,d,a,h,p=A(this),i=p.find(".csf-modal-load"),u=(p.find(".csf-modal-content"),p.find(".csf-modal-insert")),s=p.find(".csf-modal-loading"),t=p.find("select"),v=p.data("modal-id"),g=p.data("nonce");A(b).on("click",'.csf-shortcode-button[data-modal-id="'+v+'"]',function(e){e.preventDefault(),h=A(this),c=h.data("editor-id")||!1,r=h.data("target-id")||!1,o=h.data("gutenberg-id")||!1,p.removeClass("hidden"),p.hasClass("csf-shortcode-single")&&f===y&&t.trigger("change")}),t.on("change",function(){var e=A(this),t=e.find(":selected");n=e.val(),f=t.data("shortcode"),l=t.data("view")||"normal",d=t.data("group")||f,i.empty(),n?(s.show(),_.wp.ajax.post("csf-get-shortcode-"+v,{shortcode_key:n,nonce:g}).done(function(e){s.hide();var t=A(e.content).appendTo(i);u.parent().removeClass("hidden"),a=t.find(".csf--repeat-shortcode").csf_clone(),t.csf_reload_script(),t.find(".csf-fields").csf_reload_script()})):u.parent().addClass("hidden")}),u.on("click",function(e){if(e.preventDefault(),!u.prop("disabled")&&!u.attr("disabled")){var i="",t=p.find(".csf-field:not(.csf-depend-on)").find(":input:not(.ignore)").serializeObjectCSF();switch(l){case"contents":var n=f?t[f]:t;A.each(n,function(e,t){var n=f||e;i+="["+n+"]"+t+"[/"+n+"]"});break;case"group":i+="["+f,A.each(t[f],function(e,t){i+=m.shortcode_tags(e,t)}),i+="]",i+=m.shortcode_parse(t[d],d),i+="[/"+f+"]";break;case"repeater":i+=m.shortcode_parse(t[d],d);break;default:i+=m.shortcode_parse(t)}if(i=""===i?"["+f+"]":i,o){var a=_.csf_gutenberg_props.attributes.hasOwnProperty("shortcode")?_.csf_gutenberg_props.attributes.shortcode:"";_.csf_gutenberg_props.setAttributes({shortcode:a+i})}else if(c)m.send_to_editor(i,c);else{var s=r?A(r):h.parent().find("textarea");s.val(m.insertAtChars(s,i)).trigger("change")}p.addClass("hidden")}}),p.on("click",".csf--repeat-button",function(e){e.preventDefault();var t=p.find(".csf--repeatable"),n=a.csf_clone(),i=n.find(".csf-repeat-remove");n.appendTo(t);n.find(".csf-fields").csf_reload_script(),E.helper.name_nested_replace(p.find(".csf--repeat-shortcode"),d),i.on("click",function(){n.remove(),E.helper.name_nested_replace(p.find(".csf--repeat-shortcode"),d)})}),p.on("click",".csf-modal-close, .csf-modal-overlay",function(){p.addClass("hidden")})})},"function"==typeof Color&&(Color.prototype.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;0<=t;t--)e="0"+e;return"#"+e}),E.funcs.parse_color=function(e){var t=e.replace(/\s+/g,""),n=-1!==t.indexOf("rgba")?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100;return{value:t,transparent:n,rgba:n<100}},A.fn.csf_color=function(){return this.each(function(){var c,r=A(this),o=E.funcs.parse_color(r.val()),e=!_.csf_vars.color_palette.length||_.csf_vars.color_palette;r.hasClass("wp-color-picker")&&r.closest(".wp-picker-container").after(r).remove(),r.wpColorPicker({palettes:e,change:function(e,t){var n=t.color.toString();c.removeClass("csf--transparent-active"),c.find(".csf--transparent-offset").css("background-color",n),r.val(n).trigger("change")},create:function(){c=r.closest(".wp-picker-container");var i=r.data("a8cIris"),e=A('<div class="csf--transparent-wrap"><div class="csf--transparent-slider"></div><div class="csf--transparent-offset"></div><div class="csf--transparent-text"></div><div class="csf--transparent-button">transparent <i class="fas fa-toggle-off"></i></div></div>').appendTo(c.find(".wp-picker-holder")),a=e.find(".csf--transparent-slider"),s=e.find(".csf--transparent-text"),n=e.find(".csf--transparent-offset"),t=e.find(".csf--transparent-button");"transparent"===r.val()&&c.addClass("csf--transparent-active"),t.on("click",function(){"transparent"!==r.val()?(r.val("transparent").trigger("change").removeClass("iris-error"),c.addClass("csf--transparent-active")):(r.val(i._color.toString()).trigger("change"),c.removeClass("csf--transparent-active"))}),a.slider({value:o.transparent,step:1,min:0,max:100,slide:function(e,t){var n=parseFloat(t.value/100);i._color._alpha=n,r.wpColorPicker("color",i._color.toString()),s.text(1===n||0===n?"":n)},create:function(){var e=parseFloat(o.transparent/100),t=e<1?e:"";s.text(t),n.css("background-color",o.value),c.on("click",".wp-picker-clear",function(){i._color._alpha=1,s.text(""),a.slider("option","value",100),c.removeClass("csf--transparent-active"),r.trigger("change")}),c.on("click",".wp-picker-default",function(){var e=E.funcs.parse_color(r.data("default-color")),t=parseFloat(e.transparent/100),n=t<1?t:"";i._color._alpha=t,s.text(n),a.slider("option","value",e.transparent)})}})}})})},A.fn.csf_chosen=function(){return this.each(function(){var s=A(this),e=s.parent().find(".chosen-container"),t=s.hasClass("csf-chosen-sortable")||!1,n=s.hasClass("csf-chosen-ajax")||!1,i=s.attr("multiple")||!1,a=i?"100%":"auto",c=A.extend({allow_single_deselect:!0,disable_search_threshold:10,width:a,no_results_text:_.csf_vars.i18n.no_results_text},s.data("chosen-settings"));if(e.length&&e.remove(),n){var r=A.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:_.csf_vars.i18n.typing_text,searching_text:_.csf_vars.i18n.searching_text,no_results_text:_.csf_vars.i18n.no_results_text},s.data("chosen-settings"));s.CSFAjaxChosen(r)}else s.chosen(c);if(i){var o=s.parent().find(".csf-hide-select"),f=o.val()||[];s.on("change",function(e,t){t&&t.selected?o.append('<option value="'+t.selected+'" selected="selected">'+t.selected+"</option>"):t&&t.deselected&&o.find('option[value="'+t.deselected+'"]').remove(),_.wp.customize!==y&&0===o.children().length&&o.data("customize-setting-link")&&_.wp.customize.control(o.data("customize-setting-link")).setting.set(""),o.trigger("change")}),s.CSFChosenOrder(f,!0)}if(t){var l=s.parent().find(".chosen-container").find(".chosen-choices");l.bind("mousedown",function(e){A(e.target).is("span")&&e.stopPropagation()}),l.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,t){t.placeholder.width(t.item.innerWidth()),t.placeholder.height(t.item.innerHeight())},update:function(e,t){var i="",a=s.data("chosen"),n=s.parent().find(".csf-hide-select");l.find(".search-choice-close").each(function(){var n=A(this).data("option-array-index");A.each(a.results_data,function(e,t){t.array_index===n&&(i+='<option value="'+t.value+'" selected>'+t.value+"</option>")})}),n.children().remove(),n.append(i),n.trigger("change")}})}})},A.fn.csf_checkbox=function(){return this.each(function(){var e=A(this),t=e.find(".csf--input"),n=e.find(".csf--checkbox");n.on("click",function(){t.val(Number(n.prop("checked"))).trigger("change")})})},A.fn.csf_siblings=function(){return this.each(function(){var t=A(this),e=t.find(".csf--sibling"),n=t.data("multiple")||!1;e.on("click",function(){var e=A(this);n?e.hasClass("csf--active")?(e.removeClass("csf--active"),e.find("input").prop("checked",!1).trigger("change")):(e.addClass("csf--active"),e.find("input").prop("checked",!0).trigger("change")):(t.find("input").prop("checked",!1),e.find("input").prop("checked",!0).trigger("change"),e.addClass("csf--active").siblings().removeClass("csf--active"))})})},A.fn.csf_help=function(){return this.each(function(){var e,t,n=A(this);n.on({mouseenter:function(){e=A('<div class="csf-tooltip"></div>').html(n.find(".csf-help-text").html()).appendTo("body"),t=E.vars.is_rtl?n.offset().left+24:n.offset().left-e.outerWidth(),e.css({top:n.offset().top-(e.outerHeight()/2-14),left:t})},mouseleave:function(){e!==y&&e.remove()}})})},A.fn.csf_customizer_refresh=function(){return this.each(function(){var e=A(this),t=e.closest(".csf-customize-complex");if(t.length){var n=t.find(":input"),i=t.data("unique-id"),a=t.data("option-id"),s=n.serializeObjectCSF(),c=A.isEmptyObject(s)?"":s[i][a],r=_.wp.customize.control(i+"["+a+"]");r.setting._value=null,r.setting.set(c)}else e.find(":input").first().trigger("change");A(b).trigger("csf-customizer-refresh",e)})},A.fn.csf_customizer_listen=function(e){var t=A.extend({closest:!1},e);return this.each(function(){if(_.wp.customize!==y){var n=t.closest?A(this).closest(".csf-customize-complex"):A(this),e=n.find(":input"),i=n.data("unique-id"),a=n.data("option-id");i!==y&&e.on("change keyup",E.helper.debounce(function(){var e=n.find(":input").serializeObjectCSF(),t=!A.isEmptyObject(e)&&e[i]&&e[i][a]?e[i][a]:"";_.wp.customize.control(i+"["+a+"]").setting.set(t)},250))}})},A(b).on("expanded",".control-section",function(){var e=A(this);if(e.hasClass("open")&&!e.data("inited")){var t=e.find(".csf-customize-field"),n=e.find(".csf-customize-complex");t.length&&(e.csf_dependency(),t.csf_reload_script({dependency:!1}),n.csf_customizer_listen()),e.data("inited",!0)}}),E.vars.$window.on("resize csf.resize",E.helper.debounce(function(e){(-1<navigator.userAgent.indexOf("AppleWebKit/")?E.vars.$window.width():_.innerWidth)<=782&&!E.vars.onloaded&&(A(".csf-section").csf_reload_script(),E.vars.onloaded=!0)},200)).trigger("csf.resize"),A.fn.csf_widgets=function(){this.length&&(A(b).on("widget-added widget-updated",function(e,t){t.find(".csf-fields").csf_reload_script()}),A(".widgets-sortables, .control-section-sidebar").on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()}),A(b).on("click",".widget-top",function(e){A(this).parent().find(".csf-fields").csf_reload_script()}))},A.fn.csf_nav_menu=function(){return this.each(function(){var e=A(this);e.on("click","a.item-edit",function(){A(this).closest("li.menu-item").find(".csf-fields").csf_reload_script()}),e.on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()})})},A.fn.csf_reload_script_retry=function(){return this.each(function(){var e=A(this);e.data("inited")&&e.children(".csf-field-wp_editor").csf_field_wp_editor()})},A.fn.csf_reload_script=function(e){var t=A.extend({dependency:!0},e);return this.each(function(){var e=A(this);e.data("inited")||(e.children(".csf-field-accordion").csf_field_accordion(),e.children(".csf-field-backup").csf_field_backup(),e.children(".csf-field-background").csf_field_background(),e.children(".csf-field-code_editor").csf_field_code_editor(),e.children(".csf-field-date").csf_field_date(),e.children(".csf-field-fieldset").csf_field_fieldset(),e.children(".csf-field-gallery").csf_field_gallery(),e.children(".csf-field-group").csf_field_group(),e.children(".csf-field-icon").csf_field_icon(),e.children(".csf-field-media").csf_field_media(),e.children(".csf-field-map").csf_field_map(),e.children(".csf-field-repeater").csf_field_repeater(),e.children(".csf-field-slider").csf_field_slider(),e.children(".csf-field-sortable").csf_field_sortable(),e.children(".csf-field-sorter").csf_field_sorter(),e.children(".csf-field-spinner").csf_field_spinner(),e.children(".csf-field-switcher").csf_field_switcher(),e.children(".csf-field-tabbed").csf_field_tabbed(),e.children(".csf-field-typography").csf_field_typography(),e.children(".csf-field-upload").csf_field_upload(),e.children(".csf-field-wp_editor").csf_field_wp_editor(),e.children(".csf-field-border").find(".csf-color").csf_color(),e.children(".csf-field-background").find(".csf-color").csf_color(),e.children(".csf-field-color").find(".csf-color").csf_color(),e.children(".csf-field-color_group").find(".csf-color").csf_color(),e.children(".csf-field-link_color").find(".csf-color").csf_color(),e.children(".csf-field-typography").find(".csf-color").csf_color(),e.children(".csf-field-select").find(".csf-chosen").csf_chosen(),e.children(".csf-field-checkbox").find(".csf-checkbox").csf_checkbox(),e.children(".csf-field-button_set").find(".csf-siblings").csf_siblings(),e.children(".csf-field-image_select").find(".csf-siblings").csf_siblings(),e.children(".csf-field-palette").find(".csf-siblings").csf_siblings(),e.children(".csf-field").find(".csf-help").csf_help(),t.dependency&&e.csf_dependency(),e.data("inited",!0),A(b).trigger("csf-reload-script",e))})},A(b).ready(function(){A(".csf-save").csf_save(),A(".csf-options").csf_options(),A(".csf-sticky-header").csf_sticky(),A(".csf-nav-options").csf_nav_options(),A(".csf-nav-metabox").csf_nav_metabox(),A(".csf-taxonomy").csf_taxonomy(),A(".csf-page-templates").csf_page_templates(),A(".csf-post-formats").csf_post_formats(),A(".csf-shortcode").csf_shortcode(),A(".csf-search").csf_search(),A(".csf-confirm").csf_confirm(),A(".csf-expand-all").csf_expand_all(),A(".csf-onload").csf_reload_script(),A(".widget").csf_widgets(),A("#menu-to-edit").csf_nav_menu()})}(jQuery,window,document);
includes/libs/codestar-framework/assets/js/plugins.js ADDED
@@ -0,0 +1,2092 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * jQuery Chosen AJAX Autocomplete Library
4
+ *
5
+ * https://github.com/meltingice/ajax-chosen
6
+ * https://github.com/michaelperrin/ajax-chosen
7
+ *
8
+ * MIT License
9
+ *
10
+ * Customized by Codestar
11
+ *
12
+ */
13
+ (function($) {
14
+
15
+ function CSFAjaxChosen(element, options) {
16
+ this.element = $(element);
17
+ this.options = options;
18
+ this.init();
19
+ };
20
+
21
+ CSFAjaxChosen.prototype.init = function() {
22
+ this.element.chosen(this.options);
23
+ this.container = this.element.next('.chosen-container');
24
+ this.search_field = this.container.find('.chosen-search-input');
25
+ this.is_multiple = this.container.hasClass('chosen-container-multi');
26
+ this.is_typing = false;
27
+ this.chosenXhr = null;
28
+ this.events();
29
+ };
30
+
31
+ CSFAjaxChosen.prototype.events = function() {
32
+
33
+ var _this = this;
34
+
35
+ this.search_field.on('compositionstart', function() {
36
+ _this.is_typing = true;
37
+ });
38
+
39
+ this.search_field.on('compositionend', function() {
40
+ _this.is_typing = false;
41
+ _this.update_list();
42
+ });
43
+
44
+ this.search_field.on('keyup', function() {
45
+ _this.update_list();
46
+ });
47
+
48
+ this.search_field.on('focus', function() {
49
+ _this.search_field_focused();
50
+ });
51
+
52
+ };
53
+
54
+ CSFAjaxChosen.prototype.search_field_focused = function() {
55
+ this.search_welcome_message();
56
+ if ( this.options.min_length === 0 && this.search_field.val().length === 0 ) {
57
+ this.update_list();
58
+ }
59
+ };
60
+
61
+ CSFAjaxChosen.prototype.search_welcome_message = function() {
62
+
63
+ var value = $.trim(this.search_field.val());
64
+ var results = this.container.find('.chosen-results');
65
+
66
+ if ( results.children().length === 0 && value.length === 0 ) {
67
+ results.html('<li class="no-results">' + this.options.typing_text.replace('%s', this.options.min_length - value.length) + '</li>');
68
+ }
69
+
70
+ };
71
+
72
+ CSFAjaxChosen.prototype.update_list = function() {
73
+
74
+ var _this = this;
75
+
76
+ this.search_welcome_message();
77
+
78
+ if ( this.is_typing ) { return; }
79
+
80
+ var value = $.trim(this.search_field.val());
81
+ var message = ( value.length < this.options.min_length ) ? this.options.typing_text.replace('%s', this.options.min_length - value.length) : this.options.searching_text;
82
+
83
+ this.container.find('.no-results').text(message);
84
+
85
+ if ( value === this.search_field.data('prevVal') ) { return; }
86
+
87
+ this.search_field.data('prevVal', value);
88
+
89
+ if (this.timer) {
90
+ clearTimeout(this.timer);
91
+ }
92
+
93
+ if ( value.length < this.options.min_length ) { return; }
94
+
95
+ this.timer = setTimeout( function() {
96
+
97
+ if ( _this.chosenXhr ) {
98
+ _this.chosenXhr.abort();
99
+ }
100
+
101
+ _this.options.data['term'] = value;
102
+
103
+ _this.chosenXhr = window.wp.ajax.post('csf-chosen', _this.options.data).done( function( response ) {
104
+ _this.show_results( response );
105
+ }).fail( function( response ) {
106
+ _this.container.find('.no-results').text(response.error);
107
+ });
108
+
109
+ }, this.options.type_delay );
110
+
111
+ };
112
+
113
+ CSFAjaxChosen.prototype.show_results = function( items ) {
114
+
115
+ var _this = this;
116
+
117
+ if ( this.is_typing || items === null ) { return; }
118
+
119
+ if ( items.length === 0 ) {
120
+ this.element.data().chosen.no_results_clear();
121
+ this.element.data().chosen.no_results(this.search_field.val());
122
+ return;
123
+ }
124
+
125
+ var selected_values = [];
126
+
127
+ this.element.find('option').each(function() {
128
+ if ( $(this).is(':selected') ) {
129
+ selected_values.push( $(this).val() + "-" + $(this).text() );
130
+ } else {
131
+ if( $(this).attr('value').length ) {
132
+ $(this).remove();
133
+ }
134
+ }
135
+ });
136
+
137
+ $.each(items, function(i, item) {
138
+ if ( $.inArray( item.value + "-" + item.text, selected_values ) === -1 ) {
139
+ $('<option />').attr('value', item.value).html(item.text).appendTo(_this.element);
140
+ }
141
+ });
142
+
143
+ var value_before_trigger = this.search_field.val();
144
+ var width_before_trigger = this.search_field.innerWidth();
145
+
146
+ this.element.trigger('chosen:updated');
147
+
148
+ if( this.is_multiple ) {
149
+
150
+ var $hidden_select = this.element.parent().find('.csf-hide-select');
151
+ var $hidden_value = $hidden_select.val() || [];
152
+
153
+ this.element.CSFChosenOrder($hidden_value, true);
154
+ this.search_field.css('width', width_before_trigger);
155
+
156
+ }
157
+
158
+ this.search_field.val(value_before_trigger);
159
+
160
+ if ( this.chosenXhr.done !== null ) {
161
+ this.chosenXhr.done(items);
162
+ }
163
+
164
+ };
165
+
166
+ $.fn.CSFAjaxChosen = function(chosenOptions) {
167
+ return this.each(function() {
168
+ new CSFAjaxChosen(this, chosenOptions);
169
+ });
170
+ };
171
+
172
+ })(jQuery);
173
+ ;// Chosen Order v1.2.1
174
+ // This plugin allows you to handle the order of the selection for Chosen multiple <select> dropdowns
175
+ // Full source at https://github.com/tristanjahier/chosen-order
176
+ // Copyright (c) 2013 - Tristan Jahier, http://tristan-jahier.fr
177
+ (function() {
178
+ var $, CSFAbstractChosenOrder, _ref,
179
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
180
+ __hasProp = {}.hasOwnProperty,
181
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
182
+
183
+ CSFAbstractChosenOrder = (function() {
184
+
185
+ function CSFAbstractChosenOrder() {}
186
+
187
+ CSFAbstractChosenOrder.insertAt = function(node, index, parentNode) {
188
+ return parentNode.insertBefore(node, parentNode.children[index].nextSibling);
189
+ };
190
+
191
+ CSFAbstractChosenOrder.getFlattenedOptionsAndGroups = function(select) {
192
+ var flattened_options, opt, options, sub_opt, sub_options, _i, _j, _len, _len1;
193
+ options = Array.prototype.filter.call(select.childNodes, function(o) {
194
+ var _ref;
195
+ return (_ref = o.nodeName.toUpperCase()) === 'OPTION' || _ref === 'OPTGROUP';
196
+ });
197
+ flattened_options = [];
198
+ for (_i = 0, _len = options.length; _i < _len; _i++) {
199
+ opt = options[_i];
200
+ flattened_options.push(opt);
201
+ if (opt.nodeName.toUpperCase() === 'OPTGROUP') {
202
+ sub_options = Array.prototype.filter.call(opt.childNodes, function(o) {
203
+ return o.nodeName.toUpperCase() === 'OPTION';
204
+ });
205
+ for (_j = 0, _len1 = sub_options.length; _j < _len1; _j++) {
206
+ sub_opt = sub_options[_j];
207
+ flattened_options.push(sub_opt);
208
+ }
209
+ }
210
+ }
211
+ return flattened_options;
212
+ };
213
+
214
+ CSFAbstractChosenOrder.isValidMultipleSelectElement = function(element) {
215
+ return element !== null && typeof element !== "undefined" && element.nodeName === "SELECT" && element.multiple;
216
+ };
217
+
218
+ CSFAbstractChosenOrder.getChosenUIContainer = function(select) {
219
+ if (select.id !== "") {
220
+ return document.getElementById(select.id.replace(/-/g, "_") + "_chosen");
221
+ } else {
222
+ return this.searchChosenUIContainer(select);
223
+ }
224
+ };
225
+
226
+ CSFAbstractChosenOrder.isChosenified = function(select) {
227
+ return this.getChosenUIContainer(select) != null;
228
+ };
229
+
230
+ CSFAbstractChosenOrder.forceSelection = function(select, selection) {
231
+ var i, opt, options, _ref;
232
+ options = this.getFlattenedOptionsAndGroups(select);
233
+ i = 0;
234
+ while (i < options.length) {
235
+ opt = options[i];
236
+ if (_ref = opt.getAttribute("value"), __indexOf.call(selection, _ref) >= 0) {
237
+ opt.selected = true;
238
+ opt.setAttribute("selected", "");
239
+ } else {
240
+ opt.selected = false;
241
+ opt.removeAttribute("selected");
242
+ }
243
+ i++;
244
+ }
245
+ return this.triggerEvent(select, "chosen:updated");
246
+ };
247
+
248
+ CSFAbstractChosenOrder.CSFChosenOrder = function(select, order, force) {
249
+ var chosen_choices, chosen_options, chosen_ui, i, j, opt, opt_val, option, options, rel, relAttributeName, _i, _j, _len, _len1, _results;
250
+ if (this.getDOMElement != null) {
251
+ select = this.getDOMElement(select);
252
+ }
253
+ if (!this.isValidMultipleSelectElement(select)) {
254
+ return;
255
+ }
256
+ chosen_ui = this.getChosenUIContainer(select);
257
+ if (chosen_ui == null) {
258
+ return;
259
+ }
260
+ if (order instanceof Array) {
261
+ order = order.map(Function.prototype.call, String.prototype.trim);
262
+ options = this.getFlattenedOptionsAndGroups(select);
263
+ if ((force != null) && force === true) {
264
+ this.forceSelection(select, order);
265
+ }
266
+ _results = [];
267
+ for (i = _i = 0, _len = order.length; _i < _len; i = ++_i) {
268
+ opt_val = order[i];
269
+ rel = null;
270
+ for (j = _j = 0, _len1 = options.length; _j < _len1; j = ++_j) {
271
+ opt = options[j];
272
+ if (opt.value === opt_val) {
273
+ rel = j;
274
+ }
275
+ }
276
+ chosen_options = chosen_ui.querySelectorAll('.search-choice');
277
+ relAttributeName = this.relAttributeName;
278
+ option = Array.prototype.filter.call(chosen_options, function(o) {
279
+ return o.querySelector("a.search-choice-close[" + relAttributeName + "=\"" + rel + "\"]") != null;
280
+ })[0];
281
+ if (option == null) {
282
+ continue;
283
+ }
284
+ chosen_choices = chosen_ui.querySelector("ul.chosen-choices");
285
+ _results.push(this.insertAt(option, i, chosen_ui.querySelector('ul.chosen-choices')));
286
+ }
287
+ return _results;
288
+ } else {
289
+ return;
290
+ }
291
+ };
292
+
293
+ return CSFAbstractChosenOrder;
294
+
295
+ })();
296
+
297
+ $ = jQuery;
298
+
299
+ $.fn.extend({
300
+ CSFChosenOrder: function(order, force) {
301
+ return _CSFChosenOrder.CSFChosenOrder(this, order, force);
302
+ }
303
+ });
304
+
305
+ this._CSFChosenOrder = (function(_super) {
306
+ __extends(_CSFChosenOrder, _super);
307
+
308
+ function _CSFChosenOrder() {
309
+ _ref = _CSFChosenOrder.__super__.constructor.apply(this, arguments);
310
+ return _ref;
311
+ }
312
+
313
+ _CSFChosenOrder.relAttributeName = 'data-option-array-index';
314
+
315
+ _CSFChosenOrder.isjQueryObject = function(obj) {
316
+ return (typeof jQuery !== "undefined" && jQuery !== null) && obj instanceof jQuery;
317
+ };
318
+
319
+ _CSFChosenOrder.getDOMElement = function(element) {
320
+ if (this.isjQueryObject(element)) {
321
+ return element.get(0);
322
+ } else {
323
+ return element;
324
+ }
325
+ };
326
+
327
+ _CSFChosenOrder.searchChosenUIContainer = function(element) {
328
+ if ($(element).data("chosen") != null) {
329
+ return $(element).data("chosen").container[0];
330
+ } else {
331
+ return $(element).next(".chosen-container.chosen-container-multi").get(0);
332
+ }
333
+ };
334
+
335
+ _CSFChosenOrder.triggerEvent = function(target, event_name) {
336
+ return $(target).trigger(event_name);
337
+ };
338
+
339
+ return _CSFChosenOrder;
340
+
341
+ })(CSFAbstractChosenOrder);
342
+
343
+ }).call(this);
344
+ ;(function() {
345
+ var $, AbstractChosen, Chosen, SelectParser,
346
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
347
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
348
+ hasProp = {}.hasOwnProperty;
349
+
350
+ SelectParser = (function() {
351
+ function SelectParser() {
352
+ this.options_index = 0;
353
+ this.parsed = [];
354
+ }
355
+
356
+ SelectParser.prototype.add_node = function(child) {
357
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
358
+ return this.add_group(child);
359
+ } else {
360
+ return this.add_option(child);
361
+ }
362
+ };
363
+
364
+ SelectParser.prototype.add_group = function(group) {
365
+ var group_position, i, len, option, ref, results1;
366
+ group_position = this.parsed.length;
367
+ this.parsed.push({
368
+ array_index: group_position,
369
+ group: true,
370
+ label: group.label,
371
+ title: group.title ? group.title : void 0,
372
+ children: 0,
373
+ disabled: group.disabled,
374
+ classes: group.className
375
+ });
376
+ ref = group.childNodes;
377
+ results1 = [];
378
+ for (i = 0, len = ref.length; i < len; i++) {
379
+ option = ref[i];
380
+ results1.push(this.add_option(option, group_position, group.disabled));
381
+ }
382
+ return results1;
383
+ };
384
+
385
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
386
+ if (option.nodeName.toUpperCase() === "OPTION") {
387
+ if (option.text !== "") {
388
+ if (group_position != null) {
389
+ this.parsed[group_position].children += 1;
390
+ }
391
+ this.parsed.push({
392
+ array_index: this.parsed.length,
393
+ options_index: this.options_index,
394
+ value: option.value,
395
+ text: option.text,
396
+ html: option.innerHTML,
397
+ title: option.title ? option.title : void 0,
398
+ selected: option.selected,
399
+ disabled: group_disabled === true ? group_disabled : option.disabled,
400
+ group_array_index: group_position,
401
+ group_label: group_position != null ? this.parsed[group_position].label : null,
402
+ classes: option.className,
403
+ style: option.style.cssText
404
+ });
405
+ } else {
406
+ this.parsed.push({
407
+ array_index: this.parsed.length,
408
+ options_index: this.options_index,
409
+ empty: true
410
+ });
411
+ }
412
+ return this.options_index += 1;
413
+ }
414
+ };
415
+
416
+ return SelectParser;
417
+
418
+ })();
419
+
420
+ SelectParser.select_to_array = function(select) {
421
+ var child, i, len, parser, ref;
422
+ parser = new SelectParser();
423
+ ref = select.childNodes;
424
+ for (i = 0, len = ref.length; i < len; i++) {
425
+ child = ref[i];
426
+ parser.add_node(child);
427
+ }
428
+ return parser.parsed;
429
+ };
430
+
431
+ AbstractChosen = (function() {
432
+ function AbstractChosen(form_field, options1) {
433
+ this.form_field = form_field;
434
+ this.options = options1 != null ? options1 : {};
435
+ this.label_click_handler = bind(this.label_click_handler, this);
436
+ if (!AbstractChosen.browser_is_supported()) {
437
+ return;
438
+ }
439
+ this.is_multiple = this.form_field.multiple;
440
+ this.set_default_text();
441
+ this.set_default_values();
442
+ this.setup();
443
+ this.set_up_html();
444
+ this.register_observers();
445
+ this.on_ready();
446
+ }
447
+
448
+ AbstractChosen.prototype.set_default_values = function() {
449
+ this.click_test_action = (function(_this) {
450
+ return function(evt) {
451
+ return _this.test_active_click(evt);
452
+ };
453
+ })(this);
454
+ this.activate_action = (function(_this) {
455
+ return function(evt) {
456
+ return _this.activate_field(evt);
457
+ };
458
+ })(this);
459
+ this.active_field = false;
460
+ this.mouse_on_container = false;
461
+ this.results_showing = false;
462
+ this.result_highlighted = null;
463
+ this.is_rtl = this.options.rtl || /\bchosen-rtl\b/.test(this.form_field.className);
464
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
465
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
466
+ this.disable_search = this.options.disable_search || false;
467
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
468
+ this.group_search = this.options.group_search != null ? this.options.group_search : true;
469
+ this.search_contains = this.options.search_contains || false;
470
+ this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
471
+ this.max_selected_options = this.options.max_selected_options || Infinity;
472
+ this.inherit_select_classes = this.options.inherit_select_classes || false;
473
+ this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
474
+ this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
475
+ this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
476
+ this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
477
+ this.case_sensitive_search = this.options.case_sensitive_search || false;
478
+ return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;
479
+ };
480
+
481
+ AbstractChosen.prototype.set_default_text = function() {
482
+ if (this.form_field.getAttribute("data-placeholder")) {
483
+ this.default_text = this.form_field.getAttribute("data-placeholder");
484
+ } else if (this.is_multiple) {
485
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
486
+ } else {
487
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
488
+ }
489
+ this.default_text = this.escape_html(this.default_text);
490
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
491
+ };
492
+
493
+ AbstractChosen.prototype.choice_label = function(item) {
494
+ if (this.include_group_label_in_selected && (item.group_label != null)) {
495
+ return "<b class='group-name'>" + (this.escape_html(item.group_label)) + "</b>" + item.html;
496
+ } else {
497
+ return item.html;
498
+ }
499
+ };
500
+
501
+ AbstractChosen.prototype.mouse_enter = function() {
502
+ return this.mouse_on_container = true;
503
+ };
504
+
505
+ AbstractChosen.prototype.mouse_leave = function() {
506
+ return this.mouse_on_container = false;
507
+ };
508
+
509
+ AbstractChosen.prototype.input_focus = function(evt) {
510
+ if (this.is_multiple) {
511
+ if (!this.active_field) {
512
+ return setTimeout(((function(_this) {
513
+ return function() {
514
+ return _this.container_mousedown();
515
+ };
516
+ })(this)), 50);
517
+ }
518
+ } else {
519
+ if (!this.active_field) {
520
+ return this.activate_field();
521
+ }
522
+ }
523
+ };
524
+
525
+ AbstractChosen.prototype.input_blur = function(evt) {
526
+ if (!this.mouse_on_container) {
527
+ this.active_field = false;
528
+ return setTimeout(((function(_this) {
529
+ return function() {
530
+ return _this.blur_test();
531
+ };
532
+ })(this)), 100);
533
+ }
534
+ };
535
+
536
+ AbstractChosen.prototype.label_click_handler = function(evt) {
537
+ if (this.is_multiple) {
538
+ return this.container_mousedown(evt);
539
+ } else {
540
+ return this.activate_field();
541
+ }
542
+ };
543
+
544
+ AbstractChosen.prototype.results_option_build = function(options) {
545
+ var content, data, data_content, i, len, ref, shown_results;
546
+ content = '';
547
+ shown_results = 0;
548
+ ref = this.results_data;
549
+ for (i = 0, len = ref.length; i < len; i++) {
550
+ data = ref[i];
551
+ data_content = '';
552
+ if (data.group) {
553
+ data_content = this.result_add_group(data);
554
+ } else {
555
+ data_content = this.result_add_option(data);
556
+ }
557
+ if (data_content !== '') {
558
+ shown_results++;
559
+ content += data_content;
560
+ }
561
+ if (options != null ? options.first : void 0) {
562
+ if (data.selected && this.is_multiple) {
563
+ this.choice_build(data);
564
+ } else if (data.selected && !this.is_multiple) {
565
+ this.single_set_selected_text(this.choice_label(data));
566
+ }
567
+ }
568
+ if (shown_results >= this.max_shown_results) {
569
+ break;
570
+ }
571
+ }
572
+ return content;
573
+ };
574
+
575
+ AbstractChosen.prototype.result_add_option = function(option) {
576
+ var classes, option_el;
577
+ if (!option.search_match) {
578
+ return '';
579
+ }
580
+ if (!this.include_option_in_results(option)) {
581
+ return '';
582
+ }
583
+ classes = [];
584
+ if (!option.disabled && !(option.selected && this.is_multiple)) {
585
+ classes.push("active-result");
586
+ }
587
+ if (option.disabled && !(option.selected && this.is_multiple)) {
588
+ classes.push("disabled-result");
589
+ }
590
+ if (option.selected) {
591
+ classes.push("result-selected");
592
+ }
593
+ if (option.group_array_index != null) {
594
+ classes.push("group-option");
595
+ }
596
+ if (option.classes !== "") {
597
+ classes.push(option.classes);
598
+ }
599
+ option_el = document.createElement("li");
600
+ option_el.className = classes.join(" ");
601
+ if (option.style) {
602
+ option_el.style.cssText = option.style;
603
+ }
604
+ option_el.setAttribute("data-option-array-index", option.array_index);
605
+ option_el.innerHTML = option.highlighted_html || option.html;
606
+ if (option.title) {
607
+ option_el.title = option.title;
608
+ }
609
+ return this.outerHTML(option_el);
610
+ };
611
+
612
+ AbstractChosen.prototype.result_add_group = function(group) {
613
+ var classes, group_el;
614
+ if (!(group.search_match || group.group_match)) {
615
+ return '';
616
+ }
617
+ if (!(group.active_options > 0)) {
618
+ return '';
619
+ }
620
+ classes = [];
621
+ classes.push("group-result");
622
+ if (group.classes) {
623
+ classes.push(group.classes);
624
+ }
625
+ group_el = document.createElement("li");
626
+ group_el.className = classes.join(" ");
627
+ group_el.innerHTML = group.highlighted_html || this.escape_html(group.label);
628
+ if (group.title) {
629
+ group_el.title = group.title;
630
+ }
631
+ return this.outerHTML(group_el);
632
+ };
633
+
634
+ AbstractChosen.prototype.results_update_field = function() {
635
+ this.set_default_text();
636
+ if (!this.is_multiple) {
637
+ this.results_reset_cleanup();
638
+ }
639
+ this.result_clear_highlight();
640
+ this.results_build();
641
+ if (this.results_showing) {
642
+ return this.winnow_results();
643
+ }
644
+ };
645
+
646
+ AbstractChosen.prototype.reset_single_select_options = function() {
647
+ var i, len, ref, result, results1;
648
+ ref = this.results_data;
649
+ results1 = [];
650
+ for (i = 0, len = ref.length; i < len; i++) {
651
+ result = ref[i];
652
+ if (result.selected) {
653
+ results1.push(result.selected = false);
654
+ } else {
655
+ results1.push(void 0);
656
+ }
657
+ }
658
+ return results1;
659
+ };
660
+
661
+ AbstractChosen.prototype.results_toggle = function() {
662
+ if (this.results_showing) {
663
+ return this.results_hide();
664
+ } else {
665
+ return this.results_show();
666
+ }
667
+ };
668
+
669
+ AbstractChosen.prototype.results_search = function(evt) {
670
+ if (this.results_showing) {
671
+ return this.winnow_results();
672
+ } else {
673
+ return this.results_show();
674
+ }
675
+ };
676
+
677
+ AbstractChosen.prototype.winnow_results = function(options) {
678
+ var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;
679
+ this.no_results_clear();
680
+ results = 0;
681
+ query = this.get_search_text();
682
+ escapedQuery = query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
683
+ regex = this.get_search_regex(escapedQuery);
684
+ ref = this.results_data;
685
+ for (i = 0, len = ref.length; i < len; i++) {
686
+ option = ref[i];
687
+ option.search_match = false;
688
+ results_group = null;
689
+ search_match = null;
690
+ option.highlighted_html = '';
691
+ if (this.include_option_in_results(option)) {
692
+ if (option.group) {
693
+ option.group_match = false;
694
+ option.active_options = 0;
695
+ }
696
+ if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
697
+ results_group = this.results_data[option.group_array_index];
698
+ if (results_group.active_options === 0 && results_group.search_match) {
699
+ results += 1;
700
+ }
701
+ results_group.active_options += 1;
702
+ }
703
+ text = option.group ? option.label : option.text;
704
+ if (!(option.group && !this.group_search)) {
705
+ search_match = this.search_string_match(text, regex);
706
+ option.search_match = search_match != null;
707
+ if (option.search_match && !option.group) {
708
+ results += 1;
709
+ }
710
+ if (option.search_match) {
711
+ if (query.length) {
712
+ startpos = search_match.index;
713
+ prefix = text.slice(0, startpos);
714
+ fix = text.slice(startpos, startpos + query.length);
715
+ suffix = text.slice(startpos + query.length);
716
+ option.highlighted_html = (this.escape_html(prefix)) + "<em>" + (this.escape_html(fix)) + "</em>" + (this.escape_html(suffix));
717
+ }
718
+ if (results_group != null) {
719
+ results_group.group_match = true;
720
+ }
721
+ } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
722
+ option.search_match = true;
723
+ }
724
+ }
725
+ }
726
+ }
727
+ this.result_clear_highlight();
728
+ if (results < 1 && query.length) {
729
+ this.update_results_content("");
730
+ return this.no_results(query);
731
+ } else {
732
+ this.update_results_content(this.results_option_build());
733
+ if (!(options != null ? options.skip_highlight : void 0)) {
734
+ return this.winnow_results_set_highlight();
735
+ }
736
+ }
737
+ };
738
+
739
+ AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
740
+ var regex_flag, regex_string;
741
+ regex_string = this.search_contains ? escaped_search_string : "(^|\\s|\\b)" + escaped_search_string + "[^\\s]*";
742
+ if (!(this.enable_split_word_search || this.search_contains)) {
743
+ regex_string = "^" + regex_string;
744
+ }
745
+ regex_flag = this.case_sensitive_search ? "" : "i";
746
+ return new RegExp(regex_string, regex_flag);
747
+ };
748
+
749
+ AbstractChosen.prototype.search_string_match = function(search_string, regex) {
750
+ var match;
751
+ match = regex.exec(search_string);
752
+ if (!this.search_contains && (match != null ? match[1] : void 0)) {
753
+ match.index += 1;
754
+ }
755
+ return match;
756
+ };
757
+
758
+ AbstractChosen.prototype.choices_count = function() {
759
+ var i, len, option, ref;
760
+ if (this.selected_option_count != null) {
761
+ return this.selected_option_count;
762
+ }
763
+ this.selected_option_count = 0;
764
+ ref = this.form_field.options;
765
+ for (i = 0, len = ref.length; i < len; i++) {
766
+ option = ref[i];
767
+ if (option.selected) {
768
+ this.selected_option_count += 1;
769
+ }
770
+ }
771
+ return this.selected_option_count;
772
+ };
773
+
774
+ AbstractChosen.prototype.choices_click = function(evt) {
775
+ evt.preventDefault();
776
+ this.activate_field();
777
+ if (!(this.results_showing || this.is_disabled)) {
778
+ return this.results_show();
779
+ }
780
+ };
781
+
782
+ AbstractChosen.prototype.keydown_checker = function(evt) {
783
+ var ref, stroke;
784
+ stroke = (ref = evt.which) != null ? ref : evt.keyCode;
785
+ this.search_field_scale();
786
+ if (stroke !== 8 && this.pending_backstroke) {
787
+ this.clear_backstroke();
788
+ }
789
+ switch (stroke) {
790
+ case 8:
791
+ this.backstroke_length = this.get_search_field_value().length;
792
+ break;
793
+ case 9:
794
+ if (this.results_showing && !this.is_multiple) {
795
+ this.result_select(evt);
796
+ }
797
+ this.mouse_on_container = false;
798
+ break;
799
+ case 13:
800
+ if (this.results_showing) {
801
+ evt.preventDefault();
802
+ }
803
+ break;
804
+ case 27:
805
+ if (this.results_showing) {
806
+ evt.preventDefault();
807
+ }
808
+ break;
809
+ case 32:
810
+ if (this.disable_search) {
811
+ evt.preventDefault();
812
+ }
813
+ break;
814
+ case 38:
815
+ evt.preventDefault();
816
+ this.keyup_arrow();
817
+ break;
818
+ case 40:
819
+ evt.preventDefault();
820
+ this.keydown_arrow();
821
+ break;
822
+ }
823
+ };
824
+
825
+ AbstractChosen.prototype.keyup_checker = function(evt) {
826
+ var ref, stroke;
827
+ stroke = (ref = evt.which) != null ? ref : evt.keyCode;
828
+ this.search_field_scale();
829
+ switch (stroke) {
830
+ case 8:
831
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
832
+ this.keydown_backstroke();
833
+ } else if (!this.pending_backstroke) {
834
+ this.result_clear_highlight();
835
+ this.results_search();
836
+ }
837
+ break;
838
+ case 13:
839
+ evt.preventDefault();
840
+ if (this.results_showing) {
841
+ this.result_select(evt);
842
+ }
843
+ break;
844
+ case 27:
845
+ if (this.results_showing) {
846
+ this.results_hide();
847
+ }
848
+ break;
849
+ case 9:
850
+ case 16:
851
+ case 17:
852
+ case 18:
853
+ case 38:
854
+ case 40:
855
+ case 91:
856
+ break;
857
+ default:
858
+ this.results_search();
859
+ break;
860
+ }
861
+ };
862
+
863
+ AbstractChosen.prototype.clipboard_event_checker = function(evt) {
864
+ if (this.is_disabled) {
865
+ return;
866
+ }
867
+ return setTimeout(((function(_this) {
868
+ return function() {
869
+ return _this.results_search();
870
+ };
871
+ })(this)), 50);
872
+ };
873
+
874
+ AbstractChosen.prototype.container_width = function() {
875
+ if (this.options.width != null) {
876
+ return this.options.width;
877
+ } else {
878
+ return this.form_field.offsetWidth + "px";
879
+ }
880
+ };
881
+
882
+ AbstractChosen.prototype.include_option_in_results = function(option) {
883
+ if (this.is_multiple && (!this.display_selected_options && option.selected)) {
884
+ return false;
885
+ }
886
+ if (!this.display_disabled_options && option.disabled) {
887
+ return false;
888
+ }
889
+ if (option.empty) {
890
+ return false;
891
+ }
892
+ return true;
893
+ };
894
+
895
+ AbstractChosen.prototype.search_results_touchstart = function(evt) {
896
+ this.touch_started = true;
897
+ return this.search_results_mouseover(evt);
898
+ };
899
+
900
+ AbstractChosen.prototype.search_results_touchmove = function(evt) {
901
+ this.touch_started = false;
902
+ return this.search_results_mouseout(evt);
903
+ };
904
+
905
+ AbstractChosen.prototype.search_results_touchend = function(evt) {
906
+ if (this.touch_started) {
907
+ return this.search_results_mouseup(evt);
908
+ }
909
+ };
910
+
911
+ AbstractChosen.prototype.outerHTML = function(element) {
912
+ var tmp;
913
+ if (element.outerHTML) {
914
+ return element.outerHTML;
915
+ }
916
+ tmp = document.createElement("div");
917
+ tmp.appendChild(element);
918
+ return tmp.innerHTML;
919
+ };
920
+
921
+ AbstractChosen.prototype.get_single_html = function() {
922
+ return "<a class=\"chosen-single chosen-default\">\n <span>" + this.default_text + "</span>\n <div><b></b></div>\n</a>\n<div class=\"chosen-drop\">\n <div class=\"chosen-search\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" />\n </div>\n <ul class=\"chosen-results\"></ul>\n</div>";
923
+ };
924
+
925
+ AbstractChosen.prototype.get_multi_html = function() {
926
+ return "<ul class=\"chosen-choices\">\n <li class=\"search-field\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" value=\"" + this.default_text + "\" />\n </li>\n</ul>\n<div class=\"chosen-drop\">\n <ul class=\"chosen-results\"></ul>\n</div>";
927
+ };
928
+
929
+ AbstractChosen.prototype.get_no_results_html = function(terms) {
930
+ return "<li class=\"no-results\">\n " + this.results_none_found + " <span>" + (this.escape_html(terms)) + "</span>\n</li>";
931
+ };
932
+
933
+ AbstractChosen.browser_is_supported = function() {
934
+ if ("Microsoft Internet Explorer" === window.navigator.appName) {
935
+ return document.documentMode >= 8;
936
+ }
937
+ if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {
938
+ return false;
939
+ }
940
+ return true;
941
+ };
942
+
943
+ AbstractChosen.default_multiple_text = "Select Some Options";
944
+
945
+ AbstractChosen.default_single_text = "Select an Option";
946
+
947
+ AbstractChosen.default_no_result_text = "No results match";
948
+
949
+ return AbstractChosen;
950
+
951
+ })();
952
+
953
+ $ = jQuery;
954
+
955
+ $.fn.extend({
956
+ chosen: function(options) {
957
+ if (!AbstractChosen.browser_is_supported()) {
958
+ return this;
959
+ }
960
+ return this.each(function(input_field) {
961
+ var $this, chosen;
962
+ $this = $(this);
963
+ chosen = $this.data('chosen');
964
+ if (options === 'destroy') {
965
+ if (chosen instanceof Chosen) {
966
+ chosen.destroy();
967
+ }
968
+ return;
969
+ }
970
+ if (!(chosen instanceof Chosen)) {
971
+ $this.data('chosen', new Chosen(this, options));
972
+ }
973
+ });
974
+ }
975
+ });
976
+
977
+ Chosen = (function(superClass) {
978
+ extend(Chosen, superClass);
979
+
980
+ function Chosen() {
981
+ return Chosen.__super__.constructor.apply(this, arguments);
982
+ }
983
+
984
+ Chosen.prototype.setup = function() {
985
+ this.form_field_jq = $(this.form_field);
986
+ return this.current_selectedIndex = this.form_field.selectedIndex;
987
+ };
988
+
989
+ Chosen.prototype.set_up_html = function() {
990
+ var container_classes, container_props;
991
+ container_classes = ["chosen-container"];
992
+ container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
993
+ if (this.inherit_select_classes && this.form_field.className) {
994
+ container_classes.push(this.form_field.className);
995
+ }
996
+ if (this.is_rtl) {
997
+ container_classes.push("chosen-rtl");
998
+ }
999
+ container_props = {
1000
+ 'class': container_classes.join(' '),
1001
+ 'title': this.form_field.title
1002
+ };
1003
+ if (this.form_field.id.length) {
1004
+ container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
1005
+ }
1006
+ this.container = $("<div />", container_props);
1007
+ this.container.width(this.container_width());
1008
+ if (this.is_multiple) {
1009
+ this.container.html(this.get_multi_html());
1010
+ } else {
1011
+ this.container.html(this.get_single_html());
1012
+ }
1013
+ this.form_field_jq.hide().after(this.container);
1014
+ this.dropdown = this.container.find('div.chosen-drop').first();
1015
+ this.search_field = this.container.find('input').first();
1016
+ this.search_results = this.container.find('ul.chosen-results').first();
1017
+ this.search_field_scale();
1018
+ this.search_no_results = this.container.find('li.no-results').first();
1019
+ if (this.is_multiple) {
1020
+ this.search_choices = this.container.find('ul.chosen-choices').first();
1021
+ this.search_container = this.container.find('li.search-field').first();
1022
+ } else {
1023
+ this.search_container = this.container.find('div.chosen-search').first();
1024
+ this.selected_item = this.container.find('.chosen-single').first();
1025
+ }
1026
+ this.results_build();
1027
+ this.set_tab_index();
1028
+ return this.set_label_behavior();
1029
+ };
1030
+
1031
+ Chosen.prototype.on_ready = function() {
1032
+ return this.form_field_jq.trigger("chosen:ready", {
1033
+ chosen: this
1034
+ });
1035
+ };
1036
+
1037
+ Chosen.prototype.register_observers = function() {
1038
+ this.container.on('touchstart.chosen', (function(_this) {
1039
+ return function(evt) {
1040
+ _this.container_mousedown(evt);
1041
+ };
1042
+ })(this));
1043
+ this.container.on('touchend.chosen', (function(_this) {
1044
+ return function(evt) {
1045
+ _this.container_mouseup(evt);
1046
+ };
1047
+ })(this));
1048
+ this.container.on('mousedown.chosen', (function(_this) {
1049
+ return function(evt) {
1050
+ _this.container_mousedown(evt);
1051
+ };
1052
+ })(this));
1053
+ this.container.on('mouseup.chosen', (function(_this) {
1054
+ return function(evt) {
1055
+ _this.container_mouseup(evt);
1056
+ };
1057
+ })(this));
1058
+ this.container.on('mouseenter.chosen', (function(_this) {
1059
+ return function(evt) {
1060
+ _this.mouse_enter(evt);
1061
+ };
1062
+ })(this));
1063
+ this.container.on('mouseleave.chosen', (function(_this) {
1064
+ return function(evt) {
1065
+ _this.mouse_leave(evt);
1066
+ };
1067
+ })(this));
1068
+ this.search_results.on('mouseup.chosen', (function(_this) {
1069
+ return function(evt) {
1070
+ _this.search_results_mouseup(evt);
1071
+ };
1072
+ })(this));
1073
+ this.search_results.on('mouseover.chosen', (function(_this) {
1074
+ return function(evt) {
1075
+ _this.search_results_mouseover(evt);
1076
+ };
1077
+ })(this));
1078
+ this.search_results.on('mouseout.chosen', (function(_this) {
1079
+ return function(evt) {
1080
+ _this.search_results_mouseout(evt);
1081
+ };
1082
+ })(this));
1083
+ this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen', (function(_this) {
1084
+ return function(evt) {
1085
+ _this.search_results_mousewheel(evt);
1086
+ };
1087
+ })(this));
1088
+ this.search_results.on('touchstart.chosen', (function(_this) {
1089
+ return function(evt) {
1090
+ _this.search_results_touchstart(evt);
1091
+ };
1092
+ })(this));
1093
+ this.search_results.on('touchmove.chosen', (function(_this) {
1094
+ return function(evt) {
1095
+ _this.search_results_touchmove(evt);
1096
+ };
1097
+ })(this));
1098
+ this.search_results.on('touchend.chosen', (function(_this) {
1099
+ return function(evt) {
1100
+ _this.search_results_touchend(evt);
1101
+ };
1102
+ })(this));
1103
+ this.form_field_jq.on("chosen:updated.chosen", (function(_this) {
1104
+ return function(evt) {
1105
+ _this.results_update_field(evt);
1106
+ };
1107
+ })(this));
1108
+ this.form_field_jq.on("chosen:activate.chosen", (function(_this) {
1109
+ return function(evt) {
1110
+ _this.activate_field(evt);
1111
+ };
1112
+ })(this));
1113
+ this.form_field_jq.on("chosen:open.chosen", (function(_this) {
1114
+ return function(evt) {
1115
+ _this.container_mousedown(evt);
1116
+ };
1117
+ })(this));
1118
+ this.form_field_jq.on("chosen:close.chosen", (function(_this) {
1119
+ return function(evt) {
1120
+ _this.close_field(evt);
1121
+ };
1122
+ })(this));
1123
+ this.search_field.on('blur.chosen', (function(_this) {
1124
+ return function(evt) {
1125
+ _this.input_blur(evt);
1126
+ };
1127
+ })(this));
1128
+ this.search_field.on('keyup.chosen', (function(_this) {
1129
+ return function(evt) {
1130
+ _this.keyup_checker(evt);
1131
+ };
1132
+ })(this));
1133
+ this.search_field.on('keydown.chosen', (function(_this) {
1134
+ return function(evt) {
1135
+ _this.keydown_checker(evt);
1136
+ };
1137
+ })(this));
1138
+ this.search_field.on('focus.chosen', (function(_this) {
1139
+ return function(evt) {
1140
+ _this.input_focus(evt);
1141
+ };
1142
+ })(this));
1143
+ this.search_field.on('cut.chosen', (function(_this) {
1144
+ return function(evt) {
1145
+ _this.clipboard_event_checker(evt);
1146
+ };
1147
+ })(this));
1148
+ this.search_field.on('paste.chosen', (function(_this) {
1149
+ return function(evt) {
1150
+ _this.clipboard_event_checker(evt);
1151
+ };
1152
+ })(this));
1153
+ if (this.is_multiple) {
1154
+ return this.search_choices.on('click.chosen', (function(_this) {
1155
+ return function(evt) {
1156
+ _this.choices_click(evt);
1157
+ };
1158
+ })(this));
1159
+ } else {
1160
+ return this.container.on('click.chosen', function(evt) {
1161
+ evt.preventDefault();
1162
+ });
1163
+ }
1164
+ };
1165
+
1166
+ Chosen.prototype.destroy = function() {
1167
+ $(this.container[0].ownerDocument).off('click.chosen', this.click_test_action);
1168
+ if (this.form_field_label.length > 0) {
1169
+ this.form_field_label.off('click.chosen');
1170
+ }
1171
+ if (this.search_field[0].tabIndex) {
1172
+ this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
1173
+ }
1174
+ this.container.remove();
1175
+ this.form_field_jq.removeData('chosen');
1176
+ return this.form_field_jq.show();
1177
+ };
1178
+
1179
+ Chosen.prototype.search_field_disabled = function() {
1180
+ this.is_disabled = this.form_field.disabled || this.form_field_jq.parents('fieldset').is(':disabled');
1181
+ this.container.toggleClass('chosen-disabled', this.is_disabled);
1182
+ this.search_field[0].disabled = this.is_disabled;
1183
+ if (!this.is_multiple) {
1184
+ this.selected_item.off('focus.chosen', this.activate_field);
1185
+ }
1186
+ if (this.is_disabled) {
1187
+ return this.close_field();
1188
+ } else if (!this.is_multiple) {
1189
+ return this.selected_item.on('focus.chosen', this.activate_field);
1190
+ }
1191
+ };
1192
+
1193
+ Chosen.prototype.container_mousedown = function(evt) {
1194
+ var ref;
1195
+ if (this.is_disabled) {
1196
+ return;
1197
+ }
1198
+ if (evt && ((ref = evt.type) === 'mousedown' || ref === 'touchstart') && !this.results_showing) {
1199
+ evt.preventDefault();
1200
+ }
1201
+ if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
1202
+ if (!this.active_field) {
1203
+ if (this.is_multiple) {
1204
+ this.search_field.val("");
1205
+ }
1206
+ $(this.container[0].ownerDocument).on('click.chosen', this.click_test_action);
1207
+ this.results_show();
1208
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
1209
+ evt.preventDefault();
1210
+ this.results_toggle();
1211
+ }
1212
+ return this.activate_field();
1213
+ }
1214
+ };
1215
+
1216
+ Chosen.prototype.container_mouseup = function(evt) {
1217
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
1218
+ return this.results_reset(evt);
1219
+ }
1220
+ };
1221
+
1222
+ Chosen.prototype.search_results_mousewheel = function(evt) {
1223
+ var delta;
1224
+ if (evt.originalEvent) {
1225
+ delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
1226
+ }
1227
+ if (delta != null) {
1228
+ evt.preventDefault();
1229
+ if (evt.type === 'DOMMouseScroll') {
1230
+ delta = delta * 40;
1231
+ }
1232
+ return this.search_results.scrollTop(delta + this.search_results.scrollTop());
1233
+ }
1234
+ };
1235
+
1236
+ Chosen.prototype.blur_test = function(evt) {
1237
+ if (!this.active_field && this.container.hasClass("chosen-container-active")) {
1238
+ return this.close_field();
1239
+ }
1240
+ };
1241
+
1242
+ Chosen.prototype.close_field = function() {
1243
+ $(this.container[0].ownerDocument).off("click.chosen", this.click_test_action);
1244
+ this.active_field = false;
1245
+ this.results_hide();
1246
+ this.container.removeClass("chosen-container-active");
1247
+ this.clear_backstroke();
1248
+ this.show_search_field_default();
1249
+ this.search_field_scale();
1250
+ return this.search_field.blur();
1251
+ };
1252
+
1253
+ Chosen.prototype.activate_field = function() {
1254
+ if (this.is_disabled) {
1255
+ return;
1256
+ }
1257
+ this.container.addClass("chosen-container-active");
1258
+ this.active_field = true;
1259
+ this.search_field.val(this.search_field.val());
1260
+ return this.search_field.focus();
1261
+ };
1262
+
1263
+ Chosen.prototype.test_active_click = function(evt) {
1264
+ var active_container;
1265
+ active_container = $(evt.target).closest('.chosen-container');
1266
+ if (active_container.length && this.container[0] === active_container[0]) {
1267
+ return this.active_field = true;
1268
+ } else {
1269
+ return this.close_field();
1270
+ }
1271
+ };
1272
+
1273
+ Chosen.prototype.results_build = function() {
1274
+ this.parsing = true;
1275
+ this.selected_option_count = null;
1276
+ this.results_data = SelectParser.select_to_array(this.form_field);
1277
+ if (this.is_multiple) {
1278
+ this.search_choices.find("li.search-choice").remove();
1279
+ } else {
1280
+ this.single_set_selected_text();
1281
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
1282
+ this.search_field[0].readOnly = true;
1283
+ this.container.addClass("chosen-container-single-nosearch");
1284
+ } else {
1285
+ this.search_field[0].readOnly = false;
1286
+ this.container.removeClass("chosen-container-single-nosearch");
1287
+ }
1288
+ }
1289
+ this.update_results_content(this.results_option_build({
1290
+ first: true
1291
+ }));
1292
+ this.search_field_disabled();
1293
+ this.show_search_field_default();
1294
+ this.search_field_scale();
1295
+ return this.parsing = false;
1296
+ };
1297
+
1298
+ Chosen.prototype.result_do_highlight = function(el) {
1299
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
1300
+ if (el.length) {
1301
+ this.result_clear_highlight();
1302
+ this.result_highlight = el;
1303
+ this.result_highlight.addClass("highlighted");
1304
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
1305
+ visible_top = this.search_results.scrollTop();
1306
+ visible_bottom = maxHeight + visible_top;
1307
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
1308
+ high_bottom = high_top + this.result_highlight.outerHeight();
1309
+ if (high_bottom >= visible_bottom) {
1310
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
1311
+ } else if (high_top < visible_top) {
1312
+ return this.search_results.scrollTop(high_top);
1313
+ }
1314
+ }
1315
+ };
1316
+
1317
+ Chosen.prototype.result_clear_highlight = function() {
1318
+ if (this.result_highlight) {
1319
+ this.result_highlight.removeClass("highlighted");
1320
+ }
1321
+ return this.result_highlight = null;
1322
+ };
1323
+
1324
+ Chosen.prototype.results_show = function() {
1325
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1326
+ this.form_field_jq.trigger("chosen:maxselected", {
1327
+ chosen: this
1328
+ });
1329
+ return false;
1330
+ }
1331
+ this.container.addClass("chosen-with-drop");
1332
+ this.results_showing = true;
1333
+ this.search_field.focus();
1334
+ this.search_field.val(this.get_search_field_value());
1335
+ this.winnow_results();
1336
+ return this.form_field_jq.trigger("chosen:showing_dropdown", {
1337
+ chosen: this
1338
+ });
1339
+ };
1340
+
1341
+ Chosen.prototype.update_results_content = function(content) {
1342
+ return this.search_results.html(content);
1343
+ };
1344
+
1345
+ Chosen.prototype.results_hide = function() {
1346
+ if (this.results_showing) {
1347
+ this.result_clear_highlight();
1348
+ this.container.removeClass("chosen-with-drop");
1349
+ this.form_field_jq.trigger("chosen:hiding_dropdown", {
1350
+ chosen: this
1351
+ });
1352
+ }
1353
+ return this.results_showing = false;
1354
+ };
1355
+
1356
+ Chosen.prototype.set_tab_index = function(el) {
1357
+ var ti;
1358
+ if (this.form_field.tabIndex) {
1359
+ ti = this.form_field.tabIndex;
1360
+ this.form_field.tabIndex = -1;
1361
+ return this.search_field[0].tabIndex = ti;
1362
+ }
1363
+ };
1364
+
1365
+ Chosen.prototype.set_label_behavior = function() {
1366
+ this.form_field_label = this.form_field_jq.parents("label");
1367
+ if (!this.form_field_label.length && this.form_field.id.length) {
1368
+ this.form_field_label = $("label[for='" + this.form_field.id + "']");
1369
+ }
1370
+ if (this.form_field_label.length > 0) {
1371
+ return this.form_field_label.on('click.chosen', this.label_click_handler);
1372
+ }
1373
+ };
1374
+
1375
+ Chosen.prototype.show_search_field_default = function() {
1376
+ if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
1377
+ this.search_field.val(this.default_text);
1378
+ return this.search_field.addClass("default");
1379
+ } else {
1380
+ this.search_field.val("");
1381
+ return this.search_field.removeClass("default");
1382
+ }
1383
+ };
1384
+
1385
+ Chosen.prototype.search_results_mouseup = function(evt) {
1386
+ var target;
1387
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
1388
+ if (target.length) {
1389
+ this.result_highlight = target;
1390
+ this.result_select(evt);
1391
+ return this.search_field.focus();
1392
+ }
1393
+ };
1394
+
1395
+ Chosen.prototype.search_results_mouseover = function(evt) {
1396
+ var target;
1397
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
1398
+ if (target) {
1399
+ return this.result_do_highlight(target);
1400
+ }
1401
+ };
1402
+
1403
+ Chosen.prototype.search_results_mouseout = function(evt) {
1404
+ if ($(evt.target).hasClass("active-result") || $(evt.target).parents('.active-result').first()) {
1405
+ return this.result_clear_highlight();
1406
+ }
1407
+ };
1408
+
1409
+ Chosen.prototype.choice_build = function(item) {
1410
+ var choice, close_link;
1411
+ choice = $('<li />', {
1412
+ "class": "search-choice"
1413
+ }).html("<span>" + (this.choice_label(item)) + "</span>");
1414
+ if (item.disabled) {
1415
+ choice.addClass('search-choice-disabled');
1416
+ } else {
1417
+ close_link = $('<a />', {
1418
+ "class": 'search-choice-close',
1419
+ 'data-option-array-index': item.array_index
1420
+ });
1421
+ close_link.on('click.chosen', (function(_this) {
1422
+ return function(evt) {
1423
+ return _this.choice_destroy_link_click(evt);
1424
+ };
1425
+ })(this));
1426
+ choice.append(close_link);
1427
+ }
1428
+ return this.search_container.before(choice);
1429
+ };
1430
+
1431
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
1432
+ evt.preventDefault();
1433
+ evt.stopPropagation();
1434
+ if (!this.is_disabled) {
1435
+ return this.choice_destroy($(evt.target));
1436
+ }
1437
+ };
1438
+
1439
+ Chosen.prototype.choice_destroy = function(link) {
1440
+ if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
1441
+ if (this.active_field) {
1442
+ this.search_field.focus();
1443
+ } else {
1444
+ this.show_search_field_default();
1445
+ }
1446
+ if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {
1447
+ this.results_hide();
1448
+ }
1449
+ link.parents('li').first().remove();
1450
+ return this.search_field_scale();
1451
+ }
1452
+ };
1453
+
1454
+ Chosen.prototype.results_reset = function() {
1455
+ this.reset_single_select_options();
1456
+ this.form_field.options[0].selected = true;
1457
+ this.single_set_selected_text();
1458
+ this.show_search_field_default();
1459
+ this.results_reset_cleanup();
1460
+ this.trigger_form_field_change();
1461
+ if (this.active_field) {
1462
+ return this.results_hide();
1463
+ }
1464
+ };
1465
+
1466
+ Chosen.prototype.results_reset_cleanup = function() {
1467
+ this.current_selectedIndex = this.form_field.selectedIndex;
1468
+ return this.selected_item.find("abbr").remove();
1469
+ };
1470
+
1471
+ Chosen.prototype.result_select = function(evt) {
1472
+ var high, item;
1473
+ if (this.result_highlight) {
1474
+ high = this.result_highlight;
1475
+ this.result_clear_highlight();
1476
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1477
+ this.form_field_jq.trigger("chosen:maxselected", {
1478
+ chosen: this
1479
+ });
1480
+ return false;
1481
+ }
1482
+ if (this.is_multiple) {
1483
+ high.removeClass("active-result");
1484
+ } else {
1485
+ this.reset_single_select_options();
1486
+ }
1487
+ high.addClass("result-selected");
1488
+ item = this.results_data[high[0].getAttribute("data-option-array-index")];
1489
+ item.selected = true;
1490
+ this.form_field.options[item.options_index].selected = true;
1491
+ this.selected_option_count = null;
1492
+ if (this.is_multiple) {
1493
+ this.choice_build(item);
1494
+ } else {
1495
+ this.single_set_selected_text(this.choice_label(item));
1496
+ }
1497
+ if (this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey))) {
1498
+ if (evt.metaKey || evt.ctrlKey) {
1499
+ this.winnow_results({
1500
+ skip_highlight: true
1501
+ });
1502
+ } else {
1503
+ this.search_field.val("");
1504
+ this.winnow_results();
1505
+ }
1506
+ } else {
1507
+ this.results_hide();
1508
+ this.show_search_field_default();
1509
+ }
1510
+ if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1511
+ this.trigger_form_field_change({
1512
+ selected: this.form_field.options[item.options_index].value
1513
+ });
1514
+ }
1515
+ this.current_selectedIndex = this.form_field.selectedIndex;
1516
+ evt.preventDefault();
1517
+ return this.search_field_scale();
1518
+ }
1519
+ };
1520
+
1521
+ Chosen.prototype.single_set_selected_text = function(text) {
1522
+ if (text == null) {
1523
+ text = this.default_text;
1524
+ }
1525
+ if (text === this.default_text) {
1526
+ this.selected_item.addClass("chosen-default");
1527
+ } else {
1528
+ this.single_deselect_control_build();
1529
+ this.selected_item.removeClass("chosen-default");
1530
+ }
1531
+ return this.selected_item.find("span").html(text);
1532
+ };
1533
+
1534
+ Chosen.prototype.result_deselect = function(pos) {
1535
+ var result_data;
1536
+ result_data = this.results_data[pos];
1537
+ if (!this.form_field.options[result_data.options_index].disabled) {
1538
+ result_data.selected = false;
1539
+ this.form_field.options[result_data.options_index].selected = false;
1540
+ this.selected_option_count = null;
1541
+ this.result_clear_highlight();
1542
+ if (this.results_showing) {
1543
+ this.winnow_results();
1544
+ }
1545
+ this.trigger_form_field_change({
1546
+ deselected: this.form_field.options[result_data.options_index].value
1547
+ });
1548
+ this.search_field_scale();
1549
+ return true;
1550
+ } else {
1551
+ return false;
1552
+ }
1553
+ };
1554
+
1555
+ Chosen.prototype.single_deselect_control_build = function() {
1556
+ if (!this.allow_single_deselect) {
1557
+ return;
1558
+ }
1559
+ if (!this.selected_item.find("abbr").length) {
1560
+ this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1561
+ }
1562
+ return this.selected_item.addClass("chosen-single-with-deselect");
1563
+ };
1564
+
1565
+ Chosen.prototype.get_search_field_value = function() {
1566
+ return this.search_field.val();
1567
+ };
1568
+
1569
+ Chosen.prototype.get_search_text = function() {
1570
+ return $.trim(this.get_search_field_value());
1571
+ };
1572
+
1573
+ Chosen.prototype.escape_html = function(text) {
1574
+ return $('<div/>').text(text).html();
1575
+ };
1576
+
1577
+ Chosen.prototype.winnow_results_set_highlight = function() {
1578
+ var do_high, selected_results;
1579
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1580
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1581
+ if (do_high != null) {
1582
+ return this.result_do_highlight(do_high);
1583
+ }
1584
+ };
1585
+
1586
+ Chosen.prototype.no_results = function(terms) {
1587
+ var no_results_html;
1588
+ no_results_html = this.get_no_results_html(terms);
1589
+ this.search_results.append(no_results_html);
1590
+ return this.form_field_jq.trigger("chosen:no_results", {
1591
+ chosen: this
1592
+ });
1593
+ };
1594
+
1595
+ Chosen.prototype.no_results_clear = function() {
1596
+ return this.search_results.find(".no-results").remove();
1597
+ };
1598
+
1599
+ Chosen.prototype.keydown_arrow = function() {
1600
+ var next_sib;
1601
+ if (this.results_showing && this.result_highlight) {
1602
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
1603
+ if (next_sib) {
1604
+ return this.result_do_highlight(next_sib);
1605
+ }
1606
+ } else {
1607
+ return this.results_show();
1608
+ }
1609
+ };
1610
+
1611
+ Chosen.prototype.keyup_arrow = function() {
1612
+ var prev_sibs;
1613
+ if (!this.results_showing && !this.is_multiple) {
1614
+ return this.results_show();
1615
+ } else if (this.result_highlight) {
1616
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
1617
+ if (prev_sibs.length) {
1618
+ return this.result_do_highlight(prev_sibs.first());
1619
+ } else {
1620
+ if (this.choices_count() > 0) {
1621
+ this.results_hide();
1622
+ }
1623
+ return this.result_clear_highlight();
1624
+ }
1625
+ }
1626
+ };
1627
+
1628
+ Chosen.prototype.keydown_backstroke = function() {
1629
+ var next_available_destroy;
1630
+ if (this.pending_backstroke) {
1631
+ this.choice_destroy(this.pending_backstroke.find("a").first());
1632
+ return this.clear_backstroke();
1633
+ } else {
1634
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
1635
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1636
+ this.pending_backstroke = next_available_destroy;
1637
+ if (this.single_backstroke_delete) {
1638
+ return this.keydown_backstroke();
1639
+ } else {
1640
+ return this.pending_backstroke.addClass("search-choice-focus");
1641
+ }
1642
+ }
1643
+ }
1644
+ };
1645
+
1646
+ Chosen.prototype.clear_backstroke = function() {
1647
+ if (this.pending_backstroke) {
1648
+ this.pending_backstroke.removeClass("search-choice-focus");
1649
+ }
1650
+ return this.pending_backstroke = null;
1651
+ };
1652
+
1653
+ Chosen.prototype.search_field_scale = function() {
1654
+ var div, i, len, style, style_block, styles, width;
1655
+ if (!this.is_multiple) {
1656
+ return;
1657
+ }
1658
+ style_block = {
1659
+ position: 'absolute',
1660
+ left: '-1000px',
1661
+ top: '-1000px',
1662
+ display: 'none',
1663
+ whiteSpace: 'pre'
1664
+ };
1665
+ styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];
1666
+ for (i = 0, len = styles.length; i < len; i++) {
1667
+ style = styles[i];
1668
+ style_block[style] = this.search_field.css(style);
1669
+ }
1670
+ div = $('<div />').css(style_block);
1671
+ div.text(this.get_search_field_value());
1672
+ $('body').append(div);
1673
+ width = div.width() + 25;
1674
+ div.remove();
1675
+ if (this.container.is(':visible')) {
1676
+ width = Math.min(this.container.outerWidth() - 10, width);
1677
+ }
1678
+ return this.search_field.width(width);
1679
+ };
1680
+
1681
+ Chosen.prototype.trigger_form_field_change = function(extra) {
1682
+ this.form_field_jq.trigger("input", extra);
1683
+ return this.form_field_jq.trigger("change", extra);
1684
+ };
1685
+
1686
+ return Chosen;
1687
+
1688
+ })(AbstractChosen);
1689
+
1690
+ }).call(this);
1691
+ ;/**
1692
+ *
1693
+ * jQuery Interdependencies library
1694
+ * http://miohtama.github.com/jquery-interdependencies/
1695
+ * Copyright 2012-2013 Mikko Ohtamaa, others
1696
+ *
1697
+ * Customized by Codestar
1698
+ *
1699
+ */
1700
+ (function($) {
1701
+
1702
+ 'use strict';
1703
+
1704
+ function Rule(controller, condition, value) {
1705
+ this.init(controller, condition, value);
1706
+ }
1707
+
1708
+ $.extend(Rule.prototype, {
1709
+
1710
+ init: function(controller, condition, value) {
1711
+
1712
+ this.controller = controller;
1713
+ this.condition = condition;
1714
+ this.value = value;
1715
+ this.rules = [];
1716
+ this.controls = [];
1717
+
1718
+ },
1719
+
1720
+ evalCondition: function(context, control, condition, val1, val2) {
1721
+
1722
+ if( condition == '==' ) {
1723
+
1724
+ return this.checkBoolean(val1) == this.checkBoolean(val2);
1725
+
1726
+ } else if( condition == '!=' ) {
1727
+
1728
+ return this.checkBoolean(val1) != this.checkBoolean(val2);
1729
+
1730
+ } else if( condition == '>=' ) {
1731
+
1732
+ return Number(val2) >= Number(val1);
1733
+
1734
+ } else if( condition == '<=' ) {
1735
+
1736
+ return Number(val2) <= Number(val1);
1737
+
1738
+ } else if( condition == '>' ) {
1739
+
1740
+ return Number(val2) > Number(val1);
1741
+
1742
+ } else if( condition == '<' ) {
1743
+
1744
+ return Number(val2) < Number(val1);
1745
+
1746
+ } else if( condition == '()' ) {
1747
+
1748
+ return window[val1](context, control, val2);
1749
+
1750
+ } else if( condition == 'any' ) {
1751
+
1752
+ if( $.isArray( val2 ) ) {
1753
+ for (var i = val2.length - 1; i >= 0; i--) {
1754
+ if( $.inArray( val2[i], val1.split(',') ) !== -1 ) {
1755
+ return true;
1756
+ }
1757
+ }
1758
+ } else {
1759
+ if( $.inArray( val2, val1.split(',') ) !== -1 ) {
1760
+ return true;
1761
+ }
1762
+ }
1763
+
1764
+ } else if( condition == 'not-any' ) {
1765
+
1766
+ if( $.isArray( val2 ) ) {
1767
+ for (var i = val2.length - 1; i >= 0; i--) {
1768
+ if( $.inArray( val2[i], val1.split(',') ) == -1 ) {
1769
+ return true;
1770
+ }
1771
+ }
1772
+ } else {
1773
+ if( $.inArray( val2, val1.split(',') ) == -1 ) {
1774
+ return true;
1775
+ }
1776
+ }
1777
+
1778
+ }
1779
+
1780
+ return false;
1781
+
1782
+ },
1783
+
1784
+ checkBoolean: function(value) {
1785
+
1786
+ switch( value ) {
1787
+
1788
+ case true:
1789
+ case 'true':
1790
+ case 1:
1791
+ case '1':
1792
+ value = true;
1793
+ break;
1794
+
1795
+ case null:
1796
+ case false:
1797
+ case 'false':
1798
+ case 0:
1799
+ case '0':
1800
+ value = false;
1801
+ break;
1802
+
1803
+ }
1804
+
1805
+ return value;
1806
+ },
1807
+
1808
+ checkCondition: function( context ) {
1809
+
1810
+ if( !this.condition ) {
1811
+ return true;
1812
+ }
1813
+
1814
+ var control = context.find(this.controller);
1815
+
1816
+ var control_value = this.getControlValue(context, control);
1817
+
1818
+ if( control_value === undefined ) {
1819
+ return false;
1820
+ }
1821
+
1822
+ control_value = this.normalizeValue(control, this.value, control_value);
1823
+
1824
+ return this.evalCondition(context, control, this.condition, this.value, control_value);
1825
+ },
1826
+
1827
+ normalizeValue: function( control, baseValue, control_value ) {
1828
+
1829
+ if( typeof baseValue == 'number' ) {
1830
+ return parseFloat( control_value );
1831
+ }
1832
+
1833
+ return control_value;
1834
+ },
1835
+
1836
+ getControlValue: function(context, control) {
1837
+
1838
+ if( control.length > 1 && ( control.attr('type') == 'radio' || control.attr('type') == 'checkbox' ) ) {
1839
+
1840
+ return control.filter(':checked').map(function() { return this.value; }).get();
1841
+
1842
+ } else if ( control.attr('type') == 'checkbox' || control.attr('type') == 'radio' ) {
1843
+
1844
+ return control.is(':checked');
1845
+
1846
+ }
1847
+
1848
+ return control.val();
1849
+
1850
+ },
1851
+
1852
+ createRule: function(controller, condition, value) {
1853
+ var rule = new Rule(controller, condition, value);
1854
+ this.rules.push(rule);
1855
+ return rule;
1856
+ },
1857
+
1858
+ include: function(input) {
1859
+ this.controls.push(input);
1860
+ },
1861
+
1862
+ applyRule: function(context, enforced) {
1863
+
1864
+ var result;
1865
+
1866
+ if( typeof( enforced ) == 'undefined' ) {
1867
+ result = this.checkCondition(context);
1868
+ } else {
1869
+ result = enforced;
1870
+ }
1871
+
1872
+ var controls = $.map(this.controls, function(elem, idx) {
1873
+ return context.find(elem);
1874
+ });
1875
+
1876
+ if( result ) {
1877
+
1878
+ $(controls).each(function() {
1879
+ $(this).removeClass('csf-depend-on');
1880
+ });
1881
+
1882
+ $(this.rules).each(function() {
1883
+ this.applyRule(context);
1884
+ });
1885
+
1886
+ } else {
1887
+
1888
+ $(controls).each(function() {
1889
+ $(this).addClass('csf-depend-on');
1890
+ });
1891
+
1892
+ $(this.rules).each(function() {
1893
+ this.applyRule(context, false);
1894
+ });
1895
+
1896
+ }
1897
+ }
1898
+ });
1899
+
1900
+ function Ruleset() {
1901
+ this.rules = [];
1902
+ };
1903
+
1904
+ $.extend(Ruleset.prototype, {
1905
+
1906
+ createRule: function(controller, condition, value) {
1907
+ var rule = new Rule(controller, condition, value);
1908
+ this.rules.push(rule);
1909
+ return rule;
1910
+ },
1911
+
1912
+ applyRules: function(context) {
1913
+ $(this.rules).each(function() {
1914
+ this.applyRule(context);
1915
+ });
1916
+ }
1917
+ });
1918
+
1919
+ $.csf_deps = {
1920
+
1921
+ createRuleset: function() {
1922
+ return new Ruleset();
1923
+ },
1924
+
1925
+ enable: function(selection, ruleset, depends) {
1926
+
1927
+ selection.on('change keyup', function(elem) {
1928
+
1929
+ var depend_id = elem.target.getAttribute('data-depend-id') || elem.target.getAttribute('data-sub-depend-id');
1930
+
1931
+ if( depends.indexOf( depend_id ) !== -1 ) {
1932
+ ruleset.applyRules(selection);
1933
+ }
1934
+
1935
+ });
1936
+
1937
+ ruleset.applyRules(selection);
1938
+
1939
+ return true;
1940
+ }
1941
+ };
1942
+
1943
+ })(jQuery);
1944
+ ;/**
1945
+ *
1946
+ * jQuery serializeObject
1947
+ *
1948
+ * @copyright 2014, macek <paulmacek@gmail.com>
1949
+ * @link https://github.com/macek/jquery-serialize-object
1950
+ * @license BSD
1951
+ * @version 2.5.0
1952
+ *
1953
+ * Customized by Codestar
1954
+ *
1955
+ */
1956
+ (function(root, factory) {
1957
+
1958
+ // AMD
1959
+ if (typeof define === "function" && define.amd) {
1960
+ define(["exports", "jquery"], function(exports, $) {
1961
+ return factory(exports, $);
1962
+ });
1963
+ }
1964
+
1965
+ // CommonJS
1966
+ else if (typeof exports !== "undefined") {
1967
+ var $ = require("jquery");
1968
+ factory(exports, $);
1969
+ }
1970
+
1971
+ // Browser
1972
+ else {
1973
+ factory(root, (root.jQuery || root.Zepto || root.ender || root.$));
1974
+ }
1975
+
1976
+ }(this, function(exports, $) {
1977
+
1978
+ //
1979
+ // Codestar: Added custom patterns for spesific validate
1980
+ //
1981
+ var patterns = {
1982
+ validate: /^(?!(_nonce|_pseudo))[a-zA-Z0-9_-]*(?:\[(?:\d*|(?!(_nonce|_pseudo))[a-zA-Z0-9_-]+)\])*$/i,
1983
+ key: /[a-zA-Z0-9_-]+|(?=\[\])/g,
1984
+ named: /^[a-zA-Z0-9_-]+$/,
1985
+ push: /^$/,
1986
+ fixed: /^\d+$/
1987
+ };
1988
+
1989
+ function FormSerializer(helper, $form) {
1990
+
1991
+ // private variables
1992
+ var data = {},
1993
+ pushes = {};
1994
+
1995
+ // private API
1996
+ function build(base, key, value) {
1997
+ base[key] = value;
1998
+ return base;
1999
+ }
2000
+
2001
+ function makeObject(root, value) {
2002
+
2003
+ var keys = root.match(patterns.key), k;
2004
+
2005
+ // nest, nest, ..., nest
2006
+ while ((k = keys.pop()) !== undefined) {
2007
+ // foo[]
2008
+ if (patterns.push.test(k)) {
2009
+ var idx = incrementPush(root.replace(/\[\]$/, ''));
2010
+ value = build([], idx, value);
2011
+ }
2012
+
2013
+ // foo[n]
2014
+ else if (patterns.fixed.test(k)) {
2015
+ value = build([], k, value);
2016
+ }
2017
+
2018
+ // foo; foo[bar]
2019
+ else if (patterns.named.test(k)) {
2020
+ value = build({}, k, value);
2021
+ }
2022
+ }
2023
+
2024
+ return value;
2025
+ }
2026
+
2027
+ function incrementPush(key) {
2028
+ if (pushes[key] === undefined) {
2029
+ pushes[key] = 0;
2030
+ }
2031
+ return pushes[key]++;
2032
+ }
2033
+
2034
+ function addPair(pair) {
2035
+ if (!patterns.validate.test(pair.name)) return this;
2036
+ var obj = makeObject(pair.name, pair.value);
2037
+ data = helper.extend(true, data, obj);
2038
+ return this;
2039
+ }
2040
+
2041
+ function addPairs(pairs) {
2042
+ if (!helper.isArray(pairs)) {
2043
+ throw new Error("formSerializer.addPairs expects an Array");
2044
+ }
2045
+ for (var i=0, len=pairs.length; i<len; i++) {
2046
+ this.addPair(pairs[i]);
2047
+ }
2048
+ return this;
2049
+ }
2050
+
2051
+ function serialize() {
2052
+ return data;
2053
+ }
2054
+
2055
+ function serializeJSON() {
2056
+ return JSON.stringify(serialize());
2057
+ }
2058
+
2059
+ // public API
2060
+ this.addPair = addPair;
2061
+ this.addPairs = addPairs;
2062
+ this.serialize = serialize;
2063
+ this.serializeJSON = serializeJSON;
2064
+ }
2065
+
2066
+ FormSerializer.patterns = patterns;
2067
+
2068
+ FormSerializer.serializeObject = function serializeObject() {
2069
+ return new FormSerializer($, this).
2070
+ addPairs(this.serializeArray()).
2071
+ serialize();
2072
+ };
2073
+
2074
+ FormSerializer.serializeJSON = function serializeJSON() {
2075
+ return new FormSerializer($, this).
2076
+ addPairs(this.serializeArray()).
2077
+ serializeJSON();
2078
+ };
2079
+
2080
+ //
2081
+ // Codestar: Renamed function names for avoid conflicts
2082
+ //
2083
+
2084
+ if (typeof $.fn !== "undefined") {
2085
+ $.fn.serializeObjectCSF = FormSerializer.serializeObject;
2086
+ $.fn.serializeJSONCSF = FormSerializer.serializeJSON;
2087
+ }
2088
+
2089
+ exports.FormSerializer = FormSerializer;
2090
+
2091
+ return FormSerializer;
2092
+ }));
includes/libs/codestar-framework/assets/js/plugins.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.7*/
2
+
3
+ !function(o){function e(t,e){this.element=o(t),this.options=e,this.init()}e.prototype.init=function(){this.element.chosen(this.options),this.container=this.element.next(".chosen-container"),this.search_field=this.container.find(".chosen-search-input"),this.is_multiple=this.container.hasClass("chosen-container-multi"),this.is_typing=!1,this.chosenXhr=null,this.events()},e.prototype.events=function(){var t=this;this.search_field.on("compositionstart",function(){t.is_typing=!0}),this.search_field.on("compositionend",function(){t.is_typing=!1,t.update_list()}),this.search_field.on("keyup",function(){t.update_list()}),this.search_field.on("focus",function(){t.search_field_focused()})},e.prototype.search_field_focused=function(){this.search_welcome_message(),0===this.options.min_length&&0===this.search_field.val().length&&this.update_list()},e.prototype.search_welcome_message=function(){var t=o.trim(this.search_field.val()),e=this.container.find(".chosen-results");0===e.children().length&&0===t.length&&e.html('<li class="no-results">'+this.options.typing_text.replace("%s",this.options.min_length-t.length)+"</li>")},e.prototype.update_list=function(){var e=this;if(this.search_welcome_message(),!this.is_typing){var t=o.trim(this.search_field.val()),s=t.length<this.options.min_length?this.options.typing_text.replace("%s",this.options.min_length-t.length):this.options.searching_text;this.container.find(".no-results").text(s),t!==this.search_field.data("prevVal")&&(this.search_field.data("prevVal",t),this.timer&&clearTimeout(this.timer),t.length<this.options.min_length||(this.timer=setTimeout(function(){e.chosenXhr&&e.chosenXhr.abort(),e.options.data.term=t,e.chosenXhr=window.wp.ajax.post("csf-chosen",e.options.data).done(function(t){e.show_results(t)}).fail(function(t){e.container.find(".no-results").text(t.error)})},this.options.type_delay)))}},e.prototype.show_results=function(t){var s=this;if(!this.is_typing&&null!==t){if(0===t.length)return this.element.data().chosen.no_results_clear(),void this.element.data().chosen.no_results(this.search_field.val());var i=[];this.element.find("option").each(function(){o(this).is(":selected")?i.push(o(this).val()+"-"+o(this).text()):o(this).attr("value").length&&o(this).remove()}),o.each(t,function(t,e){-1===o.inArray(e.value+"-"+e.text,i)&&o("<option />").attr("value",e.value).html(e.text).appendTo(s.element)});var e=this.search_field.val(),n=this.search_field.innerWidth();if(this.element.trigger("chosen:updated"),this.is_multiple){var r=this.element.parent().find(".csf-hide-select").val()||[];this.element.CSFChosenOrder(r,!0),this.search_field.css("width",n)}this.search_field.val(e),null!==this.chosenXhr.done&&this.chosenXhr.done(t)}},o.fn.CSFAjaxChosen=function(t){return this.each(function(){new e(this,t)})}}(jQuery),function(){var s,i,o=[].indexOf||function(t){for(var e=0,s=this.length;e<s;e++)if(e in this&&this[e]===t)return e;return-1},n={}.hasOwnProperty;i=function(){function t(){}return t.insertAt=function(t,e,s){return s.insertBefore(t,s.children[e].nextSibling)},t.getFlattenedOptionsAndGroups=function(t){var e,s,i,n,r,o,h,l,c;for(e=[],o=0,l=(i=Array.prototype.filter.call(t.childNodes,function(t){var e;return"OPTION"===(e=t.nodeName.toUpperCase())||"OPTGROUP"===e})).length;o<l;o++)if(s=i[o],e.push(s),"OPTGROUP"===s.nodeName.toUpperCase())for(h=0,c=(r=Array.prototype.filter.call(s.childNodes,function(t){return"OPTION"===t.nodeName.toUpperCase()})).length;h<c;h++)n=r[h],e.push(n);return e},t.isValidMultipleSelectElement=function(t){return null!=t&&"SELECT"===t.nodeName&&t.multiple},t.getChosenUIContainer=function(t){return""!==t.id?document.getElementById(t.id.replace(/-/g,"_")+"_chosen"):this.searchChosenUIContainer(t)},t.isChosenified=function(t){return null!=this.getChosenUIContainer(t)},t.forceSelection=function(t,e){var s,i,n,r;for(n=this.getFlattenedOptionsAndGroups(t),s=0;s<n.length;)r=(i=n[s]).getAttribute("value"),0<=o.call(e,r)?(i.selected=!0,i.setAttribute("selected","")):(i.selected=!1,i.removeAttribute("selected")),s++;return this.triggerEvent(t,"chosen:updated")},t.CSFChosenOrder=function(t,e,s){var i,n,r,o,h,l,c,a,u,_,d,p,f,g;if(null!=this.getDOMElement&&(t=this.getDOMElement(t)),this.isValidMultipleSelectElement(t)&&null!=(n=this.getChosenUIContainer(t))&&e instanceof Array){for(e=e.map(Function.prototype.call,String.prototype.trim),c=this.getFlattenedOptionsAndGroups(t),null!=s&&!0===s&&this.forceSelection(t,e),g=[],r=_=0,p=e.length;_<p;r=++_){for(h=e[r],a=null,o=d=0,f=c.length;d<f;o=++d)c[o].value===h&&(a=o);i=n.querySelectorAll(".search-choice"),u=this.relAttributeName,null!=(l=Array.prototype.filter.call(i,function(t){return null!=t.querySelector("a.search-choice-close["+u+'="'+a+'"]')})[0])&&(n.querySelector("ul.chosen-choices"),g.push(this.insertAt(l,r,n.querySelector("ul.chosen-choices"))))}return g}},t}(),(s=jQuery).fn.extend({CSFChosenOrder:function(t,e){return _CSFChosenOrder.CSFChosenOrder(this,t,e)}}),this._CSFChosenOrder=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var s in e)n.call(e,s)&&(t[s]=e[s]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(e,i),e.relAttributeName="data-option-array-index",e.isjQueryObject=function(t){return"undefined"!=typeof jQuery&&null!==jQuery&&t instanceof jQuery},e.getDOMElement=function(t){return this.isjQueryObject(t)?t.get(0):t},e.searchChosenUIContainer=function(t){return null!=s(t).data("chosen")?s(t).data("chosen").container[0]:s(t).next(".chosen-container.chosen-container-multi").get(0)},e.triggerEvent=function(t,e){return s(t).trigger(e)},e}()}.call(this),function(){var h,s,n,o,r={}.hasOwnProperty;(o=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s<i;s++)n=r[s],o.push(this.add_option(n,e,t.disabled));return o},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,title:t.title?t.title:void 0,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,group_label:null!=e?this.parsed[e].label:null,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(t){var e,s,i,n,r;for(n=new o,s=0,i=(r=t.childNodes).length;s<i;s++)e=r[s],n.add_node(e);return n.parsed},s=function(){function n(t,e){var s,i;this.form_field=t,this.options=null!=e?e:{},this.label_click_handler=(s=this.label_click_handler,i=this,function(){return s.apply(i,arguments)}),n.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return n.prototype.set_default_values=function(){var e,s;return this.click_test_action=(e=this,function(t){return e.test_active_click(t)}),this.activate_action=(s=this,function(t){return s.activate_field(t)}),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},n.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||n.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||n.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||n.default_no_result_text},n.prototype.choice_label=function(t){return this.include_group_label_in_selected&&null!=t.group_label?"<b class='group-name'>"+this.escape_html(t.group_label)+"</b>"+t.html:t.html},n.prototype.mouse_enter=function(){return this.mouse_on_container=!0},n.prototype.mouse_leave=function(){return this.mouse_on_container=!1},n.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout((e=this,function(){return e.container_mousedown()}),50)}else if(!this.active_field)return this.activate_field();var e},n.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout((e=this,function(){return e.blur_test()}),100);var e},n.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},n.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",n=h=0,r=(o=this.results_data).length;n<r&&((i="")!==(i=(s=o[n]).group?this.result_add_group(s):this.result_add_option(s))&&(h++,e+=i),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(h>=this.max_shown_results));n++);return e},n.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),(s=document.createElement("li")).className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},n.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&0<t.active_options?((e=[]).push("group-result"),t.classes&&e.push(t.classes),(s=document.createElement("li")).className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},n.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},n.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t<e;t++)(i=s[t]).selected?n.push(i.selected=!1):n.push(void 0);return n},n.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},n.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},n.prototype.winnow_results=function(t){var e,s,i,n,r,o,h,l,c,a,u,_,d,p,f;for(this.no_results_clear(),a=0,e=(h=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(e),i=0,n=(l=this.results_data).length;i<n;i++)(r=l[i]).search_match=!1,_=u=null,r.highlighted_html="",this.include_option_in_results(r)&&(r.group&&(r.group_match=!1,r.active_options=0),null!=r.group_array_index&&this.results_data[r.group_array_index]&&(0===(u=this.results_data[r.group_array_index]).active_options&&u.search_match&&(a+=1),u.active_options+=1),f=r.group?r.label:r.text,r.group&&!this.group_search||(_=this.search_string_match(f,c),r.search_match=null!=_,r.search_match&&!r.group&&(a+=1),r.search_match?(h.length&&(d=_.index,o=f.slice(0,d),s=f.slice(d,d+h.length),p=f.slice(d+h.length),r.highlighted_html=this.escape_html(o)+"<em>"+this.escape_html(s)+"</em>"+this.escape_html(p)),null!=u&&(u.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),a<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},n.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},n.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},n.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(t=this.selected_option_count=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},n.prototype.choices_click=function(t){if(t.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},n.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&t.preventDefault();break;case 32:this.disable_search&&t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},n.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&0<this.choices_count()?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},n.prototype.clipboard_event_checker=function(t){var e;if(!this.is_disabled)return setTimeout((e=this,function(){return e.results_search()}),50)},n.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},n.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},n.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},n.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},n.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},n.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},n.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},n.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},n.prototype.get_no_results_html=function(t){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(t)+"</span>\n</li>"},n.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?8<=document.documentMode:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},n.default_multiple_text="Select Some Options",n.default_single_text="Select an Option",n.default_no_result_text="No results match",n}(),(h=jQuery).fn.extend({chosen:function(i){return s.browser_is_supported()?this.each(function(t){var e,s;s=(e=h(this)).data("chosen"),"destroy"!==i?s instanceof n||e.data("chosen",new n(this,i)):s instanceof n&&s.destroy()}):this}}),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var s in e)r.call(e,s)&&(t[s]=e[s]);function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(e,s),e.prototype.setup=function(){return this.form_field_jq=h(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},e.prototype.set_up_html=function(){var t,e;return(t=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chosen-rtl"),e={class:t.join(" "),title:this.form_field.title},this.form_field.id.length&&(e.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=h("<div />",e),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},e.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},e.prototype.register_observers=function(){var e,s,i,n,r,o,h,l,c,a,u,_,d,p,f,g,m,v,y,b,w,x,k,C;return this.container.on("touchstart.chosen",(e=this,function(t){e.container_mousedown(t)})),this.container.on("touchend.chosen",(s=this,function(t){s.container_mouseup(t)})),this.container.on("mousedown.chosen",(i=this,function(t){i.container_mousedown(t)})),this.container.on("mouseup.chosen",(n=this,function(t){n.container_mouseup(t)})),this.container.on("mouseenter.chosen",(r=this,function(t){r.mouse_enter(t)})),this.container.on("mouseleave.chosen",(o=this,function(t){o.mouse_leave(t)})),this.search_results.on("mouseup.chosen",(h=this,function(t){h.search_results_mouseup(t)})),this.search_results.on("mouseover.chosen",(l=this,function(t){l.search_results_mouseover(t)})),this.search_results.on("mouseout.chosen",(c=this,function(t){c.search_results_mouseout(t)})),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",(a=this,function(t){a.search_results_mousewheel(t)})),this.search_results.on("touchstart.chosen",(u=this,function(t){u.search_results_touchstart(t)})),this.search_results.on("touchmove.chosen",(_=this,function(t){_.search_results_touchmove(t)})),this.search_results.on("touchend.chosen",(d=this,function(t){d.search_results_touchend(t)})),this.form_field_jq.on("chosen:updated.chosen",(p=this,function(t){p.results_update_field(t)})),this.form_field_jq.on("chosen:activate.chosen",(f=this,function(t){f.activate_field(t)})),this.form_field_jq.on("chosen:open.chosen",(g=this,function(t){g.container_mousedown(t)})),this.form_field_jq.on("chosen:close.chosen",(m=this,function(t){m.close_field(t)})),this.search_field.on("blur.chosen",(v=this,function(t){v.input_blur(t)})),this.search_field.on("keyup.chosen",(y=this,function(t){y.keyup_checker(t)})),this.search_field.on("keydown.chosen",(b=this,function(t){b.keydown_checker(t)})),this.search_field.on("focus.chosen",(w=this,function(t){w.input_focus(t)})),this.search_field.on("cut.chosen",(x=this,function(t){x.clipboard_event_checker(t)})),this.search_field.on("paste.chosen",(k=this,function(t){k.clipboard_event_checker(t)})),this.is_multiple?this.search_choices.on("click.chosen",(C=this,function(t){C.choices_click(t)})):this.container.on("click.chosen",function(t){t.preventDefault()})},e.prototype.destroy=function(){return h(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),0<this.form_field_label.length&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},e.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},e.prototype.container_mousedown=function(t){var e;if(!this.is_disabled)return!t||"mousedown"!==(e=t.type)&&"touchstart"!==e||this.results_showing||t.preventDefault(),null!=t&&h(t.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!t||h(t.target)[0]!==this.selected_item[0]&&!h(t.target).parents("a.chosen-single").length||(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),h(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},e.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},e.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},e.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},e.prototype.close_field=function(){return h(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},e.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},e.prototype.test_active_click=function(t){var e;return(e=h(t.target).closest(".chosen-container")).length&&this.container[0]===e[0]?this.active_field=!0:this.close_field()},e.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=o.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},e.prototype.result_do_highlight=function(t){var e,s,i,n;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),(i=parseInt(this.search_results.css("maxHeight"),10))+(n=this.search_results.scrollTop())<=(e=(s=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight()))return this.search_results.scrollTop(0<e-i?e-i:0);if(s<n)return this.search_results.scrollTop(s)}},e.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},e.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},e.prototype.update_results_content=function(t){return this.search_results.html(t)},e.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},e.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},e.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=h("label[for='"+this.form_field.id+"']")),0<this.form_field_label.length)return this.form_field_label.on("click.chosen",this.label_click_handler)},e.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},e.prototype.search_results_mouseup=function(t){var e;if((e=h(t.target).hasClass("active-result")?h(t.target):h(t.target).parents(".active-result").first()).length)return this.result_highlight=e,this.result_select(t),this.search_field.focus()},e.prototype.search_results_mouseover=function(t){var e;if(e=h(t.target).hasClass("active-result")?h(t.target):h(t.target).parents(".active-result").first())return this.result_do_highlight(e)},e.prototype.search_results_mouseout=function(t){if(h(t.target).hasClass("active-result")||h(t.target).parents(".active-result").first())return this.result_clear_highlight()},e.prototype.choice_build=function(t){var e,s,i;return e=h("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(t)+"</span>"),t.disabled?e.addClass("search-choice-disabled"):((s=h("<a />",{class:"search-choice-close","data-option-array-index":t.array_index})).on("click.chosen",(i=this,function(t){return i.choice_destroy_link_click(t)})),e.append(s)),this.search_container.before(e)},e.prototype.choice_destroy_link_click=function(t){if(t.preventDefault(),t.stopPropagation(),!this.is_disabled)return this.choice_destroy(h(t.target))},e.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&0<this.choices_count()&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},e.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},e.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},e.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),(s=this.results_data[e[0].getAttribute("data-option-array-index")]).selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},e.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},e.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},e.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},e.prototype.get_search_field_value=function(){return this.search_field.val()},e.prototype.get_search_text=function(){return h.trim(this.get_search_field_value())},e.prototype.escape_html=function(t){return h("<div/>").text(t).html()},e.prototype.winnow_results_set_highlight=function(){var t,e;if(null!=(t=(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result")).length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},e.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},e.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},e.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},e.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(0<this.choices_count()&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},e.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},e.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},e.prototype.search_field_scale=function(){var t,e,s,i,n,r,o;if(this.is_multiple){for(n={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},e=0,s=(r=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;e<s;e++)n[i=r[e]]=this.search_field.css(i);return(t=h("<div />").css(n)).text(this.get_search_field_value()),h("body").append(t),o=t.width()+25,t.remove(),this.container.is(":visible")&&(o=Math.min(this.container.outerWidth()-10,o)),this.search_field.width(o)}},e.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},e}()}.call(this),function(o){"use strict";function n(t,e,s){this.init(t,e,s)}function t(){this.rules=[]}o.extend(n.prototype,{init:function(t,e,s){this.controller=t,this.condition=e,this.value=s,this.rules=[],this.controls=[]},evalCondition:function(t,e,s,i,n){if("=="==s)return this.checkBoolean(i)==this.checkBoolean(n);if("!="==s)return this.checkBoolean(i)!=this.checkBoolean(n);if(">="==s)return Number(n)>=Number(i);if("<="==s)return Number(n)<=Number(i);if(">"==s)return Number(n)>Number(i);if("<"==s)return Number(n)<Number(i);if("()"==s)return window[i](t,e,n);if("any"==s){if(o.isArray(n)){for(var r=n.length-1;0<=r;r--)if(-1!==o.inArray(n[r],i.split(",")))return!0}else if(-1!==o.inArray(n,i.split(",")))return!0}else if("not-any"==s)if(o.isArray(n)){for(r=n.length-1;0<=r;r--)if(-1==o.inArray(n[r],i.split(",")))return!0}else if(-1==o.inArray(n,i.split(",")))return!0;return!1},checkBoolean:function(t){switch(t){case!0:case"true":case 1:case"1":t=!0;break;case null:case!1:case"false":case 0:case"0":t=!1}return t},checkCondition:function(t){if(!this.condition)return!0;var e=t.find(this.controller),s=this.getControlValue(t,e);return void 0!==s&&(s=this.normalizeValue(e,this.value,s),this.evalCondition(t,e,this.condition,this.value,s))},normalizeValue:function(t,e,s){return"number"==typeof e?parseFloat(s):s},getControlValue:function(t,e){return 1<e.length&&("radio"==e.attr("type")||"checkbox"==e.attr("type"))?e.filter(":checked").map(function(){return this.value}).get():"checkbox"==e.attr("type")||"radio"==e.attr("type")?e.is(":checked"):e.val()},createRule:function(t,e,s){var i=new n(t,e,s);return this.rules.push(i),i},include:function(t){this.controls.push(t)},applyRule:function(s,t){var e;e=void 0===t?this.checkCondition(s):t;var i=o.map(this.controls,function(t,e){return s.find(t)});e?(o(i).each(function(){o(this).removeClass("csf-depend-on")}),o(this.rules).each(function(){this.applyRule(s)})):(o(i).each(function(){o(this).addClass("csf-depend-on")}),o(this.rules).each(function(){this.applyRule(s,!1)}))}}),o.extend(t.prototype,{createRule:function(t,e,s){var i=new n(t,e,s);return this.rules.push(i),i},applyRules:function(t){o(this.rules).each(function(){this.applyRule(t)})}}),o.csf_deps={createRuleset:function(){return new t},enable:function(s,i,n){return s.on("change keyup",function(t){var e=t.target.getAttribute("data-depend-id")||t.target.getAttribute("data-sub-depend-id");-1!==n.indexOf(e)&&i.applyRules(s)}),i.applyRules(s),!0}}}(jQuery),function(t,s){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(t,e){return s(t,e)});else if("undefined"!=typeof exports){var e=require("jquery");s(exports,e)}else s(t,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e){var h={validate:/^(?!(_nonce|_pseudo))[a-zA-Z0-9_-]*(?:\[(?:\d*|(?!(_nonce|_pseudo))[a-zA-Z0-9_-]+)\])*$/i,key:/[a-zA-Z0-9_-]+|(?=\[\])/g,named:/^[a-zA-Z0-9_-]+$/,push:/^$/,fixed:/^\d+$/};function s(i,t){var s={},r={};function o(t,e,s){return t[e]=s,t}function e(){return s}this.addPair=function(t){if(!h.validate.test(t.name))return this;var e=function(t,e){for(var s,i=t.match(h.key);void 0!==(s=i.pop());)h.push.test(s)?e=o([],(n=t.replace(/\[\]$/,""),void 0===r[n]&&(r[n]=0),r[n]++),e):h.fixed.test(s)?e=o([],s,e):h.named.test(s)&&(e=o({},s,e));var n;return e}(t.name,t.value);return s=i.extend(!0,s,e),this},this.addPairs=function(t){if(!i.isArray(t))throw new Error("formSerializer.addPairs expects an Array");for(var e=0,s=t.length;e<s;e++)this.addPair(t[e]);return this},this.serialize=e,this.serializeJSON=function(){return JSON.stringify(e())}}return s.patterns=h,s.serializeObject=function(){return new s(e,this).addPairs(this.serializeArray()).serialize()},s.serializeJSON=function(){return new s(e,this).addPairs(this.serializeArray()).serializeJSON()},void 0!==e.fn&&(e.fn.serializeObjectCSF=s.serializeObject,e.fn.serializeJSONCSF=s.serializeJSON),t.FormSerializer=s});
includes/libs/codestar-framework/assets/scss/style-rtl.scss ADDED
@@ -0,0 +1,720 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * ---------------------------------------------------------
4
+ * CODESTAR FRAMEWORK RTL CSS MAP
5
+ * ---------------------------------------------------------
6
+ *
7
+ * 01. Base
8
+ * 01. 01. Header
9
+ * 01. 02. Header Buttons
10
+ * 01. 03. Navigation
11
+ * 01. 04. Content
12
+ * 01. 05. Section
13
+ * 01. 06. Show All Options
14
+ * 01. 07. Search Input
15
+ * 01. 08. Copyright
16
+ * 01. 09. Metabox
17
+ * 02. Fields
18
+ * 02. 01. Field: typography
19
+ * 02. 02. Field: checkbox, radio
20
+ * 02. 03. Field: switcher
21
+ * 02. 04. Field: upload
22
+ * 02. 05. Field: group
23
+ * 02. 06. Field: repeater
24
+ * 02. 07. Field: help
25
+ * 02. 08. Field: icon
26
+ * 02. 09. Field: gallery
27
+ * 02. 10. Field: sorter
28
+ * 02. 11. Field: tabbed
29
+ * 02. 12. Field: media
30
+ * 02. 13. Field: notice
31
+ * 02. 14. Field: border, spacing, dimensions
32
+ * 02. 15. Field: background
33
+ * 02. 16. Field: spinner
34
+ * 02. 17. Field: slider
35
+ * 02. 18. Field: button_set
36
+ * 02. 19. Field: link_color
37
+ * 02. 20. Field: color_group
38
+ * 02. 21. Field: palette
39
+ * 02. 22. Field: accordion
40
+ * 02. 23. Field: date
41
+ * 02. 24. Field: map
42
+ * 02. 25. Field: sortable
43
+ * 02. 26. Field: number
44
+ * 03. Taxonomy
45
+ * 04. Profile
46
+ * 05. Nav Menu
47
+ * 06. Modal
48
+ * 07. Customizer
49
+ * 08. Responsive
50
+ * 09. Others
51
+ *
52
+ * ---------------------------------------------------------
53
+ *
54
+ */
55
+ @import "compass";
56
+ @import "vendor/mixins";
57
+
58
+ /**
59
+ * 01. Base
60
+ */
61
+ .csf-options{
62
+ margin-left: 20px;
63
+ margin-right: 0;
64
+ }
65
+
66
+ /**
67
+ * 01. 01. Header
68
+ */
69
+ .csf-header{
70
+ h1{
71
+ float: right;
72
+ }
73
+
74
+ fieldset{
75
+ float: left;
76
+ }
77
+ }
78
+
79
+ /**
80
+ * 01. 02. Header Buttons
81
+ */
82
+ .csf-buttons{
83
+ float: left;
84
+ direction: ltr;
85
+ }
86
+
87
+ .csf-header-left{
88
+ float: right;
89
+ }
90
+
91
+ .csf-header-right{
92
+ float: left;
93
+ }
94
+
95
+ /**
96
+ * 01. 03. Navigation
97
+ */
98
+ .csf-nav{
99
+ float: right;
100
+
101
+ ul{
102
+ clear: right;
103
+
104
+ li{
105
+ .csf-active:after{
106
+ right: auto;
107
+ left: 0;
108
+ border-left-color: #fff;
109
+ border-right-color: transparent;
110
+ }
111
+
112
+ .csf-arrow:after{
113
+ content: "\f053";
114
+ right: auto;
115
+ left: 10px;
116
+ }
117
+
118
+ &.csf-tab-expanded .csf-arrow:after{
119
+ @include transform( rotate(-90deg) );
120
+ }
121
+ }
122
+
123
+ ul{
124
+ li{
125
+ a{
126
+ padding-right: 25px;
127
+ padding-left: 15px;
128
+ }
129
+ }
130
+
131
+ &:before{
132
+ left: auto;
133
+ right: 15px;
134
+ }
135
+ }
136
+ }
137
+
138
+ .csf-tab-icon{
139
+ margin-left: 5px;
140
+ margin-right: 0;
141
+ }
142
+ }
143
+
144
+ .csf-nav-background{
145
+ left: auto;
146
+ right: 0;
147
+ }
148
+
149
+ /**
150
+ * 01. 04. Content
151
+ */
152
+ .csf-content{
153
+ margin-left: 0;
154
+ margin-right: 225px;
155
+ }
156
+
157
+ /**
158
+ * 01. 05. Section
159
+ */
160
+ .csf-sections{
161
+ float: right;
162
+ }
163
+
164
+ /**
165
+ * 01. 06. Show all options
166
+ */
167
+ .csf-show-all .csf-content{
168
+ margin-right: 0;
169
+ overflow: hidden;
170
+ }
171
+
172
+ .csf-expand-all{
173
+ float: right;
174
+ right: auto;
175
+ left: 40px;
176
+ margin-right: 0;
177
+ margin-left: 4px;
178
+ }
179
+
180
+ /**
181
+ * 01. 07. Search Input
182
+ */
183
+ .csf-search{
184
+ float: right;
185
+
186
+ input{
187
+ margin: 0 0 0 5px;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * 01. 08. Copyright
193
+ */
194
+ .csf-copyright{
195
+ float: right;
196
+ }
197
+
198
+ /**
199
+ * 01. 09. Metabox
200
+ */
201
+ .csf-metabox{
202
+ margin: -6px -12px -12px -12px;
203
+
204
+ .csf-section-title{
205
+ padding: 20px;
206
+ }
207
+ }
208
+
209
+ .csf-section-title{
210
+
211
+ .csf-section-icon{
212
+ margin-left: 5px;
213
+ margin-right: 0;
214
+ }
215
+ }
216
+
217
+ /**
218
+ * 02. Fields
219
+ */
220
+ .csf-field{
221
+
222
+ .csf-title{
223
+ float: right;
224
+ }
225
+
226
+ .csf-fieldset{
227
+ float: left;
228
+ }
229
+ }
230
+
231
+ .csf-pseudo-field{
232
+ padding: 0 0 0 5px !important;
233
+ }
234
+
235
+ /**
236
+ * 02. 01. Field: typography
237
+ */
238
+ .csf-field-typography{
239
+
240
+ select{
241
+ margin: 0;
242
+ width: 100%;
243
+ }
244
+
245
+ .csf--blocks-inputs{
246
+ .csf--blocks{
247
+ flex-direction: row-reverse;
248
+ }
249
+ }
250
+ }
251
+
252
+ /**
253
+ * 02. 02. Field: checkbox, radio
254
+ */
255
+ .csf-field-checkbox,
256
+ .csf-field-radio{
257
+
258
+ ul ul li{
259
+ margin-left: 0;
260
+ margin-right: 8px;
261
+
262
+ &:first-child{
263
+ margin-right: 0;
264
+ }
265
+ }
266
+
267
+ .csf--inline-list li{
268
+ margin-right: 0;
269
+ margin-left: 15px;
270
+ }
271
+
272
+ .csf--text{
273
+ margin-left: 0;
274
+ margin-right: 5px;
275
+ }
276
+ }
277
+
278
+ /**
279
+ * 02. 03. Field: switcher
280
+ */
281
+ .csf-field-switcher{
282
+
283
+ .csf--switcher{
284
+ float: right;
285
+ }
286
+
287
+ .csf--label{
288
+ float: right;
289
+ margin-left: 0;
290
+ margin-right: 5px;
291
+ }
292
+ }
293
+
294
+ /**
295
+ * 02. 04. Field: upload
296
+ */
297
+ .csf-field-upload{
298
+
299
+ .csf--remove,
300
+ .csf--button{
301
+ margin-left: 0;
302
+ margin-right: 5px;
303
+ }
304
+ }
305
+
306
+ /**
307
+ * 02. 05. Field: group
308
+ */
309
+ .csf-field-group{
310
+
311
+ .csf-cloneable-title{
312
+ padding: 15px 10px 15px 65px;
313
+ }
314
+
315
+ .csf-cloneable-helper{
316
+ right: auto;
317
+ left: 10px;
318
+ }
319
+ }
320
+
321
+ /**
322
+ * 02. 06. Field: repeater
323
+ */
324
+ .csf-field-repeater{
325
+
326
+ .csf-repeater-helper{
327
+ border-left: 0;
328
+ border-right: 1px solid #eee;
329
+ }
330
+ }
331
+
332
+ /**
333
+ * 02. 07. Field: help
334
+ */
335
+ .csf-help{
336
+ right: auto;
337
+ left: 5px;
338
+ }
339
+
340
+ /**
341
+ * 02. 08. Field: icon
342
+ */
343
+ .csf-field-icon{
344
+
345
+ .button{
346
+ margin-right: 0;
347
+ margin-left: 5px;
348
+ }
349
+
350
+ .csf-icon-preview i{
351
+ margin-right: 0;
352
+ margin-left: 5px;
353
+ }
354
+ }
355
+
356
+ /**
357
+ * 02. 09. Field: gallery
358
+ */
359
+ .csf-field-gallery{
360
+
361
+ ul li{
362
+ margin-right: 0;
363
+ margin-left: 5px;
364
+ }
365
+
366
+ .button{
367
+ margin-right: 0;
368
+ margin-left: 5px;
369
+ }
370
+ }
371
+
372
+ /**
373
+ * 02. 11. Field: tabbed
374
+ */
375
+ .csf-field-tabbed{
376
+
377
+ .csf-tabbed-nav{
378
+
379
+ .csf--icon{
380
+ padding-right: 0;
381
+ padding-left: 5px;
382
+ }
383
+
384
+ a{
385
+ margin-right: 0;
386
+ margin-left: 5px;
387
+ }
388
+ }
389
+ }
390
+
391
+ /**
392
+ * 02. 12. Field: media
393
+ */
394
+ .csf-field-media{
395
+
396
+ .button{
397
+ margin-left: 0;
398
+ margin-right: 7px;
399
+ }
400
+
401
+ .hidden + .button{
402
+ margin-right: 0;
403
+ }
404
+ }
405
+
406
+ /**
407
+ * 02. 13. Field: notice
408
+ */
409
+ .csf-notice{
410
+ border-left: none;
411
+ border-right-style: solid;
412
+ border-right-width: 4px;
413
+ }
414
+
415
+ /**
416
+ * 02. 14. Field: border, spacing, dimensions
417
+ */
418
+ .csf-field-dimensions,
419
+ .csf-field-spacing,
420
+ .csf-field-border{
421
+
422
+ .csf--input,
423
+ .csf-fieldset{
424
+ direction: ltr;
425
+ }
426
+
427
+ .csf--inputs,
428
+ .csf--color{
429
+ float: right;
430
+ }
431
+
432
+ .csf--color{
433
+ margin-right: 4px;
434
+ direction: rtl;
435
+ }
436
+ }
437
+
438
+ /**
439
+ * 02. 15. Field: background
440
+ */
441
+ .csf-field-background{
442
+
443
+ .csf--block{
444
+ float: right;
445
+ }
446
+
447
+ .csf--select,
448
+ .csf--media{
449
+ padding-right: 0;
450
+ }
451
+
452
+ .csf--title{
453
+ margin-right: 0;
454
+ margin-left: 5px;
455
+ }
456
+ }
457
+
458
+ /**
459
+ * 02. 16. Field: spinner
460
+ */
461
+ .csf-field-spinner{
462
+
463
+ .csf--spin{
464
+ float: right;
465
+ direction: ltr;
466
+ }
467
+ }
468
+
469
+ /**
470
+ * 02. 17. Field: slider
471
+ */
472
+ .csf-field-slider{
473
+
474
+ .csf-slider-ui{
475
+ direction: ltr;
476
+ margin-right: 0;
477
+ margin-left: 15px;
478
+ }
479
+
480
+ .csf--input{
481
+ direction: ltr;
482
+ }
483
+ }
484
+
485
+ /**
486
+ * 02. 18. Field: button_set
487
+ */
488
+ .csf-field-button_set{
489
+
490
+ .csf--button-group{
491
+ float: right;
492
+ }
493
+ }
494
+
495
+ /**
496
+ * 02. 19. Field: link_color
497
+ */
498
+ .csf-field-link_color{
499
+
500
+ .csf--left{
501
+ float: right;
502
+ margin-right: 0;
503
+ margin-left: 10px;
504
+ }
505
+ }
506
+
507
+ /**
508
+ * 02. 20. Field: color_group
509
+ */
510
+ .csf-field-color_group{
511
+
512
+ .csf--left{
513
+ float: right;
514
+ margin-right: 0;
515
+ margin-left: 10px;
516
+ }
517
+ }
518
+
519
+ /**
520
+ * 02. 21. Field: palette
521
+ */
522
+ .csf-field-palette{
523
+
524
+ .csf--palette{
525
+ margin-right: 0;
526
+ margin-left: 10px;
527
+ }
528
+ }
529
+
530
+ /**
531
+ * 02. 22. Field: accordion
532
+ */
533
+ .csf-field-accordion{
534
+
535
+ .csf--icon{
536
+ margin-right: 0;
537
+ margin-left: 2px;
538
+ }
539
+ }
540
+
541
+ /**
542
+ * 02. 23. Field: date
543
+ */
544
+ .csf-field-date{
545
+
546
+ .csf--to {
547
+ margin-left: 0;
548
+ margin-right: 7px;
549
+ }
550
+ }
551
+
552
+ /**
553
+ * 02. 24. Field: map
554
+ */
555
+ .csf-field-map{
556
+
557
+ .csf--map-input:last-child {
558
+ padding-left: 0;
559
+ padding-right: 10px;
560
+ }
561
+ }
562
+
563
+ /**
564
+ * 02. 25. Field: sortable
565
+ */
566
+ .csf-field-sortable{
567
+
568
+ .csf--sortable-helper{
569
+ border-left: none;
570
+ border-right: 1px solid #eee;
571
+ }
572
+ }
573
+
574
+ /**
575
+ * 02. 26. Field: number
576
+ */
577
+ .csf-field-number{
578
+
579
+ .csf--wrap{
580
+ float: right;
581
+ }
582
+ }
583
+
584
+ /**
585
+ * 03. Taxonomy
586
+ */
587
+ .csf-taxonomy-add-fields{
588
+ margin-right: 0;
589
+ margin-left: 30px;
590
+
591
+ .csf-field > .csf-fieldset > .csf-help{
592
+ left: -5px;
593
+ right: auto;
594
+ }
595
+ }
596
+
597
+ .csf-taxonomy-edit-fields{
598
+ margin-right: 0;
599
+ margin-left: 35px;
600
+
601
+ .csf-field > .csf-fieldset > .csf-help{
602
+ right: auto;
603
+ left: -5px;
604
+ }
605
+ }
606
+
607
+ /**
608
+ * 04. Profile
609
+ */
610
+ .csf-profile-options{
611
+
612
+ > h2 > .fa{
613
+ padding-right: 0;
614
+ padding-left: 7px;
615
+ }
616
+
617
+ > .csf-field{
618
+
619
+ > .csf-fieldset{
620
+
621
+ > .csf-help{
622
+ left: -5px;
623
+ right: auto;
624
+ }
625
+ }
626
+ }
627
+ }
628
+
629
+ /**
630
+ * 05. Nav Menu
631
+ */
632
+ .csf-nav-menu-options{
633
+
634
+ > .csf-fields{
635
+ margin-left: 0;
636
+ margin-right: -10px;
637
+ }
638
+ }
639
+
640
+ .csf-nav-menu-title {
641
+ padding-left: 14px;
642
+ padding-right: 12px;
643
+ }
644
+
645
+ .csf-nav-menu-icon{
646
+ margin-right: 0;
647
+ margin-left: 5px;
648
+ }
649
+
650
+ /**
651
+ * 06. Modal
652
+ */
653
+ .csf-modal-content{
654
+
655
+ .csf-field{
656
+ padding: 15px 15px 15px 30px;
657
+ }
658
+ }
659
+
660
+ .csf-modal-title{
661
+ padding: 0 16px 0 36px;
662
+ }
663
+
664
+ .csf-modal-close{
665
+ right: auto;
666
+ left: 0;
667
+ }
668
+
669
+ /**
670
+ * 07. Customizer
671
+ */
672
+ .control-section{
673
+
674
+ .csf-field{
675
+
676
+ .csf-fieldset{
677
+ margin-right: 0;
678
+ }
679
+ }
680
+ }
681
+
682
+ /**
683
+ * 08. Responsive
684
+ */
685
+ @media only screen and (max-width:1200px){
686
+ .csf-metabox .csf-field .csf-fieldset{
687
+ margin-left: 0;
688
+ }
689
+ }
690
+
691
+ @media only screen and (max-width:782px){
692
+ .csf .csf-fieldset,
693
+ .csf .csf-content{
694
+ margin-right: 0;
695
+ }
696
+ }
697
+
698
+ /**
699
+ * 09. Others
700
+ */
701
+ .csf-field{
702
+
703
+ .csf--transparent-slider{
704
+ margin-left: 0;
705
+ margin-right: 2px;
706
+
707
+ .ui-slider-handle{
708
+ margin: 0 -11px;
709
+ }
710
+ }
711
+
712
+ .csf--transparent-offset{
713
+ background-position: center right;
714
+ }
715
+
716
+ .csf--transparent-text{
717
+ right: auto;
718
+ left: 10px;
719
+ }
720
+ }
includes/libs/codestar-framework/assets/scss/style.scss ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * ---------------------------------------------------------
4
+ * CODESTAR FRAMEWORK CSS MAP
5
+ * ---------------------------------------------------------
6
+ *
7
+ * 01. Base
8
+ * 01. 01. Header
9
+ * 01. 02. Sticky
10
+ * 01. 03. Header Buttons
11
+ * 01. 04. Navigation
12
+ * 01. 05. Wrapper
13
+ * 01. 06. Content
14
+ * 01. 07. Section
15
+ * 01. 08. Footer
16
+ * 01. 09. Copyright
17
+ * 01. 10. Show All Options
18
+ * 01. 11. Search Input
19
+ * 01. 12. Metabox
20
+ * 01. 13. Comment Metabox
21
+ * 01. 14. Help Tooltip
22
+ * 02. Themes
23
+ * 02. 01. Theme Dark
24
+ * 02. 02. Theme Light
25
+ * 03. Fields
26
+ * 03. 01. Field
27
+ * 03. 02. Field: accordion
28
+ * 03. 03. Field: background
29
+ * 03. 04. Field: backup
30
+ * 03. 05. Field: border, spacing, dimensions
31
+ * 03. 06. Field: button_set
32
+ * 03. 07. Field: checkbox, radio
33
+ * 03. 08. Field: code_editor
34
+ * 03. 09. Field: color
35
+ * 03. 10. Field: color_group
36
+ * 03. 11. Field: fieldset
37
+ * 03. 12. Field: date
38
+ * 03. 13. Field: gallery
39
+ * 03. 14. Field: group
40
+ * 03. 15. Field: icon
41
+ * 03. 16. Field: image_select
42
+ * 03. 17. Field: link_color
43
+ * 03. 18. Field: map
44
+ * 03. 19. Field: media
45
+ * 03. 20. Field: palette
46
+ * 03. 21. Field: repeater
47
+ * 03. 22. Field: select
48
+ * 03. 23. Field: slider
49
+ * 03. 24. Field: sortable
50
+ * 03. 25. Field: sorter
51
+ * 03. 26. Field: spinner
52
+ * 03. 27. Field: switcher
53
+ * 03. 28. Field: tabbed
54
+ * 03. 29. Field: text
55
+ * 03. 30. Field: textarea
56
+ * 03. 31. Field: typography
57
+ * 03. 32. Field: upload
58
+ * 03. 33. Field: wp_editor
59
+ * 03. 34. Field: heading
60
+ * 03. 35. Field: subheading
61
+ * 03. 36. Field: submessage
62
+ * 03. 37. Field: notice
63
+ * 03. 38. Field: number
64
+ * 03. 39. Field: others
65
+ * 04. Widget
66
+ * 05. Customizer
67
+ * 06. Taxonomy
68
+ * 07. Profile
69
+ * 08. Nav Menu
70
+ * 09. Modal
71
+ * 09. 01. Shortcode Modal
72
+ * 09. 02. Gutenberg Modal
73
+ * 09. 03. Icon Modal
74
+ * 10. Helper
75
+ * 11. Welcome Page
76
+ * 12. Responsive
77
+ * 13. Others
78
+ *
79
+ * ---------------------------------------------------------
80
+ *
81
+ */
82
+ @import "compass";
83
+ @import "vendor/mixins";
84
+ @import "vendor/base";
85
+ @import "vendor/themes";
86
+ @import "vendor/fields";
87
+ @import "vendor/widget";
88
+ @import "vendor/customizer";
89
+ @import "vendor/taxonomy";
90
+ @import "vendor/navmenu";
91
+ @import "vendor/profile";
92
+ @import "vendor/modal";
93
+ @import "vendor/helper";
94
+ @import "vendor/welcome";
95
+ @import "vendor/responsive";
96
+ @import "vendor/chosen";
includes/libs/codestar-framework/assets/scss/vendor/_base.scss ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 01. Base
3
+ */
4
+ .csf{
5
+ position: relative;
6
+
7
+ label{
8
+ padding: 0;
9
+ margin: 0;
10
+ display: inline-block;
11
+ }
12
+ }
13
+
14
+ .csf-ab-icon{
15
+ top: 2px;
16
+ }
17
+
18
+ #screen-meta-links + .csf-options{
19
+ margin-top: 40px;
20
+ }
21
+
22
+ .csf-options{
23
+ margin-top: 20px;
24
+ margin-right: 20px;
25
+ }
26
+
27
+ /**
28
+ * 01. 01. Header
29
+ */
30
+ .csf-header{
31
+ position: relative;
32
+ }
33
+
34
+ .csf-header-inner{
35
+ padding: 25px;
36
+ transition: box-shadow .3s ease;
37
+
38
+ h1{
39
+ float: left;
40
+ font-size: 1.5em;
41
+ line-height: 26px;
42
+ font-weight: 400;
43
+ margin: 0;
44
+
45
+ small{
46
+ font-size: 11px;
47
+ font-weight: 500;
48
+ }
49
+ }
50
+ }
51
+
52
+ /**
53
+ * 01. 02. Sticky
54
+ */
55
+ .csf-sticky{
56
+
57
+ .csf-header-inner{
58
+ position: fixed;
59
+ z-index: 99;
60
+ top: 32px;
61
+ @include box-shadow(0 5px 10px rgba(black, 0.1));
62
+ }
63
+ }
64
+
65
+ /**
66
+ * 01. 03. Header Buttons
67
+ */
68
+ .csf-buttons{
69
+ float: right;
70
+ @include transition(opacity 0.2s);
71
+
72
+ .button{
73
+ margin: 0 2px;
74
+ line-height: 26px;
75
+
76
+ &:focus{
77
+ outline: none !important;
78
+ box-shadow: none !important;
79
+ }
80
+ }
81
+
82
+ .csf-save{
83
+ min-width: 72px;
84
+ }
85
+ }
86
+
87
+ .csf-header-left{
88
+ float: left;
89
+ }
90
+
91
+ .csf-header-right{
92
+ float: right;
93
+ }
94
+
95
+ /**
96
+ * 01. 04. Navigation
97
+ */
98
+ .csf-nav{
99
+ display: block;
100
+ position: relative;
101
+ z-index: 10;
102
+ float: left;
103
+ width: 225px;
104
+
105
+ ul{
106
+ clear: left;
107
+ margin: 0;
108
+ list-style-type: none;
109
+
110
+ li{
111
+ margin-bottom: 0;
112
+
113
+ a{
114
+ font-size: 13px;
115
+ position: relative;
116
+ display: block;
117
+ padding: 14px 12px;
118
+ text-decoration: none;
119
+ transition-property: color;
120
+ transition-duration: 0.2s;
121
+ transition-timing-function: ease;
122
+
123
+ &:focus{
124
+ outline: none;
125
+ @include box-shadow(none);
126
+ }
127
+ }
128
+
129
+ .csf-arrow:after{
130
+ content: "\f054";
131
+ display: inline-block;
132
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
133
+ font-weight: 900;
134
+ font-size: 9px;
135
+ line-height: 1;
136
+ position: absolute;
137
+ right: 10px;
138
+ top: 50%;
139
+ margin-top: -4px;
140
+ @include transform(rotate(0));
141
+ }
142
+
143
+ &.csf-tab-expanded{
144
+
145
+ .csf-arrow:after{
146
+ @include transform( rotate(90deg) );
147
+ }
148
+
149
+ ul{
150
+ display: block;
151
+ }
152
+ }
153
+ }
154
+
155
+ ul{
156
+ display: none;
157
+ position: relative;
158
+
159
+ li{
160
+
161
+ a{
162
+ font-size: 12px;
163
+ padding: 12px 14px 12px 24px;
164
+ }
165
+ }
166
+ }
167
+ }
168
+
169
+ .csf-tab-icon{
170
+ width: 20px;
171
+ margin-right: 5px;
172
+ font-size: 13px;
173
+ text-align: center;
174
+ }
175
+
176
+ .csf-label-error{
177
+ margin-left: 4px;
178
+ vertical-align: top;
179
+ }
180
+ }
181
+
182
+ .csf-nav-background{
183
+ position: absolute;
184
+ top: 0;
185
+ left: 0;
186
+ bottom: 0;
187
+ z-index: 9;
188
+ width: 225px;
189
+ }
190
+
191
+ /**
192
+ * 01. 05. Wrapper
193
+ */
194
+ .csf-wrapper{
195
+ position: relative;
196
+ }
197
+
198
+ /**
199
+ * 01. 06. Content
200
+ */
201
+ .csf-content{
202
+ position: relative;
203
+ margin-left: 225px;
204
+ background-color: #fff;
205
+ @include transition(opacity 0.2s);
206
+ }
207
+
208
+ /**
209
+ * 01. 07. Section
210
+ */
211
+ .csf-sections{
212
+ float: left;
213
+ width: 100%;
214
+ }
215
+
216
+ .csf-section{
217
+ display: none;
218
+ }
219
+
220
+ .csf-section-title{
221
+ display: none;
222
+ padding: 20px 30px;
223
+ background-color: #f5f5f5;
224
+ border-top: 1px solid #eee;
225
+ border-bottom: 1px solid #eee;
226
+
227
+ h3{
228
+ margin: 0;
229
+ padding: 0 ;
230
+ font-size: 13px;
231
+ font-weight: bold;
232
+ text-transform: uppercase;
233
+ }
234
+
235
+ .csf-section-icon{
236
+ margin-right: 5px;
237
+ }
238
+ }
239
+
240
+ /**
241
+ * 01. 08. Footer
242
+ */
243
+ .csf-footer{
244
+ padding: 20px;
245
+ font-size: 11px;
246
+ }
247
+
248
+ /**
249
+ * 01. 09. Copyright
250
+ */
251
+ .csf-copyright{
252
+ float: left;
253
+ margin-top: 5px;
254
+ }
255
+
256
+ /**
257
+ * 01. 10. Show All Options
258
+ */
259
+ .csf-search-all,
260
+ .csf-show-all{
261
+ .csf-nav-background,
262
+ .csf-nav{
263
+ display: none;
264
+ }
265
+
266
+ .csf-content{
267
+ margin-left: 0;
268
+ }
269
+
270
+ .csf-section-title,
271
+ .csf-section{
272
+ display: block !important;
273
+ }
274
+ }
275
+
276
+ .csf-search-all{
277
+ .csf-section-title{
278
+ display: none !important;
279
+ }
280
+ }
281
+
282
+ //
283
+ // Expand
284
+ //
285
+ .csf-expand-all{
286
+ float: left;
287
+ padding: 0 8px;
288
+ margin-right: 4px;
289
+ z-index: 1;
290
+ font-size: 13px;
291
+ line-height: 30px;
292
+ cursor: pointer;
293
+ user-select: none;
294
+ @include border-radius(2px);
295
+ @include transition(all 0.2s);
296
+
297
+ span{
298
+ font-size: 11px;
299
+ vertical-align: middle;
300
+ }
301
+ }
302
+
303
+ /**
304
+ * 01. 11. Search Input
305
+ */
306
+ .csf-search{
307
+ float: left;
308
+
309
+ input{
310
+ margin: 0 2px 0 0;
311
+ border: none;
312
+ font-size: 12px;
313
+ line-height: 30px;
314
+ min-height: 30px;
315
+ text-align: inherit;
316
+ padding: 0 10px;
317
+ @include border-radius(2px);
318
+ @include box-shadow(none);
319
+
320
+ &:focus{
321
+ @include box-shadow(none);
322
+ }
323
+ }
324
+ }
325
+
326
+ .csf-saving{
327
+
328
+ .csf-buttons,
329
+ .csf-content{
330
+ cursor: default;
331
+ pointer-events: none;
332
+ @include opacity(0.5);
333
+ }
334
+ }
335
+
336
+ /**
337
+ * 01. 12. Metabox
338
+ */
339
+ .csf-metabox{
340
+ margin: -6px -12px -12px -12px;
341
+
342
+ .csf-field{
343
+ padding: 20px;
344
+ }
345
+
346
+ .csf-section-title{
347
+ padding: 20px;
348
+ }
349
+ }
350
+
351
+ .block-editor-page{
352
+
353
+ .csf-metabox{
354
+ margin: -6px -14px -14px -14px;
355
+ }
356
+ }
357
+
358
+ .block-editor-editor-skeleton__content{
359
+
360
+ .csf-metabox{
361
+ border-left: 1px solid #e2e4e7;
362
+ border-right: 1px solid #e2e4e7;
363
+ }
364
+ }
365
+
366
+ .csf-sections-restore{
367
+ float: left;
368
+ width: 100%;
369
+ position: relative;
370
+ z-index: 1000000;
371
+ text-align: right;
372
+ border-top: 1px solid #eee;
373
+
374
+ .csf-button-cancel,
375
+ input{
376
+ display: none;
377
+ }
378
+
379
+ label{
380
+ padding: 10px;
381
+ }
382
+
383
+ span{
384
+ -webkit-user-select: none;
385
+ user-select: none;
386
+ }
387
+
388
+
389
+ input:checked ~ .csf-button-restore{
390
+ display: none;
391
+ }
392
+
393
+ input:checked ~ .csf-button-cancel{
394
+ display: inline-block;
395
+ }
396
+
397
+ }
398
+
399
+ #side-sortables{
400
+
401
+ .csf-section-title{
402
+ padding: 12px;
403
+ }
404
+
405
+ .csf-field{
406
+ padding: 10px 15px;
407
+
408
+ .csf-title{
409
+ float: none;
410
+ width: 100%;
411
+ margin-bottom: 6px;
412
+ }
413
+
414
+ .csf-fieldset{
415
+ float: none;
416
+ width: 100%;
417
+ }
418
+ }
419
+
420
+ .csf-field-text input{
421
+ width: 100%;
422
+ }
423
+
424
+ .csf-notice{
425
+ padding: 10px 15px;
426
+ }
427
+ }
428
+
429
+ /**
430
+ * 01. 13. Comment Metabox
431
+ */
432
+ .csf-comment-metabox{
433
+ margin: -6px -12px -12px -12px;
434
+
435
+ .csf-field{
436
+ padding: 20px;
437
+ }
438
+
439
+ .csf-section-title{
440
+ padding: 20px;
441
+ }
442
+ }
443
+
444
+
445
+ /**
446
+ * 01. 14. Help Tooltip
447
+ */
448
+ .csf-tooltip{
449
+ position: absolute;
450
+ z-index: 5000001;
451
+ font-size: 12px;
452
+ line-height: 1.4;
453
+ text-align: center;
454
+ text-decoration: none;
455
+ padding: 6px 12px;
456
+ max-width: 200px;
457
+ color: #fff;
458
+ background-color: #000;
459
+ background-color: rgba(black, 0.85);
460
+ @include border-radius(4px);
461
+ }
includes/libs/codestar-framework/assets/scss/vendor/_chosen.scss ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Chosen JS Styles
3
+ */
4
+ .chosen-container {
5
+ position: relative;
6
+ display: inline-block;
7
+ vertical-align: middle;
8
+ font-size: 13px;
9
+ user-select: none;
10
+ }
11
+
12
+ .chosen-container * {
13
+ box-sizing: border-box;
14
+ }
15
+
16
+ .chosen-container .chosen-drop {
17
+ position: absolute;
18
+ top: 100%;
19
+ z-index: 1010;
20
+ width: 100%;
21
+ border: 1px solid #aaa;
22
+ border-top: 0;
23
+ background: #fff;
24
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
25
+ clip: rect(0, 0, 0, 0);
26
+ clip-path: inset(100% 100%);
27
+ }
28
+
29
+ .chosen-container.chosen-with-drop .chosen-drop {
30
+ clip: auto;
31
+ clip-path: none;
32
+ }
33
+
34
+ .chosen-container a {
35
+ cursor: pointer;
36
+ }
37
+
38
+ .chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
39
+ margin-right: 4px;
40
+ overflow: hidden;
41
+ white-space: nowrap;
42
+ text-overflow: ellipsis;
43
+ font-weight: normal;
44
+ color: #999999;
45
+ }
46
+
47
+ .chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
48
+ content: ":";
49
+ padding-left: 2px;
50
+ vertical-align: top;
51
+ }
52
+
53
+ .chosen-container-single .chosen-single {
54
+ position: relative;
55
+ display: block;
56
+ overflow: hidden;
57
+ padding: 0 0 0 8px;
58
+ height: 25px;
59
+ border: 1px solid #aaa;
60
+ border-radius: 5px;
61
+ background-color: #fff;
62
+ background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
63
+ background-clip: padding-box;
64
+ box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
65
+ color: #444;
66
+ text-decoration: none;
67
+ white-space: nowrap;
68
+ line-height: 24px;
69
+ }
70
+
71
+ .chosen-container-single .chosen-default {
72
+ color: #999;
73
+ }
74
+
75
+ .chosen-container-single .chosen-single span {
76
+ display: block;
77
+ overflow: hidden;
78
+ margin-right: 26px;
79
+ text-overflow: ellipsis;
80
+ white-space: nowrap;
81
+ }
82
+
83
+ .chosen-container-single .chosen-single-with-deselect span {
84
+ margin-right: 38px;
85
+ }
86
+
87
+ .chosen-container-single .chosen-single abbr {
88
+ position: absolute;
89
+ top: 6px;
90
+ right: 26px;
91
+ display: block;
92
+ width: 12px;
93
+ height: 12px;
94
+ font-size: 1px;
95
+ }
96
+
97
+ .chosen-container-single .chosen-single div {
98
+ position: absolute;
99
+ top: 0;
100
+ right: 0;
101
+ display: block;
102
+ width: 18px;
103
+ height: 100%;
104
+ }
105
+
106
+ .chosen-container-single .chosen-single div b {
107
+ display: block;
108
+ width: 100%;
109
+ height: 100%;
110
+ }
111
+
112
+ .chosen-container-single .chosen-search {
113
+ position: relative;
114
+ z-index: 1010;
115
+ margin: 0;
116
+ padding: 3px 4px;
117
+ white-space: nowrap;
118
+ }
119
+
120
+ .chosen-container-single .chosen-search input[type="text"] {
121
+ margin: 1px 0;
122
+ padding: 4px 20px 4px 5px;
123
+ width: 100%;
124
+ height: auto;
125
+ outline: 0;
126
+ border: 1px solid #aaa;
127
+ font-size: 1em;
128
+ font-family: sans-serif;
129
+ line-height: normal;
130
+ border-radius: 0;
131
+ }
132
+
133
+ .chosen-container-single .chosen-drop {
134
+ margin-top: -1px;
135
+ border-radius: 0 0 4px 4px;
136
+ background-clip: padding-box;
137
+ }
138
+
139
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
140
+ position: absolute;
141
+ clip: rect(0, 0, 0, 0);
142
+ clip-path: inset(100% 100%);
143
+ }
144
+
145
+ .chosen-container .chosen-results {
146
+ color: #444;
147
+ position: relative;
148
+ overflow-x: hidden;
149
+ overflow-y: auto;
150
+ margin: 0 4px 4px 0;
151
+ padding: 0 0 0 4px;
152
+ max-height: 240px;
153
+ -webkit-overflow-scrolling: touch;
154
+ }
155
+
156
+ .chosen-container .chosen-results li {
157
+ display: none;
158
+ margin: 0;
159
+ padding: 5px 6px;
160
+ list-style: none;
161
+ line-height: 15px;
162
+ word-wrap: break-word;
163
+ -webkit-touch-callout: none;
164
+ }
165
+
166
+ .chosen-container .chosen-results li.active-result {
167
+ display: list-item;
168
+ cursor: pointer;
169
+ }
170
+
171
+ .chosen-container .chosen-results li.disabled-result {
172
+ display: list-item;
173
+ color: #ccc;
174
+ cursor: default;
175
+ }
176
+
177
+ .chosen-container .chosen-results li.highlighted {
178
+ background-color: #3875d7;
179
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
180
+ color: #fff;
181
+ }
182
+
183
+ .chosen-container .chosen-results li.no-results {
184
+ color: #777;
185
+ display: list-item;
186
+ background: #f4f4f4;
187
+ }
188
+
189
+ .chosen-container .chosen-results li.group-result {
190
+ display: list-item;
191
+ font-weight: bold;
192
+ cursor: default;
193
+ }
194
+
195
+ .chosen-container .chosen-results li.group-option {
196
+ padding-left: 15px;
197
+ }
198
+
199
+ .chosen-container .chosen-results li em {
200
+ font-style: normal;
201
+ text-decoration: underline;
202
+ }
203
+
204
+ .chosen-container-multi .chosen-choices {
205
+ position: relative;
206
+ overflow: hidden;
207
+ margin: 0;
208
+ padding: 0 5px;
209
+ width: 100%;
210
+ height: auto;
211
+ border: 1px solid #aaa;
212
+ background-color: #fff;
213
+ background-image: linear-gradient(#eee 1%, #fff 15%);
214
+ cursor: text;
215
+ }
216
+
217
+ .chosen-container-multi .chosen-choices li {
218
+ float: left;
219
+ list-style: none;
220
+ }
221
+
222
+ .chosen-container-multi .chosen-choices li.search-field {
223
+ margin: 0;
224
+ padding: 0;
225
+ white-space: nowrap;
226
+ }
227
+
228
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
229
+ margin: 1px 0;
230
+ padding: 0;
231
+ outline: 0;
232
+ border: 0 !important;
233
+ background: transparent !important;
234
+ box-shadow: none;
235
+ color: #999;
236
+ font-size: 100%;
237
+ font-family: sans-serif;
238
+ line-height: normal;
239
+ border-radius: 0;
240
+ width: 25px;
241
+ height: 25px;
242
+ min-height: 25px;
243
+ }
244
+
245
+ .chosen-container-multi .chosen-choices li.search-choice {
246
+ position: relative;
247
+ margin: 3px 5px 3px 0;
248
+ padding: 3px 20px 3px 6px;
249
+ border: 1px solid #aaa;
250
+ max-width: 100%;
251
+ border-radius: 3px;
252
+ background-color: #eeeeee;
253
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
254
+ background-size: 100% 19px;
255
+ background-repeat: repeat-x;
256
+ background-clip: padding-box;
257
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
258
+ color: #333;
259
+ line-height: 13px;
260
+ cursor: default;
261
+ }
262
+
263
+ .chosen-container-multi .chosen-choices li.search-choice span {
264
+ word-wrap: break-word;
265
+ white-space: nowrap;
266
+ }
267
+
268
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
269
+ position: absolute;
270
+ top: 0;
271
+ right: 0;
272
+ display: block;
273
+ width: 12px;
274
+ height: 12px;
275
+ font-size: 1px;
276
+ }
277
+
278
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
279
+ padding-right: 5px;
280
+ border: 1px solid #ccc;
281
+ background-color: #e4e4e4;
282
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
283
+ color: #666;
284
+ }
285
+
286
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
287
+ background: #d4d4d4;
288
+ }
289
+
290
+ .chosen-container-multi .chosen-results {
291
+ margin: 0;
292
+ padding: 0;
293
+ }
294
+
295
+ .chosen-container-multi .chosen-drop .result-selected {
296
+ display: list-item;
297
+ color: #ccc;
298
+ cursor: default;
299
+ }
300
+
301
+ .chosen-container-active .chosen-single {
302
+ border: 1px solid #5897fb;
303
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
304
+ }
305
+
306
+ .chosen-container-active.chosen-with-drop .chosen-single {
307
+ border: 1px solid #aaa;
308
+ border-bottom-right-radius: 0;
309
+ border-bottom-left-radius: 0;
310
+ background-image: linear-gradient(#eee 20%, #fff 80%);
311
+ box-shadow: 0 1px 0 #fff inset;
312
+ }
313
+
314
+ .chosen-container-active.chosen-with-drop .chosen-single div {
315
+ border-left: none;
316
+ background: transparent;
317
+ }
318
+
319
+ .chosen-container-active .chosen-choices {
320
+ border: 1px solid #5897fb;
321
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
322
+ }
323
+
324
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
325
+ color: #222 !important;
326
+ }
327
+
328
+ .chosen-disabled {
329
+ opacity: 0.5 !important;
330
+ cursor: default;
331
+ }
332
+
333
+ .chosen-disabled .chosen-single {
334
+ cursor: default;
335
+ }
336
+
337
+ .chosen-disabled .chosen-choices .search-choice .search-choice-close {
338
+ cursor: default;
339
+ }
340
+
341
+ .chosen-rtl {
342
+ text-align: right;
343
+ }
344
+
345
+ .chosen-rtl .chosen-single {
346
+ overflow: visible;
347
+ padding: 0 8px 0 0;
348
+ }
349
+
350
+ .chosen-rtl .chosen-single span {
351
+ margin-right: 0;
352
+ margin-left: 26px;
353
+ direction: rtl;
354
+ }
355
+
356
+ .chosen-rtl .chosen-single-with-deselect span {
357
+ margin-left: 38px;
358
+ }
359
+
360
+ .chosen-rtl .chosen-single div {
361
+ right: auto;
362
+ left: 3px;
363
+ }
364
+
365
+ .chosen-rtl .chosen-single abbr {
366
+ right: auto;
367
+ left: 26px;
368
+ }
369
+
370
+ .chosen-rtl .chosen-choices li {
371
+ float: right;
372
+ }
373
+
374
+ .chosen-rtl .chosen-choices li.search-field input[type="text"] {
375
+ direction: rtl;
376
+ }
377
+
378
+ .chosen-rtl .chosen-choices li.search-choice {
379
+ margin: 3px 5px 3px 0;
380
+ padding: 3px 5px 3px 19px;
381
+ }
382
+
383
+ .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
384
+ right: auto;
385
+ left: 4px;
386
+ }
387
+
388
+ .chosen-rtl.chosen-container-single .chosen-results {
389
+ margin: 0 0 4px 4px;
390
+ padding: 0 4px 0 0;
391
+ }
392
+
393
+ .chosen-rtl .chosen-results li.group-option {
394
+ padding-right: 15px;
395
+ padding-left: 0;
396
+ }
397
+
398
+ .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
399
+ border-right: none;
400
+ }
401
+
402
+ .chosen-rtl .chosen-search input[type="text"] {
403
+ padding: 4px 5px 4px 20px;
404
+ direction: rtl;
405
+ }
includes/libs/codestar-framework/assets/scss/vendor/_customizer.scss ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 05. Widget
3
+ */
4
+ .control-section{
5
+
6
+ .csf-field{
7
+ padding: 0;
8
+
9
+ .csf-title{
10
+ float: none;
11
+ width: 100%;
12
+ margin-bottom: 6px;
13
+
14
+ h4{
15
+ display: block;
16
+ font-size: 13px;
17
+ line-height: 1;
18
+ font-weight: 600;
19
+ color: inherit;
20
+ }
21
+ }
22
+
23
+ .csf-fieldset{
24
+ float: none;
25
+ width: 100%;
26
+ }
27
+ }
28
+
29
+ .csf-help{
30
+ top: -5px;
31
+ right: -5px;
32
+ }
33
+
34
+ .csf-field-select select{
35
+ width: 100%;
36
+ }
37
+
38
+ .csf-field-heading{
39
+ color: inherit;
40
+ font-size: 14px;
41
+ line-height: 1em;
42
+ margin-right: -15px;
43
+ margin-left: -15px;
44
+ padding: 15px;
45
+ }
46
+
47
+ .csf-field-subheading{
48
+ color: inherit;
49
+ font-size: 11px;
50
+ margin-right: -15px;
51
+ margin-left: -15px;
52
+ padding: 10px 15px;
53
+ }
54
+
55
+ .csf-subtitle-text{
56
+ margin-top: 4px;
57
+ font-size: 12px;
58
+ }
59
+
60
+ .csf-field-submessage .csf-submessage{
61
+ margin-right: -15px;
62
+ margin-left: -15px;
63
+ padding: 15px;
64
+ }
65
+
66
+ .csf-fieldset{
67
+
68
+ .csf-field-submessage .csf-submessage,
69
+ .csf-field-heading,
70
+ .csf-field-subheading{
71
+ margin-left: 0;
72
+ margin-right: 0;
73
+ }
74
+ }
75
+
76
+ .csf-field-date{
77
+
78
+ .csf--to{
79
+ margin-left: 0;
80
+ }
81
+ }
82
+
83
+ .csf-field-sorter{
84
+
85
+ ul li{
86
+ padding: 5px;
87
+ }
88
+
89
+ .csf-modules{
90
+ float: none;
91
+ width: 100%;
92
+ }
93
+
94
+ .csf-modules:first-child{
95
+ padding-right: 0;
96
+ padding-bottom: 15px;
97
+ }
98
+ }
99
+
100
+ .csf-field-background{
101
+
102
+ .csf--background-attributes{
103
+ flex-direction: column;
104
+ }
105
+ }
106
+
107
+ .csf-field-spacing{
108
+ input{
109
+ width: 90px;
110
+ }
111
+ }
112
+
113
+ .csf-field-border{
114
+
115
+ .csf--input{
116
+ flex: 1 50%;
117
+ }
118
+
119
+ input,
120
+ select{
121
+ width: 100%;
122
+ }
123
+ }
124
+
125
+ .csf-field-spinner{
126
+ input{
127
+ width: 50px;
128
+ }
129
+ }
130
+
131
+ .csf-field-number{
132
+
133
+ .csf--wrap{
134
+ width: 100%;
135
+ }
136
+ }
137
+
138
+ .csf-field-backup{
139
+
140
+ .csf-export-data{
141
+ display: none;
142
+ }
143
+ }
144
+
145
+ .csf-field-fieldset{
146
+
147
+ .csf-fieldset-content{
148
+ border-color: #e5e5e5;
149
+ }
150
+ }
151
+
152
+ .csf-tabbed-content,
153
+ .csf-sortable-content,
154
+ .csf-repeater-content,
155
+ .csf-fieldset-content,
156
+ .csf-cloneable-content,
157
+ .csf-accordion-content{
158
+
159
+ > .csf-field{
160
+ padding: 10px;
161
+
162
+ .csf-title{
163
+ margin-bottom: 5px;
164
+ }
165
+
166
+ h4{
167
+ font-size: 12px;
168
+ }
169
+ }
170
+ }
171
+
172
+ .csf-depend-hidden.csf-depend-on{
173
+ display: none !important;
174
+ }
175
+
176
+ .csf-depend-visible.csf-depend-on{
177
+ border-top: 0 !important;
178
+ }
179
+ }
includes/libs/codestar-framework/assets/scss/vendor/_fields.scss ADDED
@@ -0,0 +1,2237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 03. Fields
3
+ */
4
+ .csf-field{
5
+ position: relative;
6
+ padding: 30px;
7
+
8
+ + .csf-field{
9
+ border-top: 1px solid #eee;
10
+ }
11
+
12
+ p:first-child{
13
+ margin-top: 0;
14
+ }
15
+
16
+ p:last-child{
17
+ margin-bottom: 0;
18
+ }
19
+
20
+ &:after,
21
+ &:before{
22
+ content: " ";
23
+ display: table;
24
+ }
25
+
26
+ &:after{
27
+ clear: both;
28
+ }
29
+
30
+ h4{
31
+ margin-top: 0;
32
+ }
33
+
34
+ .csf-title{
35
+ position: relative;
36
+ width: 20%;
37
+ float: left;
38
+
39
+ h4{
40
+ margin: 0;
41
+ color: #23282d;
42
+ }
43
+ }
44
+
45
+ .csf-fieldset{
46
+ float: right;
47
+ width: calc(80% - 20px);
48
+ }
49
+ }
50
+
51
+ .csf-pseudo-field{
52
+ padding: 0 5px 0 0 !important;
53
+ display: inline-block;
54
+
55
+ + .csf-pseudo-field{
56
+ border: 0;
57
+ }
58
+
59
+ pre{
60
+ display: none;
61
+ }
62
+ }
63
+
64
+ /**
65
+ * 03. 02. Field: accordion
66
+ */
67
+ .csf-field-accordion{
68
+
69
+ .csf-accordion-item{
70
+ position: relative;
71
+ margin-bottom: 5px;
72
+
73
+ &:last-child{
74
+ margin-bottom: 0;
75
+ }
76
+
77
+ h4{
78
+ font-size: 1em;
79
+ }
80
+ }
81
+
82
+ .csf-accordion-title{
83
+ display: block;
84
+ cursor: pointer;
85
+ position: relative;
86
+ margin: 0;
87
+ padding: 15px;
88
+ min-height: 0;
89
+ font-size: 100%;
90
+ user-select: none;
91
+ border: 1px solid #ccd0d4;
92
+ background-color: #fafafa;
93
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
94
+ transition: border-color .15s;
95
+
96
+ &:active,
97
+ &:hover,
98
+ &:focus{
99
+ outline: none;
100
+ border-color: #999;
101
+ }
102
+
103
+ .csf--icon{
104
+ width: 20px;
105
+ text-align: center;
106
+ margin-right: 2px;
107
+ }
108
+ }
109
+
110
+ .csf-accordion-icon{
111
+ width: 16px;
112
+ text-align: center;
113
+ }
114
+
115
+ .csf-accordion-content{
116
+ display: none;
117
+ padding: 0;
118
+ border: 1px solid #ccd0d4;
119
+ border-top: none;
120
+ background-color: #fff;
121
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
122
+
123
+ > .csf-field{
124
+ padding: 15px;
125
+ }
126
+ }
127
+
128
+ .csf-accordion-open{
129
+ display: block;
130
+ }
131
+ }
132
+
133
+ /**
134
+ * 03. 03. Field: background
135
+ */
136
+ .csf-field-background{
137
+
138
+ .csf-field{
139
+ border: 0 !important;
140
+ padding: 0;
141
+ margin-bottom: 6px;
142
+ margin-right: 6px;
143
+ }
144
+
145
+ .csf--title{
146
+ color: #777;
147
+ font-size: 12px;
148
+ }
149
+
150
+ .csf--background-colors{
151
+ display: flex;
152
+ flex-wrap: wrap;
153
+ }
154
+
155
+ .csf--background-attributes{
156
+ display: flex;
157
+ flex-wrap: wrap;
158
+
159
+ select{
160
+ min-width: 100%;
161
+ margin: 0;
162
+ }
163
+
164
+ .csf-field{
165
+ flex: 1;
166
+ }
167
+ }
168
+
169
+ .csf--attributes-hidden{
170
+ display: none;
171
+ }
172
+ }
173
+
174
+ /**
175
+ * 03. 04. Field: backup
176
+ */
177
+ .csf-field-backup{
178
+
179
+ textarea{
180
+ width: 100%;
181
+ min-height: 200px;
182
+ margin-bottom: 5px;
183
+ }
184
+
185
+ small{
186
+ display: inline-block;
187
+ margin: 5px;
188
+ }
189
+
190
+ hr{
191
+ margin: 20px 0;
192
+ border: none;
193
+ border-bottom: 1px solid #e5e5e5;
194
+ }
195
+ }
196
+
197
+ /**
198
+ * 03. 05. Field: border, spacing, dimensions
199
+ */
200
+ .csf-field-border,
201
+ .csf-field-spacing,
202
+ .csf-field-dimensions{
203
+
204
+ .csf--inputs{
205
+ float: left;
206
+ display: flex;
207
+ flex-wrap: wrap;
208
+ }
209
+
210
+ .csf--input{
211
+ display: flex;
212
+ padding-right: 6px;
213
+ padding-bottom: 4px;
214
+ box-sizing: border-box;
215
+
216
+ select{
217
+ margin: 0;
218
+ }
219
+
220
+ input{
221
+ position: relative;
222
+ z-index: 1;
223
+ margin: 0;
224
+ width: 65px;
225
+ max-width: 100%;
226
+ text-align: center;
227
+ }
228
+ }
229
+
230
+ .csf--color{
231
+ float: left;
232
+ }
233
+
234
+ .csf--label{
235
+ display: flex;
236
+ flex-direction: column;
237
+ justify-content: center;
238
+ user-select: none;
239
+ min-width: 20px;
240
+ max-width: 100%;
241
+ padding: 0 4px;
242
+ font-size: 12px;
243
+ text-align: center;
244
+ color: #555;
245
+ border: 1px solid #7B776C;
246
+ background-color: #f5f5f5;
247
+ }
248
+
249
+ .csf--icon{
250
+ border-right: 0;
251
+ border-radius: 4px 0 0 4px;
252
+ }
253
+
254
+ .csf--icon + input{
255
+ border-top-left-radius: 0;
256
+ border-bottom-left-radius: 0;
257
+ }
258
+
259
+ .csf--unit{
260
+ border-left: 0;
261
+ border-radius: 0 4px 4px 0;
262
+ }
263
+
264
+ .csf--is-unit{
265
+ border-top-right-radius: 0;
266
+ border-bottom-right-radius: 0;
267
+ }
268
+ }
269
+
270
+ /**
271
+ * 03. 06. Field: button_set
272
+ */
273
+ .csf-field-button_set{
274
+
275
+ .csf--buttons{
276
+ display: inline-block;
277
+ }
278
+
279
+ .csf--button{
280
+ position: relative;
281
+ z-index: 1;
282
+ float: left;
283
+ cursor: pointer;
284
+ padding: 7px 14px;
285
+ min-width: 40px;
286
+ text-align: center;
287
+ color: #555;
288
+ border: 1px solid #cccccc;
289
+ background-color: #f7f7f7;
290
+ user-select: none;
291
+ -webkit-user-select: none;
292
+ box-shadow: 0 1px 0 rgba(0,0,0,0.1);
293
+
294
+ &:first-child{
295
+ border-radius: 4px 0 0 4px;
296
+ }
297
+
298
+ &:last-child{
299
+ border-radius: 0 4px 4px 0;
300
+ }
301
+
302
+ &:not(:first-child){
303
+ margin-left: -1px;
304
+ }
305
+
306
+ &:hover{
307
+ background-color: #eee;
308
+ }
309
+ }
310
+
311
+ .csf--active:hover,
312
+ .csf--active{
313
+ z-index: 2;
314
+ color: #fff;
315
+ border-color: #006799;
316
+ background-color: #0085ba;
317
+ }
318
+
319
+ input{
320
+ display: none;
321
+ }
322
+ }
323
+
324
+ /**
325
+ * 03. 07. Field: checkbox, radio
326
+ */
327
+ .csf-field-checkbox,
328
+ .csf-field-radio{
329
+
330
+ ul{
331
+ margin: 0;
332
+ padding: 0;
333
+ list-style-type: none;
334
+ overflow-y: auto;
335
+ max-height: 305px;
336
+
337
+ li{
338
+ margin-bottom: 6px;
339
+ }
340
+
341
+ ul{
342
+ max-height: none;
343
+
344
+ li{
345
+ margin-left: 8px;
346
+
347
+ &:first-child{
348
+ margin-left: 0;
349
+ }
350
+ }
351
+ }
352
+ }
353
+
354
+ input{
355
+ margin: 0 1px;
356
+ }
357
+
358
+ .csf--inline-list li{
359
+ display: inline-block;
360
+ margin-right: 15px;
361
+ }
362
+
363
+ .csf--text{
364
+ margin-left: 5px;
365
+ vertical-align: middle;
366
+ }
367
+
368
+ .csf-checker{
369
+ cursor: pointer;
370
+ }
371
+ }
372
+
373
+ /**
374
+ * 03. 08. Field: code_editor
375
+ */
376
+ .csf-field-code_editor{
377
+
378
+ .CodeMirror{
379
+ width: 100%;
380
+ height: 400px;
381
+ }
382
+
383
+ .cm-s-default{
384
+ border: 1px solid #ccd0d4;
385
+ }
386
+
387
+ textarea{
388
+ width: 100%;
389
+ height: 400px;
390
+ }
391
+ }
392
+
393
+ /**
394
+ * 03. 09. Field: color
395
+ */
396
+ .csf-field-color{
397
+
398
+ > input{
399
+ opacity: 0.75;
400
+ width: 115px;
401
+ max-width: 100%;
402
+ }
403
+
404
+ .button.wp-picker-clear{
405
+ padding: 0 8px;
406
+ margin-left: 6px;
407
+ line-height: 2.54545455;
408
+ min-height: 30px;
409
+ }
410
+ }
411
+
412
+ /**
413
+ * 03. 10. Field: color_group
414
+ */
415
+ .csf-field-color_group{
416
+
417
+ .csf--left{
418
+ float: left;
419
+ margin-right: 10px;
420
+ margin-bottom: 5px;
421
+ }
422
+
423
+ .csf--title{
424
+ color: #999;
425
+ margin-bottom: 5px;
426
+ }
427
+ }
428
+
429
+ /**
430
+ * 03. 11. Field: fieldset
431
+ */
432
+ .csf-field-fieldset{
433
+
434
+ .csf-fieldset-content{
435
+ border: 1px solid #ccd0d4;
436
+ background-color: #fff;
437
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
438
+
439
+ > .csf-field{
440
+ padding: 15px;
441
+ }
442
+ }
443
+
444
+ .csf-field-subheading{
445
+ font-size: 13px;
446
+ }
447
+ }
448
+
449
+ /**
450
+ * 03. 12. Field: date
451
+ */
452
+ .csf-field-date{
453
+
454
+ input{
455
+ margin: 0;
456
+ }
457
+
458
+ .csf--to{
459
+ margin-left: 7px;
460
+ }
461
+ }
462
+
463
+ .csf-datepicker-wrapper{
464
+ margin-top: 5px;
465
+ width: auto;
466
+ background-color: #fff;
467
+ z-index: 9999999 !important;
468
+ @include box-shadow(0 0 30px rgba(black, 0.15));
469
+
470
+ *{
471
+ float: none;
472
+ margin: 0;
473
+ padding: 0;
474
+ font-family: inherit;
475
+ font-weight: normal;
476
+ font-style: normal;
477
+ text-decoration: none;
478
+ border: 0;
479
+ border-radius: 0;
480
+ box-shadow: none;
481
+ }
482
+
483
+ .ui-widget-header,
484
+ .ui-datepicker-header{
485
+ color: #fff;
486
+ background: #00a0d2;
487
+ }
488
+
489
+ .ui-datepicker-header .ui-state-hover{
490
+ cursor: pointer;
491
+ }
492
+
493
+ .ui-datepicker-title{
494
+ font-size: 14px;
495
+ line-height: 40px;
496
+ text-align: center;
497
+ }
498
+
499
+ .ui-datepicker-prev,
500
+ .ui-datepicker-next{
501
+ position: static;
502
+ top: auto;
503
+ left: auto;
504
+ right: auto;
505
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
506
+ font-weight: 900;
507
+ font-size: 12px;
508
+ text-align: center;
509
+ width: 41px;
510
+ height: 40px;
511
+ line-height: 40px;
512
+ color: #fff;
513
+ background-color: rgba(white, 0.1);
514
+ text-rendering: auto;
515
+ -webkit-font-smoothing: antialiased;
516
+ -moz-osx-font-smoothing: grayscale;
517
+ }
518
+
519
+ .ui-datepicker-next span,
520
+ .ui-datepicker-prev span{
521
+ display: none;
522
+ }
523
+
524
+ .ui-datepicker-prev{
525
+ float: left;
526
+ }
527
+
528
+ .ui-datepicker-next{
529
+ float: right;
530
+ }
531
+
532
+ .ui-datepicker-prev:before{
533
+ content: '\f053';
534
+ }
535
+
536
+ .ui-datepicker-next:before{
537
+ content: '\f054';
538
+ }
539
+
540
+ .ui-datepicker-prev-hover,
541
+ .ui-datepicker-next-hover{
542
+ opacity: 0.75;
543
+ }
544
+
545
+ tbody .ui-datepicker-week-col{
546
+ background-color: #f7f7f7;
547
+ }
548
+
549
+ .ui-datepicker-buttonpane{
550
+ padding: 10px;
551
+ text-align: center;
552
+ background-color: #f7f7f7;
553
+ }
554
+
555
+ .ui-datepicker-buttonpane button{
556
+ cursor: pointer;
557
+ margin: 0 5px;
558
+ padding: 7px 14px;
559
+ border: 1px solid #eee;
560
+ background-color: #fff;
561
+ }
562
+
563
+ select{
564
+ margin: 0 4px;
565
+ }
566
+
567
+ select option{
568
+ color: #555;
569
+ }
570
+
571
+ table{
572
+ font-size: 13px;
573
+ border-collapse: collapse;
574
+ width: 100%;
575
+ }
576
+
577
+ thead{
578
+ color: #fff;
579
+ background: #32373c;
580
+ }
581
+
582
+ th{
583
+ text-align: center;
584
+ padding: 7px;
585
+ border: 1px solid #444;
586
+ }
587
+
588
+ td{
589
+ text-align: center;
590
+ border: 1px solid #f4f4f4;
591
+ }
592
+
593
+ td.ui-datepicker-other-month{
594
+ border: transparent;
595
+ }
596
+
597
+ td .ui-state-default{
598
+ color: #555;
599
+ width: auto;
600
+ display: block;
601
+ padding: 6px 12px;
602
+ }
603
+
604
+ td .ui-state-active,
605
+ td .ui-state-hover{
606
+ color: #fff;
607
+ background-color: #0073aa;
608
+ }
609
+
610
+ td.ui-state-disabled .ui-state-default{
611
+ opacity: 0.5;
612
+ }
613
+ }
614
+
615
+ /**
616
+ * 03. 13. Field: gallery
617
+ */
618
+ .csf-field-gallery{
619
+
620
+ input{
621
+ display: none;
622
+ }
623
+
624
+ ul{
625
+ margin: 0;
626
+ padding: 0;
627
+ list-style-type: none;
628
+
629
+ li{
630
+ display: inline-block;
631
+ position: relative;
632
+ padding: 4px;
633
+ margin: 0 5px 10px 0;
634
+ border: 1px solid #ccc;
635
+ background-color: #f9f9f9;
636
+ @include border-radius(2px);
637
+ @include box-shadow(0 1px 0 rgba(black, 0.08));
638
+
639
+ img{
640
+ max-height: 60px;
641
+ display: inline-block;
642
+ vertical-align: middle;
643
+ }
644
+ }
645
+ }
646
+
647
+ .button{
648
+ margin-right: 5px;
649
+ margin-bottom: 5px;
650
+ }
651
+ }
652
+
653
+ /**
654
+ * 03. 14. Field: group
655
+ */
656
+ .csf-field-group{
657
+
658
+ .csf-cloneable-hidden{
659
+ display: none !important;
660
+ }
661
+
662
+ .csf-cloneable-wrapper{
663
+ position: relative;
664
+ }
665
+
666
+ .csf-cloneable-item{
667
+ display: none;
668
+ position: relative;
669
+ margin-bottom: 5px;
670
+
671
+ h4{
672
+ font-size: 1em;
673
+ }
674
+ }
675
+
676
+ .ui-accordion .csf-cloneable-item{
677
+ display: block;
678
+ }
679
+
680
+ .csf-cloneable-content{
681
+ border: 1px solid #ccd0d4;
682
+ background-color: #fff;
683
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
684
+
685
+ > .csf-field{
686
+ padding: 15px;
687
+ }
688
+ }
689
+
690
+ .csf-cloneable-title{
691
+ display: block;
692
+ cursor: pointer;
693
+ position: relative;
694
+ user-select: none;
695
+ margin: 0;
696
+ padding: 15px 65px 15px 10px;
697
+ min-height: 0;
698
+ font-size: 100%;
699
+ border: 1px solid #ccd0d4;
700
+ background-color: #fafafa;
701
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
702
+ transition: border-color .15s;
703
+
704
+ &:active,
705
+ &:hover,
706
+ &:focus{
707
+ border-color: #999;
708
+ outline: none;
709
+ }
710
+ }
711
+
712
+ .csf-cloneable-helper{
713
+ position: absolute;
714
+ top: 12px;
715
+ right: 10px;
716
+ z-index: 1;
717
+ font-size: 14px;
718
+ line-height: 1em;
719
+
720
+ i{
721
+ display: inline-block;
722
+ cursor: pointer;
723
+ padding: 5px;
724
+ color: #999;
725
+
726
+ &:hover{
727
+ color: #555;
728
+ }
729
+ }
730
+ }
731
+
732
+ .csf-cloneable-content{
733
+ padding: 0;
734
+ border-top: 0;
735
+ }
736
+
737
+ .csf-cloneable-title-prefix,
738
+ .csf-cloneable-title-number{
739
+ margin-right: 5px;
740
+ }
741
+
742
+ .csf-cloneable-alert{
743
+ display: none;
744
+ margin-bottom: 5px;
745
+ padding: 10px 20px;
746
+ color: #a94442;
747
+ border: 1px solid #ebccd1;
748
+ background-color: #f2dede;
749
+ }
750
+
751
+ .widget-placeholder{
752
+ margin-bottom: 10px;
753
+ border: 1px dashed #f1c40f;
754
+ background-color: #fffae4;
755
+ }
756
+
757
+ .csf-cloneable-header-icon{
758
+ display: inline-block;
759
+ text-align: center;
760
+ font-size: 14px;
761
+ width: 17px;
762
+ text-indent: 0;
763
+ vertical-align: text-top;
764
+ }
765
+
766
+ .csf-cloneable-placeholder{
767
+ background-color: #ddd;
768
+ margin-top: 4px;
769
+ width: 100px;
770
+ height: 10px;
771
+ font-size: 10px;
772
+ line-height: 10px;
773
+ display: inline-block;
774
+ vertical-align: top;
775
+ border-radius: 2px;
776
+ }
777
+ }
778
+
779
+ /**
780
+ * 03. 15. Field: icon
781
+ */
782
+ .csf-field-icon{
783
+
784
+ input{
785
+ display: none;
786
+ }
787
+
788
+ .button{
789
+ margin-right: 5px;
790
+ }
791
+
792
+ .csf-icon-preview{
793
+
794
+ i{
795
+ display: inline-block;
796
+ font-size: 16px;
797
+ width: 30px;
798
+ height: 28px;
799
+ line-height: 28px;
800
+ margin-right: 5px;
801
+ text-align: center;
802
+ vertical-align: top;
803
+ color: #555;
804
+ border: 1px solid #ccc;
805
+ background-color: #f7f7f7;
806
+ @include border-radius(3px);
807
+ @include box-shadow(0 1px 0 rgba(black, 0.08));
808
+ @include box-sizing(content-box);
809
+ }
810
+ }
811
+ }
812
+
813
+ /**
814
+ * 03. 16. Field: image_select
815
+ */
816
+ .csf-field-image_select{
817
+
818
+ .csf--image{
819
+ cursor: pointer;
820
+ position: relative;
821
+ display: inline-block;
822
+ max-width: 100%;
823
+ margin: 0 5px 5px 0;
824
+ vertical-align: bottom;
825
+ border: 2px solid transparent;
826
+ background-color: #fff;
827
+ user-select: none;
828
+ -webkit-user-select: none;
829
+ @include transition(all 0.2s);
830
+
831
+ &:before{
832
+ position: absolute;
833
+ top: 0;
834
+ left: 0;
835
+ text-align: center;
836
+ font-size: 10px;
837
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
838
+ font-weight: 900;
839
+ content: "\f00c";
840
+ width: 16px;
841
+ height: 16px;
842
+ line-height: 14px;
843
+ opacity: 0;
844
+ color: #fff;
845
+ background-color: #222;
846
+ transition: opacity .2s;
847
+ }
848
+ }
849
+
850
+ .csf--active{
851
+ border-color: #222;
852
+ box-shadow: 0 0 20px rgba(0,0,0,0.2);
853
+
854
+ &:before{
855
+ opacity: 1;
856
+ }
857
+ }
858
+
859
+ img{
860
+ vertical-align: top;
861
+ }
862
+
863
+ input{
864
+ display: none;
865
+ }
866
+ }
867
+
868
+ /**
869
+ * 03. 17. Field: link_color
870
+ */
871
+ .csf-field-link_color{
872
+
873
+ .csf--left{
874
+ float: left;
875
+ margin-right: 10px;
876
+ margin-bottom: 5px;
877
+ }
878
+
879
+ .csf--title{
880
+ color: #777;
881
+ margin-bottom: 5px;
882
+ }
883
+ }
884
+
885
+ /**
886
+ * 03. 18. Field: map
887
+ */
888
+ .csf-field-map{
889
+
890
+ input{
891
+ width: 100%;
892
+ }
893
+
894
+ input[type="text"].ui-autocomplete-loading{
895
+ background-position-x: calc(100% - 5px);
896
+ }
897
+
898
+ .csf--map-search + .csf--map-osm-wrap{
899
+ margin-top: 10px;
900
+ }
901
+
902
+ .csf--map-osm-wrap{
903
+ position: relative;
904
+ padding: 5px;
905
+ border: 1px solid #eee;
906
+ background-color: #fff;
907
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
908
+ }
909
+
910
+ .csf--map-osm{
911
+ position: relative;
912
+ z-index: 1;
913
+ min-height: 250px;
914
+ }
915
+
916
+ .csf--map-inputs{
917
+ margin-top: 10px;
918
+ display: flex;
919
+ justify-content: space-between;
920
+ }
921
+
922
+ .csf--map-input{
923
+ flex: 1;
924
+
925
+ &:last-child{
926
+ padding-left: 10px;
927
+ }
928
+ }
929
+
930
+ label{
931
+ display: block;
932
+ color: #777;
933
+ font-size: 12px;
934
+ margin: 0 0 2px 0;
935
+ }
936
+ }
937
+
938
+ .csf-map-ui-autocomplate{
939
+ z-index: 999999;
940
+ border-radius: 4px;
941
+ overflow: hidden;
942
+ }
943
+
944
+
945
+ /**
946
+ * 03. 19. Field: media
947
+ */
948
+ .csf-field-media{
949
+
950
+ .csf--placeholder{
951
+ display: flex;
952
+ align-items: flex-start;
953
+
954
+ input{
955
+ width: 100%;
956
+ margin: 0;
957
+ }
958
+ }
959
+
960
+ .button{
961
+ margin-left: 5px;
962
+ }
963
+
964
+ .hidden + .button{
965
+ margin-left: 0;
966
+ }
967
+
968
+ .csf--preview{
969
+ position: relative;
970
+
971
+ .fa-times{
972
+ position: absolute;
973
+ z-index: 1;
974
+ right: 4px;
975
+ top: 4px;
976
+ font-size: 14px;
977
+ width: 22px;
978
+ height: 22px;
979
+ line-height: 22px;
980
+ text-align: center;
981
+ text-decoration: none;
982
+ color: #fff;
983
+ background-color: #dd3333;
984
+ opacity: 0.8;
985
+ transition: all .2s;
986
+
987
+ &:hover{
988
+ opacity: 1;
989
+ }
990
+
991
+ &:focus{
992
+ box-shadow: none;
993
+ }
994
+ }
995
+ }
996
+ }
997
+
998
+ /**
999
+ * 03. 20. Field: palette
1000
+ */
1001
+ .csf-field-palette{
1002
+
1003
+ .csf--palette{
1004
+ position: relative;
1005
+ display: inline-block;
1006
+ cursor: pointer;
1007
+ border: 2px solid #ddd;
1008
+ margin-right: 10px;
1009
+ margin-bottom: 10px;
1010
+ user-select: none;
1011
+ -webkit-user-select: none;
1012
+ transition: all .2s;
1013
+
1014
+ span{
1015
+ vertical-align: middle;
1016
+ display: inline-block;
1017
+ width: 22px;
1018
+ height: 60px;
1019
+ line-height: 60px;
1020
+ overflow: hidden;
1021
+ text-indent: -999px;
1022
+ }
1023
+
1024
+ &:before{
1025
+ position: absolute;
1026
+ top: 0;
1027
+ left: 0;
1028
+ text-align: center;
1029
+ font-size: 10px;
1030
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1031
+ font-weight: 900;
1032
+ content: "\f00c";
1033
+ width: 16px;
1034
+ height: 16px;
1035
+ line-height: 14px;
1036
+ opacity: 0;
1037
+ color: #fff;
1038
+ background-color: #222;
1039
+ transition: opacity .2s;
1040
+ }
1041
+ }
1042
+
1043
+ .csf--active{
1044
+ border-color: #222;
1045
+ box-shadow: 0 0 20px rgba(0,0,0,0.2);
1046
+
1047
+ &:before{
1048
+ opacity: 1;
1049
+ }
1050
+ }
1051
+
1052
+ input{
1053
+ display: none;
1054
+ }
1055
+ }
1056
+
1057
+ /**
1058
+ * 03. 21. Field: repeater
1059
+ */
1060
+ .csf-field-repeater{
1061
+
1062
+ .csf-field-text input{
1063
+ width: 100%;
1064
+ }
1065
+
1066
+ .csf-repeater-hidden{
1067
+ display: none !important;
1068
+ }
1069
+
1070
+ .csf-repeater-wrapper{
1071
+
1072
+ .csf-repeater-item{
1073
+ display: table;
1074
+ width: 100%;
1075
+ margin-bottom: 5px;
1076
+ border: 1px solid #eee;
1077
+
1078
+ h4{
1079
+ font-size: 1em;
1080
+ }
1081
+ }
1082
+ }
1083
+
1084
+ .csf-repeater-content{
1085
+ width: 100%;
1086
+ display: table-cell;
1087
+ vertical-align: middle;
1088
+ background-color: #fff;
1089
+
1090
+ > .csf-field{
1091
+ padding: 15px;
1092
+ }
1093
+ }
1094
+
1095
+ .csf-repeater-helper{
1096
+ width: 100%;
1097
+ display: table-cell;
1098
+ vertical-align: middle;
1099
+ text-align: center;
1100
+ font-size: 14px;
1101
+ line-height: 1em;
1102
+ border-left: 1px solid #eee;
1103
+ background-color: #f7f7f7;
1104
+
1105
+ i{
1106
+ display: inline-block;
1107
+ cursor: pointer;
1108
+ color: #999;
1109
+ padding: 5px;
1110
+
1111
+ &:hover{
1112
+ color: #555;
1113
+ }
1114
+ }
1115
+ }
1116
+
1117
+ .csf-repeater-helper-inner{
1118
+ width: 75px;
1119
+ }
1120
+
1121
+ .csf-repeater-alert{
1122
+ display: none;
1123
+ margin-bottom: 5px;
1124
+ padding: 10px 20px;
1125
+ color: #a94442;
1126
+ border: 1px solid #ebccd1;
1127
+ background-color: #f2dede;
1128
+ }
1129
+
1130
+ .widget-placeholder{
1131
+ height: 50px;
1132
+ margin-bottom: 3px;
1133
+ border: 1px dashed #f1c40f;
1134
+ background-color: #fffae4;
1135
+ }
1136
+
1137
+ .ui-sortable-helper{
1138
+ height: 50px !important;
1139
+ overflow: hidden !important;
1140
+ border-color: #ccc !important;
1141
+ background-color: #eee !important;
1142
+ @include opacity(0.5);
1143
+
1144
+ .csf-repeater-helper,
1145
+ .csf-repeater-content{
1146
+ display: none;
1147
+ }
1148
+ }
1149
+ }
1150
+
1151
+ /**
1152
+ * 03. 22. Field: select
1153
+ */
1154
+ .csf-field-select{
1155
+
1156
+ .csf-fieldset{
1157
+ min-height: 30px;
1158
+ }
1159
+
1160
+ .csf-chosen{
1161
+ display: none;
1162
+ }
1163
+
1164
+ select{
1165
+ max-width: 100%;
1166
+ margin: 0;
1167
+ }
1168
+ }
1169
+
1170
+ /**
1171
+ * 03. 23. Field: slider
1172
+ */
1173
+ .csf-field-slider{
1174
+
1175
+ .csf--wrap{
1176
+ display: flex;
1177
+ align-items: center;
1178
+ }
1179
+
1180
+ .csf--input{
1181
+ display: flex;
1182
+ }
1183
+
1184
+ .csf--unit{
1185
+ display: flex;
1186
+ justify-content: center;
1187
+ flex-direction: column;
1188
+ user-select: none;
1189
+ padding: 0 6px;
1190
+ font-size: 11px;
1191
+ line-height: 1;
1192
+ border-radius: 0 4px 4px 0;
1193
+ color: #555;
1194
+ border: 1px solid #7e8993;
1195
+ border-left: 0;
1196
+ background-color: #f5f5f5;
1197
+ }
1198
+
1199
+ .csf-slider-ui{
1200
+ margin-right: 15px;
1201
+ }
1202
+
1203
+ input[type=number]{
1204
+ position: relative;
1205
+ z-index: 1;
1206
+ margin: 0;
1207
+ width: 50px;
1208
+ text-align: center;
1209
+ }
1210
+
1211
+ .csf--is-unit{
1212
+ border-top-right-radius: 0;
1213
+ border-bottom-right-radius: 0;
1214
+ }
1215
+
1216
+ .ui-slider{
1217
+ position: relative;
1218
+ width: 100%;
1219
+ height: 3px;
1220
+ border: none;
1221
+ background: #ddd;
1222
+ border-radius: 2px;
1223
+ }
1224
+
1225
+ .ui-slider-range{
1226
+ height: 3px;
1227
+ border: none;
1228
+ background: #333;
1229
+ border-radius: 2px;
1230
+ }
1231
+
1232
+ .ui-slider-handle{
1233
+ position: absolute;
1234
+ width: 16px;
1235
+ height: 16px;
1236
+ top: -7px;
1237
+ margin-left: -8px;
1238
+ border: none;
1239
+ background: #333;
1240
+ border-radius: 2px;
1241
+ }
1242
+
1243
+ .ui-state-active,
1244
+ .ui-slider-handle:hover{
1245
+ cursor: pointer;
1246
+ background: #111;
1247
+ }
1248
+ }
1249
+
1250
+ /**
1251
+ * 03. 24. Field: sortable
1252
+ */
1253
+ .csf-field-sortable{
1254
+
1255
+ .csf-field-text{
1256
+
1257
+ input{
1258
+ width: 100%;
1259
+ max-width: 100%;
1260
+ }
1261
+ }
1262
+
1263
+ .csf-sortable{
1264
+
1265
+ .csf-sortable-item{
1266
+ display: table;
1267
+ width: 100%;
1268
+ margin-bottom: 5px;
1269
+ border: 1px solid #eee;
1270
+
1271
+ h4{
1272
+ font-size: 1em;
1273
+ }
1274
+ }
1275
+ }
1276
+
1277
+ .csf-sortable-content{
1278
+ width: 100%;
1279
+ display: table-cell;
1280
+ vertical-align: middle;
1281
+ background-color: #fff;
1282
+
1283
+ > .csf-field{
1284
+ padding: 15px;
1285
+ }
1286
+ }
1287
+
1288
+ .csf-sortable-helper{
1289
+ width: 100%;
1290
+ display: table-cell;
1291
+ vertical-align: middle;
1292
+ text-align: center;
1293
+ font-size: 14px;
1294
+ line-height: 1em;
1295
+ border-left: 1px solid #eee;
1296
+ background-color: #f7f7f7;
1297
+
1298
+ i{
1299
+ display: inline-block;
1300
+ cursor: pointer;
1301
+ width: 50px;
1302
+ color: #555;
1303
+
1304
+ &:hover{
1305
+ @include opacity(0.5);
1306
+ }
1307
+ }
1308
+ }
1309
+
1310
+ .widget-placeholder{
1311
+ height: 50px;
1312
+ margin-bottom: 3px;
1313
+ border: 1px dashed #f1c40f;
1314
+ background-color: #fffae4;
1315
+ }
1316
+
1317
+ .ui-sortable-helper{
1318
+ height: 50px !important;
1319
+ overflow: hidden !important;
1320
+ border-color: #ccc !important;
1321
+ background-color: #eee !important;
1322
+ @include opacity(0.5);
1323
+
1324
+ .csf-sortable-helper,
1325
+ .csf-sortable-content{
1326
+ display: none;
1327
+ }
1328
+ }
1329
+ }
1330
+
1331
+ /**
1332
+ * 03. 25. Field: sorter
1333
+ */
1334
+ .csf-field-sorter{
1335
+
1336
+ .ui-sortable-placeholder{
1337
+ height: 20px;
1338
+ border: 1px dashed #f1c40f;
1339
+ background-color: #fffae4;
1340
+ }
1341
+
1342
+ .csf-modules{
1343
+ float: left;
1344
+ width: 50%;
1345
+ box-sizing: border-box;
1346
+
1347
+ &:first-child{
1348
+ padding-right: 15px;
1349
+ }
1350
+
1351
+ &:last-child{
1352
+ padding-left: 15px;
1353
+ }
1354
+ }
1355
+
1356
+ .csf-disabled,
1357
+ .csf-enabled{
1358
+ padding: 5px 15px;
1359
+ border: 1px dashed #ddd;
1360
+ background-color: #fff;
1361
+ }
1362
+
1363
+ .csf-disabled{
1364
+ li{
1365
+ @include transition(opacity 0.15s);
1366
+ @include opacity(0.5);
1367
+ }
1368
+
1369
+ .ui-sortable-helper{
1370
+ @include opacity(1);
1371
+ }
1372
+ }
1373
+
1374
+ .csf-sorter-title{
1375
+ font-size: 13px;
1376
+ font-weight: 600;
1377
+ padding: 10px;
1378
+ text-align: center;
1379
+ border: 1px dashed #ddd;
1380
+ border-bottom: none;
1381
+ background-color: #f8f8f8;
1382
+ text-transform: uppercase;
1383
+ }
1384
+
1385
+ ul{
1386
+ list-style-type: none;
1387
+ margin: 0;
1388
+ padding: 0;
1389
+ min-height: 62px;
1390
+
1391
+ li{
1392
+ margin: 10px 0;
1393
+ padding: 10px 15px;
1394
+ cursor: move;
1395
+ font-weight: bold;
1396
+ text-align: center;
1397
+ border: 1px solid #e5e5e5;
1398
+ background-color: #fafafa;
1399
+ @include transition(border-color 0.15s);
1400
+
1401
+ &:hover{
1402
+ border-color: #bbb;
1403
+ }
1404
+ }
1405
+ }
1406
+ }
1407
+
1408
+ /**
1409
+ * 03. 26. Field: spinner
1410
+ */
1411
+ .csf-field-spinner{
1412
+
1413
+ .csf--spin{
1414
+ display: flex;
1415
+ }
1416
+
1417
+ .ui-spinner{
1418
+ display: flex;
1419
+ }
1420
+
1421
+ .ui-button-text-only{
1422
+ display: flex;
1423
+ flex-direction: column;
1424
+ justify-content: center;
1425
+ text-align: center;
1426
+ min-width: 20px;
1427
+ padding: 0 4px;
1428
+ color: #555;
1429
+ border: 1px solid #7e8993;
1430
+ background-color: #f5f5f5;
1431
+ }
1432
+
1433
+ .ui-button{
1434
+ cursor: pointer;
1435
+
1436
+ &:hover{
1437
+ background-color: #e7e7e7;
1438
+ }
1439
+
1440
+ &:active{
1441
+ background-color: #ddd;
1442
+ }
1443
+
1444
+ &:before{
1445
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
1446
+ font-weight: 900;
1447
+ font-size: 14px;
1448
+ line-height: 14px;
1449
+ }
1450
+ }
1451
+
1452
+ .ui-spinner-down{
1453
+ order: 1;
1454
+ border-right: 0;
1455
+ border-radius: 4px 0 0 4px;
1456
+
1457
+ &:before{
1458
+ content: "\f0d9";
1459
+ }
1460
+ }
1461
+
1462
+ .ui-spinner-input{
1463
+ order: 2;
1464
+ }
1465
+
1466
+ .csf--unit{
1467
+ order: 3;
1468
+ border-left: 0;
1469
+ user-select: none;
1470
+ }
1471
+
1472
+ .ui-spinner-up{
1473
+ order: 4;
1474
+ border-left: 0;
1475
+ border-radius: 0 4px 4px 0;
1476
+
1477
+ &:before{
1478
+ content: "\f0da";
1479
+ }
1480
+ }
1481
+
1482
+ input{
1483
+ position: relative;
1484
+ z-index: 1;
1485
+ width: 50px;
1486
+ text-align: center;
1487
+ margin: 0;
1488
+ padding: 0 8px;
1489
+ border-radius: 0;
1490
+ }
1491
+
1492
+ .ui-button-text{
1493
+ display: none;
1494
+ }
1495
+ }
1496
+
1497
+ /**
1498
+ * 03. 27. Field: switcher
1499
+ */
1500
+ .csf-field-switcher{
1501
+
1502
+ .csf--switcher{
1503
+ float: left;
1504
+ cursor: pointer;
1505
+ position: relative;
1506
+ width: 60px;
1507
+ height: 26px;
1508
+ padding: 0;
1509
+ margin: 0;
1510
+ overflow: hidden;
1511
+ border-radius: 4px;
1512
+ background-color: #ed6f6f;
1513
+ user-select: none;
1514
+ -webkit-user-select: none;
1515
+ }
1516
+
1517
+ .csf--ball{
1518
+ position: absolute;
1519
+ top: 4px;
1520
+ left: 4px;
1521
+ width: 24px;
1522
+ height: 18px;
1523
+ background-color: #fff;
1524
+ border-radius: 4px;
1525
+ transition: all .1s;
1526
+ box-shadow: 1px 1px 1px rgba(0,0,0,0.15);
1527
+ }
1528
+
1529
+ .csf--on,
1530
+ .csf--off{
1531
+ position: absolute;
1532
+ top: 0;
1533
+ left: 0;
1534
+ right: 0;
1535
+ font-size: 11px;
1536
+ line-height: 26px;
1537
+ font-weight: 500;
1538
+ font-style: normal;
1539
+ text-align: center;
1540
+ text-transform: uppercase;
1541
+ color: #fff;
1542
+ padding-right: 28px;
1543
+ opacity: 0;
1544
+ transition: all .1s;
1545
+ }
1546
+
1547
+ .csf--off{
1548
+ padding-right: 0;
1549
+ padding-left: 28px;
1550
+ opacity: 1;
1551
+ }
1552
+
1553
+ .csf--active{
1554
+ background: #4fb845;
1555
+
1556
+ .csf--on{
1557
+ opacity: 1;
1558
+ }
1559
+
1560
+ .csf--off{
1561
+ opacity: 0;
1562
+ }
1563
+
1564
+ .csf--ball{
1565
+ left: 100%;
1566
+ margin-left: -28px;
1567
+ }
1568
+ }
1569
+
1570
+ .csf--label{
1571
+ float: left;
1572
+ margin-top: 4px;
1573
+ margin-left: 8px;
1574
+ font-weight: 400;
1575
+ color: #999;
1576
+ }
1577
+
1578
+ input{
1579
+ display: none;
1580
+ }
1581
+ }
1582
+
1583
+ /**
1584
+ * 03. 28. Field: tabbed
1585
+ */
1586
+ .csf-field-tabbed{
1587
+
1588
+ .csf-tabbed-content{
1589
+ border: 1px solid #ccd0d4;
1590
+ background-color: #fff;
1591
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
1592
+
1593
+ > .csf-field{
1594
+ padding: 15px;
1595
+ }
1596
+ }
1597
+
1598
+ .csf-tabbed-nav{
1599
+
1600
+ .csf--icon{
1601
+ padding-right: 5px;
1602
+ }
1603
+
1604
+ a{
1605
+ display: inline-block;
1606
+ padding: 12px 15px;
1607
+ margin-top: 1px;
1608
+ margin-right: 5px;
1609
+ margin-bottom: -1px;
1610
+ position: relative;
1611
+ text-decoration: none;
1612
+ color: #444;
1613
+ font-weight: 600;
1614
+ border: 1px solid #ccd0d4;
1615
+ background-color: #f3f3f3;
1616
+ transition: all .2s;
1617
+
1618
+ &:hover{
1619
+ background-color: #f9f9f9;
1620
+ }
1621
+
1622
+ &.csf-tabbed-active{
1623
+ background-color: #fff;
1624
+ border-bottom-color: #fff;
1625
+ }
1626
+
1627
+ &:focus{
1628
+ outline: none;
1629
+ @include box-shadow(none);
1630
+ }
1631
+ }
1632
+ }
1633
+ }
1634
+
1635
+ /**
1636
+ * 03. 29. Field: text
1637
+ */
1638
+ .csf-field-text{
1639
+
1640
+ input{
1641
+ width: 50%;
1642
+ max-width: 100%;
1643
+ margin: 0;
1644
+ }
1645
+ }
1646
+
1647
+ /**
1648
+ * 03. 30. Field: textarea
1649
+ */
1650
+ .csf-field-textarea{
1651
+
1652
+ textarea{
1653
+ width: 100%;
1654
+ max-width: 100%;
1655
+ min-height: 125px;
1656
+ }
1657
+
1658
+ .csf-shortcode-button{
1659
+ margin-bottom: 10px;
1660
+ margin-right: 5px;
1661
+ }
1662
+ }
1663
+
1664
+ /**
1665
+ * 03. 31. Field: typography
1666
+ */
1667
+ .csf-field-typography{
1668
+
1669
+ textarea,
1670
+ select{
1671
+ min-width: 100%;
1672
+ margin: 0;
1673
+ }
1674
+
1675
+ .csf--title{
1676
+ color: #777;
1677
+ margin: 0 0 2px 0;
1678
+ font-size: 12px;
1679
+
1680
+ small{
1681
+ vertical-align: top;
1682
+ }
1683
+ }
1684
+
1685
+ .csf--blocks{
1686
+ display: flex;
1687
+ flex-wrap: wrap;
1688
+ }
1689
+
1690
+ .csf--block{
1691
+ flex: 1;
1692
+ padding-right: 6px;
1693
+ padding-bottom: 6px;
1694
+ }
1695
+
1696
+ .csf--input{
1697
+ margin: 0;
1698
+ min-width: 100%;
1699
+ }
1700
+
1701
+ .csf--input-wrap{
1702
+ position: relative;
1703
+ }
1704
+
1705
+ .csf--unit{
1706
+ position: absolute;
1707
+ z-index: 1;
1708
+ right: 4px;
1709
+ top: 4px;
1710
+ bottom: 4px;
1711
+ padding: 2px 6px;
1712
+ color: #666;
1713
+ font-size: 11px;
1714
+ line-height: 1;
1715
+ border-radius: 2px;
1716
+ background: #eee;
1717
+ user-select: none;
1718
+ display: flex;
1719
+ justify-content: center;
1720
+ flex-direction: column;
1721
+ }
1722
+
1723
+ .csf--preview{
1724
+ font-size: 16px;
1725
+ line-height: 20px;
1726
+ padding: 20px;
1727
+ color: #222;
1728
+ border: 1px solid #eee;
1729
+ background-color: #fff;
1730
+ border-radius: 2.5px;
1731
+ user-select: none;
1732
+ -webkit-user-select: none;
1733
+ transition: background-color .2s, border-color .2s;
1734
+ }
1735
+
1736
+ .csf--block-preview{
1737
+ cursor: pointer;
1738
+ position: relative;
1739
+ overflow: hidden;
1740
+ margin-top: 10px;
1741
+ max-width: 100%;
1742
+ }
1743
+
1744
+ .csf--black-background{
1745
+ border-color: #000;
1746
+ background-color: #000;
1747
+ }
1748
+
1749
+ .csf--toggle{
1750
+ position: absolute;
1751
+ top: 5px;
1752
+ right: 10px;
1753
+ color: #999;
1754
+ }
1755
+
1756
+ .csf--block-extra-styles{
1757
+ margin-top: 5px;
1758
+ }
1759
+ }
1760
+
1761
+ /**
1762
+ * 03. 32. Field: upload
1763
+ */
1764
+ .csf-field-upload{
1765
+
1766
+ input{
1767
+ width: 100%;
1768
+ margin: 0;
1769
+ }
1770
+
1771
+ .csf--wrap{
1772
+ display: flex;
1773
+ align-items: flex-start;
1774
+ }
1775
+
1776
+ .button{
1777
+ margin-left: 5px;
1778
+ }
1779
+ }
1780
+
1781
+ /**
1782
+ * 03. 33. Field: wp_editor
1783
+ */
1784
+ .csf-field-wp_editor{
1785
+
1786
+ .csf-wp-editor{
1787
+ float: left;
1788
+ width: 100%;
1789
+ }
1790
+
1791
+ .mce-toolbar-grp{
1792
+ border: none;
1793
+ }
1794
+
1795
+ .mce-btn.mce-active button,
1796
+ .mce-btn.mce-active:hover button,
1797
+ .mce-btn.mce-active i,
1798
+ .mce-btn.mce-active:hover i{
1799
+ color: #23282d;
1800
+ }
1801
+
1802
+ .wp-media-buttons{
1803
+ position: relative;
1804
+ z-index: 2;
1805
+ }
1806
+
1807
+
1808
+ .wp-editor-tabs{
1809
+ position: relative;
1810
+ z-index: 1;
1811
+ }
1812
+
1813
+ .csf-no-tinymce{
1814
+ border: 1px solid #e5e5e5;
1815
+ }
1816
+
1817
+ .csf-no-quicktags{
1818
+
1819
+ .wp-media-buttons{
1820
+ float: none;
1821
+ display: block;
1822
+ }
1823
+
1824
+ .mce-tinymce{
1825
+ box-shadow: none;
1826
+ border: 1px solid #e5e5e5;
1827
+ }
1828
+ }
1829
+
1830
+ textarea{
1831
+ width: 100%;
1832
+ max-width: 100%;
1833
+ margin: 0;
1834
+ box-shadow: none;
1835
+ }
1836
+ }
1837
+
1838
+ /**
1839
+ * 03. 34. Field: heading
1840
+ */
1841
+ .csf-field-heading{
1842
+ font-size: 1.5em;
1843
+ font-weight: bold;
1844
+ color: #23282d;
1845
+ background-color: #f5f5f5;
1846
+ }
1847
+
1848
+ /**
1849
+ * 03. 35. Field: subheading
1850
+ */
1851
+ .csf-field-subheading{
1852
+ font-size: 14px;
1853
+ font-weight: bold;
1854
+ padding-top: 17px;
1855
+ padding-bottom: 17px;
1856
+ color: #23282d;
1857
+ background-color: #f7f7f7;
1858
+ }
1859
+
1860
+ /**
1861
+ * 03. 36. Field: submessage
1862
+ */
1863
+ .csf-field-submessage{
1864
+ padding: 0 !important;
1865
+ border: 0 !important;
1866
+
1867
+ + .csf-field{
1868
+ border-top: 0 !important;
1869
+ }
1870
+ }
1871
+
1872
+ .csf-submessage{
1873
+ font-size: 12px;
1874
+ padding: 17px 30px;
1875
+ border-top: 1px solid transparent;
1876
+ border-bottom: 1px solid transparent;
1877
+ }
1878
+
1879
+ .csf-submessage-success{
1880
+ color: #3c763d;
1881
+ border-color: #d6e9c6;
1882
+ background-color: #dff0d8;
1883
+ }
1884
+
1885
+ .csf-submessage-info{
1886
+ color: #31708f;
1887
+ border-color: #bce8f1;
1888
+ background-color: #d9edf7;
1889
+ }
1890
+
1891
+ .csf-submessage-warning{
1892
+ color: #8a6d3b;
1893
+ border-color: #faebcc;
1894
+ background-color: #fcf8e3;
1895
+ }
1896
+
1897
+ .csf-submessage-danger{
1898
+ color: #a94442;
1899
+ border-color: #ebccd1;
1900
+ background-color: #f2dede;
1901
+ }
1902
+
1903
+ .csf-submessage-normal{
1904
+ color: #23282d;
1905
+ border-color: #eee;
1906
+ background-color: #f7f7f7;
1907
+ }
1908
+
1909
+ /**
1910
+ * 03. 37. Field: notice
1911
+ */
1912
+ .csf-field-notice{
1913
+ background-color: #f7f7f7;
1914
+ }
1915
+
1916
+ .csf-notice{
1917
+ padding: 12px;
1918
+ background-color: #fff;
1919
+ border-left-style: solid;
1920
+ border-left-width: 4px;
1921
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
1922
+ }
1923
+
1924
+ .csf-notice-success{
1925
+ border-color: #46b450;
1926
+ }
1927
+
1928
+ .csf-notice-info{
1929
+ border-color: #339fd4;
1930
+ }
1931
+
1932
+ .csf-notice-warning{
1933
+ border-color: #ffbc00;
1934
+ }
1935
+
1936
+ .csf-notice-danger{
1937
+ border-color: #dc3232;
1938
+ }
1939
+
1940
+ .csf-notice-normal{
1941
+ border-color: #222;
1942
+ }
1943
+
1944
+ /**
1945
+ * 03. 38. Field: number
1946
+ */
1947
+ .csf-field-number{
1948
+
1949
+ input{
1950
+ width: 100%;
1951
+ margin: 0;
1952
+ }
1953
+
1954
+ .csf--wrap{
1955
+ position: relative;
1956
+ float: left;
1957
+ width: 100px;
1958
+ }
1959
+
1960
+ .csf--unit{
1961
+ position: absolute;
1962
+ z-index: 1;
1963
+ right: 4px;
1964
+ top: 4px;
1965
+ bottom: 4px;
1966
+ padding: 2px 6px;
1967
+ color: #666;
1968
+ font-size: 11px;
1969
+ line-height: 1;
1970
+ border-radius: 2px;
1971
+ background: #eee;
1972
+ user-select: none;
1973
+ display: flex;
1974
+ justify-content: center;
1975
+ flex-direction: column;
1976
+ }
1977
+ }
1978
+
1979
+ /**
1980
+ * 03. 39. others
1981
+ */
1982
+ .csf-help{
1983
+ cursor: help;
1984
+ position: absolute;
1985
+ top: 0;
1986
+ right: 0;
1987
+ padding: 5px;
1988
+ font-size: 13px;
1989
+ color: #aaa;
1990
+
1991
+ .csf-help-text{
1992
+ display: none;
1993
+ }
1994
+ }
1995
+
1996
+ .csf-image-preview{
1997
+ display: inline-block;
1998
+ position: relative;
1999
+ padding: 4px;
2000
+ min-width: 44px;
2001
+ min-height: 22px;
2002
+ margin-bottom: 10px;
2003
+ border: 1px solid #ccc;
2004
+ background-color: #f9f9f9;
2005
+ @include box-shadow(0 1px 0 rgba(black, 0.08));
2006
+
2007
+ img{
2008
+ max-height: 90px;
2009
+ display: inline-block;
2010
+ vertical-align: middle;
2011
+ }
2012
+ }
2013
+
2014
+ .csf-field-custom{
2015
+
2016
+ .csf-field{
2017
+ padding: 0;
2018
+ }
2019
+ }
2020
+
2021
+ .csf-field{
2022
+
2023
+ .chosen-container-single .chosen-single{
2024
+ height: 28px;
2025
+ line-height: 26px;
2026
+ }
2027
+
2028
+ .chosen-container-single .chosen-single abbr{
2029
+ top: 0;
2030
+ right: 20px;
2031
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2032
+ font-weight: 900;
2033
+ font-size: 12px;
2034
+ height: 100%;
2035
+ width: 18px;
2036
+ color: #aaa;
2037
+ text-align: center;
2038
+ background: none;
2039
+
2040
+ &:before{
2041
+ content: "\f00d";
2042
+ }
2043
+
2044
+ &:hover{
2045
+ color: #555;
2046
+ }
2047
+ }
2048
+
2049
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close{
2050
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2051
+ font-weight: 900;
2052
+ font-size: 12px;
2053
+ height: 100%;
2054
+ width: 18px;
2055
+ color: #aaa;
2056
+ text-align: center;
2057
+ background: none;
2058
+
2059
+ &:before{
2060
+ content: "\f00d";
2061
+ display: inline-block;
2062
+ padding-top: 3px;
2063
+ }
2064
+
2065
+ &:hover{
2066
+ color: #555;
2067
+ }
2068
+ }
2069
+
2070
+ .chosen-container-single .chosen-single div b{
2071
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2072
+ font-weight: 900;
2073
+ font-size: 14px;
2074
+ color: #aaa;
2075
+ background: none;
2076
+
2077
+ &:before{
2078
+ content: "\f107";
2079
+ }
2080
+
2081
+ &:hover{
2082
+ color: #555;
2083
+ }
2084
+ }
2085
+
2086
+ .chosen-container-multi .chosen-choices li.search-choice-placeholder {
2087
+ border: 1px dashed #aaa;
2088
+ margin: 3px 5px 3px 0;
2089
+ }
2090
+
2091
+ .chosen-container-multi .ui-sortable li.search-choice span {
2092
+ cursor: move;
2093
+ }
2094
+
2095
+ .chosen-container-active.chosen-with-drop .chosen-single div b{
2096
+
2097
+ &:before{
2098
+ content: "\f106";
2099
+ }
2100
+ }
2101
+
2102
+ .chosen-container-single .chosen-single-with-deselect span{
2103
+ margin-right: 40px;
2104
+ }
2105
+
2106
+ .chosen-container-single .chosen-search input[type="text"]{
2107
+ background: none;
2108
+ }
2109
+
2110
+ .chosen-container-single .chosen-search{
2111
+
2112
+ &:before{
2113
+ font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
2114
+ font-weight: 900;
2115
+ font-size: 11px;
2116
+ content: "\f002";
2117
+ position: absolute;
2118
+ right: 12px;
2119
+ top: 10px;
2120
+ color: #aaa;
2121
+ }
2122
+ }
2123
+
2124
+ .wp-picker-container{
2125
+ display: inline-block;
2126
+
2127
+ .wp-color-result.button{
2128
+ margin-bottom: 0;
2129
+ }
2130
+ }
2131
+
2132
+ .csf--transparent-wrap{
2133
+ display: none;
2134
+ position: relative;
2135
+ top: -1px;
2136
+ width: 235px;
2137
+ padding: 9px 10px;
2138
+ border: 1px solid #dfdfdf;
2139
+ border-top: none;
2140
+ background-color: #fff;
2141
+ }
2142
+
2143
+ .wp-picker-active .csf--transparent-wrap{
2144
+ display: block;
2145
+ }
2146
+
2147
+ .csf--transparent-slider{
2148
+ position: absolute;
2149
+ width: 190px;
2150
+ margin-left: 2px;
2151
+ height: 18px;
2152
+
2153
+ .ui-slider-handle{
2154
+ position: absolute;
2155
+ top: -3px;
2156
+ bottom: -3px;
2157
+ z-index: 5;
2158
+ border-color: #aaa;
2159
+ border-style: solid;
2160
+ border-width: 4px 3px;
2161
+ width: 10px;
2162
+ height: 16px;
2163
+ margin: 0 -5px;
2164
+ background: none;
2165
+ cursor: ew-resize;
2166
+ @include opacity(0.9);
2167
+ @include border-radius(4px);
2168
+ @include box-shadow(0 1px 2px rgba(black, 0.2));
2169
+
2170
+ &:before{
2171
+ content: " ";
2172
+ position: absolute;
2173
+ left: -2px;
2174
+ right: -2px;
2175
+ top: -3px;
2176
+ bottom: -3px;
2177
+ border: 2px solid #fff;
2178
+ @include border-radius(3px);
2179
+ }
2180
+ }
2181
+ }
2182
+
2183
+ .csf--transparent-offset{
2184
+ height: 18px;
2185
+ width: 200px;
2186
+ background: url(../images/checkerboard.png) repeat-y center left scroll #fff;
2187
+ @include box-shadow(0 0 5px rgba(black, 0.4) inset);
2188
+ @include border-radius(2px);
2189
+ }
2190
+
2191
+ .csf--transparent-text{
2192
+ position: absolute;
2193
+ top: 12px;
2194
+ right: 10px;
2195
+ width: 30px;
2196
+ font-size: 12px;
2197
+ line-height: 12px;
2198
+ text-align: center;
2199
+ color: #999;
2200
+ }
2201
+
2202
+ .csf--transparent-button{
2203
+ cursor: pointer;
2204
+ user-select: none;
2205
+ margin-top: 10px;
2206
+ font-size: 11px;
2207
+ text-align: center;
2208
+ border-radius: 2px;
2209
+ padding: 3px 7px;
2210
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
2211
+ letter-spacing: 0.2px;
2212
+ color: #777;
2213
+ border: 1px solid #ccc;
2214
+ background-color: #f7f7f7;
2215
+ transition: background-color .2s, border-color .2s, color .2s;
2216
+ }
2217
+
2218
+ .csf--transparent-active{
2219
+
2220
+ .wp-color-result{
2221
+ background-image: url(../images/checkerboard.png);
2222
+ background-size: 135px;
2223
+ background-position: center left;
2224
+ background-color: transparent !important;
2225
+ }
2226
+
2227
+ .csf--transparent-button{
2228
+ color: #fff;
2229
+ border-color: #3ea032;
2230
+ background-color: #4fb845;
2231
+ }
2232
+
2233
+ .fa:before{
2234
+ content: "\f205";
2235
+ }
2236
+ }
2237
+ }
includes/libs/codestar-framework/assets/scss/vendor/_helper.scss ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 10. Helper
3
+ */
4
+ .csf-subtitle-text{
5
+ margin-top: 6px;
6
+ font-weight: 400;
7
+ color: #999;
8
+ }
9
+
10
+ .csf-desc-text{
11
+ clear: both;
12
+ float: left;
13
+ width: 100%;
14
+ margin-top: 6px;
15
+ font-weight: 400;
16
+ color: #999;
17
+ }
18
+
19
+ .csf-error-text{
20
+ margin-top: 6px;
21
+ color: #d02c21;
22
+ }
23
+
24
+ .csf-before-text{
25
+ margin-bottom: 6px;
26
+ }
27
+
28
+ .csf-after-text{
29
+ margin-top: 6px;
30
+ }
31
+
32
+ .csf-metabox-hide{
33
+ display: none !important;
34
+ }
35
+
36
+ .csf-metabox-show{
37
+ display: block !important;
38
+ }
39
+
40
+ .csf-depend-hidden.csf-depend-on{
41
+ display: none;
42
+ }
43
+
44
+ .csf-depend-visible.csf-depend-on{
45
+ display: block;
46
+ opacity: 0.75;
47
+ filter: grayscale(1);
48
+ user-select: none;
49
+ border-top: 1px solid #eee;
50
+
51
+ .clear:before{
52
+ content: "";
53
+ left: 0;
54
+ top: 0;
55
+ right: 0;
56
+ bottom: 0;
57
+ position: absolute;
58
+ background-color: #eee;
59
+ opacity: 0.25;
60
+ z-index: 10;
61
+ }
62
+ }
63
+
64
+ .csf-warning-primary{
65
+ color: #fff !important;
66
+ border-color: #dc3545 !important;
67
+ background: #dc3545 !important;
68
+
69
+ &:hover,
70
+ &:focus{
71
+ border-color: #bd2130 !important;
72
+ background: #bd2130 !important;
73
+ }
74
+
75
+ &:focus{
76
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px #bd2130 !important;
77
+ }
78
+
79
+ &:active{
80
+ border-color: #bd2130 !important;
81
+ background: #bd2130 !important;
82
+ }
83
+ }
84
+
85
+ .csf-form-result{
86
+ display: none;
87
+ float: left;
88
+ padding: 0 8px;
89
+ margin-right: 4px;
90
+ font-size: 11px;
91
+ line-height: 30px;
92
+ user-select: none;
93
+ border-radius: 2px;
94
+ }
95
+
96
+ .csf-form-show{
97
+ display: block;
98
+ }
99
+
100
+ .csf-form-success{
101
+ color: #fff;
102
+ background-color: #46b450;
103
+ }
104
+
105
+ .csf-form-warning{
106
+ color: #8a6d3b;
107
+ background-color: #faebcc;
108
+ }
109
+
110
+ .csf-label-error{
111
+ position: relative;
112
+ top: -2px;
113
+ display: inline-block;
114
+ font-size: 10px;
115
+ line-height: 10px;
116
+ height: 10px;
117
+ width: 10px;
118
+ padding: 1px;
119
+ font-style: normal;
120
+ text-align: center;
121
+ color: #fff;
122
+ vertical-align: middle;
123
+ background-color: #e10000;
124
+ @include border-radius(2px);
125
+ }
126
+
127
+ .csf-no-option{
128
+ padding: 30px;
129
+ }
130
+
131
+ .csf-input-number{
132
+ -moz-appearance:textfield;
133
+ }
134
+
135
+ .csf-input-number::-webkit-inner-spin-button,
136
+ .csf-input-number::-webkit-outer-spin-button{
137
+ -webkit-appearance: none;
138
+ margin: 0;
139
+ }
includes/libs/codestar-framework/assets/scss/vendor/_mixins.scss ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ @mixin opacity( $opacity ) {
2
+ opacity: $opacity;
3
+ }
includes/libs/codestar-framework/assets/scss/vendor/_modal.scss ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 09. Modal
3
+ */
4
+ .csf-modal{
5
+ position: fixed;
6
+ z-index: 100101;
7
+ top: 0;
8
+ left: 0;
9
+ width: 100%;
10
+ height: 100%;
11
+
12
+ &.hidden{
13
+ display: none;
14
+ }
15
+ }
16
+
17
+ .csf-modal-icon{
18
+ z-index: 100102;
19
+ }
20
+
21
+ .csf-modal-table{
22
+ display: table;
23
+ width: 100%;
24
+ height: 100%;
25
+ }
26
+
27
+ .csf-modal-table-cell{
28
+ display: table-cell;
29
+ vertical-align: middle;
30
+ margin: 100px 0;
31
+ }
32
+
33
+ .csf-modal-inner{
34
+ position: relative;
35
+ z-index: 10;
36
+ width: 760px;
37
+ height: 750px;
38
+ margin: 0 auto;
39
+ background-color: #fff;
40
+ }
41
+
42
+ .csf-modal-content{
43
+ position: relative;
44
+ overflow: hidden;
45
+ overflow-y: auto;
46
+ height: 595px;
47
+
48
+ .csf-shortcode-button{
49
+ display: none;
50
+ }
51
+
52
+ .csf-field{
53
+ padding: 15px 30px 15px 15px;
54
+ }
55
+
56
+ a{
57
+ &:active,
58
+ &:focus{
59
+ outline: none;
60
+ @include box-shadow(none);
61
+ }
62
+ }
63
+
64
+ h4{
65
+ font-size: 13px;
66
+
67
+ small{
68
+ font-style: italic;
69
+ font-weight: 400;
70
+ color: #aaa;
71
+ }
72
+ }
73
+ }
74
+
75
+ .csf-modal-title{
76
+ position: relative;
77
+ background-color: #fcfcfc;
78
+ border-bottom: 1px solid #ddd;
79
+ height: 36px;
80
+ font-size: 16px;
81
+ font-weight: 600;
82
+ line-height: 36px;
83
+ margin: 0;
84
+ padding: 0 36px 0 16px;
85
+ }
86
+
87
+ .csf-modal-header{
88
+ width: 100%;
89
+ padding: 14px 0;
90
+ background-color: #f5f5f5;
91
+ border-bottom: 1px solid #eee;
92
+
93
+ select{
94
+ display: block;
95
+ width: 250px;
96
+ margin: 0 auto;
97
+ font-size: 13px;
98
+ line-height: 1;
99
+ height: 30px;
100
+ min-height: 30px;
101
+ background-color: #fff;
102
+ }
103
+ }
104
+
105
+ .csf-modal-close{
106
+ color: #666;
107
+ padding: 0;
108
+ position: absolute;
109
+ top: 0;
110
+ right: 0;
111
+ width: 36px;
112
+ height: 36px;
113
+ text-align: center;
114
+ background: none;
115
+ border: none;
116
+ cursor: pointer;
117
+
118
+ &:before{
119
+ font: normal 20px/36px dashicons;
120
+ content: "\f158";
121
+ vertical-align: top;
122
+ width: 36px;
123
+ height: 36px;
124
+ }
125
+
126
+ &:hover{
127
+ @include opacity(0.5);
128
+ }
129
+ }
130
+
131
+ .csf-modal-insert-wrapper{
132
+ text-align: center;
133
+ width: 100%;
134
+ padding: 15px 0;
135
+ background-color: #f5f5f5;
136
+ border-top: 1px solid #eee;
137
+ }
138
+
139
+ .csf-modal-overlay{
140
+ position: absolute;
141
+ top: 0;
142
+ left: 0;
143
+ width: 100%;
144
+ height: 100%;
145
+ background-color: #000;
146
+ @include opacity(0.5);
147
+ }
148
+
149
+ /**
150
+ * 09. 01. Shortcode Modal
151
+ */
152
+ .csf--repeatable{
153
+ padding: 15px 15px 0 15px;
154
+ }
155
+
156
+ .csf--repeat-button-block{
157
+ text-align: center;
158
+ padding-bottom: 15px;
159
+ }
160
+
161
+ .csf--repeat-shortcode{
162
+ position: relative;
163
+ margin-bottom: 15px;
164
+ border: 1px dashed #ddd;
165
+
166
+ &:first-child{
167
+
168
+ .csf-repeat-remove{
169
+ display: none;
170
+ }
171
+ }
172
+
173
+ .csf-repeat-remove{
174
+ position: absolute;
175
+ right: 10px;
176
+ top: 10px;
177
+ z-index: 10;
178
+ cursor: pointer;
179
+ display: inline-block;
180
+ font-size: 11px;
181
+ width: 18px;
182
+ height: 18px;
183
+ line-height: 18px;
184
+ text-align: center;
185
+ border-radius: 2px;
186
+ color: #fff;
187
+ background-color: #e14d43;
188
+ @include opacity(0.5);
189
+
190
+ &:hover{
191
+ @include opacity(1);
192
+ }
193
+ }
194
+ }
195
+
196
+ .csf-shortcode-single{
197
+
198
+ .csf-modal-inner{
199
+ height: 750px;
200
+ }
201
+
202
+ .csf-modal-content{
203
+ height: 652px;
204
+ }
205
+ }
206
+
207
+ .elementor-editor-active{
208
+
209
+ .csf-shortcode-button{
210
+ margin-left: 5px;
211
+ }
212
+
213
+ .csf-modal .hidden{
214
+ display: none !important;
215
+ }
216
+ }
217
+
218
+ /**
219
+ * 09. 02. Gutenberg Modal
220
+ */
221
+ .csf-shortcode-block{
222
+ text-align: center;
223
+ padding: 14px;
224
+ font-size: 13px;
225
+ background-color: #f5f5f5;
226
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
227
+ }
228
+
229
+ .csf-shortcode-block .components-button{
230
+ margin-bottom: 10px;
231
+ }
232
+
233
+ /**
234
+ * 09. 03. Icon Modal
235
+ */
236
+ .csf-modal-icon{
237
+
238
+ .csf-icon-title{
239
+ padding: 15px 0;
240
+ margin: 4px;
241
+ font-size: 14px;
242
+ font-weight: bold;
243
+ text-align: center;
244
+ border: 1px solid #eee;
245
+ background-color: #f7f7f7;
246
+ }
247
+
248
+ .csf-modal-header{
249
+ text-align: center;
250
+ }
251
+
252
+ .csf-icon-search{
253
+ width: 50%;
254
+ height: 40px;
255
+ line-height: 40px;
256
+ }
257
+
258
+ i{
259
+ cursor: pointer;
260
+ display: inline-block;
261
+ margin: 4px;
262
+ width: 35px;
263
+ height: 35px;
264
+ line-height: 35px;
265
+ font-size: 16px;
266
+ color: #555;
267
+ text-align: center;
268
+ border: 1px solid #ccc;
269
+ background-color: #f7f7f7;
270
+ @include border-radius(2px);
271
+ @include box-shadow(1px 1px 0 rgba(black, 0.05));
272
+
273
+ &:hover {
274
+ color: #fff;
275
+ border-color: #222;
276
+ background-color: #222;
277
+ }
278
+ }
279
+
280
+ .csf-modal-content{
281
+ padding: 10px;
282
+ height: 618px;
283
+ }
284
+
285
+ .csf-error-text{
286
+ padding: 10px;
287
+ }
288
+ }
289
+
290
+ .csf-modal-loading{
291
+ display: none;
292
+ position: absolute;
293
+ left: 15px;
294
+ top: 15px;
295
+ }
296
+
297
+ .csf-loading{
298
+ position: relative;
299
+ width: 20px;
300
+ height: 20px;
301
+ background: #ccc;
302
+ @include border-radius(20px);
303
+ @include box-shadow(0 2px 5px rgba(black, 0.070));
304
+
305
+ &:after{
306
+ position: absolute;
307
+ top: 50%;
308
+ left: 50%;
309
+ width: 4px;
310
+ height: 4px;
311
+ content: "";
312
+ margin-top: -2px;
313
+ margin-left: -2px;
314
+ background-color: white;
315
+ @include animation-duration(0.5s);
316
+ @include animation-iteration-count(infinite);
317
+ @include animation-timing-function(linear);
318
+ @include animation-name(csfLoader);
319
+ @include border-radius(4px);
320
+ }
321
+ }
322
+
323
+ @include keyframes(csfLoader){
324
+ 0%{
325
+ @include transform( rotate(0deg) translateX(-6px) rotate(0deg) );
326
+ }
327
+ 100%{
328
+ @include transform( rotate(360deg) translateX(-6px) rotate(-360deg) );
329
+ }
330
+ }
includes/libs/codestar-framework/assets/scss/vendor/_navmenu.scss ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 08. Nav Menu
3
+ */
4
+ .csf-nav-menu-options{
5
+ clear: both;
6
+ float: left;
7
+ width: 100%;
8
+
9
+ > .csf-fields{
10
+ margin-left: -10px;
11
+ margin-top: 10px;
12
+ margin-bottom: 10px;
13
+ border-top: 1px solid #eee;
14
+ border-bottom: 1px solid #eee;
15
+
16
+ > .csf-field{
17
+ padding: 12px 14px 12px 12px;
18
+
19
+ .csf-title{
20
+ float: none;
21
+ width: 100%;
22
+ margin-bottom: 5px;
23
+ }
24
+
25
+ .csf-fieldset{
26
+ float: none;
27
+ width: 100%;
28
+ }
29
+ }
30
+ }
31
+
32
+ .csf-field-text input{
33
+ width: 100%;
34
+ }
35
+
36
+ .csf-field-notice .csf-notice{
37
+ padding: 15px;
38
+ }
39
+ }
40
+
41
+ .csf-nav-menu-title{
42
+ padding: 12px 14px 12px 12px;
43
+ background-color: #f5f5f5;
44
+ border-top: 1px solid #eee;
45
+ border-bottom: 1px solid #eee;
46
+
47
+ &:first-child{
48
+ border-top: 0;
49
+ }
50
+
51
+ h4{
52
+ margin: 0;
53
+ padding: 0;
54
+ color: #23282d;
55
+ }
56
+ }
57
+
58
+ .csf-nav-menu-icon{
59
+ margin-right: 5px;
60
+ }
includes/libs/codestar-framework/assets/scss/vendor/_profile.scss ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 06. Profile
3
+ */
4
+ .csf-profile-options{
5
+
6
+ > h2 > .fa {
7
+ padding-right: 7px;
8
+ }
9
+
10
+ > .csf-field{
11
+ max-width: 750px;
12
+ padding: 15px 0;
13
+ border-top: none !important;
14
+
15
+ > .csf-title{
16
+ width: 200px;
17
+
18
+ h4{
19
+ font-size: 14px;
20
+ font-weight: 600;
21
+ line-height: 1.3;
22
+ display: inline-block;
23
+ vertical-align: middle;
24
+ }
25
+ }
26
+
27
+ > .csf-fieldset{
28
+ width: calc(100% - 220px);
29
+
30
+ > .csf-help{
31
+ top: -15px;
32
+ right: -5px;
33
+ }
34
+ }
35
+ }
36
+
37
+ > .csf-field-heading{
38
+ font-size: 1.1em;
39
+ }
40
+
41
+ > .csf-field-subheading{
42
+ font-size: 12px;
43
+ }
44
+
45
+ > .csf-field-subheading,
46
+ > .csf-field-heading{
47
+ margin: 10px 0;
48
+ padding: 15px !important;
49
+ border: 1px solid #ddd;
50
+ }
51
+
52
+ > .csf-field-submessage{
53
+ margin: 20px 0;
54
+
55
+ .csf-submessage{
56
+ padding: 10px;
57
+ border-left-width: 1px;
58
+ border-left-style: solid;
59
+ border-right-width: 1px;
60
+ border-right-style: solid;
61
+ }
62
+ }
63
+
64
+ > .csf-field-notice{
65
+ background-color: transparent;
66
+ }
67
+ }
includes/libs/codestar-framework/assets/scss/vendor/_responsive.scss ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 12. Responsive
3
+ */
4
+ @media only screen and (max-width:1200px){
5
+
6
+ .csf-metabox{
7
+
8
+ .csf-field{
9
+
10
+ .csf-title{
11
+ float: none;
12
+ width: 100%;
13
+ margin-bottom: 10px;
14
+ }
15
+
16
+ .csf-fieldset{
17
+ float: none;
18
+ width: 100%;
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ @media only screen and (max-width:782px){
25
+
26
+ .csf-header-inner{
27
+ text-align: center;
28
+
29
+ h1{
30
+ width: 100%;
31
+ margin-bottom: 10px;
32
+ }
33
+ }
34
+
35
+ .csf-form-result{
36
+ float: none;
37
+ margin-right: 0;
38
+ margin-bottom: 10px;
39
+ }
40
+
41
+ .csf-search,
42
+ .csf-header-right,
43
+ .csf-header-left{
44
+ width: 100%;
45
+ }
46
+
47
+ .csf-search{
48
+ text-align: center;
49
+ margin-bottom: 15px;
50
+ }
51
+
52
+ .csf-footer{
53
+ text-align: center;
54
+ }
55
+
56
+ .csf-buttons{
57
+ float: none;
58
+ }
59
+
60
+ .csf-copyright{
61
+ float: none;
62
+ margin-top: 10px;
63
+ }
64
+
65
+ .csf-nav,
66
+ .csf-expand-all,
67
+ .csf-reset-section,
68
+ .csf-nav-background{
69
+ display: none !important;
70
+ }
71
+
72
+ .csf-content{
73
+ margin-left: 0;
74
+ }
75
+
76
+ .csf-section-title,
77
+ .csf-section{
78
+ display: block !important;
79
+ }
80
+
81
+ .csf-field{
82
+
83
+ .csf-title{
84
+ float: none;
85
+ width: 100%;
86
+ margin-bottom: 10px;
87
+ }
88
+
89
+ .csf-fieldset{
90
+ float: none;
91
+ width: 100%;
92
+ }
93
+ }
94
+
95
+ .csf-field-color{
96
+
97
+ .button.wp-picker-clear{
98
+ padding: 0 8px;
99
+ line-height: 2.14285714;
100
+ min-height: 32px;
101
+ }
102
+ }
103
+
104
+ .csf-modal-inner{
105
+ width: 350px;
106
+ height: 400px;
107
+ }
108
+
109
+ .csf-modal-content{
110
+ height: 237px;
111
+ }
112
+
113
+ .csf-icon-dialog{
114
+
115
+ .csf-modal-inner{
116
+ width: 305px;
117
+ height: 380px;
118
+ }
119
+
120
+ .csf-modal-content{
121
+ height: 267px;
122
+ }
123
+ }
124
+
125
+ .csf-modal-icon{
126
+
127
+ .csf-modal-inner{
128
+ width: 330px;
129
+ height: 385px;
130
+ }
131
+
132
+ .csf-modal-content{
133
+ height: 252px;
134
+ }
135
+ }
136
+
137
+ .csf-profile-options,
138
+ .csf-taxonomy-edit-fields{
139
+
140
+ > .csf-field{
141
+
142
+ > .csf-title{
143
+ float: none;
144
+ width: 100%;
145
+ margin-bottom: 10px;
146
+ }
147
+
148
+ > .csf-fieldset{
149
+ float: none;
150
+ width: 100%;
151
+ }
152
+ }
153
+ }
154
+
155
+ .csf-nav-menu-options{
156
+
157
+ > .csf-fields{
158
+ margin-left: -10px;
159
+ margin-right: -10px;
160
+
161
+ > .csf-field{
162
+ padding: 10px;
163
+ }
164
+ }
165
+ }
166
+ }
includes/libs/codestar-framework/assets/scss/vendor/_taxonomy.scss ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 06. Taxonomy
3
+ */
4
+ .csf-taxonomy{
5
+ max-width: 95%;
6
+
7
+ > .csf-field{
8
+ border-top: none !important;
9
+ }
10
+
11
+ > .csf-field-heading{
12
+ font-size: 1.1em;
13
+ padding: 20px !important;
14
+ border: 1px solid #ddd;
15
+ }
16
+
17
+ > .csf-field-subheading{
18
+ font-size: 12px;
19
+ padding: 15px !important;
20
+ border: 1px solid #ddd;
21
+ }
22
+
23
+ > .csf-field-submessage{
24
+
25
+ .csf-submessage{
26
+ padding: 15px;
27
+ border-left-width: 1px;
28
+ border-left-style: solid;
29
+ border-right-width: 1px;
30
+ border-right-style: solid;
31
+ }
32
+ }
33
+
34
+ > .csf-field-notice{
35
+ background-color: transparent;
36
+ }
37
+
38
+ .csf-section-title{
39
+ display: block;
40
+ padding: 15px ;
41
+ background-color: #f9f9f9;
42
+ border: 1px solid #e5e5e5;
43
+ @include box-shadow(0 1px 1px rgba(black, 0.04));
44
+ }
45
+ }
46
+
47
+ .csf-taxonomy-add-fields{
48
+
49
+ > .csf-field{
50
+ padding: 8px 0;
51
+
52
+ > .csf-title{
53
+ float: none;
54
+ width: 100%;
55
+ padding: 2px 2px 4px 0;
56
+
57
+ h4{
58
+ font-size: 12px;
59
+ font-weight: normal;
60
+ }
61
+ }
62
+
63
+ > .csf-fieldset{
64
+ float: none;
65
+ width: 100%;
66
+
67
+ > .csf-help{
68
+ right: -5px;
69
+ }
70
+ }
71
+ }
72
+
73
+ + p.submit{
74
+ margin-top: 0;
75
+ }
76
+ }
77
+
78
+ .csf-taxonomy-edit-fields{
79
+
80
+ > .csf-field{
81
+ padding: 20px 0;
82
+
83
+ > .csf-title{
84
+ width: 200px;
85
+
86
+ h4{
87
+ font-size: 14px;
88
+ font-weight: 600;
89
+ line-height: 1.3;
90
+ display: inline-block;
91
+ vertical-align: middle;
92
+ }
93
+ }
94
+
95
+ > .csf-fieldset{
96
+ width: calc(100% - 220px);
97
+
98
+ > .csf-help{
99
+ top: -5px;
100
+ right: -5px;
101
+ }
102
+ }
103
+ }
104
+
105
+ > .csf-field-submessage{
106
+ margin: 20px 0;
107
+ }
108
+
109
+ > .csf-field-subheading,
110
+ > .csf-field-heading{
111
+ margin: 20px 0;
112
+ border: 1px solid #ddd;
113
+ }
114
+ }
includes/libs/codestar-framework/assets/scss/vendor/_themes.scss ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 02. Themes
3
+ */
4
+
5
+ /**
6
+ * 02. 01. Theme Dark
7
+ */
8
+ .csf-theme-dark{
9
+
10
+ .csf-header-inner{
11
+ background-color: #050505;
12
+
13
+ h1{
14
+ color: #fff;
15
+
16
+ small{
17
+ color: #555;
18
+ }
19
+ }
20
+ }
21
+
22
+ .csf-expand-all{
23
+ color: #999;
24
+ background-color: #222;
25
+
26
+ &:hover{
27
+ color: #fff;
28
+ background-color: #333;
29
+ }
30
+ }
31
+
32
+ .csf-search{
33
+
34
+ input{
35
+ color: #fff;
36
+ background-color: #222;
37
+ }
38
+
39
+ &:focus{
40
+ background-color: #444;
41
+ }
42
+
43
+ &::-webkit-input-placeholder{
44
+ color: #666;
45
+ }
46
+ }
47
+
48
+ .csf-nav{
49
+
50
+ ul{
51
+
52
+ li{
53
+
54
+ a{
55
+ color: #999;
56
+ background-color: #222;
57
+ border-bottom: 1px solid #2f2f2f;
58
+
59
+ &:hover{
60
+ color: #fff;
61
+ }
62
+ }
63
+
64
+ .csf-active{
65
+ color: #fff;
66
+ background-color: #111;
67
+
68
+ &:after{
69
+ content: " ";
70
+ position: absolute;
71
+ right: 0;
72
+ top: 50%;
73
+ height: 0;
74
+ width: 0;
75
+ pointer-events: none;
76
+ border: solid transparent;
77
+ border-right-color: #fff;
78
+ border-width: 4px;
79
+ margin-top: -4px;
80
+ }
81
+ }
82
+ }
83
+
84
+ ul{
85
+
86
+ li{
87
+
88
+ a{
89
+ background-color: #191919;
90
+ border-bottom: 1px solid #2f2f2f;
91
+ }
92
+
93
+ .csf-active{
94
+ background-color: #101010;
95
+ }
96
+ }
97
+
98
+ &:before{
99
+ background-color: rgba(#222, 0.75);
100
+ }
101
+ }
102
+ }
103
+
104
+ > ul > li:last-child > a{
105
+ border-bottom: none;
106
+ }
107
+ }
108
+
109
+ .csf-nav-background{
110
+ background-color: #222;
111
+ }
112
+
113
+ .csf-footer{
114
+ color: #555;
115
+ background-color: #050505;
116
+ }
117
+ }
118
+
119
+ /**
120
+ * 02. 02. Theme Light
121
+ */
122
+ .csf-theme-light{
123
+
124
+ .csf-container{
125
+ border: 1px solid #ccd0d4;
126
+ @include box-shadow(0 0 15px rgba(black, 0.04));
127
+ }
128
+
129
+ .csf-header-inner{
130
+ border-bottom: 1px solid #ccd0d4;
131
+ background-color: #f5f5f5;
132
+ background: linear-gradient(#fefefe, #f5f5f5);
133
+
134
+ h1{
135
+
136
+ small{
137
+ color: #999;
138
+ }
139
+ }
140
+ }
141
+
142
+ .csf-expand-all{
143
+ color: #999;
144
+ background-color: #eee;
145
+
146
+ &:hover{
147
+ color: #555;
148
+ }
149
+ }
150
+
151
+ .csf-search{
152
+
153
+ input{
154
+ color: #555;
155
+ background-color: #eee;
156
+
157
+ &::-webkit-input-placeholder{
158
+ color: #999;
159
+ }
160
+ }
161
+ }
162
+
163
+ .csf-nav{
164
+
165
+ ul{
166
+
167
+ li{
168
+
169
+ a{
170
+ color: #666;
171
+ background-color: #f5f5f5;
172
+ border-bottom: 1px solid #ccd0d4;
173
+
174
+ &:hover{
175
+ color: #222;
176
+ }
177
+ }
178
+
179
+ .csf-active{
180
+ color: #222;
181
+ background-color: #fff;
182
+
183
+ &:after{
184
+ content: "";
185
+ position: absolute;
186
+ top: 0;
187
+ bottom: 0;
188
+ right: -1px;
189
+ width: 1px;
190
+ background-color: #fff;
191
+ }
192
+ }
193
+ }
194
+
195
+ ul{
196
+
197
+ li{
198
+
199
+ a{
200
+ background-color: #eee;
201
+ border-bottom: 1px solid #ccd0d4;
202
+ }
203
+ }
204
+ }
205
+ }
206
+
207
+ > ul > li:last-child > a{
208
+ border-bottom: none;
209
+ }
210
+ }
211
+
212
+ .csf-nav-background{
213
+ background-color: #f5f5f5;
214
+ border-right: 1px solid #ccd0d4;
215
+ }
216
+
217
+ .csf-footer{
218
+ color: #555;
219
+ border-top: 1px solid #ccd0d4;
220
+ background-color: #f5f5f5;
221
+ background: linear-gradient(#fafafa, #f5f5f5);
222
+ }
223
+ }
includes/libs/codestar-framework/assets/scss/vendor/_welcome.scss ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 11. Welcome Page
3
+ */
4
+ .csf-welcome-wrap{
5
+ position: relative;
6
+ margin: 25px 40px 0 20px;
7
+ font-size: 15px;
8
+ max-width: 1200px;
9
+
10
+ p{
11
+ font-size: 14px;
12
+ line-height: 1.5;
13
+ }
14
+
15
+ h1{
16
+ margin: 0.2em 200px 0 0;
17
+ padding: 0;
18
+ color: #32373c;
19
+ line-height: 1.2em;
20
+ font-size: 2.8em;
21
+ font-weight: 400;
22
+ }
23
+
24
+ .csf-logo{
25
+ position: absolute;
26
+ overflow: hidden;
27
+ top: 0;
28
+ right: 0;
29
+ height: 160px;
30
+ width: 140px;
31
+ background-image: linear-gradient( 45deg, #2d67cb, #ad19f3);
32
+ box-shadow: 0 1px 4px rgba(0,0,0,0.25), inset 0 0 0 4px rgba(0,0,0,0.25);
33
+
34
+ .csf--effects i{
35
+ position: absolute;
36
+ width: 200px;
37
+ height: 100px;
38
+ background-color: rgba(0,0,0,0.15);
39
+ transform: rotate(-45deg);
40
+ }
41
+
42
+ .csf--effects i:nth-child(1){
43
+ bottom: -20px;
44
+ right: -70px;
45
+ }
46
+
47
+ .csf--effects i:nth-child(2){
48
+ bottom: -35px;
49
+ right: -80px;
50
+ }
51
+
52
+ .csf--effects i:nth-child(3){
53
+ bottom: -50px;
54
+ right: -90px;
55
+ }
56
+
57
+ .csf--effects i:nth-child(4){
58
+ bottom: -65px;
59
+ right: -100px;
60
+ }
61
+
62
+ .csf--wp-logos{
63
+ position: relative;
64
+ padding-top: 25px;
65
+ text-align: center;
66
+ }
67
+
68
+ .csf--wp-logo{
69
+ position: absolute;
70
+ left: 20px;
71
+ width: 20px;
72
+ height: 20px;
73
+ background-repeat: no-repeat;
74
+ background-position: center center;
75
+ background-image: url(../images/wp-logo.svg);
76
+ }
77
+
78
+ .csf--wp-plugin-logo{
79
+ display: inline-block;
80
+ width: 50px;
81
+ height: 50px;
82
+ border: 3px solid #fff;
83
+ background-size: 40px;
84
+ background-repeat: no-repeat;
85
+ background-position: center center;
86
+ background-image: url(../images/wp-plugin-logo.svg);
87
+ border-radius: 100%;
88
+ vertical-align: middle;
89
+ }
90
+
91
+ .csf--text{
92
+ position: absolute;
93
+ left: 0;
94
+ right: 0;
95
+ top: 90px;
96
+ color: #fff;
97
+ font-size: 13px;
98
+ line-height: 1.2em;
99
+ font-weight: 600;
100
+ text-align: center;
101
+ text-transform: uppercase;
102
+ text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
103
+ }
104
+
105
+ .csf--version{
106
+ top: auto;
107
+ left: auto;
108
+ right: 8px;
109
+ bottom: 4px;
110
+ font-size: 11px;
111
+ text-transform: lowercase;
112
+ }
113
+ }
114
+
115
+ .csf-about-text{
116
+ font-weight: 400;
117
+ line-height: 1.6em;
118
+ font-size: 19px;
119
+ margin: 1em 200px 1em 0;
120
+ color: #555d66;
121
+ }
122
+
123
+ .csf-demo-button{
124
+ margin: 1em 200px 2em 0;
125
+ }
126
+
127
+ .nav-tab-wrapper{
128
+ margin-bottom: 20px;
129
+ }
130
+
131
+ ul{
132
+ list-style-type: disc;
133
+ padding-left: 15px;
134
+ }
135
+
136
+ .csf--col{
137
+ float: left;
138
+ padding-right: 20px;
139
+ box-sizing: border-box;
140
+ }
141
+
142
+ .csf--col-2{
143
+ width: 50%;
144
+ }
145
+
146
+ .csf--col-3{
147
+ width: 33.333%;
148
+ }
149
+
150
+ .csf--col-4{
151
+ width: 25%;
152
+ }
153
+
154
+ .csf--col-5{
155
+ width: 20%;
156
+ }
157
+
158
+ .csf--col-last{
159
+ padding-right: 0;
160
+ }
161
+
162
+ .csf--col-upgrade{
163
+ padding: 10px 0;
164
+ text-align: center;
165
+ border-top: 1px solid #e5e5e5;
166
+ }
167
+ }
168
+
169
+ .csf--table-compare{
170
+
171
+ thead,
172
+ tfoot{
173
+ td{
174
+ text-align: center;
175
+ }
176
+ }
177
+
178
+ td{
179
+ font-size: 14px;
180
+ text-align: center;
181
+ vertical-align: middle;
182
+ padding: 10px;
183
+ }
184
+
185
+ td:first-child{
186
+ text-align: left;
187
+ }
188
+
189
+ tfoot{
190
+ td{
191
+ padding: 15px 0;
192
+ }
193
+ }
194
+
195
+ .fa{
196
+ font-size: 18px;
197
+ }
198
+
199
+ .fa-check-circle{
200
+ color: #46b450;
201
+ }
202
+
203
+ .fa-times-circle{
204
+ color: #dc3232;
205
+ }
206
+ }
207
+
208
+ .csf-welcome-cols{
209
+ clear: both;
210
+ margin: 20px 0;
211
+ background-color: #fff;
212
+ padding: 0 0;
213
+ border-radius: 2px;
214
+ border: 1px solid #e5e5e5;
215
+
216
+ .csf--col{
217
+ width: 33.333%;
218
+ float: left;
219
+ padding: 20px;
220
+ text-align: center;
221
+ box-sizing: border-box;
222
+ min-height: 200px;
223
+ border-right: 1px solid #e5e5e5;
224
+ }
225
+
226
+ .csf--left,
227
+ .csf--block{
228
+ float: left;
229
+ width: 20%;
230
+ padding: 0 30px;
231
+ text-align: center;
232
+ box-sizing: border-box;
233
+ }
234
+
235
+ .csf--block{
236
+ width: 80%;
237
+ }
238
+
239
+ .csf--col-first{
240
+ border-bottom: 1px solid #e5e5e5;
241
+ }
242
+
243
+ .csf--last{
244
+ border-right: none;
245
+ }
246
+
247
+ .csf--space{
248
+ height: 20px;
249
+ }
250
+
251
+ .csf--icon{
252
+ display: inline-block;
253
+ font-size: 20px;
254
+ width: 30px;
255
+ height: 30px;
256
+ line-height: 30px;
257
+ text-align: center;
258
+ margin-bottom: 10px;
259
+ color: #fff;
260
+ background-color: #555;
261
+ border-radius: 30px;
262
+ }
263
+
264
+ .csf--active{
265
+ background-color: #5cb85c;
266
+ }
267
+
268
+ .csf--deactive{
269
+ background-color: #e14d43;
270
+ }
271
+
272
+ .csf--title{
273
+ font-weight: bold;
274
+ display: block;
275
+ }
276
+
277
+ p:last-child{
278
+ margin-bottom: 0;
279
+ }
280
+ }
281
+
282
+ .csf-features-cols{
283
+
284
+ .csf--key-features{
285
+ width: 30%;
286
+ }
287
+ .csf--available-fields{
288
+ width: 70%;
289
+ }
290
+ }
291
+
292
+ .csf-code-block{
293
+ margin: 20px 0;
294
+ padding: 5px 20px;
295
+ background-color: #fff;
296
+ border-radius: 2px;
297
+ box-shadow: 0 1px 1px rgba(0,0,0,0.15);
298
+
299
+ pre{
300
+ font-size: 13px;
301
+ color: #0073aa;
302
+
303
+ span{
304
+ color: #999;
305
+ }
306
+ }
307
+ }
308
+
309
+ .csf--table-fields{
310
+ td{
311
+ font-size: 14px;
312
+ }
313
+ }
314
+
315
+ .csf--upgrade a{
316
+ color: #5cb85c;
317
+ font-weight: bold;
318
+
319
+ &:focus,
320
+ &:hover{
321
+ color: #4aa14a;
322
+ outline: none;
323
+ box-shadow: none;
324
+ }
325
+ }
326
+
327
+ @media only screen and (max-width:782px){
328
+
329
+ .csf-welcome-cols{
330
+ .csf--col{
331
+ width: 100%;
332
+ min-height: auto;
333
+ border-right: none;
334
+ border-bottom: 1px solid #e5e5e5;
335
+ }
336
+ }
337
+
338
+ .csf-features-cols{
339
+ .csf--key-features{
340
+ width: 100%;
341
+ }
342
+ .csf--available-fields{
343
+ width: 100%;
344
+ }
345
+ }
346
+ }
includes/libs/codestar-framework/assets/scss/vendor/_widget.scss ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 04. Widget
3
+ */
4
+ .csf-widgets{
5
+
6
+ > .csf-field{
7
+ position: relative;
8
+ top: -1px;
9
+ margin-right: -15px;
10
+ margin-left: -15px;
11
+ padding: 12px 15px;
12
+
13
+ .csf-field{
14
+ margin-left: 0;
15
+ margin-right: 0;
16
+ }
17
+
18
+ .csf-title{
19
+ float: none;
20
+ width: 100%;
21
+ margin-bottom: 5px;
22
+ }
23
+
24
+ .csf-fieldset{
25
+ float: none;
26
+ width: 100%;
27
+ }
28
+ }
29
+
30
+ .csf-field-text input{
31
+ width: 100%;
32
+ }
33
+
34
+ .csf-field-notice .csf-notice{
35
+ padding: 15px;
36
+ }
37
+ }
38
+
39
+ .control-section{
40
+
41
+ .csf-widgets{
42
+
43
+ > .csf-field{
44
+ margin-right: -10px;
45
+ margin-left: -10px;
46
+ padding: 10px 12px;
47
+ }
48
+ }
49
+ }
includes/libs/codestar-framework/classes/abstract.class.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Abstract Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Abstract' ) ) {
11
+ abstract class CSF_Abstract {
12
+
13
+ public $abstract = '';
14
+ public $output_css = '';
15
+ public $webfonts = array();
16
+ public $subsets = array();
17
+
18
+ public function __construct() {
19
+
20
+ // Collect output css and typography
21
+ if ( ! empty( $this->args['output_css'] ) || ! empty( $this->args['enqueue_webfont'] ) ) {
22
+ add_action( 'wp_enqueue_scripts', array( &$this, 'collect_output_css_and_typography' ), 10 );
23
+ }
24
+
25
+ }
26
+
27
+ public function collect_output_css_and_typography() {
28
+ $this->recursive_output_css( $this->pre_fields );
29
+ }
30
+
31
+ public function recursive_output_css( $fields = array(), $combine_field = array() ) {
32
+
33
+ if ( ! empty( $fields ) ) {
34
+
35
+ foreach ( $fields as $field ) {
36
+
37
+ $field_id = ( ! empty( $field['id'] ) ) ? $field['id'] : '';
38
+ $field_type = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
39
+ $field_output = ( ! empty( $field['output'] ) ) ? $field['output'] : '';
40
+ $field_check = ( $field_type === 'typography' || $field_output ) ? true : false;
41
+
42
+ if ( $field_type && $field_id ) {
43
+
44
+ CSF::maybe_include_field( $field_type );
45
+
46
+ $class_name = 'CSF_Field_' . $field_type;
47
+
48
+ if( $field_type === 'fieldset' ) {
49
+ if ( ! empty( $field['fields'] ) ) {
50
+ $this->recursive_output_css( $field['fields'], $field );
51
+ }
52
+ }
53
+
54
+ if( $field_type === 'accordion' ) {
55
+ if ( ! empty( $field['accordions'] ) ) {
56
+ foreach ( $field['accordions'] as $accordion ) {
57
+ $this->recursive_output_css( $accordion['fields'], $field );
58
+ }
59
+ }
60
+ }
61
+
62
+ if( $field_type === 'tabbed' ) {
63
+ if ( ! empty( $field['tabs'] ) ) {
64
+ foreach ( $field['tabs'] as $accordion ) {
65
+ $this->recursive_output_css( $accordion['fields'], $field );
66
+ }
67
+ }
68
+ }
69
+
70
+ if ( class_exists( $class_name ) ) {
71
+
72
+ if ( method_exists( $class_name, 'output' ) || method_exists( $class_name, 'enqueue_google_fonts' ) ) {
73
+
74
+ $field_value = '';
75
+
76
+ if ( $field_check && ( $this->abstract === 'options' || $this->abstract === 'customize' ) ) {
77
+
78
+ if( ! empty( $combine_field ) ) {
79
+
80
+ $field_value = ( isset( $this->options[$combine_field['id']][$field_id] ) ) ? $this->options[$combine_field['id']][$field_id] : '';
81
+
82
+ } else {
83
+
84
+ $field_value = ( isset( $this->options[$field_id] ) ) ? $this->options[$field_id] : '';
85
+
86
+ }
87
+
88
+ } else if ( $field_check && $this->abstract === 'metabox' && is_singular() ) {
89
+
90
+ if( ! empty( $combine_field ) ) {
91
+
92
+ $meta_value = $this->get_meta_value( $combine_field );
93
+ $field_value = ( isset( $meta_value[$field_id] ) ) ? $meta_value[$field_id] : '';
94
+
95
+ } else {
96
+
97
+ $meta_value = $this->get_meta_value( $field );
98
+ $field_value = ( isset( $meta_value ) ) ? $meta_value : '';
99
+
100
+ }
101
+
102
+ }
103
+
104
+ $instance = new $class_name( $field, $field_value, $this->unique, 'wp/enqueue', $this );
105
+
106
+ // typography enqueue and embed google web fonts
107
+ if ( $field_type === 'typography' && $this->args['enqueue_webfont'] && ! empty( $field_value['font-family'] ) ) {
108
+
109
+ $method = ( ! empty( $this->args['async_webfont'] ) ) ? 'async' : 'enqueue';
110
+ $family = $instance->enqueue_google_fonts();
111
+
112
+ CSF::$webfonts[$method][$family] = ( ! empty( $this->webfonts[$family] ) ) ? $family . ':' . implode( ',', $this->webfonts[$family] ) : $family;
113
+ CSF::$subsets = $this->subsets;
114
+
115
+ }
116
+
117
+ // output css
118
+ if ( $field_output && $this->args['output_css'] ) {
119
+ CSF::$css .= $instance->output();
120
+ }
121
+
122
+ unset( $instance );
123
+
124
+ }
125
+
126
+ }
127
+
128
+ }
129
+
130
+ }
131
+
132
+ }
133
+
134
+ }
135
+
136
+ }
137
+ }
includes/libs/codestar-framework/classes/admin-options.class.php ADDED
@@ -0,0 +1,717 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Options Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Options' ) ) {
11
+ class CSF_Options extends CSF_Abstract {
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $notice = '';
16
+ public $abstract = 'options';
17
+ public $sections = array();
18
+ public $options = array();
19
+ public $errors = array();
20
+ public $pre_tabs = array();
21
+ public $pre_fields = array();
22
+ public $pre_sections = array();
23
+ public $args = array(
24
+
25
+ // framework title
26
+ 'framework_title' => 'Codestar Framework <small>by Codestar</small>',
27
+ 'framework_class' => '',
28
+
29
+ // menu settings
30
+ 'menu_title' => '',
31
+ 'menu_slug' => '',
32
+ 'menu_type' => 'menu',
33
+ 'menu_capability' => 'manage_options',
34
+ 'menu_icon' => null,
35
+ 'menu_position' => null,
36
+ 'menu_hidden' => false,
37
+ 'menu_parent' => '',
38
+ 'sub_menu_title' => '',
39
+
40
+ // menu extras
41
+ 'show_bar_menu' => true,
42
+ 'show_sub_menu' => true,
43
+ 'show_in_network' => true,
44
+ 'show_in_customizer' => false,
45
+
46
+ 'show_search' => true,
47
+ 'show_reset_all' => true,
48
+ 'show_reset_section' => true,
49
+ 'show_footer' => true,
50
+ 'show_all_options' => true,
51
+ 'show_form_warning' => true,
52
+ 'sticky_header' => true,
53
+ 'save_defaults' => true,
54
+ 'ajax_save' => true,
55
+
56
+ // admin bar menu settings
57
+ 'admin_bar_menu_icon' => '',
58
+ 'admin_bar_menu_priority' => 50,
59
+
60
+ // footer
61
+ 'footer_text' => '',
62
+ 'footer_after' => '',
63
+ 'footer_credit' => '',
64
+
65
+ // database model
66
+ 'database' => '', // options, transient, theme_mod, network
67
+ 'transient_time' => 0,
68
+
69
+ // contextual help
70
+ 'contextual_help' => array(),
71
+ 'contextual_help_sidebar' => '',
72
+
73
+ // typography options
74
+ 'enqueue_webfont' => true,
75
+ 'async_webfont' => false,
76
+
77
+ // others
78
+ 'output_css' => true,
79
+
80
+ // theme
81
+ 'theme' => 'dark',
82
+ 'class' => '',
83
+
84
+ // external default values
85
+ 'defaults' => array(),
86
+
87
+ );
88
+
89
+ // run framework construct
90
+ public function __construct( $key, $params = array() ) {
91
+
92
+ $this->unique = $key;
93
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
94
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
95
+
96
+ // run only is admin panel options, avoid performance loss
97
+ $this->pre_tabs = $this->pre_tabs( $this->sections );
98
+ $this->pre_fields = $this->pre_fields( $this->sections );
99
+ $this->pre_sections = $this->pre_sections( $this->sections );
100
+
101
+ $this->get_options();
102
+ $this->set_options();
103
+ $this->save_defaults();
104
+
105
+ add_action( 'admin_menu', array( &$this, 'add_admin_menu' ) );
106
+ add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), $this->args['admin_bar_menu_priority'] );
107
+ add_action( 'wp_ajax_csf_'. $this->unique .'_ajax_save', array( &$this, 'ajax_save' ) );
108
+
109
+ if ( $this->args['database'] === 'network' && ! empty( $this->args['show_in_network'] ) ) {
110
+ add_action( 'network_admin_menu', array( &$this, 'add_admin_menu' ) );
111
+ }
112
+
113
+ // wp enqeueu for typography and output css
114
+ parent::__construct();
115
+
116
+ }
117
+
118
+ // instance
119
+ public static function instance( $key, $params = array() ) {
120
+ return new self( $key, $params );
121
+ }
122
+
123
+ public function pre_tabs( $sections ) {
124
+
125
+ $result = array();
126
+ $parents = array();
127
+ $count = 100;
128
+
129
+ foreach ( $sections as $key => $section ) {
130
+ if ( ! empty( $section['parent'] ) ) {
131
+ $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
132
+ $parents[$section['parent']][] = $section;
133
+ unset( $sections[$key] );
134
+ }
135
+ $count++;
136
+ }
137
+
138
+ foreach ( $sections as $key => $section ) {
139
+ $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
140
+ if ( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
141
+ $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
142
+ }
143
+ $result[] = $section;
144
+ $count++;
145
+ }
146
+
147
+ return wp_list_sort( $result, array( 'priority' => 'ASC' ), 'ASC', true );
148
+ }
149
+
150
+ public function pre_fields( $sections ) {
151
+
152
+ $result = array();
153
+
154
+ foreach ( $sections as $key => $section ) {
155
+ if ( ! empty( $section['fields'] ) ) {
156
+ foreach ( $section['fields'] as $field ) {
157
+ $result[] = $field;
158
+ }
159
+ }
160
+ }
161
+
162
+ return $result;
163
+ }
164
+
165
+ public function pre_sections( $sections ) {
166
+
167
+ $result = array();
168
+
169
+ foreach ( $this->pre_tabs as $tab ) {
170
+ if ( ! empty( $tab['subs'] ) ) {
171
+ foreach ( $tab['subs'] as $sub ) {
172
+ $sub['ptitle'] = $tab['title'];
173
+ $result[] = $sub;
174
+ }
175
+ }
176
+ if ( empty( $tab['subs'] ) ) {
177
+ $result[] = $tab;
178
+ }
179
+ }
180
+
181
+ return $result;
182
+ }
183
+
184
+ // add admin bar menu
185
+ public function add_admin_bar_menu( $wp_admin_bar ) {
186
+
187
+ if( is_network_admin() && ( $this->args['database'] !== 'network' || $this->args['show_in_network'] !== true ) ) {
188
+ return;
189
+ }
190
+
191
+ if ( ! empty( $this->args['show_bar_menu'] ) && empty( $this->args['menu_hidden'] ) ) {
192
+
193
+ global $submenu;
194
+
195
+ $menu_slug = $this->args['menu_slug'];
196
+ $menu_icon = ( ! empty( $this->args['admin_bar_menu_icon'] ) ) ? '<span class="csf-ab-icon ab-icon '. esc_attr( $this->args['admin_bar_menu_icon'] ) .'"></span>' : '';
197
+
198
+ $wp_admin_bar->add_node( array(
199
+ 'id' => $menu_slug,
200
+ 'title' => $menu_icon . esc_attr( $this->args['menu_title'] ),
201
+ 'href' => esc_url( ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_slug ) : admin_url( 'admin.php?page='. $menu_slug ) ),
202
+ ) );
203
+
204
+ if ( ! empty( $submenu[$menu_slug] ) ) {
205
+ foreach ( $submenu[$menu_slug] as $menu_key => $menu_value ) {
206
+ $wp_admin_bar->add_node( array(
207
+ 'parent' => $menu_slug,
208
+ 'id' => $menu_slug .'-'. $menu_key,
209
+ 'title' => $menu_value[0],
210
+ 'href' => esc_url( ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_value[2] ) : admin_url( 'admin.php?page='. $menu_value[2] ) ),
211
+ ) );
212
+ }
213
+ }
214
+
215
+ }
216
+
217
+ }
218
+
219
+ public function ajax_save() {
220
+
221
+ $result = $this->set_options( true );
222
+
223
+ if ( ! $result ) {
224
+ wp_send_json_error( array( 'error' => esc_html__( 'Error while saving.', 'csf' ) ) );
225
+ } else {
226
+ wp_send_json_success( array( 'notice' => $this->notice, 'errors' => $this->errors ) );
227
+ }
228
+
229
+ }
230
+
231
+ // get default value
232
+ public function get_default( $field ) {
233
+
234
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
235
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
236
+
237
+ return $default;
238
+
239
+ }
240
+
241
+ // save defaults and set new fields value to main options
242
+ public function save_defaults() {
243
+
244
+ $tmp_options = $this->options;
245
+
246
+ foreach ( $this->pre_fields as $field ) {
247
+ if ( ! empty( $field['id'] ) ) {
248
+ $this->options[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : $this->get_default( $field );
249
+ }
250
+ }
251
+
252
+ if ( $this->args['save_defaults'] && empty( $tmp_options ) ) {
253
+ $this->save_options( $this->options );
254
+ }
255
+
256
+ }
257
+
258
+ // set options
259
+ public function set_options( $ajax = false ) {
260
+
261
+ // XSS ok.
262
+ // No worries, This "POST" requests is sanitizing in the below foreach. see #L337 - #L341
263
+ $response = ( $ajax && ! empty( $_POST['data'] ) ) ? json_decode( wp_unslash( trim( $_POST['data'] ) ), true ) : $_POST;
264
+
265
+ // Set variables.
266
+ $data = array();
267
+ $noncekey = 'csf_options_nonce'. $this->unique;
268
+ $nonce = ( ! empty( $response[$noncekey] ) ) ? $response[$noncekey] : '';
269
+ $options = ( ! empty( $response[$this->unique] ) ) ? $response[$this->unique] : array();
270
+ $transient = ( ! empty( $response['csf_transient'] ) ) ? $response['csf_transient'] : array();
271
+
272
+ if ( wp_verify_nonce( $nonce, 'csf_options_nonce' ) ) {
273
+
274
+ $importing = false;
275
+ $section_id = ( ! empty( $transient['section'] ) ) ? $transient['section'] : '';
276
+
277
+ if ( ! $ajax && ! empty( $response[ 'csf_import_data' ] ) ) {
278
+
279
+ // XSS ok.
280
+ // No worries, This "POST" requests is sanitizing in the below foreach. see #L337 - #L341
281
+ $import_data = json_decode( wp_unslash( trim( $response[ 'csf_import_data' ] ) ), true );
282
+ $options = ( is_array( $import_data ) && ! empty( $import_data ) ) ? $import_data : array();
283
+ $importing = true;
284
+ $this->notice = esc_html__( 'Success. Imported backup options.', 'csf' );
285
+
286
+ }
287
+
288
+ if ( ! empty( $transient['reset'] ) ) {
289
+
290
+ foreach ( $this->pre_fields as $field ) {
291
+ if ( ! empty( $field['id'] ) ) {
292
+ $data[$field['id']] = $this->get_default( $field );
293
+ }
294
+ }
295
+
296
+ $this->notice = esc_html__( 'Default options restored.', 'csf' );
297
+
298
+ } else if ( ! empty( $transient['reset_section'] ) && ! empty( $section_id ) ) {
299
+
300
+ if ( ! empty( $this->pre_sections[$section_id]['fields'] ) ) {
301
+
302
+ foreach ( $this->pre_sections[$section_id]['fields'] as $field ) {
303
+ if ( ! empty( $field['id'] ) ) {
304
+ $data[$field['id']] = $this->get_default( $field );
305
+ }
306
+ }
307
+
308
+ }
309
+
310
+ $data = wp_parse_args( $data, $this->options );
311
+
312
+ $this->notice = esc_html__( 'Default options restored for only this section.', 'csf' );
313
+
314
+ } else {
315
+
316
+ // sanitize and validate
317
+ foreach ( $this->pre_fields as $field ) {
318
+
319
+ if ( ! empty( $field['id'] ) ) {
320
+
321
+ $field_id = $field['id'];
322
+ $field_value = isset( $options[$field_id] ) ? $options[$field_id] : '';
323
+
324
+ // Ajax and Importing doing wp_unslash already.
325
+ if ( ! $ajax && ! $importing ) {
326
+ $field_value = wp_unslash( $field_value );
327
+ }
328
+
329
+ // Sanitize "post" request of field.
330
+ if ( ! isset( $field['sanitize'] ) ) {
331
+
332
+ if( is_array( $field_value ) ) {
333
+
334
+ $data[$field_id] = wp_kses_post_deep( $field_value );
335
+
336
+ } else {
337
+
338
+ $data[$field_id] = wp_kses_post( $field_value );
339
+
340
+ }
341
+
342
+ } else if( isset( $field['sanitize'] ) && is_callable( $field['sanitize'] ) ) {
343
+
344
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
345
+
346
+ } else {
347
+
348
+ $data[$field_id] = $field_value;
349
+
350
+ }
351
+
352
+ // Validate "post" request of field.
353
+ if ( isset( $field['validate'] ) && is_callable( $field['validate'] ) ) {
354
+
355
+ $has_validated = call_user_func( $field['validate'], $field_value );
356
+
357
+ if ( ! empty( $has_validated ) ) {
358
+
359
+ $data[$field_id] = ( isset( $this->options[$field_id] ) ) ? $this->options[$field_id] : '';
360
+ $this->errors[$field_id] = $has_validated;
361
+
362
+ }
363
+
364
+ }
365
+
366
+ }
367
+
368
+ }
369
+
370
+ }
371
+
372
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $this );
373
+
374
+ do_action( "csf_{$this->unique}_save_before", $data, $this );
375
+
376
+ $this->options = $data;
377
+
378
+ $this->save_options( $data );
379
+
380
+ do_action( "csf_{$this->unique}_save_after", $data, $this );
381
+
382
+ if ( empty( $this->notice ) ) {
383
+ $this->notice = esc_html__( 'Settings saved.', 'csf' );
384
+ }
385
+
386
+ return true;
387
+
388
+ }
389
+
390
+ return false;
391
+
392
+ }
393
+
394
+ // save options database
395
+ public function save_options( $data ) {
396
+
397
+ if ( $this->args['database'] === 'transient' ) {
398
+ set_transient( $this->unique, $data, $this->args['transient_time'] );
399
+ } else if ( $this->args['database'] === 'theme_mod' ) {
400
+ set_theme_mod( $this->unique, $data );
401
+ } else if ( $this->args['database'] === 'network' ) {
402
+ update_site_option( $this->unique, $data );
403
+ } else {
404
+ update_option( $this->unique, $data );
405
+ }
406
+
407
+ do_action( "csf_{$this->unique}_saved", $data, $this );
408
+
409
+ }
410
+
411
+ // get options from database
412
+ public function get_options() {
413
+
414
+ if ( $this->args['database'] === 'transient' ) {
415
+ $this->options = get_transient( $this->unique );
416
+ } else if ( $this->args['database'] === 'theme_mod' ) {
417
+ $this->options = get_theme_mod( $this->unique );
418
+ } else if ( $this->args['database'] === 'network' ) {
419
+ $this->options = get_site_option( $this->unique );
420
+ } else {
421
+ $this->options = get_option( $this->unique );
422
+ }
423
+
424
+ if ( empty( $this->options ) ) {
425
+ $this->options = array();
426
+ }
427
+
428
+ return $this->options;
429
+
430
+ }
431
+
432
+ // admin menu
433
+ public function add_admin_menu() {
434
+
435
+ extract( $this->args );
436
+
437
+ if ( $menu_type === 'submenu' ) {
438
+
439
+ $menu_page = call_user_func( 'add_submenu_page', $menu_parent, esc_attr( $menu_title ), esc_attr( $menu_title ), $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
440
+
441
+ } else {
442
+
443
+ $menu_page = call_user_func( 'add_menu_page', esc_attr( $menu_title ), esc_attr( $menu_title ), $menu_capability, $menu_slug, array( &$this, 'add_options_html' ), $menu_icon, $menu_position );
444
+
445
+ if ( ! empty( $sub_menu_title ) ) {
446
+ call_user_func( 'add_submenu_page', $menu_slug, esc_attr( $sub_menu_title ), esc_attr( $sub_menu_title ), $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
447
+ }
448
+
449
+ if ( ! empty( $this->args['show_sub_menu'] ) && count( $this->pre_tabs ) > 1 ) {
450
+
451
+ // create submenus
452
+ foreach ( $this->pre_tabs as $section ) {
453
+ call_user_func( 'add_submenu_page', $menu_slug, esc_attr( $section['title'] ), esc_attr( $section['title'] ), $menu_capability, $menu_slug .'#tab='. sanitize_title( $section['title'] ), '__return_null' );
454
+ }
455
+
456
+ remove_submenu_page( $menu_slug, $menu_slug );
457
+
458
+ }
459
+
460
+ if ( ! empty( $menu_hidden ) ) {
461
+ remove_menu_page( $menu_slug );
462
+ }
463
+
464
+ }
465
+
466
+ add_action( 'load-'. $menu_page, array( &$this, 'add_page_on_load' ) );
467
+
468
+ }
469
+
470
+ public function add_page_on_load() {
471
+
472
+ if ( ! empty( $this->args['contextual_help'] ) ) {
473
+
474
+ $screen = get_current_screen();
475
+
476
+ foreach ( $this->args['contextual_help'] as $tab ) {
477
+ $screen->add_help_tab( $tab );
478
+ }
479
+
480
+ if ( ! empty( $this->args['contextual_help_sidebar'] ) ) {
481
+ $screen->set_help_sidebar( $this->args['contextual_help_sidebar'] );
482
+ }
483
+
484
+ }
485
+
486
+ add_filter( 'admin_footer_text', array( &$this, 'add_admin_footer_text' ) );
487
+
488
+ }
489
+
490
+ public function add_admin_footer_text() {
491
+ $default = 'Thank you for creating with <a href="http://codestarframework.com/" target="_blank">Codestar Framework</a>';
492
+ echo ( ! empty( $this->args['footer_credit'] ) ) ? wp_kses_post( $this->args['footer_credit'] ) : $default;
493
+ }
494
+
495
+ public function error_check( $sections, $err = '' ) {
496
+
497
+ if ( ! $this->args['ajax_save'] ) {
498
+
499
+ if ( ! empty( $sections['fields'] ) ) {
500
+ foreach ( $sections['fields'] as $field ) {
501
+ if ( ! empty( $field['id'] ) ) {
502
+ if ( array_key_exists( $field['id'], $this->errors ) ) {
503
+ $err = '<span class="csf-label-error">!</span>';
504
+ }
505
+ }
506
+ }
507
+ }
508
+
509
+ if ( ! empty( $sections['subs'] ) ) {
510
+ foreach ( $sections['subs'] as $sub ) {
511
+ $err = $this->error_check( $sub, $err );
512
+ }
513
+ }
514
+
515
+ if ( ! empty( $sections['id'] ) && array_key_exists( $sections['id'], $this->errors ) ) {
516
+ $err = $this->errors[$sections['id']];
517
+ }
518
+
519
+ }
520
+
521
+ return $err;
522
+ }
523
+
524
+ // option page html output
525
+ public function add_options_html() {
526
+
527
+ $has_nav = ( count( $this->pre_tabs ) > 1 ) ? true : false;
528
+ $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
529
+ $ajax_class = ( $this->args['ajax_save'] ) ? ' csf-save-ajax' : '';
530
+ $sticky_class = ( $this->args['sticky_header'] ) ? ' csf-sticky-header' : '';
531
+ $wrapper_class = ( $this->args['framework_class'] ) ? ' '. $this->args['framework_class'] : '';
532
+ $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
533
+ $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
534
+
535
+ do_action( 'csf_options_before' );
536
+
537
+ echo '<div class="csf csf-options'. esc_attr( $theme . $class . $wrapper_class ) .'" data-slug="'. esc_attr( $this->args['menu_slug'] ) .'" data-unique="'. esc_attr( $this->unique ) .'">';
538
+
539
+ echo '<div class="csf-container">';
540
+
541
+ echo '<form method="post" action="" enctype="multipart/form-data" id="csf-form" autocomplete="off">';
542
+
543
+ echo '<input type="hidden" class="csf-section-id" name="csf_transient[section]" value="1">';
544
+
545
+ wp_nonce_field( 'csf_options_nonce', 'csf_options_nonce'. $this->unique );
546
+
547
+ echo '<div class="csf-header'. esc_attr( $sticky_class ) .'">';
548
+ echo '<div class="csf-header-inner">';
549
+
550
+ echo '<div class="csf-header-left">';
551
+ echo '<h1>'. $this->args['framework_title'] .'</h1>';
552
+ echo '</div>';
553
+
554
+ echo '<div class="csf-header-right">';
555
+
556
+ $notice_class = ( ! empty( $this->notice ) ) ? 'csf-form-show' : '';
557
+ $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';
558
+
559
+ echo '<div class="csf-form-result csf-form-success '. esc_attr( $notice_class ) .'">'. wp_kses_post( $notice_text ) .'</div>';
560
+
561
+ echo ( $this->args['show_form_warning'] ) ? '<div class="csf-form-result csf-form-warning">'. esc_html__( 'Settings have changed, you should save them!', 'csf' ) .'</div>' : '';
562
+
563
+ echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class="csf-expand-all" title="'. esc_html__( 'show all options', 'csf' ) .'"><i class="fas fa-outdent"></i></div>' : '';
564
+
565
+ echo ( $this->args['show_search'] ) ? '<div class="csf-search"><input type="text" name="csf-search" placeholder="'. esc_html__( 'Search option(s)', 'csf' ) .'" autocomplete="off" /></div>' : '';
566
+
567
+ echo '<div class="csf-buttons">';
568
+ echo '<input type="submit" name="'. esc_attr( $this->unique ) .'[_nonce][save]" class="button button-primary csf-top-save csf-save'. esc_attr( $ajax_class ) .'" value="'. esc_html__( 'Save', 'csf' ) .'" data-save="'. esc_html__( 'Saving...', 'csf' ) .'">';
569
+ echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="csf_transient[reset_section]" class="button button-secondary csf-reset-section csf-confirm" value="'. esc_html__( 'Reset Section', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'">' : '';
570
+ echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="csf_transient[reset]" class="button csf-warning-primary csf-reset-all csf-confirm" value="'. esc_html__( 'Reset All', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'">' : '';
571
+ echo '</div>';
572
+
573
+ echo '</div>';
574
+
575
+ echo '<div class="clear"></div>';
576
+ echo '</div>';
577
+ echo '</div>';
578
+
579
+ echo '<div class="csf-wrapper'. esc_attr( $show_all ) .'">';
580
+
581
+ if ( $has_nav ) {
582
+
583
+ echo '<div class="csf-nav csf-nav-options">';
584
+
585
+ echo '<ul>';
586
+
587
+ foreach ( $this->pre_tabs as $tab ) {
588
+
589
+ $tab_id = sanitize_title( $tab['title'] );
590
+ $tab_error = $this->error_check( $tab );
591
+ $tab_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="csf-tab-icon '. esc_attr( $tab['icon'] ) .'"></i>' : '';
592
+
593
+ if ( ! empty( $tab['subs'] ) ) {
594
+
595
+ echo '<li class="csf-tab-item">';
596
+
597
+ echo '<a href="#tab='. esc_attr( $tab_id ) .'" data-tab-id="'. esc_attr( $tab_id ) .'" class="csf-arrow">'. wp_kses_post( $tab_icon . $tab['title'] . $tab_error ) .'</a>';
598
+
599
+ echo '<ul>';
600
+
601
+ foreach ( $tab['subs'] as $sub ) {
602
+
603
+ $sub_id = $tab_id .'/'. sanitize_title( $sub['title'] );
604
+ $sub_error = $this->error_check( $sub );
605
+ $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class="csf-tab-icon '. esc_attr( $sub['icon'] ) .'"></i>' : '';
606
+
607
+ echo '<li><a href="#tab='. esc_attr( $sub_id ) .'" data-tab-id="'. esc_attr( $sub_id ) .'">'. wp_kses_post( $sub_icon . $sub['title'] . $sub_error ) .'</a></li>';
608
+
609
+ }
610
+
611
+ echo '</ul>';
612
+
613
+ echo '</li>';
614
+
615
+ } else {
616
+
617
+ echo '<li class="csf-tab-item"><a href="#tab='. esc_attr( $tab_id ) .'" data-tab-id="'. esc_attr( $tab_id ) .'">'. wp_kses_post( $tab_icon . $tab['title'] . $tab_error ) .'</a></li>';
618
+
619
+ }
620
+
621
+ }
622
+
623
+ echo '</ul>';
624
+
625
+ echo '</div>';
626
+
627
+ }
628
+
629
+ echo '<div class="csf-content">';
630
+
631
+ echo '<div class="csf-sections">';
632
+
633
+ foreach ( $this->pre_sections as $section ) {
634
+
635
+ $section_onload = ( ! $has_nav ) ? ' csf-onload' : '';
636
+ $section_class = ( ! empty( $section['class'] ) ) ? ' '. $section['class'] : '';
637
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
638
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
639
+ $section_parent = ( ! empty( $section['ptitle'] ) ) ? sanitize_title( $section['ptitle'] ) .'/' : '';
640
+ $section_id = ( ! empty( $section['title'] ) ) ? sanitize_title( $section_title ) : '';
641
+
642
+ echo '<div class="csf-section'. esc_attr( $section_onload . $section_class ) .'" data-section-id="'. esc_attr( $section_parent . $section_id ) .'">';
643
+ echo ( $has_nav ) ? '<div class="csf-section-title"><h3>'. wp_kses_post( $section_icon . $section_title ) .'</h3></div>' : '';
644
+ echo ( ! empty( $section['description'] ) ) ? '<div class="csf-field csf-section-description">'. wp_kses_post( $section['description'] ) .'</div>' : '';
645
+
646
+ if ( ! empty( $section['fields'] ) ) {
647
+
648
+ foreach ( $section['fields'] as $field ) {
649
+
650
+ $is_field_error = $this->error_check( $field );
651
+
652
+ if ( ! empty( $is_field_error ) ) {
653
+ $field['_error'] = $is_field_error;
654
+ }
655
+
656
+ if ( ! empty( $field['id'] ) ) {
657
+ $field['default'] = $this->get_default( $field );
658
+ }
659
+
660
+ $value = ( ! empty( $field['id'] ) && isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';
661
+
662
+ CSF::field( $field, $value, $this->unique, 'options' );
663
+
664
+ }
665
+
666
+ } else {
667
+
668
+ echo '<div class="csf-no-option">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';
669
+
670
+ }
671
+
672
+ echo '</div>';
673
+
674
+ }
675
+
676
+ echo '</div>';
677
+
678
+ echo '<div class="clear"></div>';
679
+
680
+ echo '</div>';
681
+
682
+ echo '<div class="csf-nav-background"></div>';
683
+
684
+ echo '</div>';
685
+
686
+ if ( ! empty( $this->args['show_footer'] ) ) {
687
+
688
+ echo '<div class="csf-footer">';
689
+
690
+ echo '<div class="csf-buttons">';
691
+ echo '<input type="submit" name="csf_transient[save]" class="button button-primary csf-save'. esc_attr( $ajax_class ) .'" value="'. esc_html__( 'Save', 'csf' ) .'" data-save="'. esc_html__( 'Saving...', 'csf' ) .'">';
692
+ echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="csf_transient[reset_section]" class="button button-secondary csf-reset-section csf-confirm" value="'. esc_html__( 'Reset Section', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'">' : '';
693
+ echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="csf_transient[reset]" class="button csf-warning-primary csf-reset-all csf-confirm" value="'. esc_html__( 'Reset All', 'csf' ) .'" data-confirm="'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'">' : '';
694
+ echo '</div>';
695
+
696
+ echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class="csf-copyright">'. wp_kses_post( $this->args['footer_text'] ) .'</div>' : '';
697
+
698
+ echo '<div class="clear"></div>';
699
+ echo '</div>';
700
+
701
+ }
702
+
703
+ echo '</form>';
704
+
705
+ echo '</div>';
706
+
707
+ echo '<div class="clear"></div>';
708
+
709
+ echo ( ! empty( $this->args['footer_after'] ) ) ? wp_kses_post( $this->args['footer_after'] ) : '';
710
+
711
+ echo '</div>';
712
+
713
+ do_action( 'csf_options_after' );
714
+
715
+ }
716
+ }
717
+ }
includes/libs/codestar-framework/classes/comment-options.class.php ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Comment Metabox Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Comment_Metabox' ) ) {
11
+ class CSF_Comment_Metabox extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'comment_metabox';
16
+ public $pre_fields = array();
17
+ public $sections = array();
18
+ public $args = array(
19
+ 'title' => '',
20
+ 'data_type' => 'serialize',
21
+ 'priority' => 'default',
22
+ 'show_restore' => false,
23
+ 'theme' => 'dark',
24
+ 'class' => '',
25
+ 'defaults' => array(),
26
+ );
27
+
28
+ // run comment metabox construct
29
+ public function __construct( $key, $params = array() ) {
30
+
31
+ $this->unique = $key;
32
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
33
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
34
+ $this->pre_fields = $this->pre_fields( $this->sections );
35
+
36
+ add_action( 'add_meta_boxes_comment', array( &$this, 'add_comment_meta_box' ) );
37
+ add_action( 'edit_comment', array( &$this, 'save_comment_meta_box' ) );
38
+
39
+ if ( ! empty( $this->args['class'] ) ) {
40
+ add_filter( 'postbox_classes_comment_'. $this->unique, array( &$this, 'add_comment_metabox_classes' ) );
41
+ }
42
+
43
+ }
44
+
45
+ // instance
46
+ public static function instance( $key, $params = array() ) {
47
+ return new self( $key, $params );
48
+ }
49
+
50
+ public function pre_fields( $sections ) {
51
+
52
+ $result = array();
53
+
54
+ foreach ( $sections as $key => $section ) {
55
+ if ( ! empty( $section['fields'] ) ) {
56
+ foreach ( $section['fields'] as $field ) {
57
+ $result[] = $field;
58
+ }
59
+ }
60
+ }
61
+
62
+ return $result;
63
+ }
64
+
65
+ public function add_comment_metabox_classes( $classes ) {
66
+
67
+ if ( ! empty( $this->args['class'] ) ) {
68
+ $classes[] = $this->args['class'];
69
+ }
70
+
71
+ return $classes;
72
+
73
+ }
74
+
75
+ // add comment metabox
76
+ public function add_comment_meta_box( $post_type ) {
77
+
78
+ add_meta_box( $this->unique, wp_kses_post( $this->args['title'] ), array( &$this, 'add_comment_meta_box_content' ), 'comment', 'normal', $this->args['priority'], $this->args );
79
+
80
+ }
81
+
82
+ // get default value
83
+ public function get_default( $field ) {
84
+
85
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
86
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
87
+
88
+ return $default;
89
+
90
+ }
91
+
92
+ // get meta value
93
+ public function get_meta_value( $comment_id, $field ) {
94
+
95
+ $value = null;
96
+
97
+ if ( ! empty( $comment_id ) && ! empty( $field['id'] ) ) {
98
+
99
+ if ( $this->args['data_type'] !== 'serialize' ) {
100
+ $meta = get_comment_meta( $comment_id, $field['id'] );
101
+ $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
102
+ } else {
103
+ $meta = get_comment_meta( $comment_id, $this->unique, true );
104
+ $value = ( isset( $meta[$field['id']] ) ) ? $meta[$field['id']] : null;
105
+ }
106
+
107
+ }
108
+
109
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
110
+ $value = ( isset( $value ) ) ? $value : $default;
111
+
112
+ return $value;
113
+
114
+ }
115
+
116
+ // add comment metabox content
117
+ public function add_comment_meta_box_content( $comment, $callback ) {
118
+
119
+ $has_nav = ( count( $this->sections ) > 1 ) ? true : false;
120
+ $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
121
+ $errors = ( is_object ( $comment ) ) ? get_comment_meta( $comment->comment_ID, '_csf_errors_'. $this->unique, true ) : array();
122
+ $errors = ( ! empty( $errors ) ) ? $errors : array();
123
+ $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
124
+
125
+ if ( is_object( $comment ) && ! empty( $errors ) ) {
126
+ delete_comment_meta( $comment->comment_ID, '_csf_errors_'. $this->unique );
127
+ }
128
+
129
+ wp_nonce_field( 'csf_comment_metabox_nonce', 'csf_comment_metabox_nonce'. $this->unique );
130
+
131
+ echo '<div class="csf csf-comment-metabox'. esc_attr( $theme ) .'">';
132
+
133
+ echo '<div class="csf-wrapper'. esc_attr( $show_all ) .'">';
134
+
135
+ if ( $has_nav ) {
136
+
137
+ echo '<div class="csf-nav csf-nav-metabox">';
138
+
139
+ echo '<ul>';
140
+
141
+ $tab_key = 1;
142
+
143
+ foreach ( $this->sections as $section ) {
144
+
145
+ $tab_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-tab-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
146
+ $tab_error = ( ! empty( $errors['sections'][$tab_key] ) ) ? '<i class="csf-label-error csf-error">!</i>' : '';
147
+
148
+ echo '<li><a href="#">'. wp_kses_post( $tab_icon . $section['title'] . $tab_error ) .'</a></li>';
149
+
150
+ $tab_key++;
151
+
152
+ }
153
+
154
+ echo '</ul>';
155
+
156
+ echo '</div>';
157
+
158
+ }
159
+
160
+ echo '<div class="csf-content">';
161
+
162
+ echo '<div class="csf-sections">';
163
+
164
+ $section_key = 1;
165
+
166
+ foreach ( $this->sections as $section ) {
167
+
168
+ $section_onload = ( ! $has_nav ) ? ' csf-onload' : '';
169
+ $section_class = ( ! empty( $section['class'] ) ) ? ' '. $section['class'] : '';
170
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
171
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
172
+
173
+ echo '<div class="csf-section'. esc_attr( $section_onload . $section_class ) .'">';
174
+
175
+ echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. wp_kses_post( $section_icon . $section_title ) .'</h3></div>' : '';
176
+
177
+ if ( ! empty( $section['fields'] ) ) {
178
+
179
+ foreach ( $section['fields'] as $field ) {
180
+
181
+ if ( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
182
+ $field['_error'] = $errors['fields'][$field['id']];
183
+ }
184
+
185
+ if ( ! empty( $field['id'] ) ) {
186
+ $field['default'] = $this->get_default( $field );
187
+ }
188
+
189
+ CSF::field( $field, $this->get_meta_value( $comment->comment_ID, $field ), $this->unique, 'comment_metabox' );
190
+
191
+ }
192
+
193
+ } else {
194
+
195
+ echo '<div class="csf-no-option">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';
196
+
197
+ }
198
+
199
+ echo '</div>';
200
+
201
+ $section_key++;
202
+
203
+ }
204
+
205
+ echo '</div>';
206
+
207
+ if ( ! empty( $this->args['show_restore'] ) ) {
208
+
209
+ echo '<div class="csf-sections-restore">';
210
+ echo '<label>';
211
+ echo '<input type="checkbox" name="'. esc_attr( $this->unique ) .'[_restore]" />';
212
+ echo '<span class="button csf-button-restore">'. esc_html__( 'Restore', 'csf' ) .'</span>';
213
+ echo '<span class="button csf-button-cancel">'. sprintf( '<small>( %s )</small> %s', esc_html__( 'update post for restore ', 'csf' ), esc_html__( 'Cancel', 'csf' ) ) .'</span>';
214
+ echo '</label>';
215
+ echo '</div>';
216
+
217
+ }
218
+
219
+ echo '</div>';
220
+
221
+ echo ( $has_nav ) ? '<div class="csf-nav-background"></div>' : '';
222
+
223
+ echo '<div class="clear"></div>';
224
+
225
+ echo '</div>';
226
+
227
+ echo '</div>';
228
+
229
+ }
230
+
231
+ // save comment metabox
232
+ public function save_comment_meta_box( $comment_id ) {
233
+
234
+ $count = 1;
235
+ $data = array();
236
+ $errors = array();
237
+ $noncekey = 'csf_comment_metabox_nonce'. $this->unique;
238
+ $nonce = ( ! empty( $_POST[ $noncekey ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ $noncekey ] ) ) : '';
239
+
240
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! wp_verify_nonce( $nonce, 'csf_comment_metabox_nonce' ) ) {
241
+ return $comment_id;
242
+ }
243
+
244
+ // XSS ok.
245
+ // No worries, This "POST" requests is sanitizing in the below foreach.
246
+ $request = ( ! empty( $_POST[ $this->unique ] ) ) ? $_POST[ $this->unique ] : array();
247
+
248
+ if ( ! empty( $request ) ) {
249
+
250
+ foreach ( $this->sections as $section ) {
251
+
252
+ if ( ! empty( $section['fields'] ) ) {
253
+
254
+ foreach ( $section['fields'] as $field ) {
255
+
256
+ if ( ! empty( $field['id'] ) ) {
257
+
258
+ $field_id = $field['id'];
259
+ $field_value = isset( $request[$field_id] ) ? $request[$field_id] : '';
260
+
261
+ // Sanitize "post" request of field.
262
+ if ( ! isset( $field['sanitize'] ) ) {
263
+
264
+ if( is_array( $field_value ) ) {
265
+ $data[$field_id] = wp_kses_post_deep( $field_value );
266
+ } else {
267
+ $data[$field_id] = wp_kses_post( $field_value );
268
+ }
269
+
270
+ } else if( isset( $field['sanitize'] ) && is_callable( $field['sanitize'] ) ) {
271
+
272
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
273
+
274
+ } else {
275
+
276
+ $data[$field_id] = $field_value;
277
+
278
+ }
279
+
280
+ // Validate "post" request of field.
281
+ if ( isset( $field['validate'] ) && is_callable( $field['validate'] ) ) {
282
+
283
+ $has_validated = call_user_func( $field['validate'], $field_value );
284
+
285
+ if ( ! empty( $has_validated ) ) {
286
+
287
+ $errors['sections'][$count] = true;
288
+ $errors['fields'][$field_id] = $has_validated;
289
+ $data[$field_id] = $this->get_meta_value( $comment_id, $field );
290
+
291
+ }
292
+
293
+ }
294
+
295
+ }
296
+
297
+ }
298
+
299
+ }
300
+
301
+ $count++;
302
+
303
+ }
304
+
305
+ }
306
+
307
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $comment_id, $this );
308
+
309
+ do_action( "csf_{$this->unique}_save_before", $data, $comment_id, $this );
310
+
311
+ if ( empty( $data ) || ! empty( $request['_restore'] ) ) {
312
+
313
+ if ( $this->args['data_type'] !== 'serialize' ) {
314
+ foreach ( $data as $key => $value ) {
315
+ delete_comment_meta( $comment_id, $key );
316
+ }
317
+ } else {
318
+ delete_comment_meta( $comment_id, $this->unique );
319
+ }
320
+
321
+ } else {
322
+
323
+ if ( $this->args['data_type'] !== 'serialize' ) {
324
+ foreach ( $data as $key => $value ) {
325
+ update_comment_meta( $comment_id, $key, $value );
326
+ }
327
+ } else {
328
+ update_comment_meta( $comment_id, $this->unique, $data );
329
+ }
330
+
331
+ if ( ! empty( $errors ) ) {
332
+ update_comment_meta( $comment_id, '_csf_errors_'. $this->unique, $errors );
333
+ }
334
+
335
+ }
336
+
337
+ do_action( "csf_{$this->unique}_saved", $data, $comment_id, $this );
338
+
339
+ do_action( "csf_{$this->unique}_save_after", $data, $comment_id, $this );
340
+
341
+ }
342
+ }
343
+ }
includes/libs/codestar-framework/classes/customize-options.class.php ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Customize Options Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Customize_Options' ) ) {
11
+ class CSF_Customize_Options extends CSF_Abstract {
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'customize';
16
+ public $options = array();
17
+ public $sections = array();
18
+ public $pre_fields = array();
19
+ public $pre_tabs = array();
20
+ public $priority = 10;
21
+ public $args = array(
22
+ 'database' => 'option',
23
+ 'transport' => 'refresh',
24
+ 'capability' => 'manage_options',
25
+ 'save_defaults' => true,
26
+ 'enqueue_webfont' => true,
27
+ 'async_webfont' => false,
28
+ 'output_css' => true,
29
+ 'defaults' => array()
30
+ );
31
+
32
+ // run customize construct
33
+ public function __construct( $key, $params ) {
34
+
35
+ $this->unique = $key;
36
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
37
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
38
+ $this->pre_fields = $this->pre_fields( $this->sections );
39
+
40
+ $this->get_options();
41
+ $this->save_defaults();
42
+
43
+ add_action( 'customize_register', array( &$this, 'add_customize_options' ) );
44
+ add_action( 'customize_save_after', array( &$this, 'add_customize_save_after' ) );
45
+
46
+ // Get options for enqueue actions
47
+ if ( is_customize_preview() ) {
48
+ add_action( 'wp_enqueue_scripts', array( &$this, 'get_options' ) );
49
+ }
50
+
51
+ // wp enqeueu for typography and output css
52
+ parent::__construct();
53
+
54
+ }
55
+
56
+ // instance
57
+ public static function instance( $key, $params = array() ) {
58
+ return new self( $key, $params );
59
+ }
60
+
61
+ public function add_customize_save_after( $wp_customize ) {
62
+ do_action( "csf_{$this->unique}_save_before", $this->get_options(), $this, $wp_customize );
63
+ do_action( "csf_{$this->unique}_saved", $this->get_options(), $this, $wp_customize );
64
+ do_action( "csf_{$this->unique}_save_after", $this->get_options(), $this, $wp_customize );
65
+ }
66
+
67
+ // get default value
68
+ public function get_default( $field ) {
69
+
70
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
71
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
72
+
73
+ return $default;
74
+
75
+ }
76
+
77
+ // get option
78
+ public function get_options() {
79
+
80
+ if ( $this->args['database'] === 'theme_mod' ) {
81
+ $this->options = get_theme_mod( $this->unique, array() );
82
+ } else {
83
+ $this->options = get_option( $this->unique, array() );
84
+ }
85
+
86
+ if ( empty( $this->options ) ) {
87
+ $this->options = array();
88
+ }
89
+
90
+ return $this->options;
91
+
92
+ }
93
+
94
+ // save defaults and set new fields value to main options
95
+ public function save_defaults() {
96
+
97
+ $tmp_options = $this->options;
98
+
99
+ if ( ! empty( $this->pre_fields ) ) {
100
+ foreach ( $this->pre_fields as $field ) {
101
+ if ( ! empty( $field['id'] ) ) {
102
+ $this->options[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : $this->get_default( $field );
103
+ }
104
+ }
105
+ }
106
+
107
+ if ( $this->args['save_defaults'] && empty( $this->args['show_in_customizer'] ) && empty( $tmp_options ) ) {
108
+
109
+ if ( $this->args['database'] === 'theme_mod' ) {
110
+ set_theme_mod( $this->unique, $this->options );
111
+ } else {
112
+ update_option( $this->unique, $this->options );
113
+ }
114
+
115
+ }
116
+
117
+ }
118
+
119
+ public function pre_fields( $sections ) {
120
+
121
+ $result = array();
122
+
123
+ foreach ( $sections as $key => $section ) {
124
+ if ( ! empty( $section['fields'] ) ) {
125
+ foreach ( $section['fields'] as $field ) {
126
+ $result[] = $field;
127
+ }
128
+ }
129
+ }
130
+
131
+ return $result;
132
+ }
133
+
134
+
135
+ public function pre_tabs( $sections ) {
136
+
137
+ $result = array();
138
+ $parents = array();
139
+
140
+ foreach ( $sections as $key => $section ) {
141
+ if ( ! empty( $section['parent'] ) ) {
142
+ $parents[$section['parent']][] = $section;
143
+ unset( $sections[$key] );
144
+ }
145
+ }
146
+
147
+ foreach ( $sections as $key => $section ) {
148
+ if ( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
149
+ $section['subs'] = $parents[$section['id']];
150
+ }
151
+ $result[] = $section;
152
+ }
153
+
154
+ return $result;
155
+
156
+ }
157
+
158
+ public function add_customize_options( $wp_customize ) {
159
+
160
+ if ( ! class_exists( 'WP_Customize_Panel_CSF' ) ) {
161
+ CSF::include_plugin_file( 'functions/customize.php' );
162
+ }
163
+
164
+ if ( ! empty( $this->sections ) ) {
165
+
166
+ $sections = $this->pre_tabs( $this->sections );
167
+
168
+ foreach ( $sections as $section ) {
169
+
170
+ if ( ! empty( $section['subs'] ) ) {
171
+
172
+ $panel_id = ( isset( $section['id'] ) ) ? $section['id'] : $this->unique .'-panel-'. $this->priority;
173
+
174
+ $wp_customize->add_panel( new WP_Customize_Panel_CSF( $wp_customize, $panel_id, array(
175
+ 'title' => ( isset( $section['title'] ) ) ? $section['title'] : null,
176
+ 'description' => ( isset( $section['description'] ) ) ? $section['description'] : null,
177
+ 'priority' => ( isset( $section['priority'] ) ) ? $section['priority'] : null,
178
+ ) ) );
179
+
180
+ $this->priority++;
181
+
182
+ foreach ( $section['subs'] as $sub_section ) {
183
+
184
+ $section_id = ( isset( $sub_section['id'] ) ) ? $sub_section['id'] : $this->unique .'-section-'. $this->priority;
185
+
186
+ $this->add_section( $wp_customize, $section_id, $sub_section, $panel_id );
187
+
188
+ $this->priority++;
189
+
190
+ }
191
+
192
+ } else {
193
+
194
+ $section_id = ( isset( $section['id'] ) ) ? $section['id'] : $this->unique .'-section-'. $this->priority;
195
+
196
+ $this->add_section( $wp_customize, $section_id, $section, false );
197
+
198
+ $this->priority++;
199
+
200
+ }
201
+
202
+ }
203
+
204
+ }
205
+
206
+ }
207
+
208
+ // add customize section
209
+ public function add_section( $wp_customize, $section_id, $section_args, $panel_id ) {
210
+
211
+ if ( ! empty( $section_args['assign'] ) ) {
212
+
213
+ $section_id = $section_args['assign'];
214
+
215
+ } else {
216
+
217
+ $wp_customize->add_section( new WP_Customize_Section_CSF( $wp_customize, $section_id, array(
218
+ 'title' => ( isset( $section_args['title'] ) ) ? $section_args['title'] : '',
219
+ 'description' => ( isset( $section_args['description'] ) ) ? $section_args['description'] : '',
220
+ 'priority' => ( isset( $section_args['priority'] ) ) ? $section_args['priority'] : '',
221
+ 'panel' => ( $panel_id ) ? $panel_id : '',
222
+ ) ) );
223
+
224
+ }
225
+
226
+ if ( ! empty( $section_args['fields'] ) ) {
227
+
228
+ $field_key = 1;
229
+
230
+ foreach ( $section_args['fields'] as $field ) {
231
+
232
+ if ( isset( $field['id'] ) ) {
233
+ $field['default'] = $this->get_default( $field );
234
+ }
235
+
236
+ $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '_nonce-'. $section_id .'-'. $field_key;
237
+ $setting_args = ( isset( $field['setting_args'] ) ) ? $field['setting_args'] : array();
238
+ $control_args = ( isset( $field['control_args'] ) ) ? $field['control_args'] : array();
239
+ $field_transport = ( isset( $field['transport'] ) ) ? $field['transport'] : $this->args['transport'];
240
+ $field_sanitize = ( isset( $field['sanitize'] ) ) ? $field['sanitize'] : '';
241
+ $field_validate = ( isset( $field['validate'] ) ) ? $field['validate'] : '';
242
+ $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
243
+ $has_selective = ( isset( $field['selective_refresh'] ) && isset( $wp_customize->selective_refresh ) ) ? true : false;
244
+
245
+ $setting_id = $this->unique .'['. $field_id .']';
246
+
247
+ $wp_customize->add_setting( $setting_id,
248
+ wp_parse_args( $setting_args, array(
249
+ 'default' => $field_default,
250
+ 'type' => $this->args['database'],
251
+ 'transport' => ( $has_selective ) ? 'postMessage' : $field_transport,
252
+ 'capability' => $this->args['capability'],
253
+ 'sanitize_callback' => $field_sanitize,
254
+ 'validate_callback' => $field_validate
255
+ ) )
256
+ );
257
+
258
+ $wp_customize->add_control( new WP_Customize_Control_CSF( $wp_customize, $setting_id,
259
+ wp_parse_args( $control_args, array(
260
+ 'unique' => $this->unique,
261
+ 'field' => $field,
262
+ 'section' => $section_id,
263
+ 'settings' => $setting_id
264
+ ) )
265
+ ) );
266
+
267
+ if ( $has_selective ) {
268
+ $wp_customize->selective_refresh->add_partial( $setting_id, $field['selective_refresh'] );
269
+ }
270
+
271
+ $field_key++;
272
+ }
273
+
274
+ }
275
+
276
+
277
+ }
278
+
279
+ }
280
+ }
includes/libs/codestar-framework/classes/fields.class.php ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Fields Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Fields' ) ) {
11
+ abstract class CSF_Fields extends CSF_Abstract {
12
+
13
+ public function __construct( $field = array(), $value = '', $unique = '', $where = '', $parent = '' ) {
14
+ $this->field = $field;
15
+ $this->value = $value;
16
+ $this->unique = $unique;
17
+ $this->where = $where;
18
+ $this->parent = $parent;
19
+ }
20
+
21
+ public function field_name( $nested_name = '' ) {
22
+
23
+ $field_id = ( ! empty( $this->field['id'] ) ) ? $this->field['id'] : '';
24
+ $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $field_id .']' : $field_id;
25
+ $field_name = ( ! empty( $this->field['name'] ) ) ? $this->field['name'] : $unique_id;
26
+ $tag_prefix = ( ! empty( $this->field['tag_prefix'] ) ) ? $this->field['tag_prefix'] : '';
27
+
28
+ if ( ! empty( $tag_prefix ) ) {
29
+ $nested_name = str_replace( '[', '['. $tag_prefix, $nested_name );
30
+ }
31
+
32
+ return $field_name . $nested_name;
33
+
34
+ }
35
+
36
+ public function field_attributes( $custom_atts = array() ) {
37
+
38
+ $field_id = ( ! empty( $this->field['id'] ) ) ? $this->field['id'] : '';
39
+ $attributes = ( ! empty( $this->field['attributes'] ) ) ? $this->field['attributes'] : array();
40
+
41
+ if ( ! empty( $field_id ) && empty( $attributes['data-depend-id'] ) ) {
42
+ $attributes['data-depend-id'] = $field_id;
43
+ }
44
+
45
+ if ( ! empty( $this->field['placeholder'] ) ) {
46
+ $attributes['placeholder'] = $this->field['placeholder'];
47
+ }
48
+
49
+ $attributes = wp_parse_args( $attributes, $custom_atts );
50
+
51
+ $atts = '';
52
+
53
+ if ( ! empty( $attributes ) ) {
54
+ foreach ( $attributes as $key => $value ) {
55
+ if ( $value === 'only-key' ) {
56
+ $atts .= ' '. esc_attr( $key );
57
+ } else {
58
+ $atts .= ' '. esc_attr( $key ) . '="'. esc_attr( $value ) .'"';
59
+ }
60
+ }
61
+ }
62
+
63
+ return $atts;
64
+
65
+ }
66
+
67
+ public function field_before() {
68
+ return ( ! empty( $this->field['before'] ) ) ? '<div class="csf-before-text">'. wp_kses_post( $this->field['before'] ) .'</div>' : '';
69
+ }
70
+
71
+ public function field_after() {
72
+
73
+ $output = ( ! empty( $this->field['after'] ) ) ? '<div class="csf-after-text">'. wp_kses_post( $this->field['after'] ) .'</div>' : '';
74
+ $output .= ( ! empty( $this->field['desc'] ) ) ? '<div class="clear"></div><div class="csf-desc-text">'. wp_kses_post( $this->field['desc'] ) .'</div>' : '';
75
+ $output .= ( ! empty( $this->field['help'] ) ) ? '<div class="csf-help"><span class="csf-help-text">'. wp_kses_post( $this->field['help'] ) .'</span><i class="fas fa-question-circle"></i></div>' : '';
76
+ $output .= ( ! empty( $this->field['_error'] ) ) ? '<div class="csf-error-text">'. wp_kses_post( $this->field['_error'] ) .'</div>' : '';
77
+
78
+ return $output;
79
+
80
+ }
81
+
82
+ public static function field_data( $type = '', $term = false, $query_args = array() ) {
83
+
84
+ $options = array();
85
+ $array_search = false;
86
+
87
+ // sanitize type name
88
+ if ( in_array( $type, array( 'page', 'pages' ) ) ) {
89
+ $option = 'page';
90
+ } else if ( in_array( $type, array( 'post', 'posts' ) ) ) {
91
+ $option = 'post';
92
+ } else if ( in_array( $type, array( 'category', 'categories' ) ) ) {
93
+ $option = 'category';
94
+ } else if ( in_array( $type, array( 'tag', 'tags' ) ) ) {
95
+ $option = 'post_tag';
96
+ } else if ( in_array( $type, array( 'menu', 'menus' ) ) ) {
97
+ $option = 'nav_menu';
98
+ } else {
99
+ $option = '';
100
+ }
101
+
102
+ // switch type
103
+ switch( $type ) {
104
+
105
+ case 'page':
106
+ case 'pages':
107
+ case 'post':
108
+ case 'posts':
109
+
110
+ // term query required for ajax select
111
+ if ( ! empty( $term ) ) {
112
+
113
+ $query = new WP_Query( wp_parse_args( $query_args, array(
114
+ 's' => $term,
115
+ 'post_type' => $option,
116
+ 'post_status' => 'publish',
117
+ 'posts_per_page' => 25,
118
+ ) ) );
119
+
120
+ } else {
121
+
122
+ $query = new WP_Query( wp_parse_args( $query_args, array(
123
+ 'post_type' => $option,
124
+ 'post_status' => 'publish',
125
+ ) ) );
126
+
127
+ }
128
+
129
+ if ( ! is_wp_error( $query ) && ! empty( $query->posts ) ) {
130
+ foreach ( $query->posts as $item ) {
131
+ $options[$item->ID] = $item->post_title;
132
+ }
133
+ }
134
+
135
+ break;
136
+
137
+ case 'category':
138
+ case 'categories':
139
+ case 'tag':
140
+ case 'tags':
141
+ case 'menu':
142
+ case 'menus':
143
+
144
+ if ( ! empty( $term ) ) {
145
+
146
+ $query = new WP_Term_Query( wp_parse_args( $query_args, array(
147
+ 'search' => $term,
148
+ 'taxonomy' => $option,
149
+ 'hide_empty' => false,
150
+ 'number' => 25,
151
+ ) ) );
152
+
153
+ } else {
154
+
155
+ $query = new WP_Term_Query( wp_parse_args( $query_args, array(
156
+ 'taxonomy' => $option,
157
+ 'hide_empty' => false,
158
+ ) ) );
159
+
160
+ }
161
+
162
+ if ( ! is_wp_error( $query ) && ! empty( $query->terms ) ) {
163
+ foreach ( $query->terms as $item ) {
164
+ $options[$item->term_id] = $item->name;
165
+ }
166
+ }
167
+
168
+ break;
169
+
170
+ case 'user':
171
+ case 'users':
172
+
173
+ if ( ! empty( $term ) ) {
174
+
175
+ $query = new WP_User_Query( array(
176
+ 'search' => '*'. $term .'*',
177
+ 'number' => 25,
178
+ 'orderby' => 'title',
179
+ 'order' => 'ASC',
180
+ 'fields' => array( 'display_name', 'ID' )
181
+ ) );
182
+
183
+ } else {
184
+
185
+ $query = new WP_User_Query( array( 'fields' => array( 'display_name', 'ID' ) ) );
186
+
187
+ }
188
+
189
+ if ( ! is_wp_error( $query ) && ! empty( $query->get_results() ) ) {
190
+ foreach ( $query->get_results() as $item ) {
191
+ $options[$item->ID] = $item->display_name;
192
+ }
193
+ }
194
+
195
+ break;
196
+
197
+ case 'sidebar':
198
+ case 'sidebars':
199
+
200
+ global $wp_registered_sidebars;
201
+
202
+ if ( ! empty( $wp_registered_sidebars ) ) {
203
+ foreach ( $wp_registered_sidebars as $sidebar ) {
204
+ $options[$sidebar['id']] = $sidebar['name'];
205
+ }
206
+ }
207
+
208
+ $array_search = true;
209
+
210
+ break;
211
+
212
+ case 'role':
213
+ case 'roles':
214
+
215
+ global $wp_roles;
216
+
217
+ if ( ! empty( $wp_roles ) ) {
218
+ if ( ! empty( $wp_roles->roles ) ) {
219
+ foreach ( $wp_roles->roles as $role_key => $role_value ) {
220
+ $options[$role_key] = $role_value['name'];
221
+ }
222
+ }
223
+ }
224
+
225
+ $array_search = true;
226
+
227
+ break;
228
+
229
+ case 'post_type':
230
+ case 'post_types':
231
+
232
+ $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
233
+
234
+ if ( ! is_wp_error( $post_types ) && ! empty( $post_types ) ) {
235
+ foreach ( $post_types as $post_type ) {
236
+ $options[$post_type->name] = $post_type->labels->name;
237
+ }
238
+ }
239
+
240
+ $array_search = true;
241
+
242
+ break;
243
+
244
+ default:
245
+
246
+ if ( is_callable( $type ) ) {
247
+ if ( ! empty( $term ) ) {
248
+ $options = call_user_func( $type, $query_args );
249
+ } else {
250
+ $options = call_user_func( $type, $term, $query_args );
251
+ }
252
+ }
253
+
254
+ break;
255
+
256
+ }
257
+
258
+ // Array search by "term"
259
+ if ( ! empty( $term ) && ! empty( $options ) && ! empty( $array_search ) ) {
260
+ $options = preg_grep( '/'. $term .'/i', $options );
261
+ }
262
+
263
+ // Make multidimensional array for ajax search
264
+ if ( ! empty( $term ) && ! empty( $options ) ) {
265
+ $arr = array();
266
+ foreach ( $options as $option_key => $option_value ) {
267
+ $arr[] = array( 'value' => $option_key, 'text' => $option_value );
268
+ }
269
+ $options = $arr;
270
+ }
271
+
272
+ return $options;
273
+
274
+ }
275
+
276
+ public function field_wp_query_data_title( $type, $values ) {
277
+
278
+ $options = array();
279
+
280
+ if ( ! empty( $values ) && is_array( $values ) ) {
281
+
282
+ foreach ( $values as $value ) {
283
+
284
+ switch( $type ) {
285
+
286
+ case 'post':
287
+ case 'posts':
288
+ case 'page':
289
+ case 'pages':
290
+
291
+ $title = get_the_title( $value );
292
+
293
+ if ( ! is_wp_error( $title ) && ! empty( $title ) ) {
294
+ $options[$value] = $title;
295
+ }
296
+
297
+ break;
298
+
299
+ case 'category':
300
+ case 'categories':
301
+ case 'tag':
302
+ case 'tags':
303
+ case 'menu':
304
+ case 'menus':
305
+
306
+ $term = get_term( $value );
307
+
308
+ if ( ! is_wp_error( $term ) && ! empty( $term ) ) {
309
+ $options[$value] = $term->name;
310
+ }
311
+
312
+ break;
313
+
314
+ case 'user':
315
+ case 'users':
316
+
317
+ $user = get_user_by( 'id', $value );
318
+
319
+ if ( ! is_wp_error( $user ) && ! empty( $user ) ) {
320
+ $options[$value] = $user->display_name;
321
+ }
322
+
323
+ break;
324
+
325
+ case 'sidebar':
326
+ case 'sidebars':
327
+
328
+ global $wp_registered_sidebars;
329
+
330
+ if ( ! empty( $wp_registered_sidebars[$value] ) ) {
331
+ $options[$value] = $wp_registered_sidebars[$value]['name'];
332
+ }
333
+
334
+ break;
335
+
336
+ case 'role':
337
+ case 'roles':
338
+
339
+ global $wp_roles;
340
+
341
+ if ( ! empty( $wp_roles ) && ! empty( $wp_roles->roles ) && ! empty( $wp_roles->roles[$value] ) ) {
342
+ $options[$value] = $wp_roles->roles[$value]['name'];
343
+ }
344
+
345
+ break;
346
+
347
+ case 'post_type':
348
+ case 'post_types':
349
+
350
+ $post_types = get_post_types( array( 'show_in_nav_menus' => true ) );
351
+
352
+ if ( ! is_wp_error( $post_types ) && ! empty( $post_types ) && ! empty( $post_types[$value] ) ) {
353
+ $options[$value] = ucfirst( $value );
354
+ }
355
+
356
+ break;
357
+
358
+ default:
359
+
360
+ if ( is_callable( $type .'_title' ) ) {
361
+ $options[$value] = call_user_func( $type .'_title', $value );
362
+ } else {
363
+ $options[$value] = ucfirst( $value );
364
+ }
365
+
366
+ break;
367
+
368
+ }
369
+
370
+ }
371
+
372
+ }
373
+
374
+ return $options;
375
+
376
+ }
377
+
378
+ }
379
+ }
includes/libs/codestar-framework/classes/metabox-options.class.php ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Metabox Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Metabox' ) ) {
11
+ class CSF_Metabox extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'metabox';
16
+ public $pre_fields = array();
17
+ public $sections = array();
18
+ public $post_type = array();
19
+ public $args = array(
20
+ 'title' => '',
21
+ 'post_type' => 'post',
22
+ 'data_type' => 'serialize',
23
+ 'context' => 'advanced',
24
+ 'priority' => 'default',
25
+ 'exclude_post_types' => array(),
26
+ 'page_templates' => '',
27
+ 'post_formats' => '',
28
+ 'show_restore' => false,
29
+ 'enqueue_webfont' => true,
30
+ 'async_webfont' => false,
31
+ 'output_css' => true,
32
+ 'theme' => 'dark',
33
+ 'class' => '',
34
+ 'defaults' => array(),
35
+ );
36
+
37
+ // run metabox construct
38
+ public function __construct( $key, $params = array() ) {
39
+
40
+ $this->unique = $key;
41
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
42
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
43
+ $this->post_type = ( is_array( $this->args['post_type'] ) ) ? $this->args['post_type'] : array_filter( (array) $this->args['post_type'] );
44
+ $this->post_formats = ( is_array( $this->args['post_formats'] ) ) ? $this->args['post_formats'] : array_filter( (array) $this->args['post_formats'] );
45
+ $this->page_templates = ( is_array( $this->args['page_templates'] ) ) ? $this->args['page_templates'] : array_filter( (array) $this->args['page_templates'] );
46
+ $this->pre_fields = $this->pre_fields( $this->sections );
47
+
48
+ add_action( 'add_meta_boxes', array( &$this, 'add_meta_box' ) );
49
+ add_action( 'save_post', array( &$this, 'save_meta_box' ) );
50
+ add_action( 'edit_attachment', array( &$this, 'save_meta_box' ) );
51
+
52
+ if ( ! empty( $this->page_templates ) || ! empty( $this->post_formats ) || ! empty( $this->args['class'] ) ) {
53
+ foreach ( $this->post_type as $post_type ) {
54
+ add_filter( 'postbox_classes_'. $post_type .'_'. $this->unique, array( &$this, 'add_metabox_classes' ) );
55
+ }
56
+ }
57
+
58
+ // wp enqeueu for typography and output css
59
+ parent::__construct();
60
+
61
+ }
62
+
63
+ // instance
64
+ public static function instance( $key, $params = array() ) {
65
+ return new self( $key, $params );
66
+ }
67
+
68
+ public function pre_fields( $sections ) {
69
+
70
+ $result = array();
71
+
72
+ foreach ( $sections as $key => $section ) {
73
+ if ( ! empty( $section['fields'] ) ) {
74
+ foreach ( $section['fields'] as $field ) {
75
+ $result[] = $field;
76
+ }
77
+ }
78
+ }
79
+
80
+ return $result;
81
+
82
+ }
83
+
84
+ public function add_metabox_classes( $classes ) {
85
+
86
+ global $post;
87
+
88
+ if ( ! empty( $this->post_formats ) ) {
89
+
90
+ $saved_post_format = ( is_object( $post ) ) ? get_post_format( $post ) : false;
91
+ $saved_post_format = ( ! empty( $saved_post_format ) ) ? $saved_post_format : 'default';
92
+
93
+ $classes[] = 'csf-post-formats';
94
+
95
+ // Sanitize post format for standard to default
96
+ if ( ( $key = array_search( 'standard', $this->post_formats ) ) !== false ) {
97
+ $this->post_formats[$key] = 'default';
98
+ }
99
+
100
+ foreach ( $this->post_formats as $format ) {
101
+ $classes[] = 'csf-post-format-'. $format;
102
+ }
103
+
104
+ if ( ! in_array( $saved_post_format, $this->post_formats ) ) {
105
+ $classes[] = 'csf-metabox-hide';
106
+ } else {
107
+ $classes[] = 'csf-metabox-show';
108
+ }
109
+
110
+ }
111
+
112
+ if ( ! empty( $this->page_templates ) ) {
113
+
114
+ $saved_template = ( is_object( $post ) && ! empty( $post->page_template ) ) ? $post->page_template : 'default';
115
+
116
+ $classes[] = 'csf-page-templates';
117
+
118
+ foreach ( $this->page_templates as $template ) {
119
+ $classes[] = 'csf-page-'. preg_replace( '/[^a-zA-Z0-9]+/', '-', strtolower( $template ) );
120
+ }
121
+
122
+ if ( ! in_array( $saved_template, $this->page_templates ) ) {
123
+ $classes[] = 'csf-metabox-hide';
124
+ } else {
125
+ $classes[] = 'csf-metabox-show';
126
+ }
127
+
128
+ }
129
+
130
+ if ( ! empty( $this->args['class'] ) ) {
131
+ $classes[] = $this->args['class'];
132
+ }
133
+
134
+ return $classes;
135
+
136
+ }
137
+
138
+ // add metabox
139
+ public function add_meta_box( $post_type ) {
140
+
141
+ if ( ! in_array( $post_type, $this->args['exclude_post_types'] ) ) {
142
+ add_meta_box( $this->unique, wp_kses_post( $this->args['title'] ), array( &$this, 'add_meta_box_content' ), $this->post_type, $this->args['context'], $this->args['priority'], $this->args );
143
+ }
144
+
145
+ }
146
+
147
+ // get default value
148
+ public function get_default( $field ) {
149
+
150
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
151
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
152
+
153
+ return $default;
154
+
155
+ }
156
+
157
+ // get meta value
158
+ public function get_meta_value( $field ) {
159
+
160
+ global $post;
161
+
162
+ $value = null;
163
+
164
+ if ( is_object( $post ) && ! empty( $field['id'] ) ) {
165
+
166
+ if ( $this->args['data_type'] !== 'serialize' ) {
167
+ $meta = get_post_meta( $post->ID, $field['id'] );
168
+ $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
169
+ } else {
170
+ $meta = get_post_meta( $post->ID, $this->unique, true );
171
+ $value = ( isset( $meta[$field['id']] ) ) ? $meta[$field['id']] : null;
172
+ }
173
+
174
+ }
175
+
176
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
177
+ $value = ( isset( $value ) ) ? $value : $default;
178
+
179
+ return $value;
180
+
181
+ }
182
+
183
+ // add metabox content
184
+ public function add_meta_box_content( $post, $callback ) {
185
+
186
+ global $post;
187
+
188
+ $has_nav = ( count( $this->sections ) > 1 && $this->args['context'] !== 'side' ) ? true : false;
189
+ $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';
190
+ $errors = ( is_object ( $post ) ) ? get_post_meta( $post->ID, '_csf_errors_'. $this->unique, true ) : array();
191
+ $errors = ( ! empty( $errors ) ) ? $errors : array();
192
+ $theme = ( $this->args['theme'] ) ? ' csf-theme-'. $this->args['theme'] : '';
193
+
194
+ if ( is_object ( $post ) && ! empty( $errors ) ) {
195
+ delete_post_meta( $post->ID, '_csf_errors_'. $this->unique );
196
+ }
197
+
198
+ wp_nonce_field( 'csf_metabox_nonce', 'csf_metabox_nonce'. $this->unique );
199
+
200
+ echo '<div class="csf csf-metabox'. esc_attr( $theme ) .'">';
201
+
202
+ echo '<div class="csf-wrapper'. esc_attr( $show_all ) .'">';
203
+
204
+ if ( $has_nav ) {
205
+
206
+ echo '<div class="csf-nav csf-nav-metabox">';
207
+
208
+ echo '<ul>';
209
+
210
+ $tab_key = 0;
211
+
212
+ foreach ( $this->sections as $section ) {
213
+
214
+ $tab_error = ( ! empty( $errors['sections'][$tab_key] ) ) ? '<i class="csf-label-error csf-error">!</i>' : '';
215
+ $tab_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-tab-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
216
+
217
+ echo '<li><a href="#">'. wp_kses_post( $tab_icon . $section['title'] . $tab_error ) .'</a></li>';
218
+
219
+ $tab_key++;
220
+
221
+ }
222
+
223
+ echo '</ul>';
224
+
225
+ echo '</div>';
226
+
227
+ }
228
+
229
+ echo '<div class="csf-content">';
230
+
231
+ echo '<div class="csf-sections">';
232
+
233
+ $section_key = 0;
234
+
235
+ foreach ( $this->sections as $section ) {
236
+
237
+ $section_onload = ( ! $has_nav ) ? ' csf-onload' : '';
238
+ $section_class = ( ! empty( $section['class'] ) ) ? ' '. $section['class'] : '';
239
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
240
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
241
+
242
+ echo '<div class="csf-section'. esc_attr( $section_onload . $section_class ) .'">';
243
+
244
+ echo ( $section_title || $section_icon ) ? '<div class="csf-section-title"><h3>'. wp_kses_post( $section_icon . $section_title ) .'</h3></div>' : '';
245
+
246
+ if ( ! empty( $section['fields'] ) ) {
247
+
248
+ foreach ( $section['fields'] as $field ) {
249
+
250
+ if ( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
251
+ $field['_error'] = $errors['fields'][$field['id']];
252
+ }
253
+
254
+ if ( ! empty( $field['id'] ) ) {
255
+ $field['default'] = $this->get_default( $field );
256
+ }
257
+
258
+ CSF::field( $field, $this->get_meta_value( $field ), $this->unique, 'metabox' );
259
+
260
+ }
261
+
262
+ } else {
263
+
264
+ echo '<div class="csf-no-option">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';
265
+
266
+ }
267
+
268
+ echo '</div>';
269
+
270
+ $section_key++;
271
+
272
+ }
273
+
274
+ echo '</div>';
275
+
276
+ if ( ! empty( $this->args['show_restore'] ) ) {
277
+
278
+ echo '<div class="csf-sections-restore">';
279
+ echo '<label>';
280
+ echo '<input type="checkbox" name="'. esc_attr( $this->unique ) .'[_restore]" />';
281
+ echo '<span class="button csf-button-restore">'. esc_html__( 'Restore', 'csf' ) .'</span>';
282
+ echo '<span class="button csf-button-cancel">'. sprintf( '<small>( %s )</small> %s', esc_html__( 'update post for restore ', 'csf' ), esc_html__( 'Cancel', 'csf' ) ) .'</span>';
283
+ echo '</label>';
284
+ echo '</div>';
285
+
286
+ }
287
+
288
+ echo '</div>';
289
+
290
+ echo ( $has_nav ) ? '<div class="csf-nav-background"></div>' : '';
291
+
292
+ echo '<div class="clear"></div>';
293
+
294
+ echo '</div>';
295
+
296
+ echo '</div>';
297
+
298
+ }
299
+
300
+ // save metabox
301
+ public function save_meta_box( $post_id ) {
302
+
303
+ $count = 1;
304
+ $data = array();
305
+ $errors = array();
306
+ $noncekey = 'csf_metabox_nonce'. $this->unique;
307
+ $nonce = ( ! empty( $_POST[ $noncekey ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ $noncekey ] ) ) : '';
308
+
309
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! wp_verify_nonce( $nonce, 'csf_metabox_nonce' ) ) {
310
+ return $post_id;
311
+ }
312
+
313
+ // XSS ok.
314
+ // No worries, This "POST" requests is sanitizing in the below foreach.
315
+ $request = ( ! empty( $_POST[ $this->unique ] ) ) ? $_POST[ $this->unique ] : array();
316
+
317
+ if ( ! empty( $request ) ) {
318
+
319
+ foreach ( $this->sections as $section ) {
320
+
321
+ if ( ! empty( $section['fields'] ) ) {
322
+
323
+ foreach ( $section['fields'] as $field ) {
324
+
325
+ if ( ! empty( $field['id'] ) ) {
326
+
327
+ $field_id = $field['id'];
328
+ $field_value = isset( $request[$field_id] ) ? $request[$field_id] : '';
329
+
330
+ // Sanitize "post" request of field.
331
+ if ( ! isset( $field['sanitize'] ) ) {
332
+
333
+ if( is_array( $field_value ) ) {
334
+ $data[$field_id] = wp_kses_post_deep( $field_value );
335
+ } else {
336
+ $data[$field_id] = wp_kses_post( $field_value );
337
+ }
338
+
339
+ } else if( isset( $field['sanitize'] ) && is_callable( $field['sanitize'] ) ) {
340
+
341
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
342
+
343
+ } else {
344
+
345
+ $data[$field_id] = $field_value;
346
+
347
+ }
348
+
349
+ // Validate "post" request of field.
350
+ if ( isset( $field['validate'] ) && is_callable( $field['validate'] ) ) {
351
+
352
+ $has_validated = call_user_func( $field['validate'], $field_value );
353
+
354
+ if ( ! empty( $has_validated ) ) {
355
+
356
+ $errors['sections'][$count] = true;
357
+ $errors['fields'][$field_id] = $has_validated;
358
+ $data[$field_id] = $this->get_meta_value( $field );
359
+
360
+ }
361
+
362
+ }
363
+
364
+ }
365
+
366
+ }
367
+
368
+ }
369
+
370
+ $count++;
371
+
372
+ }
373
+
374
+ }
375
+
376
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $post_id, $this );
377
+
378
+ do_action( "csf_{$this->unique}_save_before", $data, $post_id, $this );
379
+
380
+ if ( empty( $data ) || ! empty( $request['_restore'] ) ) {
381
+
382
+ if ( $this->args['data_type'] !== 'serialize' ) {
383
+ foreach ( $data as $key => $value ) {
384
+ delete_post_meta( $post_id, $key );
385
+ }
386
+ } else {
387
+ delete_post_meta( $post_id, $this->unique );
388
+ }
389
+
390
+ } else {
391
+
392
+ if ( $this->args['data_type'] !== 'serialize' ) {
393
+ foreach ( $data as $key => $value ) {
394
+ update_post_meta( $post_id, $key, $value );
395
+ }
396
+ } else {
397
+ update_post_meta( $post_id, $this->unique, $data );
398
+ }
399
+
400
+ if ( ! empty( $errors ) ) {
401
+ update_post_meta( $post_id, '_csf_errors_'. $this->unique, $errors );
402
+ }
403
+
404
+ }
405
+
406
+ do_action( "csf_{$this->unique}_saved", $data, $post_id, $this );
407
+
408
+ do_action( "csf_{$this->unique}_save_after", $data, $post_id, $this );
409
+
410
+ }
411
+ }
412
+ }
includes/libs/codestar-framework/classes/nav-menu-options.class.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Nav Menu Options Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Nav_Menu_Options' ) ) {
11
+ class CSF_Nav_Menu_Options extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'menu';
16
+ public $sections = array();
17
+ public $args = array(
18
+ 'data_type' => 'serialize',
19
+ 'class' => '',
20
+ 'defaults' => array(),
21
+ );
22
+
23
+ // run menu construct
24
+ public function __construct( $key, $params ) {
25
+
26
+ $this->unique = $key;
27
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
28
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
29
+
30
+ add_action( 'wp_nav_menu_item_custom_fields', array( &$this, 'wp_nav_menu_item_custom_fields' ), 10, 4 );
31
+ add_action( 'wp_update_nav_menu_item', array( &$this, 'wp_update_nav_menu_item' ), 10, 3 );
32
+
33
+ add_filter( 'wp_edit_nav_menu_walker', array( &$this, 'wp_edit_nav_menu_walker' ), 10, 2 );
34
+
35
+ }
36
+
37
+ // instance
38
+ public static function instance( $key, $params ) {
39
+ return new self( $key, $params );
40
+ }
41
+
42
+ public function wp_edit_nav_menu_walker( $class, $menu_id ) {
43
+
44
+ global $wp_version;
45
+
46
+ if( version_compare( $wp_version, '5.4.0', '<' ) ) {
47
+
48
+ if ( ! class_exists( 'CSF_Walker_Nav_Menu_Edit' ) ) {
49
+ CSF::include_plugin_file( 'functions/walker.php' );
50
+ }
51
+
52
+ return 'CSF_Walker_Nav_Menu_Edit';
53
+
54
+ }
55
+
56
+ return $class;
57
+
58
+ }
59
+
60
+ // get default value
61
+ public function get_default( $field ) {
62
+
63
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
64
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
65
+
66
+ return $default;
67
+
68
+ }
69
+
70
+ // get meta value
71
+ public function get_meta_value( $menu_item_id, $field ) {
72
+
73
+ $value = null;
74
+
75
+ if ( ! empty( $menu_item_id ) && ! empty( $field['id'] ) ) {
76
+
77
+ if ( $this->args['data_type'] !== 'serialize' ) {
78
+ $meta = get_post_meta( $menu_item_id, $field['id'] );
79
+ $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
80
+ } else {
81
+ $meta = get_post_meta( $menu_item_id, $this->unique, true );
82
+ $value = ( isset( $meta[$field['id']] ) ) ? $meta[$field['id']] : null;
83
+ }
84
+
85
+ }
86
+
87
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
88
+ $value = ( isset( $value ) ) ? $value : $default;
89
+
90
+ return $value;
91
+
92
+ }
93
+
94
+ //
95
+ public function wp_nav_menu_item_custom_fields( $menu_item_id, $item, $depth, $args ) {
96
+
97
+ $errors = ( ! empty( $menu_item_id ) ) ? get_post_meta( $menu_item_id, '_csf_errors_'. $this->unique, true ) : array();
98
+ $errors = ( ! empty( $errors ) ) ? $errors : array();
99
+ $class = ( $this->args['class'] ) ? ' '. $this->args['class'] : '';
100
+
101
+ if ( ! empty( $errors ) ) {
102
+ delete_post_meta( $menu_item_id, '_csf_errors_'. $this->unique );
103
+ }
104
+
105
+ echo '<div class="csf csf-nav-menu-options'. esc_attr( $class ) .'">';
106
+
107
+ foreach ( $this->sections as $section ) {
108
+
109
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-nav-menu-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
110
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
111
+
112
+ echo '<div class="csf-fields">';
113
+
114
+ echo ( $section_title || $section_icon ) ? '<div class="csf-nav-menu-title"><h4>'. wp_kses_post( $section_icon . $section_title ) .'</h4></div>' : '';
115
+
116
+ if ( ! empty( $section['fields'] ) ) {
117
+
118
+ foreach ( $section['fields'] as $field ) {
119
+
120
+ if ( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
121
+ $field['_error'] = $errors['fields'][$field['id']];
122
+ }
123
+
124
+ if ( ! empty( $field['id'] ) ) {
125
+ $field['default'] = $this->get_default( $field );
126
+ }
127
+
128
+ CSF::field( $field, $this->get_meta_value( $menu_item_id, $field ), $this->unique .'['. $menu_item_id .']', 'menu' );
129
+
130
+ }
131
+
132
+ }
133
+
134
+ echo '</div>';
135
+
136
+ }
137
+
138
+ echo '</div>';
139
+
140
+ }
141
+
142
+ public function wp_update_nav_menu_item( $menu_id, $menu_item_db_id, $menu_item_args ) {
143
+
144
+ $count = 1;
145
+ $data = array();
146
+ $errors = array();
147
+ $noncekey = 'update-nav-menu-nonce';
148
+ $nonce = ( ! empty( $_POST[ $noncekey ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ $noncekey ] ) ) : '';
149
+
150
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! wp_verify_nonce( $nonce, 'update-nav_menu' ) ) {
151
+ return $menu_item_db_id;
152
+ }
153
+
154
+ // XSS ok.
155
+ // No worries, This "POST" requests is sanitizing in the below foreach.
156
+ $request = ( ! empty( $_POST[ $this->unique ][ $menu_item_db_id ] ) ) ? $_POST[ $this->unique ][ $menu_item_db_id ] : array();
157
+
158
+ if ( ! empty( $request ) ) {
159
+
160
+ foreach ( $this->sections as $section ) {
161
+
162
+ if ( ! empty( $section['fields'] ) ) {
163
+
164
+ foreach ( $section['fields'] as $field ) {
165
+
166
+ if ( ! empty( $field['id'] ) ) {
167
+
168
+ $field_id = $field['id'];
169
+ $field_value = isset( $request[$field_id] ) ? $request[$field_id] : '';
170
+
171
+ // Sanitize "post" request of field.
172
+ if ( ! isset( $field['sanitize'] ) ) {
173
+
174
+ if( is_array( $field_value ) ) {
175
+ $data[$field_id] = wp_kses_post_deep( $field_value );
176
+ } else {
177
+ $data[$field_id] = wp_kses_post( $field_value );
178
+ }
179
+
180
+ } else if( isset( $field['sanitize'] ) && is_callable( $field['sanitize'] ) ) {
181
+
182
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
183
+
184
+ } else {
185
+
186
+ $data[$field_id] = $field_value;
187
+
188
+ }
189
+
190
+ // Validate "post" request of field.
191
+ if ( isset( $field['validate'] ) && is_callable( $field['validate'] ) ) {
192
+
193
+ $has_validated = call_user_func( $field['validate'], $field_value );
194
+
195
+ if ( ! empty( $has_validated ) ) {
196
+
197
+ $errors['sections'][$count] = true;
198
+ $errors['fields'][$field_id] = $has_validated;
199
+ $data[$field_id] = $this->get_meta_value( $menu_item_db_id, $field );
200
+
201
+ }
202
+
203
+ }
204
+
205
+ }
206
+
207
+ }
208
+
209
+ }
210
+
211
+ $count++;
212
+
213
+ }
214
+
215
+ }
216
+
217
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $menu_item_db_id, $this );
218
+
219
+ do_action( "csf_{$this->unique}_save_before", $data, $menu_item_db_id, $this );
220
+
221
+ if ( empty( $data ) ) {
222
+
223
+ if ( $this->args['data_type'] !== 'serialize' ) {
224
+ foreach ( $data as $key => $value ) {
225
+ delete_post_meta( $menu_item_db_id, $key );
226
+ }
227
+ } else {
228
+ delete_post_meta( $menu_item_db_id, $this->unique );
229
+ }
230
+
231
+ } else {
232
+
233
+ if ( $this->args['data_type'] !== 'serialize' ) {
234
+ foreach ( $data as $key => $value ) {
235
+ update_post_meta( $menu_item_db_id, $key, $value );
236
+ }
237
+ } else {
238
+ update_post_meta( $menu_item_db_id, $this->unique, $data );
239
+ }
240
+
241
+ if ( ! empty( $errors ) ) {
242
+ update_post_meta( $menu_item_db_id, '_csf_errors_'. $this->unique, $errors );
243
+ }
244
+
245
+ }
246
+
247
+ do_action( "csf_{$this->unique}_saved", $data, $menu_item_db_id, $this );
248
+
249
+ do_action( "csf_{$this->unique}_save_after", $data, $menu_item_db_id, $this );
250
+
251
+ }
252
+
253
+ }
254
+ }
includes/libs/codestar-framework/classes/profile-options.class.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Profile Option Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF_Profile_Options' ) ) {
11
+ class CSF_Profile_Options extends CSF_Abstract{
12
+
13
+ // constans
14
+ public $unique = '';
15
+ public $abstract = 'profile';
16
+ public $sections = array();
17
+ public $args = array(
18
+ 'data_type' => 'serialize',
19
+ 'class' => '',
20
+ 'defaults' => array(),
21
+ );
22
+
23
+ // run profile construct
24
+ public function __construct( $key, $params ) {
25
+
26
+ $this->unique = $key;
27
+ $this->args = apply_filters( "csf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
28
+ $this->sections = apply_filters( "csf_{$this->unique}_sections", $params['sections'], $this );
29
+
30
+ add_action( 'admin_init', array( &$this, 'add_profile_options' ) );
31
+
32
+ }
33
+
34
+ // instance
35
+ public static function instance( $key, $params ) {
36
+ return new self( $key, $params );
37
+ }
38
+
39
+ // add profile add/edit fields
40
+ public function add_profile_options() {
41
+
42
+ add_action( 'show_user_profile', array( &$this, 'render_profile_form_fields' ) );
43
+ add_action( 'edit_user_profile', array( &$this, 'render_profile_form_fields' ) );
44
+
45
+ add_action( 'personal_options_update', array( &$this, 'save_profile' ) );
46
+ add_action( 'edit_user_profile_update', array( &$this, 'save_profile' ) );
47
+
48
+ }
49
+
50
+ // get default value
51
+ public function get_default( $field ) {
52
+
53
+ $default = ( isset( $field['default'] ) ) ? $field['default'] : '';
54
+ $default = ( isset( $this->args['defaults'][$field['id']] ) ) ? $this->args['defaults'][$field['id']] : $default;
55
+
56
+ return $default;
57
+
58
+ }
59
+
60
+ // get meta value
61
+ public function get_meta_value( $user_id, $field ) {
62
+
63
+ $value = null;
64
+
65
+ if ( ! empty( $user_id ) && ! empty( $field['id'] ) ) {
66
+
67
+ if ( $this->args['data_type'] !== 'serialize' ) {
68
+ $meta = get_user_meta( $user_id, $field['id'] );
69
+ $value = ( isset( $meta[0] ) ) ? $meta[0] : null;
70
+ } else {
71
+ $meta = get_user_meta( $user_id, $this->unique, true );
72
+ $value = ( isset( $meta[$field['id']] ) ) ? $meta[$field['id']] : null;
73
+ }
74
+
75
+ }
76
+
77
+ $default = ( isset( $field['id'] ) ) ? $this->get_default( $field ) : '';
78
+ $value = ( isset( $value ) ) ? $value : $default;
79
+
80
+ return $value;
81
+
82
+ }
83
+
84
+ // render profile add/edit form fields
85
+ public function render_profile_form_fields( $profileuser ) {
86
+
87
+ $is_profile = ( is_object( $profileuser ) && isset( $profileuser->ID ) ) ? true : false;
88
+ $profile_id = ( $is_profile ) ? $profileuser->ID : 0;
89
+ $errors = ( ! empty( $profile_id ) ) ? get_user_meta( $profile_id, '_csf_errors_'. $this->unique, true ) : array();
90
+ $errors = ( ! empty( $errors ) ) ? $errors : array();
91
+ $class = ( $this->args['class'] ) ? ''. $this->args['class'] : '';
92
+
93
+ if ( ! empty( $errors ) ) {
94
+ delete_user_meta( $profile_id, '_csf_errors_'. $this->unique );
95
+ }
96
+
97
+ echo '<div class="csf csf-profile-options csf-onload'. esc_attr( $class ) .'">';
98
+
99
+ wp_nonce_field( 'csf_profile_nonce', 'csf_profile_nonce'. $this->unique );
100
+
101
+ foreach ( $this->sections as $section ) {
102
+
103
+ $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="csf-section-icon '. esc_attr( $section['icon'] ) .'"></i>' : '';
104
+ $section_title = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
105
+
106
+ echo ( $section_title || $section_icon ) ? '<h2>'. wp_kses_post( $section_icon . $section_title ) .'</h2>' : '';
107
+
108
+ if ( ! empty( $section['fields'] ) ) {
109
+
110
+ foreach ( $section['fields'] as $field ) {
111
+
112
+ if ( ! empty( $field['id'] ) && ! empty( $errors['fields'][$field['id']] ) ) {
113
+ $field['_error'] = $errors['fields'][$field['id']];
114
+ }
115
+
116
+ if ( ! empty( $field['id'] ) ) {
117
+ $field['default'] = $this->get_default( $field );
118
+ }
119
+
120
+ CSF::field( $field, $this->get_meta_value( $profile_id, $field ), $this->unique, 'profile' );
121
+
122
+ }
123
+
124
+ }
125
+
126
+ }
127
+
128
+ echo '</div>';
129
+
130
+ }
131
+
132
+ // save profile form fields
133
+ public function save_profile( $user_id ) {
134
+
135
+ $count = 1;
136
+ $data = array();
137
+ $errors = array();
138
+ $noncekey = 'csf_profile_nonce'. $this->unique;
139
+ $nonce = ( ! empty( $_POST[ $noncekey ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ $noncekey ] ) ) : '';
140
+
141
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! wp_verify_nonce( $nonce, 'csf_profile_nonce' ) ) {
142
+ return $user_id;
143
+ }
144
+
145
+ // XSS ok.
146
+ // No worries, This "POST" requests is sanitizing in the below foreach.
147
+ $request = ( ! empty( $_POST[ $this->unique ] ) ) ? $_POST[ $this->unique ] : array();
148
+
149
+ if ( ! empty( $request ) ) {
150
+
151
+ foreach ( $this->sections as $section ) {
152
+
153
+ if ( ! empty( $section['fields'] ) ) {
154
+
155
+ foreach ( $section['fields'] as $field ) {
156
+
157
+ if ( ! empty( $field['id'] ) ) {
158
+
159
+ $field_id = $field['id'];
160
+ $field_value = isset( $request[$field_id] ) ? $request[$field_id] : '';
161
+
162
+ // Sanitize "post" request of field.
163
+ if ( ! isset( $field['sanitize'] ) ) {
164
+
165
+ if( is_array( $field_value ) ) {
166
+ $data[$field_id] = wp_kses_post_deep( $field_value );
167
+ } else {
168
+ $data[$field_id] = wp_kses_post( $field_value );
169
+ }
170
+
171
+ } else if( isset( $field['sanitize'] ) && is_callable( $field['sanitize'] ) ) {
172
+
173
+ $data[$field_id] = call_user_func( $field['sanitize'], $field_value );
174
+
175
+ } else {
176
+
177
+ $data[$field_id] = $field_value;
178
+
179
+ }
180
+
181
+ // Validate "post" request of field.
182
+ if ( isset( $field['validate'] ) && is_callable( $field['validate'] ) ) {
183
+
184
+ $has_validated = call_user_func( $field['validate'], $field_value );
185
+
186
+ if ( ! empty( $has_validated ) ) {
187
+
188
+ $errors['sections'][$count] = true;
189
+ $errors['fields'][$field_id] = $has_validated;
190
+ $data[$field_id] = $this->get_meta_value( $user_id, $field );
191
+
192
+ }
193
+
194
+ }
195
+
196
+ }
197
+
198
+ }
199
+
200
+ }
201
+
202
+ $count++;
203
+
204
+ }
205
+
206
+ }
207
+
208
+ $data = apply_filters( "csf_{$this->unique}_save", $data, $user_id, $this );
209
+
210
+ do_action( "csf_{$this->unique}_save_before", $data, $user_id, $this );
211
+
212
+ if ( empty( $data ) ) {
213
+
214
+ if ( $this->args['data_type'] !== 'serialize' ) {
215
+ foreach ( $data as $key => $value ) {
216
+ delete_user_meta( $user_id, $key );
217
+ }
218
+ } else {
219
+ delete_user_meta( $user_id, $this->unique );
220
+ }
221
+
222
+ } else {
223
+
224
+ if ( $this->args['data_type'] !== 'serialize' ) {
225
+ foreach ( $data as $key => $value ) {
226
+ update_user_meta( $user_id, $key, $value );
227
+ }
228
+ } else {
229
+ update_user_meta( $user_id, $this->unique, $data );
230
+ }
231
+
232
+ if ( ! empty( $errors ) ) {
233
+ update_user_meta( $user_id, '_csf_errors_'. $this->unique, $errors );
234
+ }
235
+
236
+ }
237
+
238
+ do_action( "csf_{$this->unique}_saved", $data, $user_id, $this );
239
+
240
+ do_action( "csf_{$this->unique}_save_after", $data, $user_id, $this );
241
+
242
+ }
243
+ }
244
+ }
includes/libs/codestar-framework/classes/setup.class.php ADDED
@@ -0,0 +1,693 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
+ /**
3
+ *
4
+ * Setup Class
5
+ *
6
+ * @since 1.0.0
7
+ * @version 1.0.0
8
+ *
9
+ */
10
+ if ( ! class_exists( 'CSF' ) ) {
11
+ class CSF {
12
+
13
+ // Default constants
14
+ public static $premium = true;
15
+ public static $version = '2.1.7';
16
+ public static $dir = '';
17
+ public static $url = '';
18
+ public static $css = '';
19
+ public static $webfonts = array();
20
+ public static $subsets = array();
21
+ public static $inited = array();
22
+ public static $fields = array();
23
+ public static $args = array(
24
+ 'admin_options' => array(),
25
+ 'customize_options' => array(),
26
+ 'metabox_options' => array(),
27
+ 'nav_menu_options' => array(),
28
+ 'profile_options' => array(),
29
+ 'taxonomy_options' => array(),
30
+ 'widget_options' => array(),
31
+ 'comment_options' => array(),
32
+ 'shortcode_options' => array(),
33
+ );
34
+
35
+ // Shortcode instances
36
+ public static $shortcode_instances = array();
37
+
38
+ // Initalize
39
+ public static function init() {
40
+
41
+ // Init action
42
+ do_action( 'csf_init' );
43
+
44
+ // Set directory constants
45
+ self::constants();
46
+
47
+ // Include files
48
+ self::includes();
49
+
50
+ // Setup textdomain
51
+ self::textdomain();
52
+
53
+ add_action( 'after_setup_theme', array( 'CSF', 'setup' ) );
54
+ add_action( 'init', array( 'CSF', 'setup' ) );
55
+ add_action( 'switch_theme', array( 'CSF', 'setup' ) );
56
+ add_action( 'admin_enqueue_scripts', array( 'CSF', 'add_admin_enqueue_scripts' ) );
57
+ add_action( 'wp_enqueue_scripts', array( 'CSF', 'add_typography_enqueue_styles' ), 80 );
58
+ add_action( 'wp_head', array( 'CSF', 'add_custom_css' ), 80 );
59
+
60
+ }
61
+
62
+ // Setup frameworks
63
+ public static function setup() {
64
+
65
+ // Welcome page
66
+ self::include_plugin_file( 'views/welcome.php' );
67
+
68
+ // Setup admin option framework
69
+ $params = array();
70
+ if ( ! empty( self::$args['admin_options'] ) ) {
71
+ foreach ( self::$args['admin_options'] as $key => $value ) {
72
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
73
+
74
+ $params['args'] = $value;
75
+ $params['sections'] = self::$args['sections'][$key];
76
+ self::$inited[$key] = true;
77
+
78
+ CSF_Options::instance( $key, $params );
79
+
80
+ if ( ! empty( $value['show_in_customizer'] ) ) {
81
+ $value['output_css'] = false;
82
+ $value['enqueue_webfont'] = false;
83
+ self::$args['customize_options'][$key] = $value;
84
+ self::$inited[$key] = null;
85
+ }
86
+
87
+ }
88
+ }
89
+ }
90
+
91
+ // Setup customize option framework
92
+ $params = array();
93
+ if ( ! empty( self::$args['customize_options'] ) ) {
94
+ foreach ( self::$args['customize_options'] as $key => $value ) {
95
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
96
+
97
+ $params['args'] = $value;
98
+ $params['sections'] = self::$args['sections'][$key];
99
+ self::$inited[$key] = true;
100
+
101
+ CSF_Customize_Options::instance( $key, $params );
102
+
103
+ }
104
+ }
105
+ }
106
+
107
+ // Setup metabox option framework
108
+ $params = array();
109
+ if ( ! empty( self::$args['metabox_options'] ) ) {
110
+ foreach ( self::$args['metabox_options'] as $key => $value ) {
111
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
112
+
113
+ $params['args'] = $value;
114
+ $params['sections'] = self::$args['sections'][$key];
115
+ self::$inited[$key] = true;
116
+
117
+ CSF_Metabox::instance( $key, $params );
118
+
119
+ }
120
+ }
121
+ }
122
+
123
+ // Setup nav menu option framework
124
+ $params = array();
125
+ if ( ! empty( self::$args['nav_menu_options'] ) ) {
126
+ foreach ( self::$args['nav_menu_options'] as $key => $value ) {
127
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
128
+
129
+ $params['args'] = $value;
130
+ $params['sections'] = self::$args['sections'][$key];
131
+ self::$inited[$key] = true;
132
+
133
+ CSF_Nav_Menu_Options::instance( $key, $params );
134
+
135
+ }
136
+ }
137
+ }
138
+
139
+ // Setup profile option framework
140
+ $params = array();
141
+ if ( ! empty( self::$args['profile_options'] ) ) {
142
+ foreach ( self::$args['profile_options'] as $key => $value ) {
143
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
144
+
145
+ $params['args'] = $value;
146
+ $params['sections'] = self::$args['sections'][$key];
147
+ self::$inited[$key] = true;
148
+
149
+ CSF_Profile_Options::instance( $key, $params );
150
+
151
+ }
152
+ }
153
+ }
154
+
155
+ // Setup taxonomy option framework
156
+ $params = array();
157
+ if ( ! empty( self::$args['taxonomy_options'] ) ) {
158
+ $taxonomy = ( isset( $_GET['taxonomy'] ) ) ? sanitize_text_field( wp_unslash( $_GET['taxonomy'] ) ) : '';
159
+ foreach ( self::$args['taxonomy_options'] as $key => $value ) {
160
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
161
+
162
+ $params['args'] = $value;
163
+ $params['sections'] = self::$args['sections'][$key];
164
+ self::$inited[$key] = true;
165
+
166
+ CSF_Taxonomy_Options::instance( $key, $params );
167
+
168
+ }
169
+ }
170
+ }
171
+
172
+ // Setup widget option framework
173
+ if ( ! empty( self::$args['widget_options'] ) && class_exists( 'WP_Widget_Factory' ) ) {
174
+ $wp_widget_factory = new WP_Widget_Factory();
175
+ foreach ( self::$args['widget_options'] as $key => $value ) {
176
+ if ( ! isset( self::$inited[$key] ) ) {
177
+
178
+ self::$inited[$key] = true;
179
+ $wp_widget_factory->register( CSF_Widget::instance( $key, $value ) );
180
+
181
+ }
182
+ }
183
+ }
184
+
185
+ // Setup comment option framework
186
+ $params = array();
187
+ if ( ! empty( self::$args['comment_options'] ) ) {
188
+ foreach ( self::$args['comment_options'] as $key => $value ) {
189
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
190
+
191
+ $params['args'] = $value;
192
+ $params['sections'] = self::$args['sections'][$key];
193
+ self::$inited[$key] = true;
194
+
195
+ CSF_Comment_Metabox::instance( $key, $params );
196
+
197
+ }
198
+ }
199
+ }
200
+
201
+ // Setup shortcode option framework
202
+ $params = array();
203
+ if ( ! empty( self::$args['shortcode_options'] ) ) {
204
+
205
+ foreach ( self::$args['shortcode_options'] as $key => $value ) {
206
+ if ( ! empty( self::$args['sections'][$key] ) && ! isset( self::$inited[$key] ) ) {
207
+
208
+ $params['args'] = $value;
209
+ $params['sections'] = self::$args['sections'][$key];
210
+ self::$inited[$key] = true;
211
+
212
+ CSF_Shortcoder::instance( $key, $params );
213
+
214
+ }
215
+ }
216
+
217
+ // Once editor setup for gutenberg and media buttons
218
+ if ( ! empty( CSF::$shortcode_instances ) ) {
219
+ CSF_Shortcoder::once_editor_setup();
220
+ }
221
+
222
+ }
223
+
224
+ do_action( 'csf_loaded' );
225
+
226
+ }
227
+
228
+ // Create options
229
+ public static function createOptions( $id, $args = array() ) {
230
+ self::$args['admin_options'][$id] = $args;
231
+ }
232
+
233
+ // Create customize options
234
+ public static function createCustomizeOptions( $id, $args = array() ) {
235
+ self::$args['customize_options'][$id] = $args;
236
+ }
237
+
238
+ // Create metabox options
239
+ public static function createMetabox( $id, $args = array() ) {
240
+ self::$args['metabox_options'][$id] = $args;
241
+ }
242
+
243
+ // Create menu options
244
+ public static function createNavMenuOptions( $id, $args = array() ) {
245
+ self::$args['nav_menu_options'][$id] = $args;
246
+ }
247
+
248
+ // Create shortcoder options
249
+ public static function createShortcoder( $id, $args = array() ) {
250
+ self::$args['shortcode_options'][$id] = $args;
251
+ }
252
+
253
+ // Create taxonomy options
254
+ public static function createTaxonomyOptions( $id, $args = array() ) {
255
+ self::$args['taxonomy_options'][$id] = $args;
256
+ }
257
+
258
+ // Create profile options
259
+ public static function createProfileOptions( $id, $args = array() ) {
260
+ self::$args['profile_options'][$id] = $args;
261
+ }
262
+
263
+ // Create widget
264
+ public static function createWidget( $id, $args = array() ) {
265
+ self::$args['widget_options'][$id] = $args;
266
+ self::set_used_fields( $args );
267
+ }
268
+
269
+ // Create comment metabox
270
+ public static function createCommentMetabox( $id, $args = array() ) {
271
+ self::$args['comment_options'][$id] = $args;
272
+ }
273
+
274
+ // Create section
275
+ public static function createSection( $id, $sections ) {
276
+ self::$args['sections'][$id][] = $sections;
277
+ self::set_used_fields( $sections );
278
+ }
279
+
280
+ // Set directory constants
281
+ public static function constants() {
282
+
283
+ // We need this path-finder code for set URL of framework
284
+ $dirname = wp_normalize_path( dirname( dirname( __FILE__ ) ) );
285
+ $theme_dir = wp_normalize_path( get_parent_theme_file_path() );
286
+ $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
287
+ $located_plugin = ( preg_match( '#'. self::sanitize_dirname( $plugin_dir ) .'#', self::sanitize_dirname( $dirname ) ) ) ? true : false;
288
+ $directory = ( $located_plugin ) ? $plugin_dir : $theme_dir;
289
+ $directory_uri = ( $located_plugin ) ? WP_PLUGIN_URL : get_parent_theme_file_uri();
290
+ $foldername = str_replace( $directory, '', $dirname );
291
+ $protocol_uri = ( is_ssl() ) ? 'https' : 'http';
292
+ $directory_uri = set_url_scheme( $directory_uri, $protocol_uri );
293
+
294
+ self::$dir = $dirname;
295
+ self::$url = $directory_uri . $foldername;
296
+
297
+ }
298
+
299
+ // Include file helper
300
+ public static function include_plugin_file( $file, $load = true ) {
301
+
302
+ $path = '';
303
+ $file = ltrim( $file, '/' );
304
+ $override = apply_filters( 'csf_override', 'csf-override' );
305
+
306
+ if ( file_exists( get_parent_theme_file_path( $override .'/'. $file ) ) ) {
307
+ $path = get_parent_theme_file_path( $override .'/'. $file );
308
+ } elseif ( file_exists( get_theme_file_path( $override .'/'. $file ) ) ) {
309
+ $path = get_theme_file_path( $override .'/'. $file );
310
+ } elseif ( file_exists( self::$dir .'/'. $override .'/'. $file ) ) {
311
+ $path = self::$dir .'/'. $override .'/'. $file;
312
+ } elseif ( file_exists( self::$dir .'/'. $file ) ) {
313
+ $path = self::$dir .'/'. $file;
314
+ }
315
+
316
+ if ( ! empty( $path ) && ! empty( $file ) && $load ) {
317
+
318
+ global $wp_query;
319
+
320
+ if ( is_object( $wp_query ) && function_exists( 'load_template' ) ) {
321
+
322
+ load_template( $path, true );
323
+
324
+ } else {
325
+
326
+ require_once( $path );
327
+
328
+ }
329
+
330
+ } else {
331
+
332
+ return self::$dir .'/'. $file;
333
+
334
+ }
335
+
336
+ }
337
+
338
+ // Is active plugin helper
339
+ public static function is_active_plugin( $file = '' ) {
340
+ return in_array( $file, (array) get_option( 'active_plugins', array() ) );
341
+ }
342
+
343
+ // Sanitize dirname
344
+ public static function sanitize_dirname( $dirname ) {
345
+ return preg_replace( '/[^A-Za-z]/', '', $dirname );
346
+ }
347
+
348
+ // Set url constant
349
+ public static function include_plugin_url( $file ) {
350
+ return esc_url( self::$url ) .'/'. ltrim( $file, '/' );
351
+ }
352
+
353
+ // Include files
354
+ public static function includes() {
355
+
356
+ // Helpers
357
+ self::include_plugin_file( 'functions/actions.php' );
358
+ self::include_plugin_file( 'functions/helpers.php' );
359
+ self::include_plugin_file( 'functions/sanitize.php' );
360
+ self::include_plugin_file( 'functions/validate.php' );
361
+
362
+ // Includes free version classes
363
+ self::include_plugin_file( 'classes/abstract.class.php' );
364
+ self::include_plugin_file( 'classes/fields.class.php' );
365
+ self::include_plugin_file( 'classes/admin-options.class.php