WordPress Page Builder – Beaver Builder - Version 1.8.1

Version Description

Download this release

Release Info

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

Code changes from version 1.7.8 to 1.8.1

Files changed (87) hide show
  1. changelog.txt +76 -27
  2. classes/class-fl-builder-admin-posts.php +24 -5
  3. classes/class-fl-builder-admin-settings.php +100 -178
  4. classes/class-fl-builder-admin.php +110 -179
  5. classes/class-fl-builder-ajax-layout.php +27 -8
  6. classes/class-fl-builder-ajax.php +35 -11
  7. classes/class-fl-builder-export.php +113 -0
  8. classes/class-fl-builder-extensions.php +39 -0
  9. classes/class-fl-builder-fonts.php +5 -1
  10. classes/class-fl-builder-icons.php +5 -0
  11. classes/class-fl-builder-import.php +46 -0
  12. classes/class-fl-builder-importer.php +179 -0
  13. classes/class-fl-builder-loader.php +136 -0
  14. classes/class-fl-builder-loop.php +13 -0
  15. classes/class-fl-builder-model.php +419 -198
  16. classes/class-fl-builder-module.php +4 -2
  17. classes/class-fl-builder-shortcodes.php +1 -0
  18. classes/class-fl-builder-update.php +15 -2
  19. classes/class-fl-builder.php +368 -451
  20. css/fl-builder-admin-settings.css +1 -10
  21. css/fl-builder-export.css +14 -0
  22. css/fl-builder-layout-responsive.css +39 -9
  23. css/fl-builder-layout.css +66 -22
  24. css/fl-builder.css +76 -12
  25. css/fl-builder.min.css +1 -1
  26. css/fl-lightbox.css +30 -0
  27. {classes → extensions/fl-builder-multisite/classes}/class-fl-builder-multisite.php +32 -5
  28. extensions/fl-builder-multisite/fl-builder-multisite.php +13 -0
  29. fl-builder.php +4 -98
  30. img/templates-preview.jpg +0 -0
  31. includes/admin-settings-editing.php +1 -5
  32. includes/admin-settings-upgrade.php +16 -6
  33. includes/admin-settings-welcome.php +24 -11
  34. includes/column-css.php +4 -4
  35. includes/column-settings.php +61 -0
  36. includes/export-filters.php +8 -0
  37. includes/export.php +438 -0
  38. includes/field-time.php +4 -0
  39. includes/field.php +6 -2
  40. includes/layout-settings.php +2 -2
  41. includes/module-settings.php +31 -0
  42. includes/row-css.php +6 -6
  43. includes/row-settings.php +84 -0
  44. includes/row-video.php +16 -1
  45. includes/settings.php +3 -0
  46. includes/strings.php +14 -0
  47. includes/template-selector.php +57 -0
  48. includes/ui-js-config.php +135 -132
  49. includes/ui-js-templates.php +2 -22
  50. includes/ui-panel-module-templates.php +20 -0
  51. includes/ui-panel-row-templates.php +20 -0
  52. includes/ui-panel.php +8 -42
  53. includes/updater-config.php +1 -1
  54. includes/updater/includes/form.php +4 -4
  55. js/fl-builder-admin-settings.js +0 -30
  56. js/fl-builder-export.js +100 -0
  57. js/fl-builder-preview.js +40 -7
  58. js/fl-builder.js +194 -65
  59. js/fl-builder.min.js +5 -5
  60. js/fl-lightbox.js +102 -2
  61. json/font-awesome.json +1 -1
  62. languages/ar.mo +0 -0
  63. languages/cs_CZ.mo +0 -0
  64. languages/da_DK.mo +0 -0
  65. languages/de_DE.mo +0 -0
  66. languages/es_ES.mo +0 -0
  67. languages/fa_IR.mo +0 -0
  68. languages/fi.mo +0 -0
  69. languages/fr_CA.mo +0 -0
  70. languages/fr_FR.mo +0 -0
  71. languages/he_IL.mo +0 -0
  72. languages/hr.mo +0 -0
  73. languages/hu_HU.mo +0 -0
  74. languages/it_IT.mo +0 -0
  75. languages/ja.mo +0 -0
  76. languages/nl_NL.mo +0 -0
  77. languages/no_NO.mo +0 -0
  78. languages/pl_PL.mo +0 -0
  79. languages/pt_BR.mo +0 -0
  80. languages/pt_PT.mo +0 -0
  81. languages/ru_RU.mo +0 -0
  82. languages/sk_SK.mo +0 -0
  83. languages/sl_SL.mo +0 -0
  84. languages/sv_SE.mo +0 -0
  85. languages/th.mo +0 -0
  86. modules/photo/includes/frontend.php +2 -1
  87. modules/rich-text/includes/frontend.php +7 -1
changelog.txt CHANGED
@@ -1,4 +1,79 @@
1
- <h4>1.7.8 - 04/20/2016</h4>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <p><strong>Bug Fixes</strong></p>
3
  <ul>
4
  <li>Fixed a bug in the Post Carousel and Post Slider modules caused in 1.7.7 that broke the offset setting.</li>
@@ -176,32 +251,6 @@
176
  <li>Fixed a CSS bug with custom column widths on small devices.</li>
177
  </ul>
178
 
179
- <h4>1.7-beta.2 - 1/10/2016</h4>
180
- <p><strong>Enhancements</strong></p>
181
- <ul>
182
- <li>Builder caching is now disabled when WP_DEBUG is set to true.</li>
183
- </ul>
184
- <p><strong>Bug Fixes</strong></p>
185
- <ul>
186
- <li>Fixed a bug with the Subscribe Form module.</li>
187
- <li>Fixed CSS specificity issues with the new builder shortcode.</li>
188
- </ul>
189
-
190
- <h4>1.7-beta.1 - 12/16/2015</h4>
191
- <p><strong>Enhancements</strong></p>
192
- <ul>
193
- <li>Added partial refresh for all rows, columns, and modules. Developers will need to read the custom module docs for info on making their modules compatible with partial refresh.</li>
194
- <li>Added the Layout Settings panel with per-page CSS and JavaScript settings.</li>
195
- <li>Added CSS and JavaScript settings to the Global Settings panel.</li>
196
- <li>Added the Audio module.</li>
197
- <li>Added the Countdown module.</li>
198
- <li>Added new style settings to the Pricing Table module for achieving a variety of different looks.</li>
199
- <li>Added the fl_builder_insert_layout shortcode for inserting builder saved templates, rows, modules anywhere in your posts.</li>
200
- <li>Added the FLBuilder::render_query method for rendering layouts anywhere within a theme's PHP files.</li>
201
- <li>Refactored frontend AJAX actions and rendering to support partial refresh. Developers tapping into those actions may need to update their code.</li>
202
- <li>Optimized loading of the builder UI by concatenating and minifying all core CSS and JavaScript files.</li>
203
- </ul>
204
-
205
  <h4>1.6.4.7 - 1/10/2016</h4>
206
  <p><strong>Enhancements</strong></p>
207
  <ul>
1
+ <h4>1.8.1 - 06/15/2016</h4>
2
+ <p><strong>Bug Fixes</strong></p>
3
+ <ul>
4
+ <li>Fixed a bug with the text editor field stripping line breaks in 1.8.</li>
5
+ <li>Fixed a bug that caused the visual text editor to break in 1.8.</li>
6
+ <li>Fixed a bug with the index.html file in the icons cache folder causing an error.</li>
7
+ <li>Fixed a bug with vertically centered columns also centering content horizontally.</li>
8
+ <li>Fixed a bug with hooking rows via the shortcode breaking the builder UI.</li>
9
+ <li>Fixed a bug with layout templates showing in row/module positions in the content sidebar when using the Agency override feature.</li>
10
+ <li>Fixed a bug with backgrounds, padding, and margins where they were applied to all elements when using the shortcode.</li>
11
+ <li>Fixed a bug with resizing the Testimonials module on large/medium devices.</li>
12
+ <li>Fixed a number of minor CSS bugs.</li>
13
+ <li>Fixed a number of minor issues with the Menu module.</li>
14
+ <li>Fixed editing performance issues with AJAX layout rendering on large pages.</li>
15
+ </ul>
16
+
17
+ <h4>1.8 - 06/07/2016</h4>
18
+ <p>This update adds a number of new features. Be sure to check out <a href="https://www.wpbeaverbuilder.com/beaver-builder-1-8-gordon/">the blog post</a> for detailed info on what was added.</p>
19
+ <p><strong>Enhancements</strong></p>
20
+ <ul>
21
+ <li>Added 16 new home page templates.</li>
22
+ <li>Added the ability for theme authors to load third party templates into all version of the builder (including the lite) using the new Template Data Exporter. Please <a href="https://www.wpbeaverbuilder.com/knowledge-base/theme-author-templates/">read the docs</a> for more info on that.</li>
23
+ <li>Added the ability to export single templates or groups of templates using the WordPress Exporter.</li>
24
+ <li>Added a patch for the WordPress Importer to prevent it from breaking imports in certain situations.</li>
25
+ <li>Added a setting in the advanced tab to show rows/modules/columns based on if a user is logged in, logged out, or never show them (they only appear while editing). You can also choose the capability logged in users must have to see a row/column/module.</li>
26
+ <li>Added a setting in the advanced tab to reverse the column stacking order on smaller devices.</li>
27
+ <li>Added settings to vertically center or top align content in full height rows and equal height columns.</li>
28
+ <li>Added settings to add a video background to a row using external links instead of the media library.</li>
29
+ <li>Added settings in the Icon Group module to choose individual icon colors and link targets.</li>
30
+ <li>Added settings in the Heading module to set the line-height and letter spacing.</li>
31
+ <li>Added settings in the Separator module to set the width and alignment.</li>
32
+ <li>Added a setting to the Accordion module that makes the first item open by default.</li>
33
+ <li>Added a setting in the Posts module to customize the "No Posts Found" message.</li>
34
+ <li>Added settings to all modules with buttons for fading in icons on hover and choosing a hover opacity for transparent backgrounds.</li>
35
+ <li>Added settings to the Contact Form module for customizing the button.</li>
36
+ <li>Made changes to the Contact Form module so the recipient's email address is no longer visible in the markup.</li>
37
+ <li>Captions are now displayed in the Gallery module's lightbox.</li>
38
+ <li>PHP files can now be used to register templates and load template data from the database.</li>
39
+ <li>Added caching to FLBuilderModel::get_user_template_type to cut down on the number of queries it runs.</li>
40
+ <li>The form validation required message is now translatable.</li>
41
+ <li>Empty index files are now added the cache directories to prevent browsing.</li>
42
+ <li>Added a button for resizing settings lightboxes so they fill the screen.</li>
43
+ <li>Added support for oEmbeds in the Text Editor module.</li>
44
+ <li>Changed row and module templates to saved rows and modules.</li>
45
+ <li>Tweaked templates admin settings terminology.</li>
46
+ <li>Tweaked draft and discard button terminology.</li>
47
+ <li>Added CSS/JavaScript to layout settings button and panel.</li>
48
+ <li>Increased size of the publish button.</li>
49
+ <li>Added a setting to collapse inactive items in accordion mode for the Menu module.</li>
50
+ <li>Updated Font Awesome.</li>
51
+ <li>Sticky posts are no longer included when using the fl_builder_insert_layout shortcode.</li>
52
+ <li>Added an above title option for image position in the Posts module.</li>
53
+ </ul>
54
+ <p><strong>Bug Fixes</strong></p>
55
+ <ul>
56
+ <li>Fixed issues with exporting and importing new templates.</li>
57
+ <li>Fixed issues with layout CSS/JS not exporting and importing.</li>
58
+ <li>Fixed incorrect module paths on Windows servers.</li>
59
+ <li>Fixed the alignment setting preview for the Heading module. </li>
60
+ <li>Fixed the incorrect load order of FLBuilder::render_query CSS in IE.</li>
61
+ <li>Fixed RTL issues with the Content Slider and Post Slider modules.</li>
62
+ <li>Fixed an IE11 bug with images that have height:auto in equal height columns.</li>
63
+ <li>Fixed a PHP notice when adding Post Slider and Post Carousel modules to the page.</li>
64
+ <li>Fixed a PHP error when the time field is used inside a nested form.</li>
65
+ <li>Fixed a bug with duplicate rows adding backslashes to text.</li>
66
+ <li>Fixed a bug with nested Tab modules via the fl_builder_insert_layout shortcode.</li>
67
+ <li>Fixed an issue with sticky posts being included when using the fl_builder_insert_layout shortcode.</li>
68
+ <li>Fixed a PHP notice when using the fl_builder_insert_layout shortcode on a 404 page.</li>
69
+ <li>Fixed TinyMCE link editor not closing since WordPress 4.5.</li>
70
+ <li>Fixed a fatal error with the new Template Data Exporter caused by unsupported syntax in certain PHP versions.</li>
71
+ <li>Fixed a PHP warning caused by plugin activation.</li>
72
+ <li>Fixed the display of SVG files in the Photo module.</li>
73
+ <li>Fixed CSS specificity issues in IE when using the fl_builder_render_layout shortcode.</li>
74
+ </ul>
75
+
76
+ <h4>1.7.8 - 04/20/2016</h4>
77
  <p><strong>Bug Fixes</strong></p>
78
  <ul>
79
  <li>Fixed a bug in the Post Carousel and Post Slider modules caused in 1.7.7 that broke the offset setting.</li>
251
  <li>Fixed a CSS bug with custom column widths on small devices.</li>
252
  </ul>
253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  <h4>1.6.4.7 - 1/10/2016</h4>
255
  <p><strong>Enhancements</strong></p>
256
  <ul>
classes/class-fl-builder-admin-posts.php CHANGED
@@ -7,6 +7,23 @@
7
  */
8
  final class FLBuilderAdminPosts {
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Sets the body class, loads assets and renders the UI
12
  * if we are on a post type that supports the builder.
@@ -14,7 +31,7 @@ final class FLBuilderAdminPosts {
14
  * @since 1.0
15
  * @return void
16
  */
17
- static public function init()
18
  {
19
  global $pagenow;
20
 
@@ -24,9 +41,9 @@ final class FLBuilderAdminPosts {
24
  $screen = get_current_screen();
25
 
26
  if ( in_array( $screen->post_type, $post_types ) ) {
27
- add_filter( 'admin_body_class', 'FLBuilderAdminPosts::body_class', 99 );
28
- add_action( 'admin_enqueue_scripts', 'FLBuilderAdminPosts::styles_scripts' );
29
- add_action( 'edit_form_after_title', 'FLBuilderAdminPosts::render' );
30
  }
31
  }
32
  }
@@ -133,4 +150,6 @@ final class FLBuilderAdminPosts {
133
 
134
  return $location;
135
  }
136
- }
 
 
7
  */
8
  final class FLBuilderAdminPosts {
9
 
10
+ /**
11
+ * Initialize hooks.
12
+ *
13
+ * @since 1.8
14
+ * @return void
15
+ */
16
+ static public function init()
17
+ {
18
+ /* Actions */
19
+ add_action('current_screen', __CLASS__ . '::init_rendering');
20
+
21
+ /* Filters */
22
+ add_filter('redirect_post_location', __CLASS__ . '::redirect_post_location');
23
+ add_filter('page_row_actions', __CLASS__ . '::render_row_actions_link');
24
+ add_filter('post_row_actions', __CLASS__ . '::render_row_actions_link');
25
+ }
26
+
27
  /**
28
  * Sets the body class, loads assets and renders the UI
29
  * if we are on a post type that supports the builder.
31
  * @since 1.0
32
  * @return void
33
  */
34
+ static public function init_rendering()
35
  {
36
  global $pagenow;
37
 
41
  $screen = get_current_screen();
42
 
43
  if ( in_array( $screen->post_type, $post_types ) ) {
44
+ add_filter( 'admin_body_class', __CLASS__ . '::body_class', 99 );
45
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
46
+ add_action( 'edit_form_after_title', __CLASS__ . '::render' );
47
  }
48
  }
49
  }
150
 
151
  return $location;
152
  }
153
+ }
154
+
155
+ FLBuilderAdminPosts::init();
classes/class-fl-builder-admin-settings.php CHANGED
@@ -16,6 +16,17 @@ final class FLBuilderAdminSettings {
16
  */
17
  static public $errors = array();
18
 
 
 
 
 
 
 
 
 
 
 
 
19
  /**
20
  * Adds the admin menu and enqueues CSS/JS if we are on
21
  * the builder admin settings page.
@@ -23,12 +34,16 @@ final class FLBuilderAdminSettings {
23
  * @since 1.0
24
  * @return void
25
  */
26
- static public function init()
27
  {
28
- add_action( 'admin_menu', 'FLBuilderAdminSettings::menu' );
 
 
 
 
29
 
30
  if ( isset( $_REQUEST['page'] ) && 'fl-builder-settings' == $_REQUEST['page'] ) {
31
- add_action( 'admin_enqueue_scripts', 'FLBuilderAdminSettings::styles_scripts' );
32
  self::save();
33
  }
34
  }
@@ -64,7 +79,7 @@ final class FLBuilderAdminSettings {
64
  $title = FLBuilderModel::get_branding();
65
  $cap = 'delete_users';
66
  $slug = 'fl-builder-settings';
67
- $func = 'FLBuilderAdminSettings::render';
68
 
69
  add_submenu_page( 'options-general.php', $title, $title, $cap, $slug, $func );
70
  }
@@ -142,60 +157,66 @@ final class FLBuilderAdminSettings {
142
  */
143
  static public function render_nav_items()
144
  {
145
- $item_data = array(
146
  'welcome' => array(
147
- 'title' => __( 'Welcome', 'fl-builder' ),
148
- 'show' => FLBuilderModel::get_branding() == __( 'Page Builder', 'fl-builder' ) && ( is_network_admin() || ! self::multisite_support() )
 
149
  ),
150
  'license' => array(
151
- 'title' => __( 'License', 'fl-builder' ),
152
- 'show' => FL_BUILDER_LITE !== true && ( is_network_admin() || ! self::multisite_support() )
 
153
  ),
154
  'upgrade' => array(
155
- 'title' => __( 'Upgrade', 'fl-builder' ),
156
- 'show' => FL_BUILDER_LITE === true
 
157
  ),
158
  'modules' => array(
159
- 'title' => __( 'Modules', 'fl-builder' ),
160
- 'show' => true
161
- ),
162
- 'templates' => array(
163
- 'title' => __( 'Templates', 'fl-builder' ),
164
- 'show' => FL_BUILDER_LITE !== true
165
  ),
166
  'post-types' => array(
167
- 'title' => __( 'Post Types', 'fl-builder' ),
168
- 'show' => true
 
169
  ),
170
  'icons' => array(
171
- 'title' => __( 'Icons', 'fl-builder' ),
172
- 'show' => FL_BUILDER_LITE !== true
 
173
  ),
174
  'editing' => array(
175
- 'title' => __( 'Editing', 'fl-builder' ),
176
- 'show' => true
177
- ),
178
- 'branding' => array(
179
- 'title' => __( 'Branding', 'fl-builder' ),
180
- 'show' => self::has_support( 'branding' ) && ( is_network_admin() || ! self::multisite_support() )
181
- ),
182
- 'help-button' => array(
183
- 'title' => __( 'Help Button', 'fl-builder' ),
184
- 'show' => self::has_support( 'help-button' ) && ( is_network_admin() || ! self::multisite_support() )
185
  ),
186
  'cache' => array(
187
- 'title' => __( 'Cache', 'fl-builder' ),
188
- 'show' => true
 
189
  ),
190
  'uninstall' => array(
191
- 'title' => __( 'Uninstall', 'fl-builder' ),
192
- 'show' => is_network_admin() || ! self::multisite_support()
 
193
  ),
194
- );
 
 
195
 
196
  foreach ( $item_data as $key => $data ) {
 
 
 
 
 
 
 
197
  if ( $data['show'] ) {
198
- echo '<li><a href="#' . $key . '">' . $data['title'] . '</a></li>';
199
  }
200
  }
201
  }
@@ -226,9 +247,6 @@ final class FLBuilderAdminSettings {
226
  // Modules
227
  self::render_form( 'modules' );
228
 
229
- // Templates
230
- self::render_form( 'templates' );
231
-
232
  // Post Types
233
  self::render_form( 'post-types' );
234
 
@@ -238,17 +256,14 @@ final class FLBuilderAdminSettings {
238
  // Editing
239
  self::render_form( 'editing' );
240
 
241
- // Branding
242
- self::render_form( 'branding' );
243
-
244
- // Help Button
245
- self::render_form( 'help-button' );
246
-
247
  // Cache
248
  self::render_form( 'cache' );
249
 
250
  // Uninstall
251
  self::render_form( 'uninstall' );
 
 
 
252
  }
253
 
254
  /**
@@ -348,14 +363,14 @@ final class FLBuilderAdminSettings {
348
  }
349
 
350
  self::save_enabled_modules();
351
- self::save_enabled_templates();
352
  self::save_enabled_post_types();
353
  self::save_enabled_icons();
354
  self::save_editing_capability();
355
- self::save_branding();
356
- self::save_help_button();
357
  self::clear_cache();
358
  self::uninstall();
 
 
 
359
  }
360
 
361
  /**
@@ -379,30 +394,6 @@ final class FLBuilderAdminSettings {
379
  }
380
  }
381
 
382
- /**
383
- * Saves the enabled templates.
384
- *
385
- * @since 1.0
386
- * @since 1.5.7 Added the ability to enable the templates admin UI.
387
- * @access private
388
- * @return void
389
- */
390
- static private function save_enabled_templates()
391
- {
392
- if ( isset( $_POST['fl-templates-nonce'] ) && wp_verify_nonce( $_POST['fl-templates-nonce'], 'templates' ) ) {
393
-
394
- $enabled_templates = sanitize_text_field( $_POST['fl-template-settings'] );
395
- $admin_ui_enabled = isset( $_POST['fl-template-admin-ui'] ) ? 1 : 0;
396
-
397
- FLBuilderModel::update_admin_settings_option( '_fl_builder_enabled_templates', $enabled_templates, true );
398
- FLBuilderModel::update_admin_settings_option( '_fl_builder_user_templates_admin', $admin_ui_enabled, true );
399
-
400
- if ( class_exists( 'FLBuilderTemplatesOverride' ) ) {
401
- FLBuilderTemplatesOverride::save_admin_settings();
402
- }
403
- }
404
- }
405
-
406
  /**
407
  * Saves the enabled post types.
408
  *
@@ -560,110 +551,12 @@ final class FLBuilderAdminSettings {
560
  {
561
  if ( isset( $_POST['fl-editing-nonce'] ) && wp_verify_nonce( $_POST['fl-editing-nonce'], 'editing' ) ) {
562
 
563
- $capability = sanitize_text_field( $_POST['fl-editing-capability'] );
564
- $templates_capability = sanitize_text_field( $_POST['fl-global-templates-editing-capability'] );
565
 
566
  FLBuilderModel::update_admin_settings_option( '_fl_builder_editing_capability', $capability, true );
567
- FLBuilderModel::update_admin_settings_option( '_fl_builder_global_templates_editing_capability', $templates_capability, true );
568
- }
569
- }
570
-
571
- /**
572
- * Saves the branding settings.
573
- *
574
- * @since 1.0
575
- * @access private
576
- * @return void
577
- */
578
- static private function save_branding()
579
- {
580
- if ( isset( $_POST['fl-branding-nonce'] ) && wp_verify_nonce( $_POST['fl-branding-nonce'], 'branding' ) ) {
581
-
582
- // Get the plugin branding data.
583
- $branding = wp_kses_post( $_POST['fl-branding'] );
584
- $branding_icon = sanitize_text_field( $_POST['fl-branding-icon'] );
585
-
586
- // Get the theme branding data.
587
- $theme_data = array(
588
- 'name' => wp_kses_post( $_POST['fl-theme-branding-name'] ),
589
- 'description' => wp_kses_post( $_POST['fl-theme-branding-description'] ),
590
- 'company_name' => wp_kses_post( $_POST['fl-theme-branding-company-name'] ),
591
- 'company_url' => sanitize_text_field( $_POST['fl-theme-branding-company-url'] ),
592
- 'screenshot_url' => sanitize_text_field( $_POST['fl-theme-branding-screenshot-url'] ),
593
- );
594
-
595
- // Save the data.
596
- FLBuilderModel::update_admin_settings_option( '_fl_builder_branding', $branding, false );
597
- FLBuilderModel::update_admin_settings_option( '_fl_builder_branding_icon', $branding_icon, false );
598
- FLBuilderModel::update_admin_settings_option( '_fl_builder_theme_branding', $theme_data, false );
599
  }
600
  }
601
 
602
- /**
603
- * Saves the help button settings.
604
- *
605
- * @since 1.0
606
- * @access private
607
- * @return void
608
- */
609
- static private function save_help_button()
610
- {
611
- if ( isset( $_POST['fl-help-button-nonce'] ) && wp_verify_nonce( $_POST['fl-help-button-nonce'], 'help-button' ) ) {
612
-
613
- $settings = FLBuilderModel::get_help_button_defaults();
614
- $settings['enabled'] = isset( $_POST['fl-help-button-enabled'] ) ? true : false;
615
- $settings['tour'] = isset( $_POST['fl-help-tour-enabled'] ) ? true : false;
616
- $settings['video'] = isset( $_POST['fl-help-video-enabled'] ) ? true : false;
617
- $settings['knowledge_base'] = isset( $_POST['fl-knowledge-base-enabled'] ) ? true : false;
618
- $settings['forums'] = isset( $_POST['fl-forums-enabled'] ) ? true : false;
619
-
620
- // Disable everything if the main button is disabled.
621
- if ( ! $settings['enabled'] ) {
622
- $settings['tour'] = false;
623
- $settings['video'] = false;
624
- $settings['knowledge_base'] = false;
625
- $settings['forums'] = false;
626
- }
627
-
628
- // Clean the video embed.
629
- $video_embed = wp_kses( $_POST['fl-help-video-embed'], array(
630
- 'iframe' => array(
631
- 'src' => array(),
632
- 'frameborder' => array(),
633
- 'webkitallowfullscreen' => array(),
634
- 'mozallowfullscreen' => array(),
635
- 'allowfullscreen' => array()
636
- )
637
- ));
638
-
639
- // Save the video embed.
640
- if ( ! empty( $video_embed ) && ! stristr( $video_embed, 'iframe' ) ) {
641
- self::add_error( __( "Error! Please enter an iframe for the video embed code.", 'fl-builder' ) );
642
- }
643
- else if ( ! empty( $video_embed ) ) {
644
- $settings['video_embed'] = $video_embed;
645
- }
646
-
647
- // Save the knowledge base URL.
648
- if ( ! empty( $_POST['fl-knowledge-base-url'] ) ) {
649
- $settings['knowledge_base_url'] = sanitize_text_field( $_POST['fl-knowledge-base-url'] );
650
- }
651
-
652
- // Save the forums URL.
653
- if ( ! empty( $_POST['fl-forums-url'] ) ) {
654
- $settings['forums_url'] = sanitize_text_field( $_POST['fl-forums-url'] );
655
- }
656
-
657
- // Make sure we have at least one help feature enabled.
658
- if ( $settings['enabled'] && ! $settings['tour'] && ! $settings['video'] && ! $settings['knowledge_base'] && ! $settings['forums'] ) {
659
- self::add_error( __( "Error! You must have at least one feature of the help button enabled.", 'fl-builder' ) );
660
- return;
661
- }
662
-
663
- FLBuilderModel::update_admin_settings_option( '_fl_builder_help_button', $settings, false );
664
- }
665
- }
666
-
667
  /**
668
  * Clears the builder cache.
669
  *
@@ -727,12 +620,41 @@ final class FLBuilderAdminSettings {
727
  return;
728
  }
729
  else if ( isset( $_POST['fl-uninstall'] ) && wp_verify_nonce( $_POST['fl-uninstall'], 'uninstall' ) ) {
730
- if ( is_multisite() && class_exists( 'FLBuilderMultisite' ) ) {
731
- FLBuilderMultisite::uninstall();
732
- }
733
- else {
734
- FLBuilderAdmin::uninstall();
735
  }
736
  }
737
  }
738
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  */
17
  static public $errors = array();
18
 
19
+ /**
20
+ * Initializes the admin settings.
21
+ *
22
+ * @since 1.0
23
+ * @return void
24
+ */
25
+ static public function init()
26
+ {
27
+ add_action( 'plugins_loaded', __CLASS__ . '::init_hooks' );
28
+ }
29
+
30
  /**
31
  * Adds the admin menu and enqueues CSS/JS if we are on
32
  * the builder admin settings page.
34
  * @since 1.0
35
  * @return void
36
  */
37
+ static public function init_hooks()
38
  {
39
+ if ( ! is_admin() ) {
40
+ return;
41
+ }
42
+
43
+ add_action( 'admin_menu', __CLASS__ . '::menu' );
44
 
45
  if ( isset( $_REQUEST['page'] ) && 'fl-builder-settings' == $_REQUEST['page'] ) {
46
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
47
  self::save();
48
  }
49
  }
79
  $title = FLBuilderModel::get_branding();
80
  $cap = 'delete_users';
81
  $slug = 'fl-builder-settings';
82
+ $func = __CLASS__ . '::render';
83
 
84
  add_submenu_page( 'options-general.php', $title, $title, $cap, $slug, $func );
85
  }
157
  */
158
  static public function render_nav_items()
159
  {
160
+ $item_data = apply_filters( 'fl_builder_admin_settings_nav_items', array(
161
  'welcome' => array(
162
+ 'title' => __( 'Welcome', 'fl-builder' ),
163
+ 'show' => FLBuilderModel::get_branding() == __( 'Page Builder', 'fl-builder' ) && ( is_network_admin() || ! self::multisite_support() ),
164
+ 'priority' => 50
165
  ),
166
  'license' => array(
167
+ 'title' => __( 'License', 'fl-builder' ),
168
+ 'show' => FL_BUILDER_LITE !== true && ( is_network_admin() || ! self::multisite_support() ),
169
+ 'priority' => 100
170
  ),
171
  'upgrade' => array(
172
+ 'title' => __( 'Upgrade', 'fl-builder' ),
173
+ 'show' => FL_BUILDER_LITE === true,
174
+ 'priority' => 200
175
  ),
176
  'modules' => array(
177
+ 'title' => __( 'Modules', 'fl-builder' ),
178
+ 'show' => true,
179
+ 'priority' => 300
 
 
 
180
  ),
181
  'post-types' => array(
182
+ 'title' => __( 'Post Types', 'fl-builder' ),
183
+ 'show' => true,
184
+ 'priority' => 400
185
  ),
186
  'icons' => array(
187
+ 'title' => __( 'Icons', 'fl-builder' ),
188
+ 'show' => FL_BUILDER_LITE !== true,
189
+ 'priority' => 500
190
  ),
191
  'editing' => array(
192
+ 'title' => __( 'Editing', 'fl-builder' ),
193
+ 'show' => true,
194
+ 'priority' => 600
 
 
 
 
 
 
 
195
  ),
196
  'cache' => array(
197
+ 'title' => __( 'Cache', 'fl-builder' ),
198
+ 'show' => true,
199
+ 'priority' => 700
200
  ),
201
  'uninstall' => array(
202
+ 'title' => __( 'Uninstall', 'fl-builder' ),
203
+ 'show' => is_network_admin() || ! self::multisite_support(),
204
+ 'priority' => 800
205
  ),
206
+ ) );
207
+
208
+ $sorted_data = array();
209
 
210
  foreach ( $item_data as $key => $data ) {
211
+ $data['key'] = $key;
212
+ $sorted_data[ $data['priority'] ] = $data;
213
+ }
214
+
215
+ ksort( $sorted_data );
216
+
217
+ foreach ( $sorted_data as $data ) {
218
  if ( $data['show'] ) {
219
+ echo '<li><a href="#' . $data['key'] . '">' . $data['title'] . '</a></li>';
220
  }
221
  }
222
  }
247
  // Modules
248
  self::render_form( 'modules' );
249
 
 
 
 
250
  // Post Types
251
  self::render_form( 'post-types' );
252
 
256
  // Editing
257
  self::render_form( 'editing' );
258
 
 
 
 
 
 
 
259
  // Cache
260
  self::render_form( 'cache' );
261
 
262
  // Uninstall
263
  self::render_form( 'uninstall' );
264
+
265
+ // Let extensions hook into form rendering.
266
+ do_action( 'fl_builder_admin_settings_render_forms' );
267
  }
268
 
269
  /**
363
  }
364
 
365
  self::save_enabled_modules();
 
366
  self::save_enabled_post_types();
367
  self::save_enabled_icons();
368
  self::save_editing_capability();
 
 
369
  self::clear_cache();
370
  self::uninstall();
371
+
372
+ // Let extensions hook into saving.
373
+ do_action( 'fl_builder_admin_settings_save' );
374
  }
375
 
376
  /**
394
  }
395
  }
396
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
  /**
398
  * Saves the enabled post types.
399
  *
551
  {
552
  if ( isset( $_POST['fl-editing-nonce'] ) && wp_verify_nonce( $_POST['fl-editing-nonce'], 'editing' ) ) {
553
 
554
+ $capability = sanitize_text_field( $_POST['fl-editing-capability'] );
 
555
 
556
  FLBuilderModel::update_admin_settings_option( '_fl_builder_editing_capability', $capability, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
557
  }
558
  }
559
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  /**
561
  * Clears the builder cache.
562
  *
620
  return;
621
  }
622
  else if ( isset( $_POST['fl-uninstall'] ) && wp_verify_nonce( $_POST['fl-uninstall'], 'uninstall' ) ) {
623
+
624
+ $uninstall = apply_filters( 'fl_builder_uninstall', true );
625
+
626
+ if ( $uninstall ) {
627
+ FLBuilderAdmin::uninstall();
628
  }
629
  }
630
  }
631
+
632
+ /**
633
+ * @since 1.0
634
+ * @deprecated 1.8
635
+ */
636
+ static private function save_help_button()
637
+ {
638
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderWhiteLabel::save_help_button_settings()' );
639
+ }
640
+
641
+ /**
642
+ * @since 1.0
643
+ * @deprecated 1.8
644
+ */
645
+ static private function save_branding()
646
+ {
647
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderWhiteLabel::save_branding_settings()' );
648
+ }
649
+
650
+ /**
651
+ * @since 1.0
652
+ * @deprecated 1.8
653
+ */
654
+ static private function save_enabled_templates()
655
+ {
656
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderUserTemplatesAdmin::save_settings()' );
657
+ }
658
+ }
659
+
660
+ FLBuilderAdminSettings::init();
classes/class-fl-builder-admin.php CHANGED
@@ -7,6 +7,26 @@
7
  */
8
  final class FLBuilderAdmin {
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Called on plugin activation and checks to see if the correct
12
  * WordPress version is installed and multisite is supported. If
@@ -20,43 +40,28 @@ final class FLBuilderAdmin {
20
  global $wp_version;
21
 
22
  // Check for WordPress 3.5 and above.
23
- if(version_compare($wp_version, '3.5', '>=')) {
 
 
 
 
 
 
 
 
24
 
25
  // Check for multisite.
26
  if(is_multisite()) {
27
-
28
- // Init multisite support.
29
- self::init_classes();
30
- self::init_multisite();
31
-
32
- // This version has multisite support.
33
- if(class_exists('FLBuilderMultisite')) {
34
-
35
- if(is_network_admin()) {
36
- FLBuilderMultisite::install();
37
- }
38
- else {
39
- self::install();
40
- }
41
- }
42
- // This version doesn't have multisite support.
43
- else {
44
- $url = FLBuilderModel::get_upgrade_url( array( 'utm_source' => 'external', 'utm_medium' => 'builder', 'utm_campaign' => 'no-multisite-support' ) );
45
- self::show_activate_error( sprintf( __( 'This version of the <strong>Page Builder</strong> plugin is not compatible with WordPress Multisite. <a%s>Please upgrade</a> to the Multisite version of this plugin.', 'fl-builder' ), ' href="' . $url . '" target="_blank"' ) );
46
- }
47
  }
48
- // No multisite, standard install.
49
- else {
50
- self::install();
51
- }
52
- }
53
- // Wrong WordPress version.
54
- else {
55
- self::show_activate_error(__('The <strong>Page Builder</strong> plugin requires WordPress version 3.5 or greater. Please update WordPress before activating the plugin.', 'fl-builder'));
56
  }
57
-
58
- // Success! Trigger the activation notice.
59
- update_site_option('_fl_builder_activation_admin_notice', true);
60
  }
61
 
62
  /**
@@ -75,19 +80,44 @@ final class FLBuilderAdmin {
75
  }
76
 
77
  /**
78
- * Sets the action to show the activation success message.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  *
80
  * @since 1.0
81
  * @return void
82
  */
83
  static public function show_activate_notice()
84
  {
85
- $notice = get_site_option('_fl_builder_activation_admin_notice');
 
 
 
 
 
 
86
 
87
- if($notice) {
88
- add_action('admin_notices', 'FLBuilderAdmin::activate_notice');
89
- add_action('network_admin_notices', 'FLBuilderAdmin::activate_notice');
90
- delete_site_option('_fl_builder_activation_admin_notice');
 
 
 
 
91
  }
92
  }
93
 
@@ -99,24 +129,19 @@ final class FLBuilderAdmin {
99
  */
100
  static public function activate_notice()
101
  {
102
- if ( class_exists('FLBuilderMultisiteSettings') && is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
103
- $href = esc_url( network_admin_url( '/settings.php?page=fl-builder-multisite-settings' ) );
104
- }
105
- else {
106
- $href = esc_url( admin_url( '/options-general.php?page=fl-builder-settings' ) );
107
- }
108
-
109
  if ( FL_BUILDER_LITE !== true ) {
110
- $href .= '#license';
111
  $message = __( 'Page Builder activated! <a%s>Click here</a> to enable remote updates.', 'fl-builder' );
112
  }
113
  else {
114
- $href .= '#welcome';
115
  $message = __( 'Page Builder activated! <a%s>Click here</a> to get started.', 'fl-builder' );
116
  }
117
 
 
 
118
  echo '<div class="updated" style="background: #d3ebc1;">';
119
- echo '<p><strong>' . sprintf( $message, ' href="' . esc_url( $href ) . '"' ) . '</strong></p>';
120
  echo '</div>';
121
  }
122
 
@@ -141,194 +166,100 @@ final class FLBuilderAdmin {
141
  }
142
 
143
  /**
144
- * Initializes builder logic for wp-admin.
145
  *
146
  * @since 1.0
147
- * @return void
 
148
  */
149
- static public function init()
150
  {
151
- self::init_classes();
152
- self::init_settings();
153
- self::init_multisite();
154
- self::init_templates();
155
- self::show_activate_notice();
 
156
  }
157
 
158
  /**
159
- * Loads builder classes if they exist.
160
- *
161
  * @since 1.0
162
- * @return void
163
  */
164
  static public function init_classes()
165
  {
166
- $templates_class = FL_BUILDER_DIR . 'classes/class-fl-builder-template-settings.php';
167
- $overrides_class = FL_BUILDER_DIR . 'classes/class-fl-builder-templates-override.php';
168
- $ms_class = FL_BUILDER_DIR . 'classes/class-fl-builder-multisite.php';
169
- $ms_settings_class = FL_BUILDER_DIR . 'classes/class-fl-builder-multisite-settings.php';
170
-
171
- if(file_exists($templates_class)) {
172
- require_once $templates_class;
173
- }
174
- if(file_exists($overrides_class)) {
175
- require_once $overrides_class;
176
- }
177
- if(is_multisite()) {
178
-
179
- if(file_exists($ms_class)) {
180
- require_once $ms_class;
181
- }
182
- if(file_exists($ms_settings_class)) {
183
- require_once $ms_settings_class;
184
- }
185
- }
186
-
187
- require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin-settings.php';
188
  }
189
 
190
  /**
191
- * Initializes the builder admin settings page.
192
- *
193
  * @since 1.0
194
- * @return void
195
  */
196
  static public function init_settings()
197
  {
198
- FLBuilderAdminSettings::init();
199
  }
200
 
201
  /**
202
- * Initializes the builder network admin settings page
203
- * and additional multisite logic.
204
- *
205
  * @since 1.0
206
- * @return void
207
  */
208
  static public function init_multisite()
209
  {
210
- if(is_multisite()) {
211
-
212
- if(class_exists('FLBuilderMultisite')) {
213
- FLBuilderMultisite::init();
214
- }
215
- if(class_exists('FLBuilderMultisiteSettings')) {
216
- FLBuilderMultisiteSettings::init();
217
- }
218
- }
219
  }
220
 
221
  /**
222
- * Initializes the interface for core builder templates.
223
- *
224
  * @since 1.0
225
- * @return void
226
  */
227
  static public function init_templates()
228
  {
229
- if(class_exists('FLBuilderTemplates')) {
230
- FLBuilderTemplates::init();
231
- }
232
  }
233
 
234
  /**
235
- * Renders the link for the row actions on the plugins page.
236
- *
237
  * @since 1.0
238
- * @param array $actions An array of row action links.
239
- * @return array
240
- */
241
- static public function render_plugin_action_links($actions)
242
- {
243
- if(FL_BUILDER_LITE === true) {
244
- $url = FLBuilderModel::get_upgrade_url( array( 'utm_source' => 'external', 'utm_medium' => 'builder', 'utm_campaign' => 'plugins-page' ) );
245
- $actions[] = '<a href="' . $url . '" style="color:#3db634;" target="_blank">' . _x( 'Upgrade', 'Plugin action link label.', 'fl-builder' ) . '</a>';
246
- }
247
-
248
- return $actions;
249
- }
250
-
251
- /**
252
- * White labels the builder on the plugins page.
253
- *
254
- * @since 1.0
255
- * @param array $plugins An array data for each plugin.
256
- * @return array
257
  */
258
  static public function white_label_plugins_page($plugins)
259
  {
260
- $default = __( 'Page Builder', 'fl-builder' );
261
- $branding = FLBuilderModel::get_branding();
262
- $key = FLBuilderModel::plugin_basename();
263
-
264
- if ( isset( $plugins[ $key ] ) && $branding != $default ) {
265
- $plugins[ $key ]['Name'] = $branding;
266
- $plugins[ $key ]['Title'] = $branding;
267
- $plugins[ $key ]['Author'] = '';
268
- $plugins[ $key ]['AuthorName'] = '';
269
- $plugins[ $key ]['PluginURI'] = '';
270
  }
271
 
272
  return $plugins;
273
  }
274
 
275
  /**
276
- * White labels the builder theme on the themes page.
277
- *
278
  * @since 1.6.4.3
279
- * @param array $themes An array data for each theme.
280
- * @return array
281
  */
282
  static public function white_label_themes_page( $themes )
283
  {
284
- if ( isset( $themes['bb-theme'] ) ) {
285
-
286
- $theme_data = FLBuilderModel::get_theme_branding();
287
-
288
- if ( ! empty( $theme_data['name'] ) ) {
289
-
290
- $themes['bb-theme']['name'] = $theme_data['name'];
291
-
292
- foreach ( $themes as $theme_key => $theme ) {
293
- if ( isset( $theme['parent'] ) && $theme['parent'] == 'Beaver Builder Theme' ) {
294
- $themes[ $theme_key ]['parent'] = $theme_data['name'];
295
- }
296
- }
297
- }
298
- if ( ! empty( $theme_data['description'] ) ) {
299
- $themes['bb-theme']['description'] = $theme_data['description'];
300
- }
301
- if ( ! empty( $theme_data['company_name'] ) ) {
302
- $company_url = empty( $theme_data['company_url'] ) ? '#' : $theme_data['company_url'];
303
- $themes['bb-theme']['author'] = $theme_data['company_name'];
304
- $themes['bb-theme']['authorAndUri'] = '<a href="' . $company_url . '">' . $theme_data['company_name'] . '</a>';
305
- }
306
- if ( ! empty( $theme_data['screenshot_url'] ) ) {
307
- $themes['bb-theme']['screenshot'] = array( $theme_data['screenshot_url'] );
308
- }
309
  }
310
 
311
  return $themes;
312
  }
313
 
314
  /**
315
- * White labels the builder theme using the gettext filter
316
- * to cover areas that we can't access like the Customizer.
317
- *
318
  * @since 1.6.4.4
319
- * @return string
320
  */
321
  static public function white_label_theme_gettext( $text )
322
  {
323
- if ( is_admin() && 'Beaver Builder Theme' == $text ) {
324
-
325
- $theme_data = FLBuilderModel::get_theme_branding();
326
-
327
- if ( ! empty( $theme_data['name'] ) ) {
328
- $text = $theme_data['name'];
329
- }
330
- }
331
-
332
- return $text;
333
  }
334
- }
 
 
7
  */
8
  final class FLBuilderAdmin {
9
 
10
+ /**
11
+ * Initialize hooks.
12
+ *
13
+ * @since 1.8
14
+ * @return void
15
+ */
16
+ static public function init()
17
+ {
18
+ $basename = plugin_basename( FL_BUILDER_FILE );
19
+
20
+ // Activation
21
+ register_activation_hook( FL_BUILDER_FILE, __CLASS__ . '::activate' );
22
+
23
+ // Actions
24
+ add_action( 'admin_init', __CLASS__ . '::show_activate_notice' );
25
+
26
+ // Filters
27
+ add_filter( 'plugin_action_links_' . $basename, __CLASS__ . '::render_plugin_action_links' );
28
+ }
29
+
30
  /**
31
  * Called on plugin activation and checks to see if the correct
32
  * WordPress version is installed and multisite is supported. If
40
  global $wp_version;
41
 
42
  // Check for WordPress 3.5 and above.
43
+ if(!version_compare($wp_version, '3.5', '>=')) {
44
+ self::show_activate_error(__('The <strong>Page Builder</strong> plugin requires WordPress version 3.5 or greater. Please update WordPress before activating the plugin.', 'fl-builder'));
45
+ }
46
+
47
+ // Allow extensions to hook activation.
48
+ $activate = apply_filters( 'fl_builder_activate', true );
49
+
50
+ // Should we continue with activation?
51
+ if ( $activate ) {
52
 
53
  // Check for multisite.
54
  if(is_multisite()) {
55
+ $url = FLBuilderModel::get_upgrade_url( array( 'utm_medium' => 'bb-pro', 'utm_source' => 'plugins-admin-page', 'utm_campaign' => 'no-multisite-support' ) );
56
+ self::show_activate_error( sprintf( __( 'This version of the <strong>Page Builder</strong> plugin is not compatible with WordPress Multisite. <a%s>Please upgrade</a> to the Multisite version of this plugin.', 'fl-builder' ), ' href="' . $url . '" target="_blank"' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
+
59
+ // Success! Run the install.
60
+ self::install();
61
+
62
+ // Trigger the activation notice.
63
+ self::trigger_activate_notice();
 
 
64
  }
 
 
 
65
  }
66
 
67
  /**
80
  }
81
 
82
  /**
83
+ * Sets the transient that triggers the activation notice
84
+ * or welcome page redirect.
85
+ *
86
+ * @since 1.8
87
+ * @return void
88
+ */
89
+ static public function trigger_activate_notice()
90
+ {
91
+ if ( current_user_can( 'delete_users' ) ) {
92
+ set_transient( '_fl_builder_activation_admin_notice', true, 30 );
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Shows the activation success message or redirects to the
98
+ * welcome page.
99
  *
100
  * @since 1.0
101
  * @return void
102
  */
103
  static public function show_activate_notice()
104
  {
105
+ // Bail if no activation transient is set.
106
+ if ( ! get_transient( '_fl_builder_activation_admin_notice' ) ) {
107
+ return;
108
+ }
109
+
110
+ // Delete the activation transient.
111
+ delete_transient( '_fl_builder_activation_admin_notice' );
112
 
113
+ if ( isset( $_GET['activate-multi'] ) || is_multisite() ) {
114
+ // Show the notice if we are activating multiple plugins or on multisite.
115
+ add_action('admin_notices', __CLASS__ . '::activate_notice');
116
+ add_action('network_admin_notices', __CLASS__ . '::activate_notice');
117
+ }
118
+ else {
119
+ // Redirect to the welcome page.
120
+ wp_safe_redirect( add_query_arg( array( 'page' => 'fl-builder-settings' ), admin_url( 'options-general.php' ) ) );
121
  }
122
  }
123
 
129
  */
130
  static public function activate_notice()
131
  {
 
 
 
 
 
 
 
132
  if ( FL_BUILDER_LITE !== true ) {
133
+ $hash = '#license';
134
  $message = __( 'Page Builder activated! <a%s>Click here</a> to enable remote updates.', 'fl-builder' );
135
  }
136
  else {
137
+ $hash = '#welcome';
138
  $message = __( 'Page Builder activated! <a%s>Click here</a> to get started.', 'fl-builder' );
139
  }
140
 
141
+ $url = apply_filters( 'fl_builder_activate_redirect_url', admin_url( '/options-general.php?page=fl-builder-settings' . $hash ) );
142
+
143
  echo '<div class="updated" style="background: #d3ebc1;">';
144
+ echo '<p><strong>' . sprintf( $message, ' href="' . esc_url( $url ) . '"' ) . '</strong></p>';
145
  echo '</div>';
146
  }
147
 
166
  }
167
 
168
  /**
169
+ * Renders the link for the row actions on the plugins page.
170
  *
171
  * @since 1.0
172
+ * @param array $actions An array of row action links.
173
+ * @return array
174
  */
175
+ static public function render_plugin_action_links($actions)
176
  {
177
+ if(FL_BUILDER_LITE === true) {
178
+ $url = FLBuilderModel::get_upgrade_url( array( 'utm_medium' => 'bb-lite', 'utm_source' => 'plugins-admin-page', 'utm_campaign' => 'plugins-admin-upgrade' ) );
179
+ $actions[] = '<a href="' . $url . '" style="color:#3db634;" target="_blank">' . _x( 'Upgrade', 'Plugin action link label.', 'fl-builder' ) . '</a>';
180
+ }
181
+
182
+ return $actions;
183
  }
184
 
185
  /**
 
 
186
  * @since 1.0
187
+ * @deprecated 1.8
188
  */
189
  static public function init_classes()
190
  {
191
+ _deprecated_function( __METHOD__, '1.8' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  }
193
 
194
  /**
 
 
195
  * @since 1.0
196
+ * @deprecated 1.8
197
  */
198
  static public function init_settings()
199
  {
200
+ _deprecated_function( __METHOD__, '1.8' );
201
  }
202
 
203
  /**
 
 
 
204
  * @since 1.0
205
+ * @deprecated 1.8
206
  */
207
  static public function init_multisite()
208
  {
209
+ _deprecated_function( __METHOD__, '1.8' );
 
 
 
 
 
 
 
 
210
  }
211
 
212
  /**
 
 
213
  * @since 1.0
214
+ * @deprecated 1.8
215
  */
216
  static public function init_templates()
217
  {
218
+ _deprecated_function( __METHOD__, '1.8' );
 
 
219
  }
220
 
221
  /**
 
 
222
  * @since 1.0
223
+ * @deprecated 1.8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  */
225
  static public function white_label_plugins_page($plugins)
226
  {
227
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderWhiteLabel::plugins_page()' );
228
+
229
+ if ( class_exists( 'FLBuilderWhiteLabel' ) ) {
230
+ return FLBuilderWhiteLabel::plugins_page( $plugins );
 
 
 
 
 
 
231
  }
232
 
233
  return $plugins;
234
  }
235
 
236
  /**
 
 
237
  * @since 1.6.4.3
238
+ * @deprecated 1.8
 
239
  */
240
  static public function white_label_themes_page( $themes )
241
  {
242
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderWhiteLabel::themes_page()' );
243
+
244
+ if ( class_exists( 'FLBuilderWhiteLabel' ) ) {
245
+ return FLBuilderWhiteLabel::themes_page( $themes );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
247
 
248
  return $themes;
249
  }
250
 
251
  /**
 
 
 
252
  * @since 1.6.4.4
253
+ * @deprecated 1.8
254
  */
255
  static public function white_label_theme_gettext( $text )
256
  {
257
+ if ( class_exists( 'FLBuilderWhiteLabel' ) ) {
258
+ return FLBuilderWhiteLabel::theme_gettext( $text );
259
+ }
260
+
261
+ return $text;
 
 
 
 
 
262
  }
263
+ }
264
+
265
+ FLBuilderAdmin::init();
classes/class-fl-builder-ajax-layout.php CHANGED
@@ -31,7 +31,7 @@ final class FLBuilderAJAXLayout {
31
  FLBuilderModel::update_post_data( 'node_id', $node_id );
32
  }
33
 
34
- // Render CSS and JS assets.
35
  FLBuilder::render_assets();
36
 
37
  // Register scripts needed for shortcodes and widgets.
@@ -72,15 +72,21 @@ final class FLBuilderAJAXLayout {
72
  * @param string $cols The type of column layout to use.
73
  * @param int $position The position of the new row in the layout.
74
  * @param string $template_id The ID of a row template to render.
 
75
  * @return array
76
  */
77
- static public function render_new_row( $cols = '1-col', $position = false, $template_id = null )
78
  {
79
  // Add a row template?
80
- if ( $template_id ) {
81
 
82
- // Add the row template.
83
- $row = FLBuilderModel::apply_node_template( $template_id, null, $position );
 
 
 
 
 
84
 
85
  // Return the response.
86
  return self::render( $row->node );
@@ -173,13 +179,21 @@ final class FLBuilderAJAXLayout {
173
  * @param int $position The new module position.
174
  * @param string $type The type of module.
175
  * @param string $template_id The ID of a module template to render.
 
176
  * @return array
177
  */
178
- static public function render_new_module( $parent_id, $position = false, $type = null, $template_id = null )
179
  {
180
  // Add a module template?
181
- if ( $template_id ) {
182
- $module = FLBuilderModel::apply_node_template( $template_id, $parent_id, $position );
 
 
 
 
 
 
 
183
  }
184
  // Add a standard module.
185
  else {
@@ -463,6 +477,11 @@ final class FLBuilderAJAXLayout {
463
  */
464
  static private function register_scripts()
465
  {
 
 
 
 
 
466
  ob_start();
467
  do_action( 'wp_enqueue_scripts' );
468
  ob_end_clean();
31
  FLBuilderModel::update_post_data( 'node_id', $node_id );
32
  }
33
 
34
+ // Render the draft layout CSS that will be passed back.
35
  FLBuilder::render_assets();
36
 
37
  // Register scripts needed for shortcodes and widgets.
72
  * @param string $cols The type of column layout to use.
73
  * @param int $position The position of the new row in the layout.
74
  * @param string $template_id The ID of a row template to render.
75
+ * @param string $template_type The type of template. Either "user" or "core".
76
  * @return array
77
  */
78
+ static public function render_new_row( $cols = '1-col', $position = false, $template_id = null, $template_type = 'user' )
79
  {
80
  // Add a row template?
81
+ if ( null !== $template_id ) {
82
 
83
+ if ( 'core' == $template_type ) {
84
+ $template = FLBuilderModel::get_template( $template_id, 'row' );
85
+ $row = FLBuilderModel::apply_node_template( $template_id, null, $position, $template );
86
+ }
87
+ else {
88
+ $row = FLBuilderModel::apply_node_template( $template_id, null, $position );
89
+ }
90
 
91
  // Return the response.
92
  return self::render( $row->node );
179
  * @param int $position The new module position.
180
  * @param string $type The type of module.
181
  * @param string $template_id The ID of a module template to render.
182
+ * @param string $template_type The type of template. Either "user" or "core".
183
  * @return array
184
  */
185
+ static public function render_new_module( $parent_id, $position = false, $type = null, $template_id = null, $template_type = 'user' )
186
  {
187
  // Add a module template?
188
+ if ( null !== $template_id ) {
189
+
190
+ if ( 'core' == $template_type ) {
191
+ $template = FLBuilderModel::get_template( $template_id, 'module' );
192
+ $module = FLBuilderModel::apply_node_template( $template_id, $parent_id, $position, $template );
193
+ }
194
+ else {
195
+ $module = FLBuilderModel::apply_node_template( $template_id, $parent_id, $position );
196
+ }
197
  }
198
  // Add a standard module.
199
  else {
477
  */
478
  static private function register_scripts()
479
  {
480
+ // Running these isn't necessary and can cause performance issues.
481
+ remove_action( 'wp_enqueue_scripts', 'FLBuilder::register_layout_styles_scripts' );
482
+ remove_action( 'wp_enqueue_scripts', 'FLBuilder::enqueue_ui_styles_scripts' );
483
+ remove_action( 'wp_enqueue_scripts', 'FLBuilder::enqueue_all_layouts_styles_scripts' );
484
+
485
  ob_start();
486
  do_action( 'wp_enqueue_scripts' );
487
  ob_end_clean();
classes/class-fl-builder-ajax.php CHANGED
@@ -22,12 +22,23 @@ final class FLBuilderAJAX {
22
  static private $actions = array();
23
 
24
  /**
25
- * Initializes builder AJAX.
26
  *
27
- * @since 1.7
28
  * @return void
29
  */
30
  static public function init()
 
 
 
 
 
 
 
 
 
 
 
31
  {
32
  self::add_actions();
33
  self::call_action();
@@ -51,6 +62,20 @@ final class FLBuilderAJAX {
51
  );
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  /**
55
  * Adds all callable AJAX actions.
56
  *
@@ -62,14 +87,12 @@ final class FLBuilderAJAX {
62
  {
63
  // FLBuilder
64
  self::add_action( 'render_settings_form', 'FLBuilder::render_settings_form', array( 'type', 'settings' ) );
65
- self::add_action( 'render_node_template_settings', 'FLBuilder::render_node_template_settings', array( 'node_id' ) );
66
  self::add_action( 'render_row_settings', 'FLBuilder::render_row_settings', array( 'node_id' ) );
67
  self::add_action( 'render_column_settings', 'FLBuilder::render_column_settings', array( 'node_id' ) );
68
  self::add_action( 'render_module_settings', 'FLBuilder::render_module_settings', array( 'node_id', 'type', 'parent_id' ) );
69
  self::add_action( 'render_layout_settings', 'FLBuilder::render_layout_settings' );
70
  self::add_action( 'render_global_settings', 'FLBuilder::render_global_settings' );
71
  self::add_action( 'render_template_selector', 'FLBuilder::render_template_selector' );
72
- self::add_action( 'render_user_template_settings', 'FLBuilder::render_user_template_settings' );
73
  self::add_action( 'render_icon_selector', 'FLBuilder::render_icon_selector' );
74
 
75
  // FLBuilderModel
@@ -85,11 +108,7 @@ final class FLBuilderAJAX {
85
  self::add_action( 'save_color_presets', 'FLBuilderModel::save_color_presets', array( 'presets' ) );
86
  self::add_action( 'duplicate_post', 'FLBuilderModel::duplicate_post' );
87
  self::add_action( 'duplicate_wpml_layout', 'FLBuilderModel::duplicate_wpml_layout', array( 'original_post_id', 'post_id' ) );
88
- self::add_action( 'save_user_template', 'FLBuilderModel::save_user_template', array( 'settings' ) );
89
- self::add_action( 'delete_user_template', 'FLBuilderModel::delete_user_template', array( 'template_id' ) );
90
  self::add_action( 'apply_user_template', 'FLBuilderModel::apply_user_template', array( 'template_id', 'append' ) );
91
- self::add_action( 'save_node_template', 'FLBuilderModel::save_node_template', array( 'node_id', 'settings' ) );
92
- self::add_action( 'delete_node_template', 'FLBuilderModel::delete_node_template', array( 'template_id' ) );
93
  self::add_action( 'apply_template', 'FLBuilderModel::apply_template', array( 'template_id', 'append' ) );
94
  self::add_action( 'save_layout', 'FLBuilderModel::save_layout' );
95
  self::add_action( 'save_draft', 'FLBuilderModel::save_draft' );
@@ -98,11 +117,11 @@ final class FLBuilderAJAX {
98
 
99
  // FLBuilderAJAXLayout
100
  self::add_action( 'render_layout', 'FLBuilderAJAXLayout::render' );
101
- self::add_action( 'render_new_row', 'FLBuilderAJAXLayout::render_new_row', array( 'cols', 'position', 'template_id' ) );
102
  self::add_action( 'copy_row', 'FLBuilderAJAXLayout::copy_row', array( 'node_id' ) );
103
  self::add_action( 'render_new_column_group', 'FLBuilderAJAXLayout::render_new_column_group', array( 'node_id', 'cols', 'position' ) );
104
  self::add_action( 'render_new_column', 'FLBuilderAJAXLayout::render_new_column', array( 'node_id', 'insert' ) );
105
- self::add_action( 'render_new_module', 'FLBuilderAJAXLayout::render_new_module', array( 'parent_id', 'position', 'type', 'template_id' ) );
106
  self::add_action( 'copy_module', 'FLBuilderAJAXLayout::copy_module', array( 'node_id' ) );
107
 
108
  // FLBuilderServices
@@ -162,6 +181,9 @@ final class FLBuilderAJAX {
162
  return;
163
  }
164
 
 
 
 
165
  // Make sure the action exists.
166
  if ( ! isset( self::$actions[ $action ] ) ) {
167
  return;
@@ -221,4 +243,6 @@ final class FLBuilderAJAX {
221
 
222
  return true;
223
  }
224
- }
 
 
22
  static private $actions = array();
23
 
24
  /**
25
+ * Initializes hooks.
26
  *
27
+ * @since 1.8
28
  * @return void
29
  */
30
  static public function init()
31
+ {
32
+ add_action( 'wp', __CLASS__ . '::run' );
33
+ }
34
+
35
+ /**
36
+ * Runs builder's frontend AJAX.
37
+ *
38
+ * @since 1.7
39
+ * @return void
40
+ */
41
+ static public function run()
42
  {
43
  self::add_actions();
44
  self::call_action();
62
  );
63
  }
64
 
65
+ /**
66
+ * Removes an AJAX action.
67
+ *
68
+ * @since 1.8
69
+ * @param string $action The action to remove.
70
+ * @return void
71
+ */
72
+ static public function remove_action( $action )
73
+ {
74
+ if ( isset( self::$actions[ $action ] ) ) {
75
+ unset( self::$actions[ $action ] );
76
+ }
77
+ }
78
+
79
  /**
80
  * Adds all callable AJAX actions.
81
  *
87
  {
88
  // FLBuilder
89
  self::add_action( 'render_settings_form', 'FLBuilder::render_settings_form', array( 'type', 'settings' ) );
 
90
  self::add_action( 'render_row_settings', 'FLBuilder::render_row_settings', array( 'node_id' ) );
91
  self::add_action( 'render_column_settings', 'FLBuilder::render_column_settings', array( 'node_id' ) );
92
  self::add_action( 'render_module_settings', 'FLBuilder::render_module_settings', array( 'node_id', 'type', 'parent_id' ) );
93
  self::add_action( 'render_layout_settings', 'FLBuilder::render_layout_settings' );
94
  self::add_action( 'render_global_settings', 'FLBuilder::render_global_settings' );
95
  self::add_action( 'render_template_selector', 'FLBuilder::render_template_selector' );
 
96
  self::add_action( 'render_icon_selector', 'FLBuilder::render_icon_selector' );
97
 
98
  // FLBuilderModel
108
  self::add_action( 'save_color_presets', 'FLBuilderModel::save_color_presets', array( 'presets' ) );
109
  self::add_action( 'duplicate_post', 'FLBuilderModel::duplicate_post' );
110
  self::add_action( 'duplicate_wpml_layout', 'FLBuilderModel::duplicate_wpml_layout', array( 'original_post_id', 'post_id' ) );
 
 
111
  self::add_action( 'apply_user_template', 'FLBuilderModel::apply_user_template', array( 'template_id', 'append' ) );
 
 
112
  self::add_action( 'apply_template', 'FLBuilderModel::apply_template', array( 'template_id', 'append' ) );
113
  self::add_action( 'save_layout', 'FLBuilderModel::save_layout' );
114
  self::add_action( 'save_draft', 'FLBuilderModel::save_draft' );
117
 
118
  // FLBuilderAJAXLayout
119
  self::add_action( 'render_layout', 'FLBuilderAJAXLayout::render' );
120
+ self::add_action( 'render_new_row', 'FLBuilderAJAXLayout::render_new_row', array( 'cols', 'position', 'template_id', 'template_type' ) );
121
  self::add_action( 'copy_row', 'FLBuilderAJAXLayout::copy_row', array( 'node_id' ) );
122
  self::add_action( 'render_new_column_group', 'FLBuilderAJAXLayout::render_new_column_group', array( 'node_id', 'cols', 'position' ) );
123
  self::add_action( 'render_new_column', 'FLBuilderAJAXLayout::render_new_column', array( 'node_id', 'insert' ) );
124
+ self::add_action( 'render_new_module', 'FLBuilderAJAXLayout::render_new_module', array( 'parent_id', 'position', 'type', 'template_id', 'template_type' ) );
125
  self::add_action( 'copy_module', 'FLBuilderAJAXLayout::copy_module', array( 'node_id' ) );
126
 
127
  // FLBuilderServices
181
  return;
182
  }
183
 
184
+ // Allow developers to modify actions before they are called.
185
+ do_action( 'fl_ajax_before_call_action', $action );
186
+
187
  // Make sure the action exists.
188
  if ( ! isset( self::$actions[ $action ] ) ) {
189
  return;
243
 
244
  return true;
245
  }
246
+ }
247
+
248
+ FLBuilderAJAX::init();
classes/class-fl-builder-export.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Custom export handling.
5
+ *
6
+ * @since 1.8
7
+ */
8
+ final class FLBuilderExport {
9
+
10
+ /**
11
+ * @since 1.8
12
+ * @return void
13
+ */
14
+ static public function init()
15
+ {
16
+ add_action( 'admin_enqueue_scripts', 'FLBuilderExport::enqueue_scripts' );
17
+ add_action( 'export_filters', 'FLBuilderExport::filters' );
18
+ add_action( 'wp_ajax_fl_builder_export_templates_data', 'FLBuilderExport::templates_data' );
19
+ add_action( 'export_wp', 'FLBuilderExport::export' );
20
+ }
21
+
22
+ /**
23
+ * Enqueues the export scripts and styles.
24
+ *
25
+ * @since 1.8
26
+ * @return void
27
+ */
28
+ static public function enqueue_scripts()
29
+ {
30
+ global $pagenow;
31
+
32
+ if ( 'export.php' != $pagenow ) {
33
+ return;
34
+ }
35
+
36
+ wp_enqueue_style( 'fl-builder-export', FL_BUILDER_URL . 'css/fl-builder-export.css', array(), FL_BUILDER_VERSION );
37
+ wp_enqueue_script( 'fl-builder-export', FL_BUILDER_URL . 'js/fl-builder-export.js', array(), FL_BUILDER_VERSION, true );
38
+ }
39
+
40
+ /**
41
+ * Renders the export filters markup.
42
+ *
43
+ * @since 1.8
44
+ * @return void
45
+ */
46
+ static public function filters()
47
+ {
48
+ include FL_BUILDER_DIR . 'includes/export-filters.php';
49
+ }
50
+
51
+ /**
52
+ * Called via AJAX and returns the data used for selecting
53
+ * templates for export.
54
+ *
55
+ * @since 1.8
56
+ * @return void
57
+ */
58
+ static public function templates_data()
59
+ {
60
+ $data = array();
61
+ $query = new WP_Query( array(
62
+ 'post_type' => 'fl-builder-template',
63
+ 'orderby' => 'title',
64
+ 'order' => 'ASC',
65
+ 'posts_per_page' => '-1'
66
+ ) );
67
+
68
+ foreach( $query->posts as $post ) {
69
+ $data[] = array(
70
+ 'id' => $post->ID,
71
+ 'title' => $post->post_title
72
+ );
73
+ }
74
+
75
+ echo json_encode( $data );
76
+
77
+ die();
78
+ }
79
+
80
+ /**
81
+ * Download the export file.
82
+ *
83
+ * @since 1.8
84
+ * @param array $args
85
+ * @return void
86
+ */
87
+ static public function export( $args )
88
+ {
89
+ if ( ! current_user_can( 'export' ) ) {
90
+ return;
91
+ }
92
+ if ( 'fl-builder-template' != $args['content'] ) {
93
+ return;
94
+ }
95
+ if ( ! isset( $_REQUEST['fl-builder-template-export-select'] ) ) {
96
+ return;
97
+ }
98
+ if ( 'all' == $_REQUEST['fl-builder-template-export-select'] ) {
99
+ return;
100
+ }
101
+ if ( ! is_array( $_REQUEST['fl-builder-export-template'] ) ) {
102
+ return;
103
+ }
104
+
105
+ require_once FL_BUILDER_DIR . 'includes/export.php';
106
+
107
+ fl_export_wp( $_REQUEST['fl-builder-export-template'] );
108
+
109
+ die();
110
+ }
111
+ }
112
+
113
+ FLBuilderExport::init();
classes/class-fl-builder-extensions.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Helper class for builder extensions.
5
+ *
6
+ * @since 1.0
7
+ */
8
+ final class FLBuilderExtensions {
9
+
10
+ /**
11
+ * Initalizes any extensions found in the extensions directory.
12
+ *
13
+ * @since 1.8
14
+ * @return void
15
+ */
16
+ static public function init()
17
+ {
18
+ $extensions = glob( FL_BUILDER_DIR . 'extensions/*' );
19
+
20
+ if ( ! is_array( $extensions ) ) {
21
+ return;
22
+ }
23
+
24
+ foreach ( $extensions as $extension ) {
25
+
26
+ if ( ! is_dir( $extension ) ) {
27
+ continue;
28
+ }
29
+
30
+ $path = trailingslashit( $extension ) . basename( $extension ) . '.php';
31
+
32
+ if ( file_exists( $path ) ) {
33
+ require_once $path;
34
+ }
35
+ }
36
+ }
37
+ }
38
+
39
+ FLBuilderExtensions::init();
classes/class-fl-builder-fonts.php CHANGED
@@ -129,7 +129,11 @@ final class FLBuilderFonts {
129
  $css .= 'font-family: '. $font['family'] .';';
130
  }
131
 
132
- $css .= 'font-weight: '. $font['weight'] .';';
 
 
 
 
133
 
134
  echo $css;
135
  }
129
  $css .= 'font-family: '. $font['family'] .';';
130
  }
131
 
132
+ if ( 'regular' == $font['weight'] ) {
133
+ $css .= 'font-weight: normal;';
134
+ } else {
135
+ $css .= 'font-weight: '. $font['weight'] .';';
136
+ }
137
 
138
  echo $css;
139
  }
classes/class-fl-builder-icons.php CHANGED
@@ -183,6 +183,11 @@ final class FLBuilderIcons {
183
  // Loop through uploaded sets.
184
  foreach ( $folders as $folder ) {
185
 
 
 
 
 
 
186
  $folder = trailingslashit( $folder );
187
 
188
  // This is an Icomoon font.
183
  // Loop through uploaded sets.
184
  foreach ( $folders as $folder ) {
185
 
186
+ // Make sure we have a directory.
187
+ if ( ! is_dir( $folder ) ) {
188
+ continue;
189
+ }
190
+
191
  $folder = trailingslashit( $folder );
192
 
193
  // This is an Icomoon font.
classes/class-fl-builder-import.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The WordPress importer plugin has a few issues that break
5
+ * serialized data in certain cases. This class overrides the
6
+ * WordPress importer with our own patched version that fixes
7
+ * these issues.
8
+ *
9
+ * @since 1.8
10
+ */
11
+ final class FLBuilderImport {
12
+
13
+ /**
14
+ * @since 1.8
15
+ * @return void
16
+ */
17
+ static public function init()
18
+ {
19
+ if ( ! defined( 'WP_LOAD_IMPORTERS' ) || ! class_exists( 'WP_Import' ) || ! class_exists( 'WXR_Parser_Regex' ) ) {
20
+ return;
21
+ }
22
+
23
+ require_once FL_BUILDER_DIR . '/classes/class-fl-builder-importer.php';
24
+
25
+ // Remove the WordPress importer.
26
+ remove_action( 'admin_init', 'wordpress_importer_init' );
27
+
28
+ // Add our importer.
29
+ add_action( 'admin_init', 'FLBuilderImport::load' );
30
+ }
31
+
32
+ /**
33
+ * @since 1.8
34
+ * @return void
35
+ */
36
+ static public function load()
37
+ {
38
+ load_plugin_textdomain( 'wordpress-importer', false, 'wordpress-importer/languages' );
39
+
40
+ $GLOBALS['wp_import'] = new FLBuilderImporter();
41
+
42
+ 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' ) );
43
+ }
44
+ }
45
+
46
+ add_action( 'plugins_loaded', 'FLBuilderImport::init' );
classes/class-fl-builder-importer.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The WordPress importer plugin has a few issues that break
5
+ * serialized data in certain cases. This class is our own
6
+ * patched version that fixes these issues.
7
+ *
8
+ * @since 1.8
9
+ */
10
+ class FLBuilderImporter extends WP_Import {
11
+
12
+ /**
13
+ * @since 1.8
14
+ * @return array
15
+ */
16
+ function parse( $file ) {
17
+ $parser = new FLBuilderImportParserRegex();
18
+ return $parser->parse( $file );
19
+ }
20
+ }
21
+
22
+ /**
23
+ * The Regex parser is the only parser we have found that
24
+ * doesn't break serialized data. It does have two bugs
25
+ * that can break serialized data. Those are calling rtrim
26
+ * on each $importline and adding a newline to each $importline.
27
+ * This class fixes those bugs.
28
+ *
29
+ * @since 1.8
30
+ */
31
+ class FLBuilderImportParserRegex extends WXR_Parser_Regex {
32
+
33
+ /**
34
+ * @since 1.8
35
+ * @return array
36
+ */
37
+ function parse( $file ) {
38
+ $wxr_version = $in_post = false;
39
+
40
+ $fp = $this->fopen( $file, 'r' );
41
+ if ( $fp ) {
42
+ while ( ! $this->feof( $fp ) ) {
43
+ $importline = $this->fgets( $fp );
44
+
45
+ if ( ! $wxr_version && preg_match( '|<wp:wxr_version>(\d+\.\d+)</wp:wxr_version>|', $importline, $version ) )
46
+ $wxr_version = $version[1];
47
+
48
+ if ( false !== strpos( $importline, '<wp:base_site_url>' ) ) {
49
+ preg_match( '|<wp:base_site_url>(.*?)</wp:base_site_url>|is', $importline, $url );
50
+ $this->base_url = $url[1];
51
+ continue;
52
+ }
53
+ if ( false !== strpos( $importline, '<wp:category>' ) ) {
54
+ preg_match( '|<wp:category>(.*?)</wp:category>|is', $importline, $category );
55
+ $this->categories[] = $this->process_category( $category[1] );
56
+ continue;
57
+ }
58
+ if ( false !== strpos( $importline, '<wp:tag>' ) ) {
59
+ preg_match( '|<wp:tag>(.*?)</wp:tag>|is', $importline, $tag );
60
+ $this->tags[] = $this->process_tag( $tag[1] );
61
+ continue;
62
+ }
63
+ if ( false !== strpos( $importline, '<wp:term>' ) ) {
64
+ preg_match( '|<wp:term>(.*?)</wp:term>|is', $importline, $term );
65
+ $this->terms[] = $this->process_term( $term[1] );
66
+ continue;
67
+ }
68
+ if ( false !== strpos( $importline, '<wp:author>' ) ) {
69
+ preg_match( '|<wp:author>(.*?)</wp:author>|is', $importline, $author );
70
+ $a = $this->process_author( $author[1] );
71
+ $this->authors[$a['author_login']] = $a;
72
+ continue;
73
+ }
74
+ if ( false !== strpos( $importline, '<item>' ) ) {
75
+ $post = '';
76
+ $in_post = true;
77
+ continue;
78
+ }
79
+ if ( false !== strpos( $importline, '</item>' ) ) {
80
+ $in_post = false;
81
+ $this->posts[] = $this->process_post( $post );
82
+ continue;
83
+ }
84
+ if ( $in_post ) {
85
+ $post .= $importline;
86
+ }
87
+ }
88
+
89
+ $this->fclose($fp);
90
+
91
+ // Try to fix any broken builder data.
92
+ foreach ( $this->posts as $post_index => $post ) {
93
+ if ( ! isset( $post['postmeta'] ) || ! is_array( $post['postmeta'] ) ) {
94
+ continue;
95
+ }
96
+ foreach ( $post['postmeta'] as $postmeta_index => $postmeta ) {
97
+ if ( stristr( $postmeta['key'], '_fl_builder_' ) ) {
98
+ $this->posts[ $post_index ]['postmeta'][ $postmeta_index ]['value'] = FLBuilderImporterDataFix::run( $postmeta['value'] );
99
+ }
100
+ }
101
+ }
102
+ }
103
+
104
+ if ( ! $wxr_version )
105
+ return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
106
+
107
+ return array(
108
+ 'authors' => $this->authors,
109
+ 'posts' => $this->posts,
110
+ 'categories' => $this->categories,
111
+ 'tags' => $this->tags,
112
+ 'terms' => $this->terms,
113
+ 'base_url' => $this->base_url,
114
+ 'version' => $wxr_version
115
+ );
116
+ }
117
+ }
118
+
119
+ /**
120
+ * Portions borrowed from https://github.com/Blogestudio/Fix-Serialization/blob/master/fix-serialization.php
121
+ *
122
+ * Attempts to fix broken serialized data.
123
+ *
124
+ * @since 1.8
125
+ */
126
+ final class FLBuilderImporterDataFix {
127
+
128
+ /**
129
+ * @since 1.8
130
+ * @return string
131
+ */
132
+ static public function run( $data )
133
+ {
134
+ if ( empty( $data ) || @unserialize( $data ) !== false ) {
135
+ return $data;
136
+ }
137
+
138
+ return preg_replace_callback( '!s:(\d+):([\\\\]?"[\\\\]?"|[\\\\]?"((.*?)[^\\\\])[\\\\]?");!', 'FLBuilderImporterDataFix::regex_callback', $data );
139
+ }
140
+
141
+ /**
142
+ * @since 1.8
143
+ * @return string
144
+ */
145
+ static public function regex_callback( $matches )
146
+ {
147
+ if ( ! isset( $matches[3] ) ) {
148
+ return $matches[0];
149
+ }
150
+
151
+ return 's:' . strlen( self::unescape_mysql( $matches[3] ) ) . ':"' . self::unescape_quotes( $matches[3] ) . '";';
152
+ }
153
+
154
+ /**
155
+ * Unescape to avoid dump-text issues.
156
+ *
157
+ * @since 1.8
158
+ * @access private
159
+ * @return string
160
+ */
161
+ static private function unescape_mysql( $value )
162
+ {
163
+ return str_replace( array( "\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"' ),
164
+ array( "\\", "\0", "\n", "\r", "\x1a", "'", '"' ),
165
+ $value );
166
+ }
167
+
168
+ /**
169
+ * Fix strange behaviour if you have escaped quotes in your replacement.
170
+ *
171
+ * @since 1.8
172
+ * @access private
173
+ * @return string
174
+ */
175
+ static private function unescape_quotes( $value )
176
+ {
177
+ return str_replace( '\"', '"', $value );
178
+ }
179
+ }
classes/class-fl-builder-loader.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists( 'FLBuilderLoader' ) ) {
4
+
5
+ /**
6
+ * Responsible for setting up builder constants, classes and includes.
7
+ *
8
+ * @since 1.8
9
+ */
10
+ final class FLBuilderLoader {
11
+
12
+ /**
13
+ * Load the builder if it's not already loaded, otherwise
14
+ * show an admin notice.
15
+ *
16
+ * @since 1.8
17
+ * @return void
18
+ */
19
+ static public function init()
20
+ {
21
+ if ( ! function_exists( 'is_plugin_active' ) ) {
22
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
23
+ }
24
+
25
+ $lite_dirname = 'beaver-builder-lite-version';
26
+ $lite_active = is_plugin_active( $lite_dirname . '/fl-builder.php' );
27
+ $plugin_dirname = basename( dirname( dirname( __FILE__ ) ) );
28
+
29
+ if ( class_exists( 'FLBuilder' ) || ( $plugin_dirname != $lite_dirname && $lite_active ) ) {
30
+ self::admin_notice_hooks();
31
+ return;
32
+ }
33
+
34
+ self::define_constants();
35
+ self::load_files();
36
+ }
37
+
38
+ /**
39
+ * Define builder constants.
40
+ *
41
+ * @since 1.8
42
+ * @return void
43
+ */
44
+ static private function define_constants()
45
+ {
46
+ define('FL_BUILDER_VERSION', '1.8.1');
47
+ define('FL_BUILDER_FILE', trailingslashit(dirname(dirname(__FILE__))) . 'fl-builder.php');
48
+ define('FL_BUILDER_DIR', plugin_dir_path(FL_BUILDER_FILE));
49
+ define('FL_BUILDER_URL', plugins_url('/', FL_BUILDER_FILE));
50
+ define('FL_BUILDER_LITE', true);
51
+ define('FL_BUILDER_SUPPORT_URL', 'https://www.wpbeaverbuilder.com/support/');
52
+ define('FL_BUILDER_UPGRADE_URL', 'https://www.wpbeaverbuilder.com/');
53
+ define('FL_BUILDER_DEMO_URL', 'http://demos.wpbeaverbuilder.com');
54
+ define('FL_BUILDER_OLD_DEMO_URL', 'http://demos.fastlinemedia.com');
55
+ define('FL_BUILDER_DEMO_CACHE_URL', 'http://demos.wpbeaverbuilder.com/wp-content/uploads/bb-plugin/cache/');
56
+ }
57
+
58
+ /**
59
+ * Loads classes and includes.
60
+ *
61
+ * @since 1.8
62
+ * @return void
63
+ */
64
+ static private function load_files()
65
+ {
66
+ /* Classes */
67
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder.php';
68
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin.php';
69
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin-posts.php';
70
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin-settings.php';
71
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-ajax.php';
72
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-ajax-layout.php';
73
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-auto-suggest.php';
74
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-color.php';
75
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-export.php';
76
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-extensions.php';
77
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-fonts.php';
78
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-icons.php';
79
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-import.php';
80
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-loop.php';
81
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-model.php';
82
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-module.php';
83
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-photo.php';
84
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-services.php';
85
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-shortcodes.php';
86
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-update.php';
87
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-timezones.php';
88
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-utils.php';
89
+
90
+ /* Includes */
91
+ require_once FL_BUILDER_DIR . 'includes/compatibility.php';
92
+ require_once FL_BUILDER_DIR . 'includes/updater/updater.php';
93
+ }
94
+
95
+ /**
96
+ * Initializes actions for the admin notice if another version
97
+ * of the builder has already been loaded before this one.
98
+ *
99
+ * @since 1.8
100
+ * @return void
101
+ */
102
+ static private function admin_notice_hooks()
103
+ {
104
+ add_action('admin_notices', __CLASS__ . '::admin_notice');
105
+ add_action('network_admin_notices', __CLASS__ . '::admin_notice');
106
+ }
107
+
108
+ /**
109
+ * Shows an admin notice if another version of the builder
110
+ * has already been loaded before this one.
111
+ *
112
+ * @since 1.8
113
+ * @return void
114
+ */
115
+ static public function admin_notice()
116
+ {
117
+ if ( ! is_admin() ) {
118
+ return;
119
+ }
120
+ else if ( ! is_user_logged_in() ) {
121
+ return;
122
+ }
123
+ else if ( ! current_user_can( 'update_core' ) ) {
124
+ return;
125
+ }
126
+
127
+ $message = __( 'You currently have two versions of Beaver Builder active on this site. Please <a href="%s">deactivate one</a> before continuing.', 'fl-builder' );
128
+
129
+ echo '<div class="updated">';
130
+ echo '<p>' . sprintf( $message, admin_url( 'plugins.php' ) ) . '</p>';
131
+ echo '</div>';
132
+ }
133
+ }
134
+ }
135
+
136
+ FLBuilderLoader::init();
classes/class-fl-builder-loop.php CHANGED
@@ -7,6 +7,17 @@
7
  */
8
  final class FLBuilderLoop {
9
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Returns a new instance of WP_Query based on
12
  * the provided module settings.
@@ -214,3 +225,5 @@ final class FLBuilderLoop {
214
  the_time( $format );
215
  }
216
  }
 
 
7
  */
8
  final class FLBuilderLoop {
9
 
10
+ /**
11
+ * Initializes hooks.
12
+ *
13
+ * @since 1.8
14
+ * @return void
15
+ */
16
+ static public function init()
17
+ {
18
+ add_filter( 'found_posts', __CLASS__ . '::found_posts', 1, 2 );
19
+ }
20
+
21
  /**
22
  * Returns a new instance of WP_Query based on
23
  * the provided module settings.
225
  the_time( $format );
226
  }
227
  }
228
+
229
+ FLBuilderLoop::init();
classes/class-fl-builder-model.php CHANGED
@@ -89,6 +89,15 @@ final class FLBuilderModel {
89
  */
90
  static private $draft_layout_data = array();
91
 
 
 
 
 
 
 
 
 
 
92
  /**
93
  * An array of cached post IDs for node templates.
94
  *
@@ -97,6 +106,42 @@ final class FLBuilderModel {
97
  * @var array $node_template_post_ids
98
  */
99
  static private $node_template_post_ids = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  /**
102
  * Returns a builder edit URL for a post.
@@ -503,7 +548,12 @@ final class FLBuilderModel {
503
 
504
  // Create the upload dir if it doesn't exist.
505
  if ( ! file_exists( $dir_info['path'] ) ) {
 
 
506
  mkdir( $dir_info['path'] );
 
 
 
507
  }
508
 
509
  return apply_filters( 'fl_builder_get_upload_dir', $dir_info );
@@ -535,7 +585,12 @@ final class FLBuilderModel {
535
 
536
  // Create the cache dir if it doesn't exist.
537
  if( ! file_exists( $dir_info['path'] ) ) {
 
 
538
  mkdir( $dir_info['path'] );
 
 
 
539
  }
540
 
541
  return apply_filters( 'fl_builder_get_cache_dir', $dir_info );
@@ -1288,8 +1343,13 @@ final class FLBuilderModel {
1288
  $modules = self::get_nodes( 'module', $col );
1289
 
1290
  foreach ( $modules as $module ) {
 
1291
  $new_nodes[ $module->node ] = clone $module;
1292
- $new_nodes[ $module->node ]->settings = clone $module->settings;
 
 
 
 
1293
  }
1294
  }
1295
  }
@@ -1527,19 +1587,47 @@ final class FLBuilderModel {
1527
  {
1528
  // Resize sibling cols if needed.
1529
  $new_settings->size = self::resize_col($col->node, $new_settings->size);
 
 
 
 
 
1530
 
1531
- // Adjust sibling equal height setting if needed.
1532
  if ( $col->settings->equal_height != $new_settings->equal_height ) {
1533
-
1534
- $data = self::get_layout_data();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1535
  $cols = self::get_nodes( 'column', $col->parent );
1536
 
1537
  foreach ( $cols as $node_id => $node ) {
1538
- $data[ $node_id ]->settings->equal_height = $new_settings->equal_height;
 
 
 
 
 
 
 
 
 
1539
  }
1540
 
1541
  self::update_layout_data( $data );
1542
-
1543
  }
1544
 
1545
  return $new_settings;
@@ -2416,16 +2504,6 @@ final class FLBuilderModel {
2416
  require_once FL_BUILDER_DIR . 'includes/row-settings.php';
2417
  require_once FL_BUILDER_DIR . 'includes/column-settings.php';
2418
  require_once FL_BUILDER_DIR . 'includes/module-settings.php';
2419
-
2420
- $user_templates = FL_BUILDER_DIR . 'includes/user-template-settings.php';
2421
- $node_templates = FL_BUILDER_DIR . 'includes/node-template-settings.php';
2422
-
2423
- if ( file_exists( $user_templates ) ) {
2424
- require_once $user_templates;
2425
- }
2426
- if ( file_exists( $node_templates ) ) {
2427
- require_once $node_templates;
2428
- }
2429
  }
2430
 
2431
  /**
@@ -2862,7 +2940,7 @@ final class FLBuilderModel {
2862
  }
2863
 
2864
  // Return the data.
2865
- return $data;
2866
  }
2867
 
2868
  /**
@@ -2980,8 +3058,10 @@ final class FLBuilderModel {
2980
  if ( ! $settings ) {
2981
  $settings = new StdClass();
2982
  }
2983
-
2984
- return (object)array_merge( (array)$defaults, (array)$settings );
 
 
2985
  }
2986
 
2987
  /**
@@ -3355,7 +3435,8 @@ final class FLBuilderModel {
3355
  $templates[] = array(
3356
  'id' => $post->ID,
3357
  'name' => $post->post_title,
3358
- 'image' => $image
 
3359
  );
3360
  }
3361
 
@@ -3403,6 +3484,10 @@ final class FLBuilderModel {
3403
  */
3404
  static public function get_user_template_type( $template_id = null )
3405
  {
 
 
 
 
3406
  $post = $template_id ? get_post( $template_id ) : FLBuilderModel::get_post();
3407
 
3408
  if ( 'fl-builder-template' != $post->post_type ) {
@@ -3410,13 +3495,13 @@ final class FLBuilderModel {
3410
  }
3411
  else {
3412
 
3413
- $type = wp_get_post_terms( $post->ID, 'fl-builder-template-type' );
3414
-
3415
- if ( 0 === count( $type ) ) {
3416
- return 'layout';
3417
- }
3418
 
3419
- return $type[0]->slug;
3420
  }
3421
  }
3422
 
@@ -3459,12 +3544,12 @@ final class FLBuilderModel {
3459
  if ( ! is_object( $template ) ) {
3460
  $template_id = $template;
3461
  $template = new StdClass();
3462
- $template->data = self::get_layout_data('published', $template_id);
3463
  $template->settings = self::get_layout_settings('published', $template_id);
3464
  }
3465
 
3466
  // Get new ids for the template nodes.
3467
- $template->data = self::generate_new_node_ids($template->data);
3468
 
3469
  // Get the existing layout data and settings.
3470
  $layout_data = self::get_layout_data();
@@ -3475,16 +3560,16 @@ final class FLBuilderModel {
3475
 
3476
  $row_position = self::next_node_position('row');
3477
 
3478
- foreach($template->data as $node_id => $node) {
3479
 
3480
  if($node->type == 'row') {
3481
- $template->data[$node_id]->position += $row_position;
3482
  }
3483
  }
3484
  }
3485
 
3486
  // Merge the layout data and settings.
3487
- $data = array_merge($layout_data, $template->data);
3488
  $settings = self::merge_layout_settings( $layout_settings, $template->settings );
3489
 
3490
  // Update the layout data and settings.
@@ -3584,6 +3669,53 @@ final class FLBuilderModel {
3584
  return self::get_node_template_post_id( $node->template_id );
3585
  }
3586
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3587
  /**
3588
  * Checks to see if a node is the root node of a global template.
3589
  *
@@ -3845,7 +3977,7 @@ final class FLBuilderModel {
3845
  'layout' => $settings['global'] ? FLBuilderAJAXLayout::render( $root_node->node, $template_node_id ) : null
3846
  );
3847
  }
3848
-
3849
  /**
3850
  * Sets the default type for a node template when created in wp-admin.
3851
  *
@@ -4077,19 +4209,23 @@ final class FLBuilderModel {
4077
  $parent = $parent_id == 0 ? null : self::get_node( $parent_id );
4078
  $template_post_id = self::get_node_template_post_id( $template_id );
4079
 
4080
- // Apply a network-wide node template?
4081
- if ( ! $template_post_id && ! $template && class_exists( 'FLBuilderTemplatesOverride' ) ) {
4082
-
4083
- $root_node = FLBuilderTemplatesOverride::apply_node( $template_id, $parent_id, $position );
4084
-
4085
- if ( $root_node ) {
4086
- return $root_node;
4087
- }
 
 
 
 
4088
  }
4089
 
4090
  // Get the template data from $template if we have it.
4091
  if ( is_object( $template ) ) {
4092
- $template_data = $template->data;
4093
  $template_settings = $template->settings;
4094
  $type = $template->type;
4095
  $global = $template->global;
@@ -4163,78 +4299,17 @@ final class FLBuilderModel {
4163
  }
4164
 
4165
  /**
4166
- * Save a core template.
4167
- *
4168
- * @since 1.0
4169
- * @param object $settings The new template settings.
4170
- * @return void
4171
- */
4172
- static public function save_template( $settings )
4173
- {
4174
- // Get the templates array.
4175
- $templates = self::get_templates();
4176
-
4177
- // Make sure we have a settings object.
4178
- $settings = ( object )$settings;
4179
-
4180
- // Add the layout data.
4181
- $settings->nodes = self::generate_new_node_ids( self::get_layout_data() );
4182
-
4183
- // Add the layout settings.
4184
- $settings->settings = self::get_layout_settings();
4185
-
4186
- // Insert the template into the templates array.
4187
- array_splice( $templates, $settings->index, 0, array( $settings ) );
4188
-
4189
- // Save the templates array.
4190
- self::save_templates( $templates );
4191
- }
4192
-
4193
- /**
4194
- * Update a core template.
4195
  *
4196
- * @since 1.0
4197
- * @param int $old_index The old template index.
4198
- * @param object $settings The template settings.
4199
  * @return void
4200
  */
4201
- static public function update_template($old_index, $settings)
4202
  {
4203
- // Get the templates array.
4204
- $templates = self::get_templates();
4205
-
4206
- // Remove the template from its old position.
4207
- $template = array_splice($templates, $old_index, 1);
4208
-
4209
- // Update the settings
4210
- foreach($settings as $key => $val) {
4211
- $template[0]->$key = $val;
4212
  }
4213
-
4214
- // Add the template to its new position.
4215
- array_splice($templates, $settings->index, 0, $template);
4216
-
4217
- // Save the templates array.
4218
- self::save_templates($templates);
4219
- }
4220
-
4221
- /**
4222
- * Delete a core template.
4223
- *
4224
- * @since 1.0
4225
- * @param int $index The index of the template to delete.
4226
- * @return void
4227
- */
4228
- static public function delete_template($index)
4229
- {
4230
- // Get the templates array.
4231
- $templates = self::get_templates();
4232
-
4233
- // Remove the template.
4234
- array_splice($templates, $index, 1);
4235
-
4236
- // Save the templates array.
4237
- self::save_templates($templates);
4238
  }
4239
 
4240
  /**
@@ -4248,14 +4323,15 @@ final class FLBuilderModel {
4248
  */
4249
  static public function apply_template($index = 0, $append = false)
4250
  {
4251
- // Apply a user defined template if core templates are overriden.
4252
- if ( class_exists( 'FLBuilderTemplatesOverride' ) ) {
4253
-
4254
- $success = FLBuilderTemplatesOverride::apply( $index, $append );
4255
-
4256
- if ( $success ) {
4257
- return;
4258
- }
 
4259
  }
4260
 
4261
  // Apply a core template.
@@ -4309,102 +4385,182 @@ final class FLBuilderModel {
4309
  *
4310
  * @since 1.0
4311
  * @param int $index The index of the template.
 
4312
  * @return object
4313
  */
4314
- static public function get_template($index)
4315
  {
4316
- $templates = self::get_templates();
4317
 
4318
- return $templates[$index];
4319
  }
4320
 
4321
  /**
4322
- * Returns data for all core templates.
4323
  *
4324
  * @since 1.0
 
4325
  * @return array
4326
  */
4327
- static public function get_templates()
4328
  {
4329
- $templates = unserialize(file_get_contents(FL_BUILDER_DIR . 'data/templates.dat'));
4330
-
4331
- return is_array($templates) ? $templates : array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4332
  }
4333
 
4334
  /**
4335
- * Save all core template data.
4336
  *
4337
- * @since 1.0
4338
- * @param array $templates
4339
- * @return void
4340
  */
4341
- static public function save_templates($templates = array())
4342
  {
4343
- // Update the indexes for proper positioning.
4344
- $i = 0;
4345
- $updated = array();
4346
-
4347
- foreach($templates as $template) {
4348
- $template->index = $i;
4349
- $updated[$i] = $template;
4350
- $i++;
4351
- }
4352
-
4353
- // Save the templates array.
4354
- file_put_contents(FL_BUILDER_DIR . 'data/templates.dat', serialize($updated));
4355
  }
4356
 
4357
  /**
4358
  * Returns template data needed for the template selector.
 
 
4359
  *
4360
  * @since 1.5.7
 
4361
  * @return array
4362
  */
4363
- static public function get_template_selector_data()
4364
  {
4365
- // Return data for overriding core templates?
4366
- if ( class_exists( 'FLBuilderTemplatesOverride' ) ) {
4367
-
4368
- $data = FLBuilderTemplatesOverride::get_selector_data();
4369
-
4370
- if ( $data ) {
4371
- return $data;
4372
- }
4373
- }
4374
-
4375
- // Return data for core templates.
4376
- $category_labels = array(
4377
- 'landing' => __( 'Home Pages', 'fl-builder' ),
4378
  'company' => __( 'Content Pages', 'fl-builder' )
4379
  );
4380
- $categorized = array();
4381
- $templates = array();
4382
 
4383
- foreach( self::get_templates() as $key => $template ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4384
  $templates[] = array(
4385
  'id' => $key,
4386
  'name' => $template->name,
4387
- 'image' => FL_BUILDER_URL . 'img/templates/' . $template->image,
4388
- 'category' => $template->category
 
4389
  );
4390
  }
4391
 
 
4392
  foreach( $templates as $template ) {
4393
 
4394
- if ( ! isset( $categorized[ $template['category'] ] ) ) {
4395
- $categorized[ $template['category'] ] = array(
4396
- 'name' => $category_labels[ $template['category'] ],
4397
- 'templates' => array()
4398
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4399
  }
4400
-
4401
- $categorized[ $template['category'] ]['templates'][] = $template;
4402
  }
4403
 
4404
- return array(
 
4405
  'templates' => $templates,
4406
  'categorized' => $categorized
4407
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4408
  }
4409
 
4410
  /**
@@ -4440,9 +4596,11 @@ final class FLBuilderModel {
4440
  */
4441
  static public function get_branding()
4442
  {
4443
- $value = self::get_admin_settings_option( '_fl_builder_branding', false );
 
 
4444
 
4445
- return ! $value ? __( 'Page Builder', 'fl-builder' ) : stripcslashes( $value );
4446
  }
4447
 
4448
  /**
@@ -4453,29 +4611,11 @@ final class FLBuilderModel {
4453
  */
4454
  static public function get_branding_icon()
4455
  {
4456
- $value = self::get_admin_settings_option( '_fl_builder_branding_icon', false );
4457
-
4458
- return false === $value ? FL_BUILDER_URL . 'img/beaver.png' : $value;
4459
- }
4460
-
4461
- /**
4462
- * Returns the custom branding data for the builder theme.
4463
- *
4464
- * @since 1.6.4.3
4465
- * @return array
4466
- */
4467
- static public function get_theme_branding()
4468
- {
4469
- $value = self::get_admin_settings_option( '_fl_builder_theme_branding', false );
4470
- $defaults = array(
4471
- 'name' => '',
4472
- 'description' => '',
4473
- 'company_name' => '',
4474
- 'company_url' => '',
4475
- 'screenshot_url' => '',
4476
- );
4477
 
4478
- return ! $value ? $defaults : $value;
4479
  }
4480
 
4481
  /**
@@ -4516,6 +4656,17 @@ final class FLBuilderModel {
4516
  {
4517
  $cap = self::get_editing_capability();
4518
 
 
 
 
 
 
 
 
 
 
 
 
4519
  if ( strstr( $cap, ',' ) ) {
4520
 
4521
  $parts = explode( ',', $cap );
@@ -4560,9 +4711,9 @@ final class FLBuilderModel {
4560
  'video' => true,
4561
  'video_embed' => '<iframe src="https://player.vimeo.com/video/124230072?autoplay=1" width="420" height="315" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>',
4562
  'knowledge_base' => true,
4563
- 'knowledge_base_url' => 'https://www.wpbeaverbuilder.com/knowledge-base/?utm_source=external&utm_medium=builder&utm_campaign=docs-button',
4564
  'forums' => true,
4565
- 'forums_url' => 'https://www.wpbeaverbuilder.com/support/?utm_source=external&utm_medium=builder&utm_campaign=forums-button',
4566
  );
4567
 
4568
  return $defaults;
@@ -4576,9 +4727,11 @@ final class FLBuilderModel {
4576
  */
4577
  static public function get_help_button_settings()
4578
  {
4579
- $value = self::get_admin_settings_option( '_fl_builder_help_button', false );
 
 
4580
 
4581
- return false === $value ? self::get_help_button_defaults() : $value;
4582
  }
4583
 
4584
  /**
@@ -4722,6 +4875,7 @@ final class FLBuilderModel {
4722
  delete_option('_fl_builder_enabled_modules');
4723
  delete_option('_fl_builder_enabled_templates');
4724
  delete_option('_fl_builder_user_templates_admin');
 
4725
  delete_option('_fl_builder_templates_override');
4726
  delete_option('_fl_builder_templates_override_rows');
4727
  delete_option('_fl_builder_templates_override_modules');
@@ -4756,4 +4910,71 @@ final class FLBuilderModel {
4756
  exit;
4757
  }
4758
  }
4759
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  */
90
  static private $draft_layout_data = array();
91
 
92
+ /**
93
+ * An array of paths to template data files.
94
+ *
95
+ * @since 1.8
96
+ * @access private
97
+ * @var array $templates
98
+ */
99
+ static private $templates = array();
100
+
101
  /**
102
  * An array of cached post IDs for node templates.
103
  *
106
  * @var array $node_template_post_ids
107
  */
108
  static private $node_template_post_ids = array();
109
+
110
+ /**
111
+ * An array of cached types for user and node templates.
112
+ *
113
+ * @since 1.7.9
114
+ * @access private
115
+ * @var array $node_template_types
116
+ */
117
+ static private $node_template_types = array();
118
+
119
+ /**
120
+ * Initialize hooks.
121
+ *
122
+ * @since 1.8
123
+ * @return void
124
+ */
125
+ static public function init()
126
+ {
127
+ /* Admin AJAX */
128
+ add_action('wp_ajax_fl_builder_disable', __CLASS__ . '::disable');
129
+ add_action('wp_ajax_fl_builder_duplicate_wpml_layout', __CLASS__ . '::duplicate_wpml_layout');
130
+
131
+ /* Actions */
132
+ add_action('init', __CLASS__ . '::load_settings', 1);
133
+ add_action('init', __CLASS__ . '::load_modules', 2);
134
+ add_action('before_delete_post', __CLASS__ . '::delete_post');
135
+ add_action('save_post', __CLASS__ . '::save_revision');
136
+ add_action('save_post', __CLASS__ . '::set_node_template_default_type', 10, 3);
137
+ add_action('wp_restore_post_revision', __CLASS__ . '::restore_revision', 10, 2);
138
+
139
+ /* Filters */
140
+ add_filter('heartbeat_received', __CLASS__ . '::lock_post', 10, 2);
141
+
142
+ /* Core Templates */
143
+ self::register_templates( FL_BUILDER_DIR . 'data/templates.dat' );
144
+ }
145
 
146
  /**
147
  * Returns a builder edit URL for a post.
548
 
549
  // Create the upload dir if it doesn't exist.
550
  if ( ! file_exists( $dir_info['path'] ) ) {
551
+
552
+ // Create the directory.
553
  mkdir( $dir_info['path'] );
554
+
555
+ // Add an index file for security.
556
+ file_put_contents( $dir_info['path'] . 'index.html', '' );
557
  }
558
 
559
  return apply_filters( 'fl_builder_get_upload_dir', $dir_info );
585
 
586
  // Create the cache dir if it doesn't exist.
587
  if( ! file_exists( $dir_info['path'] ) ) {
588
+
589
+ // Create the directory.
590
  mkdir( $dir_info['path'] );
591
+
592
+ // Add an index file for security.
593
+ file_put_contents( $dir_info['path'] . 'index.html', '' );
594
  }
595
 
596
  return apply_filters( 'fl_builder_get_cache_dir', $dir_info );
1343
  $modules = self::get_nodes( 'module', $col );
1344
 
1345
  foreach ( $modules as $module ) {
1346
+
1347
  $new_nodes[ $module->node ] = clone $module;
1348
+ $new_nodes[ $module->node ]->settings = new stdClass;
1349
+
1350
+ foreach ( $module->settings as $key => $val ) {
1351
+ $new_nodes[ $module->node ]->settings->$key = $val;
1352
+ }
1353
  }
1354
  }
1355
  }
1587
  {
1588
  // Resize sibling cols if needed.
1589
  $new_settings->size = self::resize_col($col->node, $new_settings->size);
1590
+
1591
+ // Update other sibling vars as needed.
1592
+ $equal_height = false;
1593
+ $content_alignment = false;
1594
+ $responsive_order = false;
1595
 
1596
+ // Adjust sibling equal height?
1597
  if ( $col->settings->equal_height != $new_settings->equal_height ) {
1598
+ $equal_height = $new_settings->equal_height;
1599
+ }
1600
+
1601
+ // Adjust sibling content alignment?
1602
+ if ( $col->settings->content_alignment != $new_settings->content_alignment ) {
1603
+ $content_alignment = $new_settings->content_alignment;
1604
+ }
1605
+
1606
+ // Adjust sibling responsive order?
1607
+ if ( $col->settings->responsive_order != $new_settings->responsive_order ) {
1608
+ $responsive_order = $new_settings->responsive_order;
1609
+ }
1610
+
1611
+ // Update the siblings?
1612
+ if ( false !== $equal_height || false !== $content_alignment || false !== $responsive_order ) {
1613
+
1614
+ $data = self::get_layout_data();
1615
  $cols = self::get_nodes( 'column', $col->parent );
1616
 
1617
  foreach ( $cols as $node_id => $node ) {
1618
+
1619
+ if ( false !== $equal_height ) {
1620
+ $data[ $node_id ]->settings->equal_height = $equal_height;
1621
+ }
1622
+ if ( false !== $content_alignment ) {
1623
+ $data[ $node_id ]->settings->content_alignment = $content_alignment;
1624
+ }
1625
+ if ( false !== $responsive_order ) {
1626
+ $data[ $node_id ]->settings->responsive_order = $responsive_order;
1627
+ }
1628
  }
1629
 
1630
  self::update_layout_data( $data );
 
1631
  }
1632
 
1633
  return $new_settings;
2504
  require_once FL_BUILDER_DIR . 'includes/row-settings.php';
2505
  require_once FL_BUILDER_DIR . 'includes/column-settings.php';
2506
  require_once FL_BUILDER_DIR . 'includes/module-settings.php';
 
 
 
 
 
 
 
 
 
 
2507
  }
2508
 
2509
  /**
2940
  }
2941
 
2942
  // Return the data.
2943
+ return apply_filters( 'fl_builder_layout_data', $data, $status, $post_id );
2944
  }
2945
 
2946
  /**
3058
  if ( ! $settings ) {
3059
  $settings = new StdClass();
3060
  }
3061
+
3062
+ $settings = (object)array_merge( (array)$defaults, (array)$settings );
3063
+
3064
+ return apply_filters( 'fl_builder_layout_settings', $settings, $status, $post_id );
3065
  }
3066
 
3067
  /**
3435
  $templates[] = array(
3436
  'id' => $post->ID,
3437
  'name' => $post->post_title,
3438
+ 'image' => $image,
3439
+ 'type' => 'user'
3440
  );
3441
  }
3442
 
3484
  */
3485
  static public function get_user_template_type( $template_id = null )
3486
  {
3487
+ if ( $template_id && isset( self::$node_template_types[ $template_id ] ) ) {
3488
+ return self::$node_template_types[ $template_id ];
3489
+ }
3490
+
3491
  $post = $template_id ? get_post( $template_id ) : FLBuilderModel::get_post();
3492
 
3493
  if ( 'fl-builder-template' != $post->post_type ) {
3495
  }
3496
  else {
3497
 
3498
+ $terms = wp_get_post_terms( $post->ID, 'fl-builder-template-type' );
3499
+
3500
+ $type = ( 0 === count( $terms ) ) ? 'layout' : $terms[0]->slug;
3501
+
3502
+ self::$node_template_types[ $template_id ] = $type;
3503
 
3504
+ return $type;
3505
  }
3506
  }
3507
 
3544
  if ( ! is_object( $template ) ) {
3545
  $template_id = $template;
3546
  $template = new StdClass();
3547
+ $template->nodes = self::get_layout_data('published', $template_id);
3548
  $template->settings = self::get_layout_settings('published', $template_id);
3549
  }
3550
 
3551
  // Get new ids for the template nodes.
3552
+ $template->nodes = self::generate_new_node_ids($template->nodes);
3553
 
3554
  // Get the existing layout data and settings.
3555
  $layout_data = self::get_layout_data();
3560
 
3561
  $row_position = self::next_node_position('row');
3562
 
3563
+ foreach($template->nodes as $node_id => $node) {
3564
 
3565
  if($node->type == 'row') {
3566
+ $template->nodes[$node_id]->position += $row_position;
3567
  }
3568
  }
3569
  }
3570
 
3571
  // Merge the layout data and settings.
3572
+ $data = array_merge($layout_data, $template->nodes);
3573
  $settings = self::merge_layout_settings( $layout_settings, $template->settings );
3574
 
3575
  // Update the layout data and settings.
3669
  return self::get_node_template_post_id( $node->template_id );
3670
  }
3671
 
3672
+ /**
3673
+ * Check the visibility settings that has been sets from any type of node (rows/columns/modules)
3674
+ * This will be applied ONLY when the builder is not active.
3675
+ *
3676
+ * @param object $node The type of object to check
3677
+ * @return bool
3678
+ */
3679
+ static public function is_node_visible($node)
3680
+ {
3681
+ $is_visible = true;
3682
+
3683
+ if ( self::is_builder_active() ) {
3684
+ return $is_visible;
3685
+ }
3686
+
3687
+ if ( isset( $node->settings->visibility_display ) && ('' != $node->settings->visibility_display) ) {
3688
+
3689
+ // For logged out users
3690
+ if ( $node->settings->visibility_display == 'logged_out' && ! is_user_logged_in() ) {
3691
+ $is_visible = true;
3692
+ }
3693
+ // For logged in users
3694
+ else if ( $node->settings->visibility_display == 'logged_in' && is_user_logged_in() ) {
3695
+ $is_visible = true;
3696
+
3697
+ // User capability setting
3698
+ if ( isset($node->settings->visibility_user_capability) && ! empty($node->settings->visibility_user_capability) ) {
3699
+ if (self::current_user_has_capability( trim( $node->settings->visibility_user_capability ) )) {
3700
+ $is_visible = true;
3701
+ }
3702
+ else {
3703
+ $is_visible = false;
3704
+ }
3705
+ }
3706
+ }
3707
+ // Never
3708
+ else if ( $node->settings->visibility_display == 0 ) {
3709
+ $is_visible = false;
3710
+ } else {
3711
+ $is_visible = false;
3712
+ }
3713
+
3714
+ }
3715
+
3716
+ return $is_visible;
3717
+ }
3718
+
3719
  /**
3720
  * Checks to see if a node is the root node of a global template.
3721
  *
3977
  'layout' => $settings['global'] ? FLBuilderAJAXLayout::render( $root_node->node, $template_node_id ) : null
3978
  );
3979
  }
3980
+
3981
  /**
3982
  * Sets the default type for a node template when created in wp-admin.
3983
  *
4209
  $parent = $parent_id == 0 ? null : self::get_node( $parent_id );
4210
  $template_post_id = self::get_node_template_post_id( $template_id );
4211
 
4212
+ // Allow extensions to hook into applying a node template.
4213
+ $override = apply_filters( 'fl_builder_override_apply_node_template', false, array(
4214
+ 'template_id' => $template_id,
4215
+ 'parent_id' => $parent_id,
4216
+ 'position' => $position,
4217
+ 'template' => $template,
4218
+ 'template_post_id' => $template_post_id
4219
+ ) );
4220
+
4221
+ // Return if we got an override from the filter.
4222
+ if ( $override ) {
4223
+ return $override;
4224
  }
4225
 
4226
  // Get the template data from $template if we have it.
4227
  if ( is_object( $template ) ) {
4228
+ $template_data = $template->nodes;
4229
  $template_settings = $template->settings;
4230
  $type = $template->type;
4231
  $global = $template->global;
4299
  }
4300
 
4301
  /**
4302
+ * Registers a template data file with the builder.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4303
  *
4304
+ * @since 1.8
4305
+ * @param sting $path The directory path to the template data file.
 
4306
  * @return void
4307
  */
4308
+ static public function register_templates( $path = false )
4309
  {
4310
+ if ( $path && file_exists( $path ) ) {
4311
+ self::$templates[] = $path;
 
 
 
 
 
 
 
4312
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4313
  }
4314
 
4315
  /**
4323
  */
4324
  static public function apply_template($index = 0, $append = false)
4325
  {
4326
+ // Allow extensions to hook into applying a template.
4327
+ $override = apply_filters( 'fl_builder_override_apply_template', false, array(
4328
+ 'index' => $index,
4329
+ 'append' => $append
4330
+ ) );
4331
+
4332
+ // Return if we have an override from the filter.
4333
+ if ( $override ) {
4334
+ return;
4335
  }
4336
 
4337
  // Apply a core template.
4385
  *
4386
  * @since 1.0
4387
  * @param int $index The index of the template.
4388
+ * @param string $type The type of template to get. Currently either layout, row or module.
4389
  * @return object
4390
  */
4391
+ static public function get_template( $index, $type = 'layout' )
4392
  {
4393
+ $templates = self::get_templates( $type );
4394
 
4395
+ return isset( $templates[ $index ] ) ? $templates[ $index ] : false;
4396
  }
4397
 
4398
  /**
4399
+ * Returns data for all core or third party templates.
4400
  *
4401
  * @since 1.0
4402
+ * @param string $type Either layout, row or module
4403
  * @return array
4404
  */
4405
+ static public function get_templates( $type = 'layout' )
4406
  {
4407
+ $templates = array();
4408
+
4409
+ foreach ( self::$templates as $path ) {
4410
+
4411
+ if ( file_exists( $path ) ) {
4412
+
4413
+ ob_start();
4414
+ include $path;
4415
+ $unserialized = unserialize( ob_get_clean() );
4416
+
4417
+ if ( is_array( $unserialized ) ) {
4418
+
4419
+ if ( isset( $unserialized[ $type ] ) ) {
4420
+ $templates = array_merge( $templates, $unserialized[ $type ] );
4421
+ }
4422
+ else if ( 'layout' == $type ) {
4423
+ $templates = array_merge( $templates, $unserialized );
4424
+ }
4425
+ }
4426
+ }
4427
+ }
4428
+
4429
+ return $templates;
4430
  }
4431
 
4432
  /**
4433
+ * Checks to see if any templates exist.
4434
  *
4435
+ * @since 1.8
4436
+ * @return bool
 
4437
  */
4438
+ static public function has_templates()
4439
  {
4440
+ return apply_filters( 'fl_builder_has_templates', ( count( self::get_templates() ) > 0 ) );
 
 
 
 
 
 
 
 
 
 
 
4441
  }
4442
 
4443
  /**
4444
  * Returns template data needed for the template selector.
4445
+ * Can also return data for row and module templates if
4446
+ * a template type is passed.
4447
  *
4448
  * @since 1.5.7
4449
+ * @param string $type Either layout, row or module
4450
  * @return array
4451
  */
4452
+ static public function get_template_selector_data( $type = 'layout' )
4453
  {
4454
+ $categorized = array();
4455
+ $templates = array();
4456
+ $core_categories = array(
4457
+ 'landing' => __( 'Landing Pages', 'fl-builder' ),
 
 
 
 
 
 
 
 
 
4458
  'company' => __( 'Content Pages', 'fl-builder' )
4459
  );
 
 
4460
 
4461
+ // Build the the templates array.
4462
+ foreach( self::get_templates( $type ) as $key => $template ) {
4463
+
4464
+ if ( 'module' == $type ) {
4465
+
4466
+ $node = array_shift( $template->nodes );
4467
+
4468
+ if ( ! isset( self::$modules[ $node->settings->type ] ) ) {
4469
+ continue;
4470
+ }
4471
+ }
4472
+
4473
+ if ( strstr( $template->image, '://' ) ) {
4474
+ $image = $template->image;
4475
+ }
4476
+ else {
4477
+ $image = FL_BUILDER_URL . 'img/templates/' . ( empty( $template->image ) ? 'blank.jpg' : $template->image );
4478
+ }
4479
+
4480
  $templates[] = array(
4481
  'id' => $key,
4482
  'name' => $template->name,
4483
+ 'image' => $image,
4484
+ 'category' => isset( $template->category ) ? $template->category : $template->categories,
4485
+ 'type' => 'core'
4486
  );
4487
  }
4488
 
4489
+ // Build the categorized templates array.
4490
  foreach( $templates as $template ) {
4491
 
4492
+ if ( is_array( $template['category'] ) ) {
4493
+
4494
+ foreach ( $template['category'] as $cat_key => $cat_label ) {
4495
+
4496
+ if ( ! isset( $categorized[ $cat_key ] ) ) {
4497
+ $categorized[ $cat_key ] = array(
4498
+ 'name' => $cat_label,
4499
+ 'templates' => array()
4500
+ );
4501
+ }
4502
+
4503
+ $categorized[ $cat_key ]['templates'][] = $template;
4504
+ }
4505
+ }
4506
+ else {
4507
+
4508
+ if ( ! isset( $categorized[ $template['category'] ] ) ) {
4509
+ $categorized[ $template['category'] ] = array(
4510
+ 'name' => $core_categories[ $template['category'] ],
4511
+ 'templates' => array()
4512
+ );
4513
+ }
4514
+
4515
+ $categorized[ $template['category'] ]['templates'][] = $template;
4516
  }
 
 
4517
  }
4518
 
4519
+ // Return both the templates and categorized templates array.
4520
+ return apply_filters( 'fl_builder_template_selector_data', array(
4521
  'templates' => $templates,
4522
  'categorized' => $categorized
4523
+ ), $type );
4524
+ }
4525
+
4526
+ /**
4527
+ * Returns data needed for the template selector's category filter.
4528
+ *
4529
+ * @since 1.8
4530
+ * @return array
4531
+ */
4532
+ static public function get_template_selector_filter_data()
4533
+ {
4534
+ $templates = self::get_template_selector_data();
4535
+ $data = array();
4536
+
4537
+ foreach ( $templates['categorized'] as $slug => $category ) {
4538
+ $data[ $slug ] = $category['name'];
4539
+ }
4540
+
4541
+ return apply_filters( 'fl_builder_template_selector_filter_data', $data );
4542
+ }
4543
+
4544
+ /**
4545
+ * Returns data for row templates to be shown in the UI panel.
4546
+ *
4547
+ * @since 1.8
4548
+ * @return array
4549
+ */
4550
+ static public function get_row_templates_data()
4551
+ {
4552
+ return apply_filters( 'fl_builder_row_templates_data', self::get_template_selector_data( 'row' ) );
4553
+ }
4554
+
4555
+ /**
4556
+ * Returns data for module templates to be shown in the UI panel.
4557
+ *
4558
+ * @since 1.8
4559
+ * @return array
4560
+ */
4561
+ static public function get_module_templates_data()
4562
+ {
4563
+ return apply_filters( 'fl_builder_module_templates_data', self::get_template_selector_data( 'module' ) );
4564
  }
4565
 
4566
  /**
4596
  */
4597
  static public function get_branding()
4598
  {
4599
+ if ( class_exists( 'FLBuilderWhiteLabel' ) ) {
4600
+ return FLBuilderWhiteLabel::get_branding();
4601
+ }
4602
 
4603
+ return __( 'Page Builder', 'fl-builder' );
4604
  }
4605
 
4606
  /**
4611
  */
4612
  static public function get_branding_icon()
4613
  {
4614
+ if ( class_exists( 'FLBuilderWhiteLabel' ) ) {
4615
+ return FLBuilderWhiteLabel::get_branding_icon();
4616
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4617
 
4618
+ return FL_BUILDER_URL . 'img/beaver.png';
4619
  }
4620
 
4621
  /**
4656
  {
4657
  $cap = self::get_editing_capability();
4658
 
4659
+ return self::current_user_has_capability($cap);
4660
+ }
4661
+
4662
+ /**
4663
+ * Check if the current user has the specific capabilities
4664
+ *
4665
+ * @param string $cap The capability to evaluate if it's single or multiple (comma separated) value
4666
+ * @return bool
4667
+ */
4668
+ static public function current_user_has_capability($cap)
4669
+ {
4670
  if ( strstr( $cap, ',' ) ) {
4671
 
4672
  $parts = explode( ',', $cap );
4711
  'video' => true,
4712
  'video_embed' => '<iframe src="https://player.vimeo.com/video/124230072?autoplay=1" width="420" height="315" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>',
4713
  'knowledge_base' => true,
4714
+ 'knowledge_base_url' => 'https://www.wpbeaverbuilder.com/knowledge-base/?utm_medium=' . ( true === FL_BUILDER_LITE ? 'bb-lite' : 'bb-pro' ) . '&utm_source=builder-ui&utm_campaign=kb-help-button',
4715
  'forums' => true,
4716
+ 'forums_url' => 'https://www.wpbeaverbuilder.com/beaver-builder-support/?utm_medium=' . ( true === FL_BUILDER_LITE ? 'bb-lite' : 'bb-pro' ) . '&utm_source=builder-ui&utm_campaign=forums-help-button',
4717
  );
4718
 
4719
  return $defaults;
4727
  */
4728
  static public function get_help_button_settings()
4729
  {
4730
+ if ( class_exists( 'FLBuilderWhiteLabel' ) ) {
4731
+ return FLBuilderWhiteLabel::get_help_button_settings();
4732
+ }
4733
 
4734
+ return self::get_help_button_defaults();
4735
  }
4736
 
4737
  /**
4875
  delete_option('_fl_builder_enabled_modules');
4876
  delete_option('_fl_builder_enabled_templates');
4877
  delete_option('_fl_builder_user_templates_admin');
4878
+ delete_option('_fl_builder_template_data_exporter');
4879
  delete_option('_fl_builder_templates_override');
4880
  delete_option('_fl_builder_templates_override_rows');
4881
  delete_option('_fl_builder_templates_override_modules');
4910
  exit;
4911
  }
4912
  }
4913
+
4914
+ /**
4915
+ * @since 1.6.4.3
4916
+ * @deprecated 1.8
4917
+ */
4918
+ static public function get_theme_branding()
4919
+ {
4920
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderWhiteLabel::get_theme_branding()' );
4921
+
4922
+ if ( class_exists( 'FLBuilderWhiteLabel' ) ) {
4923
+ return FLBuilderWhiteLabel::get_theme_branding();
4924
+ }
4925
+ }
4926
+
4927
+ /**
4928
+ * @since 1.0
4929
+ * @deprecated 1.8
4930
+ */
4931
+ static public function save_templates( $templates = array() )
4932
+ {
4933
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderCoreTemplatesAdmin::save_templates()' );
4934
+
4935
+ if ( class_exists( 'FLBuilderCoreTemplatesAdmin' ) ) {
4936
+ FLBuilderCoreTemplatesAdmin::save_templates( $templates );
4937
+ }
4938
+ }
4939
+
4940
+ /**
4941
+ * @since 1.0
4942
+ * @deprecated 1.8
4943
+ */
4944
+ static public function save_template( $settings )
4945
+ {
4946
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderCoreTemplatesAdmin::save_template()' );
4947
+
4948
+ if ( class_exists( 'FLBuilderCoreTemplatesAdmin' ) ) {
4949
+ FLBuilderCoreTemplatesAdmin::save_template( $settings );
4950
+ }
4951
+ }
4952
+
4953
+ /**
4954
+ * @since 1.0
4955
+ * @deprecated 1.8
4956
+ */
4957
+ static public function update_template( $old_index, $settings )
4958
+ {
4959
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderCoreTemplatesAdmin::update_template()' );
4960
+
4961
+ if ( class_exists( 'FLBuilderCoreTemplatesAdmin' ) ) {
4962
+ FLBuilderCoreTemplatesAdmin::update_template( $old_index, $settings );
4963
+ }
4964
+ }
4965
+
4966
+ /**
4967
+ * @since 1.0
4968
+ * @deprecated 1.8
4969
+ */
4970
+ static public function delete_template( $index )
4971
+ {
4972
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderCoreTemplatesAdmin::delete_template()' );
4973
+
4974
+ if ( class_exists( 'FLBuilderCoreTemplatesAdmin' ) ) {
4975
+ FLBuilderCoreTemplatesAdmin::delete_template( $index );
4976
+ }
4977
+ }
4978
+ }
4979
+
4980
+ FLBuilderModel::init();
classes/class-fl-builder-module.php CHANGED
@@ -158,6 +158,8 @@ class FLBuilderModule {
158
 
159
  // We need to normalize the paths here since path comparisons
160
  // break on Windows because they use backslashes.
 
 
161
  $dir_path = str_replace( '\\', '/', $dir_path );
162
  $stylesheet_directory = str_replace( '\\', '/', get_stylesheet_directory() );
163
  $stylesheet_directory_uri = str_replace( '\\', '/', get_stylesheet_directory_uri() );
@@ -177,8 +179,8 @@ class FLBuilderModule {
177
  $this->url = trailingslashit($params['url']);
178
  $this->dir = trailingslashit($params['dir']);
179
  }
180
- else if(!stristr($dir_path, FL_BUILDER_DIR)) {
181
- $this->url = trailingslashit(str_replace(trailingslashit(ABSPATH), trailingslashit(home_url()), $dir_path));
182
  $this->dir = trailingslashit($dir_path);
183
  }
184
  else {
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 );
162
+ $fl_builder_dir = str_replace( '\\', '/', FL_BUILDER_DIR );
163
  $dir_path = str_replace( '\\', '/', $dir_path );
164
  $stylesheet_directory = str_replace( '\\', '/', get_stylesheet_directory() );
165
  $stylesheet_directory_uri = str_replace( '\\', '/', get_stylesheet_directory_uri() );
179
  $this->url = trailingslashit($params['url']);
180
  $this->dir = trailingslashit($params['dir']);
181
  }
182
+ else if(!stristr($dir_path, $fl_builder_dir)) {
183
+ $this->url = trailingslashit(str_replace(trailingslashit($abspath), trailingslashit(home_url()), $dir_path));
184
  $this->dir = trailingslashit($dir_path);
185
  }
186
  else {
classes/class-fl-builder-shortcodes.php CHANGED
@@ -39,6 +39,7 @@ final class FLBuilderShortcodes {
39
  if ( isset( $attrs['id'] ) ) {
40
 
41
  $args['orderby'] = 'post__in';
 
42
 
43
  if ( is_numeric( $attrs['id'] ) ) {
44
  $args['post__in'] = array( $attrs['id'] );
39
  if ( isset( $attrs['id'] ) ) {
40
 
41
  $args['orderby'] = 'post__in';
42
+ $args['ignore_sticky_posts'] = true;
43
 
44
  if ( is_numeric( $attrs['id'] ) ) {
45
  $args['post__in'] = array( $attrs['id'] );
classes/class-fl-builder-update.php CHANGED
@@ -7,6 +7,17 @@
7
  */
8
  final class FLBuilderUpdate {
9
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Checks to see if an update should be run. If it should,
12
  * the appropriate update method is run and the version
@@ -15,7 +26,7 @@ final class FLBuilderUpdate {
15
  * @since 1.2.8
16
  * @return void
17
  */
18
- static public function init()
19
  {
20
  // Make sure the user is logged in.
21
  if ( ! is_user_logged_in() ) {
@@ -430,4 +441,6 @@ final class FLBuilderUpdate {
430
  }
431
  }
432
  }
433
- }
 
 
7
  */
8
  final class FLBuilderUpdate {
9
 
10
+ /**
11
+ * Initialize hooks.
12
+ *
13
+ * @since 1.8
14
+ * @return void
15
+ */
16
+ static public function init()
17
+ {
18
+ add_action( 'init', __CLASS__ . '::maybe_run', 11 );
19
+ }
20
+
21
  /**
22
  * Checks to see if an update should be run. If it should,
23
  * the appropriate update method is run and the version
26
  * @since 1.2.8
27
  * @return void
28
  */
29
+ static public function maybe_run()
30
  {
31
  // Make sure the user is logged in.
32
  if ( ! is_user_logged_in() ) {
441
  }
442
  }
443
  }
444
+ }
445
+
446
+ FLBuilderUpdate::init();
classes/class-fl-builder.php CHANGED
@@ -23,6 +23,39 @@ final class FLBuilder {
23
  */
24
  static private $template_dir = 'fl-builder/includes';
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  /**
27
  * Localization
28
  *
@@ -55,38 +88,15 @@ final class FLBuilder {
55
  }
56
 
57
  /**
58
- * Initializes the builder interface.
59
  *
60
- * @since 1.0
 
61
  * @return void
62
  */
63
- static public function init()
64
  {
65
- // Enable editing if the builder is active.
66
- if ( FLBuilderModel::is_builder_active() && ! defined( 'DOING_AJAX' ) ) {
67
-
68
- // Tell W3TC not to minify while the builder is active.
69
- define( 'DONOTMINIFY', true );
70
-
71
- // Tell Autoptimize not to minify while the builder is active.
72
- add_filter( 'autoptimize_filter_noptimize', '__return_true' );
73
-
74
- // Remove 3rd party editor buttons.
75
- remove_all_actions('media_buttons', 999999);
76
- remove_all_actions('media_buttons_context', 999999);
77
-
78
- // Get the post.
79
- require_once ABSPATH . 'wp-admin/includes/post.php';
80
- $post_id = FLBuilderModel::get_post_id();
81
-
82
- // Check to see if the post is locked.
83
- if(wp_check_post_lock($post_id) !== false) {
84
- header('Location: ' . admin_url('/post.php?post=' . $post_id . '&action=edit'));
85
- }
86
- else {
87
- FLBuilderModel::enable_editing();
88
- }
89
- }
90
  }
91
 
92
  /**
@@ -280,7 +290,7 @@ final class FLBuilder {
280
  wp_register_style('jquery-magnificpopup', $css_url . 'jquery.magnificpopup.css', array(), $ver);
281
 
282
  // Register icon CDN CSS
283
- wp_register_style('font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), $ver);
284
  wp_register_style('foundation-icons', 'https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css', array(), $ver);
285
 
286
  // Register additional JS
@@ -413,6 +423,22 @@ final class FLBuilder {
413
  }
414
  }
415
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  /**
417
  * Register and enqueue the styles and scripts for the builder UI.
418
  *
@@ -497,11 +523,6 @@ final class FLBuilder {
497
  else {
498
  wp_enqueue_script('fl-builder-min', $js_url . 'fl-builder.min.js', array(), $ver, true);
499
  }
500
-
501
- /* Core template settings */
502
- if(file_exists(FL_BUILDER_DIR . 'js/fl-builder-template-settings.js')) {
503
- wp_enqueue_script('fl-builder-template-settings', FL_BUILDER_URL . 'js/fl-builder-template-settings.js', array(), $ver, true);
504
- }
505
 
506
  /* Additional module styles and scripts */
507
  foreach(FLBuilderModel::$modules as $module) {
@@ -599,6 +620,42 @@ final class FLBuilder {
599
  return apply_filters( 'fl_builder_template_path', $template_path, $template_base, $slug );
600
  }
601
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  /**
603
  * Renders the markup for the builder interface.
604
  *
@@ -612,27 +669,12 @@ final class FLBuilder {
612
  if ( FLBuilderModel::is_builder_active() ) {
613
 
614
  $post_id = $wp_the_query->post->ID;
615
- $help_button = FLBuilderModel::get_help_button_settings();
616
- $enabled_templates = FLBuilderModel::get_enabled_templates();
617
- $color_presets = FLBuilderModel::get_color_presets();
618
  $simple_ui = ! FLBuilderModel::current_user_has_editing_capability();
619
  $categories = FLBuilderModel::get_categorized_modules();
620
- $row_templates = null;
621
- $module_templates = null;
622
 
623
- if ( ! FLBuilderModel::is_post_user_template( 'module' ) && ! $simple_ui ) {
624
-
625
- if ( class_exists( 'FLBuilderTemplatesOverride' ) ) {
626
-
627
- if ( FLBuilderTemplatesOverride::show_modules() ) {
628
- $module_templates = FLBuilderTemplatesOverride::get_selector_data( 'module' );
629
- }
630
- if ( FLBuilderTemplatesOverride::show_rows() && ! FLBuilderModel::is_post_user_template( 'row' ) ) {
631
- $row_templates = FLBuilderTemplatesOverride::get_selector_data( 'row' );
632
- }
633
- }
634
-
635
- include FL_BUILDER_DIR . 'includes/ui-panel.php';
636
  }
637
 
638
  include FL_BUILDER_DIR . 'includes/ui-bar.php';
@@ -650,17 +692,8 @@ final class FLBuilder {
650
  */
651
  static public function render_ui_bar_title()
652
  {
653
- global $wp_the_query;
654
-
655
- $post_id = $wp_the_query->post->ID;
656
-
657
  // Get the bar title.
658
- if( FLBuilderModel::is_post_user_template() ) {
659
- $title = sprintf( __( 'Template: %s', 'fl-builder' ), get_the_title( $post_id ) );
660
- }
661
- else {
662
- $title = FLBuilderModel::get_branding();
663
- }
664
 
665
  // Render the bar title.
666
  if ( '' == FLBuilderModel::get_branding_icon() ) {
@@ -681,21 +714,20 @@ final class FLBuilder {
681
  */
682
  static public function render_ui_bar_buttons()
683
  {
684
- $help_button = FLBuilderModel::get_help_button_settings();
685
- $enabled_templates = FLBuilderModel::get_enabled_templates();
686
- $simple_ui = ! FLBuilderModel::current_user_has_editing_capability();
687
 
688
- $buttons = array(
689
  'help' => array(
690
  'label' => '<i class="fa fa-question-circle"></i>',
691
  'show' => $help_button['enabled'] && ! $simple_ui
692
  ),
693
  'upgrade' => array(
694
- 'label' => __( 'Upgrade!', 'fl-builder' ),
695
  'show' => true === FL_BUILDER_LITE
696
  ),
697
  'buy' => array(
698
- 'label' => __( 'Buy Now!', 'fl-builder' ),
699
  'show' => stristr( home_url(), 'demo.wpbeaverbuilder.com' )
700
  ),
701
  'done' => array(
@@ -704,17 +736,17 @@ final class FLBuilder {
704
  ),
705
  'tools' => array(
706
  'label' => __( 'Tools', 'fl-builder' ),
707
- 'show' => ! FLBuilderModel::is_post_user_template( 'module' ) && ! $simple_ui
708
  ),
709
  'templates' => array(
710
  'label' => __( 'Templates', 'fl-builder' ),
711
- 'show' => ! FLBuilderModel::is_post_user_template() && true !== FL_BUILDER_LITE && $enabled_templates != 'disabled' && ! $simple_ui
712
  ),
713
  'add-content' => array(
714
  'label' => __( 'Add Content', 'fl-builder' ),
715
- 'show' => ! FLBuilderModel::is_post_user_template( 'module' ) && ! $simple_ui
716
  )
717
- );
718
 
719
  echo '<div class="fl-builder-bar-actions">';
720
 
@@ -736,37 +768,38 @@ final class FLBuilder {
736
  echo '<div class="fl-clear"></div></div>';
737
  }
738
 
739
- /**
740
- * Renders the UI panel for node templates.
741
  *
742
- * @since 1.6.3
743
  * @return void
744
  */
745
- static public function render_ui_panel_node_templates()
746
  {
747
- $file = FL_BUILDER_DIR . 'includes/ui-panel-node-templates.php';
 
 
 
748
 
749
- if ( file_exists( $file ) && FLBuilderModel::node_templates_enabled() ) {
750
-
751
- $saved_rows = FLBuilderModel::get_node_templates( 'row' );
752
- $saved_modules = FLBuilderModel::get_node_templates( 'module' );
753
- $node_template = FLBuilderModel::is_post_node_template();
754
-
755
- // Don't global rows for node templates.
756
- foreach ( $saved_rows as $key => $val ) {
757
- if ( $node_template && $val['global'] ) {
758
- unset( $saved_rows[ $key ] );
759
- }
760
- }
761
-
762
- // Don't global modules for node templates.
763
- foreach ( $saved_modules as $key => $val ) {
764
- if ( $node_template && $val['global'] ) {
765
- unset( $saved_modules[ $key ] );
766
- }
767
- }
768
-
769
- include $file;
770
  }
771
  }
772
 
@@ -804,7 +837,7 @@ final class FLBuilder {
804
  $wp_query->the_post();
805
 
806
  // Make sure this isn't the same post as the original post to prevent infinite loops.
807
- if ( $original_post->ID === $post->ID ) {
808
  continue;
809
  }
810
 
@@ -813,10 +846,15 @@ final class FLBuilder {
813
 
814
  // Print the styles since we are outside of the head tag.
815
  ob_start();
 
 
 
816
  wp_print_styles();
 
 
817
  $styles = str_replace( "\n", '', ob_get_clean() );
818
 
819
- // Added stylesheets inline can mess with specificity, so we add them to the head with JS.
820
  if ( ! empty( $styles ) ) {
821
  echo '<script>jQuery("head").prepend("' . str_replace( '"', "'", $styles ) . '");</script>';
822
  }
@@ -930,17 +968,6 @@ final class FLBuilder {
930
  // Build the content class.
931
  $classes = 'fl-builder-content fl-builder-content-' . FLBuilderModel::get_post_id();
932
 
933
- // Add template classes to the content class.
934
- if ( FLBuilderModel::is_post_user_template() ) {
935
- $classes .= ' fl-builder-template';
936
- $classes .= ' fl-builder-' . FLBuilderModel::get_user_template_type() . '-template';
937
- }
938
-
939
- // Add the global templates locked class.
940
- if ( ! current_user_can( FLBuilderModel::get_global_templates_editing_capability() ) ) {
941
- $classes .= ' fl-builder-global-templates-locked';
942
- }
943
-
944
  // Add browser specific classes.
945
  if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
946
  if ( stristr( $_SERVER[ 'HTTP_USER_AGENT' ], 'Trident/7.0' ) && stristr( $_SERVER[ 'HTTP_USER_AGENT' ], 'rv:11.0' ) ) {
@@ -948,7 +975,7 @@ final class FLBuilder {
948
  }
949
  }
950
 
951
- return $classes;
952
  }
953
 
954
  /**
@@ -961,16 +988,48 @@ final class FLBuilder {
961
  {
962
  do_action( 'fl_builder_before_render_nodes' );
963
 
964
- if ( FLBuilderModel::is_post_user_template( 'module' ) ) {
965
- self::render_modules();
966
- }
967
- else {
968
  self::render_rows();
969
  }
970
 
971
  do_action( 'fl_builder_after_render_nodes' );
972
  }
973
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
974
  /**
975
  * Renders the stripped down content for a layout
976
  * that is saved to the WordPress editor.
@@ -1046,10 +1105,11 @@ final class FLBuilder {
1046
  'title' => '',
1047
  'badges' => array(),
1048
  'tabs' => array(),
1049
- 'buttons' => array()
 
1050
  );
1051
 
1052
- $form = array_merge($defaults, $form);
1053
 
1054
  ob_start();
1055
  include FL_BUILDER_DIR . 'includes/settings.php';
@@ -1140,8 +1200,9 @@ final class FLBuilder {
1140
  }
1141
 
1142
  return self::render_settings(array(
1143
- 'title' => $form['title'],
1144
- 'tabs' => $form['tabs']
 
1145
  ), $settings);
1146
  }
1147
 
@@ -1157,9 +1218,10 @@ final class FLBuilder {
1157
  $form = FLBuilderModel::$settings_forms['layout'];
1158
 
1159
  return self::render_settings( array(
1160
- 'class' => 'fl-builder-layout-settings',
1161
- 'title' => $form['title'],
1162
- 'tabs' => $form['tabs']
 
1163
  ), $settings );
1164
  }
1165
 
@@ -1175,99 +1237,13 @@ final class FLBuilder {
1175
  $form = FLBuilderModel::$settings_forms['global'];
1176
 
1177
  return self::render_settings(array(
1178
- 'class' => 'fl-builder-global-settings',
1179
- 'title' => $form['title'],
1180
- 'tabs' => $form['tabs']
 
1181
  ), $settings);
1182
  }
1183
 
1184
- /**
1185
- * Registers the custom post type for builder templates.
1186
- *
1187
- * @since 1.1.3
1188
- * @since 1.5.7 Added template category taxonomy.
1189
- * @return void
1190
- */
1191
- static public function register_templates_post_type()
1192
- {
1193
- // Template classes aren't included in the lite version.
1194
- if(FL_BUILDER_LITE === true) {
1195
- return;
1196
- }
1197
-
1198
- // Vars for checking if the templates admin should be public.
1199
- $admin_enabled = FLBuilderModel::user_templates_admin_enabled();
1200
- $can_edit = FLBuilderModel::current_user_has_editing_capability();
1201
-
1202
- // Get the array of supported features for the templates post type.
1203
- $supports = array(
1204
- 'title',
1205
- 'revisions',
1206
- 'page-attributes'
1207
- );
1208
-
1209
- // Include thumbnail support if core templates can be overridden.
1210
- if ( class_exists( 'FLBuilderTemplatesOverride' ) ) {
1211
- $supports[] = 'thumbnail';
1212
- }
1213
-
1214
- // Register the template post type.
1215
- register_post_type('fl-builder-template', array(
1216
- 'public' => $admin_enabled && $can_edit ? true : false,
1217
- 'labels' => array(
1218
- 'name' => _x( 'Templates', 'Custom post type label.', 'fl-builder' ),
1219
- 'singular_name' => _x( 'Template', 'Custom post type label.', 'fl-builder' ),
1220
- 'menu_name' => _x( 'Templates', 'Custom post type label.', 'fl-builder' ),
1221
- 'name_admin_bar' => _x( 'Template', 'Custom post type label.', 'fl-builder' ),
1222
- 'add_new' => _x( 'Add New', 'Custom post type label.', 'fl-builder' ),
1223
- 'add_new_item' => _x( 'Add New Template', 'Custom post type label.', 'fl-builder' ),
1224
- 'new_item' => _x( 'New Template', 'Custom post type label.', 'fl-builder' ),
1225
- 'edit_item' => _x( 'Edit Template', 'Custom post type label.', 'fl-builder' ),
1226
- 'view_item' => _x( 'View Template', 'Custom post type label.', 'fl-builder' ),
1227
- 'all_items' => _x( 'All Templates', 'Custom post type label.', 'fl-builder' ),
1228
- 'search_items' => _x( 'Search Templates', 'Custom post type label.', 'fl-builder' ),
1229
- 'parent_item_colon' => _x( 'Parent Templates:', 'Custom post type label.', 'fl-builder' ),
1230
- 'not_found' => _x( 'No templates found.', 'Custom post type label.', 'fl-builder' ),
1231
- 'not_found_in_trash' => _x( 'No templates found in Trash.', 'Custom post type label.', 'fl-builder' )
1232
- ),
1233
- 'menu_icon' => 'dashicons-welcome-widgets-menus',
1234
- 'supports' => $supports,
1235
- 'taxonomies' => array(
1236
- 'fl-builder-template-category'
1237
- ),
1238
- 'publicly_queryable' => $can_edit,
1239
- 'exclude_from_search' => true
1240
- ) );
1241
-
1242
- // Register the template category tax.
1243
- register_taxonomy( 'fl-builder-template-category', array( 'fl-builder-template' ), array(
1244
- 'labels' => array(
1245
- 'name' => _x( 'Template Categories', 'Custom taxonomy label.', 'fl-builder' ),
1246
- 'singular_name' => _x( 'Template Category', 'Custom taxonomy label.', 'fl-builder' ),
1247
- 'search_items' => _x( 'Search Template Categories', 'Custom taxonomy label.', 'fl-builder' ),
1248
- 'all_items' => _x( 'All Template Categories', 'Custom taxonomy label.', 'fl-builder' ),
1249
- 'parent_item' => _x( 'Parent Template Category', 'Custom taxonomy label.', 'fl-builder' ),
1250
- 'parent_item_colon' => _x( 'Parent Template Category:', 'Custom taxonomy label.', 'fl-builder' ),
1251
- 'edit_item' => _x( 'Edit Template Category', 'Custom taxonomy label.', 'fl-builder' ),
1252
- 'update_item' => _x( 'Update Template Category', 'Custom taxonomy label.', 'fl-builder' ),
1253
- 'add_new_item' => _x( 'Add New Template Category', 'Custom taxonomy label.', 'fl-builder' ),
1254
- 'new_item_name' => _x( 'New Template Category Name', 'Custom taxonomy label.', 'fl-builder' ),
1255
- 'menu_name' => _x( 'Categories', 'Custom taxonomy label.', 'fl-builder' ),
1256
- ),
1257
- 'hierarchical' => true,
1258
- 'public' => true,
1259
- 'show_admin_column' => true
1260
- ) );
1261
-
1262
- // Register the template type tax.
1263
- register_taxonomy( 'fl-builder-template-type', array( 'fl-builder-template' ), array(
1264
- 'label' => _x( 'Type', 'Custom taxonomy label.', 'fl-builder' ),
1265
- 'hierarchical' => false,
1266
- 'public' => false,
1267
- 'show_admin_column' => true
1268
- ) );
1269
- }
1270
-
1271
  /**
1272
  * Renders the markup for the template selector.
1273
  *
@@ -1276,80 +1252,14 @@ final class FLBuilder {
1276
  */
1277
  static public function render_template_selector()
1278
  {
1279
- if(file_exists(FL_BUILDER_DIR . 'includes/template-selector.php')) {
1280
-
1281
- $enabled_templates = FLBuilderModel::get_enabled_templates();
1282
- $user_templates = FLBuilderModel::get_user_templates();
1283
- $templates = FLBuilderModel::get_template_selector_data();
1284
-
1285
- ob_start();
1286
- include FL_BUILDER_DIR . 'includes/template-selector.php';
1287
- $html = ob_get_clean();
1288
-
1289
- return array( 'html' => $html );
1290
- }
1291
- }
1292
-
1293
- /**
1294
- * Renders the settings form for saving a user defined template.
1295
- *
1296
- * @since 1.0
1297
- * @return array
1298
- */
1299
- static public function render_user_template_settings()
1300
- {
1301
- $defaults = FLBuilderModel::get_settings_form_defaults( 'user_template' );
1302
- $form = FLBuilderModel::get_settings_form( 'user_template' );
1303
-
1304
- return self::render_settings(array(
1305
- 'class' => 'fl-builder-user-template-settings',
1306
- 'title' => $form['title'],
1307
- 'tabs' => $form['tabs']
1308
- ), $defaults);
1309
- }
1310
-
1311
- /**
1312
- * Renders the settings form for saving a node template.
1313
- *
1314
- * @since 1.6.3
1315
- * @param string $node_id The node whose template settings to load.
1316
- * @return array
1317
- */
1318
- static public function render_node_template_settings( $node_id = null )
1319
- {
1320
- $defaults = FLBuilderModel::get_settings_form_defaults( 'node_template' );
1321
- $form = FLBuilderModel::get_settings_form( 'node_template' );
1322
- $node = FLBuilderModel::get_node( $node_id );
1323
 
1324
- return self::render_settings(array(
1325
- 'class' => 'fl-builder-node-template-settings',
1326
- 'attrs' => 'data-node="'. $node->node .'"',
1327
- 'title' => str_replace( '%s', ucwords( $node->type ), $form['title'] ),
1328
- 'tabs' => $form['tabs']
1329
- ), $defaults);
1330
- }
1331
-
1332
- /**
1333
- * Trys to load page.php for editing a builder template.
1334
- *
1335
- * @since 1.0
1336
- * @param string $template The current template to be loaded.
1337
- * @return string
1338
- */
1339
- static public function render_template( $template )
1340
- {
1341
- global $post;
1342
-
1343
- if ( 'string' == gettype( $template ) && $post && $post->post_type == 'fl-builder-template' ) {
1344
-
1345
- $page = locate_template( array( 'page.php' ) );
1346
-
1347
- if ( ! empty( $page ) ) {
1348
- return $page;
1349
- }
1350
- }
1351
 
1352
- return $template;
1353
  }
1354
 
1355
  /**
@@ -1406,7 +1316,7 @@ final class FLBuilder {
1406
  apply_filters( 'fl_builder_row_template_slug', '', $row )
1407
  );
1408
 
1409
- if ( $template_file ) {
1410
  include $template_file;
1411
  }
1412
 
@@ -1424,51 +1334,43 @@ final class FLBuilder {
1424
  {
1425
  $custom_class = apply_filters( 'fl_builder_row_custom_class', $row->settings->class, $row );
1426
  $overlay_bgs = array( 'photo', 'parallax', 'slideshow', 'video' );
1427
- $active = FLBuilderModel::is_builder_active();
1428
- $global = FLBuilderModel::is_node_global( $row );
1429
-
1430
- // ID
1431
- if ( ! empty( $row->settings->id ) ) {
1432
- echo ' id="' . esc_attr( $row->settings->id ) . '"';
1433
- }
1434
-
1435
- // Class
1436
- echo ' class="fl-row';
1437
- echo ' fl-row-' . $row->settings->width . '-width';
1438
- echo ' fl-row-bg-' . $row->settings->bg_type;
1439
 
 
1440
  if ( ! empty( $row->settings->full_height ) && $row->settings->full_height == 'full' ) {
1441
- echo ' fl-row-full-height';
 
 
 
 
 
1442
  }
1443
-
1444
  if ( in_array( $row->settings->bg_type, $overlay_bgs ) && ! empty( $row->settings->bg_overlay_color ) ) {
1445
- echo ' fl-row-bg-overlay';
1446
  }
1447
  if ( ! empty( $row->settings->responsive_display ) ) {
1448
- echo ' fl-visible-' . $row->settings->responsive_display;
1449
  }
1450
  if ( ! empty( $custom_class ) ) {
1451
- echo ' ' . trim( esc_attr( $custom_class ) );
1452
- }
1453
- if ( $global && $active ) {
1454
- echo ' fl-node-global';
1455
  }
1456
 
1457
- echo ' fl-node-' . $row->node;
1458
- echo '"';
1459
-
1460
  // Data
1461
- echo ' data-node="' . $row->node . '"';
1462
-
1463
  if ( $row->settings->bg_type == 'parallax' && ! empty( $row->settings->bg_parallax_image_src ) ) {
1464
- echo ' data-parallax-speed="' . $row->settings->bg_parallax_speed . '"';
1465
- echo ' data-parallax-image="' . $row->settings->bg_parallax_image_src . '"';
1466
- }
1467
- if ( $global && $active ) {
1468
- echo ' data-template="' . $row->template_id . '"';
1469
- echo ' data-template-node="' . $row->template_node_id . '"';
1470
- echo ' data-template-url="' . FLBuilderModel::get_node_template_edit_url( $row->template_id ) . '"';
1471
  }
 
 
1472
  }
1473
 
1474
  /**
@@ -1530,20 +1432,13 @@ final class FLBuilder {
1530
  $node = FLBuilderModel::get_node($node_id);
1531
  $settings = $node->settings;
1532
  $form = FLBuilderModel::$settings_forms['row'];
1533
- $global = FLBuilderModel::is_node_global( $node );
1534
- $buttons = array();
1535
-
1536
- if ( ! $global && ! FLBuilderModel::is_post_node_template() && FLBuilderModel::node_templates_enabled() ) {
1537
- $buttons[] = 'save-as';
1538
- }
1539
 
1540
  $rendered_settings = self::render_settings(array(
1541
  'class' => 'fl-builder-row-settings',
1542
  'attrs' => 'data-node="'. $node->node .'"',
1543
  'title' => $form['title'],
1544
- 'badges' => $global ? array( 'global' => _x( 'Global', 'Indicator for global node templates.', 'fl-builder' ) ) : array(),
1545
  'tabs' => $form['tabs'],
1546
- 'buttons' => $buttons
1547
  ), $settings);
1548
 
1549
  return array(
@@ -1578,60 +1473,48 @@ final class FLBuilder {
1578
  }
1579
 
1580
  /**
1581
- * Adds a new column group and renders it.
1582
  *
1583
  * @since 1.0
1584
- * @param string $node_id The node ID of a row to add the new group to.
1585
- * @param string $cols The type of column layout to use.
1586
- * @param int $position The position of the new column group in the row.
1587
  * @return void
1588
  */
1589
  static public function render_column_group_attributes( $group )
1590
  {
1591
- $equal_height = self::is_column_equal_height( $group ) ? ' fl-col-group-equal-height' : '';
1592
- $custom_width = self::column_has_custom_width( $group ) ? ' fl-col-group-custom-width' : '';
1593
- echo ' class="fl-col-group fl-node-' . $group->node . $equal_height . $custom_width . '"';
1594
- echo ' data-node="' . $group->node . '"';
1595
- }
1596
-
1597
- /**
1598
- * Checks if the columns in a group are equal height.
1599
- *
1600
- * @since 1.6.4
1601
- * @param string $group A group node who's columns to check.
1602
- * @return bool
1603
- */
1604
- static public function is_column_equal_height( $group )
1605
- {
1606
- $cols = FLBuilderModel::get_nodes( 'column', $group );
1607
-
1608
  foreach( $cols as $col ) {
 
1609
  if( isset( $col->settings->equal_height ) && $col->settings->equal_height == 'yes' ) {
1610
- return true;
 
 
 
 
 
 
 
1611
  }
1612
- }
1613
-
1614
- return false;
1615
- }
1616
-
1617
- /**
1618
- * Checks to see if the columns in a group have custom responsive widths.
1619
- *
1620
- * @since 1.6.4
1621
- * @param string $group A group node who's columns to check.
1622
- * @return bool
1623
- */
1624
- static public function column_has_custom_width( $group )
1625
- {
1626
- $cols = FLBuilderModel::get_nodes( 'column', $group );
1627
-
1628
- foreach( $cols as $col ) {
1629
  if( isset( $col->settings->responsive_size ) && $col->settings->responsive_size == 'custom' ) {
1630
- return true;
1631
- }
 
 
 
 
 
 
 
1632
  }
1633
 
1634
- return false;
1635
  }
1636
 
1637
  /**
@@ -1645,7 +1528,9 @@ final class FLBuilder {
1645
  {
1646
  $col = is_object( $col_id ) ? $col_id : FLBuilderModel::get_node( $col_id );
1647
 
1648
- include FL_BUILDER_DIR . 'includes/column.php';
 
 
1649
  }
1650
 
1651
  /**
@@ -1660,14 +1545,13 @@ final class FLBuilder {
1660
  $node = FLBuilderModel::get_node($node_id);
1661
  $settings = $node->settings;
1662
  $form = FLBuilderModel::$settings_forms['col'];
1663
- $global = FLBuilderModel::is_node_global( $node );
1664
 
1665
  $rendered_settings = self::render_settings(array(
1666
  'class' => 'fl-builder-col-settings',
1667
  'attrs' => 'data-node="'. $node->node .'"',
1668
  'title' => $form['title'],
1669
- 'badges' => $global ? array( 'global' => _x( 'Global', 'Indicator for global node templates.', 'fl-builder' ) ) : array(),
1670
- 'tabs' => $form['tabs']
1671
  ), $settings);
1672
 
1673
  return array(
@@ -1687,46 +1571,32 @@ final class FLBuilder {
1687
  {
1688
  $custom_class = apply_filters( 'fl_builder_column_custom_class', $col->settings->class, $col );
1689
  $overlay_bgs = array( 'photo' );
1690
- $active = FLBuilderModel::is_builder_active();
1691
- $global = FLBuilderModel::is_node_global( $col );
1692
-
1693
- // ID
1694
- if ( ! empty( $col->settings->id ) ) {
1695
- echo ' id="' . esc_attr( $col->settings->id ) . '"';
1696
- }
 
 
1697
 
1698
- // Class
1699
- echo ' class="fl-col';
1700
-
1701
  if ( $col->settings->size <= 50 ) {
1702
- echo ' fl-col-small';
1703
  }
1704
  if ( in_array( $col->settings->bg_type, $overlay_bgs ) && ! empty( $col->settings->bg_overlay_color ) ) {
1705
- echo ' fl-col-bg-overlay';
1706
  }
1707
  if ( ! empty( $col->settings->responsive_display ) ) {
1708
- echo ' fl-visible-' . $col->settings->responsive_display;
1709
  }
1710
  if ( ! empty( $custom_class ) ) {
1711
- echo ' ' . trim( esc_attr( $custom_class ) );
1712
  }
1713
- if ( $global && $active ) {
1714
- echo ' fl-node-global';
1715
- }
1716
-
1717
- echo ' fl-node-' . $col->node;
1718
- echo '"';
1719
-
1720
- // Width
1721
- echo ' style="width: ' . $col->settings->size . '%;"';
1722
-
1723
- // Data
1724
- echo ' data-node="' . $col->node . '"';
1725
 
1726
- if ( $global && $active ) {
1727
- echo ' data-template="' . $col->template_id . '"';
1728
- echo ' data-template-node="' . $col->template_node_id . '"';
1729
- }
1730
  }
1731
 
1732
  /**
@@ -1770,7 +1640,7 @@ final class FLBuilder {
1770
  apply_filters( 'fl_builder_module_template_slug', '', $module )
1771
  );
1772
 
1773
- if ( $template_file ) {
1774
  include $template_file;
1775
  }
1776
 
@@ -1789,7 +1659,6 @@ final class FLBuilder {
1789
  */
1790
  static public function render_module_settings($node_id = null, $type = null, $parent_id = null, $render_state = true)
1791
  {
1792
- $buttons = array();
1793
  $assets = '';
1794
 
1795
  // Get the module and settings.
@@ -1801,14 +1670,6 @@ final class FLBuilder {
1801
  $module = FLBuilderModel::$modules[$type];
1802
  $settings = FLBuilderModel::get_module_defaults($type);
1803
  }
1804
-
1805
- // Is this module global?
1806
- $global = FLBuilderModel::is_node_global( $module );
1807
-
1808
- // Add the Save As button?
1809
- if ( ! $global && ! FLBuilderModel::is_post_node_template() && FLBuilderModel::node_templates_enabled() ) {
1810
- $buttons[] = 'save-as';
1811
- }
1812
 
1813
  // Render the settings CSS/JS assets.
1814
  if(file_exists($module->dir .'css/settings.css')) {
@@ -1823,9 +1684,8 @@ final class FLBuilder {
1823
  'class' => 'fl-builder-module-settings fl-builder-'. $type .'-settings',
1824
  'attrs' => 'data-node="'. $node_id .'" data-parent="'. $parent_id .'" data-type="'. $type .'"',
1825
  'title' => sprintf( _x( '%s Settings', '%s stands for module name.', 'fl-builder' ), $module->name ),
1826
- 'badges' => $global ? array( 'global' => _x( 'Global', 'Indicator for global node templates.', 'fl-builder' ) ) : array(),
1827
  'tabs' => $module->form,
1828
- 'buttons' => $buttons
1829
  ), $settings);
1830
 
1831
  // Return the HTML.
@@ -1873,47 +1733,37 @@ final class FLBuilder {
1873
  static public function render_module_attributes( $module )
1874
  {
1875
  $custom_class = apply_filters( 'fl_builder_module_custom_class', $module->settings->class, $module );
1876
- $active = FLBuilderModel::is_builder_active();
1877
- $global = FLBuilderModel::is_node_global( $module );
1878
-
1879
- // ID
1880
- if ( ! empty( $module->settings->id ) ) {
1881
- echo ' id="' . esc_attr( $module->settings->id ) . '"';
1882
- }
 
 
 
1883
 
1884
- // Class
1885
- echo ' class="fl-module';
1886
- echo ' fl-module-' . $module->settings->type;
1887
-
1888
  if ( ! empty( $module->settings->responsive_display ) ) {
1889
- echo ' fl-visible-' . $module->settings->responsive_display;
1890
  }
1891
  if ( ! empty( $module->settings->animation ) ) {
1892
- echo ' fl-animation fl-' . $module->settings->animation;
1893
  }
1894
  if ( ! empty( $custom_class ) ) {
1895
- echo ' ' . trim( esc_attr( $custom_class ) );
1896
- }
1897
- if ( $global && $active ) {
1898
- echo ' fl-node-global';
1899
  }
1900
 
1901
- echo ' fl-node-' . $module->node;
1902
- echo '"';
1903
-
1904
  // Data
1905
- echo ' data-node="' . $module->node . '" ';
1906
- echo ' data-animation-delay="' . $module->settings->animation_delay . '" ';
1907
-
1908
- if ( $active ) {
1909
- echo ' data-parent="' . $module->parent . '" ';
1910
- echo ' data-type="' . $module->settings->type . '" ';
1911
- echo ' data-name="' . $module->name . '" ';
1912
- }
1913
- if ( $global && $active ) {
1914
- echo ' data-template="' . $module->template_id . '"';
1915
- echo ' data-template-node="' . $module->template_node_id . '"';
1916
  }
 
 
 
1917
  }
1918
 
1919
  /**
@@ -2187,7 +2037,7 @@ final class FLBuilder {
2187
  $margins .= 'margin-right:' . $settings->margin_right . 'px;';
2188
  }
2189
  if($margins != '') {
2190
- $css .= '.fl-node-' . $row->node . ' .fl-row-content-wrap {' . $margins . '}';
2191
  }
2192
 
2193
  return $css;
@@ -2219,7 +2069,7 @@ final class FLBuilder {
2219
  $padding .= 'padding-right:' . $settings->padding_right . 'px;';
2220
  }
2221
  if($padding != '') {
2222
- $css = '.fl-node-' . $row->node . ' .fl-row-content-wrap {' . $padding . '}';
2223
  }
2224
 
2225
  return $css;
@@ -2251,7 +2101,7 @@ final class FLBuilder {
2251
  $margins .= 'margin-right:' . $settings->margin_right . 'px;';
2252
  }
2253
  if($margins != '') {
2254
- $css .= '.fl-node-' . $col->node . ' .fl-col-content {' . $margins . '}';
2255
  }
2256
 
2257
  return $css;
@@ -2283,7 +2133,7 @@ final class FLBuilder {
2283
  $padding .= 'padding-right:' . $settings->padding_right . 'px;';
2284
  }
2285
  if($padding != '') {
2286
- $css = '.fl-node-' . $col->node . ' .fl-col-content {' . $padding . '}';
2287
  }
2288
 
2289
  return $css;
@@ -2315,7 +2165,7 @@ final class FLBuilder {
2315
  $margins .= 'margin-right:' . $settings->margin_right . 'px;';
2316
  }
2317
  if($margins != '') {
2318
- $css = '.fl-node-' . $module->node . ' .fl-module-content {' . $margins . '}';
2319
  }
2320
 
2321
  return $css;
@@ -2350,7 +2200,7 @@ final class FLBuilder {
2350
  }
2351
  if($margins != '') {
2352
  $css .= '@media (max-width: '. $global_settings->responsive_breakpoint .'px) { ';
2353
- $css .= '.fl-node-' . $module->node . ' .fl-module-content {' . $margins . '}';
2354
  $css .= ' }';
2355
  }
2356
 
@@ -2609,4 +2459,71 @@ final class FLBuilder {
2609
 
2610
  self::enqueue_ui_styles_scripts();
2611
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2612
  }
 
 
23
  */
24
  static private $template_dir = 'fl-builder/includes';
25
 
26
+ /**
27
+ * Initializes hooks.
28
+ *
29
+ * @since 1.8
30
+ * @return void
31
+ */
32
+ static public function init()
33
+ {
34
+ /* Actions */
35
+ add_action('plugins_loaded', __CLASS__ . '::load_plugin_textdomain');
36
+ add_action('send_headers', __CLASS__ . '::no_cache_headers');
37
+ add_action('wp', __CLASS__ . '::init_ui', 11);
38
+ add_action('wp_enqueue_scripts', __CLASS__ . '::register_layout_styles_scripts');
39
+ add_action('wp_enqueue_scripts', __CLASS__ . '::enqueue_ui_styles_scripts');
40
+ add_action('wp_enqueue_scripts', __CLASS__ . '::enqueue_all_layouts_styles_scripts');
41
+ add_action('wp_head', __CLASS__ . '::render_custom_css_for_editing', 999);
42
+ add_action('admin_bar_menu', __CLASS__ . '::admin_bar_menu', 999);
43
+ add_action('wp_footer', __CLASS__ . '::include_jquery');
44
+ add_action('wp_footer', __CLASS__ . '::render_ui');
45
+ add_action('fl_builder_ui_panel_after_rows', __CLASS__ . '::render_ui_panel_row_templates');
46
+ add_action('fl_builder_ui_panel_after_modules', __CLASS__ . '::render_ui_panel_modules_templates');
47
+
48
+ /* Filters */
49
+ add_filter('fl_builder_render_css', __CLASS__ . '::rewrite_css_cache_urls', 9999);
50
+ add_filter('body_class', __CLASS__ . '::body_class');
51
+ add_filter('wp_default_editor', __CLASS__ . '::default_editor');
52
+ add_filter('mce_css', __CLASS__ . '::add_editor_css');
53
+ add_filter('mce_buttons_2', __CLASS__ . '::editor_buttons_2');
54
+ add_filter('mce_external_plugins', __CLASS__ . '::editor_external_plugins', 9999);
55
+ add_filter('tiny_mce_before_init', __CLASS__ . '::editor_font_sizes');
56
+ add_filter('the_content', __CLASS__ . '::render_content');
57
+ }
58
+
59
  /**
60
  * Localization
61
  *
88
  }
89
 
90
  /**
91
+ * Alias method for registering a template data file with the builder.
92
  *
93
+ * @since 1.8
94
+ * @param sting $path The directory path to the template data file.
95
  * @return void
96
  */
97
+ static public function register_templates( $path )
98
  {
99
+ FLBuilderModel::register_templates( $path );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
101
 
102
  /**
290
  wp_register_style('jquery-magnificpopup', $css_url . 'jquery.magnificpopup.css', array(), $ver);
291
 
292
  // Register icon CDN CSS
293
+ wp_register_style('font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css', array(), $ver);
294
  wp_register_style('foundation-icons', 'https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css', array(), $ver);
295
 
296
  // Register additional JS
423
  }
424
  }
425
 
426
+ /**
427
+ * Return inline invocation of stylesheet.
428
+ *
429
+ * @link https://developer.wordpress.org/reference/hooks/style_loader_tag/ See for hook documentation.
430
+ *
431
+ * @param string $html
432
+ * @param string $handle
433
+ * @param string $href
434
+ * @param string $media (Default: all)
435
+ * @return string
436
+ */
437
+ static public function inline_style_loader_tag( $html, $handle, $href, $media = 'all' )
438
+ {
439
+ return '<style id="' . $handle . '"> @import "' . $href . '" ' . $media . '; </style>';
440
+ }
441
+
442
  /**
443
  * Register and enqueue the styles and scripts for the builder UI.
444
  *
523
  else {
524
  wp_enqueue_script('fl-builder-min', $js_url . 'fl-builder.min.js', array(), $ver, true);
525
  }
 
 
 
 
 
526
 
527
  /* Additional module styles and scripts */
528
  foreach(FLBuilderModel::$modules as $module) {
620
  return apply_filters( 'fl_builder_template_path', $template_path, $template_base, $slug );
621
  }
622
 
623
+ /**
624
+ * Initializes the builder interface.
625
+ *
626
+ * @since 1.0
627
+ * @since 1.8 Method name changed from init to init_ui.
628
+ * @return void
629
+ */
630
+ static public function init_ui()
631
+ {
632
+ // Enable editing if the builder is active.
633
+ if ( FLBuilderModel::is_builder_active() && ! defined( 'DOING_AJAX' ) ) {
634
+
635
+ // Tell W3TC not to minify while the builder is active.
636
+ define( 'DONOTMINIFY', true );
637
+
638
+ // Tell Autoptimize not to minify while the builder is active.
639
+ add_filter( 'autoptimize_filter_noptimize', '__return_true' );
640
+
641
+ // Remove 3rd party editor buttons.
642
+ remove_all_actions('media_buttons', 999999);
643
+ remove_all_actions('media_buttons_context', 999999);
644
+
645
+ // Get the post.
646
+ require_once ABSPATH . 'wp-admin/includes/post.php';
647
+ $post_id = FLBuilderModel::get_post_id();
648
+
649
+ // Check to see if the post is locked.
650
+ if(wp_check_post_lock($post_id) !== false) {
651
+ header('Location: ' . admin_url('/post.php?post=' . $post_id . '&action=edit'));
652
+ }
653
+ else {
654
+ FLBuilderModel::enable_editing();
655
+ }
656
+ }
657
+ }
658
+
659
  /**
660
  * Renders the markup for the builder interface.
661
  *
669
  if ( FLBuilderModel::is_builder_active() ) {
670
 
671
  $post_id = $wp_the_query->post->ID;
 
 
 
672
  $simple_ui = ! FLBuilderModel::current_user_has_editing_capability();
673
  $categories = FLBuilderModel::get_categorized_modules();
674
+ $render_panel = apply_filters( 'fl_builder_render_ui_panel', FLBuilderModel::current_user_has_editing_capability() );
 
675
 
676
+ if ( $render_panel ) {
677
+ include FL_BUILDER_DIR . 'includes/ui-panel.php';
 
 
 
 
 
 
 
 
 
 
 
678
  }
679
 
680
  include FL_BUILDER_DIR . 'includes/ui-bar.php';
692
  */
693
  static public function render_ui_bar_title()
694
  {
 
 
 
 
695
  // Get the bar title.
696
+ $title = apply_filters( 'fl_builder_ui_bar_title', FLBuilderModel::get_branding() );
 
 
 
 
 
697
 
698
  // Render the bar title.
699
  if ( '' == FLBuilderModel::get_branding_icon() ) {
714
  */
715
  static public function render_ui_bar_buttons()
716
  {
717
+ $help_button = FLBuilderModel::get_help_button_settings();
718
+ $simple_ui = ! FLBuilderModel::current_user_has_editing_capability();
 
719
 
720
+ $buttons = apply_filters( 'fl_builder_ui_bar_buttons', array(
721
  'help' => array(
722
  'label' => '<i class="fa fa-question-circle"></i>',
723
  'show' => $help_button['enabled'] && ! $simple_ui
724
  ),
725
  'upgrade' => array(
726
+ 'label' => __( 'Upgrade Today <i class="fa fa-external-link-square"></i>', 'fl-builder' ),
727
  'show' => true === FL_BUILDER_LITE
728
  ),
729
  'buy' => array(
730
+ 'label' => __( 'Buy Now <i class="fa fa-external-link-square"></i>', 'fl-builder' ),
731
  'show' => stristr( home_url(), 'demo.wpbeaverbuilder.com' )
732
  ),
733
  'done' => array(
736
  ),
737
  'tools' => array(
738
  'label' => __( 'Tools', 'fl-builder' ),
739
+ 'show' => ! $simple_ui
740
  ),
741
  'templates' => array(
742
  'label' => __( 'Templates', 'fl-builder' ),
743
+ 'show' => ! $simple_ui
744
  ),
745
  'add-content' => array(
746
  'label' => __( 'Add Content', 'fl-builder' ),
747
+ 'show' => ! $simple_ui
748
  )
749
+ ) );
750
 
751
  echo '<div class="fl-builder-bar-actions">';
752
 
768
  echo '<div class="fl-clear"></div></div>';
769
  }
770
 
771
+ /**
772
+ * Renders categorized row templates in the UI panel.
773
  *
774
+ * @since 1.8
775
  * @return void
776
  */
777
+ static public function render_ui_panel_row_templates()
778
  {
779
+ $is_row_template = FLBuilderModel::is_post_user_template( 'row' );
780
+ $is_module_template = FLBuilderModel::is_post_user_template( 'module' );
781
+ $has_editing_cap = FLBuilderModel::current_user_has_editing_capability();
782
+ $row_templates = FLBuilderModel::get_row_templates_data();
783
 
784
+ if ( ! $is_row_template && ! $is_module_template && $has_editing_cap ) {
785
+ include FL_BUILDER_DIR . 'includes/ui-panel-row-templates.php';
786
+ }
787
+ }
788
+
789
+ /**
790
+ * Renders categorized module templates in the UI panel.
791
+ *
792
+ * @since 1.8
793
+ * @return void
794
+ */
795
+ static public function render_ui_panel_modules_templates()
796
+ {
797
+ $is_module_template = FLBuilderModel::is_post_user_template( 'module' );
798
+ $has_editing_cap = FLBuilderModel::current_user_has_editing_capability();
799
+ $module_templates = FLBuilderModel::get_module_templates_data();
800
+
801
+ if ( ! $is_module_template && $has_editing_cap ) {
802
+ include FL_BUILDER_DIR . 'includes/ui-panel-module-templates.php';
 
 
803
  }
804
  }
805
 
837
  $wp_query->the_post();
838
 
839
  // Make sure this isn't the same post as the original post to prevent infinite loops.
840
+ if ( is_object( $original_post ) && $original_post->ID === $post->ID ) {
841
  continue;
842
  }
843
 
846
 
847
  // Print the styles since we are outside of the head tag.
848
  ob_start();
849
+
850
+ // Make styles render as inline "@import" statements so IE <= Edge 25.* and IE <= 11 respect order
851
+ add_filter( 'style_loader_tag', 'FLBuilder::inline_style_loader_tag', 10, 4 );
852
  wp_print_styles();
853
+ remove_filter( 'style_loader_tag', 'FLBuilder::inline_style_loader_tag', 10, 4 );
854
+
855
  $styles = str_replace( "\n", '', ob_get_clean() );
856
 
857
+ // Added stylesheets in body can mess with specificity, so we add them to the head with JS.
858
  if ( ! empty( $styles ) ) {
859
  echo '<script>jQuery("head").prepend("' . str_replace( '"', "'", $styles ) . '");</script>';
860
  }
968
  // Build the content class.
969
  $classes = 'fl-builder-content fl-builder-content-' . FLBuilderModel::get_post_id();
970
 
 
 
 
 
 
 
 
 
 
 
 
971
  // Add browser specific classes.
972
  if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
973
  if ( stristr( $_SERVER[ 'HTTP_USER_AGENT' ], 'Trident/7.0' ) && stristr( $_SERVER[ 'HTTP_USER_AGENT' ], 'rv:11.0' ) ) {
975
  }
976
  }
977
 
978
+ return apply_filters( 'fl_builder_content_classes', $classes );
979
  }
980
 
981
  /**
988
  {
989
  do_action( 'fl_builder_before_render_nodes' );
990
 
991
+ if ( apply_filters( 'fl_builder_render_nodes', true ) ) {
 
 
 
992
  self::render_rows();
993
  }
994
 
995
  do_action( 'fl_builder_after_render_nodes' );
996
  }
997
 
998
+ /**
999
+ * Renders the markup for a node's attributes.
1000
+ *
1001
+ * @since 1.8
1002
+ * @param array $attrs
1003
+ * @return void
1004
+ */
1005
+ static public function render_node_attributes( $attrs )
1006
+ {
1007
+ foreach( $attrs as $attr_key => $attr_value ) {
1008
+
1009
+ if ( empty( $attr_value ) ) {
1010
+ continue;
1011
+ }
1012
+ else if ( is_string( $attr_value ) ) {
1013
+ echo ' ' . $attr_key . '="' . $attr_value . '"';
1014
+ }
1015
+ else if ( is_array( $attr_value ) ) {
1016
+
1017
+ echo ' ' . $attr_key . '="';
1018
+
1019
+ for( $i = 0; $i < count( $attr_value ); $i++ ) {
1020
+
1021
+ echo $attr_value[ $i ];
1022
+
1023
+ if ( $i < count( $attr_value ) - 1 ) {
1024
+ echo ' ';
1025
+ }
1026
+ }
1027
+
1028
+ echo '"';
1029
+ }
1030
+ }
1031
+ }
1032
+
1033
  /**
1034
  * Renders the stripped down content for a layout
1035
  * that is saved to the WordPress editor.
1105
  'title' => '',
1106
  'badges' => array(),
1107
  'tabs' => array(),
1108
+ 'buttons' => array(),
1109
+ 'resizable' => false
1110
  );
1111
 
1112
+ $form = apply_filters( 'fl_builder_settings_form_config', array_merge( $defaults, $form ) );
1113
 
1114
  ob_start();
1115
  include FL_BUILDER_DIR . 'includes/settings.php';
1200
  }
1201
 
1202
  return self::render_settings(array(
1203
+ 'title' => $form['title'],
1204
+ 'tabs' => $form['tabs'],
1205
+ 'resizable' => true
1206
  ), $settings);
1207
  }
1208
 
1218
  $form = FLBuilderModel::$settings_forms['layout'];
1219
 
1220
  return self::render_settings( array(
1221
+ 'class' => 'fl-builder-layout-settings',
1222
+ 'title' => $form['title'],
1223
+ 'tabs' => $form['tabs'],
1224
+ 'resizable' => true
1225
  ), $settings );
1226
  }
1227
 
1237
  $form = FLBuilderModel::$settings_forms['global'];
1238
 
1239
  return self::render_settings(array(
1240
+ 'class' => 'fl-builder-global-settings',
1241
+ 'title' => $form['title'],
1242
+ 'tabs' => $form['tabs'],
1243
+ 'resizable' => true
1244
  ), $settings);
1245
  }
1246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1247
  /**
1248
  * Renders the markup for the template selector.
1249
  *
1252
  */
1253
  static public function render_template_selector()
1254
  {
1255
+ $filter_data = FLBuilderModel::get_template_selector_filter_data();
1256
+ $templates = FLBuilderModel::get_template_selector_data();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1257
 
1258
+ ob_start();
1259
+ include FL_BUILDER_DIR . 'includes/template-selector.php';
1260
+ $html = ob_get_clean();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1261
 
1262
+ return array( 'html' => $html );
1263
  }
1264
 
1265
  /**
1316
  apply_filters( 'fl_builder_row_template_slug', '', $row )
1317
  );
1318
 
1319
+ if ( $template_file && FLBuilderModel::is_node_visible( $row ) ) {
1320
  include $template_file;
1321
  }
1322
 
1334
  {
1335
  $custom_class = apply_filters( 'fl_builder_row_custom_class', $row->settings->class, $row );
1336
  $overlay_bgs = array( 'photo', 'parallax', 'slideshow', 'video' );
1337
+ $attrs = array(
1338
+ 'id' => $row->settings->id,
1339
+ 'class' => array(
1340
+ 'fl-row',
1341
+ 'fl-row-' . $row->settings->width . '-width',
1342
+ 'fl-row-bg-' . $row->settings->bg_type,
1343
+ 'fl-node-' . $row->node
1344
+ ),
1345
+ 'data-node' => $row->node
1346
+ );
 
 
1347
 
1348
+ // Classes
1349
  if ( ! empty( $row->settings->full_height ) && $row->settings->full_height == 'full' ) {
1350
+
1351
+ $attrs['class'][] = 'fl-row-full-height';
1352
+
1353
+ if ( isset( $row->settings->content_alignment ) ) {
1354
+ $attrs['class'][] = 'fl-row-align-' . $row->settings->content_alignment;
1355
+ }
1356
  }
 
1357
  if ( in_array( $row->settings->bg_type, $overlay_bgs ) && ! empty( $row->settings->bg_overlay_color ) ) {
1358
+ $attrs['class'][] = 'fl-row-bg-overlay';
1359
  }
1360
  if ( ! empty( $row->settings->responsive_display ) ) {
1361
+ $attrs['class'][] = 'fl-visible-' . $row->settings->responsive_display;
1362
  }
1363
  if ( ! empty( $custom_class ) ) {
1364
+ $attrs['class'][] = trim( esc_attr( $custom_class ) );
 
 
 
1365
  }
1366
 
 
 
 
1367
  // Data
 
 
1368
  if ( $row->settings->bg_type == 'parallax' && ! empty( $row->settings->bg_parallax_image_src ) ) {
1369
+ $attrs['data-parallax-speed'] = $row->settings->bg_parallax_speed;
1370
+ $attrs['data-parallax-image'] = $row->settings->bg_parallax_image_src;
 
 
 
 
 
1371
  }
1372
+
1373
+ self::render_node_attributes( apply_filters( 'fl_builder_row_attributes', $attrs, $row ) );
1374
  }
1375
 
1376
  /**
1432
  $node = FLBuilderModel::get_node($node_id);
1433
  $settings = $node->settings;
1434
  $form = FLBuilderModel::$settings_forms['row'];
 
 
 
 
 
 
1435
 
1436
  $rendered_settings = self::render_settings(array(
1437
  'class' => 'fl-builder-row-settings',
1438
  'attrs' => 'data-node="'. $node->node .'"',
1439
  'title' => $form['title'],
 
1440
  'tabs' => $form['tabs'],
1441
+ 'resizable' => true
1442
  ), $settings);
1443
 
1444
  return array(
1473
  }
1474
 
1475
  /**
1476
+ * Renders the attrs for a column group.
1477
  *
1478
  * @since 1.0
1479
+ * @param object $group
 
 
1480
  * @return void
1481
  */
1482
  static public function render_column_group_attributes( $group )
1483
  {
1484
+ $cols = FLBuilderModel::get_nodes( 'column', $group );
1485
+ $attrs = array(
1486
+ 'class' => array(
1487
+ 'fl-col-group',
1488
+ 'fl-node-' . $group->node
1489
+ ),
1490
+ 'data-node' => $group->node
1491
+ );
1492
+
 
 
 
 
 
 
 
 
1493
  foreach( $cols as $col ) {
1494
+
1495
  if( isset( $col->settings->equal_height ) && $col->settings->equal_height == 'yes' ) {
1496
+ if ( ! in_array( 'fl-col-group-equal-height', $attrs['class'] ) ) {
1497
+ $attrs['class'][] = 'fl-col-group-equal-height';
1498
+ }
1499
+ if( isset( $col->settings->content_alignment ) ) {
1500
+ if ( ! in_array( 'fl-col-group-align-' . $col->settings->content_alignment, $attrs['class'] ) ) {
1501
+ $attrs['class'][] = 'fl-col-group-align-' . $col->settings->content_alignment;
1502
+ }
1503
+ }
1504
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1505
  if( isset( $col->settings->responsive_size ) && $col->settings->responsive_size == 'custom' ) {
1506
+ if ( ! in_array( 'fl-col-group-custom-width', $attrs['class'] ) ) {
1507
+ $attrs['class'][] = 'fl-col-group-custom-width';
1508
+ }
1509
+ }
1510
+ if( isset( $col->settings->responsive_order ) && $col->settings->responsive_order == 'reversed' ) {
1511
+ if ( ! in_array( 'fl-col-group-responsive-reversed', $attrs['class'] ) ) {
1512
+ $attrs['class'][] = 'fl-col-group-responsive-reversed';
1513
+ }
1514
+ }
1515
  }
1516
 
1517
+ self::render_node_attributes( apply_filters( 'fl_builder_column_group_attributes', $attrs, $group ) );
1518
  }
1519
 
1520
  /**
1528
  {
1529
  $col = is_object( $col_id ) ? $col_id : FLBuilderModel::get_node( $col_id );
1530
 
1531
+ if ( FLBuilderModel::is_node_visible( $col ) ) {
1532
+ include FL_BUILDER_DIR . 'includes/column.php';
1533
+ }
1534
  }
1535
 
1536
  /**
1545
  $node = FLBuilderModel::get_node($node_id);
1546
  $settings = $node->settings;
1547
  $form = FLBuilderModel::$settings_forms['col'];
 
1548
 
1549
  $rendered_settings = self::render_settings(array(
1550
  'class' => 'fl-builder-col-settings',
1551
  'attrs' => 'data-node="'. $node->node .'"',
1552
  'title' => $form['title'],
1553
+ 'tabs' => $form['tabs'],
1554
+ 'resizable' => true
1555
  ), $settings);
1556
 
1557
  return array(
1571
  {
1572
  $custom_class = apply_filters( 'fl_builder_column_custom_class', $col->settings->class, $col );
1573
  $overlay_bgs = array( 'photo' );
1574
+ $attrs = array(
1575
+ 'id' => $col->settings->id,
1576
+ 'class' => array(
1577
+ 'fl-col',
1578
+ 'fl-node-' . $col->node
1579
+ ),
1580
+ 'data-node' => $col->node,
1581
+ 'style' => 'width: ' . $col->settings->size . '%;'
1582
+ );
1583
 
1584
+ // Classes
 
 
1585
  if ( $col->settings->size <= 50 ) {
1586
+ $attrs['class'][] = 'fl-col-small';
1587
  }
1588
  if ( in_array( $col->settings->bg_type, $overlay_bgs ) && ! empty( $col->settings->bg_overlay_color ) ) {
1589
+ $attrs['class'][] = 'fl-col-bg-overlay';
1590
  }
1591
  if ( ! empty( $col->settings->responsive_display ) ) {
1592
+ $attrs['class'][] = 'fl-visible-' . $col->settings->responsive_display;
1593
  }
1594
  if ( ! empty( $custom_class ) ) {
1595
+ $attrs['class'][] = trim( esc_attr( $custom_class ) );
1596
  }
 
 
 
 
 
 
 
 
 
 
 
 
1597
 
1598
+ // Render the attrs
1599
+ self::render_node_attributes( apply_filters( 'fl_builder_column_attributes', $attrs, $col ) );
 
 
1600
  }
1601
 
1602
  /**
1640
  apply_filters( 'fl_builder_module_template_slug', '', $module )
1641
  );
1642
 
1643
+ if ( $template_file && FLBuilderModel::is_node_visible( $module ) ) {
1644
  include $template_file;
1645
  }
1646
 
1659
  */
1660
  static public function render_module_settings($node_id = null, $type = null, $parent_id = null, $render_state = true)
1661
  {
 
1662
  $assets = '';
1663
 
1664
  // Get the module and settings.
1670
  $module = FLBuilderModel::$modules[$type];
1671
  $settings = FLBuilderModel::get_module_defaults($type);
1672
  }
 
 
 
 
 
 
 
 
1673
 
1674
  // Render the settings CSS/JS assets.
1675
  if(file_exists($module->dir .'css/settings.css')) {
1684
  'class' => 'fl-builder-module-settings fl-builder-'. $type .'-settings',
1685
  'attrs' => 'data-node="'. $node_id .'" data-parent="'. $parent_id .'" data-type="'. $type .'"',
1686
  'title' => sprintf( _x( '%s Settings', '%s stands for module name.', 'fl-builder' ), $module->name ),
 
1687
  'tabs' => $module->form,
1688
+ 'resizable' => true
1689
  ), $settings);
1690
 
1691
  // Return the HTML.
1733
  static public function render_module_attributes( $module )
1734
  {
1735
  $custom_class = apply_filters( 'fl_builder_module_custom_class', $module->settings->class, $module );
1736
+ $attrs = array(
1737
+ 'id' => esc_attr( $module->settings->id ),
1738
+ 'class' => array(
1739
+ 'fl-module',
1740
+ 'fl-module-' . $module->settings->type,
1741
+ 'fl-node-' . $module->node
1742
+ ),
1743
+ 'data-node' => $module->node,
1744
+ 'data-animation-delay' => $module->settings->animation_delay
1745
+ );
1746
 
1747
+ // Classes
 
 
 
1748
  if ( ! empty( $module->settings->responsive_display ) ) {
1749
+ $attrs['class'][] = 'fl-visible-' . $module->settings->responsive_display;
1750
  }
1751
  if ( ! empty( $module->settings->animation ) ) {
1752
+ $attrs['class'][] = 'fl-animation fl-' . $module->settings->animation;
1753
  }
1754
  if ( ! empty( $custom_class ) ) {
1755
+ $attrs['class'][] = trim( esc_attr( $custom_class ) );
 
 
 
1756
  }
1757
 
 
 
 
1758
  // Data
1759
+ if ( FLBuilderModel::is_builder_active() ) {
1760
+ $attrs['data-parent'] = $module->parent;
1761
+ $attrs['data-type'] = $module->settings->type;
1762
+ $attrs['data-name'] = $module->name;
 
 
 
 
 
 
 
1763
  }
1764
+
1765
+ // Render the attrs
1766
+ self::render_node_attributes( apply_filters( 'fl_builder_module_attributes', $attrs, $module ) );
1767
  }
1768
 
1769
  /**
2037
  $margins .= 'margin-right:' . $settings->margin_right . 'px;';
2038
  }
2039
  if($margins != '') {
2040
+ $css .= '.fl-node-' . $row->node . ' > .fl-row-content-wrap {' . $margins . '}';
2041
  }
2042
 
2043
  return $css;
2069
  $padding .= 'padding-right:' . $settings->padding_right . 'px;';
2070
  }
2071
  if($padding != '') {
2072
+ $css = '.fl-node-' . $row->node . ' > .fl-row-content-wrap {' . $padding . '}';
2073
  }
2074
 
2075
  return $css;
2101
  $margins .= 'margin-right:' . $settings->margin_right . 'px;';
2102
  }
2103
  if($margins != '') {
2104
+ $css .= '.fl-node-' . $col->node . ' > .fl-col-content {' . $margins . '}';
2105
  }
2106
 
2107
  return $css;
2133
  $padding .= 'padding-right:' . $settings->padding_right . 'px;';
2134
  }
2135
  if($padding != '') {
2136
+ $css = '.fl-node-' . $col->node . ' > .fl-col-content {' . $padding . '}';
2137
  }
2138
 
2139
  return $css;
2165
  $margins .= 'margin-right:' . $settings->margin_right . 'px;';
2166
  }
2167
  if($margins != '') {
2168
+ $css = '.fl-node-' . $module->node . ' > .fl-module-content {' . $margins . '}';
2169
  }
2170
 
2171
  return $css;
2200
  }
2201
  if($margins != '') {
2202
  $css .= '@media (max-width: '. $global_settings->responsive_breakpoint .'px) { ';
2203
+ $css .= '.fl-node-' . $module->node . ' > .fl-module-content {' . $margins . '}';
2204
  $css .= ' }';
2205
  }
2206
 
2459
 
2460
  self::enqueue_ui_styles_scripts();
2461
  }
2462
+
2463
+ /**
2464
+ * @since 1.0
2465
+ * @deprecated 1.8
2466
+ */
2467
+ static public function register_templates_post_type()
2468
+ {
2469
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderUserTemplates::register_post_type()' );
2470
+
2471
+ if ( class_exists( 'FLBuilderUserTemplates' ) ) {
2472
+ FLBuilderUserTemplates::register_post_type();
2473
+ }
2474
+ }
2475
+
2476
+ /**
2477
+ * @since 1.0
2478
+ * @deprecated 1.8
2479
+ */
2480
+ static public function render_template( $template )
2481
+ {
2482
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderUserTemplates::template_include()' );
2483
+
2484
+ if ( class_exists( 'FLBuilderUserTemplates' ) ) {
2485
+ FLBuilderUserTemplates::template_include();
2486
+ }
2487
+ }
2488
+
2489
+ /**
2490
+ * @since 1.6.3
2491
+ * @deprecated 1.8
2492
+ */
2493
+ static public function render_ui_panel_node_templates()
2494
+ {
2495
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderUserTemplates::render_ui_panel_node_templates()' );
2496
+
2497
+ if ( class_exists( 'FLBuilderUserTemplates' ) ) {
2498
+ FLBuilderUserTemplates::render_ui_panel_node_templates();
2499
+ }
2500
+ }
2501
+
2502
+ /**
2503
+ * @since 1.0
2504
+ * @deprecated 1.8
2505
+ */
2506
+ static public function render_user_template_settings()
2507
+ {
2508
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderUserTemplates::render_settings()' );
2509
+
2510
+ if ( class_exists( 'FLBuilderUserTemplates' ) ) {
2511
+ FLBuilderUserTemplates::render_settings();
2512
+ }
2513
+ }
2514
+
2515
+ /**
2516
+ * @since 1.6.3
2517
+ * @deprecated 1.8
2518
+ */
2519
+ static public function render_node_template_settings( $node_id = null )
2520
+ {
2521
+ _deprecated_function( __METHOD__, '1.8', 'FLBuilderUserTemplates::render_node_settings()' );
2522
+
2523
+ if ( class_exists( 'FLBuilderUserTemplates' ) ) {
2524
+ FLBuilderUserTemplates::render_node_settings( $node_id );
2525
+ }
2526
+ }
2527
  }
2528
+
2529
+ FLBuilder::init();
css/fl-builder-admin-settings.css CHANGED
@@ -72,6 +72,7 @@
72
  .fl-welcome-page-content {
73
  max-width: 880px;
74
  }
 
75
  .fl-welcome-page-content ul {
76
  list-style-type: disc;
77
  margin: 15px 0 20px 35px;
@@ -149,16 +150,6 @@
149
  color: #d34e2a;
150
  }
151
 
152
- /* Help Button
153
- ----------------------------------------------------------- */
154
-
155
- .fl-help-button-settings,
156
- .fl-help-video-embed,
157
- .fl-knowledge-base-url,
158
- .fl-forums-url {
159
- display: none;
160
- }
161
-
162
  /* Media Query - Max Width 900px
163
  ----------------------------------------------------------- */
164
 
72
  .fl-welcome-page-content {
73
  max-width: 880px;
74
  }
75
+ .fl-upgrade-page-content ul,
76
  .fl-welcome-page-content ul {
77
  list-style-type: disc;
78
  margin: 15px 0 20px 35px;
150
  color: #d34e2a;
151
  }
152
 
 
 
 
 
 
 
 
 
 
 
153
  /* Media Query - Max Width 900px
154
  ----------------------------------------------------------- */
155
 
css/fl-builder-export.css ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #fl-builder-template-filters {
2
+ padding: 0 0 20px 20px;
3
+ }
4
+ #fl-builder-template-filters .spinner {
5
+ float: none;
6
+ margin-bottom: 3px;
7
+ }
8
+ #fl-builder-template-export-posts {
9
+ display: none;
10
+ padding: 20px 0 10px 0;
11
+ }
12
+ #fl-builder-template-export-posts p {
13
+ margin-bottom: 8px;
14
+ }
css/fl-builder-layout-responsive.css CHANGED
@@ -27,6 +27,45 @@
27
  background-position: center center !important;
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  /* Columns
31
  ------------------------------------------------------ */
32
 
@@ -40,15 +79,6 @@
40
  .fl-col-small {
41
  max-width: 400px;
42
  }
43
- .fl-col-group.fl-col-group-equal-height {
44
- display: block;
45
- }
46
- .fl-col-group.fl-col-group-equal-height.fl-col-group-custom-width {
47
- display: -webkit-box;
48
- display: -webkit-flex;
49
- display: -ms-flexbox;
50
- display: flex;
51
- }
52
  .fl-block-col-resize {
53
  display:none;
54
  }
27
  background-position: center center !important;
28
  }
29
 
30
+ /* Column Groups
31
+ ------------------------------------------------------ */
32
+
33
+ /* Equal Heights */
34
+ .fl-col-group.fl-col-group-equal-height {
35
+ display: block;
36
+ }
37
+ .fl-col-group.fl-col-group-equal-height.fl-col-group-custom-width {
38
+ display: -webkit-box;
39
+ display: -webkit-flex;
40
+ display: -ms-flexbox;
41
+ display: flex;
42
+ }
43
+
44
+ /* Reversed Responsive Stacking */
45
+ .fl-col-group.fl-col-group-responsive-reversed {
46
+ display: -webkit-box;
47
+ display: -moz-box;
48
+ display: -ms-flexbox;
49
+ display: -moz-flex;
50
+ display: -webkit-flex;
51
+ display: flex;
52
+ flex-flow: row wrap;
53
+ -ms-box-orient: horizontal;
54
+ -webkit-flex-flow: row wrap;
55
+ }
56
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(1) { order: 12; }
57
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(2) { order: 11; }
58
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(3) { order: 10; }
59
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(4) { order: 9; }
60
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(5) { order: 8; }
61
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(6) { order: 7; }
62
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(7) { order: 6; }
63
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(8) { order: 5; }
64
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(9) { order: 4; }
65
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(10) { order: 3; }
66
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(11) { order: 2; }
67
+ .fl-col-group-responsive-reversed .fl-col:nth-of-type(12) { order: 1; }
68
+
69
  /* Columns
70
  ------------------------------------------------------ */
71
 
79
  .fl-col-small {
80
  max-width: 400px;
81
  }
 
 
 
 
 
 
 
 
 
82
  .fl-block-col-resize {
83
  display:none;
84
  }
css/fl-builder-layout.css CHANGED
@@ -158,30 +158,22 @@
158
  }
159
 
160
  /* Full Height Rows */
161
- .fl-row-full-height .fl-row-content-wrap{
162
  display: -webkit-box;
163
  display: -webkit-flex;
164
  display: -ms-flexbox;
165
  display: flex;
166
- -webkit-box-align: center;
167
- -webkit-align-items: center;
168
- -ms-flex-align: center;
169
- align-items: center;
170
- -webkit-box-pack: center;
171
- -webkit-justify-content: center;
172
- -ms-flex-pack: center;
173
- justify-content: center;
174
  min-height: 100vh;
175
 
176
  }
177
- .fl-row-full-height .fl-row-content{
178
  -webkit-box-flex: 1 1 auto;
179
  -moz-box-flex: 1 1 auto;
180
  -webkit-flex: 1 1 auto;
181
  -ms-flex: 1 1 auto;
182
  flex: 1 1 auto;
183
  }
184
- .fl-row-full-height .fl-row-full-width.fl-row-content{
185
  max-width: 100%;
186
  width: 100%;
187
  }
@@ -196,28 +188,33 @@
196
  margin: 0;
197
  }
198
 
199
- /**
200
- * iPad with portrait orientation.
201
- */
 
 
 
 
 
 
 
 
 
 
202
  @media all and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait){
203
  .fl-row-full-height .fl-row-content-wrap{
204
  min-height: 1024px;
205
  }
206
  }
207
 
208
- /**
209
- * iPad with landscape orientation.
210
- */
211
  @media all and (device-width: 1024px) and (device-height: 768px) and (orientation:landscape){
212
  .fl-row-full-height .fl-row-content-wrap{
213
  min-height: 768px;
214
  }
215
  }
216
 
217
- /**
218
- * iPhone 5
219
- * You can also target devices with aspect ratio.
220
- */
221
  @media screen and (device-aspect-ratio: 40/71) {
222
  .fl-row-full-height .fl-row-content-wrap {
223
  min-height: 500px;
@@ -226,6 +223,7 @@
226
 
227
  /* Column Groups
228
  ------------------------------------------------------ */
 
229
  .fl-col-group-equal-height,
230
  .fl-col-group-equal-height .fl-col,
231
  .fl-col-group-equal-height .fl-col-content{
@@ -267,6 +265,23 @@
267
  content: none;
268
  }
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  /* Columns
271
  ------------------------------------------------------ */
272
 
@@ -428,6 +443,9 @@
428
  position: relative;
429
  max-width: 100%;
430
  }
 
 
 
431
  .fl-photo-content img {
432
  display: inline;
433
  height: auto !important;
@@ -694,4 +712,30 @@ img.mfp-img {
694
  @-moz-keyframes fl-slide-down {
695
  0% { opacity: 0; -moz-transform: translateY(-10%); }
696
  100% { opacity: 1; -moz-transform: translateY(0%); }
697
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
159
 
160
  /* Full Height Rows */
161
+ .fl-row-full-height .fl-row-content-wrap {
162
  display: -webkit-box;
163
  display: -webkit-flex;
164
  display: -ms-flexbox;
165
  display: flex;
 
 
 
 
 
 
 
 
166
  min-height: 100vh;
167
 
168
  }
169
+ .fl-row-full-height .fl-row-content {
170
  -webkit-box-flex: 1 1 auto;
171
  -moz-box-flex: 1 1 auto;
172
  -webkit-flex: 1 1 auto;
173
  -ms-flex: 1 1 auto;
174
  flex: 1 1 auto;
175
  }
176
+ .fl-row-full-height .fl-row-full-width.fl-row-content {
177
  max-width: 100%;
178
  width: 100%;
179
  }
188
  margin: 0;
189
  }
190
 
191
+ /* Full height align center */
192
+ .fl-row-full-height.fl-row-align-center .fl-row-content-wrap {
193
+ align-items: center;
194
+ justify-content: center;
195
+ -webkit-align-items: center;
196
+ -webkit-box-align: center;
197
+ -webkit-box-pack: center;
198
+ -webkit-justify-content: center;
199
+ -ms-flex-align: center;
200
+ -ms-flex-pack: center;
201
+ }
202
+
203
+ /* Full height iPad with portrait orientation. */
204
  @media all and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait){
205
  .fl-row-full-height .fl-row-content-wrap{
206
  min-height: 1024px;
207
  }
208
  }
209
 
210
+ /* Full height iPad with landscape orientation. */
 
 
211
  @media all and (device-width: 1024px) and (device-height: 768px) and (orientation:landscape){
212
  .fl-row-full-height .fl-row-content-wrap{
213
  min-height: 768px;
214
  }
215
  }
216
 
217
+ /* Full height iPhone 5. You can also target devices with aspect ratio. */
 
 
 
218
  @media screen and (device-aspect-ratio: 40/71) {
219
  .fl-row-full-height .fl-row-content-wrap {
220
  min-height: 500px;
223
 
224
  /* Column Groups
225
  ------------------------------------------------------ */
226
+
227
  .fl-col-group-equal-height,
228
  .fl-col-group-equal-height .fl-col,
229
  .fl-col-group-equal-height .fl-col-content{
265
  content: none;
266
  }
267
 
268
+ /* Equal height align center */
269
+ .fl-col-group-equal-height.fl-col-group-align-center .fl-col-content {
270
+ align-items: center;
271
+ justify-content: flex-start;
272
+ -webkit-align-items: center;
273
+ -webkit-box-align: center;
274
+ -webkit-box-pack: center;
275
+ -webkit-justify-content: center;
276
+ -ms-flex-align: center;
277
+ -ms-flex-pack: center;
278
+ }
279
+
280
+ /* IE11 fix for images with height:auto in equal height columns. */
281
+ .fl-builder-ie-11 .fl-col-group-equal-height .fl-module {
282
+ min-height: 1px;
283
+ }
284
+
285
  /* Columns
286
  ------------------------------------------------------ */
287
 
443
  position: relative;
444
  max-width: 100%;
445
  }
446
+ .fl-photo-img-svg {
447
+ width: 100%;
448
+ }
449
  .fl-photo-content img {
450
  display: inline;
451
  height: auto !important;
712
  @-moz-keyframes fl-slide-down {
713
  0% { opacity: 0; -moz-transform: translateY(-10%); }
714
  100% { opacity: 1; -moz-transform: translateY(0%); }
715
+ }
716
+
717
+ /* Button Icon Animation */
718
+ .fl-button.fl-button-icon-animation i {
719
+ width: 0 !important;
720
+ opacity: 0;
721
+ -ms-filter: "alpha(opacity=0)";
722
+ transition: all 0.2s ease-out;
723
+ -webkit-transition: all 0.2s ease-out;
724
+ }
725
+ .fl-button.fl-button-icon-animation:hover i {
726
+ opacity: 1! important;
727
+ -ms-filter: "alpha(opacity=100)";
728
+ }
729
+ .fl-button.fl-button-icon-animation i.fl-button-icon-after {
730
+ margin-left: 0px !important;
731
+ }
732
+ .fl-button.fl-button-icon-animation:hover i.fl-button-icon-after {
733
+ margin-left: 10px !important;
734
+ }
735
+ .fl-button.fl-button-icon-animation i.fl-button-icon-before {
736
+ margin-right: 0 !important;
737
+ }
738
+ .fl-button.fl-button-icon-animation:hover i.fl-button-icon-before {
739
+ margin-right: 20px !important;
740
+ margin-left: -10px;
741
+ }
css/fl-builder.css CHANGED
@@ -136,6 +136,10 @@ html.fl-builder-edit {
136
  .fl-builder-help-button:hover {
137
  color: #666;
138
  }
 
 
 
 
139
 
140
  /* Builder Badges
141
  ------------------------------------------------------ */
@@ -162,7 +166,7 @@ html.fl-builder-edit {
162
  .fl-builder-has-submenu {
163
  position: relative;
164
  }
165
- ul.fl-builder-submenu {
166
  background: #3ba0ff;
167
  box-shadow: 0 0 20px rgba(0,0,0,0.20);
168
  display: none;
@@ -176,19 +180,23 @@ ul.fl-builder-submenu {
176
  width: 155px;
177
  z-index: 100008;
178
  }
179
- ul.fl-builder-submenu li {
180
- list-style: none;
181
  margin: 0;
182
  padding: 0;
183
  }
184
- .fl-builder-submenu-right ul.fl-builder-submenu {
185
  left: auto;
186
  right: 0;
187
  }
188
- .fl-builder-submenu-open ul.fl-builder-submenu {
189
  display: block;
190
  }
191
- ul.fl-builder-submenu li a {
 
 
 
 
192
  color: #fff !important;
193
  display: block;
194
  line-height: 13px;
@@ -200,11 +208,12 @@ ul.fl-builder-submenu li a {
200
  padding: 6px 12px;
201
  text-decoration: none;
202
  }
203
- ul.fl-builder-submenu li a:hover {
204
  background: #54acff;
205
  color: #fff;
206
  opacity: 1;
207
  filter: alpha(opacity = 100);
 
208
  }
209
 
210
  /* Global Submenus */
@@ -278,6 +287,11 @@ ul.fl-builder-submenu li a:hover {
278
  color: #fff !important;
279
  text-decoration: none;
280
  }
 
 
 
 
 
281
  .fl-builder-buy-button:hover,
282
  .fl-builder-upgrade-button:hover {
283
  background: #de861b;
@@ -413,6 +427,29 @@ ul.fl-builder-submenu li a:hover {
413
  display: none !important;
414
  }
415
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  /* Builder Panel Templates
417
  ------------------------------------------------------ */
418
 
@@ -865,6 +902,9 @@ span.fl-builder-block-no-node-templates:hover {
865
  .fl-template-selector .fl-builder-settings-fields {
866
  height: 470px;
867
  }
 
 
 
868
  .fl-template-selector .fl-builder-settings-tab-description {
869
  font-size: 15px!important;
870
  margin: 0 !important;
@@ -873,7 +913,7 @@ span.fl-builder-block-no-node-templates:hover {
873
  }
874
  .fl-template-preview {
875
  float: left;
876
- margin: 0 20px 30px 0;
877
  position: relative;
878
  text-align: center;
879
  width: 170px;
@@ -945,6 +985,26 @@ span.fl-builder-block-no-node-templates:hover {
945
  display: none;
946
  }
947
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
948
  /* User Template Settings
949
  ------------------------------------------------------ */
950
 
@@ -1452,7 +1512,6 @@ form.fl-builder-settings {
1452
  }
1453
  .fl-builder-edit form#wp-link #link-options label span {
1454
  padding-right: 10px;
1455
- width: 60px;
1456
  vertical-align: middle;
1457
  }
1458
  .fl-builder-edit form#wp-link #link-options input[type="text"] {
@@ -1462,6 +1521,9 @@ form.fl-builder-settings {
1462
  padding: 3px 5px;
1463
  width: 80%;
1464
  }
 
 
 
1465
 
1466
  /* Code Editors */
1467
  .ace_editor, .ace_editor * {
@@ -1756,7 +1818,8 @@ li.as-result-item em {
1756
  position: relative;
1757
  top: 2px;
1758
  }
1759
- .fl-builder-service-connect-row .fl-field-description {
 
1760
  background: #f0f0f0;
1761
  color: #333 !important;
1762
  display: block;
@@ -1764,7 +1827,8 @@ li.as-result-item em {
1764
  margin: 10px 0 0 0;
1765
  padding: 10px;
1766
  }
1767
- .fl-builder-service-connect-row .fl-field-description a {
 
1768
  color: #21759b !important;
1769
  text-decoration: underline !important;
1770
  }
@@ -1873,4 +1937,4 @@ body > .fl-builder-tour-dimmed {
1873
  right: -1px;
1874
  top: -1px;
1875
  z-index: 1;
1876
- }
136
  .fl-builder-help-button:hover {
137
  color: #666;
138
  }
139
+ .fl-builder-publish-button {
140
+ height: 45px;
141
+ line-height: 45px !important;
142
+ }
143
 
144
  /* Builder Badges
145
  ------------------------------------------------------ */
166
  .fl-builder-has-submenu {
167
  position: relative;
168
  }
169
+ .fl-builder-has-submenu > ul.fl-builder-submenu.fl-block-col-submenu {
170
  background: #3ba0ff;
171
  box-shadow: 0 0 20px rgba(0,0,0,0.20);
172
  display: none;
180
  width: 155px;
181
  z-index: 100008;
182
  }
183
+ .fl-builder-has-submenu > ul.fl-builder-submenu.fl-block-col-submenu li {
184
+ list-style: none;
185
  margin: 0;
186
  padding: 0;
187
  }
188
+ .fl-builder-submenu-right ul.fl-builder-submenu.fl-block-col-submenu {
189
  left: auto;
190
  right: 0;
191
  }
192
+ .fl-builder-submenu-open ul.fl-builder-submenu.fl-block-col-submenu {
193
  display: block;
194
  }
195
+ .fl-builder-has-submenu > ul.fl-builder-submenu.fl-block-col-submenu li a {
196
+ border-bottom: 0 none;
197
+ box-shadow: none;
198
+ -moz-box-shadow: none;
199
+ -webkit-box-shadow: none;
200
  color: #fff !important;
201
  display: block;
202
  line-height: 13px;
208
  padding: 6px 12px;
209
  text-decoration: none;
210
  }
211
+ .fl-builder-has-submenu > ul.fl-builder-submenu li a:hover {
212
  background: #54acff;
213
  color: #fff;
214
  opacity: 1;
215
  filter: alpha(opacity = 100);
216
+ text-decoration: none;
217
  }
218
 
219
  /* Global Submenus */
287
  color: #fff !important;
288
  text-decoration: none;
289
  }
290
+ .fl-builder-buy-button i.fa-external-link-square,
291
+ .fl-builder-upgrade-button i.fa-external-link-square {
292
+ color: #f4d1a7;
293
+ margin: 0 0 0 6px;
294
+ }
295
  .fl-builder-buy-button:hover,
296
  .fl-builder-upgrade-button:hover {
297
  background: #de861b;
427
  display: none !important;
428
  }
429
 
430
+ /* Lite version modules CTA */
431
+ .fl-builder-modules-cta a {
432
+ color: #999 !important;
433
+ display: block !important;
434
+ font-size: 12px !important;
435
+ font-style: italic !important;
436
+ padding: 15px 20px !important;
437
+ line-height: 16px !important;
438
+ }
439
+ .fl-builder-modules-cta a:hover {
440
+ background: #e5e5e5 !important;
441
+ color: #666 !important;
442
+ text-decoration: none !important;
443
+ }
444
+ .fl-builder-modules-cta a:focus {
445
+ text-decoration: none !important;
446
+ }
447
+ .fl-builder-modules-cta .fa {
448
+ float: right !important;
449
+ font-size: 14px !important;
450
+ margin: 3px 0px 0 9px !important;
451
+ }
452
+
453
  /* Builder Panel Templates
454
  ------------------------------------------------------ */
455
 
902
  .fl-template-selector .fl-builder-settings-fields {
903
  height: 470px;
904
  }
905
+ .fl-template-selector .fl-builder-settings-tab {
906
+ width: 560px;
907
+ }
908
  .fl-template-selector .fl-builder-settings-tab-description {
909
  font-size: 15px!important;
910
  margin: 0 !important;
913
  }
914
  .fl-template-preview {
915
  float: left;
916
+ margin: 0 25px 30px 0;
917
  position: relative;
918
  text-align: center;
919
  width: 170px;
985
  display: none;
986
  }
987
 
988
+ /* Lite version templates CTA */
989
+ .fl-builder-templates-cta {
990
+ margin-bottom: 20px;
991
+ }
992
+ .fl-builder-templates-cta p {
993
+ display: inline-block !important;
994
+ width: 75% !important;
995
+ font-size: 14px !important;
996
+ line-height: 1.5 !important;
997
+ margin-bottom: 0 !important;
998
+ }
999
+ .fl-builder-templates-cta .fl-builder-upgrade-button {
1000
+ font-size: 13px !important;
1001
+ line-height: 13px !important;
1002
+ position: relative;
1003
+ top: 8px;
1004
+ left: 15px;
1005
+ padding: 1px 12px;
1006
+ }
1007
+
1008
  /* User Template Settings
1009
  ------------------------------------------------------ */
1010
 
1512
  }
1513
  .fl-builder-edit form#wp-link #link-options label span {
1514
  padding-right: 10px;
 
1515
  vertical-align: middle;
1516
  }
1517
  .fl-builder-edit form#wp-link #link-options input[type="text"] {
1521
  padding: 3px 5px;
1522
  width: 80%;
1523
  }
1524
+ .fl-builder-edit form#wp-link .query-results {
1525
+ top: 225px;
1526
+ }
1527
 
1528
  /* Code Editors */
1529
  .ace_editor, .ace_editor * {
1818
  position: relative;
1819
  top: 2px;
1820
  }
1821
+ .fl-builder-service-connect-row .fl-field-description,
1822
+ #fl-field-visibility_user_capability .fl-field-description {
1823
  background: #f0f0f0;
1824
  color: #333 !important;
1825
  display: block;
1827
  margin: 10px 0 0 0;
1828
  padding: 10px;
1829
  }
1830
+ .fl-builder-service-connect-row .fl-field-description a,
1831
+ #fl-field-visibility_user_capability .fl-field-description a {
1832
  color: #21759b !important;
1833
  text-decoration: underline !important;
1834
  }
1937
  right: -1px;
1938
  top: -1px;
1939
  z-index: 1;
1940
+ }
css/fl-builder.min.css CHANGED
@@ -1 +1 @@
1
- .fl-builder-edit #wpadminbar,.fl-builder-hidden-editor{display:none}table{border-collapse:inherit!important}html.fl-builder-edit{margin-top:43px!important}.fl-builder-edit body{position:static!important}.fl-clear{clear:both}.fl-builder-loading{background:url(../img/ajax-loader.gif) center center no-repeat rgba(240,240,240,.8);bottom:0;display:none;left:0;position:fixed;right:0;text-align:center;top:0;z-index:200000}.fl-builder-settings .fl-builder-loading{background:url(../img/ajax-loader.gif) center center no-repeat rgba(255,255,255,.8);display:block;position:absolute}#tiptip_holder{z-index:200000}.screen-reader-text{position:absolute;left:-1000em;top:-1000em;height:1px;width:1px;overflow:hidden}.fl-visible-desktop,.fl-visible-desktop-medium,.fl-visible-medium,.fl-visible-medium-mobile,.fl-visible-mobile{display:block!important}.fl-builder-button{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top;display:inline-block;text-decoration:none;font-size:13px!important;line-height:13px!important;height:28px;margin:0;padding:7px 10px;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important;box-sizing:border-box!important}.fl-builder-button:hover{background:#fafafa;border-color:#999;color:#222}.fl-builder-button-primary{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff!important;text-decoration:none}.fl-builder-button-primary:hover{background:#1e8cbe;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff!important}.fl-builder-button-large{height:30px;line-height:30px!important;padding:0 12px 2px}.fl-builder-button-small{font-size:11px!important;line-height:11px!important;height:24px}.fl-builder-help-button{color:#b3b3b3;font-size:16px!important}.fl-builder-help-button i{position:relative;top:-1px}.fl-builder-help-button:hover{color:#666}.fl-builder-badge{background:#333;border-radius:2px;color:#fff!important;display:inline;font-size:11px!important;font-weight:400;letter-spacing:1px;margin-left:2px;padding:2px 4px;vertical-align:top}.fl-builder-badge-global{background:#ff9600}.fl-builder-has-submenu{position:relative}ul.fl-builder-submenu{background:#3ba0ff;box-shadow:0 0 20px rgba(0,0,0,.2);display:none;left:0;list-style:none;margin:0;padding:6px 0;position:absolute;text-align:left;top:100%;width:155px;z-index:100008}ul.fl-builder-submenu li{list-style:none;margin:0;padding:0}.fl-builder-submenu-right ul.fl-builder-submenu{left:auto;right:0}.fl-builder-submenu-open ul.fl-builder-submenu{display:block}ul.fl-builder-submenu li a{color:#fff!important;display:block;line-height:13px;font-size:13px;font-family:Helvetica,Verdana,sans-serif;font-weight:400;opacity:.8;filter:alpha(opacity=80);padding:6px 12px;text-decoration:none}ul.fl-builder-submenu li a:hover{background:#54acff;color:#fff;opacity:1;filter:alpha(opacity=100)}.fl-builder-bar-content,.fl-builder-panel{color:#999;font-family:Helvetica,Verdana,sans-serif}.fl-block-overlay-global ul.fl-builder-submenu{background:#ff9600}.fl-block-overlay-global ul.fl-builder-submenu li a:hover{background:#fa3}.fl-builder-bar{left:0;position:fixed;right:0;top:0;z-index:100008}.fl-builder-bar-content{background:#f4f4f4;border-bottom:1px solid #ccc;box-shadow:0 0 8px rgba(0,0,0,.2);-moz-box-shadow:0 0 8px rgba(0,0,0,.2);-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);font-size:14px;height:43px}.fl-builder-bar-title{color:#333;display:block;float:left;font-size:20px;font-weight:300;line-height:20px;padding:7px 10px}.fl-builder-bar-title img{height:30px!important;margin:0 1px 0 0!important;vertical-align:middle!important}.fl-builder-bar-title span{vertical-align:middle}.fl-builder-bar-title.fl-builder-bar-title-no-icon{padding:12px}.fl-builder-bar-actions{float:right;padding:7px}.fl-builder-bar .fl-builder-button{float:right;margin:0 0 0 6px}.fl-builder-bar .fl-builder-add-content-button{display:none}.fl-builder-buy-button,.fl-builder-upgrade-button{background:#f7951e;border-color:#de7c04;-webkit-box-shadow:inset 0 1px 0 rgba(255,177,82,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,177,82,.5),0 1px 0 rgba(0,0,0,.15);color:#fff!important;text-decoration:none}.fl-builder-buy-button:hover,.fl-builder-upgrade-button:hover{background:#de861b;border-color:#c46e04;-webkit-box-shadow:inset 0 1px 0 rgba(255,177,82,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,177,82,.5),0 1px 0 rgba(0,0,0,.15);color:#fff!important}.fl-builder-panel{background:#f0f0f0;border-left:1px solid #ccc;bottom:0;box-shadow:0 0 8px rgba(0,0,0,.2);-moz-box-shadow:0 0 8px rgba(0,0,0,.2);-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);font-size:14px;opacity:1;position:fixed;right:0;top:43px;width:300px;z-index:100007;-webkit-transform:translateZ(0);transition:opacity .2s;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;-ms-transition:opacity .2s;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fl-block-col-resize-feedback,.fl-builder-drop-zone,.fl-builder-empty{font-family:Helvetica,Verdana,sans-serif!important}.fl-builder-panel-actions{background:#f4f4f4;border-bottom:1px solid #dbdbdb;height:43px;left:0;position:absolute;right:0;top:0;text-align:right;z-index:100009}.fl-builder-panel-actions .fl-builder-panel-close{color:#bfbfbf;cursor:pointer;float:left;font-size:18px;margin:12px 18px}.fl-builder-panel-actions .fl-builder-panel-close:hover{color:#333}.fl-builder-panel-content-wrap{bottom:0;height:auto;left:0;overflow:hidden;position:absolute;right:0;top:43px}.fl-builder-panel-content{padding-bottom:60px}.fl-builder-blocks-section .fl-builder-block,.fl-builder-blocks-section .fl-builder-blocks-section-title{cursor:pointer;display:block;line-height:14px;padding:15px 20px}.fl-builder-blocks-section .fl-builder-blocks-section-title{border-bottom:1px solid #dfdfdf;color:#333;font-weight:400}.fl-builder-blocks-section .fl-builder-blocks-section-title i{color:#bfbfbf;float:right}.fl-builder-blocks-section .fl-builder-blocks-section-title:hover,.fl-builder-blocks-section .fl-builder-blocks-section-title:hover i{background:#e5e5e5}.fl-builder-blocks-section-content{background:#fff;display:none}.fl-builder-blocks-section.fl-active .fl-builder-blocks-section-content{display:block}.fl-builder-blocks-section-content .fl-builder-block{border-bottom:1px solid #ebebeb;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fl-builder-blocks-section-content .fl-builder-block i{color:#d9d9d9;margin-right:10px}.fl-builder-blocks-section-content .fl-builder-block:hover{background:#0074a1;color:#fff;cursor:move}.fl-builder-blocks-separator{background:#dfdfdf;height:6px}.fl-builder-block:hover .fl-builder-badge{background:#2ea2cc}.ui-sortable-helper .fl-builder-badge{display:none!important}.fl-builder-block-template-image{margin:5px 0 10px;max-width:100%}.fl-photo-field .fl-photo-preview-img img,.fl-video-field .fl-video-preview-img img{max-width:60px}.fl-builder-block-template .fl-builder-block-title{display:block}.ui-sortable-helper .fl-builder-block-template-image{display:none!important}span.fl-builder-block-no-node-templates{display:block;padding:15px 20px}span.fl-builder-block-no-node-templates:hover{cursor:default;background:#fff}.fl-builder-blocks-node-template .fl-builder-block{position:relative}.fl-builder-blocks-section-content .fl-builder-node-template-actions{bottom:0;cursor:default;display:none;position:absolute;right:0;top:0;width:72px}.fl-builder-blocks-section-content .fl-builder-node-template-delete,.fl-builder-blocks-section-content .fl-builder-node-template-edit{bottom:0;cursor:pointer;margin:0;padding:15px 0;position:absolute;text-align:center;top:0;width:30px}.fl-builder-blocks-section-content .fl-builder-node-template-delete{right:12px}.fl-builder-blocks-section-content .fl-builder-node-template-edit{right:42px}.fl-builder-blocks-section-content .fl-builder-node-template-delete i,.fl-builder-blocks-section-content .fl-builder-node-template-edit i{margin:0}.fl-builder-blocks-section-content .fl-builder-node-template-delete:hover i,.fl-builder-blocks-section-content .fl-builder-node-template-edit:hover i{color:#fff}.fl-builder-blocks-node-template .fl-builder-block:hover{padding-right:85px}.fl-builder-blocks-node-template .fl-builder-block:hover .fl-builder-node-template-actions{display:block}.ui-sortable-helper .fl-builder-node-template-delete,.ui-sortable-helper .fl-builder-node-template-edit{display:none!important}.fl-builder-empty{border:1px dashed #3ba0ff;color:#3ba0ff;font-size:14px;margin:10px;padding:100px 20px;text-align:center;text-transform:uppercase}.fl-builder-empty .fl-builder-drop-zone{margin:10px}.fl-builder-block-drag-helper,.fl-builder-block.ui-draggable-dragging{background:#fff!important;border:1px solid #ccc;box-shadow:0 0 8px rgba(0,0,0,.2);-moz-box-shadow:0 0 8px rgba(0,0,0,.2);-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);color:#999!important;font-family:Helvetica,Verdana,sans-serif!important;font-size:14px!important;height:45px!important;line-height:42px!important;overflow:hidden;padding:0 18px;position:fixed!important;text-overflow:ellipsis;white-space:nowrap;width:140px!important;z-index:100010}.fl-builder-drop-zone{background:#3ba0ff;color:#fff;display:block;font-weight:700;font-size:14px;margin:10px;padding:10px;text-shadow:none}.fl-builder-drop-zone-global{background:#ff9600}.fl-builder-content>.fl-builder-drop-zone{margin:10px 20px}.fl-row-content>.fl-builder-drop-zone{margin:5px}.fl-row-highlight{padding:5px 0}.fl-row-highlight .fl-row-content{border:1px dashed red;padding:5px}.fl-col-highlight{padding:15px 5px}.fl-col-highlight .fl-col-content{border-style:dashed;border-color:#3ba0ff;min-height:100px;border-width:1px}.fl-col-highlight.fl-node-global .fl-col-content{border-color:#ff9600}.fl-builder-simple .fl-col-highlight .fl-col-content{border:none}.fl-block-overlay,.fl-block-overlay *{text-shadow:none}.fl-block-overlay-active{position:relative}.fl-block-overlay-actions{background:#3ba0ff;float:left;margin:0 -1px;text-shadow:none}.fl-block-overlay-actions>span{display:block;float:left}.fl-block-overlay-actions i{color:#fff!important;cursor:pointer;display:block!important;float:left;font-size:14px!important;height:28px!important;font-weight:100!important;line-height:28px!important;opacity:.8;filter:alpha(opacity=80);text-align:center;width:28px!important}.fl-block-overlay-actions i:hover{opacity:1;filter:alpha(opacity=100)}.fl-block-overlay-actions>i:first-child{padding-left:4px}.fl-block-overlay-actions>i:last-child{padding-right:2px}.fl-block-overlay-actions i.fl-block-move{cursor:move}.fl-block-overlay-title{border-right:1px solid #5eb1ff;color:#fff!important;float:left;font-family:Helvetica,Verdana,sans-serif;font-size:13px;height:30px;line-height:29px;margin-right:2px;padding:0 8px}.fl-row-overlay{background:rgba(59,160,255,.15);border:1px solid #3ba0ff;bottom:0;box-sizing:border-box!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;color:#fff;left:0;position:absolute;top:-30px;width:100%;z-index:100006}.fl-row-overlay-header-bottom{bottom:-30px;top:0}.fl-row-overlay-header-bottom .fl-block-overlay-header{position:absolute;bottom:0}.fl-block-overlay-active .fl-row-content-wrap{position:relative}.fl-block-overlay-active .fl-row-content{position:relative;z-index:100007!important}.fl-col-overlay,.fl-module-overlay{background:rgba(59,160,255,.15);border:1px solid #3ba0ff;cursor:pointer;color:#fff;position:absolute}.fl-col-overlay{bottom:15px;left:5px;right:5px;top:15px;z-index:100007}.fl-module-overlay{bottom:4px;left:4px;min-height:32px;right:4px;top:4px;z-index:100007}.fl-builder-global-templates-locked .fl-block-overlay-global.fl-module-overlay{cursor:default}.fl-module-adjust-height{padding-bottom:15px;padding-top:15px}.fl-block-overlay-global{background:rgba(255,150,0,.1);border:1px solid #ff9600}.fl-block-overlay-global .fl-block-overlay-actions{background:#ff9600}.fl-block-overlay-global .fl-block-overlay-title{border-right:1px solid #ffcf66}.fl-block-overlay-title-global{background:#fff;border-radius:2px;color:#ff9600!important;font-size:11px;letter-spacing:1px;margin-left:4px;padding:2px 4px;vertical-align:top}.fl-block-overlay-global.fl-row-overlay{background:rgba(255,150,0,.3);cursor:pointer;z-index:100007}.fl-builder-global-templates-locked .fl-block-overlay-global.fl-row-overlay{cursor:default}.fl-builder-row-template .fl-block-overlay-global.fl-row-overlay{background:rgba(255,150,0,.1);cursor:default;z-index:100006}.fl-block-overlay-muted .fl-row-overlay{background:rgba(153,153,153,.1);border:1px solid #8c8c8c}.fl-block-overlay-muted .fl-row-overlay .fl-block-overlay-actions{background:#8c8c8c}.fl-block-overlay-muted .fl-row-overlay .fl-block-overlay-title{border-right:1px solid #a6a6a6}.fl-node-disabled{position:relative}.fl-node-disabled-overlay{background:rgba(153,153,153,.75);bottom:0;left:0;position:absolute;right:0;top:0}.fl-block-col-resize{bottom:0!important;position:absolute;top:0!important;width:6px}.fl-block-col-resize-e{cursor:ew-resize;left:auto!important;right:-4px!important}.fl-block-col-resize-w{cursor:ew-resize;left:-4px!important}.fl-block-col-resize-handle-wrap{margin:-4px 0 0 -5px;padding:0 5px;position:absolute;top:50%!important}.fl-block-col-resize-e .fl-block-col-resize-handle-wrap{margin-left:-6px}.fl-block-col-resize-handle{background:#fff;border:1px solid #259aff;height:7px;width:7px}.fl-node-global .fl-block-col-resize-handle{border-color:#ff9600}.fl-block-col-resize-feedback{color:#333!important;display:none;font-size:11px!important;position:absolute}.fl-builder-actions-title,.fl-builder-alert-lightbox .fl-lightbox-message{color:#333!important;font-family:Helvetica,Verdana,sans-serif!important;font-size:16px!important}.fl-block-col-resize-feedback-left,.fl-block-col-resize-feedback-right{background:#fff;border:1px solid #3ba0ff;padding:2px 4px}.fl-block-col-resize-feedback-left{right:20px;top:-7px}.fl-block-col-resize-feedback-right{left:20px;top:-7px}.fl-builder-actions-lightbox .fl-lightbox{width:300px}.fl-builder-actions-lightbox .fl-builder-actions{display:block;padding:25px;text-align:center}.fl-builder-actions-title{display:block;margin-bottom:20px}.fl-builder-actions .fl-builder-button{display:block;margin-bottom:7px}.fl-builder-alert-lightbox{z-index:200001}.fl-builder-alert-lightbox .fl-lightbox{width:440px!important}.fl-builder-alert-lightbox .fl-lightbox-message{line-height:24px;padding:30px}.fl-builder-settings-message,.fl-builder-settings-message *{font-size:15px!important;line-height:23px!important}.fl-template-category-select{width:180px!important}.fl-template-selector .fl-builder-settings-section{margin:0 0 10px}.fl-template-selector .fl-builder-settings-fields{height:470px}.fl-template-selector .fl-builder-settings-tab-description{font-size:15px!important;margin:0!important;padding:10px 0 25px;text-align:center}.fl-template-preview{float:left;margin:0 20px 30px 0;position:relative;text-align:center;width:170px}.fl-template-preview.fl-last{margin-right:0}.fl-template-image{border:1px solid #d9d9d9;cursor:pointer;margin-bottom:12px;height:164px;overflow:hidden}.fl-template-image:hover{border-color:red}.fl-template-image img{max-height:none;width:100%}.fl-template-preview span{display:block;text-align:center}.fl-user-template-category-name{background:#f2f2f2;border-bottom:3px solid #dfdfdf;border-top:2px solid #dfdfdf;font-weight:700;padding:8px 15px}.fl-user-templates{border-top:1px solid #dfdfdf;margin-bottom:20px;margin-right:8px}.fl-user-template{border-bottom:1px solid #dfdfdf;padding:15px;position:relative}.fl-user-template:hover{background:#0074a1;color:#fff!important;cursor:pointer}.fl-user-template:hover *{color:#fff!important}.fl-user-template-actions{bottom:0;position:absolute;right:0;top:0}.fl-user-template-actions a{color:#bfbfbf!important;display:inline-block;padding:15px}.fl-user-template:hover a{color:#99c7d9!important}.fl-user-template:hover a:hover{color:#fff!important}.fl-user-templates-message{display:none}.fl-builder-node-template-settings .fl-builder-settings-fields,.fl-builder-user-template-settings .fl-builder-settings-fields{height:150px}.fl-builder-lightbox .fl-lightbox{width:600px}form.fl-builder-settings{margin:0;padding:0}.fl-builder-settings-message{padding:20px 25px!important;background:#f2f2f2!important}.fl-builder-preview-loader{position:relative;top:-1px;margin-left:3px}.fl-lightbox-header .fl-builder-preview-loader{margin:0;position:absolute;right:15px;top:15px}.fl-builder-settings-tabs{background:#f5f5f5;border-bottom:1px solid #dfdfdf;padding:15px 20px 0}.fl-builder-settings-tabs a{color:#999;display:inline-block;margin:0;padding:10px 20px;text-decoration:none}.fl-builder-settings-tabs a:hover{color:#333}.fl-builder-settings-tabs a.fl-active{background:#fff;border:1px solid #dfdfdf;border-bottom:none;color:#222;position:relative;top:1px}.fl-builder-settings-tabs a.error{color:#d03436;padding-right:10px}.fl-builder-settings-tabs a.error .fl-error-icon{background:url(../img/sprite.png) -148px -5px no-repeat;display:inline-block;height:16px;margin-left:7px;position:relative;top:3px;width:16px}.fl-builder-settings-tab{display:none;width:550px}.fl-builder-settings-tab.fl-active{display:block}.fl-builder-settings-tab-description{background:#f5f5f5;padding:10px 15px}.fl-form-table{border:none;width:100%}.fl-form-table tbody{border:none}.fl-form-table th{border:none!important;background:#fff!important;font-weight:400!important;padding:10px!important;text-align:left!important;vertical-align:top!important;width:200px!important}.fl-form-table td{border:none;padding:8px 10px}.fl-builder-settings-fields{height:410px;margin:5px 0 0;overflow:hidden;position:relative}.fl-lightbox-header .fl-builder-settings-fields{height:auto;margin:0;position:absolute;right:10px;top:10px}.fl-builder-settings-fields .fl-nanoscroller-content{padding:15px 20px}.fl-builder-settings-fields input[type=email],.fl-builder-settings-fields input[type=file],.fl-builder-settings-fields input[type=number],.fl-builder-settings-fields input[type=password],.fl-builder-settings-fields input[type=search],.fl-builder-settings-fields input[type=tel],.fl-builder-settings-fields input[type=text],.fl-builder-settings-fields input[type=url],.fl-builder-settings-fields select,.fl-builder-settings-fields textarea{background-color:#fff;border-color:#dfdfdf;border-style:solid;border-width:1px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;color:#333;display:inline;font-size:12px;height:auto;line-height:15px;margin:1px;outline:0;padding:3px;width:auto}.fl-builder-settings-fields input[type=email]:focus,.fl-builder-settings-fields input[type=file]:focus,.fl-builder-settings-fields input[type=number]:focus,.fl-builder-settings-fields input[type=password]:focus,.fl-builder-settings-fields input[type=search]:focus,.fl-builder-settings-fields input[type=tel]:focus,.fl-builder-settings-fields input[type=text]:focus,.fl-builder-settings-fields input[type=url]:focus,.fl-builder-settings-fields select:focus,.fl-builder-settings-fields textarea:focus{background:0 0;border-color:#aaa}.fl-builder-settings-fields select[multiple]{height:60px}.fl-builder-settings-fields ::-webkit-input-placeholder{color:#999!important}.fl-builder-settings-fields input:-moz-placeholder{color:#999}.fl-builder-settings-fields ::-moz-placeholder{color:#999!important}.fl-builder-settings-fields input:-ms-input-placeholder{color:#999}.fl-builder-settings-fields label{font-weight:400}.fl-builder-settings-fields select{height:2em;color:#000;padding:2px}.fl-builder-settings-description{border-bottom:1px solid #dfdfdf;margin:0 0 10px;padding-bottom:10px!important}.fl-builder-settings-fields table{margin:0}.fl-builder-settings-fields h3.fl-builder-settings-title{border-bottom:1px solid #dfdfdf;color:#333;font-size:14px;font-weight:700;margin:0 0 20px!important;padding:10px}.fl-builder-settings-section{margin-bottom:15px}.wp-core-ui h1,.wp-core-ui h2,.wp-core-ui h3,.wp-core-ui h4,.wp-core-ui h5,.wp-core-ui h6{color:#333}.wp-core-ui .submitbox .submitdelete{color:#a00}.wp-core-ui button{font-weight:400;text-transform:capitalize}.wp-core-ui input[type=email],.wp-core-ui input[type=file],.wp-core-ui input[type=number],.wp-core-ui input[type=password],.wp-core-ui input[type=search],.wp-core-ui input[type=tel],.wp-core-ui input[type=text],.wp-core-ui input[type=url],.wp-core-ui select,.wp-core-ui textarea{background-color:#fff;border-color:#dfdfdf;border-style:solid;border-width:1px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;color:#333;font-weight:400}.wp-core-ui input[type=email]:focus,.wp-core-ui input[type=file]:focus,.wp-core-ui input[type=number]:focus,.wp-core-ui input[type=password]:focus,.wp-core-ui input[type=search]:focus,.wp-core-ui input[type=tel]:focus,.wp-core-ui input[type=text]:focus,.wp-core-ui input[type=url]:focus,.wp-core-ui select:focus,.wp-core-ui textarea:focus{background:0 0;border-color:#aaa}.wp-core-ui input[type=search]{background-image:none;padding:6px}.fl-builder-settings-fields input.text-full,.fl-builder-settings-fields textarea{width:97%}.fl-color-picker{cursor:pointer}.fl-color-picker .fl-color-picker-clear:hover{background-color:#ededed}.colorpicker input{padding:0!important;font-size:11px!important;color:#fff!important;width:29px!important;height:auto!important;background:0 0!important;border:none!important}.colorpicker .colorpicker_hex input{width:45px!important}.fl-builder-custom-field{border:1px solid #dfdfdf;border-radius:3px;padding:5px 10px}.fl-builder-custom-field a{color:#21759b!important;text-decoration:underline!important}.fl-builder-custom-field a:hover{color:#d54e21!important}.fl-builder-custom-field label.error{margin-top:5px}.fl-photo-field .fl-photo-select,.fl-photo-field.fl-photo-empty .fl-photo-preview{display:none}.fl-photo-field.fl-photo-empty .fl-photo-select{display:block}.fl-photo-field .fl-photo-preview-img{float:left;line-height:0;margin:5px 0}.fl-photo-field .fl-photo-preview select{margin:8px 0 8px 10px;width:200px}.fl-photo-field .fl-photo-edit{margin:0 0 0 11px}.fl-multiple-photos-field .fl-multiple-photos-add,.fl-photo-field .fl-photo-remove,.fl-photo-field .fl-photo-replace{margin:0 0 0 8px}.fl-builder-edit .media-frame{-webkit-backface-visibility:hidden}.fl-builder-edit .media-modal-content .thumbnail{padding:0;border:none;border-radius:0}.fl-builder-edit button.button-link.media-modal-close{position:absolute;box-shadow:none;-webkit-box-shadow:none}.fl-multiple-photos-field .fl-multiple-photos-select,.fl-multiple-photos-field.fl-multiple-photos-empty .fl-multiple-photos-add,.fl-multiple-photos-field.fl-multiple-photos-empty .fl-multiple-photos-count,.fl-multiple-photos-field.fl-multiple-photos-empty .fl-multiple-photos-edit,.fl-multiple-photos-lightbox .gallery-settings{display:none}.fl-multiple-photos-field.fl-multiple-photos-empty .fl-multiple-photos-select{display:inline}.fl-multiple-photos-count{font-weight:700;margin-bottom:3px}.fl-video-field .fl-video-select,.fl-video-field.fl-video-empty .fl-video-preview{display:none}.fl-video-field.fl-video-empty .fl-video-select{display:block}.fl-video-field .fl-video-preview-img{float:left;line-height:0;margin:5px 0}.fl-video-field .fl-video-preview-filename{display:inline-block;font-size:14px;font-weight:700;margin:7px 0 0 11px}.fl-video-field .fl-video-replace{margin:0 0 0 11px}.fl-multiple-audios-field .fl-multiple-audios-select,.fl-multiple-audios-field.fl-multiple-audios-empty .fl-multiple-audios-add,.fl-multiple-audios-field.fl-multiple-audios-empty .fl-multiple-audios-edit{display:none}.fl-multiple-audios-field.fl-multiple-audios-empty .fl-multiple-audios-select{display:block}.fl-multiple-audios-field .fl-multiple-audios-add{margin:0 0 0 8px}.fl-icon-field .fl-icon-select,.fl-icon-field.fl-icon-empty .fl-icon-preview{display:none}.fl-icon-field.fl-icon-empty .fl-icon-select{display:block}.fl-icon-field .fl-icon-preview i{display:inline-block;font-size:28px;margin:10px 10px 9px 2px;vertical-align:middle}.fl-icon-field .fl-icon-remove{margin:0 0 0 8px}.fl-builder-settings .wp-switch-editor{background:#ebebeb;border:1px solid #e5e5e5;border-radius:0;color:#333}.fl-builder-settings .wp-editor-container{border:1px solid #e5e5e5}.fl-builder-settings .mce-toolbar .mce-btn-group .mce-btn{margin:2px 0}.fl-builder-settings .mce-menubtn.mce-fixed-width button{width:100px}.mce-close:active,.mce-close:hover,.mce-toolbar .mce-btn button:active,.mce-toolbar .mce-btn button:hover,.mce-window .mce-btn button:active,.mce-window .mce-btn button:hover{background:0 0;border:none}.mce-ico{font-family:tinymce,Arial!important}.mce-toolbar i.mce-ico{font:400 20px/1 dashicons!important}.fl-builder-edit form#wp-link,.fl-color-picker-ui,.popover[class*=tour-],ul.as-list{font-family:Helvetica,Verdana,sans-serif}.wp-core-ui .quicktags-toolbar input.button.button-small{margin:1px!important}.wp-editor-container textarea.wp-editor-area{background:0 0;border:none;padding:10px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.fl-builder-edit form#wp-link{color:#000;font-size:13px}.fl-builder-edit form#wp-link #link-options label{display:block;margin-bottom:2px}.fl-builder-edit form#wp-link #link-options label span{padding-right:10px;width:60px;vertical-align:middle}.fl-builder-edit form#wp-link #link-options input[type=text]{display:inline-block;height:auto;margin:5px 0 0;padding:3px 5px;width:80%}.ace_editor,.ace_editor *{font-family:Monaco,Menlo,"Ubuntu Mono","Droid Sans Mono",Consolas,monospace!important;font-size:12px!important;font-weight:400!important;letter-spacing:0!important}.fl-builder-global-settings #fl-builder-settings-tab-css,.fl-builder-global-settings #fl-builder-settings-tab-js,.fl-builder-html-settings #fl-builder-settings-tab-general,.fl-builder-layout-settings #fl-builder-settings-tab-css,.fl-builder-layout-settings #fl-builder-settings-tab-js{width:560px}.fl-builder-global-settings #fl-builder-settings-section-css,.fl-builder-global-settings #fl-builder-settings-section-js,.fl-builder-html-settings #fl-builder-settings-section-general,.fl-builder-layout-settings #fl-builder-settings-section-css,.fl-builder-layout-settings #fl-builder-settings-section-js{margin-bottom:0}.fl-builder-global-settings #fl-builder-settings-tab-css td,.fl-builder-global-settings #fl-builder-settings-tab-js td,.fl-builder-html-settings #fl-builder-settings-section-general td,.fl-builder-layout-settings #fl-builder-settings-tab-css td,.fl-builder-layout-settings #fl-builder-settings-tab-js td{padding:0}.fl-layout-field-option{border:2px solid #d9d9d9;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-sizing:border-box!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;cursor:pointer;float:left;line-height:0;max-width:23%;margin:0 1% 2%;padding:5px}.fl-layout-field-option-selected,.fl-layout-field-option:hover{border-color:red}.fl-layout-field-option img{max-width:100%}.fl-link-field-input{width:244px!important}.fl-link-field-search{display:none;border:1px solid #dfdfdf;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin:4px 0 0;padding:10px}.fl-link-field-search-title{display:block;margin:0 0 3px 2px}.fl-link-field-search-cancel{margin-top:6px}.fl-help-tooltip{display:inline-block;position:relative}.fl-help-tooltip-icon{color:#999!important;cursor:pointer;font-family:FontAwesome;font-size:15px!important;padding:5px;vertical-align:middle}.fl-help-tooltip-text{background:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ccc;-moz-box-shadow:0 0 5px #ccc;-webkit-box-shadow:0 0 5px #ccc;display:none;font-weight:400;left:23px;padding:10px 13px;position:absolute;top:-6px;width:250px;z-index:1000}.fl-form-field-preview-text .fa{font-size:18px;line-height:22px}.fl-builder-field-actions{padding-left:0!important;padding-right:0!important;text-align:center;vertical-align:middle;width:85px}.fl-builder-field-actions i{color:#999!important;cursor:pointer;font-size:13px!important;height:24px;line-height:29px!important;width:24px}.fl-builder-field-actions i:hover{color:#000!important}.fl-builder-field-actions i.fl-builder-field-copy,.fl-builder-field-actions i.fl-builder-field-delete{margin-left:5px}.fl-builder-field-actions i.fl-builder-field-move{cursor:move}.fl-builder-field-dd-helper{background:#ccc;height:30px!important;float:left;width:130px!important}.fl-builder-field-dd-zone{border:1px dashed #ccc;height:30px}.fl-builder-field-actions-single{width:auto}.fl-builder-field-actions-single i.fl-builder-field-delete,.fl-builder-field-actions-single i.fl-builder-field-move{display:none}.fl-builder-widget-settings input{display:inline-block!important;margin:5px 10px 8px!important}.fl-builder-lightbox-loading{background:url(../img/ajax-loader.gif) center center no-repeat;height:100px}.fl-builder-settings .error,.fl-builder-settings input.error{border-color:#d03436}.fl-builder-settings label.error,.fl-builder-settings p.error{color:#d03436;display:block;margin-top:5px}.fl-builder-settings .fl-form-table .fl-field-description{color:#999;font-style:normal}ul.as-selections{background-color:#fff;border-color:#dfdfdf;border-style:solid;border-width:1px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;color:#333;font-size:12px;height:auto;line-height:15px;margin:1px;outline:0;padding:3px;width:auto}ul.as-selections.loading{background:url(../img/ajax-loader-small.gif) 98% center no-repeat}ul.as-selections li.as-selection-item{background:#d4eaf6;border:none;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;font-size:11px;line-height:14px;margin-bottom:4px;padding-bottom:0;padding-top:0}ul.as-selections li.as-selection-item.blur{background:#f4f4f4}ul.as-selections li.as-selection-item a.as-close{line-height:12px}ul.as-selections li.as-original{margin:0}ul.as-selections li.as-original input{height:auto;font-size:12px;margin:0;padding:0}ul.as-list{margin:0;font-size:13px;color:#000;background-color:#fff;background-color:rgba(255,255,255,.95);z-index:2;-webkit-box-shadow:0 0 10px rgba(0,0,0,.1);-moz-box-shadow:0 0 10px rgba(0,0,0,.1);box-shadow:0 0 10px rgba(0,0,0,.1);-ms-border-radius:0;-o-border-radius:0;border:none;border:1px solid #dfdfdf;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}li.as-message,li.as-result-item{border:none}li.as-result-item.active{background:#e5e5e5;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;color:#333;text-shadow:none}li.as-result-item em{background:0 0!important;color:#333!important;font-size:12px;padding:0!important}.fl-loop-builder-filter{display:none}.fl-builder-service-settings{position:relative}.fl-builder-service-error{color:red!important;padding:15px 0 0}.fl-builder-service-account-delete{color:red!important;margin-left:10px;position:relative;top:2px}.fl-builder-service-connect-row .fl-field-description{background:#f0f0f0;color:#333!important;display:block;float:none;margin:10px 0 0;padding:10px}.fl-builder-service-connect-row .fl-field-description a{color:#21759b!important;text-decoration:underline!important}.fl-builder-getting-started-video{line-height:0!important;padding:10px}.fl-builder-getting-started-video iframe{border:none;height:326px;width:100%}.fl-builder-tour-actions .fl-builder-actions-title{font-size:14px!important;line-height:19px}.fl-builder-tour-mask{bottom:0;left:0;position:fixed;right:0;top:0;z-index:100000000}.fl-builder-tour-dimmed{background:rgba(0,0,0,.7);bottom:0;left:0;position:absolute;right:0;top:0}body>.fl-builder-tour-dimmed{position:fixed}.tour-backdrop{z-index:110000}.popover[class*=tour-]{border:1px solid #ccc;border-radius:0;-webkit-box-shadow:0 0 30px rgba(0,0,0,.3);box-shadow:0 0 40px rgba(0,0,0,.3);color:#666;font-size:13px;font-weight:400;line-height:18px;max-width:none;padding:0;width:300px;z-index:100000001}.popover[class*=tour-].bottom>.arrow{border-bottom-color:#ccc}.popover[class*=tour-].bottom>.arrow:after{border-bottom-color:#f7f7f7}.popover[class*=tour-] .popover-title{border-radius:0;color:#333;letter-spacing:normal;text-transform:none}.popover[class*=tour-] .fa-times{color:#b3b3b3;cursor:pointer;font-size:16px;padding:5px;position:absolute;right:3px;top:2px}.popover[class*=tour-] .fa-times:hover{color:#666}.popover[class*=tour-] .popover-content{border-bottom:1px solid #d9d9d9;padding:13px 15px}.popover[class*=tour-] .fl-builder-tour-next{display:block;float:none;width:100%}.fl-builder-shortcode-mask-wrap{position:relative}.fl-builder-shortcode-mask{bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fl-color-picker-ui .iris-picker{width:200px;height:215px;display:block;position:relative;border-top:1px solid rgba(0,0,0,.1)}.fl-color-picker-ui .iris-picker .iris-square-inner,.fl-color-picker-ui .iris-picker-inner{position:absolute;left:0;top:0;bottom:0;right:0}.fl-color-picker-ui .iris-picker,.iris-picker *{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.fl-color-picker-ui .iris-error{background-color:#ffafaf}.fl-color-picker-ui .iris-picker .iris-square{width:200px;height:200px}.fl-color-picker-ui .iris-picker .iris-palette,.fl-color-picker-ui .iris-picker .iris-slider,.fl-color-picker-ui .iris-picker .iris-square-inner{height:100%;width:12.5%}.fl-color-picker-ui .iris-picker .iris-placeholder,.fl-color-picker-ui .iris-picker .iris-square{position:relative}.fl-color-picker-ui .iris-picker .iris-square-inner{width:auto;margin:0}.fl-color-picker-ui .iris-ie-9 .iris-palette,.fl-color-picker-ui .iris-ie-9 .iris-slider,.fl-color-picker-ui .iris-ie-9 .iris-square,.fl-color-picker-ui .iris-ie-9 .iris-square-inner{box-shadow:none;border-radius:0}.fl-color-picker-ui .iris-ie-9 .iris-palette,.fl-color-picker-ui .iris-ie-9 .iris-slider,.fl-color-picker-ui .iris-ie-9 .iris-square{outline:rgba(0,0,0,.1) solid 1px}.fl-color-picker-ui .iris-ie-lt9 .iris-palette,.fl-color-picker-ui .iris-ie-lt9 .iris-slider,.fl-color-picker-ui .iris-ie-lt9 .iris-square,.fl-color-picker-ui .iris-ie-lt9 .iris-square-inner{outline:#999 solid 1px}.fl-color-picker-ui .iris-ie-lt9 .iris-square .ui-slider-handle{outline:#999 solid 1px;background-color:#fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"}.fl-color-picker-ui .iris-ie-lt9 .iris-square .iris-square-handle{background:0 0;border:3px solid #fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"}.fl-color-picker-ui .iris-picker .iris-strip{width:200px;margin-top:5px;position:relative;height:10px;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fl-color-picker-ui .iris-picker .iris-strip .ui-slider-handle{width:6px;position:absolute;right:0;top:-2px;bottom:-2px;margin:0;border-radius:3px;background:#fff;box-shadow:0 0 2px rgba(0,0,0,.5);z-index:5;cursor:ew-resize}.fl-color-picker-ui .iris-picker .iris-slider-offset{position:absolute;top:0;left:6px;right:0;bottom:0;width:auto;height:auto;background:0 0;border:none;border-radius:0;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fl-color-picker-ui .iris-picker .iris-square-handle{background:0 0;border:5px solid #999;border-radius:50%;border-color:rgba(128,128,128,.5);box-shadow:none;width:12px;height:12px;position:absolute;left:-10px;top:-10px;cursor:move;opacity:1;z-index:10}.fl-color-picker-ui .iris-picker .ui-state-focus .iris-square-handle{opacity:.8}.fl-color-picker-ui .iris-picker .iris-square-handle:hover{border-color:#999}.fl-color-picker-ui .iris-picker .iris-square-value:focus .iris-square-handle{box-shadow:0 0 2px rgba(0,0,0,.75);opacity:.8}.fl-color-picker-ui .iris-picker .iris-square-handle:hover::after{border-color:#fff}.fl-color-picker-ui .iris-picker .iris-square-handle::after{position:absolute;bottom:-4px;right:-4px;left:-4px;top:-4px;border:3px solid #f9f9f9;border-color:rgba(255,255,255,.8);border-radius:50%;content:" "}.fl-color-picker-clear,.fl-color-picker-color{float:left;border:1px solid rgba(0,0,0,.1);cursor:pointer}.fl-color-picker-ui .iris-picker .iris-square-value{width:8px;height:8px;position:absolute}.iris-ie-lt9 .iris-square-value,.iris-mozilla .iris-square-value{width:1px;height:1px}.fl-color-picker-wrapper{position:relative;width:48px;height:32px}.fl-color-picker-color{position:relative;width:30px;height:30px;background-color:transparent}.fl-color-picker-color.fl-color-picker-empty{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABG2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS4xLjIiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgo8P3hwYWNrZXQgZW5kPSJyIj8+MahxaQAAAAlwSFlzAAALEwAACxMBAJqcGAAACk9pQ0NQUGhvdG9zaG9wIElDQyBwcm9maWxlAAB42p1TZ1RT6RY99970QkuIgJRLb1IVCCBSQouAFJEmKiEJEEqIIaHZFVHBEUVFBBvIoIgDjo6AjBVRLAyKCtgH5CGijoOjiIrK++F7o2vWvPfmzf611z7nrPOds88HwAgMlkgzUTWADKlCHhHgg8fExuHkLkCBCiRwABAIs2Qhc/0jAQD4fjw8KyLAB74AAXjTCwgAwE2bwDAch/8P6kKZXAGAhAHAdJE4SwiAFABAeo5CpgBARgGAnZgmUwCgBABgy2Ni4wBQLQBgJ3/m0wCAnfiZewEAW5QhFQGgkQAgE2WIRABoOwCsz1aKRQBYMAAUZkvEOQDYLQAwSVdmSACwtwDAzhALsgAIDAAwUYiFKQAEewBgyCMjeACEmQAURvJXPPErrhDnKgAAeJmyPLkkOUWBWwgtcQdXVy4eKM5JFysUNmECYZpALsJ5mRkygTQP4PPMAACgkRUR4IPz/XjODq7OzjaOtg5fLeq/Bv8iYmLj/uXPq3BAAADhdH7R/iwvsxqAOwaAbf6iJe4EaF4LoHX3i2ayD0C1AKDp2lfzcPh+PDxFoZC52dnl5OTYSsRCW2HKV33+Z8JfwFf9bPl+PPz39eC+4iSBMl2BRwT44MLM9EylHM+SCYRi3OaPR/y3C//8HdMixEliuVgqFONREnGORJqM8zKlIolCkinFJdL/ZOLfLPsDPt81ALBqPgF7kS2oXWMD9ksnEFh0wOL3AADyu2/B1CgIA4Bog+HPd//vP/1HoCUAgGZJknEAAF5EJC5UyrM/xwgAAESggSqwQRv0wRgswAYcwQXcwQv8YDaEQiTEwkIQQgpkgBxyYCmsgkIohs2wHSpgL9RAHTTAUWiGk3AOLsJVuA49cA/6YQiewSi8gQkEQcgIE2Eh2ogBYopYI44IF5mF+CHBSAQSiyQgyYgUUSJLkTVIMVKKVCBVSB3yPXICOYdcRrqRO8gAMoL8hrxHMZSBslE91Ay1Q7moNxqERqIL0GR0MZqPFqCb0HK0Gj2MNqHn0KtoD9qPPkPHMMDoGAczxGwwLsbDQrE4LAmTY8uxIqwMq8YasFasA7uJ9WPPsXcEEoFFwAk2BHdCIGEeQUhYTFhO2EioIBwkNBHaCTcJA4RRwicik6hLtCa6EfnEGGIyMYdYSCwj1hKPEy8Qe4hDxDckEolDMie5kAJJsaRU0hLSRtJuUiPpLKmbNEgaI5PJ2mRrsgc5lCwgK8iF5J3kw+Qz5BvkIfJbCp1iQHGk+FPiKFLKakoZ5RDlNOUGZZgyQVWjmlLdqKFUETWPWkKtobZSr1GHqBM0dZo5zYMWSUulraKV0xpoF2j3aa/odLoR3ZUeTpfQV9LL6Ufol+gD9HcMDYYVg8eIZygZmxgHGGcZdxivmEymGdOLGcdUMDcx65jnmQ+Zb1VYKrYqfBWRygqVSpUmlRsqL1Spqqaq3qoLVfNVy1SPqV5Tfa5GVTNT46kJ1JarVaqdUOtTG1NnqTuoh6pnqG9UP6R+Wf2JBlnDTMNPQ6RRoLFf47zGIAtjGbN4LCFrDauGdYE1xCaxzdl8diq7mP0du4s9qqmhOUMzSjNXs1LzlGY/B+OYcficdE4J5yinl/N+it4U7yniKRumNEy5MWVca6qWl5ZYq0irUatH6702ru2nnaa9RbtZ+4EOQcdKJ1wnR2ePzgWd51PZU92nCqcWTT069a4uqmulG6G7RHe/bqfumJ6+XoCeTG+n3nm95/ocfS/9VP1t+qf1RwxYBrMMJAbbDM4YPMU1cW88HS/H2/FRQ13DQEOlYZVhl+GEkbnRPKPVRo1GD4xpxlzjJONtxm3GoyYGJiEmS03qTe6aUk25pimmO0w7TMfNzM2izdaZNZs9Mdcy55vnm9eb37dgWnhaLLaotrhlSbLkWqZZ7ra8boVaOVmlWFVaXbNGrZ2tJda7rbunEae5TpNOq57WZ8Ow8bbJtqm3GbDl2AbbrrZttn1hZ2IXZ7fFrsPuk72Tfbp9jf09Bw2H2Q6rHVodfnO0chQ6Vjrems6c7j99xfSW6S9nWM8Qz9gz47YTyynEaZ1Tm9NHZxdnuXOD84iLiUuCyy6XPi6bG8bdyL3kSnT1cV3hetL1nZuzm8LtqNuv7jbuae6H3J/MNJ8pnlkzc9DDyEPgUeXRPwuflTBr36x+T0NPgWe15yMvYy+RV63XsLeld6r3Ye8XPvY+cp/jPuM8N94y3llfzDfAt8i3y0/Db55fhd9DfyP/ZP96/9EAp4AlAWcDiYFBgVsC+/h6fCG/jj8622X2stntQYyguUEVQY+CrYLlwa0haMjskK0h9+eYzpHOaQ6FUH7o1tAHYeZhi8N+DCeFh4VXhj+OcIhYGtExlzV30dxDc99E+kSWRN6bZzFPOa8tSjUqPqouajzaN7o0uj/GLmZZzNVYnVhJbEscOS4qrjZubL7f/O3zh+Kd4gvjexeYL8hdcHmhzsL0hacWqS4SLDqWQEyITjiU8EEQKqgWjCXyE3cljgp5wh3CZyIv0TbRiNhDXCoeTvJIKk16kuyRvDV5JMUzpSzluYQnqZC8TA1M3Zs6nhaadiBtMj06vTGDkpGQcUKqIU2TtmfqZ+ZmdsusZYWy/sVui7cvHpUHyWuzkKwFWS0KtkKm6FRaKNcqB7JnZVdmv82JyjmWq54rze3Ms8rbkDec75//7RLCEuGStqWGS1ctHVjmvaxqObI8cXnbCuMVBSuGVgasPLiKtipt1U+r7VeXrn69JnpNa4FewcqCwbUBa+sLVQrlhX3r3NftXU9YL1nftWH6hp0bPhWJiq4U2xeXFX/YKNx45RuHb8q/mdyUtKmrxLlkz2bSZunm3i2eWw6Wqpfmlw5uDdnatA3fVrTt9fZF2y+XzSjbu4O2Q7mjvzy4vGWnyc7NOz9UpFT0VPpUNu7S3bVh1/hu0e4be7z2NOzV21u89/0+yb7bVQFVTdVm1WX7Sfuz9z+uiarp+Jb7bV2tTm1x7ccD0gP9ByMOtte51NUd0j1UUo/WK+tHDscfvv6d73ctDTYNVY2cxuIjcER55On3Cd/3Hg062naMe6zhB9Mfdh1nHS9qQprymkabU5r7W2Jbuk/MPtHW6t56/EfbHw+cNDxZeUrzVMlp2umC05Nn8s+MnZWdfX4u+dxg26K2e+djzt9qD2/vuhB04dJF/4vnO7w7zlzyuHTystvlE1e4V5qvOl9t6nTqPP6T00/Hu5y7mq65XGu57nq9tXtm9+kbnjfO3fS9efEW/9bVnjk93b3zem/3xff13xbdfnIn/c7Lu9l3J+6tvE+8X/RA7UHZQ92H1T9b/tzY79x/asB3oPPR3Ef3BoWDz/6R9Y8PQwWPmY/Lhg2G6544Pjk54j9y/en8p0PPZM8mnhf+ov7LrhcWL3741evXztGY0aGX8peTv218pf3qwOsZr9vGwsYevsl4MzFe9Fb77cF33Hcd76PfD0/kfCB/KP9o+bH1U9Cn+5MZk5P/BAOY8/xjMy3bAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAGbSURBVHjajNO/S1VxGMfx9+ebQ6FiImkOgatTDYlKXgfPgVAbHRpt6U/oH6jmHAPH2gOX2vx1URCaWoKGhhQ1hKsJLnqeT8sxTveeSz3bFx5ez/f58vkqyzL+pyQhiYhYsL0i6bIoiuf6B/AIENCUBPAUWAX6AGx/6wpIyoEPJTBhewxYk9Rz3RMRXYEeSevATHneB/qBgcqAi4hY6gAkYVvApKS3wP2aAYWk5Yh4rzzPKff7U7axfQP4LKkdOJb0zPZH23QAtpE0FBGbwLmkV7ZfV6AD29PAD6AWGLa9JSlJemj7l6THtj9VbnFuexHYbgcGbe+UjzgLHNq+DawBt4BeYBy4sj33FxARA8BeOblh+0jSsO0mcAk8sD0u6Q3w0vZGdYWhiGgCKaXUAH7aHikDFMAU0IqIzrzkeX6nsvOU7Zak0YjYklRImgZaZXBqgW3gXtl4aHsQ2AWSpAZwXEleJ5Bl2feU0rztr5WdQ9IMcFJt7naDL5JeAKcR8S6ldAVM2j5rD1g3YB24C9wEDiQ9AU7rPkgd8HsAv5vXzUui544AAAAASUVORK5CYII=) center center no-repeat}.fl-color-picker-clear{position:relative;display:block;width:17px;height:30px;border-left:none;background-color:#FAFAFA}.fl-color-picker-color.fl-color-picker-empty+.fl-color-picker-clear{display:none}.fl-color-picker-ui{display:inline-block;z-index:999999;position:fixed;overflow:hidden;padding-bottom:45px;border:1px solid rgba(0,0,0,.1);color:#999;background-color:#FAFAFA;border-radius:3px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1);-webkit-transition:opacity .2s,visibility .2s;-moz-transition:opacity .2s,visibility .2s;-ms-transition:opacity .2s,visibility .2s;-o-transition:opacity .2s,visibility .2s;transition:opacity .2s,visibility .2s;visibility:hidden;opacity:0;-webkit-transform:translate3d(0,0,0)}.fl-color-picker-ui.fl-color-picker-active{visibility:visible;opacity:1}.fl-color-picker-ui .fl-color-picker-input,.fl-color-picker-ui .fl-color-picker-input:focus{width:100%;height:30px;border:none!important;font-size:14px!important;padding:0 8px;vertical-align:middle;color:#999;background-color:#fff;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.fl-color-picker-ui .iris-square-value{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none}.fl-color-picker-preset-add{position:absolute;top:8px;right:8px;width:14px;height:14px;background-color:#999;border-radius:50%;cursor:pointer;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s}.fl-color-picker-preset-add:hover{background-color:#333}.fl-color-picker-preset-add:after,.fl-color-picker-preset-add:before{content:'';display:block;position:relative;background-color:#fff}.fl-color-picker-preset-add:before{top:6px;left:3px;width:8px;height:2px}.fl-color-picker-preset-add:after{left:6px;top:1px;width:2px;height:8px}.fl-color-picker-presets{position:absolute;left:0;bottom:0;width:100%;z-index:15;overflow:auto;border-top:1px solid rgba(0,0,0,.1);background-color:#FAFAFA}.fl-color-picker-presets-list .fl-color-picker-preset:hover,.fl-color-picker-presets-toggle:hover{background-color:#EDEDED}.fl-color-picker-presets-toggle{position:relative;overflow:hidden;width:100%;height:35px;text-align:center;line-height:35px;font-size:12px;font-weight:700;cursor:pointer;-webkit-transition:all .1s;-moz-transition:all .1s;-ms-transition:all .1s;-o-transition:all .1s;transition:all .1s}.fl-color-picker-presets-close-label,.fl-color-picker-presets-open-label{position:absolute;top:50%;left:50%;visibility:hidden;color:#999;-webkit-transition:all .5s;-moz-transition:all .5s;-ms-transition:all .5s;-o-transition:all .5s;transition:all .5s;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0}.fl-color-picker-presets-close-label.fl-color-picker-active,.fl-color-picker-presets-open-label.fl-color-picker-active{color:#999;visibility:visible;opacity:1}.fl-color-picker-presets-list{width:100%;list-style:none;margin:0;padding:0;overflow:auto}.fl-color-picker-presets-list .fl-color-picker-no-preset,.fl-color-picker-presets-list .fl-color-picker-preset{position:relative;padding:5px;font-size:12px;border-top:1px solid rgba(0,0,0,.1);-webkit-transition:all .1s;-moz-transition:all .1s;-ms-transition:all .1s;-o-transition:all .1s;transition:all .1s}.fl-color-picker-presets-list .fl-color-picker-preset-color{display:inline-block;width:20px;height:20px;margin-right:3px;vertical-align:middle;border:1px solid rgba(0,0,0,.1);border-radius:2px;cursor:pointer}.fl-color-picker-presets-list .fl-color-picker-preset-label{vertical-align:middle;color:#999}.fl-color-picker-clear .fl-color-picker-icon-remove,.fl-color-picker-presets-list .fl-color-picker-preset-remove{position:absolute;top:50%;cursor:pointer;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%)}.fl-color-picker-clear .fl-color-picker-icon-remove{right:0}.fl-color-picker-presets-list .fl-color-picker-preset-remove{right:5px}.fl-color-picker-presets-list .fl-color-picker-preset-remove:hover:after,.fl-color-picker-presets-list .fl-color-picker-preset-remove:hover:before{background-color:#333}.fl-color-picker-added{position:absolute;width:100%;top:0;left:0;right:0;bottom:35px;z-index:10;color:#fff;text-align:center;background-color:rgba(0,0,0,.6)}.fl-color-picker-added-text{position:absolute;top:50%;left:50%;width:80%;font-size:14px;color:#fff!important;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.fl-color-picker-icon-check{position:relative;width:50px;height:50px;margin:5px auto}.fl-color-picker-icon-check:before{content:'';display:block;position:relative;width:15px;height:30px;margin-left:14px;border:7px solid #fff;border-left:none;border-top:none;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.fl-color-picker-icon-arrow-down,.fl-color-picker-icon-arrow-up{display:inline-block;position:relative;width:10px;height:10px;margin-left:5px}.fl-color-picker-icon-arrow-down:before,.fl-color-picker-icon-arrow-up:before{content:'';display:block;position:relative;width:6px;height:6px;border:2px solid #999;border-left:none;border-top:none;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.fl-color-picker-icon-arrow-up{top:2px;-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fl-color-picker-icon-remove{width:15px;height:15px}.fl-color-picker-icon-remove:after,.fl-color-picker-icon-remove:before{content:'';display:block;position:relative;background-color:#999}.fl-color-picker-icon-remove:before{left:6px;width:2px;height:10px;margin-top:3px;background:#999;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.fl-color-picker-icon-remove:after{left:6px;width:2px;height:10px;margin-top:-10px;background:#999;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.fl-icons-filter input,.fl-icons-filter select{vertical-align:middle;width:160px}.fl-icon-selector .fl-lightbox{height:100%}.fl-icons-filter{height:auto!important;margin:0!important;position:absolute!important;right:10px;top:10px}.fl-icons-filter input{line-height:18px}.fl-icons-list{bottom:52px;left:0;overflow:auto;padding:20px;position:absolute;right:0;top:48px}.fl-icons-list::-webkit-scrollbar{background-color:#ccc;-webkit-appearance:none;width:10px}.fl-icons-list::-webkit-scrollbar-thumb{background-color:#666;border:1px solid #ccc}.fl-icons-section{text-align:center}.fl-icons-section h2{border-bottom:1px solid #dfdfdf;color:#333!important;font-family:Helvetica,Verdana,sans-serif!important;font-size:16px!important;font-weight:700!important;margin:0 0 20px!important;padding:0 0 10px!important;text-align:left}.fl-icons-list i,.fl-icons-list i:before{cursor:pointer;display:inline-block;font-size:32px;height:80px;line-height:80px;width:80px}.fl-icons-list i:hover{background:#e5e5e5}.fl-icon-selector-footer{bottom:0;left:0;position:absolute;right:0}.fl-lightbox-mask,.fl-lightbox-wrap{bottom:0;left:0;position:fixed;right:0;top:0}.fl-lightbox-wrap{display:none;overflow:auto;padding:30px;z-index:100010;-webkit-backface-visibility:hidden;-webkit-transform:translateZ(0)}.fl-lightbox-wrap.fl-icon-selector{z-index:100011}.fl-lightbox-mask{background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100010}.fl-lightbox,.fl-lightbox-header{background:#fff;position:relative}.fl-lightbox{box-shadow:rgba(0,0,0,1) 0 4px 30px;-moz-box-shadow:rgba(0,0,0,1) 0 4px 30px;-webkit-box-shadow:rgba(0,0,0,1) 0 4px 30px;z-index:100011}.fl-lightbox :not(i){color:#333;font-family:Helvetica,Verdana,sans-serif;font-size:12px;line-height:16px;text-decoration:none;text-transform:none}.fl-lightbox *,.fl-lightbox :after,.fl-lightbox :before{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.fl-lightbox .fl-nanoscroller-pane{bottom:4px;right:4px;width:8px}.fl-lightbox .fa{font-family:FontAwesome}.fl-lightbox-content-wrap{height:100%}.fl-lightbox.ui-draggable{box-shadow:rgba(0,0,0,.5) 0 4px 30px;-moz-box-shadow:rgba(0,0,0,.5) 0 4px 30px;-webkit-box-shadow:rgba(0,0,0,.5) 0 4px 30px}.fl-lightbox-header{border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,.1);-moz-box-shadow:0 4px 4px -4px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 4px -4px rgba(0,0,0,.1)}.fl-lightbox-header h1{color:#333!important;font-size:18px!important;font-family:Helvetica,Verdana,sans-serif!important;font-weight:300!important;margin:0!important;padding:15px 20px!important}.fl-lightbox.ui-draggable .fl-lightbox-header{cursor:move}.fl-lightbox-footer{border-top:1px solid #dfdfdf;box-shadow:0 -4px 4px -4px rgba(0,0,0,.1);-moz-box-shadow:0 -4px 4px -4px rgba(0,0,0,.1);-webkit-box-shadow:0 -4px 4px -4px rgba(0,0,0,.1);padding:10px;text-align:right}.fl-lightbox-footer .fl-builder-button{margin-left:5px!important}
1
+ .fl-builder-edit #wpadminbar,.fl-builder-hidden-editor{display:none}table{border-collapse:inherit!important}html.fl-builder-edit{margin-top:43px!important}.fl-builder-edit body{position:static!important}.fl-clear{clear:both}.fl-builder-loading{background:url(../img/ajax-loader.gif) center center no-repeat rgba(240,240,240,.8);bottom:0;display:none;left:0;position:fixed;right:0;text-align:center;top:0;z-index:200000}.fl-builder-settings .fl-builder-loading{background:url(../img/ajax-loader.gif) center center no-repeat rgba(255,255,255,.8);display:block;position:absolute}#tiptip_holder{z-index:200000}.screen-reader-text{position:absolute;left:-1000em;top:-1000em;height:1px;width:1px;overflow:hidden}.fl-visible-desktop,.fl-visible-desktop-medium,.fl-visible-medium,.fl-visible-medium-mobile,.fl-visible-mobile{display:block!important}.fl-builder-button{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top;display:inline-block;text-decoration:none;font-size:13px!important;line-height:13px!important;height:28px;margin:0;padding:7px 10px;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important;box-sizing:border-box!important}.fl-builder-button:hover{background:#fafafa;border-color:#999;color:#222}.fl-builder-button-primary{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff!important;text-decoration:none}.fl-builder-button-primary:hover{background:#1e8cbe;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff!important}.fl-builder-button-large{height:30px;line-height:30px!important;padding:0 12px 2px}.fl-builder-button-small{font-size:11px!important;line-height:11px!important;height:24px}.fl-builder-help-button{color:#b3b3b3;font-size:16px!important}.fl-builder-help-button i{position:relative;top:-1px}.fl-builder-help-button:hover{color:#666}.fl-builder-publish-button{height:45px;line-height:45px!important}.fl-builder-badge{background:#333;border-radius:2px;color:#fff!important;display:inline;font-size:11px!important;font-weight:400;letter-spacing:1px;margin-left:2px;padding:2px 4px;vertical-align:top}.fl-builder-badge-global{background:#ff9600}.fl-builder-has-submenu{position:relative}.fl-builder-has-submenu>ul.fl-builder-submenu.fl-block-col-submenu{background:#3ba0ff;box-shadow:0 0 20px rgba(0,0,0,.2);display:none;left:0;list-style:none;margin:0;padding:6px 0;position:absolute;text-align:left;top:100%;width:155px;z-index:100008}.fl-builder-has-submenu>ul.fl-builder-submenu.fl-block-col-submenu li{list-style:none;margin:0;padding:0}.fl-builder-submenu-right ul.fl-builder-submenu.fl-block-col-submenu{left:auto;right:0}.fl-builder-submenu-open ul.fl-builder-submenu.fl-block-col-submenu{display:block}.fl-builder-has-submenu>ul.fl-builder-submenu.fl-block-col-submenu li a{border-bottom:0 none;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;color:#fff!important;display:block;line-height:13px;font-size:13px;font-family:Helvetica,Verdana,sans-serif;font-weight:400;opacity:.8;filter:alpha(opacity=80);padding:6px 12px;text-decoration:none}.fl-builder-has-submenu>ul.fl-builder-submenu li a:hover{background:#54acff;color:#fff;opacity:1;filter:alpha(opacity=100);text-decoration:none}.fl-builder-bar-content,.fl-builder-panel{color:#999;font-family:Helvetica,Verdana,sans-serif}.fl-block-overlay-global ul.fl-builder-submenu{background:#ff9600}.fl-block-overlay-global ul.fl-builder-submenu li a:hover{background:#fa3}.fl-builder-bar{left:0;position:fixed;right:0;top:0;z-index:100008}.fl-builder-bar-content{background:#f4f4f4;border-bottom:1px solid #ccc;box-shadow:0 0 8px rgba(0,0,0,.2);-moz-box-shadow:0 0 8px rgba(0,0,0,.2);-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);font-size:14px;height:43px}.fl-builder-bar-title{color:#333;display:block;float:left;font-size:20px;font-weight:300;line-height:20px;padding:7px 10px}.fl-builder-bar-title img{height:30px!important;margin:0 1px 0 0!important;vertical-align:middle!important}.fl-builder-bar-title span{vertical-align:middle}.fl-builder-bar-title.fl-builder-bar-title-no-icon{padding:12px}.fl-builder-bar-actions{float:right;padding:7px}.fl-builder-bar .fl-builder-button{float:right;margin:0 0 0 6px}.fl-builder-bar .fl-builder-add-content-button{display:none}.fl-builder-buy-button,.fl-builder-upgrade-button{background:#f7951e;border-color:#de7c04;-webkit-box-shadow:inset 0 1px 0 rgba(255,177,82,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,177,82,.5),0 1px 0 rgba(0,0,0,.15);color:#fff!important;text-decoration:none}.fl-builder-buy-button i.fa-external-link-square,.fl-builder-upgrade-button i.fa-external-link-square{color:#f4d1a7;margin:0 0 0 6px}.fl-builder-buy-button:hover,.fl-builder-upgrade-button:hover{background:#de861b;border-color:#c46e04;-webkit-box-shadow:inset 0 1px 0 rgba(255,177,82,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,177,82,.5),0 1px 0 rgba(0,0,0,.15);color:#fff!important}.fl-builder-panel{background:#f0f0f0;border-left:1px solid #ccc;bottom:0;box-shadow:0 0 8px rgba(0,0,0,.2);-moz-box-shadow:0 0 8px rgba(0,0,0,.2);-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);font-size:14px;opacity:1;position:fixed;right:0;top:43px;width:300px;z-index:100007;-webkit-transform:translateZ(0);transition:opacity .2s;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;-ms-transition:opacity .2s;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fl-block-col-resize-feedback,.fl-builder-drop-zone,.fl-builder-empty{font-family:Helvetica,Verdana,sans-serif!important}.fl-builder-panel-actions{background:#f4f4f4;border-bottom:1px solid #dbdbdb;height:43px;left:0;position:absolute;right:0;top:0;text-align:right;z-index:100009}.fl-builder-panel-actions .fl-builder-panel-close{color:#bfbfbf;cursor:pointer;float:left;font-size:18px;margin:12px 18px}.fl-builder-panel-actions .fl-builder-panel-close:hover{color:#333}.fl-builder-panel-content-wrap{bottom:0;height:auto;left:0;overflow:hidden;position:absolute;right:0;top:43px}.fl-builder-panel-content{padding-bottom:60px}.fl-builder-blocks-section .fl-builder-block,.fl-builder-blocks-section .fl-builder-blocks-section-title{cursor:pointer;display:block;line-height:14px;padding:15px 20px}.fl-builder-blocks-section .fl-builder-blocks-section-title{border-bottom:1px solid #dfdfdf;color:#333;font-weight:400}.fl-builder-blocks-section .fl-builder-blocks-section-title i{color:#bfbfbf;float:right}.fl-builder-blocks-section .fl-builder-blocks-section-title:hover,.fl-builder-blocks-section .fl-builder-blocks-section-title:hover i{background:#e5e5e5}.fl-builder-blocks-section-content{background:#fff;display:none}.fl-builder-blocks-section.fl-active .fl-builder-blocks-section-content{display:block}.fl-builder-blocks-section-content .fl-builder-block{border-bottom:1px solid #ebebeb;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fl-builder-blocks-section-content .fl-builder-block i{color:#d9d9d9;margin-right:10px}.fl-builder-blocks-section-content .fl-builder-block:hover{background:#0074a1;color:#fff;cursor:move}.fl-builder-blocks-separator{background:#dfdfdf;height:6px}.fl-builder-block:hover .fl-builder-badge{background:#2ea2cc}.ui-sortable-helper .fl-builder-badge{display:none!important}.fl-builder-modules-cta a{color:#999!important;display:block!important;font-size:12px!important;font-style:italic!important;padding:15px 20px!important;line-height:16px!important}.fl-builder-modules-cta a:hover{background:#e5e5e5!important;color:#666!important;text-decoration:none!important}.fl-builder-modules-cta a:focus{text-decoration:none!important}.fl-builder-modules-cta .fa{float:right!important;font-size:14px!important;margin:3px 0 0 9px!important}.fl-builder-block-template-image{margin:5px 0 10px;max-width:100%}.fl-photo-field .fl-photo-preview-img img,.fl-video-field .fl-video-preview-img img{max-width:60px}.fl-builder-block-template .fl-builder-block-title{display:block}.ui-sortable-helper .fl-builder-block-template-image{display:none!important}span.fl-builder-block-no-node-templates{display:block;padding:15px 20px}span.fl-builder-block-no-node-templates:hover{cursor:default;background:#fff}.fl-builder-blocks-node-template .fl-builder-block{position:relative}.fl-builder-blocks-section-content .fl-builder-node-template-actions{bottom:0;cursor:default;display:none;position:absolute;right:0;top:0;width:72px}.fl-builder-blocks-section-content .fl-builder-node-template-delete,.fl-builder-blocks-section-content .fl-builder-node-template-edit{bottom:0;cursor:pointer;margin:0;padding:15px 0;position:absolute;text-align:center;top:0;width:30px}.fl-builder-blocks-section-content .fl-builder-node-template-delete{right:12px}.fl-builder-blocks-section-content .fl-builder-node-template-edit{right:42px}.fl-builder-blocks-section-content .fl-builder-node-template-delete i,.fl-builder-blocks-section-content .fl-builder-node-template-edit i{margin:0}.fl-builder-blocks-section-content .fl-builder-node-template-delete:hover i,.fl-builder-blocks-section-content .fl-builder-node-template-edit:hover i{color:#fff}.fl-builder-blocks-node-template .fl-builder-block:hover{padding-right:85px}.fl-builder-blocks-node-template .fl-builder-block:hover .fl-builder-node-template-actions{display:block}.ui-sortable-helper .fl-builder-node-template-delete,.ui-sortable-helper .fl-builder-node-template-edit{display:none!important}.fl-builder-empty{border:1px dashed #3ba0ff;color:#3ba0ff;font-size:14px;margin:10px;padding:100px 20px;text-align:center;text-transform:uppercase}.fl-builder-empty .fl-builder-drop-zone{margin:10px}.fl-builder-block-drag-helper,.fl-builder-block.ui-draggable-dragging{background:#fff!important;border:1px solid #ccc;box-shadow:0 0 8px rgba(0,0,0,.2);-moz-box-shadow:0 0 8px rgba(0,0,0,.2);-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);color:#999!important;font-family:Helvetica,Verdana,sans-serif!important;font-size:14px!important;height:45px!important;line-height:42px!important;overflow:hidden;padding:0 18px;position:fixed!important;text-overflow:ellipsis;white-space:nowrap;width:140px!important;z-index:100010}.fl-builder-drop-zone{background:#3ba0ff;color:#fff;display:block;font-weight:700;font-size:14px;margin:10px;padding:10px;text-shadow:none}.fl-builder-drop-zone-global{background:#ff9600}.fl-builder-content>.fl-builder-drop-zone{margin:10px 20px}.fl-row-content>.fl-builder-drop-zone{margin:5px}.fl-row-highlight{padding:5px 0}.fl-row-highlight .fl-row-content{border:1px dashed red;padding:5px}.fl-col-highlight{padding:15px 5px}.fl-col-highlight .fl-col-content{border-style:dashed;border-color:#3ba0ff;min-height:100px;border-width:1px}.fl-col-highlight.fl-node-global .fl-col-content{border-color:#ff9600}.fl-builder-simple .fl-col-highlight .fl-col-content{border:none}.fl-block-overlay,.fl-block-overlay *{text-shadow:none}.fl-block-overlay-active{position:relative}.fl-block-overlay-actions{background:#3ba0ff;float:left;margin:0 -1px;text-shadow:none}.fl-block-overlay-actions>span{display:block;float:left}.fl-block-overlay-actions i{color:#fff!important;cursor:pointer;display:block!important;float:left;font-size:14px!important;height:28px!important;font-weight:100!important;line-height:28px!important;opacity:.8;filter:alpha(opacity=80);text-align:center;width:28px!important}.fl-block-overlay-actions i:hover{opacity:1;filter:alpha(opacity=100)}.fl-block-overlay-actions>i:first-child{padding-left:4px}.fl-block-overlay-actions>i:last-child{padding-right:2px}.fl-block-overlay-actions i.fl-block-move{cursor:move}.fl-block-overlay-title{border-right:1px solid #5eb1ff;color:#fff!important;float:left;font-family:Helvetica,Verdana,sans-serif;font-size:13px;height:30px;line-height:29px;margin-right:2px;padding:0 8px}.fl-row-overlay{background:rgba(59,160,255,.15);border:1px solid #3ba0ff;bottom:0;box-sizing:border-box!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;color:#fff;left:0;position:absolute;top:-30px;width:100%;z-index:100006}.fl-row-overlay-header-bottom{bottom:-30px;top:0}.fl-row-overlay-header-bottom .fl-block-overlay-header{position:absolute;bottom:0}.fl-block-overlay-active .fl-row-content-wrap{position:relative}.fl-block-overlay-active .fl-row-content{position:relative;z-index:100007!important}.fl-col-overlay,.fl-module-overlay{background:rgba(59,160,255,.15);border:1px solid #3ba0ff;cursor:pointer;color:#fff;position:absolute}.fl-col-overlay{bottom:15px;left:5px;right:5px;top:15px;z-index:100007}.fl-module-overlay{bottom:4px;left:4px;min-height:32px;right:4px;top:4px;z-index:100007}.fl-builder-global-templates-locked .fl-block-overlay-global.fl-module-overlay{cursor:default}.fl-module-adjust-height{padding-bottom:15px;padding-top:15px}.fl-block-overlay-global{background:rgba(255,150,0,.1);border:1px solid #ff9600}.fl-block-overlay-global .fl-block-overlay-actions{background:#ff9600}.fl-block-overlay-global .fl-block-overlay-title{border-right:1px solid #ffcf66}.fl-block-overlay-title-global{background:#fff;border-radius:2px;color:#ff9600!important;font-size:11px;letter-spacing:1px;margin-left:4px;padding:2px 4px;vertical-align:top}.fl-block-overlay-global.fl-row-overlay{background:rgba(255,150,0,.3);cursor:pointer;z-index:100007}.fl-builder-global-templates-locked .fl-block-overlay-global.fl-row-overlay{cursor:default}.fl-builder-row-template .fl-block-overlay-global.fl-row-overlay{background:rgba(255,150,0,.1);cursor:default;z-index:100006}.fl-block-overlay-muted .fl-row-overlay{background:rgba(153,153,153,.1);border:1px solid #8c8c8c}.fl-block-overlay-muted .fl-row-overlay .fl-block-overlay-actions{background:#8c8c8c}.fl-block-overlay-muted .fl-row-overlay .fl-block-overlay-title{border-right:1px solid #a6a6a6}.fl-node-disabled{position:relative}.fl-node-disabled-overlay{background:rgba(153,153,153,.75);bottom:0;left:0;position:absolute;right:0;top:0}.fl-block-col-resize{bottom:0!important;position:absolute;top:0!important;width:6px}.fl-block-col-resize-e{cursor:ew-resize;left:auto!important;right:-4px!important}.fl-block-col-resize-w{cursor:ew-resize;left:-4px!important}.fl-block-col-resize-handle-wrap{margin:-4px 0 0 -5px;padding:0 5px;position:absolute;top:50%!important}.fl-block-col-resize-e .fl-block-col-resize-handle-wrap{margin-left:-6px}.fl-block-col-resize-handle{background:#fff;border:1px solid #259aff;height:7px;width:7px}.fl-node-global .fl-block-col-resize-handle{border-color:#ff9600}.fl-block-col-resize-feedback{color:#333!important;display:none;font-size:11px!important;position:absolute}.fl-builder-actions-title,.fl-builder-alert-lightbox .fl-lightbox-message{color:#333!important;font-family:Helvetica,Verdana,sans-serif!important;font-size:16px!important}.fl-block-col-resize-feedback-left,.fl-block-col-resize-feedback-right{background:#fff;border:1px solid #3ba0ff;padding:2px 4px}.fl-block-col-resize-feedback-left{right:20px;top:-7px}.fl-block-col-resize-feedback-right{left:20px;top:-7px}.fl-builder-actions-lightbox .fl-lightbox{width:300px}.fl-builder-actions-lightbox .fl-builder-actions{display:block;padding:25px;text-align:center}.fl-builder-actions-title{display:block;margin-bottom:20px}.fl-builder-actions .fl-builder-button{display:block;margin-bottom:7px}.fl-builder-alert-lightbox{z-index:200001}.fl-builder-alert-lightbox .fl-lightbox{width:440px!important}.fl-builder-alert-lightbox .fl-lightbox-message{line-height:24px;padding:30px}.fl-template-category-select{width:180px!important}.fl-template-selector .fl-builder-settings-section{margin:0 0 10px}.fl-template-selector .fl-builder-settings-fields{height:470px}.fl-template-selector .fl-builder-settings-tab{width:560px}.fl-template-selector .fl-builder-settings-tab-description{font-size:15px!important;margin:0!important;padding:10px 0 25px;text-align:center}.fl-template-preview{float:left;margin:0 25px 30px 0;position:relative;text-align:center;width:170px}.fl-template-preview.fl-last{margin-right:0}.fl-template-image{border:1px solid #d9d9d9;cursor:pointer;margin-bottom:12px;height:164px;overflow:hidden}.fl-builder-templates-cta,.fl-user-templates{margin-bottom:20px}.fl-template-image:hover{border-color:red}.fl-template-image img{max-height:none;width:100%}.fl-template-preview span{display:block;text-align:center}.fl-user-template-category-name{background:#f2f2f2;border-bottom:3px solid #dfdfdf;border-top:2px solid #dfdfdf;font-weight:700;padding:8px 15px}.fl-user-templates{border-top:1px solid #dfdfdf;margin-right:8px}.fl-user-template{border-bottom:1px solid #dfdfdf;padding:15px;position:relative}.fl-user-template:hover{background:#0074a1;color:#fff!important;cursor:pointer}.fl-user-template:hover *{color:#fff!important}.fl-user-template-actions{bottom:0;position:absolute;right:0;top:0}.fl-user-template-actions a{color:#bfbfbf!important;display:inline-block;padding:15px}.fl-user-template:hover a{color:#99c7d9!important}.fl-user-template:hover a:hover{color:#fff!important}.fl-user-templates-message{display:none}.fl-builder-templates-cta p{display:inline-block!important;width:75%!important;font-size:14px!important;line-height:1.5!important;margin-bottom:0!important}.fl-builder-templates-cta .fl-builder-upgrade-button{font-size:13px!important;line-height:13px!important;position:relative;top:8px;left:15px;padding:1px 12px}.fl-builder-settings-message,.fl-builder-settings-message *{font-size:15px!important;line-height:23px!important}.fl-builder-node-template-settings .fl-builder-settings-fields,.fl-builder-user-template-settings .fl-builder-settings-fields{height:150px}.fl-builder-lightbox .fl-lightbox{width:600px}form.fl-builder-settings{margin:0;padding:0}.fl-builder-settings-message{padding:20px 25px!important;background:#f2f2f2!important}.fl-builder-preview-loader{position:relative;top:-1px;margin-left:3px}.fl-lightbox-header .fl-builder-preview-loader{margin:0;position:absolute;right:15px;top:15px}.fl-builder-settings-tabs{background:#f5f5f5;border-bottom:1px solid #dfdfdf;padding:15px 20px 0}.fl-builder-settings-tabs a{color:#999;display:inline-block;margin:0;padding:10px 20px;text-decoration:none}.fl-builder-settings-tabs a:hover{color:#333}.fl-builder-settings-tabs a.fl-active{background:#fff;border:1px solid #dfdfdf;border-bottom:none;color:#222;position:relative;top:1px}.fl-builder-settings-tabs a.error{color:#d03436;padding-right:10px}.fl-builder-settings-tabs a.error .fl-error-icon{background:url(../img/sprite.png) -148px -5px no-repeat;display:inline-block;height:16px;margin-left:7px;position:relative;top:3px;width:16px}.fl-builder-settings-tab{display:none;width:550px}.fl-builder-settings-tab.fl-active{display:block}.fl-builder-settings-tab-description{background:#f5f5f5;padding:10px 15px}.fl-form-table{border:none;width:100%}.fl-form-table tbody{border:none}.fl-form-table th{border:none!important;background:#fff!important;font-weight:400!important;padding:10px!important;text-align:left!important;vertical-align:top!important;width:200px!important}.fl-form-table td{border:none;padding:8px 10px}.fl-builder-settings-fields{height:410px;margin:5px 0 0;overflow:hidden;position:relative}.fl-lightbox-header .fl-builder-settings-fields{height:auto;margin:0;position:absolute;right:10px;top:10px}.fl-builder-settings-fields .fl-nanoscroller-content{padding:15px 20px}.fl-builder-settings-fields input[type=email],.fl-builder-settings-fields input[type=file],.fl-builder-settings-fields input[type=number],.fl-builder-settings-fields input[type=password],.fl-builder-settings-fields input[type=search],.fl-builder-settings-fields input[type=tel],.fl-builder-settings-fields input[type=text],.fl-builder-settings-fields input[type=url],.fl-builder-settings-fields select,.fl-builder-settings-fields textarea{background-color:#fff;border-color:#dfdfdf;border-style:solid;border-width:1px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;color:#333;display:inline;font-size:12px;height:auto;line-height:15px;margin:1px;outline:0;padding:3px;width:auto}.fl-builder-settings-fields input[type=email]:focus,.fl-builder-settings-fields input[type=file]:focus,.fl-builder-settings-fields input[type=number]:focus,.fl-builder-settings-fields input[type=password]:focus,.fl-builder-settings-fields input[type=search]:focus,.fl-builder-settings-fields input[type=tel]:focus,.fl-builder-settings-fields input[type=text]:focus,.fl-builder-settings-fields input[type=url]:focus,.fl-builder-settings-fields select:focus,.fl-builder-settings-fields textarea:focus{background:0 0;border-color:#aaa}.fl-builder-settings-fields select[multiple]{height:60px}.fl-builder-settings-fields ::-webkit-input-placeholder{color:#999!important}.fl-builder-settings-fields input:-moz-placeholder{color:#999}.fl-builder-settings-fields ::-moz-placeholder{color:#999!important}.fl-builder-settings-fields input:-ms-input-placeholder{color:#999}.fl-builder-settings-fields label{font-weight:400}.fl-builder-settings-fields select{height:2em;color:#000;padding:2px}.fl-builder-settings-description{border-bottom:1px solid #dfdfdf;margin:0 0 10px;padding-bottom:10px!important}.fl-builder-settings-fields table{margin:0}.fl-builder-settings-fields h3.fl-builder-settings-title{border-bottom:1px solid #dfdfdf;color:#333;font-size:14px;font-weight:700;margin:0 0 20px!important;padding:10px}.fl-builder-settings-section{margin-bottom:15px}.wp-core-ui h1,.wp-core-ui h2,.wp-core-ui h3,.wp-core-ui h4,.wp-core-ui h5,.wp-core-ui h6{color:#333}.wp-core-ui .submitbox .submitdelete{color:#a00}.wp-core-ui button{font-weight:400;text-transform:capitalize}.wp-core-ui input[type=email],.wp-core-ui input[type=file],.wp-core-ui input[type=number],.wp-core-ui input[type=password],.wp-core-ui input[type=search],.wp-core-ui input[type=tel],.wp-core-ui input[type=text],.wp-core-ui input[type=url],.wp-core-ui select,.wp-core-ui textarea{background-color:#fff;border-color:#dfdfdf;border-style:solid;border-width:1px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;color:#333;font-weight:400}.wp-core-ui input[type=email]:focus,.wp-core-ui input[type=file]:focus,.wp-core-ui input[type=number]:focus,.wp-core-ui input[type=password]:focus,.wp-core-ui input[type=search]:focus,.wp-core-ui input[type=tel]:focus,.wp-core-ui input[type=text]:focus,.wp-core-ui input[type=url]:focus,.wp-core-ui select:focus,.wp-core-ui textarea:focus{background:0 0;border-color:#aaa}.wp-core-ui input[type=search]{background-image:none;padding:6px}.fl-builder-settings-fields input.text-full,.fl-builder-settings-fields textarea{width:97%}.fl-color-picker{cursor:pointer}.fl-color-picker .fl-color-picker-clear:hover{background-color:#ededed}.colorpicker input{padding:0!important;font-size:11px!important;color:#fff!important;width:29px!important;height:auto!important;background:0 0!important;border:none!important}.colorpicker .colorpicker_hex input{width:45px!important}.fl-builder-custom-field{border:1px solid #dfdfdf;border-radius:3px;padding:5px 10px}.fl-builder-custom-field a{color:#21759b!important;text-decoration:underline!important}.fl-builder-custom-field a:hover{color:#d54e21!important}.fl-builder-custom-field label.error{margin-top:5px}.fl-photo-field .fl-photo-select,.fl-photo-field.fl-photo-empty .fl-photo-preview{display:none}.fl-photo-field.fl-photo-empty .fl-photo-select{display:block}.fl-photo-field .fl-photo-preview-img{float:left;line-height:0;margin:5px 0}.fl-photo-field .fl-photo-preview select{margin:8px 0 8px 10px;width:200px}.fl-photo-field .fl-photo-edit{margin:0 0 0 11px}.fl-multiple-photos-field .fl-multiple-photos-add,.fl-photo-field .fl-photo-remove,.fl-photo-field .fl-photo-replace{margin:0 0 0 8px}.fl-builder-edit .media-frame{-webkit-backface-visibility:hidden}.fl-builder-edit .media-modal-content .thumbnail{padding:0;border:none;border-radius:0}.fl-builder-edit button.button-link.media-modal-close{position:absolute;box-shadow:none;-webkit-box-shadow:none}.fl-multiple-photos-field .fl-multiple-photos-select,.fl-multiple-photos-field.fl-multiple-photos-empty .fl-multiple-photos-add,.fl-multiple-photos-field.fl-multiple-photos-empty .fl-multiple-photos-count,.fl-multiple-photos-field.fl-multiple-photos-empty .fl-multiple-photos-edit,.fl-multiple-photos-lightbox .gallery-settings{display:none}.fl-multiple-photos-field.fl-multiple-photos-empty .fl-multiple-photos-select{display:inline}.fl-multiple-photos-count{font-weight:700;margin-bottom:3px}.fl-video-field .fl-video-select,.fl-video-field.fl-video-empty .fl-video-preview{display:none}.fl-video-field.fl-video-empty .fl-video-select{display:block}.fl-video-field .fl-video-preview-img{float:left;line-height:0;margin:5px 0}.fl-video-field .fl-video-preview-filename{display:inline-block;font-size:14px;font-weight:700;margin:7px 0 0 11px}.fl-video-field .fl-video-replace{margin:0 0 0 11px}.fl-multiple-audios-field .fl-multiple-audios-select,.fl-multiple-audios-field.fl-multiple-audios-empty .fl-multiple-audios-add,.fl-multiple-audios-field.fl-multiple-audios-empty .fl-multiple-audios-edit{display:none}.fl-multiple-audios-field.fl-multiple-audios-empty .fl-multiple-audios-select{display:block}.fl-multiple-audios-field .fl-multiple-audios-add{margin:0 0 0 8px}.fl-icon-field .fl-icon-select,.fl-icon-field.fl-icon-empty .fl-icon-preview{display:none}.fl-icon-field.fl-icon-empty .fl-icon-select{display:block}.fl-icon-field .fl-icon-preview i{display:inline-block;font-size:28px;margin:10px 10px 9px 2px;vertical-align:middle}.fl-icon-field .fl-icon-remove{margin:0 0 0 8px}.fl-builder-settings .wp-switch-editor{background:#ebebeb;border:1px solid #e5e5e5;border-radius:0;color:#333}.fl-builder-settings .wp-editor-container{border:1px solid #e5e5e5}.fl-builder-settings .mce-toolbar .mce-btn-group .mce-btn{margin:2px 0}.fl-builder-settings .mce-menubtn.mce-fixed-width button{width:100px}.mce-close:active,.mce-close:hover,.mce-toolbar .mce-btn button:active,.mce-toolbar .mce-btn button:hover,.mce-window .mce-btn button:active,.mce-window .mce-btn button:hover{background:0 0;border:none}.mce-ico{font-family:tinymce,Arial!important}.mce-toolbar i.mce-ico{font:400 20px/1 dashicons!important}.fl-builder-edit form#wp-link,.fl-color-picker-ui,.popover[class*=tour-],ul.as-list{font-family:Helvetica,Verdana,sans-serif}.wp-core-ui .quicktags-toolbar input.button.button-small{margin:1px!important}.wp-editor-container textarea.wp-editor-area{background:0 0;border:none;padding:10px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.fl-builder-edit form#wp-link{color:#000;font-size:13px}.fl-builder-edit form#wp-link #link-options label{display:block;margin-bottom:2px}.fl-builder-edit form#wp-link #link-options label span{padding-right:10px;vertical-align:middle}.fl-builder-edit form#wp-link #link-options input[type=text]{display:inline-block;height:auto;margin:5px 0 0;padding:3px 5px;width:80%}.fl-builder-edit form#wp-link .query-results{top:225px}.ace_editor,.ace_editor *{font-family:Monaco,Menlo,"Ubuntu Mono","Droid Sans Mono",Consolas,monospace!important;font-size:12px!important;font-weight:400!important;letter-spacing:0!important}.fl-builder-global-settings #fl-builder-settings-tab-css,.fl-builder-global-settings #fl-builder-settings-tab-js,.fl-builder-html-settings #fl-builder-settings-tab-general,.fl-builder-layout-settings #fl-builder-settings-tab-css,.fl-builder-layout-settings #fl-builder-settings-tab-js{width:560px}.fl-builder-global-settings #fl-builder-settings-section-css,.fl-builder-global-settings #fl-builder-settings-section-js,.fl-builder-html-settings #fl-builder-settings-section-general,.fl-builder-layout-settings #fl-builder-settings-section-css,.fl-builder-layout-settings #fl-builder-settings-section-js{margin-bottom:0}.fl-builder-global-settings #fl-builder-settings-tab-css td,.fl-builder-global-settings #fl-builder-settings-tab-js td,.fl-builder-html-settings #fl-builder-settings-section-general td,.fl-builder-layout-settings #fl-builder-settings-tab-css td,.fl-builder-layout-settings #fl-builder-settings-tab-js td{padding:0}.fl-layout-field-option{border:2px solid #d9d9d9;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-sizing:border-box!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;cursor:pointer;float:left;line-height:0;max-width:23%;margin:0 1% 2%;padding:5px}.fl-layout-field-option-selected,.fl-layout-field-option:hover{border-color:red}.fl-layout-field-option img{max-width:100%}.fl-link-field-input{width:244px!important}.fl-link-field-search{display:none;border:1px solid #dfdfdf;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin:4px 0 0;padding:10px}.fl-link-field-search-title{display:block;margin:0 0 3px 2px}.fl-link-field-search-cancel{margin-top:6px}.fl-help-tooltip{display:inline-block;position:relative}.fl-help-tooltip-icon{color:#999!important;cursor:pointer;font-family:FontAwesome;font-size:15px!important;padding:5px;vertical-align:middle}.fl-help-tooltip-text{background:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ccc;-moz-box-shadow:0 0 5px #ccc;-webkit-box-shadow:0 0 5px #ccc;display:none;font-weight:400;left:23px;padding:10px 13px;position:absolute;top:-6px;width:250px;z-index:1000}.fl-form-field-preview-text .fa{font-size:18px;line-height:22px}.fl-builder-field-actions{padding-left:0!important;padding-right:0!important;text-align:center;vertical-align:middle;width:85px}.fl-builder-field-actions i{color:#999!important;cursor:pointer;font-size:13px!important;height:24px;line-height:29px!important;width:24px}.fl-builder-field-actions i:hover{color:#000!important}.fl-builder-field-actions i.fl-builder-field-copy,.fl-builder-field-actions i.fl-builder-field-delete{margin-left:5px}.fl-builder-field-actions i.fl-builder-field-move{cursor:move}.fl-builder-field-dd-helper{background:#ccc;height:30px!important;float:left;width:130px!important}.fl-builder-field-dd-zone{border:1px dashed #ccc;height:30px}.fl-builder-field-actions-single{width:auto}.fl-builder-field-actions-single i.fl-builder-field-delete,.fl-builder-field-actions-single i.fl-builder-field-move{display:none}.fl-builder-widget-settings input{display:inline-block!important;margin:5px 10px 8px!important}.fl-builder-lightbox-loading{background:url(../img/ajax-loader.gif) center center no-repeat;height:100px}.fl-builder-settings .error,.fl-builder-settings input.error{border-color:#d03436}.fl-builder-settings label.error,.fl-builder-settings p.error{color:#d03436;display:block;margin-top:5px}.fl-builder-settings .fl-form-table .fl-field-description{color:#999;font-style:normal}ul.as-selections{background-color:#fff;border-color:#dfdfdf;border-style:solid;border-width:1px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;color:#333;font-size:12px;height:auto;line-height:15px;margin:1px;outline:0;padding:3px;width:auto}ul.as-selections.loading{background:url(../img/ajax-loader-small.gif) 98% center no-repeat}ul.as-selections li.as-selection-item{background:#d4eaf6;border:none;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;font-size:11px;line-height:14px;margin-bottom:4px;padding-bottom:0;padding-top:0}ul.as-selections li.as-selection-item.blur{background:#f4f4f4}ul.as-selections li.as-selection-item a.as-close{line-height:12px}ul.as-selections li.as-original{margin:0}ul.as-selections li.as-original input{height:auto;font-size:12px;margin:0;padding:0}ul.as-list{margin:0;font-size:13px;color:#000;background-color:#fff;background-color:rgba(255,255,255,.95);z-index:2;-webkit-box-shadow:0 0 10px rgba(0,0,0,.1);-moz-box-shadow:0 0 10px rgba(0,0,0,.1);box-shadow:0 0 10px rgba(0,0,0,.1);-ms-border-radius:0;-o-border-radius:0;border:none;border:1px solid #dfdfdf;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}li.as-message,li.as-result-item{border:none}li.as-result-item.active{background:#e5e5e5;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;color:#333;text-shadow:none}li.as-result-item em{background:0 0!important;color:#333!important;font-size:12px;padding:0!important}.fl-loop-builder-filter{display:none}.fl-builder-service-settings{position:relative}.fl-builder-service-error{color:red!important;padding:15px 0 0}.fl-builder-service-account-delete{color:red!important;margin-left:10px;position:relative;top:2px}#fl-field-visibility_user_capability .fl-field-description,.fl-builder-service-connect-row .fl-field-description{background:#f0f0f0;color:#333!important;display:block;float:none;margin:10px 0 0;padding:10px}#fl-field-visibility_user_capability .fl-field-description a,.fl-builder-service-connect-row .fl-field-description a{color:#21759b!important;text-decoration:underline!important}.fl-builder-getting-started-video{line-height:0!important;padding:10px}.fl-builder-getting-started-video iframe{border:none;height:326px;width:100%}.fl-builder-tour-actions .fl-builder-actions-title{font-size:14px!important;line-height:19px}.fl-builder-tour-mask{bottom:0;left:0;position:fixed;right:0;top:0;z-index:100000000}.fl-builder-tour-dimmed{background:rgba(0,0,0,.7);bottom:0;left:0;position:absolute;right:0;top:0}body>.fl-builder-tour-dimmed{position:fixed}.tour-backdrop{z-index:110000}.popover[class*=tour-]{border:1px solid #ccc;border-radius:0;-webkit-box-shadow:0 0 30px rgba(0,0,0,.3);box-shadow:0 0 40px rgba(0,0,0,.3);color:#666;font-size:13px;font-weight:400;line-height:18px;max-width:none;padding:0;width:300px;z-index:100000001}.popover[class*=tour-].bottom>.arrow{border-bottom-color:#ccc}.popover[class*=tour-].bottom>.arrow:after{border-bottom-color:#f7f7f7}.popover[class*=tour-] .popover-title{border-radius:0;color:#333;letter-spacing:normal;text-transform:none}.popover[class*=tour-] .fa-times{color:#b3b3b3;cursor:pointer;font-size:16px;padding:5px;position:absolute;right:3px;top:2px}.popover[class*=tour-] .fa-times:hover{color:#666}.popover[class*=tour-] .popover-content{border-bottom:1px solid #d9d9d9;padding:13px 15px}.popover[class*=tour-] .fl-builder-tour-next{display:block;float:none;width:100%}.fl-builder-shortcode-mask-wrap{position:relative}.fl-builder-shortcode-mask{bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fl-color-picker-ui .iris-picker{width:200px;height:215px;display:block;position:relative;border-top:1px solid rgba(0,0,0,.1)}.fl-color-picker-ui .iris-picker .iris-square-inner,.fl-color-picker-ui .iris-picker-inner{position:absolute;left:0;top:0;bottom:0;right:0}.fl-color-picker-ui .iris-picker,.iris-picker *{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.fl-color-picker-ui .iris-error{background-color:#ffafaf}.fl-color-picker-ui .iris-picker .iris-square{width:200px;height:200px}.fl-color-picker-ui .iris-picker .iris-palette,.fl-color-picker-ui .iris-picker .iris-slider,.fl-color-picker-ui .iris-picker .iris-square-inner{height:100%;width:12.5%}.fl-color-picker-ui .iris-picker .iris-placeholder,.fl-color-picker-ui .iris-picker .iris-square{position:relative}.fl-color-picker-ui .iris-picker .iris-square-inner{width:auto;margin:0}.fl-color-picker-ui .iris-ie-9 .iris-palette,.fl-color-picker-ui .iris-ie-9 .iris-slider,.fl-color-picker-ui .iris-ie-9 .iris-square,.fl-color-picker-ui .iris-ie-9 .iris-square-inner{box-shadow:none;border-radius:0}.fl-color-picker-ui .iris-ie-9 .iris-palette,.fl-color-picker-ui .iris-ie-9 .iris-slider,.fl-color-picker-ui .iris-ie-9 .iris-square{outline:rgba(0,0,0,.1) solid 1px}.fl-color-picker-ui .iris-ie-lt9 .iris-palette,.fl-color-picker-ui .iris-ie-lt9 .iris-slider,.fl-color-picker-ui .iris-ie-lt9 .iris-square,.fl-color-picker-ui .iris-ie-lt9 .iris-square-inner{outline:#999 solid 1px}.fl-color-picker-ui .iris-ie-lt9 .iris-square .ui-slider-handle{outline:#999 solid 1px;background-color:#fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"}.fl-color-picker-ui .iris-ie-lt9 .iris-square .iris-square-handle{background:0 0;border:3px solid #fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"}.fl-color-picker-ui .iris-picker .iris-strip{width:200px;margin-top:5px;position:relative;height:10px;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fl-color-picker-ui .iris-picker .iris-strip .ui-slider-handle{width:6px;position:absolute;right:0;top:-2px;bottom:-2px;margin:0;border-radius:3px;background:#fff;box-shadow:0 0 2px rgba(0,0,0,.5);z-index:5;cursor:ew-resize}.fl-color-picker-ui .iris-picker .iris-slider-offset{position:absolute;top:0;left:6px;right:0;bottom:0;width:auto;height:auto;background:0 0;border:none;border-radius:0;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fl-color-picker-ui .iris-picker .iris-square-handle{background:0 0;border:5px solid #999;border-radius:50%;border-color:rgba(128,128,128,.5);box-shadow:none;width:12px;height:12px;position:absolute;left:-10px;top:-10px;cursor:move;opacity:1;z-index:10}.fl-color-picker-ui .iris-picker .ui-state-focus .iris-square-handle{opacity:.8}.fl-color-picker-ui .iris-picker .iris-square-handle:hover{border-color:#999}.fl-color-picker-ui .iris-picker .iris-square-value:focus .iris-square-handle{box-shadow:0 0 2px rgba(0,0,0,.75);opacity:.8}.fl-color-picker-ui .iris-picker .iris-square-handle:hover::after{border-color:#fff}.fl-color-picker-ui .iris-picker .iris-square-handle::after{position:absolute;bottom:-4px;right:-4px;left:-4px;top:-4px;border:3px solid #f9f9f9;border-color:rgba(255,255,255,.8);border-radius:50%;content:" "}.fl-color-picker-clear,.fl-color-picker-color{float:left;border:1px solid rgba(0,0,0,.1);cursor:pointer}.fl-color-picker-ui .iris-picker .iris-square-value{width:8px;height:8px;position:absolute}.iris-ie-lt9 .iris-square-value,.iris-mozilla .iris-square-value{width:1px;height:1px}.fl-color-picker-wrapper{position:relative;width:48px;height:32px}.fl-color-picker-color{position:relative;width:30px;height:30px;background-color:transparent}.fl-color-picker-color.fl-color-picker-empty{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABG2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS4xLjIiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgo8P3hwYWNrZXQgZW5kPSJyIj8+MahxaQAAAAlwSFlzAAALEwAACxMBAJqcGAAACk9pQ0NQUGhvdG9zaG9wIElDQyBwcm9maWxlAAB42p1TZ1RT6RY99970QkuIgJRLb1IVCCBSQouAFJEmKiEJEEqIIaHZFVHBEUVFBBvIoIgDjo6AjBVRLAyKCtgH5CGijoOjiIrK++F7o2vWvPfmzf611z7nrPOds88HwAgMlkgzUTWADKlCHhHgg8fExuHkLkCBCiRwABAIs2Qhc/0jAQD4fjw8KyLAB74AAXjTCwgAwE2bwDAch/8P6kKZXAGAhAHAdJE4SwiAFABAeo5CpgBARgGAnZgmUwCgBABgy2Ni4wBQLQBgJ3/m0wCAnfiZewEAW5QhFQGgkQAgE2WIRABoOwCsz1aKRQBYMAAUZkvEOQDYLQAwSVdmSACwtwDAzhALsgAIDAAwUYiFKQAEewBgyCMjeACEmQAURvJXPPErrhDnKgAAeJmyPLkkOUWBWwgtcQdXVy4eKM5JFysUNmECYZpALsJ5mRkygTQP4PPMAACgkRUR4IPz/XjODq7OzjaOtg5fLeq/Bv8iYmLj/uXPq3BAAADhdH7R/iwvsxqAOwaAbf6iJe4EaF4LoHX3i2ayD0C1AKDp2lfzcPh+PDxFoZC52dnl5OTYSsRCW2HKV33+Z8JfwFf9bPl+PPz39eC+4iSBMl2BRwT44MLM9EylHM+SCYRi3OaPR/y3C//8HdMixEliuVgqFONREnGORJqM8zKlIolCkinFJdL/ZOLfLPsDPt81ALBqPgF7kS2oXWMD9ksnEFh0wOL3AADyu2/B1CgIA4Bog+HPd//vP/1HoCUAgGZJknEAAF5EJC5UyrM/xwgAAESggSqwQRv0wRgswAYcwQXcwQv8YDaEQiTEwkIQQgpkgBxyYCmsgkIohs2wHSpgL9RAHTTAUWiGk3AOLsJVuA49cA/6YQiewSi8gQkEQcgIE2Eh2ogBYopYI44IF5mF+CHBSAQSiyQgyYgUUSJLkTVIMVKKVCBVSB3yPXICOYdcRrqRO8gAMoL8hrxHMZSBslE91Ay1Q7moNxqERqIL0GR0MZqPFqCb0HK0Gj2MNqHn0KtoD9qPPkPHMMDoGAczxGwwLsbDQrE4LAmTY8uxIqwMq8YasFasA7uJ9WPPsXcEEoFFwAk2BHdCIGEeQUhYTFhO2EioIBwkNBHaCTcJA4RRwicik6hLtCa6EfnEGGIyMYdYSCwj1hKPEy8Qe4hDxDckEolDMie5kAJJsaRU0hLSRtJuUiPpLKmbNEgaI5PJ2mRrsgc5lCwgK8iF5J3kw+Qz5BvkIfJbCp1iQHGk+FPiKFLKakoZ5RDlNOUGZZgyQVWjmlLdqKFUETWPWkKtobZSr1GHqBM0dZo5zYMWSUulraKV0xpoF2j3aa/odLoR3ZUeTpfQV9LL6Ufol+gD9HcMDYYVg8eIZygZmxgHGGcZdxivmEymGdOLGcdUMDcx65jnmQ+Zb1VYKrYqfBWRygqVSpUmlRsqL1Spqqaq3qoLVfNVy1SPqV5Tfa5GVTNT46kJ1JarVaqdUOtTG1NnqTuoh6pnqG9UP6R+Wf2JBlnDTMNPQ6RRoLFf47zGIAtjGbN4LCFrDauGdYE1xCaxzdl8diq7mP0du4s9qqmhOUMzSjNXs1LzlGY/B+OYcficdE4J5yinl/N+it4U7yniKRumNEy5MWVca6qWl5ZYq0irUatH6702ru2nnaa9RbtZ+4EOQcdKJ1wnR2ePzgWd51PZU92nCqcWTT069a4uqmulG6G7RHe/bqfumJ6+XoCeTG+n3nm95/ocfS/9VP1t+qf1RwxYBrMMJAbbDM4YPMU1cW88HS/H2/FRQ13DQEOlYZVhl+GEkbnRPKPVRo1GD4xpxlzjJONtxm3GoyYGJiEmS03qTe6aUk25pimmO0w7TMfNzM2izdaZNZs9Mdcy55vnm9eb37dgWnhaLLaotrhlSbLkWqZZ7ra8boVaOVmlWFVaXbNGrZ2tJda7rbunEae5TpNOq57WZ8Ow8bbJtqm3GbDl2AbbrrZttn1hZ2IXZ7fFrsPuk72Tfbp9jf09Bw2H2Q6rHVodfnO0chQ6Vjrems6c7j99xfSW6S9nWM8Qz9gz47YTyynEaZ1Tm9NHZxdnuXOD84iLiUuCyy6XPi6bG8bdyL3kSnT1cV3hetL1nZuzm8LtqNuv7jbuae6H3J/MNJ8pnlkzc9DDyEPgUeXRPwuflTBr36x+T0NPgWe15yMvYy+RV63XsLeld6r3Ye8XPvY+cp/jPuM8N94y3llfzDfAt8i3y0/Db55fhd9DfyP/ZP96/9EAp4AlAWcDiYFBgVsC+/h6fCG/jj8622X2stntQYyguUEVQY+CrYLlwa0haMjskK0h9+eYzpHOaQ6FUH7o1tAHYeZhi8N+DCeFh4VXhj+OcIhYGtExlzV30dxDc99E+kSWRN6bZzFPOa8tSjUqPqouajzaN7o0uj/GLmZZzNVYnVhJbEscOS4qrjZubL7f/O3zh+Kd4gvjexeYL8hdcHmhzsL0hacWqS4SLDqWQEyITjiU8EEQKqgWjCXyE3cljgp5wh3CZyIv0TbRiNhDXCoeTvJIKk16kuyRvDV5JMUzpSzluYQnqZC8TA1M3Zs6nhaadiBtMj06vTGDkpGQcUKqIU2TtmfqZ+ZmdsusZYWy/sVui7cvHpUHyWuzkKwFWS0KtkKm6FRaKNcqB7JnZVdmv82JyjmWq54rze3Ms8rbkDec75//7RLCEuGStqWGS1ctHVjmvaxqObI8cXnbCuMVBSuGVgasPLiKtipt1U+r7VeXrn69JnpNa4FewcqCwbUBa+sLVQrlhX3r3NftXU9YL1nftWH6hp0bPhWJiq4U2xeXFX/YKNx45RuHb8q/mdyUtKmrxLlkz2bSZunm3i2eWw6Wqpfmlw5uDdnatA3fVrTt9fZF2y+XzSjbu4O2Q7mjvzy4vGWnyc7NOz9UpFT0VPpUNu7S3bVh1/hu0e4be7z2NOzV21u89/0+yb7bVQFVTdVm1WX7Sfuz9z+uiarp+Jb7bV2tTm1x7ccD0gP9ByMOtte51NUd0j1UUo/WK+tHDscfvv6d73ctDTYNVY2cxuIjcER55On3Cd/3Hg062naMe6zhB9Mfdh1nHS9qQprymkabU5r7W2Jbuk/MPtHW6t56/EfbHw+cNDxZeUrzVMlp2umC05Nn8s+MnZWdfX4u+dxg26K2e+djzt9qD2/vuhB04dJF/4vnO7w7zlzyuHTystvlE1e4V5qvOl9t6nTqPP6T00/Hu5y7mq65XGu57nq9tXtm9+kbnjfO3fS9efEW/9bVnjk93b3zem/3xff13xbdfnIn/c7Lu9l3J+6tvE+8X/RA7UHZQ92H1T9b/tzY79x/asB3oPPR3Ef3BoWDz/6R9Y8PQwWPmY/Lhg2G6544Pjk54j9y/en8p0PPZM8mnhf+ov7LrhcWL3741evXztGY0aGX8peTv218pf3qwOsZr9vGwsYevsl4MzFe9Fb77cF33Hcd76PfD0/kfCB/KP9o+bH1U9Cn+5MZk5P/BAOY8/xjMy3bAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAGbSURBVHjajNO/S1VxGMfx9+ebQ6FiImkOgatTDYlKXgfPgVAbHRpt6U/oH6jmHAPH2gOX2vx1URCaWoKGhhQ1hKsJLnqeT8sxTveeSz3bFx5ez/f58vkqyzL+pyQhiYhYsL0i6bIoiuf6B/AIENCUBPAUWAX6AGx/6wpIyoEPJTBhewxYk9Rz3RMRXYEeSevATHneB/qBgcqAi4hY6gAkYVvApKS3wP2aAYWk5Yh4rzzPKff7U7axfQP4LKkdOJb0zPZH23QAtpE0FBGbwLmkV7ZfV6AD29PAD6AWGLa9JSlJemj7l6THtj9VbnFuexHYbgcGbe+UjzgLHNq+DawBt4BeYBy4sj33FxARA8BeOblh+0jSsO0mcAk8sD0u6Q3w0vZGdYWhiGgCKaXUAH7aHikDFMAU0IqIzrzkeX6nsvOU7Zak0YjYklRImgZaZXBqgW3gXtl4aHsQ2AWSpAZwXEleJ5Bl2feU0rztr5WdQ9IMcFJt7naDL5JeAKcR8S6ldAVM2j5rD1g3YB24C9wEDiQ9AU7rPkgd8HsAv5vXzUui544AAAAASUVORK5CYII=) center center no-repeat}.fl-color-picker-clear{position:relative;display:block;width:17px;height:30px;border-left:none;background-color:#FAFAFA}.fl-color-picker-color.fl-color-picker-empty+.fl-color-picker-clear{display:none}.fl-color-picker-ui{display:inline-block;z-index:999999;position:fixed;overflow:hidden;padding-bottom:45px;border:1px solid rgba(0,0,0,.1);color:#999;background-color:#FAFAFA;border-radius:3px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1);-webkit-transition:opacity .2s,visibility .2s;-moz-transition:opacity .2s,visibility .2s;-ms-transition:opacity .2s,visibility .2s;-o-transition:opacity .2s,visibility .2s;transition:opacity .2s,visibility .2s;visibility:hidden;opacity:0;-webkit-transform:translate3d(0,0,0)}.fl-color-picker-ui.fl-color-picker-active{visibility:visible;opacity:1}.fl-color-picker-ui .fl-color-picker-input,.fl-color-picker-ui .fl-color-picker-input:focus{width:100%;height:30px;border:none!important;font-size:14px!important;padding:0 8px;vertical-align:middle;color:#999;background-color:#fff;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.fl-color-picker-ui .iris-square-value{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none}.fl-color-picker-preset-add{position:absolute;top:8px;right:8px;width:14px;height:14px;background-color:#999;border-radius:50%;cursor:pointer;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s}.fl-color-picker-preset-add:hover{background-color:#333}.fl-color-picker-preset-add:after,.fl-color-picker-preset-add:before{content:'';display:block;position:relative;background-color:#fff}.fl-color-picker-preset-add:before{top:6px;left:3px;width:8px;height:2px}.fl-color-picker-preset-add:after{left:6px;top:1px;width:2px;height:8px}.fl-color-picker-presets{position:absolute;left:0;bottom:0;width:100%;z-index:15;overflow:auto;border-top:1px solid rgba(0,0,0,.1);background-color:#FAFAFA}.fl-color-picker-presets-list .fl-color-picker-preset:hover,.fl-color-picker-presets-toggle:hover{background-color:#EDEDED}.fl-color-picker-presets-toggle{position:relative;overflow:hidden;width:100%;height:35px;text-align:center;line-height:35px;font-size:12px;font-weight:700;cursor:pointer;-webkit-transition:all .1s;-moz-transition:all .1s;-ms-transition:all .1s;-o-transition:all .1s;transition:all .1s}.fl-color-picker-presets-close-label,.fl-color-picker-presets-open-label{position:absolute;top:50%;left:50%;visibility:hidden;color:#999;-webkit-transition:all .5s;-moz-transition:all .5s;-ms-transition:all .5s;-o-transition:all .5s;transition:all .5s;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0}.fl-color-picker-presets-close-label.fl-color-picker-active,.fl-color-picker-presets-open-label.fl-color-picker-active{color:#999;visibility:visible;opacity:1}.fl-color-picker-presets-list{width:100%;list-style:none;margin:0;padding:0;overflow:auto}.fl-color-picker-presets-list .fl-color-picker-no-preset,.fl-color-picker-presets-list .fl-color-picker-preset{position:relative;padding:5px;font-size:12px;border-top:1px solid rgba(0,0,0,.1);-webkit-transition:all .1s;-moz-transition:all .1s;-ms-transition:all .1s;-o-transition:all .1s;transition:all .1s}.fl-color-picker-presets-list .fl-color-picker-preset-color{display:inline-block;width:20px;height:20px;margin-right:3px;vertical-align:middle;border:1px solid rgba(0,0,0,.1);border-radius:2px;cursor:pointer}.fl-color-picker-presets-list .fl-color-picker-preset-label{vertical-align:middle;color:#999}.fl-color-picker-clear .fl-color-picker-icon-remove,.fl-color-picker-presets-list .fl-color-picker-preset-remove{position:absolute;top:50%;cursor:pointer;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%)}.fl-color-picker-clear .fl-color-picker-icon-remove{right:0}.fl-color-picker-presets-list .fl-color-picker-preset-remove{right:5px}.fl-color-picker-presets-list .fl-color-picker-preset-remove:hover:after,.fl-color-picker-presets-list .fl-color-picker-preset-remove:hover:before{background-color:#333}.fl-color-picker-added{position:absolute;width:100%;top:0;left:0;right:0;bottom:35px;z-index:10;color:#fff;text-align:center;background-color:rgba(0,0,0,.6)}.fl-color-picker-added-text{position:absolute;top:50%;left:50%;width:80%;font-size:14px;color:#fff!important;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.fl-color-picker-icon-check{position:relative;width:50px;height:50px;margin:5px auto}.fl-color-picker-icon-check:before{content:'';display:block;position:relative;width:15px;height:30px;margin-left:14px;border:7px solid #fff;border-left:none;border-top:none;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.fl-color-picker-icon-arrow-down,.fl-color-picker-icon-arrow-up{display:inline-block;position:relative;width:10px;height:10px;margin-left:5px}.fl-color-picker-icon-arrow-down:before,.fl-color-picker-icon-arrow-up:before{content:'';display:block;position:relative;width:6px;height:6px;border:2px solid #999;border-left:none;border-top:none;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.fl-color-picker-icon-arrow-up{top:2px;-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fl-color-picker-icon-remove{width:15px;height:15px}.fl-color-picker-icon-remove:after,.fl-color-picker-icon-remove:before{content:'';display:block;position:relative;background-color:#999}.fl-color-picker-icon-remove:before{left:6px;width:2px;height:10px;margin-top:3px;background:#999;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.fl-color-picker-icon-remove:after{left:6px;width:2px;height:10px;margin-top:-10px;background:#999;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.fl-icons-filter input,.fl-icons-filter select{vertical-align:middle;width:160px}.fl-icon-selector .fl-lightbox{height:100%}.fl-icons-filter{height:auto!important;margin:0!important;position:absolute!important;right:10px;top:10px}.fl-icons-filter input{line-height:18px}.fl-icons-list{bottom:52px;left:0;overflow:auto;padding:20px;position:absolute;right:0;top:48px}.fl-icons-list::-webkit-scrollbar{background-color:#ccc;-webkit-appearance:none;width:10px}.fl-icons-list::-webkit-scrollbar-thumb{background-color:#666;border:1px solid #ccc}.fl-icons-section{text-align:center}.fl-icons-section h2{border-bottom:1px solid #dfdfdf;color:#333!important;font-family:Helvetica,Verdana,sans-serif!important;font-size:16px!important;font-weight:700!important;margin:0 0 20px!important;padding:0 0 10px!important;text-align:left}.fl-icons-list i,.fl-icons-list i:before{cursor:pointer;display:inline-block;font-size:32px;height:80px;line-height:80px;width:80px}.fl-icons-list i:hover{background:#e5e5e5}.fl-icon-selector-footer{bottom:0;left:0;position:absolute;right:0}.fl-lightbox-mask,.fl-lightbox-wrap{bottom:0;left:0;position:fixed;right:0;top:0}.fl-lightbox-wrap{display:none;overflow:auto;padding:30px;z-index:100010;-webkit-backface-visibility:hidden;-webkit-transform:translateZ(0)}.fl-lightbox-wrap.fl-icon-selector{z-index:100011}.fl-lightbox-mask{background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100010}.fl-lightbox{background:#fff;box-shadow:rgba(0,0,0,1) 0 4px 30px;-moz-box-shadow:rgba(0,0,0,1) 0 4px 30px;-webkit-box-shadow:rgba(0,0,0,1) 0 4px 30px;position:relative;z-index:100011}.fl-lightbox :not(i){color:#333;font-family:Helvetica,Verdana,sans-serif;font-size:12px;line-height:16px;text-decoration:none;text-transform:none}.fl-lightbox *,.fl-lightbox :after,.fl-lightbox :before{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.fl-lightbox .fl-nanoscroller-pane{bottom:4px;right:4px;width:8px}.fl-lightbox .fa{font-family:FontAwesome}.fl-lightbox-content-wrap{height:100%}.fl-lightbox.ui-draggable{box-shadow:rgba(0,0,0,.5) 0 4px 30px;-moz-box-shadow:rgba(0,0,0,.5) 0 4px 30px;-webkit-box-shadow:rgba(0,0,0,.5) 0 4px 30px}.fl-lightbox-controls{position:absolute;right:10px;top:10px;z-index:5}.fl-lightbox-controls .fa{color:#999;font-size:18px;padding:5px}.fl-lightbox-controls .fa:hover{color:#333;cursor:pointer}.fl-builder-lightbox .fl-lightbox-expanded{left:0!important;right:0!important;top:0!important;height:100%!important;width:100%!important}.fl-lightbox.ui-draggable.fl-lightbox-expanded .fl-lightbox-header{cursor:inherit}.fl-builder-lightbox .fl-lightbox-expanded .fl-builder-settings-tab{width:100%!important}.fl-lightbox-header{background:#fff;border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,.1);-moz-box-shadow:0 4px 4px -4px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 4px -4px rgba(0,0,0,.1);position:relative}.fl-lightbox-header h1{color:#333!important;font-size:18px!important;font-family:Helvetica,Verdana,sans-serif!important;font-weight:300!important;margin:0!important;padding:15px 20px!important}.fl-lightbox.ui-draggable .fl-lightbox-header{cursor:move}.fl-lightbox-footer{border-top:1px solid #dfdfdf;box-shadow:0 -4px 4px -4px rgba(0,0,0,.1);-moz-box-shadow:0 -4px 4px -4px rgba(0,0,0,.1);-webkit-box-shadow:0 -4px 4px -4px rgba(0,0,0,.1);padding:10px;text-align:right}.fl-lightbox-footer .fl-builder-button{margin-left:5px!important}
css/fl-lightbox.css CHANGED
@@ -65,6 +65,36 @@
65
  -webkit-box-shadow: rgba(0,0,0,0.5) 0 4px 30px;
66
  }
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  /* Header */
69
  .fl-lightbox-header {
70
  background: #fff;
65
  -webkit-box-shadow: rgba(0,0,0,0.5) 0 4px 30px;
66
  }
67
 
68
+ /* Lightbox Controls */
69
+ .fl-lightbox-controls {
70
+ position: absolute;
71
+ right: 10px;
72
+ top: 10px;
73
+ z-index: 5;
74
+ }
75
+ .fl-lightbox-controls .fa {
76
+ color: #999;
77
+ font-size: 18px;
78
+ padding: 5px;
79
+ }
80
+ .fl-lightbox-controls .fa:hover {
81
+ color: #333;
82
+ cursor: pointer;
83
+ }
84
+ .fl-builder-lightbox .fl-lightbox-expanded {
85
+ left: 0!important;
86
+ right: 0!important;
87
+ top: 0!important;
88
+ height: 100%!important;
89
+ width: 100%!important;
90
+ }
91
+ .fl-lightbox.ui-draggable.fl-lightbox-expanded .fl-lightbox-header {
92
+ cursor: inherit;
93
+ }
94
+ .fl-builder-lightbox .fl-lightbox-expanded .fl-builder-settings-tab {
95
+ width: 100%!important;
96
+ }
97
+
98
  /* Header */
99
  .fl-lightbox-header {
100
  background: #fff;
{classes → extensions/fl-builder-multisite/classes}/class-fl-builder-multisite.php RENAMED
@@ -15,8 +15,30 @@ final class FLBuilderMultisite {
15
  */
16
  static public function init()
17
  {
18
- add_action('wpmu_new_blog', 'FLBuilderMultisite::install_for_new_blog', 10, 6);
19
- add_filter('wpmu_drop_tables', 'FLBuilderMultisite::uninstall_on_delete_blog');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
 
22
  /**
@@ -65,12 +87,13 @@ final class FLBuilderMultisite {
65
  }
66
 
67
  /**
68
- * Runs the uninstall method for each site on the network.
 
69
  *
70
  * @since 1.0
71
  * @return void
72
  */
73
- static public function uninstall()
74
  {
75
  global $blog_id;
76
  global $wpdb;
@@ -84,6 +107,8 @@ final class FLBuilderMultisite {
84
  }
85
 
86
  switch_to_blog($original_blog_id);
 
 
87
  }
88
 
89
  /**
@@ -117,4 +142,6 @@ final class FLBuilderMultisite {
117
 
118
  return $wpdb->get_row( "SELECT blog_id FROM $wpdb->blogs WHERE blog_id = '$like'" );
119
  }
120
- }
 
 
15
  */
16
  static public function init()
17
  {
18
+ add_action('wpmu_new_blog', __CLASS__ . '::install_for_new_blog', 10, 6);
19
+ add_filter('wpmu_drop_tables', __CLASS__ . '::uninstall_on_delete_blog');
20
+ add_filter('fl_builder_activate', __CLASS__ . '::activate');
21
+ add_filter('fl_builder_uninstall', __CLASS__ . '::uninstall');
22
+ }
23
+
24
+ /**
25
+ * Short circuit activation in favor of multisite activation.
26
+ *
27
+ * @since 1.8
28
+ * @return void
29
+ */
30
+ static public function activate( $activate )
31
+ {
32
+ if ( is_network_admin() ) {
33
+ FLBuilderMultisite::install();
34
+ }
35
+ else {
36
+ FLBuilderAdmin::install();
37
+ }
38
+
39
+ FLBuilderAdmin::trigger_activate_notice();
40
+
41
+ return false;
42
  }
43
 
44
  /**
87
  }
88
 
89
  /**
90
+ * Short circuit the default uninstall and run
91
+ * the uninstall for each site on the network.
92
  *
93
  * @since 1.0
94
  * @return void
95
  */
96
+ static public function uninstall( $uninstall )
97
  {
98
  global $blog_id;
99
  global $wpdb;
107
  }
108
 
109
  switch_to_blog($original_blog_id);
110
+
111
+ return false;
112
  }
113
 
114
  /**
142
 
143
  return $wpdb->get_row( "SELECT blog_id FROM $wpdb->blogs WHERE blog_id = '$like'" );
144
  }
145
+ }
146
+
147
+ FLBuilderMultisite::init();
extensions/fl-builder-multisite/fl-builder-multisite.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Only load for multisite installs.
4
+ if ( ! is_multisite() ) {
5
+ return;
6
+ }
7
+
8
+ // Defines
9
+ define( 'FL_BUILDER_MULTISITE_DIR', FL_BUILDER_DIR . 'extensions/fl-builder-multisite/' );
10
+ define( 'FL_BUILDER_MULTISITE_URL', FL_BUILDER_URL . 'extensions/fl-builder-multisite/' );
11
+
12
+ // Classes
13
+ require_once FL_BUILDER_MULTISITE_DIR . 'classes/class-fl-builder-multisite.php';
fl-builder.php CHANGED
@@ -1,109 +1,15 @@
1
  <?php
2
  /**
3
  * Plugin Name: Beaver Builder Plugin (Lite Version)
4
- * Plugin URI: https://www.wpbeaverbuilder.com/?utm_source=external&utm_medium=builder&utm_campaign=plugins-page
5
  * Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
6
- * Version: 1.7.8
7
  * Author: The Beaver Builder Team
8
- * Author URI: https://www.wpbeaverbuilder.com/?utm_source=external&utm_medium=builder&utm_campaign=plugins-page
9
  * Copyright: (c) 2014 Beaver Builder
10
  * License: GNU General Public License v2.0
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  * Text Domain: fl-builder
13
  */
14
- define('FL_BUILDER_VERSION', '1.7.8');
15
- define('FL_BUILDER_FILE', __FILE__);
16
- define('FL_BUILDER_DIR', plugin_dir_path(FL_BUILDER_FILE));
17
- define('FL_BUILDER_URL', plugins_url('/', FL_BUILDER_FILE));
18
- define('FL_BUILDER_LITE', true);
19
- define('FL_BUILDER_SUPPORT_URL', 'https://www.wpbeaverbuilder.com/support/');
20
- define('FL_BUILDER_UPGRADE_URL', 'https://www.wpbeaverbuilder.com/pricing/');
21
- define('FL_BUILDER_DEMO_URL', 'http://demos.wpbeaverbuilder.com');
22
- define('FL_BUILDER_OLD_DEMO_URL', 'http://demos.fastlinemedia.com');
23
- define('FL_BUILDER_DEMO_CACHE_URL', 'http://demos.wpbeaverbuilder.com/wp-content/uploads/bb-plugin/cache/');
24
 
25
- /* Classes */
26
- require_once 'classes/class-fl-builder.php';
27
- require_once 'classes/class-fl-builder-admin.php';
28
- require_once 'classes/class-fl-builder-admin-posts.php';
29
- require_once 'classes/class-fl-builder-ajax.php';
30
- require_once 'classes/class-fl-builder-ajax-layout.php';
31
- require_once 'classes/class-fl-builder-auto-suggest.php';
32
- require_once 'classes/class-fl-builder-color.php';
33
- require_once 'classes/class-fl-builder-fonts.php';
34
- require_once 'classes/class-fl-builder-icons.php';
35
- require_once 'classes/class-fl-builder-loop.php';
36
- require_once 'classes/class-fl-builder-model.php';
37
- require_once 'classes/class-fl-builder-module.php';
38
- require_once 'classes/class-fl-builder-photo.php';
39
- require_once 'classes/class-fl-builder-services.php';
40
- require_once 'classes/class-fl-builder-shortcodes.php';
41
- require_once 'classes/class-fl-builder-update.php';
42
- require_once 'classes/class-fl-builder-timezones.php';
43
- require_once 'classes/class-fl-builder-utils.php';
44
-
45
- /* Includes */
46
- require_once 'includes/compatibility.php';
47
- require_once 'includes/updater/updater.php';
48
-
49
- /* Plugin Activation */
50
- register_activation_hook(__FILE__, 'FLBuilderAdmin::activate');
51
-
52
- /* Localization */
53
- add_action('plugins_loaded', 'FLBuilder::load_plugin_textdomain');
54
-
55
- /* Updates */
56
- add_action('init', 'FLBuilderUpdate::init', 11);
57
-
58
- /* Load Settings and Modules */
59
- add_action('init', 'FLBuilderModel::load_settings', 1);
60
- add_action('init', 'FLBuilderModel::load_modules', 2);
61
-
62
- /* Admin AJAX */
63
- add_action('wp_ajax_fl_builder_disable', 'FLBuilderModel::disable');
64
- add_action('wp_ajax_fl_builder_duplicate_wpml_layout', 'FLBuilderModel::duplicate_wpml_layout');
65
-
66
- /* Admin Actions */
67
- add_action('init', 'FLBuilderAdmin::init');
68
- add_action('current_screen', 'FLBuilderAdminPosts::init');
69
- add_action('before_delete_post', 'FLBuilderModel::delete_post');
70
- add_action('save_post', 'FLBuilderModel::save_revision');
71
- add_action('save_post', 'FLBuilderModel::set_node_template_default_type', 10, 3);
72
- add_action('wp_restore_post_revision', 'FLBuilderModel::restore_revision', 10, 2);
73
-
74
- /* Admin Filters */
75
- add_filter('heartbeat_received', 'FLBuilderModel::lock_post', 10, 2);
76
- add_filter('redirect_post_location', 'FLBuilderAdminPosts::redirect_post_location');
77
- add_filter('page_row_actions', 'FLBuilderAdminPosts::render_row_actions_link');
78
- add_filter('post_row_actions', 'FLBuilderAdminPosts::render_row_actions_link');
79
- add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'FLBuilderAdmin::render_plugin_action_links');
80
- add_filter('all_plugins', 'FLBuilderAdmin::white_label_plugins_page');
81
- add_filter('wp_prepare_themes_for_js', 'FLBuilderAdmin::white_label_themes_page');
82
- add_filter('gettext', 'FLBuilderAdmin::white_label_theme_gettext');
83
-
84
- /* Frontend AJAX */
85
- add_action('wp', 'FLBuilderAJAX::init');
86
-
87
- /* Frontend Actions */
88
- add_action('init', 'FLBuilder::register_templates_post_type');
89
- add_action('send_headers', 'FLBuilder::no_cache_headers');
90
- add_action('wp', 'FLBuilder::init');
91
- add_action('wp_enqueue_scripts', 'FLBuilder::register_layout_styles_scripts');
92
- add_action('wp_enqueue_scripts', 'FLBuilder::enqueue_ui_styles_scripts');
93
- add_action('wp_enqueue_scripts', 'FLBuilder::enqueue_all_layouts_styles_scripts');
94
- add_action('wp_head', 'FLBuilder::render_custom_css_for_editing', 999);
95
- add_action('admin_bar_menu', 'FLBuilder::admin_bar_menu', 999);
96
- add_action('wp_footer', 'FLBuilder::include_jquery');
97
- add_action('wp_footer', 'FLBuilder::render_ui');
98
-
99
- /* Frontend Filters */
100
- add_filter('found_posts', 'FLBuilderLoop::found_posts', 1, 2);
101
- add_filter('template_include', 'FLBuilder::render_template', 999);
102
- add_filter('body_class', 'FLBuilder::body_class');
103
- add_filter('wp_default_editor', 'FLBuilder::default_editor');
104
- add_filter('mce_css', 'FLBuilder::add_editor_css');
105
- add_filter('mce_buttons_2', 'FLBuilder::editor_buttons_2');
106
- add_filter('mce_external_plugins', 'FLBuilder::editor_external_plugins', 9999);
107
- add_filter('tiny_mce_before_init', 'FLBuilder::editor_font_sizes');
108
- add_filter('the_content', 'FLBuilder::render_content');
109
- add_filter('fl_builder_render_css', 'FLBuilder::rewrite_css_cache_urls', 9999);
1
  <?php
2
  /**
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.8.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
10
  * License: GNU General Public License v2.0
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  * Text Domain: fl-builder
13
  */
 
 
 
 
 
 
 
 
 
 
14
 
15
+ require_once 'classes/class-fl-builder-loader.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
img/templates-preview.jpg ADDED
Binary file
includes/admin-settings-editing.php CHANGED
@@ -17,11 +17,7 @@
17
  <p><?php printf( __( 'Set the <a%s>capability</a> required for users to access advanced builder editing such as adding, deleting or moving modules.', 'fl-builder' ), ' href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table" target="_blank"' ); ?></p>
18
  <input type="text" name="fl-editing-capability" value="<?php echo esc_html(FLBuilderModel::get_editing_capability()); ?>" class="regular-text" />
19
 
20
- <?php if ( file_exists( FL_BUILDER_DIR . 'includes/node-template-settings.php' ) ) : ?>
21
- <h4><?php _e( 'Global Templates Editing Capability', 'fl-builder' ); ?></h4>
22
- <p><?php printf( __( 'Set the <a%s>capability</a> required for users to global templates.', 'fl-builder' ), ' href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table" target="_blank"' ); ?></p>
23
- <input type="text" name="fl-global-templates-editing-capability" value="<?php echo esc_html(FLBuilderModel::get_global_templates_editing_capability()); ?>" class="regular-text" />
24
- <?php endif; ?>
25
 
26
  </div>
27
  <p class="submit">
17
  <p><?php printf( __( 'Set the <a%s>capability</a> required for users to access advanced builder editing such as adding, deleting or moving modules.', 'fl-builder' ), ' href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table" target="_blank"' ); ?></p>
18
  <input type="text" name="fl-editing-capability" value="<?php echo esc_html(FLBuilderModel::get_editing_capability()); ?>" class="regular-text" />
19
 
20
+ <?php do_action( 'fl_builder_admin_settings_editing_form' ); ?>
 
 
 
 
21
 
22
  </div>
23
  <p class="submit">
includes/admin-settings-upgrade.php CHANGED
@@ -1,11 +1,21 @@
1
- <div id="fl-upgrade-form" class="fl-settings-form">
2
 
3
- <h3 class="fl-settings-form-header"><?php _e('Upgrade', 'fl-builder'); ?></h3>
4
 
5
- <p><?php _e('You are currently running the lite version of the Beaver Builder plugin. Upgrade today for access to premium features such as advanced modules, templates, support and more!', 'fl-builder'); ?></p>
6
 
7
- <input type="button" class="button button-primary" value="<?php _e('Upgrade Now', 'fl-builder'); ?>" onclick="window.open('<?php echo FLBuilderModel::get_upgrade_url( array( 'utm_source' => 'external', 'utm_medium' => 'builder', 'utm_campaign' => 'settings-page' ) ); ?>');" style="margin-right: 10px;">
8
 
9
- <input type="button" class="button button-primary" value="<?php _e('Learn More', 'fl-builder'); ?>" onclick="window.open('http://www.wpbeaverbuilder.com/?utm_source=external&utm_medium=builder&utm_campaign=settings-page');">
 
 
 
 
 
 
10
 
11
- </div>
 
 
 
 
1
+ <div id="fl-upgrade-form" class="fl-settings-form fl-upgrade-page-content">
2
 
3
+ <h3 class="fl-settings-form-header"><?php _e('Get More Features', 'fl-builder'); ?></h3>
4
 
5
+ <p><?php _e('Along with access to our expert support team, the premium versions of Beaver Builder are packed with more features to save you time and make building websites easier!', 'fl-builder'); ?></p>
6
 
7
+ <h4><?php _e('Premium Features', 'fl-builder'); ?></h4>
8
 
9
+ <ul>
10
+ <li><?php _e('Additional modules: Contact Form, Tabs, Slider, Pricing Table, Map, Blog Posts, Subscribe Form, Social Icons, and many more.', 'fl-builder'); ?></li>
11
+ <li><?php _e('Expert support from our world-class support team.', 'fl-builder'); ?></li>
12
+ <li><?php _e('Beautiful pre-made layout templates.', 'fl-builder'); ?></li>
13
+ <li><?php _e('Save, export, and reuse full-page layouts, rows, and modules.', 'fl-builder'); ?></li>
14
+ <li><?php _e('Build your own custom modules.', 'fl-builder'); ?></li>
15
+ </ul>
16
 
17
+ <p><?php _e('Come by the Beaver Builder Homepage to learn more about what our premium features can do for you!', 'fl-builder'); ?></p>
18
+
19
+ <input type="button" class="button button-primary" value="<?php _e('Learn More', 'fl-builder'); ?>" onclick="window.open('<?php echo FLBuilderModel::get_upgrade_url( array( 'utm_medium' => 'bb-lite', 'utm_source' => 'upgrade-settings-page', 'utm_campaign' => 'settings-upgrade-button' ) ); ?>');" style="margin-right: 10px;">
20
+
21
+ </div>
includes/admin-settings-welcome.php CHANGED
@@ -4,7 +4,15 @@
4
 
5
  <div class="fl-settings-form-content fl-welcome-page-content">
6
 
7
- <p><?php _e('Thank you for choosing Beaver Builder and welcome to the colony! Find some helpful information below. Also, to the left are the Page Builder settings options.', 'fl-builder'); ?></p>
 
 
 
 
 
 
 
 
8
 
9
  <h4><?php _e('Getting Started - Building your first page.', 'fl-builder'); ?></h4>
10
 
@@ -21,8 +29,8 @@
21
  <p><?php _e('There\'s a wonderful community of "Beaver Builders" out there and we\'d love it if <em>you</em> joined us!', 'fl-builder'); ?></p>
22
 
23
  <ul>
24
- <li><?php _e('<a href="https://www.facebook.com/groups/beaverbuilders/" target="_blank">Join the Beaver Builder\'s Group on Facebook</a>', 'fl-builder'); ?></li>
25
- <li><?php _e('<a href="https://beaverbuilders.herokuapp.com/" target="_blank">Join the Beaver Builder\'s Group on Slack</a>', 'fl-builder'); ?></li>
26
  </ul>
27
 
28
  <p><?php _e('Come by and share a project, ask a question, or just say hi! For news about new features and updates, like our <a href="https://www.facebook.com/wpbeaverbuilder/" target="_blank">Facebook Page</a> or follow us <a href="https://twitter.com/beaverbuilder" target="_blank">on Twitter</a>.', 'fl-builder'); ?></p>
@@ -41,17 +49,18 @@
41
 
42
  <div class="fl-welcome-col">
43
 
44
- <h4><?php _e('What\'s New in Beaver Builder 1.7', 'fl-builder'); ?></h4>
45
 
46
- <p><?php _e('Beaver Builder 1.7 is live and it\'s got some slick new features:', 'fl-builder'); ?></p>
47
 
48
  <ul>
49
- <li><?php _e('Partial Refresh is live and will make your builder experience faster and more fluid.', 'fl-builder'); ?></li>
50
- <li><?php _e('The Audio Module and Count Down module are available!', 'fl-builder'); ?></li>
51
- <li><?php _e('You can now insert layouts with a shortcode.', 'fl-builder'); ?></li>
 
52
  </ul>
53
 
54
- <p><?php _e('Read more our <a href="https://www.wpbeaverbuilder.com/beaver-builder-1-7-now-with-partial-refresh-per-page-code-settings-and-our-first-shortcode/" target="_blank">update post</a> or <a href="https://www.wpbeaverbuilder.com/change-logs/" target="_blank">change logs</a>.', 'fl-builder'); ?></p>
55
 
56
  </div>
57
 
@@ -63,9 +72,13 @@
63
 
64
  <p><?php _e('The fastest way to find an answer to a question is to see if someone\'s already answered it!', 'fl-builder'); ?></p>
65
 
66
- <p><?php _e('For that, check our <a href="https://www.wpbeaverbuilder.com/knowledge-base/" target="_blank">Knowledge Base</a>, <a href="https://www.wpbeaverbuilder.com/frequently-asked-questions/" target="_blank">FAQ page</a>, or search our <a href="http://www.wpbeaverbuilder.com/support/" target="_blank">support forum.</a>', 'fl-builder'); ?></p>
67
 
68
- <p><?php _e('If you can\'t find an answer, feel free to post a question in our <a href="http://www.wpbeaverbuilder.com/support/" target="_blank">support forum</a>.', 'fl-builder'); ?></p>
 
 
 
 
69
  </div>
70
 
71
  </div>
4
 
5
  <div class="fl-settings-form-content fl-welcome-page-content">
6
 
7
+ <p><?php _e('Thank you for choosing Beaver Builder and welcome to the colony! Find some helpful information below. Also, to the left are the Page Builder settings options.', 'fl-builder'); ?>
8
+
9
+ <?php if (true === FL_BUILDER_LITE) : ?>
10
+ <?php printf( __('For more time-saving features and access to our expert support team, <a href="%s" target="_blank">upgrade today</a>.', 'fl-builder'), FLBuilderModel::get_upgrade_url( array( 'utm_medium' => 'bb-lite', 'utm_source' => 'welcome-settings-page', 'utm_campaign' => 'settings-welcome-support' ) ) ); ?>
11
+ <?php else: ?>
12
+ <?php _e('Be sure to add your license key for access to updates and new features.', 'fl-builder'); ?>
13
+ <?php endif; ?>
14
+
15
+ </p>
16
 
17
  <h4><?php _e('Getting Started - Building your first page.', 'fl-builder'); ?></h4>
18
 
29
  <p><?php _e('There\'s a wonderful community of "Beaver Builders" out there and we\'d love it if <em>you</em> joined us!', 'fl-builder'); ?></p>
30
 
31
  <ul>
32
+ <li><?php printf( __( '<a href="https://www.wpbeaverbuilder.com/go/bb-facebook" target="_blank">Join the Beaver Builder\'s Group on Facebook</a>', 'fl-builder' ), ( true === FL_BUILDER_LITE ? 'bb-lite' : 'bb-pro' ) ); ?></li>
33
+ <li><?php printf( __( '<a href="https://www.wpbeaverbuilder.com/go/bb-slack" target="_blank">Join the Beaver Builder\'s Group on Slack</a>', 'fl-builder'), ( true === FL_BUILDER_LITE ? 'bb-lite' : 'bb-pro' ) ); ?></li>
34
  </ul>
35
 
36
  <p><?php _e('Come by and share a project, ask a question, or just say hi! For news about new features and updates, like our <a href="https://www.facebook.com/wpbeaverbuilder/" target="_blank">Facebook Page</a> or follow us <a href="https://twitter.com/beaverbuilder" target="_blank">on Twitter</a>.', 'fl-builder'); ?></p>
49
 
50
  <div class="fl-welcome-col">
51
 
52
+ <h4><?php _e('What\'s New in Beaver Builder 1.8 Gordon', 'fl-builder'); ?></h4>
53
 
54
+ <p><?php _e('Beaver Builder 1.8 is out and it\'s has some epic new features:', 'fl-builder'); ?></p>
55
 
56
  <ul>
57
+ <li><?php _e('16 new landing page templates are available in the template selector.', 'fl-builder'); ?></li>
58
+ <li><?php _e('Overhauled Import/Export options and the ability to export single templates.', 'fl-builder'); ?></li>
59
+ <li><?php _e('Hide rows and modules depending on whether a user is logged in or out.', 'fl-builder'); ?></li>
60
+ <li><?php _e('Ability to expand settings panels.', 'fl-builder'); ?></li>
61
  </ul>
62
 
63
+ <p><?php _e('There\'s a whole lot more, too! Read about everything else on our <a href="https://www.wpbeaverbuilder.com/beaver-builder-1-8-gordon/" target="_blank">update post</a> or <a href="https://www.wpbeaverbuilder.com/change-logs/" target="_blank">change logs</a>.', 'fl-builder'); ?></p>
64
 
65
  </div>
66
 
72
 
73
  <p><?php _e('The fastest way to find an answer to a question is to see if someone\'s already answered it!', 'fl-builder'); ?></p>
74
 
75
+ <p><?php _e('For that, check our <a href="https://www.wpbeaverbuilder.com/knowledge-base/" target="_blank">Knowledge Base</a>, <a href="https://www.wpbeaverbuilder.com/frequently-asked-questions/" target="_blank">FAQ page</a>, or search our legacy <a href="http://www.wpbeaverbuilder.com/support/" target="_blank">support forum.</a>', 'fl-builder'); ?></p>
76
 
77
+ <?php if (true === FL_BUILDER_LITE) : ?>
78
+ <p><?php printf( __('If you can\'t find an answer, consider upgrading to a premium version of Beaver Builder. Our expert support team is waiting to answer your questions and help you build your website. <a href="%s" target="_blank">Learn More</a>.', 'fl-builder'), FLBuilderModel::get_upgrade_url( array( 'utm_medium' => 'bb-lite', 'utm_source' => 'welcome-settings-page', 'utm_campaign' => 'settings-welcome-support' ) ) ); ?></p>
79
+ <?php else: ?>
80
+ <p><?php _e('If you can\'t find an answer, feel free to <a href="https://www.wpbeaverbuilder.com/beaver-builder-support/" target="_blank">send us a message with your question.</a>', 'fl-builder'); ?></p>
81
+ <?php endif; ?>
82
  </div>
83
 
84
  </div>
includes/column-css.php CHANGED
@@ -64,14 +64,14 @@
64
  <?php endif; ?>
65
 
66
  <?php if($col->settings->bg_type == 'color' && !empty($col->settings->bg_color)) : // Background Color ?>
67
- .fl-node-<?php echo $col->node; ?> .fl-col-content {
68
  background-color: #<?php echo $col->settings->bg_color; ?>;
69
  background-color: rgba(<?php echo implode(',', FLBuilderColor::hex_to_rgb($col->settings->bg_color)) ?>, <?php echo $col->settings->bg_opacity/100; ?>);
70
  }
71
  <?php endif; ?>
72
 
73
  <?php if($col->settings->bg_type == 'photo' && !empty($col->settings->bg_image)) : // Background Image ?>
74
- .fl-node-<?php echo $col->node; ?> .fl-col-content {
75
  background-image: url(<?php echo $col->settings->bg_image_src; ?>);
76
  background-repeat: <?php echo $col->settings->bg_repeat; ?>;
77
  background-position: <?php echo $col->settings->bg_position; ?>;
@@ -81,14 +81,14 @@
81
  <?php endif; ?>
82
 
83
  <?php if( in_array( $col->settings->bg_type, array('photo') ) && ! empty( $col->settings->bg_overlay_color ) ) : // Background Overlay Color ?>
84
- .fl-node-<?php echo $col->node; ?> .fl-col-content:after {
85
  background-color: #<?php echo $col->settings->bg_overlay_color; ?>;
86
  background-color: rgba(<?php echo implode( ',', FLBuilderColor::hex_to_rgb( $col->settings->bg_overlay_color ) ) ?>, <?php echo $col->settings->bg_overlay_opacity/100; ?>);
87
  }
88
  <?php endif; ?>
89
 
90
  <?php if(!empty($col->settings->border_type)) : // Border ?>
91
- .fl-builder-content .fl-node-<?php echo $col->node; ?> .fl-col-content {
92
  border-style: <?php echo $col->settings->border_type; ?>;
93
  border-color: #<?php echo $col->settings->border_color; ?>;
94
  border-color: rgba(<?php echo implode(',', FLBuilderColor::hex_to_rgb($col->settings->border_color)) ?>, <?php echo $col->settings->border_opacity/100; ?>);
64
  <?php endif; ?>
65
 
66
  <?php if($col->settings->bg_type == 'color' && !empty($col->settings->bg_color)) : // Background Color ?>
67
+ .fl-node-<?php echo $col->node; ?> > .fl-col-content {
68
  background-color: #<?php echo $col->settings->bg_color; ?>;
69
  background-color: rgba(<?php echo implode(',', FLBuilderColor::hex_to_rgb($col->settings->bg_color)) ?>, <?php echo $col->settings->bg_opacity/100; ?>);
70
  }
71
  <?php endif; ?>
72
 
73
  <?php if($col->settings->bg_type == 'photo' && !empty($col->settings->bg_image)) : // Background Image ?>
74
+ .fl-node-<?php echo $col->node; ?> > .fl-col-content {
75
  background-image: url(<?php echo $col->settings->bg_image_src; ?>);
76
  background-repeat: <?php echo $col->settings->bg_repeat; ?>;
77
  background-position: <?php echo $col->settings->bg_position; ?>;
81
  <?php endif; ?>
82
 
83
  <?php if( in_array( $col->settings->bg_type, array('photo') ) && ! empty( $col->settings->bg_overlay_color ) ) : // Background Overlay Color ?>
84
+ .fl-node-<?php echo $col->node; ?> > .fl-col-content:after {
85
  background-color: #<?php echo $col->settings->bg_overlay_color; ?>;
86
  background-color: rgba(<?php echo implode( ',', FLBuilderColor::hex_to_rgb( $col->settings->bg_overlay_color ) ) ?>, <?php echo $col->settings->bg_overlay_opacity/100; ?>);
87
  }
88
  <?php endif; ?>
89
 
90
  <?php if(!empty($col->settings->border_type)) : // Border ?>
91
+ .fl-builder-content .fl-node-<?php echo $col->node; ?> > .fl-col-content {
92
  border-style: <?php echo $col->settings->border_type; ?>;
93
  border-color: #<?php echo $col->settings->border_color; ?>;
94
  border-color: rgba(<?php echo implode(',', FLBuilderColor::hex_to_rgb($col->settings->border_color)) ?>, <?php echo $col->settings->border_opacity/100; ?>);
includes/column-settings.php CHANGED
@@ -29,6 +29,23 @@ FLBuilder::register_settings_form('col', array(
29
  'no' => __( 'No', 'fl-builder' ),
30
  'yes' => __( 'Yes', 'fl-builder' ),
31
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  'preview' => array(
33
  'type' => 'none'
34
  )
@@ -510,6 +527,50 @@ FLBuilder::register_settings_form('col', array(
510
  'preview' => array(
511
  'type' => 'none'
512
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
  )
514
  )
515
  ),
29
  'no' => __( 'No', 'fl-builder' ),
30
  'yes' => __( 'Yes', 'fl-builder' ),
31
  ),
32
+ 'toggle' => array(
33
+ 'yes' => array(
34
+ 'fields' => array('content_alignment')
35
+ )
36
+ ),
37
+ 'preview' => array(
38
+ 'type' => 'none'
39
+ )
40
+ ),
41
+ 'content_alignment' => array(
42
+ 'type' => 'select',
43
+ 'label' => __('Content Alignment', 'fl-builder'),
44
+ 'default' => 'top',
45
+ 'options' => array(
46
+ 'top' => __( 'Top', 'fl-builder' ),
47
+ 'center' => __( 'Center', 'fl-builder' ),
48
+ ),
49
  'preview' => array(
50
  'type' => 'none'
51
  )
527
  'preview' => array(
528
  'type' => 'none'
529
  )
530
+ ),
531
+ 'responsive_order' => array(
532
+ 'type' => 'select',
533
+ 'label' => __('Stacking Order', 'fl-builder'),
534
+ 'help' => __( 'The order of the columns in this group when they are stacked for small devices.', 'fl-builder' ),
535
+ 'default' => 'default',
536
+ 'options' => array(
537
+ 'default' => __('Default', 'fl-builder'),
538
+ 'reversed' => __('Reversed', 'fl-builder'),
539
+ ),
540
+ 'preview' => array(
541
+ 'type' => 'none'
542
+ )
543
+ ),
544
+ )
545
+ ),
546
+ 'visibility' => array(
547
+ 'title' => __('Visibility', 'fl-builder'),
548
+ 'fields' => array(
549
+ 'visibility_display' => array(
550
+ 'type' => 'select',
551
+ 'label' => __('Display', 'fl-builder'),
552
+ 'options' => array(
553
+ '' => __('Always', 'fl-builder'),
554
+ 'logged_out' => __('Logged Out User', 'fl-builder'),
555
+ 'logged_in' => __('Logged In User', 'fl-builder'),
556
+ '0' => __('Never', 'fl-builder'),
557
+ ),
558
+ 'toggle' => array(
559
+ 'logged_in' => array(
560
+ 'fields' => array('visibility_user_capability')
561
+ )
562
+ ),
563
+ 'preview' => array(
564
+ 'type' => 'none'
565
+ )
566
+ ),
567
+ 'visibility_user_capability' => array(
568
+ 'type' => 'text',
569
+ 'label' => __('User Capability', 'fl-builder'),
570
+ 'description' => sprintf( __( 'Optional. Set the <a%s>capability</a> required for users to view this column.', 'fl-builder' ), ' href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table" target="_blank"' ),
571
+ 'preview' => array(
572
+ 'type' => 'none'
573
+ ),
574
  )
575
  )
576
  ),
includes/export-filters.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <div class="export-filters" id="fl-builder-template-filters">
2
+ <select id="fl-builder-template-export-select" name="fl-builder-template-export-select">
3
+ <option value="all"><?php _e( 'All Templates', 'fl-builder' ); ?></option>
4
+ <option value="selected"><?php _e( 'Selected Templates', 'fl-builder' ); ?></option>
5
+ </select>
6
+ <span class="spinner"></span>
7
+ <div id="fl-builder-template-export-posts"></div>
8
+ </div>
includes/export.php ADDED
@@ -0,0 +1,438 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Modified version of the WordPress Export Administration API
4
+ * that lets us export single posts and selected groups of posts.
5
+ *
6
+ * @package WordPress
7
+ * @subpackage Administration
8
+ */
9
+
10
+ /**
11
+ * Generates the WXR export file for download.
12
+ *
13
+ * @since 2.1.0
14
+ *
15
+ * @global wpdb $wpdb
16
+ * @global WP_Post $post
17
+ *
18
+ * @param array $post_ids
19
+ */
20
+ function fl_export_wp( $post_ids = array() ) {
21
+ global $wpdb, $post;
22
+
23
+ if ( empty( $post_ids ) ) {
24
+ return;
25
+ }
26
+
27
+ $sitename = sanitize_key( get_bloginfo( 'name' ) );
28
+ if ( ! empty( $sitename ) ) {
29
+ $sitename .= '.';
30
+ }
31
+ $date = date( 'Y-m-d' );
32
+ $wp_filename = $sitename . 'wordpress.' . $date . '.xml';
33
+ /**
34
+ * Filter the export filename.
35
+ *
36
+ * @since 4.4.0
37
+ *
38
+ * @param string $wp_filename The name of the file for download.
39
+ * @param string $sitename The site name.
40
+ * @param string $date Today's date, formatted.
41
+ */
42
+ $filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );
43
+
44
+ header( 'Content-Description: File Transfer' );
45
+ header( 'Content-Disposition: attachment; filename=' . $filename );
46
+ header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
47
+
48
+ /**
49
+ * Wrap given string in XML CDATA tag.
50
+ *
51
+ * @since 2.1.0
52
+ *
53
+ * @param string $str String to wrap in XML CDATA tag.
54
+ * @return string
55
+ */
56
+ function wxr_cdata( $str ) {
57
+ if ( ! seems_utf8( $str ) ) {
58
+ $str = utf8_encode( $str );
59
+ }
60
+ // $str = ent2ncr(esc_html($str));
61
+ $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
62
+
63
+ return $str;
64
+ }
65
+
66
+ /**
67
+ * Return the URL of the site
68
+ *
69
+ * @since 2.5.0
70
+ *
71
+ * @return string Site URL.
72
+ */
73
+ function wxr_site_url() {
74
+ // Multisite: the base URL.
75
+ if ( is_multisite() )
76
+ return network_home_url();
77
+ // WordPress (single site): the blog URL.
78
+ else
79
+ return get_bloginfo_rss( 'url' );
80
+ }
81
+
82
+ /**
83
+ * Output a cat_name XML tag from a given category object
84
+ *
85
+ * @since 2.1.0
86
+ *
87
+ * @param object $category Category Object
88
+ */
89
+ function wxr_cat_name( $category ) {
90
+ if ( empty( $category->name ) )
91
+ return;
92
+
93
+ echo '<wp:cat_name>' . wxr_cdata( $category->name ) . '</wp:cat_name>';
94
+ }
95
+
96
+ /**
97
+ * Output a category_description XML tag from a given category object
98
+ *
99
+ * @since 2.1.0
100
+ *
101
+ * @param object $category Category Object
102
+ */
103
+ function wxr_category_description( $category ) {
104
+ if ( empty( $category->description ) )
105
+ return;
106
+
107
+ echo '<wp:category_description>' . wxr_cdata( $category->description ) . '</wp:category_description>';
108
+ }
109
+
110
+ /**
111
+ * Output a tag_name XML tag from a given tag object
112
+ *
113
+ * @since 2.3.0
114
+ *
115
+ * @param object $tag Tag Object
116
+ */
117
+ function wxr_tag_name( $tag ) {
118
+ if ( empty( $tag->name ) )
119
+ return;
120
+
121
+ echo '<wp:tag_name>' . wxr_cdata( $tag->name ) . '</wp:tag_name>';
122
+ }
123
+
124
+ /**
125
+ * Output a tag_description XML tag from a given tag object
126
+ *
127
+ * @since 2.3.0
128
+ *
129
+ * @param object $tag Tag Object
130
+ */
131
+ function wxr_tag_description( $tag ) {
132
+ if ( empty( $tag->description ) )
133
+ return;
134
+
135
+ echo '<wp:tag_description>' . wxr_cdata( $tag->description ) . '</wp:tag_description>';
136
+ }
137
+
138
+ /**
139
+ * Output a term_name XML tag from a given term object
140
+ *
141
+ * @since 2.9.0
142
+ *
143
+ * @param object $term Term Object
144
+ */
145
+ function wxr_term_name( $term ) {
146
+ if ( empty( $term->name ) )
147
+ return;
148
+
149
+ echo '<wp:term_name>' . wxr_cdata( $term->name ) . '</wp:term_name>';
150
+ }
151
+
152
+ /**
153
+ * Output a term_description XML tag from a given term object
154
+ *
155
+ * @since 2.9.0
156
+ *
157
+ * @param object $term Term Object
158
+ */
159
+ function wxr_term_description( $term ) {
160
+ if ( empty( $term->description ) )
161
+ return;
162
+
163
+ echo '<wp:term_description>' . wxr_cdata( $term->description ) . '</wp:term_description>';
164
+ }
165
+
166
+ /**
167
+ * Output list of authors with posts
168
+ *
169
+ * @since 3.1.0
170
+ *
171
+ * @global wpdb $wpdb WordPress database abstraction object.
172
+ *
173
+ * @param array $post_ids Array of post IDs to filter the query by. Optional.
174
+ */
175
+ function wxr_authors_list( array $post_ids = null ) {
176
+ global $wpdb;
177
+
178
+ if ( !empty( $post_ids ) ) {
179
+ $post_ids = array_map( 'absint', $post_ids );
180
+ $and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';
181
+ } else {
182
+ $and = '';
183
+ }
184
+
185
+ $authors = array();
186
+ $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" );
187
+ foreach ( (array) $results as $result )
188
+ $authors[] = get_userdata( $result->post_author );
189
+
190
+ $authors = array_filter( $authors );
191
+
192
+ foreach ( $authors as $author ) {
193
+ echo "\t<wp:author>";
194
+ echo '<wp:author_id>' . intval( $author->ID ) . '</wp:author_id>';
195
+ echo '<wp:author_login>' . wxr_cdata( $author->user_login ) . '</wp:author_login>';
196
+ echo '<wp:author_email>' . wxr_cdata( $author->user_email ) . '</wp:author_email>';
197
+ echo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';
198
+ echo '<wp:author_first_name>' . wxr_cdata( $author->first_name ) . '</wp:author_first_name>';
199
+ echo '<wp:author_last_name>' . wxr_cdata( $author->last_name ) . '</wp:author_last_name>';
200
+ echo "</wp:author>\n";
201
+ }
202
+ }
203
+
204
+ /**
205
+ * Ouput all navigation menu terms
206
+ *
207
+ * @since 3.1.0
208
+ */
209
+ function wxr_nav_menu_terms() {
210
+ $nav_menus = wp_get_nav_menus();
211
+ if ( empty( $nav_menus ) || ! is_array( $nav_menus ) )
212
+ return;
213
+
214
+ foreach ( $nav_menus as $menu ) {
215
+ echo "\t<wp:term>";
216
+ echo '<wp:term_id>' . intval( $menu->term_id ) . '</wp:term_id>';
217
+ echo '<wp:term_taxonomy>nav_menu</wp:term_taxonomy>';
218
+ echo '<wp:term_slug>' . wxr_cdata( $menu->slug ) . '</wp:term_slug>';
219
+ wxr_term_name( $menu );
220
+ echo "</wp:term>\n";
221
+ }
222
+ }
223
+
224
+ /**
225
+ * Output list of taxonomy terms, in XML tag format, associated with a post
226
+ *
227
+ * @since 2.3.0
228
+ */
229
+ function wxr_post_taxonomy() {
230
+ $post = get_post();
231
+
232
+ $taxonomies = get_object_taxonomies( $post->post_type );
233
+ if ( empty( $taxonomies ) )
234
+ return;
235
+ $terms = wp_get_object_terms( $post->ID, $taxonomies );
236
+
237
+ foreach ( (array) $terms as $term ) {
238
+ echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . wxr_cdata( $term->name ) . "</category>\n";
239
+ }
240
+ }
241
+
242
+ /**
243
+ *
244
+ * @param bool $return_me
245
+ * @param string $meta_key
246
+ * @return bool
247
+ */
248
+ function wxr_filter_postmeta( $return_me, $meta_key ) {
249
+ if ( '_edit_lock' == $meta_key )
250
+ $return_me = true;
251
+ return $return_me;
252
+ }
253
+ add_filter( 'wxr_export_skip_postmeta', 'wxr_filter_postmeta', 10, 2 );
254
+
255
+ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . "\" ?>\n";
256
+
257
+ ?>
258
+ <!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
259
+ <!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
260
+ <!-- You may use this file to transfer that content from one site to another. -->
261
+ <!-- This file is not intended to serve as a complete backup of your site. -->
262
+
263
+ <!-- To import this information into a WordPress site follow these steps: -->
264
+ <!-- 1. Log in to that site as an administrator. -->
265
+ <!-- 2. Go to Tools: Import in the WordPress admin panel. -->
266
+ <!-- 3. Install the "WordPress" importer from the list. -->
267
+ <!-- 4. Activate & Run Importer. -->
268
+ <!-- 5. Upload this file using the form provided on that page. -->
269
+ <!-- 6. You will first be asked to map the authors in this export file to users -->
270
+ <!-- on the site. For each author, you may choose to map to an -->
271
+ <!-- existing user on the site or to create a new user. -->
272
+ <!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
273
+ <!-- contained in this file into your site. -->
274
+
275
+ <?php the_generator( 'export' ); ?>
276
+ <rss version="2.0"
277
+ xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/"
278
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
279
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
280
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
281
+ xmlns:wp="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/"
282
+ >
283
+
284
+ <channel>
285
+ <title><?php bloginfo_rss( 'name' ); ?></title>
286
+ <link><?php bloginfo_rss( 'url' ); ?></link>
287
+ <description><?php bloginfo_rss( 'description' ); ?></description>
288
+ <pubDate><?php echo date( 'D, d M Y H:i:s +0000' ); ?></pubDate>
289
+ <language><?php bloginfo_rss( 'language' ); ?></language>
290
+ <wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
291
+ <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
292
+ <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
293
+
294
+ <?php wxr_authors_list( $post_ids ); ?>
295
+
296
+ <?php
297
+ /** This action is documented in wp-includes/feed-rss2.php */
298
+ do_action( 'rss2_head' );
299
+ ?>
300
+
301
+ <?php if ( $post_ids ) {
302
+ /**
303
+ * @global WP_Query $wp_query
304
+ */
305
+ global $wp_query;
306
+
307
+ // Fake being in the loop.
308
+ $wp_query->in_the_loop = true;
309
+
310
+ // Fetch 20 posts at a time rather than loading the entire table into memory.
311
+ while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
312
+ $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
313
+ $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
314
+
315
+ // Begin Loop.
316
+ foreach ( $posts as $post ) {
317
+ setup_postdata( $post );
318
+ $is_sticky = is_sticky( $post->ID ) ? 1 : 0;
319
+ ?>
320
+ <item>
321
+ <title><?php
322
+ /** This filter is documented in wp-includes/feed.php */
323
+ echo apply_filters( 'the_title_rss', $post->post_title );
324
+ ?></title>
325
+ <link><?php the_permalink_rss() ?></link>
326
+ <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
327
+ <dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
328
+ <guid isPermaLink="false"><?php the_guid(); ?></guid>
329
+ <description></description>
330
+ <content:encoded><?php
331
+ /**
332
+ * Filter the post content used for WXR exports.
333
+ *
334
+ * @since 2.5.0
335
+ *
336
+ * @param string $post_content Content of the current post.
337
+ */
338
+ echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
339
+ ?></content:encoded>
340
+ <excerpt:encoded><?php
341
+ /**
342
+ * Filter the post excerpt used for WXR exports.
343
+ *
344
+ * @since 2.6.0
345
+ *
346
+ * @param string $post_excerpt Excerpt for the current post.
347
+ */
348
+ echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
349
+ ?></excerpt:encoded>
350
+ <wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>
351
+ <wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
352
+ <wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
353
+ <wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>
354
+ <wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>
355
+ <wp:post_name><?php echo wxr_cdata( $post->post_name ); ?></wp:post_name>
356
+ <wp:status><?php echo wxr_cdata( $post->post_status ); ?></wp:status>
357
+ <wp:post_parent><?php echo intval( $post->post_parent ); ?></wp:post_parent>
358
+ <wp:menu_order><?php echo intval( $post->menu_order ); ?></wp:menu_order>
359
+ <wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>
360
+ <wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
361
+ <wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>
362
+ <?php if ( $post->post_type == 'attachment' ) : ?>
363
+ <wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
364
+ <?php endif; ?>
365
+ <?php wxr_post_taxonomy(); ?>
366
+ <?php $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
367
+ foreach ( $postmeta as $meta ) :
368
+ /**
369
+ * Filter whether to selectively skip post meta used for WXR exports.
370
+ *
371
+ * Returning a truthy value to the filter will skip the current meta
372
+ * object from being exported.
373
+ *
374
+ * @since 3.3.0
375
+ *
376
+ * @param bool $skip Whether to skip the current post meta. Default false.
377
+ * @param string $meta_key Current meta key.
378
+ * @param object $meta Current meta object.
379
+ */
380
+ if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) )
381
+ continue;
382
+ ?>
383
+ <wp:postmeta>
384
+ <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
385
+ <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
386
+ </wp:postmeta>
387
+ <?php endforeach;
388
+
389
+ $_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
390
+ $comments = array_map( 'get_comment', $_comments );
391
+ foreach ( $comments as $c ) : ?>
392
+ <wp:comment>
393
+ <wp:comment_id><?php echo intval( $c->comment_ID ); ?></wp:comment_id>
394
+ <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
395
+ <wp:comment_author_email><?php echo wxr_cdata( $c->comment_author_email ); ?></wp:comment_author_email>
396
+ <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
397
+ <wp:comment_author_IP><?php echo wxr_cdata( $c->comment_author_IP ); ?></wp:comment_author_IP>
398
+ <wp:comment_date><?php echo wxr_cdata( $c->comment_date ); ?></wp:comment_date>
399
+ <wp:comment_date_gmt><?php echo wxr_cdata( $c->comment_date_gmt ); ?></wp:comment_date_gmt>
400
+ <wp:comment_content><?php echo wxr_cdata( $c->comment_content ) ?></wp:comment_content>
401
+ <wp:comment_approved><?php echo wxr_cdata( $c->comment_approved ); ?></wp:comment_approved>
402
+ <wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>
403
+ <wp:comment_parent><?php echo intval( $c->comment_parent ); ?></wp:comment_parent>
404
+ <wp:comment_user_id><?php echo intval( $c->user_id ); ?></wp:comment_user_id>
405
+ <?php $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
406
+ foreach ( $c_meta as $meta ) :
407
+ /**
408
+ * Filter whether to selectively skip comment meta used for WXR exports.
409
+ *
410
+ * Returning a truthy value to the filter will skip the current meta
411
+ * object from being exported.
412
+ *
413
+ * @since 4.0.0
414
+ *
415
+ * @param bool $skip Whether to skip the current comment meta. Default false.
416
+ * @param string $meta_key Current meta key.
417
+ * @param object $meta Current meta object.
418
+ */
419
+ if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
420
+ continue;
421
+ }
422
+ ?>
423
+ <wp:commentmeta>
424
+ <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
425
+ <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
426
+ </wp:commentmeta>
427
+ <?php endforeach; ?>
428
+ </wp:comment>
429
+ <?php endforeach; ?>
430
+ </item>
431
+ <?php
432
+ }
433
+ }
434
+ } ?>
435
+ </channel>
436
+ </rss>
437
+ <?php
438
+ }
includes/field-time.php CHANGED
@@ -3,6 +3,10 @@
3
  $hours = array_merge( $prepend, range( 10, 12 ) );
4
  $minutes = array_merge( array('00'), $prepend, range( 10, 59 ) );
5
  $day_period = array( 'am', 'pm' );
 
 
 
 
6
  ?>
7
  <select name="<?php echo $name . '[][hours]'; ?>" class="fl-time-field-hours">
8
  <?php foreach( $hours as $hour ) : ?>
3
  $hours = array_merge( $prepend, range( 10, 12 ) );
4
  $minutes = array_merge( array('00'), $prepend, range( 10, 59 ) );
5
  $day_period = array( 'am', 'pm' );
6
+
7
+ if ( is_object( $value ) ) {
8
+ $value = (array) $value;
9
+ }
10
  ?>
11
  <select name="<?php echo $name . '[][hours]'; ?>" class="fl-time-field-hours">
12
  <?php foreach( $hours as $hour ) : ?>
includes/field.php CHANGED
@@ -33,10 +33,14 @@
33
  $field_file = FL_BUILDER_DIR . 'includes/field-' . $field['type'] . '.php';
34
 
35
  if(file_exists($field_file)) {
36
- include $field_file;
 
 
37
  }
38
  else {
39
- do_action('fl_builder_control_' . $field['type'], $name, $value, $field, $settings);
 
 
40
  }
41
 
42
  ?>
33
  $field_file = FL_BUILDER_DIR . 'includes/field-' . $field['type'] . '.php';
34
 
35
  if(file_exists($field_file)) {
36
+ do_action('fl_builder_before_control_' . $field['type'], $name, $value, $field, $settings);
37
+ include $field_file;
38
+ do_action('fl_builder_after_control_' . $field['type'], $name, $value, $field, $settings);
39
  }
40
  else {
41
+ do_action('fl_builder_before_control_' . $field['type'], $name, $value, $field, $settings);
42
+ do_action('fl_builder_control_' . $field['type'], $name, $value, $field, $settings);
43
+ do_action('fl_builder_after_control_' . $field['type'], $name, $value, $field, $settings);
44
  }
45
 
46
  ?>
includes/layout-settings.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  FLBuilder::register_settings_form('layout', array(
4
- 'title' => __('Layout Settings', 'fl-builder'),
5
  'tabs' => array(
6
  'css' => array(
7
  'title' => __('CSS', 'fl-builder'),
@@ -42,4 +42,4 @@ FLBuilder::register_settings_form('layout', array(
42
  )
43
  )
44
  )
45
- ));
1
  <?php
2
 
3
  FLBuilder::register_settings_form('layout', array(
4
+ 'title' => __('Layout CSS / Javascript', 'fl-builder'),
5
  'tabs' => array(
6
  'css' => array(
7
  'title' => __('CSS', 'fl-builder'),
42
  )
43
  )
44
  )
45
+ ));
includes/module-settings.php CHANGED
@@ -79,6 +79,37 @@ FLBuilder::register_settings_form('module_advanced', array(
79
  )
80
  )
81
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  'animation' => array(
83
  'title' => __('Animation', 'fl-builder'),
84
  'fields' => array(
79
  )
80
  )
81
  ),
82
+ 'visibility' => array(
83
+ 'title' => __('Visibility', 'fl-builder'),
84
+ 'fields' => array(
85
+ 'visibility_display' => array(
86
+ 'type' => 'select',
87
+ 'label' => __('Display', 'fl-builder'),
88
+ 'options' => array(
89
+ '' => __('Always', 'fl-builder'),
90
+ 'logged_out' => __('Logged Out User', 'fl-builder'),
91
+ 'logged_in' => __('Logged In User', 'fl-builder'),
92
+ '0' => __('Never', 'fl-builder'),
93
+ ),
94
+ 'toggle' => array(
95
+ 'logged_in' => array(
96
+ 'fields' => array('visibility_user_capability')
97
+ )
98
+ ),
99
+ 'preview' => array(
100
+ 'type' => 'none'
101
+ )
102
+ ),
103
+ 'visibility_user_capability' => array(
104
+ 'type' => 'text',
105
+ 'label' => __('User Capability', 'fl-builder'),
106
+ 'description' => sprintf( __( 'Optional. Set the <a%s>capability</a> required for users to view this module.', 'fl-builder' ), ' href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table" target="_blank"' ),
107
+ 'preview' => array(
108
+ 'type' => 'none'
109
+ ),
110
+ )
111
+ )
112
+ ),
113
  'animation' => array(
114
  'title' => __('Animation', 'fl-builder'),
115
  'fields' => array(
includes/row-css.php CHANGED
@@ -60,14 +60,14 @@
60
  <?php endif; ?>
61
 
62
  <?php if(in_array( $row->settings->bg_type, array('color', 'photo', 'parallax', 'slideshow', 'video') ) && !empty($row->settings->bg_color)) : // Background Color ?>
63
- .fl-node-<?php echo $row->node; ?> .fl-row-content-wrap {
64
  background-color: #<?php echo $row->settings->bg_color; ?>;
65
  background-color: rgba(<?php echo implode(',', FLBuilderColor::hex_to_rgb($row->settings->bg_color)) ?>, <?php echo $row->settings->bg_opacity/100; ?>);
66
  }
67
  <?php endif; ?>
68
 
69
  <?php if($row->settings->bg_type == 'photo' && !empty($row->settings->bg_image)) : // Background Photo ?>
70
- .fl-node-<?php echo $row->node; ?> .fl-row-content-wrap {
71
  background-image: url(<?php echo $row->settings->bg_image_src; ?>);
72
  background-repeat: <?php echo $row->settings->bg_repeat; ?>;
73
  background-position: <?php echo $row->settings->bg_position; ?>;
@@ -77,20 +77,20 @@
77
  <?php endif; ?>
78
 
79
  <?php if( in_array( $row->settings->bg_type, array('photo', 'parallax', 'slideshow', 'video') ) && !empty($row->settings->bg_overlay_color)) : // Background Color Overlay ?>
80
- .fl-node-<?php echo $row->node; ?> .fl-row-content-wrap:after {
81
  background-color: #<?php echo $row->settings->bg_overlay_color; ?>;
82
  background-color: rgba(<?php echo implode(',', FLBuilderColor::hex_to_rgb($row->settings->bg_overlay_color)) ?>, <?php echo $row->settings->bg_overlay_opacity/100; ?>);
83
  }
84
  <?php endif; ?>
85
 
86
  <?php if($row->settings->bg_type == 'parallax' && !empty($row->settings->bg_parallax_image_src)) : // Parallax Background ?>
87
- .fl-node-<?php echo $row->node; ?> .fl-row-content-wrap {
88
  background-repeat: no-repeat;
89
  background-position: center center;
90
  background-attachment: fixed;
91
  background-size: cover;
92
  }
93
- .fl-builder-mobile .fl-node-<?php echo $row->node; ?> .fl-row-content-wrap {
94
  background-image: url(<?php echo $row->settings->bg_parallax_image_src; ?>);
95
  background-attachment: scroll;
96
  background-position: center center;
@@ -98,7 +98,7 @@
98
  <?php endif; ?>
99
 
100
  <?php if(!empty($row->settings->border_type)) : // Border ?>
101
- .fl-node-<?php echo $row->node; ?> .fl-row-content-wrap {
102
  border-style: <?php echo $row->settings->border_type; ?>;
103
  border-top-width: <?php echo is_numeric($row->settings->border_top) ? $row->settings->border_top : '0'; ?>px;
104
  border-bottom-width: <?php echo is_numeric($row->settings->border_bottom) ? $row->settings->border_bottom : '0'; ?>px;
60
  <?php endif; ?>
61
 
62
  <?php if(in_array( $row->settings->bg_type, array('color', 'photo', 'parallax', 'slideshow', 'video') ) && !empty($row->settings->bg_color)) : // Background Color ?>
63
+ .fl-node-<?php echo $row->node; ?> > .fl-row-content-wrap {
64
  background-color: #<?php echo $row->settings->bg_color; ?>;
65
  background-color: rgba(<?php echo implode(',', FLBuilderColor::hex_to_rgb($row->settings->bg_color)) ?>, <?php echo $row->settings->bg_opacity/100; ?>);
66
  }
67
  <?php endif; ?>
68
 
69
  <?php if($row->settings->bg_type == 'photo' && !empty($row->settings->bg_image)) : // Background Photo ?>
70
+ .fl-node-<?php echo $row->node; ?> > .fl-row-content-wrap {
71
  background-image: url(<?php echo $row->settings->bg_image_src; ?>);
72
  background-repeat: <?php echo $row->settings->bg_repeat; ?>;
73
  background-position: <?php echo $row->settings->bg_position; ?>;
77
  <?php endif; ?>
78
 
79
  <?php if( in_array( $row->settings->bg_type, array('photo', 'parallax', 'slideshow', 'video') ) && !empty($row->settings->bg_overlay_color)) : // Background Color Overlay ?>
80
+ .fl-node-<?php echo $row->node; ?> > .fl-row-content-wrap:after {
81
  background-color: #<?php echo $row->settings->bg_overlay_color; ?>;
82
  background-color: rgba(<?php echo implode(',', FLBuilderColor::hex_to_rgb($row->settings->bg_overlay_color)) ?>, <?php echo $row->settings->bg_overlay_opacity/100; ?>);
83
  }
84
  <?php endif; ?>
85
 
86
  <?php if($row->settings->bg_type == 'parallax' && !empty($row->settings->bg_parallax_image_src)) : // Parallax Background ?>
87
+ .fl-node-<?php echo $row->node; ?> > .fl-row-content-wrap {
88
  background-repeat: no-repeat;
89
  background-position: center center;
90
  background-attachment: fixed;
91
  background-size: cover;
92
  }
93
+ .fl-builder-mobile .fl-node-<?php echo $row->node; ?> > .fl-row-content-wrap {
94
  background-image: url(<?php echo $row->settings->bg_parallax_image_src; ?>);
95
  background-attachment: scroll;
96
  background-position: center center;
98
  <?php endif; ?>
99
 
100
  <?php if(!empty($row->settings->border_type)) : // Border ?>
101
+ .fl-node-<?php echo $row->node; ?> > .fl-row-content-wrap {
102
  border-style: <?php echo $row->settings->border_type; ?>;
103
  border-top-width: <?php echo is_numeric($row->settings->border_top) ? $row->settings->border_top : '0'; ?>px;
104
  border-bottom-width: <?php echo is_numeric($row->settings->border_bottom) ? $row->settings->border_bottom : '0'; ?>px;
includes/row-settings.php CHANGED
@@ -51,10 +51,27 @@ FLBuilder::register_settings_form('row', array(
51
  'full' => __('Full Height', 'fl-builder')
52
  ),
53
  'help' => __('Full height rows fill the height of the browser window.', 'fl-builder'),
 
 
 
 
 
54
  'preview' => array(
55
  'type' => 'none'
56
  )
57
  ),
 
 
 
 
 
 
 
 
 
 
 
 
58
  )
59
  ),
60
  'colors' => array(
@@ -215,6 +232,26 @@ FLBuilder::register_settings_form('row', array(
215
  'bg_video' => array(
216
  'title' => __('Background Video', 'fl-builder'),
217
  'fields' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  'bg_video' => array(
219
  'type' => 'video',
220
  'label' => __('Video (MP4)', 'fl-builder'),
@@ -231,6 +268,22 @@ FLBuilder::register_settings_form('row', array(
231
  'type' => 'refresh'
232
  )
233
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  'bg_video_fallback' => array(
235
  'type' => 'photo',
236
  'label' => __('Fallback Photo', 'fl-builder'),
@@ -644,6 +697,37 @@ FLBuilder::register_settings_form('row', array(
644
  )
645
  )
646
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  'css_selectors' => array(
648
  'title' => __('CSS Selectors', 'fl-builder'),
649
  'fields' => array(
51
  'full' => __('Full Height', 'fl-builder')
52
  ),
53
  'help' => __('Full height rows fill the height of the browser window.', 'fl-builder'),
54
+ 'toggle' => array(
55
+ 'full' => array(
56
+ 'fields' => array('content_alignment')
57
+ )
58
+ ),
59
  'preview' => array(
60
  'type' => 'none'
61
  )
62
  ),
63
+ 'content_alignment' => array(
64
+ 'type' => 'select',
65
+ 'label' => __('Content Alignment', 'fl-builder'),
66
+ 'default' => 'center',
67
+ 'options' => array(
68
+ 'top' => __( 'Top', 'fl-builder' ),
69
+ 'center' => __( 'Center', 'fl-builder' ),
70
+ ),
71
+ 'preview' => array(
72
+ 'type' => 'none'
73
+ )
74
+ )
75
  )
76
  ),
77
  'colors' => array(
232
  'bg_video' => array(
233
  'title' => __('Background Video', 'fl-builder'),
234
  'fields' => array(
235
+ 'bg_video_source' => array(
236
+ 'type' => 'select',
237
+ 'label' => __('Source', 'fl-builder'),
238
+ 'default' => 'wordpress',
239
+ 'options' => array(
240
+ 'wordpress' => __('Media Library', 'fl-builder'),
241
+ 'video_url' => 'URL'
242
+ ),
243
+ 'toggle' => array(
244
+ 'wordpress' => array(
245
+ 'fields' => array('bg_video', 'bg_video_webm')
246
+ ),
247
+ 'video_url' => array(
248
+ 'fields' => array('bg_video_url_mp4', 'bg_video_url_webm')
249
+ )
250
+ ),
251
+ 'preview' => array(
252
+ 'type' => 'none'
253
+ )
254
+ ),
255
  'bg_video' => array(
256
  'type' => 'video',
257
  'label' => __('Video (MP4)', 'fl-builder'),
268
  'type' => 'refresh'
269
  )
270
  ),
271
+ 'bg_video_url_mp4' => array(
272
+ 'type' => 'text',
273
+ 'label' => __('Video URL (MP4)', 'fl-builder'),
274
+ 'help' => __('A video in the MP4 format to use as the background of this row. Most modern browsers support this format.', 'fl-builder'),
275
+ 'preview' => array(
276
+ 'type' => 'refresh'
277
+ )
278
+ ),
279
+ 'bg_video_url_webm' => array(
280
+ 'type' => 'text',
281
+ 'label' => __('Video URL (WebM)', 'fl-builder'),
282
+ 'help' => __('A video in the WebM format to use as the background of this row. This format is required to support browsers such as FireFox and Opera.', 'fl-builder'),
283
+ 'preview' => array(
284
+ 'type' => 'refresh'
285
+ )
286
+ ),
287
  'bg_video_fallback' => array(
288
  'type' => 'photo',
289
  'label' => __('Fallback Photo', 'fl-builder'),
697
  )
698
  )
699
  ),
700
+ 'visibility' => array(
701
+ 'title' => __('Visibility', 'fl-builder'),
702
+ 'fields' => array(
703
+ 'visibility_display' => array(
704
+ 'type' => 'select',
705
+ 'label' => __('Display', 'fl-builder'),
706
+ 'options' => array(
707
+ '' => __('Always', 'fl-builder'),
708
+ 'logged_out' => __('Logged Out User', 'fl-builder'),
709
+ 'logged_in' => __('Logged In User', 'fl-builder'),
710
+ '0' => __('Never', 'fl-builder'),
711
+ ),
712
+ 'toggle' => array(
713
+ 'logged_in' => array(
714
+ 'fields' => array('visibility_user_capability')
715
+ )
716
+ ),
717
+ 'preview' => array(
718
+ 'type' => 'none'
719
+ )
720
+ ),
721
+ 'visibility_user_capability' => array(
722
+ 'type' => 'text',
723
+ 'label' => __('User Capability', 'fl-builder'),
724
+ 'description' => sprintf( __( 'Optional. Set the <a%s>capability</a> required for users to view this row.', 'fl-builder' ), ' href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table" target="_blank"' ),
725
+ 'preview' => array(
726
+ 'type' => 'none'
727
+ ),
728
+ )
729
+ )
730
+ ),
731
  'css_selectors' => array(
732
  'title' => __('CSS Selectors', 'fl-builder'),
733
  'fields' => array(
includes/row-video.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="fl-bg-video"
2
  data-width="<?php if ( isset( $vid_data['mp4'] ) ) echo @$vid_data['mp4']->width; else echo @$vid_data['webm']->width; ?>"
3
  data-height="<?php if ( isset( $vid_data['mp4'] ) ) echo @$vid_data['mp4']->height; else echo @$vid_data['webm']->height; ?>"
@@ -9,4 +10,18 @@ data-mp4-type="video/<?php echo $vid_data['mp4']->extension; ?>"
9
  <?php if ( isset( $vid_data['webm'] ) ) : ?>
10
  data-webm="<?php echo $vid_data['webm']->url; ?>"
11
  data-webm-type="video/<?php echo $vid_data['webm']->extension; ?>"
12
- <?php endif; ?>></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($row->settings->bg_video_source == 'wordpress') { ?>
2
  <div class="fl-bg-video"
3
  data-width="<?php if ( isset( $vid_data['mp4'] ) ) echo @$vid_data['mp4']->width; else echo @$vid_data['webm']->width; ?>"
4
  data-height="<?php if ( isset( $vid_data['mp4'] ) ) echo @$vid_data['mp4']->height; else echo @$vid_data['webm']->height; ?>"
10
  <?php if ( isset( $vid_data['webm'] ) ) : ?>
11
  data-webm="<?php echo $vid_data['webm']->url; ?>"
12
  data-webm-type="video/<?php echo $vid_data['webm']->extension; ?>"
13
+ <?php endif; ?>></div>
14
+ <?php } ?>
15
+
16
+ <?php if($row->settings->bg_video_source == 'video_url') { ?>
17
+ <div class="fl-bg-video"
18
+ data-fallback="<?php if ( isset( $row->settings->bg_video_fallback_src ) ) echo $row->settings->bg_video_fallback_src; ?>"
19
+ <?php if ( isset( $row->settings->bg_video_url_mp4 ) ) : ?>
20
+ data-mp4="<?php echo $row->settings->bg_video_url_mp4; ?>"
21
+ data-mp4-type="video/mp4"
22
+ <?php endif; ?>
23
+ <?php if ( isset( $row->settings->bg_video_url_webm ) ) : ?>
24
+ data-webm="<?php echo $row->settings->bg_video_url_webm; ?>"
25
+ data-webm-type="video/webm"
26
+ <?php endif; ?>></div>
27
+ <?php } ?>
includes/settings.php CHANGED
@@ -6,6 +6,9 @@
6
  <span class="fl-builder-badge fl-builder-badge-<?php echo $form_badge_slug; ?>"><?php echo $form_badge_title; ?></span>
7
  <?php endforeach; ?>
8
  </h1>
 
 
 
9
  </div>
10
  <?php if(count($form['tabs']) > 1) : ?>
11
  <div class="fl-builder-settings-tabs">
6
  <span class="fl-builder-badge fl-builder-badge-<?php echo $form_badge_slug; ?>"><?php echo $form_badge_title; ?></span>
7
  <?php endforeach; ?>
8
  </h1>
9
+ <?php if (isset($form['resizable']) && $form['resizable'] === true) : ?>
10
+ <div class="fl-lightbox-controls"><i class="fa fa-expand"></i></div>
11
+ <?php endif; ?>
12
  </div>
13
  <?php if(count($form['tabs']) > 1) : ?>
14
  <div class="fl-builder-settings-tabs">
includes/strings.php ADDED
@@ -0,0 +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' );
includes/template-selector.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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">
9
+ <?php foreach ( $filter_data as $slug => $category ) : ?>
10
+ <option value="fl-builder-settings-tab-<?php echo $slug; ?>"><?php echo $category; ?></option>
11
+ <?php endforeach; ?>
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_upgrade_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_upgrade_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; ?>
33
+ <?php endif; ?>
34
+
35
+ <?php $i = 0; foreach ( $templates['categorized'] as $slug => $category ) : ?>
36
+ <div id="fl-builder-settings-tab-<?php echo $slug; ?>" class="fl-builder-settings-tab<?php if ( 0 === $i ) echo ' fl-active'; ?>">
37
+ <div class="fl-builder-settings-section">
38
+ <?php $k = 0; foreach ( $category['templates'] as $template ) : ?>
39
+ <div class="fl-template-preview<?php if(($k + 1) % 3 === 0) echo ' fl-last'; ?>" data-id="<?php echo $template['id']; ?>">
40
+ <div class="fl-template-image">
41
+ <img src="<?php echo $template['image']; ?>" />
42
+ </div>
43
+ <span><?php echo $template['name']; ?></span>
44
+ </div>
45
+ <?php $k++; endforeach; ?>
46
+ </div>
47
+ </div>
48
+ <?php $i++; endforeach; ?>
49
+
50
+ <?php do_action( 'fl_builder_template_selector_content' ); ?>
51
+
52
+ </div>
53
+ </div>
54
+ <div class="fl-lightbox-footer">
55
+ <span class="fl-builder-settings-cancel fl-builder-button fl-builder-button-large" href="javascript:void(0);" onclick="return false;"><?php _e('Cancel', 'fl-builder'); ?></span>
56
+ </div>
57
+ </form>
includes/ui-js-config.php CHANGED
@@ -1,136 +1,139 @@
1
  <script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- var FLBuilderConfig = {
4
- ajaxNonce: '<?php echo wp_create_nonce( 'fl_ajax_update' ); ?>',
5
- colorPresets: <?php echo json_encode( $color_presets ); ?>,
6
- customImageSizeTitles: <?php echo json_encode( apply_filters( 'image_size_names_choose', array() ) ); ?>,
7
- debug: <?php if( defined( 'WP_DEBUG' ) && WP_DEBUG ) echo 'true'; else echo 'false'; ?>,
8
- enabledTemplates: '<?php echo $enabled_templates; ?>',
9
- help: <?php echo json_encode( $help_button ); ?>,
10
- homeUrl: '<?php echo home_url(); ?>',
11
- isRtl: <?php if(is_rtl()) echo 'true'; else echo 'false'; ?>,
12
- isUserTemplate: <?php if(FLBuilderModel::is_post_user_template()) echo 'true'; else echo 'false'; ?>,
13
- lite: <?php if(FL_BUILDER_LITE === true) echo 'true'; else echo 'false'; ?>,
14
- newUser: <?php if ( FLBuilderModel::is_new_user() ) echo 'true'; else echo 'false'; ?>,
15
- postId: <?php echo $post_id; ?>,
16
- postStatus: '<?php echo get_post_status(); ?>',
17
- postType: '<?php echo get_post_type(); ?>',
18
- simpleUi: <?php if(!FLBuilderModel::current_user_has_editing_capability()) echo 'true'; else echo 'false'; ?>,
19
- upgradeUrl: '<?php if(FL_BUILDER_LITE === true) $campaign = 'upgrade-button'; else $campaign = 'buy-button'; echo FLBuilderModel::get_upgrade_url( array( 'utm_source' => 'external', 'utm_medium' => 'builder', 'utm_campaign' => $campaign ) ); ?>',
20
- userCanEditGlobalTemplates: <?php if(current_user_can(FLBuilderModel::get_global_templates_editing_capability())) echo 'true'; else echo 'false'; ?>,
21
- userCanPublish: <?php if(current_user_can('publish_posts')) echo 'true'; else echo 'false'; ?>,
22
- userTemplateType: '<?php echo FLBuilderModel::get_user_template_type(); ?>'
23
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
- var FLBuilderStrings = {
26
- actionsLightboxTitle: '<?php esc_attr_e('What would you like to do?', 'fl-builder'); ?>',
27
- alreadySaved: '<?php echo esc_attr_x( '%s is already a saved preset.', '%s is the preset hex color code.', 'fl-builder' ) ?>',
28
- audioSelected: '<?php esc_attr_e('Audio File Selected', 'fl-builder'); ?>',
29
- audiosSelected: '<?php esc_attr_e('Audio Files Selected', 'fl-builder'); ?>',
30
- cancel: '<?php esc_attr_e('Cancel', 'fl-builder'); ?>',
31
- changeTemplate: '<?php esc_attr_e('Change Template', 'fl-builder'); ?>',
32
- changeTemplateMessage: '<?php esc_attr_e('Warning! Changing the template will replace your existing layout. Do you really want to do this?', 'fl-builder'); ?>',
33
- colorPresets: '<?php esc_attr_e( 'Color Presets', 'fl-builder' ) ?>',
34
- colorPicker: '<?php esc_attr_e( 'Color Picker', 'fl-builder' ) ?>',
35
- column: '<?php esc_attr_e('Column', 'fl-builder') ?>',
36
- contentSliderSelectLayout: '<?php esc_attr_e('Please select either a background layout or content layout before submitting.', 'fl-builder'); ?>',
37
- countdownDateisInThePast: '<?php esc_attr_e( 'Error! Please enter a date that is in the future.', 'fl-builder' ) ?>',
38
- deleteAccount: '<?php esc_attr_e('Remove Account', 'fl-builder'); ?>',
39
- deleteAccountWarning: '<?php esc_attr_e('Are you sure you want to remove this account? Other modules that are connected to it will be affected.', 'fl-builder'); ?>',
40
- deleteColumnMessage: '<?php esc_attr_e('Do you really want to delete this column?', 'fl-builder') ?>',
41
- deleteFieldMessage: '<?php esc_attr_e('Do you really want to delete this item?', 'fl-builder'); ?>',
42
- deleteModuleMessage: '<?php esc_attr_e('Do you really want to delete this module?', 'fl-builder') ?>',
43
- deleteRowMessage: '<?php esc_attr_e('Do you really want to delete this row?', 'fl-builder') ?>',
44
- deleteTemplate: '<?php esc_attr_e('Do you really want to delete this template?', 'fl-builder'); ?>',
45
- deleteGlobalTemplate: '<?php esc_attr_e('WARNING! You are about to delete a global template that may be linked to other pages. Do you really want to delete this template and unlink it?', 'fl-builder'); ?>',
46
- discard: '<?php esc_attr_e('Discard Changes', 'fl-builder'); ?>',
47
- discardMessage: '<?php esc_attr_e('Do you really want to discard these changes? All of your changes that are not published will be lost.', 'fl-builder'); ?>',
48
- done: '<?php esc_attr_e('Done', 'fl-builder'); ?>',
49
- draft: '<?php esc_attr_e('Save Draft', 'fl-builder'); ?>',
50
- duplicate: '<?php esc_attr_e( 'Duplicate', 'fl-builder' ); ?>',
51
- duplicateLayout: '<?php echo esc_attr_x('Duplicate Layout', 'Duplicate page/post action label.', 'fl-builder'); ?>',
52
- editGlobalSettings: '<?php esc_attr_e('Global Settings', 'fl-builder'); ?>',
53
- editLayoutSettings: '<?php esc_attr_e('Layout Settings', 'fl-builder'); ?>',
54
- emptyMessage: '<?php esc_attr_e('Drop a row layout or module to get started!', 'fl-builder') ?>',
55
- enterValidDay: '<?php esc_attr_e( 'Error! Please enter a valid day.', 'fl-builder' ) ?>',
56
- enterValidMonth: '<?php esc_attr_e( 'Error! Please enter a valid month.', 'fl-builder' ) ?>',
57
- enterValidYear: '<?php esc_attr_e( 'Error! Please enter a valid year.', 'fl-builder' ) ?>',
58
- errorMessage: '<?php esc_attr_e('Beaver Builder caught the following JavaScript error. If Beaver Builder is not functioning as expected the cause is most likely this error. Please help us by disabling all plugins and testing Beaver Builder while reactivating each to determine if the issue is related to a third party plugin.', 'fl-builder') ?>',
59
- fullSize: '<?php esc_attr_e('Full Size', 'fl-builder'); ?>',
60
- getHelp: '<?php esc_attr_e('Get Help', 'fl-builder'); ?>',
61
- globalErrorMessage: '<?php _e('"{message}" on line {line} of {file}.', 'fl-builder') ?>',
62
- insert: '<?php esc_attr_e('Insert', 'fl-builder'); ?>',
63
- large: '<?php esc_attr_e('Large', 'fl-builder'); ?>',
64
- manageTemplates: '<?php esc_attr_e('Manage Templates', 'fl-builder'); ?>',
65
- medium: '<?php esc_attr_e('Medium', 'fl-builder'); ?>',
66
- module: '<?php esc_attr_e('Module', 'fl-builder') ?>',
67
- moduleTemplateSaved: '<?php esc_attr_e('Module Template Saved!', 'fl-builder') ?>',
68
- move: '<?php esc_attr_e('Move', 'fl-builder'); ?>',
69
- newColumn: '<?php esc_attr_e('New Column', 'fl-builder') ?>',
70
- newRow: '<?php esc_attr_e('New Row', 'fl-builder') ?>',
71
- noneColorSelected: '<?php esc_attr_e( 'Please enter a color first.', 'fl-builder' ) ?>',
72
- noPresets: '<?php esc_attr_e( 'Add a color preset first.', 'fl-builder' ) ?>',
73
- noResultsFound: '<?php esc_attr_e('No results found.', 'fl-builder') ?>',
74
- noSavedRows: '<?php esc_attr_e('No saved rows found.', 'fl-builder') ?>',
75
- noSavedModules: '<?php esc_attr_e('No saved modules found.', 'fl-builder') ?>',
76
- ok: '<?php esc_attr_e( 'OK', 'fl-builder' ); ?>',
77
- photoPage: '<?php esc_attr_e('Photo Page', 'fl-builder'); ?>',
78
- photoSelected: '<?php esc_attr_e('Photo Selected', 'fl-builder'); ?>',
79
- photosSelected: '<?php esc_attr_e('Photos Selected', 'fl-builder'); ?>',
80
- placeholder: '<?php esc_attr_e( 'Paste color here...', 'fl-builder' ) ?>',
81
- pleaseWait: '<?php esc_attr_e('Please Wait...', 'fl-builder'); ?>',
82
- presetAdded: '<?php echo esc_attr_x( '%s added to presets!', '%s is the preset hex color code.', 'fl-builder' ) ?>',
83
- publish: '<?php esc_attr_e('Publish Changes', 'fl-builder'); ?>',
84
- remove: '<?php esc_attr_e('Remove', 'fl-builder'); ?>',
85
- removePresetConfirm: '<?php esc_attr_e( 'Are you sure?', 'fl-builder' ) ?>',
86
- row: '<?php esc_attr_e('Row', 'fl-builder') ?>',
87
- rowSettings: '<?php esc_attr_e('Row Settings', 'fl-builder') ?>',
88
- rowTemplateSaved: '<?php esc_attr_e('Row Template Saved!', 'fl-builder'); ?>',
89
- saveCoreTemplate: '<?php esc_attr_e('Save Core Template', 'fl-builder'); ?>',
90
- saveTemplate: '<?php esc_attr_e('Save Template', 'fl-builder'); ?>',
91
- selectAudio: '<?php esc_attr_e('Select Audio', 'fl-builder'); ?>',
92
- selectPhoto: '<?php esc_attr_e('Select Photo', 'fl-builder'); ?>',
93
- selectPhotos: '<?php esc_attr_e('Select Photos', 'fl-builder'); ?>',
94
- selectVideo: '<?php esc_attr_e('Select Video', 'fl-builder'); ?>',
95
- submitForReview: '<?php esc_attr_e('Submit for Review', 'fl-builder'); ?>',
96
- subscriptionModuleAccountError: '<?php esc_attr_e('Please select an account before saving.', 'fl-builder'); ?>',
97
- subscriptionModuleConnectError: '<?php esc_attr_e('Please connect an account before saving.', 'fl-builder'); ?>',
98
- subscriptionModuleListError: '<?php esc_attr_e('Please select a list before saving.', 'fl-builder'); ?>',
99
- subscriptionModuleTagsError: '<?php esc_attr_e('Please enter at least one tag before saving.', 'fl-builder'); ?>',
100
- takeHelpTour: '<?php esc_attr_e('Take a Tour', 'fl-builder'); ?>',
101
- templateAppend: '<?php esc_attr_e('Append New Layout', 'fl-builder'); ?>',
102
- templateReplace: '<?php esc_attr_e('Replace Existing Layout', 'fl-builder'); ?>',
103
- templateSaved: '<?php esc_attr_e('Template Saved!', 'fl-builder'); ?>',
104
- thumbnail: '<?php esc_attr_e('Thumbnail', 'fl-builder'); ?>',
105
- tourNext: '<?php esc_attr_e('Next', 'fl-builder'); ?>',
106
- tourEnd: '<?php esc_attr_e('Get Started', 'fl-builder'); ?>',
107
- tourTemplatesTitle: '<?php esc_attr_e('Choose a Template', 'fl-builder'); ?>',
108
- tourTemplates: '<?php esc_attr_e('Get started by choosing a layout template to customize, or build a page from scratch by selecting the blank layout template.', 'fl-builder'); ?>',
109
- tourAddRowsTitle: '<?php esc_attr_e('Add Rows', 'fl-builder'); ?>',
110
- tourAddRows: '<?php esc_attr_e('Add multi-column rows, adjust spacing, add backgrounds and more by dragging and dropping row layouts onto the page.', 'fl-builder'); ?>',
111
- tourAddContentTitle: '<?php esc_attr_e('Add Content', 'fl-builder'); ?>',
112
- tourAddContent: '<?php esc_attr_e('Add new content by dragging and dropping modules or widgets into your row layouts or to create a new row layout.', 'fl-builder'); ?>',
113
- tourEditContentTitle: '<?php esc_attr_e('Edit Content', 'fl-builder'); ?>',
114
- tourEditContent: '<?php esc_attr_e('Move your mouse over rows, columns or modules to edit and interact with them.', 'fl-builder'); ?>',
115
- tourEditContent2: '<?php esc_attr_e('Use the action buttons to perform actions such as moving, editing, duplicating or deleting rows, columns and modules.', 'fl-builder'); ?>',
116
- tourAddContentButtonTitle: '<?php esc_attr_e('Add More Content', 'fl-builder'); ?>',
117
- tourAddContentButton: '<?php esc_attr_e('Use the Add Content button to open the content panel and add new row layouts, modules or widgets.', 'fl-builder'); ?>',
118
- tourTemplatesButtonTitle: '<?php esc_attr_e('Change Templates', 'fl-builder'); ?>',
119
- tourTemplatesButton: '<?php esc_attr_e('Use the Templates button to pick a new template or append one to your layout. Appending will insert a new template at the end of your existing page content.', 'fl-builder'); ?>',
120
- tourToolsButtonTitle: '<?php esc_attr_e('Helpful Tools', 'fl-builder'); ?>',
121
- tourToolsButton: '<?php esc_attr_e('The Tools button lets you save a template, duplicate a layout, edit the settings for a layout or edit the global settings.', 'fl-builder'); ?>',
122
- tourDoneButtonTitle: '<?php esc_attr_e('Publish Your Changes', 'fl-builder'); ?>',
123
- tourDoneButton: '<?php esc_attr_e("Once you're finished, click the Done button to publish your changes, save a draft or revert back to the last published state.", 'fl-builder'); ?>',
124
- tourFinishedTitle: '<?php esc_attr_e("Let's Get Building!", 'fl-builder'); ?>',
125
- tourFinished: '<?php esc_attr_e("Now that you know the basics, you're ready to start building! If at any time you need help, click the help icon in the upper right corner to access the help menu. Happy building!", 'fl-builder'); ?>',
126
- unloadWarning: '<?php esc_attr_e('The settings you are currently editing will not be saved if you navigate away from this page.', 'fl-builder'); ?>',
127
- viewKnowledgeBase: '<?php esc_attr_e('View the Knowledge Base', 'fl-builder'); ?>',
128
- visitForums: '<?php esc_attr_e('Visit the Forums', 'fl-builder'); ?>',
129
- watchHelpVideo: '<?php esc_attr_e('Watch the Video', 'fl-builder'); ?>',
130
- welcomeMessage: '<?php esc_attr_e('Welcome! It looks like this might be your first time using the builder. Would you like to take a tour?', 'fl-builder'); ?>',
131
- yesPlease: '<?php esc_attr_e('Yes Please!', 'fl-builder'); ?>'
132
- };
133
 
134
- <?php FLBuilderFonts::js(); ?>
135
-
136
- </script>
1
  <script>
2
+ <?php
3
+
4
+ echo 'FLBuilderConfig = ' . json_encode( apply_filters('fl_builder_ui_js_config', array(
5
+ 'ajaxNonce' => wp_create_nonce( 'fl_ajax_update' ),
6
+ 'colorPresets' => FLBuilderModel::get_color_presets(),
7
+ 'customImageSizeTitles' => apply_filters( 'image_size_names_choose', array() ),
8
+ 'debug' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
9
+ 'enabledTemplates' => 'core',
10
+ 'help' => FLBuilderModel::get_help_button_settings(),
11
+ 'homeUrl' => home_url(),
12
+ 'isRtl' => is_rtl(),
13
+ 'isUserTemplate' => false,
14
+ 'lite' => true === FL_BUILDER_LITE,
15
+ 'newUser' => FLBuilderModel::is_new_user(),
16
+ 'postId' => $post_id,
17
+ 'postStatus' => get_post_status(),
18
+ 'postType' => get_post_type(),
19
+ 'simpleUi' => $simple_ui ? true : false,
20
+ 'upgradeUrl' => FLBuilderModel::get_upgrade_url( array( 'utm_medium' => ( true === FL_BUILDER_LITE ? 'bb-lite' : 'bb-demo' ), 'utm_source' => 'builder-ui', 'utm_campaign' => ( true === FL_BUILDER_LITE ? 'top-panel-cta' : 'demo-cta' ) ) ),
21
+ 'userCanEditGlobalTemplates' => current_user_can( FLBuilderModel::get_global_templates_editing_capability() ),
22
+ 'userCanPublish' => current_user_can('publish_posts'),
23
+ 'userTemplateType' => FLBuilderModel::get_user_template_type()
24
+ ) ) ) . ';';
25
 
26
+ echo 'FLBuilderStrings = ' . json_encode( apply_filters('fl_builder_ui_js_strings', array(
27
+ 'actionsLightboxTitle' => esc_attr__('What would you like to do?', 'fl-builder'),
28
+ 'alreadySaved' => esc_attr_x( '%s is already a saved preset.', '%s is the preset hex color code.', 'fl-builder' ),
29
+ 'audioSelected' => esc_attr__('Audio File Selected', 'fl-builder'),
30
+ 'audiosSelected' => esc_attr__('Audio Files Selected', 'fl-builder'),
31
+ 'cancel' => esc_attr__('Cancel', 'fl-builder'),
32
+ 'changeTemplate' => esc_attr__('Change Template', 'fl-builder'),
33
+ 'changeTemplateMessage' => esc_attr__('Warning! Changing the template will replace your existing layout. Do you really want to do this?', 'fl-builder'),
34
+ 'colorPresets' => esc_attr__( 'Color Presets', 'fl-builder' ),
35
+ 'colorPicker' => esc_attr__( 'Color Picker', 'fl-builder' ),
36
+ 'column' => esc_attr__('Column', 'fl-builder'),
37
+ 'contentSliderSelectLayout' => esc_attr__('Please select either a background layout or content layout before submitting.', 'fl-builder'),
38
+ 'countdownDateisInThePast' => esc_attr__( 'Error! Please enter a date that is in the future.', 'fl-builder' ),
39
+ 'deleteAccount' => esc_attr__('Remove Account', 'fl-builder'),
40
+ 'deleteAccountWarning' => esc_attr__('Are you sure you want to remove this account? Other modules that are connected to it will be affected.', 'fl-builder'),
41
+ 'deleteColumnMessage' => esc_attr__('Do you really want to delete this column?', 'fl-builder'),
42
+ 'deleteFieldMessage' => esc_attr__('Do you really want to delete this item?', 'fl-builder'),
43
+ 'deleteModuleMessage' => esc_attr__('Do you really want to delete this module?', 'fl-builder'),
44
+ 'deleteRowMessage' => esc_attr__('Do you really want to delete this row?', 'fl-builder'),
45
+ 'deleteTemplate' => esc_attr__('Do you really want to delete this template?', 'fl-builder'),
46
+ 'deleteGlobalTemplate' => esc_attr__('WARNING! You are about to delete a global template that may be linked to other pages. Do you really want to delete this template and unlink it?', 'fl-builder'),
47
+ 'discard' => esc_attr__('Discard Changes and Exit', 'fl-builder'),
48
+ 'discardMessage' => esc_attr__('Do you really want to discard these changes? All of your changes that are not published will be lost.', 'fl-builder'),
49
+ 'done' => esc_attr__('Done', 'fl-builder'),
50
+ 'draft' => esc_attr__('Save Changes and Exit', 'fl-builder'),
51
+ 'duplicate' => esc_attr__( 'Duplicate', 'fl-builder' ),
52
+ 'duplicateLayout' => esc_attr_x('Duplicate Layout', 'Duplicate page/post action label.', 'fl-builder'),
53
+ 'editGlobalSettings' => esc_attr__('Global Settings', 'fl-builder'),
54
+ 'editLayoutSettings' => esc_attr__('Layout CSS / Javascript', 'fl-builder'),
55
+ 'emptyMessage' => esc_attr__('Drop a row layout or module to get started!', 'fl-builder'),
56
+ 'enterValidDay' => esc_attr__( 'Error! Please enter a valid day.', 'fl-builder' ),
57
+ 'enterValidMonth' => esc_attr__( 'Error! Please enter a valid month.', 'fl-builder' ),
58
+ 'enterValidYear' => esc_attr__( 'Error! Please enter a valid year.', 'fl-builder' ),
59
+ 'errorMessage' => esc_attr__('Beaver Builder caught the following JavaScript error. If Beaver Builder is not functioning as expected the cause is most likely this error. Please help us by disabling all plugins and testing Beaver Builder while reactivating each to determine if the issue is related to a third party plugin.', 'fl-builder'),
60
+ 'fullSize' => esc_attr__('Full Size', 'fl-builder'),
61
+ 'getHelp' => esc_attr__('Get Help', 'fl-builder'),
62
+ 'globalErrorMessage' => __('"{message}" on line {line} of {file}.', 'fl-builder'),
63
+ 'insert' => esc_attr__('Insert', 'fl-builder'),
64
+ 'large' => esc_attr__('Large', 'fl-builder'),
65
+ 'manageTemplates' => esc_attr__('Manage Templates', 'fl-builder'),
66
+ 'medium' => esc_attr__('Medium', 'fl-builder'),
67
+ 'module' => esc_attr__('Module', 'fl-builder'),
68
+ 'moduleTemplateSaved' => esc_attr__('Module Saved!', 'fl-builder'),
69
+ 'move' => esc_attr__('Move', 'fl-builder'),
70
+ 'newColumn' => esc_attr__('New Column', 'fl-builder'),
71
+ 'newRow' => esc_attr__('New Row', 'fl-builder'),
72
+ 'noneColorSelected' => esc_attr__( 'Please enter a color first.', 'fl-builder' ),
73
+ 'noPresets' => esc_attr__( 'Add a color preset first.', 'fl-builder' ),
74
+ 'noResultsFound' => esc_attr__('No results found.', 'fl-builder'),
75
+ 'noSavedRows' => esc_attr__('No saved rows found.', 'fl-builder'),
76
+ 'noSavedModules' => esc_attr__('No saved modules found.', 'fl-builder'),
77
+ 'ok' => esc_attr__( 'OK', 'fl-builder' ),
78
+ 'photoPage' => esc_attr__('Photo Page', 'fl-builder'),
79
+ 'photoSelected' => esc_attr__('Photo Selected', 'fl-builder'),
80
+ 'photosSelected' => esc_attr__('Photos Selected', 'fl-builder'),
81
+ 'placeholder' => esc_attr__( 'Paste color here...', 'fl-builder' ),
82
+ 'pleaseWait' => esc_attr__('Please Wait...', 'fl-builder'),
83
+ 'presetAdded' => esc_attr_x( '%s added to presets!', '%s is the preset hex color code.', 'fl-builder' ),
84
+ 'publish' => esc_attr__('Publish Changes', 'fl-builder'),
85
+ 'remove' => esc_attr__('Remove', 'fl-builder'),
86
+ 'removePresetConfirm' => esc_attr__( 'Are you sure?', 'fl-builder' ),
87
+ 'row' => esc_attr__('Row', 'fl-builder'),
88
+ 'rowSettings' => esc_attr__('Row Settings', 'fl-builder'),
89
+ 'rowTemplateSaved' => esc_attr__('Row Saved!', 'fl-builder'),
90
+ 'saveCoreTemplate' => esc_attr__('Save Core Template', 'fl-builder'),
91
+ 'saveTemplate' => esc_attr__('Save Template', 'fl-builder'),
92
+ 'selectAudio' => esc_attr__('Select Audio', 'fl-builder'),
93
+ 'selectPhoto' => esc_attr__('Select Photo', 'fl-builder'),
94
+ 'selectPhotos' => esc_attr__('Select Photos', 'fl-builder'),
95
+ 'selectVideo' => esc_attr__('Select Video', 'fl-builder'),
96
+ 'submitForReview' => esc_attr__('Submit for Review', 'fl-builder'),
97
+ 'subscriptionModuleAccountError' => esc_attr__('Please select an account before saving.', 'fl-builder'),
98
+ 'subscriptionModuleConnectError' => esc_attr__('Please connect an account before saving.', 'fl-builder'),
99
+ 'subscriptionModuleListError' => esc_attr__('Please select a list before saving.', 'fl-builder'),
100
+ 'subscriptionModuleTagsError' => esc_attr__('Please enter at least one tag before saving.', 'fl-builder'),
101
+ 'takeHelpTour' => esc_attr__('Take a Tour', 'fl-builder'),
102
+ 'templateAppend' => esc_attr__('Append New Layout', 'fl-builder'),
103
+ 'templateReplace' => esc_attr__('Replace Existing Layout', 'fl-builder'),
104
+ 'templateSaved' => esc_attr__('Template Saved!', 'fl-builder'),
105
+ 'thumbnail' => esc_attr__('Thumbnail', 'fl-builder'),
106
+ 'tourNext' => esc_attr__('Next', 'fl-builder'),
107
+ 'tourEnd' => esc_attr__('Get Started', 'fl-builder'),
108
+ 'tourTemplatesTitle' => esc_attr__('Choose a Template', 'fl-builder'),
109
+ 'tourTemplates' => esc_attr__('Get started by choosing a layout template to customize, or build a page from scratch by selecting the blank layout template.', 'fl-builder'),
110
+ 'tourAddRowsTitle' => esc_attr__('Add Rows', 'fl-builder'),
111
+ 'tourAddRows' => esc_attr__('Add multi-column rows, adjust spacing, add backgrounds and more by dragging and dropping row layouts onto the page.', 'fl-builder'),
112
+ 'tourAddContentTitle' => esc_attr__('Add Content', 'fl-builder'),
113
+ 'tourAddContent' => esc_attr__('Add new content by dragging and dropping modules or widgets into your row layouts or to create a new row layout.', 'fl-builder'),
114
+ 'tourEditContentTitle' => esc_attr__('Edit Content', 'fl-builder'),
115
+ 'tourEditContent' => esc_attr__('Move your mouse over rows, columns or modules to edit and interact with them.', 'fl-builder'),
116
+ 'tourEditContent2' => esc_attr__('Use the action buttons to perform actions such as moving, editing, duplicating or deleting rows, columns and modules.', 'fl-builder'),
117
+ 'tourAddContentButtonTitle' => esc_attr__('Add More Content', 'fl-builder'),
118
+ 'tourAddContentButton' => esc_attr__('Use the Add Content button to open the content panel and add new row layouts, modules or widgets.', 'fl-builder'),
119
+ 'tourTemplatesButtonTitle' => esc_attr__('Change Templates', 'fl-builder'),
120
+ 'tourTemplatesButton' => esc_attr__('Use the Templates button to pick a new template or append one to your layout. Appending will insert a new template at the end of your existing page content.', 'fl-builder'),
121
+ 'tourToolsButtonTitle' => esc_attr__('Helpful Tools', 'fl-builder'),
122
+ 'tourToolsButton' => esc_attr__('The Tools button lets you save a template, duplicate a layout, edit the settings for a layout or edit the global settings.', 'fl-builder'),
123
+ 'tourDoneButtonTitle' => esc_attr__('Publish Your Changes', 'fl-builder'),
124
+ 'tourDoneButton' => esc_attr__("Once you're finished, click the Done button to publish your changes, save a draft or revert back to the last published state.", 'fl-builder'),
125
+ 'tourFinishedTitle' => esc_attr__("Let's Get Building!", 'fl-builder'),
126
+ 'tourFinished' => esc_attr__("Now that you know the basics, you're ready to start building! If at any time you need help, click the help icon in the upper right corner to access the help menu. Happy building!", 'fl-builder'),
127
+ 'unloadWarning' => esc_attr__('The settings you are currently editing will not be saved if you navigate away from this page.', 'fl-builder'),
128
+ 'viewKnowledgeBase' => esc_attr__('View the Knowledge Base', 'fl-builder'),
129
+ 'validateRequiredMessage' => esc_attr__('This field is required.', 'fl-builder'),
130
+ 'visitForums' => esc_attr__('Contact Support', 'fl-builder'),
131
+ 'watchHelpVideo' => esc_attr__('Watch the Video', 'fl-builder'),
132
+ 'welcomeMessage' => esc_attr__('Welcome! It looks like this might be your first time using the builder. Would you like to take a tour?', 'fl-builder'),
133
+ 'yesPlease' => esc_attr__('Yes Please!', 'fl-builder')
134
+ ) ) ) . ';';
135
 
136
+ FLBuilderFonts::js();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
+ ?>
139
+ </script>
 
includes/ui-js-templates.php CHANGED
@@ -130,7 +130,7 @@
130
  <div class="fl-builder-actions {{data.className}}">
131
  <span class="fl-builder-actions-title">{{data.title}}</span>
132
  <# for( var i in data.buttons ) { #>
133
- <span class="fl-builder-{{i}}-button fl-builder-button fl-builder-button-large">{{data.buttons[ i ]}}</span>
134
  <# } #>
135
  <span class="fl-builder-cancel-button fl-builder-button fl-builder-button-primary fl-builder-button-large"><?php _e('Cancel', 'fl-builder'); ?></span>
136
  </div>
@@ -163,24 +163,4 @@
163
  <span class="fl-builder-settings-cancel fl-builder-button fl-builder-button-large fl-builder-button-primary" href="javascript:void(0);"><?php _e('Done', 'fl-builder'); ?></span>
164
  </div>
165
  </script>
166
- <!-- #tmpl-fl-video-lightbox -->
167
-
168
- <script type="text/html" id="tmpl-fl-node-template-block">
169
- <span class="fl-builder-block fl-builder-block-saved-{{data.type}}<# if ( data.global ) { #> fl-builder-block-global<# } #>" data-id="{{data.id}}">
170
- <span class="fl-builder-block-title">{{data.name}}</span>
171
- <# if ( data.global ) { #>
172
- <div class="fl-builder-badge fl-builder-badge-global">
173
- <?php _ex( 'Global', 'Indicator for global node templates.', 'fl-builder' ); ?>
174
- </div>
175
- <# } #>
176
- <span class="fl-builder-node-template-actions">
177
- <a class="fl-builder-node-template-edit" href="{{data.link}}" target="_blank">
178
- <i class="fa fa-wrench"></i>
179
- </a>
180
- <a class="fl-builder-node-template-delete" href="javascript:void(0);">
181
- <i class="fa fa-times"></i>
182
- </a>
183
- </span>
184
- </span>
185
- </script>
186
- <!-- #tmpl-fl-node-template-block -->
130
  <div class="fl-builder-actions {{data.className}}">
131
  <span class="fl-builder-actions-title">{{data.title}}</span>
132
  <# for( var i in data.buttons ) { #>
133
+ <span class="fl-builder-{{data.buttons[ i ].key}}-button fl-builder-button fl-builder-button-large">{{data.buttons[ i ].label}}</span>
134
  <# } #>
135
  <span class="fl-builder-cancel-button fl-builder-button fl-builder-button-primary fl-builder-button-large"><?php _e('Cancel', 'fl-builder'); ?></span>
136
  </div>
163
  <span class="fl-builder-settings-cancel fl-builder-button fl-builder-button-large fl-builder-button-primary" href="javascript:void(0);"><?php _e('Done', 'fl-builder'); ?></span>
164
  </div>
165
  </script>
166
+ <!-- #tmpl-fl-video-lightbox -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/ui-panel-module-templates.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( count( $module_templates['categorized'] ) > 0 ) : ?>
2
+ <?php foreach ( $module_templates['categorized'] as $cat ) : ?>
3
+ <div class="fl-builder-blocks-section">
4
+ <span class="fl-builder-blocks-section-title">
5
+ <?php echo $cat['name']; ?>
6
+ <i class="fa fa-chevron-down"></i>
7
+ </span>
8
+ <div class="fl-builder-blocks-section-content fl-builder-module-templates">
9
+ <?php foreach ( $cat['templates'] as $template ) : ?>
10
+ <span class="fl-builder-block fl-builder-block-template fl-builder-block-module-template" data-id="<?php echo $template['id']; ?>" data-type="<?php echo $template['type']; ?>">
11
+ <?php if ( ! stristr( $template['image'], 'blank.jpg' ) ) : ?>
12
+ <img class="fl-builder-block-template-image" src="<?php echo $template['image']; ?>" />
13
+ <?php endif; ?>
14
+ <span class="fl-builder-block-title"><?php echo $template['name']; ?></span>
15
+ </span>
16
+ <?php endforeach; ?>
17
+ </div>
18
+ </div>
19
+ <?php endforeach; ?>
20
+ <?php endif; ?>
includes/ui-panel-row-templates.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( count( $row_templates['categorized'] ) > 0 ) : ?>
2
+ <?php foreach ( $row_templates['categorized'] as $cat ) : ?>
3
+ <div class="fl-builder-blocks-section">
4
+ <span class="fl-builder-blocks-section-title">
5
+ <?php echo $cat['name']; ?>
6
+ <i class="fa fa-chevron-down"></i>
7
+ </span>
8
+ <div class="fl-builder-blocks-section-content fl-builder-row-templates">
9
+ <?php foreach ( $cat['templates'] as $template ) : ?>
10
+ <span class="fl-builder-block fl-builder-block-template fl-builder-block-row-template" data-id="<?php echo $template['id']; ?>" data-type="<?php echo $template['type']; ?>">
11
+ <?php if ( ! stristr( $template['image'], 'blank.jpg' ) ) : ?>
12
+ <img class="fl-builder-block-template-image" src="<?php echo $template['image']; ?>" />
13
+ <?php endif; ?>
14
+ <span class="fl-builder-block-title"><?php echo $template['name']; ?></span>
15
+ </span>
16
+ <?php endforeach; ?>
17
+ </div>
18
+ </div>
19
+ <?php endforeach; ?>
20
+ <?php endif; ?>
includes/ui-panel.php CHANGED
@@ -24,26 +24,7 @@
24
  </div>
25
  </div>
26
 
27
- <?php if ( $row_templates ) : ?>
28
- <?php foreach ( $row_templates['categorized'] as $cat ) : ?>
29
- <div class="fl-builder-blocks-section">
30
- <span class="fl-builder-blocks-section-title">
31
- <?php echo $cat['name']; ?>
32
- <i class="fa fa-chevron-down"></i>
33
- </span>
34
- <div class="fl-builder-blocks-section-content fl-builder-row-templates">
35
- <?php foreach ( $cat['templates'] as $template ) : ?>
36
- <span class="fl-builder-block fl-builder-block-template fl-builder-block-row-template" data-id="<?php echo $template['id']; ?>">
37
- <?php if ( ! stristr( $template['image'], 'blank.jpg' ) ) : ?>
38
- <img class="fl-builder-block-template-image" src="<?php echo $template['image']; ?>" />
39
- <?php endif; ?>
40
- <span class="fl-builder-block-title"><?php echo $template['name']; ?></span>
41
- </span>
42
- <?php endforeach; ?>
43
- </div>
44
- </div>
45
- <?php endforeach; ?>
46
- <?php endif; ?>
47
 
48
  <div class="fl-builder-blocks-separator"></div>
49
 
@@ -69,30 +50,15 @@
69
  </div>
70
  <?php endforeach; ?>
71
 
72
- <?php if ( $module_templates ) : ?>
73
- <?php foreach ( $module_templates['categorized'] as $cat ) : ?>
74
- <div class="fl-builder-blocks-section">
75
- <span class="fl-builder-blocks-section-title">
76
- <?php echo $cat['name']; ?>
77
- <i class="fa fa-chevron-down"></i>
78
- </span>
79
- <div class="fl-builder-blocks-section-content fl-builder-module-templates">
80
- <?php foreach ( $cat['templates'] as $template ) : ?>
81
- <span class="fl-builder-block fl-builder-block-template fl-builder-block-module-template" data-id="<?php echo $template['id']; ?>">
82
- <?php if ( ! stristr( $template['image'], 'blank.jpg' ) ) : ?>
83
- <img class="fl-builder-block-template-image" src="<?php echo $template['image']; ?>" />
84
- <?php endif; ?>
85
- <span class="fl-builder-block-title"><?php echo $template['name']; ?></span>
86
- </span>
87
- <?php endforeach; ?>
88
- </div>
89
- </div>
90
- <?php endforeach; ?>
91
- <?php endif; ?>
92
 
93
- <?php FLBuilder::render_ui_panel_node_templates(); ?>
 
 
 
 
94
 
95
  </div>
96
  </div>
97
  </div>
98
- </div>
24
  </div>
25
  </div>
26
 
27
+ <?php do_action( 'fl_builder_ui_panel_after_rows' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  <div class="fl-builder-blocks-separator"></div>
30
 
50
  </div>
51
  <?php endforeach; ?>
52
 
53
+ <?php do_action( 'fl_builder_ui_panel_after_modules' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
+ <?php if ( true === FL_BUILDER_LITE ) : ?>
56
+ <div class="fl-builder-modules-cta">
57
+ <a href="#" onclick="window.open('<?php echo FLBuilderModel::get_upgrade_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>
58
+ </div>
59
+ <?php endif; ?>
60
 
61
  </div>
62
  </div>
63
  </div>
64
+ </div>
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.7.8',
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.8.1',
7
  'slug' => 'bb-plugin',
8
  'type' => 'plugin'
9
  ));
includes/updater/includes/form.php CHANGED
@@ -3,12 +3,12 @@
3
  <?php if(isset($subscription->error) || !$subscription->active) : ?>
4
  <p class="fl-license-error" style="padding:10px 20px; background: #d54e21; color: #fff;">
5
  <?php _e('UPDATES UNAVAILABLE! Please subscribe or enter your license key below to enable automatic updates.', 'fl-builder'); ?>
6
- &nbsp;<a style="color: #fff;" href="<?php echo FLBuilderModel::get_upgrade_url( array( 'utm_source' => 'external', 'utm_medium' => 'builder', 'utm_campaign' => 'settings-page' ) ); ?>" target="_blank"><?php _e('Subscribe Now', 'fl-builder'); ?> &raquo;</a>
7
  </p>
8
  <?php elseif(!$subscription->domain->active) : ?>
9
  <p class="fl-license-error" style="padding:10px 20px; background: #d54e21; color: #fff;">
10
  <?php _e('UPDATES UNAVAILABLE! Your subscription is active but this domain has been deactivated. Please reactivate this domain in your account to enable automatic updates.', 'fl-builder'); ?>
11
- &nbsp;<a style="color: #fff;" href="https://www.wpbeaverbuilder.com/my-account/?utm_source=external&utm_medium=builder&utm_campaign=settings-page" target="_blank"><?php _e('Visit Account', 'fl-builder'); ?> &raquo;</a>
12
  </p>
13
  <?php endif; ?>
14
 
@@ -31,7 +31,7 @@
31
  <?php endif; ?>
32
 
33
  <p>
34
- <?php echo sprintf( __( 'Enter your <a%s>license key</a> to enable remote updates and support.', 'fl-builder' ), ' href="https://www.wpbeaverbuilder.com/my-account/?utm_source=external&utm_medium=builder&utm_campaign=settings-page" target="_blank"' ) ?>
35
  </p>
36
 
37
  <?php if(is_multisite()) : ?>
@@ -56,4 +56,4 @@
56
  </p>
57
  </div>
58
 
59
- </div>
3
  <?php if(isset($subscription->error) || !$subscription->active) : ?>
4
  <p class="fl-license-error" style="padding:10px 20px; background: #d54e21; color: #fff;">
5
  <?php _e('UPDATES UNAVAILABLE! Please subscribe or enter your license key below to enable automatic updates.', 'fl-builder'); ?>
6
+ &nbsp;<a style="color: #fff;" href="<?php echo FLBuilderModel::get_upgrade_url( array( 'utm_medium' => 'bb-pro', 'utm_source' => 'license-settings-page', 'utm_campaign' => 'license-expired' ) ); ?>" target="_blank"><?php _e('Subscribe Now', 'fl-builder'); ?> &raquo;</a>
7
  </p>
8
  <?php elseif(!$subscription->domain->active) : ?>
9
  <p class="fl-license-error" style="padding:10px 20px; background: #d54e21; color: #fff;">
10
  <?php _e('UPDATES UNAVAILABLE! Your subscription is active but this domain has been deactivated. Please reactivate this domain in your account to enable automatic updates.', 'fl-builder'); ?>
11
+ &nbsp;<a style="color: #fff;" href="https://www.wpbeaverbuilder.com/my-account/?utm_medium=bb-pro&utm_source=license-settings-page&utm_campaign=license-deactivated" target="_blank"><?php _e('Visit Account', 'fl-builder'); ?> &raquo;</a>
12
  </p>
13
  <?php endif; ?>
14
 
31
  <?php endif; ?>
32
 
33
  <p>
34
+ <?php echo sprintf( __( 'Enter your <a%s>license key</a> to enable remote updates and support.', 'fl-builder' ), ' href="https://www.wpbeaverbuilder.com/my-account/?utm_medium=bb-pro&utm_source=license-settings-page&utm_campaign=license-key-link" target="_blank"' ) ?>
35
  </p>
36
 
37
  <?php if(is_multisite()) : ?>
56
  </p>
57
  </div>
58
 
59
+ </div>
js/fl-builder-admin-settings.js CHANGED
@@ -32,7 +32,6 @@
32
  this._initOverrides();
33
  this._initLicenseSettings();
34
  this._templatesOverrideChange();
35
- this._initHelpButtonSettings();
36
  },
37
 
38
  /**
@@ -51,10 +50,6 @@
51
  $('input[name=fl-templates-override]').on('keyup click', FLBuilderAdminSettings._templatesOverrideChange);
52
  $('input[name=fl-upload-icon]').on('click', FLBuilderAdminSettings._showIconUploader);
53
  $('.fl-delete-icon-set').on('click', FLBuilderAdminSettings._deleteCustomIconSet);
54
- $('input[name=fl-help-button-enabled]').on('click', FLBuilderAdminSettings._initHelpButtonSettings);
55
- $('input[name=fl-help-video-enabled]').on('click', FLBuilderAdminSettings._initHelpButtonSettings);
56
- $('input[name=fl-knowledge-base-enabled]').on('click', FLBuilderAdminSettings._initHelpButtonSettings);
57
- $('input[name=fl-forums-enabled]').on('click', FLBuilderAdminSettings._initHelpButtonSettings);
58
  $('#uninstall-form').on('submit', FLBuilderAdminSettings._uninstallFormSubmit);
59
  },
60
 
@@ -256,31 +251,6 @@
256
  overrideNodes.toggle( toggle );
257
  },
258
 
259
- /**
260
- * Initializes the the help button settings.
261
- *
262
- * @since 1.4.9
263
- * @access private
264
- * @method _initHelpButtonSettings
265
- */
266
- _initHelpButtonSettings: function()
267
- {
268
- if ( 0 === $( '#fl-help-button-form' ).length ) {
269
- return;
270
- }
271
-
272
- var enabled = $( 'input[name=fl-help-button-enabled]' )[ 0 ].checked,
273
- tour = $('input[name=fl-help-tour-enabled]')[ 0 ].checked,
274
- video = $('input[name=fl-help-video-enabled]')[ 0 ].checked,
275
- kb = $('input[name=fl-knowledge-base-enabled]')[ 0 ].checked,
276
- forums = $('input[name=fl-forums-enabled]')[ 0 ].checked;
277
-
278
- $( '.fl-help-button-settings' ).toggle( enabled );
279
- $( '.fl-help-video-embed' ).toggle( video );
280
- $( '.fl-knowledge-base-url' ).toggle( kb );
281
- $( '.fl-forums-url' ).toggle( forums );
282
- },
283
-
284
  /**
285
  * Shows the media library lightbox for uploading icons.
286
  *
32
  this._initOverrides();
33
  this._initLicenseSettings();
34
  this._templatesOverrideChange();
 
35
  },
36
 
37
  /**
50
  $('input[name=fl-templates-override]').on('keyup click', FLBuilderAdminSettings._templatesOverrideChange);
51
  $('input[name=fl-upload-icon]').on('click', FLBuilderAdminSettings._showIconUploader);
52
  $('.fl-delete-icon-set').on('click', FLBuilderAdminSettings._deleteCustomIconSet);
 
 
 
 
53
  $('#uninstall-form').on('submit', FLBuilderAdminSettings._uninstallFormSubmit);
54
  },
55
 
251
  overrideNodes.toggle( toggle );
252
  },
253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  /**
255
  * Shows the media library lightbox for uploading icons.
256
  *
js/fl-builder-export.js ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+
3
+ /**
4
+ * @since 1.8
5
+ * @class FLBuilderExport
6
+ */
7
+ FLBuilderExport = {
8
+
9
+ /**
10
+ * Initializes custom exports for the builder.
11
+ *
12
+ * @since 1.8
13
+ * @access private
14
+ * @method _init
15
+ */
16
+ _init: function()
17
+ {
18
+ var templateRadio = $( '#export-filters input[value=fl-builder-template]' );
19
+
20
+ // Add the template filters after the template radio.
21
+ templateRadio.closest( 'p' ).after( $( '#fl-builder-template-filters' ) );
22
+
23
+ // Events
24
+ templateRadio.on( 'change', FLBuilderExport._showTemplateFilters );
25
+ $( '#fl-builder-template-export-select' ).on( 'change', FLBuilderExport._templateSelectChange );
26
+ },
27
+
28
+ /**
29
+ * Shows the template filters when the template radio
30
+ * button is clicked.
31
+ *
32
+ * @since 1.8
33
+ * @access private
34
+ * @method _showTemplateFilters
35
+ */
36
+ _showTemplateFilters: function()
37
+ {
38
+ $( '#fl-builder-template-filters' ).slideDown();
39
+ },
40
+
41
+ /**
42
+ * Called when the template select is changed and shows
43
+ * all templates to select from when the value is set
44
+ * to selected.
45
+ *
46
+ * @since 1.8
47
+ * @access private
48
+ * @method _templateSelectChange
49
+ */
50
+ _templateSelectChange: function()
51
+ {
52
+ var filter = $( '#fl-builder-template-filters' ),
53
+ posts = $( '#fl-builder-template-export-posts' ),
54
+ spinner = filter.find( '.spinner' );
55
+
56
+ if ( 'all' == $( this ).val() ) {
57
+ spinner.removeClass( 'is-active' );
58
+ posts.hide();
59
+ }
60
+ else {
61
+
62
+ posts.show();
63
+
64
+ if ( 0 === posts.find( 'input' ).length ) {
65
+
66
+ spinner.addClass( 'is-active' );
67
+
68
+ $.post( ajaxurl, {
69
+ action: 'fl_builder_export_templates_data'
70
+ }, FLBuilderExport._templateDataLoaded );
71
+ }
72
+ }
73
+ },
74
+
75
+ /**
76
+ * Called when the template data is loaded.
77
+ *
78
+ * @since 1.8
79
+ * @access private
80
+ * @method _templateDataLoaded
81
+ */
82
+ _templateDataLoaded: function( response )
83
+ {
84
+ var filter = $( '#fl-builder-template-filters' ),
85
+ posts = $( '#fl-builder-template-export-posts' ),
86
+ spinner = filter.find( '.spinner' ),
87
+ data = JSON.parse( response ),
88
+ i = 0;
89
+
90
+ for ( i in data ) {
91
+ posts.append( '<p><label><input type="checkbox" name="fl-builder-export-template[]" value="' + data[ i ].id + '" /> ' + data[ i ].title + '</label></p>' );
92
+ }
93
+
94
+ spinner.removeClass( 'is-active' );
95
+ }
96
+ };
97
+
98
+ $( FLBuilderExport._init );
99
+
100
+ } )( jQuery );
js/fl-builder-preview.js CHANGED
@@ -1322,14 +1322,16 @@
1322
  // Elements
1323
  $.extend(this.elements, {
1324
  width : $(this.classes.settings + ' select[name=width]'),
 
1325
  height : $(this.classes.settings + ' select[name=full_height]'),
1326
- contentWidth : $(this.classes.settings + ' select[name=content_width]')
1327
  });
1328
 
1329
  // Events
1330
  this.elements.width.on( 'change', $.proxy(this._rowWidthChange, this));
1331
- this.elements.height.on( 'change', $.proxy(this._rowHeightChange, this));
1332
  this.elements.contentWidth.on( 'change', $.proxy(this._rowContentWidthChange, this));
 
 
1333
 
1334
  // Common Elements
1335
  this._initNodeTextColor();
@@ -1374,8 +1376,12 @@
1374
  {
1375
  var row = this.elements.node;
1376
 
 
 
 
1377
  if(this.elements.height.val() == 'full') {
1378
  row.addClass('fl-row-full-height');
 
1379
  }
1380
  else {
1381
  row.removeClass('fl-row-full-height');
@@ -1418,13 +1424,17 @@
1418
  {
1419
  // Elements
1420
  $.extend(this.elements, {
1421
- size : $(this.classes.settings + ' input[name=size]'),
1422
- columnHeight : $(this.classes.settings + ' select[name=equal_height]'),
 
 
1423
  });
1424
 
1425
  // Events
1426
- this.elements.size.on( 'keyup', $.proxy( this._colSizeChange, this ) );
1427
- this.elements.columnHeight.on( 'change', $.proxy( this._colHeightChange, this ) );
 
 
1428
 
1429
  // Common Elements
1430
  this._initNodeTextColor();
@@ -1494,16 +1504,39 @@
1494
  */
1495
  _colHeightChange: function()
1496
  {
1497
-
1498
  var parent = this.elements.node.parent('.fl-col-group');
1499
 
 
 
 
1500
  if(this.elements.columnHeight.val() == 'yes') {
1501
  parent.addClass('fl-col-group-equal-height');
 
1502
  }
1503
  else {
1504
  parent.removeClass('fl-col-group-equal-height');
1505
  }
1506
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1507
 
1508
  /* Module Settings
1509
  ----------------------------------------------------------*/
1322
  // Elements
1323
  $.extend(this.elements, {
1324
  width : $(this.classes.settings + ' select[name=width]'),
1325
+ contentWidth : $(this.classes.settings + ' select[name=content_width]'),
1326
  height : $(this.classes.settings + ' select[name=full_height]'),
1327
+ align : $(this.classes.settings + ' select[name=content_alignment]')
1328
  });
1329
 
1330
  // Events
1331
  this.elements.width.on( 'change', $.proxy(this._rowWidthChange, this));
 
1332
  this.elements.contentWidth.on( 'change', $.proxy(this._rowContentWidthChange, this));
1333
+ this.elements.height.on( 'change', $.proxy(this._rowHeightChange, this));
1334
+ this.elements.align.on( 'change', $.proxy(this._rowHeightChange, this));
1335
 
1336
  // Common Elements
1337
  this._initNodeTextColor();
1376
  {
1377
  var row = this.elements.node;
1378
 
1379
+ row.removeClass('fl-row-align-top');
1380
+ row.removeClass('fl-row-align-center');
1381
+
1382
  if(this.elements.height.val() == 'full') {
1383
  row.addClass('fl-row-full-height');
1384
+ row.addClass('fl-row-align-' + this.elements.align.val());
1385
  }
1386
  else {
1387
  row.removeClass('fl-row-full-height');
1424
  {
1425
  // Elements
1426
  $.extend(this.elements, {
1427
+ size : $(this.classes.settings + ' input[name=size]'),
1428
+ columnHeight : $(this.classes.settings + ' select[name=equal_height]'),
1429
+ columnAlign : $(this.classes.settings + ' select[name=content_alignment]'),
1430
+ responsiveOrder : $(this.classes.settings + ' select[name=responsive_order]')
1431
  });
1432
 
1433
  // Events
1434
+ this.elements.size.on( 'keyup', $.proxy( this._colSizeChange, this ) );
1435
+ this.elements.columnHeight.on( 'change', $.proxy( this._colHeightChange, this ) );
1436
+ this.elements.columnAlign.on( 'change', $.proxy( this._colHeightChange, this ) );
1437
+ this.elements.responsiveOrder.on( 'change', $.proxy( this._colResponsiveOrder, this ) );
1438
 
1439
  // Common Elements
1440
  this._initNodeTextColor();
1504
  */
1505
  _colHeightChange: function()
1506
  {
 
1507
  var parent = this.elements.node.parent('.fl-col-group');
1508
 
1509
+ parent.removeClass('fl-col-group-align-top');
1510
+ parent.removeClass('fl-col-group-align-center');
1511
+
1512
  if(this.elements.columnHeight.val() == 'yes') {
1513
  parent.addClass('fl-col-group-equal-height');
1514
+ parent.addClass('fl-col-group-align-' + this.elements.columnAlign.val());
1515
  }
1516
  else {
1517
  parent.removeClass('fl-col-group-equal-height');
1518
  }
1519
  },
1520
+
1521
+ /**
1522
+ * Fires when the responsive order field of a column changes.
1523
+ *
1524
+ * @since 1.8
1525
+ * @access private
1526
+ * @method _colResponsiveOrder
1527
+ */
1528
+ _colResponsiveOrder: function()
1529
+ {
1530
+
1531
+ var parent = this.elements.node.parent('.fl-col-group');
1532
+
1533
+ if(this.elements.responsiveOrder.val() == 'reversed') {
1534
+ parent.addClass('fl-col-group-responsive-reversed');
1535
+ }
1536
+ else {
1537
+ parent.removeClass('fl-col-group-responsive-reversed');
1538
+ }
1539
+ },
1540
 
1541
  /* Module Settings
1542
  ----------------------------------------------------------*/
js/fl-builder.js CHANGED
@@ -303,7 +303,7 @@
303
  FLBuilder._initScrollbars();
304
  FLBuilder._initLightboxes();
305
  FLBuilder._initSortables();
306
- FLBuilder._initCoreTemplateSettings();
307
  FLBuilder._bindEvents();
308
  FLBuilder._bindOverlayEvents();
309
  FLBuilder._setupEmptyLayout();
@@ -585,6 +585,18 @@
585
  }));
586
  },
587
 
 
 
 
 
 
 
 
 
 
 
 
 
588
  /**
589
  * Binds most of the events for the builder interface.
590
  *
@@ -634,6 +646,9 @@
634
 
635
  /* Actions Lightbox */
636
  $('body').delegate('.fl-builder-actions .fl-builder-cancel-button', 'click', FLBuilder._cancelButtonClicked);
 
 
 
637
 
638
  /* Save Actions */
639
  $('body').delegate('.fl-builder-save-actions .fl-builder-publish-button', 'click', FLBuilder._publishButtonClicked);
@@ -1001,34 +1016,47 @@
1001
  */
1002
  _toolsClicked: function()
1003
  {
1004
- var buttons = {},
1005
  lite = FLBuilderConfig.lite,
1006
  enabledTemplates = FLBuilderConfig.enabledTemplates;
1007
 
1008
  // Template buttons
1009
  if(!lite && !FLBuilderConfig.isUserTemplate && (enabledTemplates == 'enabled' || enabledTemplates == 'user')) {
1010
-
1011
- buttons['save-user-template'] = FLBuilderStrings.saveTemplate;
1012
-
1013
- if('undefined' != typeof FLBuilderTemplateSettings) {
1014
- buttons['save-template'] = FLBuilderStrings.saveCoreTemplate;
1015
- }
1016
  }
1017
 
1018
  // Duplicate button
1019
  if(FLBuilderConfig.isUserTemplate) {
1020
  if ( typeof window.opener == 'undefined' || ! window.opener ) {
1021
- buttons['duplicate-layout'] = FLBuilderStrings.duplicateLayout;
 
 
 
1022
  }
1023
  }
1024
  else {
1025
- buttons['duplicate-layout'] = FLBuilderStrings.duplicateLayout;
 
 
 
1026
  }
1027
 
1028
- // Settings button
1029
- buttons['layout-settings'] = FLBuilderStrings.editLayoutSettings;
1030
- buttons['global-settings'] = FLBuilderStrings.editGlobalSettings;
 
 
 
 
 
 
 
 
1031
 
 
1032
  FLBuilder._showActionsLightbox({
1033
  'className' : 'fl-builder-tools-actions',
1034
  'title' : FLBuilderStrings.actionsLightboxTitle,
@@ -1045,20 +1073,32 @@
1045
  */
1046
  _doneClicked: function()
1047
  {
1048
- var publishButtonText = FLBuilderStrings.publish;
 
1049
 
1050
  if(FLBuilderConfig.postStatus != 'publish' && !FLBuilderConfig.userCanPublish) {
1051
  publishButtonText = FLBuilderStrings.submitForReview;
1052
  }
1053
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1054
  FLBuilder._showActionsLightbox({
1055
  'className': 'fl-builder-save-actions',
1056
  'title': FLBuilderStrings.actionsLightboxTitle,
1057
- 'buttons': {
1058
- 'publish': publishButtonText,
1059
- 'draft': FLBuilderStrings.draft,
1060
- 'discard': FLBuilderStrings.discard
1061
- }
1062
  });
1063
  },
1064
 
@@ -1087,16 +1127,28 @@
1087
  var buttons = {};
1088
 
1089
  if ( FLBuilderConfig.help.tour ) {
1090
- buttons['help-tour'] = FLBuilderStrings.takeHelpTour;
 
 
 
1091
  }
1092
  if ( FLBuilderConfig.help.video ) {
1093
- buttons['help-video'] = FLBuilderStrings.watchHelpVideo;
 
 
 
1094
  }
1095
  if ( FLBuilderConfig.help.knowledge_base ) {
1096
- buttons['knowledge-base'] = FLBuilderStrings.viewKnowledgeBase;
 
 
 
1097
  }
1098
  if ( FLBuilderConfig.help.forums ) {
1099
- buttons.forums = FLBuilderStrings.visitForums;
 
 
 
1100
  }
1101
 
1102
  FLBuilder._showActionsLightbox({
@@ -1597,7 +1649,7 @@
1597
  if ( 'disabled' == FLBuilderConfig.enabledTemplates ) {
1598
  return;
1599
  }
1600
- if ( FLBuilderConfig.lite ) {
1601
  return;
1602
  }
1603
 
@@ -1626,11 +1678,13 @@
1626
  FLBuilder._setLightboxContent( data.html );
1627
 
1628
  // Set the vars.
1629
- select = $( '.fl-template-category-select' );
1630
- userTemplates = $( '.fl-user-template' );
 
 
1631
 
1632
  // Default to the user templates tab?
1633
- if ( 'user' == FLBuilderConfig.enabledTemplates || userTemplates.length > 0 ) {
1634
  select.val( 'fl-builder-settings-tab-yours' );
1635
  $( '.fl-builder-settings-tab' ).removeClass( 'fl-active' );
1636
  $( '#fl-builder-settings-tab-yours' ).addClass( 'fl-active' );
@@ -1673,7 +1727,7 @@
1673
 
1674
  if($(FLBuilder._contentClass).children('.fl-row').length > 0) {
1675
 
1676
- if(index === 0) {
1677
  if(confirm(FLBuilderStrings.changeTemplateMessage)) {
1678
  FLBuilder._lightbox._node.hide();
1679
  FLBuilder._applyTemplate(0, false, 'core');
@@ -1700,13 +1754,22 @@
1700
  */
1701
  _showTemplateActions: function()
1702
  {
 
 
 
 
 
 
 
 
 
 
 
 
1703
  FLBuilder._showActionsLightbox({
1704
  'className': 'fl-builder-template-actions',
1705
  'title': FLBuilderStrings.actionsLightboxTitle,
1706
- 'buttons': {
1707
- 'template-replace': FLBuilderStrings.templateReplace,
1708
- 'template-append': FLBuilderStrings.templateAppend
1709
- }
1710
  });
1711
  },
1712
 
@@ -1961,23 +2024,6 @@
1961
  e.stopPropagation();
1962
  },
1963
 
1964
- /* Core Template Settings
1965
- ----------------------------------------------------------*/
1966
-
1967
- /**
1968
- * Initializes the settings for saving core templates.
1969
- *
1970
- * @since 1.0
1971
- * @access private
1972
- * @method _initCoreTemplateSettings
1973
- */
1974
- _initCoreTemplateSettings: function()
1975
- {
1976
- if('undefined' != typeof FLBuilderTemplateSettings) {
1977
- FLBuilderTemplateSettings.init();
1978
- }
1979
- },
1980
-
1981
  /* Help Actions
1982
  ----------------------------------------------------------*/
1983
 
@@ -1987,7 +2033,7 @@
1987
  *
1988
  * @since 1.4.9
1989
  * @access private
1990
- * @method _initCoreTemplateSettings
1991
  */
1992
  _watchVideoClicked: function()
1993
  {
@@ -4223,10 +4269,11 @@
4223
 
4224
  // Apply and render the node template.
4225
  FLBuilder.ajax({
4226
- action : action,
4227
- template_id : item.attr( 'data-id' ),
4228
- parent_id : parentId,
4229
- position : position
 
4230
  }, callback );
4231
 
4232
  // Remove the helper.
@@ -4311,6 +4358,11 @@
4311
  FLBuilder._initAutoSuggestFields();
4312
  FLBuilder._initLinkFields();
4313
  FLBuilder._initFontFields();
 
 
 
 
 
4314
  },
4315
 
4316
  /**
@@ -5914,6 +5966,7 @@
5914
  _updateEditorField: function()
5915
  {
5916
  var textarea = $( this ),
 
5917
  wrap = textarea.closest( '.wp-editor-wrap' ),
5918
  id = textarea.attr( 'id' ),
5919
  setting = textarea.closest( '.fl-editor-field' ).attr( 'id' ),
@@ -5926,15 +5979,26 @@
5926
  textarea.after( hidden );
5927
  }
5928
 
5929
- // Update the hidden textarea content.
5930
- if ( editor && wrap.hasClass( 'tmce-active' ) ) {
5931
- hidden.val( editor.getContent() );
5932
- }
5933
- else if ( 'undefined' != typeof switchEditors ) {
5934
- hidden.val( switchEditors.wpautop( textarea.val() ) );
 
 
5935
  }
5936
  else {
5937
- hidden.val( textarea.val() );
 
 
 
 
 
 
 
 
 
5938
  }
5939
  },
5940
 
@@ -5972,14 +6036,19 @@
5972
  var dropdown = $( this ),
5973
  textField = $( 'input[name="' + dropdown.data( 'target' ) + '"]' ),
5974
  currentValue = textField.val(),
5975
- addingValue = dropdown.val();
 
5976
 
5977
  // Adding selected value to target text field only once
5978
 
5979
  if ( -1 == currentValue.indexOf( addingValue ) ) {
 
 
5980
 
5981
  textField
5982
- .attr( 'value', ( currentValue.trim() + ' ' + addingValue.trim() ) );
 
 
5983
 
5984
  }
5985
 
@@ -6216,9 +6285,27 @@
6216
  _showActionsLightbox: function(settings)
6217
  {
6218
  var template = wp.template( 'fl-actions-lightbox' );
6219
-
 
 
 
 
6220
  FLBuilder._actionsLightbox.open( template( settings ) );
6221
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6222
 
6223
  /* Alert Lightboxes
6224
  ----------------------------------------------------------*/
@@ -6253,6 +6340,48 @@
6253
  FLLightbox.closeParent(this);
6254
  },
6255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6256
  /* Console Logging
6257
  ----------------------------------------------------------*/
6258
 
303
  FLBuilder._initScrollbars();
304
  FLBuilder._initLightboxes();
305
  FLBuilder._initSortables();
306
+ FLBuilder._initStrings();
307
  FLBuilder._bindEvents();
308
  FLBuilder._bindOverlayEvents();
309
  FLBuilder._setupEmptyLayout();
585
  }));
586
  },
587
 
588
+ /**
589
+ * Initializes text translation
590
+ *
591
+ * @since 1.0
592
+ * @access private
593
+ * @method _initStrings
594
+ */
595
+ _initStrings: function()
596
+ {
597
+ $.validator.messages.required = FLBuilderStrings.validateRequiredMessage;
598
+ },
599
+
600
  /**
601
  * Binds most of the events for the builder interface.
602
  *
646
 
647
  /* Actions Lightbox */
648
  $('body').delegate('.fl-builder-actions .fl-builder-cancel-button', 'click', FLBuilder._cancelButtonClicked);
649
+
650
+ /* Expand/Contract Lightbox */
651
+ $('body').delegate('.fl-lightbox-controls .fa', 'click', FLBuilder._resizeLightbox);
652
 
653
  /* Save Actions */
654
  $('body').delegate('.fl-builder-save-actions .fl-builder-publish-button', 'click', FLBuilder._publishButtonClicked);
1016
  */
1017
  _toolsClicked: function()
1018
  {
1019
+ var buttons = [],
1020
  lite = FLBuilderConfig.lite,
1021
  enabledTemplates = FLBuilderConfig.enabledTemplates;
1022
 
1023
  // Template buttons
1024
  if(!lite && !FLBuilderConfig.isUserTemplate && (enabledTemplates == 'enabled' || enabledTemplates == 'user')) {
1025
+ buttons[ 10 ] = {
1026
+ 'key': 'save-user-template',
1027
+ 'label': FLBuilderStrings.saveTemplate
1028
+ };
 
 
1029
  }
1030
 
1031
  // Duplicate button
1032
  if(FLBuilderConfig.isUserTemplate) {
1033
  if ( typeof window.opener == 'undefined' || ! window.opener ) {
1034
+ buttons[ 20 ] = {
1035
+ 'key': 'duplicate-layout',
1036
+ 'label': FLBuilderStrings.duplicateLayout
1037
+ };
1038
  }
1039
  }
1040
  else {
1041
+ buttons[ 20 ] = {
1042
+ 'key': 'duplicate-layout',
1043
+ 'label': FLBuilderStrings.duplicateLayout
1044
+ };
1045
  }
1046
 
1047
+ // Layout settings button
1048
+ buttons[ 30 ] = {
1049
+ 'key': 'layout-settings',
1050
+ 'label': FLBuilderStrings.editLayoutSettings
1051
+ };
1052
+
1053
+ // Global settings button
1054
+ buttons[ 40 ] = {
1055
+ 'key': 'global-settings',
1056
+ 'label': FLBuilderStrings.editGlobalSettings
1057
+ };
1058
 
1059
+ // Show the lightbox.
1060
  FLBuilder._showActionsLightbox({
1061
  'className' : 'fl-builder-tools-actions',
1062
  'title' : FLBuilderStrings.actionsLightboxTitle,
1073
  */
1074
  _doneClicked: function()
1075
  {
1076
+ var buttons = [],
1077
+ publishButtonText = FLBuilderStrings.publish;
1078
 
1079
  if(FLBuilderConfig.postStatus != 'publish' && !FLBuilderConfig.userCanPublish) {
1080
  publishButtonText = FLBuilderStrings.submitForReview;
1081
  }
1082
+
1083
+ buttons[ 10 ] = {
1084
+ 'key': 'publish',
1085
+ 'label': publishButtonText
1086
+ };
1087
+
1088
+ buttons[ 20 ] = {
1089
+ 'key': 'draft',
1090
+ 'label': FLBuilderStrings.draft
1091
+ };
1092
+
1093
+ buttons[ 30 ] = {
1094
+ 'key': 'discard',
1095
+ 'label': FLBuilderStrings.discard
1096
+ };
1097
+
1098
  FLBuilder._showActionsLightbox({
1099
  'className': 'fl-builder-save-actions',
1100
  'title': FLBuilderStrings.actionsLightboxTitle,
1101
+ 'buttons': buttons
 
 
 
 
1102
  });
1103
  },
1104
 
1127
  var buttons = {};
1128
 
1129
  if ( FLBuilderConfig.help.tour ) {
1130
+ buttons[ 10 ] = {
1131
+ 'key': 'help-tour',
1132
+ 'label': FLBuilderStrings.takeHelpTour
1133
+ };
1134
  }
1135
  if ( FLBuilderConfig.help.video ) {
1136
+ buttons[ 20 ] = {
1137
+ 'key': 'help-video',
1138
+ 'label': FLBuilderStrings.watchHelpVideo
1139
+ };
1140
  }
1141
  if ( FLBuilderConfig.help.knowledge_base ) {
1142
+ buttons[ 30 ] = {
1143
+ 'key': 'knowledge-base',
1144
+ 'label': FLBuilderStrings.viewKnowledgeBase
1145
+ };
1146
  }
1147
  if ( FLBuilderConfig.help.forums ) {
1148
+ buttons[ 40 ] = {
1149
+ 'key': 'forums',
1150
+ 'label': FLBuilderStrings.visitForums
1151
+ };
1152
  }
1153
 
1154
  FLBuilder._showActionsLightbox({
1649
  if ( 'disabled' == FLBuilderConfig.enabledTemplates ) {
1650
  return;
1651
  }
1652
+ if ( 0 === $( '.fl-builder-templates-button' ).length ) {
1653
  return;
1654
  }
1655
 
1678
  FLBuilder._setLightboxContent( data.html );
1679
 
1680
  // Set the vars.
1681
+ select = $( '.fl-template-category-select' );
1682
+ tabs = $( '.fl-builder-settings-tab' );
1683
+ userTemplatesTab = $( '#fl-builder-settings-tab-yours' );
1684
+ userTemplates = $( '.fl-user-template' );
1685
 
1686
  // Default to the user templates tab?
1687
+ if ( 'user' == FLBuilderConfig.enabledTemplates || userTemplates.length > 0 || ( userTemplatesTab.length > 0 && tabs.length == 1 ) ) {
1688
  select.val( 'fl-builder-settings-tab-yours' );
1689
  $( '.fl-builder-settings-tab' ).removeClass( 'fl-active' );
1690
  $( '#fl-builder-settings-tab-yours' ).addClass( 'fl-active' );
1727
 
1728
  if($(FLBuilder._contentClass).children('.fl-row').length > 0) {
1729
 
1730
+ if(index == 0) {
1731
  if(confirm(FLBuilderStrings.changeTemplateMessage)) {
1732
  FLBuilder._lightbox._node.hide();
1733
  FLBuilder._applyTemplate(0, false, 'core');
1754
  */
1755
  _showTemplateActions: function()
1756
  {
1757
+ var buttons = [];
1758
+
1759
+ buttons[ 10 ] = {
1760
+ 'key': 'template-replace',
1761
+ 'label': FLBuilderStrings.templateReplace
1762
+ };
1763
+
1764
+ buttons[ 20 ] = {
1765
+ 'key': 'template-append',
1766
+ 'label': FLBuilderStrings.templateAppend
1767
+ };
1768
+
1769
  FLBuilder._showActionsLightbox({
1770
  'className': 'fl-builder-template-actions',
1771
  'title': FLBuilderStrings.actionsLightboxTitle,
1772
+ 'buttons': buttons
 
 
 
1773
  });
1774
  },
1775
 
2024
  e.stopPropagation();
2025
  },
2026
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2027
  /* Help Actions
2028
  ----------------------------------------------------------*/
2029
 
2033
  *
2034
  * @since 1.4.9
2035
  * @access private
2036
+ * @method _watchVideoClicked
2037
  */
2038
  _watchVideoClicked: function()
2039
  {
4269
 
4270
  // Apply and render the node template.
4271
  FLBuilder.ajax({
4272
+ action : action,
4273
+ template_id : item.attr( 'data-id' ),
4274
+ template_type : item.attr( 'data-type' ),
4275
+ parent_id : parentId,
4276
+ position : position
4277
  }, callback );
4278
 
4279
  // Remove the helper.
4358
  FLBuilder._initAutoSuggestFields();
4359
  FLBuilder._initLinkFields();
4360
  FLBuilder._initFontFields();
4361
+
4362
+ /**
4363
+ * Hook for settings form init.
4364
+ */
4365
+ FLBuilder.triggerHook('settings-form-init');
4366
  },
4367
 
4368
  /**
5966
  _updateEditorField: function()
5967
  {
5968
  var textarea = $( this ),
5969
+ form = textarea.closest( '.fl-builder-settings' ),
5970
  wrap = textarea.closest( '.wp-editor-wrap' ),
5971
  id = textarea.attr( 'id' ),
5972
  setting = textarea.closest( '.fl-editor-field' ).attr( 'id' ),
5979
  textarea.after( hidden );
5980
  }
5981
 
5982
+ // Save editor content.
5983
+ if ( 'rich-text' == form.data( 'type' ) ) {
5984
+
5985
+ if ( editor && wrap.hasClass( 'tmce-active' ) ) {
5986
+ editor.save();
5987
+ }
5988
+
5989
+ hidden.val( textarea.val() );
5990
  }
5991
  else {
5992
+
5993
+ if ( editor && wrap.hasClass( 'tmce-active' ) ) {
5994
+ hidden.val( editor.getContent() );
5995
+ }
5996
+ else if ( 'undefined' != typeof switchEditors ) {
5997
+ hidden.val( switchEditors.wpautop( textarea.val() ) );
5998
+ }
5999
+ else {
6000
+ hidden.val( textarea.val() );
6001
+ }
6002
  }
6003
  },
6004
 
6036
  var dropdown = $( this ),
6037
  textField = $( 'input[name="' + dropdown.data( 'target' ) + '"]' ),
6038
  currentValue = textField.val(),
6039
+ addingValue = dropdown.val(),
6040
+ newValue = '';
6041
 
6042
  // Adding selected value to target text field only once
6043
 
6044
  if ( -1 == currentValue.indexOf( addingValue ) ) {
6045
+
6046
+ newValue = ( currentValue.trim() + ' ' + addingValue.trim() ).trim();
6047
 
6048
  textField
6049
+ .val( newValue )
6050
+ .trigger( 'change' )
6051
+ .trigger( 'keyup' );
6052
 
6053
  }
6054
 
6285
  _showActionsLightbox: function(settings)
6286
  {
6287
  var template = wp.template( 'fl-actions-lightbox' );
6288
+
6289
+ // Allow extensions to modify the settings object.
6290
+ FLBuilder.triggerHook( 'actions-lightbox-settings', settings );
6291
+
6292
+ // Open the lightbox.
6293
  FLBuilder._actionsLightbox.open( template( settings ) );
6294
  },
6295
+
6296
+ /**
6297
+ * Resize lightbox to wether expand or contract
6298
+ *
6299
+ * @access private
6300
+ * @method _expandLightbox
6301
+ */
6302
+ _resizeLightbox: function(){
6303
+ var link = $(this),
6304
+ resizeType = (link.hasClass('fa-expand')) ? 'expand' : 'contract';
6305
+
6306
+ FLBuilder._lightbox.renderResize( resizeType );
6307
+ $(this).toggleClass("fa-expand").toggleClass("fa-compress");
6308
+ },
6309
 
6310
  /* Alert Lightboxes
6311
  ----------------------------------------------------------*/
6340
  FLLightbox.closeParent(this);
6341
  },
6342
 
6343
+ /* Simple JS hooks similar to WordPress PHP hooks.
6344
+ ----------------------------------------------------------*/
6345
+
6346
+ /**
6347
+ * Trigger a hook.
6348
+ *
6349
+ * @since 1.8
6350
+ * @method triggerHook
6351
+ * @param {String} hook The hook to trigger.
6352
+ * @param {Array} args An array of args to pass to the hook.
6353
+ */
6354
+ triggerHook: function( hook, args )
6355
+ {
6356
+ $( 'body' ).trigger( 'fl-builder.' + hook, args );
6357
+ },
6358
+
6359
+ /**
6360
+ * Add a hook.
6361
+ *
6362
+ * @since 1.8
6363
+ * @method addHook
6364
+ * @param {String} hook The hook to add.
6365
+ * @param {Function} callback A function to call when the hook is triggered.
6366
+ */
6367
+ addHook: function( hook, callback )
6368
+ {
6369
+ $( 'body' ).on( 'fl-builder.' + hook, callback );
6370
+ },
6371
+
6372
+ /**
6373
+ * Remove a hook.
6374
+ *
6375
+ * @since 1.8
6376
+ * @method removeHook
6377
+ * @param {String} hook The hook to remove.
6378
+ * @param {Function} callback The callback function to remove.
6379
+ */
6380
+ removeHook: function( hook, callback )
6381
+ {
6382
+ $( 'body' ).off( 'fl-builder.' + hook, callback );
6383
+ },
6384
+
6385
  /* Console Logging
6386
  ----------------------------------------------------------*/
6387
 
js/fl-builder.min.js CHANGED
@@ -1,5 +1,5 @@
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-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._initSortables(),FLBuilder._resizeLayout(),FLBuilder._initMediaElements(),FLBuilderLayout.init(),this._body.height("auto")}}}(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,_timeout:null,_lastClassName:null,_xhr:null,_init:function(){switch(this.nodeId=e(".fl-builder-settings").data("node"),this._saveSettings(),this._initElementsAndClasses(),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)})},updateCSSRule:function(e,t,l){this._styleSheet||(this._styleSheet=new FLStyleSheet),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)},_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._cancelDelay(),this._cancelPreview(),this._styleSheet&&this._styleSheet.remove(),this._settingsHaveChanged()&&FLBuilder._renderLayout(this.state)},clear:function(){this._cancelDelay(),this._cancelPreview(),this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=null)},_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]"),bgVideo:e(this.classes.settings+" input[name=bg_video]"),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.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.elements.bgVideo.val()&&this.preview()):"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()})},_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]"),borderTopWidth:e(this.classes.settings+" input[name=border_top]"),borderBottomWidth:e(this.classes.settings+" input[name=border_bottom]"),borderLeftWidth:e(this.classes.settings+" input[name=border_left]"),borderRightWidth:e(this.classes.settings+" input[name=border_right]")}),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)),this.elements.borderTopWidth.on("keyup",e.proxy(this._borderWidthChange,this)),this.elements.borderBottomWidth.on("keyup",e.proxy(this._borderWidthChange,this)),this.elements.borderLeftWidth.on("keyup",e.proxy(this._borderWidthChange,this)),this.elements.borderRightWidth.on("keyup",e.proxy(this._borderWidthChange,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.borderTopWidth.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")},_getBorderWidths:function(e){var t=this.elements.borderTopWidth.val(),l=this.elements.borderBottomWidth.val(),i=this.elements.borderLeftWidth.val(),o=this.elements.borderRightWidth.val();return""===t&&(t=this.elements.borderTopWidth.attr("placeholder")),""===l&&(l=this.elements.borderBottomWidth.attr("placeholder")),""===i&&(i=this.elements.borderLeftWidth.attr("placeholder")),""===o&&(o=this.elements.borderRightWidth.attr("placeholder")),{top:this.parseFloat(t),bottom:this.parseFloat(l),left:this.parseFloat(i),right:this.parseFloat(o)}},_borderWidthChange:function(e){var t=this._getBorderWidths();this.elements.borderColor.trigger("change"),this.updateCSSRule(this.classes.content,{"border-top-width":t.top+"px","border-bottom-width":t.bottom+"px","border-left-width":t.left+"px","border-right-width":t.right+"px"}),this._positionAbsoluteBgs()},_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},_initMargins:function(){e.extend(this.elements,{marginTop:e(this.classes.settings+" input[name=margin_top]"),marginBottom:e(this.classes.settings+" input[name=margin_bottom]"),marginLeft:e(this.classes.settings+" input[name=margin_left]"),marginRight:e(this.classes.settings+" input[name=margin_right]")}),this.elements.marginTop.on("keyup",e.proxy(this._marginChange,this)),this.elements.marginBottom.on("keyup",e.proxy(this._marginChange,this)),this.elements.marginLeft.on("keyup",e.proxy(this._marginChange,this)),this.elements.marginRight.on("keyup",e.proxy(this._marginChange,this))},_getMargins:function(e){var t=this.elements.marginTop.val(),l=this.elements.marginBottom.val(),i=this.elements.marginLeft.val(),o=this.elements.marginRight.val();return""===t&&(t=this.elements.marginTop.attr("placeholder")),""===l&&(l=this.elements.marginBottom.attr("placeholder")),""===i&&(i=this.elements.marginLeft.attr("placeholder")),""===o&&(o=this.elements.marginRight.attr("placeholder")),{top:this.parseFloat(t),bottom:this.parseFloat(l),left:this.parseFloat(i),right:this.parseFloat(o)}},_marginChange:function(e){var t=this._getMargins();this.updateCSSRule(this.classes.content,{"margin-top":t.top+"px","margin-bottom":t.bottom+"px","margin-left":t.left+"px","margin-right":t.right+"px"}),this._positionAbsoluteBgs()},_initPadding:function(){e.extend(this.elements,{paddingTop:e(this.classes.settings+" input[name=padding_top]"),paddingBottom:e(this.classes.settings+" input[name=padding_bottom]"),paddingLeft:e(this.classes.settings+" input[name=padding_left]"),paddingRight:e(this.classes.settings+" input[name=padding_right]")}),this.elements.paddingTop.on("keyup",e.proxy(this._paddingChange,this)),this.elements.paddingBottom.on("keyup",e.proxy(this._paddingChange,this)),this.elements.paddingLeft.on("keyup",e.proxy(this._paddingChange,this)),this.elements.paddingRight.on("keyup",e.proxy(this._paddingChange,this))},_getPadding:function(e){var t=this.elements.paddingTop.val(),l=this.elements.paddingBottom.val(),i=this.elements.paddingLeft.val(),o=this.elements.paddingRight.val();return""===t&&(t=this.elements.paddingTop.attr("placeholder")),""===l&&(l=this.elements.paddingBottom.attr("placeholder")),""===i&&(i=this.elements.paddingLeft.attr("placeholder")),""===o&&(o=this.elements.paddingRight.attr("placeholder")),{top:this.parseFloat(t),bottom:this.parseFloat(l),left:this.parseFloat(i),right:this.parseFloat(o)}},_paddingChange:function(e){var t=this._getPadding();this.updateCSSRule(this.classes.content,{"padding-top":t.top+"px","padding-bottom":t.bottom+"px","padding-left":t.left+"px","padding-right":t.right+"px"}),this._positionAbsoluteBgs()},_positionAbsoluteBgs:function(){var e=this.elements.node.find(".fl-bg-slideshow"),t=this.elements.node.find(".fl-bg-video"),l=null,i=null;(e.length>0||t.length>0)&&(l=this._getMargins(),i=this._getBorderWidths(),e.length>0&&(this.updateCSSRule(this.classes.node+" .fl-bg-slideshow",{top:l.top+i.top+"px",bottom:l.bottom+i.bottom+"px",left:l.left+i.left+"px",right:l.right+i.right+"px"}),FLBuilder._resizeLayout()),t.length>0&&this.updateCSSRule(this.classes.node+" .fl-bg-video",{top:l.top+i.top+"px",bottom:l.bottom+i.bottom+"px",left:l.left+i.left+"px",right:l.right+i.right+"px"}))},_initRow:function(){e.extend(this.elements,{width:e(this.classes.settings+" select[name=width]"),height:e(this.classes.settings+" select[name=full_height]"),contentWidth:e(this.classes.settings+" select[name=content_width]")}),this.elements.width.on("change",e.proxy(this._rowWidthChange,this)),this.elements.height.on("change",e.proxy(this._rowHeightChange,this)),this.elements.contentWidth.on("change",e.proxy(this._rowContentWidthChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeBorder(),this._initNodeClassName(),this._initMargins(),this._initPadding()},_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;"full"==this.elements.height.val()?t.addClass("fl-row-full-height"):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]")}),this.elements.size.on("keyup",e.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",e.proxy(this._colHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeBorder(),this._initNodeClassName(),this._initMargins(),this._initPadding()},_colSizeChange:function(){var t=10,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))}),t>i&&(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");"yes"==this.elements.columnHeight.val()?e.addClass("fl-col-group-equal-height"):e.removeClass("fl-col-group-equal-height")},_initModule:function(){this._initNodeClassName(),this._initMargins()},_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)}},_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"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="//fonts.googleapis.com/css?family=",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"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).val();"%"==s?r=parseInt(r)/100:r+=s,this.updateCSSRule(i,o,r)},_previewColor:function(t,l){var i=this._getPreviewSelector(this.classes.node,t.selector),o=e(l.target).val(),s=""===o?"inherit":"#"+o;this.updateCSSRule(i,t.property,s)},_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){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)},_startSettingsLoading:function(t){var l=e(".fl-builder-settings"),i=t.closest(".fl-builder-service-settings"),o=e(".fl-builder-service-error");
2
- 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()}};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,_addModuleAfterRowRender:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_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._initSortables(),FLBuilder._initCoreTemplateSettings(),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:25,top:20},distance:1,helper:FLBuilder._blockDragHelper,start:FLBuilder._blockDragStart,sort:FLBuilder._blockDragSort,placeholder:"fl-builder-drop-zone",tolerance:"intersect"},l="",i="";l="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row-content":FLBuilder._contentClass+", "+FLBuilder._contentClass+" .fl-row:not(.fl-node-global) .fl-row-content",i="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row-content, "+FLBuilder._contentClass+" .fl-col-content":FLBuilder._contentClass+", "+FLBuilder._contentClass+" .fl-row:not(.fl-node-global) .fl-row-content, "+FLBuilder._contentClass+" .fl-col:not(.fl-node-global) .fl-col-content",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,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,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(FLBuilder._contentClass).sortable(e.extend({},t,{handle:".fl-row-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._rowDragHelper,items:".fl-row",stop:FLBuilder._rowDragStop})),e(FLBuilder._contentClass+" .fl-row-content").sortable(e.extend({},t,{handle:".fl-row-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._rowDragHelper,items:".fl-col-group",stop:FLBuilder._rowDragStop})),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",stop:FLBuilder._moduleDragStop}))},_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(".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-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._blockDragInit),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","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-col-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-col-overlay .fl-block-remove","click",FLBuilder._deleteColClicked),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-insert-before","click",FLBuilder._insertColBeforeClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-insert-after","click",FLBuilder._insertColAfterClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-reset","click",FLBuilder._resetColumnWidths),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;return t||l||i?FLBuilderStrings.unloadWarning:void 0},_initTipTips:function(){e(".fl-tip").tipTip()},_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){e(this).closest(".fl-builder-submenu-open").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-submenu-open").removeClass("fl-builder-submenu-open")},500);l.data("timeout",i)},_toolsClicked:function(){var e={},t=FLBuilderConfig.lite,l=FLBuilderConfig.enabledTemplates;t||FLBuilderConfig.isUserTemplate||"enabled"!=l&&"user"!=l||(e["save-user-template"]=FLBuilderStrings.saveTemplate,"undefined"!=typeof FLBuilderTemplateSettings&&(e["save-template"]=FLBuilderStrings.saveCoreTemplate)),FLBuilderConfig.isUserTemplate?"undefined"!=typeof window.opener&&window.opener||(e["duplicate-layout"]=FLBuilderStrings.duplicateLayout):e["duplicate-layout"]=FLBuilderStrings.duplicateLayout,e["layout-settings"]=FLBuilderStrings.editLayoutSettings,e["global-settings"]=FLBuilderStrings.editGlobalSettings,FLBuilder._showActionsLightbox({className:"fl-builder-tools-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_doneClicked:function(){var e=FLBuilderStrings.publish;"publish"==FLBuilderConfig.postStatus||FLBuilderConfig.userCanPublish||(e=FLBuilderStrings.submitForReview),FLBuilder._showActionsLightbox({className:"fl-builder-save-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:{publish:e,draft:FLBuilderStrings.draft,discard:FLBuilderStrings.discard}})},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_helpButtonClicked:function(){var e={};FLBuilderConfig.help.tour&&(e["help-tour"]=FLBuilderStrings.takeHelpTour),FLBuilderConfig.help.video&&(e["help-video"]=FLBuilderStrings.watchHelpVideo),FLBuilderConfig.help.knowledge_base&&(e["knowledge-base"]=FLBuilderStrings.viewKnowledgeBase),FLBuilderConfig.help.forums&&(e.forums=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(),
3
- window.close()):(e=FLBuilder._exitUrl?FLBuilder._exitUrl:e.replace("?fl_builder","").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({module_margins:{required:!0,number:!0},row_margins:{required:!0,number:!0},row_padding:{required:!0,number:!0},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._updateLayout),FLBuilder._lightbox.close()}},_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&&(FLBuilderConfig.lite||(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"),o=e(".fl-user-template"),("user"==FLBuilderConfig.enabledTemplates||o.length>0)&&(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(){FLBuilder._showActionsLightbox({className:"fl-builder-template-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:{"template-replace":FLBuilderStrings.templateReplace,"template-append":FLBuilderStrings.templateAppend}})},_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()},_initCoreTemplateSettings:function(){"undefined"!=typeof FLBuilderTemplateSettings&&FLBuilderTemplateSettings.init()},_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))},_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.target),i=null,o=0,s="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";FLBuilder._dragEnabled=!0,l.closest(".fl-module").length>0?i=l.closest(".fl-module"):l.closest(".fl-row").length>0?i=l.closest(".fl-row"):l.hasClass("fl-builder-block-row")||l.hasClass("fl-builder-block-saved-row")?e(".fl-row").each(function(){null===i&&e(this).offset().top-e(window).scrollTop()>0&&(i=e(this))}):(l.hasClass("fl-builder-block-module")||l.hasClass("fl-builder-block-saved-module"))&&e(".fl-module").each(function(){null===i&&e(this).offset().top-e(window).scrollTop()>0&&(i=e(this))}),null!==i?o=i.offset().top-e(window).scrollTop():i=l,e(".fl-builder-empty-message").hide(),e(FLBuilder._contentClass+" .fl-row"+s).addClass("fl-row-highlight"),(i.hasClass("fl-module")||i.hasClass("fl-builder-block-module")||i.hasClass("fl-builder-block-saved-module"))&&e(FLBuilder._contentClass+" .fl-col"+s).addClass("fl-col-highlight"),FLBuilder._disableGlobalRows(),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays(),o>0&&scrollTo(0,i.offset().top-o)},_blockDragStart:function(t,l){FLBuilder._dragging=!0,e(FLBuilder._contentClass).sortable("refreshPositions"),e(FLBuilder._contentClass+" .fl-row-content").sortable("refreshPositions"),e(FLBuilder._contentClass+" .fl-col-content").sortable("refreshPositions")},_blockDragSort:function(e,t){if("undefined"!=typeof t.placeholder){var l=t.placeholder.parent(),i=FLBuilderStrings.insert;l.hasClass("fl-col-content")?i=t.item.hasClass("fl-builder-block-module")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-builder-block-saved-module")||t.item.hasClass("fl-builder-block-module-template")?t.item.find(".fl-builder-block-title").text():t.item.attr("data-name"):l.hasClass("fl-row-content")?i=t.item.hasClass("fl-builder-block-row")?t.item.find(".fl-builder-block-title").text():FLBuilderStrings.newColumn:l.hasClass("fl-builder-content")&&(i=t.item.hasClass("fl-builder-block-row")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-builder-block-saved-row")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-row")?FLBuilderStrings.row:FLBuilderStrings.newRow),t.placeholder.html(i),t.item.hasClass("fl-node-global")||t.item.hasClass("fl-builder-block-global")?t.placeholder.addClass("fl-builder-drop-zone-global"):t.placeholder.removeClass("fl-builder-drop-zone-global")}},_blockDragStop:function(t,l){var i=l.item.parent(),o=i.offset().top-e(window).scrollTop();i.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),e(".fl-builder-empty-message").show(),scrollTo(0,i.offset().top-o)},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),e(".fl-builder-empty-message").show())},_removeAllOverlays:function(){FLBuilder._removeRowOverlays(),FLBuilder._removeColOverlays(),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)};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")),o&&i.offset().top<43&&i.addClass("fl-row-overlay-header-bottom")},_highlightEmptyCols:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=e(FLBuilder._contentClass+" .fl-row"+t),i=e(FLBuilder._contentClass+" .fl-col"+t);l.removeClass("fl-row-highlight"),i.removeClass("fl-col-highlight"),i.each(function(){var t=e(this);0===t.find(".fl-module").length&&t.addClass("fl-col-highlight")})},_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(){if("row"!=FLBuilderConfig.userTemplateType){var t=e(".fl-row.fl-node-global");t.addClass("fl-node-disabled"),t.append('<div class="fl-node-disabled-overlay"></div>')}},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&(e(".fl-node-disabled").removeClass("fl-node-disabled"),e(".fl-node-disabled-overlay").remove())},_rowMouseenter:function(){var t=e(this),l=wp.template("fl-row-overlay");t.hasClass("fl-block-overlay-active")||(FLBuilder._appendOverlay(t,l({global:t.hasClass("fl-node-global"),node:t.attr("data-node")})),t.find(".fl-module").each(function(){e(this).outerHeight(!0)<20&&e(this).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" style="width: 190px; height: 45px;">'+FLBuilderStrings.row+"</div>")},_rowDragStop:function(t,l){var i=l.item,o=i.parent();return FLBuilder._blockDragStop(t,l),o.hasClass("fl-builder-rows")?void i.remove():void(i.hasClass("fl-builder-block")?(o.hasClass("fl-row-content")?FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),i.attr("data-cols"),o.children(".fl-col-group, .fl-builder-block").index(i)):FLBuilder._addRow(i.attr("data-cols"),o.children(".fl-row, .fl-builder-block").index(i)),i.remove(),FLBuilder._showPanel(),e(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")):FLBuilder._reorderRow(i.attr("data-node"),o.children(".fl-row").index(i)))},_reorderRow:function(e,t){FLBuilder.ajax({action:"reorder_node",node_id:e,position:t,silent:!0})},_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");l.nodeParent=i,l.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(l,function(){null!==FLBuilder._addModuleAfterRowRender&&(FLBuilder._addModuleAfterRowRender.hasClass("fl-module")&&(e(".fl-node-"+o+" .fl-col-content").append(FLBuilder._addModuleAfterRowRender),FLBuilder._reorderModule(FLBuilder._addModuleAfterRowRender)),FLBuilder._addModuleAfterRowRender=null)})},_deleteRowClicked:function(t){var l=e(this).closest(".fl-row-overlay").attr("data-node"),i=e(".fl-row[data-node="+l+"]"),o=null;i.find(".fl-module").length?(o=confirm(FLBuilderStrings.deleteRowMessage),o&&FLBuilder._deleteRow(i)):FLBuilder._deleteRow(i),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-overlay").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})},_colMouseenter:function(){var t=e(this),l=t.hasClass("fl-node-global"),i=t.parents(".fl-node-global").length>0,o=t.parents(".fl-col-group").find(".fl-col").length,s=0===t.index(),r=o===t.index()+1,n=wp.template("fl-col-overlay");FLBuilderConfig.simpleUi||l&&i&&"row"!=FLBuilderConfig.userTemplateType||t.find(".fl-module").length>0||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),FLBuilder._appendOverlay(t,n({global:l,numCols:o,first:s,last:r})),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;o||s||r||FLBuilder._removeColOverlays()},_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")},_colSettingsClicked:function(t){var l=e(this).closest(".fl-col").attr("data-node");FLBuilder._colResizing||(FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_column_settings",node_id:l},FLBuilder._colSettingsLoaded),t.stopPropagation())},_colSettingsLoaded:function(t){var l=JSON.parse(t),i=null,o=null,s=null;FLBuilder._setSettingsFormContent(l.settings),i=e(".fl-builder-col-settings"),o=i.data("node"),s=e('.fl-col[data-node="'+o+'"]'),0===s.siblings(".fl-col").length&&e(i).find("#fl-builder-settings-section-general").css("display","none"),FLBuilder.preview=new FLBuilderPreview({type:"col",state:l.state})},_deleteColClicked:function(t){var l=e(this),i=l.closest(".fl-col"),o=l.closest(".fl-module"),s=!0;o.length>0&&(s=confirm(FLBuilderStrings.deleteColumnMessage)),s&&(FLBuilder._deleteCol(i),FLBuilder._removeAllOverlays()),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-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}))},_insertColBeforeClicked:function(t){FLBuilder._insertCol(e(this).closest(".fl-col"),"before"),t.stopPropagation()},_insertColAfterClicked:function(t){FLBuilder._insertCol(e(this).closest(".fl-col"),"after"),t.stopPropagation()},_insertCol:function(e,t){FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder.ajax({action:"render_new_column",node_id:e.attr("data-node"),insert:t},FLBuilder._renderLayout)},_addColGroup:function(t,l,i){FLBuilder.showAjaxLoader(),FLBuilder._newColGroupParent=e(".fl-node-"+t+" .fl-row-content"),FLBuilder._newColGroupPosition=i,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");l.nodeParent=FLBuilder._newColGroupParent,l.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(l,function(){null!==FLBuilder._addModuleAfterRowRender&&(FLBuilder._addModuleAfterRowRender.hasClass("fl-module")&&(e(".fl-node-"+i+" .fl-col-content").append(FLBuilder._addModuleAfterRowRender),FLBuilder._reorderModule(FLBuilder._addModuleAfterRowRender)),FLBuilder._addModuleAfterRowRender=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.closest(".fl-col-group"),r=s.find(".fl-col"),n=i.closest(".fl-col"),a=null,d=100,u=0;for(i.hasClass("fl-block-col-resize-e")?(o="e",a=n.next(".fl-col")):(o="w",a=n.prev(".fl-col"));u<r.length;u++)r.eq(u).data("node")!=n.data("node")&&r.eq(u).data("node")!=a.data("node")&&(d-=parseFloat(r.eq(u)[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:s.outerWidth(),col:n,colWidth:parseFloat(n[0].style.width)/100,sibling:a,offset:l.position.left,availWidth:d},FLBuilder._colResizing=!0,FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents()},_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=10,d=Math.round(100*(l.availWidth-10))/100;10>s?(s=a,n=d):10>n&&(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+"%")},_colDragResizeStop:function(e,t){var l=FLBuilder._colResizeData;FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide(),FLBuilder.ajax({action:"resize_cols",col_id:l.col.data("node"),col_width:parseFloat(l.col[0].style.width),sibling_id:l.sibling.data("node"),sibling_width:parseFloat(l.sibling[0].style.width),silent:!0}),FLBuilder._colResizeData=null,FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50)},_resetColumnWidths:function(t){var l=e(this).closest(".fl-col-group"),i=l.find(".fl-col"),o=0;o=6===i.length?16.65:7===i.length?14.28:Math.round(100/i.length*100)/100,i.css("width",o+"%"),FLBuilder.ajax({action:"reset_col_widths",group_id:l.data("node"),silent:!0}),t.stopPropagation()},_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.parents(".fl-col-group").find(".fl-col").length,r=t.parents(".fl-col"),n=0===r.index(),a=s===r.index()+1,d=wp.template("fl-module-overlay");FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),i&&o&&"row"!=FLBuilderConfig.userTemplateType||(t.hasClass("fl-block-overlay-active")||(FLBuilder._appendOverlay(t,d({global:i,moduleName:l,numCols:s,parentFirst:n,parentLast:a})),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()},_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>")},_moduleDragStop:function(e,t){var l=t.item,i=l.parent(),o=0,s=0;return FLBuilder._blockDragStop(e,t),i.hasClass("fl-builder-modules")||i.hasClass("fl-builder-widgets")?void l.remove():(l.hasClass("fl-builder-block")?(i.hasClass("fl-builder-content")?(o=i.children(".fl-row, .fl-builder-block").index(l),s=0):i.hasClass("fl-row-content")?(o=i.children(".fl-col-group, .fl-builder-block").index(l),s=l.closest(".fl-row").attr("data-node")):(o=i.children(".fl-module, .fl-builder-block").index(l),s=l.closest(".fl-col").attr("data-node")),FLBuilder._addModule(i,s,l.attr("data-type"),o,l.attr("data-widget")),t.item.remove()):i.hasClass("fl-builder-content")?(o=i.children(".fl-row, .fl-module").index(l),FLBuilder._addModuleAfterRowRender=l,FLBuilder._addRow("1-col",o),l.remove()):i.hasClass("fl-row-content")?(o=i.children(".fl-col-group, .fl-module").index(l),FLBuilder._addModuleAfterRowRender=l,FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),"1-col",o),l.remove()):FLBuilder._reorderModule(l),void 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.ajax({action:"reorder_node",node_id:i,position:o,silent:!0}):(e.attr("data-parent",t),FLBuilder.ajax({action:"move_node",new_parent:t,node_id:i,position:o,silent:!0}))},_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(),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&&r>n){i.prepend(d(l));break}if(r>n){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(e,t){var l=t.item,i=l.parent(),o=null,s=0,r="",n=null;FLBuilder._blockDragStop(e,t),l.hasClass("fl-builder-block-saved-row")||l.hasClass("fl-builder-block-row-template")?(s=i.children(".fl-row, .fl-builder-block").index(l),o=null,r="render_new_row",n=FLBuilder._addRowComplete,FLBuilder._newRowPosition=s):(l.hasClass("fl-builder-block-saved-module")||l.hasClass("fl-builder-block-module-template"))&&(r="render_new_module",n=FLBuilder._addModuleComplete,i.hasClass("fl-builder-content")?(s=i.children(".fl-row, .fl-builder-block").index(l),o=0):i.hasClass("fl-row-content")?(s=i.children(".fl-col-group, .fl-builder-block").index(l),o=l.closest(".fl-row").attr("data-node")):(s=i.children(".fl-module, .fl-builder-block").index(l),o=l.closest(".fl-col").attr("data-node")),FLBuilder._newModuleParent=i,FLBuilder._newModulePosition=s),
4
- FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:r,template_id:l.attr("data-id"),parent_id:o,position:s},n),l.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()},_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]()},_initColorPickers:function(){var t=FLBuilderConfig.colorPresets?FLBuilderConfig.colorPresets:[];FLBuilder.colorPicker=new FLBuilderColorPicker({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}}),e(FLBuilder.colorPicker).on("presetRemoved presetAdded",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_selectSinglePhoto:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:"image"},multiple:!1})),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(){var t=FLBuilder._singlePhotoSelector.state().get("selection"),l=e(this).closest(".fl-photo-field"),i=l.find("input[type=hidden]"),o=l.find("select");t.reset(),l.addClass("fl-photo-empty"),i.val(""),o.html(""),o.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?'[gallery ids="-1"]':'[gallery ids="'+JSON.parse(i).join()+'"]',s=wp.shortcode.next("gallery",o).shortcode,r=wp.media.gallery.defaults.id,n=null,a=null;_.isUndefined(s.get("id"))&&!_.isUndefined(r)&&s.set("id",r),n=wp.media.gallery.attachments(s),a=new wp.media.model.Selection(n.models,{props:n.props.toJSON(),multiple:!0}),a.gallery=n.gallery,a.more().done(function(){a.props.set({query:!1}),a.unmirror(),a.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:a}).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();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"),h=!0;return u.length>0&&(d=u.find('option[value="'+o[a]+'"]').text()),"undefined"!=typeof r&&(t.find("label.error").remove(),t.validate().hideErrors(),h=t.validate().form(),h&&(h=r.submit())),h?("undefined"!=typeof a&&(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(".wp-editor-wrap"),i=t.attr("id"),o=t.closest(".fl-editor-field").attr("id"),s="undefined"==typeof tinyMCE?!1:tinyMCE.get(i),r=t.siblings('textarea[name="'+o+'"]');0===r.length&&(r=e('<textarea name="'+o+'"></textarea>').hide(),t.after(r)),s&&l.hasClass("tmce-active")?r.val(s.getContent()):"undefined"!=typeof switchEditors?r.val(switchEditors.wpautop(t.val())):r.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();-1==i.indexOf(o)&&l.attr("value",i.trim()+" "+o.trim()),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,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()},_showLightbox:function(e){e="undefined"==typeof e?!0: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._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout)},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder._actionsLightbox.open(t(e))},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)},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";h?f="filter":(t=e('<div id="iris-gradtest" />'),l="linear-gradient(top,#fff,#000)",e.each(p,function(e,o){return t.css(i,o+l),t.css(i).match("gradient")?(f=e,!1):void 0}),f===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css(this.bgImageString).match("gradient")&&(f="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"===f?s(t,l):p[f]+"linear-gradient("+t+", "+l.join(", ")+")"}function o(t,l){var i,o,s,n,a,d,u,c,h;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>',h="","static"===o.css("position")&&o.css({position:"relative"}),l=r(l),e.each(l,function(e,t){var o,r,n;return e===s?!1:(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+"')",h+=c.replace("%start%",t.stop).replace("%end%",r).replace("%filter%",n))))}),o.find(".iris-ie-gradient-shim").remove(),e(h).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;a>d;)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,h=u&&10>c,f=!1,p=["-moz-","-webkit-","-o-","-ms-"];e.fn.flBuilderColorPickerGradient=function(){var t=arguments;return this.each(function(){h?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=[];360>=s;)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),(h===!1||h===!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("#000000").setHSpace(t.options.mode),a=this.options.presets,f===!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"):8>=c&&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(),e("html").addClass("fl-color-picker-init")},_prepareColorFields:function(){e(".fl-color-picker-value").each(function(){var t=e(this),l=t.parent().find(".fl-color-picker-color");t.val()&&l.css({backgroundColor:"#"+t.val().toString()})})},_setTemplates:function(){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>";
5
- },_has:function(t,l){var i=!1;return e.each(l,function(e,l){return t===l?(i=!0,!1):void 0}),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()},_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?!0:"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"),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}}}}(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=.5>d?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,h;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),h=o*(1-(1-d)*i),a%6){case 0:s=o,r=h,n=u;break;case 1:s=c,r=o,n=u;break;case 2:s=u,r=o,n=h;break;case 3:s=u,r=c,n=o;break;case 4:s=h,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 0>l&&(l+=1),l>1&&(l-=1),1/6>l?e+6*(t-e)*l:.5>l?t:2/3>l?e+(t-e)*(2/3-l)*6:e},toString:function(){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 1>t?"rgba( "+l.r+", "+l.g+", "+l.b+", "+t+" )":"rgb( "+l.r+", "+l.g+", "+l.b+" )";case"hsl":case"hsla":var i=this.toHsl();return 1>t?"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+(s>o?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+(s>o?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(o>=n)return r;if(s>=o)return this;for(var a=0===r.toInt()?-1:1;o>s&&(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.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()},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?!1: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){}},_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)},_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()}}}(jQuery),function(e){FLStyleSheet=function(){},FLStyleSheet.prototype={_sheet:null,_sheetElement:null,updateRule:function(e,t,l){this._createSheet();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){this._createSheet();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)},remove:function(){this._sheetElement&&(this._sheetElement.remove(),this._sheetElement=null),this._sheet&&(this._sheet=null)},_createSheet:function(){this._sheet||(this._sheetElement=e('<style type="text/css"></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){FLBuilderAJAXLayout=function(t,i){this._data=e.extend({},this._defaults,"string"==typeof t?JSON.parse(t):t),this._callback=i,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>"),i="fl-row",l=this._data.scriptsStyles,o="";this._data.partial&&(i="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(i)||(o=e(this).remove(),l+=o[0].outerHTML)}),""!==l&&(l=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+l+"<div>":'<div class="fl-builder-node-scripts-styles">'+l+"<div>"),this._data.html=t.html(),this._data.scriptsStyles=l}},_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-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 i=e("<div>"+t+"</div>"),l="",o=null,s="",r=null,n=window.location,a=n.protocol+"//"+n.hostname+(n.port?":"+n.port:"");return i.find("script").each(function(){l=e(this).attr("src"),"undefined"!=typeof l&&(l=l.replace(a,""),o=e('script[src*="'+l+'"]'),o.length>0&&e(this).remove())}),i.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())}),i.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._initSortables(),FLBuilder._resizeLayout(),FLBuilder._initMediaElements(),FLBuilderLayout.init(),this._body.height("auto")}}}(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,_timeout:null,_lastClassName:null,_xhr:null,_init:function(){switch(this.nodeId=e(".fl-builder-settings").data("node"),this._saveSettings(),this._initElementsAndClasses(),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"),i=FLBuilder._getSettings(t);return JSON.stringify(this._savedSettings)!=JSON.stringify(i)},_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)})},updateCSSRule:function(e,t,i){this._styleSheet||(this._styleSheet=new FLStyleSheet),this._styleSheet.updateRule(e,t,i)},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),i=t>>16&255,l=t>>8&255,o=255&t;return[i,l,o]},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_saveState:function(){var t=e("#fl-post-id").val(),i=e('link[href*="/cache/'+t+'"]').attr("href"),l=e('script[src*="/cache/'+t+'"]').attr("src"),o=e(FLBuilder._contentClass).html();this.state={css:i,js:l,html:o}},preview:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=t.attr("data-node"),l=FLBuilder._getSettings(t);this._cancelPreview(),this._xhr=FLBuilder.ajax({action:"render_layout",node_id:i,node_preview:l},e.proxy(this._renderPreview,this))},delayPreview:function(t){var i="undefined"==typeof t?[]:e(t.target).closest("tr").find("th"),l=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(),i.length>0?i.append(r):l.length>0?l.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._cancelDelay(),this._cancelPreview(),this._styleSheet&&this._styleSheet.remove(),this._settingsHaveChanged()&&FLBuilder._renderLayout(this.state)},clear:function(){this._cancelDelay(),this._cancelPreview(),this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=null)},_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 i=this.elements.textColor.val(),l=this.elements.linkColor.val(),o=this.elements.hoverColor.val(),s=this.elements.headingColor.val();l=""===l?i:l,o=""===o?i:o,s=""===s?i:s,this.delay(100,e.proxy(function(){""===i?this.updateCSSRule(this.classes.node,"color","inherit"):this.updateCSSRule(this.classes.node,"color","#"+i),""===l?this.updateCSSRule(this.classes.node+" a","color","inherit"):this.updateCSSRule(this.classes.node+" a","color","#"+l),""===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]"),bgVideo:e(this.classes.settings+" input[name=bg_video]"),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.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.elements.bgVideo.val()&&this.preview()):"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 i,l,o;""===this.elements.bgColor.val()||isNaN(this.elements.bgOpacity.val())?this.updateCSSRule(this.classes.content,"background-color","transparent"):(i=this.hexToRgb(this.elements.bgColor.val()),l=this.parseFloat(this.elements.bgOpacity.val())/100,o="rgba("+i.join()+", "+l+")",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()})},_bgSlideshowChange:function(t){var i=this.elements,l=i.bgSlideshowSource.val(),o=i.bgSlideshowPhotos.val(),s=i.bgSlideshowFeedUrl.val(),r=i.bgSlideshowSpeed.val(),n=i.bgSlideshowTransSpeed.val();"wordpress"==l&&""===o||"smugmug"==l&&""===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 i,l,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")):(i=this.hexToRgb(this.elements.bgOverlayColor.val()),l=this.parseFloat(this.elements.bgOverlayOpacity.val())/100,o="rgba("+i.join()+", "+l+")",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]"),borderTopWidth:e(this.classes.settings+" input[name=border_top]"),borderBottomWidth:e(this.classes.settings+" input[name=border_bottom]"),borderLeftWidth:e(this.classes.settings+" input[name=border_left]"),borderRightWidth:e(this.classes.settings+" input[name=border_right]")}),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)),this.elements.borderTopWidth.on("keyup",e.proxy(this._borderWidthChange,this)),this.elements.borderBottomWidth.on("keyup",e.proxy(this._borderWidthChange,this)),this.elements.borderLeftWidth.on("keyup",e.proxy(this._borderWidthChange,this)),this.elements.borderRightWidth.on("keyup",e.proxy(this._borderWidthChange,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.borderTopWidth.trigger("keyup")},_borderColorChange:function(t){var i,l,o;""===this.elements.borderColor.val()||isNaN(this.elements.borderOpacity.val())?this.updateCSSRule(this.classes.content,"border-color","transparent"):(i=this.hexToRgb(this.elements.borderColor.val()),l=parseInt(this.elements.borderOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"border-color",o)},this)))},_borderOpacityChange:function(e){this.elements.borderColor.trigger("change")},_getBorderWidths:function(e){var t=this.elements.borderTopWidth.val(),i=this.elements.borderBottomWidth.val(),l=this.elements.borderLeftWidth.val(),o=this.elements.borderRightWidth.val();return""===t&&(t=this.elements.borderTopWidth.attr("placeholder")),""===i&&(i=this.elements.borderBottomWidth.attr("placeholder")),""===l&&(l=this.elements.borderLeftWidth.attr("placeholder")),""===o&&(o=this.elements.borderRightWidth.attr("placeholder")),{top:this.parseFloat(t),bottom:this.parseFloat(i),left:this.parseFloat(l),right:this.parseFloat(o)}},_borderWidthChange:function(e){var t=this._getBorderWidths();this.elements.borderColor.trigger("change"),this.updateCSSRule(this.classes.content,{"border-top-width":t.top+"px","border-bottom-width":t.bottom+"px","border-left-width":t.left+"px","border-right-width":t.right+"px"}),this._positionAbsoluteBgs()},_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},_initMargins:function(){e.extend(this.elements,{marginTop:e(this.classes.settings+" input[name=margin_top]"),marginBottom:e(this.classes.settings+" input[name=margin_bottom]"),marginLeft:e(this.classes.settings+" input[name=margin_left]"),marginRight:e(this.classes.settings+" input[name=margin_right]")}),this.elements.marginTop.on("keyup",e.proxy(this._marginChange,this)),this.elements.marginBottom.on("keyup",e.proxy(this._marginChange,this)),this.elements.marginLeft.on("keyup",e.proxy(this._marginChange,this)),this.elements.marginRight.on("keyup",e.proxy(this._marginChange,this))},_getMargins:function(e){var t=this.elements.marginTop.val(),i=this.elements.marginBottom.val(),l=this.elements.marginLeft.val(),o=this.elements.marginRight.val();return""===t&&(t=this.elements.marginTop.attr("placeholder")),""===i&&(i=this.elements.marginBottom.attr("placeholder")),""===l&&(l=this.elements.marginLeft.attr("placeholder")),""===o&&(o=this.elements.marginRight.attr("placeholder")),{top:this.parseFloat(t),bottom:this.parseFloat(i),left:this.parseFloat(l),right:this.parseFloat(o)}},_marginChange:function(e){var t=this._getMargins();this.updateCSSRule(this.classes.content,{"margin-top":t.top+"px","margin-bottom":t.bottom+"px","margin-left":t.left+"px","margin-right":t.right+"px"}),this._positionAbsoluteBgs()},_initPadding:function(){e.extend(this.elements,{paddingTop:e(this.classes.settings+" input[name=padding_top]"),paddingBottom:e(this.classes.settings+" input[name=padding_bottom]"),paddingLeft:e(this.classes.settings+" input[name=padding_left]"),paddingRight:e(this.classes.settings+" input[name=padding_right]")}),this.elements.paddingTop.on("keyup",e.proxy(this._paddingChange,this)),this.elements.paddingBottom.on("keyup",e.proxy(this._paddingChange,this)),this.elements.paddingLeft.on("keyup",e.proxy(this._paddingChange,this)),this.elements.paddingRight.on("keyup",e.proxy(this._paddingChange,this))},_getPadding:function(e){var t=this.elements.paddingTop.val(),i=this.elements.paddingBottom.val(),l=this.elements.paddingLeft.val(),o=this.elements.paddingRight.val();return""===t&&(t=this.elements.paddingTop.attr("placeholder")),""===i&&(i=this.elements.paddingBottom.attr("placeholder")),""===l&&(l=this.elements.paddingLeft.attr("placeholder")),""===o&&(o=this.elements.paddingRight.attr("placeholder")),{top:this.parseFloat(t),bottom:this.parseFloat(i),left:this.parseFloat(l),right:this.parseFloat(o)}},_paddingChange:function(e){var t=this._getPadding();this.updateCSSRule(this.classes.content,{"padding-top":t.top+"px","padding-bottom":t.bottom+"px","padding-left":t.left+"px","padding-right":t.right+"px"}),this._positionAbsoluteBgs()},_positionAbsoluteBgs:function(){var e=this.elements.node.find(".fl-bg-slideshow"),t=this.elements.node.find(".fl-bg-video"),i=null,l=null;(e.length>0||t.length>0)&&(i=this._getMargins(),l=this._getBorderWidths(),e.length>0&&(this.updateCSSRule(this.classes.node+" .fl-bg-slideshow",{top:i.top+l.top+"px",bottom:i.bottom+l.bottom+"px",left:i.left+l.left+"px",right:i.right+l.right+"px"}),FLBuilder._resizeLayout()),t.length>0&&this.updateCSSRule(this.classes.node+" .fl-bg-video",{top:i.top+l.top+"px",bottom:i.bottom+l.bottom+"px",left:i.left+l.left+"px",right:i.right+l.right+"px"}))},_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._initNodeBorder(),this._initNodeClassName(),this._initMargins(),this._initPadding()},_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._initNodeBorder(),this._initNodeClassName(),this._initMargins(),this._initPadding()},_colSizeChange:function(){var t=10,i=100-t,l=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(l)||(n.each(function(){e(this).data("node")!=r.data("node")&&(i-=parseFloat(e(this)[0].style.width),a+=parseFloat(e(this)[0].style.width))}),t>l&&(l=t),l>i&&(l=i),r.css("width",100-a-l+"%"),this.elements.node.css("width",l+"%"))},_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"),"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._initMargins()},_initDefaultFieldPreviews:function(){for(var e=this.elements.settings.find(".fl-field"),t=null,i=null,l=0;l<e.length;l++)t=e.eq(l),i=t.data("preview"),"refresh"==i.type&&this._initFieldRefreshPreview(t),"text"==i.type&&this._initFieldTextPreview(t),"css"==i.type&&this._initFieldCSSPreview(t),"widget"==i.type&&this._initFieldWidgetPreview(t),"font"==i.type&&this._initFieldFontPreview(t)},_initFieldRefreshPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this.delayPreview,this);switch(i){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,l);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)}},_initFieldTextPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this._previewText,this,l);switch(i){case"text":t.find("input[type=text]").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,l)}},_previewText:function(t,i){var l=this.elements.node.find(t.selector),o=e("<div>"+e(i.target).val()+"</div>");l.length>0&&(o.find("script").remove(),l.html(o.html()))},_previewTextEditor:function(t,i,l){var o=this.elements.node.find(t.selector),s="undefined"!=typeof tinyMCE?tinyMCE.get(i):null,r=e("#"+i),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,i){var l=t.find("textarea.wp-editor-area").attr("id"),o=null;if("refresh"==i.type)o=e.proxy(this.delayPreview,this);else{if("text"!=i.type)return;o=e.proxy(this._previewTextEditor,this,i,l)}e("#"+l).on("keyup",o),"undefined"!=typeof tinyMCE&&(editor=tinyMCE.get(l),editor.on("change",o),editor.on("keyup",o))},_initFieldFontPreview:function(t){var i=t.data("type"),l=t.data("preview");l.id=t.attr("id");var o=e.proxy(this._previewFont,this,l);"font"==i&&t.find(".fl-font-field").on("change","select",o)},_previewFont:function(t,i){var l=e(i.delegateTarget),o=l.find(".fl-font-field-font"),s=e(o).find(":selected"),r=s.parent().attr("label"),n=l.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,i,l){var o="//fonts.googleapis.com/css?family=",s="",r={},n={};r[i]=[l],FLBuilderPreview._fontsList[t]=r,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var t=FLBuilderPreview._fontsList[e];Object.keys(t).forEach(function(e){var i=t[e];n[e]=n[e]||[],i=i.filter(function(t){return n[e].indexOf(t)<0}),n[e]=n[e].concat(i)})}),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"),i=null;if("undefined"!=typeof t.rules)for(i in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[i]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(t,i){switch(t.data("type")){case"text":t.find("input[type=text]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"select":t.find("select").on("change",e.proxy(this._previewCSS,this,i));break;case"color":t.find(".fl-color-picker-value").on("change",e.proxy(this._previewColor,this,i))}},_previewCSS:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=t.property,s="undefined"==typeof t.unit?"":t.unit,r=e(i.target).val();"%"==s?r=parseInt(r)/100:r+=s,this.updateCSSRule(l,o,r)},_previewColor:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(i.target).val(),s=""===o?"inherit":"#"+o;this.updateCSSRule(l,t.property,s)},_initFieldWidgetPreview:function(t){
2
+ var i=e.proxy(this.delayPreview,this);t.find("input").on("keyup",i),t.find("input[type=checkbox]").on("click",i),t.find("textarea").on("keyup",i),t.find("select").on("change",i)},_getPreviewSelector:function(e,t){for(var i="",l=t.split(","),o=0;o<l.length;o++)i+=e+" "+l[o],o!=l.length-1&&(i+=", ");return i}}}(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)},_startSettingsLoading:function(t){var i=e(".fl-builder-settings"),l=t.closest(".fl-builder-service-settings"),o=e(".fl-builder-service-error");i.append('<div class="fl-builder-loading"></div>'),l.addClass("fl-builder-service-settings-loading"),o.remove()},_finishSettingsLoading:function(){var t=e(".fl-builder-settings"),i=e(".fl-builder-service-settings-loading");t.find(".fl-builder-loading").remove(),i.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this),o=l.closest("tr"),s=l.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(l),FLBuilder.ajax({action:"render_service_settings",node_id:i,service:s},t._serviceChangeComplete))},_serviceChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row");s.after(l.html),t._addAccountDelete(o),t._finishSettingsLoading()},_connectClicked:function(){for(var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-connect-row"),r=l.find(".fl-builder-service-connect-input"),n=null,a=null,d=0,u={action:"connect_service",node_id:i,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(i){var l=JSON.parse(i),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");l.error?(d.show(),0===a.length?r.after('<div class="fl-builder-service-error">'+l.error+"</div>"):a.after('<div class="fl-builder-service-error">'+l.error+"</div>")):(d.remove(),n.remove(),s.after(l.html)),t._addAccountDelete(o),t._finishSettingsLoading()},_accountChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),r=l.find(".fl-builder-service-connect-row"),n=l.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:i,service:o.val(),add_new:!0}:""!==d&&(u={action:"render_service_fields",node_id:i,service:o.val(),account:d}),u&&(t._startSettingsLoading(o),FLBuilder.ajax(u,t._accountChangeComplete)),t._addAccountDelete(l)},_accountChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-account-row");s.after(l.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 i=e(this).closest(".fl-builder-service-settings"),l=i.find(".fl-builder-service-select"),o=i.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:l.val(),account:o.val()},t._accountDeleteComplete),t._startSettingsLoading(o))},_accountDeleteComplete:function(){var i=e(".fl-builder-service-settings-loading"),l=i.find(".fl-builder-service-select");t._finishSettingsLoading(),l.trigger("change")},_campaignMonitorClientChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),r=e(this),n=l.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:i,service:o.val(),account:s.val(),client:a},t._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-campaign-monitor-client-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_mailChimpListChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),r=l.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:i,service:o.val(),account:s.val(),list_id:r.val()},t._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-list-select");s.closest("tr").after(l.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"),i=t.height(),l=t.offset().top+75;e(".popover[class*=tour-]").css({top:l+i+"px",visibility:"visible"})}}}(jQuery),function(e){FLBuilder={preview:null,_actionsLightbox:null,_addModuleAfterRowRender:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_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._initSortables(),FLBuilder._initStrings(),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,i,l,o){return FLBuilder.logGlobalError(e,t,i,l,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:25,top:20},distance:1,helper:FLBuilder._blockDragHelper,start:FLBuilder._blockDragStart,sort:FLBuilder._blockDragSort,placeholder:"fl-builder-drop-zone",tolerance:"intersect"},i="",l="";i="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row-content":FLBuilder._contentClass+", "+FLBuilder._contentClass+" .fl-row:not(.fl-node-global) .fl-row-content",l="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row-content, "+FLBuilder._contentClass+" .fl-col-content":FLBuilder._contentClass+", "+FLBuilder._contentClass+" .fl-row:not(.fl-node-global) .fl-row-content, "+FLBuilder._contentClass+" .fl-col:not(.fl-node-global) .fl-col-content",e(".fl-builder-rows").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),e(".fl-builder-row-templates").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass,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,items:".fl-builder-block-saved-row",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-modules, .fl-builder-widgets").sortable(e.extend({},t,{connectWith:l,items:".fl-builder-block-module",stop:FLBuilder._moduleDragStop})),e(".fl-builder-module-templates").sortable(e.extend({},t,{connectWith:l,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:l,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),e(FLBuilder._contentClass).sortable(e.extend({},t,{handle:".fl-row-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._rowDragHelper,items:".fl-row",stop:FLBuilder._rowDragStop})),e(FLBuilder._contentClass+" .fl-row-content").sortable(e.extend({},t,{handle:".fl-row-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._rowDragHelper,items:".fl-col-group",stop:FLBuilder._rowDragStop})),e(FLBuilder._contentClass+" .fl-col-content").sortable(e.extend({},t,{connectWith:l,handle:".fl-module-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._moduleDragHelper,items:".fl-module",stop:FLBuilder._moduleDragStop}))},_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(".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._blockDragInit),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","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-col-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-col-overlay .fl-block-remove","click",FLBuilder._deleteColClicked),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-insert-before","click",FLBuilder._insertColBeforeClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-insert-after","click",FLBuilder._insertColAfterClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-reset","click",FLBuilder._resetColumnWidths),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 i=e(this),l=i.attr("href");t.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=l.indexOf("?")>-1?l:l+"?fl_builder",FLBuilder._doneClicked())},_warnBeforeUnload:function(){var t=e(".fl-builder-row-settings").length>0,i=e(".fl-builder-col-settings").length>0,l=e(".fl-builder-module-settings").length>0;return t||i||l?FLBuilderStrings.unloadWarning:void 0},_initTipTips:function(){e(".fl-tip").tipTip()},_hideTipTips:function(){e("#tiptip_holder").stop().remove()},_submenuParentClicked:function(t){var i=e(this),l=i.find(".fl-builder-submenu");i.hasClass("fl-builder-submenu-open")?(i.removeClass("fl-builder-submenu-open"),i.removeClass("fl-builder-submenu-right")):(i.offset().left+l.width()>e(window).width()&&i.addClass("fl-builder-submenu-right"),i.addClass("fl-builder-submenu-open")),FLBuilder._hideTipTips(),t.preventDefault(),t.stopPropagation()},_submenuChildClicked:function(t){e(this).closest(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_submenuMouseenter:function(t){var i=e(this),l=i.data("timeout");"undefined"!=typeof l&&clearTimeout(l)},_submenuMouseleave:function(t){var i=e(this),l=setTimeout(function(){i.closest(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},500);i.data("timeout",l)},_toolsClicked:function(){var e=[],t=FLBuilderConfig.lite,i=FLBuilderConfig.enabledTemplates;t||FLBuilderConfig.isUserTemplate||"enabled"!=i&&"user"!=i||(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,
3
+ 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),i=t.parent();i.hasClass("fl-active")?i.removeClass("fl-active"):(e(".fl-builder-blocks-section").removeClass("fl-active"),i.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()):(e=FLBuilder._exitUrl?FLBuilder._exitUrl:e.replace("?fl_builder","").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 i=e("#fl-admin-url").val();window.location.href=i+"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"),i=e(this),l=i.parents("#fl-field-css");l.find(".ace_error").length>0||(t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(i.val()):e("#fl-builder-global-css").html(i.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var t=e(this).closest(".fl-builder-settings"),i=t.serializeArray(),l={},o=0;o<i.length;o++)l[i[o].name]=i[o].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_layout_settings",settings:l},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({module_margins:{required:!0,number:!0},row_margins:{required:!0,number:!0},row_padding:{required:!0,number:!0},row_width:{required:!0,number:!0},responsive_breakpoint:{required:!0,number:!0}})},_saveGlobalSettingsClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=t.serializeArray(),o={},s=0;if(i){for(;s<l.length;s++)o[l[s].name]=l[s].value;FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_global_settings",settings:o},FLBuilder._updateLayout),FLBuilder._lightbox.close()}},_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 i=JSON.parse(t),l=null,o=null;FLBuilder._setLightboxContent(i.html),l=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)&&(l.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),i=t.closest(".fl-template-preview").attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?0==i?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate(0,!1,"core")):(FLBuilder._selectedTemplateId=i,FLBuilder._selectedTemplateType="core",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(i,!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,i){t="undefined"!=typeof t&&t?"1":"0",i="undefined"==typeof i?"core":i,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader(),"core"==i?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"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_user_template",settings:l},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 i=e(this).closest(".fl-user-template"),l=i.attr("data-id"),o=e(".fl-user-template[data-id="+l+"]"),s=null;confirm(FLBuilderStrings.deleteTemplate)&&(FLBuilder.ajax({action:"delete_user_template",template_id:l}),o.fadeOut(function(){i=e(this),s=i.closest(".fl-user-template-category"),i.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))},_blockDragHelper:function(e,t){var i=t.clone();return t.clone().insertAfter(t),i.addClass("fl-builder-block-drag-helper"),i},_blockDragInit:function(t){var i=e(t.target),l=null,o=0,s="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";FLBuilder._dragEnabled=!0,i.closest(".fl-module").length>0?l=i.closest(".fl-module"):i.closest(".fl-row").length>0?l=i.closest(".fl-row"):i.hasClass("fl-builder-block-row")||i.hasClass("fl-builder-block-saved-row")?e(".fl-row").each(function(){null===l&&e(this).offset().top-e(window).scrollTop()>0&&(l=e(this))}):(i.hasClass("fl-builder-block-module")||i.hasClass("fl-builder-block-saved-module"))&&e(".fl-module").each(function(){null===l&&e(this).offset().top-e(window).scrollTop()>0&&(l=e(this))}),null!==l?o=l.offset().top-e(window).scrollTop():l=i,e(".fl-builder-empty-message").hide(),e(FLBuilder._contentClass+" .fl-row"+s).addClass("fl-row-highlight"),(l.hasClass("fl-module")||l.hasClass("fl-builder-block-module")||l.hasClass("fl-builder-block-saved-module"))&&e(FLBuilder._contentClass+" .fl-col"+s).addClass("fl-col-highlight"),FLBuilder._disableGlobalRows(),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays(),o>0&&scrollTo(0,l.offset().top-o)},_blockDragStart:function(t,i){FLBuilder._dragging=!0,e(FLBuilder._contentClass).sortable("refreshPositions"),e(FLBuilder._contentClass+" .fl-row-content").sortable("refreshPositions"),e(FLBuilder._contentClass+" .fl-col-content").sortable("refreshPositions")},_blockDragSort:function(e,t){if("undefined"!=typeof t.placeholder){var i=t.placeholder.parent(),l=FLBuilderStrings.insert;i.hasClass("fl-col-content")?l=t.item.hasClass("fl-builder-block-module")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-builder-block-saved-module")||t.item.hasClass("fl-builder-block-module-template")?t.item.find(".fl-builder-block-title").text():t.item.attr("data-name"):i.hasClass("fl-row-content")?l=t.item.hasClass("fl-builder-block-row")?t.item.find(".fl-builder-block-title").text():FLBuilderStrings.newColumn:i.hasClass("fl-builder-content")&&(l=t.item.hasClass("fl-builder-block-row")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-builder-block-saved-row")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-row")?FLBuilderStrings.row:FLBuilderStrings.newRow),t.placeholder.html(l),t.item.hasClass("fl-node-global")||t.item.hasClass("fl-builder-block-global")?t.placeholder.addClass("fl-builder-drop-zone-global"):t.placeholder.removeClass("fl-builder-drop-zone-global")}},_blockDragStop:function(t,i){var l=i.item.parent(),o=l.offset().top-e(window).scrollTop();l.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),e(".fl-builder-empty-message").show(),scrollTo(0,l.offset().top-o)},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),e(".fl-builder-empty-message").show())},_removeAllOverlays:function(){FLBuilder._removeRowOverlays(),FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),FLBuilder._hideTipTips()},_appendOverlay:function(e,t){var i=0,l=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)};e.append(t),e.addClass("fl-block-overlay-active"),FLBuilder._initTipTips(),l=e.find("> .fl-block-overlay"),r.top<0&&(i=parseInt(l.css("top"),10),i=isNaN(i)?0:i,l.css("top",r.top+i+"px")),r.bottom<0&&(i=parseInt(l.css("bottom"),10),i=isNaN(i)?0:i,l.css("bottom",r.bottom+i+"px")),o&&l.offset().top<43&&l.addClass("fl-row-overlay-header-bottom")},_highlightEmptyCols:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",i=e(FLBuilder._contentClass+" .fl-row"+t),l=e(FLBuilder._contentClass+" .fl-col"+t);i.removeClass("fl-row-highlight"),l.removeClass("fl-col-highlight"),l.each(function(){var t=e(this);0===t.find(".fl-module").length&&t.addClass("fl-col-highlight")})},_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(){if("row"!=FLBuilderConfig.userTemplateType){var t=e(".fl-row.fl-node-global");t.addClass("fl-node-disabled"),t.append('<div class="fl-node-disabled-overlay"></div>')}},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&(e(".fl-node-disabled").removeClass("fl-node-disabled"),e(".fl-node-disabled-overlay").remove())},_rowMouseenter:function(){var t=e(this),i=wp.template("fl-row-overlay");t.hasClass("fl-block-overlay-active")||(FLBuilder._appendOverlay(t,i({global:t.hasClass("fl-node-global"),node:t.attr("data-node")})),t.find(".fl-module").each(function(){e(this).outerHeight(!0)<20&&e(this).addClass("fl-module-adjust-height")}))},_rowMouseleave:function(t){var i=e(t.toElement)||e(t.relatedTarget),l=i.hasClass("fl-row-overlay"),o=i.closest(".fl-row-overlay").length>0,s=i.is("#tiptip_holder"),r=i.closest("#tiptip_holder").length>0;l||o||s||r||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return e('<div class="fl-builder-block-drag-helper" style="width: 190px; height: 45px;">'+FLBuilderStrings.row+"</div>")},_rowDragStop:function(t,i){var l=i.item,o=l.parent();return FLBuilder._blockDragStop(t,i),o.hasClass("fl-builder-rows")?void l.remove():void(l.hasClass("fl-builder-block")?(o.hasClass("fl-row-content")?FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),l.attr("data-cols"),o.children(".fl-col-group, .fl-builder-block").index(l)):FLBuilder._addRow(l.attr("data-cols"),o.children(".fl-row, .fl-builder-block").index(l)),l.remove(),FLBuilder._showPanel(),e(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")):FLBuilder._reorderRow(l.attr("data-node"),o.children(".fl-row").index(l)))},_reorderRow:function(e,t){FLBuilder.ajax({action:"reorder_node",node_id:e,position:t,silent:!0})},_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 i=JSON.parse(t),l=e(FLBuilder._contentClass),o=e(i.html).data("node");i.nodeParent=l,i.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(i,function(){null!==FLBuilder._addModuleAfterRowRender&&(FLBuilder._addModuleAfterRowRender.hasClass("fl-module")&&(e(".fl-node-"+o+" .fl-col-content").append(FLBuilder._addModuleAfterRowRender),FLBuilder._reorderModule(FLBuilder._addModuleAfterRowRender)),FLBuilder._addModuleAfterRowRender=null)})},_deleteRowClicked:function(t){var i=e(this).closest(".fl-row-overlay").attr("data-node"),l=e(".fl-row[data-node="+i+"]"),o=null;l.find(".fl-module").length?(o=confirm(FLBuilderStrings.deleteRowMessage),o&&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 i=e(this).closest(".fl-row"),l=i.attr("data-node");FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder._newRowPosition=i.index(".fl-row")+1,FLBuilder.ajax({action:"copy_row",node_id:l},FLBuilder._rowCopyComplete),t.stopPropagation()},_rowCopyComplete:function(t){var i=JSON.parse(t);i.nodeParent=e(FLBuilder._contentClass),i.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(i)},_rowSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-row-overlay").attr("data-node"),o=i.closest(".fl-block-overlay-global").length>0;o&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&window.open(e('.fl-row[data-node="'+l+'"]').attr("data-template-url")):i.hasClass("fl-block-settings")&&(FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_row_settings",node_id:l},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})},_colMouseenter:function(){var t=e(this),i=t.hasClass("fl-node-global"),l=t.parents(".fl-node-global").length>0,o=t.parents(".fl-col-group").find(".fl-col").length,s=0===t.index(),r=o===t.index()+1,n=wp.template("fl-col-overlay");FLBuilderConfig.simpleUi||i&&l&&"row"!=FLBuilderConfig.userTemplateType||t.find(".fl-module").length>0||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),FLBuilder._appendOverlay(t,n({global:i,numCols:o,first:s,last:r})),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(t){var i=e(this),l=e(t.toElement)||e(t.relatedTarget),o=i.find(".fl-module").length>0,s=l.is("#tiptip_holder"),r=l.closest("#tiptip_holder").length>0;o||s||r||FLBuilder._removeColOverlays()},_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")},_colSettingsClicked:function(t){var i=e(this).closest(".fl-col").attr("data-node");FLBuilder._colResizing||(FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_column_settings",node_id:i},FLBuilder._colSettingsLoaded),t.stopPropagation())},_colSettingsLoaded:function(t){var i=JSON.parse(t),l=null,o=null,s=null;FLBuilder._setSettingsFormContent(i.settings),l=e(".fl-builder-col-settings"),o=l.data("node"),s=e('.fl-col[data-node="'+o+'"]'),0===s.siblings(".fl-col").length&&e(l).find("#fl-builder-settings-section-general").css("display","none"),FLBuilder.preview=new FLBuilderPreview({type:"col",state:i.state})},_deleteColClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=i.closest(".fl-module"),s=!0;o.length>0&&(s=confirm(FLBuilderStrings.deleteColumnMessage)),s&&(FLBuilder._deleteCol(l),FLBuilder._removeAllOverlays()),t.stopPropagation()},_deleteCol:function(e){var t=e.closest(".fl-row"),i=e.closest(".fl-col-group"),l=0;e.remove(),rowCols=t.find(".fl-col"),groupCols=i.find(".fl-col"),0===rowCols.length&&"row"!=FLBuilderConfig.userTemplateType?FLBuilder._deleteRow(t):(0===groupCols.length?i.remove():(l=6===groupCols.length?16.65:7===groupCols.length?14.28:Math.round(100/groupCols.length*100)/100,groupCols.css("width",l+"%")),FLBuilder.ajax({action:"delete_col",node_id:e.attr("data-node"),new_width:l,silent:!0}))},_insertColBeforeClicked:function(t){FLBuilder._insertCol(e(this).closest(".fl-col"),"before"),t.stopPropagation()},_insertColAfterClicked:function(t){FLBuilder._insertCol(e(this).closest(".fl-col"),"after"),t.stopPropagation()},_insertCol:function(e,t){FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder.ajax({action:"render_new_column",node_id:e.attr("data-node"),insert:t},FLBuilder._renderLayout)},_addColGroup:function(t,i,l){FLBuilder.showAjaxLoader(),FLBuilder._newColGroupParent=e(".fl-node-"+t+" .fl-row-content"),FLBuilder._newColGroupPosition=l,FLBuilder.ajax({action:"render_new_column_group",cols:i,node_id:t,position:l},FLBuilder._addColGroupComplete)},_addColGroupComplete:function(t){var i=JSON.parse(t),l=e(i.html).find(".fl-col").data("node");i.nodeParent=FLBuilder._newColGroupParent,i.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(i,function(){null!==FLBuilder._addModuleAfterRowRender&&(FLBuilder._addModuleAfterRowRender.hasClass("fl-module")&&(e(".fl-node-"+l+" .fl-col-content").append(FLBuilder._addModuleAfterRowRender),FLBuilder._reorderModule(FLBuilder._addModuleAfterRowRender)),FLBuilder._addModuleAfterRowRender=null)})},_initColDragResizing:function(){e(".fl-block-col-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(t,i){var l=e(i.helper),o="",s=l.closest(".fl-col-group"),r=s.find(".fl-col"),n=l.closest(".fl-col"),a=null,d=100,u=0;for(l.hasClass("fl-block-col-resize-e")?(o="e",a=n.next(".fl-col")):(o="w",a=n.prev(".fl-col"));u<r.length;u++)r.eq(u).data("node")!=n.data("node")&&r.eq(u).data("node")!=a.data("node")&&(d-=parseFloat(r.eq(u)[0].style.width));FLBuilder._colResizeData={handle:l,feedbackLeft:l.find(".fl-block-col-resize-feedback-left"),feedbackRight:l.find(".fl-block-col-resize-feedback-right"),direction:o,groupWidth:s.outerWidth(),col:n,colWidth:parseFloat(n[0].style.width)/100,sibling:a,offset:i.position.left,availWidth:d},FLBuilder._colResizing=!0,FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents()},_colDragResize:function(e,t){var i=FLBuilder._colResizeData,l=(i.offset-t.position.left)/i.groupWidth,o="e"==i.direction?100*(i.colWidth-l):100*(i.colWidth+l),s=Math.round(100*o)/100,r=i.availWidth-o,n=Math.round(100*r)/100,a=10,d=Math.round(100*(i.availWidth-10))/100;10>s?(s=a,n=d):10>n&&(s=d,n=a),"e"==i.direction?(i.feedbackLeft.html(s.toFixed(1)+"%").show(),i.feedbackRight.html(n.toFixed(1)+"%").show()):(i.feedbackLeft.html(n.toFixed(1)+"%").show(),i.feedbackRight.html(s.toFixed(1)+"%").show()),i.col.css("width",s+"%"),i.sibling.css("width",n+"%")},_colDragResizeStop:function(e,t){var i=FLBuilder._colResizeData;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._colResizeData=null,FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50)},_resetColumnWidths:function(t){var i=e(this).closest(".fl-col-group"),l=i.find(".fl-col"),o=0;o=6===l.length?16.65:7===l.length?14.28:Math.round(100/l.length*100)/100,l.css("width",o+"%"),FLBuilder.ajax({action:"reset_col_widths",group_id:i.data("node"),silent:!0}),t.stopPropagation()},_moduleMouseenter:function(){var t=e(this),i=t.attr("data-name"),l=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.parents(".fl-col-group").find(".fl-col").length,r=t.parents(".fl-col"),n=0===r.index(),a=s===r.index()+1,d=wp.template("fl-module-overlay");FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),l&&o&&"row"!=FLBuilderConfig.userTemplateType||(t.hasClass("fl-block-overlay-active")||(FLBuilder._appendOverlay(t,d({global:l,moduleName:i,numCols:s,parentFirst:n,parentLast:a})),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(t){var i=(e(this),e(t.toElement)||e(t.relatedTarget)),l=i.is("#tiptip_holder"),o=i.closest("#tiptip_holder").length>0;l||o||FLBuilder._removeModuleOverlays()},_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,i){return e('<div class="fl-builder-block-drag-helper">'+i.attr("data-name")+"</div>")},_moduleDragStop:function(e,t){var i=t.item,l=i.parent(),o=0,s=0;return FLBuilder._blockDragStop(e,t),l.hasClass("fl-builder-modules")||l.hasClass("fl-builder-widgets")?void i.remove():(i.hasClass("fl-builder-block")?(l.hasClass("fl-builder-content")?(o=l.children(".fl-row, .fl-builder-block").index(i),s=0):l.hasClass("fl-row-content")?(o=l.children(".fl-col-group, .fl-builder-block").index(i),s=i.closest(".fl-row").attr("data-node")):(o=l.children(".fl-module, .fl-builder-block").index(i),s=i.closest(".fl-col").attr("data-node")),FLBuilder._addModule(l,s,i.attr("data-type"),o,i.attr("data-widget")),t.item.remove()):l.hasClass("fl-builder-content")?(o=l.children(".fl-row, .fl-module").index(i),FLBuilder._addModuleAfterRowRender=i,FLBuilder._addRow("1-col",o),i.remove()):l.hasClass("fl-row-content")?(o=l.children(".fl-col-group, .fl-module").index(i),FLBuilder._addModuleAfterRowRender=i,FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),"1-col",o),i.remove()):FLBuilder._reorderModule(i),void FLBuilder._resizeLayout())},_reorderModule:function(e){var t=e.closest(".fl-col").attr("data-node"),i=e.attr("data-parent"),l=e.attr("data-node"),o=e.index();t==i?FLBuilder.ajax({action:"reorder_node",node_id:l,position:o,silent:!0}):(e.attr("data-parent",t),FLBuilder.ajax({action:"move_node",new_parent:t,node_id:l,position:o,silent:!0}))},_deleteModuleClicked:function(t){var i=e(this).closest(".fl-module"),l=confirm(FLBuilderStrings.deleteModuleMessage);l&&(FLBuilder._deleteModule(i),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 i=e(this).closest(".fl-module");FLBuilder.showAjaxLoader(),FLBuilder._removeAllOverlays(),FLBuilder._newModuleParent=i.parent(),FLBuilder._newModulePosition=i.index()+1,FLBuilder.ajax({action:"copy_module",node_id:i.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 i=e(this),l=i.closest(".fl-module").attr("data-node"),o=i.closest(".fl-col").attr("data-node"),s=i.closest(".fl-module").attr("data-type"),r=i.closest(".fl-block-overlay-global").length>0;t.stopPropagation(),FLBuilder._colResizing||r&&!FLBuilderConfig.userCanEditGlobalTemplates||FLBuilder._showModuleSettings(l,o,s)},_showModuleSettings:function(e,t,i){FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder.ajax({action:"render_module_settings",node_id:e,type:i,parent_id:t},FLBuilder._moduleSettingsLoaded)},_moduleSettingsLoaded:function(t){var i=JSON.parse(t),l=e("<div>"+i.settings+"</div>"),o=l.find("link.fl-builder-settings-css"),s=l.find("script.fl-builder-settings-js"),r=l.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(l),"undefined"!=typeof i.layout&&(a=i.layout,a.nodeParent=FLBuilder._newModuleParent,a.nodePosition=FLBuilder._newModulePosition),"undefined"!=typeof i.state&&(d=i.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"),i=t.attr("data-type"),l=(t.attr("data-node"),FLBuilder._moduleHelpers[i]),o=!0;"undefined"!=typeof l&&(t.find("label.error").remove(),t.validate().hideErrors(),o=t.validate().form(),o&&(o=l.submit())),o?(FLBuilder._saveSettings(),FLBuilder._lightbox.close()):FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,i,l,o){FLBuilder.showAjaxLoader(),FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=l,FLBuilder.ajax({action:"render_new_module",parent_id:t,type:i,position:l,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,i){var l={rules:{},init:function(){},submit:function(){return!0},preview:function(){}};FLBuilder._moduleHelpers[t]=e.extend({},l,i)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings");FLBuilder._saveSettings(),FLBuilder.ajax({action:"render_node_template_settings",node_id:i.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"),i=t.validate().form();i&&(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){
4
+ var i=JSON.parse(t),l=e(".fl-builder-saved-"+i.type+"s"),o=l.find(".fl-builder-block"),s=null,r="",n=i.name.toLowerCase(),a=0,d=wp.template("fl-node-template-block");if("row"==i.type?FLBuilder.alert(FLBuilderStrings.rowTemplateSaved):"module"==i.type&&FLBuilder.alert(FLBuilderStrings.moduleTemplateSaved),i.layout&&FLBuilder._renderLayout(i.layout),0===o.length)l.append(d(i));else for(;a<o.length;a++){if(s=o.eq(a),r=s.text().toLowerCase().trim(),0===a&&r>n){l.prepend(d(i));break}if(r>n){s.before(d(i));break}if(o.length-1===a){l.append(d(i));break}}l.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(e,t){var i=t.item,l=i.parent(),o=null,s=0,r="",n=null;FLBuilder._blockDragStop(e,t),i.hasClass("fl-builder-block-saved-row")||i.hasClass("fl-builder-block-row-template")?(s=l.children(".fl-row, .fl-builder-block").index(i),o=null,r="render_new_row",n=FLBuilder._addRowComplete,FLBuilder._newRowPosition=s):(i.hasClass("fl-builder-block-saved-module")||i.hasClass("fl-builder-block-module-template"))&&(r="render_new_module",n=FLBuilder._addModuleComplete,l.hasClass("fl-builder-content")?(s=l.children(".fl-row, .fl-builder-block").index(i),o=0):l.hasClass("fl-row-content")?(s=l.children(".fl-col-group, .fl-builder-block").index(i),o=i.closest(".fl-row").attr("data-node")):(s=l.children(".fl-module, .fl-builder-block").index(i),o=i.closest(".fl-col").attr("data-node")),FLBuilder._newModuleParent=l,FLBuilder._newModulePosition=s),FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:r,template_id:i.attr("data-id"),template_type:i.attr("data-type"),parent_id:o,position:s},n),i.remove()},_editNodeTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteNodeTemplateClicked:function(t){var i=e(t.target),l=i.closest(".fl-builder-blocks-section"),o=l.find(".fl-builder-blocks-section-content"),s=o.find(".fl-builder-block"),r=i.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 i=e(this),l=i.closest(".fl-builder-settings"),o=i.attr("href").split("#").pop();l.find(".fl-builder-settings-tab").removeClass("fl-active"),l.find("#"+o).addClass("fl-active"),l.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),e(this).addClass("fl-active"),t.preventDefault()},_settingsCancelClicked:function(t){var i=e(".fl-builder-module-settings"),l=null,o=null,s=null,r=null;i.length>0&&"undefined"!=typeof i.data("new-module")?(l=e(FLBuilder.preview.state.html),o=e(".fl-node-"+i.data("node")),s=o.closest(".fl-col"),r=l.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,i){var l=e(".fl-builder-settings").last();l.validate({ignore:[],rules:t,messages:i,errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab"),l=null,o=null,s=0;s<i.length;s++)l=i.eq(s),o=l.find("label.error"),tabLink=t.find(".fl-builder-settings-tabs a[href*="+l.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 i=t.serializeArray(),l=0,o=0,s="",r="",n="",a=[],d=[],u={};for(l=0;l<i.length;l++)if(s=i[l].value.replace(/\r/gm,""),!(i[l].name.indexOf("flrich")>-1))if(i[l].name.indexOf("[")>-1){for(r=i[l].name.replace(/\[(.*)\]/,""),n=i[l].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[i[l].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"),i=t.attr("data-node"),l=FLBuilder._getSettings(t);FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_settings",node_id:i,settings:l},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,i,l){e(this).siblings(".as-values").val(l.join(",")).trigger("change")},_initMultipleFields:function(){for(var t=e(".fl-builder-field-multiples"),i=null,l=null,o=0,s=FLBuilderConfig.isRtl?{left:10}:{right:10};o<t.length;o++)i=t.eq(o),l=i.find(".fl-builder-field-multiple"),1===l.length?l.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):l.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),i=t.attr("data-field"),l=t.closest("tr").siblings("tr[data-field="+i+"]").last(),o=l.clone(),s=parseInt(l.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(""),l.after(o),FLBuilder._initMultipleFields()},_copyFieldClicked:function(){var t=e(this),i=t.closest("tr"),l=i.clone(),o=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;l.find("th label span.fl-builder-field-index").html(o),i.after(l),FLBuilder._renumberFields(i.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var t=e(this).closest("tr"),i=t.parent(),l=confirm(FLBuilderStrings.deleteFieldMessage);l&&(t.remove(),FLBuilder._renumberFields(i),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview())},_renumberFields:function(e){for(var t=e.find(".fl-builder-field-multiple"),i=0;i<t.length;i++)t.eq(i).find("th label span.fl-builder-field-index").html(i+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),i=t.attr("data-toggle"),l=t.attr("data-hide"),o=t.attr("data-trigger"),s=t.val(),r=0;if("undefined"!=typeof i){i=JSON.parse(i);for(r in i)FLBuilder._settingsSelectToggle(i[r].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[r].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[r].tabs,"hide","a[href*=fl-builder-settings-tab-","]");"undefined"!=typeof i[s]&&(FLBuilder._settingsSelectToggle(i[s].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(i[s].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[s].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if("undefined"!=typeof l&&(l=JSON.parse(l),"undefined"!=typeof l[s]&&(FLBuilder._settingsSelectToggle(l[s].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(l[s].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[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,i,l,o){var s=0;if(o="undefined"==typeof o?"":o,"undefined"!=typeof t)for(;s<t.length;s++)e(l+t[s]+o)[i]()},_initColorPickers:function(){var t=FLBuilderConfig.colorPresets?FLBuilderConfig.colorPresets:[];FLBuilder.colorPicker=new FLBuilderColorPicker({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}}),e(FLBuilder.colorPicker).on("presetRemoved presetAdded",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_selectSinglePhoto:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:"image"},multiple:!1})),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"),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=l.val(),s=null;e(this).hasClass("fl-photo-replace")?(t.reset(),i.addClass("fl-photo-empty"),l.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(),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-photo-preview img"),s=i.find("select");l.val(t.id),o.attr("src",FLBuilder._getPhotoSrc(t)),i.removeClass("fl-photo-empty"),i.find("label.error").remove(),s.show(),s.html(FLBuilder._getPhotoSizeOptions(t)),s.trigger("change")},_singlePhotoRemoved:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection"),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=i.find("select");t.reset(),i.addClass("fl-photo-empty"),l.val(""),o.html(""),o.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="",i=null,l=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(i in e.sizes)o="undefined"!=typeof s[i]?s[i]+" - ":"undefined"!=typeof FLBuilderConfig.customImageSizeTitles[i]?FLBuilderConfig.customImageSizeTitles[i]+" - ":"",l="full"==i?' selected="selected"':"",t+='<option value="'+e.sizes[i].url+'"'+l+">"+o+e.sizes[i].width+" x "+e.sizes[i].height+"</option>";return t},_selectMultiplePhotos:function(){var t=e(this).closest(".fl-multiple-photos-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""===l?'[gallery ids="-1"]':'[gallery ids="'+JSON.parse(l).join()+'"]',s=wp.shortcode.next("gallery",o).shortcode,r=wp.media.gallery.defaults.id,n=null,a=null;_.isUndefined(s.get("id"))&&!_.isUndefined(r)&&s.set("id",r),n=wp.media.gallery.attachments(s),a=new wp.media.model.Selection(n.models,{props:n.props.toJSON(),multiple:!0}),a.gallery=n.gallery,a.more().done(function(){a.props.set({query:!1}),a.unmirror(),a.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:a}).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 i=e(this).closest(".fl-multiple-photos-field"),l=i.find("input[type=hidden]"),o=i.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),i.removeClass("fl-multiple-photos-empty"),i.find("label.error").remove(),l.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(),i=e(this).closest(".fl-video-field"),l=i.find(".fl-video-preview-img img"),o=i.find(".fl-video-preview-filename"),s=i.find("input[type=hidden]");l.attr("src",t.icon),o.html(t.filename),i.removeClass("fl-video-empty"),i.find("label.error").remove(),s.val(t.id).trigger("change")},_selectMultipleAudios:function(){var t=e(this).closest(".fl-multiple-audios-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""==l?'[playlist ids="-1"]':'[playlist ids="'+JSON.parse(l).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 i=e(this).closest(".fl-multiple-audios-field"),l=i.find(".fl-multiple-audios-count"),o=i.find("input[type=hidden]"),s=[],r=0;r<t.models.length;r++)s.push(t.models[r].id);1==s.length?l.html("1 "+FLBuilderStrings.audioSelected):l.html(s.length+" "+FLBuilderStrings.audiosSelected),o.val(JSON.stringify(s)).trigger("change"),i.removeClass("fl-multiple-audios-empty"),i.find("label.error").remove()},_selectIcon:function(){var e=this;FLIconSelector.open(function(t){FLBuilder._iconSelected.apply(e,[t])})},_iconSelected:function(t){var i=e(this).closest(".fl-icon-field"),l=i.find("input[type=hidden]"),o=i.find("i"),s=o.attr("data-icon");l.val(t).trigger("change"),o.removeClass(s),o.addClass(t),o.attr("data-icon",t),i.removeClass("fl-icon-empty"),i.find("label.error").remove()},_removeIcon:function(){var t=e(this).closest(".fl-icon-field"),i=t.find("input[type=hidden]"),l=t.find("i");i.val("").trigger("change"),l.removeClass(),l.attr("data-icon",""),t.addClass("fl-icon-empty")},_formFieldClicked:function(){var t=e(this),i=t.closest(".fl-lightbox-wrap").attr("data-instance-id"),l=FLLightbox._instances[i],o=l._node.find(".fl-lightbox").css("left"),s=l._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"),i=FLLightbox._instances[t],l=e(".fl-builder-settings-lightbox"),o=l.find("form"),s=i._node.find(".fl-lightbox").css("left"),r=i._node.find(".fl-lightbox").css("top"),n=0,a=e(window),d=a.height();i._node.find(".fl-lightbox-content").html('<div class="fl-builder-lightbox-loading"></div>'),n=i._node.find(".fl-lightbox").height(),d-80>n?i._node.find(".fl-lightbox").css("top",(d-n)/2-40+"px"):i._node.find(".fl-lightbox").css("top","0px"),i.on("close",function(){l.show(),l.find("label.error").remove(),o.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors(),l.find(".fl-lightbox").css({left:s,top:r})}),setTimeout(function(){i.close(),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked)},500)},_saveFormFieldClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),l=t.attr("data-type"),o=FLBuilder._getSettings(t),s={},r=FLBuilder._moduleHelpers[l],n=e(".fl-builder-settings #fl-"+i),a=n.parent().attr("data-preview-text"),d=o[a],u=e('select[name="'+a+'"]'),c=document.createElement("div"),h=!0;return u.length>0&&(d=u.find('option[value="'+o[a]+'"]').text()),"undefined"!=typeof r&&(t.find("label.error").remove(),t.validate().hideErrors(),h=t.validate().form(),h&&(h=r.submit())),h?("undefined"!=typeof a&&(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),i=t.find(".fl-link-field-search-input");i.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:i.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,i){var l=e.closest(".fl-link-field"),o=l.find(".fl-link-field-search"),s=l.find(".fl-link-field-search-input"),r=l.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),i=t.find(".fl-font-field-font");i.on("change",function(){FLBuilder._getFontWeights(i)})},_getFontWeights:function(t){var i=t.next(".fl-font-field-weight"),l=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={};i.html(""),s="undefined"!=typeof FLBuilderFontFamilies.system[l]?FLBuilderFontFamilies.system[l].weights:"undefined"!=typeof FLBuilderFontFamilies.google[l]?FLBuilderFontFamilies.google[l]:FLBuilderFontFamilies["default"][l],e.each(s,function(e,t){i.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),i=t.closest(".fl-builder-settings"),l=t.closest(".wp-editor-wrap"),o=t.attr("id"),s=t.closest(".fl-editor-field").attr("id"),r="undefined"==typeof tinyMCE?!1:tinyMCE.get(o),n=t.siblings('textarea[name="'+s+'"]');0===n.length&&(n=e('<textarea name="'+s+'"></textarea>').hide(),t.after(n)),"rich-text"==i.data("type")?(r&&l.hasClass("tmce-active")&&r.save(),n.val(t.val())):r&&l.hasClass("tmce-active")?n.val(r.getContent()):"undefined"!=typeof switchEditors?n.val(switchEditors.wpautop(t.val())):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),i=e('input[name="'+t.data("target")+'"]'),l=i.val(),o=t.val(),s="";-1==l.indexOf(o)&&(s=(l.trim()+" "+o.trim()).trim(),i.val(s).trigger("change").trigger("keyup")),t.val("")},ajax:function(t,i){var l;if(FLBuilder._silentUpdate)return FLBuilder.showAjaxLoader(),void(FLBuilder._silentUpdateCallbackData=[t,i]);t.silent===!0&&(FLBuilder._silentUpdate=!0);for(l in t)"undefined"==typeof t[l]&&(t[l]=null);return t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=e("#fl-post-id").val(),t.fl_builder=1,t.fl_action=t.action,t={fl_builder_data:t},e.post(FLBuilder._ajaxUrl(),t,function(e){FLBuilder._ajaxComplete(),"undefined"!=typeof i&&i.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(),i=null;if("undefined"!=typeof e)for(i in e)t+=t.indexOf("?")>-1?"&":"?",t+=i+"="+e[i];return t},showAjaxLoader:function(){0===e(".fl-builder-lightbox-loading").length&&e(".fl-builder-loading").show()},hideAjaxLoader:function(){e(".fl-builder-loading").hide()},_showLightbox:function(e){e="undefined"==typeof e?!0: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._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),i=t.hasClass("fa-expand")?"expand":"contract";FLBuilder._lightbox.renderResize(i),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}),i=wp.template("fl-alert-lightbox");t.open(i({message:e}))},_alertClose:function(){FLLightbox.closeParent(this)},triggerHook:function(t,i){e("body").trigger("fl-builder."+t,i)},addHook:function(t,i){e("body").on("fl-builder."+t,i)},removeHook:function(t,i){e("body").off("fl-builder."+t,i)},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,i,l,o){FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(FLBuilderStrings.globalErrorMessage.replace("{message}",e).replace("{line}",i).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 i(){var t,i,l="backgroundImage";h?f="filter":(t=e('<div id="iris-gradtest" />'),i="linear-gradient(top,#fff,#000)",e.each(p,function(e,o){return t.css(l,o+i),t.css(l).match("gradient")?(f=e,!1):void 0}),f===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css(this.bgImageString).match("gradient")&&(f="webkit")),t.remove())}function l(t,i){return t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),"webkit"===f?s(t,i):p[f]+"linear-gradient("+t+", "+i.join(", ")+")"}function o(t,i){var l,o,s,n,a,d,u,c,h;t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),l="top"===t?0:1,o=e(this),s=i.length-1,n="filter",a=1===l?"left":"top",d=1===l?"right":"bottom",u=1===l?"height":"width",c='<div class="iris-ie-gradient-shim" style="position:absolute;'+u+":100%;"+a+":%start%;"+d+":%end%;"+n+':%filter%;" data-color:"%color%"></div>',h="","static"===o.css("position")&&o.css({position:"relative"}),i=r(i),e.each(i,function(e,t){var o,r,n;return e===s?!1:(o=i[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="+l+", StartColorStr='"+t.octoHex+"', EndColorStr='"+o.octoHex+"')",h+=c.replace("%start%",t.stop).replace("%end%",r).replace("%filter%",n))))}),o.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(o)}function s(t,i){var l=[];return t="top"===t?"0% 0%,0% 100%,":"0% 100%,100% 100%,",i=r(i),e.each(i,function(e,t){l.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+l.join(",")+")"}function r(t){var i=[],l=[],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()),i.push(o),l.push(s)}),l[0]===!1&&(l[0]="0%"),l[s]===!1&&(l[s]="100%"),l=n(l),e.each(l,function(e){o[e]={color:i[e],stop:l[e]}}),o}function n(t){var i,l,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(l=a-r,s=parseInt(t[r].replace("%"),10),i=(parseFloat(t[a].replace("%"))-s)/l,d=r+1,o=1;a>d;)t[d]=s+o*i+"%",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,h=u&&10>c,f=!1,p=["-moz-","-webkit-","-o-","-ms-"];e.fn.flBuilderColorPickerGradient=function(){var t=arguments;return this.each(function(){h?o.apply(this,t):e(this).css("backgroundImage",l.apply(this,t))})},e.fn.flBuilderColorPickerRaninbowGradient=function(t,i){var l,o,s,r;for(t=t||"top",l=e.extend({},{s:100,l:50},i),o="hsl(%h%,"+l.s+"%,"+l.l+"%)",s=0,r=[];360>=s;)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 i={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({},i,t),(h===!1||h===!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("#000000").setHSpace(t.options.mode),a=this.options.presets,f===!1&&i(),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"):8>=c&&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"),
5
+ 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(),e("html").addClass("fl-color-picker-init")},_prepareColorFields:function(){e(".fl-color-picker-value").each(function(){var t=e(this),i=t.parent().find(".fl-color-picker-color");t.val()&&i.css({backgroundColor:"#"+t.val().toString()})})},_setTemplates:function(){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,i){var l=!1;return e.each(i,function(e,i){return t===i?(l=!0,!1):void 0}),l},_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,i){t._addPresetView(i)}):t._presetsList.append(this._noPresetsTpl)},_addPresetView:function(t){var i=this._presetsList.find(".fl-color-picker-no-preset");i.length>0&&i.remove();var l=e(this._presetsTpl),o=Color(t);l.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(l)},_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 i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),t._ui.position({my:"left top",at:"left bottom",of:i,collision:"flipfit",using:function(e,i){t._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),i.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,i=t._ui.find(".fl-color-picker-preset-add"),l=t._ui.find(".fl-color-picker-presets"),o=l.find(".fl-color-picker-presets-open-label"),s=l.find(".fl-color-picker-presets-close-label"),r=l.find(".fl-color-picker-presets-list");i.off("click").on("click",function(){t._addPreset(t.element.val())}),r.css({height:t.element.innerHeight()+t._iris.innerHeight()+14+"px"}).hide(),l.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(i){var l=new Color(e(this).data("color").toString());t._setColor(l),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:l.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(i){i.stopPropagation(),t._removePreset(e(this).parent().data("color"))})},_removePreset:function(t){if(confirm(this.options.labels.removePresetConfirm)){var i=t.toString(),l=a.indexOf(i);l>-1&&(a.splice(l,1),this.options.presets=a,this._presetsList.find('.fl-color-picker-preset[data-color="'+i+'"]').slideUp(function(){e(this).remove()})),a.length<1&&this._presetsList.append(this._noPresetsTpl),e(this).trigger("presetRemoved",{presets:a})}},_addPreset:function(t){var i=t.toString().replace(/^#/,"");""===i?alert(this.options.labels.noneColorSelected):a.indexOf(i)>-1?alert(this.options.labels.alreadySaved.replace("%s","#"+i)):(this._addPresetView(i),this._addPresetFeedback(),a.push(i),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 i,l=this,o=l._color,s=l.options.mode,r=l._getHSpaceColor(),n=l.controls[t],a=l.options.controls;if(t!==l.active&&("square"!==l.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")}i=r.toHsl()}else i="strip"===t?{s:r.s,l:r.l}:{s:100,l:r.l};n.flBuilderColorPickerRaninbowGradient(e,i);break;case"s":"hsv"===s?"vert"===t?i=[o.clone().a(0).s(0).toCSS("rgba"),o.clone().a(1).s(0).toCSS("rgba")]:"strip"===t?i=[o.clone().s(100).toCSS("hsl"),o.clone().s(0).toCSS("hsl")]:"horiz"===t&&(i=["#fff","hsl("+r.h+",100%,50%)"]):i="vert"===t&&"h"===l.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,i);break;case"l":i="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,i);break;case"v":i="strip"===t?[o.clone().v(100).toCSS(),o.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],n.flBuilderColorPickerGradient(e,i)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_addInputListeners:function(e){var t=this,i=100,l=function(i){var l=new Color(e.val()),o=e.val().replace(/^#/,"");if(e.removeClass("iris-error"),l.error)""!==o&&e.addClass("iris-error");else if(l.toString()!==t._color.toString())if("keyup"===i.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"===i.type)return o=i.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",l).on("keyup",t._debounce(l,i))},_initControls:function(){var t=this,i=t.controls,l=i.square,o=t.options.controls,s=t._scale[o.strip];i.stripSlider.slider({orientation:"horizontal",max:s,slide:function(e,i){t.active="strip","h"===o.strip&&(i.value=s-i.value),t._color[o.strip](i.value),t._change.apply(t,arguments)}}),i.squareDrag.draggable({containment:i.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,i){t._squareDrag(e,i)},start:function(){l.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){l.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(i){var l="ui-state-focus";i.preventDefault(),"mousedown"===i.type?(t.picker.find("."+l).removeClass(l).blur(),e(this).addClass(l).focus()):e(this).removeClass(l)}).on("keydown",function(e){var l=i.square,o=i.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,l.width())),s.top=Math.max(0,Math.min(s.top,l.height())),o.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),l.mousedown(function(i){var l,o;1===i.which&&e(i.target).is("div")&&(l=t.controls.square.offset(),o={top:i.pageY-l.top,left:i.pageX-l.left},i.preventDefault(),t._squareDrag(i,{position:o}),i.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(o).trigger(i))})},_squareDrag:function(e,t){var i=this,l=i.options.controls,o=i._squareDimensions(),s=Math.round((o.h-t.position.top)/o.h*i._scale[l.vert]),r=i._scale[l.horiz]-Math.round((o.w-t.position.left)/o.w*i._scale[l.horiz]);i._color[l.horiz](r)[l.vert](s),i.active="square",i._change.apply(i,arguments)},_setColor:function(e){var t,i,l=this,o=l.options.color;l.options.color=e,e=""+e,t=e.replace(/^#/,""),i=new Color(e).setHSpace(l.options.mode),i.error?l.options.color=o:(l._color=i,l.options.color=l._color.toString(),l.active="external",l._change())},_squareDimensions:function(e){var i,l,o=this.controls.square;return e!==t&&o.data("dimensions")?o.data("dimensions"):(l=this.controls.squareDrag,i={w:o.width(),h:o.height()},o.data("dimensions",i),i)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip?!0:"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var t=this,i=t.controls,l=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]-l[s.strip]:l[s.strip],i.stripSlider.slider("value",r);break;case"square":n=t._squareDimensions(),a={left:l[s.horiz]/t._scale[s.horiz]*n.w,top:n.h-l[s.vert]/t._scale[s.vert]*n.h},t.controls.squareDrag.css(a)}}),l.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"),this._currentElement.trigger("change")))),t._paint(),t._inited=!0,t.active=!1},_debounce:function(e,t,i){var l,o;return function(){var s,r,n=this,a=arguments;return s=function(){l=null,i||(o=e.apply(n,a))},r=i&&!l,clearTimeout(l),l=setTimeout(s,t),r&&(o=e.apply(n,a)),o}}}}(jQuery),function(e,t){var i=function(e,t){return this instanceof i?this._init(e,t):new i(e,t)};i.fn=i.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 i="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),i=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":i,this[i](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 i(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],l=t.length-1;l>=0;l--)e[t[l]]=this[t[l]];return e},setHSpace:function(e){return this._hSpace="hsv"===e?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,i=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),e.match(i)&&e.match(/\)$/)){if(t=e.replace(/(\s|%)/g,"").replace(i,"").replace(/,?\);?$/,"").split(","),t.length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var l=t.length-1;l>=0;l--)if(t[l]=parseInt(t[l],10),isNaN(t[l]))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,i){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),i))},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 i,l,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?i=l=o=d:(s=.5>d?d*(1+a):d+a-d*a,r=2*d-s,i=this.hue2rgb(r,s,n+1/3),l=this.hue2rgb(r,s,n),o=this.hue2rgb(r,s,n-1/3)),this.fromRgb({r:255*i,g:255*l,b:255*o},!0))},fromHsv:function(e){var i,l,o,s,r,n,a,d,u,c,h;if("object"!=typeof e||e.h===t||e.s===t||e.v===t)return this._error();switch(this._hsv=e,this._hSpace="hsv",i=e.h/360,l=e.s/100,o=e.v/100,a=Math.floor(6*i),d=6*i-a,u=o*(1-l),c=o*(1-d*l),h=o*(1-(1-d)*l),a%6){case 0:s=o,r=h,n=u;break;case 1:s=c,r=o,n=u;break;case 2:s=u,r=o,n=h;break;case 3:s=u,r=c,n=o;break;case 4:s=h,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,i){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),i===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1/6>i?e+6*(t-e)*i:.5>i?t:2/3>i?e+(t-e)*(2/3-i)*6:e},toString:function(){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 i=this.toRgb();return 1>t?"rgba( "+i.r+", "+i.g+", "+i.b+", "+t+" )":"rgb( "+i.r+", "+i.g+", "+i.b+" )";case"hsl":case"hsla":var l=this.toHsl();return 1>t?"hsla( "+l.h+", "+l.s+"%, "+l.l+"%, "+t+" )":"hsl( "+l.h+", "+l.s+"%, "+l.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,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,r=Math.max(l,o,s),n=Math.min(l,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 l:e=(o-s)/d+(s>o?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-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,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,r=Math.max(l,o,s),n=Math.min(l,o,s),a=r,d=r-n;if(t=0===r?0:d/r,r===n)e=t=0;else{switch(r){case l:e=(o-s)/d+(s>o?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-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 i))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),l=e.toLuminosity();return t>l?(t+.05)/(l+.05):(l+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new i(t)},getReadableContrastingColor:function(e,l){if(!(e instanceof i))return this;var o=l===t?5:l,s=e.getDistanceLuminosityFrom(this),r=e.getMaxContrastColor(),n=r.getDistanceLuminosityFrom(e);if(o>=n)return r;if(s>=o)return this;for(var a=0===r.toInt()?-1:1;o>s&&(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 i=parseFloat(e);return isNaN(i)?this._error():(this._alpha=i,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 i=l[e];return function(l,o){var s=this._spaceFunc("to",i.space);return l===t?s[e]:(o===!0&&(l=s[e]+l),i.mod&&(l%=i.mod),i.range&&(l=l<i.range[0]?i.range[0]:l>i.range[1]?i.range[1]:l),s[e]=l,this._spaceFunc("from",i.space,s))}},_spaceFunc:function(e,t,i){var l=t||this._hSpace,o=e+l.charAt(0).toUpperCase()+l.substr(1);return this[o](i)}};var l={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 l)l.hasOwnProperty(o)&&(i.fn[o]=i.fn._partial(o));"object"==typeof exports?module.exports=i:e.Color=i}(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,i){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),e(i)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0},_getContentComplete:function(t){var i=JSON.parse(t);FLIconSelector._content=i.html,FLIconSelector._lightbox.setContent(i.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(),i=e(".fl-icons-filter-text").val();"all"==t?e(".fl-icons-section").show():(e(".fl-icons-section").hide(),e(".fl-"+t).show()),FLIconSelector._filterText=i,""!==i?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 i=e(t).closest(".fl-lightbox-wrap").attr("data-instance-id");FLLightbox._instances[i].close()},FLLightbox._instances={},FLLightbox.prototype={_id:null,_node:null,_visible:!1,_resizeTimer:null,_draggable:!1,_defaults:{className:"",destroyOnClose:!1},open:function(e){this._node.show(),this._visible=!0,"undefined"!=typeof e?this.setContent(e):this._resize(),this.trigger("open")},close:function(){"undefined"!=typeof tinymce&&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"),i=this._node.find(".fl-lightbox");e="undefined"==typeof e?!1:e,this._draggable&&i.draggable("destroy"),e?(this._unbind(),this._draggable=!0,t.hide(),i.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 i=this._getActiveNode();if(lightbox=i.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 i=0,l=null;for(l in FLLightbox._instances)i++;this._defaults=e.extend({},this._defaults,t),this._id=(new Date).getTime()+i,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"),i=t.height(),l=t.width(),o=e(window),s=o.height(),r=o.width(),n="0px",a=(r-l)/2-30+"px";t.css({margin:"0px",top:"auto",left:"auto"}),s-80>i&&(n=(s-i)/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(i,l){e(l._node).is(":visible")&&(t=e(l._node))}),t}}}(jQuery),function(e){FLStyleSheet=function(){},FLStyleSheet.prototype={_sheet:null,_sheetElement:null,updateRule:function(e,t,i){this._createSheet();for(var l=this._sheet.cssRules?this._sheet.cssRules:this._sheet.rules,o=null,s=0;s<l.length;s++)l[s].selectorText.toLowerCase()==e.toLowerCase()&&(o=l[s]);if(o)if("object"==typeof t)for(s in t)o.style[this._toCamelCase(s)]=t[s];else o.style[this._toCamelCase(t)]=i;else this.addRule(e,t,i)},addRule:function(e,t,i){this._createSheet();var l="",o="";if("object"==typeof t)for(o in t)l+=o+":"+t[o]+";";else l=t+":"+i+";";this._sheet.insertRule?this._sheet.insertRule(e+" { "+l+" }",this._sheet.cssRules.length):this._sheet.addRule(e,l)},remove:function(){this._sheetElement&&(this._sheetElement.remove(),this._sheetElement=null),this._sheet&&(this._sheet=null)},_createSheet:function(){this._sheet||(this._sheetElement=e('<style type="text/css"></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
@@ -140,6 +140,11 @@
140
  */
141
  close: function()
142
  {
 
 
 
 
 
143
  this._node.hide();
144
  this._visible = false;
145
  this.trigger('close');
@@ -173,6 +178,7 @@
173
  empty: function()
174
  {
175
  this._node.find('.fl-lightbox-content').empty();
 
176
  },
177
 
178
  /**
@@ -230,7 +236,7 @@
230
  if(this._draggable) {
231
  lightbox.draggable('destroy');
232
  }
233
-
234
  if(toggle) {
235
 
236
  this._unbind();
@@ -247,7 +253,7 @@
247
  this._bind();
248
  this._draggable = false;
249
  }
250
-
251
  this._resize();
252
  },
253
 
@@ -268,6 +274,77 @@
268
  FLLightbox._instances[this._id] = 'undefined';
269
  try{ delete FLLightbox._instances[this._id]; } catch(e){}
270
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
 
272
  /**
273
  * Initialize this lightbox instance.
@@ -343,6 +420,8 @@
343
  clearTimeout(this._resizeTimer);
344
 
345
  this._resizeTimer = setTimeout($.proxy(this._resize, this), 250);
 
 
346
  },
347
 
348
  /**
@@ -404,6 +483,27 @@
404
  if(e.which == 27 && this._visible) {
405
  this.close();
406
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  }
408
  };
409
 
140
  */
141
  close: function()
142
  {
143
+ // Temporary fix for link editor not closing since WP 4.5
144
+ if ( typeof tinymce !== 'undefined' ) {
145
+ tinymce.EditorManager.activeEditor.hide();
146
+ }
147
+
148
  this._node.hide();
149
  this._visible = false;
150
  this.trigger('close');
178
  empty: function()
179
  {
180
  this._node.find('.fl-lightbox-content').empty();
181
+ this._node.find('.fl-lightbox').removeClass('fl-lightbox-expanded');
182
  },
183
 
184
  /**
236
  if(this._draggable) {
237
  lightbox.draggable('destroy');
238
  }
239
+
240
  if(toggle) {
241
 
242
  this._unbind();
253
  this._bind();
254
  this._draggable = false;
255
  }
256
+
257
  this._resize();
258
  },
259
 
274
  FLLightbox._instances[this._id] = 'undefined';
275
  try{ delete FLLightbox._instances[this._id]; } catch(e){}
276
  },
277
+
278
+ /**
279
+ * Render the expand/contract of lightbox
280
+ *
281
+ * @method renderResize
282
+ * @param {String}
283
+ */
284
+ renderResize: function(method)
285
+ {
286
+ if(typeof method !== 'undefined') {
287
+ var activeNode = this._getActiveNode();
288
+ lightbox = activeNode.find('.fl-lightbox'),
289
+ boxFields = lightbox.find('.fl-builder-settings-fields'),
290
+ win = $(window),
291
+ winHeight = win.height(),
292
+ winWidth = win.width(),
293
+ boxHeaderHeight = lightbox.find('.fl-lightbox-header').height(),
294
+ boxTabsHeight = lightbox.find('.fl-builder-settings-tabs').height(),
295
+ boxFooterHeight = lightbox.find('.fl-lightbox-footer').height(),
296
+ boxFieldHeight = (winHeight - (boxHeaderHeight + boxTabsHeight + boxFooterHeight + 103)),
297
+ editor = typeof tinymce !== 'undefined' && tinymce.EditorManager.activeEditor ? tinymce : null,
298
+ editorId = editor ? editor.EditorManager.activeEditor.id : 'flhiddeneditor',
299
+ editorIframeEl = lightbox.find('#'+ editorId +'_ifr'),
300
+ editorTextarea = lightbox.find('#'+ editorId),
301
+ codeField = lightbox.find('.fl-code-field .ace_editor');
302
+
303
+ if(method == 'expand' || method == 'window_resize') {
304
+ if(method == 'window_resize' && !lightbox.hasClass('fl-lightbox-expanded')) {
305
+ return false;
306
+ }
307
+
308
+ boxFields.css('height', boxFieldHeight + 'px');
309
+
310
+ if(method == 'expand') {
311
+ lightbox.addClass('fl-lightbox-expanded');
312
+ lightbox.draggable('disable');
313
+ }
314
+
315
+ if(editorIframeEl.length > 0) {
316
+ editorIframeEl.css('height', (boxFieldHeight - 145) + 'px');
317
+ }
318
+
319
+ if(editorTextarea.length > 0) {
320
+ editorTextarea.css('height', (boxFieldHeight - 145) + 'px');
321
+ }
322
+
323
+ if(codeField.length > 0) {
324
+ codeField.css('height', (boxFieldHeight - 30) + 'px');
325
+ }
326
+
327
+ }
328
+ else {
329
+ // Contract lightbox
330
+ setTimeout($.proxy(this._resize, this), 250);
331
+
332
+ lightbox.removeClass('fl-lightbox-expanded');
333
+ boxFields.removeAttr('style');
334
+
335
+ if(editorId !== null) {
336
+ editorIframeEl.css('height', '232px');
337
+ editorTextarea.css('height', '232px');
338
+ }
339
+
340
+ if(codeField.length > 0) {
341
+ codeField.css('height', '380px');
342
+ }
343
+
344
+ lightbox.draggable('enable');
345
+ }
346
+ }
347
+ },
348
 
349
  /**
350
  * Initialize this lightbox instance.
420
  clearTimeout(this._resizeTimer);
421
 
422
  this._resizeTimer = setTimeout($.proxy(this._resize, this), 250);
423
+
424
+ this.renderResize('window_resize');
425
  },
426
 
427
  /**
483
  if(e.which == 27 && this._visible) {
484
  this.close();
485
  }
486
+ },
487
+
488
+ /**
489
+ * Get the current active lightbox from multiple instances.
490
+ *
491
+ * @since 1.0
492
+ * @access private
493
+ * @method _getActiveNode
494
+ * @return {object} Current node
495
+ */
496
+ _getActiveNode: function()
497
+ {
498
+ var activeNode = this._node;
499
+
500
+ $.each(FLLightbox._instances, function(i, obj){
501
+ if($(obj._node).is(':visible')) {
502
+ activeNode = $(obj._node);
503
+ }
504
+ });
505
+
506
+ return activeNode;
507
  }
508
  };
509
 
json/font-awesome.json CHANGED
@@ -1 +1 @@
1
- ["fa-500px","fa-adjust","fa-adn","fa-align-center","fa-align-justify","fa-align-left","fa-align-right","fa-amazon","fa-ambulance","fa-anchor","fa-android","fa-angellist","fa-angle-double-down","fa-angle-double-left","fa-angle-double-right","fa-angle-double-up","fa-angle-down","fa-angle-left","fa-angle-right","fa-angle-up","fa-apple","fa-archive","fa-area-chart","fa-arrow-circle-down","fa-arrow-circle-left","fa-arrow-circle-o-down","fa-arrow-circle-o-left","fa-arrow-circle-o-right","fa-arrow-circle-o-up","fa-arrow-circle-right","fa-arrow-circle-up","fa-arrow-down","fa-arrow-left","fa-arrow-right","fa-arrow-up","fa-arrows","fa-arrows-alt","fa-arrows-h","fa-arrows-v","fa-asterisk","fa-at","fa-automobile","fa-backward","fa-balance-scale","fa-ban","fa-bank","fa-bar-chart","fa-bar-chart-o","fa-barcode","fa-bars","fa-battery-0","fa-battery-1","fa-battery-2","fa-battery-3","fa-battery-4","fa-battery-empty","fa-battery-full","fa-battery-half","fa-battery-quarter","fa-battery-three-quarters","fa-bed","fa-beer","fa-behance","fa-behance-square","fa-bell","fa-bell-o","fa-bell-slash","fa-bell-slash-o","fa-bicycle","fa-binoculars","fa-birthday-cake","fa-bitbucket","fa-bitbucket-square","fa-bitcoin","fa-black-tie","fa-bluetooth","fa-bluetooth-b","fa-bold","fa-bolt","fa-bomb","fa-book","fa-bookmark","fa-bookmark-o","fa-briefcase","fa-btc","fa-bug","fa-building","fa-building-o","fa-bullhorn","fa-bullseye","fa-bus","fa-buysellads","fa-cab","fa-calculator","fa-calendar","fa-calendar-check-o","fa-calendar-minus-o","fa-calendar-o","fa-calendar-plus-o","fa-calendar-times-o","fa-camera","fa-camera-retro","fa-car","fa-caret-down","fa-caret-left","fa-caret-right","fa-caret-square-o-down","fa-caret-square-o-left","fa-caret-square-o-right","fa-caret-square-o-up","fa-caret-up","fa-cart-arrow-down","fa-cart-plus","fa-cc","fa-cc-amex","fa-cc-diners-club","fa-cc-discover","fa-cc-jcb","fa-cc-mastercard","fa-cc-paypal","fa-cc-stripe","fa-cc-visa","fa-certificate","fa-chain","fa-chain-broken","fa-check","fa-check-circle","fa-check-circle-o","fa-check-square","fa-check-square-o","fa-chevron-circle-down","fa-chevron-circle-left","fa-chevron-circle-right","fa-chevron-circle-up","fa-chevron-down","fa-chevron-left","fa-chevron-right","fa-chevron-up","fa-child","fa-chrome","fa-circle","fa-circle-o","fa-circle-o-notch","fa-circle-thin","fa-clipboard","fa-clock-o","fa-clone","fa-close","fa-cloud","fa-cloud-download","fa-cloud-upload","fa-cny","fa-code","fa-code-fork","fa-codepen","fa-codiepie","fa-coffee","fa-cog","fa-cogs","fa-columns","fa-comment","fa-comment-o","fa-commenting","fa-commenting-o","fa-comments","fa-comments-o","fa-compass","fa-compress","fa-connectdevelop","fa-contao","fa-copy","fa-copyright","fa-creative-commons","fa-credit-card","fa-credit-card-alt","fa-crop","fa-crosshairs","fa-css3","fa-cube","fa-cubes","fa-cut","fa-cutlery","fa-dashboard","fa-dashcube","fa-database","fa-dedent","fa-delicious","fa-desktop","fa-deviantart","fa-diamond","fa-digg","fa-dollar","fa-dot-circle-o","fa-download","fa-dribbble","fa-dropbox","fa-drupal","fa-edge","fa-edit","fa-eject","fa-ellipsis-h","fa-ellipsis-v","fa-empire","fa-envelope","fa-envelope-o","fa-envelope-square","fa-eraser","fa-eur","fa-euro","fa-exchange","fa-exclamation","fa-exclamation-circle","fa-exclamation-triangle","fa-expand","fa-expeditedssl","fa-external-link","fa-external-link-square","fa-eye","fa-eye-slash","fa-eyedropper","fa-facebook","fa-facebook-f","fa-facebook-official","fa-facebook-square","fa-fast-backward","fa-fast-forward","fa-fax","fa-feed","fa-female","fa-fighter-jet","fa-file","fa-file-archive-o","fa-file-audio-o","fa-file-code-o","fa-file-excel-o","fa-file-image-o","fa-file-movie-o","fa-file-o","fa-file-pdf-o","fa-file-photo-o","fa-file-picture-o","fa-file-powerpoint-o","fa-file-sound-o","fa-file-text","fa-file-text-o","fa-file-video-o","fa-file-word-o","fa-file-zip-o","fa-files-o","fa-film","fa-filter","fa-fire","fa-fire-extinguisher","fa-firefox","fa-flag","fa-flag-checkered","fa-flag-o","fa-flash","fa-flask","fa-flickr","fa-floppy-o","fa-folder","fa-folder-o","fa-folder-open","fa-folder-open-o","fa-font","fa-fonticons","fa-fort-awesome","fa-forumbee","fa-forward","fa-foursquare","fa-frown-o","fa-futbol-o","fa-gamepad","fa-gavel","fa-gbp","fa-ge","fa-gear","fa-gears","fa-genderless","fa-get-pocket","fa-gg","fa-gg-circle","fa-gift","fa-git","fa-git-square","fa-github","fa-github-alt","fa-github-square","fa-gittip","fa-glass","fa-globe","fa-google","fa-google-plus","fa-google-plus-square","fa-google-wallet","fa-graduation-cap","fa-gratipay","fa-group","fa-h-square","fa-hacker-news","fa-hand-grab-o","fa-hand-lizard-o","fa-hand-o-down","fa-hand-o-left","fa-hand-o-right","fa-hand-o-up","fa-hand-paper-o","fa-hand-peace-o","fa-hand-pointer-o","fa-hand-rock-o","fa-hand-scissors-o","fa-hand-spock-o","fa-hand-stop-o","fa-hashtag","fa-hdd-o","fa-header","fa-headphones","fa-heart","fa-heart-o","fa-heartbeat","fa-history","fa-home","fa-hospital-o","fa-hotel","fa-hourglass","fa-hourglass-1","fa-hourglass-2","fa-hourglass-3","fa-hourglass-end","fa-hourglass-half","fa-hourglass-o","fa-hourglass-start","fa-houzz","fa-html5","fa-i-cursor","fa-ils","fa-image","fa-inbox","fa-indent","fa-industry","fa-info","fa-info-circle","fa-inr","fa-instagram","fa-institution","fa-internet-explorer","fa-intersex","fa-ioxhost","fa-italic","fa-joomla","fa-jpy","fa-jsfiddle","fa-key","fa-keyboard-o","fa-krw","fa-language","fa-laptop","fa-lastfm","fa-lastfm-square","fa-leaf","fa-leanpub","fa-legal","fa-lemon-o","fa-level-down","fa-level-up","fa-life-bouy","fa-life-buoy","fa-life-ring","fa-life-saver","fa-lightbulb-o","fa-line-chart","fa-link","fa-linkedin","fa-linkedin-square","fa-linux","fa-list","fa-list-alt","fa-list-ol","fa-list-ul","fa-location-arrow","fa-lock","fa-long-arrow-down","fa-long-arrow-left","fa-long-arrow-right","fa-long-arrow-up","fa-magic","fa-magnet","fa-mail-forward","fa-mail-reply","fa-mail-reply-all","fa-male","fa-map","fa-map-marker","fa-map-o","fa-map-pin","fa-map-signs","fa-mars","fa-mars-double","fa-mars-stroke","fa-mars-stroke-h","fa-mars-stroke-v","fa-maxcdn","fa-meanpath","fa-medium","fa-medkit","fa-meh-o","fa-mercury","fa-microphone","fa-microphone-slash","fa-minus","fa-minus-circle","fa-minus-square","fa-minus-square-o","fa-mixcloud","fa-mobile","fa-mobile-phone","fa-modx","fa-money","fa-moon-o","fa-mortar-board","fa-motorcycle","fa-mouse-pointer","fa-music","fa-navicon","fa-neuter","fa-newspaper-o","fa-object-group","fa-object-ungroup","fa-odnoklassniki","fa-odnoklassniki-square","fa-opencart","fa-openid","fa-opera","fa-optin-monster","fa-outdent","fa-pagelines","fa-paint-brush","fa-paper-plane","fa-paper-plane-o","fa-paperclip","fa-paragraph","fa-paste","fa-pause","fa-pause-circle","fa-pause-circle-o","fa-paw","fa-paypal","fa-pencil","fa-pencil-square","fa-pencil-square-o","fa-percent","fa-phone","fa-phone-square","fa-photo","fa-picture-o","fa-pie-chart","fa-pied-piper","fa-pied-piper-alt","fa-pinterest","fa-pinterest-p","fa-pinterest-square","fa-plane","fa-play","fa-play-circle","fa-play-circle-o","fa-plug","fa-plus","fa-plus-circle","fa-plus-square","fa-plus-square-o","fa-power-off","fa-print","fa-product-hunt","fa-puzzle-piece","fa-qq","fa-qrcode","fa-question","fa-question-circle","fa-quote-left","fa-quote-right","fa-ra","fa-random","fa-rebel","fa-recycle","fa-reddit","fa-reddit-alien","fa-reddit-square","fa-refresh","fa-registered","fa-remove","fa-renren","fa-reorder","fa-repeat","fa-reply","fa-reply-all","fa-retweet","fa-rmb","fa-road","fa-rocket","fa-rotate-left","fa-rotate-right","fa-rouble","fa-rss","fa-rss-square","fa-rub","fa-ruble","fa-rupee","fa-safari","fa-save","fa-scissors","fa-scribd","fa-search","fa-search-minus","fa-search-plus","fa-sellsy","fa-send","fa-send-o","fa-server","fa-share","fa-share-alt","fa-share-alt-square","fa-share-square","fa-share-square-o","fa-shekel","fa-sheqel","fa-shield","fa-ship","fa-shirtsinbulk","fa-shopping-bag","fa-shopping-basket","fa-shopping-cart","fa-sign-in","fa-sign-out","fa-signal","fa-simplybuilt","fa-sitemap","fa-skyatlas","fa-skype","fa-slack","fa-sliders","fa-slideshare","fa-smile-o","fa-soccer-ball-o","fa-sort","fa-sort-alpha-asc","fa-sort-alpha-desc","fa-sort-amount-asc","fa-sort-amount-desc","fa-sort-asc","fa-sort-desc","fa-sort-down","fa-sort-numeric-asc","fa-sort-numeric-desc","fa-sort-up","fa-soundcloud","fa-space-shuttle","fa-spinner","fa-spoon","fa-spotify","fa-square","fa-square-o","fa-stack-exchange","fa-stack-overflow","fa-star","fa-star-half","fa-star-half-empty","fa-star-half-full","fa-star-half-o","fa-star-o","fa-steam","fa-steam-square","fa-step-backward","fa-step-forward","fa-stethoscope","fa-sticky-note","fa-sticky-note-o","fa-stop","fa-stop-circle","fa-stop-circle-o","fa-street-view","fa-strikethrough","fa-stumbleupon","fa-stumbleupon-circle","fa-subscript","fa-subway","fa-suitcase","fa-sun-o","fa-superscript","fa-support","fa-table","fa-tablet","fa-tachometer","fa-tag","fa-tags","fa-tasks","fa-taxi","fa-television","fa-tencent-weibo","fa-terminal","fa-text-height","fa-text-width","fa-th","fa-th-large","fa-th-list","fa-thumb-tack","fa-thumbs-down","fa-thumbs-o-down","fa-thumbs-o-up","fa-thumbs-up","fa-ticket","fa-times","fa-times-circle","fa-times-circle-o","fa-tint","fa-toggle-down","fa-toggle-left","fa-toggle-off","fa-toggle-on","fa-toggle-right","fa-toggle-up","fa-trademark","fa-train","fa-transgender","fa-transgender-alt","fa-trash","fa-trash-o","fa-tree","fa-trello","fa-tripadvisor","fa-trophy","fa-truck","fa-try","fa-tty","fa-tumblr","fa-tumblr-square","fa-turkish-lira","fa-tv","fa-twitch","fa-twitter","fa-twitter-square","fa-umbrella","fa-underline","fa-undo","fa-university","fa-unlink","fa-unlock","fa-unlock-alt","fa-unsorted","fa-upload","fa-usb","fa-usd","fa-user","fa-user-md","fa-user-plus","fa-user-secret","fa-user-times","fa-users","fa-venus","fa-venus-double","fa-venus-mars","fa-viacoin","fa-video-camera","fa-vimeo","fa-vimeo-square","fa-vine","fa-vk","fa-volume-down","fa-volume-off","fa-volume-up","fa-warning","fa-wechat","fa-weibo","fa-weixin","fa-whatsapp","fa-wheelchair","fa-wifi","fa-wikipedia-w","fa-windows","fa-won","fa-wordpress","fa-wrench","fa-xing","fa-xing-square","fa-y-combinator","fa-y-combinator-square","fa-yahoo","fa-yc","fa-yc-square","fa-yelp","fa-yen","fa-youtube","fa-youtube-play","fa-youtube-square"]
1
+ ["fa-500px","fa-adjust","fa-adn","fa-align-center","fa-align-justify","fa-align-left","fa-align-right","fa-amazon","fa-ambulance","fa-american-sign-language-interpreting","fa-anchor","fa-android","fa-angellist","fa-angle-double-down","fa-angle-double-left","fa-angle-double-right","fa-angle-double-up","fa-angle-down","fa-angle-left","fa-angle-right","fa-angle-up","fa-apple","fa-archive","fa-area-chart","fa-arrow-circle-down","fa-arrow-circle-left","fa-arrow-circle-o-down","fa-arrow-circle-o-left","fa-arrow-circle-o-right","fa-arrow-circle-o-up","fa-arrow-circle-right","fa-arrow-circle-up","fa-arrow-down","fa-arrow-left","fa-arrow-right","fa-arrow-up","fa-arrows","fa-arrows-alt","fa-arrows-h","fa-arrows-v","fa-asl-interpreting","fa-assistive-listening-systems","fa-asterisk","fa-at","fa-audio-description","fa-automobile","fa-backward","fa-balance-scale","fa-ban","fa-bank","fa-bar-chart","fa-bar-chart-o","fa-barcode","fa-bars","fa-battery-0","fa-battery-1","fa-battery-2","fa-battery-3","fa-battery-4","fa-battery-empty","fa-battery-full","fa-battery-half","fa-battery-quarter","fa-battery-three-quarters","fa-bed","fa-beer","fa-behance","fa-behance-square","fa-bell","fa-bell-o","fa-bell-slash","fa-bell-slash-o","fa-bicycle","fa-binoculars","fa-birthday-cake","fa-bitbucket","fa-bitbucket-square","fa-bitcoin","fa-black-tie","fa-blind","fa-bluetooth","fa-bluetooth-b","fa-bold","fa-bolt","fa-bomb","fa-book","fa-bookmark","fa-bookmark-o","fa-braille","fa-briefcase","fa-btc","fa-bug","fa-building","fa-building-o","fa-bullhorn","fa-bullseye","fa-bus","fa-buysellads","fa-cab","fa-calculator","fa-calendar","fa-calendar-check-o","fa-calendar-minus-o","fa-calendar-o","fa-calendar-plus-o","fa-calendar-times-o","fa-camera","fa-camera-retro","fa-car","fa-caret-down","fa-caret-left","fa-caret-right","fa-caret-square-o-down","fa-caret-square-o-left","fa-caret-square-o-right","fa-caret-square-o-up","fa-caret-up","fa-cart-arrow-down","fa-cart-plus","fa-cc","fa-cc-amex","fa-cc-diners-club","fa-cc-discover","fa-cc-jcb","fa-cc-mastercard","fa-cc-paypal","fa-cc-stripe","fa-cc-visa","fa-certificate","fa-chain","fa-chain-broken","fa-check","fa-check-circle","fa-check-circle-o","fa-check-square","fa-check-square-o","fa-chevron-circle-down","fa-chevron-circle-left","fa-chevron-circle-right","fa-chevron-circle-up","fa-chevron-down","fa-chevron-left","fa-chevron-right","fa-chevron-up","fa-child","fa-chrome","fa-circle","fa-circle-o","fa-circle-o-notch","fa-circle-thin","fa-clipboard","fa-clock-o","fa-clone","fa-close","fa-cloud","fa-cloud-download","fa-cloud-upload","fa-cny","fa-code","fa-code-fork","fa-codepen","fa-codiepie","fa-coffee","fa-cog","fa-cogs","fa-columns","fa-comment","fa-comment-o","fa-commenting","fa-commenting-o","fa-comments","fa-comments-o","fa-compass","fa-compress","fa-connectdevelop","fa-contao","fa-copy","fa-copyright","fa-creative-commons","fa-credit-card","fa-credit-card-alt","fa-crop","fa-crosshairs","fa-css3","fa-cube","fa-cubes","fa-cut","fa-cutlery","fa-dashboard","fa-dashcube","fa-database","fa-deaf","fa-deafness","fa-dedent","fa-delicious","fa-desktop","fa-deviantart","fa-diamond","fa-digg","fa-dollar","fa-dot-circle-o","fa-download","fa-dribbble","fa-dropbox","fa-drupal","fa-edge","fa-edit","fa-eject","fa-ellipsis-h","fa-ellipsis-v","fa-empire","fa-envelope","fa-envelope-o","fa-envelope-square","fa-envira","fa-eraser","fa-eur","fa-euro","fa-exchange","fa-exclamation","fa-exclamation-circle","fa-exclamation-triangle","fa-expand","fa-expeditedssl","fa-external-link","fa-external-link-square","fa-eye","fa-eye-slash","fa-eyedropper","fa-facebook","fa-facebook-f","fa-facebook-official","fa-facebook-square","fa-fast-backward","fa-fast-forward","fa-fax","fa-feed","fa-female","fa-fighter-jet","fa-file","fa-file-archive-o","fa-file-audio-o","fa-file-code-o","fa-file-excel-o","fa-file-image-o","fa-file-movie-o","fa-file-o","fa-file-pdf-o","fa-file-photo-o","fa-file-picture-o","fa-file-powerpoint-o","fa-file-sound-o","fa-file-text","fa-file-text-o","fa-file-video-o","fa-file-word-o","fa-file-zip-o","fa-files-o","fa-film","fa-filter","fa-fire","fa-fire-extinguisher","fa-firefox","fa-first-order","fa-flag","fa-flag-checkered","fa-flag-o","fa-flash","fa-flask","fa-flickr","fa-floppy-o","fa-folder","fa-folder-o","fa-folder-open","fa-folder-open-o","fa-font","fa-fonticons","fa-fort-awesome","fa-forumbee","fa-forward","fa-foursquare","fa-frown-o","fa-futbol-o","fa-gamepad","fa-gavel","fa-gbp","fa-ge","fa-gear","fa-gears","fa-genderless","fa-get-pocket","fa-gg","fa-gg-circle","fa-gift","fa-git","fa-git-square","fa-github","fa-github-alt","fa-github-square","fa-gitlab","fa-gittip","fa-glass","fa-glide","fa-glide-g","fa-globe","fa-google","fa-google-plus","fa-google-plus-square","fa-google-wallet","fa-graduation-cap","fa-gratipay","fa-group","fa-h-square","fa-hacker-news","fa-hand-grab-o","fa-hand-lizard-o","fa-hand-o-down","fa-hand-o-left","fa-hand-o-right","fa-hand-o-up","fa-hand-paper-o","fa-hand-peace-o","fa-hand-pointer-o","fa-hand-rock-o","fa-hand-scissors-o","fa-hand-spock-o","fa-hand-stop-o","fa-hard-of-hearing","fa-hashtag","fa-hdd-o","fa-header","fa-headphones","fa-heart","fa-heart-o","fa-heartbeat","fa-history","fa-home","fa-hospital-o","fa-hotel","fa-hourglass","fa-hourglass-1","fa-hourglass-2","fa-hourglass-3","fa-hourglass-end","fa-hourglass-half","fa-hourglass-o","fa-hourglass-start","fa-houzz","fa-html5","fa-i-cursor","fa-ils","fa-image","fa-inbox","fa-indent","fa-industry","fa-info","fa-info-circle","fa-inr","fa-instagram","fa-institution","fa-internet-explorer","fa-intersex","fa-ioxhost","fa-italic","fa-joomla","fa-jpy","fa-jsfiddle","fa-key","fa-keyboard-o","fa-krw","fa-language","fa-laptop","fa-lastfm","fa-lastfm-square","fa-leaf","fa-leanpub","fa-legal","fa-lemon-o","fa-level-down","fa-level-up","fa-life-bouy","fa-life-buoy","fa-life-ring","fa-life-saver","fa-lightbulb-o","fa-line-chart","fa-link","fa-linkedin","fa-linkedin-square","fa-linux","fa-list","fa-list-alt","fa-list-ol","fa-list-ul","fa-location-arrow","fa-lock","fa-long-arrow-down","fa-long-arrow-left","fa-long-arrow-right","fa-long-arrow-up","fa-low-vision","fa-magic","fa-magnet","fa-mail-forward","fa-mail-reply","fa-mail-reply-all","fa-male","fa-map","fa-map-marker","fa-map-o","fa-map-pin","fa-map-signs","fa-mars","fa-mars-double","fa-mars-stroke","fa-mars-stroke-h","fa-mars-stroke-v","fa-maxcdn","fa-meanpath","fa-medium","fa-medkit","fa-meh-o","fa-mercury","fa-microphone","fa-microphone-slash","fa-minus","fa-minus-circle","fa-minus-square","fa-minus-square-o","fa-mixcloud","fa-mobile","fa-mobile-phone","fa-modx","fa-money","fa-moon-o","fa-mortar-board","fa-motorcycle","fa-mouse-pointer","fa-music","fa-navicon","fa-neuter","fa-newspaper-o","fa-object-group","fa-object-ungroup","fa-odnoklassniki","fa-odnoklassniki-square","fa-opencart","fa-openid","fa-opera","fa-optin-monster","fa-outdent","fa-pagelines","fa-paint-brush","fa-paper-plane","fa-paper-plane-o","fa-paperclip","fa-paragraph","fa-paste","fa-pause","fa-pause-circle","fa-pause-circle-o","fa-paw","fa-paypal","fa-pencil","fa-pencil-square","fa-pencil-square-o","fa-percent","fa-phone","fa-phone-square","fa-photo","fa-picture-o","fa-pie-chart","fa-pied-piper","fa-pied-piper-alt","fa-pied-piper-pp","fa-pinterest","fa-pinterest-p","fa-pinterest-square","fa-plane","fa-play","fa-play-circle","fa-play-circle-o","fa-plug","fa-plus","fa-plus-circle","fa-plus-square","fa-plus-square-o","fa-power-off","fa-print","fa-product-hunt","fa-puzzle-piece","fa-qq","fa-qrcode","fa-question","fa-question-circle","fa-question-circle-o","fa-quote-left","fa-quote-right","fa-ra","fa-random","fa-rebel","fa-recycle","fa-reddit","fa-reddit-alien","fa-reddit-square","fa-refresh","fa-registered","fa-remove","fa-renren","fa-reorder","fa-repeat","fa-reply","fa-reply-all","fa-resistance","fa-retweet","fa-rmb","fa-road","fa-rocket","fa-rotate-left","fa-rotate-right","fa-rouble","fa-rss","fa-rss-square","fa-rub","fa-ruble","fa-rupee","fa-safari","fa-save","fa-scissors","fa-scribd","fa-search","fa-search-minus","fa-search-plus","fa-sellsy","fa-send","fa-send-o","fa-server","fa-share","fa-share-alt","fa-share-alt-square","fa-share-square","fa-share-square-o","fa-shekel","fa-sheqel","fa-shield","fa-ship","fa-shirtsinbulk","fa-shopping-bag","fa-shopping-basket","fa-shopping-cart","fa-sign-in","fa-sign-language","fa-sign-out","fa-signal","fa-signing","fa-simplybuilt","fa-sitemap","fa-skyatlas","fa-skype","fa-slack","fa-sliders","fa-slideshare","fa-smile-o","fa-snapchat","fa-snapchat-ghost","fa-snapchat-square","fa-soccer-ball-o","fa-sort","fa-sort-alpha-asc","fa-sort-alpha-desc","fa-sort-amount-asc","fa-sort-amount-desc","fa-sort-asc","fa-sort-desc","fa-sort-down","fa-sort-numeric-asc","fa-sort-numeric-desc","fa-sort-up","fa-soundcloud","fa-space-shuttle","fa-spinner","fa-spoon","fa-spotify","fa-square","fa-square-o","fa-stack-exchange","fa-stack-overflow","fa-star","fa-star-half","fa-star-half-empty","fa-star-half-full","fa-star-half-o","fa-star-o","fa-steam","fa-steam-square","fa-step-backward","fa-step-forward","fa-stethoscope","fa-sticky-note","fa-sticky-note-o","fa-stop","fa-stop-circle","fa-stop-circle-o","fa-street-view","fa-strikethrough","fa-stumbleupon","fa-stumbleupon-circle","fa-subscript","fa-subway","fa-suitcase","fa-sun-o","fa-superscript","fa-support","fa-table","fa-tablet","fa-tachometer","fa-tag","fa-tags","fa-tasks","fa-taxi","fa-television","fa-tencent-weibo","fa-terminal","fa-text-height","fa-text-width","fa-th","fa-th-large","fa-th-list","fa-themeisle","fa-thumb-tack","fa-thumbs-down","fa-thumbs-o-down","fa-thumbs-o-up","fa-thumbs-up","fa-ticket","fa-times","fa-times-circle","fa-times-circle-o","fa-tint","fa-toggle-down","fa-toggle-left","fa-toggle-off","fa-toggle-on","fa-toggle-right","fa-toggle-up","fa-trademark","fa-train","fa-transgender","fa-transgender-alt","fa-trash","fa-trash-o","fa-tree","fa-trello","fa-tripadvisor","fa-trophy","fa-truck","fa-try","fa-tty","fa-tumblr","fa-tumblr-square","fa-turkish-lira","fa-tv","fa-twitch","fa-twitter","fa-twitter-square","fa-umbrella","fa-underline","fa-undo","fa-universal-access","fa-university","fa-unlink","fa-unlock","fa-unlock-alt","fa-unsorted","fa-upload","fa-usb","fa-usd","fa-user","fa-user-md","fa-user-plus","fa-user-secret","fa-user-times","fa-users","fa-venus","fa-venus-double","fa-venus-mars","fa-viacoin","fa-viadeo","fa-viadeo-square","fa-video-camera","fa-vimeo","fa-vimeo-square","fa-vine","fa-vk","fa-volume-control-phone","fa-volume-down","fa-volume-off","fa-volume-up","fa-warning","fa-wechat","fa-weibo","fa-weixin","fa-whatsapp","fa-wheelchair","fa-wheelchair-alt","fa-wifi","fa-wikipedia-w","fa-windows","fa-won","fa-wordpress","fa-wpbeginner","fa-wpforms","fa-wrench","fa-xing","fa-xing-square","fa-y-combinator","fa-y-combinator-square","fa-yahoo","fa-yc","fa-yc-square","fa-yelp","fa-yen","fa-yoast","fa-youtube","fa-youtube-play","fa-youtube-square"]
languages/ar.mo CHANGED
Binary file
languages/cs_CZ.mo CHANGED
Binary file
languages/da_DK.mo CHANGED
Binary file
languages/de_DE.mo CHANGED
Binary file
languages/es_ES.mo CHANGED
Binary file
languages/fa_IR.mo CHANGED
Binary file
languages/fi.mo CHANGED
Binary file
languages/fr_CA.mo ADDED
Binary file
languages/fr_FR.mo CHANGED
Binary file
languages/he_IL.mo CHANGED
Binary file
languages/hr.mo ADDED
Binary file
languages/hu_HU.mo CHANGED
Binary file
languages/it_IT.mo CHANGED
Binary file
languages/ja.mo ADDED
Binary file
languages/nl_NL.mo CHANGED
Binary file
languages/no_NO.mo ADDED
Binary file
languages/pl_PL.mo CHANGED
Binary file
languages/pt_BR.mo CHANGED
Binary file
languages/pt_PT.mo CHANGED
Binary file
languages/ru_RU.mo CHANGED
Binary file
languages/sk_SK.mo CHANGED
Binary file
languages/sl_SL.mo ADDED
Binary file
languages/sv_SE.mo CHANGED
Binary file
languages/th.mo CHANGED
Binary file
modules/photo/includes/frontend.php CHANGED
@@ -6,10 +6,11 @@ $src = $module->get_src();
6
  $link = $module->get_link();
7
  $alt = $module->get_alt();
8
  $attrs = $module->get_attributes();
 
9
 
10
  ?>
11
  <div class="fl-photo<?php if ( ! empty( $settings->crop ) ) echo ' fl-photo-crop-' . $settings->crop ; ?> fl-photo-align-<?php echo $settings->align; ?>" itemscope itemtype="http://schema.org/ImageObject">
12
- <div class="fl-photo-content">
13
  <?php if(!empty($link)) : ?>
14
  <a href="<?php echo $link; ?>" target="<?php echo $settings->link_target; ?>" itemprop="url">
15
  <?php endif; ?>
6
  $link = $module->get_link();
7
  $alt = $module->get_alt();
8
  $attrs = $module->get_attributes();
9
+ $filetype = pathinfo($src, PATHINFO_EXTENSION);
10
 
11
  ?>
12
  <div class="fl-photo<?php if ( ! empty( $settings->crop ) ) echo ' fl-photo-crop-' . $settings->crop ; ?> fl-photo-align-<?php echo $settings->align; ?>" itemscope itemtype="http://schema.org/ImageObject">
13
+ <div class="fl-photo-content fl-photo-img-<?php echo $filetype; ?>">
14
  <?php if(!empty($link)) : ?>
15
  <a href="<?php echo $link; ?>" target="<?php echo $settings->link_target; ?>" itemprop="url">
16
  <?php endif; ?>
modules/rich-text/includes/frontend.php CHANGED
@@ -1,3 +1,9 @@
1
  <div class="fl-rich-text">
2
- <?php echo $settings->text; ?>
 
 
 
 
 
 
3
  </div>
1
  <div class="fl-rich-text">
2
+ <?php
3
+
4
+ global $wp_embed;
5
+
6
+ echo wpautop( $wp_embed->autoembed( $settings->text ) );
7
+
8
+ ?>
9
  </div>