Version Description
Download this release
Release Info
Developer | justinbusa |
Plugin | WordPress Page Builder – Beaver Builder |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.4.0 to 1.4.1
- changelog.txt +21 -0
- classes/FLBuilder.php +12 -5
- classes/FLBuilderAdmin.php +8 -5
- classes/FLBuilderModel.php +11 -5
- css/fl-builder-layout-medium.css +12 -0
- css/{fl-builder-responsive.css → fl-builder-layout-responsive.css} +14 -14
- css/fl-builder-layout.css +2 -0
- css/fl-builder.css +4 -1
- fl-builder.php +4 -4
- includes/column-css.php +22 -0
- includes/column-settings.php +69 -5
- includes/global-settings.php +15 -5
- includes/module-settings.php +7 -4
- includes/row-settings.php +7 -4
- includes/ui.php +21 -1
- includes/updater-config.php +1 -1
- includes/updater/classes/FLUpdater.php +46 -16
- includes/updater/includes/form.php +10 -3
- js/fl-builder-admin-posts.js +3 -3
- js/fl-builder.js +191 -80
- modules/widget/includes/frontend.php +1 -1
changelog.txt
CHANGED
@@ -1,3 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<h4>1.4.0</h4>
|
2 |
<p><strong>Bug Fixes</strong></p>
|
3 |
<ul>
|
1 |
+
<h4>1.4.1</h4>
|
2 |
+
<p><strong>Enhancements</strong></p>
|
3 |
+
<ul>
|
4 |
+
<li>Added a new responsive breakpoint in the global settings for medium devices.</li>
|
5 |
+
<li>Added new column width settings for medium and small devices.</li>
|
6 |
+
<li>Added the ability to hide rows, columns and modules at a number of new breakpoints.</li>
|
7 |
+
<li>Improved the UI/UX for editing user defined templates.</li>
|
8 |
+
<li>User defined templates are now ordered by title instead of id.</li>
|
9 |
+
<li>Optimized the loading of images for the gallery module's collage layout.</li>
|
10 |
+
<li>White label settings for Agency members are now available on single site installs.</li>
|
11 |
+
<li>Updated the custom modules docs and examples with info on the new link field type.</li>
|
12 |
+
</ul>
|
13 |
+
<p><strong>Bug Fixes</strong></p>
|
14 |
+
<ul>
|
15 |
+
<li>Fixed a bug that kept some third party widgets from being styled correctly.</li>
|
16 |
+
<li>Fixed bugs that caused a secondary layout on a page to be editable when it shouldn't be.</li>
|
17 |
+
<li>Replaced the word update with save in AJAX requests to prevent mod security from blocking them.</li>
|
18 |
+
<li>Fixed a bug where publishing a layout in multiple tabs caused it to disappear.</li>
|
19 |
+
<li>Fixed a bug causing the builder to break in rare cases when canceling out of a preview.</li>
|
20 |
+
</ul>
|
21 |
+
|
22 |
<h4>1.4.0</h4>
|
23 |
<p><strong>Bug Fixes</strong></p>
|
24 |
<ul>
|
classes/FLBuilder.php
CHANGED
@@ -231,8 +231,10 @@ final class FLBuilder {
|
|
231 |
}
|
232 |
|
233 |
// Enqueue assets for posts in the main query.
|
234 |
-
|
235 |
-
|
|
|
|
|
236 |
}
|
237 |
|
238 |
// Enqueue assets for posts via the fl_builder_global_posts filter.
|
@@ -420,6 +422,8 @@ final class FLBuilder {
|
|
420 |
*/
|
421 |
static public function render_ui()
|
422 |
{
|
|
|
|
|
423 |
if(FLBuilderModel::is_builder_active()) {
|
424 |
|
425 |
wp_reset_query();
|
@@ -584,7 +588,7 @@ final class FLBuilder {
|
|
584 |
$module->settings->crop = false;
|
585 |
}
|
586 |
|
587 |
-
FLBuilder::render_module_html($module->settings->type, $module->settings);
|
588 |
}
|
589 |
}
|
590 |
}
|
@@ -1094,7 +1098,7 @@ final class FLBuilder {
|
|
1094 |
/**
|
1095 |
* @method render_module_html
|
1096 |
*/
|
1097 |
-
static public function render_module_html($type, $settings)
|
1098 |
{
|
1099 |
// Settings
|
1100 |
$defaults = FLBuilderModel::get_module_defaults($type);
|
@@ -1186,8 +1190,11 @@ final class FLBuilder {
|
|
1186 |
|
1187 |
// Responsive css
|
1188 |
if($global_settings->responsive_enabled) {
|
|
|
|
|
|
|
1189 |
$css .= '@media (max-width: '. $global_settings->responsive_breakpoint .'px) { ';
|
1190 |
-
$css .= file_get_contents(FL_BUILDER_DIR . '/css/fl-builder-responsive.css');
|
1191 |
$css .= ' }';
|
1192 |
}
|
1193 |
|
231 |
}
|
232 |
|
233 |
// Enqueue assets for posts in the main query.
|
234 |
+
if ( isset( $wp_query->posts ) ) {
|
235 |
+
foreach ( $wp_query->posts as $post ) {
|
236 |
+
self::enqueue_layout_styles_scripts( $post->ID );
|
237 |
+
}
|
238 |
}
|
239 |
|
240 |
// Enqueue assets for posts via the fl_builder_global_posts filter.
|
422 |
*/
|
423 |
static public function render_ui()
|
424 |
{
|
425 |
+
global $post;
|
426 |
+
|
427 |
if(FLBuilderModel::is_builder_active()) {
|
428 |
|
429 |
wp_reset_query();
|
588 |
$module->settings->crop = false;
|
589 |
}
|
590 |
|
591 |
+
FLBuilder::render_module_html($module->settings->type, $module->settings, $module);
|
592 |
}
|
593 |
}
|
594 |
}
|
1098 |
/**
|
1099 |
* @method render_module_html
|
1100 |
*/
|
1101 |
+
static public function render_module_html($type, $settings, $module = null)
|
1102 |
{
|
1103 |
// Settings
|
1104 |
$defaults = FLBuilderModel::get_module_defaults($type);
|
1190 |
|
1191 |
// Responsive css
|
1192 |
if($global_settings->responsive_enabled) {
|
1193 |
+
$css .= '@media (max-width: '. $global_settings->medium_breakpoint .'px) { ';
|
1194 |
+
$css .= file_get_contents(FL_BUILDER_DIR . '/css/fl-builder-layout-medium.css');
|
1195 |
+
$css .= ' }';
|
1196 |
$css .= '@media (max-width: '. $global_settings->responsive_breakpoint .'px) { ';
|
1197 |
+
$css .= file_get_contents(FL_BUILDER_DIR . '/css/fl-builder-layout-responsive.css');
|
1198 |
$css .= ' }';
|
1199 |
}
|
1200 |
|
classes/FLBuilderAdmin.php
CHANGED
@@ -128,11 +128,14 @@ final class FLBuilderAdmin {
|
|
128 |
if(file_exists($templates_class)) {
|
129 |
require_once $templates_class;
|
130 |
}
|
131 |
-
if(
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
136 |
}
|
137 |
|
138 |
require_once FL_BUILDER_DIR . 'classes/FLBuilderAdminSettings.php';
|
128 |
if(file_exists($templates_class)) {
|
129 |
require_once $templates_class;
|
130 |
}
|
131 |
+
if(is_multisite()) {
|
132 |
+
|
133 |
+
if(file_exists($ms_class)) {
|
134 |
+
require_once $ms_class;
|
135 |
+
}
|
136 |
+
if(file_exists($ms_settings_class) && FL_BUILDER_VERSION != '{FL_BUILDER_VERSION}') {
|
137 |
+
require_once $ms_settings_class;
|
138 |
+
}
|
139 |
}
|
140 |
|
141 |
require_once FL_BUILDER_DIR . 'classes/FLBuilderAdminSettings.php';
|
classes/FLBuilderModel.php
CHANGED
@@ -2045,8 +2045,17 @@ final class FLBuilderModel {
|
|
2045 |
*/
|
2046 |
static public function clear_draft_layout()
|
2047 |
{
|
|
|
|
|
|
|
|
|
2048 |
self::delete_layout_data('draft');
|
2049 |
-
|
|
|
|
|
|
|
|
|
|
|
2050 |
}
|
2051 |
|
2052 |
/**
|
@@ -2064,9 +2073,6 @@ final class FLBuilderModel {
|
|
2064 |
// Save the new published layout.
|
2065 |
self::update_layout_data($data, 'published', $post_id);
|
2066 |
|
2067 |
-
// Delete the draft layout.
|
2068 |
-
self::delete_layout_data('draft', $post_id);
|
2069 |
-
|
2070 |
// Clear the asset cache.
|
2071 |
self::delete_all_asset_cache($post_id);
|
2072 |
|
@@ -2180,7 +2186,7 @@ final class FLBuilderModel {
|
|
2180 |
*/
|
2181 |
static public function get_user_templates()
|
2182 |
{
|
2183 |
-
return get_posts('post_type=fl-builder-template&orderby=
|
2184 |
}
|
2185 |
|
2186 |
/**
|
2045 |
*/
|
2046 |
static public function clear_draft_layout()
|
2047 |
{
|
2048 |
+
$post_id = self::get_post_id();
|
2049 |
+
$data = self::get_layout_data('published', $post_id);
|
2050 |
+
|
2051 |
+
// Delete the old draft layout.
|
2052 |
self::delete_layout_data('draft');
|
2053 |
+
|
2054 |
+
// Save the new draft layout.
|
2055 |
+
self::update_layout_data($data, 'draft', $post_id);
|
2056 |
+
|
2057 |
+
// Clear the asset cache.
|
2058 |
+
self::delete_all_asset_cache($post_id);
|
2059 |
}
|
2060 |
|
2061 |
/**
|
2073 |
// Save the new published layout.
|
2074 |
self::update_layout_data($data, 'published', $post_id);
|
2075 |
|
|
|
|
|
|
|
2076 |
// Clear the asset cache.
|
2077 |
self::delete_all_asset_cache($post_id);
|
2078 |
|
2186 |
*/
|
2187 |
static public function get_user_templates()
|
2188 |
{
|
2189 |
+
return get_posts('post_type=fl-builder-template&orderby=title&order=ASC&posts_per_page=-1');
|
2190 |
}
|
2191 |
|
2192 |
/**
|
css/fl-builder-layout-medium.css
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Responsive Utilities
|
2 |
+
------------------------------------------------------ */
|
3 |
+
|
4 |
+
.fl-visible-desktop,
|
5 |
+
.fl-visible-mobile {
|
6 |
+
display: none;
|
7 |
+
}
|
8 |
+
.fl-visible-desktop-medium,
|
9 |
+
.fl-visible-medium,
|
10 |
+
.fl-visible-medium-mobile {
|
11 |
+
display: block;
|
12 |
+
}
|
css/{fl-builder-responsive.css → fl-builder-layout-responsive.css}
RENAMED
@@ -1,22 +1,12 @@
|
|
1 |
-
/* Grid
|
2 |
-
------------------------------------------------------ */
|
3 |
-
|
4 |
-
.fl-col {
|
5 |
-
float: none;
|
6 |
-
margin-left: auto;
|
7 |
-
margin-right: auto;
|
8 |
-
width: auto !important;
|
9 |
-
}
|
10 |
-
.fl-col-small {
|
11 |
-
max-width: 400px;
|
12 |
-
}
|
13 |
-
|
14 |
/* Responsive Utilities
|
15 |
------------------------------------------------------ */
|
16 |
|
17 |
-
.fl-visible-desktop
|
|
|
|
|
18 |
display: none;
|
19 |
}
|
|
|
20 |
.fl-visible-mobile {
|
21 |
display: block;
|
22 |
}
|
@@ -45,6 +35,16 @@
|
|
45 |
/* Columns
|
46 |
------------------------------------------------------ */
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
.fl-col-content {
|
49 |
border-left: none !important;
|
50 |
border-right: none !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/* Responsive Utilities
|
2 |
------------------------------------------------------ */
|
3 |
|
4 |
+
.fl-visible-desktop,
|
5 |
+
.fl-visible-desktop-medium,
|
6 |
+
.fl-visible-medium {
|
7 |
display: none;
|
8 |
}
|
9 |
+
.fl-visible-medium-mobile,
|
10 |
.fl-visible-mobile {
|
11 |
display: block;
|
12 |
}
|
35 |
/* Columns
|
36 |
------------------------------------------------------ */
|
37 |
|
38 |
+
.fl-col {
|
39 |
+
clear: both;
|
40 |
+
float: none;
|
41 |
+
margin-left: auto;
|
42 |
+
margin-right: auto;
|
43 |
+
width: auto !important;
|
44 |
+
}
|
45 |
+
.fl-col-small {
|
46 |
+
max-width: 400px;
|
47 |
+
}
|
48 |
.fl-col-content {
|
49 |
border-left: none !important;
|
50 |
border-right: none !important;
|
css/fl-builder-layout.css
CHANGED
@@ -70,6 +70,8 @@
|
|
70 |
/* Responsive Utilities
|
71 |
------------------------------------------------------ */
|
72 |
|
|
|
|
|
73 |
.fl-visible-mobile {
|
74 |
display: none;
|
75 |
}
|
70 |
/* Responsive Utilities
|
71 |
------------------------------------------------------ */
|
72 |
|
73 |
+
.fl-visible-medium,
|
74 |
+
.fl-visible-medium-mobile,
|
75 |
.fl-visible-mobile {
|
76 |
display: none;
|
77 |
}
|
css/fl-builder.css
CHANGED
@@ -45,8 +45,11 @@ html.fl-builder-edit {
|
|
45 |
------------------------------------------------------ */
|
46 |
|
47 |
.fl-visible-desktop,
|
|
|
|
|
|
|
48 |
.fl-visible-mobile {
|
49 |
-
display: block
|
50 |
}
|
51 |
|
52 |
/* Builder Buttons
|
45 |
------------------------------------------------------ */
|
46 |
|
47 |
.fl-visible-desktop,
|
48 |
+
.fl-visible-desktop-medium,
|
49 |
+
.fl-visible-medium,
|
50 |
+
.fl-visible-medium-mobile,
|
51 |
.fl-visible-mobile {
|
52 |
+
display: block;
|
53 |
}
|
54 |
|
55 |
/* Builder Buttons
|
fl-builder.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Beaver Builder Plugin (Lite Version)
|
4 |
* Plugin URI: http://www.wpbeaverbuilder.com
|
5 |
* Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
|
6 |
-
* Version: 1.4.
|
7 |
* Author: The Beaver Builder Team
|
8 |
* Author URI: http://www.wpbeaverbuilder.com
|
9 |
* Copyright: (c) 2014 Beaver Builder
|
@@ -11,7 +11,7 @@
|
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
* Text Domain: fl-builder
|
13 |
*/
|
14 |
-
define('FL_BUILDER_VERSION', '1.4.
|
15 |
define('FL_BUILDER_DIR', plugin_dir_path(__FILE__));
|
16 |
define('FL_BUILDER_URL', plugins_url('/', __FILE__));
|
17 |
define('FL_BUILDER_LITE', true);
|
@@ -52,7 +52,7 @@ add_action('init', 'FLBuilderModel::
|
|
52 |
add_action('init', 'FLBuilderModel::load_modules', 11);
|
53 |
|
54 |
/* Admin AJAX Actions */
|
55 |
-
add_action('
|
56 |
|
57 |
/* Admin AJAX Filters */
|
58 |
add_filter('heartbeat_received', 'FLBuilderModel::lock_post', 10, 2);
|
@@ -72,7 +72,7 @@ add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'FLBuilderAdmin::
|
|
72 |
add_filter('all_plugins', 'FLBuilderAdmin::white_label_plugins_page');
|
73 |
|
74 |
/* AJAX Actions */
|
75 |
-
add_action('
|
76 |
add_action('fl_ajax_fl_builder_autosuggest', 'FLBuilderAutoSuggest::init');
|
77 |
add_action('fl_ajax_fl_builder_render_layout', 'FLBuilder::render_layout');
|
78 |
add_action('fl_ajax_fl_builder_render_preview', 'FLBuilder::render_preview');
|
3 |
* Plugin Name: Beaver Builder Plugin (Lite Version)
|
4 |
* Plugin URI: http://www.wpbeaverbuilder.com
|
5 |
* Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
|
6 |
+
* Version: 1.4.1
|
7 |
* Author: The Beaver Builder Team
|
8 |
* Author URI: http://www.wpbeaverbuilder.com
|
9 |
* Copyright: (c) 2014 Beaver Builder
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
* Text Domain: fl-builder
|
13 |
*/
|
14 |
+
define('FL_BUILDER_VERSION', '1.4.1');
|
15 |
define('FL_BUILDER_DIR', plugin_dir_path(__FILE__));
|
16 |
define('FL_BUILDER_URL', plugins_url('/', __FILE__));
|
17 |
define('FL_BUILDER_LITE', true);
|
52 |
add_action('init', 'FLBuilderModel::load_modules', 11);
|
53 |
|
54 |
/* Admin AJAX Actions */
|
55 |
+
add_action('wp_ajax_fl_builder_save', 'FLBuilderModel::update');
|
56 |
|
57 |
/* Admin AJAX Filters */
|
58 |
add_filter('heartbeat_received', 'FLBuilderModel::lock_post', 10, 2);
|
72 |
add_filter('all_plugins', 'FLBuilderAdmin::white_label_plugins_page');
|
73 |
|
74 |
/* AJAX Actions */
|
75 |
+
add_action('fl_ajax_fl_builder_save', 'FLBuilderModel::update');
|
76 |
add_action('fl_ajax_fl_builder_autosuggest', 'FLBuilderAutoSuggest::init');
|
77 |
add_action('fl_ajax_fl_builder_render_layout', 'FLBuilder::render_layout');
|
78 |
add_action('fl_ajax_fl_builder_render_preview', 'FLBuilder::render_preview');
|
includes/column-css.php
CHANGED
@@ -22,4 +22,26 @@
|
|
22 |
border-left-width: <?php echo is_numeric($col->settings->border_left) ? $col->settings->border_left : '0'; ?>px;
|
23 |
border-right-width: <?php echo is_numeric($col->settings->border_right) ? $col->settings->border_right : '0'; ?>px;
|
24 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
<?php endif; ?>
|
22 |
border-left-width: <?php echo is_numeric($col->settings->border_left) ? $col->settings->border_left : '0'; ?>px;
|
23 |
border-right-width: <?php echo is_numeric($col->settings->border_right) ? $col->settings->border_right : '0'; ?>px;
|
24 |
}
|
25 |
+
<?php endif; ?>
|
26 |
+
|
27 |
+
<?php if($global_settings->responsive_enabled) : ?>
|
28 |
+
|
29 |
+
<?php if($col->settings->medium_size == 'custom') : ?>
|
30 |
+
@media(max-width: <?php echo $global_settings->medium_breakpoint; ?>px) {
|
31 |
+
.fl-builder-content .fl-node-<?php echo $col->node; ?> {
|
32 |
+
width: <?php echo $col->settings->custom_medium_size; ?>% !important;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
<?php endif; ?>
|
36 |
+
|
37 |
+
<?php if($col->settings->responsive_size == 'custom') : ?>
|
38 |
+
@media(max-width: <?php echo $global_settings->responsive_breakpoint; ?>px) {
|
39 |
+
.fl-builder-content .fl-node-<?php echo $col->node; ?> {
|
40 |
+
clear: none;
|
41 |
+
float: left;
|
42 |
+
width: <?php echo $col->settings->custom_responsive_size; ?>% !important;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
<?php endif; ?>
|
46 |
+
|
47 |
<?php endif; ?>
|
includes/column-settings.php
CHANGED
@@ -179,16 +179,80 @@ FLBuilder::register_settings_form('col', array(
|
|
179 |
'preview' => array(
|
180 |
'type' => 'none'
|
181 |
)
|
182 |
-
)
|
|
|
|
|
|
|
|
|
|
|
183 |
'responsive_display' => array(
|
184 |
'type' => 'select',
|
185 |
'label' => __('Display', 'fl-builder'),
|
186 |
'options' => array(
|
187 |
-
''
|
188 |
-
'desktop'
|
189 |
-
'
|
|
|
|
|
|
|
190 |
),
|
191 |
-
'help' => __('Choose whether to
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
'preview' => array(
|
193 |
'type' => 'none'
|
194 |
)
|
179 |
'preview' => array(
|
180 |
'type' => 'none'
|
181 |
)
|
182 |
+
)
|
183 |
+
)
|
184 |
+
),
|
185 |
+
'responsive' => array(
|
186 |
+
'title' => __('Responsive', 'fl-builder'),
|
187 |
+
'fields' => array(
|
188 |
'responsive_display' => array(
|
189 |
'type' => 'select',
|
190 |
'label' => __('Display', 'fl-builder'),
|
191 |
'options' => array(
|
192 |
+
'' => __('Always', 'fl-builder'),
|
193 |
+
'desktop' => __('Large Devices Only', 'fl-builder'),
|
194 |
+
'desktop-medium' => __('Large & Medium Devices Only', 'fl-builder'),
|
195 |
+
'medium' => __('Medium Devices Only', 'fl-builder'),
|
196 |
+
'medium-mobile' => __('Medium & Small Devices Only', 'fl-builder'),
|
197 |
+
'mobile' => __('Small Devices Only', 'fl-builder'),
|
198 |
),
|
199 |
+
'help' => __('Choose whether to show or hide this column at different device sizes.'),
|
200 |
+
'preview' => array(
|
201 |
+
'type' => 'none'
|
202 |
+
)
|
203 |
+
),
|
204 |
+
'medium_size' => array(
|
205 |
+
'type' => 'select',
|
206 |
+
'label' => __('Medium Device Width', 'fl-builder'),
|
207 |
+
'help' => __('The width of this column on medium devices such as tablets.'),
|
208 |
+
'options' => array(
|
209 |
+
'default' => __('Default', 'fl-builder'),
|
210 |
+
'custom' => __('Custom', 'fl-builder'),
|
211 |
+
),
|
212 |
+
'toggle' => array(
|
213 |
+
'custom' => array(
|
214 |
+
'fields' => array('custom_medium_size')
|
215 |
+
)
|
216 |
+
),
|
217 |
+
'preview' => array(
|
218 |
+
'type' => 'none'
|
219 |
+
)
|
220 |
+
),
|
221 |
+
'custom_medium_size' => array(
|
222 |
+
'type' => 'text',
|
223 |
+
'label' => __('Custom Medium Device Width', 'fl-builder'),
|
224 |
+
'default' => '100',
|
225 |
+
'description' => __('%', 'fl-builder'),
|
226 |
+
'maxlength' => '5',
|
227 |
+
'size' => '6',
|
228 |
+
'preview' => array(
|
229 |
+
'type' => 'none'
|
230 |
+
)
|
231 |
+
),
|
232 |
+
'responsive_size' => array(
|
233 |
+
'type' => 'select',
|
234 |
+
'label' => __('Small Device Width', 'fl-builder'),
|
235 |
+
'help' => __('The width of this column on small devices such as phones.'),
|
236 |
+
'options' => array(
|
237 |
+
'default' => __('Default', 'fl-builder'),
|
238 |
+
'custom' => __('Custom', 'fl-builder'),
|
239 |
+
),
|
240 |
+
'toggle' => array(
|
241 |
+
'custom' => array(
|
242 |
+
'fields' => array('custom_responsive_size')
|
243 |
+
)
|
244 |
+
),
|
245 |
+
'preview' => array(
|
246 |
+
'type' => 'none'
|
247 |
+
)
|
248 |
+
),
|
249 |
+
'custom_responsive_size' => array(
|
250 |
+
'type' => 'text',
|
251 |
+
'label' => 'Custom Small Device Width',
|
252 |
+
'default' => '100',
|
253 |
+
'description' => __('%', 'fl-builder'),
|
254 |
+
'maxlength' => '5',
|
255 |
+
'size' => '6',
|
256 |
'preview' => array(
|
257 |
'type' => 'none'
|
258 |
)
|
includes/global-settings.php
CHANGED
@@ -76,8 +76,8 @@ FLBuilder::register_settings_form('global', array(
|
|
76 |
)
|
77 |
)
|
78 |
),
|
79 |
-
'
|
80 |
-
'title' => __('
|
81 |
'fields' => array(
|
82 |
'responsive_enabled' => array(
|
83 |
'type' => 'select',
|
@@ -89,17 +89,27 @@ FLBuilder::register_settings_form('global', array(
|
|
89 |
),
|
90 |
'toggle' => array(
|
91 |
'1' => array(
|
92 |
-
'fields' => array('responsive_breakpoint')
|
93 |
)
|
94 |
)
|
95 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
'responsive_breakpoint' => array(
|
97 |
'type' => 'text',
|
98 |
-
'label' => __('Breakpoint', 'fl-builder'),
|
99 |
'default' => '768',
|
100 |
'maxlength' => '4',
|
101 |
'size' => '5',
|
102 |
-
'description' => __('px', 'fl-builder')
|
|
|
103 |
)
|
104 |
)
|
105 |
)
|
76 |
)
|
77 |
)
|
78 |
),
|
79 |
+
'responsive' => array(
|
80 |
+
'title' => __('Responsive Layout', 'fl-builder'),
|
81 |
'fields' => array(
|
82 |
'responsive_enabled' => array(
|
83 |
'type' => 'select',
|
89 |
),
|
90 |
'toggle' => array(
|
91 |
'1' => array(
|
92 |
+
'fields' => array('responsive_breakpoint', 'medium_breakpoint')
|
93 |
)
|
94 |
)
|
95 |
),
|
96 |
+
'medium_breakpoint' => array(
|
97 |
+
'type' => 'text',
|
98 |
+
'label' => __('Medium Device Breakpoint', 'fl-builder'),
|
99 |
+
'default' => '992',
|
100 |
+
'maxlength' => '4',
|
101 |
+
'size' => '5',
|
102 |
+
'description' => __('px', 'fl-builder'),
|
103 |
+
'help' => __('The browser width at which the layout will adjust for medium devices such as tablets.', 'fl-builder')
|
104 |
+
),
|
105 |
'responsive_breakpoint' => array(
|
106 |
'type' => 'text',
|
107 |
+
'label' => __('Small Device Breakpoint', 'fl-builder'),
|
108 |
'default' => '768',
|
109 |
'maxlength' => '4',
|
110 |
'size' => '5',
|
111 |
+
'description' => __('px', 'fl-builder'),
|
112 |
+
'help' => __('The browser width at which the layout will adjust for small devices such as phones.', 'fl-builder')
|
113 |
)
|
114 |
)
|
115 |
)
|
includes/module-settings.php
CHANGED
@@ -20,11 +20,14 @@ FLBuilder::register_settings_form('module-advanced', array(
|
|
20 |
'type' => 'select',
|
21 |
'label' => __('Display', 'fl-builder'),
|
22 |
'options' => array(
|
23 |
-
''
|
24 |
-
'desktop'
|
25 |
-
'
|
|
|
|
|
|
|
26 |
),
|
27 |
-
'help' => __('Choose whether to
|
28 |
'preview' => array(
|
29 |
'type' => 'none'
|
30 |
)
|
20 |
'type' => 'select',
|
21 |
'label' => __('Display', 'fl-builder'),
|
22 |
'options' => array(
|
23 |
+
'' => __('Always', 'fl-builder'),
|
24 |
+
'desktop' => __('Large Devices Only', 'fl-builder'),
|
25 |
+
'desktop-medium' => __('Large & Medium Devices Only', 'fl-builder'),
|
26 |
+
'medium' => __('Medium Devices Only', 'fl-builder'),
|
27 |
+
'medium-mobile' => __('Medium & Small Devices Only', 'fl-builder'),
|
28 |
+
'mobile' => __('Small Devices Only', 'fl-builder'),
|
29 |
),
|
30 |
+
'help' => __('Choose whether to show or hide this module at different device sizes.'),
|
31 |
'preview' => array(
|
32 |
'type' => 'none'
|
33 |
)
|
includes/row-settings.php
CHANGED
@@ -463,11 +463,14 @@ FLBuilder::register_settings_form('row', array(
|
|
463 |
'type' => 'select',
|
464 |
'label' => __('Display', 'fl-builder'),
|
465 |
'options' => array(
|
466 |
-
''
|
467 |
-
'desktop'
|
468 |
-
'
|
|
|
|
|
|
|
469 |
),
|
470 |
-
'help' => __('Choose whether to
|
471 |
'preview' => array(
|
472 |
'type' => 'none'
|
473 |
)
|
463 |
'type' => 'select',
|
464 |
'label' => __('Display', 'fl-builder'),
|
465 |
'options' => array(
|
466 |
+
'' => __('Always', 'fl-builder'),
|
467 |
+
'desktop' => __('Large Devices Only', 'fl-builder'),
|
468 |
+
'desktop-medium' => __('Large & Medium Devices Only', 'fl-builder'),
|
469 |
+
'medium' => __('Medium Devices Only', 'fl-builder'),
|
470 |
+
'medium-mobile' => __('Medium & Small Devices Only', 'fl-builder'),
|
471 |
+
'mobile' => __('Small Devices Only', 'fl-builder'),
|
472 |
),
|
473 |
+
'help' => __('Choose whether to show or hide this row at different device sizes.'),
|
474 |
'preview' => array(
|
475 |
'type' => 'none'
|
476 |
)
|
includes/ui.php
CHANGED
@@ -1,4 +1,21 @@
|
|
1 |
<div class="fl-builder-bar">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<div class="fl-builder-bar-content">
|
3 |
<?php if(stristr(home_url(), 'demo.wpbeaverbuilder.com')) : ?>
|
4 |
<span class="fl-builder-bar-title">
|
@@ -18,7 +35,7 @@
|
|
18 |
<div class="fl-builder-bar-actions">
|
19 |
<span class="fl-builder-done-button fl-builder-button fl-builder-button-primary"><?php _e('Done', 'fl-builder'); ?></span>
|
20 |
<span class="fl-builder-tools-button fl-builder-button"><?php _e('Tools', 'fl-builder'); ?></span>
|
21 |
-
<?php if(
|
22 |
<span class="fl-builder-templates-button fl-builder-button"><?php _e('Templates', 'fl-builder'); ?></span>
|
23 |
<?php endif; ?>
|
24 |
<span class="fl-builder-add-content-button fl-builder-button"><?php _e('Add Content', 'fl-builder'); ?></span>
|
@@ -26,6 +43,9 @@
|
|
26 |
</div>
|
27 |
<div class="fl-clear"></div>
|
28 |
</div>
|
|
|
|
|
|
|
29 |
</div>
|
30 |
<div class="fl-builder-panel">
|
31 |
<div class="fl-builder-panel-actions">
|
1 |
<div class="fl-builder-bar">
|
2 |
+
|
3 |
+
<?php if(get_post_type() == 'fl-builder-template') : ?>
|
4 |
+
|
5 |
+
<div class="fl-builder-bar-content">
|
6 |
+
<span class="fl-builder-bar-title fl-builder-bar-title-no-icon">
|
7 |
+
<?php echo sprintf(__('Template: %s', 'fl-builder'), get_the_title($post->ID)); ?>
|
8 |
+
</span>
|
9 |
+
<div class="fl-builder-bar-actions">
|
10 |
+
<span class="fl-builder-save-edit-template-button fl-builder-button fl-builder-button-primary"><?php _e('Save Template', 'fl-builder'); ?></span>
|
11 |
+
<span class="fl-builder-cancel-edit-template-button fl-builder-button"><?php _e('Cancel', 'fl-builder'); ?></span>
|
12 |
+
<div class="fl-clear"></div>
|
13 |
+
</div>
|
14 |
+
<div class="fl-clear"></div>
|
15 |
+
</div>
|
16 |
+
|
17 |
+
<?php else : ?>
|
18 |
+
|
19 |
<div class="fl-builder-bar-content">
|
20 |
<?php if(stristr(home_url(), 'demo.wpbeaverbuilder.com')) : ?>
|
21 |
<span class="fl-builder-bar-title">
|
35 |
<div class="fl-builder-bar-actions">
|
36 |
<span class="fl-builder-done-button fl-builder-button fl-builder-button-primary"><?php _e('Done', 'fl-builder'); ?></span>
|
37 |
<span class="fl-builder-tools-button fl-builder-button"><?php _e('Tools', 'fl-builder'); ?></span>
|
38 |
+
<?php if(FL_BUILDER_LITE !== true && $enabled_templates != 'disabled') : ?>
|
39 |
<span class="fl-builder-templates-button fl-builder-button"><?php _e('Templates', 'fl-builder'); ?></span>
|
40 |
<?php endif; ?>
|
41 |
<span class="fl-builder-add-content-button fl-builder-button"><?php _e('Add Content', 'fl-builder'); ?></span>
|
43 |
</div>
|
44 |
<div class="fl-clear"></div>
|
45 |
</div>
|
46 |
+
|
47 |
+
<?php endif; ?>
|
48 |
+
|
49 |
</div>
|
50 |
<div class="fl-builder-panel">
|
51 |
<div class="fl-builder-panel-actions">
|
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.4.
|
7 |
'slug' => 'bb-plugin',
|
8 |
'type' => 'plugin'
|
9 |
));
|
3 |
if(class_exists('FLUpdater')) {
|
4 |
FLUpdater::add_product(array(
|
5 |
'name' => 'Beaver Builder Plugin (Lite Version)',
|
6 |
+
'version' => '1.4.1',
|
7 |
'slug' => 'bb-plugin',
|
8 |
'type' => 'plugin'
|
9 |
));
|
includes/updater/classes/FLUpdater.php
CHANGED
@@ -28,16 +28,17 @@ final class FLUpdater {
|
|
28 |
/**
|
29 |
* @method __construct
|
30 |
*/
|
31 |
-
public function __construct($settings = array())
|
32 |
{
|
33 |
$this->settings = $settings;
|
34 |
|
35 |
-
if($settings['type']
|
36 |
-
add_filter('pre_set_site_transient_update_plugins', array($this, 'update_check'));
|
37 |
-
add_filter('plugins_api', array($this, 'plugin_info'), 10, 3);
|
|
|
38 |
}
|
39 |
-
else if($settings['type'] == 'theme') {
|
40 |
-
add_filter('pre_set_site_transient_update_themes', array($this, 'update_check'));
|
41 |
}
|
42 |
}
|
43 |
|
@@ -55,20 +56,15 @@ final class FLUpdater {
|
|
55 |
'email' => FLUpdater::get_subscription_email(),
|
56 |
'domain' => network_home_url(),
|
57 |
'product' => $this->settings['name'],
|
58 |
-
'slug' => $this->settings['slug']
|
|
|
59 |
));
|
60 |
|
61 |
if(isset($response) && $response !== false && is_object($response) && !isset($response->errors)) {
|
62 |
|
63 |
if($this->settings['type'] == 'plugin') {
|
64 |
-
|
65 |
-
|
66 |
-
$plugin = $this->settings['slug'] . '/fl-builder.php';
|
67 |
-
}
|
68 |
-
else {
|
69 |
-
$plugin = $this->settings['slug'] . '/' . $this->settings['slug'] . '.php';
|
70 |
-
}
|
71 |
-
|
72 |
$new_ver = $response->new_version;
|
73 |
$curr_ver = $this->settings['version'];
|
74 |
|
@@ -94,6 +90,23 @@ final class FLUpdater {
|
|
94 |
return $transient;
|
95 |
}
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
/**
|
98 |
* @method plugin_info
|
99 |
*/
|
@@ -194,7 +207,7 @@ final class FLUpdater {
|
|
194 |
*/
|
195 |
static public function save_subscription_email($email)
|
196 |
{
|
197 |
-
update_site_option('fl_themes_subscription_email',
|
198 |
}
|
199 |
|
200 |
/**
|
@@ -215,6 +228,23 @@ final class FLUpdater {
|
|
215 |
return false;
|
216 |
}
|
217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
/**
|
219 |
* @method api_request
|
220 |
* @static
|
28 |
/**
|
29 |
* @method __construct
|
30 |
*/
|
31 |
+
public function __construct( $settings = array() )
|
32 |
{
|
33 |
$this->settings = $settings;
|
34 |
|
35 |
+
if ( 'plugin' == $settings['type'] ) {
|
36 |
+
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'update_check' ) );
|
37 |
+
add_filter( 'plugins_api', array( $this, 'plugin_info' ), 10, 3 );
|
38 |
+
add_action( 'in_plugin_update_message-' . self::get_plugin_file( $settings['slug'] ), array( $this, 'update_message' ), 1, 2 );
|
39 |
}
|
40 |
+
else if ( $settings['type'] == 'theme' ) {
|
41 |
+
add_filter( 'pre_set_site_transient_update_themes', array( $this, 'update_check' ) );
|
42 |
}
|
43 |
}
|
44 |
|
56 |
'email' => FLUpdater::get_subscription_email(),
|
57 |
'domain' => network_home_url(),
|
58 |
'product' => $this->settings['name'],
|
59 |
+
'slug' => $this->settings['slug'],
|
60 |
+
'version' => $this->settings['version']
|
61 |
));
|
62 |
|
63 |
if(isset($response) && $response !== false && is_object($response) && !isset($response->errors)) {
|
64 |
|
65 |
if($this->settings['type'] == 'plugin') {
|
66 |
+
|
67 |
+
$plugin = self::get_plugin_file($this->settings['slug']);
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
$new_ver = $response->new_version;
|
69 |
$curr_ver = $this->settings['version'];
|
70 |
|
90 |
return $transient;
|
91 |
}
|
92 |
|
93 |
+
/**
|
94 |
+
* @method update_message
|
95 |
+
*/
|
96 |
+
public function update_message( $plugin_data, $response )
|
97 |
+
{
|
98 |
+
if ( empty( $response->package ) ) {
|
99 |
+
echo '<p style="padding:10px 20px; margin-top: 10px; background: #d54e21; color: #fff;">';
|
100 |
+
echo __('<strong>UPDATE UNAVAILABLE!</strong>');
|
101 |
+
echo ' ';
|
102 |
+
echo __('Please subscribe to enable automatic updates for this plugin.', 'fl-builder');
|
103 |
+
echo ' <a href="' . $plugin_data['PluginURI'] . '" target="_blank" style="color: #fff; text-decoration: underline;">';
|
104 |
+
echo __('Subscribe Now', 'fl-builder');
|
105 |
+
echo ' »</a>';
|
106 |
+
echo '</p>';
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
/**
|
111 |
* @method plugin_info
|
112 |
*/
|
207 |
*/
|
208 |
static public function save_subscription_email($email)
|
209 |
{
|
210 |
+
update_site_option('fl_themes_subscription_email', $email);
|
211 |
}
|
212 |
|
213 |
/**
|
228 |
return false;
|
229 |
}
|
230 |
|
231 |
+
/**
|
232 |
+
* @method get_plugin_file
|
233 |
+
* @static
|
234 |
+
* @private
|
235 |
+
*/
|
236 |
+
static private function get_plugin_file( $slug )
|
237 |
+
{
|
238 |
+
if ( 'bb-plugin' == $slug ) {
|
239 |
+
$file = $slug . '/fl-builder.php';
|
240 |
+
}
|
241 |
+
else {
|
242 |
+
$file = $slug . '/' . $slug . '.php';
|
243 |
+
}
|
244 |
+
|
245 |
+
return $file;
|
246 |
+
}
|
247 |
+
|
248 |
/**
|
249 |
* @method api_request
|
250 |
* @static
|
includes/updater/includes/form.php
CHANGED
@@ -1,7 +1,14 @@
|
|
1 |
<div class="wrap">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
<h3 class="fl-settings-form-header">
|
4 |
-
<?php _e('
|
5 |
<span> — </span>
|
6 |
<?php if($status) : ?>
|
7 |
<i style="color:#3cb341;"><?php _e('Active!', 'fl-builder'); ?></i>
|
@@ -17,7 +24,7 @@
|
|
17 |
<?php endif; ?>
|
18 |
|
19 |
<p>
|
20 |
-
|
21 |
</p>
|
22 |
<?php if(is_multisite()) : ?>
|
23 |
<p>
|
@@ -26,7 +33,7 @@
|
|
26 |
<?php endif; ?>
|
27 |
<form action="" method="post">
|
28 |
|
29 |
-
<input type="
|
30 |
|
31 |
<p class="submit">
|
32 |
<input type="submit" name="submit" class="button button-primary" value="<?php _e('Save Subscription Settings', 'fl-builder'); ?>">
|
1 |
<div class="wrap">
|
2 |
+
|
3 |
+
<?php if(!$status) : ?>
|
4 |
+
<p style="padding:10px 20px; background: #d54e21; color: #fff;">
|
5 |
+
<?php _e('UPDATES UNAVAILABLE! Please subscribe or enter your licence key below to enable automatic updates.', 'fl-builder'); ?>
|
6 |
+
<a style="color: #fff;" href="http://www.wpbeaverbuilder.com/" target="_blank"><?php _e('Subscribe Now', 'fl-builder'); ?> »</a>
|
7 |
+
</p>
|
8 |
+
<?php endif; ?>
|
9 |
|
10 |
<h3 class="fl-settings-form-header">
|
11 |
+
<?php _e('Updates & Support Subscription', 'fl-builder'); ?>
|
12 |
<span> — </span>
|
13 |
<?php if($status) : ?>
|
14 |
<i style="color:#3cb341;"><?php _e('Active!', 'fl-builder'); ?></i>
|
24 |
<?php endif; ?>
|
25 |
|
26 |
<p>
|
27 |
+
<?php echo sprintf(__('Enter your <a href="%s" target="_blank">licence key</a> to enable remote updates and support.', 'fl-builder'), 'http://www.wpbeaverbuilder.com/my-account/') ?>
|
28 |
</p>
|
29 |
<?php if(is_multisite()) : ?>
|
30 |
<p>
|
33 |
<?php endif; ?>
|
34 |
<form action="" method="post">
|
35 |
|
36 |
+
<input type="password" name="email" value="<?php echo self::get_subscription_email(); ?>" class="regular-text" />
|
37 |
|
38 |
<p class="submit">
|
39 |
<input type="submit" name="submit" class="button button-primary" value="<?php _e('Save Subscription Settings', 'fl-builder'); ?>">
|
js/fl-builder-admin-posts.js
CHANGED
@@ -34,10 +34,9 @@ var FLBuilderAdminPosts;
|
|
34 |
|
35 |
$('.fl-builder-admin-tabs a').removeClass('fl-active');
|
36 |
$(this).addClass('fl-active');
|
37 |
-
$(window).resize();
|
38 |
|
39 |
FLBuilderAdminPosts.ajax({
|
40 |
-
action: '
|
41 |
method: 'disable',
|
42 |
}, FLBuilderAdminPosts._enableEditorComplete);
|
43 |
},
|
@@ -49,6 +48,7 @@ var FLBuilderAdminPosts;
|
|
49 |
_enableEditorComplete: function()
|
50 |
{
|
51 |
$('body').removeClass('fl-builder-enabled');
|
|
|
52 |
},
|
53 |
|
54 |
/**
|
@@ -110,7 +110,7 @@ var FLBuilderAdminPosts;
|
|
110 |
$('.fl-builder-loading').show();
|
111 |
|
112 |
FLBuilderAdminPosts.ajax({
|
113 |
-
action: '
|
114 |
method: 'duplicate_wpml_layout',
|
115 |
original_post_id: originalPostId
|
116 |
}, FLBuilderAdminPosts._wpmlCopyComplete);
|
34 |
|
35 |
$('.fl-builder-admin-tabs a').removeClass('fl-active');
|
36 |
$(this).addClass('fl-active');
|
|
|
37 |
|
38 |
FLBuilderAdminPosts.ajax({
|
39 |
+
action: 'fl_builder_save',
|
40 |
method: 'disable',
|
41 |
}, FLBuilderAdminPosts._enableEditorComplete);
|
42 |
},
|
48 |
_enableEditorComplete: function()
|
49 |
{
|
50 |
$('body').removeClass('fl-builder-enabled');
|
51 |
+
$(window).resize();
|
52 |
},
|
53 |
|
54 |
/**
|
110 |
$('.fl-builder-loading').show();
|
111 |
|
112 |
FLBuilderAdminPosts.ajax({
|
113 |
+
action: 'fl_builder_save',
|
114 |
method: 'duplicate_wpml_layout',
|
115 |
original_post_id: originalPostId
|
116 |
}, FLBuilderAdminPosts._wpmlCopyComplete);
|
js/fl-builder.js
CHANGED
@@ -269,14 +269,17 @@ var FLBuilder;
|
|
269 |
|
270 |
// Row layouts from the builder panel.
|
271 |
$('.fl-builder-rows').sortable($.extend({}, defaults, {
|
272 |
-
connectWith: FLBuilder._contentClass + ',
|
|
|
273 |
items: '.fl-builder-block-row',
|
274 |
stop: FLBuilder._rowDragStop
|
275 |
}));
|
276 |
|
277 |
// Modules from the builder panel.
|
278 |
$('.fl-builder-modules, .fl-builder-widgets').sortable($.extend({}, defaults, {
|
279 |
-
connectWith: FLBuilder._contentClass + ',
|
|
|
|
|
280 |
items: '.fl-builder-block-module',
|
281 |
stop: FLBuilder._moduleDragStop
|
282 |
}));
|
@@ -290,7 +293,7 @@ var FLBuilder;
|
|
290 |
}));
|
291 |
|
292 |
// Column group position.
|
293 |
-
$('.fl-row-content').sortable($.extend({}, defaults, {
|
294 |
handle: '.fl-row-overlay .fl-block-overlay-actions .fl-block-move',
|
295 |
helper: FLBuilder._rowDragHelper,
|
296 |
items: '.fl-col-group',
|
@@ -298,8 +301,10 @@ var FLBuilder;
|
|
298 |
}));
|
299 |
|
300 |
// Module position.
|
301 |
-
$('.fl-col-content').sortable($.extend({}, defaults, {
|
302 |
-
connectWith: FLBuilder._contentClass + ',
|
|
|
|
|
303 |
handle: '.fl-module-overlay .fl-block-overlay-actions .fl-block-move',
|
304 |
helper: FLBuilder._moduleDragHelper,
|
305 |
items: '.fl-module',
|
@@ -364,6 +369,10 @@ var FLBuilder;
|
|
364 |
/* User Template Settings */
|
365 |
$('body').delegate('.fl-builder-user-template-settings .fl-builder-settings-save', 'click', FLBuilder._saveUserTemplateSettings);
|
366 |
|
|
|
|
|
|
|
|
|
367 |
/* Rows */
|
368 |
$('body').delegate('.fl-row-overlay .fl-block-remove', 'click', FLBuilder._deleteRowClicked);
|
369 |
$('body').delegate('.fl-row-overlay .fl-block-copy', 'click', FLBuilder._rowCopyClicked);
|
@@ -442,13 +451,15 @@ var FLBuilder;
|
|
442 |
*/
|
443 |
_bindOverlayEvents: function()
|
444 |
{
|
445 |
-
$(
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
|
|
|
|
452 |
},
|
453 |
|
454 |
/**
|
@@ -457,13 +468,15 @@ var FLBuilder;
|
|
457 |
*/
|
458 |
_destroyOverlayEvents: function()
|
459 |
{
|
460 |
-
$(
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
|
|
|
|
467 |
},
|
468 |
|
469 |
/**
|
@@ -646,7 +659,7 @@ var FLBuilder;
|
|
646 |
$('.fl-builder-loading').show();
|
647 |
|
648 |
FLBuilder.ajax({
|
649 |
-
action: '
|
650 |
method: 'save_layout',
|
651 |
render_assets: 0
|
652 |
}, FLBuilder._exit);
|
@@ -678,7 +691,7 @@ var FLBuilder;
|
|
678 |
$('.fl-builder-loading').show();
|
679 |
|
680 |
FLBuilder.ajax({
|
681 |
-
action: '
|
682 |
method: 'clear_draft_layout',
|
683 |
render_assets: 0
|
684 |
}, FLBuilder._exit);
|
@@ -721,7 +734,7 @@ var FLBuilder;
|
|
721 |
$('.fl-builder-loading').show();
|
722 |
|
723 |
FLBuilder.ajax({
|
724 |
-
action: '
|
725 |
method: 'duplicate_post'
|
726 |
}, FLBuilder._duplicatePageComplete);
|
727 |
},
|
@@ -828,7 +841,7 @@ var FLBuilder;
|
|
828 |
$('.fl-builder-loading').show();
|
829 |
|
830 |
FLBuilder.ajax({
|
831 |
-
action: '
|
832 |
method: 'save_global_settings',
|
833 |
settings: settings
|
834 |
}, FLBuilder._updateLayout);
|
@@ -962,7 +975,7 @@ var FLBuilder;
|
|
962 |
if(confirm(FLBuilderStrings.deleteTemplate)) {
|
963 |
|
964 |
FLBuilder.ajax({
|
965 |
-
action: '
|
966 |
method: 'delete_user_template',
|
967 |
template_id: template.attr('data-id')
|
968 |
});
|
@@ -1042,7 +1055,7 @@ var FLBuilder;
|
|
1042 |
if(type == 'core') {
|
1043 |
|
1044 |
FLBuilder.ajax({
|
1045 |
-
action: '
|
1046 |
method: 'apply_template',
|
1047 |
index: id,
|
1048 |
append: append
|
@@ -1051,7 +1064,7 @@ var FLBuilder;
|
|
1051 |
else {
|
1052 |
|
1053 |
FLBuilder.ajax({
|
1054 |
-
action: '
|
1055 |
method: 'apply_user_template',
|
1056 |
template_id: id,
|
1057 |
append: append
|
@@ -1092,7 +1105,7 @@ var FLBuilder;
|
|
1092 |
$('.fl-builder-loading').show();
|
1093 |
|
1094 |
FLBuilder.ajax({
|
1095 |
-
action: '
|
1096 |
method: 'save_user_template',
|
1097 |
template_name: settings.name
|
1098 |
}, FLBuilder._saveUserTemplateSettingsComplete);
|
@@ -1109,6 +1122,62 @@ var FLBuilder;
|
|
1109 |
{
|
1110 |
FLBuilder._alert(FLBuilderStrings.templateSaved);
|
1111 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1112 |
|
1113 |
/* Template Settings
|
1114 |
----------------------------------------------------------*/
|
@@ -1203,8 +1272,8 @@ var FLBuilder;
|
|
1203 |
oldCss.remove();
|
1204 |
oldJs.remove();
|
1205 |
|
1206 |
-
//
|
1207 |
-
newHtml.
|
1208 |
|
1209 |
// Add the new content.
|
1210 |
content.append(newHtml);
|
@@ -1231,6 +1300,28 @@ var FLBuilder;
|
|
1231 |
body.append(loader);
|
1232 |
},
|
1233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1234 |
/**
|
1235 |
* Called by the JavaScript file once it's loaded
|
1236 |
* to finish rendering the layout.
|
@@ -1352,11 +1443,11 @@ var FLBuilder;
|
|
1352 |
$('.fl-builder-empty-message').hide();
|
1353 |
|
1354 |
// Highlight rows.
|
1355 |
-
$('.fl-row').addClass('fl-row-highlight');
|
1356 |
|
1357 |
// Highlight modules.
|
1358 |
if(item.hasClass('fl-module') || item.hasClass('fl-builder-block-module')) {
|
1359 |
-
$('.fl-col').addClass('fl-col-highlight');
|
1360 |
}
|
1361 |
|
1362 |
// Clean up the UI for dragging.
|
@@ -1380,8 +1471,8 @@ var FLBuilder;
|
|
1380 |
|
1381 |
// Refresh sortables.
|
1382 |
$(FLBuilder._contentClass).sortable('refreshPositions');
|
1383 |
-
$('.fl-row-content').sortable('refreshPositions');
|
1384 |
-
$('.fl-col-content').sortable('refreshPositions');
|
1385 |
},
|
1386 |
|
1387 |
/**
|
@@ -1437,16 +1528,19 @@ var FLBuilder;
|
|
1437 |
var parent = ui.item.parent(),
|
1438 |
initialPos = parent.offset().top - $(window).scrollTop();
|
1439 |
|
|
|
1440 |
if(parent.hasClass('fl-builder-blocks-section-content')) {
|
1441 |
FLBuilder._showPanel();
|
1442 |
}
|
1443 |
|
|
|
1444 |
FLBuilder._dragEnabled = false;
|
1445 |
FLBuilder._dragging = false;
|
1446 |
FLBuilder._bindOverlayEvents();
|
1447 |
FLBuilder._highlightEmptyCols();
|
1448 |
$('.fl-builder-empty-message').show();
|
1449 |
|
|
|
1450 |
scrollTo(0, parent.offset().top - initialPos);
|
1451 |
},
|
1452 |
|
@@ -1488,8 +1582,8 @@ var FLBuilder;
|
|
1488 |
*/
|
1489 |
_highlightEmptyCols: function()
|
1490 |
{
|
1491 |
-
var rows = $('.fl-row'),
|
1492 |
-
cols = $('.fl-col');
|
1493 |
|
1494 |
rows.removeClass('fl-row-highlight');
|
1495 |
cols.removeClass('fl-col-highlight');
|
@@ -1563,39 +1657,50 @@ var FLBuilder;
|
|
1563 |
*/
|
1564 |
_rowDragStop: function(e, ui)
|
1565 |
{
|
|
|
|
|
|
|
1566 |
FLBuilder._blockDragStop(e, ui);
|
1567 |
|
1568 |
// A row was dropped back into the row list.
|
1569 |
-
if(
|
1570 |
-
|
1571 |
return;
|
1572 |
}
|
1573 |
// Add a new row.
|
1574 |
-
else if(
|
1575 |
|
1576 |
// A row was dropped into another row.
|
1577 |
-
if(
|
1578 |
FLBuilder._addColGroup(
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
);
|
1583 |
-
FLBuilder._showPanel();
|
1584 |
-
$('.fl-builder-modules').siblings('.fl-builder-blocks-section-title').eq(0).trigger('click');
|
1585 |
}
|
1586 |
// A row was dropped into the main layout.
|
1587 |
else {
|
1588 |
-
FLBuilder._addRow(
|
1589 |
-
|
1590 |
-
|
|
|
1591 |
}
|
1592 |
|
1593 |
// Remove the helper.
|
1594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1595 |
}
|
1596 |
// Reorder a row.
|
1597 |
else {
|
1598 |
-
|
|
|
|
|
|
|
1599 |
}
|
1600 |
},
|
1601 |
|
@@ -1606,7 +1711,7 @@ var FLBuilder;
|
|
1606 |
_reorderRow: function(node_id, position)
|
1607 |
{
|
1608 |
FLBuilder.ajax({
|
1609 |
-
action: '
|
1610 |
method: 'reorder_node',
|
1611 |
node_id: node_id,
|
1612 |
position: position,
|
@@ -1638,7 +1743,7 @@ var FLBuilder;
|
|
1638 |
_addRowComplete: function(response)
|
1639 |
{
|
1640 |
var content = $(FLBuilder._contentClass),
|
1641 |
-
rows =
|
1642 |
row = $(response),
|
1643 |
module = null,
|
1644 |
form = null;
|
@@ -1700,9 +1805,10 @@ var FLBuilder;
|
|
1700 |
_deleteRow: function(row)
|
1701 |
{
|
1702 |
FLBuilder.ajax({
|
1703 |
-
action: '
|
1704 |
method: 'delete_node',
|
1705 |
node_id: row.attr('data-node'),
|
|
|
1706 |
silent: true
|
1707 |
});
|
1708 |
|
@@ -1725,7 +1831,7 @@ var FLBuilder;
|
|
1725 |
FLBuilder._removeAllOverlays();
|
1726 |
|
1727 |
FLBuilder.ajax({
|
1728 |
-
action: '
|
1729 |
method: 'copy_row',
|
1730 |
node_id: nodeId
|
1731 |
}, FLBuilder._updateLayout);
|
@@ -1883,11 +1989,12 @@ var FLBuilder;
|
|
1883 |
groupCols.css('width', width + '%');
|
1884 |
|
1885 |
FLBuilder.ajax({
|
1886 |
-
action
|
1887 |
-
method
|
1888 |
-
node_id
|
1889 |
-
new_width
|
1890 |
-
|
|
|
1891 |
});
|
1892 |
}
|
1893 |
},
|
@@ -2010,57 +2117,60 @@ var FLBuilder;
|
|
2010 |
*/
|
2011 |
_moduleDragStop: function(e, ui)
|
2012 |
{
|
2013 |
-
var
|
|
|
|
|
2014 |
parentId = 0;
|
2015 |
|
2016 |
FLBuilder._blockDragStop(e, ui);
|
2017 |
|
2018 |
// A module was dropped back into the module list.
|
2019 |
if(parent.hasClass('fl-builder-modules') || parent.hasClass('fl-builder-widgets')) {
|
2020 |
-
|
2021 |
return;
|
2022 |
}
|
2023 |
// A new module was dropped.
|
2024 |
-
else if(
|
2025 |
|
2026 |
// A new module was dropped into a row position.
|
2027 |
if(parent.hasClass('fl-builder-content')) {
|
|
|
2028 |
parentId = 0;
|
2029 |
}
|
2030 |
// A new module was dropped into a column position.
|
2031 |
else if(parent.hasClass('fl-row-content')) {
|
2032 |
-
|
|
|
2033 |
}
|
2034 |
// A new module was dropped into a column.
|
2035 |
else {
|
2036 |
-
|
|
|
2037 |
}
|
2038 |
|
2039 |
// Add the new module.
|
2040 |
-
FLBuilder._addModule(parentId,
|
2041 |
|
2042 |
// Remove the drag helper.
|
2043 |
ui.item.remove();
|
2044 |
}
|
2045 |
// A module was dropped into the main layout.
|
2046 |
else if(parent.hasClass('fl-builder-content')) {
|
2047 |
-
|
2048 |
-
FLBuilder.
|
2049 |
-
|
|
|
2050 |
}
|
2051 |
// A module was dropped into a column position.
|
2052 |
else if(parent.hasClass('fl-row-content')) {
|
2053 |
-
|
2054 |
-
FLBuilder.
|
2055 |
-
|
2056 |
-
|
2057 |
-
ui.item.index()
|
2058 |
-
);
|
2059 |
-
ui.item.remove();
|
2060 |
}
|
2061 |
// A module was dropped into another column.
|
2062 |
else {
|
2063 |
-
FLBuilder._reorderModule(
|
2064 |
}
|
2065 |
|
2066 |
FLBuilder._resizeLayout();
|
@@ -2079,7 +2189,7 @@ var FLBuilder;
|
|
2079 |
|
2080 |
if(newParent == oldParent) {
|
2081 |
FLBuilder.ajax({
|
2082 |
-
action: '
|
2083 |
method: 'reorder_node',
|
2084 |
node_id: node_id,
|
2085 |
position: position,
|
@@ -2090,7 +2200,7 @@ var FLBuilder;
|
|
2090 |
module.attr('data-parent', newParent);
|
2091 |
|
2092 |
FLBuilder.ajax({
|
2093 |
-
action: '
|
2094 |
method: 'move_node',
|
2095 |
new_parent: newParent,
|
2096 |
node_id: node_id,
|
@@ -2126,9 +2236,10 @@ var FLBuilder;
|
|
2126 |
var row = module.closest('.fl-row');
|
2127 |
|
2128 |
FLBuilder.ajax({
|
2129 |
-
action: '
|
2130 |
method: 'delete_node',
|
2131 |
node_id: module.attr('data-node'),
|
|
|
2132 |
silent: true
|
2133 |
});
|
2134 |
|
@@ -2152,7 +2263,7 @@ var FLBuilder;
|
|
2152 |
FLBuilder._removeAllOverlays();
|
2153 |
|
2154 |
FLBuilder.ajax({
|
2155 |
-
action: '
|
2156 |
method: 'copy_module',
|
2157 |
node_id: module.attr('data-node')
|
2158 |
}, FLBuilder._updateLayout);
|
@@ -2526,7 +2637,7 @@ var FLBuilder;
|
|
2526 |
|
2527 |
// Make the AJAX call.
|
2528 |
FLBuilder.ajax({
|
2529 |
-
action : '
|
2530 |
method : 'save_settings',
|
2531 |
node_id : nodeId,
|
2532 |
settings : settings,
|
269 |
|
270 |
// Row layouts from the builder panel.
|
271 |
$('.fl-builder-rows').sortable($.extend({}, defaults, {
|
272 |
+
connectWith: FLBuilder._contentClass + ', ' +
|
273 |
+
FLBuilder._contentClass + ' .fl-row-content',
|
274 |
items: '.fl-builder-block-row',
|
275 |
stop: FLBuilder._rowDragStop
|
276 |
}));
|
277 |
|
278 |
// Modules from the builder panel.
|
279 |
$('.fl-builder-modules, .fl-builder-widgets').sortable($.extend({}, defaults, {
|
280 |
+
connectWith: FLBuilder._contentClass + ', ' +
|
281 |
+
FLBuilder._contentClass + ' .fl-row-content, ' +
|
282 |
+
FLBuilder._contentClass + ' .fl-col-content',
|
283 |
items: '.fl-builder-block-module',
|
284 |
stop: FLBuilder._moduleDragStop
|
285 |
}));
|
293 |
}));
|
294 |
|
295 |
// Column group position.
|
296 |
+
$(FLBuilder._contentClass + ' .fl-row-content').sortable($.extend({}, defaults, {
|
297 |
handle: '.fl-row-overlay .fl-block-overlay-actions .fl-block-move',
|
298 |
helper: FLBuilder._rowDragHelper,
|
299 |
items: '.fl-col-group',
|
301 |
}));
|
302 |
|
303 |
// Module position.
|
304 |
+
$(FLBuilder._contentClass + ' .fl-col-content').sortable($.extend({}, defaults, {
|
305 |
+
connectWith: FLBuilder._contentClass + ', ' +
|
306 |
+
FLBuilder._contentClass + ' .fl-row-content, ' +
|
307 |
+
FLBuilder._contentClass + ' .fl-col-content',
|
308 |
handle: '.fl-module-overlay .fl-block-overlay-actions .fl-block-move',
|
309 |
helper: FLBuilder._moduleDragHelper,
|
310 |
items: '.fl-module',
|
369 |
/* User Template Settings */
|
370 |
$('body').delegate('.fl-builder-user-template-settings .fl-builder-settings-save', 'click', FLBuilder._saveUserTemplateSettings);
|
371 |
|
372 |
+
/* Edit User Template */
|
373 |
+
$('body').delegate('.fl-builder-cancel-edit-template-button', 'click', FLBuilder._cancelEditUserTemplate);
|
374 |
+
$('body').delegate('.fl-builder-save-edit-template-button', 'click', FLBuilder._saveEditUserTemplate);
|
375 |
+
|
376 |
/* Rows */
|
377 |
$('body').delegate('.fl-row-overlay .fl-block-remove', 'click', FLBuilder._deleteRowClicked);
|
378 |
$('body').delegate('.fl-row-overlay .fl-block-copy', 'click', FLBuilder._rowCopyClicked);
|
451 |
*/
|
452 |
_bindOverlayEvents: function()
|
453 |
{
|
454 |
+
var content = $(FLBuilder._contentClass);
|
455 |
+
|
456 |
+
content.delegate('.fl-row', 'mouseenter', FLBuilder._rowMouseenter);
|
457 |
+
content.delegate('.fl-row', 'mouseleave', FLBuilder._rowMouseleave);
|
458 |
+
content.delegate('.fl-row-overlay', 'mouseleave', FLBuilder._rowMouseleave);
|
459 |
+
content.delegate('.fl-col', 'mouseenter', FLBuilder._colMouseenter);
|
460 |
+
content.delegate('.fl-col', 'mouseleave', FLBuilder._colMouseleave);
|
461 |
+
content.delegate('.fl-module', 'mouseenter', FLBuilder._moduleMouseenter);
|
462 |
+
content.delegate('.fl-module', 'mouseleave', FLBuilder._moduleMouseleave);
|
463 |
},
|
464 |
|
465 |
/**
|
468 |
*/
|
469 |
_destroyOverlayEvents: function()
|
470 |
{
|
471 |
+
var content = $(FLBuilder._contentClass);
|
472 |
+
|
473 |
+
content.undelegate('.fl-row', 'mouseenter', FLBuilder._rowMouseenter);
|
474 |
+
content.undelegate('.fl-row', 'mouseleave', FLBuilder._rowMouseleave);
|
475 |
+
content.undelegate('.fl-row-overlay', 'mouseleave', FLBuilder._rowMouseleave);
|
476 |
+
content.undelegate('.fl-col', 'mouseenter', FLBuilder._colMouseenter);
|
477 |
+
content.undelegate('.fl-col', 'mouseleave', FLBuilder._colMouseleave);
|
478 |
+
content.undelegate('.fl-module', 'mouseenter', FLBuilder._moduleMouseenter);
|
479 |
+
content.undelegate('.fl-module', 'mouseleave', FLBuilder._moduleMouseleave);
|
480 |
},
|
481 |
|
482 |
/**
|
659 |
$('.fl-builder-loading').show();
|
660 |
|
661 |
FLBuilder.ajax({
|
662 |
+
action: 'fl_builder_save',
|
663 |
method: 'save_layout',
|
664 |
render_assets: 0
|
665 |
}, FLBuilder._exit);
|
691 |
$('.fl-builder-loading').show();
|
692 |
|
693 |
FLBuilder.ajax({
|
694 |
+
action: 'fl_builder_save',
|
695 |
method: 'clear_draft_layout',
|
696 |
render_assets: 0
|
697 |
}, FLBuilder._exit);
|
734 |
$('.fl-builder-loading').show();
|
735 |
|
736 |
FLBuilder.ajax({
|
737 |
+
action: 'fl_builder_save',
|
738 |
method: 'duplicate_post'
|
739 |
}, FLBuilder._duplicatePageComplete);
|
740 |
},
|
841 |
$('.fl-builder-loading').show();
|
842 |
|
843 |
FLBuilder.ajax({
|
844 |
+
action: 'fl_builder_save',
|
845 |
method: 'save_global_settings',
|
846 |
settings: settings
|
847 |
}, FLBuilder._updateLayout);
|
975 |
if(confirm(FLBuilderStrings.deleteTemplate)) {
|
976 |
|
977 |
FLBuilder.ajax({
|
978 |
+
action: 'fl_builder_save',
|
979 |
method: 'delete_user_template',
|
980 |
template_id: template.attr('data-id')
|
981 |
});
|
1055 |
if(type == 'core') {
|
1056 |
|
1057 |
FLBuilder.ajax({
|
1058 |
+
action: 'fl_builder_save',
|
1059 |
method: 'apply_template',
|
1060 |
index: id,
|
1061 |
append: append
|
1064 |
else {
|
1065 |
|
1066 |
FLBuilder.ajax({
|
1067 |
+
action: 'fl_builder_save',
|
1068 |
method: 'apply_user_template',
|
1069 |
template_id: id,
|
1070 |
append: append
|
1105 |
$('.fl-builder-loading').show();
|
1106 |
|
1107 |
FLBuilder.ajax({
|
1108 |
+
action: 'fl_builder_save',
|
1109 |
method: 'save_user_template',
|
1110 |
template_name: settings.name
|
1111 |
}, FLBuilder._saveUserTemplateSettingsComplete);
|
1122 |
{
|
1123 |
FLBuilder._alert(FLBuilderStrings.templateSaved);
|
1124 |
},
|
1125 |
+
|
1126 |
+
/* Edit User Template
|
1127 |
+
----------------------------------------------------------*/
|
1128 |
+
|
1129 |
+
/**
|
1130 |
+
* @method _cancelEditUserTemplate
|
1131 |
+
* @private
|
1132 |
+
*/
|
1133 |
+
_cancelEditUserTemplate: function()
|
1134 |
+
{
|
1135 |
+
var result = confirm(FLBuilderStrings.discardMessage);
|
1136 |
+
|
1137 |
+
if(result) {
|
1138 |
+
|
1139 |
+
$('.fl-builder-loading').show();
|
1140 |
+
|
1141 |
+
FLBuilder.ajax({
|
1142 |
+
action: 'fl_builder_save',
|
1143 |
+
method: 'clear_draft_layout',
|
1144 |
+
render_assets: 0
|
1145 |
+
}, FLBuilder._cancelEditUserTemplateComplete);
|
1146 |
+
}
|
1147 |
+
},
|
1148 |
+
|
1149 |
+
/**
|
1150 |
+
* @method _cancelEditUserTemplateComplete
|
1151 |
+
* @private
|
1152 |
+
*/
|
1153 |
+
_cancelEditUserTemplateComplete: function()
|
1154 |
+
{
|
1155 |
+
window.close();
|
1156 |
+
},
|
1157 |
+
|
1158 |
+
/**
|
1159 |
+
* @method _saveEditUserTemplate
|
1160 |
+
* @private
|
1161 |
+
*/
|
1162 |
+
_saveEditUserTemplate: function()
|
1163 |
+
{
|
1164 |
+
$('.fl-builder-loading').show();
|
1165 |
+
|
1166 |
+
FLBuilder.ajax({
|
1167 |
+
action: 'fl_builder_save',
|
1168 |
+
method: 'save_layout',
|
1169 |
+
render_assets: 0
|
1170 |
+
}, FLBuilder._saveEditUserTemplateComplete);
|
1171 |
+
},
|
1172 |
+
|
1173 |
+
/**
|
1174 |
+
* @method _saveEditUserTemplateComplete
|
1175 |
+
* @private
|
1176 |
+
*/
|
1177 |
+
_saveEditUserTemplateComplete: function()
|
1178 |
+
{
|
1179 |
+
window.close();
|
1180 |
+
},
|
1181 |
|
1182 |
/* Template Settings
|
1183 |
----------------------------------------------------------*/
|
1272 |
oldCss.remove();
|
1273 |
oldJs.remove();
|
1274 |
|
1275 |
+
// Clean the new content.
|
1276 |
+
newHtml = FLBuilder._renderLayoutCleanContent(newHtml);
|
1277 |
|
1278 |
// Add the new content.
|
1279 |
content.append(newHtml);
|
1300 |
body.append(loader);
|
1301 |
},
|
1302 |
|
1303 |
+
/**
|
1304 |
+
* Remove scripts added by third party plugins
|
1305 |
+
* that are already present on the page.
|
1306 |
+
*
|
1307 |
+
* @method _renderLayoutCleanContent
|
1308 |
+
* @private
|
1309 |
+
*/
|
1310 |
+
_renderLayoutCleanContent: function(newHtml)
|
1311 |
+
{
|
1312 |
+
var i = 0;
|
1313 |
+
|
1314 |
+
for( ; i < newHtml.length; i++) {
|
1315 |
+
if(newHtml[i].nodeName.toUpperCase() == 'SCRIPT') {
|
1316 |
+
if($('script[src="' + newHtml[i].src + '"]').length > 0) {
|
1317 |
+
newHtml.splice(i, 1);
|
1318 |
+
}
|
1319 |
+
}
|
1320 |
+
}
|
1321 |
+
|
1322 |
+
return newHtml;
|
1323 |
+
},
|
1324 |
+
|
1325 |
/**
|
1326 |
* Called by the JavaScript file once it's loaded
|
1327 |
* to finish rendering the layout.
|
1443 |
$('.fl-builder-empty-message').hide();
|
1444 |
|
1445 |
// Highlight rows.
|
1446 |
+
$(FLBuilder._contentClass + ' .fl-row').addClass('fl-row-highlight');
|
1447 |
|
1448 |
// Highlight modules.
|
1449 |
if(item.hasClass('fl-module') || item.hasClass('fl-builder-block-module')) {
|
1450 |
+
$(FLBuilder._contentClass + ' .fl-col').addClass('fl-col-highlight');
|
1451 |
}
|
1452 |
|
1453 |
// Clean up the UI for dragging.
|
1471 |
|
1472 |
// Refresh sortables.
|
1473 |
$(FLBuilder._contentClass).sortable('refreshPositions');
|
1474 |
+
$(FLBuilder._contentClass + ' .fl-row-content').sortable('refreshPositions');
|
1475 |
+
$(FLBuilder._contentClass + ' .fl-col-content').sortable('refreshPositions');
|
1476 |
},
|
1477 |
|
1478 |
/**
|
1528 |
var parent = ui.item.parent(),
|
1529 |
initialPos = parent.offset().top - $(window).scrollTop();
|
1530 |
|
1531 |
+
// Show the panel?
|
1532 |
if(parent.hasClass('fl-builder-blocks-section-content')) {
|
1533 |
FLBuilder._showPanel();
|
1534 |
}
|
1535 |
|
1536 |
+
// Finish dragging.
|
1537 |
FLBuilder._dragEnabled = false;
|
1538 |
FLBuilder._dragging = false;
|
1539 |
FLBuilder._bindOverlayEvents();
|
1540 |
FLBuilder._highlightEmptyCols();
|
1541 |
$('.fl-builder-empty-message').show();
|
1542 |
|
1543 |
+
// Scroll the page back to where it was.
|
1544 |
scrollTo(0, parent.offset().top - initialPos);
|
1545 |
},
|
1546 |
|
1582 |
*/
|
1583 |
_highlightEmptyCols: function()
|
1584 |
{
|
1585 |
+
var rows = $(FLBuilder._contentClass + ' .fl-row'),
|
1586 |
+
cols = $(FLBuilder._contentClass + ' .fl-col');
|
1587 |
|
1588 |
rows.removeClass('fl-row-highlight');
|
1589 |
cols.removeClass('fl-col-highlight');
|
1657 |
*/
|
1658 |
_rowDragStop: function(e, ui)
|
1659 |
{
|
1660 |
+
var item = ui.item,
|
1661 |
+
parent = item.parent();
|
1662 |
+
|
1663 |
FLBuilder._blockDragStop(e, ui);
|
1664 |
|
1665 |
// A row was dropped back into the row list.
|
1666 |
+
if(parent.hasClass('fl-builder-rows')) {
|
1667 |
+
item.remove();
|
1668 |
return;
|
1669 |
}
|
1670 |
// Add a new row.
|
1671 |
+
else if(item.hasClass('fl-builder-block')) {
|
1672 |
|
1673 |
// A row was dropped into another row.
|
1674 |
+
if(parent.hasClass('fl-row-content')) {
|
1675 |
FLBuilder._addColGroup(
|
1676 |
+
item.closest('.fl-row').attr('data-node'),
|
1677 |
+
item.attr('data-cols'),
|
1678 |
+
parent.children('.fl-col-group, .fl-builder-block').index(item)
|
1679 |
);
|
|
|
|
|
1680 |
}
|
1681 |
// A row was dropped into the main layout.
|
1682 |
else {
|
1683 |
+
FLBuilder._addRow(
|
1684 |
+
item.attr('data-cols'),
|
1685 |
+
parent.children('.fl-row, .fl-builder-block').index(item)
|
1686 |
+
);
|
1687 |
}
|
1688 |
|
1689 |
// Remove the helper.
|
1690 |
+
item.remove();
|
1691 |
+
|
1692 |
+
// Show the builder panel.
|
1693 |
+
FLBuilder._showPanel();
|
1694 |
+
|
1695 |
+
// Show the module list.
|
1696 |
+
$('.fl-builder-modules').siblings('.fl-builder-blocks-section-title').eq(0).trigger('click');
|
1697 |
}
|
1698 |
// Reorder a row.
|
1699 |
else {
|
1700 |
+
FLBuilder._reorderRow(
|
1701 |
+
item.attr('data-node'),
|
1702 |
+
parent.children('.fl-row').index(item)
|
1703 |
+
);
|
1704 |
}
|
1705 |
},
|
1706 |
|
1711 |
_reorderRow: function(node_id, position)
|
1712 |
{
|
1713 |
FLBuilder.ajax({
|
1714 |
+
action: 'fl_builder_save',
|
1715 |
method: 'reorder_node',
|
1716 |
node_id: node_id,
|
1717 |
position: position,
|
1743 |
_addRowComplete: function(response)
|
1744 |
{
|
1745 |
var content = $(FLBuilder._contentClass),
|
1746 |
+
rows = content.find('.fl-row'),
|
1747 |
row = $(response),
|
1748 |
module = null,
|
1749 |
form = null;
|
1805 |
_deleteRow: function(row)
|
1806 |
{
|
1807 |
FLBuilder.ajax({
|
1808 |
+
action: 'fl_builder_save',
|
1809 |
method: 'delete_node',
|
1810 |
node_id: row.attr('data-node'),
|
1811 |
+
render_assets: 0,
|
1812 |
silent: true
|
1813 |
});
|
1814 |
|
1831 |
FLBuilder._removeAllOverlays();
|
1832 |
|
1833 |
FLBuilder.ajax({
|
1834 |
+
action: 'fl_builder_save',
|
1835 |
method: 'copy_row',
|
1836 |
node_id: nodeId
|
1837 |
}, FLBuilder._updateLayout);
|
1989 |
groupCols.css('width', width + '%');
|
1990 |
|
1991 |
FLBuilder.ajax({
|
1992 |
+
action : 'fl_builder_save',
|
1993 |
+
method : 'delete_col',
|
1994 |
+
node_id : col.attr('data-node'),
|
1995 |
+
new_width : width,
|
1996 |
+
render_assets : 0,
|
1997 |
+
silent : true
|
1998 |
});
|
1999 |
}
|
2000 |
},
|
2117 |
*/
|
2118 |
_moduleDragStop: function(e, ui)
|
2119 |
{
|
2120 |
+
var item = ui.item,
|
2121 |
+
parent = item.parent(),
|
2122 |
+
position = 0,
|
2123 |
parentId = 0;
|
2124 |
|
2125 |
FLBuilder._blockDragStop(e, ui);
|
2126 |
|
2127 |
// A module was dropped back into the module list.
|
2128 |
if(parent.hasClass('fl-builder-modules') || parent.hasClass('fl-builder-widgets')) {
|
2129 |
+
item.remove();
|
2130 |
return;
|
2131 |
}
|
2132 |
// A new module was dropped.
|
2133 |
+
else if(item.hasClass('fl-builder-block')) {
|
2134 |
|
2135 |
// A new module was dropped into a row position.
|
2136 |
if(parent.hasClass('fl-builder-content')) {
|
2137 |
+
position = parent.children('.fl-row, .fl-builder-block').index(item);
|
2138 |
parentId = 0;
|
2139 |
}
|
2140 |
// A new module was dropped into a column position.
|
2141 |
else if(parent.hasClass('fl-row-content')) {
|
2142 |
+
position = parent.children('.fl-col-group, .fl-builder-block').index(item);
|
2143 |
+
parentId = item.closest('.fl-row').attr('data-node');
|
2144 |
}
|
2145 |
// A new module was dropped into a column.
|
2146 |
else {
|
2147 |
+
position = parent.children('.fl-module, .fl-builder-block').index(item);
|
2148 |
+
parentId = item.closest('.fl-col').attr('data-node');
|
2149 |
}
|
2150 |
|
2151 |
// Add the new module.
|
2152 |
+
FLBuilder._addModule(parentId, item.attr('data-type'), position, item.attr('data-widget'))
|
2153 |
|
2154 |
// Remove the drag helper.
|
2155 |
ui.item.remove();
|
2156 |
}
|
2157 |
// A module was dropped into the main layout.
|
2158 |
else if(parent.hasClass('fl-builder-content')) {
|
2159 |
+
position = parent.children('.fl-row, .fl-module').index(item);
|
2160 |
+
FLBuilder._addModuleAfterRowRender = item;
|
2161 |
+
FLBuilder._addRow('1-col', position);
|
2162 |
+
item.remove();
|
2163 |
}
|
2164 |
// A module was dropped into a column position.
|
2165 |
else if(parent.hasClass('fl-row-content')) {
|
2166 |
+
position = parent.children('.fl-col-group, .fl-module').index(item);
|
2167 |
+
FLBuilder._addModuleAfterRowRender = item;
|
2168 |
+
FLBuilder._addColGroup(item.closest('.fl-row').attr('data-node'), '1-col', position);
|
2169 |
+
item.remove();
|
|
|
|
|
|
|
2170 |
}
|
2171 |
// A module was dropped into another column.
|
2172 |
else {
|
2173 |
+
FLBuilder._reorderModule(item);
|
2174 |
}
|
2175 |
|
2176 |
FLBuilder._resizeLayout();
|
2189 |
|
2190 |
if(newParent == oldParent) {
|
2191 |
FLBuilder.ajax({
|
2192 |
+
action: 'fl_builder_save',
|
2193 |
method: 'reorder_node',
|
2194 |
node_id: node_id,
|
2195 |
position: position,
|
2200 |
module.attr('data-parent', newParent);
|
2201 |
|
2202 |
FLBuilder.ajax({
|
2203 |
+
action: 'fl_builder_save',
|
2204 |
method: 'move_node',
|
2205 |
new_parent: newParent,
|
2206 |
node_id: node_id,
|
2236 |
var row = module.closest('.fl-row');
|
2237 |
|
2238 |
FLBuilder.ajax({
|
2239 |
+
action: 'fl_builder_save',
|
2240 |
method: 'delete_node',
|
2241 |
node_id: module.attr('data-node'),
|
2242 |
+
render_assets: 0,
|
2243 |
silent: true
|
2244 |
});
|
2245 |
|
2263 |
FLBuilder._removeAllOverlays();
|
2264 |
|
2265 |
FLBuilder.ajax({
|
2266 |
+
action: 'fl_builder_save',
|
2267 |
method: 'copy_module',
|
2268 |
node_id: module.attr('data-node')
|
2269 |
}, FLBuilder._updateLayout);
|
2637 |
|
2638 |
// Make the AJAX call.
|
2639 |
FLBuilder.ajax({
|
2640 |
+
action : 'fl_builder_save',
|
2641 |
method : 'save_settings',
|
2642 |
node_id : nodeId,
|
2643 |
settings : settings,
|
modules/widget/includes/frontend.php
CHANGED
@@ -27,7 +27,7 @@ if(isset($widget_slug) && isset($wp_widget_factory->widgets[$widget_slug])) {
|
|
27 |
|
28 |
// Render the widget
|
29 |
wp_cache_flush($widget_slug, 'widget');
|
30 |
-
the_widget($widget_slug, $widget_settings);
|
31 |
}
|
32 |
else if(isset($widget_slug) && FLBuilderModel::is_builder_active()) {
|
33 |
|
27 |
|
28 |
// Render the widget
|
29 |
wp_cache_flush($widget_slug, 'widget');
|
30 |
+
the_widget($widget_slug, $widget_settings, array('widget_id' => $module->node));
|
31 |
}
|
32 |
else if(isset($widget_slug) && FLBuilderModel::is_builder_active()) {
|
33 |
|