WordPress Page Builder – Beaver Builder - Version 1.9.5.1

Version Description

Download this release

Release Info

Developer justinbusa
Plugin Icon 128x128 WordPress Page Builder – Beaver Builder
Version 1.9.5.1
Comparing to
See all releases

Code changes from version 1.9.4 to 1.9.5.1

Files changed (73) hide show
  1. .gitattributes +0 -1
  2. changelog.txt +53 -0
  3. classes/class-fl-builder-ajax-layout.php +8 -1
  4. classes/class-fl-builder-ajax.php +3 -1
  5. classes/class-fl-builder-fonts.php +126 -10
  6. classes/class-fl-builder-import.php +1 -1
  7. classes/class-fl-builder-importer.php +1 -1
  8. classes/class-fl-builder-loader.php +1 -1
  9. classes/class-fl-builder-loop.php +129 -14
  10. classes/class-fl-builder-model.php +16 -3
  11. classes/class-fl-builder-module.php +11 -4
  12. classes/class-fl-builder-photo.php +7 -1
  13. classes/class-fl-builder-service-convertkit.php +6 -1
  14. classes/class-fl-builder-service-email-address.php +33 -28
  15. classes/class-fl-builder.php +54 -13
  16. css/fl-builder-layout.css +19 -2
  17. fl-builder.php +1 -1
  18. includes/compatibility.php +30 -0
  19. includes/field-code.php +4 -0
  20. includes/field-unit.php +5 -5
  21. includes/layout-js-config.php +3 -0
  22. includes/strings.php +4 -4
  23. includes/template-selector.php +8 -8
  24. includes/ui-panel.php +2 -2
  25. includes/updater-config.php +1 -1
  26. includes/updater/classes/class-fl-updater.php +24 -23
  27. index.php +2 -0
  28. js/fl-builder-layout.js +15 -10
  29. js/fl-builder.js +21 -3
  30. js/fl-builder.min.js +6 -6
  31. js/fl-lightbox.js +0 -5
  32. languages/af_ZA.mo +0 -0
  33. languages/ar.mo +0 -0
  34. languages/cs_CZ.mo +0 -0
  35. languages/da_DK.mo +0 -0
  36. languages/de.mo +0 -0
  37. languages/el_GR.mo +0 -0
  38. languages/es.mo +0 -0
  39. languages/es_MX.mo +0 -0
  40. languages/fa.mo +0 -0
  41. languages/fi.mo +0 -0
  42. languages/fr.mo +0 -0
  43. languages/fr_CA.mo +0 -0
  44. languages/he_IL.mo +0 -0
  45. languages/hi_IN.mo +0 -0
  46. languages/hr.mo +0 -0
  47. languages/hu.mo +0 -0
  48. languages/id.mo +0 -0
  49. languages/it.mo +0 -0
  50. languages/ja_JP.mo +0 -0
  51. languages/ko_KR.mo +0 -0
  52. languages/mr.mo +0 -0
  53. languages/ms.mo +0 -0
  54. languages/nb_NO.mo +0 -0
  55. languages/nl.mo +0 -0
  56. languages/pl.mo +0 -0
  57. languages/pt.mo +0 -0
  58. languages/pt_BR.mo +0 -0
  59. languages/ru.mo +0 -0
  60. languages/sk.mo +0 -0
  61. languages/sl_SI.mo +0 -0
  62. languages/sv_SE.mo +0 -0
  63. languages/th.mo +0 -0
  64. languages/tl_PH.mo +0 -0
  65. languages/tr.mo +0 -0
  66. languages/uk_UA.mo +0 -0
  67. languages/vi_VN.mo +0 -0
  68. languages/zh_CN.mo +0 -0
  69. languages/zh_TW.mo +0 -0
  70. modules/photo/css/frontend.responsive.css +4 -0
  71. modules/photo/photo.php +8 -6
  72. modules/video/video.php +5 -3
  73. readme.txt +4 -4
.gitattributes DELETED
@@ -1 +0,0 @@
1
- data/templates.dat binary
 
changelog.txt CHANGED
@@ -1,3 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <h4>1.9.4 - 01/18/2017</h4>
2
  <p><strong>Bug Fixes</strong></p>
3
  <ul>
1
+ <h4>1.9.5.1 - 3/21/2017</h4>
2
+ <p><strong>Bug Fixes</strong></p>
3
+ <ul>
4
+ <li>Rolled back change in 1.9.5 that fixed some photos not going full width on mobile. That was causing all photos to go full width on mobile even when not intended. We’ll revisit that fix in 1.10.</li>
5
+ </ul>
6
+
7
+ <h4>1.9.5 - 3/20/2017</h4>
8
+ <p><strong>Enhancements</strong></p>
9
+ <ul>
10
+ <li>Posts module pagination now works separately when multiple Posts modules are on a page.</li>
11
+ <li>Added support for WooCommerce Memberships.</li>
12
+ <li>Added support for setting a custom subject in the Contact Form and Subscribe Form modules.</li>
13
+ <li>Added JS config for overriding the offset of waypoint animations.</li>
14
+ <li>Added support for font-weights that have 'i' at the end of their value string.</li>
15
+ <li>Added fl_builder_editing_enabled filter.</li>
16
+ <li>Added fl_builder_module_details filter.</li>
17
+ <li>Added logic to prevent bad JS entered into the layout settings from breaking the builder.</li>
18
+ <li>Added post_class() call to the Posts module.</li>
19
+ <li>Update Google Fonts.</li>
20
+ </ul>
21
+ <p><strong>Changes</strong></p>
22
+ <ul>
23
+ <li>Changed Video module embed field to a code editor.</li>
24
+ <li>Removed outline from the Accordion module when an item has focus.</li>
25
+ </ul>
26
+ <p><strong>Bug Fixes</strong></p>
27
+ <ul>
28
+ <li>Fixed content disappearing or being ordered incorrectly when dragging and dropping nested columns.</li>
29
+ <li>Fixed Posts module pagination not working when rendered via a shortcode.</li>
30
+ <li>Fixed module settings JS errors in Safari.</li>
31
+ <li>Fixed warning caused when DOING_AJAX is already defined.</li>
32
+ <li>Fixed Gravity Forms not showing in the Button module lightbox.</li>
33
+ <li>Fixed IE flexbox issues with full-height rows.</li>
34
+ <li>Fixed nested menu items not opening in the Menu module's accordion layout.</li>
35
+ <li>Fixed module export/import not working.</li>
36
+ <li>Fixed non-breaking space in the Number module.</li>
37
+ <li>Fixed content in nested columns not being exported to the default WordPress editor.</li>
38
+ <li>Fixed Posts Carousel and Posts Gallery icons always showing even when set not to display.</li>
39
+ <li>Fixed YouTube and Vimeo video backgrounds not filling the full width and height of a row.</li>
40
+ <li>Fixed photos not going full width on mobile devices.</li>
41
+ <li>Fixed pagination double slashes when using permalinks with no ending slash.</li>
42
+ <li>Fixed multiple translation issues.</li>
43
+ <li>Fixed photo fields showing incorrect selection when switching site to HTTPS.</li>
44
+ <li>Fixed layout settings css not applying when overriding/appending a user template.</li>
45
+ <li>Fixed validation errors with Map module.</li>
46
+ <li>Fixed conflict with WPEngine's PHP Compatibility plugin reporting a PHP7 warning.</li>
47
+ <li>Fixed ReCaptcha conflicts with other plugins.</li>
48
+ <li>Fixed linking to a specific tab in the Tabs module.</li>
49
+ <li>Fixed name being set to 0 in the Subscribe Form module when using ConvertKit.</li>
50
+ <li>Fixed PHP warning in the Gallery module when an image doesn't have an ID.</li>
51
+ <li>Fixed JavaScript error in FireFox.</li>
52
+ </ul>
53
+
54
  <h4>1.9.4 - 01/18/2017</h4>
55
  <p><strong>Bug Fixes</strong></p>
56
  <ul>
classes/class-fl-builder-ajax-layout.php CHANGED
@@ -460,7 +460,14 @@ final class FLBuilderAJAXLayout {
460
  }
461
 
462
  $assets['js'] .= 'FLBuilder._renderLayoutComplete();';
463
- $assets['js'] = FLJSMin::minify( $assets['js'] );
 
 
 
 
 
 
 
464
  }
465
  else {
466
  $assets['js'] = $asset_info['js_url'] . '?ver=' . $asset_ver;
460
  }
461
 
462
  $assets['js'] .= 'FLBuilder._renderLayoutComplete();';
463
+
464
+ try {
465
+ $min = FLJSMin::minify( $assets['js'] );
466
+ } catch (Exception $e) {}
467
+
468
+ if ( $min ) {
469
+ $assets['js'] = $min;
470
+ }
471
  }
472
  else {
473
  $assets['js'] = $asset_info['js_url'] . '?ver=' . $asset_ver;
classes/class-fl-builder-ajax.php CHANGED
@@ -202,7 +202,9 @@ final class FLBuilderAJAX {
202
  }
203
 
204
  // Tell WordPress this is an AJAX request.
205
- define( 'DOING_AJAX', true );
 
 
206
 
207
  // Allow developers to hook before the action runs.
208
  do_action( 'fl_ajax_before_' . $action['action'], $keys_args );
202
  }
203
 
204
  // Tell WordPress this is an AJAX request.
205
+ if ( ! defined( 'DOING_AJAX' ) ) {
206
+ define( 'DOING_AJAX', true );
207
+ }
208
 
209
  // Allow developers to hook before the action runs.
210
  do_action( 'fl_ajax_before_' . $action['action'], $keys_args );
classes/class-fl-builder-fonts.php CHANGED
@@ -97,7 +97,7 @@ final class FLBuilderFonts {
97
  */
98
  static public function get_weight_string( $weight ){
99
 
100
- $weight_string = array(
101
  'default' => __( 'Default', 'fl-builder' ),
102
  'regular' => __( 'Regular', 'fl-builder' ),
103
  '100' => 'Thin 100',
@@ -109,7 +109,7 @@ final class FLBuilderFonts {
109
  '700' => 'Bold 700',
110
  '800' => 'Extra-Bold 800',
111
  '900' => 'Ultra-Bold 900'
112
- );
113
 
114
  return $weight_string[ $weight ];
115
  }
@@ -138,7 +138,12 @@ final class FLBuilderFonts {
138
  if ( 'regular' == $font['weight'] ) {
139
  $css .= 'font-weight: normal;';
140
  } else {
141
- $css .= 'font-weight: '. $font['weight'] .';';
 
 
 
 
 
142
  }
143
 
144
  echo $css;
@@ -328,9 +333,9 @@ final class FLBuilderFontFamilies {
328
  * @var array
329
  */
330
  static public $google = array(
331
- "ABeeZee" => array(
332
- "regular",
333
- ),
334
  "Abel" => array(
335
  "regular",
336
  ),
@@ -552,6 +557,10 @@ final class FLBuilderFontFamilies {
552
  "Armata" => array(
553
  "regular",
554
  ),
 
 
 
 
555
  "Artifika" => array(
556
  "regular",
557
  ),
@@ -565,6 +574,7 @@ final class FLBuilderFontFamilies {
565
  ),
566
  "Asap" => array(
567
  "regular",
 
568
  "700",
569
  ),
570
  "Asar" => array(
@@ -643,6 +653,9 @@ final class FLBuilderFontFamilies {
643
  "Bad Script" => array(
644
  "regular",
645
  ),
 
 
 
646
  "Baloo" => array(
647
  "regular",
648
  ),
@@ -673,6 +686,9 @@ final class FLBuilderFontFamilies {
673
  "Bangers" => array(
674
  "regular",
675
  ),
 
 
 
676
  "Basic" => array(
677
  "regular",
678
  ),
@@ -951,7 +967,9 @@ final class FLBuilderFontFamilies {
951
  "regular",
952
  ),
953
  "Chivo" => array(
 
954
  "regular",
 
955
  "900",
956
  ),
957
  "Chonburi" => array(
@@ -1344,13 +1362,41 @@ final class FLBuilderFontFamilies {
1344
  ),
1345
  "Fira Mono" => array(
1346
  "regular",
 
1347
  "700",
1348
  ),
1349
  "Fira Sans" => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1350
  "300",
1351
  "regular",
1352
  "500",
 
1353
  "700",
 
 
1354
  ),
1355
  "Fjalla One" => array(
1356
  "regular",
@@ -2193,12 +2239,26 @@ final class FLBuilderFontFamilies {
2193
  "regular",
2194
  ),
2195
  "Montserrat" => array(
 
 
 
2196
  "regular",
 
 
2197
  "700",
 
 
2198
  ),
2199
  "Montserrat Alternates" => array(
 
 
 
2200
  "regular",
 
 
2201
  "700",
 
 
2202
  ),
2203
  "Montserrat Subrayada" => array(
2204
  "regular",
@@ -2242,8 +2302,13 @@ final class FLBuilderFontFamilies {
2242
  "800",
2243
  ),
2244
  "Muli" => array(
 
2245
  "300",
2246
  "regular",
 
 
 
 
2247
  ),
2248
  "Mystery Quest" => array(
2249
  "regular",
@@ -2331,9 +2396,22 @@ final class FLBuilderFontFamilies {
2331
  "regular",
2332
  ),
2333
  "Nunito" => array(
 
 
 
 
 
 
 
 
 
 
2334
  "300",
2335
  "regular",
 
2336
  "700",
 
 
2337
  ),
2338
  "Odor Mean Chey" => array(
2339
  "regular",
@@ -2386,8 +2464,11 @@ final class FLBuilderFontFamilies {
2386
  "regular",
2387
  ),
2388
  "Oswald" => array(
 
2389
  "300",
2390
  "regular",
 
 
2391
  "700",
2392
  ),
2393
  "Over the Rainbow" => array(
@@ -2401,6 +2482,22 @@ final class FLBuilderFontFamilies {
2401
  "Overlock SC" => array(
2402
  "regular",
2403
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2404
  "Ovo" => array(
2405
  "regular",
2406
  ),
@@ -2437,6 +2534,10 @@ final class FLBuilderFontFamilies {
2437
  "Pacifico" => array(
2438
  "regular",
2439
  ),
 
 
 
 
2440
  "Palanquin" => array(
2441
  "100",
2442
  "200",
@@ -2452,6 +2553,9 @@ final class FLBuilderFontFamilies {
2452
  "600",
2453
  "700",
2454
  ),
 
 
 
2455
  "Paprika" => array(
2456
  "regular",
2457
  ),
@@ -2537,7 +2641,10 @@ final class FLBuilderFontFamilies {
2537
  ),
2538
  "Podkova" => array(
2539
  "regular",
 
 
2540
  "700",
 
2541
  ),
2542
  "Poiret One" => array(
2543
  "regular",
@@ -2643,6 +2750,7 @@ final class FLBuilderFontFamilies {
2643
  "Quicksand" => array(
2644
  "300",
2645
  "regular",
 
2646
  "700",
2647
  ),
2648
  "Quintessential" => array(
@@ -2777,8 +2885,15 @@ final class FLBuilderFontFamilies {
2777
  "regular",
2778
  ),
2779
  "Rokkitt" => array(
 
 
 
2780
  "regular",
 
 
2781
  "700",
 
 
2782
  ),
2783
  "Romanesco" => array(
2784
  "regular",
@@ -2809,9 +2924,6 @@ final class FLBuilderFontFamilies {
2809
  "Rubik Mono One" => array(
2810
  "regular",
2811
  ),
2812
- "Rubik One" => array(
2813
- "regular",
2814
- ),
2815
  "Ruda" => array(
2816
  "regular",
2817
  "700",
@@ -2861,8 +2973,11 @@ final class FLBuilderFontFamilies {
2861
  "Sancreek" => array(
2862
  "regular",
2863
  ),
2864
- "Sansita One" => array(
2865
  "regular",
 
 
 
2866
  ),
2867
  "Sarala" => array(
2868
  "regular",
@@ -3255,6 +3370,7 @@ final class FLBuilderFontFamilies {
3255
  ),
3256
  "Unna" => array(
3257
  "regular",
 
3258
  ),
3259
  "VT323" => array(
3260
  "regular",
97
  */
98
  static public function get_weight_string( $weight ){
99
 
100
+ $weight_string = apply_filters( 'fl_builder_font_weight_strings', array(
101
  'default' => __( 'Default', 'fl-builder' ),
102
  'regular' => __( 'Regular', 'fl-builder' ),
103
  '100' => 'Thin 100',
109
  '700' => 'Bold 700',
110
  '800' => 'Extra-Bold 800',
111
  '900' => 'Ultra-Bold 900'
112
+ ) );
113
 
114
  return $weight_string[ $weight ];
115
  }
138
  if ( 'regular' == $font['weight'] ) {
139
  $css .= 'font-weight: normal;';
140
  } else {
141
+ if ( 'i' == substr( $font['weight'], -1 ) ) {
142
+ $css .= 'font-weight: '. substr( $font['weight'], 0, -1 ) .';';
143
+ $css .= 'font-style: italic;';
144
+ } else {
145
+ $css .= 'font-weight: '. $font['weight'] .';';
146
+ }
147
  }
148
 
149
  echo $css;
333
  * @var array
334
  */
335
  static public $google = array(
336
+ "ABeeZee" => array(
337
+ "regular",
338
+ ),
339
  "Abel" => array(
340
  "regular",
341
  ),
557
  "Armata" => array(
558
  "regular",
559
  ),
560
+ "Arsenal" => array(
561
+ "regular",
562
+ "700",
563
+ ),
564
  "Artifika" => array(
565
  "regular",
566
  ),
574
  ),
575
  "Asap" => array(
576
  "regular",
577
+ "500",
578
  "700",
579
  ),
580
  "Asar" => array(
653
  "Bad Script" => array(
654
  "regular",
655
  ),
656
+ "Bahiana" => array(
657
+ "regular",
658
+ ),
659
  "Baloo" => array(
660
  "regular",
661
  ),
686
  "Bangers" => array(
687
  "regular",
688
  ),
689
+ "Barrio" => array(
690
+ "regular",
691
+ ),
692
  "Basic" => array(
693
  "regular",
694
  ),
967
  "regular",
968
  ),
969
  "Chivo" => array(
970
+ "300",
971
  "regular",
972
+ "700",
973
  "900",
974
  ),
975
  "Chonburi" => array(
1362
  ),
1363
  "Fira Mono" => array(
1364
  "regular",
1365
+ "500",
1366
  "700",
1367
  ),
1368
  "Fira Sans" => array(
1369
+ "100",
1370
+ "200",
1371
+ "300",
1372
+ "regular",
1373
+ "500",
1374
+ "600",
1375
+ "700",
1376
+ "800",
1377
+ "900",
1378
+ ),
1379
+ "Fira Sans Condensed" => array(
1380
+ "100",
1381
+ "200",
1382
+ "300",
1383
+ "regular",
1384
+ "500",
1385
+ "600",
1386
+ "700",
1387
+ "800",
1388
+ "900",
1389
+ ),
1390
+ "Fira Sans Extra Condensed" => array(
1391
+ "100",
1392
+ "200",
1393
  "300",
1394
  "regular",
1395
  "500",
1396
+ "600",
1397
  "700",
1398
+ "800",
1399
+ "900",
1400
  ),
1401
  "Fjalla One" => array(
1402
  "regular",
2239
  "regular",
2240
  ),
2241
  "Montserrat" => array(
2242
+ "100",
2243
+ "200",
2244
+ "300",
2245
  "regular",
2246
+ "500",
2247
+ "600",
2248
  "700",
2249
+ "800",
2250
+ "900",
2251
  ),
2252
  "Montserrat Alternates" => array(
2253
+ "100",
2254
+ "200",
2255
+ "300",
2256
  "regular",
2257
+ "500",
2258
+ "600",
2259
  "700",
2260
+ "800",
2261
+ "900",
2262
  ),
2263
  "Montserrat Subrayada" => array(
2264
  "regular",
2302
  "800",
2303
  ),
2304
  "Muli" => array(
2305
+ "200",
2306
  "300",
2307
  "regular",
2308
+ "600",
2309
+ "700",
2310
+ "800",
2311
+ "900",
2312
  ),
2313
  "Mystery Quest" => array(
2314
  "regular",
2396
  "regular",
2397
  ),
2398
  "Nunito" => array(
2399
+ "200",
2400
+ "300",
2401
+ "regular",
2402
+ "600",
2403
+ "700",
2404
+ "800",
2405
+ "900",
2406
+ ),
2407
+ "Nunito Sans" => array(
2408
+ "200",
2409
  "300",
2410
  "regular",
2411
+ "600",
2412
  "700",
2413
+ "800",
2414
+ "900",
2415
  ),
2416
  "Odor Mean Chey" => array(
2417
  "regular",
2464
  "regular",
2465
  ),
2466
  "Oswald" => array(
2467
+ "200",
2468
  "300",
2469
  "regular",
2470
+ "500",
2471
+ "600",
2472
  "700",
2473
  ),
2474
  "Over the Rainbow" => array(
2482
  "Overlock SC" => array(
2483
  "regular",
2484
  ),
2485
+ "Overpass" => array(
2486
+ "100",
2487
+ "200",
2488
+ "300",
2489
+ "regular",
2490
+ "600",
2491
+ "700",
2492
+ "800",
2493
+ "900",
2494
+ ),
2495
+ "Overpass Mono" => array(
2496
+ "300",
2497
+ "regular",
2498
+ "600",
2499
+ "700",
2500
+ ),
2501
  "Ovo" => array(
2502
  "regular",
2503
  ),
2534
  "Pacifico" => array(
2535
  "regular",
2536
  ),
2537
+ "Padauk" => array(
2538
+ "regular",
2539
+ "700",
2540
+ ),
2541
  "Palanquin" => array(
2542
  "100",
2543
  "200",
2553
  "600",
2554
  "700",
2555
  ),
2556
+ "Pangolin" => array(
2557
+ "regular",
2558
+ ),
2559
  "Paprika" => array(
2560
  "regular",
2561
  ),
2641
  ),
2642
  "Podkova" => array(
2643
  "regular",
2644
+ "500",
2645
+ "600",
2646
  "700",
2647
+ "800",
2648
  ),
2649
  "Poiret One" => array(
2650
  "regular",
2750
  "Quicksand" => array(
2751
  "300",
2752
  "regular",
2753
+ "500",
2754
  "700",
2755
  ),
2756
  "Quintessential" => array(
2885
  "regular",
2886
  ),
2887
  "Rokkitt" => array(
2888
+ "100",
2889
+ "200",
2890
+ "300",
2891
  "regular",
2892
+ "500",
2893
+ "600",
2894
  "700",
2895
+ "800",
2896
+ "900",
2897
  ),
2898
  "Romanesco" => array(
2899
  "regular",
2924
  "Rubik Mono One" => array(
2925
  "regular",
2926
  ),
 
 
 
2927
  "Ruda" => array(
2928
  "regular",
2929
  "700",
2973
  "Sancreek" => array(
2974
  "regular",
2975
  ),
2976
+ "Sansita" => array(
2977
  "regular",
2978
+ "700",
2979
+ "800",
2980
+ "900",
2981
  ),
2982
  "Sarala" => array(
2983
  "regular",
3370
  ),
3371
  "Unna" => array(
3372
  "regular",
3373
+ "700",
3374
  ),
3375
  "VT323" => array(
3376
  "regular",
classes/class-fl-builder-import.php CHANGED
@@ -43,7 +43,7 @@ final class FLBuilderImport {
43
 
44
  $GLOBALS['wp_import'] = new FLBuilderImporter();
45
 
46
- register_importer( 'wordpress', 'WordPress', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'), array( $GLOBALS['wp_import'], 'dispatch' ) );
47
  }
48
  }
49
 
43
 
44
  $GLOBALS['wp_import'] = new FLBuilderImporter();
45
 
46
+ register_importer( 'wordpress', 'WordPress', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'fl-builder'), array( $GLOBALS['wp_import'], 'dispatch' ) );
47
  }
48
  }
49
 
classes/class-fl-builder-importer.php CHANGED
@@ -110,7 +110,7 @@ class FLBuilderImportParserRegex extends WXR_Parser_Regex {
110
  }
111
 
112
  if ( ! $wxr_version )
113
- return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
114
 
115
  return array(
116
  'authors' => $this->authors,
110
  }
111
 
112
  if ( ! $wxr_version )
113
+ return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'fl-builder' ) );
114
 
115
  return array(
116
  'authors' => $this->authors,
classes/class-fl-builder-loader.php CHANGED
@@ -45,7 +45,7 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
45
  */
46
  static private function define_constants()
47
  {
48
- define('FL_BUILDER_VERSION', '1.9.4');
49
  define('FL_BUILDER_FILE', trailingslashit(dirname(dirname(__FILE__))) . 'fl-builder.php');
50
  define('FL_BUILDER_DIR', plugin_dir_path(FL_BUILDER_FILE));
51
  define('FL_BUILDER_URL', plugins_url('/', FL_BUILDER_FILE));
45
  */
46
  static private function define_constants()
47
  {
48
+ define('FL_BUILDER_VERSION', '1.9.5.1');
49
  define('FL_BUILDER_FILE', trailingslashit(dirname(dirname(__FILE__))) . 'fl-builder.php');
50
  define('FL_BUILDER_DIR', plugin_dir_path(FL_BUILDER_FILE));
51
  define('FL_BUILDER_URL', plugins_url('/', FL_BUILDER_FILE));
classes/class-fl-builder-loop.php CHANGED
@@ -7,6 +7,14 @@
7
  */
8
  final class FLBuilderLoop {
9
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Initializes hooks.
12
  *
@@ -15,7 +23,9 @@ final class FLBuilderLoop {
15
  */
16
  static public function init()
17
  {
18
- add_filter( 'found_posts', __CLASS__ . '::found_posts', 1, 2 );
 
 
19
  }
20
 
21
  /**
@@ -33,9 +43,12 @@ final class FLBuilderLoop {
33
  $order_by = empty($settings->order_by) ? 'date' : $settings->order_by;
34
  $order = empty($settings->order) ? 'DESC' : $settings->order;
35
  $users = empty($settings->users) ? '' : $settings->users;
36
- $paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
37
- $fields = empty($settings->fields) ? '' : $settings->fields;
38
-
 
 
 
39
  // Get the offset.
40
  if ( ! isset( $settings->offset ) || ! is_int( ( int )$settings->offset ) ) {
41
  $offset = 0;
@@ -43,7 +56,7 @@ final class FLBuilderLoop {
43
  else {
44
  $offset = $settings->offset;
45
  }
46
-
47
  // Get the paged offset.
48
  if ( $paged < 2 ) {
49
  $paged_offset = $offset;
@@ -128,7 +141,52 @@ final class FLBuilderLoop {
128
 
129
  return $found_posts;
130
  }
131
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  /**
133
  * Builds and renders the pagination for a query.
134
  *
@@ -140,26 +198,40 @@ final class FLBuilderLoop {
140
  {
141
  $total_pages = $query->max_num_pages;
142
  $permalink_structure = get_option('permalink_structure');
143
- $paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
144
-
 
145
  if($total_pages > 1) {
146
 
147
- if(!$current_page = $paged) {
148
  $current_page = 1;
149
  }
150
 
 
 
 
 
 
 
 
151
  if(empty($permalink_structure)) {
152
- $format = '&paged=%#%';
153
  }
154
- else if ("/" == substr($permalink_structure, -1)) {
155
- $format = 'page/%#%/';
 
156
  }
157
  else {
158
- $format = '/page/%#%/';
 
 
 
 
 
159
  }
160
 
161
  echo paginate_links(array(
162
- 'base' => get_pagenum_link(1) . '%_%',
163
  'format' => $format,
164
  'current' => $current_page,
165
  'total' => $total_pages,
@@ -168,6 +240,49 @@ final class FLBuilderLoop {
168
  }
169
  }
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  /**
172
  * Returns an array of data for post types supported
173
  * by module loop settings.
7
  */
8
  final class FLBuilderLoop {
9
 
10
+ /**
11
+ * Loop query counter
12
+ *
13
+ * @since 1.9.5
14
+ * @var int $loop_counter
15
+ */
16
+ static public $loop_counter = 0;
17
+
18
  /**
19
  * Initializes hooks.
20
  *
23
  */
24
  static public function init()
25
  {
26
+ add_filter( 'found_posts', __CLASS__ . '::found_posts', 1, 2 );
27
+ add_action( 'init', __CLASS__ . '::init_rewrite_rules' );
28
+ add_filter( 'redirect_canonical', __CLASS__ . '::override_canonical', 1, 2 );
29
  }
30
 
31
  /**
43
  $order_by = empty($settings->order_by) ? 'date' : $settings->order_by;
44
  $order = empty($settings->order) ? 'DESC' : $settings->order;
45
  $users = empty($settings->users) ? '' : $settings->users;
46
+ $fields = empty($settings->fields) ? '' : $settings->fields;
47
+
48
+ // Count how many times this method has been called
49
+ self::$loop_counter++;
50
+ $paged = self::get_paged();
51
+
52
  // Get the offset.
53
  if ( ! isset( $settings->offset ) || ! is_int( ( int )$settings->offset ) ) {
54
  $offset = 0;
56
  else {
57
  $offset = $settings->offset;
58
  }
59
+
60
  // Get the paged offset.
61
  if ( $paged < 2 ) {
62
  $paged_offset = $offset;
141
 
142
  return $found_posts;
143
  }
144
+
145
+
146
+ /**
147
+ * Add rewrite rules for custom pagination url to avoid conflict with the default paged param in WP
148
+ *
149
+ * @since 1.9.5
150
+ * @return void
151
+ */
152
+ static public function init_rewrite_rules()
153
+ {
154
+ for ( $x = 2; $x <= 10; $x++ ) {
155
+ add_rewrite_rule( 'paged-'. $x .'/([0-9]*)/?', 'index.php?page_id=' . get_option( 'page_on_front' ) . '&flpaged'. $x .'=$matches[1]', 'top' );
156
+ add_rewrite_rule( 'paged-'. $x .'/?([0-9]{1,})/?$', 'index.php?&flpaged'. $x .'=$matches[1]', 'top');
157
+ add_rewrite_rule( '(.?.+?)/paged-'. $x .'/?([0-9]{1,})/?$', 'index.php?pagename=$matches[1]&flpaged'. $x .'=$matches[2]', 'top');
158
+ add_rewrite_rule( '([^/]+)/paged-'. $x .'/?([0-9]{1,})/?$', 'index.php?name=$matches[1]&flpaged'. $x .'=$matches[2]', 'top');
159
+
160
+ add_rewrite_tag( "%flpaged{$x}%", '([^&]+)');
161
+ }
162
+
163
+ // Flush the rewrite rules so it would take effect
164
+ flush_rewrite_rules();
165
+ }
166
+
167
+ /**
168
+ * Disable canonical redirection on the frontpage when query var 'flpaged' is found.
169
+ *
170
+ * @param string $redirect_url The redirect URL.
171
+ * @param string $requested_url The requested URL.
172
+ * @since 1.9.5
173
+ * @return bool|string
174
+ */
175
+ static public function override_canonical( $redirect_url, $requested_url ) {
176
+ global $wp_the_query;
177
+
178
+ if ( is_array($wp_the_query->query) ) {
179
+ foreach ($wp_the_query->query as $key => $value) {
180
+ if (strpos($key, 'flpaged') === 0 && is_page() && get_option( 'page_on_front' )) {
181
+ $redirect_url = false;
182
+ break;
183
+ }
184
+ }
185
+ }
186
+
187
+ return $redirect_url;
188
+ }
189
+
190
  /**
191
  * Builds and renders the pagination for a query.
192
  *
198
  {
199
  $total_pages = $query->max_num_pages;
200
  $permalink_structure = get_option('permalink_structure');
201
+ $paged = self::get_paged();
202
+ $base = get_pagenum_link();
203
+
204
  if($total_pages > 1) {
205
 
206
+ if(!$current_page = $paged) {
207
  $current_page = 1;
208
  }
209
 
210
+ if ( self::$loop_counter > 1 ) {
211
+ $page_prefix = 'paged-'. self::$loop_counter;
212
+ }
213
+ else {
214
+ $page_prefix = empty($permalink_structure) ? 'paged' : 'page';
215
+ }
216
+
217
  if(empty($permalink_structure)) {
218
+ $format = '&'. $page_prefix .'=%#%';
219
  }
220
+
221
+ else if ("/" == substr($base, -1)) {
222
+ $format = $page_prefix . '/%#%/';
223
  }
224
  else {
225
+ $format = '/'. $page_prefix .'/%#%';
226
+ }
227
+
228
+ $pos = strrpos($base, "paged-");
229
+ if ( $pos ) {
230
+ $base = substr_replace( $base, '', $pos, strlen( $base ) );
231
  }
232
 
233
  echo paginate_links(array(
234
+ 'base' => $base . '%_%',
235
  'format' => $format,
236
  'current' => $current_page,
237
  'total' => $total_pages,
240
  }
241
  }
242
 
243
+ /**
244
+ * Returns the paged number for the query.
245
+ *
246
+ * @since 1.9.5
247
+ * @return int
248
+ */
249
+ static public function get_paged()
250
+ {
251
+ global $wp_the_query, $paged;
252
+
253
+ // Check first for custom pagination from post module
254
+ $flpaged = $wp_the_query->get( 'flpaged'. self::$loop_counter );
255
+
256
+ if ( is_numeric( $flpaged ) ) {
257
+ return $flpaged;
258
+ }
259
+ else if ( self::$loop_counter > 1 ) {
260
+ // If we have multiple paginations, make sure it won't affect the other loops.
261
+ return 0;
262
+ }
263
+
264
+ // Check the 'page' query var.
265
+ $page_qv = $wp_the_query->get( 'page' );
266
+
267
+ if ( is_numeric( $page_qv ) ) {
268
+ return $page_qv;
269
+ }
270
+
271
+ // Check the 'paged' query var.
272
+ $paged_qv = $wp_the_query->get( 'paged' );
273
+
274
+ if ( is_numeric( $paged_qv ) ) {
275
+ return $paged_qv;
276
+ }
277
+
278
+ // Check the $paged global?
279
+ if ( is_numeric( $paged ) ) {
280
+ return $paged;
281
+ }
282
+
283
+ return 0;
284
+ }
285
+
286
  /**
287
  * Returns an array of data for post types supported
288
  * by module loop settings.
classes/class-fl-builder-model.php CHANGED
@@ -544,6 +544,9 @@ final class FLBuilderModel {
544
  // Lock the post.
545
  require_once ABSPATH . 'wp-admin/includes/post.php';
546
  wp_set_post_lock( $post->ID );
 
 
 
547
  }
548
  }
549
 
@@ -4116,10 +4119,14 @@ final class FLBuilderModel {
4116
  // Update the layout data and settings.
4117
  self::update_layout_data($data);
4118
  self::update_layout_settings( $settings );
4119
- }
4120
 
4121
- // Delete old asset cache.
4122
- self::delete_asset_cache();
 
 
 
 
 
4123
  }
4124
  }
4125
 
@@ -4531,6 +4538,12 @@ final class FLBuilderModel {
4531
  */
4532
  static public function set_node_template_default_type( $post_id, $post, $update )
4533
  {
 
 
 
 
 
 
4534
  $post_data = self::get_post_data();
4535
 
4536
  if ( $update || 'fl-builder-template' != $post->post_type ) {
544
  // Lock the post.
545
  require_once ABSPATH . 'wp-admin/includes/post.php';
546
  wp_set_post_lock( $post->ID );
547
+
548
+ // Allow devs to hook into when editing is enabled.
549
+ do_action( 'fl_builder_editing_enabled' );
550
  }
551
  }
552
 
4119
  // Update the layout data and settings.
4120
  self::update_layout_data($data);
4121
  self::update_layout_settings( $settings );
 
4122
 
4123
+ // Delete old asset cache.
4124
+ self::delete_asset_cache();
4125
+
4126
+ return array(
4127
+ 'layout_css' => $settings->css
4128
+ );
4129
+ }
4130
  }
4131
  }
4132
 
4538
  */
4539
  static public function set_node_template_default_type( $post_id, $post, $update )
4540
  {
4541
+ global $pagenow;
4542
+
4543
+ if ( 'admin.php' == $pagenow && isset( $_GET['import'] ) ) {
4544
+ return;
4545
+ }
4546
+
4547
  $post_data = self::get_post_data();
4548
 
4549
  if ( $update || 'fl-builder-template' != $post->post_type ) {
classes/class-fl-builder-module.php CHANGED
@@ -143,19 +143,26 @@ class FLBuilderModule {
143
  *
144
  * @since 1.0
145
  */
146
- public function __construct($params)
147
  {
148
  $class_info = new ReflectionClass($this);
149
  $class_path = $class_info->getFileName();
150
  $dir_path = dirname($class_path);
151
- $this->name = $params['name'];
152
- $this->description = $params['description'];
153
- $this->category = $params['category'];
154
  $this->slug = basename($class_path, '.php');
155
  $this->enabled = isset($params['enabled']) ? $params['enabled'] : true;
156
  $this->editor_export = isset($params['editor_export']) ? $params['editor_export'] : true;
157
  $this->partial_refresh = isset($params['partial_refresh']) ? $params['partial_refresh'] : false;
158
 
 
 
 
 
 
 
 
 
 
 
159
  // We need to normalize the paths here since path comparisons
160
  // break on Windows because they use backslashes.
161
  $abspath = str_replace( '\\', '/', ABSPATH );
143
  *
144
  * @since 1.0
145
  */
146
+ public function __construct( $params )
147
  {
148
  $class_info = new ReflectionClass($this);
149
  $class_path = $class_info->getFileName();
150
  $dir_path = dirname($class_path);
 
 
 
151
  $this->slug = basename($class_path, '.php');
152
  $this->enabled = isset($params['enabled']) ? $params['enabled'] : true;
153
  $this->editor_export = isset($params['editor_export']) ? $params['editor_export'] : true;
154
  $this->partial_refresh = isset($params['partial_refresh']) ? $params['partial_refresh'] : false;
155
 
156
+ $details = apply_filters( 'fl_builder_module_details', array(
157
+ 'name' => $params['name'],
158
+ 'description' => $params['description'],
159
+ 'category' => $params['category']
160
+ ), $this->slug );
161
+
162
+ $this->name = $details['name'];
163
+ $this->description = $details['description'];
164
+ $this->category = $details['category'];
165
+
166
  // We need to normalize the paths here since path comparisons
167
  // break on Windows because they use backslashes.
168
  $abspath = str_replace( '\\', '/', ABSPATH );
classes/class-fl-builder-photo.php CHANGED
@@ -108,13 +108,19 @@ final class FLBuilderPhoto {
108
  'thumbnail' => _x( 'Thumbnail', 'Image size.', 'fl-builder' )
109
  );
110
 
 
 
 
 
111
  foreach($photo->sizes as $key => $val) {
112
 
113
  if(!isset($titles[$key])) {
114
  $titles[$key] = ucwords(str_replace(array('_', '-'), ' ', $key));
115
  }
 
 
116
 
117
- echo '<option value="' . $val->url . '" ' . selected($selected, $val->url) . '>' . $titles[$key] . ' - ' . $val->width . ' x ' . $val->height . '</option>';
118
  }
119
  }
120
  }
108
  'thumbnail' => _x( 'Thumbnail', 'Image size.', 'fl-builder' )
109
  );
110
 
111
+ // Check the selected value without the protocol so we get a match if
112
+ // a site has switched to HTTPS since selecting this photo (#641).
113
+ $selected = str_replace( array( 'http://', 'https://' ), '', $selected );
114
+
115
  foreach($photo->sizes as $key => $val) {
116
 
117
  if(!isset($titles[$key])) {
118
  $titles[$key] = ucwords(str_replace(array('_', '-'), ' ', $key));
119
  }
120
+
121
+ $check = str_replace( array( 'http://', 'https://' ), '', $val->url );
122
 
123
+ echo '<option value="' . $val->url . '" ' . selected($selected, $check) . '>' . $titles[$key] . ' - ' . $val->width . ' x ' . $val->height . '</option>';
124
  }
125
  }
126
  }
classes/class-fl-builder-service-convertkit.php CHANGED
@@ -192,8 +192,13 @@ final class FLBuilderServiceConvertKit extends FLBuilderService {
192
  else {
193
 
194
  $api = $this->get_api( $account_data['api_key'] );
 
195
 
196
- $result = $api->form_subscribe( $settings->list_id, array('email' => $email, 'fname' => $name) );
 
 
 
 
197
  if ($result->status != "created") {
198
  $response['error'] = __( 'There was an error subscribing to ConvertKit.', 'fl-builder' );
199
  }
192
  else {
193
 
194
  $api = $this->get_api( $account_data['api_key'] );
195
+ $data = array('email' => $email);
196
 
197
+ if ( !empty( $name ) ) {
198
+ $data['fname'] = $name;
199
+ }
200
+
201
+ $result = $api->form_subscribe( $settings->list_id, $data );
202
  if ($result->status != "created") {
203
  $response['error'] = __( 'There was an error subscribing to ConvertKit.', 'fl-builder' );
204
  }
classes/class-fl-builder-service-email-address.php CHANGED
@@ -12,9 +12,9 @@ final class FLBuilderServiceEmailAddress extends FLBuilderService {
12
  *
13
  * @since 1.6.0
14
  * @var string $id
15
- */
16
  public $id = 'email-address';
17
-
18
  /**
19
  * Test the API connection.
20
  *
@@ -26,14 +26,14 @@ final class FLBuilderServiceEmailAddress extends FLBuilderService {
26
  * @type bool|string $error The error message or false if no error.
27
  * @type array $data An array of data used to make the connection.
28
  * }
29
- */
30
- public function connect( $fields = array() )
31
  {
32
- $response = array(
33
  'error' => false,
34
  'data' => array()
35
  );
36
-
37
  // Make sure we have an email address.
38
  if ( ! isset( $fields['email'] ) || empty( $fields['email'] ) ) {
39
  $response['error'] = __( 'Error: You must provide an email address.', 'fl-builder' );
@@ -42,7 +42,7 @@ final class FLBuilderServiceEmailAddress extends FLBuilderService {
42
  else {
43
  $response['data'] = array( 'email' => $fields['email'] );
44
  }
45
-
46
  return $response;
47
  }
48
 
@@ -51,11 +51,11 @@ final class FLBuilderServiceEmailAddress extends FLBuilderService {
51
  *
52
  * @since 1.6.0
53
  * @return string The connection settings markup.
54
- */
55
- public function render_connect_settings()
56
  {
57
  ob_start();
58
-
59
  FLBuilder::render_settings_field( 'email', array(
60
  'row_class' => 'fl-builder-service-connect-row',
61
  'class' => 'fl-builder-service-connect-input',
@@ -64,13 +64,13 @@ final class FLBuilderServiceEmailAddress extends FLBuilderService {
64
  'preview' => array(
65
  'type' => 'none'
66
  )
67
- ));
68
-
69
  return ob_get_clean();
70
  }
71
 
72
  /**
73
- * Render the markup for service specific fields.
74
  *
75
  * @since 1.6.0
76
  * @param string $account The name of the saved account.
@@ -79,18 +79,18 @@ final class FLBuilderServiceEmailAddress extends FLBuilderService {
79
  * @type bool|string $error The error message or false if no error.
80
  * @type string $html The field markup.
81
  * }
82
- */
83
- public function render_fields( $account, $settings )
84
  {
85
- $response = array(
86
- 'error' => false,
87
- 'html' => ''
88
  );
89
-
90
  return $response;
91
  }
92
 
93
- /**
94
  * Send the subscription info to the saved email address.
95
  *
96
  * @since 1.6.0
@@ -100,31 +100,36 @@ final class FLBuilderServiceEmailAddress extends FLBuilderService {
100
  * @return array {
101
  * @type bool|string $error The error message or false if no error.
102
  * }
103
- */
104
  public function subscribe( $settings, $email, $name = false )
105
  {
106
  $account_data = $this->get_account_data( $settings->service_account );
107
  $response = array( 'error' => false );
108
-
109
  if ( ! $account_data ) {
110
  $response['error'] = __( 'There was an error subscribing. The account is no longer connected.', 'fl-builder' );
111
  }
112
  else {
113
-
114
  $subject = __( 'Subscribe Form Signup', 'fl-builder' );
 
 
 
 
 
115
  $message = __( 'Email', 'fl-builder' ) . ': ' . $email;
116
-
117
  if ( $name ) {
118
  $message .= "\n" . __( 'Name', 'fl-builder' ) . ': ' . $name;
119
  }
120
-
121
  $result = wp_mail( $account_data['email'], $subject, $message );
122
-
123
  if ( ! $result ) {
124
  $response['error'] = __( 'There was an error subscribing. Please try again.', 'fl-builder' );
125
  }
126
  }
127
-
128
  return $response;
129
  }
130
- }
12
  *
13
  * @since 1.6.0
14
  * @var string $id
15
+ */
16
  public $id = 'email-address';
17
+
18
  /**
19
  * Test the API connection.
20
  *
26
  * @type bool|string $error The error message or false if no error.
27
  * @type array $data An array of data used to make the connection.
28
  * }
29
+ */
30
+ public function connect( $fields = array() )
31
  {
32
+ $response = array(
33
  'error' => false,
34
  'data' => array()
35
  );
36
+
37
  // Make sure we have an email address.
38
  if ( ! isset( $fields['email'] ) || empty( $fields['email'] ) ) {
39
  $response['error'] = __( 'Error: You must provide an email address.', 'fl-builder' );
42
  else {
43
  $response['data'] = array( 'email' => $fields['email'] );
44
  }
45
+
46
  return $response;
47
  }
48
 
51
  *
52
  * @since 1.6.0
53
  * @return string The connection settings markup.
54
+ */
55
+ public function render_connect_settings()
56
  {
57
  ob_start();
58
+
59
  FLBuilder::render_settings_field( 'email', array(
60
  'row_class' => 'fl-builder-service-connect-row',
61
  'class' => 'fl-builder-service-connect-input',
64
  'preview' => array(
65
  'type' => 'none'
66
  )
67
+ ));
68
+
69
  return ob_get_clean();
70
  }
71
 
72
  /**
73
+ * Render the markup for service specific fields.
74
  *
75
  * @since 1.6.0
76
  * @param string $account The name of the saved account.
79
  * @type bool|string $error The error message or false if no error.
80
  * @type string $html The field markup.
81
  * }
82
+ */
83
+ public function render_fields( $account, $settings )
84
  {
85
+ $response = array(
86
+ 'error' => false,
87
+ 'html' => ''
88
  );
89
+
90
  return $response;
91
  }
92
 
93
+ /**
94
  * Send the subscription info to the saved email address.
95
  *
96
  * @since 1.6.0
100
  * @return array {
101
  * @type bool|string $error The error message or false if no error.
102
  * }
103
+ */
104
  public function subscribe( $settings, $email, $name = false )
105
  {
106
  $account_data = $this->get_account_data( $settings->service_account );
107
  $response = array( 'error' => false );
108
+
109
  if ( ! $account_data ) {
110
  $response['error'] = __( 'There was an error subscribing. The account is no longer connected.', 'fl-builder' );
111
  }
112
  else {
113
+
114
  $subject = __( 'Subscribe Form Signup', 'fl-builder' );
115
+
116
+ if( $settings->custom_subject ) {
117
+ $subject = $settings->custom_subject;
118
+ }
119
+
120
  $message = __( 'Email', 'fl-builder' ) . ': ' . $email;
121
+
122
  if ( $name ) {
123
  $message .= "\n" . __( 'Name', 'fl-builder' ) . ': ' . $name;
124
  }
125
+
126
  $result = wp_mail( $account_data['email'], $subject, $message );
127
+
128
  if ( ! $result ) {
129
  $response['error'] = __( 'There was an error subscribing. Please try again.', 'fl-builder' );
130
  }
131
  }
132
+
133
  return $response;
134
  }
135
+ }
classes/class-fl-builder.php CHANGED
@@ -82,8 +82,13 @@ final class FLBuilder {
82
  */
83
  static public function load_plugin_textdomain()
84
  {
85
- //Traditional WordPress plugin locale filter
86
- $locale = apply_filters( 'plugin_locale', get_locale(), 'fl-builder' );
 
 
 
 
 
87
 
88
  //Setup paths to current locale file
89
  $mofile_global = trailingslashit( WP_LANG_DIR ) . 'plugins/bb-plugin/' . $locale . '.mo';
@@ -629,7 +634,9 @@ final class FLBuilder {
629
  */
630
  static public function body_class($classes)
631
  {
632
- if(FLBuilderModel::is_builder_enabled() && !is_archive()) {
 
 
633
  $classes[] = 'fl-builder';
634
  }
635
  if(FLBuilderModel::is_builder_active() && !FLBuilderModel::current_user_has_editing_capability()) {
@@ -965,10 +972,11 @@ final class FLBuilder {
965
  $post_id = FLBuilderModel::get_post_id();
966
  $enabled = FLBuilderModel::is_builder_enabled();
967
  $rendering = $post_id === self::$post_rendering;
 
968
  $in_loop = in_the_loop();
969
  $is_global = in_array( $post_id, FLBuilderModel::get_global_posts() );
970
 
971
- if( $enabled && ! $rendering && ( $in_loop || $is_global ) ) {
972
 
973
  // Set the post rendering ID.
974
  self::$post_rendering = $post_id;
@@ -1137,18 +1145,45 @@ final class FLBuilder {
1137
 
1138
  foreach($cols as $col) {
1139
 
1140
- $modules = FLBuilderModel::get_modules($col);
1141
 
1142
- foreach($modules as $module) {
1143
 
1144
- if($module->editor_export) {
 
 
 
 
1145
 
1146
- // Don't crop photos to ensure media library photos are rendered.
1147
- if($module->settings->type == 'photo') {
1148
- $module->settings->crop = false;
1149
- }
1150
 
1151
- FLBuilder::render_module_html($module->settings->type, $module->settings, $module);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1152
  }
1153
  }
1154
  }
@@ -2504,7 +2539,13 @@ final class FLBuilder {
2504
  $js = apply_filters( 'fl_builder_render_js', $js, $nodes, $global_settings );
2505
 
2506
  if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
2507
- $js = FLJSMin::minify( $js );
 
 
 
 
 
 
2508
  }
2509
 
2510
  file_put_contents( $path, $js );
82
  */
83
  static public function load_plugin_textdomain()
84
  {
85
+ // Traditional WordPress plugin locale filter
86
+ // Uses get_user_locale() which was added in 4.7 so we need to check its available.
87
+ if( function_exists( 'get_user_locale' ) ) {
88
+ $locale = apply_filters( 'plugin_locale', get_user_locale(), 'fl-builder' );
89
+ } else {
90
+ $locale = apply_filters( 'plugin_locale', get_locale(), 'fl-builder' );
91
+ }
92
 
93
  //Setup paths to current locale file
94
  $mofile_global = trailingslashit( WP_LANG_DIR ) . 'plugins/bb-plugin/' . $locale . '.mo';
634
  */
635
  static public function body_class($classes)
636
  {
637
+ $do_render = apply_filters( 'fl_builder_do_render_content', true, FLBuilderModel::get_post_id() );
638
+
639
+ if($do_render && FLBuilderModel::is_builder_enabled() && !is_archive()) {
640
  $classes[] = 'fl-builder';
641
  }
642
  if(FLBuilderModel::is_builder_active() && !FLBuilderModel::current_user_has_editing_capability()) {
972
  $post_id = FLBuilderModel::get_post_id();
973
  $enabled = FLBuilderModel::is_builder_enabled();
974
  $rendering = $post_id === self::$post_rendering;
975
+ $do_render = apply_filters( 'fl_builder_do_render_content', true, $post_id );
976
  $in_loop = in_the_loop();
977
  $is_global = in_array( $post_id, FLBuilderModel::get_global_posts() );
978
 
979
+ if( $enabled && ! $rendering && $do_render && ( $in_loop || $is_global ) ) {
980
 
981
  // Set the post rendering ID.
982
  self::$post_rendering = $post_id;
1145
 
1146
  foreach($cols as $col) {
1147
 
1148
+ $col_children = FLBuilderModel::get_nodes( null, $col );
1149
 
1150
+ foreach ( $col_children as $col_child ) {
1151
 
1152
+ if ( 'module' == $col_child->type ) {
1153
+
1154
+ $module = FLBuilderModel::get_module( $col_child );
1155
+
1156
+ if ( $module && $module->editor_export ) {
1157
 
1158
+ // Don't crop photos to ensure media library photos are rendered.
1159
+ if($module->settings->type == 'photo') {
1160
+ $module->settings->crop = false;
1161
+ }
1162
 
1163
+ FLBuilder::render_module_html($module->settings->type, $module->settings, $module);
1164
+ }
1165
+ }
1166
+ else if ( 'column-group' == $col_child->type ) {
1167
+
1168
+ $group_cols = FLBuilderModel::get_nodes( 'column', $col_child );
1169
+
1170
+ foreach ( $group_cols as $group_col ) {
1171
+
1172
+ $modules = FLBuilderModel::get_modules( $group_col );
1173
+
1174
+ foreach ( $modules as $module ) {
1175
+
1176
+ if($module->editor_export) {
1177
+
1178
+ // Don't crop photos to ensure media library photos are rendered.
1179
+ if($module->settings->type == 'photo') {
1180
+ $module->settings->crop = false;
1181
+ }
1182
+
1183
+ FLBuilder::render_module_html($module->settings->type, $module->settings, $module);
1184
+ }
1185
+ }
1186
+ }
1187
  }
1188
  }
1189
  }
2539
  $js = apply_filters( 'fl_builder_render_js', $js, $nodes, $global_settings );
2540
 
2541
  if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
2542
+ try {
2543
+ $min = FLJSMin::minify( $js );
2544
+ } catch (Exception $e) {}
2545
+
2546
+ if ( $min ) {
2547
+ $js = $min;
2548
+ }
2549
  }
2550
 
2551
  file_put_contents( $path, $js );
css/fl-builder-layout.css CHANGED
@@ -111,6 +111,7 @@
111
  pointer-events: none;
112
  width: 100vw;
113
  height: 56.25vw; /* Given a 16:9 aspect ratio, 9/16*100 = 56.25 */
 
114
  min-height: 100vh;
115
  min-width: 177.77vh; /* Given a 16:9 aspect ratio, 16/9*100 = 177.77 */
116
  position: absolute;
@@ -191,13 +192,29 @@
191
 
192
  /* Stupid IE Full Height Row Fixes */
193
  .fl-builder-ie-11 .fl-row-full-height .fl-row-content-wrap {
194
- height: 1px;
195
  }
196
 
197
  .fl-builder-ie-11 .fl-row-full-height .fl-row-content {
198
  flex: 0 0 auto;
199
  flex-basis: 100%;
200
- margin: 0 auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  }
202
 
203
  /* Full height align center */
111
  pointer-events: none;
112
  width: 100vw;
113
  height: 56.25vw; /* Given a 16:9 aspect ratio, 9/16*100 = 56.25 */
114
+ max-width: none;
115
  min-height: 100vh;
116
  min-width: 177.77vh; /* Given a 16:9 aspect ratio, 16/9*100 = 177.77 */
117
  position: absolute;
192
 
193
  /* Stupid IE Full Height Row Fixes */
194
  .fl-builder-ie-11 .fl-row-full-height .fl-row-content-wrap {
195
+ height: auto;
196
  }
197
 
198
  .fl-builder-ie-11 .fl-row-full-height .fl-row-content {
199
  flex: 0 0 auto;
200
  flex-basis: 100%;
201
+ margin: 0;
202
+ }
203
+
204
+ .fl-builder-ie-11 .fl-row-full-height.fl-row-align-top .fl-row-content {
205
+ margin: 0 auto;
206
+ }
207
+
208
+ .fl-row-full-height.fl-row-align-center .fl-col-group:not(.fl-col-group-equal-height) {
209
+ display: flex;
210
+ align-items: center;
211
+ justify-content: center;
212
+ -webkit-align-items: center;
213
+ -webkit-box-align: center;
214
+ -webkit-box-pack: center;
215
+ -webkit-justify-content: center;
216
+ -ms-flex-align: center;
217
+ -ms-flex-pack: center;
218
  }
219
 
220
  /* Full height align center */
fl-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Beaver Builder Plugin (Lite Version)
4
  * Plugin URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-uri
5
  * Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
6
- * Version: 1.9.4
7
  * Author: The Beaver Builder Team
8
  * Author URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-author
9
  * Copyright: (c) 2014 Beaver Builder
3
  * Plugin Name: Beaver Builder Plugin (Lite Version)
4
  * Plugin URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-uri
5
  * Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
6
+ * Version: 1.9.5.1
7
  * Author: The Beaver Builder Team
8
  * Author URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-author
9
  * Copyright: (c) 2014 Beaver Builder
includes/compatibility.php CHANGED
@@ -4,6 +4,36 @@
4
  * Misc functions for compatibility with other plugins.
5
  */
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  /**
8
  * Support for Option Tree.
9
  *
4
  * Misc functions for compatibility with other plugins.
5
  */
6
 
7
+ /**
8
+ * Support for WooCommerce Memberships.
9
+ *
10
+ * Makes sure builder content isn't rendered for protected posts.
11
+ */
12
+ function fl_builder_wc_memberships_support() {
13
+
14
+ if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) {
15
+
16
+ function fl_builder_wc_memberships_maybe_render_content( $do_render, $post_id ) {
17
+
18
+ if ( wc_memberships_is_post_content_restricted() ) {
19
+
20
+ // check if user has access to restricted content
21
+ if ( ! current_user_can( 'wc_memberships_view_restricted_post_content', $post_id ) ) {
22
+ $do_render = false;
23
+ }
24
+ // check if user has access to delayed content
25
+ else if ( ! current_user_can( 'wc_memberships_view_delayed_post_content', $post_id ) ) {
26
+ $do_render = false;
27
+ }
28
+ }
29
+
30
+ return $do_render;
31
+ }
32
+ add_filter( 'fl_builder_do_render_content', 'fl_builder_wc_memberships_maybe_render_content', 10, 2 );
33
+ }
34
+ }
35
+ add_action( 'plugins_loaded', 'fl_builder_wc_memberships_support', 11 );
36
+
37
  /**
38
  * Support for Option Tree.
39
  *
includes/field-code.php CHANGED
@@ -21,6 +21,10 @@
21
  editor.getSession().setValue(textarea.val());
22
  editor.getSession().setMode('ace/mode/' + mode);
23
 
 
 
 
 
24
  editor.setOptions({
25
  enableBasicAutocompletion: true,
26
  enableLiveAutocompletion: true,
21
  editor.getSession().setValue(textarea.val());
22
  editor.getSession().setMode('ace/mode/' + mode);
23
 
24
+ <?php if ( isset( $field['wrap'] ) && $field['wrap'] === true ) : ?>
25
+ editor.getSession().setUseWrapMode(true);
26
+ <?php endif; ?>
27
+
28
  editor.setOptions({
29
  enableBasicAutocompletion: true,
30
  enableLiveAutocompletion: true,
includes/field-unit.php CHANGED
@@ -1,6 +1,6 @@
1
- <input
2
  type="number"
3
- name="<?php esc_attr_e( $name ); ?>"
4
- value="<?php esc_attr_e( $value ); ?>"
5
- placeholder="<?php if ( isset( $field['placeholder'] ) ) esc_attr_e( $field['placeholder'] ); ?>"
6
- />
1
+ <input
2
  type="number"
3
+ name="<?php echo esc_attr( $name ); ?>"
4
+ value="<?php echo esc_attr( $value ); ?>"
5
+ placeholder="<?php if ( isset( $field['placeholder'] ) ) echo esc_attr( $field['placeholder'] ); ?>"
6
+ />
includes/layout-js-config.php CHANGED
@@ -7,5 +7,8 @@ var FLBuilderLayoutConfig = {
7
  paths : {
8
  pluginUrl : '<?php echo FL_BUILDER_URL; ?>',
9
  wpAjaxUrl : '<?php echo admin_url( 'admin-ajax.php' ); ?>'
 
 
 
10
  }
11
  };
7
  paths : {
8
  pluginUrl : '<?php echo FL_BUILDER_URL; ?>',
9
  wpAjaxUrl : '<?php echo admin_url( 'admin-ajax.php' ); ?>'
10
+ },
11
+ waypoint: {
12
+ offset: 80
13
  }
14
  };
includes/strings.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
-
3
  /**
4
  * Misc strings that aren't in the core plugin but
5
  * need to be translated.
6
  */
7
-
8
  __( 'The Beaver Builder Booster plugin is not compatible with your host.', 'fl-builder' );
9
 
10
- __( 'Click here to edit content on this %s using an easy drag-and-drop builder.', '%s is the singular post type name (e.g. page)', 'fl-builder' );
11
 
12
  __( 'Use an easy drag-and-drop builder to edit content on this page.', 'fl-builder' );
13
 
14
- __( 'Launch Page Builder', 'fl-builder' );
1
  <?php
2
+
3
  /**
4
  * Misc strings that aren't in the core plugin but
5
  * need to be translated.
6
  */
7
+
8
  __( 'The Beaver Builder Booster plugin is not compatible with your host.', 'fl-builder' );
9
 
10
+ _x( 'Click here to edit content on this %s using an easy drag-and-drop builder.', '%s is the singular post type name (e.g. page)', 'fl-builder' );
11
 
12
  __( 'Use an easy drag-and-drop builder to edit content on this page.', 'fl-builder' );
13
 
14
+ __( 'Launch Page Builder', 'fl-builder' );
includes/template-selector.php CHANGED
@@ -1,8 +1,8 @@
1
  <form class="fl-builder-settings fl-template-selector">
2
  <div class="fl-lightbox-header">
3
-
4
  <h1><?php _e('Layout Templates', 'fl-builder'); ?></h1>
5
-
6
  <?php if ( count( $filter_data ) > 1 ) : ?>
7
  <div class="fl-template-category-filter fl-builder-settings-fields">
8
  <select class="fl-template-category-select" name="fl-template-category-select">
@@ -12,21 +12,21 @@
12
  </select>
13
  </div>
14
  <?php endif; ?>
15
-
16
  </div>
17
  <div class="fl-builder-settings-fields fl-nanoscroller">
18
  <div class="fl-nanoscroller-content">
19
-
20
  <?php if ( true === FL_BUILDER_LITE ) : ?>
21
  <?php if ( FLBuilderModel::has_templates() ) : ?>
22
  <div class="fl-builder-settings-message fl-builder-templates-cta">
23
- <p>Save and reuse your layouts or kick-start your creativity with even more professionally designed templates.</p>
24
- <a class="fl-builder-upgrade-button fl-builder-button" href="<?php echo FLBuilderModel::get_store_url( '', array( 'utm_medium' => 'bb-lite', 'utm_source' => 'builder-ui', 'utm_campaign' => 'templates-cta' ) ); ?>" target="_blank">Learn More <i class="fa fa-external-link-square"></i></a>
25
  </div>
26
  <?php else : ?>
27
  <div class="fl-builder-settings-message fl-builder-templates-cta">
28
- <p>Save and reuse your layouts or kick-start your creativity with dozens of professionally designed templates.</p>
29
- <a class="fl-builder-upgrade-button fl-builder-button" href="<?php echo FLBuilderModel::get_store_url( '', array( 'utm_medium' => 'bb-lite', 'utm_source' => 'builder-ui', 'utm_campaign' => 'templates-cta' ) ); ?>" target="_blank">Learn More <i class="fa fa-external-link-square"></i></a>
30
  </div>
31
  <img class="fl-builder-templates-cta-img" src="<?php echo FL_BUILDER_URL; ?>img/templates-preview.jpg" />
32
  <?php endif; ?>
1
  <form class="fl-builder-settings fl-template-selector">
2
  <div class="fl-lightbox-header">
3
+
4
  <h1><?php _e('Layout Templates', 'fl-builder'); ?></h1>
5
+
6
  <?php if ( count( $filter_data ) > 1 ) : ?>
7
  <div class="fl-template-category-filter fl-builder-settings-fields">
8
  <select class="fl-template-category-select" name="fl-template-category-select">
12
  </select>
13
  </div>
14
  <?php endif; ?>
15
+
16
  </div>
17
  <div class="fl-builder-settings-fields fl-nanoscroller">
18
  <div class="fl-nanoscroller-content">
19
+
20
  <?php if ( true === FL_BUILDER_LITE ) : ?>
21
  <?php if ( FLBuilderModel::has_templates() ) : ?>
22
  <div class="fl-builder-settings-message fl-builder-templates-cta">
23
+ <p><?php _e( 'Save and reuse your layouts or kick-start your creativity with even more professionally designed templates.', 'fl-builder' ); ?></p>
24
+ <a class="fl-builder-upgrade-button fl-builder-button" href="<?php echo FLBuilderModel::get_store_url( '', array( 'utm_medium' => 'bb-lite', 'utm_source' => 'builder-ui', 'utm_campaign' => 'templates-cta' ) ); ?>" target="_blank"><?php _e( 'Learn More', 'fl-builder' ); ?> <i class="fa fa-external-link-square"></i></a>
25
  </div>
26
  <?php else : ?>
27
  <div class="fl-builder-settings-message fl-builder-templates-cta">
28
+ <p><?php _e( 'Save and reuse your layouts or kick-start your creativity with dozens of professionally designed templates.', 'fl-builder' ); ?></p>
29
+ <a class="fl-builder-upgrade-button fl-builder-button" href="<?php echo FLBuilderModel::get_store_url( '', array( 'utm_medium' => 'bb-lite', 'utm_source' => 'builder-ui', 'utm_campaign' => 'templates-cta' ) ); ?>" target="_blank"><?php _e( 'Learn More', 'fl-builder' ); ?> <i class="fa fa-external-link-square"></i></a>
30
  </div>
31
  <img class="fl-builder-templates-cta-img" src="<?php echo FL_BUILDER_URL; ?>img/templates-preview.jpg" />
32
  <?php endif; ?>
includes/ui-panel.php CHANGED
@@ -31,7 +31,7 @@
31
  <div class="fl-builder-blocks-separator"></div>
32
 
33
  <?php do_action( 'fl_builder_ui_panel_before_modules' ); ?>
34
-
35
  <?php foreach($categories as $title => $modules) : ?>
36
  <div id="fl-builder-blocks-<?php echo FLBuilderModel::get_module_category_slug( $title ); ?>" class="fl-builder-blocks-section">
37
  <span class="fl-builder-blocks-section-title">
@@ -58,7 +58,7 @@
58
 
59
  <?php if ( true === FL_BUILDER_LITE ) : ?>
60
  <div class="fl-builder-modules-cta">
61
- <a href="#" onclick="window.open('<?php echo FLBuilderModel::get_store_url( '', array( 'utm_medium' => 'bb-lite', 'utm_source' => 'builder-ui', 'utm_campaign' => 'modules-panel-cta' ) ); ?>');" target="_blank"><i class="fa fa-external-link-square"></i> Get more time-saving features, modules, and expert support.</a>
62
  </div>
63
  <?php endif; ?>
64
 
31
  <div class="fl-builder-blocks-separator"></div>
32
 
33
  <?php do_action( 'fl_builder_ui_panel_before_modules' ); ?>
34
+
35
  <?php foreach($categories as $title => $modules) : ?>
36
  <div id="fl-builder-blocks-<?php echo FLBuilderModel::get_module_category_slug( $title ); ?>" class="fl-builder-blocks-section">
37
  <span class="fl-builder-blocks-section-title">
58
 
59
  <?php if ( true === FL_BUILDER_LITE ) : ?>
60
  <div class="fl-builder-modules-cta">
61
+ <a href="#" onclick="window.open('<?php echo FLBuilderModel::get_store_url( '', array( 'utm_medium' => 'bb-lite', 'utm_source' => 'builder-ui', 'utm_campaign' => 'modules-panel-cta' ) ); ?>');" target="_blank"><i class="fa fa-external-link-square"></i> <?php _e( 'Get more time-saving features, modules, and expert support.', 'fl-builder' ); ?></a>
62
  </div>
63
  <?php endif; ?>
64
 
includes/updater-config.php CHANGED
@@ -3,7 +3,7 @@
3
  if(class_exists('FLUpdater')) {
4
  FLUpdater::add_product(array(
5
  'name' => 'Beaver Builder Plugin (Lite Version)',
6
- 'version' => '1.9.4',
7
  'slug' => 'bb-plugin',
8
  'type' => 'plugin'
9
  ));
3
  if(class_exists('FLUpdater')) {
4
  FLUpdater::add_product(array(
5
  'name' => 'Beaver Builder Plugin (Lite Version)',
6
+ 'version' => '1.9.5.1',
7
  'slug' => 'bb-plugin',
8
  'type' => 'plugin'
9
  ));
includes/updater/classes/class-fl-updater.php CHANGED
@@ -8,7 +8,7 @@
8
  final class FLUpdater {
9
 
10
  /**
11
- * The API URL for the Beaver Builder update server.
12
  *
13
  * @since 1.0
14
  * @access private
@@ -26,7 +26,7 @@ final class FLUpdater {
26
  static private $_products = array();
27
 
28
  /**
29
- * An internal array of remote responses with
30
  * update data for each product.
31
  *
32
  * @since 1.8.4
@@ -74,20 +74,21 @@ final class FLUpdater {
74
  public function get_response()
75
  {
76
  $slug = $this->settings['slug'];
77
-
78
  if ( isset( FLUpdater::$_responses[ $slug ] ) ) {
79
  return FLUpdater::$_responses[ $slug ];
80
  }
81
-
82
  FLUpdater::$_responses[ $slug ] = FLUpdater::api_request( FLUpdater::$_updates_api_url, array(
83
  'fl-api-method' => 'update_info',
84
  'license' => FLUpdater::get_subscription_license(),
85
  'domain' => network_home_url(),
86
  'product' => $this->settings['name'],
87
  'slug' => $this->settings['slug'],
88
- 'version' => $this->settings['version']
 
89
  ) );
90
-
91
  return FLUpdater::$_responses[ $slug ];
92
  }
93
 
@@ -101,7 +102,7 @@ final class FLUpdater {
101
  public function update_check( $transient )
102
  {
103
  global $pagenow;
104
-
105
  if( 'plugins.php' == $pagenow && is_multisite() ) {
106
  return $transient;
107
  }
@@ -111,26 +112,26 @@ final class FLUpdater {
111
  if ( ! isset( $transient->checked ) ) {
112
  $transient->checked = array();
113
  }
114
-
115
  $response = $this->get_response();
116
 
117
  if( ! isset( $response->error ) ) {
118
-
119
  $transient->last_checked = time();
120
  $transient->checked[ $this->settings['slug'] ] = $this->settings['version'];
121
 
122
  if($this->settings['type'] == 'plugin') {
123
 
124
  $plugin = self::get_plugin_file($this->settings['slug']);
125
-
126
  if ( version_compare( $response->new_version, $this->settings['version'], '>' ) ) {
127
-
128
  $transient->response[ $plugin ] = new stdClass();
129
  $transient->response[ $plugin ]->slug = $response->slug;
130
  $transient->response[ $plugin ]->new_version = $response->new_version;
131
  $transient->response[ $plugin ]->url = $response->homepage;
132
  $transient->response[ $plugin ]->package = $response->package;
133
-
134
  if ( empty( $response->package ) ) {
135
  $transient->response[ $plugin ]->upgrade_notice = FLUpdater::get_update_error_message();
136
  }
@@ -139,7 +140,7 @@ final class FLUpdater {
139
  else if($this->settings['type'] == 'theme') {
140
 
141
  if(version_compare($response->new_version, $this->settings['version'], '>')) {
142
-
143
  $transient->response[$this->settings['slug']] = array(
144
  'new_version' => $response->new_version,
145
  'url' => $response->homepage,
@@ -173,7 +174,7 @@ final class FLUpdater {
173
  $response = $this->get_response();
174
 
175
  if( ! isset( $response->error ) ) {
176
-
177
  $info = new stdClass();
178
  $info->name = $this->settings['name'];
179
  $info->version = $response->new_version;
@@ -186,7 +187,7 @@ final class FLUpdater {
186
  $info->last_updated = $response->last_updated;
187
  $info->download_link = $response->package;
188
  $info->sections = (array)$response->sections;
189
-
190
  return $info;
191
  }
192
 
@@ -304,7 +305,7 @@ final class FLUpdater {
304
  'domain' => network_home_url(),
305
  'products' => json_encode( self::$_products )
306
  ));
307
-
308
  update_site_option('fl_themes_subscription_email', $license);
309
  }
310
 
@@ -338,15 +339,15 @@ final class FLUpdater {
338
  $message .= __( '<strong>UPDATE UNAVAILABLE!</strong>', 'fl-builder' );
339
  $message .= '&nbsp;&nbsp;&nbsp;';
340
  $message .= __('Please subscribe to enable automatic updates for this plugin.', 'fl-builder');
341
-
342
  if ( $plugin_data && isset( $plugin_data['PluginURI'] ) ) {
343
  $message .= ' <a href="' . $plugin_data['PluginURI'] . '" target="_blank" style="color: #fff; text-decoration: underline;">';
344
  $message .= __('Subscribe Now', 'fl-builder');
345
  $message .= ' &raquo;</a>';
346
  }
347
-
348
  $message .= '</p>';
349
-
350
  return $message;
351
  }
352
 
@@ -417,19 +418,19 @@ final class FLUpdater {
417
  if(wp_remote_retrieve_response_code($request) != 200) {
418
  return $error;
419
  }
420
-
421
  $body = wp_remote_retrieve_body($request);
422
-
423
  if(is_wp_error($body)) {
424
  return $error;
425
  }
426
 
427
  $body_decoded = json_decode($body);
428
-
429
  if(!is_object($body_decoded)) {
430
  return $error;
431
  }
432
 
433
  return $body_decoded;
434
  }
435
- }
8
  final class FLUpdater {
9
 
10
  /**
11
+ * The API URL for the Beaver Builder update server.
12
  *
13
  * @since 1.0
14
  * @access private
26
  static private $_products = array();
27
 
28
  /**
29
+ * An internal array of remote responses with
30
  * update data for each product.
31
  *
32
  * @since 1.8.4
74
  public function get_response()
75
  {
76
  $slug = $this->settings['slug'];
77
+
78
  if ( isset( FLUpdater::$_responses[ $slug ] ) ) {
79
  return FLUpdater::$_responses[ $slug ];
80
  }
81
+
82
  FLUpdater::$_responses[ $slug ] = FLUpdater::api_request( FLUpdater::$_updates_api_url, array(
83
  'fl-api-method' => 'update_info',
84
  'license' => FLUpdater::get_subscription_license(),
85
  'domain' => network_home_url(),
86
  'product' => $this->settings['name'],
87
  'slug' => $this->settings['slug'],
88
+ 'version' => $this->settings['version'],
89
+ 'php' => phpversion()
90
  ) );
91
+
92
  return FLUpdater::$_responses[ $slug ];
93
  }
94
 
102
  public function update_check( $transient )
103
  {
104
  global $pagenow;
105
+
106
  if( 'plugins.php' == $pagenow && is_multisite() ) {
107
  return $transient;
108
  }
112
  if ( ! isset( $transient->checked ) ) {
113
  $transient->checked = array();
114
  }
115
+
116
  $response = $this->get_response();
117
 
118
  if( ! isset( $response->error ) ) {
119
+
120
  $transient->last_checked = time();
121
  $transient->checked[ $this->settings['slug'] ] = $this->settings['version'];
122
 
123
  if($this->settings['type'] == 'plugin') {
124
 
125
  $plugin = self::get_plugin_file($this->settings['slug']);
126
+
127
  if ( version_compare( $response->new_version, $this->settings['version'], '>' ) ) {
128
+
129
  $transient->response[ $plugin ] = new stdClass();
130
  $transient->response[ $plugin ]->slug = $response->slug;
131
  $transient->response[ $plugin ]->new_version = $response->new_version;
132
  $transient->response[ $plugin ]->url = $response->homepage;
133
  $transient->response[ $plugin ]->package = $response->package;
134
+
135
  if ( empty( $response->package ) ) {
136
  $transient->response[ $plugin ]->upgrade_notice = FLUpdater::get_update_error_message();
137
  }
140
  else if($this->settings['type'] == 'theme') {
141
 
142
  if(version_compare($response->new_version, $this->settings['version'], '>')) {
143
+
144
  $transient->response[$this->settings['slug']] = array(
145
  'new_version' => $response->new_version,
146
  'url' => $response->homepage,
174
  $response = $this->get_response();
175
 
176
  if( ! isset( $response->error ) ) {
177
+
178
  $info = new stdClass();
179
  $info->name = $this->settings['name'];
180
  $info->version = $response->new_version;
187
  $info->last_updated = $response->last_updated;
188
  $info->download_link = $response->package;
189
  $info->sections = (array)$response->sections;
190
+
191
  return $info;
192
  }
193
 
305
  'domain' => network_home_url(),
306
  'products' => json_encode( self::$_products )
307
  ));
308
+
309
  update_site_option('fl_themes_subscription_email', $license);
310
  }
311
 
339
  $message .= __( '<strong>UPDATE UNAVAILABLE!</strong>', 'fl-builder' );
340
  $message .= '&nbsp;&nbsp;&nbsp;';
341
  $message .= __('Please subscribe to enable automatic updates for this plugin.', 'fl-builder');
342
+
343
  if ( $plugin_data && isset( $plugin_data['PluginURI'] ) ) {
344
  $message .= ' <a href="' . $plugin_data['PluginURI'] . '" target="_blank" style="color: #fff; text-decoration: underline;">';
345
  $message .= __('Subscribe Now', 'fl-builder');
346
  $message .= ' &raquo;</a>';
347
  }
348
+
349
  $message .= '</p>';
350
+
351
  return $message;
352
  }
353
 
418
  if(wp_remote_retrieve_response_code($request) != 200) {
419
  return $error;
420
  }
421
+
422
  $body = wp_remote_retrieve_body($request);
423
+
424
  if(is_wp_error($body)) {
425
  return $error;
426
  }
427
 
428
  $body_decoded = json_decode($body);
429
+
430
  if(!is_object($body_decoded)) {
431
  return $error;
432
  }
433
 
434
  return $body_decoded;
435
  }
436
+ }
index.php CHANGED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
js/fl-builder-layout.js CHANGED
@@ -838,9 +838,9 @@
838
  if ( responsiveLabel.is( ':visible' ) ) {
839
  responsiveLabel.trigger( 'click' );
840
  }
841
- else {
842
- FLBuilderLayout._scrollToElement( label );
843
- label.trigger( 'click' );
844
  }
845
 
846
  }, 100 );
@@ -877,16 +877,21 @@
877
  loc = window.location,
878
  id = null,
879
  element = null;
880
-
881
  if ( 'undefined' != typeof href && href.indexOf( '#' ) > -1 ) {
882
-
883
  if ( loc.pathname.replace( /^\//, '' ) == this.pathname.replace( /^\//, '' ) && loc.hostname == this.hostname ) {
884
-
885
  try {
886
-
887
  id = href.split( '#' ).pop();
 
 
 
 
 
888
  element = $( '#' + id );
889
-
890
  if ( element.length > 0 ) {
891
  if ( link.hasClass( 'fl-scroll-link' ) || element.hasClass( 'fl-row' ) || element.hasClass( 'fl-col' ) || element.hasClass( 'fl-module' ) ) {
892
  $( link ).on( 'click', FLBuilderLayout._scrollToElementOnLinkClick );
@@ -1025,8 +1030,8 @@
1025
  FLBuilderLayout._scrollToElementOnLinkClick.call( this, e, callback );
1026
  }
1027
  else {
1028
- FLBuilderLayout._scrollToElement( label );
1029
- label.trigger( 'click' );
1030
  }
1031
 
1032
  e.preventDefault();
838
  if ( responsiveLabel.is( ':visible' ) ) {
839
  responsiveLabel.trigger( 'click' );
840
  }
841
+ else {
842
+ label[0].click();
843
+ FLBuilderLayout._scrollToElement( element );
844
  }
845
 
846
  }, 100 );
877
  loc = window.location,
878
  id = null,
879
  element = null;
880
+
881
  if ( 'undefined' != typeof href && href.indexOf( '#' ) > -1 ) {
882
+
883
  if ( loc.pathname.replace( /^\//, '' ) == this.pathname.replace( /^\//, '' ) && loc.hostname == this.hostname ) {
884
+
885
  try {
886
+
887
  id = href.split( '#' ).pop();
888
+ // If there is no ID then we have nowhere to look
889
+ // Fixes a quirk in jQuery and FireFox
890
+ if( ! id ) {
891
+ return;
892
+ }
893
  element = $( '#' + id );
894
+
895
  if ( element.length > 0 ) {
896
  if ( link.hasClass( 'fl-scroll-link' ) || element.hasClass( 'fl-row' ) || element.hasClass( 'fl-col' ) || element.hasClass( 'fl-module' ) ) {
897
  $( link ).on( 'click', FLBuilderLayout._scrollToElementOnLinkClick );
1030
  FLBuilderLayout._scrollToElementOnLinkClick.call( this, e, callback );
1031
  }
1032
  else {
1033
+ label[0].click();
1034
+ FLBuilderLayout._scrollToElement( element );
1035
  }
1036
 
1037
  e.preventDefault();
js/fl-builder.js CHANGED
@@ -1932,8 +1932,26 @@
1932
  action: 'apply_user_template',
1933
  template_id: id,
1934
  append: append
1935
- }, FLBuilder._updateLayout);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1936
  }
 
 
1937
  },
1938
 
1939
  /* User Template Settings
@@ -3788,7 +3806,7 @@
3788
  }
3789
 
3790
  // Find the new group position.
3791
- position = newParent.find( '.fl-module, .fl-col-group, .fl-col-sortable-proxy-item' ).index( ui.item );
3792
 
3793
  // Add the new group.
3794
  FLBuilder._addColGroup( newParent.closest( '.fl-col' ).attr('data-node'), colId, position );
@@ -6018,7 +6036,7 @@
6018
  $(prefix + inputArray[i] + suffix)[func]();
6019
 
6020
  // Resize code editor fields.
6021
- $( prefix + inputArray[i] ).parent().find( '.fl-field[data-type="code"]' ).each( function() {
6022
  $( this ).data( 'editor' ).resize();
6023
  } );
6024
  }
1932
  action: 'apply_user_template',
1933
  template_id: id,
1934
  append: append
1935
+ }, FLBuilder._updateTemplateLayout);
1936
+ }
1937
+ },
1938
+
1939
+ /**
1940
+ * Callback method when applying user template to the current layout
1941
+
1942
+ * @since 1.9.5
1943
+ * @access private
1944
+ * @method _updateTemplateLayout
1945
+ * @param {string} response The JSON with the new layout settings
1946
+ */
1947
+ _updateTemplateLayout: function(response)
1948
+ {
1949
+ var data = JSON.parse(response);
1950
+ if( data !== null ) {
1951
+ $( '#fl-builder-layout-css' ).html( data.layout_css );
1952
  }
1953
+
1954
+ FLBuilder._updateLayout();
1955
  },
1956
 
1957
  /* User Template Settings
3806
  }
3807
 
3808
  // Find the new group position.
3809
+ position = newParent.find( '> .fl-module, .fl-col-group, .fl-col-sortable-proxy-item' ).index( ui.item );
3810
 
3811
  // Add the new group.
3812
  FLBuilder._addColGroup( newParent.closest( '.fl-col' ).attr('data-node'), colId, position );
6036
  $(prefix + inputArray[i] + suffix)[func]();
6037
 
6038
  // Resize code editor fields.
6039
+ $( prefix + inputArray[i] + suffix ).parent().find( '.fl-field[data-type="code"]' ).each( function() {
6040
  $( this ).data( 'editor' ).resize();
6041
  } );
6042
  }
js/fl-builder.min.js CHANGED
@@ -1,6 +1,6 @@
1
- !function(e){FLBuilderAJAXLayout=function(t,l){this._data=e.extend({},this._defaults,"string"==typeof t?JSON.parse(t):t),this._callback=l,this._post=e("#fl-post-id").val(),this._head=e("head").eq(0),this._body=e("body").eq(0),this._data.css&&(this._loader=e('<img src="'+this._data.css+'" />'),this._oldCss=e('link[href*="/cache/'+this._post+'"]'),this._newCss=e('<link rel="stylesheet" id="fl-builder-layout-'+this._post+'-css" href="'+this._data.css+'" />')),this._data.partial?(this._data.js&&(this._oldJs=e("#fl-builder-partial-refresh-js"),this._newJs=e('<script type="text/javascript" id="fl-builder-partial-refresh-js">'+this._data.js+"</script>")),this._data.nodeId&&(this._data.oldNodeId?(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.oldNodeId+'"]'),this._content=e(".fl-node-"+this._data.oldNodeId)):(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.nodeId+'"]'),this._content=e(".fl-node-"+this._data.nodeId)))):(this._oldJs=e('script[src*="/cache/'+this._post+'"]'),this._newJs=e('<script src="'+this._data.js+'"></script>'),this._oldScriptsStyles=e(".fl-builder-layout-scripts-styles"),this._content=e(FLBuilder._contentClass)),this._init()},FLBuilderAJAXLayout.prototype={_defaults:{partial:!1,nodeId:null,nodeType:null,nodeParent:null,nodePosition:null,oldNodeId:null,html:null,scriptsStyles:null,css:null,js:null},_data:null,_callback:function(){},_post:null,_head:null,_body:null,_loader:null,_oldCss:null,_newCss:null,_oldJs:null,_newJs:null,_oldScriptsStyles:null,_content:null,_init:function(){this._body.height(this._body.height()),this._loader?(this._loader.on("error",e.proxy(this._loadNewCSSComplete,this)),this._body.append(this._loader)):this._finish()},_loadNewCSSComplete:function(){this._loader.remove(),this._oldCss.length>0?this._oldCss.after(this._newCss):this._head.append(this._newCss),setTimeout(e.proxy(this._finish,this),250)},_finish:function(){this._removeOldContentAndAssets(),this._cleanNewHTML(),this._cleanNewAssets(),this._addNewHTML(),this._addNewScriptsStyles(),this._addNewJS(),e(FLBuilder._contentClass).trigger("fl-builder.layout-rendered"),FLBuilder.hideAjaxLoader(),"undefined"!=typeof this._callback&&this._callback()},_removeOldContentAndAssets:function(){this._content&&this._content.empty(),this._oldCss&&this._oldCss.remove(),this._oldJs&&this._oldJs.remove(),this._oldScriptsStyles&&this._oldScriptsStyles.remove()},_cleanNewHTML:function(){if(this._data.scriptsStyles){var t=e("<div>"+this._data.html+"</div>"),l="fl-row",i=this._data.scriptsStyles,o="";this._data.partial&&(l="column-group"==this._data.nodeType?"fl-col-group":"column"==this._data.nodeType?"fl-col":"fl-"+this._data.nodeType),t.find("> *, script").each(function(){e(this).hasClass(l)||(o=e(this).remove(),i+=o[0].outerHTML)}),""!==i&&(i=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+i+"<div>":'<div class="fl-builder-node-scripts-styles">'+i+"<div>"),this._data.html=t.html(),this._data.scriptsStyles=i}},_addNewHTML:function(){var e;this._data.partial?this._data.nodeParent?(e=this._data.nodeParent.hasClass("fl-builder-content")?this._data.nodeParent.find(".fl-row"):this._data.nodeParent.hasClass("fl-row-content")?this._data.nodeParent.find(" > .fl-col-group"):this._data.nodeParent.find(" > .fl-col-group, > .fl-module"),0===e.length||e.length==this._data.nodePosition?this._data.nodeParent.append(this._data.html):e.eq(this._data.nodePosition).before(this._data.html)):(this._content.after(this._data.html),this._content.remove()):this._content.append(this._data.html)},_cleanNewAssets:function(){var t=this;this._data.html=this._removeDuplicateAssets(this._data.html),this._data.scriptsStyles&&""!==this._data.scriptsStyles&&(this._data.scriptsStyles=this._removeDuplicateAssets(this._data.scriptsStyles)),this._data.partial?e(".fl-builder-node-scripts-styles").each(function(){t._data.html.indexOf("fl-node-"+e(this).data("node"))>-1&&e(this).remove()}):(e("#fl-builder-partial-refresh-js").remove(),e(".fl-builder-node-scripts-styles").remove())},_removeDuplicateAssets:function(t){var l=e("<div>"+t+"</div>"),i="",o=null,s="",r=null,n=window.location,a=n.protocol+"//"+n.hostname+(n.port?":"+n.port:"");return l.find("script").each(function(){i=e(this).attr("src"),"undefined"!=typeof i&&(i=i.replace(a,""),o=e('script[src*="'+i+'"]'),o.length>0&&e(this).remove())}),l.find("link").each(function(){s=e(this).attr("href"),"undefined"!=typeof s&&(s=s.replace(a,""),r=e('link[href*="'+s+'"]'),r.length>0&&e(this).remove())}),l.html()},_addNewScriptsStyles:function(){this._data.scriptsStyles&&""!==this._data.scriptsStyles&&this._body.append(this._data.scriptsStyles)},_addNewJS:function(){setTimeout(e.proxy(function(){this._newJs&&this._head.append(this._newJs)},this),50)},_complete:function(){FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._resizeLayout(),FLBuilder._initMediaElements(),FLBuilderLayout.init(),FLBuilderResponsiveEditing.refreshPreview(),this._body.height("auto")}}}(jQuery),!function(e){"use strict";if(e.matchMedia&&e.matchMedia("all").addListener)return!1;var t=e.matchMedia,l=t("only all").matches,i=!1,o=0,s=[],r=function(l){e.clearTimeout(o),o=e.setTimeout(function(){for(var l=0,i=s.length;l<i;l++){var o=s[l].mql,r=s[l].listeners||[],n=t(o.media).matches;if(n!==o.matches){o.matches=n;for(var a=0,d=r.length;a<d;a++)r[a].call(e,o)}}},30)};e.matchMedia=function(o){var n=t(o),a=[],d=0;return n.addListener=function(t){l&&(i||(i=!0,e.addEventListener("resize",r,!0)),0===d&&(d=s.push({mql:n,listeners:a})),a.push(t))},n.removeListener=function(e){for(var t=0,l=a.length;t<l;t++)a[t]===e&&a.splice(t,1)},n}}(this),!function(e){"use strict";e.matchMedia=e.matchMedia||function(e,t){var l,i=e.documentElement,o=i.firstElementChild||i.firstChild,s=e.createElement("body"),r=e.createElement("div");return r.id="mq-test-1",r.style.cssText="position:absolute;top:-100em",s.style.background="none",s.appendChild(r),function(e){return r.innerHTML='&shy;<style media="'+e+'"> #mq-test-1 { width: 42px; }</style>',i.insertBefore(s,o),l=42===r.offsetWidth,i.removeChild(s),{matches:l,media:e}}}(e.document)}(this),function(e){FLBuilderForcedMediaQueries={_requestQueue:[],_xmlHttp:function(){var e=!1;try{e=new window.XMLHttpRequest}catch(t){e=new window.ActiveXObject("Microsoft.XMLHTTP")}return function(){return e}}(),_regex:{media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^\/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},_mediaStyles:[],_rules:[],_appendedEls:[],_parsedSheets:{},_emInPx:null,_width:null,_callback:null,update:function(e,t){var l=FLBuilderForcedMediaQueries,i=window.document,o=i.documentElement,s=i.getElementsByTagName("head")[0]||o,r=i.getElementsByTagName("base")[0],n=s.getElementsByTagName("link");l._mediaStyles=[],l._rules=[],"undefined"!=typeof e&&(l._width=e),"undefined"!=typeof t&&(l._callback=t);for(var a in l._parsedSheets)a.indexOf("-layout-draft.css?")>-1?l._parsedSheets[a].parsed=!1:a.indexOf("-layout-preview.css?")>-1&&(l._parsedSheets[a].parsed=!1);for(var d=0;d<n.length;d++){var a=n[d],u=a.href,c=a.media,f=a.rel&&"stylesheet"===a.rel.toLowerCase();if(u&&f){if(u.indexOf(FLBuilderConfig.pluginUrl)>-1)continue;"undefined"!=typeof l._parsedSheets[u]&&l._parsedSheets[u].parsed?l._translate(l._parsedSheets[u].styles,u,l._parsedSheets[u].media):a.styleSheet&&a.styleSheet.rawCssText?(l._translate(a.styleSheet.rawCssText,u,c),l._parsedSheets[u]=!0):(/^([a-zA-Z:]*\/\/)/.test(u)||r)&&u.replace(RegExp.$1,"").split("/")[0]!==window.location.host||("//"===u.substring(0,2)&&(u=window.location.protocol+u),l._requestQueue.push({href:u,media:c}))}}l._makeRequests()},applyMedia:function(e){var t=FLBuilderForcedMediaQueries,l="clientWidth",i=window.document,o=i.documentElement,s=(o[l],i.getElementsByTagName("head")[0]||o),r=s.getElementsByTagName("link"),n=r[r.length-1],a=((new Date).getTime(),{}),d=t._mediaStyles,u=t._appendedEls,c=t._emInPx;t._width=e;for(var f in d)if(d.hasOwnProperty(f)){var h=d[f],p=h.minw,g=h.maxw,_=null===p,m=null===g,b="em";p&&(p=parseFloat(p)*(p.indexOf(b)>-1?c||t.getEmPixelValue():1)),g&&(g=parseFloat(g)*(g.indexOf(b)>-1?c||t.getEmPixelValue():1)),h.hasQuery&&(_&&m||!(_||e>=p)||!(m||e<=g))||(a[h.media]||(a[h.media]=[]),a[h.media].push(t._rules[h.rules]))}for(var v in u)u.hasOwnProperty(v)&&u[v]&&u[v].parentNode===s&&s.removeChild(u[v]);t._appendedEls.length=0;for(var L in a)if(a.hasOwnProperty(L)){var F=i.createElement("style"),y=a[L].join("\n");F.type="text/css",F.media=L,s.insertBefore(F,n.nextSibling),F.styleSheet?F.styleSheet.cssText=y:F.appendChild(i.createTextNode(y)),t._appendedEls.push(F)}},isUnsupportedMediaQuery:function(e){var t=FLBuilderForcedMediaQueries._regex;return e.replace(t.minmaxwh,"").match(t.other)},getEmPixelValue:function(){var e=null,t=window.document,l=t.documentElement,i=t.body,o=t.createElement("div"),s=l.style.fontSize,r=i&&i.style.fontSize,n=!1;return o.style.cssText="position:absolute;font-size:1em;width:1em",i||(i=n=t.createElement("body"),i.style.background="none"),l.style.fontSize="100%",i.style.fontSize="100%",i.appendChild(o),n&&l.insertBefore(i,l.firstChild),e=o.offsetWidth,n?l.removeChild(i):i.removeChild(o),l.style.fontSize=s,r&&(i.style.fontSize=r),e=FLBuilderForcedMediaQueries._emInPx=parseFloat(e)},_translate:function(e,t,l){var i=FLBuilderForcedMediaQueries,o=i._regex,s=e.replace(o.comments,"").replace(o.keyframes,"").match(o.media),r=s&&s.length||0;t=t.substring(0,t.lastIndexOf("/"));var n=function(e){return e.replace(o.urls,"$1"+t+"$2$3")},a=!r&&l;t.length&&(t+="/"),a&&(r=1);for(var d=0;d<r;d++){var u,c,f,h;a?(u=l,i._rules.push(n(e))):(u=s[d].match(o.findStyles)&&RegExp.$1,i._rules.push(RegExp.$2&&n(RegExp.$2))),f=u.split(","),h=f.length;for(var p=0;p<h;p++)c=f[p],i.isUnsupportedMediaQuery(c)||i._mediaStyles.push({media:c.split("(")[0].match(o.only)&&RegExp.$2||"all",rules:i._rules.length-1,hasQuery:c.indexOf("(")>-1,minw:c.match(o.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:c.match(o.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}},_makeRequests:function(){var e=FLBuilderForcedMediaQueries;if(e._requestQueue.length){var t=e._requestQueue.shift();e._ajax(t.href,function(l){e._translate(l,t.href,t.media),e._parsedSheets[t.href]={parsed:!0,styles:l,media:t.media},window.setTimeout(function(){e._makeRequests()},0)})}else e._width&&(e.applyMedia(e._width),e._callback&&(e._callback(),e._callback=null))},_ajax:function(e,t){var l=FLBuilderForcedMediaQueries._xmlHttp();l&&(l.open("GET",e,!0),l.onreadystatechange=function(){4!==l.readyState||200!==l.status&&304!==l.status||t(l.responseText)},4!==l.readyState&&l.send(null))}}}(jQuery),function(e){FLBuilderPreview=function(t){this.type=t.type,"undefined"!=t.state&&t.state?this.state=t.state:this._saveState(),"undefined"!=t.layout&&t.layout?FLBuilder._renderLayout(t.layout,e.proxy(this._init,this)):this._init()},FLBuilderPreview._fontsList={},FLBuilderPreview.prototype={type:"",nodeId:null,classes:{},elements:{},state:null,_savedSettings:null,_styleSheet:null,_styleSheetMedium:null,_styleSheetResponsive:null,_timeout:null,_lastClassName:null,_xhr:null,_init:function(){switch(this.nodeId=e(".fl-builder-settings").data("node"),this._saveSettings(),this._initElementsAndClasses(),this._createSheets(),this._initResponsivePreviews(),this._initDefaultFieldPreviews(),this.type){case"row":this._initRow();break;case"col":this._initColumn();break;case"module":this._initModule()}},_saveSettings:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings");this._savedSettings=FLBuilder._getSettings(t)},_settingsHaveChanged:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=FLBuilder._getSettings(t);return JSON.stringify(this._savedSettings)!=JSON.stringify(l)},_initElementsAndClasses:function(){var t;t="row"==this.type?".fl-row-content-wrap":".fl-"+this.type+"-content",e.extend(this.classes,{settings:".fl-builder-"+this.type+"-settings",settingsHeader:".fl-builder-"+this.type+"-settings .fl-lightbox-header",node:FLBuilder._contentClass+" .fl-node-"+this.nodeId,content:FLBuilder._contentClass+" .fl-node-"+this.nodeId+" > "+t}),e.extend(this.elements,{settings:e(this.classes.settings),settingsHeader:e(this.classes.settingsHeader),node:e(this.classes.node),content:e(this.classes.content)})},_createSheets:function(){this._styleSheet||(this._styleSheet=new FLStyleSheet({id:"fl-builder-preview"})),this._styleSheetMedium||(this._styleSheetMedium=new FLStyleSheet({id:"fl-builder-preview-medium"})),this._styleSheetResponsive||(this._styleSheetResponsive=new FLStyleSheet({id:"fl-builder-preview-responsive"}))},_destroySheets:function(){this._styleSheet&&(this._styleSheet.destroy(),this._styleSheet=null),this._styleSheetMedium&&(this._styleSheetMedium.destroy(),this._styleSheetMedium=null),this._styleSheetResponsive&&(this._styleSheetResponsive.destroy(),this._styleSheetResponsive=null)},updateCSSRule:function(e,t,l){this._styleSheet.updateRule(e,t,l)},delay:function(e,t){this._cancelDelay(),this._timeout=setTimeout(t,e)},_cancelDelay:function(){null!==this._timeout&&clearTimeout(this._timeout)},hexToRgb:function(e){var t=parseInt(e,16),l=t>>16&255,i=t>>8&255,o=255&t;return[l,i,o]},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_initResponsivePreviews:function(){FLBuilder.addHook("responsive-editing-switched",e.proxy(this._responsiveEditingSwitched,this))},_destroyResponsivePreviews:function(){FLBuilder.removeHook("responsive-editing-switched")},_responsiveEditingSwitched:function(e,t){"default"==t?(this._styleSheetMedium.disable(),this._styleSheetResponsive.disable()):"medium"==t?(this._styleSheetMedium.enable(),this._styleSheetResponsive.disable()):"responsive"==t&&(this._styleSheetMedium.disable(),this._styleSheetResponsive.enable())},updateResponsiveCSSRule:function(e,t,l){var i=FLBuilderResponsiveEditing._mode,o="default"==i?"":i.charAt(0).toUpperCase()+i.slice(1);this["_styleSheet"+o].updateRule(e,t,l)},_saveState:function(){var t=e("#fl-post-id").val(),l=e('link[href*="/cache/'+t+'"]').attr("href"),i=e('script[src*="/cache/'+t+'"]').attr("src"),o=e(FLBuilder._contentClass).html();this.state={css:l,js:i,html:o}},preview:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=t.attr("data-node"),i=FLBuilder._getSettings(t);this._cancelPreview(),this._xhr=FLBuilder.ajax({action:"render_layout",node_id:l,node_preview:i},e.proxy(this._renderPreview,this))},delayPreview:function(t){var l="undefined"==typeof t?[]:e(t.target).closest("tr").find("th"),i=e(".fl-builder-widget-settings .fl-builder-settings-title"),o=e(".fl-builder-settings .fl-lightbox-header"),s=FLBuilderLayoutConfig.paths.pluginUrl+"img/ajax-loader-small.gif",r=e('<img class="fl-builder-preview-loader" src="'+s+'" />');e(".fl-builder-preview-loader").remove(),l.length>0?l.append(r):i.length>0?i.append(r):o.length>0&&o.append(r),this.delay(1e3,e.proxy(this.preview,this))},_cancelPreview:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)},_renderPreview:function(t){this._xhr=null,FLBuilder._renderLayout(t,e.proxy(this._renderPreviewComplete,this))},_renderPreviewComplete:function(){this._initElementsAndClasses(),e(".fl-builder-preview-loader").remove(),e(FLBuilder._contentClass).trigger("fl-builder.preview-rendered")},revert:function(){this.clear(),this._settingsHaveChanged()&&FLBuilder._renderLayout(this.state)},clear:function(){this._cancelDelay(),this._cancelPreview(),this._destroySheets(),this._destroyResponsivePreviews()},_initNodeTextColor:function(){e.extend(this.elements,{textColor:e(this.classes.settings+" input[name=text_color]"),linkColor:e(this.classes.settings+" input[name=link_color]"),hoverColor:e(this.classes.settings+" input[name=hover_color]"),headingColor:e(this.classes.settings+" input[name=heading_color]")}),this.elements.textColor.on("change",e.proxy(this._textColorChange,this)),this.elements.linkColor.on("change",e.proxy(this._textColorChange,this)),this.elements.hoverColor.on("change",e.proxy(this._textColorChange,this)),this.elements.headingColor.on("change",e.proxy(this._textColorChange,this))},_textColorChange:function(t){var l=this.elements.textColor.val(),i=this.elements.linkColor.val(),o=this.elements.hoverColor.val(),s=this.elements.headingColor.val();i=""===i?l:i,o=""===o?l:o,s=""===s?l:s,this.delay(100,e.proxy(function(){""===l?this.updateCSSRule(this.classes.node,"color","inherit"):this.updateCSSRule(this.classes.node,"color","#"+l),""===i?this.updateCSSRule(this.classes.node+" a","color","inherit"):this.updateCSSRule(this.classes.node+" a","color","#"+i),""===o?this.updateCSSRule(this.classes.node+" a:hover","color","inherit"):this.updateCSSRule(this.classes.node+" a:hover","color","#"+o),""===s?(this.updateCSSRule(this.classes.node+" h1","color","inherit"),this.updateCSSRule(this.classes.node+" h2","color","inherit"),this.updateCSSRule(this.classes.node+" h3","color","inherit"),this.updateCSSRule(this.classes.node+" h4","color","inherit"),this.updateCSSRule(this.classes.node+" h5","color","inherit"),this.updateCSSRule(this.classes.node+" h6","color","inherit"),this.updateCSSRule(this.classes.node+" h1 a","color","inherit"),this.updateCSSRule(this.classes.node+" h2 a","color","inherit"),this.updateCSSRule(this.classes.node+" h3 a","color","inherit"),this.updateCSSRule(this.classes.node+" h4 a","color","inherit"),this.updateCSSRule(this.classes.node+" h5 a","color","inherit"),this.updateCSSRule(this.classes.node+" h6 a","color","inherit")):(this.updateCSSRule(this.classes.node+" h1","color","#"+s),this.updateCSSRule(this.classes.node+" h2","color","#"+s),this.updateCSSRule(this.classes.node+" h3","color","#"+s),this.updateCSSRule(this.classes.node+" h4","color","#"+s),this.updateCSSRule(this.classes.node+" h5","color","#"+s),this.updateCSSRule(this.classes.node+" h6","color","#"+s),this.updateCSSRule(this.classes.node+" h1 a","color","#"+s),this.updateCSSRule(this.classes.node+" h2 a","color","#"+s),this.updateCSSRule(this.classes.node+" h3 a","color","#"+s),this.updateCSSRule(this.classes.node+" h4 a","color","#"+s),this.updateCSSRule(this.classes.node+" h5 a","color","#"+s),this.updateCSSRule(this.classes.node+" h6 a","color","#"+s))},this))},_initNodeBg:function(){e.extend(this.elements,{bgType:e(this.classes.settings+" select[name=bg_type]"),bgColor:e(this.classes.settings+" input[name=bg_color]"),bgColorPicker:e(this.classes.settings+" .fl-picker-bg_color"),bgOpacity:e(this.classes.settings+" input[name=bg_opacity]"),bgImageSrc:e(this.classes.settings+" select[name=bg_image_src]"),bgRepeat:e(this.classes.settings+" select[name=bg_repeat]"),bgPosition:e(this.classes.settings+" select[name=bg_position]"),bgAttachment:e(this.classes.settings+" select[name=bg_attachment]"),bgSize:e(this.classes.settings+" select[name=bg_size]"),bgVideoSource:e(this.classes.settings+" select[name=bg_video_source]"),bgVideo:e(this.classes.settings+" input[name=bg_video]"),bgVideoServiceUrl:e(this.classes.settings+" input[name=bg_video_service_url]"),bgVideoFallbackSrc:e(this.classes.settings+" select[name=bg_video_fallback_src]"),bgSlideshowSource:e(this.classes.settings+" select[name=ss_source]"),bgSlideshowPhotos:e(this.classes.settings+" input[name=ss_photos]"),bgSlideshowFeedUrl:e(this.classes.settings+" input[name=ss_feed_url]"),bgSlideshowSpeed:e(this.classes.settings+" input[name=ss_speed]"),bgSlideshowTrans:e(this.classes.settings+" select[name=ss_transition]"),bgSlideshowTransSpeed:e(this.classes.settings+" input[name=ss_transitionDuration]"),bgParallaxImageSrc:e(this.classes.settings+" select[name=bg_parallax_image_src]"),bgOverlayColor:e(this.classes.settings+" input[name=bg_overlay_color]"),bgOverlayOpacity:e(this.classes.settings+" input[name=bg_overlay_opacity]")}),this.elements.bgType.on("change",e.proxy(this._bgTypeChange,this)),this.elements.bgColor.on("change",e.proxy(this._bgColorChange,this)),this.elements.bgOpacity.on("keyup",e.proxy(this._bgOpacityChange,this)),this.elements.bgImageSrc.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgRepeat.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgPosition.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgAttachment.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgSize.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgVideoServiceUrl.on("change",e.proxy(this._bgVideoChange,this)),this.elements.bgSlideshowSource.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowPhotos.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowFeedUrl.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTrans.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTransSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgParallaxImageSrc.on("change",e.proxy(this._bgParallaxChange,this)),this.elements.bgOverlayColor.on("change",e.proxy(this._bgOverlayChange,this)),this.elements.bgOverlayOpacity.on("keyup",e.proxy(this._bgOverlayChange,this))},_bgTypeChange:function(e){var t=this.elements.bgType.val();this.elements.node.removeClass("fl-row-bg-video"),this.elements.node.removeClass("fl-row-bg-slideshow"),this.elements.node.removeClass("fl-row-bg-parallax"),this.elements.node.find(".fl-bg-video").remove(),this.elements.node.find(".fl-bg-slideshow").remove(),this.elements.content.css("background-image",""),this.updateCSSRule(this.classes.content,{"background-color":"transparent","background-image":"none"}),"none"==t?this._bgOverlayClear():"color"==t?(this.elements.bgColor.trigger("change"),this._bgOverlayClear()):"photo"==t?(this.elements.bgColor.trigger("change"),this.elements.bgImageSrc.trigger("change")):"video"==t?(this.elements.bgColor.trigger("change"),this._bgVideoChange()):"slideshow"==t?(this.elements.bgColor.trigger("change"),this._bgSlideshowChange()):"parallax"==t&&(this.elements.bgColor.trigger("change"),this.elements.bgParallaxImageSrc.trigger("change"))},_bgColorChange:function(t){var l,i,o;""===this.elements.bgColor.val()||isNaN(this.elements.bgOpacity.val())?this.updateCSSRule(this.classes.content,"background-color","transparent"):(l=this.hexToRgb(this.elements.bgColor.val()),i=this.parseFloat(this.elements.bgOpacity.val())/100,o="rgba("+l.join()+", "+i+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"background-color",o)},this)))},_bgOpacityChange:function(e){this.elements.bgColor.trigger("change")},_bgPhotoChange:function(e){this.elements.bgImageSrc.val()?this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgImageSrc.val()+")","background-repeat":this.elements.bgRepeat.val(),"background-position":this.elements.bgPosition.val(),"background-attachment":this.elements.bgAttachment.val(),"background-size":this.elements.bgSize.val()}):this.updateCSSRule(this.classes.content,{"background-image":"none"})},_bgVideoChange:function(t){var l=this.elements,i=l.bgVideoSource.val(),o=l.bgVideo.val(),s=l.bgVideoServiceUrl.val(),r="https://www.youtube.com/iframe_api",n="https://player.vimeo.com/api/player.js",a=e("<script>");"video_service"==i&&""!=s?(/^(?:(?:(?:https?:)?\/\/)?(?:www.)?(?:youtu(?:be.com|.be))\/(?:watch\?v\=|v\/|embed\/)?([\w\-]+))/i.test(s)&&e('script[src*="youtube.com"').length<1?a.attr("src",r):/^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test(s)&&e('script[src*="vimeo.com"').length<1&&a.attr("src",n),a.attr("type","text/javascript").appendTo("head"),this.delay(500,e.proxy(this.preview,this))):""!=o&&this.preview()},_bgSlideshowChange:function(t){var l=this.elements,i=l.bgSlideshowSource.val(),o=l.bgSlideshowPhotos.val(),s=l.bgSlideshowFeedUrl.val(),r=l.bgSlideshowSpeed.val(),n=l.bgSlideshowTransSpeed.val();"wordpress"==i&&""===o||"smugmug"==i&&""===s||isNaN(parseInt(r))||isNaN(parseInt(n))||this.delay(500,e.proxy(this.preview,this))},_bgParallaxChange:function(e){this.elements.bgParallaxImageSrc.val()&&this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgParallaxImageSrc.val()+")","background-repeat":"no-repeat","background-position":"center center","background-attachment":"fixed","background-size":"cover"})},_bgOverlayChange:function(t){var l,i,o;""===this.elements.bgOverlayColor.val()||isNaN(this.elements.bgOverlayOpacity.val())?(this.elements.node.removeClass("fl-row-bg-overlay"),this.elements.node.removeClass("fl-col-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color","transparent")):(l=this.hexToRgb(this.elements.bgOverlayColor.val()),i=this.parseFloat(this.elements.bgOverlayOpacity.val())/100,o="rgba("+l.join()+", "+i+")",this.delay(100,e.proxy(function(){this.elements.node.hasClass("fl-col")?this.elements.node.addClass("fl-col-bg-overlay"):this.elements.node.addClass("fl-row-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color",o)},this)))},_bgOverlayClear:function(e){this.elements.bgOverlayColor.prev(".fl-color-picker-clear").trigger("click")},_initNodeBorder:function(){e.extend(this.elements,{borderType:e(this.classes.settings+" select[name=border_type]"),borderColor:e(this.classes.settings+" input[name=border_color]"),borderColorPicker:e(this.classes.settings+" .fl-picker-border_color"),borderOpacity:e(this.classes.settings+" input[name=border_opacity]")}),this.elements.borderType.on("change",e.proxy(this._borderTypeChange,this)),this.elements.borderColor.on("change",e.proxy(this._borderColorChange,this)),this.elements.borderOpacity.on("keyup",e.proxy(this._borderOpacityChange,this))},_borderTypeChange:function(e){var t=this.elements.borderType.val();this.updateCSSRule(this.classes.content,{"border-style":""===t?"none":t}),this.elements.borderColor.trigger("change"),this.elements.borderTop.trigger("keyup")},_borderColorChange:function(t){var l,i,o;""===this.elements.borderColor.val()||isNaN(this.elements.borderOpacity.val())?this.updateCSSRule(this.classes.content,"border-color","transparent"):(l=this.hexToRgb(this.elements.borderColor.val()),i=parseInt(this.elements.borderOpacity.val())/100,o="rgba("+l.join()+", "+i+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"border-color",o)},this)))},_borderOpacityChange:function(e){this.elements.borderColor.trigger("change")},_initNodeClassName:function(){e.extend(this.elements,{className:e(this.classes.settings+" input[name=class]")}),this.elements.className.on("keyup",e.proxy(this._classNameChange,this)),this._lastClassName=this.elements.className.val()},_classNameChange:function(e){var t=this.elements.className.val();null!==this._lastClassName&&this.elements.node.removeClass(this._lastClassName),this.elements.node.addClass(t),this._lastClassName=t},_initResponsiveDimensions:function(t){var l={},i=["Top","Bottom","Left","Right"],o=["","Medium","Responsive"],s=this.classes.settings,r="",n="",a=null,d=null;for(a=0;a<i.length;a++)for(d=0;d<o.length;d++)r=t+i[a]+o[d],n=t+"_"+i[a].toLowerCase(),""!=o[d]&&(n+="_"+o[d].toLowerCase()),l[r]=e(s+" input[name="+n+"]"),l[r].on("keyup",e.proxy(this._responsiveDimensionChange,this,t));e.extend(this.elements,l)},_getDimensions:function(e){for(var t=FLBuilderResponsiveEditing._mode,l=["Top","Bottom","Left","Right"],i="default"==t?"":t.charAt(0).toUpperCase()+t.slice(1),o={},s=0;s<l.length;s++)o[l[s].toLowerCase()]=this.elements[e+l[s]+i].val();return this._normalizeDimensionValues(o,e)},_responsiveDimensionChange:function(t){var l=this._getDimensions(t),i={},o="border"==t;e.each(l,function(e,l){i[t+"-"+e+(o?"-width":"")]=l}),this.updateResponsiveCSSRule(this.classes.content,i),this._positionAbsoluteBgs()},_normalizeDimensionValues:function(t,l){var i=this,o=FLBuilderResponsiveEditing._mode,s="default"==o?"":o.charAt(0).toUpperCase()+o.slice(1),l=l.split("-");return"undefined"==typeof l[1]?l[1]="":l[1]=l[1].charAt(0).toUpperCase()+l[1].slice(1),e.map(t,function(e,o){if(e=e.toLowerCase().replace(/[^a-z0-9%.\-]/g,""),""===e){var r=l[0]+o.charAt(0).toUpperCase()+o.slice(1)+l[1]+s,n=i.elements[r].attr("placeholder");n&&(e=n)}null===e||""===e||isNaN(e)||(e=parseFloat(e)+"px"),t[o]=e}),t},_positionAbsoluteBgs:function(){var t=this.elements.node.find(".fl-bg-slideshow"),l=this.elements.node.find(".fl-bg-video"),i=null,o=null,s={top:0,bottom:0,left:0,right:0};(t.length>0||l.length>0)&&(i=this._getDimensions("margin"),o=this._getDimensions("border"),e.map(s,function(e,t){i[t]&&o[t]?s[t]="calc("+i[t]+"+"+o[t]+")":i[t]?s[t]=i[t]:o[t]&&(s[t]=o[t])}),t.length>0&&(this.updateCSSRule(this.classes.node+" .fl-bg-slideshow",s),FLBuilder._resizeLayout()),l.length>0&&this.updateCSSRule(this.classes.node+" .fl-bg-video",s))},_initRow:function(){e.extend(this.elements,{width:e(this.classes.settings+" select[name=width]"),contentWidth:e(this.classes.settings+" select[name=content_width]"),height:e(this.classes.settings+" select[name=full_height]"),align:e(this.classes.settings+" select[name=content_alignment]")}),this.elements.width.on("change",e.proxy(this._rowWidthChange,this)),this.elements.contentWidth.on("change",e.proxy(this._rowContentWidthChange,this)),this.elements.height.on("change",e.proxy(this._rowHeightChange,this)),this.elements.align.on("change",e.proxy(this._rowHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_rowWidthChange:function(e){var t=this.elements.node;"full"==this.elements.width.val()?(t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"))},_rowHeightChange:function(e){var t=this.elements.node;t.removeClass("fl-row-align-top"),t.removeClass("fl-row-align-center"),"full"==this.elements.height.val()?(t.addClass("fl-row-full-height"),t.addClass("fl-row-align-"+this.elements.align.val())):t.removeClass("fl-row-full-height")},_rowContentWidthChange:function(e){var t=this.elements.content.find(".fl-row-content");"full"==this.elements.contentWidth.val()?(t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"))},_initColumn:function(){e.extend(this.elements,{size:e(this.classes.settings+" input[name=size]"),columnHeight:e(this.classes.settings+" select[name=equal_height]"),columnAlign:e(this.classes.settings+" select[name=content_alignment]"),responsiveOrder:e(this.classes.settings+" select[name=responsive_order]")}),this.elements.size.on("keyup",e.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",e.proxy(this._colHeightChange,this)),this.elements.columnAlign.on("change",e.proxy(this._colHeightChange,this)),this.elements.responsiveOrder.on("change",e.proxy(this._colResponsiveOrder,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_colSizeChange:function(){var t=8,l=100-t,i=parseFloat(this.elements.size.val()),o=this.elements.node.prev(".fl-col"),s=this.elements.node.next(".fl-col"),r=0===s.length?o:s,n=this.elements.node.siblings(".fl-col"),a=0;0===n.length||isNaN(i)||(n.each(function(){e(this).data("node")!=r.data("node")&&(l-=parseFloat(e(this)[0].style.width),
2
- a+=parseFloat(e(this)[0].style.width))}),i<t&&(i=t),i>l&&(i=l),r.css("width",100-a-i+"%"),this.elements.node.css("width",i+"%"))},_colHeightChange:function(){var e=this.elements.node.parent(".fl-col-group");e.removeClass("fl-col-group-align-top"),e.removeClass("fl-col-group-align-center"),e.removeClass("fl-col-group-align-bottom"),"yes"==this.elements.columnHeight.val()?(e.addClass("fl-col-group-equal-height"),e.addClass("fl-col-group-align-"+this.elements.columnAlign.val())):e.removeClass("fl-col-group-equal-height")},_colResponsiveOrder:function(){var e=this.elements.node.parent(".fl-col-group");"reversed"==this.elements.responsiveOrder.val()?e.addClass("fl-col-group-responsive-reversed"):e.removeClass("fl-col-group-responsive-reversed")},_initModule:function(){this._initNodeClassName(),this._initResponsiveDimensions("margin")},_initDefaultFieldPreviews:function(){for(var e=this.elements.settings.find(".fl-field"),t=null,l=null,i=0;i<e.length;i++)t=e.eq(i),l=t.data("preview"),"refresh"==l.type&&this._initFieldRefreshPreview(t),"text"==l.type&&this._initFieldTextPreview(t),"css"==l.type&&this._initFieldCSSPreview(t),"widget"==l.type&&this._initFieldWidgetPreview(t),"font"==l.type&&this._initFieldFontPreview(t)},_initFieldRefreshPreview:function(t){var l=t.data("type"),i=t.data("preview"),o=e.proxy(this.delayPreview,this);switch(l){case"text":t.find("input[type=text]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"select":t.find("select").on("change",o);break;case"color":t.find(".fl-color-picker-value").on("change",o);break;case"photo":t.find("select").on("change",o);break;case"multiple-photos":t.find("input").on("change",o);break;case"photo-sizes":t.find("select").on("change",o);break;case"video":t.find("input").on("change",o);break;case"multiple-audios":t.find("input").on("change",o);break;case"icon":t.find("input").on("change",o);break;case"form":t.delegate("input","change",o);break;case"editor":this._addTextEditorCallback(t,i);break;case"code":t.find("textarea").on("change",o);break;case"post-type":t.find("select").on("change",o);break;case"suggest":t.find(".as-values").on("change",o);break;case"unit":t.find("input[type=number]").on("keyup",o)}},_initFieldTextPreview:function(t){var l=t.data("type"),i=t.data("preview"),o=e.proxy(this._previewText,this,i);switch(l){case"text":t.find("input[type=text]").on("keyup",o);break;case"unit":t.find("input[type=number]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"code":t.find("textarea").on("change",o);break;case"editor":this._addTextEditorCallback(t,i)}},_previewText:function(t,l){var i=this.elements.node.find(t.selector),o=e("<div>"+e(l.target).val()+"</div>");i.length>0&&(o.find("script").remove(),i.html(o.html()))},_previewTextEditor:function(t,l,i){var o=this.elements.node.find(t.selector),s="undefined"!=typeof tinyMCE?tinyMCE.get(l):null,r=e("#"+l),n="";o.length>0&&(n=e(s&&"none"==r.css("display")?"<div>"+s.getContent()+"</div>":"undefined"==typeof switchEditors||"undefined"==typeof switchEditors.wpautop?"<div>"+r.val()+"</div>":"<div>"+switchEditors.wpautop(r.val())+"</div>"),n.find("script").remove(),o.html(n.html()))},_addTextEditorCallback:function(t,l){var i=t.find("textarea.wp-editor-area").attr("id"),o=null;if("refresh"==l.type)o=e.proxy(this.delayPreview,this);else{if("text"!=l.type)return;o=e.proxy(this._previewTextEditor,this,l,i)}e("#"+i).on("keyup",o),"undefined"!=typeof tinyMCE&&(editor=tinyMCE.get(i),editor.on("change",o),editor.on("keyup",o))},_initFieldFontPreview:function(t){var l=t.data("type"),i=t.data("preview");i.id=t.attr("id");var o=e.proxy(this._previewFont,this,i);"font"==l&&t.find(".fl-font-field").on("change","select",o)},_previewFont:function(t,l){var i=e(l.delegateTarget),o=i.find(".fl-font-field-font"),s=e(o).find(":selected"),r=s.parent().attr("label"),n=i.find(".fl-font-field-weight"),a=t.id+"-"+this.nodeId,d=this._getPreviewSelector(this.classes.node,t.selector);"Google"==r&&this._buildFontStylesheet(a,o.val(),n.val()),"Default"==o.val()?(this.updateCSSRule(d,"font-family",""),this.updateCSSRule(d,"font-weight","")):(this.updateCSSRule(d,"font-family",o.val()),this.updateCSSRule(d,"font-weight",n.val()))},_buildFontStylesheet:function(t,l,i){var o=FLBuilderConfig.googleFontsUrl,s="",r={},n={};r[l]=[i],FLBuilderPreview._fontsList[t]=r,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var t=FLBuilderPreview._fontsList[e];Object.keys(t).forEach(function(e){var l=t[e];n[e]=n[e]||[],l=l.filter(function(t){return n[e].indexOf(t)<0}),n[e]=n[e].concat(l)})}),e.each(n,function(e,t){s+=e+":"+t.join()+"|"}),s=o+s.slice(0,-1).replace(" ","+"),e("#fl-builder-google-fonts-preview").length<1?e("<link>").attr("id","fl-builder-google-fonts-preview").attr("type","text/css").attr("rel","stylesheet").attr("href",s).appendTo("head"):e("#fl-builder-google-fonts-preview").attr("href",s)},_initFieldCSSPreview:function(e){var t=e.data("preview"),l=null;if("undefined"!=typeof t.rules)for(l in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[l]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(t,l){switch(t.data("type")){case"text":t.find("input[type=text]").on("keyup",e.proxy(this._previewCSS,this,l));break;case"unit":t.find("input[type=number]").on("keyup",e.proxy(this._previewCSS,this,l));break;case"select":t.find("select").on("change",e.proxy(this._previewCSS,this,l));break;case"color":t.find(".fl-color-picker-value").on("change",e.proxy(this._previewColor,this,l))}},_previewCSS:function(t,l){var i=this._getPreviewSelector(this.classes.node,t.selector),o=t.property,s="undefined"==typeof t.unit?"":t.unit,r=e(l.target),n=r.val();"%"==s?n=parseInt(n)/100:n+=s,r.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(i,o,n):this.updateCSSRule(i,o,n)},_previewColor:function(t,l){var i=this._getPreviewSelector(this.classes.node,t.selector),o=e(l.target),s=o.val(),r=""===s?"inherit":"#"+s;o.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(i,t.property,r):this.updateCSSRule(i,t.property,r)},_initFieldWidgetPreview:function(t){var l=e.proxy(this.delayPreview,this);t.find("input").on("keyup",l),t.find("input[type=checkbox]").on("click",l),t.find("textarea").on("keyup",l),t.find("select").on("change",l)},_getPreviewSelector:function(e,t){for(var l="",i=t.split(","),o=0;o<i.length;o++)l+=e+" "+i[o],o!=i.length-1&&(l+=", ");return l}}}(jQuery),function(e){FLBuilderResponsiveEditing={_mode:"default",_fields:{},refreshPreview:function(){e(".fl-responsive-preview").length&&FLBuilderForcedMediaQueries.update()},_init:function(){this._bind()},_bind:function(){FLBuilder.addHook("responsive-editing-switched",this._previewSpacingFields),FLBuilder.addHook("settings-form-init",this._initSettingsForms),FLBuilder.addHook("settings-lightbox-closed",this._clearPreview),e("body").delegate(".fl-field-responsive-toggle","click",this._settingToggleClicked)},_switchTo:function(t,l){var i=e("body"),o=e(FLBuilder._contentClass),s=e(".fl-responsive-preview"),r=e(".fl-responsive-preview-mask"),n=e(".fl-content-placeholder"),a=null;if(FLBuilderResponsiveEditing._mode=t,"default"==t){if(0===n.length)return;n.after(o),n.remove(),s.remove(),r.remove()}else 0===s.length?(o.after('<div class="fl-content-placeholder"></div>'),i.prepend(wp.template("fl-responsive-preview")()),e(".fl-responsive-preview").addClass("fl-preview-"+t),e(".fl-responsive-preview-content").append(o)):(s.removeClass("fl-preview-responsive fl-preview-medium"),s.addClass("fl-preview-"+t));"responsive"==t?(a=FLBuilderConfig.global.responsive_breakpoint>=320?320:FLBuilderConfig.global.responsive_breakpoint,o.width(a),FLBuilderForcedMediaQueries.update(a,l)):"medium"==t?(a=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,o.width(a),FLBuilderForcedMediaQueries.update(a,l)):(o.width(""),FLBuilderForcedMediaQueries.update(1e4,l)),this._setContentBackgroundColor(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("responsive-editing-switched",t)},_setContentBackgroundColor:function(){var t=e(FLBuilder._contentClass),l=e(".fl-responsive-preview"),i=e(".fl-content-placeholder"),o=i.parents(),s="#fff",r=0;if(0===l.length)t.css("background-color","");else{for(;r<o.length&&(s=o.eq(r).css("background-color"),"rgba(0, 0, 0, 0)"==s);r++);t.css("background-color",s)}},_switchToAndScroll:function(t){var l=e(".fl-builder-settings").data("node"),i=void 0===l?void 0:e(".fl-node-"+l);FLBuilderResponsiveEditing._switchTo(t,function(){void 0!==i&&i&&setTimeout(function(){var t=e(window),l=e(".fl-responsive-preview-content");!l.length||t.height()<l.height()?e("html, body").animate({scrollTop:i.offset().top-100},250):scrollTo(0,0)},250)})},_clearPreview:function(){FLBuilderResponsiveEditing._switchToAndScroll("default")},_settingToggleClicked:function(){var t=e(this),l=t.data("mode");l="default"==l?"medium":"medium"==l?"responsive":"default",FLBuilderResponsiveEditing._switchAllSettingsTo(l),t.siblings(".fl-field-responsive-setting:visible").find("input").focus()},_switchAllSettingsTo:function(t){var l="dashicons-desktop dashicons-tablet dashicons-smartphone";e(".fl-field-responsive-toggle").removeClass(l),e(".fl-field-responsive-setting").hide(),l="default"==t?"dashicons-desktop":"medium"==t?"dashicons-tablet":"dashicons-smartphone",e(".fl-field-responsive-toggle").addClass(l).data("mode",t),e(".fl-field-responsive-setting-"+t).css("display","inline-block"),FLBuilderResponsiveEditing._switchToAndScroll(t)},_initSettingsForms:function(){var e=FLBuilderResponsiveEditing;Number(FLBuilderConfig.global.responsive_enabled)&&(FLBuilderResponsiveEditing._fields={},e._initFields("unit","input","keyup",e._spacingFieldKeyup,["margin_top","margin_bottom","margin_left","margin_right","padding_top","padding_bottom","padding_left","padding_right"]),e._initFields("unit","input","keyup",e._textFieldKeyup)),e._switchAllSettingsTo(e._mode)},_initFields:function(t,l,i,o,s){var r=e(".fl-builder-settings"),n=r.find(".fl-field").has(".fl-field-responsive-setting"),a=null,d=null,u=0,c=0;for("object"!=typeof this._fields[t]&&(this._fields[t]={});u<n.length;u++)if(a=n.eq(u),d=a.attr("id").replace("fl-field-",""),!("object"==typeof s&&e.inArray(d,s)<0)&&t==a.attr("data-type")&&void 0===a.attr("data-responsive-init")){this._fields[t][d]={"default":a.find(".fl-field-responsive-setting-default "+l),medium:a.find(".fl-field-responsive-setting-medium "+l),responsive:a.find(".fl-field-responsive-setting-responsive "+l)};for(c in this._fields[t][d])this._fields[t][d][c].on(i,o);this._fields[t][d]["default"].trigger(i),a.attr("data-responsive-init",1)}},_getFields:function(t){var l=e(t).closest(".fl-field");return type=l.attr("data-type"),name=l.attr("id").replace("fl-field-",""),this._fields[type][name]},_textFieldKeyup:function(){var e=FLBuilderResponsiveEditing._getFields(this),t=e["default"].attr("placeholder"),l=e["default"].val(),i=e.medium.val();""==l?e.medium.attr("placeholder",void 0===t?"":t):e.medium.attr("placeholder",l),""==i?e.responsive.attr("placeholder",e.medium.attr("placeholder")):e.responsive.attr("placeholder",i)},_spacingFieldKeyup:function(){var t=e(".fl-builder-settings"),l="row",i=e(this).closest(".fl-field").attr("id").replace("fl-field-","").split("_"),o=i[0],s=i[1],r=FLBuilderResponsiveEditing._fields.unit[o+"_"+s],n=FLBuilderConfig.global,a=null,d=r["default"].val(),u=null,c=r.medium.val(),f=null,h=(r.responsive.val(),null),p=null,g=null;t.hasClass("fl-builder-row-settings")?l="row":t.hasClass("fl-builder-col-settings")?l="col":t.hasClass("fl-builder-module-settings")&&(l="module"),e.extend(n,{col_margins:0,col_margins_medium:"",col_margins_responsive:"",col_padding:0,col_padding_medium:"",col_padding_responsive:""}),a=l+"_"+o+("margin"==o?"s":""),u=n[a],f=n[a+"_medium"],h=n[a+"_responsive"],""==f&&(""!=d?r.medium.attr("placeholder",d):""!=u&&r.medium.attr("placeholder",u)),""==h&&("module"==l&&Number(n.auto_spacing)?(p=""==f?Number(u):f,g=""==c?Number(d):c,""!=g&&(g>p||g<0)?r.responsive.attr("placeholder",p):""!=g?r.responsive.attr("placeholder",g):r.responsive.attr("placeholder",p)):(!Number(n.auto_spacing)||"padding"==o&&"top|bottom".indexOf(s)>-1)&&(""!=c?r.responsive.attr("placeholder",c):""!=f?r.responsive.attr("placeholder",f):""!=d?r.responsive.attr("placeholder",d):""!=u&&r.responsive.attr("placeholder",u)))},_previewSpacingFields:function(){var t=FLBuilderResponsiveEditing._mode,l=e(".fl-builder-settings"),i=null,o=null;if(0!==l.length&&void 0!==l.attr("data-node")){i=FLBuilderResponsiveEditing._fields.unit;for(o in i)i[o][t].trigger("keyup")}}},e(function(){FLBuilderResponsiveEditing._init()})}(jQuery),function(e){var t={init:function(){var t=e("body");t.delegate(".fl-builder-service-select","change",this._serviceChange),t.delegate(".fl-builder-service-connect-button","click",this._connectClicked),t.delegate(".fl-builder-service-account-select","change",this._accountChange),t.delegate(".fl-builder-service-account-delete","click",this._accountDeleteClicked),t.delegate(".fl-builder-campaign-monitor-client-select","change",this._campaignMonitorClientChange),t.delegate(".fl-builder-mailchimp-list-select","change",this._mailChimpListChange),t.delegate(".fl-builder-activecampaign-list_type-select","change",this._activeCampaignChange)},_startSettingsLoading:function(t){var l=e(".fl-builder-settings"),i=t.closest(".fl-builder-service-settings"),o=e(".fl-builder-service-error");l.append('<div class="fl-builder-loading"></div>'),i.addClass("fl-builder-service-settings-loading"),o.remove()},_finishSettingsLoading:function(){var t=e(".fl-builder-settings"),l=e(".fl-builder-service-settings-loading");t.find(".fl-builder-loading").remove(),l.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this),o=i.closest("tr"),s=i.val();o.siblings("tr.fl-builder-service-account-row").remove(),o.siblings("tr.fl-builder-service-connect-row").remove(),o.siblings("tr.fl-builder-service-field-row").remove(),e(".fl-builder-service-error").remove(),""!==s&&(t._startSettingsLoading(i),FLBuilder.ajax({action:"render_service_settings",node_id:l,service:s},t._serviceChangeComplete))},_serviceChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row");s.after(i.html),t._addAccountDelete(o),t._finishSettingsLoading()},_connectClicked:function(){for(var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-connect-row"),r=i.find(".fl-builder-service-connect-input"),n=null,a=null,d=0,u={action:"connect_service",node_id:l,service:o.val(),fields:{}};d<r.length;d++)n=r.eq(d),a=n.attr("name"),u.fields[a]=n.val();s.hide(),t._startSettingsLoading(o),FLBuilder.ajax(u,t._connectComplete)},_connectComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row"),r=o.find(".fl-builder-service-select"),n=o.find(".fl-builder-service-account-row"),a=o.find(".fl-builder-service-account-select"),d=o.find(".fl-builder-service-connect-row");i.error?(d.show(),0===a.length?r.after('<div class="fl-builder-service-error">'+i.error+"</div>"):a.after('<div class="fl-builder-service-error">'+i.error+"</div>")):(d.remove(),n.remove(),s.after(i.html)),t._addAccountDelete(o),t._finishSettingsLoading()},_accountChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-account-select"),r=i.find(".fl-builder-service-connect-row"),n=i.find("tr.fl-builder-service-field-row"),a=e(".fl-builder-service-error"),d=s.val(),u=null;r.remove(),n.remove(),a.remove(),"add_new_account"==d?u={action:"render_service_settings",node_id:l,service:o.val(),add_new:!0}:""!==d&&(u={action:"render_service_fields",node_id:l,service:o.val(),account:d}),u&&(t._startSettingsLoading(o),FLBuilder.ajax(u,t._accountChangeComplete)),t._addAccountDelete(i)},_accountChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-account-row");s.after(i.html),t._finishSettingsLoading()},_addAccountDelete:function(e){var t=e.find(".fl-builder-service-account-select");t.length>0&&(e.find(".fl-builder-service-account-delete").remove(),""!==t.val()&&"add_new_account"!=t.val()&&t.after('<a href="javascript:void(0);" class="fl-builder-service-account-delete">'+FLBuilderStrings.deleteAccount+"</a>"))},_accountDeleteClicked:function(){var l=e(this).closest(".fl-builder-service-settings"),i=l.find(".fl-builder-service-select"),o=l.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:i.val(),account:o.val()},t._accountDeleteComplete),t._startSettingsLoading(o))},_accountDeleteComplete:function(){var l=e(".fl-builder-service-settings-loading"),i=l.find(".fl-builder-service-select");t._finishSettingsLoading(),i.trigger("change")},_campaignMonitorClientChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-account-select"),r=e(this),n=i.find(".fl-builder-service-list-select"),a=r.val();0!==n.length&&n.closest("tr").remove(),""!==a&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:l,service:o.val(),account:s.val(),client:a},t._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-campaign-monitor-client-select");s.closest("tr").after(i.html),t._finishSettingsLoading()},_mailChimpListChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-account-select"),r=i.find(".fl-builder-service-list-select");e(".fl-builder-mailchimp-group-select").closest("tr").remove(),""!==r.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:l,service:o.val(),account:s.val(),list_id:r.val()},t._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-list-select");s.closest("tr").after(i.html),t._finishSettingsLoading()},_activeCampaignChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-account-select"),r=i.find(".fl-builder-service-list-select");list_type=i.find('select[name="list_type"]'),0!==r.length&&r.closest("tr").remove(),""!==list_type.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:l,service:o.val(),account:s.val(),list_type:list_type.val()},t._activeCampaignTypeChangeComplete))},_activeCampaignTypeChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-field-row");s.after(i.html),t._finishSettingsLoading()}};e(function(){t.init()})}(jQuery),function(e){FLBuilderTour={_tour:null,start:function(){FLBuilderTour._tour?FLBuilderTour._tour.restart():(FLBuilderTour._tour=new Tour(FLBuilderTour._config()),FLBuilderTour._tour.init()),FLBuilderTour._tour.start()},_config:function(){var t={storage:!1,onStart:FLBuilderTour._onStart,onPrev:FLBuilderTour._onPrev,onNext:FLBuilderTour._onNext,onEnd:FLBuilderTour._onEnd,template:'<div class="popover" role="tooltip"> <i class="fa fa-times" data-role="end"></i> <div class="arrow"></div> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="next">'+FLBuilderStrings.tourNext+"</button> </div> </div>",steps:[{animation:!1,element:".fl-builder-bar",placement:"bottom",title:FLBuilderStrings.tourTemplatesTitle,content:FLBuilderStrings.tourTemplates,onShown:function(){0===e(".fl-template-selector").length?(e(".popover[class*=tour-]").css("visibility","hidden"),FLBuilder._showTemplateSelector()):FLBuilderTour._templateSelectorLoaded()}},{animation:!1,element:"#fl-builder-blocks-rows .fl-builder-blocks-section-title",placement:"left",title:FLBuilderStrings.tourAddRowsTitle,content:FLBuilderStrings.tourAddRows,onShow:function(){FLBuilderTour._dimSection("body"),FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._showPanel(),e(".fl-template-selector .fl-builder-settings-cancel").trigger("click"),e("#fl-builder-blocks-rows .fl-builder-blocks-section-title").trigger("click")}},{animation:!1,element:"#fl-builder-blocks-basic .fl-builder-blocks-section-title",placement:"left",title:FLBuilderStrings.tourAddContentTitle,content:FLBuilderStrings.tourAddContent,onShow:function(){FLBuilderTour._dimSection("body"),FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._showPanel(),e("#fl-builder-blocks-basic .fl-builder-blocks-section-title").trigger("click"),e(".fl-row").eq(0).trigger("mouseleave"),e(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-row:first-of-type",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-row:first-of-type .fl-module-overlay .fl-block-overlay-actions",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent2,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-builder-add-content-button",placement:"bottom",title:FLBuilderStrings.tourAddContentButtonTitle,content:FLBuilderStrings.tourAddContentButton,onShow:function(){FLBuilderTour._dimSection("body"),e(".fl-row").eq(0).trigger("mouseleave"),e(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-builder-templates-button",placement:"bottom",title:FLBuilderStrings.tourTemplatesButtonTitle,content:FLBuilderStrings.tourTemplatesButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-tools-button",placement:"bottom",title:FLBuilderStrings.tourToolsButtonTitle,content:FLBuilderStrings.tourToolsButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-done-button",placement:"bottom",title:FLBuilderStrings.tourDoneButtonTitle,content:FLBuilderStrings.tourDoneButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,orphan:!0,backdrop:!0,title:FLBuilderStrings.tourFinishedTitle,content:FLBuilderStrings.tourFinished,template:'<div class="popover" role="tooltip"> <div class="arrow"></div> <i class="fa fa-times" data-role="end"></i> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="end">'+FLBuilderStrings.tourEnd+"</button> </div> </div>"}]};return FLBuilderConfig.lite?t.steps.shift():"disabled"==FLBuilderConfig.enabledTemplates?t.steps.shift():"fl-builder-template"==FLBuilderConfig.postType&&t.steps.shift(),t},_onStart:function(){var t=e("body");t.append('<div class="fl-builder-tour-mask"></div>'),t.on("fl-builder.template-selector-loaded",FLBuilderTour._templateSelectorLoaded),0===e(".fl-row").length&&"module"!=FLBuilderConfig.userTemplateType&&(e(".fl-builder-content").append('<div class="fl-builder-tour-demo-content fl-row fl-row-fixed-width fl-row-bg-none"> <div class="fl-row-content-wrap"> <div class="fl-row-content fl-row-fixed-width fl-node-content"> <div class="fl-col-group"> <div class="fl-col" style="width:100%"> <div class="fl-col-content fl-node-content"> <div class="fl-module fl-module-rich-text" data-type="rich-text" data-name="Text Editor"> <div class="fl-module-content fl-node-content"> <div class="fl-rich-text"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pellentesque ut lorem non cursus. Sed mauris nunc, porttitor iaculis lorem a, sollicitudin lacinia sapien. Proin euismod orci lacus, et sollicitudin leo posuere ac. In hac habitasse platea dictumst. Maecenas elit magna, consequat in turpis suscipit, ultrices rhoncus arcu. Phasellus finibus sapien nec elit tempus venenatis. Maecenas tincidunt sapien non libero maximus, in aliquam felis tincidunt. Mauris mollis ultricies facilisis. Duis condimentum dignissim tortor sit amet facilisis. Aenean gravida lacus eu risus molestie egestas. Donec ut dolor dictum, fringilla metus malesuada, viverra nunc. Maecenas ut purus ac justo aliquet lacinia. Cras vestibulum elementum tincidunt. Maecenas mattis tortor neque, consectetur dignissim neque tempor nec.</p></div> </div> </div> </div> </div> </div> </div> </div> </div>'),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols())},_onPrev:function(){e(".fl-builder-tour-dimmed").remove()},_onNext:function(){e(".fl-builder-tour-dimmed").remove()},_onEnd:function(){e("body").off("fl-builder.template-selector-loaded"),e(".fl-builder-tour-mask").remove(),e(".fl-builder-tour-dimmed").remove(),e(".fl-builder-tour-demo-content").remove(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showPanel(),FLBuilder._initTemplateSelector()},_dimSection:function(t){e(t).find(".fl-builder-tour-dimmed").remove(),e(t).append('<div class="fl-builder-tour-dimmed"></div>')},_templateSelectorLoaded:function(){var t=e(".fl-builder-settings-lightbox .fl-lightbox-header"),l=t.height(),i=t.offset().top+75;e(".popover[class*=tour-]").css({top:i+l+"px",visibility:"visible"})}}}(jQuery),function(e){FLBuilder={preview:null,_actionsLightbox:null,_addModuleAfterNodeRender:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_dragInitialScrollTop:0,_exitUrl:null,_layout:null,_layoutSettingsCSSCache:null,_layoutSettingsCSSTimeout:null,_lightbox:null,_lightboxScrollbarTimeout:null,_loadedModuleAssets:[],_moduleHelpers:{},_multiplePhotoSelector:null,_newColGroupParent:null,_newColGroupPosition:0,_newModuleParent:null,_newModulePosition:0,_newRowPosition:0,_selectedTemplateId:null,_selectedTemplateType:null,_singlePhotoSelector:null,_singleVideoSelector:null,_multipleAudiosSelector:null,_silentUpdate:!1,_silentUpdateCallbackData:null,_init:function(){FLBuilder._initJQueryReadyFix(),FLBuilder._initGlobalErrorHandling(),FLBuilder._initPostLock(),FLBuilder._initClassNames(),FLBuilder._initMediaUploader(),FLBuilder._initOverflowFix(),FLBuilder._initScrollbars(),FLBuilder._initLightboxes(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._initStrings(),FLBuilder._initTipTips(),FLBuilder._bindEvents(),FLBuilder._bindOverlayEvents(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showTourOrTemplates()},_initJQueryReadyFix:function(){FLBuilderConfig.debug||(jQuery.fn.oldReady=jQuery.fn.ready,jQuery.fn.ready=function(e){return jQuery.fn.oldReady(function(){try{"function"==typeof e&&e()}catch(t){FLBuilder.logError(t)}})})},_initGlobalErrorHandling:function(){FLBuilderConfig.debug||(window.onerror=function(e,t,l,i,o){return FLBuilder.logGlobalError(e,t,l,i,o),!0})},_initPostLock:function(){"undefined"!=typeof wp.heartbeat&&(wp.heartbeat.interval(30),wp.heartbeat.enqueue("fl_builder_post_lock",{post_id:e("#fl-post-id").val()}))},_initClassNames:function(){e("html").addClass("fl-builder-edit"),e("body").addClass("fl-builder"),FLBuilderConfig.simpleUi&&e("body").addClass("fl-builder-simple"),FLBuilder._contentClass=".fl-builder-content-"+FLBuilderConfig.postId},_initMediaUploader:function(){wp.media.model.settings.post.id=e("#fl-post-id").val()},_initOverflowFix:function(){e(FLBuilder._contentClass).parents().css("overflow","visible")},_initScrollbars:function(){e(".fl-nanoscroller").nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},_initLightboxes:function(){FLBuilder._lightbox=new FLLightbox({className:"fl-builder-lightbox fl-builder-settings-lightbox"}),FLBuilder._lightbox.on("close",FLBuilder._lightboxClosed),FLBuilder._actionsLightbox=new FLLightbox({className:"fl-builder-actions-lightbox"})},_initSortables:function(){var t={appendTo:"body",cursor:"move",cursorAt:{left:60,top:20},distance:1,helper:FLBuilder._blockDragHelper,start:FLBuilder._blockDragStart,sort:FLBuilder._blockDragSort,change:FLBuilder._blockDragChange,stop:FLBuilder._blockDragStop,placeholder:"fl-builder-drop-zone",tolerance:"intersect"},l="",i="";i="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col-content":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-node-global) .fl-col-content",l=FLBuilderConfig.nestedColumns?i:"row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",e(".fl-builder-rows").sortable(e.extend({},t,{connectWith:l,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),e(".fl-builder-row-templates").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-row-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-rows").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-saved-row",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-modules, .fl-builder-widgets").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-module",stop:FLBuilder._moduleDragStop})),e(".fl-builder-module-templates").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-module-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-modules").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:i,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-row-sortable-proxy").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",helper:FLBuilder._rowDragHelper,start:FLBuilder._rowDragStart,stop:FLBuilder._rowDragStop})),e(".fl-col-sortable-proxy").sortable(e.extend({},t,{connectWith:i,helper:FLBuilder._colDragHelper,start:FLBuilder._colDragStart,stop:FLBuilder._colDragStop})),e(FLBuilder._contentClass+" .fl-col-content").sortable(e.extend({},t,{connectWith:i,handle:".fl-module-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._moduleDragHelper,items:".fl-module, .fl-col-group",start:FLBuilder._moduleDragStart,stop:FLBuilder._moduleDragStop})),e(FLBuilder._contentClass+" .fl-row-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-group-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-drop-target").sortable(t)},_initStrings:function(){e.validator.messages.required=FLBuilderStrings.validateRequiredMessage},_bindEvents:function(){e("a").on("click",FLBuilder._preventDefault),
3
- e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e(document).on("heartbeat-tick",FLBuilder._initPostLock),e(window).on("beforeunload",FLBuilder._warnBeforeUnload),e("body").delegate(".fl-builder-has-submenu","click",FLBuilder._submenuParentClicked),e("body").delegate(".fl-builder-has-submenu a","click",FLBuilder._submenuChildClicked),e("body").delegate(".fl-builder-submenu","mouseenter",FLBuilder._submenuMouseenter),e("body").delegate(".fl-builder-submenu","mouseleave",FLBuilder._submenuMouseleave),e("body").delegate(".fl-builder-submenu .fl-builder-has-submenu","mouseenter",FLBuilder._submenuNestedParentMouseenter),e(".fl-builder-tools-button").on("click",FLBuilder._toolsClicked),e(".fl-builder-done-button").on("click",FLBuilder._doneClicked),e(".fl-builder-add-content-button").on("click",FLBuilder._showPanel),e(".fl-builder-templates-button").on("click",FLBuilder._changeTemplateClicked),e(".fl-builder-buy-button").on("click",FLBuilder._upgradeClicked),e(".fl-builder-upgrade-button").on("click",FLBuilder._upgradeClicked),e(".fl-builder-help-button").on("click",FLBuilder._helpButtonClicked),e(".fl-builder-panel-actions .fl-builder-panel-close").on("click",FLBuilder._closePanel),e(".fl-builder-blocks-section-title").on("click",FLBuilder._blockSectionTitleClicked),e("body").delegate(".fl-builder-node-template-actions","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-delete","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","click",FLBuilder._editNodeTemplateClicked),e("body").delegate(".fl-builder-node-template-delete","click",FLBuilder._deleteNodeTemplateClicked),e("body").delegate(".fl-builder-block","mousedown",FLBuilder._blockDragInit),e("body").on("mouseup",FLBuilder._blockDragCancel),e("body").delegate(".fl-builder-actions .fl-builder-cancel-button","click",FLBuilder._cancelButtonClicked),e("body").delegate(".fl-lightbox-controls .fa","click",FLBuilder._resizeLightbox),e("body").delegate(".fl-builder-save-actions .fl-builder-publish-button","click",FLBuilder._publishButtonClicked),e("body").delegate(".fl-builder-save-actions .fl-builder-draft-button","click",FLBuilder._draftButtonClicked),e("body").delegate(".fl-builder-save-actions .fl-builder-discard-button","click",FLBuilder._discardButtonClicked),e("body").delegate(".fl-builder-save-user-template-button","click",FLBuilder._saveUserTemplateClicked),e("body").delegate(".fl-builder-duplicate-layout-button","click",FLBuilder._duplicateLayoutClicked),e("body").delegate(".fl-builder-layout-settings-button","click",FLBuilder._layoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-save","click",FLBuilder._saveLayoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-builder-global-settings-button","click",FLBuilder._globalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-save","click",FLBuilder._saveGlobalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-template-category-select","change",FLBuilder._templateCategoryChanged),e("body").delegate(".fl-template-preview","click",FLBuilder._templateClicked),e("body").delegate(".fl-user-template","click",FLBuilder._userTemplateClicked),e("body").delegate(".fl-user-template-edit","click",FLBuilder._editUserTemplateClicked),e("body").delegate(".fl-user-template-delete","click",FLBuilder._deleteUserTemplateClicked),e("body").delegate(".fl-builder-template-replace-button","click",FLBuilder._templateReplaceClicked),e("body").delegate(".fl-builder-template-append-button","click",FLBuilder._templateAppendClicked),e("body").delegate(".fl-builder-template-actions .fl-builder-cancel-button","click",FLBuilder._templateCancelClicked),e("body").delegate(".fl-builder-user-template-settings .fl-builder-settings-save","click",FLBuilder._saveUserTemplateSettings),e("body").delegate(".fl-builder-help-tour-button","click",FLBuilder._startHelpTour),e("body").delegate(".fl-builder-help-video-button","click",FLBuilder._watchVideoClicked),e("body").delegate(".fl-builder-knowledge-base-button","click",FLBuilder._viewKnowledgeBaseClicked),e("body").delegate(".fl-builder-forums-button","click",FLBuilder._visitForumsClicked),e("body").delegate(".fl-builder-no-tour-button","click",FLBuilder._noTourButtonClicked),e("body").delegate(".fl-builder-yes-tour-button","click",FLBuilder._yesTourButtonClicked),e("body").delegate(".fl-builder-alert-close","click",FLBuilder._alertClose),e("body").delegate(".fl-row-overlay .fl-block-remove","click",FLBuilder._deleteRowClicked),e("body").delegate(".fl-row-overlay .fl-block-copy","click",FLBuilder._rowCopyClicked),e("body").delegate(".fl-row-overlay .fl-block-move","mousedown",FLBuilder._rowDragInit),e("body").delegate(".fl-row-overlay .fl-block-settings","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-row-overlay","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-builder-row-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-col-overlay .fl-block-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-col-overlay .fl-block-remove","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-col-overlay","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-col-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-col-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-delete","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-reset","click",FLBuilder._resetColumnWidthsClicked),e("body").delegate(".fl-block-col-submenu li","mouseenter",FLBuilder._showColHighlightGuide),e("body").delegate(".fl-block-col-submenu li","mouseleave",FLBuilder._removeColHighlightGuides),e("body").delegate(".fl-block-col-submenu .fl-block-col-move-parent","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit-parent","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-module-overlay .fl-block-remove","click",FLBuilder._deleteModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-copy","click",FLBuilder._moduleCopyClicked),e("body").delegate(".fl-module-overlay .fl-block-move","mousedown",FLBuilder._blockDragInit),e("body").delegate(".fl-module-overlay .fl-block-settings","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-module-overlay","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-builder-module-settings .fl-builder-settings-save","click",FLBuilder._saveModuleClicked),e("body").delegate(".fl-builder-settings-save-as","click",FLBuilder._showNodeTemplateSettings),e("body").delegate(".fl-builder-node-template-settings .fl-builder-settings-save","click",FLBuilder._saveNodeTemplate),e("body").delegate(".fl-builder-settings-tabs a","click",FLBuilder._settingsTabClicked),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked),e("body").delegate(".fl-help-tooltip-icon","mouseover",FLBuilder._showHelpTooltip),e("body").delegate(".fl-help-tooltip-icon","mouseout",FLBuilder._hideHelpTooltip),e("body").delegate(".fl-builder-field-add","click",FLBuilder._addFieldClicked),e("body").delegate(".fl-builder-field-copy","click",FLBuilder._copyFieldClicked),e("body").delegate(".fl-builder-field-delete","click",FLBuilder._deleteFieldClicked),e("body").delegate(".fl-builder-settings-fields select","change",FLBuilder._settingsSelectChanged),e("body").delegate(".fl-photo-field .fl-photo-select","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-edit","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-replace","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-remove","click",FLBuilder._singlePhotoRemoved),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-select","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-edit","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-add","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-video-field .fl-video-select","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-replace","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-select","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-edit","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-add","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-icon-field .fl-icon-select","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-replace","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-remove","click",FLBuilder._removeIcon),e("body").delegate(".fl-form-field .fl-form-field-edit","click",FLBuilder._formFieldClicked),e("body").delegate(".fl-form-field-settings .fl-builder-settings-save","click",FLBuilder._saveFormFieldClicked),e("body").delegate(".fl-layout-field-option","click",FLBuilder._layoutFieldClicked),e("body").delegate(".fl-link-field-select","click",FLBuilder._linkFieldSelectClicked),e("body").delegate(".fl-link-field-search-cancel","click",FLBuilder._linkFieldSelectCancelClicked),e("body").delegate(".fl-loop-builder select[name=post_type]","change",FLBuilder._loopBuilderPostTypeChange),e("body").delegate(".fl-select-add-value","change",FLBuilder._textFieldAddValueSelectChange)},_bindOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.delegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.delegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.delegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.delegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.delegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_destroyOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.undelegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.undelegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.undelegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.undelegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.undelegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()},_headerLinkClicked:function(t){var l=e(this),i=l.attr("href");t.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=i.indexOf("?")>-1?i:i+"?fl_builder",FLBuilder._doneClicked())},_warnBeforeUnload:function(){var t=e(".fl-builder-row-settings").length>0,l=e(".fl-builder-col-settings").length>0,i=e(".fl-builder-module-settings").length>0;if(t||l||i)return FLBuilderStrings.unloadWarning},_initTipTips:function(){e(".fl-tip:not(.fl-has-tip)").each(function(){var t=e(this);t.addClass("fl-has-tip"),void 0==t.attr("data-title")&&t.attr("data-title",t.attr("title"))}).tipTip({defaultPosition:"top",delay:1500})},_hideTipTips:function(){e("#tiptip_holder").stop().remove()},_submenuParentClicked:function(t){var l=e(this),i=l.find(".fl-builder-submenu");l.hasClass("fl-builder-submenu-open")?(l.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-right")):(l.offset().left+i.width()>e(window).width()&&l.addClass("fl-builder-submenu-right"),l.addClass("fl-builder-submenu-open")),FLBuilder._hideTipTips(),t.preventDefault(),t.stopPropagation()},_submenuChildClicked:function(t){var l=e(this).parents(".fl-builder-has-submenu");l.parents(".fl-builder-has-submenu").length||l.removeClass("fl-builder-submenu-open")},_submenuMouseenter:function(t){var l=e(this),i=l.data("timeout");"undefined"!=typeof i&&clearTimeout(i)},_submenuMouseleave:function(t){var l=e(this),i=setTimeout(function(){l.closest(".fl-builder-has-submenu").removeClass("fl-builder-submenu-open")},500);l.data("timeout",i)},_submenuNestedParentMouseenter:function(t){var l=e(this),i=l.find(".fl-builder-submenu");l.width()+l.offset().left+i.width()>e(window).width()&&l.addClass("fl-builder-submenu-right")},_closeAllSubmenus:function(){e(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_toolsClicked:function(){var e=[],t=FLBuilderConfig.lite,l=FLBuilderConfig.enabledTemplates;t||FLBuilderConfig.isUserTemplate||"enabled"!=l&&"user"!=l||(e[10]={key:"save-user-template",label:FLBuilderStrings.saveTemplate}),FLBuilderConfig.isUserTemplate?"undefined"!=typeof window.opener&&window.opener||(e[20]={key:"duplicate-layout",label:FLBuilderStrings.duplicateLayout}):e[20]={key:"duplicate-layout",label:FLBuilderStrings.duplicateLayout},e[30]={key:"layout-settings",label:FLBuilderStrings.editLayoutSettings},e[40]={key:"global-settings",label:FLBuilderStrings.editGlobalSettings},FLBuilder._showActionsLightbox({className:"fl-builder-tools-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_doneClicked:function(){var e=[],t=FLBuilderStrings.publish;"publish"==FLBuilderConfig.postStatus||FLBuilderConfig.userCanPublish||(t=FLBuilderStrings.submitForReview),e[10]={key:"publish",label:t},e[20]={key:"draft",label:FLBuilderStrings.draft},e[30]={key:"discard",label:FLBuilderStrings.discard},FLBuilder._showActionsLightbox({className:"fl-builder-save-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_helpButtonClicked:function(){var e={};FLBuilderConfig.help.tour&&(e[10]={key:"help-tour",label:FLBuilderStrings.takeHelpTour}),FLBuilderConfig.help.video&&(e[20]={key:"help-video",label:FLBuilderStrings.watchHelpVideo}),FLBuilderConfig.help.knowledge_base&&(e[30]={key:"knowledge-base",label:FLBuilderStrings.viewKnowledgeBase}),FLBuilderConfig.help.forums&&(e[40]={key:"forums",label:FLBuilderStrings.visitForums}),FLBuilder._showActionsLightbox({className:"fl-builder-help-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_closePanel:function(){e(".fl-builder-panel").stop(!0,!0).animate({right:"-350px"},500,function(){e(this).hide()}),e(".fl-builder-bar .fl-builder-add-content-button").stop(!0,!0).fadeIn()},_showPanel:function(){e(".fl-builder-bar .fl-builder-add-content-button").stop(!0,!0).fadeOut(),e(".fl-builder-panel").stop(!0,!0).show().animate({right:"0"},500)},_blockSectionTitleClicked:function(){var t=e(this),l=t.parent();l.hasClass("fl-active")?l.removeClass("fl-active"):(e(".fl-builder-blocks-section").removeClass("fl-active"),l.addClass("fl-active")),FLBuilder._initScrollbars()},_publishButtonClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_layout"},FLBuilder._exit),FLBuilder._actionsLightbox.close()},_draftButtonClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_draft"},FLBuilder._exit),FLBuilder._actionsLightbox.close()},_discardButtonClicked:function(){var e=confirm(FLBuilderStrings.discardMessage);e&&(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"clear_draft_layout"},FLBuilder._exit),FLBuilder._actionsLightbox.close())},_cancelButtonClicked:function(){FLBuilder._exitUrl=null,FLBuilder._actionsLightbox.close()},_exit:function(){var e=window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&window.opener.FLBuilder._updateLayout(),window.close()):(FLBuilder._exitUrl?e=FLBuilder._exitUrl:(e=e.replace("?fl_builder&","?"),e=e.replace("?fl_builder",""),e=e.replace("&fl_builder","")),window.location.href=e)},_duplicateLayoutClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"duplicate_post"},FLBuilder._duplicateLayoutComplete)},_duplicateLayoutComplete:function(t){var l=e("#fl-admin-url").val();window.location.href=l+"post.php?post="+t+"&action=edit"},_layoutSettingsClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._showLightbox(),FLBuilder._closePanel(),FLBuilder.ajax({action:"render_layout_settings"},FLBuilder._layoutSettingsLoaded)},_layoutSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._setSettingsFormContent(t.html),FLBuilder._layoutSettingsInitCSS()},_layoutSettingsInitCSS:function(){var t=e(".fl-builder-settings #fl-field-css textarea:not(.ace_text-input)");t.on("change",FLBuilder._layoutSettingsCSSChanged),FLBuilder._layoutSettingsCSSCache=t.val()},_layoutSettingsCSSChanged:function(){FLBuilder._layoutSettingsCSSTimeout&&clearTimeout(FLBuilder._layoutSettingsCSSTimeout),FLBuilder._layoutSettingsCSSTimeout=setTimeout(e.proxy(FLBuilder._layoutSettingsCSSDoChange,this),600)},_layoutSettingsCSSDoChange:function(){var t=e(".fl-builder-settings"),l=e(this),i=l.parents("#fl-field-css");i.find(".ace_error").length>0||(t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(l.val()):e("#fl-builder-global-css").html(l.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var t=e(this).closest(".fl-builder-settings"),l=t.serializeArray(),i={},o=0;o<l.length;o++)i[l[o].name]=l[o].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_layout_settings",settings:i},FLBuilder._updateLayout)},_cancelLayoutSettingsClicked:function(){var t=e(".fl-builder-settings");t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(FLBuilder._layoutSettingsCSSCache):e("#fl-builder-global-css").html(FLBuilder._layoutSettingsCSSCache),FLBuilder._layoutSettingsCSSCache=null},_globalSettingsClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_global_settings"},FLBuilder._globalSettingsLoaded)},_globalSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._setSettingsFormContent(t.html),FLBuilder._layoutSettingsInitCSS(),FLBuilder._initSettingsValidation({row_width:{required:!0,number:!0},responsive_breakpoint:{required:!0,number:!0}})},_saveGlobalSettingsClicked:function(){var t=e(this).closest(".fl-builder-settings"),l=t.validate().form(),i=t.serializeArray(),o={},s=0;if(l){for(;s<i.length;s++)o[i[s].name]=i[s].value;FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_global_settings",settings:o},FLBuilder._saveGlobalSettingsComplete),FLBuilder._lightbox.close()}},_saveGlobalSettingsComplete:function(e){FLBuilderConfig.global=JSON.parse(e),FLBuilder._updateLayout()},_initTemplateSelector:function(){var t=e(FLBuilder._contentClass).find(".fl-row");0===t.length&&FLBuilder._showTemplateSelector()},_changeTemplateClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._showTemplateSelector()},_showTemplateSelector:function(){FLBuilderConfig.simpleUi||FLBuilderConfig.isUserTemplate||"disabled"!=FLBuilderConfig.enabledTemplates&&0!==e(".fl-builder-templates-button").length&&(FLBuilder._showLightbox(!1),FLBuilder.ajax({action:"render_template_selector"},FLBuilder._templateSelectorLoaded))},_templateSelectorLoaded:function(t){var l=JSON.parse(t),i=null,o=null;FLBuilder._setLightboxContent(l.html),i=e(".fl-template-category-select"),tabs=e(".fl-builder-settings-tab"),userTemplatesTab=e("#fl-builder-settings-tab-yours"),o=e(".fl-user-template"),("user"==FLBuilderConfig.enabledTemplates||o.length>0||userTemplatesTab.length>0&&1==tabs.length)&&(i.val("fl-builder-settings-tab-yours"),e(".fl-builder-settings-tab").removeClass("fl-active"),e("#fl-builder-settings-tab-yours").addClass("fl-active")),0===o.length&&e(".fl-user-templates-message").show(),e("body").trigger("fl-builder.template-selector-loaded")},_templateCategoryChanged:function(){e(".fl-template-selector .fl-builder-settings-tab").hide(),e("#"+e(this).val()).show()},_templateClicked:function(){var t=e(this),l=t.closest(".fl-template-preview").attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?0==l?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate(0,!1,"core")):(FLBuilder._selectedTemplateId=l,FLBuilder._selectedTemplateType="core",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(l,!1,"core")},_showTemplateActions:function(){var e=[];e[10]={key:"template-replace",label:FLBuilderStrings.templateReplace},e[20]={key:"template-append",label:FLBuilderStrings.templateAppend},FLBuilder._showActionsLightbox({className:"fl-builder-template-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_templateReplaceClicked:function(){confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!1,FLBuilder._selectedTemplateType))},_templateAppendClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!0,FLBuilder._selectedTemplateType)},_templateCancelClicked:function(){FLBuilder._lightbox._node.show()},_applyTemplate:function(e,t,l){t="undefined"!=typeof t&&t?"1":"0",l="undefined"==typeof l?"core":l,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader(),"core"==l?FLBuilder.ajax({action:"apply_template",template_id:e,append:t},FLBuilder._updateLayout):FLBuilder.ajax({action:"apply_user_template",template_id:e,append:t},FLBuilder._updateLayout)},_saveUserTemplateClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._showLightbox(!1),FLBuilder.ajax({action:"render_user_template_settings"},FLBuilder._userTemplateSettingsLoaded)},_userTemplateSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._setSettingsFormContent(t.html),FLBuilder._initSettingsValidation({name:{required:!0}})},_saveUserTemplateSettings:function(){var t=e(this).closest(".fl-builder-settings"),l=t.validate().form(),i=FLBuilder._getSettings(t);l&&(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_user_template",settings:i},FLBuilder._saveUserTemplateSettingsComplete),FLBuilder._lightbox.close())},_saveUserTemplateSettingsComplete:function(){FLBuilder.alert(FLBuilderStrings.templateSaved)},_userTemplateClicked:function(){var t=e(this).attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?"blank"==t?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate("blank",!1,"user")):(FLBuilder._selectedTemplateId=t,FLBuilder._selectedTemplateType="user",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(t,!1,"user")},_editUserTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteUserTemplateClicked:function(t){var l=e(this).closest(".fl-user-template"),i=l.attr("data-id"),o=e(".fl-user-template[data-id="+i+"]"),s=null;confirm(FLBuilderStrings.deleteTemplate)&&(FLBuilder.ajax({action:"delete_user_template",template_id:i}),o.fadeOut(function(){l=e(this),s=l.closest(".fl-user-template-category"),l.remove(),0===s.find(".fl-user-template").length&&s.remove(),1===e(".fl-user-template").length&&(e(".fl-user-templates").hide(),e(".fl-user-templates-message").show())})),t.stopPropagation()},_watchVideoClicked:function(){var e=wp.template("fl-video-lightbox");FLBuilder._actionsLightbox.close(),FLBuilder._lightbox.open(e({video:FLBuilderConfig.help.video_embed}))},_viewKnowledgeBaseClicked:function(){FLBuilder._actionsLightbox.close(),window.open(FLBuilderConfig.help.knowledge_base_url)},_visitForumsClicked:function(){FLBuilder._actionsLightbox.close(),window.open(FLBuilderConfig.help.forums_url)},_showTourOrTemplates:function(){FLBuilderConfig.simpleUi||FLBuilderConfig.isUserTemplate||(FLBuilderConfig.help.tour&&FLBuilderConfig.newUser?FLBuilder._showTourLightbox():FLBuilder._initTemplateSelector())},_showTourLightbox:function(){var e=wp.template("fl-tour-lightbox");FLBuilder._actionsLightbox.open(e())},_noTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._initTemplateSelector()},_yesTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_startHelpTour:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_setupEmptyLayout:function(){var t=e(FLBuilder._contentClass);FLBuilderConfig.isUserTemplate&&"module"==FLBuilderConfig.userTemplateType||(t.removeClass("fl-builder-empty"),t.find(".fl-builder-empty-message").remove(),0===t.children(".fl-row").length&&(t.addClass("fl-builder-empty"),t.append('<span class="fl-builder-empty-message">'+FLBuilderStrings.emptyMessage+"</span>"),FLBuilder._initSortables()))},_updateLayout:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_layout"},FLBuilder._renderLayout)},_renderLayout:function(e,t){FLBuilder._layout=new FLBuilderAJAXLayout(e,t)},_renderLayoutComplete:function(){FLBuilder._layout&&(FLBuilder._layout._complete(),FLBuilder._layout=null)},_resizeLayout:function(){e(window).trigger("resize"),"undefined"!=typeof YUI&&YUI().use("node-event-simulate",function(e){e.one(window).simulate("resize")})},_initMediaElements:function(){var t={};"undefined"!=typeof e.fn.mediaelementplayer&&("undefined"!=typeof _wpmejsSettings&&(t.pluginPath=_wpmejsSettings.pluginPath),e(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").mediaelementplayer(t))},_initDropTargets:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=e(FLBuilder._contentClass+" .fl-row"),i=null,o=e(FLBuilder._contentClass+" .fl-row"+t).find(".fl-col-group"),s=null,r=null,n=0;for(e(".fl-col-drop-target").remove(),e(".fl-col-group-drop-target").remove(),e(".fl-row-drop-target").remove(),e(FLBuilder._contentClass).append('<div class="fl-drop-target fl-row-drop-target"></div>'),l.prepend('<div class="fl-drop-target fl-row-drop-target"></div>'),l.append('<div class="fl-drop-target fl-drop-target-last fl-row-drop-target fl-row-drop-target-last"></div>');n<l.length;n++)i=l.eq(n),0===i.find(".fl-col-group").length&&i.find(".fl-row-content").append('<div class="fl-drop-target fl-col-group-drop-target"></div>');for(n=0;n<o.length;n++)s=o.eq(n),r=s.find("> .fl-col"),s.hasClass("fl-col-group-nested")||(s.append('<div class="fl-drop-target fl-col-group-drop-target"></div>'),s.append('<div class="fl-drop-target fl-drop-target-last fl-col-group-drop-target fl-col-group-drop-target-last"></div>')),r.append('<div class="fl-drop-target fl-col-drop-target"></div>'),r.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')},_blockDragHelper:function(e,t){var l=t.clone();return t.clone().insertAfter(t),l.addClass("fl-builder-block-drag-helper"),l},_blockDragInit:function(t){var l=e(t.currentTarget),i=null,o=e(window).scrollTop(),s=0;FLBuilder._dragEnabled=!0,FLBuilder._dragInitialScrollTop=o,l.closest("[data-node]").length>0?(i=l.closest("[data-node]"),i.addClass("fl-node-drag-init")):l.hasClass("fl-builder-block")&&e(".fl-row").each(function(){null===i&&e(this).offset().top-o>0&&(i=e(this))}),null!==i&&(s=i.offset().top-o),FLBuilder._highlightRowsAndColsForDrag(l),FLBuilder._adjustColHeightsForDrag(),FLBuilder._disableGlobalRows(),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays(),FLBuilder._initSortables(),e("body").addClass("fl-builder-dragging"),e(".fl-builder-empty-message").hide(),e(".fl-sortable-disabled").removeClass("fl-sortable-disabled"),s>0&&scrollTo(0,i.offset().top-s)},_blockDragStart:function(t,l){FLBuilder._dragging=!0,e(".fl-node-drag-init").removeClass("fl-node-drag-init")},_blockDragSort:function(t,l){var i=l.placeholder.parent(),o=FLBuilderStrings.insert;FLBuilder._blockPreventSort(l.item,i)||(i.hasClass("fl-col-content")?o=l.item.hasClass("fl-builder-block-row")?l.item.find(".fl-builder-block-title").text():l.item.hasClass("fl-col-sortable-proxy-item")?FLBuilderStrings.column:l.item.hasClass("fl-builder-block-module")?l.item.find(".fl-builder-block-title").text():l.item.hasClass("fl-builder-block-saved-module")||l.item.hasClass("fl-builder-block-module-template")?l.item.find(".fl-builder-block-title").text():l.item.attr("data-name"):i.hasClass("fl-col-drop-target")?o="":i.hasClass("fl-col-group-drop-target")?o="":i.hasClass("fl-row-drop-target")&&(o=l.item.hasClass("fl-builder-block-row")?l.item.find(".fl-builder-block-title").text():l.item.hasClass("fl-builder-block-saved-row")?l.item.find(".fl-builder-block-title").text():l.item.hasClass("fl-row-sortable-proxy-item")?FLBuilderStrings.row:FLBuilderStrings.newRow),l.placeholder.html(o),l.item.hasClass("fl-node-global")||l.item.hasClass("fl-builder-block-global")||e(".fl-node-dragging").hasClass("fl-node-global")?l.placeholder.addClass("fl-builder-drop-zone-global"):l.placeholder.removeClass("fl-builder-drop-zone-global"))},_blockDragChange:function(e,t){t.placeholder.hide(),t.placeholder.fadeIn(100)},_blockPreventSort:function(t,l){var i=!1,o=t.hasClass("fl-builder-block-row"),s=t.hasClass("fl-col-sortable-proxy-item"),r=l.hasClass("fl-col-content"),n=l.hasClass("fl-col-drop-target"),a=l.parents(".fl-col-group:not(.fl-col-group-nested)"),d=l.parents(".fl-col-group-nested");return(o||s)&&r&&d.length>0&&(i=!0),r&&!l.find(".fl-module, .fl-col").length&&(o&&"1-col"==t.data("cols")?i=!0:s&&(i=!0)),o&&r&&e.inArray(t.data("cols"),["5-cols","6-cols"])>-1&&(i=!0),s&&e(".fl-node-dragging").find(".fl-col-group-nested").length>0&&(r||n&&d.length>0)&&(i=!0),n&&a.length>0&&0===d.length&&a.find("> .fl-col:visible").length>11&&(i=!0),n&&d.length>0&&d.find(".fl-col:visible").length>3&&(i=!0),i&&l.addClass("fl-sortable-disabled"),i},_blockDragStop:function(t,l){var i=e(window).scrollTop(),o=l.item.parent(),s=null;o.hasClass("fl-drop-target")&&o.closest("[data-node]").length?(o=o.closest("[data-node]"),s=o.offset().top-i):s=o.offset().top-i,o.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),scrollTo(0,o.offset().top-s)},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),e(".fl-node-drag-init").removeClass("fl-node-drag-init"),e(".fl-node-dragging").removeClass("fl-node-dragging"),scrollTo(0,FLBuilder._dragInitialScrollTop))},_reorderNode:function(e,t){FLBuilder.ajax({action:"reorder_node",node_id:e,position:t,silent:!0})},_moveNode:function(e,t,l){FLBuilder.ajax({action:"move_node",new_parent:e,node_id:t,position:l,silent:!0})},_removeAllOverlays:function(){FLBuilder._removeRowOverlays(),FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._removeModuleOverlays(),FLBuilder._hideTipTips()},_appendOverlay:function(e,t){var l=0,i=null,o=e.hasClass("fl-row"),s=o?e.find("> .fl-row-content-wrap"):e.find("> .fl-node-content"),r={top:parseInt(s.css("margin-top"),10),bottom:parseInt(s.css("margin-bottom"),10)};return e.append(t),e.addClass("fl-block-overlay-active"),
4
- FLBuilder._initTipTips(),i=e.find("> .fl-block-overlay"),r.top<0&&(l=parseInt(i.css("top"),10),l=isNaN(l)?0:l,i.css("top",r.top+l+"px")),r.bottom<0&&(l=parseInt(i.css("bottom"),10),l=isNaN(l)?0:l,i.css("bottom",r.bottom+l+"px")),i},_buildOverlayOverflowMenu:function(e){var t=e.find(".fl-block-overlay-actions"),l=t.data("original"),i=0,o=null,s=0,r=null,n=0,a=[],d=[],u=[],c=wp.template("fl-overlay-overflow-menu");for(void 0!=l&&(t.after(l),t.remove(),t=l),t.data("original",t.clone()),i=t[0].getBoundingClientRect().width,o=t.find(" > i, > span.fl-builder-has-submenu");n<o.length;n++)r=o.eq(n),s+=r.outerWidth(),s>i?(d.push(r),r.remove()):a.push(r);if(d.length>0){for(d.unshift(a.pop().remove()),n=0;n<d.length;n++)d[n].is(".fl-builder-has-submenu")?u.push({type:"submenu",label:d[n].find(".fa").data("title"),submenu:d[n].find(".fl-builder-submenu")[0].outerHTML}):u.push({type:"action",label:d[n].data("title"),className:d[n].removeClass(function(e,t){return t.replace(/fl-block-([^\s]+)/,"")}).attr("class")});t.append(c(u)),FLBuilder._initTipTips()}},_removeRowOverlays:function(){e(".fl-row").removeClass("fl-block-overlay-active"),e(".fl-row-overlay").remove(),e(".fl-module").removeClass("fl-module-adjust-height")},_disableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-row.fl-node-global").addClass("fl-node-disabled")},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_rowMouseenter:function(){var t=e(this),l=t.offset().top,i=null,o=null,s=wp.template("fl-row-overlay");t.hasClass("fl-block-overlay-active")||(o=FLBuilder._appendOverlay(t,s({global:t.hasClass("fl-node-global"),node:t.attr("data-node")})),t.find(".fl-node-content:visible").each(function(){var t=e(this).offset().top;i=null===i||i>t?t:i}),null!==i&&i<l&&o.css("top",i-l-30+"px"),o.offset().top<43&&o.addClass("fl-row-overlay-header-bottom"),t.find(".fl-module").each(function(){var t=e(this);t.outerHeight(!0)<20&&t.addClass("fl-module-adjust-height")}))},_rowMouseleave:function(t){var l=e(t.toElement)||e(t.relatedTarget),i=l.hasClass("fl-row-overlay"),o=l.closest(".fl-row-overlay").length>0,s=l.is("#tiptip_holder"),r=l.closest("#tiptip_holder").length>0;i||o||s||r||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.row+"</div>")},_rowDragInit:function(t){var l=e(t.target),i=e(".fl-row-sortable-proxy-item"),o=l.closest(".fl-row");o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),t.target=i[0],i.trigger(t)},_rowDragStart:function(t,l){var i=e(FLBuilder._contentClass+" .fl-row"),o=e(".fl-node-dragging");1===i.length&&e(FLBuilder._contentClass).addClass("fl-builder-empty"),o.hide(),FLBuilder._blockDragStart(t,l)},_rowDragStop:function(t,l){var i=l.item,o=i.parent(),s=null,r=null,n=0;if(FLBuilder._blockDragStop(t,l),o.hasClass("fl-builder-rows"))return void i.remove();if(o.hasClass("fl-row-sortable-proxy"))return void e(".fl-node-dragging").removeClass("fl-node-dragging").show();if(i.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();o.hasClass("fl-col-content")?FLBuilder._addColGroup(i.closest(".fl-col").attr("data-node"),i.attr("data-cols"),o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(i)):o.hasClass("fl-col-drop-target")?FLBuilder._addCols(o.closest(".fl-col"),o.hasClass("fl-col-drop-target-last")?"after":"before",i.attr("data-cols"),o.closest(".fl-col-group-nested").length>0):o.hasClass("fl-col-group-drop-target")?(r=i.closest(".fl-col-group"),n=i.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(r),FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),i.attr("data-cols"),o.hasClass("fl-drop-target-last")?n+1:n)):(s=i.closest(".fl-row"),n=s.length?e(FLBuilder._contentClass+" .fl-row").index(s):0,FLBuilder._addRow(i.attr("data-cols"),o.hasClass("fl-drop-target-last")?n+1:n)),i.remove(),FLBuilder._showPanel(),e(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")}else s=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o.parent().hasClass("fl-builder-content")||(o.hasClass("fl-drop-target-last")?o.parent().after(s):o.parent().before(s),FLBuilder._reorderNode(s.attr("data-node"),s.index())),e(".fl-row-sortable-proxy").append(l.item)},_addRow:function(e,t){FLBuilder.showAjaxLoader(),FLBuilder._newRowPosition=t,FLBuilder.ajax({action:"render_new_row",cols:e,position:t},FLBuilder._addRowComplete)},_addRowComplete:function(t){var l=JSON.parse(t),i=e(FLBuilder._contentClass),o=e(l.html).data("node"),s=FLBuilder._addModuleAfterNodeRender;l.nodeParent=i,l.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(l,function(){null!==s&&(e(".fl-node-"+o+" .fl-col-content").append(s),FLBuilder._reorderModule(s),FLBuilder._addModuleAfterNodeRender=null)})},_deleteRowClicked:function(t){var l=e(this).closest(".fl-row"),i=null;l.find(".fl-module").length?(i=confirm(FLBuilderStrings.deleteRowMessage),i&&FLBuilder._deleteRow(l)):FLBuilder._deleteRow(l),FLBuilder._removeAllOverlays(),t.stopPropagation()},_deleteRow:function(e){FLBuilder.ajax({action:"delete_node",node_id:e.attr("data-node"),silent:!0}),e.empty(),e.remove(),FLBuilder._setupEmptyLayout(),FLBuilder._removeRowOverlays()},_rowCopyClicked:function(t){var l=e(this).closest(".fl-row"),i=l.attr("data-node");FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder._newRowPosition=l.index(".fl-row")+1,FLBuilder.ajax({action:"copy_row",node_id:i},FLBuilder._rowCopyComplete),t.stopPropagation()},_rowCopyComplete:function(t){var l=JSON.parse(t);l.nodeParent=e(FLBuilder._contentClass),l.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(l)},_rowSettingsClicked:function(t){var l=e(this),i=l.closest(".fl-row").attr("data-node"),o=l.closest(".fl-block-overlay-global").length>0;o&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&window.open(e('.fl-row[data-node="'+i+'"]').attr("data-template-url")):l.hasClass("fl-block-settings")&&(FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_row_settings",node_id:i},FLBuilder._rowSettingsLoaded)),t.stopPropagation()},_rowSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._setSettingsFormContent(t.settings),FLBuilder.preview=new FLBuilderPreview({type:"row",state:t.state})},_highlightEmptyCols:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=(e(FLBuilder._contentClass+" .fl-row"+t),e(FLBuilder._contentClass+" .fl-col"+t));e(".fl-row-highlight").removeClass("fl-row-highlight"),l.removeClass("fl-col-highlight").find(".fl-col-content").css("height",""),l.each(function(){var t=e(this);0===t.find(".fl-module, .fl-col").length&&t.addClass("fl-col-highlight")})},_highlightRowsAndColsForDrag:function(t){var l="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";e(FLBuilder._contentClass+" .fl-row").addClass("fl-row-highlight"),t.closest(".fl-row-overlay").length||e(FLBuilder._contentClass+" .fl-col"+l).addClass("fl-col-highlight")},_adjustColHeightsForDrag:function(){var t="row"==FLBuilderConfig.userTemplateType?"":".fl-row:not(.fl-node-global) ",l=e(FLBuilder._contentClass),i=l.find(t+".fl-col-group:not(.fl-col-group-nested) > .fl-col > .fl-col-content"),o=l.find(t+".fl-col-group-nested .fl-col-content"),s=0;for(e(".fl-node-drag-init").hide();s<o.length;s++)FLBuilder._adjustColHeightForDrag(o.eq(s));for(s=0;s<i.length;s++)FLBuilder._adjustColHeightForDrag(i.eq(s));e(".fl-node-drag-init").show()},_adjustColHeightForDrag:function(e){e.find(".fl-module:visible, .fl-col:visible").length&&e.height(e.height()+45)},_showColHighlightGuide:function(){var t=e(this),l=t.find("a"),i=t.closest(".fl-col"),o=i.parents(".fl-col"),s=e('<div class="fl-col-highlight-guide"></div>'),r=null,n=t.closest(".fl-block-overlay").offset().top;(l.hasClass("fl-block-col-move-parent")||l.hasClass("fl-block-col-edit-parent"))&&(i=o),i.hasClass("fl-col-highlight")||(i.find("> .fl-col-content").append(s),i.addClass("fl-col-has-highlight-guide"),r=s.offset().top,r>n&&s.css("top",n-r+4+"px"))},_removeColHighlightGuides:function(){e(".fl-col-has-highlight-guide").removeClass("fl-col-has-highlight-guide"),e(".fl-col-highlight-guide").remove()},_colMouseenter:function(){var t=e(this),l=t.closest(".fl-col-group"),i=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.closest(".fl-col-group").find("> .fl-col").length,r=l.find("> .fl-col").index(t),n=0===r,a=s===r+1,d=t.find(".fl-col").length>0,u=t.parents(".fl-col"),c=u.closest(".fl-col-group"),f=u.length>0,h=f?c.find("> .fl-col").length:0,p=c.find("> .fl-col").index(u),g=!!f&&0===p,_=!!f&&h===p+1,m=t.find("> .fl-col-content").width(),b=wp.template("fl-col-overlay"),v=null;FLBuilderConfig.simpleUi||i&&o&&"row"!=FLBuilderConfig.userTemplateType||t.find(".fl-module").length>0||t.find(".fl-col").length>0||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),v=FLBuilder._appendOverlay(t,b({global:i,numCols:s,first:n,last:a,hasChildCols:d,hasParentCol:f,parentFirst:g,parentLast:_,numParentCols:h,contentWidth:m})),FLBuilder._buildOverlayOverflowMenu(v),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(t){var l=e(this),i=e(t.toElement)||e(t.relatedTarget),o=l.find(".fl-module").length>0,s=i.is("#tiptip_holder"),r=i.closest("#tiptip_holder").length>0;s||r||o||(FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides())},_removeColOverlays:function(){var t=e(".fl-col");t.removeClass("fl-block-overlay-active"),t.find(".fl-col-overlay").remove(),e("body").removeClass("fl-block-overlay-muted")},_colDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.column+"</div>")},_colDragInit:function(t){var l=e(t.target),i=e(".fl-col-sortable-proxy-item"),o=l.closest(".fl-col");l.hasClass("fl-block-col-move-parent")&&(o=o.parents(".fl-col")),o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),FLBuilder._removeColHighlightGuides(),t.target=i[0],i.trigger(t)},_colDragStart:function(t,l){var i=e(".fl-node-dragging");i.hide(),FLBuilder._resetColumnWidths(i.parent()),FLBuilder._blockDragStart(t,l)},_colDragStop:function(t,l){FLBuilder._blockDragStop(t,l);var i=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o=i.attr("data-node"),s=l.item.parent(),r=i.parent(),n=r.attr("data-node");newGroup=s.closest(".fl-col-group"),newGroupId=newGroup.attr("data-node"),newRow=s.closest(".fl-row"),position=0,s.hasClass("fl-sortable-disabled")?FLBuilder._resetColumnWidths(r):s.hasClass("fl-col-sortable-proxy")?FLBuilder._resetColumnWidths(r):s.hasClass("fl-col-content")?(i.remove(),0===r.find(".fl-col").length&&r.remove(),position=s.find(".fl-module, .fl-col-group, .fl-col-sortable-proxy-item").index(l.item),FLBuilder._addColGroup(s.closest(".fl-col").attr("data-node"),o,position)):s.hasClass("fl-col-drop-target")?(s.hasClass("fl-col-drop-target-last")?s.parent().after(i):s.parent().before(i),FLBuilder._resetColumnWidths(newGroup),n==newGroupId?FLBuilder.ajax({action:"reorder_col",node_id:o,position:i.index(),silent:!0}):FLBuilder.ajax({action:"move_col",node_id:o,new_parent:newGroupId,position:i.index(),resize:[n,newGroupId],silent:!0}),FLBuilder._resizeLayout()):s.hasClass("fl-col-group-drop-target")?(i.remove(),0===r.find(".fl-col").length&&r.remove(),position=newRow.find(".fl-row-content > .fl-col-group").index(newGroup),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addColGroup(newRow.attr("data-node"),o,position)):s.hasClass("fl-row-drop-target")&&(i.remove(),position=s.closest(".fl-builder-content").find(".fl-row").index(newRow),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addRow(o,position)),0===r.find(".fl-col").length&&r.remove(),e(".fl-col-sortable-proxy").append(l.item),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables()},_colSettingsClicked:function(t){var l=e(this),i=l.closest(".fl-col"),o=null;FLBuilder._colResizing||(o=l.hasClass("fl-block-col-edit-parent")?i.parents(".fl-col").data("node"):i.attr("data-node"),FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_column_settings",node_id:o},FLBuilder._colSettingsLoaded),t.stopPropagation())},_colSettingsLoaded:function(t){var l=JSON.parse(t),i=null,o=null,s=null,r=null;FLBuilder._setSettingsFormContent(l.settings),i=e(".fl-builder-col-settings"),o=i.data("node"),s=e('.fl-col[data-node="'+o+'"]'),r=s.find("> .fl-col-content"),0===s.siblings(".fl-col").length?e(i).find("#fl-builder-settings-section-general").css("display","none"):r.width()<=40&&e("#fl-field-size").hide(),FLBuilder.preview=new FLBuilderPreview({type:"col",state:l.state})},_deleteColClicked:function(t){var l=e(this),i=l.closest(".fl-col"),o=i.closest(".fl-col-group"),s=i.parents(".fl-col"),r=s.length>0,n=s.find("> .fl-col-content > .fl-module, > .fl-col-content > .fl-col-group"),a=i.siblings(".fl-col"),d=!0;i.find(".fl-module").length>0&&(d=confirm(FLBuilderStrings.deleteColumnMessage)),r&&1===n.length&&(0===a.length?i=s:1!==a.length||a.find(".fl-module").length||(i=o)),d&&(FLBuilder._deleteCol(i),FLBuilder._removeAllOverlays(),FLBuilder._highlightEmptyCols()),t.stopPropagation()},_deleteCol:function(e){var t=e.closest(".fl-row"),l=e.closest(".fl-col-group"),i=0;e.remove(),rowCols=t.find(".fl-row-content > .fl-col-group > .fl-col"),groupCols=l.find(" > .fl-col"),0===rowCols.length&&"row"!=FLBuilderConfig.userTemplateType?FLBuilder._deleteRow(t):(0===groupCols.length?l.remove():(i=6===groupCols.length?16.65:7===groupCols.length?14.28:Math.round(100/groupCols.length*100)/100,groupCols.css("width",i+"%")),FLBuilder.ajax({action:"delete_col",node_id:e.attr("data-node"),new_width:i,silent:!0}),FLBuilder._initDropTargets(),FLBuilder._initSortables())},_addCols:function(e,t,l,i){l="undefined"==typeof l?"1-col":l,i="undefined"!=typeof i&&i,FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder.ajax({action:"render_new_columns",node_id:e.attr("data-node"),insert:t,type:l,nested:i?1:0},FLBuilder._addColsComplete)},_addColsComplete:function(t){var l=JSON.parse(t),i=null,o=FLBuilder._addModuleAfterNodeRender;FLBuilder._renderLayout(l,function(){null!==o&&(e('[data-node="'+o.module.data("node")+'"]').remove(),i=e('[data-node="'+o.colId+'"]'),"after"==o.position?i.next().find(".fl-col-content").append(o.module):i.prev().find(".fl-col-content").append(o.module),FLBuilder._reorderModule(o.module),FLBuilder._addModuleAfterNodeRender=null)})},_addColGroup:function(t,l,i){var o=e(".fl-node-"+t);FLBuilder.showAjaxLoader(),FLBuilder._newColGroupPosition=i,o.hasClass("fl-col")?FLBuilder._newColGroupParent=o.find(" > .fl-col-content"):FLBuilder._newColGroupParent=o.find(".fl-row-content"),FLBuilder.ajax({action:"render_new_column_group",cols:l,node_id:t,position:i},FLBuilder._addColGroupComplete)},_addColGroupComplete:function(t){var l=JSON.parse(t),i=e(l.html).find(".fl-col").data("node"),o=FLBuilder._addModuleAfterNodeRender;l.nodeParent=FLBuilder._newColGroupParent,l.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(l,function(){l.nodeParent.hasClass("fl-col-content")&&l.nodeParent.parents(".fl-col").addClass("fl-col-has-cols"),null!==o&&(e(".fl-node-"+i+" .fl-col-content").append(o),FLBuilder._reorderModule(o),FLBuilder._addModuleAfterNodeRender=null)})},_initColDragResizing:function(){e(".fl-block-col-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(t,l){var i=e(l.helper),o="",s=i.hasClass("fl-block-col-resize-parent"),r=s?i.closest(".fl-col").parents(".fl-col"):null,n=s?r.parents(".fl-col-group"):i.closest(".fl-col-group"),a=n.find("> .fl-col"),d=s?r:i.closest(".fl-col"),u=null,c=100,f=0;for(i.hasClass("fl-block-col-resize-e")?(o="e",u=d.next(".fl-col")):(o="w",u=d.prev(".fl-col"));f<a.length;f++)a.eq(f).data("node")!=d.data("node")&&a.eq(f).data("node")!=u.data("node")&&(c-=parseFloat(a.eq(f)[0].style.width));FLBuilder._colResizeData={handle:i,feedbackLeft:i.find(".fl-block-col-resize-feedback-left"),feedbackRight:i.find(".fl-block-col-resize-feedback-right"),direction:o,groupWidth:n.outerWidth(),col:d,colWidth:parseFloat(d[0].style.width)/100,sibling:u,offset:l.position.left,availWidth:c},FLBuilder._colResizing=!0,e("body").addClass("fl-builder-col-resizing"),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder.triggerHook("col-resize-start")},_colDragResize:function(e,t){var l=FLBuilder._colResizeData,i=(l.offset-t.position.left)/l.groupWidth,o="e"==l.direction?100*(l.colWidth-i):100*(l.colWidth+i),s=Math.round(100*o)/100,r=l.availWidth-o,n=Math.round(100*r)/100,a=8,d=Math.round(100*(l.availWidth-a))/100;s<a?(s=a,n=d):n<a&&(s=d,n=a),"e"==l.direction?(l.feedbackLeft.html(s.toFixed(1)+"%").show(),l.feedbackRight.html(n.toFixed(1)+"%").show()):(l.feedbackLeft.html(n.toFixed(1)+"%").show(),l.feedbackRight.html(s.toFixed(1)+"%").show()),l.col.css("width",s+"%"),l.sibling.css("width",n+"%"),FLBuilder.triggerHook("col-resize-drag")},_colDragResizeStop:function(t,l){var i=FLBuilder._colResizeData,o=FLBuilder._colResizeData.handle.closest(".fl-block-overlay");FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide(),FLBuilder.ajax({action:"resize_cols",col_id:i.col.data("node"),col_width:parseFloat(i.col[0].style.width),sibling_id:i.sibling.data("node"),sibling_width:parseFloat(i.sibling[0].style.width),silent:!0}),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder._colResizeData=null,e("body").removeClass("fl-builder-col-resizing"),FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50),FLBuilder.triggerHook("col-resize-stop")},_resetColumnWidthsClicked:function(t){var l=e(this).parents(".fl-col-group").last(),i=[l.data("node")],o=l.find(".fl-col-group"),s=0;for(FLBuilder._resetColumnWidths(l);s<o.length;s++)FLBuilder._resetColumnWidths(o.eq(s)),i.push(o.eq(s).data("node"));FLBuilder.ajax({action:"reset_col_widths",group_id:i,silent:!0}),FLBuilder.triggerHook("col-reset-widths"),FLBuilder._closeAllSubmenus(),t.stopPropagation()},_resetColumnWidths:function(e){var t=e.find(" > .fl-col:visible"),l=0;l=6===t.length?16.65:7===t.length?14.28:Math.round(100/t.length*100)/100,t.css("width",l+"%")},_moduleMouseenter:function(){var t=e(this),l=t.attr("data-name"),i=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.closest(".fl-col-group").find("> .fl-col").length,r=t.closest(".fl-col"),n=0===r.index(),a=s===r.index()+1,d=r.parents(".fl-col"),u=d.length>0,c=u?d.closest(".fl-col-group").find("> .fl-col").length:0,f=!!u&&0===d.index(),h=!!u&&c===d.index()+1,p=r.find("> .fl-col-content").width(),g=wp.template("fl-module-overlay"),_=null;FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),i&&o&&"row"!=FLBuilderConfig.userTemplateType||(t.hasClass("fl-block-overlay-active")||(_=FLBuilder._appendOverlay(t,g({global:i,moduleName:l,numCols:s,colFirst:n,colLast:a,hasParentCol:u,numParentCols:c,parentFirst:f,parentLast:h,contentWidth:p})),FLBuilder._buildOverlayOverflowMenu(_),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(t){var l=(e(this),e(t.toElement)||e(t.relatedTarget)),i=l.is("#tiptip_holder"),o=l.closest("#tiptip_holder").length>0;i||o||(FLBuilder._removeModuleOverlays(),FLBuilder._removeColHighlightGuides())},_removeModuleOverlays:function(){var t=e(".fl-module");t.removeClass("fl-block-overlay-active"),t.find(".fl-module-overlay").remove(),e("body").removeClass("fl-block-overlay-muted")},_moduleDragHelper:function(t,l){return e('<div class="fl-builder-block-drag-helper">'+l.attr("data-name")+"</div>")},_moduleDragStart:function(t,l){e(l.item).data("original-position",l.item.index()),FLBuilder._blockDragStart(t,l)},_moduleDragStop:function(t,l){FLBuilder._blockDragStop(t,l);var i=l.item,o=i.parent(),s=null,r=0,n=0;if(o.hasClass("fl-builder-modules")||o.hasClass("fl-builder-widgets"))return void i.remove();if(i.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=i.closest(".fl-builder-content"),n=0,s=i.closest(".fl-row"),r=o.find(".fl-row").index(s)):o.hasClass("fl-col-group-drop-target")?(o=i.closest(".fl-row-content"),n=o.closest(".fl-row").attr("data-node"),s=i.closest(".fl-col-group"),r=o.find(" > .fl-col-group").index(s)):o.hasClass("fl-col-drop-target")?(o=i.closest(".fl-col-group"),n=o.attr("data-node"),s=i.closest(".fl-col"),r=o.find(" > .fl-col").index(s)):(r=o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(i),n=i.closest(".fl-col").attr("data-node")),i.closest(".fl-drop-target-last").length&&(r+=1),FLBuilder._addModule(o,n,i.attr("data-type"),r,i.attr("data-widget")),i.remove()}else{if(o.hasClass("fl-sortable-disabled"))return e(t.target).append(l.item),e(t.target).children().eq(l.item.data("original-position")).before(l.item),void FLBuilder._highlightEmptyCols();o.hasClass("fl-row-drop-target")?(s=i.closest(".fl-row"),r=i.closest(".fl-builder-content").children(".fl-row").index(s),r=i.closest(".fl-drop-target-last").length?r+1:r,FLBuilder._addModuleAfterNodeRender=i,FLBuilder._addRow("1-col",r),i.remove()):o.hasClass("fl-col-group-drop-target")?(s=i.closest(".fl-col-group"),r=i.closest(".fl-row-content ").find(" > .fl-col-group").index(s),r=i.closest(".fl-drop-target-last").length?r+1:r,FLBuilder._addModuleAfterNodeRender=i,FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),"1-col",r),i.remove()):o.hasClass("fl-col-drop-target")?(s=i.closest(".fl-col"),r=i.closest(".fl-col-drop-target-last").length?"after":"before",FLBuilder._addModuleAfterNodeRender={module:i,colId:s.data("node"),position:r},FLBuilder._addCols(s,r,"1-col",i.closest(".fl-col-group-nested").length>0),i.remove()):FLBuilder._reorderModule(i)}FLBuilder._resizeLayout()},_reorderModule:function(e){var t=e.closest(".fl-col").attr("data-node"),l=e.attr("data-parent"),i=e.attr("data-node"),o=e.index();t==l?FLBuilder._reorderNode(i,o):(e.attr("data-parent",t),FLBuilder._moveNode(t,i,o))},_deleteModuleClicked:function(t){var l=e(this).closest(".fl-module"),i=confirm(FLBuilderStrings.deleteModuleMessage);i&&(FLBuilder._deleteModule(l),FLBuilder._removeAllOverlays()),t.stopPropagation()},_deleteModule:function(e){var t=e.closest(".fl-row");FLBuilder.ajax({action:"delete_node",node_id:e.attr("data-node"),silent:!0}),e.empty(),e.remove(),t.removeClass("fl-block-overlay-muted"),FLBuilder._highlightEmptyCols(),FLBuilder._removeAllOverlays()},_moduleCopyClicked:function(t){var l=e(this).closest(".fl-module");FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder._newModuleParent=l.parent(),FLBuilder._newModulePosition=l.index()+1,FLBuilder.ajax({action:"copy_module",node_id:l.attr("data-node")},FLBuilder._moduleCopyComplete),t.stopPropagation()},_moduleCopyComplete:function(e){var t=JSON.parse(e);t.nodeParent=FLBuilder._newModuleParent,t.nodePosition=FLBuilder._newModulePosition,FLBuilder._renderLayout(t)},_moduleSettingsClicked:function(t){var l=e(this),i=l.closest(".fl-module").attr("data-node"),o=l.closest(".fl-col").attr("data-node"),s=l.closest(".fl-module").attr("data-type"),r=l.closest(".fl-block-overlay-global").length>0;t.stopPropagation(),FLBuilder._colResizing||r&&!FLBuilderConfig.userCanEditGlobalTemplates||FLBuilder._showModuleSettings(i,o,s)},_showModuleSettings:function(e,t,l){FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_module_settings",node_id:e,type:l,parent_id:t},FLBuilder._moduleSettingsLoaded)},_moduleSettingsLoaded:function(t){var l=JSON.parse(t),i=e("<div>"+l.settings+"</div>"),o=i.find("link.fl-builder-settings-css"),s=i.find("script.fl-builder-settings-js"),r=i.find(".fl-builder-settings"),n=r.attr("data-type"),a=null,d=null,u=null;e.inArray(n,FLBuilder._loadedModuleAssets)>-1?(o.remove(),s.remove()):(e("head").append(o),e("head").append(s),FLBuilder._loadedModuleAssets.push(n)),FLBuilder._setSettingsFormContent(i),"undefined"!=typeof l.layout&&(a=l.layout,a.nodeParent=FLBuilder._newModuleParent,a.nodePosition=FLBuilder._newModulePosition),"undefined"!=typeof l.state&&(d=l.state),FLBuilder.preview=new FLBuilderPreview({type:"module",layout:a,state:d}),u=FLBuilder._moduleHelpers[n],"undefined"!=typeof u&&(FLBuilder._initSettingsValidation(u.rules),u.init())},_saveModuleClicked:function(){var t=e(this).closest(".fl-builder-settings"),l=t.attr("data-type"),i=(t.attr("data-node"),FLBuilder._moduleHelpers[l]),o=!0;"undefined"!=typeof i&&(t.find("label.error").remove(),t.validate().hideErrors(),o=t.validate().form(),o&&(o=i.submit())),o?(FLBuilder._saveSettings(),FLBuilder._lightbox.close()):FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,l,i,o){FLBuilder.showAjaxLoader(),e.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=i),FLBuilder.ajax({action:"render_new_module",parent_id:t,type:l,position:i,node_preview:1,widget:"undefined"==typeof o?"":o},FLBuilder._addModuleComplete)},_addModuleComplete:function(t){FLBuilder._showLightbox(),FLBuilder._moduleSettingsLoaded(t),e(".fl-builder-module-settings").data("new-module","1")},registerModuleHelper:function(t,l){var i={rules:{},init:function(){},submit:function(){return!0},preview:function(){}};FLBuilder._moduleHelpers[t]=e.extend({},i,l)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(t){var l=e(".fl-builder-settings-lightbox .fl-builder-settings");FLBuilder._saveSettings(),FLBuilder.ajax({action:"render_node_template_settings",node_id:l.attr("data-node")},FLBuilder._nodeTemplateSettingsLoaded)},_nodeTemplateSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._showLightbox(!1),FLBuilder._setSettingsFormContent(t.html),FLBuilder._initSettingsValidation({name:{required:!0}})},_saveNodeTemplate:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=t.validate().form();l&&(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_node_template",node_id:t.attr("data-node"),settings:FLBuilder._getSettings(t)},FLBuilder._saveNodeTemplateComplete),FLBuilder._lightbox.close())},_saveNodeTemplateComplete:function(t){var l=JSON.parse(t),i=e(".fl-builder-saved-"+l.type+"s"),o=i.find(".fl-builder-block"),s=null,r="",n=l.name.toLowerCase(),a=0,d=wp.template("fl-node-template-block");if("row"==l.type?FLBuilder.alert(FLBuilderStrings.rowTemplateSaved):"module"==l.type&&FLBuilder.alert(FLBuilderStrings.moduleTemplateSaved),l.layout&&FLBuilder._renderLayout(l.layout),0===o.length)i.append(d(l));else for(;a<o.length;a++){if(s=o.eq(a),r=s.text().toLowerCase().trim(),0===a&&n<r){i.prepend(d(l));break}if(n<r){s.before(d(l));break}if(o.length-1===a){i.append(d(l));break}}i.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(t,l){FLBuilder._blockDragStop(t,l);var i=l.item,o=i.parent(),s=null,r=0,n=null,a="",d=null;if(i.hasClass("fl-builder-block-saved-row")||i.hasClass("fl-builder-block-row-template"))n=i.closest(".fl-row"),r=n.length?e(FLBuilder._contentClass+" .fl-row").index(n):0,r=o.hasClass("fl-drop-target-last")?r+1:r,s=null,a="render_new_row",d=FLBuilder._addRowComplete,FLBuilder._newRowPosition=r;else if(i.hasClass("fl-builder-block-saved-module")||i.hasClass("fl-builder-block-module-template")){if(a="render_new_module",d=FLBuilder._addModuleComplete,o.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=i.closest(".fl-builder-content"),s=0,r=o.find(".fl-row").index(i.closest(".fl-row"))):o.hasClass("fl-col-group-drop-target")?(o=i.closest(".fl-row-content"),s=o.closest(".fl-row").attr("data-node"),r=o.find(" > .fl-col-group").index(i.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")?(o=i.closest(".fl-col-group"),r=o.children(".fl-col").index(i.closest(".fl-col")),s=o.attr("data-node")):(r=o.children(".fl-module, .fl-builder-block").index(i),s=i.closest(".fl-col").attr("data-node")),i.closest(".fl-drop-target-last").length&&(r+=1),o.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=o,FLBuilder._newModulePosition=r)}FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:a,template_id:i.attr("data-id"),template_type:i.attr("data-type"),parent_id:s,position:r},d),i.remove()},_editNodeTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteNodeTemplateClicked:function(t){var l=e(t.target),i=l.closest(".fl-builder-blocks-section"),o=i.find(".fl-builder-blocks-section-content"),s=o.find(".fl-builder-block"),r=l.closest(".fl-builder-block"),n=r.hasClass("fl-builder-block-global"),a=n?FLBuilder._updateLayout:void 0,d=n?FLBuilderStrings.deleteGlobalTemplate:FLBuilderStrings.deleteTemplate;confirm(d)&&(r.remove(),1===s.length&&(r.hasClass("fl-builder-block-saved-row")?o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedRows+"</span>"):o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedModules+"</span>")),FLBuilder.ajax({action:"delete_node_template",template_id:r.attr("data-id"),silent:!r.hasClass("fl-builder-block-global")},a))},_initSettingsForms:function(){FLBuilder._initColorPickers(),FLBuilder._initSelectFields(),FLBuilder._initMultipleFields(),FLBuilder._initAutoSuggestFields(),FLBuilder._initLinkFields(),FLBuilder._initFontFields(),FLBuilder.triggerHook("settings-form-init")},_setSettingsFormContent:function(e){FLBuilder._setLightboxContent(e),FLBuilder._initSettingsForms()},_settingsTabClicked:function(t){var l=e(this),i=l.closest(".fl-builder-settings"),o=l.attr("href").split("#").pop();i.find(".fl-builder-settings-tab").removeClass("fl-active"),i.find("#"+o).addClass("fl-active"),i.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),e(this).addClass("fl-active"),t.preventDefault()},_settingsCancelClicked:function(t){var l=e(".fl-builder-module-settings"),i=null,o=null,s=null,r=null;l.length>0&&"undefined"!=typeof l.data("new-module")?(i=e(FLBuilder.preview.state.html),o=e(".fl-node-"+l.data("node")),s=o.closest(".fl-col"),r=i.find(".fl-node-"+s.data("node")),r.length>0?FLBuilder._deleteModule(o):FLBuilder._deleteCol(s)):FLBuilder.preview&&FLBuilder.preview.revert(),FLBuilder.preview=null,FLLightbox.closeParent(this)},_initSettingsValidation:function(t,l){var i=e(".fl-builder-settings").last();i.validate({ignore:[],rules:t,messages:l,errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var t=e(".fl-builder-settings:visible"),l=t.find(".fl-builder-settings-tab"),i=null,o=null,s=0;s<l.length;s++)i=l.eq(s),o=i.find("label.error"),tabLink=t.find(".fl-builder-settings-tabs a[href*="+i.attr("id")+"]"),tabLink.find(".fl-error-icon").remove(),tabLink.removeClass("error"),o.length>0&&(tabLink.append('<span class="fl-error-icon"></span>'),tabLink.addClass("error"))},_getSettings:function(t){FLBuilder._updateEditorFields();var l=t.serializeArray(),i=0,o=0,s="",r="",n="",a=[],d=[],u={};for(i=0;i<l.length;i++)if(s=l[i].value.replace(/\r/gm,""),!(l[i].name.indexOf("flrich")>-1))if(l[i].name.indexOf("[")>-1){for(r=l[i].name.replace(/\[(.*)\]/,""),n=l[i].name.replace(r,""),a=[],d=n.match(/\[[^\]]*\]/g),o=0;o<d.length;o++)"[]"!=d[o]&&a.push(d[o].replace(/\[|\]/g,""));n.match(/\[\]\[[^\]]*\]\[[^\]]+\]/)?("undefined"==typeof u[r]&&(u[r]={}),"undefined"==typeof u[r][a[0]]&&(u[r][a[0]]={}),"undefined"==typeof u[r][a[0]][a[1]]&&(u[r][a[0]][a[1]]={}),u[r][a[0]][a[1]]=s):n.match(/\[\]\[[^\]]*\]\[\]/)?("undefined"==typeof u[r]&&(u[r]={}),
5
- "undefined"==typeof u[r][a[0]]&&(u[r][a[0]]=[]),u[r][a[0]].push(s)):n.match(/\[\]\[[^\]]*\]/)?("undefined"==typeof u[r]&&(u[r]={}),u[r][a[0]]=s):n.match(/\[\]/)&&("undefined"==typeof u[r]&&(u[r]=[]),u[r].push(s))}else u[l[i].name]=s;for(n in u)if("undefined"!=typeof u["as_values_"+n]){u[n]=e.grep(u["as_values_"+n].split(","),function(e){return""!==e}).join(",");try{delete u["as_values_"+n]}catch(c){}}return u},_saveSettings:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=t.attr("data-node"),i=FLBuilder._getSettings(t);FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_settings",node_id:l,settings:i},FLBuilder._saveSettingsComplete),FLBuilder._lightbox.close()},_saveSettingsComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder.preview&&(FLBuilder.preview.clear(),FLBuilder.preview=null)})},_showHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeIn()},_hideHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeOut()},_initAutoSuggestFields:function(){e(".fl-suggest-field").each(FLBuilder._initAutoSuggestField)},_initAutoSuggestField:function(){var t=e(this);t.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:t.data("action"),fl_as_action_data:t.data("action-data"),_wpnonce:FLBuilderConfig.ajaxNonce}),e.extend({},{asHtmlID:t.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,preFill:t.data("value"),queryParam:"fl_as_query",afterSelectionAdd:FLBuilder._updateAutoSuggestField,afterSelectionRemove:FLBuilder._updateAutoSuggestField,selectionLimit:t.data("limit")},t.data("args")))},_updateAutoSuggestField:function(t,l,i){e(this).siblings(".as-values").val(i.join(",")).trigger("change")},_initMultipleFields:function(){for(var t=e(".fl-builder-field-multiples"),l=null,i=null,o=0,s=FLBuilderConfig.isRtl?{left:10}:{right:10};o<t.length;o++)l=t.eq(o),i=l.find(".fl-builder-field-multiple"),1===i.length?i.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):i.find(".fl-builder-field-actions").removeClass("fl-builder-field-actions-single");e(".fl-builder-field-multiples").sortable({items:".fl-builder-field-multiple",cursor:"move",cursorAt:s,distance:5,opacity:.5,helper:FLBuilder._fieldDragHelper,placeholder:"fl-builder-field-dd-zone",stop:FLBuilder._fieldDragStop,tolerance:"pointer"})},_addFieldClicked:function(){var t=e(this),l=t.attr("data-field"),i=t.closest("tr").siblings("tr[data-field="+l+"]").last(),o=i.clone(),s=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;o.find("th label span.fl-builder-field-index").html(s),o.find(".fl-form-field-preview-text").html(""),o.find("input, textarea, select").val(""),i.after(o),FLBuilder._initMultipleFields()},_copyFieldClicked:function(){var t=e(this),l=t.closest("tr"),i=l.clone(),o=parseInt(l.find("label span.fl-builder-field-index").html(),10)+1;i.find("th label span.fl-builder-field-index").html(o),l.after(i),FLBuilder._renumberFields(l.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var t=e(this).closest("tr"),l=t.parent(),i=confirm(FLBuilderStrings.deleteFieldMessage);i&&(t.remove(),FLBuilder._renumberFields(l),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview())},_renumberFields:function(e){for(var t=e.find(".fl-builder-field-multiple"),l=0;l<t.length;l++)t.eq(l).find("th label span.fl-builder-field-index").html(l+1)},_fieldDragHelper:function(){return e('<div class="fl-builder-field-dd-helper"></div>')},_fieldDragStop:function(e,t){FLBuilder._renumberFields(t.item.parent()),FLBuilder.preview.delayPreview()},_initSelectFields:function(){e(".fl-builder-settings:visible").find(".fl-builder-settings-fields select").trigger("change")},_settingsSelectChanged:function(){var t=e(this),l=t.attr("data-toggle"),i=t.attr("data-hide"),o=t.attr("data-trigger"),s=t.val(),r=0;if("undefined"!=typeof l){l=JSON.parse(l);for(r in l)FLBuilder._settingsSelectToggle(l[r].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(l[r].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[r].tabs,"hide","a[href*=fl-builder-settings-tab-","]");"undefined"!=typeof l[s]&&(FLBuilder._settingsSelectToggle(l[s].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(l[s].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[s].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if("undefined"!=typeof i&&(i=JSON.parse(i),"undefined"!=typeof i[s]&&(FLBuilder._settingsSelectToggle(i[s].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[s].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[s].tabs,"hide","a[href*=fl-builder-settings-tab-","]"))),"undefined"!=typeof o&&(o=JSON.parse(o),"undefined"!=typeof o[s]&&"undefined"!=typeof o[s].fields))for(r=0;r<o[s].fields.length;r++)e("#fl-field-"+o[s].fields[r]).find("select").trigger("change")},_settingsSelectToggle:function(t,l,i,o){var s=0;if(o="undefined"==typeof o?"":o,"undefined"!=typeof t)for(;s<t.length;s++)e(i+t[s]+o)[l](),e(i+t[s]).parent().find('.fl-field[data-type="code"]').each(function(){e(this).data("editor").resize()})},_initColorPickers:function(){var t=FLBuilderConfig.colorPresets?FLBuilderConfig.colorPresets:[];FLBuilder.colorPicker=new FLBuilderColorPicker({mode:"hsv",elements:".fl-color-picker .fl-color-picker-value",presets:t,labels:{colorPresets:FLBuilderStrings.colorPresets,colorPicker:FLBuilderStrings.colorPicker,placeholder:FLBuilderStrings.placeholder,removePresetConfirm:FLBuilderStrings.removePresetConfirm,noneColorSelected:FLBuilderStrings.noneColorSelected,alreadySaved:FLBuilderStrings.alreadySaved,noPresets:FLBuilderStrings.noPresets,presetAdded:FLBuilderStrings.presetAdded},mode:"hsv"}),e(FLBuilder.colorPicker).on("presetRemoved presetAdded",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_initSinglePhotoSelector:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:"image"},multiple:!1}))},_selectSinglePhoto:function(){FLBuilder._initSinglePhotoSelector(),FLBuilder._singlePhotoSelector.once("open",e.proxy(FLBuilder._singlePhotoOpened,this)),FLBuilder._singlePhotoSelector.once("select",e.proxy(FLBuilder._singlePhotoSelected,this)),FLBuilder._singlePhotoSelector.open()},_singlePhotoOpened:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection"),l=e(this).closest(".fl-photo-field"),i=l.find("input[type=hidden]"),o=i.val(),s=null;e(this).hasClass("fl-photo-replace")?(t.reset(),l.addClass("fl-photo-empty"),i.val("")):""!==o?(s=wp.media.attachment(o),s.fetch(),t.add(s?[s]:[])):t.reset()},_singlePhotoSelected:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection").first().toJSON(),l=e(this).closest(".fl-photo-field"),i=l.find("input[type=hidden]"),o=l.find(".fl-photo-preview img"),s=l.find("select");i.val(t.id),o.attr("src",FLBuilder._getPhotoSrc(t)),l.removeClass("fl-photo-empty"),l.find("label.error").remove(),s.show(),s.html(FLBuilder._getPhotoSizeOptions(t)),s.trigger("change")},_singlePhotoRemoved:function(){FLBuilder._initSinglePhotoSelector();var t=FLBuilder._singlePhotoSelector.state(),l="undefined"!=typeof t?t.get("selection"):null,i=e(this).closest(".fl-photo-field"),o=i.find("input[type=hidden]"),s=i.find("select");l&&l.reset(),i.addClass("fl-photo-empty"),o.val(""),s.html('<option value="" selected></option>'),s.trigger("change")},_getPhotoSrc:function(e){return"undefined"==typeof e.sizes?e.url:"undefined"!=typeof e.sizes.thumbnail?e.sizes.thumbnail.url:e.sizes.full.url},_getPhotoSizeOptions:function(e){var t="",l=null,i=null,o="",s={full:FLBuilderStrings.fullSize,large:FLBuilderStrings.large,medium:FLBuilderStrings.medium,thumbnail:FLBuilderStrings.thumbnail};if("undefined"==typeof e.sizes)t+='<option value="'+e.url+'">'+FLBuilderStrings.fullSize+"</option>";else for(l in e.sizes)o="undefined"!=typeof s[l]?s[l]+" - ":"undefined"!=typeof FLBuilderConfig.customImageSizeTitles[l]?FLBuilderConfig.customImageSizeTitles[l]+" - ":"",i="full"==l?' selected="selected"':"",t+='<option value="'+e.sizes[l].url+'"'+i+">"+o+e.sizes[l].width+" x "+e.sizes[l].height+"</option>";return t},_selectMultiplePhotos:function(){var t=e(this).closest(".fl-multiple-photos-field"),l=t.find("input[type=hidden]"),i=l.val(),o=""===i?"":JSON.parse(i),s=wp.media.gallery.defaults.id,r='[gallery ids="-1"]',n=null,a=null,d=null,u=null,c=[];if("object"==typeof o){for(u in o)c.push(o[u]);r='[gallery ids="'+c.join()+'"]'}n=wp.shortcode.next("gallery",r).shortcode,_.isUndefined(n.get("id"))&&!_.isUndefined(s)&&n.set("id",s),a=wp.media.gallery.attachments(n),d=new wp.media.model.Selection(a.models,{props:a.props.toJSON(),multiple:!0}),d.gallery=a.gallery,d.more().done(function(){d.length||FLBuilder._multiplePhotoSelector.setState("gallery-library"),d.props.set({query:!1}),d.unmirror(),d.props.unset("orderby")}),FLBuilder._multiplePhotoSelector&&FLBuilder._multiplePhotoSelector.dispose(),FLBuilder._multiplePhotoSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-photos-edit")?"gallery-edit":"gallery-library",title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:d}).open(),e(FLBuilder._multiplePhotoSelector.views.view.el).addClass("fl-multiple-photos-lightbox"),FLBuilder._multiplePhotoSelector.once("update",e.proxy(FLBuilder._multiplePhotosSelected,this))},_multiplePhotosSelected:function(t){for(var l=e(this).closest(".fl-multiple-photos-field"),i=l.find("input[type=hidden]"),o=l.find(".fl-multiple-photos-count"),s=[],r=0;r<t.models.length;r++)s.push(t.models[r].id);1==s.length?o.html("1 "+FLBuilderStrings.photoSelected):o.html(s.length+" "+FLBuilderStrings.photosSelected),l.removeClass("fl-multiple-photos-empty"),l.find("label.error").remove(),i.val(JSON.stringify(s)).trigger("change")},_selectSingleVideo:function(){null===FLBuilder._singleVideoSelector&&(FLBuilder._singleVideoSelector=wp.media({title:FLBuilderStrings.selectVideo,button:{text:FLBuilderStrings.selectVideo},library:{type:"video"},multiple:!1})),FLBuilder._singleVideoSelector.once("select",e.proxy(FLBuilder._singleVideoSelected,this)),FLBuilder._singleVideoSelector.open()},_singleVideoSelected:function(){var t=FLBuilder._singleVideoSelector.state().get("selection").first().toJSON(),l=e(this).closest(".fl-video-field"),i=l.find(".fl-video-preview-img img"),o=l.find(".fl-video-preview-filename"),s=l.find("input[type=hidden]");i.attr("src",t.icon),o.html(t.filename),l.removeClass("fl-video-empty"),l.find("label.error").remove(),s.val(t.id).trigger("change")},_selectMultipleAudios:function(){var t=e(this).closest(".fl-multiple-audios-field"),l=t.find("input[type=hidden]"),i=l.val(),o=""==i?'[playlist ids="-1"]':'[playlist ids="'+JSON.parse(i).join()+'"]',s=wp.shortcode.next("playlist",o).shortcode,r=wp.media.playlist.defaults.id,n=null,a=null;_.isUndefined(s.get("id"))&&!_.isUndefined(r)&&s.set("id",r),n=wp.media.playlist.attachments(s),a=new wp.media.model.Selection(n.models,{props:n.props.toJSON(),multiple:!0}),a.playlist=n.playlist,a.more().done(function(){a.props.set({query:!1}),a.unmirror(),a.props.unset("orderby")}),FLBuilder._multipleAudiosSelector&&FLBuilder._multipleAudiosSelector.dispose(),FLBuilder._multipleAudiosSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-audios-edit")?"playlist-edit":"playlist-library",title:wp.media.view.l10n.editPlaylistTitle,editing:!0,multiple:!0,selection:a}).open(),FLBuilder._multipleAudiosSelector.content.get("view").sidebar.unset("playlist"),FLBuilder._multipleAudiosSelector.on("content:render:browse",function(e){e&&e.sidebar.on("ready",function(){e.sidebar.unset("playlist")})}),FLBuilder._multipleAudiosSelector.once("update",e.proxy(FLBuilder._multipleAudiosSelected,this))},_multipleAudiosSelected:function(t){for(var l=e(this).closest(".fl-multiple-audios-field"),i=l.find(".fl-multiple-audios-count"),o=l.find("input[type=hidden]"),s=[],r=0;r<t.models.length;r++)s.push(t.models[r].id);1==s.length?i.html("1 "+FLBuilderStrings.audioSelected):i.html(s.length+" "+FLBuilderStrings.audiosSelected),o.val(JSON.stringify(s)).trigger("change"),l.removeClass("fl-multiple-audios-empty"),l.find("label.error").remove()},_selectIcon:function(){var e=this;FLIconSelector.open(function(t){FLBuilder._iconSelected.apply(e,[t])})},_iconSelected:function(t){var l=e(this).closest(".fl-icon-field"),i=l.find("input[type=hidden]"),o=l.find("i"),s=o.attr("data-icon");i.val(t).trigger("change"),o.removeClass(s),o.addClass(t),o.attr("data-icon",t),l.removeClass("fl-icon-empty"),l.find("label.error").remove()},_removeIcon:function(){var t=e(this).closest(".fl-icon-field"),l=t.find("input[type=hidden]"),i=t.find("i");l.val("").trigger("change"),i.removeClass(),i.attr("data-icon",""),t.addClass("fl-icon-empty")},_formFieldClicked:function(){var t=e(this),l=t.closest(".fl-lightbox-wrap").attr("data-instance-id"),i=FLLightbox._instances[l],o=i._node.find(".fl-lightbox").css("left"),s=i._node.find(".fl-lightbox").css("top"),r=t.closest(".fl-builder-settings"),n=t.attr("data-type"),a=t.siblings("input").val(),d=FLBuilder._moduleHelpers[n],u=new FLLightbox({className:"fl-builder-lightbox fl-form-field-settings",destroyOnClose:!0});t.closest(".fl-builder-lightbox").hide(),t.attr("id","fl-"+u._id),u.open('<div class="fl-builder-lightbox-loading"></div>'),u.draggable({handle:".fl-lightbox-header"}),e("body").undelegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked),u._node.find(".fl-lightbox").css({left:o,top:Number(parseInt(s)+233)+"px"}),FLBuilder.ajax({action:"render_settings_form",node_id:r.attr("data-node"),node_settings:FLBuilder._getSettings(r),type:n,settings:a.replace(/&#39;/g,"'")},function(e){var t=JSON.parse(e);u.setContent(t.html),u._node.find("form.fl-builder-settings").attr("data-type",n),u._node.find(".fl-builder-settings-cancel").on("click",FLBuilder._closeFormFieldLightbox),FLBuilder._initSettingsForms(),"undefined"!=typeof d&&(FLBuilder._initSettingsValidation(d.rules),d.init()),u._node.find(".fl-lightbox").css({left:o,top:s})})},_closeFormFieldLightbox:function(){var t=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),l=FLLightbox._instances[t],i=e(".fl-builder-settings-lightbox"),o=i.find("form"),s=l._node.find(".fl-lightbox").css("left"),r=l._node.find(".fl-lightbox").css("top"),n=0,a=e(window),d=a.height();"undefined"!=typeof tinymce&&"undefined"!=typeof tinymce.EditorManager.activeEditor&&tinymce.EditorManager.activeEditor.remove(),l._node.find(".fl-lightbox-content").html('<div class="fl-builder-lightbox-loading"></div>'),n=l._node.find(".fl-lightbox").height(),d-80>n?l._node.find(".fl-lightbox").css("top",(d-n)/2-40+"px"):l._node.find(".fl-lightbox").css("top","0px"),l.on("close",function(){i.show(),i.find("label.error").remove(),o.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors(),i.find(".fl-lightbox").css({left:s,top:r})}),setTimeout(function(){l.close(),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked)},500)},_saveFormFieldClicked:function(){var t=e(this).closest(".fl-builder-settings"),l=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),i=t.attr("data-type"),o=FLBuilder._getSettings(t),s={},r=FLBuilder._moduleHelpers[i],n=e(".fl-builder-settings #fl-"+l),a=n.parent().attr("data-preview-text"),d=o[a],u=e('select[name="'+a+'"]'),c=document.createElement("div"),f=!0;return u.length>0&&(d=u.find('option[value="'+o[a]+'"]').text()),"undefined"!=typeof r&&(t.find("label.error").remove(),t.validate().hideErrors(),f=t.validate().form(),f&&(f=r.submit())),f?("undefined"!=typeof a&&"undefined"!=typeof d&&(d.indexOf("fa fa-")>-1?d='<i class="'+d+'"></i>':d.length>35&&(c.innerHTML=d,d=(c.textContent||c.innerText||"").replace(/^(.{35}[^\s]*).*/,"$1")+"..."),n.siblings(".fl-form-field-preview-text").html(d)),s=n.siblings("input").val().replace(/&#39;/g,"'"),""!=s&&(o=e.extend(JSON.parse(s),o)),n.siblings("input").val(JSON.stringify(o)).trigger("change"),FLBuilder._closeFormFieldLightbox.apply(this),!0):(FLBuilder._toggleSettingsTabErrors(),!1)},_layoutFieldClicked:function(){var t=e(this);t.siblings().removeClass("fl-layout-field-option-selected"),t.addClass("fl-layout-field-option-selected"),t.siblings("input").val(t.attr("data-value"))},_initLinkFields:function(){e(".fl-link-field").each(FLBuilder._initLinkField)},_initLinkField:function(){var t=e(this),l=t.find(".fl-link-field-search-input");l.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:l.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,queryParam:"fl_as_query",selectionLimit:1,afterSelectionAdd:FLBuilder._updateLinkField})},_updateLinkField:function(e,t,l){var i=e.closest(".fl-link-field"),o=i.find(".fl-link-field-search"),s=i.find(".fl-link-field-search-input"),r=i.find(".fl-link-field-input");r.val(t.value).trigger("keyup"),s.autoSuggest("remove",t.value),o.hide()},_linkFieldSelectClicked:function(){e(this).parent().find(".fl-link-field-search").show()},_linkFieldSelectCancelClicked:function(){e(this).parent().hide()},_initFontFields:function(){e(".fl-font-field").each(FLBuilder._initFontField)},_initFontField:function(){var t=e(this),l=t.find(".fl-font-field-font");l.on("change",function(){FLBuilder._getFontWeights(l)})},_getFontWeights:function(t){var l=t.next(".fl-font-field-weight"),i=t.val(),o={"default":"Default",regular:"Regular",100:"Thin 100",200:"Extra-Light 200",300:"Light 300",400:"Normal 400",500:"Medium 500",600:"Semi-Bold 600",700:"Bold 700",800:"Extra-Bold 800",900:"Ultra-Bold 900"},s={};l.html(""),s="undefined"!=typeof FLBuilderFontFamilies.system[i]?FLBuilderFontFamilies.system[i].weights:"undefined"!=typeof FLBuilderFontFamilies.google[i]?FLBuilderFontFamilies.google[i]:FLBuilderFontFamilies["default"][i],e.each(s,function(e,t){l.append('<option value="'+t+'">'+o[t]+"</option>")})},initEditorField:function(e){var t=tinyMCEPreInit.mceInit.flhiddeneditor;t.elements=e,tinyMCEPreInit.mceInit[e]=t},_updateEditorFields:function(){var t=e(".fl-builder-settings textarea.wp-editor-area");t.each(FLBuilder._updateEditorField)},_updateEditorField:function(){var t=e(this),l=t.closest(".fl-editor-field"),i=(t.closest(".fl-builder-settings"),t.closest(".wp-editor-wrap")),o=t.attr("id"),s=l.attr("id"),r="undefined"!=typeof tinyMCE&&tinyMCE.get(o),n=t.siblings('textarea[name="'+s+'"]'),a=l.data("wpautop");0===n.length&&(n=e('<textarea name="'+s+'"></textarea>').hide(),t.after(n)),a?r&&i.hasClass("tmce-active")?n.val(r.getContent()):"undefined"!=typeof switchEditors?n.val(switchEditors.wpautop(t.val())):n.val(t.val()):(r&&i.hasClass("tmce-active")&&r.save(),n.val(t.val()))},_loopBuilderPostTypeChange:function(){var t=e(this).val();e(".fl-loop-builder-filter").hide(),e(".fl-loop-builder-"+t+"-filter").show()},_textFieldAddValueSelectChange:function(){var t=e(this),l=e('input[name="'+t.data("target")+'"]'),i=l.val(),o=t.val(),s="";-1==i.indexOf(o)&&(s=(i.trim()+" "+o.trim()).trim(),l.val(s).trigger("change").trigger("keyup")),t.val("")},ajax:function(t,l){var i;if(FLBuilder._silentUpdate)return FLBuilder.showAjaxLoader(),void(FLBuilder._silentUpdateCallbackData=[t,l]);t.silent===!0&&(FLBuilder._silentUpdate=!0);for(i in t)"undefined"==typeof t[i]&&(t[i]=null);return t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=e("#fl-post-id").val(),t.fl_builder=1,t.fl_action=t.action,"undefined"!=typeof t.settings&&(t.settings=FLBuilder._ajaxModSecFix(t.settings)),"undefined"!=typeof t.node_settings&&(t.node_settings=FLBuilder._ajaxModSecFix(t.node_settings)),t={fl_builder_data:t},e.post(FLBuilder._ajaxUrl(),t,function(e){FLBuilder._ajaxComplete(),"undefined"!=typeof l&&l.call(this,e)})},_ajaxComplete:function(){var e,t;FLBuilder._silentUpdate=!1,null!==FLBuilder._silentUpdateCallbackData?(FLBuilder.showAjaxLoader(),e=FLBuilder._silentUpdateCallbackData[0],t=FLBuilder._silentUpdateCallbackData[1],FLBuilder._silentUpdateCallbackData=null,FLBuilder.ajax(e,t)):FLBuilder.hideAjaxLoader()},_ajaxUrl:function(e){var t=window.location.href.split("#").shift(),l=null;if("undefined"!=typeof e)for(l in e)t+=t.indexOf("?")>-1?"&":"?",t+=l+"="+e[l];return t},showAjaxLoader:function(){0===e(".fl-builder-lightbox-loading").length&&e(".fl-builder-loading").show()},hideAjaxLoader:function(){e(".fl-builder-loading").hide()},_ajaxModSecFix:function(e){var t;if(FLBuilderConfig.modSecFix&&"undefined"!=typeof btoa)if("string"==typeof e)e=btoa(e);else for(t in e)"string"==typeof e[t]?e[t]=btoa(e[t]):"object"==typeof e[t]&&(e[t]=FLBuilder._ajaxModSecFix(e[t]));return e},_showLightbox:function(e){e="undefined"==typeof e||e,FLBuilder._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),e?FLBuilder._lightbox.draggable({handle:".fl-lightbox-header"}):FLBuilder._lightbox.draggable(!1),FLBuilder._removeAllOverlays(),FLBuilder._initLightboxScrollbars()},_setLightboxContent:function(e){FLBuilder._lightbox.setContent(e)},_initLightboxScrollbars:function(){FLBuilder._initScrollbars(),FLBuilder._lightboxScrollbarTimeout=setTimeout(FLBuilder._initLightboxScrollbars,500)},_lightboxClosed:function(){FLBuilder.triggerHook("settings-lightbox-closed"),FLBuilder._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout)},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder.triggerHook("actions-lightbox-settings",e),FLBuilder._actionsLightbox.open(t(e))},_resizeLightbox:function(){var t=e(this),l=t.hasClass("fa-expand")?"expand":"contract";FLBuilder._lightbox.renderResize(l),e(this).toggleClass("fa-expand").toggleClass("fa-compress")},alert:function(e){var t=new FLLightbox({className:"fl-builder-lightbox fl-builder-alert-lightbox",destroyOnClose:!0}),l=wp.template("fl-alert-lightbox");t.open(l({message:e}))},_alertClose:function(){FLLightbox.closeParent(this)},triggerHook:function(t,l){e("body").trigger("fl-builder."+t,l)},addHook:function(t,l){e("body").on("fl-builder."+t,l)},removeHook:function(t,l){e("body").off("fl-builder."+t,l)},log:function(e){"undefined"!=typeof window.console&&"undefined"!=typeof window.console.log&&console.log(e)},logError:function(e){var t=null;"undefined"!=typeof e&&("undefined"!=typeof e.stack?t=e.stack:"undefined"!=typeof e.message&&(t=e.message),t&&(FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(t),FLBuilder.log("************************************************************************")))},logGlobalError:function(e,t,l,i,o){FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(FLBuilderStrings.globalErrorMessage.replace("{message}",e).replace("{line}",l).replace("{file}",t)),"undefined"!=typeof o&&"undefined"!=typeof o.stack&&(FLBuilder.log(o.stack),FLBuilder.log("************************************************************************"))}},e(function(){FLBuilder._init()})}(jQuery);var FLBuilderColorPicker;!function(e,t){function l(){var t,l,i="backgroundImage";f?h="filter":(t=e('<div id="iris-gradtest" />'),l="linear-gradient(top,#fff,#000)",e.each(p,function(e,o){if(t.css(i,o+l),t.css(i).match("gradient"))return h=e,!1}),h===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css(this.bgImageString).match("gradient")&&(h="webkit")),t.remove())}function i(t,l){return t="top"===t?"top":"left",l=e.isArray(l)?l:Array.prototype.slice.call(arguments,1),"webkit"===h?s(t,l):p[h]+"linear-gradient("+t+", "+l.join(", ")+")"}function o(t,l){var i,o,s,n,a,d,u,c,f;t="top"===t?"top":"left",l=e.isArray(l)?l:Array.prototype.slice.call(arguments,1),i="top"===t?0:1,o=e(this),s=l.length-1,n="filter",a=1===i?"left":"top",d=1===i?"right":"bottom",u=1===i?"height":"width",c='<div class="iris-ie-gradient-shim" style="position:absolute;'+u+":100%;"+a+":%start%;"+d+":%end%;"+n+':%filter%;" data-color:"%color%"></div>',f="","static"===o.css("position")&&o.css({position:"relative"}),l=r(l),e.each(l,function(e,t){var o,r,n;return e!==s&&(o=l[e+1],void(t.stop!==o.stop&&(r=100-parseFloat(o.stop)+"%",t.octoHex=new Color(t.color).toIEOctoHex(),o.octoHex=new Color(o.color).toIEOctoHex(),n="progid:DXImageTransform.Microsoft.Gradient(GradientType="+i+", StartColorStr='"+t.octoHex+"', EndColorStr='"+o.octoHex+"')",f+=c.replace("%start%",t.stop).replace("%end%",r).replace("%filter%",n))))}),o.find(".iris-ie-gradient-shim").remove(),e(f).prependTo(o)}function s(t,l){var i=[];return t="top"===t?"0% 0%,0% 100%,":"0% 100%,100% 100%,",l=r(l),e.each(l,function(e,t){i.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+i.join(",")+")"}function r(t){var l=[],i=[],o=[],s=t.length-1;return e.each(t,function(e,t){var o=t,s=!1,r=t.match(/1?[0-9]{1,2}%$/);r&&(o=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=r.shift()),l.push(o),i.push(s)}),i[0]===!1&&(i[0]="0%"),i[s]===!1&&(i[s]="100%"),i=n(i),e.each(i,function(e){o[e]={color:l[e],stop:i[e]}}),o}function n(t){var l,i,o,s,r=0,a=t.length-1,d=0,u=!1;if(t.length<=2||e.inArray(!1,t)<0)return t;for(;d<t.length-1;)u||t[d]!==!1?u&&t[d]!==!1&&(a=d,d=t.length):(r=d-1,u=!0),d++;for(i=a-r,s=parseInt(t[r].replace("%"),10),l=(parseFloat(t[a].replace("%"))-s)/i,d=r+1,o=1;d<a;)t[d]=s+o*l+"%",o++,d++;return n(t)}var a=[],d=navigator.userAgent.toLowerCase(),u="Microsoft Internet Explorer"===navigator.appName,c=u?parseFloat(d.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,f=u&&c<10,h=!1,p=["-moz-","-webkit-","-o-","-ms-"];flBuilderParseColorValue=function(e){var t=e.replace(/\s+/g,""),l=t.indexOf("rgba")!==-1?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100,i=l<100;return{value:t,alpha:l,rgba:i}},e.fn.flBuilderColorPickerGradient=function(){var t=arguments;return this.each(function(){f?o.apply(this,t):e(this).css("backgroundImage",i.apply(this,t))})},e.fn.flBuilderColorPickerRaninbowGradient=function(t,l){var i,o,s,r;for(t=t||"top",i=e.extend({},{s:100,l:50},l),o="hsl(%h%,"+i.s+"%,"+i.l+"%)",s=0,r=[];s<=360;)r.push(o.replace("%h%",s)),s+=30;return this.each(function(){e(this).flBuilderColorPickerGradient(t,r)})},FLBuilderColorPicker=function(t){this._html='<div class="fl-color-picker-ui"><div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="#"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div></div>';var l={elements:null,color:"",mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},target:!1,width:200,presets:[],labels:{colorPresets:"Color Presets",colorPicker:"Color Picker",placeholder:"Paste color here...",removePresetConfirm:"Are you sure?",noneColorSelected:"None color selected.",alreadySaved:"%s is already a saved preset.",noPresets:"Add a color preset first.",presetAdded:"%s added to presets!"}};this.options=e.extend({},l,t),(f===!1||f===!0&&c>7)&&this._init()},FLBuilderColorPicker.prototype={_html:"",_color:"",_currentElement:"",_inited:!1,_defaultHSLControls:{horiz:"s",vert:"l",strip:"h"},_defaultHSVControls:{horiz:"h",vert:"v",strip:"s"},_scale:{h:360,s:100,l:100,v:100},_init:function(){var t=this;e(t.options.elements);this._color=new Color("#ff0000").setHSpace(t.options.mode),a=this.options.presets,h===!1&&l(),e("html").hasClass("fl-color-picker-init")?t.picker=e(".fl-color-picker-ui"):t.picker=e(this._html).appendTo("body"),u?9===c?t.picker.addClass("iris-ie-9"):c<=8&&t.picker.addClass("iris-ie-lt9"):d.indexOf("compatible")<0&&d.indexOf("khtml")<0&&d.match(/mozilla/)&&t.picker.addClass("iris-mozilla"),t.controls={square:t.picker.find(".iris-square"),squareDrag:t.picker.find(".iris-square-value"),horiz:t.picker.find(".iris-square-horiz"),vert:t.picker.find(".iris-square-vert"),strip:t.picker.find(".iris-strip"),stripSlider:t.picker.find(".iris-strip .iris-slider-offset")},"hsv"===t.options.mode&&t._has("l",t.options.controls)?t.options.controls=t._defaultHSVControls:"hsl"===t.options.mode&&t._has("v",t.options.controls)&&(t.options.controls=t._defaultHSLControls),t.hue=t._color.h(),this._setTemplates(),this._ui=e(".fl-color-picker-ui"),this._iris=e(".iris-picker"),this._wrapper=e("body"),e("html").hasClass("fl-color-picker-init")||this._ui.prepend(this._hexHtml).append(this._presetsHtml),t.element=this._ui.find(".fl-color-picker-input"),t._initControls(),t.active="external",t._change(),t._addInputListeners(t.element),this._buildUI(),this._prepareColorFields(),this._pickerControls(),this._presetsControls(),this._buildAlphaUI(),e("html").addClass("fl-color-picker-init")},_prepareColorFields:function(){var t=this;e(".fl-color-picker-value").each(function(){var l=e(this),i=l.val(),o=l.parent().find(".fl-color-picker-color"),s=flBuilderParseColorValue(i),r="";if(i){if(o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba)r=l.val().toString();else if(!o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba){var n=i.replace("rgba","rgb");n=n.substr(0,n.lastIndexOf(","))+")",t._color._alpha=1,r=n,l.val(n)}else r="#"+l.val().toString();o.css({backgroundColor:r})}})},_setTemplates:function(){this._alphaHtml='<div class="fl-alpha-wrap"><div class="fl-alpha-slider"></div><div class="fl-alpha-slider-offset"></div><div class="fl-alpha-text"></div></div>',this._presetsHtml='<div class="fl-color-picker-presets"><div class="fl-color-picker-presets-toggle"><div class="fl-color-picker-presets-open-label fl-color-picker-active">'+this.options.labels.colorPresets+' <span class="fl-color-picker-icon-arrow-up"></span></div><div class="fl-color-picker-presets-close-label">'+this.options.labels.colorPicker+' <span class="fl-color-picker-icon-arrow-down"></span></div></div><ul class="fl-color-picker-presets-list"></ul></div>',this._hexHtml='<input type="text" class="fl-color-picker-input" maxlength="7" placeholder="'+this.options.labels.placeholder+'"><div class="fl-color-picker-preset-add"></div>',this._presetsTpl='<li class="fl-color-picker-preset"><span class="fl-color-picker-preset-color"></span> <span class="fl-color-picker-preset-label"></span> <span class="fl-color-picker-preset-remove fl-color-picker-icon-remove"></span></li>',this._noPresetsTpl='<li class="fl-color-picker-no-preset"><span class="fl-color-picker-preset-label">'+this.options.labels.noPresets+"</span></li>"},_has:function(t,l){var i=!1;return e.each(l,function(e,l){if(t===l)return i=!0,!1}),i},_buildUI:function(){var t=this;t._presetsList=this._ui.find(".fl-color-picker-presets-list"),t._presetsList.html(""),this.options.presets.length>0?e.each(this.options.presets,function(e,l){t._addPresetView(l)}):t._presetsList.append(this._noPresetsTpl)},_addPresetView:function(t){var l=this._presetsList.find(".fl-color-picker-no-preset");l.length>0&&l.remove();var i=e(this._presetsTpl),o=Color(t);i.attr("data-color",t).find(".fl-color-picker-preset-color").css({backgroundColor:o.toString()}).end().find(".fl-color-picker-preset-label").html(o.toString()),this._presetsList.append(i)},_addPresetFeedback:function(){this._ui.append('<div class="fl-color-picker-added"><div class="fl-color-picker-added-text"><div class="fl-color-picker-icon-check"></div> "'+this.options.labels.presetAdded.replace("%s",this._color.toString())+'"</div></div>'),this._ui.find(".fl-color-picker-added").hide().fadeIn(200).delay(2e3).fadeOut(200,function(){e(this).remove()})},_pickerControls:function(){var t=this;this._wrapper.on("click",".fl-color-picker-color",function(){
6
- var l=e(this);t._currentElement=l.parent().find(".fl-color-picker-value"),t._ui.position({my:"left top",at:"left bottom",of:l,collision:"flipfit",using:function(e,l){t._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var l=e(this);t._currentElement=l.parent().find(".fl-color-picker-value"),l.prev(".fl-color-picker-color").css({backgroundColor:"transparent"}).addClass("fl-color-picker-empty"),t._setColor(""),t.element.val(""),t._currentElement.val("").trigger("change")}),e(document).on("click",function(t){0===e(t.target).closest(".fl-color-picker-ui").length&&e(".fl-color-picker-ui.fl-color-picker-active").removeClass("fl-color-picker-active")})},_presetsControls:function(){var t=this,l=t._ui.find(".fl-color-picker-preset-add"),i=t._ui.find(".fl-color-picker-presets"),o=i.find(".fl-color-picker-presets-open-label"),s=i.find(".fl-color-picker-presets-close-label"),r=i.find(".fl-color-picker-presets-list");l.off("click").on("click",function(){t._addPreset(t.element.val())}),r.css({height:t.element.innerHeight()+t._iris.innerHeight()+14+"px"}).hide(),i.off("click").on("click",".fl-color-picker-presets-toggle",function(){o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),r.slideToggle(500)}).on("click",".fl-color-picker-preset",function(l){var i=new Color(e(this).data("color").toString());t._setColor(i),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:i.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),r.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(l){l.stopPropagation(),t._removePreset(e(this).parent().data("color"))})},_removePreset:function(t){if(confirm(this.options.labels.removePresetConfirm)){var l=t.toString(),i=a.indexOf(l);i>-1&&(a.splice(i,1),this.options.presets=a,this._presetsList.find('.fl-color-picker-preset[data-color="'+l+'"]').slideUp(function(){e(this).remove()})),a.length<1&&this._presetsList.append(this._noPresetsTpl),e(this).trigger("presetRemoved",{presets:a})}},_addPreset:function(t){var l=t.toString().replace(/^#/,"");""===l?alert(this.options.labels.noneColorSelected):a.indexOf(l)>-1?alert(this.options.labels.alreadySaved.replace("%s","#"+l)):(this._addPresetView(l),this._addPresetFeedback(),a.push(l),this.options.presets=a,e(this).trigger("presetAdded",{presets:a}))},_togglePicker:function(e){var t=this;this._ui.hasClass("fl-color-picker-active")?(this._ui.removeClass("fl-color-picker-active"),e&&setTimeout(function(){t._ui.css(e),t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200)):(e&&t._ui.css(e),setTimeout(function(){t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200))},_paint:function(){var e=this;e._paintDimension("right","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var l,i=this,o=i._color,s=i.options.mode,r=i._getHSpaceColor(),n=i.controls[t],a=i.options.controls;if(t!==i.active&&("square"!==i.active||"strip"===t))switch(a[t]){case"h":if("hsv"===s){switch(r=o.clone(),t){case"horiz":r[a.vert](100);break;case"vert":r[a.horiz](100);break;case"strip":r.setHSpace("hsl")}l=r.toHsl()}else l="strip"===t?{s:r.s,l:r.l}:{s:100,l:r.l};n.flBuilderColorPickerRaninbowGradient(e,l);break;case"s":"hsv"===s?"vert"===t?l=[o.clone().a(0).s(0).toCSS("rgba"),o.clone().a(1).s(0).toCSS("rgba")]:"strip"===t?l=[o.clone().s(100).toCSS("hsl"),o.clone().s(0).toCSS("hsl")]:"horiz"===t&&(l=["#fff","hsl("+r.h+",100%,50%)"]):l="vert"===t&&"h"===i.options.controls.horiz?["hsla(0, 0%, "+r.l+"%, 0)","hsla(0, 0%, "+r.l+"%, 1)"]:["hsl("+r.h+",0%,50%)","hsl("+r.h+",100%,50%)"],n.flBuilderColorPickerGradient(e,l);break;case"l":l="strip"===t?["hsl("+r.h+",100%,100%)","hsl("+r.h+", "+r.s+"%,50%)","hsl("+r.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],n.flBuilderColorPickerGradient(e,l);break;case"v":l="strip"===t?[o.clone().v(100).toCSS(),o.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],n.flBuilderColorPickerGradient(e,l)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_dimensions:function(e){var t,l=this,i=l.options,o=l.controls,s=o.square,r=l.picker.find(".iris-strip"),n="77.5%",a="12%",d=20,u=i.border?i.width-d:i.width;if(e&&(s.css("width",""),r.css("width",""),l.picker.css({width:"",height:""})),n=u*(parseFloat(n)/100),a=u*(parseFloat(a)/100),t=i.border?n+d:n,s.width(n).height(n),r.height(n).width(a),l.picker.css({width:i.width,height:t}),!i.palettes)return l.picker.css("paddingBottom","")},_addInputListeners:function(e){var t=this,l=100,i=function(l){var i=new Color(e.val()),o=e.val().replace(/^#/,"");if(e.removeClass("iris-error"),i.error)""!==o&&e.addClass("iris-error");else if(i.toString()!==t._color.toString())if("keyup"===l.type){if(o.match(/^[0-9a-fA-F]{3}$/))return;t._setColor(o),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:Color(o).toString()}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change")}else if("paste"===l.type)return o=l.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=Color(o).toString(),t._setColor(o),e.val(hex),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:hex}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change"),!1};e.on("change",i).on("keyup",t._debounce(i,l))},_initControls:function(){var t=this,l=t.controls,i=l.square,o=t.options.controls,s=t._scale[o.strip];l.stripSlider.slider({orientation:"horizontal",max:s,slide:function(e,l){t.active="strip","h"===o.strip&&(l.value=s-l.value),t._color[o.strip](l.value),t._change.apply(t,arguments)}}),l.squareDrag.draggable({containment:l.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,l){t._squareDrag(e,l)},start:function(){i.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){i.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(l){var i="ui-state-focus";l.preventDefault(),"mousedown"===l.type?(t.picker.find("."+i).removeClass(i).blur(),e(this).addClass(i).focus()):e(this).removeClass(i)}).on("keydown",function(e){var i=l.square,o=l.squareDrag,s=o.position(),r=2;switch(e.altKey&&(r*=10),e.keyCode){case 37:s.left-=r;break;case 38:s.top-=r;break;case 39:s.left+=r;break;case 40:s.top+=r;break;default:return!0}s.left=Math.max(0,Math.min(s.left,i.width())),s.top=Math.max(0,Math.min(s.top,i.height())),o.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),i.mousedown(function(l){var i,o;1===l.which&&e(l.target).is("div")&&(i=t.controls.square.offset(),o={top:l.pageY-i.top,left:l.pageX-i.left},l.preventDefault(),t._squareDrag(l,{position:o}),l.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(o).trigger(l))})},_squareDrag:function(e,t){var l=this,i=l.options.controls,o=l._squareDimensions(),s=Math.round((o.h-t.position.top)/o.h*l._scale[i.vert]),r=l._scale[i.horiz]-Math.round((o.w-t.position.left)/o.w*l._scale[i.horiz]);l._color[i.horiz](r)[i.vert](s),l.active="square",l._change.apply(l,arguments)},_setColor:function(e){var t,l,i=this,o=i.options.color;i.options.color=e,e=""+e,t=e.replace(/^#/,""),l=new Color(e).setHSpace(i.options.mode),l.error?i.options.color=o:(i._color=l,i.options.color=i._color.toString(),i.active="external",i._change())},_squareDimensions:function(e){var l,i,o=this.controls.square;return e!==t&&o.data("dimensions")?o.data("dimensions"):(i=this.controls.squareDrag,l={w:o.width(),h:o.height()},o.data("dimensions",l),l)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var t=this,l=t.controls,i=t._getHSpaceColor(),o=["square","strip"],s=t.options.controls,r=s[t.active]||"external",n=t.hue;"strip"===t.active?o=[]:"external"!==t.active&&o.pop(),e.each(o,function(e,o){var r,n,a;if(o!==t.active)switch(o){case"strip":r="h"===s.strip?t._scale[s.strip]-i[s.strip]:i[s.strip],l.stripSlider.slider("value",r);break;case"square":n=t._squareDimensions(),a={left:i[s.horiz]/t._scale[s.horiz]*n.w,top:n.h-i[s.vert]/t._scale[s.vert]*n.h},t.controls.squareDrag.css(a)}}),i.h!==n&&t._isNonHueControl(t.active,r)&&t._color.h(n),t.hue=t._color.h(),t.options.color=t._color.toString(),t.element.is(":input")&&!t._color.error&&(t.element.removeClass("iris-error"),t.element.val()!==t._color.toString()&&(t.element.val(t._color.toString()),this._currentElement&&(this._currentElement.val(t._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:t._color.toString()}).removeClass("fl-color-picker-empty"),t._wrapper.find(".fl-alpha-slider-offset").css("background-color",t._color.toString()),this._currentElement.trigger("change")))),t._paint(),t._inited=!0,t.active=!1},_debounce:function(e,t,l){var i,o;return function(){var s,r,n=this,a=arguments;return s=function(){i=null,l||(o=e.apply(n,a))},r=l&&!i,clearTimeout(i),i=setTimeout(s,t),r&&(o=e.apply(n,a)),o}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var l=e(this);t._currentElement.val();l.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&e(t._alphaHtml).insertAfter(t._iris),t._pickerAlphaControls()):t._ui.find(".fl-alpha-wrap").remove()})},_pickerAlphaControls:function(){var e=this,t=e._currentElement,l=flBuilderParseColorValue(t.val()),i=parseFloat(l.alpha/100),o=e._wrapper,s=e._ui,r=s.find(".fl-alpha-wrap"),n=r.find(".fl-alpha-slider"),a=r.find(".fl-alpha-text"),d=r.find(".fl-alpha-slider-offset");alphaHandle=r.find(".ui-slider-handle"),a.text(i<1?i:""),n.slider({orientation:"vertical",slide:function(t,l){var i=parseFloat(l.value/100);e._color._alpha=i,a.text(i<1?i:""),e._change.apply(e,arguments)},create:function(){d.css({backgroundColor:l.value}),o.on("click",".fl-color-picker-clear",function(){e._color._alpha=1,a.text(""),n.slider("value",100).trigger("slide")})},value:l.alpha,step:1,min:1,max:100})}}}(jQuery),function(e,t){var l=function(e,t){return this instanceof l?this._init(e,t):new l(e,t)};l.fn=l.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var l="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),l=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":l,this[l](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var e=new l(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],i=t.length-1;i>=0;i--)e[t[i]]=this[t[i]];return e},setHSpace:function(e){return this._hSpace="hsv"===e?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,l=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),e.match(l)&&e.match(/\)$/)){if(t=e.replace(/(\s|%)/g,"").replace(l,"").replace(/,?\);?$/,"").split(","),t.length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var i=t.length-1;i>=0;i--)if(t[i]=parseInt(t[i],10),isNaN(t[i]))return this._error();return e.match(/^rgb/)?this.fromRgb({r:t[0],g:t[1],b:t[2]}):e.match(/^hsv/)?this.fromHsv({h:t[0],s:t[1],v:t[2]}):this.fromHsl({h:t[0],s:t[1],l:t[2]})}return this.fromHex(e)},fromRgb:function(e,l){return"object"!=typeof e||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),l))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var l,i,o,s,r,n,a,d;return"object"!=typeof e||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",n=e.h/360,a=e.s/100,d=e.l/100,0===a?l=i=o=d:(s=d<.5?d*(1+a):d+a-d*a,r=2*d-s,l=this.hue2rgb(r,s,n+1/3),i=this.hue2rgb(r,s,n),o=this.hue2rgb(r,s,n-1/3)),this.fromRgb({r:255*l,g:255*i,b:255*o},!0))},fromHsv:function(e){var l,i,o,s,r,n,a,d,u,c,f;if("object"!=typeof e||e.h===t||e.s===t||e.v===t)return this._error();switch(this._hsv=e,this._hSpace="hsv",l=e.h/360,i=e.s/100,o=e.v/100,a=Math.floor(6*l),d=6*l-a,u=o*(1-i),c=o*(1-d*i),f=o*(1-(1-d)*i),a%6){case 0:s=o,r=f,n=u;break;case 1:s=c,r=o,n=u;break;case 2:s=u,r=o,n=f;break;case 3:s=u,r=c,n=o;break;case 4:s=f,r=u,n=o;break;case 5:s=o,r=u,n=c}return this.fromRgb({r:255*s,g:255*r,b:255*n},!0)},fromInt:function(e,l){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),l===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?e+6*(t-e)*l:l<.5?t:l<2/3?e+(t-e)*(2/3-l)*6:e},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;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){switch(e=e||"hex",t=parseFloat(t||this._alpha),e){case"rgb":case"rgba":var l=this.toRgb();return t<1?"rgba( "+l.r+", "+l.g+", "+l.b+", "+t+" )":"rgb( "+l.r+", "+l.g+", "+l.b+" )";case"hsl":case"hsla":var i=this.toHsl();return t<1?"hsla( "+i.h+", "+i.s+"%, "+i.l+"%, "+t+" )":"hsl( "+i.h+", "+i.s+"%, "+i.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e,t,l=this.toRgb(),i=l.r/255,o=l.g/255,s=l.b/255,r=Math.max(i,o,s),n=Math.min(i,o,s),a=(r+n)/2;if(r===n)e=t=0;else{var d=r-n;switch(t=a>.5?d/(2-r-n):d/(r+n),r){case i:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-i)/d+2;break;case s:e=(i-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsl.h!==e&&(e=this._hsl.h),t=Math.round(100*t),0===t&&this._hsl.s&&(t=this._hsl.s),{h:e,s:t,l:Math.round(100*a)}},toHsv:function(){var e,t,l=this.toRgb(),i=l.r/255,o=l.g/255,s=l.b/255,r=Math.max(i,o,s),n=Math.min(i,o,s),a=r,d=r-n;if(t=0===r?0:d/r,r===n)e=t=0;else{switch(r){case i:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-i)/d+2;break;case s:e=(i-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsv.h!==e&&(e=this._hsv.h),t=Math.round(100*t),0===t&&this._hsv.s&&(t=this._hsv.s),{h:e,s:t,v:Math.round(100*a)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return 1===t.length&&(t="0"+t),"#"+t+e.replace(/^#/,"")},toLuminosity:function(){var e=this.toRgb();return.2126*Math.pow(e.r/255,2.2)+.7152*Math.pow(e.g/255,2.2)+.0722*Math.pow(e.b/255,2.2)},getDistanceLuminosityFrom:function(e){if(!(e instanceof l))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),i=e.toLuminosity();return t>i?(t+.05)/(i+.05):(i+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new l(t)},getReadableContrastingColor:function(e,i){if(!(e instanceof l))return this;var o=i===t?5:i,s=e.getDistanceLuminosityFrom(this),r=e.getMaxContrastColor(),n=r.getDistanceLuminosityFrom(e);if(n<=o)return r;if(s>=o)return this;for(var a=0===r.toInt()?-1:1;s<o&&(this.l(a,!0),s=this.getDistanceLuminosityFrom(e),0!==this._color&&16777215!==this._color););return this},a:function(e){if(e===t)return this._alpha;var l=parseFloat(e);return isNaN(l)?this._error():(this._alpha=l,this)},darken:function(e){return e=e||5,this.l(-e,!0)},lighten:function(e){return e=e||5,this.l(e,!0)},saturate:function(e){return e=e||15,this.s(e,!0)},desaturate:function(e){return e=e||15,this.s(-e,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){e=e||1;var t=180+30*e;return this.h(t,!0)},getAnalog:function(e){e=e||1;var t=30*e;return this.h(t,!0)},getTetrad:function(e){e=e||1;var t=60*e;return this.h(t,!0)},getTriad:function(e){e=e||1;var t=120*e;return this.h(t,!0)},_partial:function(e){var l=i[e];return function(i,o){var s=this._spaceFunc("to",l.space);return i===t?s[e]:(o===!0&&(i=s[e]+i),l.mod&&(i%=l.mod),l.range&&(i=i<l.range[0]?l.range[0]:i>l.range[1]?l.range[1]:i),s[e]=i,this._spaceFunc("from",l.space,s))}},_spaceFunc:function(e,t,l){var i=t||this._hSpace,o=e+i.charAt(0).toUpperCase()+i.substr(1);return this[o](l)}};var i={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var o in i)i.hasOwnProperty(o)&&(l.fn[o]=l.fn._partial(o));"object"==typeof exports?module.exports=l:e.Color=l}(this),function(e){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",open:function(e){FLIconSelector._rendered||FLIconSelector._render(),null===FLIconSelector._content?(FLIconSelector._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder.ajax({action:"render_icon_selector"},FLIconSelector._getContentComplete)):FLIconSelector._lightbox.open(),FLIconSelector._lightbox.on("icon-selected",function(t,l){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),e(l)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0},_getContentComplete:function(t){var l=JSON.parse(t);FLIconSelector._content=l.html,FLIconSelector._lightbox.setContent(l.html),e(".fl-icons-filter-select").on("change",FLIconSelector._filter),e(".fl-icons-filter-text").on("keyup",FLIconSelector._filter),e(".fl-icons-list i").on("click",FLIconSelector._select),e(".fl-icon-selector-cancel").on("click",e.proxy(FLIconSelector._lightbox.close,FLIconSelector._lightbox))},_filter:function(){var t=e(".fl-icons-filter-select").val(),l=e(".fl-icons-filter-text").val();"all"==t?e(".fl-icons-section").show():(e(".fl-icons-section").hide(),e(".fl-"+t).show()),FLIconSelector._filterText=l,""!==l?e(".fl-icons-list i").each(FLIconSelector._filterIcon):e(".fl-icons-list i").show()},_filterIcon:function(){var t=e(this);-1==t.attr("class").indexOf(FLIconSelector._filterText)?t.hide():t.show()},_select:function(){var t=e(this).attr("class");FLIconSelector._lightbox.trigger("icon-selected",t)}}}(jQuery),function(e){FLLightbox=function(e){this._init(e),this._render(),this._bind()},FLLightbox.closeParent=function(t){var l=e(t).closest(".fl-lightbox-wrap").attr("data-instance-id");FLLightbox._instances[l].close()},FLLightbox._instances={},FLLightbox.prototype={_id:null,_node:null,_visible:!1,_resizeTimer:null,_draggable:!1,_defaults:{className:"",destroyOnClose:!1},open:function(e){this._node.find(".fl-lightbox").attr("style",""),this._node.show(),this._visible=!0,"undefined"!=typeof e?this.setContent(e):this._resize(),this.trigger("open")},close:function(){"undefined"!=typeof tinymce&&"undefined"!=typeof tinymce.EditorManager.activeEditor&&null!=tinymce.EditorManager.activeEditor&&tinymce.EditorManager.activeEditor.hide(),this._node.hide(),this._visible=!1,this.trigger("close"),this._defaults.destroyOnClose&&this.destroy()},setContent:function(e){this._node.find(".fl-lightbox-content").html(e),this._resize()},empty:function(){this._node.find(".fl-lightbox-content").empty(),this._node.find(".fl-lightbox").removeClass("fl-lightbox-expanded")},on:function(e,t){this._node.on(e,t)},off:function(e){this._node.off(e)},trigger:function(e,t){this._node.trigger(e,t)},draggable:function(e){var t=this._node.find(".fl-lightbox-mask"),l=this._node.find(".fl-lightbox");e="undefined"!=typeof e&&e,this._draggable&&l.draggable("destroy"),e?(this._unbind(),this._draggable=!0,t.hide(),l.draggable({cursor:"move",handle:e.handle||""})):(t.show(),this._bind(),this._draggable=!1),this._resize()},destroy:function(){e(window).off("resize.fl-lightbox-"+this._id),this._node.empty(),this._node.remove(),FLLightbox._instances[this._id]="undefined";try{delete FLLightbox._instances[this._id]}catch(t){}},renderResize:function(t){if("undefined"!=typeof t){var l=this._getActiveNode();if(lightbox=l.find(".fl-lightbox"),boxFields=lightbox.find(".fl-builder-settings-fields"),win=e(window),winHeight=win.height(),winWidth=win.width(),boxHeaderHeight=lightbox.find(".fl-lightbox-header").height(),boxTabsHeight=lightbox.find(".fl-builder-settings-tabs").height(),boxFooterHeight=lightbox.find(".fl-lightbox-footer").height(),boxFieldHeight=winHeight-(boxHeaderHeight+boxTabsHeight+boxFooterHeight+103),editor="undefined"!=typeof tinymce&&tinymce.EditorManager.activeEditor?tinymce:null,editorId=editor?editor.EditorManager.activeEditor.id:"flhiddeneditor",editorIframeEl=lightbox.find("#"+editorId+"_ifr"),editorTextarea=lightbox.find("#"+editorId),codeField=lightbox.find(".fl-code-field .ace_editor"),"expand"==t||"window_resize"==t){if("window_resize"==t&&!lightbox.hasClass("fl-lightbox-expanded"))return!1;boxFields.css("height",boxFieldHeight+"px"),"expand"==t&&(lightbox.addClass("fl-lightbox-expanded"),lightbox.draggable("disable")),editorIframeEl.length>0&&editorIframeEl.css("height",boxFieldHeight-145+"px"),editorTextarea.length>0&&editorTextarea.css("height",boxFieldHeight-145+"px"),codeField.length>0&&codeField.css("height",boxFieldHeight-30+"px")}else setTimeout(e.proxy(this._resize,this),250),lightbox.removeClass("fl-lightbox-expanded"),boxFields.removeAttr("style"),null!==editorId&&(editorIframeEl.css("height","232px"),editorTextarea.css("height","232px")),codeField.length>0&&codeField.css("height","380px"),lightbox.draggable("enable")}},_init:function(t){var l=0,i=null;for(i in FLLightbox._instances)l++;this._defaults=e.extend({},this._defaults,t),this._id=(new Date).getTime()+l,FLLightbox._instances[this._id]=this},_render:function(){this._node=e('<div class="fl-lightbox-wrap" data-instance-id="'+this._id+'"><div class="fl-lightbox-mask"></div><div class="fl-lightbox"><div class="fl-lightbox-content-wrap"><div class="fl-lightbox-content"></div></div></div></div>'),this._node.addClass(this._defaults.className),e("body").append(this._node)},_bind:function(){e(window).on("resize.fl-lightbox-"+this._id,e.proxy(this._delayedResize,this))},_unbind:function(){e(window).off("resize.fl-lightbox-"+this._id)},_delayedResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(e.proxy(this._resize,this),250),this.renderResize("window_resize")},_resize:function(){if(this._visible){var t=this._node.find(".fl-lightbox"),l=t.height(),i=t.width(),o=e(window),s=o.height(),r=o.width(),n="0px",a=(r-i)/2-30+"px";t.css({margin:"0px",top:"auto",left:"auto"}),s-80>l&&(n=(s-l)/2-40+"px"),this._draggable?(t.css("top",n),t.css("left",FLBuilderConfig.isRtl?"-"+a:a)):(t.css("margin-top",n),t.css("margin-left","auto"),t.css("margin-right","auto"))}},_onKeypress:function(e){27==e.which&&this._visible&&this.close()},_getActiveNode:function(){var t=this._node;return e.each(FLLightbox._instances,function(l,i){e(i._node).is(":visible")&&(t=e(i._node))}),t}}}(jQuery),function(e){FLStyleSheet=function(t){"object"==typeof t&&e.extend(this,t),this._createSheet()},FLStyleSheet.prototype={id:null,_sheet:null,_sheetElement:null,updateRule:function(e,t,l){for(var i=this._sheet.cssRules?this._sheet.cssRules:this._sheet.rules,o=null,s=0;s<i.length;s++)i[s].selectorText.toLowerCase()==e.toLowerCase()&&(o=i[s]);if(o)if("object"==typeof t)for(s in t)o.style[this._toCamelCase(s)]=t[s];else o.style[this._toCamelCase(t)]=l;else this.addRule(e,t,l)},addRule:function(e,t,l){var i="",o="";if("object"==typeof t)for(o in t)i+=o+":"+t[o]+";";else i=t+":"+l+";";this._sheet.insertRule?this._sheet.insertRule(e+" { "+i+" }",this._sheet.cssRules.length):this._sheet.addRule(e,i)},destroy:function(){this._sheetElement&&(this._sheetElement.remove(),this._sheetElement=null),this._sheet&&(this._sheet=null)},disable:function(){this._sheet.disabled=!0},enable:function(){this._sheet.disabled=!1},_createSheet:function(){var t=this.id?' id="'+this.id+'"':"";this._sheet||(this._sheetElement=e('<style type="text/css"'+t+"></style>"),e("body").append(this._sheetElement),this._sheet=this._sheetElement[0].sheet)},_toCamelCase:function(e){return e.toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}}(jQuery);
1
+ !function(e){FLLightbox=function(e){this._init(e),this._render(),this._bind()},FLLightbox.closeParent=function(t){var l=e(t).closest(".fl-lightbox-wrap").attr("data-instance-id");FLLightbox._instances[l].close()},FLLightbox._instances={},FLLightbox.prototype={_id:null,_node:null,_visible:!1,_resizeTimer:null,_draggable:!1,_defaults:{className:"",destroyOnClose:!1},open:function(e){this._node.find(".fl-lightbox").attr("style",""),this._node.show(),this._visible=!0,"undefined"!=typeof e?this.setContent(e):this._resize(),this.trigger("open")},close:function(){this._node.hide(),this._visible=!1,this.trigger("close"),this._defaults.destroyOnClose&&this.destroy()},setContent:function(e){this._node.find(".fl-lightbox-content").html(e),this._resize()},empty:function(){this._node.find(".fl-lightbox-content").empty(),this._node.find(".fl-lightbox").removeClass("fl-lightbox-expanded")},on:function(e,t){this._node.on(e,t)},off:function(e){this._node.off(e)},trigger:function(e,t){this._node.trigger(e,t)},draggable:function(e){var t=this._node.find(".fl-lightbox-mask"),l=this._node.find(".fl-lightbox");e="undefined"!=typeof e&&e,this._draggable&&l.draggable("destroy"),e?(this._unbind(),this._draggable=!0,t.hide(),l.draggable({cursor:"move",handle:e.handle||""})):(t.show(),this._bind(),this._draggable=!1),this._resize()},destroy:function(){e(window).off("resize.fl-lightbox-"+this._id),this._node.empty(),this._node.remove(),FLLightbox._instances[this._id]="undefined";try{delete FLLightbox._instances[this._id]}catch(t){}},renderResize:function(t){if("undefined"!=typeof t){var l=this._getActiveNode();if(lightbox=l.find(".fl-lightbox"),boxFields=lightbox.find(".fl-builder-settings-fields"),win=e(window),winHeight=win.height(),winWidth=win.width(),boxHeaderHeight=lightbox.find(".fl-lightbox-header").height(),boxTabsHeight=lightbox.find(".fl-builder-settings-tabs").height(),boxFooterHeight=lightbox.find(".fl-lightbox-footer").height(),boxFieldHeight=winHeight-(boxHeaderHeight+boxTabsHeight+boxFooterHeight+103),editor="undefined"!=typeof tinymce&&tinymce.EditorManager.activeEditor?tinymce:null,editorId=editor?editor.EditorManager.activeEditor.id:"flhiddeneditor",editorIframeEl=lightbox.find("#"+editorId+"_ifr"),editorTextarea=lightbox.find("#"+editorId),codeField=lightbox.find(".fl-code-field .ace_editor"),"expand"==t||"window_resize"==t){if("window_resize"==t&&!lightbox.hasClass("fl-lightbox-expanded"))return!1;boxFields.css("height",boxFieldHeight+"px"),"expand"==t&&(lightbox.addClass("fl-lightbox-expanded"),lightbox.draggable("disable")),editorIframeEl.length>0&&editorIframeEl.css("height",boxFieldHeight-145+"px"),editorTextarea.length>0&&editorTextarea.css("height",boxFieldHeight-145+"px"),codeField.length>0&&codeField.css("height",boxFieldHeight-30+"px")}else setTimeout(e.proxy(this._resize,this),250),lightbox.removeClass("fl-lightbox-expanded"),boxFields.removeAttr("style"),null!==editorId&&(editorIframeEl.css("height","232px"),editorTextarea.css("height","232px")),codeField.length>0&&codeField.css("height","380px"),lightbox.draggable("enable")}},_init:function(t){var l=0,i=null;for(i in FLLightbox._instances)l++;this._defaults=e.extend({},this._defaults,t),this._id=(new Date).getTime()+l,FLLightbox._instances[this._id]=this},_render:function(){this._node=e('<div class="fl-lightbox-wrap" data-instance-id="'+this._id+'"><div class="fl-lightbox-mask"></div><div class="fl-lightbox"><div class="fl-lightbox-content-wrap"><div class="fl-lightbox-content"></div></div></div></div>'),this._node.addClass(this._defaults.className),e("body").append(this._node)},_bind:function(){e(window).on("resize.fl-lightbox-"+this._id,e.proxy(this._delayedResize,this))},_unbind:function(){e(window).off("resize.fl-lightbox-"+this._id)},_delayedResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(e.proxy(this._resize,this),250),this.renderResize("window_resize")},_resize:function(){if(this._visible){var t=this._node.find(".fl-lightbox"),l=t.height(),i=t.width(),o=e(window),s=o.height(),r=o.width(),n="0px",a=(r-i)/2-30+"px";t.css({margin:"0px",top:"auto",left:"auto"}),s-80>l&&(n=(s-l)/2-40+"px"),this._draggable?(t.css("top",n),t.css("left",FLBuilderConfig.isRtl?"-"+a:a)):(t.css("margin-top",n),t.css("margin-left","auto"),t.css("margin-right","auto"))}},_onKeypress:function(e){27==e.which&&this._visible&&this.close()},_getActiveNode:function(){var t=this._node;return e.each(FLLightbox._instances,function(l,i){e(i._node).is(":visible")&&(t=e(i._node))}),t}}}(jQuery),function(e){FLBuilder={preview:null,_actionsLightbox:null,_addModuleAfterNodeRender:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_dragInitialScrollTop:0,_exitUrl:null,_layout:null,_layoutSettingsCSSCache:null,_layoutSettingsCSSTimeout:null,_lightbox:null,_lightboxScrollbarTimeout:null,_loadedModuleAssets:[],_moduleHelpers:{},_multiplePhotoSelector:null,_newColGroupParent:null,_newColGroupPosition:0,_newModuleParent:null,_newModulePosition:0,_newRowPosition:0,_selectedTemplateId:null,_selectedTemplateType:null,_singlePhotoSelector:null,_singleVideoSelector:null,_multipleAudiosSelector:null,_silentUpdate:!1,_silentUpdateCallbackData:null,_init:function(){FLBuilder._initJQueryReadyFix(),FLBuilder._initGlobalErrorHandling(),FLBuilder._initPostLock(),FLBuilder._initClassNames(),FLBuilder._initMediaUploader(),FLBuilder._initOverflowFix(),FLBuilder._initScrollbars(),FLBuilder._initLightboxes(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._initStrings(),FLBuilder._initTipTips(),FLBuilder._bindEvents(),FLBuilder._bindOverlayEvents(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showTourOrTemplates()},_initJQueryReadyFix:function(){FLBuilderConfig.debug||(jQuery.fn.oldReady=jQuery.fn.ready,jQuery.fn.ready=function(e){return jQuery.fn.oldReady(function(){try{"function"==typeof e&&e()}catch(t){FLBuilder.logError(t)}})})},_initGlobalErrorHandling:function(){FLBuilderConfig.debug||(window.onerror=function(e,t,l,i,o){return FLBuilder.logGlobalError(e,t,l,i,o),!0})},_initPostLock:function(){"undefined"!=typeof wp.heartbeat&&(wp.heartbeat.interval(30),wp.heartbeat.enqueue("fl_builder_post_lock",{post_id:e("#fl-post-id").val()}))},_initClassNames:function(){e("html").addClass("fl-builder-edit"),e("body").addClass("fl-builder"),FLBuilderConfig.simpleUi&&e("body").addClass("fl-builder-simple"),FLBuilder._contentClass=".fl-builder-content-"+FLBuilderConfig.postId},_initMediaUploader:function(){wp.media.model.settings.post.id=e("#fl-post-id").val()},_initOverflowFix:function(){e(FLBuilder._contentClass).parents().css("overflow","visible")},_initScrollbars:function(){e(".fl-nanoscroller").nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},_initLightboxes:function(){FLBuilder._lightbox=new FLLightbox({className:"fl-builder-lightbox fl-builder-settings-lightbox"}),FLBuilder._lightbox.on("close",FLBuilder._lightboxClosed),FLBuilder._actionsLightbox=new FLLightbox({className:"fl-builder-actions-lightbox"})},_initSortables:function(){var t={appendTo:"body",cursor:"move",cursorAt:{left:60,top:20},distance:1,helper:FLBuilder._blockDragHelper,start:FLBuilder._blockDragStart,sort:FLBuilder._blockDragSort,change:FLBuilder._blockDragChange,stop:FLBuilder._blockDragStop,placeholder:"fl-builder-drop-zone",tolerance:"intersect"},l="",i="";i="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col-content":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-node-global) .fl-col-content",l=FLBuilderConfig.nestedColumns?i:"row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",e(".fl-builder-rows").sortable(e.extend({},t,{connectWith:l,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),e(".fl-builder-row-templates").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-row-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-rows").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-saved-row",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-modules, .fl-builder-widgets").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-module",stop:FLBuilder._moduleDragStop})),e(".fl-builder-module-templates").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-module-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-modules").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:i,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-row-sortable-proxy").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",helper:FLBuilder._rowDragHelper,start:FLBuilder._rowDragStart,stop:FLBuilder._rowDragStop})),e(".fl-col-sortable-proxy").sortable(e.extend({},t,{connectWith:i,helper:FLBuilder._colDragHelper,start:FLBuilder._colDragStart,stop:FLBuilder._colDragStop})),e(FLBuilder._contentClass+" .fl-col-content").sortable(e.extend({},t,{connectWith:i,handle:".fl-module-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._moduleDragHelper,items:".fl-module, .fl-col-group",start:FLBuilder._moduleDragStart,stop:FLBuilder._moduleDragStop})),e(FLBuilder._contentClass+" .fl-row-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-group-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-drop-target").sortable(t)},_initStrings:function(){e.validator.messages.required=FLBuilderStrings.validateRequiredMessage},_bindEvents:function(){e("a").on("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e(document).on("heartbeat-tick",FLBuilder._initPostLock),e(window).on("beforeunload",FLBuilder._warnBeforeUnload),e("body").delegate(".fl-builder-has-submenu","click",FLBuilder._submenuParentClicked),e("body").delegate(".fl-builder-has-submenu a","click",FLBuilder._submenuChildClicked),e("body").delegate(".fl-builder-submenu","mouseenter",FLBuilder._submenuMouseenter),e("body").delegate(".fl-builder-submenu","mouseleave",FLBuilder._submenuMouseleave),e("body").delegate(".fl-builder-submenu .fl-builder-has-submenu","mouseenter",FLBuilder._submenuNestedParentMouseenter),e(".fl-builder-tools-button").on("click",FLBuilder._toolsClicked),e(".fl-builder-done-button").on("click",FLBuilder._doneClicked),e(".fl-builder-add-content-button").on("click",FLBuilder._showPanel),e(".fl-builder-templates-button").on("click",FLBuilder._changeTemplateClicked),e(".fl-builder-buy-button").on("click",FLBuilder._upgradeClicked),e(".fl-builder-upgrade-button").on("click",FLBuilder._upgradeClicked),e(".fl-builder-help-button").on("click",FLBuilder._helpButtonClicked),e(".fl-builder-panel-actions .fl-builder-panel-close").on("click",FLBuilder._closePanel),e(".fl-builder-blocks-section-title").on("click",FLBuilder._blockSectionTitleClicked),e("body").delegate(".fl-builder-node-template-actions","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-delete","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","click",FLBuilder._editNodeTemplateClicked),e("body").delegate(".fl-builder-node-template-delete","click",FLBuilder._deleteNodeTemplateClicked),e("body").delegate(".fl-builder-block","mousedown",FLBuilder._blockDragInit),e("body").on("mouseup",FLBuilder._blockDragCancel),e("body").delegate(".fl-builder-actions .fl-builder-cancel-button","click",FLBuilder._cancelButtonClicked),e("body").delegate(".fl-lightbox-controls .fa","click",FLBuilder._resizeLightbox),e("body").delegate(".fl-builder-save-actions .fl-builder-publish-button","click",FLBuilder._publishButtonClicked),e("body").delegate(".fl-builder-save-actions .fl-builder-draft-button","click",FLBuilder._draftButtonClicked),e("body").delegate(".fl-builder-save-actions .fl-builder-discard-button","click",FLBuilder._discardButtonClicked),e("body").delegate(".fl-builder-save-user-template-button","click",FLBuilder._saveUserTemplateClicked),e("body").delegate(".fl-builder-duplicate-layout-button","click",FLBuilder._duplicateLayoutClicked),e("body").delegate(".fl-builder-layout-settings-button","click",FLBuilder._layoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-save","click",FLBuilder._saveLayoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-builder-global-settings-button","click",FLBuilder._globalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-save","click",FLBuilder._saveGlobalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-template-category-select","change",FLBuilder._templateCategoryChanged),e("body").delegate(".fl-template-preview","click",FLBuilder._templateClicked),e("body").delegate(".fl-user-template","click",FLBuilder._userTemplateClicked),e("body").delegate(".fl-user-template-edit","click",FLBuilder._editUserTemplateClicked),e("body").delegate(".fl-user-template-delete","click",FLBuilder._deleteUserTemplateClicked),e("body").delegate(".fl-builder-template-replace-button","click",FLBuilder._templateReplaceClicked),e("body").delegate(".fl-builder-template-append-button","click",FLBuilder._templateAppendClicked),e("body").delegate(".fl-builder-template-actions .fl-builder-cancel-button","click",FLBuilder._templateCancelClicked),e("body").delegate(".fl-builder-user-template-settings .fl-builder-settings-save","click",FLBuilder._saveUserTemplateSettings),e("body").delegate(".fl-builder-help-tour-button","click",FLBuilder._startHelpTour),e("body").delegate(".fl-builder-help-video-button","click",FLBuilder._watchVideoClicked),e("body").delegate(".fl-builder-knowledge-base-button","click",FLBuilder._viewKnowledgeBaseClicked),e("body").delegate(".fl-builder-forums-button","click",FLBuilder._visitForumsClicked),e("body").delegate(".fl-builder-no-tour-button","click",FLBuilder._noTourButtonClicked),e("body").delegate(".fl-builder-yes-tour-button","click",FLBuilder._yesTourButtonClicked),e("body").delegate(".fl-builder-alert-close","click",FLBuilder._alertClose),e("body").delegate(".fl-row-overlay .fl-block-remove","click",FLBuilder._deleteRowClicked),e("body").delegate(".fl-row-overlay .fl-block-copy","click",FLBuilder._rowCopyClicked),e("body").delegate(".fl-row-overlay .fl-block-move","mousedown",FLBuilder._rowDragInit),e("body").delegate(".fl-row-overlay .fl-block-settings","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-row-overlay","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-builder-row-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-col-overlay .fl-block-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-col-overlay .fl-block-remove","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-col-overlay","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-col-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-col-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-delete","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-reset","click",FLBuilder._resetColumnWidthsClicked),e("body").delegate(".fl-block-col-submenu li","mouseenter",FLBuilder._showColHighlightGuide),e("body").delegate(".fl-block-col-submenu li","mouseleave",FLBuilder._removeColHighlightGuides),e("body").delegate(".fl-block-col-submenu .fl-block-col-move-parent","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit-parent","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-module-overlay .fl-block-remove","click",FLBuilder._deleteModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-copy","click",FLBuilder._moduleCopyClicked),e("body").delegate(".fl-module-overlay .fl-block-move","mousedown",FLBuilder._blockDragInit),e("body").delegate(".fl-module-overlay .fl-block-settings","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-module-overlay","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-builder-module-settings .fl-builder-settings-save","click",FLBuilder._saveModuleClicked),e("body").delegate(".fl-builder-settings-save-as","click",FLBuilder._showNodeTemplateSettings),e("body").delegate(".fl-builder-node-template-settings .fl-builder-settings-save","click",FLBuilder._saveNodeTemplate),e("body").delegate(".fl-builder-settings-tabs a","click",FLBuilder._settingsTabClicked),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked),e("body").delegate(".fl-help-tooltip-icon","mouseover",FLBuilder._showHelpTooltip),e("body").delegate(".fl-help-tooltip-icon","mouseout",FLBuilder._hideHelpTooltip),e("body").delegate(".fl-builder-field-add","click",FLBuilder._addFieldClicked),e("body").delegate(".fl-builder-field-copy","click",FLBuilder._copyFieldClicked),e("body").delegate(".fl-builder-field-delete","click",FLBuilder._deleteFieldClicked),e("body").delegate(".fl-builder-settings-fields select","change",FLBuilder._settingsSelectChanged),e("body").delegate(".fl-photo-field .fl-photo-select","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-edit","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-replace","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-remove","click",FLBuilder._singlePhotoRemoved),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-select","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-edit","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-add","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-video-field .fl-video-select","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-replace","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-select","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-edit","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-add","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-icon-field .fl-icon-select","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-replace","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-remove","click",FLBuilder._removeIcon),e("body").delegate(".fl-form-field .fl-form-field-edit","click",FLBuilder._formFieldClicked),e("body").delegate(".fl-form-field-settings .fl-builder-settings-save","click",FLBuilder._saveFormFieldClicked),e("body").delegate(".fl-layout-field-option","click",FLBuilder._layoutFieldClicked),e("body").delegate(".fl-link-field-select","click",FLBuilder._linkFieldSelectClicked),e("body").delegate(".fl-link-field-search-cancel","click",FLBuilder._linkFieldSelectCancelClicked),e("body").delegate(".fl-loop-builder select[name=post_type]","change",FLBuilder._loopBuilderPostTypeChange),e("body").delegate(".fl-select-add-value","change",FLBuilder._textFieldAddValueSelectChange)},_bindOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.delegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.delegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.delegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.delegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.delegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_destroyOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.undelegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.undelegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.undelegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.undelegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.undelegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()},_headerLinkClicked:function(t){var l=e(this),i=l.attr("href");t.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=i.indexOf("?")>-1?i:i+"?fl_builder",FLBuilder._doneClicked())},_warnBeforeUnload:function(){var t=e(".fl-builder-row-settings").length>0,l=e(".fl-builder-col-settings").length>0,i=e(".fl-builder-module-settings").length>0;if(t||l||i)return FLBuilderStrings.unloadWarning},_initTipTips:function(){e(".fl-tip:not(.fl-has-tip)").each(function(){var t=e(this);t.addClass("fl-has-tip"),void 0==t.attr("data-title")&&t.attr("data-title",t.attr("title"))}).tipTip({defaultPosition:"top",delay:1500})},_hideTipTips:function(){e("#tiptip_holder").stop().remove()},_submenuParentClicked:function(t){var l=e(this),i=l.find(".fl-builder-submenu");l.hasClass("fl-builder-submenu-open")?(l.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-right")):(l.offset().left+i.width()>e(window).width()&&l.addClass("fl-builder-submenu-right"),l.addClass("fl-builder-submenu-open")),FLBuilder._hideTipTips(),t.preventDefault(),t.stopPropagation()},_submenuChildClicked:function(t){var l=e(this).parents(".fl-builder-has-submenu");l.parents(".fl-builder-has-submenu").length||l.removeClass("fl-builder-submenu-open")},_submenuMouseenter:function(t){var l=e(this),i=l.data("timeout");"undefined"!=typeof i&&clearTimeout(i)},_submenuMouseleave:function(t){var l=e(this),i=setTimeout(function(){l.closest(".fl-builder-has-submenu").removeClass("fl-builder-submenu-open")},500);l.data("timeout",i)},_submenuNestedParentMouseenter:function(t){var l=e(this),i=l.find(".fl-builder-submenu");l.width()+l.offset().left+i.width()>e(window).width()&&l.addClass("fl-builder-submenu-right")},_closeAllSubmenus:function(){e(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_toolsClicked:function(){var e=[],t=FLBuilderConfig.lite,l=FLBuilderConfig.enabledTemplates;t||FLBuilderConfig.isUserTemplate||"enabled"!=l&&"user"!=l||(e[10]={key:"save-user-template",label:FLBuilderStrings.saveTemplate}),FLBuilderConfig.isUserTemplate?"undefined"!=typeof window.opener&&window.opener||(e[20]={key:"duplicate-layout",label:FLBuilderStrings.duplicateLayout}):e[20]={key:"duplicate-layout",label:FLBuilderStrings.duplicateLayout},e[30]={key:"layout-settings",label:FLBuilderStrings.editLayoutSettings},e[40]={key:"global-settings",label:FLBuilderStrings.editGlobalSettings},FLBuilder._showActionsLightbox({className:"fl-builder-tools-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_doneClicked:function(){var e=[],t=FLBuilderStrings.publish;"publish"==FLBuilderConfig.postStatus||FLBuilderConfig.userCanPublish||(t=FLBuilderStrings.submitForReview),e[10]={key:"publish",label:t},e[20]={key:"draft",label:FLBuilderStrings.draft},e[30]={key:"discard",label:FLBuilderStrings.discard},FLBuilder._showActionsLightbox({className:"fl-builder-save-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_helpButtonClicked:function(){var e={};FLBuilderConfig.help.tour&&(e[10]={key:"help-tour",label:FLBuilderStrings.takeHelpTour}),FLBuilderConfig.help.video&&(e[20]={key:"help-video",label:FLBuilderStrings.watchHelpVideo}),FLBuilderConfig.help.knowledge_base&&(e[30]={key:"knowledge-base",label:FLBuilderStrings.viewKnowledgeBase}),FLBuilderConfig.help.forums&&(e[40]={key:"forums",label:FLBuilderStrings.visitForums}),FLBuilder._showActionsLightbox({className:"fl-builder-help-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_closePanel:function(){e(".fl-builder-panel").stop(!0,!0).animate({right:"-350px"},500,function(){e(this).hide()}),e(".fl-builder-bar .fl-builder-add-content-button").stop(!0,!0).fadeIn()},_showPanel:function(){e(".fl-builder-bar .fl-builder-add-content-button").stop(!0,!0).fadeOut(),e(".fl-builder-panel").stop(!0,!0).show().animate({right:"0"},500)},_blockSectionTitleClicked:function(){var t=e(this),l=t.parent();l.hasClass("fl-active")?l.removeClass("fl-active"):(e(".fl-builder-blocks-section").removeClass("fl-active"),l.addClass("fl-active")),FLBuilder._initScrollbars()},_publishButtonClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_layout"},FLBuilder._exit),FLBuilder._actionsLightbox.close()},_draftButtonClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_draft"},FLBuilder._exit),FLBuilder._actionsLightbox.close()},_discardButtonClicked:function(){var e=confirm(FLBuilderStrings.discardMessage);e&&(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"clear_draft_layout"},FLBuilder._exit),FLBuilder._actionsLightbox.close())},_cancelButtonClicked:function(){FLBuilder._exitUrl=null,FLBuilder._actionsLightbox.close()},_exit:function(){var e=window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&window.opener.FLBuilder._updateLayout(),window.close()):(FLBuilder._exitUrl?e=FLBuilder._exitUrl:(e=e.replace("?fl_builder&","?"),e=e.replace("?fl_builder",""),e=e.replace("&fl_builder","")),window.location.href=e)},_duplicateLayoutClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"duplicate_post"},FLBuilder._duplicateLayoutComplete)},_duplicateLayoutComplete:function(t){var l=e("#fl-admin-url").val();window.location.href=l+"post.php?post="+t+"&action=edit"},_layoutSettingsClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._showLightbox(),FLBuilder._closePanel(),FLBuilder.ajax({action:"render_layout_settings"},FLBuilder._layoutSettingsLoaded)},_layoutSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._setSettingsFormContent(t.html),FLBuilder._layoutSettingsInitCSS()},_layoutSettingsInitCSS:function(){var t=e(".fl-builder-settings #fl-field-css textarea:not(.ace_text-input)");t.on("change",FLBuilder._layoutSettingsCSSChanged),FLBuilder._layoutSettingsCSSCache=t.val()},_layoutSettingsCSSChanged:function(){FLBuilder._layoutSettingsCSSTimeout&&clearTimeout(FLBuilder._layoutSettingsCSSTimeout),FLBuilder._layoutSettingsCSSTimeout=setTimeout(e.proxy(FLBuilder._layoutSettingsCSSDoChange,this),600)},_layoutSettingsCSSDoChange:function(){var t=e(".fl-builder-settings"),l=e(this),i=l.parents("#fl-field-css");i.find(".ace_error").length>0||(t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(l.val()):e("#fl-builder-global-css").html(l.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var t=e(this).closest(".fl-builder-settings"),l=t.serializeArray(),i={},o=0;o<l.length;o++)i[l[o].name]=l[o].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_layout_settings",settings:i},FLBuilder._updateLayout)},_cancelLayoutSettingsClicked:function(){var t=e(".fl-builder-settings");t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(FLBuilder._layoutSettingsCSSCache):e("#fl-builder-global-css").html(FLBuilder._layoutSettingsCSSCache),FLBuilder._layoutSettingsCSSCache=null},_globalSettingsClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_global_settings"},FLBuilder._globalSettingsLoaded)},_globalSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._setSettingsFormContent(t.html),FLBuilder._layoutSettingsInitCSS(),FLBuilder._initSettingsValidation({row_width:{required:!0,number:!0},responsive_breakpoint:{required:!0,number:!0}})},_saveGlobalSettingsClicked:function(){var t=e(this).closest(".fl-builder-settings"),l=t.validate().form(),i=t.serializeArray(),o={},s=0;if(l){for(;s<i.length;s++)o[i[s].name]=i[s].value;FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_global_settings",settings:o},FLBuilder._saveGlobalSettingsComplete),FLBuilder._lightbox.close()}},_saveGlobalSettingsComplete:function(e){FLBuilderConfig.global=JSON.parse(e),FLBuilder._updateLayout()},_initTemplateSelector:function(){var t=e(FLBuilder._contentClass).find(".fl-row");0===t.length&&FLBuilder._showTemplateSelector()},_changeTemplateClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._showTemplateSelector()},_showTemplateSelector:function(){FLBuilderConfig.simpleUi||FLBuilderConfig.isUserTemplate||"disabled"!=FLBuilderConfig.enabledTemplates&&0!==e(".fl-builder-templates-button").length&&(FLBuilder._showLightbox(!1),FLBuilder.ajax({action:"render_template_selector"},FLBuilder._templateSelectorLoaded))},_templateSelectorLoaded:function(t){var l=JSON.parse(t),i=null,o=null;FLBuilder._setLightboxContent(l.html),i=e(".fl-template-category-select"),tabs=e(".fl-builder-settings-tab"),userTemplatesTab=e("#fl-builder-settings-tab-yours"),o=e(".fl-user-template"),("user"==FLBuilderConfig.enabledTemplates||o.length>0||userTemplatesTab.length>0&&1==tabs.length)&&(i.val("fl-builder-settings-tab-yours"),e(".fl-builder-settings-tab").removeClass("fl-active"),e("#fl-builder-settings-tab-yours").addClass("fl-active")),0===o.length&&e(".fl-user-templates-message").show(),e("body").trigger("fl-builder.template-selector-loaded")},_templateCategoryChanged:function(){e(".fl-template-selector .fl-builder-settings-tab").hide(),e("#"+e(this).val()).show()},_templateClicked:function(){var t=e(this),l=t.closest(".fl-template-preview").attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?0==l?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate(0,!1,"core")):(FLBuilder._selectedTemplateId=l,FLBuilder._selectedTemplateType="core",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(l,!1,"core")},_showTemplateActions:function(){var e=[];e[10]={key:"template-replace",label:FLBuilderStrings.templateReplace},e[20]={key:"template-append",label:FLBuilderStrings.templateAppend},FLBuilder._showActionsLightbox({className:"fl-builder-template-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_templateReplaceClicked:function(){confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!1,FLBuilder._selectedTemplateType))},_templateAppendClicked:function(){
2
+ FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!0,FLBuilder._selectedTemplateType)},_templateCancelClicked:function(){FLBuilder._lightbox._node.show()},_applyTemplate:function(e,t,l){t="undefined"!=typeof t&&t?"1":"0",l="undefined"==typeof l?"core":l,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader(),"core"==l?FLBuilder.ajax({action:"apply_template",template_id:e,append:t},FLBuilder._updateLayout):FLBuilder.ajax({action:"apply_user_template",template_id:e,append:t},FLBuilder._updateTemplateLayout)},_updateTemplateLayout:function(t){var l=JSON.parse(t);null!==l&&e("#fl-builder-layout-css").html(l.layout_css),FLBuilder._updateLayout()},_saveUserTemplateClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._showLightbox(!1),FLBuilder.ajax({action:"render_user_template_settings"},FLBuilder._userTemplateSettingsLoaded)},_userTemplateSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._setSettingsFormContent(t.html),FLBuilder._initSettingsValidation({name:{required:!0}})},_saveUserTemplateSettings:function(){var t=e(this).closest(".fl-builder-settings"),l=t.validate().form(),i=FLBuilder._getSettings(t);l&&(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_user_template",settings:i},FLBuilder._saveUserTemplateSettingsComplete),FLBuilder._lightbox.close())},_saveUserTemplateSettingsComplete:function(){FLBuilder.alert(FLBuilderStrings.templateSaved)},_userTemplateClicked:function(){var t=e(this).attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?"blank"==t?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate("blank",!1,"user")):(FLBuilder._selectedTemplateId=t,FLBuilder._selectedTemplateType="user",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(t,!1,"user")},_editUserTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteUserTemplateClicked:function(t){var l=e(this).closest(".fl-user-template"),i=l.attr("data-id"),o=e(".fl-user-template[data-id="+i+"]"),s=null;confirm(FLBuilderStrings.deleteTemplate)&&(FLBuilder.ajax({action:"delete_user_template",template_id:i}),o.fadeOut(function(){l=e(this),s=l.closest(".fl-user-template-category"),l.remove(),0===s.find(".fl-user-template").length&&s.remove(),1===e(".fl-user-template").length&&(e(".fl-user-templates").hide(),e(".fl-user-templates-message").show())})),t.stopPropagation()},_watchVideoClicked:function(){var e=wp.template("fl-video-lightbox");FLBuilder._actionsLightbox.close(),FLBuilder._lightbox.open(e({video:FLBuilderConfig.help.video_embed}))},_viewKnowledgeBaseClicked:function(){FLBuilder._actionsLightbox.close(),window.open(FLBuilderConfig.help.knowledge_base_url)},_visitForumsClicked:function(){FLBuilder._actionsLightbox.close(),window.open(FLBuilderConfig.help.forums_url)},_showTourOrTemplates:function(){FLBuilderConfig.simpleUi||FLBuilderConfig.isUserTemplate||(FLBuilderConfig.help.tour&&FLBuilderConfig.newUser?FLBuilder._showTourLightbox():FLBuilder._initTemplateSelector())},_showTourLightbox:function(){var e=wp.template("fl-tour-lightbox");FLBuilder._actionsLightbox.open(e())},_noTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._initTemplateSelector()},_yesTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_startHelpTour:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_setupEmptyLayout:function(){var t=e(FLBuilder._contentClass);FLBuilderConfig.isUserTemplate&&"module"==FLBuilderConfig.userTemplateType||(t.removeClass("fl-builder-empty"),t.find(".fl-builder-empty-message").remove(),0===t.children(".fl-row").length&&(t.addClass("fl-builder-empty"),t.append('<span class="fl-builder-empty-message">'+FLBuilderStrings.emptyMessage+"</span>"),FLBuilder._initSortables()))},_updateLayout:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_layout"},FLBuilder._renderLayout)},_renderLayout:function(e,t){FLBuilder._layout=new FLBuilderAJAXLayout(e,t)},_renderLayoutComplete:function(){FLBuilder._layout&&(FLBuilder._layout._complete(),FLBuilder._layout=null)},_resizeLayout:function(){e(window).trigger("resize"),"undefined"!=typeof YUI&&YUI().use("node-event-simulate",function(e){e.one(window).simulate("resize")})},_initMediaElements:function(){var t={};"undefined"!=typeof e.fn.mediaelementplayer&&("undefined"!=typeof _wpmejsSettings&&(t.pluginPath=_wpmejsSettings.pluginPath),e(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").mediaelementplayer(t))},_initDropTargets:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=e(FLBuilder._contentClass+" .fl-row"),i=null,o=e(FLBuilder._contentClass+" .fl-row"+t).find(".fl-col-group"),s=null,r=null,n=0;for(e(".fl-col-drop-target").remove(),e(".fl-col-group-drop-target").remove(),e(".fl-row-drop-target").remove(),e(FLBuilder._contentClass).append('<div class="fl-drop-target fl-row-drop-target"></div>'),l.prepend('<div class="fl-drop-target fl-row-drop-target"></div>'),l.append('<div class="fl-drop-target fl-drop-target-last fl-row-drop-target fl-row-drop-target-last"></div>');n<l.length;n++)i=l.eq(n),0===i.find(".fl-col-group").length&&i.find(".fl-row-content").append('<div class="fl-drop-target fl-col-group-drop-target"></div>');for(n=0;n<o.length;n++)s=o.eq(n),r=s.find("> .fl-col"),s.hasClass("fl-col-group-nested")||(s.append('<div class="fl-drop-target fl-col-group-drop-target"></div>'),s.append('<div class="fl-drop-target fl-drop-target-last fl-col-group-drop-target fl-col-group-drop-target-last"></div>')),r.append('<div class="fl-drop-target fl-col-drop-target"></div>'),r.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')},_blockDragHelper:function(e,t){var l=t.clone();return t.clone().insertAfter(t),l.addClass("fl-builder-block-drag-helper"),l},_blockDragInit:function(t){var l=e(t.currentTarget),i=null,o=e(window).scrollTop(),s=0;FLBuilder._dragEnabled=!0,FLBuilder._dragInitialScrollTop=o,l.closest("[data-node]").length>0?(i=l.closest("[data-node]"),i.addClass("fl-node-drag-init")):l.hasClass("fl-builder-block")&&e(".fl-row").each(function(){null===i&&e(this).offset().top-o>0&&(i=e(this))}),null!==i&&(s=i.offset().top-o),FLBuilder._highlightRowsAndColsForDrag(l),FLBuilder._adjustColHeightsForDrag(),FLBuilder._disableGlobalRows(),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays(),FLBuilder._initSortables(),e("body").addClass("fl-builder-dragging"),e(".fl-builder-empty-message").hide(),e(".fl-sortable-disabled").removeClass("fl-sortable-disabled"),s>0&&scrollTo(0,i.offset().top-s)},_blockDragStart:function(t,l){FLBuilder._dragging=!0,e(".fl-node-drag-init").removeClass("fl-node-drag-init")},_blockDragSort:function(t,l){var i=l.placeholder.parent(),o=FLBuilderStrings.insert;FLBuilder._blockPreventSort(l.item,i)||(i.hasClass("fl-col-content")?o=l.item.hasClass("fl-builder-block-row")?l.item.find(".fl-builder-block-title").text():l.item.hasClass("fl-col-sortable-proxy-item")?FLBuilderStrings.column:l.item.hasClass("fl-builder-block-module")?l.item.find(".fl-builder-block-title").text():l.item.hasClass("fl-builder-block-saved-module")||l.item.hasClass("fl-builder-block-module-template")?l.item.find(".fl-builder-block-title").text():l.item.attr("data-name"):i.hasClass("fl-col-drop-target")?o="":i.hasClass("fl-col-group-drop-target")?o="":i.hasClass("fl-row-drop-target")&&(o=l.item.hasClass("fl-builder-block-row")?l.item.find(".fl-builder-block-title").text():l.item.hasClass("fl-builder-block-saved-row")?l.item.find(".fl-builder-block-title").text():l.item.hasClass("fl-row-sortable-proxy-item")?FLBuilderStrings.row:FLBuilderStrings.newRow),l.placeholder.html(o),l.item.hasClass("fl-node-global")||l.item.hasClass("fl-builder-block-global")||e(".fl-node-dragging").hasClass("fl-node-global")?l.placeholder.addClass("fl-builder-drop-zone-global"):l.placeholder.removeClass("fl-builder-drop-zone-global"))},_blockDragChange:function(e,t){t.placeholder.hide(),t.placeholder.fadeIn(100)},_blockPreventSort:function(t,l){var i=!1,o=t.hasClass("fl-builder-block-row"),s=t.hasClass("fl-col-sortable-proxy-item"),r=l.hasClass("fl-col-content"),n=l.hasClass("fl-col-drop-target"),a=l.parents(".fl-col-group:not(.fl-col-group-nested)"),d=l.parents(".fl-col-group-nested");return(o||s)&&r&&d.length>0&&(i=!0),r&&!l.find(".fl-module, .fl-col").length&&(o&&"1-col"==t.data("cols")?i=!0:s&&(i=!0)),o&&r&&e.inArray(t.data("cols"),["5-cols","6-cols"])>-1&&(i=!0),s&&e(".fl-node-dragging").find(".fl-col-group-nested").length>0&&(r||n&&d.length>0)&&(i=!0),n&&a.length>0&&0===d.length&&a.find("> .fl-col:visible").length>11&&(i=!0),n&&d.length>0&&d.find(".fl-col:visible").length>3&&(i=!0),i&&l.addClass("fl-sortable-disabled"),i},_blockDragStop:function(t,l){var i=e(window).scrollTop(),o=l.item.parent(),s=null;o.hasClass("fl-drop-target")&&o.closest("[data-node]").length?(o=o.closest("[data-node]"),s=o.offset().top-i):s=o.offset().top-i,o.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),scrollTo(0,o.offset().top-s)},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),e(".fl-node-drag-init").removeClass("fl-node-drag-init"),e(".fl-node-dragging").removeClass("fl-node-dragging"),scrollTo(0,FLBuilder._dragInitialScrollTop))},_reorderNode:function(e,t){FLBuilder.ajax({action:"reorder_node",node_id:e,position:t,silent:!0})},_moveNode:function(e,t,l){FLBuilder.ajax({action:"move_node",new_parent:e,node_id:t,position:l,silent:!0})},_removeAllOverlays:function(){FLBuilder._removeRowOverlays(),FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._removeModuleOverlays(),FLBuilder._hideTipTips()},_appendOverlay:function(e,t){var l=0,i=null,o=e.hasClass("fl-row"),s=o?e.find("> .fl-row-content-wrap"):e.find("> .fl-node-content"),r={top:parseInt(s.css("margin-top"),10),bottom:parseInt(s.css("margin-bottom"),10)};return e.append(t),e.addClass("fl-block-overlay-active"),FLBuilder._initTipTips(),i=e.find("> .fl-block-overlay"),r.top<0&&(l=parseInt(i.css("top"),10),l=isNaN(l)?0:l,i.css("top",r.top+l+"px")),r.bottom<0&&(l=parseInt(i.css("bottom"),10),l=isNaN(l)?0:l,i.css("bottom",r.bottom+l+"px")),i},_buildOverlayOverflowMenu:function(e){var t=e.find(".fl-block-overlay-actions"),l=t.data("original"),i=0,o=null,s=0,r=null,n=0,a=[],d=[],u=[],c=wp.template("fl-overlay-overflow-menu");for(void 0!=l&&(t.after(l),t.remove(),t=l),t.data("original",t.clone()),i=t[0].getBoundingClientRect().width,o=t.find(" > i, > span.fl-builder-has-submenu");n<o.length;n++)r=o.eq(n),s+=r.outerWidth(),s>i?(d.push(r),r.remove()):a.push(r);if(d.length>0){for(d.unshift(a.pop().remove()),n=0;n<d.length;n++)d[n].is(".fl-builder-has-submenu")?u.push({type:"submenu",label:d[n].find(".fa").data("title"),submenu:d[n].find(".fl-builder-submenu")[0].outerHTML}):u.push({type:"action",label:d[n].data("title"),className:d[n].removeClass(function(e,t){return t.replace(/fl-block-([^\s]+)/,"")}).attr("class")});t.append(c(u)),FLBuilder._initTipTips()}},_removeRowOverlays:function(){e(".fl-row").removeClass("fl-block-overlay-active"),e(".fl-row-overlay").remove(),e(".fl-module").removeClass("fl-module-adjust-height")},_disableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-row.fl-node-global").addClass("fl-node-disabled")},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_rowMouseenter:function(){var t=e(this),l=t.offset().top,i=null,o=null,s=wp.template("fl-row-overlay");t.hasClass("fl-block-overlay-active")||(o=FLBuilder._appendOverlay(t,s({global:t.hasClass("fl-node-global"),node:t.attr("data-node")})),t.find(".fl-node-content:visible").each(function(){var t=e(this).offset().top;i=null===i||i>t?t:i}),null!==i&&i<l&&o.css("top",i-l-30+"px"),o.offset().top<43&&o.addClass("fl-row-overlay-header-bottom"),t.find(".fl-module").each(function(){var t=e(this);t.outerHeight(!0)<20&&t.addClass("fl-module-adjust-height")}))},_rowMouseleave:function(t){var l=e(t.toElement)||e(t.relatedTarget),i=l.hasClass("fl-row-overlay"),o=l.closest(".fl-row-overlay").length>0,s=l.is("#tiptip_holder"),r=l.closest("#tiptip_holder").length>0;i||o||s||r||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.row+"</div>")},_rowDragInit:function(t){var l=e(t.target),i=e(".fl-row-sortable-proxy-item"),o=l.closest(".fl-row");o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),t.target=i[0],i.trigger(t)},_rowDragStart:function(t,l){var i=e(FLBuilder._contentClass+" .fl-row"),o=e(".fl-node-dragging");1===i.length&&e(FLBuilder._contentClass).addClass("fl-builder-empty"),o.hide(),FLBuilder._blockDragStart(t,l)},_rowDragStop:function(t,l){var i=l.item,o=i.parent(),s=null,r=null,n=0;if(FLBuilder._blockDragStop(t,l),o.hasClass("fl-builder-rows"))return void i.remove();if(o.hasClass("fl-row-sortable-proxy"))return void e(".fl-node-dragging").removeClass("fl-node-dragging").show();if(i.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();o.hasClass("fl-col-content")?FLBuilder._addColGroup(i.closest(".fl-col").attr("data-node"),i.attr("data-cols"),o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(i)):o.hasClass("fl-col-drop-target")?FLBuilder._addCols(o.closest(".fl-col"),o.hasClass("fl-col-drop-target-last")?"after":"before",i.attr("data-cols"),o.closest(".fl-col-group-nested").length>0):o.hasClass("fl-col-group-drop-target")?(r=i.closest(".fl-col-group"),n=i.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(r),FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),i.attr("data-cols"),o.hasClass("fl-drop-target-last")?n+1:n)):(s=i.closest(".fl-row"),n=s.length?e(FLBuilder._contentClass+" .fl-row").index(s):0,FLBuilder._addRow(i.attr("data-cols"),o.hasClass("fl-drop-target-last")?n+1:n)),i.remove(),FLBuilder._showPanel(),e(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")}else s=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o.parent().hasClass("fl-builder-content")||(o.hasClass("fl-drop-target-last")?o.parent().after(s):o.parent().before(s),FLBuilder._reorderNode(s.attr("data-node"),s.index())),e(".fl-row-sortable-proxy").append(l.item)},_addRow:function(e,t){FLBuilder.showAjaxLoader(),FLBuilder._newRowPosition=t,FLBuilder.ajax({action:"render_new_row",cols:e,position:t},FLBuilder._addRowComplete)},_addRowComplete:function(t){var l=JSON.parse(t),i=e(FLBuilder._contentClass),o=e(l.html).data("node"),s=FLBuilder._addModuleAfterNodeRender;l.nodeParent=i,l.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(l,function(){null!==s&&(e(".fl-node-"+o+" .fl-col-content").append(s),FLBuilder._reorderModule(s),FLBuilder._addModuleAfterNodeRender=null)})},_deleteRowClicked:function(t){var l=e(this).closest(".fl-row"),i=null;l.find(".fl-module").length?(i=confirm(FLBuilderStrings.deleteRowMessage),i&&FLBuilder._deleteRow(l)):FLBuilder._deleteRow(l),FLBuilder._removeAllOverlays(),t.stopPropagation()},_deleteRow:function(e){FLBuilder.ajax({action:"delete_node",node_id:e.attr("data-node"),silent:!0}),e.empty(),e.remove(),FLBuilder._setupEmptyLayout(),FLBuilder._removeRowOverlays()},_rowCopyClicked:function(t){var l=e(this).closest(".fl-row"),i=l.attr("data-node");FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder._newRowPosition=l.index(".fl-row")+1,FLBuilder.ajax({action:"copy_row",node_id:i},FLBuilder._rowCopyComplete),t.stopPropagation()},_rowCopyComplete:function(t){var l=JSON.parse(t);l.nodeParent=e(FLBuilder._contentClass),l.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(l)},_rowSettingsClicked:function(t){var l=e(this),i=l.closest(".fl-row").attr("data-node"),o=l.closest(".fl-block-overlay-global").length>0;o&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&window.open(e('.fl-row[data-node="'+i+'"]').attr("data-template-url")):l.hasClass("fl-block-settings")&&(FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_row_settings",node_id:i},FLBuilder._rowSettingsLoaded)),t.stopPropagation()},_rowSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._setSettingsFormContent(t.settings),FLBuilder.preview=new FLBuilderPreview({type:"row",state:t.state})},_highlightEmptyCols:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=(e(FLBuilder._contentClass+" .fl-row"+t),e(FLBuilder._contentClass+" .fl-col"+t));e(".fl-row-highlight").removeClass("fl-row-highlight"),l.removeClass("fl-col-highlight").find(".fl-col-content").css("height",""),l.each(function(){var t=e(this);0===t.find(".fl-module, .fl-col").length&&t.addClass("fl-col-highlight")})},_highlightRowsAndColsForDrag:function(t){var l="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";e(FLBuilder._contentClass+" .fl-row").addClass("fl-row-highlight"),t.closest(".fl-row-overlay").length||e(FLBuilder._contentClass+" .fl-col"+l).addClass("fl-col-highlight")},_adjustColHeightsForDrag:function(){var t="row"==FLBuilderConfig.userTemplateType?"":".fl-row:not(.fl-node-global) ",l=e(FLBuilder._contentClass),i=l.find(t+".fl-col-group:not(.fl-col-group-nested) > .fl-col > .fl-col-content"),o=l.find(t+".fl-col-group-nested .fl-col-content"),s=0;for(e(".fl-node-drag-init").hide();s<o.length;s++)FLBuilder._adjustColHeightForDrag(o.eq(s));for(s=0;s<i.length;s++)FLBuilder._adjustColHeightForDrag(i.eq(s));e(".fl-node-drag-init").show()},_adjustColHeightForDrag:function(e){e.find(".fl-module:visible, .fl-col:visible").length&&e.height(e.height()+45)},_showColHighlightGuide:function(){var t=e(this),l=t.find("a"),i=t.closest(".fl-col"),o=i.parents(".fl-col"),s=e('<div class="fl-col-highlight-guide"></div>'),r=null,n=t.closest(".fl-block-overlay").offset().top;(l.hasClass("fl-block-col-move-parent")||l.hasClass("fl-block-col-edit-parent"))&&(i=o),i.hasClass("fl-col-highlight")||(i.find("> .fl-col-content").append(s),i.addClass("fl-col-has-highlight-guide"),r=s.offset().top,r>n&&s.css("top",n-r+4+"px"))},_removeColHighlightGuides:function(){e(".fl-col-has-highlight-guide").removeClass("fl-col-has-highlight-guide"),e(".fl-col-highlight-guide").remove()},_colMouseenter:function(){var t=e(this),l=t.closest(".fl-col-group"),i=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.closest(".fl-col-group").find("> .fl-col").length,r=l.find("> .fl-col").index(t),n=0===r,a=s===r+1,d=t.find(".fl-col").length>0,u=t.parents(".fl-col"),c=u.closest(".fl-col-group"),f=u.length>0,h=f?c.find("> .fl-col").length:0,p=c.find("> .fl-col").index(u),g=!!f&&0===p,_=!!f&&h===p+1,m=t.find("> .fl-col-content").width(),b=wp.template("fl-col-overlay"),v=null;FLBuilderConfig.simpleUi||i&&o&&"row"!=FLBuilderConfig.userTemplateType||t.find(".fl-module").length>0||t.find(".fl-col").length>0||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),v=FLBuilder._appendOverlay(t,b({global:i,numCols:s,first:n,last:a,hasChildCols:d,hasParentCol:f,parentFirst:g,parentLast:_,numParentCols:h,contentWidth:m})),FLBuilder._buildOverlayOverflowMenu(v),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(t){var l=e(this),i=e(t.toElement)||e(t.relatedTarget),o=l.find(".fl-module").length>0,s=i.is("#tiptip_holder"),r=i.closest("#tiptip_holder").length>0;s||r||o||(FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides())},_removeColOverlays:function(){var t=e(".fl-col");t.removeClass("fl-block-overlay-active"),t.find(".fl-col-overlay").remove(),e("body").removeClass("fl-block-overlay-muted")},_colDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.column+"</div>")},_colDragInit:function(t){var l=e(t.target),i=e(".fl-col-sortable-proxy-item"),o=l.closest(".fl-col");l.hasClass("fl-block-col-move-parent")&&(o=o.parents(".fl-col")),o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),FLBuilder._removeColHighlightGuides(),t.target=i[0],i.trigger(t)},_colDragStart:function(t,l){var i=e(".fl-node-dragging");i.hide(),FLBuilder._resetColumnWidths(i.parent()),FLBuilder._blockDragStart(t,l)},_colDragStop:function(t,l){FLBuilder._blockDragStop(t,l);var i=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o=i.attr("data-node"),s=l.item.parent(),r=i.parent(),n=r.attr("data-node");newGroup=s.closest(".fl-col-group"),newGroupId=newGroup.attr("data-node"),newRow=s.closest(".fl-row"),position=0,s.hasClass("fl-sortable-disabled")?FLBuilder._resetColumnWidths(r):s.hasClass("fl-col-sortable-proxy")?FLBuilder._resetColumnWidths(r):s.hasClass("fl-col-content")?(i.remove(),0===r.find(".fl-col").length&&r.remove(),position=s.find("> .fl-module, .fl-col-group, .fl-col-sortable-proxy-item").index(l.item),FLBuilder._addColGroup(s.closest(".fl-col").attr("data-node"),o,position)):s.hasClass("fl-col-drop-target")?(s.hasClass("fl-col-drop-target-last")?s.parent().after(i):s.parent().before(i),FLBuilder._resetColumnWidths(newGroup),n==newGroupId?FLBuilder.ajax({action:"reorder_col",node_id:o,position:i.index(),silent:!0}):FLBuilder.ajax({action:"move_col",node_id:o,new_parent:newGroupId,position:i.index(),resize:[n,newGroupId],silent:!0}),FLBuilder._resizeLayout()):s.hasClass("fl-col-group-drop-target")?(i.remove(),0===r.find(".fl-col").length&&r.remove(),position=newRow.find(".fl-row-content > .fl-col-group").index(newGroup),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addColGroup(newRow.attr("data-node"),o,position)):s.hasClass("fl-row-drop-target")&&(i.remove(),position=s.closest(".fl-builder-content").find(".fl-row").index(newRow),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addRow(o,position)),0===r.find(".fl-col").length&&r.remove(),e(".fl-col-sortable-proxy").append(l.item),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables()},_colSettingsClicked:function(t){var l=e(this),i=l.closest(".fl-col"),o=null;FLBuilder._colResizing||(o=l.hasClass("fl-block-col-edit-parent")?i.parents(".fl-col").data("node"):i.attr("data-node"),FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_column_settings",node_id:o},FLBuilder._colSettingsLoaded),t.stopPropagation())},_colSettingsLoaded:function(t){var l=JSON.parse(t),i=null,o=null,s=null,r=null;FLBuilder._setSettingsFormContent(l.settings),i=e(".fl-builder-col-settings"),o=i.data("node"),s=e('.fl-col[data-node="'+o+'"]'),r=s.find("> .fl-col-content"),0===s.siblings(".fl-col").length?e(i).find("#fl-builder-settings-section-general").css("display","none"):r.width()<=40&&e("#fl-field-size").hide(),FLBuilder.preview=new FLBuilderPreview({type:"col",state:l.state})},_deleteColClicked:function(t){var l=e(this),i=l.closest(".fl-col"),o=i.closest(".fl-col-group"),s=i.parents(".fl-col"),r=s.length>0,n=s.find("> .fl-col-content > .fl-module, > .fl-col-content > .fl-col-group"),a=i.siblings(".fl-col"),d=!0;i.find(".fl-module").length>0&&(d=confirm(FLBuilderStrings.deleteColumnMessage)),r&&1===n.length&&(0===a.length?i=s:1!==a.length||a.find(".fl-module").length||(i=o)),d&&(FLBuilder._deleteCol(i),FLBuilder._removeAllOverlays(),FLBuilder._highlightEmptyCols()),t.stopPropagation()},_deleteCol:function(e){var t=e.closest(".fl-row"),l=e.closest(".fl-col-group"),i=0;e.remove(),rowCols=t.find(".fl-row-content > .fl-col-group > .fl-col"),groupCols=l.find(" > .fl-col"),0===rowCols.length&&"row"!=FLBuilderConfig.userTemplateType?FLBuilder._deleteRow(t):(0===groupCols.length?l.remove():(i=6===groupCols.length?16.65:7===groupCols.length?14.28:Math.round(100/groupCols.length*100)/100,groupCols.css("width",i+"%")),FLBuilder.ajax({action:"delete_col",node_id:e.attr("data-node"),new_width:i,silent:!0}),FLBuilder._initDropTargets(),FLBuilder._initSortables())},_addCols:function(e,t,l,i){l="undefined"==typeof l?"1-col":l,i="undefined"!=typeof i&&i,FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder.ajax({action:"render_new_columns",node_id:e.attr("data-node"),insert:t,type:l,nested:i?1:0},FLBuilder._addColsComplete)},_addColsComplete:function(t){var l=JSON.parse(t),i=null,o=FLBuilder._addModuleAfterNodeRender;FLBuilder._renderLayout(l,function(){null!==o&&(e('[data-node="'+o.module.data("node")+'"]').remove(),i=e('[data-node="'+o.colId+'"]'),"after"==o.position?i.next().find(".fl-col-content").append(o.module):i.prev().find(".fl-col-content").append(o.module),FLBuilder._reorderModule(o.module),FLBuilder._addModuleAfterNodeRender=null)})},_addColGroup:function(t,l,i){var o=e(".fl-node-"+t);FLBuilder.showAjaxLoader(),FLBuilder._newColGroupPosition=i,o.hasClass("fl-col")?FLBuilder._newColGroupParent=o.find(" > .fl-col-content"):FLBuilder._newColGroupParent=o.find(".fl-row-content"),FLBuilder.ajax({action:"render_new_column_group",cols:l,node_id:t,position:i},FLBuilder._addColGroupComplete)},_addColGroupComplete:function(t){var l=JSON.parse(t),i=e(l.html).find(".fl-col").data("node"),o=FLBuilder._addModuleAfterNodeRender;l.nodeParent=FLBuilder._newColGroupParent,l.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(l,function(){l.nodeParent.hasClass("fl-col-content")&&l.nodeParent.parents(".fl-col").addClass("fl-col-has-cols"),null!==o&&(e(".fl-node-"+i+" .fl-col-content").append(o),FLBuilder._reorderModule(o),FLBuilder._addModuleAfterNodeRender=null)})},_initColDragResizing:function(){e(".fl-block-col-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(t,l){var i=e(l.helper),o="",s=i.hasClass("fl-block-col-resize-parent"),r=s?i.closest(".fl-col").parents(".fl-col"):null,n=s?r.parents(".fl-col-group"):i.closest(".fl-col-group"),a=n.find("> .fl-col"),d=s?r:i.closest(".fl-col"),u=null,c=100,f=0;for(i.hasClass("fl-block-col-resize-e")?(o="e",u=d.next(".fl-col")):(o="w",u=d.prev(".fl-col"));f<a.length;f++)a.eq(f).data("node")!=d.data("node")&&a.eq(f).data("node")!=u.data("node")&&(c-=parseFloat(a.eq(f)[0].style.width));FLBuilder._colResizeData={handle:i,feedbackLeft:i.find(".fl-block-col-resize-feedback-left"),feedbackRight:i.find(".fl-block-col-resize-feedback-right"),direction:o,groupWidth:n.outerWidth(),col:d,colWidth:parseFloat(d[0].style.width)/100,sibling:u,offset:l.position.left,availWidth:c},FLBuilder._colResizing=!0,e("body").addClass("fl-builder-col-resizing"),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder.triggerHook("col-resize-start")},_colDragResize:function(e,t){var l=FLBuilder._colResizeData,i=(l.offset-t.position.left)/l.groupWidth,o="e"==l.direction?100*(l.colWidth-i):100*(l.colWidth+i),s=Math.round(100*o)/100,r=l.availWidth-o,n=Math.round(100*r)/100,a=8,d=Math.round(100*(l.availWidth-a))/100;s<a?(s=a,n=d):n<a&&(s=d,n=a),"e"==l.direction?(l.feedbackLeft.html(s.toFixed(1)+"%").show(),l.feedbackRight.html(n.toFixed(1)+"%").show()):(l.feedbackLeft.html(n.toFixed(1)+"%").show(),l.feedbackRight.html(s.toFixed(1)+"%").show()),l.col.css("width",s+"%"),l.sibling.css("width",n+"%"),FLBuilder.triggerHook("col-resize-drag")},_colDragResizeStop:function(t,l){var i=FLBuilder._colResizeData,o=FLBuilder._colResizeData.handle.closest(".fl-block-overlay");FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide(),FLBuilder.ajax({action:"resize_cols",col_id:i.col.data("node"),col_width:parseFloat(i.col[0].style.width),sibling_id:i.sibling.data("node"),sibling_width:parseFloat(i.sibling[0].style.width),silent:!0}),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder._colResizeData=null,e("body").removeClass("fl-builder-col-resizing"),FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50),FLBuilder.triggerHook("col-resize-stop")},_resetColumnWidthsClicked:function(t){var l=e(this).parents(".fl-col-group").last(),i=[l.data("node")],o=l.find(".fl-col-group"),s=0;for(FLBuilder._resetColumnWidths(l);s<o.length;s++)FLBuilder._resetColumnWidths(o.eq(s)),i.push(o.eq(s).data("node"));FLBuilder.ajax({action:"reset_col_widths",group_id:i,silent:!0}),FLBuilder.triggerHook("col-reset-widths"),FLBuilder._closeAllSubmenus(),t.stopPropagation()},_resetColumnWidths:function(e){var t=e.find(" > .fl-col:visible"),l=0;l=6===t.length?16.65:7===t.length?14.28:Math.round(100/t.length*100)/100,t.css("width",l+"%")},_moduleMouseenter:function(){var t=e(this),l=t.attr("data-name"),i=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.closest(".fl-col-group").find("> .fl-col").length,r=t.closest(".fl-col"),n=0===r.index(),a=s===r.index()+1,d=r.parents(".fl-col"),u=d.length>0,c=u?d.closest(".fl-col-group").find("> .fl-col").length:0,f=!!u&&0===d.index(),h=!!u&&c===d.index()+1,p=r.find("> .fl-col-content").width(),g=wp.template("fl-module-overlay"),_=null;FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),i&&o&&"row"!=FLBuilderConfig.userTemplateType||(t.hasClass("fl-block-overlay-active")||(_=FLBuilder._appendOverlay(t,g({global:i,moduleName:l,numCols:s,colFirst:n,colLast:a,hasParentCol:u,numParentCols:c,parentFirst:f,parentLast:h,contentWidth:p})),FLBuilder._buildOverlayOverflowMenu(_),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(t){var l=(e(this),e(t.toElement)||e(t.relatedTarget)),i=l.is("#tiptip_holder"),o=l.closest("#tiptip_holder").length>0;i||o||(FLBuilder._removeModuleOverlays(),FLBuilder._removeColHighlightGuides())},_removeModuleOverlays:function(){var t=e(".fl-module");t.removeClass("fl-block-overlay-active"),t.find(".fl-module-overlay").remove(),e("body").removeClass("fl-block-overlay-muted")},_moduleDragHelper:function(t,l){return e('<div class="fl-builder-block-drag-helper">'+l.attr("data-name")+"</div>")},_moduleDragStart:function(t,l){e(l.item).data("original-position",l.item.index()),FLBuilder._blockDragStart(t,l)},_moduleDragStop:function(t,l){FLBuilder._blockDragStop(t,l);var i=l.item,o=i.parent(),s=null,r=0,n=0;if(o.hasClass("fl-builder-modules")||o.hasClass("fl-builder-widgets"))return void i.remove();if(i.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=i.closest(".fl-builder-content"),n=0,s=i.closest(".fl-row"),r=o.find(".fl-row").index(s)):o.hasClass("fl-col-group-drop-target")?(o=i.closest(".fl-row-content"),n=o.closest(".fl-row").attr("data-node"),s=i.closest(".fl-col-group"),r=o.find(" > .fl-col-group").index(s)):o.hasClass("fl-col-drop-target")?(o=i.closest(".fl-col-group"),n=o.attr("data-node"),s=i.closest(".fl-col"),r=o.find(" > .fl-col").index(s)):(r=o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(i),n=i.closest(".fl-col").attr("data-node")),i.closest(".fl-drop-target-last").length&&(r+=1),FLBuilder._addModule(o,n,i.attr("data-type"),r,i.attr("data-widget")),i.remove()}else{if(o.hasClass("fl-sortable-disabled"))return e(t.target).append(l.item),e(t.target).children().eq(l.item.data("original-position")).before(l.item),void FLBuilder._highlightEmptyCols();o.hasClass("fl-row-drop-target")?(s=i.closest(".fl-row"),r=i.closest(".fl-builder-content").children(".fl-row").index(s),r=i.closest(".fl-drop-target-last").length?r+1:r,
3
+ FLBuilder._addModuleAfterNodeRender=i,FLBuilder._addRow("1-col",r),i.remove()):o.hasClass("fl-col-group-drop-target")?(s=i.closest(".fl-col-group"),r=i.closest(".fl-row-content ").find(" > .fl-col-group").index(s),r=i.closest(".fl-drop-target-last").length?r+1:r,FLBuilder._addModuleAfterNodeRender=i,FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),"1-col",r),i.remove()):o.hasClass("fl-col-drop-target")?(s=i.closest(".fl-col"),r=i.closest(".fl-col-drop-target-last").length?"after":"before",FLBuilder._addModuleAfterNodeRender={module:i,colId:s.data("node"),position:r},FLBuilder._addCols(s,r,"1-col",i.closest(".fl-col-group-nested").length>0),i.remove()):FLBuilder._reorderModule(i)}FLBuilder._resizeLayout()},_reorderModule:function(e){var t=e.closest(".fl-col").attr("data-node"),l=e.attr("data-parent"),i=e.attr("data-node"),o=e.index();t==l?FLBuilder._reorderNode(i,o):(e.attr("data-parent",t),FLBuilder._moveNode(t,i,o))},_deleteModuleClicked:function(t){var l=e(this).closest(".fl-module"),i=confirm(FLBuilderStrings.deleteModuleMessage);i&&(FLBuilder._deleteModule(l),FLBuilder._removeAllOverlays()),t.stopPropagation()},_deleteModule:function(e){var t=e.closest(".fl-row");FLBuilder.ajax({action:"delete_node",node_id:e.attr("data-node"),silent:!0}),e.empty(),e.remove(),t.removeClass("fl-block-overlay-muted"),FLBuilder._highlightEmptyCols(),FLBuilder._removeAllOverlays()},_moduleCopyClicked:function(t){var l=e(this).closest(".fl-module");FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder._newModuleParent=l.parent(),FLBuilder._newModulePosition=l.index()+1,FLBuilder.ajax({action:"copy_module",node_id:l.attr("data-node")},FLBuilder._moduleCopyComplete),t.stopPropagation()},_moduleCopyComplete:function(e){var t=JSON.parse(e);t.nodeParent=FLBuilder._newModuleParent,t.nodePosition=FLBuilder._newModulePosition,FLBuilder._renderLayout(t)},_moduleSettingsClicked:function(t){var l=e(this),i=l.closest(".fl-module").attr("data-node"),o=l.closest(".fl-col").attr("data-node"),s=l.closest(".fl-module").attr("data-type"),r=l.closest(".fl-block-overlay-global").length>0;t.stopPropagation(),FLBuilder._colResizing||r&&!FLBuilderConfig.userCanEditGlobalTemplates||FLBuilder._showModuleSettings(i,o,s)},_showModuleSettings:function(e,t,l){FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_module_settings",node_id:e,type:l,parent_id:t},FLBuilder._moduleSettingsLoaded)},_moduleSettingsLoaded:function(t){var l=JSON.parse(t),i=e("<div>"+l.settings+"</div>"),o=i.find("link.fl-builder-settings-css"),s=i.find("script.fl-builder-settings-js"),r=i.find(".fl-builder-settings"),n=r.attr("data-type"),a=null,d=null,u=null;e.inArray(n,FLBuilder._loadedModuleAssets)>-1?(o.remove(),s.remove()):(e("head").append(o),e("head").append(s),FLBuilder._loadedModuleAssets.push(n)),FLBuilder._setSettingsFormContent(i),"undefined"!=typeof l.layout&&(a=l.layout,a.nodeParent=FLBuilder._newModuleParent,a.nodePosition=FLBuilder._newModulePosition),"undefined"!=typeof l.state&&(d=l.state),FLBuilder.preview=new FLBuilderPreview({type:"module",layout:a,state:d}),u=FLBuilder._moduleHelpers[n],"undefined"!=typeof u&&(FLBuilder._initSettingsValidation(u.rules),u.init())},_saveModuleClicked:function(){var t=e(this).closest(".fl-builder-settings"),l=t.attr("data-type"),i=(t.attr("data-node"),FLBuilder._moduleHelpers[l]),o=!0;"undefined"!=typeof i&&(t.find("label.error").remove(),t.validate().hideErrors(),o=t.validate().form(),o&&(o=i.submit())),o?(FLBuilder._saveSettings(),FLBuilder._lightbox.close()):FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,l,i,o){FLBuilder.showAjaxLoader(),e.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=i),FLBuilder.ajax({action:"render_new_module",parent_id:t,type:l,position:i,node_preview:1,widget:"undefined"==typeof o?"":o},FLBuilder._addModuleComplete)},_addModuleComplete:function(t){FLBuilder._showLightbox(),FLBuilder._moduleSettingsLoaded(t),e(".fl-builder-module-settings").data("new-module","1")},registerModuleHelper:function(t,l){var i={rules:{},init:function(){},submit:function(){return!0},preview:function(){}};FLBuilder._moduleHelpers[t]=e.extend({},i,l)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(t){var l=e(".fl-builder-settings-lightbox .fl-builder-settings");FLBuilder._saveSettings(),FLBuilder.ajax({action:"render_node_template_settings",node_id:l.attr("data-node")},FLBuilder._nodeTemplateSettingsLoaded)},_nodeTemplateSettingsLoaded:function(e){var t=JSON.parse(e);FLBuilder._showLightbox(!1),FLBuilder._setSettingsFormContent(t.html),FLBuilder._initSettingsValidation({name:{required:!0}})},_saveNodeTemplate:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=t.validate().form();l&&(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_node_template",node_id:t.attr("data-node"),settings:FLBuilder._getSettings(t)},FLBuilder._saveNodeTemplateComplete),FLBuilder._lightbox.close())},_saveNodeTemplateComplete:function(t){var l=JSON.parse(t),i=e(".fl-builder-saved-"+l.type+"s"),o=i.find(".fl-builder-block"),s=null,r="",n=l.name.toLowerCase(),a=0,d=wp.template("fl-node-template-block");if("row"==l.type?FLBuilder.alert(FLBuilderStrings.rowTemplateSaved):"module"==l.type&&FLBuilder.alert(FLBuilderStrings.moduleTemplateSaved),l.layout&&FLBuilder._renderLayout(l.layout),0===o.length)i.append(d(l));else for(;a<o.length;a++){if(s=o.eq(a),r=s.text().toLowerCase().trim(),0===a&&n<r){i.prepend(d(l));break}if(n<r){s.before(d(l));break}if(o.length-1===a){i.append(d(l));break}}i.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(t,l){FLBuilder._blockDragStop(t,l);var i=l.item,o=i.parent(),s=null,r=0,n=null,a="",d=null;if(i.hasClass("fl-builder-block-saved-row")||i.hasClass("fl-builder-block-row-template"))n=i.closest(".fl-row"),r=n.length?e(FLBuilder._contentClass+" .fl-row").index(n):0,r=o.hasClass("fl-drop-target-last")?r+1:r,s=null,a="render_new_row",d=FLBuilder._addRowComplete,FLBuilder._newRowPosition=r;else if(i.hasClass("fl-builder-block-saved-module")||i.hasClass("fl-builder-block-module-template")){if(a="render_new_module",d=FLBuilder._addModuleComplete,o.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=i.closest(".fl-builder-content"),s=0,r=o.find(".fl-row").index(i.closest(".fl-row"))):o.hasClass("fl-col-group-drop-target")?(o=i.closest(".fl-row-content"),s=o.closest(".fl-row").attr("data-node"),r=o.find(" > .fl-col-group").index(i.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")?(o=i.closest(".fl-col-group"),r=o.children(".fl-col").index(i.closest(".fl-col")),s=o.attr("data-node")):(r=o.children(".fl-module, .fl-builder-block").index(i),s=i.closest(".fl-col").attr("data-node")),i.closest(".fl-drop-target-last").length&&(r+=1),o.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=o,FLBuilder._newModulePosition=r)}FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:a,template_id:i.attr("data-id"),template_type:i.attr("data-type"),parent_id:s,position:r},d),i.remove()},_editNodeTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteNodeTemplateClicked:function(t){var l=e(t.target),i=l.closest(".fl-builder-blocks-section"),o=i.find(".fl-builder-blocks-section-content"),s=o.find(".fl-builder-block"),r=l.closest(".fl-builder-block"),n=r.hasClass("fl-builder-block-global"),a=n?FLBuilder._updateLayout:void 0,d=n?FLBuilderStrings.deleteGlobalTemplate:FLBuilderStrings.deleteTemplate;confirm(d)&&(r.remove(),1===s.length&&(r.hasClass("fl-builder-block-saved-row")?o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedRows+"</span>"):o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedModules+"</span>")),FLBuilder.ajax({action:"delete_node_template",template_id:r.attr("data-id"),silent:!r.hasClass("fl-builder-block-global")},a))},_initSettingsForms:function(){FLBuilder._initColorPickers(),FLBuilder._initSelectFields(),FLBuilder._initMultipleFields(),FLBuilder._initAutoSuggestFields(),FLBuilder._initLinkFields(),FLBuilder._initFontFields(),FLBuilder.triggerHook("settings-form-init")},_setSettingsFormContent:function(e){FLBuilder._setLightboxContent(e),FLBuilder._initSettingsForms()},_settingsTabClicked:function(t){var l=e(this),i=l.closest(".fl-builder-settings"),o=l.attr("href").split("#").pop();i.find(".fl-builder-settings-tab").removeClass("fl-active"),i.find("#"+o).addClass("fl-active"),i.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),e(this).addClass("fl-active"),t.preventDefault()},_settingsCancelClicked:function(t){var l=e(".fl-builder-module-settings"),i=null,o=null,s=null,r=null;l.length>0&&"undefined"!=typeof l.data("new-module")?(i=e(FLBuilder.preview.state.html),o=e(".fl-node-"+l.data("node")),s=o.closest(".fl-col"),r=i.find(".fl-node-"+s.data("node")),r.length>0?FLBuilder._deleteModule(o):FLBuilder._deleteCol(s)):FLBuilder.preview&&FLBuilder.preview.revert(),FLBuilder.preview=null,FLLightbox.closeParent(this)},_initSettingsValidation:function(t,l){var i=e(".fl-builder-settings").last();i.validate({ignore:[],rules:t,messages:l,errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var t=e(".fl-builder-settings:visible"),l=t.find(".fl-builder-settings-tab"),i=null,o=null,s=0;s<l.length;s++)i=l.eq(s),o=i.find("label.error"),tabLink=t.find(".fl-builder-settings-tabs a[href*="+i.attr("id")+"]"),tabLink.find(".fl-error-icon").remove(),tabLink.removeClass("error"),o.length>0&&(tabLink.append('<span class="fl-error-icon"></span>'),tabLink.addClass("error"))},_getSettings:function(t){FLBuilder._updateEditorFields();var l=t.serializeArray(),i=0,o=0,s="",r="",n="",a=[],d=[],u={};for(i=0;i<l.length;i++)if(s=l[i].value.replace(/\r/gm,""),!(l[i].name.indexOf("flrich")>-1))if(l[i].name.indexOf("[")>-1){for(r=l[i].name.replace(/\[(.*)\]/,""),n=l[i].name.replace(r,""),a=[],d=n.match(/\[[^\]]*\]/g),o=0;o<d.length;o++)"[]"!=d[o]&&a.push(d[o].replace(/\[|\]/g,""));n.match(/\[\]\[[^\]]*\]\[[^\]]+\]/)?("undefined"==typeof u[r]&&(u[r]={}),"undefined"==typeof u[r][a[0]]&&(u[r][a[0]]={}),"undefined"==typeof u[r][a[0]][a[1]]&&(u[r][a[0]][a[1]]={}),u[r][a[0]][a[1]]=s):n.match(/\[\]\[[^\]]*\]\[\]/)?("undefined"==typeof u[r]&&(u[r]={}),"undefined"==typeof u[r][a[0]]&&(u[r][a[0]]=[]),u[r][a[0]].push(s)):n.match(/\[\]\[[^\]]*\]/)?("undefined"==typeof u[r]&&(u[r]={}),u[r][a[0]]=s):n.match(/\[\]/)&&("undefined"==typeof u[r]&&(u[r]=[]),u[r].push(s))}else u[l[i].name]=s;for(n in u)if("undefined"!=typeof u["as_values_"+n]){u[n]=e.grep(u["as_values_"+n].split(","),function(e){return""!==e}).join(",");try{delete u["as_values_"+n]}catch(c){}}return u},_saveSettings:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=t.attr("data-node"),i=FLBuilder._getSettings(t);FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_settings",node_id:l,settings:i},FLBuilder._saveSettingsComplete),FLBuilder._lightbox.close()},_saveSettingsComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder.preview&&(FLBuilder.preview.clear(),FLBuilder.preview=null)})},_showHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeIn()},_hideHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeOut()},_initAutoSuggestFields:function(){e(".fl-suggest-field").each(FLBuilder._initAutoSuggestField)},_initAutoSuggestField:function(){var t=e(this);t.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:t.data("action"),fl_as_action_data:t.data("action-data"),_wpnonce:FLBuilderConfig.ajaxNonce}),e.extend({},{asHtmlID:t.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,preFill:t.data("value"),queryParam:"fl_as_query",afterSelectionAdd:FLBuilder._updateAutoSuggestField,afterSelectionRemove:FLBuilder._updateAutoSuggestField,selectionLimit:t.data("limit")},t.data("args")))},_updateAutoSuggestField:function(t,l,i){e(this).siblings(".as-values").val(i.join(",")).trigger("change")},_initMultipleFields:function(){for(var t=e(".fl-builder-field-multiples"),l=null,i=null,o=0,s=FLBuilderConfig.isRtl?{left:10}:{right:10};o<t.length;o++)l=t.eq(o),i=l.find(".fl-builder-field-multiple"),1===i.length?i.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):i.find(".fl-builder-field-actions").removeClass("fl-builder-field-actions-single");e(".fl-builder-field-multiples").sortable({items:".fl-builder-field-multiple",cursor:"move",cursorAt:s,distance:5,opacity:.5,helper:FLBuilder._fieldDragHelper,placeholder:"fl-builder-field-dd-zone",stop:FLBuilder._fieldDragStop,tolerance:"pointer"})},_addFieldClicked:function(){var t=e(this),l=t.attr("data-field"),i=t.closest("tr").siblings("tr[data-field="+l+"]").last(),o=i.clone(),s=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;o.find("th label span.fl-builder-field-index").html(s),o.find(".fl-form-field-preview-text").html(""),o.find("input, textarea, select").val(""),i.after(o),FLBuilder._initMultipleFields()},_copyFieldClicked:function(){var t=e(this),l=t.closest("tr"),i=l.clone(),o=parseInt(l.find("label span.fl-builder-field-index").html(),10)+1;i.find("th label span.fl-builder-field-index").html(o),l.after(i),FLBuilder._renumberFields(l.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var t=e(this).closest("tr"),l=t.parent(),i=confirm(FLBuilderStrings.deleteFieldMessage);i&&(t.remove(),FLBuilder._renumberFields(l),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview())},_renumberFields:function(e){for(var t=e.find(".fl-builder-field-multiple"),l=0;l<t.length;l++)t.eq(l).find("th label span.fl-builder-field-index").html(l+1)},_fieldDragHelper:function(){return e('<div class="fl-builder-field-dd-helper"></div>')},_fieldDragStop:function(e,t){FLBuilder._renumberFields(t.item.parent()),FLBuilder.preview.delayPreview()},_initSelectFields:function(){e(".fl-builder-settings:visible").find(".fl-builder-settings-fields select").trigger("change")},_settingsSelectChanged:function(){var t=e(this),l=t.attr("data-toggle"),i=t.attr("data-hide"),o=t.attr("data-trigger"),s=t.val(),r=0;if("undefined"!=typeof l){l=JSON.parse(l);for(r in l)FLBuilder._settingsSelectToggle(l[r].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(l[r].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[r].tabs,"hide","a[href*=fl-builder-settings-tab-","]");"undefined"!=typeof l[s]&&(FLBuilder._settingsSelectToggle(l[s].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(l[s].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[s].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if("undefined"!=typeof i&&(i=JSON.parse(i),"undefined"!=typeof i[s]&&(FLBuilder._settingsSelectToggle(i[s].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[s].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[s].tabs,"hide","a[href*=fl-builder-settings-tab-","]"))),"undefined"!=typeof o&&(o=JSON.parse(o),"undefined"!=typeof o[s]&&"undefined"!=typeof o[s].fields))for(r=0;r<o[s].fields.length;r++)e("#fl-field-"+o[s].fields[r]).find("select").trigger("change")},_settingsSelectToggle:function(t,l,i,o){var s=0;if(o="undefined"==typeof o?"":o,"undefined"!=typeof t)for(;s<t.length;s++)e(i+t[s]+o)[l](),e(i+t[s]+o).parent().find('.fl-field[data-type="code"]').each(function(){e(this).data("editor").resize()})},_initColorPickers:function(){var t=FLBuilderConfig.colorPresets?FLBuilderConfig.colorPresets:[];FLBuilder.colorPicker=new FLBuilderColorPicker({mode:"hsv",elements:".fl-color-picker .fl-color-picker-value",presets:t,labels:{colorPresets:FLBuilderStrings.colorPresets,colorPicker:FLBuilderStrings.colorPicker,placeholder:FLBuilderStrings.placeholder,removePresetConfirm:FLBuilderStrings.removePresetConfirm,noneColorSelected:FLBuilderStrings.noneColorSelected,alreadySaved:FLBuilderStrings.alreadySaved,noPresets:FLBuilderStrings.noPresets,presetAdded:FLBuilderStrings.presetAdded},mode:"hsv"}),e(FLBuilder.colorPicker).on("presetRemoved presetAdded",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_initSinglePhotoSelector:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:"image"},multiple:!1}))},_selectSinglePhoto:function(){FLBuilder._initSinglePhotoSelector(),FLBuilder._singlePhotoSelector.once("open",e.proxy(FLBuilder._singlePhotoOpened,this)),FLBuilder._singlePhotoSelector.once("select",e.proxy(FLBuilder._singlePhotoSelected,this)),FLBuilder._singlePhotoSelector.open()},_singlePhotoOpened:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection"),l=e(this).closest(".fl-photo-field"),i=l.find("input[type=hidden]"),o=i.val(),s=null;e(this).hasClass("fl-photo-replace")?(t.reset(),l.addClass("fl-photo-empty"),i.val("")):""!==o?(s=wp.media.attachment(o),s.fetch(),t.add(s?[s]:[])):t.reset()},_singlePhotoSelected:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection").first().toJSON(),l=e(this).closest(".fl-photo-field"),i=l.find("input[type=hidden]"),o=l.find(".fl-photo-preview img"),s=l.find("select");i.val(t.id),o.attr("src",FLBuilder._getPhotoSrc(t)),l.removeClass("fl-photo-empty"),l.find("label.error").remove(),s.show(),s.html(FLBuilder._getPhotoSizeOptions(t)),s.trigger("change")},_singlePhotoRemoved:function(){FLBuilder._initSinglePhotoSelector();var t=FLBuilder._singlePhotoSelector.state(),l="undefined"!=typeof t?t.get("selection"):null,i=e(this).closest(".fl-photo-field"),o=i.find("input[type=hidden]"),s=i.find("select");l&&l.reset(),i.addClass("fl-photo-empty"),o.val(""),s.html('<option value="" selected></option>'),s.trigger("change")},_getPhotoSrc:function(e){return"undefined"==typeof e.sizes?e.url:"undefined"!=typeof e.sizes.thumbnail?e.sizes.thumbnail.url:e.sizes.full.url},_getPhotoSizeOptions:function(e){var t="",l=null,i=null,o="",s={full:FLBuilderStrings.fullSize,large:FLBuilderStrings.large,medium:FLBuilderStrings.medium,thumbnail:FLBuilderStrings.thumbnail};if("undefined"==typeof e.sizes)t+='<option value="'+e.url+'">'+FLBuilderStrings.fullSize+"</option>";else for(l in e.sizes)o="undefined"!=typeof s[l]?s[l]+" - ":"undefined"!=typeof FLBuilderConfig.customImageSizeTitles[l]?FLBuilderConfig.customImageSizeTitles[l]+" - ":"",i="full"==l?' selected="selected"':"",t+='<option value="'+e.sizes[l].url+'"'+i+">"+o+e.sizes[l].width+" x "+e.sizes[l].height+"</option>";return t},_selectMultiplePhotos:function(){var t=e(this).closest(".fl-multiple-photos-field"),l=t.find("input[type=hidden]"),i=l.val(),o=""===i?"":JSON.parse(i),s=wp.media.gallery.defaults.id,r='[gallery ids="-1"]',n=null,a=null,d=null,u=null,c=[];if("object"==typeof o){for(u in o)c.push(o[u]);r='[gallery ids="'+c.join()+'"]'}n=wp.shortcode.next("gallery",r).shortcode,_.isUndefined(n.get("id"))&&!_.isUndefined(s)&&n.set("id",s),a=wp.media.gallery.attachments(n),d=new wp.media.model.Selection(a.models,{props:a.props.toJSON(),multiple:!0}),d.gallery=a.gallery,d.more().done(function(){d.length||FLBuilder._multiplePhotoSelector.setState("gallery-library"),d.props.set({query:!1}),d.unmirror(),d.props.unset("orderby")}),FLBuilder._multiplePhotoSelector&&FLBuilder._multiplePhotoSelector.dispose(),FLBuilder._multiplePhotoSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-photos-edit")?"gallery-edit":"gallery-library",title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:d}).open(),e(FLBuilder._multiplePhotoSelector.views.view.el).addClass("fl-multiple-photos-lightbox"),FLBuilder._multiplePhotoSelector.once("update",e.proxy(FLBuilder._multiplePhotosSelected,this))},_multiplePhotosSelected:function(t){for(var l=e(this).closest(".fl-multiple-photos-field"),i=l.find("input[type=hidden]"),o=l.find(".fl-multiple-photos-count"),s=[],r=0;r<t.models.length;r++)s.push(t.models[r].id);1==s.length?o.html("1 "+FLBuilderStrings.photoSelected):o.html(s.length+" "+FLBuilderStrings.photosSelected),l.removeClass("fl-multiple-photos-empty"),l.find("label.error").remove(),i.val(JSON.stringify(s)).trigger("change")},_selectSingleVideo:function(){null===FLBuilder._singleVideoSelector&&(FLBuilder._singleVideoSelector=wp.media({title:FLBuilderStrings.selectVideo,button:{text:FLBuilderStrings.selectVideo},library:{type:"video"},multiple:!1})),FLBuilder._singleVideoSelector.once("select",e.proxy(FLBuilder._singleVideoSelected,this)),FLBuilder._singleVideoSelector.open()},_singleVideoSelected:function(){var t=FLBuilder._singleVideoSelector.state().get("selection").first().toJSON(),l=e(this).closest(".fl-video-field"),i=l.find(".fl-video-preview-img img"),o=l.find(".fl-video-preview-filename"),s=l.find("input[type=hidden]");i.attr("src",t.icon),o.html(t.filename),l.removeClass("fl-video-empty"),l.find("label.error").remove(),s.val(t.id).trigger("change")},_selectMultipleAudios:function(){var t=e(this).closest(".fl-multiple-audios-field"),l=t.find("input[type=hidden]"),i=l.val(),o=""==i?'[playlist ids="-1"]':'[playlist ids="'+JSON.parse(i).join()+'"]',s=wp.shortcode.next("playlist",o).shortcode,r=wp.media.playlist.defaults.id,n=null,a=null;_.isUndefined(s.get("id"))&&!_.isUndefined(r)&&s.set("id",r),n=wp.media.playlist.attachments(s),a=new wp.media.model.Selection(n.models,{props:n.props.toJSON(),multiple:!0}),a.playlist=n.playlist,a.more().done(function(){a.props.set({query:!1}),a.unmirror(),a.props.unset("orderby")}),FLBuilder._multipleAudiosSelector&&FLBuilder._multipleAudiosSelector.dispose(),FLBuilder._multipleAudiosSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-audios-edit")?"playlist-edit":"playlist-library",title:wp.media.view.l10n.editPlaylistTitle,editing:!0,multiple:!0,selection:a}).open(),FLBuilder._multipleAudiosSelector.content.get("view").sidebar.unset("playlist"),FLBuilder._multipleAudiosSelector.on("content:render:browse",function(e){e&&e.sidebar.on("ready",function(){e.sidebar.unset("playlist")})}),FLBuilder._multipleAudiosSelector.once("update",e.proxy(FLBuilder._multipleAudiosSelected,this))},_multipleAudiosSelected:function(t){for(var l=e(this).closest(".fl-multiple-audios-field"),i=l.find(".fl-multiple-audios-count"),o=l.find("input[type=hidden]"),s=[],r=0;r<t.models.length;r++)s.push(t.models[r].id);1==s.length?i.html("1 "+FLBuilderStrings.audioSelected):i.html(s.length+" "+FLBuilderStrings.audiosSelected),o.val(JSON.stringify(s)).trigger("change"),l.removeClass("fl-multiple-audios-empty"),l.find("label.error").remove()},_selectIcon:function(){var e=this;FLIconSelector.open(function(t){FLBuilder._iconSelected.apply(e,[t])})},_iconSelected:function(t){var l=e(this).closest(".fl-icon-field"),i=l.find("input[type=hidden]"),o=l.find("i"),s=o.attr("data-icon");i.val(t).trigger("change"),o.removeClass(s),o.addClass(t),o.attr("data-icon",t),l.removeClass("fl-icon-empty"),l.find("label.error").remove()},_removeIcon:function(){var t=e(this).closest(".fl-icon-field"),l=t.find("input[type=hidden]"),i=t.find("i");l.val("").trigger("change"),i.removeClass(),i.attr("data-icon",""),t.addClass("fl-icon-empty")},_formFieldClicked:function(){var t=e(this),l=t.closest(".fl-lightbox-wrap").attr("data-instance-id"),i=FLLightbox._instances[l],o=i._node.find(".fl-lightbox").css("left"),s=i._node.find(".fl-lightbox").css("top"),r=t.closest(".fl-builder-settings"),n=t.attr("data-type"),a=t.siblings("input").val(),d=FLBuilder._moduleHelpers[n],u=new FLLightbox({className:"fl-builder-lightbox fl-form-field-settings",destroyOnClose:!0});t.closest(".fl-builder-lightbox").hide(),t.attr("id","fl-"+u._id),u.open('<div class="fl-builder-lightbox-loading"></div>'),u.draggable({handle:".fl-lightbox-header"}),e("body").undelegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked),u._node.find(".fl-lightbox").css({left:o,top:Number(parseInt(s)+233)+"px"}),FLBuilder.ajax({action:"render_settings_form",node_id:r.attr("data-node"),node_settings:FLBuilder._getSettings(r),type:n,settings:a.replace(/&#39;/g,"'")},function(e){var t=JSON.parse(e);u.setContent(t.html),u._node.find("form.fl-builder-settings").attr("data-type",n),u._node.find(".fl-builder-settings-cancel").on("click",FLBuilder._closeFormFieldLightbox),FLBuilder._initSettingsForms(),"undefined"!=typeof d&&(FLBuilder._initSettingsValidation(d.rules),d.init()),u._node.find(".fl-lightbox").css({left:o,top:s})})},_closeFormFieldLightbox:function(){var t=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),l=FLLightbox._instances[t],i=e(".fl-builder-settings-lightbox"),o=i.find("form"),s=l._node.find(".fl-lightbox").css("left"),r=l._node.find(".fl-lightbox").css("top"),n=0,a=e(window),d=a.height();"undefined"!=typeof tinymce&&"undefined"!=typeof tinymce.EditorManager.activeEditor&&tinymce.EditorManager.activeEditor.remove(),l._node.find(".fl-lightbox-content").html('<div class="fl-builder-lightbox-loading"></div>'),n=l._node.find(".fl-lightbox").height(),d-80>n?l._node.find(".fl-lightbox").css("top",(d-n)/2-40+"px"):l._node.find(".fl-lightbox").css("top","0px"),l.on("close",function(){i.show(),i.find("label.error").remove(),o.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors(),i.find(".fl-lightbox").css({left:s,top:r})}),setTimeout(function(){l.close(),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked)},500)},_saveFormFieldClicked:function(){var t=e(this).closest(".fl-builder-settings"),l=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),i=t.attr("data-type"),o=FLBuilder._getSettings(t),s={},r=FLBuilder._moduleHelpers[i],n=e(".fl-builder-settings #fl-"+l),a=n.parent().attr("data-preview-text"),d=o[a],u=e('select[name="'+a+'"]'),c=document.createElement("div"),f=!0;return u.length>0&&(d=u.find('option[value="'+o[a]+'"]').text()),"undefined"!=typeof r&&(t.find("label.error").remove(),t.validate().hideErrors(),f=t.validate().form(),f&&(f=r.submit())),f?("undefined"!=typeof a&&"undefined"!=typeof d&&(d.indexOf("fa fa-")>-1?d='<i class="'+d+'"></i>':d.length>35&&(c.innerHTML=d,d=(c.textContent||c.innerText||"").replace(/^(.{35}[^\s]*).*/,"$1")+"..."),n.siblings(".fl-form-field-preview-text").html(d)),s=n.siblings("input").val().replace(/&#39;/g,"'"),""!=s&&(o=e.extend(JSON.parse(s),o)),n.siblings("input").val(JSON.stringify(o)).trigger("change"),FLBuilder._closeFormFieldLightbox.apply(this),!0):(FLBuilder._toggleSettingsTabErrors(),!1)},_layoutFieldClicked:function(){var t=e(this);t.siblings().removeClass("fl-layout-field-option-selected"),t.addClass("fl-layout-field-option-selected"),t.siblings("input").val(t.attr("data-value"))},_initLinkFields:function(){e(".fl-link-field").each(FLBuilder._initLinkField)},_initLinkField:function(){var t=e(this),l=t.find(".fl-link-field-search-input");l.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:l.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,queryParam:"fl_as_query",selectionLimit:1,afterSelectionAdd:FLBuilder._updateLinkField})},_updateLinkField:function(e,t,l){var i=e.closest(".fl-link-field"),o=i.find(".fl-link-field-search"),s=i.find(".fl-link-field-search-input"),r=i.find(".fl-link-field-input");r.val(t.value).trigger("keyup"),s.autoSuggest("remove",t.value),o.hide()},_linkFieldSelectClicked:function(){e(this).parent().find(".fl-link-field-search").show()},_linkFieldSelectCancelClicked:function(){e(this).parent().hide()},_initFontFields:function(){e(".fl-font-field").each(FLBuilder._initFontField)},_initFontField:function(){var t=e(this),l=t.find(".fl-font-field-font");l.on("change",function(){FLBuilder._getFontWeights(l)})},_getFontWeights:function(t){var l=t.next(".fl-font-field-weight"),i=t.val(),o={"default":"Default",regular:"Regular",100:"Thin 100",200:"Extra-Light 200",300:"Light 300",400:"Normal 400",500:"Medium 500",600:"Semi-Bold 600",700:"Bold 700",800:"Extra-Bold 800",900:"Ultra-Bold 900"},s={};l.html(""),s="undefined"!=typeof FLBuilderFontFamilies.system[i]?FLBuilderFontFamilies.system[i].weights:"undefined"!=typeof FLBuilderFontFamilies.google[i]?FLBuilderFontFamilies.google[i]:FLBuilderFontFamilies["default"][i],e.each(s,function(e,t){l.append('<option value="'+t+'">'+o[t]+"</option>")})},initEditorField:function(e){var t=tinyMCEPreInit.mceInit.flhiddeneditor;t.elements=e,tinyMCEPreInit.mceInit[e]=t},_updateEditorFields:function(){var t=e(".fl-builder-settings textarea.wp-editor-area");t.each(FLBuilder._updateEditorField)},_updateEditorField:function(){var t=e(this),l=t.closest(".fl-editor-field"),i=(t.closest(".fl-builder-settings"),t.closest(".wp-editor-wrap")),o=t.attr("id"),s=l.attr("id"),r="undefined"!=typeof tinyMCE&&tinyMCE.get(o),n=t.siblings('textarea[name="'+s+'"]'),a=l.data("wpautop");0===n.length&&(n=e('<textarea name="'+s+'"></textarea>').hide(),t.after(n)),a?r&&i.hasClass("tmce-active")?n.val(r.getContent()):"undefined"!=typeof switchEditors?n.val(switchEditors.wpautop(t.val())):n.val(t.val()):(r&&i.hasClass("tmce-active")&&r.save(),n.val(t.val()))},_loopBuilderPostTypeChange:function(){var t=e(this).val();e(".fl-loop-builder-filter").hide(),e(".fl-loop-builder-"+t+"-filter").show()},_textFieldAddValueSelectChange:function(){var t=e(this),l=e('input[name="'+t.data("target")+'"]'),i=l.val(),o=t.val(),s="";-1==i.indexOf(o)&&(s=(i.trim()+" "+o.trim()).trim(),l.val(s).trigger("change").trigger("keyup")),t.val("")},ajax:function(t,l){var i;if(FLBuilder._silentUpdate)return FLBuilder.showAjaxLoader(),void(FLBuilder._silentUpdateCallbackData=[t,l]);t.silent===!0&&(FLBuilder._silentUpdate=!0);for(i in t)"undefined"==typeof t[i]&&(t[i]=null);return t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=e("#fl-post-id").val(),t.fl_builder=1,t.fl_action=t.action,"undefined"!=typeof t.settings&&(t.settings=FLBuilder._ajaxModSecFix(t.settings)),"undefined"!=typeof t.node_settings&&(t.node_settings=FLBuilder._ajaxModSecFix(t.node_settings)),t={fl_builder_data:t},e.post(FLBuilder._ajaxUrl(),t,function(e){FLBuilder._ajaxComplete(),"undefined"!=typeof l&&l.call(this,e)})},_ajaxComplete:function(){var e,t;FLBuilder._silentUpdate=!1,null!==FLBuilder._silentUpdateCallbackData?(FLBuilder.showAjaxLoader(),e=FLBuilder._silentUpdateCallbackData[0],t=FLBuilder._silentUpdateCallbackData[1],FLBuilder._silentUpdateCallbackData=null,FLBuilder.ajax(e,t)):FLBuilder.hideAjaxLoader()},_ajaxUrl:function(e){var t=window.location.href.split("#").shift(),l=null;if("undefined"!=typeof e)for(l in e)t+=t.indexOf("?")>-1?"&":"?",t+=l+"="+e[l];return t},showAjaxLoader:function(){0===e(".fl-builder-lightbox-loading").length&&e(".fl-builder-loading").show()},hideAjaxLoader:function(){e(".fl-builder-loading").hide()},_ajaxModSecFix:function(e){var t;if(FLBuilderConfig.modSecFix&&"undefined"!=typeof btoa)if("string"==typeof e)e=btoa(e);else for(t in e)"string"==typeof e[t]?e[t]=btoa(e[t]):"object"==typeof e[t]&&(e[t]=FLBuilder._ajaxModSecFix(e[t]));return e},_showLightbox:function(e){e="undefined"==typeof e||e,FLBuilder._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),e?FLBuilder._lightbox.draggable({handle:".fl-lightbox-header"}):FLBuilder._lightbox.draggable(!1),FLBuilder._removeAllOverlays(),FLBuilder._initLightboxScrollbars()},_setLightboxContent:function(e){
4
+ FLBuilder._lightbox.setContent(e)},_initLightboxScrollbars:function(){FLBuilder._initScrollbars(),FLBuilder._lightboxScrollbarTimeout=setTimeout(FLBuilder._initLightboxScrollbars,500)},_lightboxClosed:function(){FLBuilder.triggerHook("settings-lightbox-closed"),FLBuilder._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout)},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder.triggerHook("actions-lightbox-settings",e),FLBuilder._actionsLightbox.open(t(e))},_resizeLightbox:function(){var t=e(this),l=t.hasClass("fa-expand")?"expand":"contract";FLBuilder._lightbox.renderResize(l),e(this).toggleClass("fa-expand").toggleClass("fa-compress")},alert:function(e){var t=new FLLightbox({className:"fl-builder-lightbox fl-builder-alert-lightbox",destroyOnClose:!0}),l=wp.template("fl-alert-lightbox");t.open(l({message:e}))},_alertClose:function(){FLLightbox.closeParent(this)},triggerHook:function(t,l){e("body").trigger("fl-builder."+t,l)},addHook:function(t,l){e("body").on("fl-builder."+t,l)},removeHook:function(t,l){e("body").off("fl-builder."+t,l)},log:function(e){"undefined"!=typeof window.console&&"undefined"!=typeof window.console.log&&console.log(e)},logError:function(e){var t=null;"undefined"!=typeof e&&("undefined"!=typeof e.stack?t=e.stack:"undefined"!=typeof e.message&&(t=e.message),t&&(FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(t),FLBuilder.log("************************************************************************")))},logGlobalError:function(e,t,l,i,o){FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(FLBuilderStrings.globalErrorMessage.replace("{message}",e).replace("{line}",l).replace("{file}",t)),"undefined"!=typeof o&&"undefined"!=typeof o.stack&&(FLBuilder.log(o.stack),FLBuilder.log("************************************************************************"))}},e(function(){FLBuilder._init()})}(jQuery),function(e){FLBuilderAJAXLayout=function(t,l){this._data=e.extend({},this._defaults,"string"==typeof t?JSON.parse(t):t),this._callback=l,this._post=e("#fl-post-id").val(),this._head=e("head").eq(0),this._body=e("body").eq(0),this._data.css&&(this._loader=e('<img src="'+this._data.css+'" />'),this._oldCss=e('link[href*="/cache/'+this._post+'"]'),this._newCss=e('<link rel="stylesheet" id="fl-builder-layout-'+this._post+'-css" href="'+this._data.css+'" />')),this._data.partial?(this._data.js&&(this._oldJs=e("#fl-builder-partial-refresh-js"),this._newJs=e('<script type="text/javascript" id="fl-builder-partial-refresh-js">'+this._data.js+"</script>")),this._data.nodeId&&(this._data.oldNodeId?(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.oldNodeId+'"]'),this._content=e(".fl-node-"+this._data.oldNodeId)):(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.nodeId+'"]'),this._content=e(".fl-node-"+this._data.nodeId)))):(this._oldJs=e('script[src*="/cache/'+this._post+'"]'),this._newJs=e('<script src="'+this._data.js+'"></script>'),this._oldScriptsStyles=e(".fl-builder-layout-scripts-styles"),this._content=e(FLBuilder._contentClass)),this._init()},FLBuilderAJAXLayout.prototype={_defaults:{partial:!1,nodeId:null,nodeType:null,nodeParent:null,nodePosition:null,oldNodeId:null,html:null,scriptsStyles:null,css:null,js:null},_data:null,_callback:function(){},_post:null,_head:null,_body:null,_loader:null,_oldCss:null,_newCss:null,_oldJs:null,_newJs:null,_oldScriptsStyles:null,_content:null,_init:function(){this._body.height(this._body.height()),this._loader?(this._loader.on("error",e.proxy(this._loadNewCSSComplete,this)),this._body.append(this._loader)):this._finish()},_loadNewCSSComplete:function(){this._loader.remove(),this._oldCss.length>0?this._oldCss.after(this._newCss):this._head.append(this._newCss),setTimeout(e.proxy(this._finish,this),250)},_finish:function(){this._removeOldContentAndAssets(),this._cleanNewHTML(),this._cleanNewAssets(),this._addNewHTML(),this._addNewScriptsStyles(),this._addNewJS(),e(FLBuilder._contentClass).trigger("fl-builder.layout-rendered"),FLBuilder.hideAjaxLoader(),"undefined"!=typeof this._callback&&this._callback()},_removeOldContentAndAssets:function(){this._content&&this._content.empty(),this._oldCss&&this._oldCss.remove(),this._oldJs&&this._oldJs.remove(),this._oldScriptsStyles&&this._oldScriptsStyles.remove()},_cleanNewHTML:function(){if(this._data.scriptsStyles){var t=e("<div>"+this._data.html+"</div>"),l="fl-row",i=this._data.scriptsStyles,o="";this._data.partial&&(l="column-group"==this._data.nodeType?"fl-col-group":"column"==this._data.nodeType?"fl-col":"fl-"+this._data.nodeType),t.find("> *, script").each(function(){e(this).hasClass(l)||(o=e(this).remove(),i+=o[0].outerHTML)}),""!==i&&(i=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+i+"<div>":'<div class="fl-builder-node-scripts-styles">'+i+"<div>"),this._data.html=t.html(),this._data.scriptsStyles=i}},_addNewHTML:function(){var e;this._data.partial?this._data.nodeParent?(e=this._data.nodeParent.hasClass("fl-builder-content")?this._data.nodeParent.find(".fl-row"):this._data.nodeParent.hasClass("fl-row-content")?this._data.nodeParent.find(" > .fl-col-group"):this._data.nodeParent.find(" > .fl-col-group, > .fl-module"),0===e.length||e.length==this._data.nodePosition?this._data.nodeParent.append(this._data.html):e.eq(this._data.nodePosition).before(this._data.html)):(this._content.after(this._data.html),this._content.remove()):this._content.append(this._data.html)},_cleanNewAssets:function(){var t=this;this._data.html=this._removeDuplicateAssets(this._data.html),this._data.scriptsStyles&&""!==this._data.scriptsStyles&&(this._data.scriptsStyles=this._removeDuplicateAssets(this._data.scriptsStyles)),this._data.partial?e(".fl-builder-node-scripts-styles").each(function(){t._data.html.indexOf("fl-node-"+e(this).data("node"))>-1&&e(this).remove()}):(e("#fl-builder-partial-refresh-js").remove(),e(".fl-builder-node-scripts-styles").remove())},_removeDuplicateAssets:function(t){var l=e("<div>"+t+"</div>"),i="",o=null,s="",r=null,n=window.location,a=n.protocol+"//"+n.hostname+(n.port?":"+n.port:"");return l.find("script").each(function(){i=e(this).attr("src"),"undefined"!=typeof i&&(i=i.replace(a,""),o=e('script[src*="'+i+'"]'),o.length>0&&e(this).remove())}),l.find("link").each(function(){s=e(this).attr("href"),"undefined"!=typeof s&&(s=s.replace(a,""),r=e('link[href*="'+s+'"]'),r.length>0&&e(this).remove())}),l.html()},_addNewScriptsStyles:function(){this._data.scriptsStyles&&""!==this._data.scriptsStyles&&this._body.append(this._data.scriptsStyles)},_addNewJS:function(){setTimeout(e.proxy(function(){this._newJs&&this._head.append(this._newJs)},this),50)},_complete:function(){FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._resizeLayout(),FLBuilder._initMediaElements(),FLBuilderLayout.init(),FLBuilderResponsiveEditing.refreshPreview(),this._body.height("auto")}}}(jQuery),!function(e){"use strict";if(e.matchMedia&&e.matchMedia("all").addListener)return!1;var t=e.matchMedia,l=t("only all").matches,i=!1,o=0,s=[],r=function(l){e.clearTimeout(o),o=e.setTimeout(function(){for(var l=0,i=s.length;l<i;l++){var o=s[l].mql,r=s[l].listeners||[],n=t(o.media).matches;if(n!==o.matches){o.matches=n;for(var a=0,d=r.length;a<d;a++)r[a].call(e,o)}}},30)};e.matchMedia=function(o){var n=t(o),a=[],d=0;return n.addListener=function(t){l&&(i||(i=!0,e.addEventListener("resize",r,!0)),0===d&&(d=s.push({mql:n,listeners:a})),a.push(t))},n.removeListener=function(e){for(var t=0,l=a.length;t<l;t++)a[t]===e&&a.splice(t,1)},n}}(this),!function(e){"use strict";e.matchMedia=e.matchMedia||function(e,t){var l,i=e.documentElement,o=i.firstElementChild||i.firstChild,s=e.createElement("body"),r=e.createElement("div");return r.id="mq-test-1",r.style.cssText="position:absolute;top:-100em",s.style.background="none",s.appendChild(r),function(e){return r.innerHTML='&shy;<style media="'+e+'"> #mq-test-1 { width: 42px; }</style>',i.insertBefore(s,o),l=42===r.offsetWidth,i.removeChild(s),{matches:l,media:e}}}(e.document)}(this),function(e){FLBuilderForcedMediaQueries={_requestQueue:[],_xmlHttp:function(){var e=!1;try{e=new window.XMLHttpRequest}catch(t){e=new window.ActiveXObject("Microsoft.XMLHTTP")}return function(){return e}}(),_regex:{media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^\/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},_mediaStyles:[],_rules:[],_appendedEls:[],_parsedSheets:{},_emInPx:null,_width:null,_callback:null,update:function(e,t){var l=FLBuilderForcedMediaQueries,i=window.document,o=i.documentElement,s=i.getElementsByTagName("head")[0]||o,r=i.getElementsByTagName("base")[0],n=s.getElementsByTagName("link");l._mediaStyles=[],l._rules=[],"undefined"!=typeof e&&(l._width=e),"undefined"!=typeof t&&(l._callback=t);for(var a in l._parsedSheets)a.indexOf("-layout-draft.css?")>-1?l._parsedSheets[a].parsed=!1:a.indexOf("-layout-preview.css?")>-1&&(l._parsedSheets[a].parsed=!1);for(var d=0;d<n.length;d++){var a=n[d],u=a.href,c=a.media,f=a.rel&&"stylesheet"===a.rel.toLowerCase();if(u&&f){if(u.indexOf(FLBuilderConfig.pluginUrl)>-1)continue;"undefined"!=typeof l._parsedSheets[u]&&l._parsedSheets[u].parsed?l._translate(l._parsedSheets[u].styles,u,l._parsedSheets[u].media):a.styleSheet&&a.styleSheet.rawCssText?(l._translate(a.styleSheet.rawCssText,u,c),l._parsedSheets[u]=!0):(/^([a-zA-Z:]*\/\/)/.test(u)||r)&&u.replace(RegExp.$1,"").split("/")[0]!==window.location.host||("//"===u.substring(0,2)&&(u=window.location.protocol+u),l._requestQueue.push({href:u,media:c}))}}l._makeRequests()},applyMedia:function(e){var t=FLBuilderForcedMediaQueries,l="clientWidth",i=window.document,o=i.documentElement,s=(o[l],i.getElementsByTagName("head")[0]||o),r=s.getElementsByTagName("link"),n=r[r.length-1],a=((new Date).getTime(),{}),d=t._mediaStyles,u=t._appendedEls,c=t._emInPx;t._width=e;for(var f in d)if(d.hasOwnProperty(f)){var h=d[f],p=h.minw,g=h.maxw,_=null===p,m=null===g,b="em";p&&(p=parseFloat(p)*(p.indexOf(b)>-1?c||t.getEmPixelValue():1)),g&&(g=parseFloat(g)*(g.indexOf(b)>-1?c||t.getEmPixelValue():1)),h.hasQuery&&(_&&m||!(_||e>=p)||!(m||e<=g))||(a[h.media]||(a[h.media]=[]),a[h.media].push(t._rules[h.rules]))}for(var v in u)u.hasOwnProperty(v)&&u[v]&&u[v].parentNode===s&&s.removeChild(u[v]);t._appendedEls.length=0;for(var L in a)if(a.hasOwnProperty(L)){var F=i.createElement("style"),y=a[L].join("\n");F.type="text/css",F.media=L,s.insertBefore(F,n.nextSibling),F.styleSheet?F.styleSheet.cssText=y:F.appendChild(i.createTextNode(y)),t._appendedEls.push(F)}},isUnsupportedMediaQuery:function(e){var t=FLBuilderForcedMediaQueries._regex;return e.replace(t.minmaxwh,"").match(t.other)},getEmPixelValue:function(){var e=null,t=window.document,l=t.documentElement,i=t.body,o=t.createElement("div"),s=l.style.fontSize,r=i&&i.style.fontSize,n=!1;return o.style.cssText="position:absolute;font-size:1em;width:1em",i||(i=n=t.createElement("body"),i.style.background="none"),l.style.fontSize="100%",i.style.fontSize="100%",i.appendChild(o),n&&l.insertBefore(i,l.firstChild),e=o.offsetWidth,n?l.removeChild(i):i.removeChild(o),l.style.fontSize=s,r&&(i.style.fontSize=r),e=FLBuilderForcedMediaQueries._emInPx=parseFloat(e)},_translate:function(e,t,l){var i=FLBuilderForcedMediaQueries,o=i._regex,s=e.replace(o.comments,"").replace(o.keyframes,"").match(o.media),r=s&&s.length||0;t=t.substring(0,t.lastIndexOf("/"));var n=function(e){return e.replace(o.urls,"$1"+t+"$2$3")},a=!r&&l;t.length&&(t+="/"),a&&(r=1);for(var d=0;d<r;d++){var u,c,f,h;a?(u=l,i._rules.push(n(e))):(u=s[d].match(o.findStyles)&&RegExp.$1,i._rules.push(RegExp.$2&&n(RegExp.$2))),f=u.split(","),h=f.length;for(var p=0;p<h;p++)c=f[p],i.isUnsupportedMediaQuery(c)||i._mediaStyles.push({media:c.split("(")[0].match(o.only)&&RegExp.$2||"all",rules:i._rules.length-1,hasQuery:c.indexOf("(")>-1,minw:c.match(o.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:c.match(o.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}},_makeRequests:function(){var e=FLBuilderForcedMediaQueries;if(e._requestQueue.length){var t=e._requestQueue.shift();e._ajax(t.href,function(l){e._translate(l,t.href,t.media),e._parsedSheets[t.href]={parsed:!0,styles:l,media:t.media},window.setTimeout(function(){e._makeRequests()},0)})}else e._width&&(e.applyMedia(e._width),e._callback&&(e._callback(),e._callback=null))},_ajax:function(e,t){var l=FLBuilderForcedMediaQueries._xmlHttp();l&&(l.open("GET",e,!0),l.onreadystatechange=function(){4!==l.readyState||200!==l.status&&304!==l.status||t(l.responseText)},4!==l.readyState&&l.send(null))}}}(jQuery),function(e){FLBuilderPreview=function(t){this.type=t.type,"undefined"!=t.state&&t.state?this.state=t.state:this._saveState(),"undefined"!=t.layout&&t.layout?FLBuilder._renderLayout(t.layout,e.proxy(this._init,this)):this._init()},FLBuilderPreview._fontsList={},FLBuilderPreview.prototype={type:"",nodeId:null,classes:{},elements:{},state:null,_savedSettings:null,_styleSheet:null,_styleSheetMedium:null,_styleSheetResponsive:null,_timeout:null,_lastClassName:null,_xhr:null,_init:function(){switch(this.nodeId=e(".fl-builder-settings").data("node"),this._saveSettings(),this._initElementsAndClasses(),this._createSheets(),this._initResponsivePreviews(),this._initDefaultFieldPreviews(),this.type){case"row":this._initRow();break;case"col":this._initColumn();break;case"module":this._initModule()}},_saveSettings:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings");this._savedSettings=FLBuilder._getSettings(t)},_settingsHaveChanged:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=FLBuilder._getSettings(t);return JSON.stringify(this._savedSettings)!=JSON.stringify(l)},_initElementsAndClasses:function(){var t;t="row"==this.type?".fl-row-content-wrap":".fl-"+this.type+"-content",e.extend(this.classes,{settings:".fl-builder-"+this.type+"-settings",settingsHeader:".fl-builder-"+this.type+"-settings .fl-lightbox-header",node:FLBuilder._contentClass+" .fl-node-"+this.nodeId,content:FLBuilder._contentClass+" .fl-node-"+this.nodeId+" > "+t}),e.extend(this.elements,{settings:e(this.classes.settings),settingsHeader:e(this.classes.settingsHeader),node:e(this.classes.node),content:e(this.classes.content)})},_createSheets:function(){this._styleSheet||(this._styleSheet=new FLStyleSheet({id:"fl-builder-preview"})),this._styleSheetMedium||(this._styleSheetMedium=new FLStyleSheet({id:"fl-builder-preview-medium"})),this._styleSheetResponsive||(this._styleSheetResponsive=new FLStyleSheet({id:"fl-builder-preview-responsive"}))},_destroySheets:function(){this._styleSheet&&(this._styleSheet.destroy(),this._styleSheet=null),this._styleSheetMedium&&(this._styleSheetMedium.destroy(),this._styleSheetMedium=null),this._styleSheetResponsive&&(this._styleSheetResponsive.destroy(),this._styleSheetResponsive=null)},updateCSSRule:function(e,t,l){this._styleSheet.updateRule(e,t,l)},delay:function(e,t){this._cancelDelay(),this._timeout=setTimeout(t,e)},_cancelDelay:function(){null!==this._timeout&&clearTimeout(this._timeout)},hexToRgb:function(e){var t=parseInt(e,16),l=t>>16&255,i=t>>8&255,o=255&t;return[l,i,o]},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_initResponsivePreviews:function(){FLBuilder.addHook("responsive-editing-switched",e.proxy(this._responsiveEditingSwitched,this))},_destroyResponsivePreviews:function(){FLBuilder.removeHook("responsive-editing-switched")},_responsiveEditingSwitched:function(e,t){"default"==t?(this._styleSheetMedium.disable(),this._styleSheetResponsive.disable()):"medium"==t?(this._styleSheetMedium.enable(),this._styleSheetResponsive.disable()):"responsive"==t&&(this._styleSheetMedium.disable(),this._styleSheetResponsive.enable())},updateResponsiveCSSRule:function(e,t,l){var i=FLBuilderResponsiveEditing._mode,o="default"==i?"":i.charAt(0).toUpperCase()+i.slice(1);this["_styleSheet"+o].updateRule(e,t,l)},_saveState:function(){var t=e("#fl-post-id").val(),l=e('link[href*="/cache/'+t+'"]').attr("href"),i=e('script[src*="/cache/'+t+'"]').attr("src"),o=e(FLBuilder._contentClass).html();this.state={css:l,js:i,html:o}},preview:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=t.attr("data-node"),i=FLBuilder._getSettings(t);this._cancelPreview(),this._xhr=FLBuilder.ajax({action:"render_layout",node_id:l,node_preview:i},e.proxy(this._renderPreview,this))},delayPreview:function(t){var l="undefined"==typeof t?[]:e(t.target).closest("tr").find("th"),i=e(".fl-builder-widget-settings .fl-builder-settings-title"),o=e(".fl-builder-settings .fl-lightbox-header"),s=FLBuilderLayoutConfig.paths.pluginUrl+"img/ajax-loader-small.gif",r=e('<img class="fl-builder-preview-loader" src="'+s+'" />');e(".fl-builder-preview-loader").remove(),l.length>0?l.append(r):i.length>0?i.append(r):o.length>0&&o.append(r),this.delay(1e3,e.proxy(this.preview,this))},_cancelPreview:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)},_renderPreview:function(t){this._xhr=null,FLBuilder._renderLayout(t,e.proxy(this._renderPreviewComplete,this))},_renderPreviewComplete:function(){this._initElementsAndClasses(),e(".fl-builder-preview-loader").remove(),e(FLBuilder._contentClass).trigger("fl-builder.preview-rendered")},revert:function(){this.clear(),this._settingsHaveChanged()&&FLBuilder._renderLayout(this.state)},clear:function(){this._cancelDelay(),this._cancelPreview(),this._destroySheets(),this._destroyResponsivePreviews()},_initNodeTextColor:function(){e.extend(this.elements,{textColor:e(this.classes.settings+" input[name=text_color]"),linkColor:e(this.classes.settings+" input[name=link_color]"),hoverColor:e(this.classes.settings+" input[name=hover_color]"),headingColor:e(this.classes.settings+" input[name=heading_color]")}),this.elements.textColor.on("change",e.proxy(this._textColorChange,this)),this.elements.linkColor.on("change",e.proxy(this._textColorChange,this)),this.elements.hoverColor.on("change",e.proxy(this._textColorChange,this)),this.elements.headingColor.on("change",e.proxy(this._textColorChange,this))},_textColorChange:function(t){var l=this.elements.textColor.val(),i=this.elements.linkColor.val(),o=this.elements.hoverColor.val(),s=this.elements.headingColor.val();i=""===i?l:i,o=""===o?l:o,s=""===s?l:s,this.delay(100,e.proxy(function(){""===l?this.updateCSSRule(this.classes.node,"color","inherit"):this.updateCSSRule(this.classes.node,"color","#"+l),""===i?this.updateCSSRule(this.classes.node+" a","color","inherit"):this.updateCSSRule(this.classes.node+" a","color","#"+i),""===o?this.updateCSSRule(this.classes.node+" a:hover","color","inherit"):this.updateCSSRule(this.classes.node+" a:hover","color","#"+o),""===s?(this.updateCSSRule(this.classes.node+" h1","color","inherit"),this.updateCSSRule(this.classes.node+" h2","color","inherit"),this.updateCSSRule(this.classes.node+" h3","color","inherit"),this.updateCSSRule(this.classes.node+" h4","color","inherit"),this.updateCSSRule(this.classes.node+" h5","color","inherit"),this.updateCSSRule(this.classes.node+" h6","color","inherit"),this.updateCSSRule(this.classes.node+" h1 a","color","inherit"),this.updateCSSRule(this.classes.node+" h2 a","color","inherit"),this.updateCSSRule(this.classes.node+" h3 a","color","inherit"),this.updateCSSRule(this.classes.node+" h4 a","color","inherit"),this.updateCSSRule(this.classes.node+" h5 a","color","inherit"),this.updateCSSRule(this.classes.node+" h6 a","color","inherit")):(this.updateCSSRule(this.classes.node+" h1","color","#"+s),this.updateCSSRule(this.classes.node+" h2","color","#"+s),this.updateCSSRule(this.classes.node+" h3","color","#"+s),this.updateCSSRule(this.classes.node+" h4","color","#"+s),this.updateCSSRule(this.classes.node+" h5","color","#"+s),this.updateCSSRule(this.classes.node+" h6","color","#"+s),this.updateCSSRule(this.classes.node+" h1 a","color","#"+s),this.updateCSSRule(this.classes.node+" h2 a","color","#"+s),this.updateCSSRule(this.classes.node+" h3 a","color","#"+s),this.updateCSSRule(this.classes.node+" h4 a","color","#"+s),this.updateCSSRule(this.classes.node+" h5 a","color","#"+s),this.updateCSSRule(this.classes.node+" h6 a","color","#"+s))},this))},_initNodeBg:function(){e.extend(this.elements,{bgType:e(this.classes.settings+" select[name=bg_type]"),bgColor:e(this.classes.settings+" input[name=bg_color]"),bgColorPicker:e(this.classes.settings+" .fl-picker-bg_color"),bgOpacity:e(this.classes.settings+" input[name=bg_opacity]"),bgImageSrc:e(this.classes.settings+" select[name=bg_image_src]"),bgRepeat:e(this.classes.settings+" select[name=bg_repeat]"),bgPosition:e(this.classes.settings+" select[name=bg_position]"),bgAttachment:e(this.classes.settings+" select[name=bg_attachment]"),bgSize:e(this.classes.settings+" select[name=bg_size]"),bgVideoSource:e(this.classes.settings+" select[name=bg_video_source]"),bgVideo:e(this.classes.settings+" input[name=bg_video]"),bgVideoServiceUrl:e(this.classes.settings+" input[name=bg_video_service_url]"),bgVideoFallbackSrc:e(this.classes.settings+" select[name=bg_video_fallback_src]"),bgSlideshowSource:e(this.classes.settings+" select[name=ss_source]"),bgSlideshowPhotos:e(this.classes.settings+" input[name=ss_photos]"),bgSlideshowFeedUrl:e(this.classes.settings+" input[name=ss_feed_url]"),bgSlideshowSpeed:e(this.classes.settings+" input[name=ss_speed]"),bgSlideshowTrans:e(this.classes.settings+" select[name=ss_transition]"),bgSlideshowTransSpeed:e(this.classes.settings+" input[name=ss_transitionDuration]"),bgParallaxImageSrc:e(this.classes.settings+" select[name=bg_parallax_image_src]"),bgOverlayColor:e(this.classes.settings+" input[name=bg_overlay_color]"),bgOverlayOpacity:e(this.classes.settings+" input[name=bg_overlay_opacity]")}),this.elements.bgType.on("change",e.proxy(this._bgTypeChange,this)),this.elements.bgColor.on("change",e.proxy(this._bgColorChange,this)),this.elements.bgOpacity.on("keyup",e.proxy(this._bgOpacityChange,this)),this.elements.bgImageSrc.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgRepeat.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgPosition.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgAttachment.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgSize.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgVideoServiceUrl.on("change",e.proxy(this._bgVideoChange,this)),this.elements.bgSlideshowSource.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowPhotos.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowFeedUrl.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTrans.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTransSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgParallaxImageSrc.on("change",e.proxy(this._bgParallaxChange,this)),this.elements.bgOverlayColor.on("change",e.proxy(this._bgOverlayChange,this)),this.elements.bgOverlayOpacity.on("keyup",e.proxy(this._bgOverlayChange,this))},_bgTypeChange:function(e){var t=this.elements.bgType.val();this.elements.node.removeClass("fl-row-bg-video"),this.elements.node.removeClass("fl-row-bg-slideshow"),this.elements.node.removeClass("fl-row-bg-parallax"),this.elements.node.find(".fl-bg-video").remove(),this.elements.node.find(".fl-bg-slideshow").remove(),this.elements.content.css("background-image",""),this.updateCSSRule(this.classes.content,{"background-color":"transparent","background-image":"none"}),"none"==t?this._bgOverlayClear():"color"==t?(this.elements.bgColor.trigger("change"),this._bgOverlayClear()):"photo"==t?(this.elements.bgColor.trigger("change"),this.elements.bgImageSrc.trigger("change")):"video"==t?(this.elements.bgColor.trigger("change"),this._bgVideoChange()):"slideshow"==t?(this.elements.bgColor.trigger("change"),this._bgSlideshowChange()):"parallax"==t&&(this.elements.bgColor.trigger("change"),this.elements.bgParallaxImageSrc.trigger("change"))},_bgColorChange:function(t){var l,i,o;""===this.elements.bgColor.val()||isNaN(this.elements.bgOpacity.val())?this.updateCSSRule(this.classes.content,"background-color","transparent"):(l=this.hexToRgb(this.elements.bgColor.val()),i=this.parseFloat(this.elements.bgOpacity.val())/100,o="rgba("+l.join()+", "+i+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"background-color",o)},this)))},_bgOpacityChange:function(e){this.elements.bgColor.trigger("change")},_bgPhotoChange:function(e){this.elements.bgImageSrc.val()?this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgImageSrc.val()+")","background-repeat":this.elements.bgRepeat.val(),"background-position":this.elements.bgPosition.val(),"background-attachment":this.elements.bgAttachment.val(),"background-size":this.elements.bgSize.val()}):this.updateCSSRule(this.classes.content,{"background-image":"none"})},_bgVideoChange:function(t){var l=this.elements,i=l.bgVideoSource.val(),o=l.bgVideo.val(),s=l.bgVideoServiceUrl.val(),r="https://www.youtube.com/iframe_api",n="https://player.vimeo.com/api/player.js",a=e("<script>");"video_service"==i&&""!=s?(/^(?:(?:(?:https?:)?\/\/)?(?:www.)?(?:youtu(?:be.com|.be))\/(?:watch\?v\=|v\/|embed\/)?([\w\-]+))/i.test(s)&&e('script[src*="youtube.com"').length<1?a.attr("src",r):/^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test(s)&&e('script[src*="vimeo.com"').length<1&&a.attr("src",n),a.attr("type","text/javascript").appendTo("head"),this.delay(500,e.proxy(this.preview,this))):""!=o&&this.preview()},_bgSlideshowChange:function(t){var l=this.elements,i=l.bgSlideshowSource.val(),o=l.bgSlideshowPhotos.val(),s=l.bgSlideshowFeedUrl.val(),r=l.bgSlideshowSpeed.val(),n=l.bgSlideshowTransSpeed.val();"wordpress"==i&&""===o||"smugmug"==i&&""===s||isNaN(parseInt(r))||isNaN(parseInt(n))||this.delay(500,e.proxy(this.preview,this))},_bgParallaxChange:function(e){this.elements.bgParallaxImageSrc.val()&&this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgParallaxImageSrc.val()+")","background-repeat":"no-repeat","background-position":"center center","background-attachment":"fixed","background-size":"cover"})},_bgOverlayChange:function(t){var l,i,o;""===this.elements.bgOverlayColor.val()||isNaN(this.elements.bgOverlayOpacity.val())?(this.elements.node.removeClass("fl-row-bg-overlay"),this.elements.node.removeClass("fl-col-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color","transparent")):(l=this.hexToRgb(this.elements.bgOverlayColor.val()),i=this.parseFloat(this.elements.bgOverlayOpacity.val())/100,o="rgba("+l.join()+", "+i+")",this.delay(100,e.proxy(function(){this.elements.node.hasClass("fl-col")?this.elements.node.addClass("fl-col-bg-overlay"):this.elements.node.addClass("fl-row-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color",o)},this)))},_bgOverlayClear:function(e){this.elements.bgOverlayColor.prev(".fl-color-picker-clear").trigger("click")},_initNodeBorder:function(){e.extend(this.elements,{borderType:e(this.classes.settings+" select[name=border_type]"),borderColor:e(this.classes.settings+" input[name=border_color]"),borderColorPicker:e(this.classes.settings+" .fl-picker-border_color"),borderOpacity:e(this.classes.settings+" input[name=border_opacity]")}),this.elements.borderType.on("change",e.proxy(this._borderTypeChange,this)),this.elements.borderColor.on("change",e.proxy(this._borderColorChange,this)),this.elements.borderOpacity.on("keyup",e.proxy(this._borderOpacityChange,this))},_borderTypeChange:function(e){var t=this.elements.borderType.val();this.updateCSSRule(this.classes.content,{"border-style":""===t?"none":t}),this.elements.borderColor.trigger("change"),this.elements.borderTop.trigger("keyup")},_borderColorChange:function(t){var l,i,o;""===this.elements.borderColor.val()||isNaN(this.elements.borderOpacity.val())?this.updateCSSRule(this.classes.content,"border-color","transparent"):(l=this.hexToRgb(this.elements.borderColor.val()),i=parseInt(this.elements.borderOpacity.val())/100,o="rgba("+l.join()+", "+i+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"border-color",o)},this)))},_borderOpacityChange:function(e){this.elements.borderColor.trigger("change")},_initNodeClassName:function(){e.extend(this.elements,{className:e(this.classes.settings+" input[name=class]")}),this.elements.className.on("keyup",e.proxy(this._classNameChange,this)),this._lastClassName=this.elements.className.val()},_classNameChange:function(e){var t=this.elements.className.val();null!==this._lastClassName&&this.elements.node.removeClass(this._lastClassName),this.elements.node.addClass(t),this._lastClassName=t},_initResponsiveDimensions:function(t){var l={},i=["Top","Bottom","Left","Right"],o=["","Medium","Responsive"],s=this.classes.settings,r="",n="",a=null,d=null;for(a=0;a<i.length;a++)for(d=0;d<o.length;d++)r=t+i[a]+o[d],n=t+"_"+i[a].toLowerCase(),""!=o[d]&&(n+="_"+o[d].toLowerCase()),l[r]=e(s+" input[name="+n+"]"),l[r].on("keyup",e.proxy(this._responsiveDimensionChange,this,t));e.extend(this.elements,l)},_getDimensions:function(e){for(var t=FLBuilderResponsiveEditing._mode,l=["Top","Bottom","Left","Right"],i="default"==t?"":t.charAt(0).toUpperCase()+t.slice(1),o={},s=0;s<l.length;s++)o[l[s].toLowerCase()]=this.elements[e+l[s]+i].val();return this._normalizeDimensionValues(o,e)},_responsiveDimensionChange:function(t){var l=this._getDimensions(t),i={},o="border"==t;e.each(l,function(e,l){i[t+"-"+e+(o?"-width":"")]=l}),this.updateResponsiveCSSRule(this.classes.content,i),this._positionAbsoluteBgs()},_normalizeDimensionValues:function(t,l){var i=this,o=FLBuilderResponsiveEditing._mode,s="default"==o?"":o.charAt(0).toUpperCase()+o.slice(1),l=l.split("-");return"undefined"==typeof l[1]?l[1]="":l[1]=l[1].charAt(0).toUpperCase()+l[1].slice(1),e.map(t,function(e,o){if(e=e.toLowerCase().replace(/[^a-z0-9%.\-]/g,""),""===e){var r=l[0]+o.charAt(0).toUpperCase()+o.slice(1)+l[1]+s,n=i.elements[r].attr("placeholder");n&&(e=n)}null===e||""===e||isNaN(e)||(e=parseFloat(e)+"px"),t[o]=e}),t},_positionAbsoluteBgs:function(){var t=this.elements.node.find(".fl-bg-slideshow"),l=this.elements.node.find(".fl-bg-video"),i=null,o=null,s={top:0,bottom:0,left:0,right:0};(t.length>0||l.length>0)&&(i=this._getDimensions("margin"),o=this._getDimensions("border"),e.map(s,function(e,t){i[t]&&o[t]?s[t]="calc("+i[t]+"+"+o[t]+")":i[t]?s[t]=i[t]:o[t]&&(s[t]=o[t])}),t.length>0&&(this.updateCSSRule(this.classes.node+" .fl-bg-slideshow",s),FLBuilder._resizeLayout()),l.length>0&&this.updateCSSRule(this.classes.node+" .fl-bg-video",s))},_initRow:function(){e.extend(this.elements,{width:e(this.classes.settings+" select[name=width]"),contentWidth:e(this.classes.settings+" select[name=content_width]"),height:e(this.classes.settings+" select[name=full_height]"),align:e(this.classes.settings+" select[name=content_alignment]")}),this.elements.width.on("change",e.proxy(this._rowWidthChange,this)),this.elements.contentWidth.on("change",e.proxy(this._rowContentWidthChange,this)),this.elements.height.on("change",e.proxy(this._rowHeightChange,this)),this.elements.align.on("change",e.proxy(this._rowHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),
5
+ this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_rowWidthChange:function(e){var t=this.elements.node;"full"==this.elements.width.val()?(t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"))},_rowHeightChange:function(e){var t=this.elements.node;t.removeClass("fl-row-align-top"),t.removeClass("fl-row-align-center"),"full"==this.elements.height.val()?(t.addClass("fl-row-full-height"),t.addClass("fl-row-align-"+this.elements.align.val())):t.removeClass("fl-row-full-height")},_rowContentWidthChange:function(e){var t=this.elements.content.find(".fl-row-content");"full"==this.elements.contentWidth.val()?(t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"))},_initColumn:function(){e.extend(this.elements,{size:e(this.classes.settings+" input[name=size]"),columnHeight:e(this.classes.settings+" select[name=equal_height]"),columnAlign:e(this.classes.settings+" select[name=content_alignment]"),responsiveOrder:e(this.classes.settings+" select[name=responsive_order]")}),this.elements.size.on("keyup",e.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",e.proxy(this._colHeightChange,this)),this.elements.columnAlign.on("change",e.proxy(this._colHeightChange,this)),this.elements.responsiveOrder.on("change",e.proxy(this._colResponsiveOrder,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_colSizeChange:function(){var t=8,l=100-t,i=parseFloat(this.elements.size.val()),o=this.elements.node.prev(".fl-col"),s=this.elements.node.next(".fl-col"),r=0===s.length?o:s,n=this.elements.node.siblings(".fl-col"),a=0;0===n.length||isNaN(i)||(n.each(function(){e(this).data("node")!=r.data("node")&&(l-=parseFloat(e(this)[0].style.width),a+=parseFloat(e(this)[0].style.width))}),i<t&&(i=t),i>l&&(i=l),r.css("width",100-a-i+"%"),this.elements.node.css("width",i+"%"))},_colHeightChange:function(){var e=this.elements.node.parent(".fl-col-group");e.removeClass("fl-col-group-align-top"),e.removeClass("fl-col-group-align-center"),e.removeClass("fl-col-group-align-bottom"),"yes"==this.elements.columnHeight.val()?(e.addClass("fl-col-group-equal-height"),e.addClass("fl-col-group-align-"+this.elements.columnAlign.val())):e.removeClass("fl-col-group-equal-height")},_colResponsiveOrder:function(){var e=this.elements.node.parent(".fl-col-group");"reversed"==this.elements.responsiveOrder.val()?e.addClass("fl-col-group-responsive-reversed"):e.removeClass("fl-col-group-responsive-reversed")},_initModule:function(){this._initNodeClassName(),this._initResponsiveDimensions("margin")},_initDefaultFieldPreviews:function(){for(var e=this.elements.settings.find(".fl-field"),t=null,l=null,i=0;i<e.length;i++)t=e.eq(i),l=t.data("preview"),"refresh"==l.type&&this._initFieldRefreshPreview(t),"text"==l.type&&this._initFieldTextPreview(t),"css"==l.type&&this._initFieldCSSPreview(t),"widget"==l.type&&this._initFieldWidgetPreview(t),"font"==l.type&&this._initFieldFontPreview(t)},_initFieldRefreshPreview:function(t){var l=t.data("type"),i=t.data("preview"),o=e.proxy(this.delayPreview,this);switch(l){case"text":t.find("input[type=text]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"select":t.find("select").on("change",o);break;case"color":t.find(".fl-color-picker-value").on("change",o);break;case"photo":t.find("select").on("change",o);break;case"multiple-photos":t.find("input").on("change",o);break;case"photo-sizes":t.find("select").on("change",o);break;case"video":t.find("input").on("change",o);break;case"multiple-audios":t.find("input").on("change",o);break;case"icon":t.find("input").on("change",o);break;case"form":t.delegate("input","change",o);break;case"editor":this._addTextEditorCallback(t,i);break;case"code":t.find("textarea").on("change",o);break;case"post-type":t.find("select").on("change",o);break;case"suggest":t.find(".as-values").on("change",o);break;case"unit":t.find("input[type=number]").on("keyup",o)}},_initFieldTextPreview:function(t){var l=t.data("type"),i=t.data("preview"),o=e.proxy(this._previewText,this,i);switch(l){case"text":t.find("input[type=text]").on("keyup",o);break;case"unit":t.find("input[type=number]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"code":t.find("textarea").on("change",o);break;case"editor":this._addTextEditorCallback(t,i)}},_previewText:function(t,l){var i=this.elements.node.find(t.selector),o=e("<div>"+e(l.target).val()+"</div>");i.length>0&&(o.find("script").remove(),i.html(o.html()))},_previewTextEditor:function(t,l,i){var o=this.elements.node.find(t.selector),s="undefined"!=typeof tinyMCE?tinyMCE.get(l):null,r=e("#"+l),n="";o.length>0&&(n=e(s&&"none"==r.css("display")?"<div>"+s.getContent()+"</div>":"undefined"==typeof switchEditors||"undefined"==typeof switchEditors.wpautop?"<div>"+r.val()+"</div>":"<div>"+switchEditors.wpautop(r.val())+"</div>"),n.find("script").remove(),o.html(n.html()))},_addTextEditorCallback:function(t,l){var i=t.find("textarea.wp-editor-area").attr("id"),o=null;if("refresh"==l.type)o=e.proxy(this.delayPreview,this);else{if("text"!=l.type)return;o=e.proxy(this._previewTextEditor,this,l,i)}e("#"+i).on("keyup",o),"undefined"!=typeof tinyMCE&&(editor=tinyMCE.get(i),editor.on("change",o),editor.on("keyup",o))},_initFieldFontPreview:function(t){var l=t.data("type"),i=t.data("preview");i.id=t.attr("id");var o=e.proxy(this._previewFont,this,i);"font"==l&&t.find(".fl-font-field").on("change","select",o)},_previewFont:function(t,l){var i=e(l.delegateTarget),o=i.find(".fl-font-field-font"),s=e(o).find(":selected"),r=s.parent().attr("label"),n=i.find(".fl-font-field-weight"),a=t.id+"-"+this.nodeId,d=this._getPreviewSelector(this.classes.node,t.selector);"Google"==r&&this._buildFontStylesheet(a,o.val(),n.val()),"Default"==o.val()?(this.updateCSSRule(d,"font-family",""),this.updateCSSRule(d,"font-weight","")):(this.updateCSSRule(d,"font-family",o.val()),this.updateCSSRule(d,"font-weight",n.val()))},_buildFontStylesheet:function(t,l,i){var o=FLBuilderConfig.googleFontsUrl,s="",r={},n={};r[l]=[i],FLBuilderPreview._fontsList[t]=r,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var t=FLBuilderPreview._fontsList[e];Object.keys(t).forEach(function(e){var l=t[e];n[e]=n[e]||[],l=l.filter(function(t){return n[e].indexOf(t)<0}),n[e]=n[e].concat(l)})}),e.each(n,function(e,t){s+=e+":"+t.join()+"|"}),s=o+s.slice(0,-1).replace(" ","+"),e("#fl-builder-google-fonts-preview").length<1?e("<link>").attr("id","fl-builder-google-fonts-preview").attr("type","text/css").attr("rel","stylesheet").attr("href",s).appendTo("head"):e("#fl-builder-google-fonts-preview").attr("href",s)},_initFieldCSSPreview:function(e){var t=e.data("preview"),l=null;if("undefined"!=typeof t.rules)for(l in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[l]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(t,l){switch(t.data("type")){case"text":t.find("input[type=text]").on("keyup",e.proxy(this._previewCSS,this,l));break;case"unit":t.find("input[type=number]").on("keyup",e.proxy(this._previewCSS,this,l));break;case"select":t.find("select").on("change",e.proxy(this._previewCSS,this,l));break;case"color":t.find(".fl-color-picker-value").on("change",e.proxy(this._previewColor,this,l))}},_previewCSS:function(t,l){var i=this._getPreviewSelector(this.classes.node,t.selector),o=t.property,s="undefined"==typeof t.unit?"":t.unit,r=e(l.target),n=r.val();"%"==s?n=parseInt(n)/100:n+=s,r.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(i,o,n):this.updateCSSRule(i,o,n)},_previewColor:function(t,l){var i=this._getPreviewSelector(this.classes.node,t.selector),o=e(l.target),s=o.val(),r=""===s?"inherit":"#"+s;o.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(i,t.property,r):this.updateCSSRule(i,t.property,r)},_initFieldWidgetPreview:function(t){var l=e.proxy(this.delayPreview,this);t.find("input").on("keyup",l),t.find("input[type=checkbox]").on("click",l),t.find("textarea").on("keyup",l),t.find("select").on("change",l)},_getPreviewSelector:function(e,t){for(var l="",i=t.split(","),o=0;o<i.length;o++)l+=e+" "+i[o],o!=i.length-1&&(l+=", ");return l}}}(jQuery),function(e){FLBuilderResponsiveEditing={_mode:"default",_fields:{},refreshPreview:function(){e(".fl-responsive-preview").length&&FLBuilderForcedMediaQueries.update()},_init:function(){this._bind()},_bind:function(){FLBuilder.addHook("responsive-editing-switched",this._previewSpacingFields),FLBuilder.addHook("settings-form-init",this._initSettingsForms),FLBuilder.addHook("settings-lightbox-closed",this._clearPreview),e("body").delegate(".fl-field-responsive-toggle","click",this._settingToggleClicked)},_switchTo:function(t,l){var i=e("body"),o=e(FLBuilder._contentClass),s=e(".fl-responsive-preview"),r=e(".fl-responsive-preview-mask"),n=e(".fl-content-placeholder"),a=null;if(FLBuilderResponsiveEditing._mode=t,"default"==t){if(0===n.length)return;n.after(o),n.remove(),s.remove(),r.remove()}else 0===s.length?(o.after('<div class="fl-content-placeholder"></div>'),i.prepend(wp.template("fl-responsive-preview")()),e(".fl-responsive-preview").addClass("fl-preview-"+t),e(".fl-responsive-preview-content").append(o)):(s.removeClass("fl-preview-responsive fl-preview-medium"),s.addClass("fl-preview-"+t));"responsive"==t?(a=FLBuilderConfig.global.responsive_breakpoint>=320?320:FLBuilderConfig.global.responsive_breakpoint,o.width(a),FLBuilderForcedMediaQueries.update(a,l)):"medium"==t?(a=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,o.width(a),FLBuilderForcedMediaQueries.update(a,l)):(o.width(""),FLBuilderForcedMediaQueries.update(1e4,l)),this._setContentBackgroundColor(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("responsive-editing-switched",t)},_setContentBackgroundColor:function(){var t=e(FLBuilder._contentClass),l=e(".fl-responsive-preview"),i=e(".fl-content-placeholder"),o=i.parents(),s="#fff",r=0;if(0===l.length)t.css("background-color","");else{for(;r<o.length&&(s=o.eq(r).css("background-color"),"rgba(0, 0, 0, 0)"==s);r++);t.css("background-color",s)}},_switchToAndScroll:function(t){var l=e(".fl-builder-settings").data("node"),i=void 0===l?void 0:e(".fl-node-"+l);FLBuilderResponsiveEditing._switchTo(t,function(){void 0!==i&&i&&setTimeout(function(){var t=e(window),l=e(".fl-responsive-preview-content");!l.length||t.height()<l.height()?e("html, body").animate({scrollTop:i.offset().top-100},250):scrollTo(0,0)},250)})},_clearPreview:function(){FLBuilderResponsiveEditing._switchToAndScroll("default")},_settingToggleClicked:function(){var t=e(this),l=t.data("mode");l="default"==l?"medium":"medium"==l?"responsive":"default",FLBuilderResponsiveEditing._switchAllSettingsTo(l),t.siblings(".fl-field-responsive-setting:visible").find("input").focus()},_switchAllSettingsTo:function(t){var l="dashicons-desktop dashicons-tablet dashicons-smartphone";e(".fl-field-responsive-toggle").removeClass(l),e(".fl-field-responsive-setting").hide(),l="default"==t?"dashicons-desktop":"medium"==t?"dashicons-tablet":"dashicons-smartphone",e(".fl-field-responsive-toggle").addClass(l).data("mode",t),e(".fl-field-responsive-setting-"+t).css("display","inline-block"),FLBuilderResponsiveEditing._switchToAndScroll(t)},_initSettingsForms:function(){var e=FLBuilderResponsiveEditing;Number(FLBuilderConfig.global.responsive_enabled)&&(FLBuilderResponsiveEditing._fields={},e._initFields("unit","input","keyup",e._spacingFieldKeyup,["margin_top","margin_bottom","margin_left","margin_right","padding_top","padding_bottom","padding_left","padding_right"]),e._initFields("unit","input","keyup",e._textFieldKeyup)),e._switchAllSettingsTo(e._mode)},_initFields:function(t,l,i,o,s){var r=e(".fl-builder-settings"),n=r.find(".fl-field").has(".fl-field-responsive-setting"),a=null,d=null,u=0,c=0;for("object"!=typeof this._fields[t]&&(this._fields[t]={});u<n.length;u++)if(a=n.eq(u),d=a.attr("id").replace("fl-field-",""),!("object"==typeof s&&e.inArray(d,s)<0)&&t==a.attr("data-type")&&void 0===a.attr("data-responsive-init")){this._fields[t][d]={"default":a.find(".fl-field-responsive-setting-default "+l),medium:a.find(".fl-field-responsive-setting-medium "+l),responsive:a.find(".fl-field-responsive-setting-responsive "+l)};for(c in this._fields[t][d])this._fields[t][d][c].on(i,o);this._fields[t][d]["default"].trigger(i),a.attr("data-responsive-init",1)}},_getFields:function(t){var l=e(t).closest(".fl-field");return type=l.attr("data-type"),name=l.attr("id").replace("fl-field-",""),this._fields[type][name]},_textFieldKeyup:function(){var e=FLBuilderResponsiveEditing._getFields(this),t=e["default"].attr("placeholder"),l=e["default"].val(),i=e.medium.val();""==l?e.medium.attr("placeholder",void 0===t?"":t):e.medium.attr("placeholder",l),""==i?e.responsive.attr("placeholder",e.medium.attr("placeholder")):e.responsive.attr("placeholder",i)},_spacingFieldKeyup:function(){var t=e(".fl-builder-settings"),l="row",i=e(this).closest(".fl-field").attr("id").replace("fl-field-","").split("_"),o=i[0],s=i[1],r=FLBuilderResponsiveEditing._fields.unit[o+"_"+s],n=FLBuilderConfig.global,a=null,d=r["default"].val(),u=null,c=r.medium.val(),f=null,h=(r.responsive.val(),null),p=null,g=null;t.hasClass("fl-builder-row-settings")?l="row":t.hasClass("fl-builder-col-settings")?l="col":t.hasClass("fl-builder-module-settings")&&(l="module"),e.extend(n,{col_margins:0,col_margins_medium:"",col_margins_responsive:"",col_padding:0,col_padding_medium:"",col_padding_responsive:""}),a=l+"_"+o+("margin"==o?"s":""),u=n[a],f=n[a+"_medium"],h=n[a+"_responsive"],""==f&&(""!=d?r.medium.attr("placeholder",d):""!=u&&r.medium.attr("placeholder",u)),""==h&&("module"==l&&Number(n.auto_spacing)?(p=""==f?Number(u):f,g=""==c?Number(d):c,""!=g&&(g>p||g<0)?r.responsive.attr("placeholder",p):""!=g?r.responsive.attr("placeholder",g):r.responsive.attr("placeholder",p)):(!Number(n.auto_spacing)||"padding"==o&&"top|bottom".indexOf(s)>-1)&&(""!=c?r.responsive.attr("placeholder",c):""!=f?r.responsive.attr("placeholder",f):""!=d?r.responsive.attr("placeholder",d):""!=u&&r.responsive.attr("placeholder",u)))},_previewSpacingFields:function(){var t=FLBuilderResponsiveEditing._mode,l=e(".fl-builder-settings"),i=null,o=null;if(0!==l.length&&void 0!==l.attr("data-node")){i=FLBuilderResponsiveEditing._fields.unit;for(o in i)i[o][t].trigger("keyup")}}},e(function(){FLBuilderResponsiveEditing._init()})}(jQuery),function(e){var t={init:function(){var t=e("body");t.delegate(".fl-builder-service-select","change",this._serviceChange),t.delegate(".fl-builder-service-connect-button","click",this._connectClicked),t.delegate(".fl-builder-service-account-select","change",this._accountChange),t.delegate(".fl-builder-service-account-delete","click",this._accountDeleteClicked),t.delegate(".fl-builder-campaign-monitor-client-select","change",this._campaignMonitorClientChange),t.delegate(".fl-builder-mailchimp-list-select","change",this._mailChimpListChange),t.delegate(".fl-builder-activecampaign-list_type-select","change",this._activeCampaignChange)},_startSettingsLoading:function(t){var l=e(".fl-builder-settings"),i=t.closest(".fl-builder-service-settings"),o=e(".fl-builder-service-error");l.append('<div class="fl-builder-loading"></div>'),i.addClass("fl-builder-service-settings-loading"),o.remove()},_finishSettingsLoading:function(){var t=e(".fl-builder-settings"),l=e(".fl-builder-service-settings-loading");t.find(".fl-builder-loading").remove(),l.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this),o=i.closest("tr"),s=i.val();o.siblings("tr.fl-builder-service-account-row").remove(),o.siblings("tr.fl-builder-service-connect-row").remove(),o.siblings("tr.fl-builder-service-field-row").remove(),e(".fl-builder-service-error").remove(),""!==s&&(t._startSettingsLoading(i),FLBuilder.ajax({action:"render_service_settings",node_id:l,service:s},t._serviceChangeComplete))},_serviceChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row");s.after(i.html),t._addAccountDelete(o),t._finishSettingsLoading()},_connectClicked:function(){for(var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-connect-row"),r=i.find(".fl-builder-service-connect-input"),n=null,a=null,d=0,u={action:"connect_service",node_id:l,service:o.val(),fields:{}};d<r.length;d++)n=r.eq(d),a=n.attr("name"),u.fields[a]=n.val();s.hide(),t._startSettingsLoading(o),FLBuilder.ajax(u,t._connectComplete)},_connectComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row"),r=o.find(".fl-builder-service-select"),n=o.find(".fl-builder-service-account-row"),a=o.find(".fl-builder-service-account-select"),d=o.find(".fl-builder-service-connect-row");i.error?(d.show(),0===a.length?r.after('<div class="fl-builder-service-error">'+i.error+"</div>"):a.after('<div class="fl-builder-service-error">'+i.error+"</div>")):(d.remove(),n.remove(),s.after(i.html)),t._addAccountDelete(o),t._finishSettingsLoading()},_accountChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-account-select"),r=i.find(".fl-builder-service-connect-row"),n=i.find("tr.fl-builder-service-field-row"),a=e(".fl-builder-service-error"),d=s.val(),u=null;r.remove(),n.remove(),a.remove(),"add_new_account"==d?u={action:"render_service_settings",node_id:l,service:o.val(),add_new:!0}:""!==d&&(u={action:"render_service_fields",node_id:l,service:o.val(),account:d}),u&&(t._startSettingsLoading(o),FLBuilder.ajax(u,t._accountChangeComplete)),t._addAccountDelete(i)},_accountChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-account-row");s.after(i.html),t._finishSettingsLoading()},_addAccountDelete:function(e){var t=e.find(".fl-builder-service-account-select");t.length>0&&(e.find(".fl-builder-service-account-delete").remove(),""!==t.val()&&"add_new_account"!=t.val()&&t.after('<a href="javascript:void(0);" class="fl-builder-service-account-delete">'+FLBuilderStrings.deleteAccount+"</a>"))},_accountDeleteClicked:function(){var l=e(this).closest(".fl-builder-service-settings"),i=l.find(".fl-builder-service-select"),o=l.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:i.val(),account:o.val()},t._accountDeleteComplete),t._startSettingsLoading(o))},_accountDeleteComplete:function(){var l=e(".fl-builder-service-settings-loading"),i=l.find(".fl-builder-service-select");t._finishSettingsLoading(),i.trigger("change")},_campaignMonitorClientChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-account-select"),r=e(this),n=i.find(".fl-builder-service-list-select"),a=r.val();0!==n.length&&n.closest("tr").remove(),""!==a&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:l,service:o.val(),account:s.val(),client:a},t._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-campaign-monitor-client-select");s.closest("tr").after(i.html),t._finishSettingsLoading()},_mailChimpListChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-account-select"),r=i.find(".fl-builder-service-list-select");e(".fl-builder-mailchimp-group-select").closest("tr").remove(),""!==r.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:l,service:o.val(),account:s.val(),list_id:r.val()},t._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-list-select");s.closest("tr").after(i.html),t._finishSettingsLoading()},_activeCampaignChange:function(){var l=e(".fl-builder-settings").data("node"),i=e(this).closest(".fl-builder-service-settings"),o=i.find(".fl-builder-service-select"),s=i.find(".fl-builder-service-account-select"),r=i.find(".fl-builder-service-list-select");list_type=i.find('select[name="list_type"]'),0!==r.length&&r.closest("tr").remove(),""!==list_type.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:l,service:o.val(),account:s.val(),list_type:list_type.val()},t._activeCampaignTypeChangeComplete))},_activeCampaignTypeChangeComplete:function(l){var i=JSON.parse(l),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-field-row");s.after(i.html),t._finishSettingsLoading()}};e(function(){t.init()})}(jQuery),function(e){FLBuilderTour={_tour:null,start:function(){FLBuilderTour._tour?FLBuilderTour._tour.restart():(FLBuilderTour._tour=new Tour(FLBuilderTour._config()),FLBuilderTour._tour.init()),FLBuilderTour._tour.start()},_config:function(){var t={storage:!1,onStart:FLBuilderTour._onStart,onPrev:FLBuilderTour._onPrev,onNext:FLBuilderTour._onNext,onEnd:FLBuilderTour._onEnd,template:'<div class="popover" role="tooltip"> <i class="fa fa-times" data-role="end"></i> <div class="arrow"></div> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="next">'+FLBuilderStrings.tourNext+"</button> </div> </div>",steps:[{animation:!1,element:".fl-builder-bar",placement:"bottom",title:FLBuilderStrings.tourTemplatesTitle,content:FLBuilderStrings.tourTemplates,onShown:function(){0===e(".fl-template-selector").length?(e(".popover[class*=tour-]").css("visibility","hidden"),FLBuilder._showTemplateSelector()):FLBuilderTour._templateSelectorLoaded()}},{animation:!1,element:"#fl-builder-blocks-rows .fl-builder-blocks-section-title",placement:"left",title:FLBuilderStrings.tourAddRowsTitle,content:FLBuilderStrings.tourAddRows,onShow:function(){FLBuilderTour._dimSection("body"),FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._showPanel(),e(".fl-template-selector .fl-builder-settings-cancel").trigger("click"),e("#fl-builder-blocks-rows .fl-builder-blocks-section-title").trigger("click")}},{animation:!1,element:"#fl-builder-blocks-basic .fl-builder-blocks-section-title",placement:"left",title:FLBuilderStrings.tourAddContentTitle,content:FLBuilderStrings.tourAddContent,onShow:function(){FLBuilderTour._dimSection("body"),FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._showPanel(),e("#fl-builder-blocks-basic .fl-builder-blocks-section-title").trigger("click"),e(".fl-row").eq(0).trigger("mouseleave"),e(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-row:first-of-type",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-row:first-of-type .fl-module-overlay .fl-block-overlay-actions",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent2,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-builder-add-content-button",placement:"bottom",title:FLBuilderStrings.tourAddContentButtonTitle,content:FLBuilderStrings.tourAddContentButton,onShow:function(){FLBuilderTour._dimSection("body"),e(".fl-row").eq(0).trigger("mouseleave"),e(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-builder-templates-button",placement:"bottom",title:FLBuilderStrings.tourTemplatesButtonTitle,content:FLBuilderStrings.tourTemplatesButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-tools-button",placement:"bottom",title:FLBuilderStrings.tourToolsButtonTitle,content:FLBuilderStrings.tourToolsButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-done-button",placement:"bottom",title:FLBuilderStrings.tourDoneButtonTitle,content:FLBuilderStrings.tourDoneButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,orphan:!0,backdrop:!0,title:FLBuilderStrings.tourFinishedTitle,content:FLBuilderStrings.tourFinished,template:'<div class="popover" role="tooltip"> <div class="arrow"></div> <i class="fa fa-times" data-role="end"></i> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="end">'+FLBuilderStrings.tourEnd+"</button> </div> </div>"}]};return FLBuilderConfig.lite?t.steps.shift():"disabled"==FLBuilderConfig.enabledTemplates?t.steps.shift():"fl-builder-template"==FLBuilderConfig.postType&&t.steps.shift(),t},_onStart:function(){var t=e("body");t.append('<div class="fl-builder-tour-mask"></div>'),t.on("fl-builder.template-selector-loaded",FLBuilderTour._templateSelectorLoaded),0===e(".fl-row").length&&"module"!=FLBuilderConfig.userTemplateType&&(e(".fl-builder-content").append('<div class="fl-builder-tour-demo-content fl-row fl-row-fixed-width fl-row-bg-none"> <div class="fl-row-content-wrap"> <div class="fl-row-content fl-row-fixed-width fl-node-content"> <div class="fl-col-group"> <div class="fl-col" style="width:100%"> <div class="fl-col-content fl-node-content"> <div class="fl-module fl-module-rich-text" data-type="rich-text" data-name="Text Editor"> <div class="fl-module-content fl-node-content"> <div class="fl-rich-text"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pellentesque ut lorem non cursus. Sed mauris nunc, porttitor iaculis lorem a, sollicitudin lacinia sapien. Proin euismod orci lacus, et sollicitudin leo posuere ac. In hac habitasse platea dictumst. Maecenas elit magna, consequat in turpis suscipit, ultrices rhoncus arcu. Phasellus finibus sapien nec elit tempus venenatis. Maecenas tincidunt sapien non libero maximus, in aliquam felis tincidunt. Mauris mollis ultricies facilisis. Duis condimentum dignissim tortor sit amet facilisis. Aenean gravida lacus eu risus molestie egestas. Donec ut dolor dictum, fringilla metus malesuada, viverra nunc. Maecenas ut purus ac justo aliquet lacinia. Cras vestibulum elementum tincidunt. Maecenas mattis tortor neque, consectetur dignissim neque tempor nec.</p></div> </div> </div> </div> </div> </div> </div> </div> </div>'),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols())},_onPrev:function(){e(".fl-builder-tour-dimmed").remove()},_onNext:function(){e(".fl-builder-tour-dimmed").remove()},_onEnd:function(){e("body").off("fl-builder.template-selector-loaded"),e(".fl-builder-tour-mask").remove(),e(".fl-builder-tour-dimmed").remove(),e(".fl-builder-tour-demo-content").remove(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showPanel(),FLBuilder._initTemplateSelector()},_dimSection:function(t){e(t).find(".fl-builder-tour-dimmed").remove(),e(t).append('<div class="fl-builder-tour-dimmed"></div>')},_templateSelectorLoaded:function(){var t=e(".fl-builder-settings-lightbox .fl-lightbox-header"),l=t.height(),i=t.offset().top+75;e(".popover[class*=tour-]").css({top:i+l+"px",visibility:"visible"})}}}(jQuery);var FLBuilderColorPicker;!function(e,t){function l(){var t,l,i="backgroundImage";f?h="filter":(t=e('<div id="iris-gradtest" />'),l="linear-gradient(top,#fff,#000)",e.each(p,function(e,o){if(t.css(i,o+l),t.css(i).match("gradient"))return h=e,!1}),h===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css(this.bgImageString).match("gradient")&&(h="webkit")),t.remove())}function i(t,l){return t="top"===t?"top":"left",l=e.isArray(l)?l:Array.prototype.slice.call(arguments,1),"webkit"===h?s(t,l):p[h]+"linear-gradient("+t+", "+l.join(", ")+")"}function o(t,l){var i,o,s,n,a,d,u,c,f;t="top"===t?"top":"left",l=e.isArray(l)?l:Array.prototype.slice.call(arguments,1),i="top"===t?0:1,o=e(this),s=l.length-1,n="filter",a=1===i?"left":"top",d=1===i?"right":"bottom",u=1===i?"height":"width",c='<div class="iris-ie-gradient-shim" style="position:absolute;'+u+":100%;"+a+":%start%;"+d+":%end%;"+n+':%filter%;" data-color:"%color%"></div>',f="","static"===o.css("position")&&o.css({position:"relative"}),l=r(l),e.each(l,function(e,t){var o,r,n;return e!==s&&(o=l[e+1],void(t.stop!==o.stop&&(r=100-parseFloat(o.stop)+"%",t.octoHex=new Color(t.color).toIEOctoHex(),o.octoHex=new Color(o.color).toIEOctoHex(),n="progid:DXImageTransform.Microsoft.Gradient(GradientType="+i+", StartColorStr='"+t.octoHex+"', EndColorStr='"+o.octoHex+"')",f+=c.replace("%start%",t.stop).replace("%end%",r).replace("%filter%",n))))}),o.find(".iris-ie-gradient-shim").remove(),e(f).prependTo(o)}function s(t,l){var i=[];return t="top"===t?"0% 0%,0% 100%,":"0% 100%,100% 100%,",l=r(l),e.each(l,function(e,t){i.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+i.join(",")+")"}function r(t){var l=[],i=[],o=[],s=t.length-1;return e.each(t,function(e,t){var o=t,s=!1,r=t.match(/1?[0-9]{1,2}%$/);r&&(o=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=r.shift()),l.push(o),i.push(s)}),i[0]===!1&&(i[0]="0%"),i[s]===!1&&(i[s]="100%"),i=n(i),e.each(i,function(e){o[e]={color:l[e],stop:i[e]}}),o}function n(t){var l,i,o,s,r=0,a=t.length-1,d=0,u=!1;if(t.length<=2||e.inArray(!1,t)<0)return t;for(;d<t.length-1;)u||t[d]!==!1?u&&t[d]!==!1&&(a=d,d=t.length):(r=d-1,u=!0),d++;for(i=a-r,s=parseInt(t[r].replace("%"),10),l=(parseFloat(t[a].replace("%"))-s)/i,d=r+1,o=1;d<a;)t[d]=s+o*l+"%",o++,d++;return n(t)}var a=[],d=navigator.userAgent.toLowerCase(),u="Microsoft Internet Explorer"===navigator.appName,c=u?parseFloat(d.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,f=u&&c<10,h=!1,p=["-moz-","-webkit-","-o-","-ms-"];flBuilderParseColorValue=function(e){var t=e.replace(/\s+/g,""),l=t.indexOf("rgba")!==-1?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100,i=l<100;return{value:t,alpha:l,rgba:i}},e.fn.flBuilderColorPickerGradient=function(){var t=arguments;return this.each(function(){f?o.apply(this,t):e(this).css("backgroundImage",i.apply(this,t))})},e.fn.flBuilderColorPickerRaninbowGradient=function(t,l){var i,o,s,r;for(t=t||"top",i=e.extend({},{s:100,l:50},l),o="hsl(%h%,"+i.s+"%,"+i.l+"%)",s=0,r=[];s<=360;)r.push(o.replace("%h%",s)),s+=30;return this.each(function(){e(this).flBuilderColorPickerGradient(t,r)})},FLBuilderColorPicker=function(t){this._html='<div class="fl-color-picker-ui"><div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="#"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div></div>';var l={elements:null,color:"",mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},target:!1,width:200,presets:[],labels:{colorPresets:"Color Presets",colorPicker:"Color Picker",
6
+ placeholder:"Paste color here...",removePresetConfirm:"Are you sure?",noneColorSelected:"None color selected.",alreadySaved:"%s is already a saved preset.",noPresets:"Add a color preset first.",presetAdded:"%s added to presets!"}};this.options=e.extend({},l,t),(f===!1||f===!0&&c>7)&&this._init()},FLBuilderColorPicker.prototype={_html:"",_color:"",_currentElement:"",_inited:!1,_defaultHSLControls:{horiz:"s",vert:"l",strip:"h"},_defaultHSVControls:{horiz:"h",vert:"v",strip:"s"},_scale:{h:360,s:100,l:100,v:100},_init:function(){var t=this;e(t.options.elements);this._color=new Color("#ff0000").setHSpace(t.options.mode),a=this.options.presets,h===!1&&l(),e("html").hasClass("fl-color-picker-init")?t.picker=e(".fl-color-picker-ui"):t.picker=e(this._html).appendTo("body"),u?9===c?t.picker.addClass("iris-ie-9"):c<=8&&t.picker.addClass("iris-ie-lt9"):d.indexOf("compatible")<0&&d.indexOf("khtml")<0&&d.match(/mozilla/)&&t.picker.addClass("iris-mozilla"),t.controls={square:t.picker.find(".iris-square"),squareDrag:t.picker.find(".iris-square-value"),horiz:t.picker.find(".iris-square-horiz"),vert:t.picker.find(".iris-square-vert"),strip:t.picker.find(".iris-strip"),stripSlider:t.picker.find(".iris-strip .iris-slider-offset")},"hsv"===t.options.mode&&t._has("l",t.options.controls)?t.options.controls=t._defaultHSVControls:"hsl"===t.options.mode&&t._has("v",t.options.controls)&&(t.options.controls=t._defaultHSLControls),t.hue=t._color.h(),this._setTemplates(),this._ui=e(".fl-color-picker-ui"),this._iris=e(".iris-picker"),this._wrapper=e("body"),e("html").hasClass("fl-color-picker-init")||this._ui.prepend(this._hexHtml).append(this._presetsHtml),t.element=this._ui.find(".fl-color-picker-input"),t._initControls(),t.active="external",t._change(),t._addInputListeners(t.element),this._buildUI(),this._prepareColorFields(),this._pickerControls(),this._presetsControls(),this._buildAlphaUI(),e("html").addClass("fl-color-picker-init")},_prepareColorFields:function(){var t=this;e(".fl-color-picker-value").each(function(){var l=e(this),i=l.val(),o=l.parent().find(".fl-color-picker-color"),s=flBuilderParseColorValue(i),r="";if(i){if(o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba)r=l.val().toString();else if(!o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba){var n=i.replace("rgba","rgb");n=n.substr(0,n.lastIndexOf(","))+")",t._color._alpha=1,r=n,l.val(n)}else r="#"+l.val().toString();o.css({backgroundColor:r})}})},_setTemplates:function(){this._alphaHtml='<div class="fl-alpha-wrap"><div class="fl-alpha-slider"></div><div class="fl-alpha-slider-offset"></div><div class="fl-alpha-text"></div></div>',this._presetsHtml='<div class="fl-color-picker-presets"><div class="fl-color-picker-presets-toggle"><div class="fl-color-picker-presets-open-label fl-color-picker-active">'+this.options.labels.colorPresets+' <span class="fl-color-picker-icon-arrow-up"></span></div><div class="fl-color-picker-presets-close-label">'+this.options.labels.colorPicker+' <span class="fl-color-picker-icon-arrow-down"></span></div></div><ul class="fl-color-picker-presets-list"></ul></div>',this._hexHtml='<input type="text" class="fl-color-picker-input" maxlength="7" placeholder="'+this.options.labels.placeholder+'"><div class="fl-color-picker-preset-add"></div>',this._presetsTpl='<li class="fl-color-picker-preset"><span class="fl-color-picker-preset-color"></span> <span class="fl-color-picker-preset-label"></span> <span class="fl-color-picker-preset-remove fl-color-picker-icon-remove"></span></li>',this._noPresetsTpl='<li class="fl-color-picker-no-preset"><span class="fl-color-picker-preset-label">'+this.options.labels.noPresets+"</span></li>"},_has:function(t,l){var i=!1;return e.each(l,function(e,l){if(t===l)return i=!0,!1}),i},_buildUI:function(){var t=this;t._presetsList=this._ui.find(".fl-color-picker-presets-list"),t._presetsList.html(""),this.options.presets.length>0?e.each(this.options.presets,function(e,l){t._addPresetView(l)}):t._presetsList.append(this._noPresetsTpl)},_addPresetView:function(t){var l=this._presetsList.find(".fl-color-picker-no-preset");l.length>0&&l.remove();var i=e(this._presetsTpl),o=Color(t);i.attr("data-color",t).find(".fl-color-picker-preset-color").css({backgroundColor:o.toString()}).end().find(".fl-color-picker-preset-label").html(o.toString()),this._presetsList.append(i)},_addPresetFeedback:function(){this._ui.append('<div class="fl-color-picker-added"><div class="fl-color-picker-added-text"><div class="fl-color-picker-icon-check"></div> "'+this.options.labels.presetAdded.replace("%s",this._color.toString())+'"</div></div>'),this._ui.find(".fl-color-picker-added").hide().fadeIn(200).delay(2e3).fadeOut(200,function(){e(this).remove()})},_pickerControls:function(){var t=this;this._wrapper.on("click",".fl-color-picker-color",function(){var l=e(this);t._currentElement=l.parent().find(".fl-color-picker-value"),t._ui.position({my:"left top",at:"left bottom",of:l,collision:"flipfit",using:function(e,l){t._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var l=e(this);t._currentElement=l.parent().find(".fl-color-picker-value"),l.prev(".fl-color-picker-color").css({backgroundColor:"transparent"}).addClass("fl-color-picker-empty"),t._setColor(""),t.element.val(""),t._currentElement.val("").trigger("change")}),e(document).on("click",function(t){0===e(t.target).closest(".fl-color-picker-ui").length&&e(".fl-color-picker-ui.fl-color-picker-active").removeClass("fl-color-picker-active")})},_presetsControls:function(){var t=this,l=t._ui.find(".fl-color-picker-preset-add"),i=t._ui.find(".fl-color-picker-presets"),o=i.find(".fl-color-picker-presets-open-label"),s=i.find(".fl-color-picker-presets-close-label"),r=i.find(".fl-color-picker-presets-list");l.off("click").on("click",function(){t._addPreset(t.element.val())}),r.css({height:t.element.innerHeight()+t._iris.innerHeight()+14+"px"}).hide(),i.off("click").on("click",".fl-color-picker-presets-toggle",function(){o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),r.slideToggle(500)}).on("click",".fl-color-picker-preset",function(l){var i=new Color(e(this).data("color").toString());t._setColor(i),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:i.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),r.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(l){l.stopPropagation(),t._removePreset(e(this).parent().data("color"))})},_removePreset:function(t){if(confirm(this.options.labels.removePresetConfirm)){var l=t.toString(),i=a.indexOf(l);i>-1&&(a.splice(i,1),this.options.presets=a,this._presetsList.find('.fl-color-picker-preset[data-color="'+l+'"]').slideUp(function(){e(this).remove()})),a.length<1&&this._presetsList.append(this._noPresetsTpl),e(this).trigger("presetRemoved",{presets:a})}},_addPreset:function(t){var l=t.toString().replace(/^#/,"");""===l?alert(this.options.labels.noneColorSelected):a.indexOf(l)>-1?alert(this.options.labels.alreadySaved.replace("%s","#"+l)):(this._addPresetView(l),this._addPresetFeedback(),a.push(l),this.options.presets=a,e(this).trigger("presetAdded",{presets:a}))},_togglePicker:function(e){var t=this;this._ui.hasClass("fl-color-picker-active")?(this._ui.removeClass("fl-color-picker-active"),e&&setTimeout(function(){t._ui.css(e),t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200)):(e&&t._ui.css(e),setTimeout(function(){t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200))},_paint:function(){var e=this;e._paintDimension("right","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var l,i=this,o=i._color,s=i.options.mode,r=i._getHSpaceColor(),n=i.controls[t],a=i.options.controls;if(t!==i.active&&("square"!==i.active||"strip"===t))switch(a[t]){case"h":if("hsv"===s){switch(r=o.clone(),t){case"horiz":r[a.vert](100);break;case"vert":r[a.horiz](100);break;case"strip":r.setHSpace("hsl")}l=r.toHsl()}else l="strip"===t?{s:r.s,l:r.l}:{s:100,l:r.l};n.flBuilderColorPickerRaninbowGradient(e,l);break;case"s":"hsv"===s?"vert"===t?l=[o.clone().a(0).s(0).toCSS("rgba"),o.clone().a(1).s(0).toCSS("rgba")]:"strip"===t?l=[o.clone().s(100).toCSS("hsl"),o.clone().s(0).toCSS("hsl")]:"horiz"===t&&(l=["#fff","hsl("+r.h+",100%,50%)"]):l="vert"===t&&"h"===i.options.controls.horiz?["hsla(0, 0%, "+r.l+"%, 0)","hsla(0, 0%, "+r.l+"%, 1)"]:["hsl("+r.h+",0%,50%)","hsl("+r.h+",100%,50%)"],n.flBuilderColorPickerGradient(e,l);break;case"l":l="strip"===t?["hsl("+r.h+",100%,100%)","hsl("+r.h+", "+r.s+"%,50%)","hsl("+r.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],n.flBuilderColorPickerGradient(e,l);break;case"v":l="strip"===t?[o.clone().v(100).toCSS(),o.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],n.flBuilderColorPickerGradient(e,l)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_dimensions:function(e){var t,l=this,i=l.options,o=l.controls,s=o.square,r=l.picker.find(".iris-strip"),n="77.5%",a="12%",d=20,u=i.border?i.width-d:i.width;if(e&&(s.css("width",""),r.css("width",""),l.picker.css({width:"",height:""})),n=u*(parseFloat(n)/100),a=u*(parseFloat(a)/100),t=i.border?n+d:n,s.width(n).height(n),r.height(n).width(a),l.picker.css({width:i.width,height:t}),!i.palettes)return l.picker.css("paddingBottom","")},_addInputListeners:function(e){var t=this,l=100,i=function(l){var i=new Color(e.val()),o=e.val().replace(/^#/,"");if(e.removeClass("iris-error"),i.error)""!==o&&e.addClass("iris-error");else if(i.toString()!==t._color.toString())if("keyup"===l.type){if(o.match(/^[0-9a-fA-F]{3}$/))return;t._setColor(o),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:Color(o).toString()}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change")}else if("paste"===l.type)return o=l.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=Color(o).toString(),t._setColor(o),e.val(hex),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:hex}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change"),!1};e.on("change",i).on("keyup",t._debounce(i,l))},_initControls:function(){var t=this,l=t.controls,i=l.square,o=t.options.controls,s=t._scale[o.strip];l.stripSlider.slider({orientation:"horizontal",max:s,slide:function(e,l){t.active="strip","h"===o.strip&&(l.value=s-l.value),t._color[o.strip](l.value),t._change.apply(t,arguments)}}),l.squareDrag.draggable({containment:l.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,l){t._squareDrag(e,l)},start:function(){i.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){i.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(l){var i="ui-state-focus";l.preventDefault(),"mousedown"===l.type?(t.picker.find("."+i).removeClass(i).blur(),e(this).addClass(i).focus()):e(this).removeClass(i)}).on("keydown",function(e){var i=l.square,o=l.squareDrag,s=o.position(),r=2;switch(e.altKey&&(r*=10),e.keyCode){case 37:s.left-=r;break;case 38:s.top-=r;break;case 39:s.left+=r;break;case 40:s.top+=r;break;default:return!0}s.left=Math.max(0,Math.min(s.left,i.width())),s.top=Math.max(0,Math.min(s.top,i.height())),o.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),i.mousedown(function(l){var i,o;1===l.which&&e(l.target).is("div")&&(i=t.controls.square.offset(),o={top:l.pageY-i.top,left:l.pageX-i.left},l.preventDefault(),t._squareDrag(l,{position:o}),l.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(o).trigger(l))})},_squareDrag:function(e,t){var l=this,i=l.options.controls,o=l._squareDimensions(),s=Math.round((o.h-t.position.top)/o.h*l._scale[i.vert]),r=l._scale[i.horiz]-Math.round((o.w-t.position.left)/o.w*l._scale[i.horiz]);l._color[i.horiz](r)[i.vert](s),l.active="square",l._change.apply(l,arguments)},_setColor:function(e){var t,l,i=this,o=i.options.color;i.options.color=e,e=""+e,t=e.replace(/^#/,""),l=new Color(e).setHSpace(i.options.mode),l.error?i.options.color=o:(i._color=l,i.options.color=i._color.toString(),i.active="external",i._change())},_squareDimensions:function(e){var l,i,o=this.controls.square;return e!==t&&o.data("dimensions")?o.data("dimensions"):(i=this.controls.squareDrag,l={w:o.width(),h:o.height()},o.data("dimensions",l),l)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var t=this,l=t.controls,i=t._getHSpaceColor(),o=["square","strip"],s=t.options.controls,r=s[t.active]||"external",n=t.hue;"strip"===t.active?o=[]:"external"!==t.active&&o.pop(),e.each(o,function(e,o){var r,n,a;if(o!==t.active)switch(o){case"strip":r="h"===s.strip?t._scale[s.strip]-i[s.strip]:i[s.strip],l.stripSlider.slider("value",r);break;case"square":n=t._squareDimensions(),a={left:i[s.horiz]/t._scale[s.horiz]*n.w,top:n.h-i[s.vert]/t._scale[s.vert]*n.h},t.controls.squareDrag.css(a)}}),i.h!==n&&t._isNonHueControl(t.active,r)&&t._color.h(n),t.hue=t._color.h(),t.options.color=t._color.toString(),t.element.is(":input")&&!t._color.error&&(t.element.removeClass("iris-error"),t.element.val()!==t._color.toString()&&(t.element.val(t._color.toString()),this._currentElement&&(this._currentElement.val(t._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:t._color.toString()}).removeClass("fl-color-picker-empty"),t._wrapper.find(".fl-alpha-slider-offset").css("background-color",t._color.toString()),this._currentElement.trigger("change")))),t._paint(),t._inited=!0,t.active=!1},_debounce:function(e,t,l){var i,o;return function(){var s,r,n=this,a=arguments;return s=function(){i=null,l||(o=e.apply(n,a))},r=l&&!i,clearTimeout(i),i=setTimeout(s,t),r&&(o=e.apply(n,a)),o}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var l=e(this);t._currentElement.val();l.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&e(t._alphaHtml).insertAfter(t._iris),t._pickerAlphaControls()):t._ui.find(".fl-alpha-wrap").remove()})},_pickerAlphaControls:function(){var e=this,t=e._currentElement,l=flBuilderParseColorValue(t.val()),i=parseFloat(l.alpha/100),o=e._wrapper,s=e._ui,r=s.find(".fl-alpha-wrap"),n=r.find(".fl-alpha-slider"),a=r.find(".fl-alpha-text"),d=r.find(".fl-alpha-slider-offset");alphaHandle=r.find(".ui-slider-handle"),a.text(i<1?i:""),n.slider({orientation:"vertical",slide:function(t,l){var i=parseFloat(l.value/100);e._color._alpha=i,a.text(i<1?i:""),e._change.apply(e,arguments)},create:function(){d.css({backgroundColor:l.value}),o.on("click",".fl-color-picker-clear",function(){e._color._alpha=1,a.text(""),n.slider("value",100).trigger("slide")})},value:l.alpha,step:1,min:1,max:100})}}}(jQuery),function(e,t){var l=function(e,t){return this instanceof l?this._init(e,t):new l(e,t)};l.fn=l.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var l="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),l=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":l,this[l](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var e=new l(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],i=t.length-1;i>=0;i--)e[t[i]]=this[t[i]];return e},setHSpace:function(e){return this._hSpace="hsv"===e?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,l=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),e.match(l)&&e.match(/\)$/)){if(t=e.replace(/(\s|%)/g,"").replace(l,"").replace(/,?\);?$/,"").split(","),t.length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var i=t.length-1;i>=0;i--)if(t[i]=parseInt(t[i],10),isNaN(t[i]))return this._error();return e.match(/^rgb/)?this.fromRgb({r:t[0],g:t[1],b:t[2]}):e.match(/^hsv/)?this.fromHsv({h:t[0],s:t[1],v:t[2]}):this.fromHsl({h:t[0],s:t[1],l:t[2]})}return this.fromHex(e)},fromRgb:function(e,l){return"object"!=typeof e||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),l))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var l,i,o,s,r,n,a,d;return"object"!=typeof e||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",n=e.h/360,a=e.s/100,d=e.l/100,0===a?l=i=o=d:(s=d<.5?d*(1+a):d+a-d*a,r=2*d-s,l=this.hue2rgb(r,s,n+1/3),i=this.hue2rgb(r,s,n),o=this.hue2rgb(r,s,n-1/3)),this.fromRgb({r:255*l,g:255*i,b:255*o},!0))},fromHsv:function(e){var l,i,o,s,r,n,a,d,u,c,f;if("object"!=typeof e||e.h===t||e.s===t||e.v===t)return this._error();switch(this._hsv=e,this._hSpace="hsv",l=e.h/360,i=e.s/100,o=e.v/100,a=Math.floor(6*l),d=6*l-a,u=o*(1-i),c=o*(1-d*i),f=o*(1-(1-d)*i),a%6){case 0:s=o,r=f,n=u;break;case 1:s=c,r=o,n=u;break;case 2:s=u,r=o,n=f;break;case 3:s=u,r=c,n=o;break;case 4:s=f,r=u,n=o;break;case 5:s=o,r=u,n=c}return this.fromRgb({r:255*s,g:255*r,b:255*n},!0)},fromInt:function(e,l){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),l===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?e+6*(t-e)*l:l<.5?t:l<2/3?e+(t-e)*(2/3-l)*6:e},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;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){switch(e=e||"hex",t=parseFloat(t||this._alpha),e){case"rgb":case"rgba":var l=this.toRgb();return t<1?"rgba( "+l.r+", "+l.g+", "+l.b+", "+t+" )":"rgb( "+l.r+", "+l.g+", "+l.b+" )";case"hsl":case"hsla":var i=this.toHsl();return t<1?"hsla( "+i.h+", "+i.s+"%, "+i.l+"%, "+t+" )":"hsl( "+i.h+", "+i.s+"%, "+i.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e,t,l=this.toRgb(),i=l.r/255,o=l.g/255,s=l.b/255,r=Math.max(i,o,s),n=Math.min(i,o,s),a=(r+n)/2;if(r===n)e=t=0;else{var d=r-n;switch(t=a>.5?d/(2-r-n):d/(r+n),r){case i:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-i)/d+2;break;case s:e=(i-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsl.h!==e&&(e=this._hsl.h),t=Math.round(100*t),0===t&&this._hsl.s&&(t=this._hsl.s),{h:e,s:t,l:Math.round(100*a)}},toHsv:function(){var e,t,l=this.toRgb(),i=l.r/255,o=l.g/255,s=l.b/255,r=Math.max(i,o,s),n=Math.min(i,o,s),a=r,d=r-n;if(t=0===r?0:d/r,r===n)e=t=0;else{switch(r){case i:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-i)/d+2;break;case s:e=(i-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsv.h!==e&&(e=this._hsv.h),t=Math.round(100*t),0===t&&this._hsv.s&&(t=this._hsv.s),{h:e,s:t,v:Math.round(100*a)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return 1===t.length&&(t="0"+t),"#"+t+e.replace(/^#/,"")},toLuminosity:function(){var e=this.toRgb();return.2126*Math.pow(e.r/255,2.2)+.7152*Math.pow(e.g/255,2.2)+.0722*Math.pow(e.b/255,2.2)},getDistanceLuminosityFrom:function(e){if(!(e instanceof l))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),i=e.toLuminosity();return t>i?(t+.05)/(i+.05):(i+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new l(t)},getReadableContrastingColor:function(e,i){if(!(e instanceof l))return this;var o=i===t?5:i,s=e.getDistanceLuminosityFrom(this),r=e.getMaxContrastColor(),n=r.getDistanceLuminosityFrom(e);if(n<=o)return r;if(s>=o)return this;for(var a=0===r.toInt()?-1:1;s<o&&(this.l(a,!0),s=this.getDistanceLuminosityFrom(e),0!==this._color&&16777215!==this._color););return this},a:function(e){if(e===t)return this._alpha;var l=parseFloat(e);return isNaN(l)?this._error():(this._alpha=l,this)},darken:function(e){return e=e||5,this.l(-e,!0)},lighten:function(e){return e=e||5,this.l(e,!0)},saturate:function(e){return e=e||15,this.s(e,!0)},desaturate:function(e){return e=e||15,this.s(-e,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){e=e||1;var t=180+30*e;return this.h(t,!0)},getAnalog:function(e){e=e||1;var t=30*e;return this.h(t,!0)},getTetrad:function(e){e=e||1;var t=60*e;return this.h(t,!0)},getTriad:function(e){e=e||1;var t=120*e;return this.h(t,!0)},_partial:function(e){var l=i[e];return function(i,o){var s=this._spaceFunc("to",l.space);return i===t?s[e]:(o===!0&&(i=s[e]+i),l.mod&&(i%=l.mod),l.range&&(i=i<l.range[0]?l.range[0]:i>l.range[1]?l.range[1]:i),s[e]=i,this._spaceFunc("from",l.space,s))}},_spaceFunc:function(e,t,l){var i=t||this._hSpace,o=e+i.charAt(0).toUpperCase()+i.substr(1);return this[o](l)}};var i={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var o in i)i.hasOwnProperty(o)&&(l.fn[o]=l.fn._partial(o));"object"==typeof exports?module.exports=l:e.Color=l}(this),function(e){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",open:function(e){FLIconSelector._rendered||FLIconSelector._render(),null===FLIconSelector._content?(FLIconSelector._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder.ajax({action:"render_icon_selector"},FLIconSelector._getContentComplete)):FLIconSelector._lightbox.open(),FLIconSelector._lightbox.on("icon-selected",function(t,l){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),e(l)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0},_getContentComplete:function(t){var l=JSON.parse(t);FLIconSelector._content=l.html,FLIconSelector._lightbox.setContent(l.html),e(".fl-icons-filter-select").on("change",FLIconSelector._filter),e(".fl-icons-filter-text").on("keyup",FLIconSelector._filter),e(".fl-icons-list i").on("click",FLIconSelector._select),e(".fl-icon-selector-cancel").on("click",e.proxy(FLIconSelector._lightbox.close,FLIconSelector._lightbox))},_filter:function(){var t=e(".fl-icons-filter-select").val(),l=e(".fl-icons-filter-text").val();"all"==t?e(".fl-icons-section").show():(e(".fl-icons-section").hide(),e(".fl-"+t).show()),FLIconSelector._filterText=l,""!==l?e(".fl-icons-list i").each(FLIconSelector._filterIcon):e(".fl-icons-list i").show()},_filterIcon:function(){var t=e(this);-1==t.attr("class").indexOf(FLIconSelector._filterText)?t.hide():t.show()},_select:function(){var t=e(this).attr("class");FLIconSelector._lightbox.trigger("icon-selected",t)}}}(jQuery),function(e){FLStyleSheet=function(t){"object"==typeof t&&e.extend(this,t),this._createSheet()},FLStyleSheet.prototype={id:null,_sheet:null,_sheetElement:null,updateRule:function(e,t,l){for(var i=this._sheet.cssRules?this._sheet.cssRules:this._sheet.rules,o=null,s=0;s<i.length;s++)i[s].selectorText.toLowerCase()==e.toLowerCase()&&(o=i[s]);if(o)if("object"==typeof t)for(s in t)o.style[this._toCamelCase(s)]=t[s];else o.style[this._toCamelCase(t)]=l;else this.addRule(e,t,l)},addRule:function(e,t,l){var i="",o="";if("object"==typeof t)for(o in t)i+=o+":"+t[o]+";";else i=t+":"+l+";";this._sheet.insertRule?this._sheet.insertRule(e+" { "+i+" }",this._sheet.cssRules.length):this._sheet.addRule(e,i)},destroy:function(){this._sheetElement&&(this._sheetElement.remove(),this._sheetElement=null),this._sheet&&(this._sheet=null)},disable:function(){this._sheet.disabled=!0},enable:function(){this._sheet.disabled=!1},_createSheet:function(){var t=this.id?' id="'+this.id+'"':"";this._sheet||(this._sheetElement=e('<style type="text/css"'+t+"></style>"),e("body").append(this._sheetElement),this._sheet=this._sheetElement[0].sheet)},_toCamelCase:function(e){return e.toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}}(jQuery);
js/fl-lightbox.js CHANGED
@@ -141,11 +141,6 @@
141
  */
142
  close: function()
143
  {
144
- // Temporary fix for link editor not closing since WP 4.5
145
- if ( 'undefined' != typeof tinymce && 'undefined' != typeof tinymce.EditorManager.activeEditor && tinymce.EditorManager.activeEditor != null ) {
146
- tinymce.EditorManager.activeEditor.hide();
147
- }
148
-
149
  this._node.hide();
150
  this._visible = false;
151
  this.trigger('close');
141
  */
142
  close: function()
143
  {
 
 
 
 
 
144
  this._node.hide();
145
  this._visible = false;
146
  this.trigger('close');
languages/af_ZA.mo ADDED
Binary file
languages/ar.mo CHANGED
Binary file
languages/cs_CZ.mo CHANGED
Binary file
languages/da_DK.mo CHANGED
Binary file
languages/de.mo ADDED
Binary file
languages/el_GR.mo ADDED
Binary file
languages/es.mo ADDED
Binary file
languages/es_MX.mo CHANGED
Binary file
languages/fa.mo ADDED
Binary file
languages/fi.mo CHANGED
Binary file
languages/fr.mo ADDED
Binary file
languages/fr_CA.mo CHANGED
Binary file
languages/he_IL.mo CHANGED
Binary file
languages/hi_IN.mo ADDED
Binary file
languages/hr.mo CHANGED
Binary file
languages/hu.mo ADDED
Binary file
languages/id.mo ADDED
Binary file
languages/it.mo ADDED
Binary file
languages/ja_JP.mo ADDED
Binary file
languages/ko_KR.mo CHANGED
Binary file
languages/mr.mo CHANGED
Binary file
languages/ms.mo ADDED
Binary file
languages/nb_NO.mo ADDED
Binary file
languages/nl.mo ADDED
Binary file
languages/pl.mo ADDED
Binary file
languages/pt.mo ADDED
Binary file
languages/pt_BR.mo CHANGED
Binary file
languages/ru.mo ADDED
Binary file
languages/sk.mo ADDED
Binary file
languages/sl_SI.mo ADDED
Binary file
languages/sv_SE.mo CHANGED
Binary file
languages/th.mo CHANGED
Binary file
languages/tl_PH.mo ADDED
Binary file
languages/tr.mo ADDED
Binary file
languages/uk_UA.mo ADDED
Binary file
languages/vi_VN.mo ADDED
Binary file
languages/zh_CN.mo CHANGED
Binary file
languages/zh_TW.mo CHANGED
Binary file
modules/photo/css/frontend.responsive.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /* Mobile Photo */
2
+ .fl-photo-content {
3
+ width: 100%;
4
+ }
modules/photo/photo.php CHANGED
@@ -192,19 +192,21 @@ class FLPhotoModule extends FLBuilderModule {
192
  public function get_classes()
193
  {
194
  $classes = array( 'fl-photo-img' );
195
-
196
  if ( $this->settings->photo_source == 'library' && ! empty( $this->settings->photo ) ) {
197
-
198
  $data = self::get_data();
199
-
200
  if ( is_object( $data ) ) {
201
-
202
- $classes[] = 'wp-image-' . $data->id;
 
 
203
 
204
  if ( isset( $data->sizes ) ) {
205
 
206
  foreach ( $data->sizes as $key => $size ) {
207
-
208
  if ( $size->url == $this->settings->photo_src ) {
209
  $classes[] = 'size-' . $key;
210
  break;
192
  public function get_classes()
193
  {
194
  $classes = array( 'fl-photo-img' );
195
+
196
  if ( $this->settings->photo_source == 'library' && ! empty( $this->settings->photo ) ) {
197
+
198
  $data = self::get_data();
199
+
200
  if ( is_object( $data ) ) {
201
+
202
+ if( isset( $data->id ) ) {
203
+ $classes[] = 'wp-image-' . $data->id;
204
+ }
205
 
206
  if ( isset( $data->sizes ) ) {
207
 
208
  foreach ( $data->sizes as $key => $size ) {
209
+
210
  if ( $size->url == $this->settings->photo_src ) {
211
  $classes[] = 'size-' . $key;
212
  break;
modules/video/video.php CHANGED
@@ -143,9 +143,11 @@ FLBuilder::register_module('FLVideoModule', array(
143
  )
144
  ),
145
  'embed_code' => array(
146
- 'type' => 'textarea',
147
- 'label' => __( 'Video Embed Code', 'fl-builder' ),
148
- 'rows' => '6'
 
 
149
  )
150
  )
151
  )
143
  )
144
  ),
145
  'embed_code' => array(
146
+ 'type' => 'code',
147
+ 'wrap' => true,
148
+ 'editor' => 'html',
149
+ 'label' => '',
150
+ 'rows' => '9'
151
  )
152
  )
153
  )
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Beaver Builder - WordPress Page Builder ===
2
- Contributors: justinbusa, RobbyMcCullough, billyyoung, hinampaksh, diegoliv, webmandesign, eugenealegiojo, helgatheviking, ozancanakli, brentjettgmailcom, jproffitt71, brainstormforce, ideaboxcreations, laubsterboy, nikolayyordanov
3
- Tags: beaver builder, page builder, page builder plugin, design, wysiwyg, home page builder, template builder, layout builder, landing page builder, website builder, site builder, front-end builder, drag and drop builder, editor, front-end editor, page layout, visual builder
4
  Requires at least: 3.6
5
- Tested up to: 4.7
6
- Stable tag: trunk
7
  License: GPL2+
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
1
  === Beaver Builder - WordPress Page Builder ===
2
+ Contributors: justinbusa, RobbyMcCullough, billyyoung, hinampaksh, diegoliv, webmandesign, eugenealegiojo, helgatheviking, ozancanakli, brentjettgmailcom, jproffitt71, brainstormforce, ideaboxcreations, laubsterboy, nikolayyordanov, codente, pross
3
+ Tags: page builder, drag and drop, front-end, editor, landing page
4
  Requires at least: 3.6
5
+ Tested up to: 4.7.3
6
+ Stable tag: 1.9.5.1
7
  License: GPL2+
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9