Version Description
- 4 January 2019 =
- Accordion: allow multiple panels with the same title.
- Actions when widgets' CSS files are created/deleted.
- Compat fixes for PHP 7.3
- Indicate when 'setup_widgets' is triggered for previews.
- Accordion: Debounce window.location.hash updates to prevent incorrect states.
- Don't remove FitText window listener to ensure previously set up FitText elements still work.
- Icon field: Show loading indicator while icons are loading.
- Widget documentation links.
- Icons: Update to use latest FontAwesome icon sets.
- Sliders: Resize slides when widgets are set up.
- Elementor compat: Directly enqueue necessary scripts and styles for previews.
- Allow widget headers to be translated.
- Accordion: Keep the clicked panel in the viewport, if it moves out.
- TinyMCE field: Check if tinymce is available before using.
Download this release
Release Info
Developer | gpriday |
Plugin | ![]() |
Version | 1.14.0 |
Comparing to | |
See all releases |
Code changes from version 1.13.4 to 1.14.0
- admin/admin.css +15 -7
- admin/tpl/admin.php +31 -24
- base/base.php +37 -17
- base/css/img/menu-icon.svg +1 -0
- base/inc/fields/container-base.class.php +3 -0
- base/inc/fields/css/icon-field.css +12 -2
- base/inc/fields/icon.class.php +41 -6
- base/inc/fields/js/icon-field.js +67 -21
- base/inc/fields/js/icon-field.min.js +1 -1
- base/inc/fields/js/tinymce-field.js +3 -1
- base/inc/fields/js/tinymce-field.min.js +1 -1
- base/inc/routes/siteorigin-widgets-resource.class.php +1 -1
- base/js/admin.js +2 -2
- base/js/admin.min.js +1 -1
- base/less/mixins.less +193 -193
- base/siteorigin-widget.class.php +7 -1
- compat/beaver-builder/sowb-beaver-builder.js +1 -1
- compat/beaver-builder/sowb-beaver-builder.min.js +1 -1
- compat/block-editor/widget-block.js +9 -2
- compat/block-editor/widget-block.min.js +1 -1
- compat/elementor/elementor.php +16 -40
- compat/elementor/sowb-elementor.js +25 -25
- compat/elementor/sowb-elementor.min.js +1 -1
- compat/visual-composer/sowb-vc-widget.js +80 -80
- compat/visual-composer/sowb-vc-widget.min.js +1 -1
- icons/fontawesome/filter.php +1653 -786
- icons/fontawesome/font/FontAwesome.otf +0 -0
- icons/fontawesome/font/fontawesome-webfont.eot +0 -0
- icons/fontawesome/font/fontawesome-webfont.svg +0 -2671
- icons/fontawesome/font/fontawesome-webfont.ttf +0 -0
- icons/fontawesome/font/fontawesome-webfont.woff +0 -0
- icons/fontawesome/font/fontawesome-webfont.woff2 +0 -0
- icons/fontawesome/style.css +302 -20
- icons/fontawesome/webfonts/fa-brands-400.eot +0 -0
- icons/fontawesome/webfonts/fa-brands-400.svg +576 -0
admin/admin.css
CHANGED
@@ -227,13 +227,25 @@
|
|
227 |
Â
color: #555;
|
228 |
Â
text-decoration: underline;
|
229 |
Â
}
|
230 |
-
#sow-widgets-page #widgets-list .so-widget .so-
|
231 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
232 |
Â
display: inline-block;
|
Â
|
|
Â
|
|
Â
|
|
233 |
Â
}
|
234 |
-
#sow-widgets-page #widgets-list .so-widget .so-widget-toggle-active button:focus {
|
235 |
Â
outline: none;
|
236 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
237 |
Â
#sow-widgets-page #widgets-list .so-widget.so-widget-is-active .so-widget-toggle-active .so-widget-activate {
|
238 |
Â
display: none;
|
239 |
Â
}
|
@@ -253,10 +265,6 @@
|
|
253 |
Â
-webkit-filter: grayscale(1);
|
254 |
Â
opacity: 0.7;
|
255 |
Â
}
|
256 |
-
#sow-widgets-page #widgets-list .so-widget .so-widget-settings {
|
257 |
-
margin-top: 15px;
|
258 |
-
display: inline-block;
|
259 |
-
}
|
260 |
Â
#sow-widgets-page #widgets-list.so-animated img,
|
261 |
Â
#sow-widgets-page #widgets-list.so-animated svg {
|
262 |
Â
-webkit-transition: all 0.45s ease;
|
227 |
Â
color: #555;
|
228 |
Â
text-decoration: underline;
|
229 |
Â
}
|
230 |
+
#sow-widgets-page #widgets-list .so-widget .so-action-links:after {
|
231 |
+
content: "";
|
232 |
+
display: table;
|
233 |
+
clear: both;
|
234 |
+
}
|
235 |
+
#sow-widgets-page #widgets-list .so-widget .so-action-links .so-widget-toggle-active,
|
236 |
+
#sow-widgets-page #widgets-list .so-widget .so-action-links .so-widget-settings,
|
237 |
+
#sow-widgets-page #widgets-list .so-widget .so-action-links .so-widget-documentation {
|
238 |
Â
display: inline-block;
|
239 |
+
float: left;
|
240 |
+
margin-right: 1em;
|
241 |
+
margin-top: 0.5em;
|
242 |
Â
}
|
243 |
+
#sow-widgets-page #widgets-list .so-widget .so-action-links .so-widget-toggle-active button:focus {
|
244 |
Â
outline: none;
|
245 |
Â
}
|
246 |
+
#sow-widgets-page #widgets-list .so-widget .so-action-links .so-widget-documentation {
|
247 |
+
margin-top: 1em;
|
248 |
+
}
|
249 |
Â
#sow-widgets-page #widgets-list .so-widget.so-widget-is-active .so-widget-toggle-active .so-widget-activate {
|
250 |
Â
display: none;
|
251 |
Â
}
|
265 |
Â
-webkit-filter: grayscale(1);
|
266 |
Â
opacity: 0.7;
|
267 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
268 |
Â
#sow-widgets-page #widgets-list.so-animated img,
|
269 |
Â
#sow-widgets-page #widgets-list.so-animated svg {
|
270 |
Â
-webkit-transition: all 0.45s ease;
|
admin/tpl/admin.php
CHANGED
@@ -65,33 +65,40 @@
|
|
65 |
Â
</strong>
|
66 |
Â
</div>
|
67 |
Â
<?php endif; ?>
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
68 |
Â
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
'action' => 'so_widgets_setting_form',
|
83 |
-
),
|
84 |
-
admin_url( 'admin-ajax.php' )
|
85 |
-
);
|
86 |
-
$form_url = wp_nonce_url( $form_url, 'display-widget-form' );
|
87 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
88 |
Â
?>
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
Â
|
|
95 |
Â
</div>
|
96 |
Â
|
97 |
Â
</div>
|
65 |
Â
</strong>
|
66 |
Â
</div>
|
67 |
Â
<?php endif; ?>
|
68 |
+
<div class="so-action-links">
|
69 |
+
<div class="so-widget-toggle-active">
|
70 |
+
<button class="button-secondary so-widget-activate" data-status="1"><?php esc_html_e( 'Activate', 'so-widgets-bundle' ) ?></button>
|
71 |
+
<button class="button-secondary so-widget-deactivate" data-status="0"><?php esc_html_e( 'Deactivate', 'so-widgets-bundle' ) ?></button>
|
72 |
+
</div>
|
73 |
Â
|
74 |
+
<?php
|
75 |
+
/** @var SiteOrigin_Widget $widget_object */
|
76 |
+
$widget_object = !empty( $widget_objects[ $file ] ) ? $widget_objects[ $file ] : false;
|
77 |
+
if( !empty( $widget_object ) && $widget_object->has_form( 'settings' ) ) {
|
78 |
+
$rel_path = str_replace( wp_normalize_path( WP_CONTENT_DIR ), '', $file );
|
79 |
+
|
80 |
+
$form_url = add_query_arg( array(
|
81 |
+
'id' => $rel_path,
|
82 |
+
'action' => 'so_widgets_setting_form',
|
83 |
+
),
|
84 |
+
admin_url( 'admin-ajax.php' )
|
85 |
+
);
|
86 |
+
$form_url = wp_nonce_url( $form_url, 'display-widget-form' );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
87 |
Â
|
88 |
+
?>
|
89 |
+
<button class="button-secondary so-widget-settings" data-form-url="<?php echo esc_url( $form_url ) ?>">
|
90 |
+
<?php esc_html_e( 'Settings', 'so-widgets-bundle' ) ?>
|
91 |
+
</button>
|
92 |
+
<?php
|
93 |
+
}
|
94 |
Â
?>
|
95 |
+
|
96 |
+
<?php if( ! empty( $widget['Documentation'] ) ) : ?>
|
97 |
+
<a href="<?php echo esc_url( $widget['Documentation'] ) ?>" target="_blank" rel="noopener noreferrer" class="so-widget-documentation">
|
98 |
+
<?php _e( 'Documentation', 'so-widgets-bundle' ) ?>
|
99 |
+
</a>
|
100 |
+
<?php endif; ?>
|
101 |
+
</div>
|
102 |
Â
</div>
|
103 |
Â
|
104 |
Â
</div>
|
base/base.php
CHANGED
@@ -47,14 +47,17 @@ add_action('wp_footer', 'siteorigin_widget_print_styles');
|
|
47 |
Â
* The ajax handler for getting a list of available icons.
|
48 |
Â
*/
|
49 |
Â
function siteorigin_widget_get_icon_list(){
|
50 |
-
if(empty($
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
Â
|
|
Â
|
|
Â
|
|
58 |
Â
}
|
59 |
Â
add_action('wp_ajax_siteorigin_widgets_get_icons', 'siteorigin_widget_get_icon_list');
|
60 |
Â
|
@@ -66,20 +69,37 @@ add_action('wp_ajax_siteorigin_widgets_get_icons', 'siteorigin_widget_get_icon_l
|
|
66 |
Â
*/
|
67 |
Â
function siteorigin_widget_get_icon($icon_value, $icon_styles = false) {
|
68 |
Â
if( empty( $icon_value ) ) return false;
|
69 |
-
|
Â
|
|
Â
|
|
Â
|
|
70 |
Â
if( empty( $family ) || empty( $icon ) ) return false;
|
71 |
Â
|
72 |
Â
static $widget_icon_families;
|
73 |
Â
static $widget_icons_enqueued = array();
|
74 |
-
|
75 |
-
if( empty($widget_icon_families
|
76 |
-
|
77 |
-
|
78 |
-
if(empty(
|
79 |
-
|
80 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
81 |
Â
}
|
82 |
-
return '<span class="
|
83 |
Â
}
|
84 |
Â
else {
|
85 |
Â
return false;
|
47 |
Â
* The ajax handler for getting a list of available icons.
|
48 |
Â
*/
|
49 |
Â
function siteorigin_widget_get_icon_list(){
|
50 |
+
if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
|
51 |
+
wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
|
52 |
+
}
|
53 |
+
|
54 |
+
if ( empty( $_GET['family'] ) ) {
|
55 |
+
wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 400 );
|
56 |
+
}
|
57 |
+
|
58 |
+
$widget_icon_families = apply_filters( 'siteorigin_widgets_icon_families', array() );
|
59 |
+
$icons = ! empty( $widget_icon_families[ $_GET['family'] ] ) ? $widget_icon_families[ $_GET['family'] ] : array();
|
60 |
+
wp_send_json( $icons );
|
61 |
Â
}
|
62 |
Â
add_action('wp_ajax_siteorigin_widgets_get_icons', 'siteorigin_widget_get_icon_list');
|
63 |
Â
|
69 |
Â
*/
|
70 |
Â
function siteorigin_widget_get_icon($icon_value, $icon_styles = false) {
|
71 |
Â
if( empty( $icon_value ) ) return false;
|
72 |
+
$value_parts = SiteOrigin_Widget_Field_Icon::get_value_parts( $icon_value );
|
73 |
+
$family = $value_parts['family'];
|
74 |
+
$style = empty( $value_parts['style'] ) ? null : $value_parts['style'];
|
75 |
+
$icon = $value_parts['icon'];
|
76 |
Â
if( empty( $family ) || empty( $icon ) ) return false;
|
77 |
Â
|
78 |
Â
static $widget_icon_families;
|
79 |
Â
static $widget_icons_enqueued = array();
|
80 |
+
|
81 |
+
if ( empty( $widget_icon_families ) ) {
|
82 |
+
$widget_icon_families = apply_filters('siteorigin_widgets_icon_families', array() );
|
83 |
+
}
|
84 |
+
if ( empty( $widget_icon_families[ $family ] ) ||
|
85 |
+
empty( $widget_icon_families[ $family ]['icons'][ $icon ] ) ) {
|
86 |
+
return false;
|
87 |
+
}
|
88 |
+
|
89 |
+
if ( empty( $widget_icons_enqueued[ $family ] ) &&
|
90 |
+
! empty( $widget_icon_families[ $family ]['style_uri'] ) ) {
|
91 |
+
if( ! wp_style_is( 'siteorigin-widget-icon-font-'.$family ) ) {
|
92 |
+
wp_enqueue_style( 'siteorigin-widget-icon-font-' . $family, $widget_icon_families[ $family ]['style_uri'] );
|
93 |
+
}
|
94 |
+
$family_style = 'sow-icon-' . $family . ( empty( $style ) ? '' : ' ' . $style );
|
95 |
+
$icon_data = $widget_icon_families[ $family ]['icons'][ $icon ];
|
96 |
+
$unicode = '';
|
97 |
+
if ( ! empty( $icon_data['unicode'] ) ) {
|
98 |
+
$unicode = $icon_data['unicode'];
|
99 |
+
} else if ( is_string( $icon_data ) ) {
|
100 |
+
$unicode = $icon_data;
|
101 |
Â
}
|
102 |
+
return '<span class="' . esc_attr( $family_style ) . '" data-sow-icon="' . $unicode . '" ' . ( ! empty( $icon_styles ) ? 'style="' . implode( '; ', $icon_styles ) . '"' : '' ) . '></span>';
|
103 |
Â
}
|
104 |
Â
else {
|
105 |
Â
return false;
|
base/css/img/menu-icon.svg
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
<svg enable-background="new 0 0 212.3 101.7" viewBox="0 0 212.3 101.7" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m145 56.9c4.6 5.5 7.7 6.7 13.6-1.9 1.3-2 7.7-7.8 9.8-8.8.6-.3 9.9 5.2 9.9 5.3 1.1 1.4-14.1 2-15.8 3.6-6 5.7-4.5 11-14.5 11.9-12.6 1.2-16.2-7.7-19.4-10.8-2-1.2-4-2.3-6-3.5 1.7 10.8.2 22.1.2 33 0 7.6-27.5 3.5-27 1.8 9.7-29.1-32.4-37.3-22.6-.8-8.8 3.9-17.7 3.9-26.5 0-1.5-17.5-3.4-34.9 4.1-46.5-5.2-2.2-7.7-2.9-8.1 3.9-.1 1.3-.9 4.4-1.6 5.5-.2.3-2.2-1.2-2.1-1.2.1-.5 1.5-2 1.9-3.3 1.3-4.4-.9-6.6 3.7-9.8 4.9-3.4 8.6-1.6 11.1-.6 6.3-5.4 13.8-8.6 29-8.6-.5 9.1 11.4 30.9 28.6 34.1-14.3-7.1-21.4-20.3-22.7-27.6 0-.2-.1-.4-.1-.6-4.6-26.9 25.8-25.2 31.3-9 16.7-2.8 14.7 7.6 18.9 14.5 3.2 6.6 5.4 14.6 4.3 19.4"/></clipPath><linearGradient id="b" gradientTransform="matrix(-179.082 -103.3928 85.8686 -148.7292 -74733.3203 117016.5)" gradientUnits="userSpaceOnUse" x1="-30.7393" x2="-30.2793" y1="807.7318" y2="807.7318"><stop offset="0" stop-color="#e5e5e5"/><stop offset="1" stop-color="#fff"/></linearGradient><path d="m145 56.9c4.6 5.5 7.7 6.7 13.6-1.9 1.3-2 7.7-7.8 9.8-8.8.6-.3 9.9 5.2 9.9 5.3 1.1 1.4-14.1 2-15.8 3.6-6 5.7-4.5 11-14.5 11.9-12.6 1.2-16.2-7.7-19.4-10.8-2-1.2-4-2.3-6-3.5 1.7 10.8.2 22.1.2 33 0 7.6-27.5 3.5-27 1.8 9.7-29.1-32.4-37.3-22.6-.8-8.8 3.9-17.7 3.9-26.5 0-1.5-17.5-3.4-34.9 4.1-46.5-5.2-2.2-7.7-2.9-8.1 3.9-.1 1.3-.9 4.4-1.6 5.5-.2.3-2.2-1.2-2.1-1.2.1-.5 1.5-2 1.9-3.3 1.3-4.4-.9-6.6 3.7-9.8 4.9-3.4 8.6-1.6 11.1-.6 6.3-5.4 13.8-8.6 29-8.6-.5 9.1 11.4 30.9 28.6 34.1-14.3-7.1-21.4-20.3-22.7-27.6 0-.2-.1-.4-.1-.6-4.6-26.9 25.8-25.1 31.4-8.9 16.7-2.8 14.7 7.6 18.9 14.5 3.1 6.5 5.3 14.5 4.2 19.3z" style="fill:none;stroke:#4d4d4d;stroke-width:8.7434;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:22.9256"/><path clip-path="url(#a)" d="m217.6 27.1-143.6-82.9-73.4 127 143.7 83z" fill="url(#b)"/><path clip-rule="evenodd" d="m131.3 32c1.2.3 2 1.3 1.8 2.2s-1.4 1.3-2.6 1-2-1.3-1.8-2.2 1.4-1.4 2.6-1" fill="#4d4d4d" fill-rule="evenodd"/></svg>
|
base/inc/fields/container-base.class.php
CHANGED
@@ -96,6 +96,9 @@ abstract class SiteOrigin_Widget_Field_Container_Base extends SiteOrigin_Widget_
|
|
96 |
Â
}
|
97 |
Â
|
98 |
Â
protected function sanitize_field_input( $value, $instance ) {
|
Â
|
|
Â
|
|
Â
|
|
99 |
Â
/* @var $field_factory SiteOrigin_Widget_Field_Factory */
|
100 |
Â
$field_factory = SiteOrigin_Widget_Field_Factory::single();
|
101 |
Â
foreach( $this->fields as $sub_field_name => $sub_field_options ) {
|
96 |
Â
}
|
97 |
Â
|
98 |
Â
protected function sanitize_field_input( $value, $instance ) {
|
99 |
+
if ( ! is_array( $value ) ) {
|
100 |
+
return array();
|
101 |
+
}
|
102 |
Â
/* @var $field_factory SiteOrigin_Widget_Field_Factory */
|
103 |
Â
$field_factory = SiteOrigin_Widget_Field_Factory::single();
|
104 |
Â
foreach( $this->fields as $sub_field_name => $sub_field_options ) {
|
base/inc/fields/css/icon-field.css
CHANGED
@@ -103,10 +103,10 @@
|
|
103 |
Â
width: 58px;
|
104 |
Â
height: 48px;
|
105 |
Â
margin: 3px;
|
106 |
-
padding:
|
107 |
Â
border: 1px solid #D0D0D0;
|
108 |
Â
background: #FFFFFF;
|
109 |
-
font-size:
|
110 |
Â
overflow: hidden;
|
111 |
Â
cursor: pointer;
|
112 |
Â
text-align: center;
|
@@ -119,3 +119,13 @@
|
|
119 |
Â
-moz-box-shadow: 0 1px 2px rgba(0,0,0,0.25);
|
120 |
Â
box-shadow: 0 1px 2px rgba(0,0,0,0.25);
|
121 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
103 |
Â
width: 58px;
|
104 |
Â
height: 48px;
|
105 |
Â
margin: 3px;
|
106 |
+
padding: 5px 0;
|
107 |
Â
border: 1px solid #D0D0D0;
|
108 |
Â
background: #FFFFFF;
|
109 |
+
font-size: 35px;
|
110 |
Â
overflow: hidden;
|
111 |
Â
cursor: pointer;
|
112 |
Â
text-align: center;
|
119 |
Â
-moz-box-shadow: 0 1px 2px rgba(0,0,0,0.25);
|
120 |
Â
box-shadow: 0 1px 2px rgba(0,0,0,0.25);
|
121 |
Â
}
|
122 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-icon .siteorigin-widget-icon-selector .siteorigin-widget-icon-icons.loading {
|
123 |
+
min-height: 40px;
|
124 |
+
background: #FFFFFF url("../../../css/img/wpspin_light.gif") center center no-repeat;
|
125 |
+
}
|
126 |
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
127 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-icon .siteorigin-widget-icon-selector .siteorigin-widget-icon-icons.loading {
|
128 |
+
background-image: url("../../../css/img/wpspin_light-2x.gif");
|
129 |
+
background-size: 16px 16px;
|
130 |
+
}
|
131 |
+
}
|
base/inc/fields/icon.class.php
CHANGED
@@ -17,8 +17,9 @@ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
|
17 |
Â
|
18 |
Â
protected function render_field( $value, $instance ) {
|
19 |
Â
$widget_icon_families = $this->get_widget_icon_families();
|
20 |
-
|
21 |
-
|
Â
|
|
22 |
Â
?>
|
23 |
Â
|
24 |
Â
<div class="siteorigin-widget-icon-selector-current">
|
@@ -41,6 +42,19 @@ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
|
41 |
Â
</option>
|
42 |
Â
<?php endforeach; ?>
|
43 |
Â
</select>
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
44 |
Â
|
45 |
Â
<input type="search" class="siteorigin-widget-icon-search" placeholder="<?php esc_attr_e( 'Search Icons' ) ?>" />
|
46 |
Â
|
@@ -61,13 +75,13 @@ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
|
61 |
Â
else {
|
62 |
Â
$sanitized_value = '';
|
63 |
Â
}
|
64 |
-
|
65 |
-
|
66 |
Â
$widget_icon_families = $this->get_widget_icon_families();
|
67 |
-
if( ! ( isset( $widget_icon_families[$
|
68 |
Â
$sanitized_value = isset( $this->default ) ? $this->default : '';
|
69 |
Â
}
|
70 |
-
|
71 |
Â
return $sanitized_value;
|
72 |
Â
}
|
73 |
Â
|
@@ -84,6 +98,27 @@ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
|
84 |
Â
|
85 |
Â
return $widget_icon_families;
|
86 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
87 |
Â
|
88 |
Â
public function enqueue_scripts(){
|
89 |
Â
wp_enqueue_script( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'js/icon-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
|
17 |
Â
|
18 |
Â
protected function render_field( $value, $instance ) {
|
19 |
Â
$widget_icon_families = $this->get_widget_icon_families();
|
20 |
+
$value_parts = self::get_value_parts( $value );
|
21 |
+
$value_family = ! empty( $value ) ? $value_parts['family'] : 'fontawesome';
|
22 |
+
$value = $value_parts['family'] . '-' . ( empty( $value_parts['style'] ) ? '' : $value_parts['style'] ) . '-' . $value_parts['icon'];
|
23 |
Â
?>
|
24 |
Â
|
25 |
Â
<div class="siteorigin-widget-icon-selector-current">
|
42 |
Â
</option>
|
43 |
Â
<?php endforeach; ?>
|
44 |
Â
</select>
|
45 |
+
|
46 |
+
<?php if ( ! empty( $widget_icon_families[$value_family]['styles'] ) ) :
|
47 |
+
$family_styles = $widget_icon_families[ $value_family ]['styles'];
|
48 |
+
?>
|
49 |
+
<select class="siteorigin-widget-icon-family-styles">
|
50 |
+
<?php foreach ( $family_styles as $family_style => $family_style_name ) : ?>
|
51 |
+
<option value="<?php echo esc_attr( $family_style ) ?>"
|
52 |
+
<?php selected( $value_parts['style'], $family_style ) ?>>
|
53 |
+
<?php esc_html_e( $family_style_name ); ?>
|
54 |
+
</option>
|
55 |
+
<?php endforeach; ?>
|
56 |
+
</select>
|
57 |
+
<?php endif;?>
|
58 |
Â
|
59 |
Â
<input type="search" class="siteorigin-widget-icon-search" placeholder="<?php esc_attr_e( 'Search Icons' ) ?>" />
|
60 |
Â
|
75 |
Â
else {
|
76 |
Â
$sanitized_value = '';
|
77 |
Â
}
|
78 |
+
|
79 |
+
$value_parts = self::get_value_parts( $sanitized_value );
|
80 |
Â
$widget_icon_families = $this->get_widget_icon_families();
|
81 |
+
if( ! ( isset( $widget_icon_families[$value_parts['family']] ) && isset( $widget_icon_families[$value_parts['family']]['icons'][$value_parts['icon']] ) ) ) {
|
82 |
Â
$sanitized_value = isset( $this->default ) ? $this->default : '';
|
83 |
Â
}
|
84 |
+
|
85 |
Â
return $sanitized_value;
|
86 |
Â
}
|
87 |
Â
|
98 |
Â
|
99 |
Â
return $widget_icon_families;
|
100 |
Â
}
|
101 |
+
|
102 |
+
static function get_value_parts( $value ) {
|
103 |
+
|
104 |
+
list( $value_family, $value_icon ) = ( ! empty( $value ) && strpos( $value, '-' ) !== false ) ? explode( '-', $value, 2 ) : array('', '');
|
105 |
+
|
106 |
+
$matched = preg_match( '/(sow\-fa\w?)\-/', $value_icon, $style_matches );
|
107 |
+
if ( ! empty( $matched ) ) {
|
108 |
+
$value_icon = str_replace( $style_matches[0], '', $value_icon );
|
109 |
+
$value_style = $style_matches[1];
|
110 |
+
}
|
111 |
+
|
112 |
+
if ( ! empty( $value_family ) ) {
|
113 |
+
include_once plugin_dir_path(SOW_BUNDLE_BASE_FILE) . 'icons/' . $value_family . '/filter.php';
|
114 |
+
}
|
115 |
+
|
116 |
+
return apply_filters( 'siteorigin_widgets_icon_migrate_' . $value_family, array(
|
117 |
+
'family' => $value_family,
|
118 |
+
'style' => ! empty( $value_style ) ? $value_style : null,
|
119 |
+
'icon' => $value_icon,
|
120 |
+
) );
|
121 |
+
}
|
122 |
Â
|
123 |
Â
public function enqueue_scripts(){
|
124 |
Â
wp_enqueue_script( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'js/icon-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
|
base/inc/fields/js/icon-field.js
CHANGED
@@ -53,16 +53,52 @@
|
|
53 |
Â
};
|
54 |
Â
|
55 |
Â
$search.keyup( searchIcons ).change( searchIcons );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
56 |
Â
|
57 |
Â
var rerenderIcons = function() {
|
58 |
-
var
|
Â
|
|
59 |
Â
var container = $is.find('.siteorigin-widget-icon-icons');
|
60 |
-
|
61 |
Â
if(typeof iconWidgetCache[family] === 'undefined') {
|
62 |
Â
return;
|
63 |
Â
}
|
64 |
Â
|
65 |
Â
container.empty();
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
66 |
Â
|
67 |
Â
if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
|
68 |
Â
|
@@ -72,11 +108,17 @@
|
|
72 |
Â
.appendTo('head');
|
73 |
Â
}
|
74 |
Â
|
75 |
-
for ( var i in
|
76 |
-
|
77 |
-
var
|
78 |
-
|
79 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
80 |
Â
.addClass( 'siteorigin-widget-icon-icons-icon' )
|
81 |
Â
.click(function(){
|
82 |
Â
var $$ = $(this);
|
@@ -95,14 +137,14 @@
|
|
95 |
Â
// This is being selected
|
96 |
Â
container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
|
97 |
Â
$$.addClass('siteorigin-widget-active');
|
98 |
-
$v.val( $$.data('value') );
|
99 |
Â
|
100 |
Â
// Also add this to the button
|
101 |
Â
$b.find('span')
|
102 |
Â
.show()
|
103 |
Â
.attr( 'data-sow-icon', $$.attr('data-sow-icon') )
|
104 |
Â
.attr( 'class', '' )
|
105 |
-
.addClass(
|
106 |
Â
|
107 |
Â
$remove.show();
|
108 |
Â
}
|
@@ -112,17 +154,17 @@
|
|
112 |
Â
// Hide the icon selector
|
113 |
Â
$is.slideUp();
|
114 |
Â
});
|
Â
|
|
Â
|
|
115 |
Â
|
116 |
-
|
117 |
-
|
118 |
-
if( $v.val() === family + '-' + i ) {
|
119 |
Â
// Add selected icon to the button.
|
120 |
-
$b.find('span')
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
icon.addClass('siteorigin-widget-active');
|
126 |
Â
}
|
127 |
Â
}
|
128 |
Â
|
@@ -133,7 +175,7 @@
|
|
133 |
Â
};
|
134 |
Â
|
135 |
Â
// Create the function for changing the icon family and call it once
|
136 |
-
var changeIconFamily = function(){
|
137 |
Â
// Fetch the family icons from the server
|
138 |
Â
var family = $is.find('select.siteorigin-widget-icon-family').val();
|
139 |
Â
|
@@ -142,12 +184,14 @@
|
|
142 |
Â
iconWidgetCache[family] = dataIcons;
|
143 |
Â
}
|
144 |
Â
|
145 |
-
|
146 |
Â
if(typeof family === 'undefined' || family === '') {
|
147 |
Â
return;
|
148 |
Â
}
|
149 |
Â
|
150 |
Â
if(typeof iconWidgetCache[family] === 'undefined') {
|
Â
|
|
Â
|
|
Â
|
|
151 |
Â
$.getJSON(
|
152 |
Â
soWidgets.ajaxurl,
|
153 |
Â
{
|
@@ -156,6 +200,8 @@
|
|
156 |
Â
},
|
157 |
Â
function(data) {
|
158 |
Â
iconWidgetCache[family] = data;
|
Â
|
|
Â
|
|
159 |
Â
rerenderIcons();
|
160 |
Â
}
|
161 |
Â
);
|
@@ -164,7 +210,7 @@
|
|
164 |
Â
rerenderIcons();
|
165 |
Â
}
|
166 |
Â
};
|
167 |
-
changeIconFamily();
|
168 |
Â
|
169 |
Â
$is.find('select.siteorigin-widget-icon-family').change(function(){
|
170 |
Â
$is.find('.siteorigin-widget-icon-icons').empty();
|
53 |
Â
};
|
54 |
Â
|
55 |
Â
$search.keyup( searchIcons ).change( searchIcons );
|
56 |
+
|
57 |
+
var renderStylesSelect = function ( init ) {
|
58 |
+
var $familySelect = $is.find( 'select.siteorigin-widget-icon-family' );
|
59 |
+
var family = $familySelect.val();
|
60 |
+
|
61 |
+
if(typeof iconWidgetCache[family] === 'undefined') {
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
|
65 |
+
var $stylesSelect = $is.find( '.siteorigin-widget-icon-family-styles' );
|
66 |
+
if ( !init ) {
|
67 |
+
$stylesSelect.off( 'change', rerenderIcons );
|
68 |
+
$stylesSelect.remove();
|
69 |
+
var iconFamily = iconWidgetCache[ family ];
|
70 |
+
if ( iconFamily.hasOwnProperty( 'styles' ) && iconFamily.styles ) {
|
71 |
+
var options = '';
|
72 |
+
for ( var styleClass in iconFamily.styles ) {
|
73 |
+
options += '<option value="' + styleClass + '">' + iconFamily.styles[styleClass] + '</option>';
|
74 |
+
}
|
75 |
+
if ( options ) {
|
76 |
+
$stylesSelect = $( '<select class="siteorigin-widget-icon-family-styles"></select>' ).append( options );
|
77 |
+
$familySelect.after( $stylesSelect );
|
78 |
+
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
$stylesSelect.on( 'change', rerenderIcons );
|
83 |
+
};
|
84 |
Â
|
85 |
Â
var rerenderIcons = function() {
|
86 |
+
var $familySelect = $is.find( 'select.siteorigin-widget-icon-family' );
|
87 |
+
var family = $familySelect.val();
|
88 |
Â
var container = $is.find('.siteorigin-widget-icon-icons');
|
89 |
+
|
90 |
Â
if(typeof iconWidgetCache[family] === 'undefined') {
|
91 |
Â
return;
|
92 |
Â
}
|
93 |
Â
|
94 |
Â
container.empty();
|
95 |
+
|
96 |
+
var iconFamily = iconWidgetCache[ family ];
|
97 |
+
var icons = iconFamily.icons;
|
98 |
+
var style;
|
99 |
+
if ( iconFamily.hasOwnProperty( 'styles' ) && iconFamily.styles ) {
|
100 |
+
style = $is.find( '.siteorigin-widget-icon-family-styles' ).val();
|
101 |
+
}
|
102 |
Â
|
103 |
Â
if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
|
104 |
Â
|
108 |
Â
.appendTo('head');
|
109 |
Â
}
|
110 |
Â
|
111 |
+
for ( var i in icons ) {
|
112 |
+
var iconData = icons[ i ];
|
113 |
+
var unicode = iconData.hasOwnProperty('unicode' ) ? iconData.unicode : iconData;
|
114 |
+
if ( iconData.hasOwnProperty( 'styles' ) && iconData.styles.indexOf( style ) === -1 ) {
|
115 |
+
continue;
|
116 |
+
}
|
117 |
+
var familyStyle = 'sow-icon-' + family + ( style ? ' ' + style : '' );
|
118 |
+
var familyValue = family + ( style ? '-' + style : '' ) + '-' + i;
|
119 |
+
var $icon = $('<div data-sow-icon="' + unicode + '"/>')
|
120 |
+
.attr('data-value', familyValue )
|
121 |
+
.addClass( familyStyle )
|
122 |
Â
.addClass( 'siteorigin-widget-icon-icons-icon' )
|
123 |
Â
.click(function(){
|
124 |
Â
var $$ = $(this);
|
137 |
Â
// This is being selected
|
138 |
Â
container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
|
139 |
Â
$$.addClass('siteorigin-widget-active');
|
140 |
+
$v.val( $$.data( 'value' ) );
|
141 |
Â
|
142 |
Â
// Also add this to the button
|
143 |
Â
$b.find('span')
|
144 |
Â
.show()
|
145 |
Â
.attr( 'data-sow-icon', $$.attr('data-sow-icon') )
|
146 |
Â
.attr( 'class', '' )
|
147 |
+
.addClass( familyStyle );
|
148 |
Â
|
149 |
Â
$remove.show();
|
150 |
Â
}
|
154 |
Â
// Hide the icon selector
|
155 |
Â
$is.slideUp();
|
156 |
Â
});
|
157 |
+
|
158 |
+
container.append( $icon );
|
159 |
Â
|
160 |
+
if( $v.val() === familyValue ) {
|
Â
|
|
Â
|
|
161 |
Â
// Add selected icon to the button.
|
162 |
+
$b.find( 'span' )
|
163 |
+
.show()
|
164 |
+
.attr( 'data-sow-icon', $icon.attr( 'data-sow-icon' ) )
|
165 |
+
.attr( 'class', '' )
|
166 |
+
.addClass( familyStyle );
|
167 |
+
$icon.addClass( 'siteorigin-widget-active' );
|
168 |
Â
}
|
169 |
Â
}
|
170 |
Â
|
175 |
Â
};
|
176 |
Â
|
177 |
Â
// Create the function for changing the icon family and call it once
|
178 |
+
var changeIconFamily = function( init ){
|
179 |
Â
// Fetch the family icons from the server
|
180 |
Â
var family = $is.find('select.siteorigin-widget-icon-family').val();
|
181 |
Â
|
184 |
Â
iconWidgetCache[family] = dataIcons;
|
185 |
Â
}
|
186 |
Â
|
Â
|
|
187 |
Â
if(typeof family === 'undefined' || family === '') {
|
188 |
Â
return;
|
189 |
Â
}
|
190 |
Â
|
191 |
Â
if(typeof iconWidgetCache[family] === 'undefined') {
|
192 |
+
var $container = $is.find('.siteorigin-widget-icon-icons');
|
193 |
+
$container.addClass( 'loading' );
|
194 |
+
|
195 |
Â
$.getJSON(
|
196 |
Â
soWidgets.ajaxurl,
|
197 |
Â
{
|
200 |
Â
},
|
201 |
Â
function(data) {
|
202 |
Â
iconWidgetCache[family] = data;
|
203 |
+
renderStylesSelect( init );
|
204 |
+
$container.removeClass( 'loading' );
|
205 |
Â
rerenderIcons();
|
206 |
Â
}
|
207 |
Â
);
|
210 |
Â
rerenderIcons();
|
211 |
Â
}
|
212 |
Â
};
|
213 |
+
changeIconFamily( true );
|
214 |
Â
|
215 |
Â
$is.find('select.siteorigin-widget-icon-family').change(function(){
|
216 |
Â
$is.find('.siteorigin-widget-icon-icons').empty();
|
base/inc/fields/js/icon-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(h){var u={};h(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(i){var e=h(this),g=e.find(".siteorigin-widget-icon-selector"),f=g.find(".siteorigin-widget-icon-icon"),v=e.find(".siteorigin-widget-icon-selector-current"),w=e.find(".so-icon-remove"),n=e.find(".siteorigin-widget-icon-search");if(!e.data("initialized")){v.click(function(){g.slideToggle(),n.val(""),y()}),w.click(function(i){i.preventDefault(),e.find(".siteorigin-widget-active").click()});var y=function(){var t=n.val().toLowerCase();""===t?g.find(".siteorigin-widget-icon-icons-icon").show():g.find(".siteorigin-widget-icon-icons-icon").each(function(){var i=h(this),e=i.attr("data-value");-1===(e=e.replace(/-/," ")).indexOf(t)?i.hide():i.show()})};n.keyup(y).change(y);var d=function(){var i=g.find("select.siteorigin-widget-icon-family").val(),e=g.find(".siteorigin-widget-icon-icons");if(void 0!==u[i]){e.empty();var t,n=u[i],s=n.icons;for(var o in n.hasOwnProperty("styles")&&n.styles&&(t=g.find(".siteorigin-widget-icon-family-styles").val()),0===h("#siteorigin-widget-font-"+i).length&&h("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+i).attr("href",u[i].style_uri).appendTo("head"),s){var a=s[o],d=a.hasOwnProperty("unicode")?a.unicode:a;if(!a.hasOwnProperty("styles")||-1!==a.styles.indexOf(t)){var c="sow-icon-"+i+(t?" "+t:""),r=i+(t?"-"+t:"")+"-"+o,l=h('<div data-sow-icon="'+d+'"/>').attr("data-value",r).addClass(c).addClass("siteorigin-widget-icon-icons-icon").click(function(){var i=h(this);i.hasClass("siteorigin-widget-active")?(i.removeClass("siteorigin-widget-active"),f.val(""),v.find("span").hide(),w.hide()):(e.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),i.addClass("siteorigin-widget-active"),f.val(i.data("value")),v.find("span").show().attr("data-sow-icon",i.attr("data-sow-icon")).attr("class","").addClass(c),w.show()),f.trigger("change",{isRendering:!0}),g.slideUp()});e.append(l),f.val()===r&&(v.find("span").show().attr("data-sow-icon",l.attr("data-sow-icon")).attr("class","").addClass(c),l.addClass("siteorigin-widget-active"))}}e.prepend(e.find(".siteorigin-widget-active")),y()}},t=function(e){var t=g.find("select.siteorigin-widget-icon-family").val(),i=g.find("select.siteorigin-widget-icon-family option:selected").data("icons");if(null!==i&&(u[t]=i),void 0!==t&&""!==t)if(void 0===u[t]){var n=g.find(".siteorigin-widget-icon-icons");n.addClass("loading"),h.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:g.find("select.siteorigin-widget-icon-family").val()},function(i){u[t]=i,function(i){var e=g.find("select.siteorigin-widget-icon-family"),t=e.val();if(void 0!==u[t]){var n=g.find(".siteorigin-widget-icon-family-styles");if(!i){n.off("change",d),n.remove();var s=u[t];if(s.hasOwnProperty("styles")&&s.styles){var o="";for(var a in s.styles)o+='<option value="'+a+'">'+s.styles[a]+"</option>";o&&(n=h('<select class="siteorigin-widget-icon-family-styles"></select>').append(o),e.after(n))}}n.on("change",d)}}(e),n.removeClass("loading"),d()})}else d()};t(!0),g.find("select.siteorigin-widget-icon-family").change(function(){g.find(".siteorigin-widget-icon-icons").empty(),t()}),f.change(function(i,e){e&&e.isRendering||d()}),e.data("initialized",!0)}})}(jQuery);
|
base/inc/fields/js/tinymce-field.js
CHANGED
@@ -62,7 +62,9 @@
|
|
62 |
Â
} );
|
63 |
Â
|
64 |
Â
wpEditor.remove( id );
|
65 |
-
window.tinymce
|
Â
|
|
Â
|
|
66 |
Â
// Wait for textarea to be visible before initialization.
|
67 |
Â
if ( $textarea.is( ':visible' ) ) {
|
68 |
Â
wpEditor.initialize( id, settings );
|
62 |
Â
} );
|
63 |
Â
|
64 |
Â
wpEditor.remove( id );
|
65 |
+
if ( window.tinymce ) {
|
66 |
+
window.tinymce.EditorManager.overrideDefaults( { base_url: settings.baseURL, suffix: settings.suffix } );
|
67 |
+
}
|
68 |
Â
// Wait for textarea to be visible before initialization.
|
69 |
Â
if ( $textarea.is( ':visible' ) ) {
|
70 |
Â
wpEditor.initialize( id, settings );
|
base/inc/fields/js/tinymce-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(c){var t=function(r){if(!r.data("initialized")){var i=wp.oldEditor?wp.oldEditor:wp.editor;i&&i.hasOwnProperty("autop")&&(wp.editor.autop=i.autop,wp.editor.removep=i.removep,wp.editor.initialize=i.initialize);var e,n=r.find(".siteorigin-widget-tinymce-container"),d=n.data("editorSettings");if(d.wpautopToggleField){var t=n.closest(".siteorigin-widget-form");e=t.find(d.wpautopToggleField),d.tinymce.wpautop=e.is(":checked")}var a=n.find("textarea"),s=a.attr("id");if(d.tinymce&&(d.tinymce=c.extend({},d.tinymce,{selector:"#"+s,setup:function(i){i.on("change",function(){window.tinymce.get(s).save(),a.trigger("change")}),e&&(e.off("change"),e.on("change",function(){wp.editor.remove(s),d.tinymce.wpautop=e.is(":checked"),wp.editor.initialize(s,d)}))}})),c(document).on("wp-before-tinymce-init",function(i,e){if(e.selector===d.tinymce.selector){var t=n.data("mediaButtons");0===r.find(".wp-media-buttons").length&&r.find(".wp-editor-tabs").before(t.html)}}),c(document).on("tinymce-editor-setup",function(){r.find(".wp-editor-wrap").hasClass(d.selectedEditor+"-active")||setTimeout(function(){window.switchEditors.go(s)},10)}),i.remove(s),window.tinymce.EditorManager.overrideDefaults({base_url:d.baseURL,suffix:d.suffix}),a.is(":visible"))i.initialize(s,d);else var o=setInterval(function(){a.is(":visible")&&(i.initialize(s,d),clearInterval(o))},500);r.on("click",function(i){var e=c(i.target);if(e.is(".wp-switch-editor")){var t=e.hasClass("switch-tmce")?"tmce":"html";if("tmce"===t){var n=window.tinymce.get(s);if(null!==n){var o=a.val();-1!==o.search("<")&&-1===o.search(">")&&(o=o.replace(/</g,""),a.val(o)),n.setContent(window.switchEditors.wpautop(o))}}d.selectedEditor=t,r.find(".siteorigin-widget-tinymce-selected-editor").val(t)}}),r.data("initialized",!0)}};c(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(){var i=c(this),e=i.closest(".siteorigin-widget-field-repeater-item-form");0<e.length?e.is(":visible")?t(i):e.on("slideToggleOpenComplete",function(){e.is(":visible")&&(t(i),e.off("slideToggleOpenComplete"))}):t(i)}),c(document).on("sortstop",function(i,e){(e.item.is(".siteorigin-widget-field-repeater-item")?e.item.find("> .siteorigin-widget-field-repeater-item-form"):e.item.find(".siteorigin-widget-form")).find(".siteorigin-widget-field-type-tinymce").each(function(){c(this).data("initialized",null),t(c(this))})})}(jQuery);
|
1 |
+
!function(c){var t=function(r){if(!r.data("initialized")){var i=wp.oldEditor?wp.oldEditor:wp.editor;i&&i.hasOwnProperty("autop")&&(wp.editor.autop=i.autop,wp.editor.removep=i.removep,wp.editor.initialize=i.initialize);var e,n=r.find(".siteorigin-widget-tinymce-container"),d=n.data("editorSettings");if(d.wpautopToggleField){var t=n.closest(".siteorigin-widget-form");e=t.find(d.wpautopToggleField),d.tinymce.wpautop=e.is(":checked")}var a=n.find("textarea"),s=a.attr("id");if(d.tinymce&&(d.tinymce=c.extend({},d.tinymce,{selector:"#"+s,setup:function(i){i.on("change",function(){window.tinymce.get(s).save(),a.trigger("change")}),e&&(e.off("change"),e.on("change",function(){wp.editor.remove(s),d.tinymce.wpautop=e.is(":checked"),wp.editor.initialize(s,d)}))}})),c(document).on("wp-before-tinymce-init",function(i,e){if(e.selector===d.tinymce.selector){var t=n.data("mediaButtons");0===r.find(".wp-media-buttons").length&&r.find(".wp-editor-tabs").before(t.html)}}),c(document).on("tinymce-editor-setup",function(){r.find(".wp-editor-wrap").hasClass(d.selectedEditor+"-active")||setTimeout(function(){window.switchEditors.go(s)},10)}),i.remove(s),window.tinymce&&window.tinymce.EditorManager.overrideDefaults({base_url:d.baseURL,suffix:d.suffix}),a.is(":visible"))i.initialize(s,d);else var o=setInterval(function(){a.is(":visible")&&(i.initialize(s,d),clearInterval(o))},500);r.on("click",function(i){var e=c(i.target);if(e.is(".wp-switch-editor")){var t=e.hasClass("switch-tmce")?"tmce":"html";if("tmce"===t){var n=window.tinymce.get(s);if(null!==n){var o=a.val();-1!==o.search("<")&&-1===o.search(">")&&(o=o.replace(/</g,""),a.val(o)),n.setContent(window.switchEditors.wpautop(o))}}d.selectedEditor=t,r.find(".siteorigin-widget-tinymce-selected-editor").val(t)}}),r.data("initialized",!0)}};c(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(){var i=c(this),e=i.closest(".siteorigin-widget-field-repeater-item-form");0<e.length?e.is(":visible")?t(i):e.on("slideToggleOpenComplete",function(){e.is(":visible")&&(t(i),e.off("slideToggleOpenComplete"))}):t(i)}),c(document).on("sortstop",function(i,e){(e.item.is(".siteorigin-widget-field-repeater-item")?e.item.find("> .siteorigin-widget-field-repeater-item-form"):e.item.find(".siteorigin-widget-form")).find(".siteorigin-widget-field-type-tinymce").each(function(){c(this).data("initialized",null),t(c(this))})})}(jQuery);
|
base/inc/routes/siteorigin-widgets-resource.class.php
CHANGED
@@ -58,7 +58,7 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
|
|
58 |
Â
$status_code = rest_authorization_required_code();
|
59 |
Â
return new WP_Error(
|
60 |
Â
$status_code,
|
61 |
-
__( '', 'so-widgets-bundle' ),
|
62 |
Â
array(
|
63 |
Â
'status' => $status_code,
|
64 |
Â
)
|
58 |
Â
$status_code = rest_authorization_required_code();
|
59 |
Â
return new WP_Error(
|
60 |
Â
$status_code,
|
61 |
+
__( 'Insufficient permissions.', 'so-widgets-bundle' ),
|
62 |
Â
array(
|
63 |
Â
'status' => $status_code,
|
64 |
Â
)
|
base/js/admin.js
CHANGED
@@ -1238,9 +1238,9 @@ var sowbForms = window.sowbForms || {};
|
|
1238 |
Â
}
|
1239 |
Â
|
1240 |
Â
if ( $body.hasClass('block-editor-page') ) {
|
1241 |
-
// Setup new widgets when they're
|
1242 |
Â
$(document).on('panels_setup_preview', function () {
|
1243 |
-
$( sowb ).trigger( 'setup_widgets' );
|
1244 |
Â
});
|
1245 |
Â
}
|
1246 |
Â
|
1238 |
Â
}
|
1239 |
Â
|
1240 |
Â
if ( $body.hasClass('block-editor-page') ) {
|
1241 |
+
// Setup new widgets when they're previewed in the block editor.
|
1242 |
Â
$(document).on('panels_setup_preview', function () {
|
1243 |
+
$( sowb ).trigger( 'setup_widgets', { preview: true } );
|
1244 |
Â
});
|
1245 |
Â
}
|
1246 |
Â
|
base/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowbForms=window.sowbForms||{};!function(C){C.fn.sowSetupForm=function(){return C(this).each(function(e,i){var o,t=C(i),y=!0,r=C("body"),n=t.find("input[name]");if(n.length&&-1!==n.attr("name").indexOf("__i__"))return this;if(t.is(".siteorigin-widget-form-main")){if(!0===t.data("sow-form-setup"))return!0;if(r.hasClass("widgets-php")&&!t.is(":visible")&&0===t.closest(".panel-dialog").length)return!0;t.on("sowstatechange",function(e,h,b){t.find("[data-state-handler]").each(function(){var e,i,t,r,n,a,s=C(this),o=C.extend({},s.data("state-handler"),y?s.data("state-handler-initial"):{});if(0===Object.keys(o).length)return!0;var d={},l=sowbForms.getContainerFieldId(s,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==l){var g={};for(var f in o)g[f.replace("{$repeater}",l)]=o[f];o=g}var c=sowbForms.getContainerFieldId(s,"widget",".siteorigin-widget-widget");if(!1!==c){var p={};for(var u in o){var m=u.match(/_else\[(.*)\]|(.*)\[(.*)\]/);p[m&&m.length&&void 0===m[1]?m[2]+"_"+c+"["+m[3]+"]":"_else["+m[1]+"_"+c+"]"]=o[u]}o=p}for(var w in o)if(n=!1,null!==(e=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(i={group:"default",name:"",multi:!1},void 0!==e[2]?(i.group=e[1],i.name=e[3]):i.name=e[0],i.multi=void 0!==e[4],"_else"===i.group)i.group=i.name,i.name="",n=i.group===h&&void 0===d[i.group];else{a=i.name.split(",").map(function(e){return e.trim()});for(var v=0;v<a.length&&!(n=i.group===h&&a[v]===b);v++);}if(n){t=o[w],i.multi||(t=[t]);for(v=0;v<t.length;v++)(r=void 0!==t[v][1]&&Boolean(t[v][1])?s.find(t[v][1]):s)[t[v][0]].apply(r,void 0!==t[v][2]?t[v][2]:[]);d[i.group]=!0}}})}),t.sowSetupPreview();var a=(o=t).find(".siteorigin-widget-teaser");if(a.find(".dashicons-dismiss").click(function(){var e=C(this);C.get(e.data("dismiss-url")),a.slideUp("normal",function(){a.remove()})}),!t.data("backupDisabled")){var s=t.find("> .siteorigin-widgets-form-id").val(),d=t.find("> .siteorigin-widgets-form-timestamp"),l=parseInt(d.val()||0),g=JSON.parse(sessionStorage.getItem(s));if(g)if(g._sow_form_timestamp>l){var f=C('<div class="siteorigin-widget-form-notification"><span>'+soWidgets.backup.newerVersion+'</span><a class="button button-small so-backup-restore">'+soWidgets.backup.restore+'</a><a class="button button-small so-backup-dismiss">'+soWidgets.backup.dismiss+"</a><div><small>"+soWidgets.backup.replaceWarning+"</small></div></div>");t.prepend(f),f.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(o,g),f.slideUp("fast",function(){f.remove()})}),f.find(".so-backup-dismiss").click(function(){f.slideUp("fast",function(){sessionStorage.removeItem(s),f.remove()})})}else sessionStorage.removeItem(s);t.change(function(){d.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(t);sessionStorage.setItem(s,JSON.stringify(e))})}}else o=t.closest(".siteorigin-widget-form-main");o.find("> .siteorigin-widgets-form-id").val();var c=t.find("> .siteorigin-widget-field");c.find("> .siteorigin-widget-section").sowSetupForm();var p=c.find("> .siteorigin-widget-widget");p.find("> .siteorigin-widget-section").sowSetupForm(),p.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),c.find(".siteorigin-widget-input").each(function(e,i){null===C(i).data("original-name")&&C(i).data("original-name",C(i).attr("name"))}),c.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),t.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),c.find("> .siteorigin-widget-input-color").each(function(){var e=C(this),i={change:function(e,i){setTimeout(function(){C(e.target).trigger("change")},100)}};e.data("defaultColor")&&(i.defaultColor=e.data("defaultColor")),e.wpColorPicker(i)});var u=function(){C(this).toggleClass("siteorigin-widget-section-visible"),C(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){(C(window).resize(),C(this).find("> .siteorigin-widget-field-container-state").val(C(this).is(":visible")?"open":"closed"),C(this).is(":visible"))&&C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})};c.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(u),c.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(u),c.filter(".siteorigin-widget-field-type-slider").each(function(){var t=C(this),r=t.find('input[type="number"]'),n=t.find(".siteorigin-widget-value-slider");n.slider({max:parseFloat(r.attr("max")),min:parseFloat(r.attr("min")),step:parseFloat(r.attr("step")),value:parseFloat(r.val()),slide:function(e,i){r.val(parseFloat(i.value)),r.trigger("change")},change:function(e,i){t.find(".siteorigin-widget-slider-value").html(i.value)}}),r.change(function(e,i){i&&i.silent||n.slider("value",parseFloat(r.val()))})}),c.filter(".siteorigin-widget-field-type-link").each(function(){var n=C(this),t=function(){var e=n.find(".content-text-search"),i=e.val(),t=e.data("postTypes"),r=n.find("ul.posts").empty().addClass("loading");C.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:i,postTypes:t},function(e){for(var i=0;i<e.length;i++)""===e[i].label&&(e[i].label=" "),r.append(C("<li>").addClass("post").html(e[i].label+"<span>("+e[i].type+")</span>").data(e[i]));r.removeClass("loading")})};n.find(".select-content-button, .button-close").click(function(e){e.preventDefault(),C(this).blur();var i=n.find(".existing-content-selector");i.toggle(),i.is(":visible")&&0===i.find("ul.posts li").length&&t()}),n.on("click",".posts li",function(e){e.preventDefault();var i=C(this);n.find("input.siteorigin-widget-input").val("post: "+i.data("value")),n.change(),n.find(".existing-content-selector").toggle()});var e=null;n.find(".content-text-search").keyup(function(){null!==e&&clearTimeout(e),e=setTimeout(function(){t()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&c.filter(".siteorigin-widget-field-type-builder").each(function(){C(this).find("> .siteorigin-page-builder-field").each(function(){var e=C(this);e.soPanelsSetupBuilderWidget({builderType:e.data("type")})})});var m=function(){var a=C(this),e=a.closest("[data-state-emitter]").data("state-emitter");if(void 0!==e){var i=function(e,i){if(void 0===sowEmitters[e.callback]||"_"===e.callback.substr(0,1))return i;if(a.is('[type="radio"]')&&!a.is(":checked"))return i;var t=sowbForms.getContainerFieldId(a,"repeater",".siteorigin-widget-field-repeater-item");!1!==t&&(e.args=e.args.map(function(e){return e.replace("{$repeater}",t)}));var r=sowbForms.getContainerFieldId(a,"widget",".siteorigin-widget-widget");!1===r||e.hasOwnProperty("widgetFieldId")||(e.widgetFieldId=r,e.args=e.args.map(function(e){return e+"_"+r}));var n=a.is('[type="checkbox"]')?a.is(":checked"):a.val();return C.extend(i,sowEmitters[e.callback](n,e.args))},t={default:""};void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++)t=i(e[r],t);var n=o.data("states");for(var s in void 0===n&&(n={default:""}),t)void 0!==n[s]&&t[s]===n[s]||(n[s]=t[s],o.trigger("sowstatechange",[s,t[s]]));o.data("states",n)}};c.filter("[data-state-emitter]").each(function(){var e=C(this).find(".siteorigin-widget-input");e.on("keyup change",m),e.each(function(){var e=C(this);e.is(":radio")?e.is(":checked")&&m.call(e[0]):m.call(e[0])})}),t.trigger("sowsetupform",c).data("sow-form-setup",!0),c.trigger("sowsetupformfield"),t.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(r.hasClass("wp-customizer")||r.hasClass("widgets-php"))&&t.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),y=!1})},C.fn.sowSetupPreview=function(){var r=C(this);r.siblings(".siteorigin-widget-preview").find("> a").click(function(e){e.preventDefault();var i=sowbForms.getWidgetFormValues(r),t=C(C("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");t.find('input[name="data"]').val(JSON.stringify(i)),t.find('input[name="class"]').val(r.data("class")),t.find("iframe").on("load",function(){C(this).css("visibility","visible")}),t.find("form").submit(),t.find(".close").click(function(){t.remove()})})},C.fn.sowSetupRepeater=function(){return C(this).each(function(e,i){var n=C(i),t=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");t.bind("updateFieldPositions",function(){var e=C(this),i=e.find("> .siteorigin-widget-field-repeater-item");i.each(function(r,e){C(e).find(".siteorigin-widget-input").each(function(e,i){var t=C(i).data("repeater-positions");void 0===t&&(t={}),t[a]=r,C(i).data("repeater-positions",t)})}),e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i),r=t.data("repeater-positions");if(void 0!==r){var n=t.attr("data-original-name");if(n||(t.attr("data-original-name",t.attr("name")),n=t.attr("name")),!n)return;if(r)for(var a in r)n=n.replace("#"+a+"#",r[a]);t.attr("name",n)}}),e.data("initialSetup")||(e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i);t.prop("checked",t.prop("defaultChecked"))}),e.data("initialSetup",!0));var t=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(0<t&&i.length>t){var r=i.first().outerHeight();e.css("max-height",r*t).css("overflow","auto")}else e.css("max-height","").css("overflow","")}),t.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){t.find('input[type="radio"].siteorigin-widget-input').attr("name",""),t.trigger("updateFieldPositions"),n.trigger("change")},sortstop:function(e,i){i.item.is(".siteorigin-widget-field-repeater-item")?i.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}):i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");n.trigger("change")}}),t.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){C(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){C(window).resize()})})})},C.fn.sowAddRepeaterItem=function(){return C(this).each(function(e,i){var t=C(i),r=t.find("> .siteorigin-widget-field-repeater-items").children().length+1,n=C("<div>"+t.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");n.find(".siteorigin-widget-input[data-name]").each(function(){var e=C(this);0===e.closest(".siteorigin-widget-field-repeater-item-html").length&&e.attr("name",C(this).data("name"))});var a="";n.find("> .siteorigin-widget-field").each(function(e,i){var t=i.outerHTML;C(i).is(".siteorigin-widget-field-type-repeater")||(t=t.replace(/_id_/g,r)),a+=t});var s=void 0!==t.attr("readonly"),o=C('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(C('<div class="siteorigin-widget-field-repeater-item-top" />').append(C('<div class="siteorigin-widget-field-expand" />')).append(s?"":C('<div class="siteorigin-widget-field-copy" />')).append(s?"":C('<div class="siteorigin-widget-field-remove" />')).append(C("<h4 />").html(t.data("item-name")))).append(C('<div class="siteorigin-widget-field-repeater-item-form" />').html(a));t.find("> .siteorigin-widget-field-repeater-items").append(o).sortable("refresh").trigger("updateFieldPositions"),o.sowSetupRepeaterItems(),o.hide().slideDown("fast",function(){C(window).resize()}),t.trigger("change")})},C.fn.sowRemoveRepeaterItem=function(){return C(this).each(function(e,i){var t=C(this).closest(".siteorigin-widget-field-repeater-items");C(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(i).trigger("change")})},C.fn.sowSetupRepeaterItems=function(){return C(this).each(function(e,i){var _=C(i);if(void 0===_.data("sowrepeater-actions-setup")){var t=_.closest(".siteorigin-widget-field-repeater"),r=_.find("> .siteorigin-widget-field-repeater-item-top"),n=t.data("item-label");if(n&&n.selector){var a=function(){var e=n.hasOwnProperty("valueMethod")&&n.valueMethod?n.valueMethod:"val",i=_.find(n.selector)[e]();i&&(80<i.length&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};a();var s=n.hasOwnProperty("updateEvent")&&n.updateEvent?n.updateEvent:"change";_.bind(s,a)}r.click(function(e){"siteorigin-widget-field-remove"!==e.target.className&&"siteorigin-widget-field-copy"!==e.target.className&&(e.preventDefault(),C(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){(C(window).resize(),C(this).is(":visible"))?(C(this).trigger("slideToggleOpenComplete"),C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")):C(this).trigger("slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(e,i){e.preventDefault();var t=C(this).closest(".siteorigin-widget-field-repeater-items"),r=C(this).closest(".siteorigin-widget-field-repeater-item"),n=function(){r.remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(window).resize()};i&&i.silent?n():confirm(soWidgets.sure)&&r.slideUp("fast",n),_.trigger("change")}),r.find(".siteorigin-widget-field-copy").click(function(e){e.preventDefault();var h=C(this).closest(".siteorigin-widget-form-main"),b=C(this).closest(".siteorigin-widget-field-repeater-item"),y=b.clone(),i=b.closest(".siteorigin-widget-field-repeater-items"),F=i.children().length,k={};y.find("*[name]").each(function(){var e=C(this),i=e.attr("id"),t=e.attr("name");if(e.is("textarea")&&e.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){e.parent().empty().append(e),e.css("display","");var r=tinymce.get(i);r&&e.val(r.getContent())}else if(e.is(".wp-color-picker")){var n=e.closest(".wp-picker-container"),a=e.closest(".siteorigin-widget-field");n.remove(),a.append(e.remove())}else{var s=i?b.find("#"+i):b.find('[name="'+t+'"]');s.length&&null!=s.val()&&e.val(s.val())}if(i){var o,d;if(e.is('[type="radio"]')){o=i.replace(/-\d+-\d+$/,"");var l=i.replace(/-\d+$/,"");if(!k[o]){var g={};k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").filter(function(e,i){var t=C(i).attr("name");return!g[t]&&(g[t]=!0)}).length+1}var f=o+"-"+k[o];d=f+i.match(/-\d+$/)[0],y.find("label[for="+l+"]").attr("for",f)}else u=new RegExp("-\\d+$"),o=i.replace(u,""),k[o]||(k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").length+1),d=o+"-"+k[o]++;if(e.attr("id",d),e.is(".wp-editor-area")){var c=e.closest(".siteorigin-widget-tinymce-container"),p=c.data("media-buttons");if(p&&p.html){var u=new RegExp(i,"g");p.html=p.html.replace(u,d),c.data("media-buttons",p)}}y.find("label[for="+i+"]").attr("for",d),y.find("[id*="+i+"]").each(function(){var e=C(this).attr("id").replace(i,d);C(this).attr("id",e)}),"undefined"!=typeof tinymce&&tinymce.get(d)&&tinymce.get(d).remove()}var m=b.parents(".siteorigin-widget-field-repeater").length,w=C("body");(w.hasClass("wp-customizer")||w.hasClass("widgets-php"))&&0===_.closest(".panel-dialog").length&&(m+=1);var v=t.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+F.toString()+"$3");e.attr("name",v),e.data("original-name",v)}),i.append(y).sortable("refresh").trigger("updateFieldPositions"),y.sowSetupRepeaterItems(),y.hide().slideDown("fast",function(){C(window).resize()}),_.trigger("change")}),_.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),_.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?C.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(e){if(_.isUndefined(e))return null;var l={};return e.find("*[name]").each(function(){var i=C(this);try{var e=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(e))return!0;var t=(e=e[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var r=l,n=null,a=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===a)n=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===a){if(!i.is(":checked"))return;n=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(i.attr("id"))),n=null===s||"function"!=typeof s.getContent||s.isHidden()?i.val():s.getContent()}else if("SELECT"===i.prop("tagName")){var o=i.find("option:selected");1===o.length?n=i.find("option:selected").val():1<o.length&&(n=_.map(i.find("option:selected"),function(e,i){return C(e).val()}))}else n=i.val();for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?r.push(n):r[t[d]]=n:(_.isUndefined(r[t[d]])&&(_.isNumber(t[d+1])||""===t[d+1]?r[t[d]]=[]:r[t[d]]={}),r=r[t[d]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),l},sowbForms.setWidgetFormValues=function(e,d,v,l){v=v||!1,l=void 0!==l&&l||void 0===l;var i=0,h=function(e,w){10!=++i&&e.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(e,i){var t=C(this),r=t.find("> .siteorigin-widget-field-repeater"),n=r.data("repeaterName"),a=w.hasOwnProperty(n)?w[n]:null;if(t.parent().is(".siteorigin-widget-section")){var s=r.data("element-name");s=s.replace(/\[#.*?#\]/g,"");for(var o=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(s)[1].split("]["),d=o.length?w:null;o.length;){var l=o.shift();d=d.hasOwnProperty(l)?d[l]:d}a=d}if(a&&Array.isArray(a)){var g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),f=a.length,c=g.length;if(c<f)for(var p=0;p<f-c;p++)r.find("> .siteorigin-widget-field-repeater-add").click();else if(!v&&f<c)for(var u=f;u<c;u++){C(g.eq(u)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var m=0;m<g.length;m++)g.eq(m).find("> .siteorigin-widget-field-repeater-item-form"),h(g.eq(m).find("> .siteorigin-widget-field-repeater-item-form"),a[m])}}),--i};h(e,d),e.find("*[name]").each(function(){var e=C(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(null==i)return!0;var t=(i=i[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r,n=d,a=0;a<t.length;a++){if(!n.hasOwnProperty(t[a])){if(v)return!0;break}a===t.length-1?r=n[t[a]]:n=n[t[a]]}if("checkbox"===e.attr("type"))e.prop("checked",r);else if("radio"===e.attr("type"))e.prop("checked",r===e.val());else if("TEXTAREA"===e.prop("tagName")&&e.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(e.attr("id"))),null!==s&&"function"==typeof s.setContent&&!s.isHidden()&&e.parent().is(":visible")?s.initialized?s.setContent(r):s.on("init",function(){s.setContent(r)}):e.val(r)}else if(e.is(".panels-data")){e.val(r);var o=e.data("builder");o&&o.setDataField(e)}else e.val(r);l&&e.trigger("change")})},C(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var e=C(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){e.sowSetupForm()},200)});var e=C("body");e.hasClass("wp-customizer")&&C(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e.hasClass("block-editor-page")&&C(document).on("panels_setup_preview",function(){C(sowb).trigger("setup_widgets")}),C(document).on("open_dialog",function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),C(function(){C(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return r=void 0!==t[3]?(n=t[1],t[3]):t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};window.sowbForms=sowbForms;
|
1 |
+
var sowbForms=window.sowbForms||{};!function(C){C.fn.sowSetupForm=function(){return C(this).each(function(e,i){var o,t=C(i),y=!0,r=C("body"),n=t.find("input[name]");if(n.length&&-1!==n.attr("name").indexOf("__i__"))return this;if(t.is(".siteorigin-widget-form-main")){if(!0===t.data("sow-form-setup"))return!0;if(r.hasClass("widgets-php")&&!t.is(":visible")&&0===t.closest(".panel-dialog").length)return!0;t.on("sowstatechange",function(e,h,b){t.find("[data-state-handler]").each(function(){var e,i,t,r,n,a,s=C(this),o=C.extend({},s.data("state-handler"),y?s.data("state-handler-initial"):{});if(0===Object.keys(o).length)return!0;var d={},l=sowbForms.getContainerFieldId(s,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==l){var g={};for(var f in o)g[f.replace("{$repeater}",l)]=o[f];o=g}var c=sowbForms.getContainerFieldId(s,"widget",".siteorigin-widget-widget");if(!1!==c){var p={};for(var u in o){var m=u.match(/_else\[(.*)\]|(.*)\[(.*)\]/);p[m&&m.length&&void 0===m[1]?m[2]+"_"+c+"["+m[3]+"]":"_else["+m[1]+"_"+c+"]"]=o[u]}o=p}for(var w in o)if(n=!1,null!==(e=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(i={group:"default",name:"",multi:!1},void 0!==e[2]?(i.group=e[1],i.name=e[3]):i.name=e[0],i.multi=void 0!==e[4],"_else"===i.group)i.group=i.name,i.name="",n=i.group===h&&void 0===d[i.group];else{a=i.name.split(",").map(function(e){return e.trim()});for(var v=0;v<a.length&&!(n=i.group===h&&a[v]===b);v++);}if(n){t=o[w],i.multi||(t=[t]);for(v=0;v<t.length;v++)(r=void 0!==t[v][1]&&Boolean(t[v][1])?s.find(t[v][1]):s)[t[v][0]].apply(r,void 0!==t[v][2]?t[v][2]:[]);d[i.group]=!0}}})}),t.sowSetupPreview();var a=(o=t).find(".siteorigin-widget-teaser");if(a.find(".dashicons-dismiss").click(function(){var e=C(this);C.get(e.data("dismiss-url")),a.slideUp("normal",function(){a.remove()})}),!t.data("backupDisabled")){var s=t.find("> .siteorigin-widgets-form-id").val(),d=t.find("> .siteorigin-widgets-form-timestamp"),l=parseInt(d.val()||0),g=JSON.parse(sessionStorage.getItem(s));if(g)if(g._sow_form_timestamp>l){var f=C('<div class="siteorigin-widget-form-notification"><span>'+soWidgets.backup.newerVersion+'</span><a class="button button-small so-backup-restore">'+soWidgets.backup.restore+'</a><a class="button button-small so-backup-dismiss">'+soWidgets.backup.dismiss+"</a><div><small>"+soWidgets.backup.replaceWarning+"</small></div></div>");t.prepend(f),f.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(o,g),f.slideUp("fast",function(){f.remove()})}),f.find(".so-backup-dismiss").click(function(){f.slideUp("fast",function(){sessionStorage.removeItem(s),f.remove()})})}else sessionStorage.removeItem(s);t.change(function(){d.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(t);sessionStorage.setItem(s,JSON.stringify(e))})}}else o=t.closest(".siteorigin-widget-form-main");o.find("> .siteorigin-widgets-form-id").val();var c=t.find("> .siteorigin-widget-field");c.find("> .siteorigin-widget-section").sowSetupForm();var p=c.find("> .siteorigin-widget-widget");p.find("> .siteorigin-widget-section").sowSetupForm(),p.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),c.find(".siteorigin-widget-input").each(function(e,i){null===C(i).data("original-name")&&C(i).data("original-name",C(i).attr("name"))}),c.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),t.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),c.find("> .siteorigin-widget-input-color").each(function(){var e=C(this),i={change:function(e,i){setTimeout(function(){C(e.target).trigger("change")},100)}};e.data("defaultColor")&&(i.defaultColor=e.data("defaultColor")),e.wpColorPicker(i)});var u=function(){C(this).toggleClass("siteorigin-widget-section-visible"),C(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){(C(window).resize(),C(this).find("> .siteorigin-widget-field-container-state").val(C(this).is(":visible")?"open":"closed"),C(this).is(":visible"))&&C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})};c.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(u),c.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(u),c.filter(".siteorigin-widget-field-type-slider").each(function(){var t=C(this),r=t.find('input[type="number"]'),n=t.find(".siteorigin-widget-value-slider");n.slider({max:parseFloat(r.attr("max")),min:parseFloat(r.attr("min")),step:parseFloat(r.attr("step")),value:parseFloat(r.val()),slide:function(e,i){r.val(parseFloat(i.value)),r.trigger("change")},change:function(e,i){t.find(".siteorigin-widget-slider-value").html(i.value)}}),r.change(function(e,i){i&&i.silent||n.slider("value",parseFloat(r.val()))})}),c.filter(".siteorigin-widget-field-type-link").each(function(){var n=C(this),t=function(){var e=n.find(".content-text-search"),i=e.val(),t=e.data("postTypes"),r=n.find("ul.posts").empty().addClass("loading");C.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:i,postTypes:t},function(e){for(var i=0;i<e.length;i++)""===e[i].label&&(e[i].label=" "),r.append(C("<li>").addClass("post").html(e[i].label+"<span>("+e[i].type+")</span>").data(e[i]));r.removeClass("loading")})};n.find(".select-content-button, .button-close").click(function(e){e.preventDefault(),C(this).blur();var i=n.find(".existing-content-selector");i.toggle(),i.is(":visible")&&0===i.find("ul.posts li").length&&t()}),n.on("click",".posts li",function(e){e.preventDefault();var i=C(this);n.find("input.siteorigin-widget-input").val("post: "+i.data("value")),n.change(),n.find(".existing-content-selector").toggle()});var e=null;n.find(".content-text-search").keyup(function(){null!==e&&clearTimeout(e),e=setTimeout(function(){t()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&c.filter(".siteorigin-widget-field-type-builder").each(function(){C(this).find("> .siteorigin-page-builder-field").each(function(){var e=C(this);e.soPanelsSetupBuilderWidget({builderType:e.data("type")})})});var m=function(){var a=C(this),e=a.closest("[data-state-emitter]").data("state-emitter");if(void 0!==e){var i=function(e,i){if(void 0===sowEmitters[e.callback]||"_"===e.callback.substr(0,1))return i;if(a.is('[type="radio"]')&&!a.is(":checked"))return i;var t=sowbForms.getContainerFieldId(a,"repeater",".siteorigin-widget-field-repeater-item");!1!==t&&(e.args=e.args.map(function(e){return e.replace("{$repeater}",t)}));var r=sowbForms.getContainerFieldId(a,"widget",".siteorigin-widget-widget");!1===r||e.hasOwnProperty("widgetFieldId")||(e.widgetFieldId=r,e.args=e.args.map(function(e){return e+"_"+r}));var n=a.is('[type="checkbox"]')?a.is(":checked"):a.val();return C.extend(i,sowEmitters[e.callback](n,e.args))},t={default:""};void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++)t=i(e[r],t);var n=o.data("states");for(var s in void 0===n&&(n={default:""}),t)void 0!==n[s]&&t[s]===n[s]||(n[s]=t[s],o.trigger("sowstatechange",[s,t[s]]));o.data("states",n)}};c.filter("[data-state-emitter]").each(function(){var e=C(this).find(".siteorigin-widget-input");e.on("keyup change",m),e.each(function(){var e=C(this);e.is(":radio")?e.is(":checked")&&m.call(e[0]):m.call(e[0])})}),t.trigger("sowsetupform",c).data("sow-form-setup",!0),c.trigger("sowsetupformfield"),t.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(r.hasClass("wp-customizer")||r.hasClass("widgets-php"))&&t.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),y=!1})},C.fn.sowSetupPreview=function(){var r=C(this);r.siblings(".siteorigin-widget-preview").find("> a").click(function(e){e.preventDefault();var i=sowbForms.getWidgetFormValues(r),t=C(C("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");t.find('input[name="data"]').val(JSON.stringify(i)),t.find('input[name="class"]').val(r.data("class")),t.find("iframe").on("load",function(){C(this).css("visibility","visible")}),t.find("form").submit(),t.find(".close").click(function(){t.remove()})})},C.fn.sowSetupRepeater=function(){return C(this).each(function(e,i){var n=C(i),t=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");t.bind("updateFieldPositions",function(){var e=C(this),i=e.find("> .siteorigin-widget-field-repeater-item");i.each(function(r,e){C(e).find(".siteorigin-widget-input").each(function(e,i){var t=C(i).data("repeater-positions");void 0===t&&(t={}),t[a]=r,C(i).data("repeater-positions",t)})}),e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i),r=t.data("repeater-positions");if(void 0!==r){var n=t.attr("data-original-name");if(n||(t.attr("data-original-name",t.attr("name")),n=t.attr("name")),!n)return;if(r)for(var a in r)n=n.replace("#"+a+"#",r[a]);t.attr("name",n)}}),e.data("initialSetup")||(e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i);t.prop("checked",t.prop("defaultChecked"))}),e.data("initialSetup",!0));var t=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(0<t&&i.length>t){var r=i.first().outerHeight();e.css("max-height",r*t).css("overflow","auto")}else e.css("max-height","").css("overflow","")}),t.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){t.find('input[type="radio"].siteorigin-widget-input').attr("name",""),t.trigger("updateFieldPositions"),n.trigger("change")},sortstop:function(e,i){i.item.is(".siteorigin-widget-field-repeater-item")?i.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}):i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");n.trigger("change")}}),t.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){C(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){C(window).resize()})})})},C.fn.sowAddRepeaterItem=function(){return C(this).each(function(e,i){var t=C(i),r=t.find("> .siteorigin-widget-field-repeater-items").children().length+1,n=C("<div>"+t.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");n.find(".siteorigin-widget-input[data-name]").each(function(){var e=C(this);0===e.closest(".siteorigin-widget-field-repeater-item-html").length&&e.attr("name",C(this).data("name"))});var a="";n.find("> .siteorigin-widget-field").each(function(e,i){var t=i.outerHTML;C(i).is(".siteorigin-widget-field-type-repeater")||(t=t.replace(/_id_/g,r)),a+=t});var s=void 0!==t.attr("readonly"),o=C('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(C('<div class="siteorigin-widget-field-repeater-item-top" />').append(C('<div class="siteorigin-widget-field-expand" />')).append(s?"":C('<div class="siteorigin-widget-field-copy" />')).append(s?"":C('<div class="siteorigin-widget-field-remove" />')).append(C("<h4 />").html(t.data("item-name")))).append(C('<div class="siteorigin-widget-field-repeater-item-form" />').html(a));t.find("> .siteorigin-widget-field-repeater-items").append(o).sortable("refresh").trigger("updateFieldPositions"),o.sowSetupRepeaterItems(),o.hide().slideDown("fast",function(){C(window).resize()}),t.trigger("change")})},C.fn.sowRemoveRepeaterItem=function(){return C(this).each(function(e,i){var t=C(this).closest(".siteorigin-widget-field-repeater-items");C(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(i).trigger("change")})},C.fn.sowSetupRepeaterItems=function(){return C(this).each(function(e,i){var _=C(i);if(void 0===_.data("sowrepeater-actions-setup")){var t=_.closest(".siteorigin-widget-field-repeater"),r=_.find("> .siteorigin-widget-field-repeater-item-top"),n=t.data("item-label");if(n&&n.selector){var a=function(){var e=n.hasOwnProperty("valueMethod")&&n.valueMethod?n.valueMethod:"val",i=_.find(n.selector)[e]();i&&(80<i.length&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};a();var s=n.hasOwnProperty("updateEvent")&&n.updateEvent?n.updateEvent:"change";_.bind(s,a)}r.click(function(e){"siteorigin-widget-field-remove"!==e.target.className&&"siteorigin-widget-field-copy"!==e.target.className&&(e.preventDefault(),C(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){(C(window).resize(),C(this).is(":visible"))?(C(this).trigger("slideToggleOpenComplete"),C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")):C(this).trigger("slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(e,i){e.preventDefault();var t=C(this).closest(".siteorigin-widget-field-repeater-items"),r=C(this).closest(".siteorigin-widget-field-repeater-item"),n=function(){r.remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(window).resize()};i&&i.silent?n():confirm(soWidgets.sure)&&r.slideUp("fast",n),_.trigger("change")}),r.find(".siteorigin-widget-field-copy").click(function(e){e.preventDefault();var h=C(this).closest(".siteorigin-widget-form-main"),b=C(this).closest(".siteorigin-widget-field-repeater-item"),y=b.clone(),i=b.closest(".siteorigin-widget-field-repeater-items"),F=i.children().length,k={};y.find("*[name]").each(function(){var e=C(this),i=e.attr("id"),t=e.attr("name");if(e.is("textarea")&&e.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){e.parent().empty().append(e),e.css("display","");var r=tinymce.get(i);r&&e.val(r.getContent())}else if(e.is(".wp-color-picker")){var n=e.closest(".wp-picker-container"),a=e.closest(".siteorigin-widget-field");n.remove(),a.append(e.remove())}else{var s=i?b.find("#"+i):b.find('[name="'+t+'"]');s.length&&null!=s.val()&&e.val(s.val())}if(i){var o,d;if(e.is('[type="radio"]')){o=i.replace(/-\d+-\d+$/,"");var l=i.replace(/-\d+$/,"");if(!k[o]){var g={};k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").filter(function(e,i){var t=C(i).attr("name");return!g[t]&&(g[t]=!0)}).length+1}var f=o+"-"+k[o];d=f+i.match(/-\d+$/)[0],y.find("label[for="+l+"]").attr("for",f)}else u=new RegExp("-\\d+$"),o=i.replace(u,""),k[o]||(k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").length+1),d=o+"-"+k[o]++;if(e.attr("id",d),e.is(".wp-editor-area")){var c=e.closest(".siteorigin-widget-tinymce-container"),p=c.data("media-buttons");if(p&&p.html){var u=new RegExp(i,"g");p.html=p.html.replace(u,d),c.data("media-buttons",p)}}y.find("label[for="+i+"]").attr("for",d),y.find("[id*="+i+"]").each(function(){var e=C(this).attr("id").replace(i,d);C(this).attr("id",e)}),"undefined"!=typeof tinymce&&tinymce.get(d)&&tinymce.get(d).remove()}var m=b.parents(".siteorigin-widget-field-repeater").length,w=C("body");(w.hasClass("wp-customizer")||w.hasClass("widgets-php"))&&0===_.closest(".panel-dialog").length&&(m+=1);var v=t.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+F.toString()+"$3");e.attr("name",v),e.data("original-name",v)}),i.append(y).sortable("refresh").trigger("updateFieldPositions"),y.sowSetupRepeaterItems(),y.hide().slideDown("fast",function(){C(window).resize()}),_.trigger("change")}),_.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),_.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?C.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(e){if(_.isUndefined(e))return null;var l={};return e.find("*[name]").each(function(){var i=C(this);try{var e=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(e))return!0;var t=(e=e[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var r=l,n=null,a=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===a)n=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===a){if(!i.is(":checked"))return;n=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(i.attr("id"))),n=null===s||"function"!=typeof s.getContent||s.isHidden()?i.val():s.getContent()}else if("SELECT"===i.prop("tagName")){var o=i.find("option:selected");1===o.length?n=i.find("option:selected").val():1<o.length&&(n=_.map(i.find("option:selected"),function(e,i){return C(e).val()}))}else n=i.val();for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?r.push(n):r[t[d]]=n:(_.isUndefined(r[t[d]])&&(_.isNumber(t[d+1])||""===t[d+1]?r[t[d]]=[]:r[t[d]]={}),r=r[t[d]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),l},sowbForms.setWidgetFormValues=function(e,d,v,l){v=v||!1,l=void 0!==l&&l||void 0===l;var i=0,h=function(e,w){10!=++i&&e.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(e,i){var t=C(this),r=t.find("> .siteorigin-widget-field-repeater"),n=r.data("repeaterName"),a=w.hasOwnProperty(n)?w[n]:null;if(t.parent().is(".siteorigin-widget-section")){var s=r.data("element-name");s=s.replace(/\[#.*?#\]/g,"");for(var o=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(s)[1].split("]["),d=o.length?w:null;o.length;){var l=o.shift();d=d.hasOwnProperty(l)?d[l]:d}a=d}if(a&&Array.isArray(a)){var g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),f=a.length,c=g.length;if(c<f)for(var p=0;p<f-c;p++)r.find("> .siteorigin-widget-field-repeater-add").click();else if(!v&&f<c)for(var u=f;u<c;u++){C(g.eq(u)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var m=0;m<g.length;m++)g.eq(m).find("> .siteorigin-widget-field-repeater-item-form"),h(g.eq(m).find("> .siteorigin-widget-field-repeater-item-form"),a[m])}}),--i};h(e,d),e.find("*[name]").each(function(){var e=C(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(null==i)return!0;var t=(i=i[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r,n=d,a=0;a<t.length;a++){if(!n.hasOwnProperty(t[a])){if(v)return!0;break}a===t.length-1?r=n[t[a]]:n=n[t[a]]}if("checkbox"===e.attr("type"))e.prop("checked",r);else if("radio"===e.attr("type"))e.prop("checked",r===e.val());else if("TEXTAREA"===e.prop("tagName")&&e.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(e.attr("id"))),null!==s&&"function"==typeof s.setContent&&!s.isHidden()&&e.parent().is(":visible")?s.initialized?s.setContent(r):s.on("init",function(){s.setContent(r)}):e.val(r)}else if(e.is(".panels-data")){e.val(r);var o=e.data("builder");o&&o.setDataField(e)}else e.val(r);l&&e.trigger("change")})},C(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var e=C(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){e.sowSetupForm()},200)});var e=C("body");e.hasClass("wp-customizer")&&C(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e.hasClass("block-editor-page")&&C(document).on("panels_setup_preview",function(){C(sowb).trigger("setup_widgets",{preview:!0})}),C(document).on("open_dialog",function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),C(function(){C(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return r=void 0!==t[3]?(n=t[1],t[3]):t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};window.sowbForms=sowbForms;
|
base/less/mixins.less
CHANGED
@@ -1,194 +1,194 @@
|
|
1 |
-
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
|
2 |
-
background: @color;
|
3 |
-
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, @start), color-stop(1, @stop));
|
4 |
-
background: -ms-linear-gradient(bottom,@start,@stop);
|
5 |
-
background: -moz-linear-gradient(center bottom,@start 0%,@stop 100%);
|
6 |
-
background: -o-linear-gradient(@stop,@start);
|
7 |
-
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", @stop, @start));
|
8 |
-
}
|
9 |
-
|
10 |
-
.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
|
11 |
-
background: @color;
|
12 |
-
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop)));
|
13 |
-
background: -ms-linear-gradient(bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
|
14 |
-
background: -moz-linear-gradient(center bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
|
15 |
-
background: -o-linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
|
16 |
-
background: linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
|
17 |
-
|
18 |
-
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop), rgb(@start,@start,@start)));
|
19 |
-
}
|
20 |
-
|
21 |
-
.linear-gradient(@color, @gradient) {
|
22 |
-
background: @color;
|
23 |
-
background: -moz-linear-gradient(@gradient);
|
24 |
-
background: -webkit-linear-gradient(@gradient);
|
25 |
-
background: -o-linear-gradient(@gradient);
|
26 |
-
background: -ms-linear-gradient(@gradient);
|
27 |
-
background: linear-gradient(@gradient);
|
28 |
-
}
|
29 |
-
|
30 |
-
.bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
|
31 |
-
border-top: solid 1px @top-color;
|
32 |
-
border-left: solid 1px @left-color;
|
33 |
-
border-right: solid 1px @right-color;
|
34 |
-
border-bottom: solid 1px @bottom-color;
|
35 |
-
}
|
36 |
-
|
37 |
-
.drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
|
38 |
-
-webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
39 |
-
-moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
40 |
-
box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
41 |
-
}
|
42 |
-
|
43 |
-
.box-shadow(@shadow) {
|
44 |
-
-webkit-box-shadow: @shadow;
|
45 |
-
-moz-box-shadow: @shadow;
|
46 |
-
box-shadow: @shadow;
|
47 |
-
}
|
48 |
-
|
49 |
-
.rounded(@radius: 2px) {
|
50 |
-
-webkit-border-radius: @radius;
|
51 |
-
-moz-border-radius: @radius;
|
52 |
-
border-radius: @radius;
|
53 |
-
}
|
54 |
-
|
55 |
-
.border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
|
56 |
-
-webkit-border-top-right-radius: @topright;
|
57 |
-
-webkit-border-bottom-right-radius: @bottomright;
|
58 |
-
-webkit-border-bottom-left-radius: @bottomleft;
|
59 |
-
-webkit-border-top-left-radius: @topleft;
|
60 |
-
-moz-border-radius-topright: @topright;
|
61 |
-
-moz-border-radius-bottomright: @bottomright;
|
62 |
-
-moz-border-radius-bottomleft: @bottomleft;
|
63 |
-
-moz-border-radius-topleft: @topleft;
|
64 |
-
border-top-right-radius: @topright;
|
65 |
-
border-bottom-right-radius: @bottomright;
|
66 |
-
border-bottom-left-radius: @bottomleft;
|
67 |
-
border-top-left-radius: @topleft;
|
68 |
-
.background-clip(padding-box);
|
69 |
-
}
|
70 |
-
|
71 |
-
.opacity(@opacity: 0.5) {
|
72 |
-
-moz-opacity: @opacity;
|
73 |
-
-khtml-opacity: @opacity;
|
74 |
-
-webkit-opacity: @opacity;
|
75 |
-
opacity: @opacity;
|
76 |
-
@opperc: @opacity * 100;
|
77 |
-
-ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})";
|
78 |
-
filter: ~"alpha(opacity=@{opperc})";
|
79 |
-
}
|
80 |
-
|
81 |
-
.transition-duration(@duration: 0.2s) {
|
82 |
-
-moz-transition-duration: @duration;
|
83 |
-
-webkit-transition-duration: @duration;
|
84 |
-
-o-transition-duration: @duration;
|
85 |
-
transition-duration: @duration;
|
86 |
-
}
|
87 |
-
|
88 |
-
.transform(...) {
|
89 |
-
-webkit-transform: @arguments;
|
90 |
-
-moz-transform: @arguments;
|
91 |
-
-o-transform: @arguments;
|
92 |
-
-ms-transform: @arguments;
|
93 |
-
transform: @arguments;
|
94 |
-
}
|
95 |
-
|
96 |
-
.rotation(@deg:5deg) {
|
97 |
-
.transform(rotate(@deg));
|
98 |
-
}
|
99 |
-
|
100 |
-
.scale(@ratio:1.5) {
|
101 |
-
.transform(scale(@ratio));
|
102 |
-
}
|
103 |
-
|
104 |
-
.transition(@duration:0.2s, @on: all, @ease:ease) {
|
105 |
-
-webkit-transition: @on @duration @ease;
|
106 |
-
-moz-transition: @on @duration @ease;
|
107 |
-
-o-transition: @on @duration @ease;
|
108 |
-
transition: @on @duration @ease;
|
109 |
-
}
|
110 |
-
|
111 |
-
.inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
|
112 |
-
-webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
|
113 |
-
-moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
|
114 |
-
box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
|
115 |
-
}
|
116 |
-
|
117 |
-
.box-sizing(@sizing: border-box) {
|
118 |
-
-ms-box-sizing: @sizing;
|
119 |
-
-moz-box-sizing: @sizing;
|
120 |
-
-webkit-box-sizing: @sizing;
|
121 |
-
box-sizing: @sizing;
|
122 |
-
}
|
123 |
-
|
124 |
-
.user-select(@argument: none) {
|
125 |
-
-webkit-user-select: @argument;
|
126 |
-
-moz-user-select: @argument;
|
127 |
-
-ms-user-select: @argument;
|
128 |
-
user-select: @argument;
|
129 |
-
}
|
130 |
-
|
131 |
-
.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
|
132 |
-
-moz-column-width: @colwidth;
|
133 |
-
-moz-column-count: @colcount;
|
134 |
-
-moz-column-gap: @colgap;
|
135 |
-
-moz-column-rule-color: @columnRuleColor;
|
136 |
-
-moz-column-rule-style: @columnRuleStyle;
|
137 |
-
-moz-column-rule-width: @columnRuleWidth;
|
138 |
-
-webkit-column-width: @colwidth;
|
139 |
-
-webkit-column-count: @colcount;
|
140 |
-
-webkit-column-gap: @colgap;
|
141 |
-
-webkit-column-rule-color: @columnRuleColor;
|
142 |
-
-webkit-column-rule-style: @columnRuleStyle;
|
143 |
-
-webkit-column-rule-width: @columnRuleWidth;
|
144 |
-
column-width: @colwidth;
|
145 |
-
column-count: @colcount;
|
146 |
-
column-gap: @colgap;
|
147 |
-
column-rule-color: @columnRuleColor;
|
148 |
-
column-rule-style: @columnRuleStyle;
|
149 |
-
column-rule-width: @columnRuleWidth;
|
150 |
-
}
|
151 |
-
|
152 |
-
.translate(@x:0, @y:0) {
|
153 |
-
.transform(translate(@x, @y));
|
154 |
-
}
|
155 |
-
|
156 |
-
.background-clip(@argument: padding-box) {
|
157 |
-
-moz-background-clip: @argument;
|
158 |
-
-webkit-background-clip: @argument;
|
159 |
-
background-clip: @argument;
|
160 |
-
}
|
161 |
-
|
162 |
-
.clearfix() {
|
163 |
-
zoom: 1;
|
164 |
-
&:before {
|
165 |
-
content: '';
|
166 |
-
display: block;
|
167 |
-
}
|
168 |
-
&:after {
|
169 |
-
content: '';
|
170 |
-
display: table;
|
171 |
-
clear: both;
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
.button-style(@base_color, @bg_var: 3.5%, @border_darken: 18%, @border_var: 4%) {
|
176 |
-
@gradient_start: darken(@base_color, @bg_var);
|
177 |
-
@gradient_end: lighten(@base_color, @bg_var);
|
178 |
-
|
179 |
-
@border_color: darken(@base_color, @border_darken);
|
180 |
-
|
181 |
-
@border_top: lighten(@border_color, @border_var );
|
182 |
-
@border_bottom: darken(@border_color, @border_var );
|
183 |
-
|
184 |
-
.gradient(@base_color, @gradient_start, @gradient_end);
|
185 |
-
.bordered(@border_top, @border_color, @border_bottom, @border_color);
|
186 |
-
}
|
187 |
-
|
188 |
-
.font(@font, @weight) when not (@font = default) {
|
189 |
-
font-family: @font;
|
190 |
-
font-weight: @weight;
|
191 |
-
}
|
192 |
-
|
193 |
-
//this is to remove annoying IDE warnings for not being able to resolve .widget-function() calls
|
194 |
Â
.widget-function(...){}
|
1 |
+
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
|
2 |
+
background: @color;
|
3 |
+
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, @start), color-stop(1, @stop));
|
4 |
+
background: -ms-linear-gradient(bottom,@start,@stop);
|
5 |
+
background: -moz-linear-gradient(center bottom,@start 0%,@stop 100%);
|
6 |
+
background: -o-linear-gradient(@stop,@start);
|
7 |
+
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", @stop, @start));
|
8 |
+
}
|
9 |
+
|
10 |
+
.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
|
11 |
+
background: @color;
|
12 |
+
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop)));
|
13 |
+
background: -ms-linear-gradient(bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
|
14 |
+
background: -moz-linear-gradient(center bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
|
15 |
+
background: -o-linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
|
16 |
+
background: linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
|
17 |
+
|
18 |
+
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop), rgb(@start,@start,@start)));
|
19 |
+
}
|
20 |
+
|
21 |
+
.linear-gradient(@color, @gradient) {
|
22 |
+
background: @color;
|
23 |
+
background: -moz-linear-gradient(@gradient);
|
24 |
+
background: -webkit-linear-gradient(@gradient);
|
25 |
+
background: -o-linear-gradient(@gradient);
|
26 |
+
background: -ms-linear-gradient(@gradient);
|
27 |
+
background: linear-gradient(@gradient);
|
28 |
+
}
|
29 |
+
|
30 |
+
.bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
|
31 |
+
border-top: solid 1px @top-color;
|
32 |
+
border-left: solid 1px @left-color;
|
33 |
+
border-right: solid 1px @right-color;
|
34 |
+
border-bottom: solid 1px @bottom-color;
|
35 |
+
}
|
36 |
+
|
37 |
+
.drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
|
38 |
+
-webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
39 |
+
-moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
40 |
+
box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
41 |
+
}
|
42 |
+
|
43 |
+
.box-shadow(@shadow) {
|
44 |
+
-webkit-box-shadow: @shadow;
|
45 |
+
-moz-box-shadow: @shadow;
|
46 |
+
box-shadow: @shadow;
|
47 |
+
}
|
48 |
+
|
49 |
+
.rounded(@radius: 2px) {
|
50 |
+
-webkit-border-radius: @radius;
|
51 |
+
-moz-border-radius: @radius;
|
52 |
+
border-radius: @radius;
|
53 |
+
}
|
54 |
+
|
55 |
+
.border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
|
56 |
+
-webkit-border-top-right-radius: @topright;
|
57 |
+
-webkit-border-bottom-right-radius: @bottomright;
|
58 |
+
-webkit-border-bottom-left-radius: @bottomleft;
|
59 |
+
-webkit-border-top-left-radius: @topleft;
|
60 |
+
-moz-border-radius-topright: @topright;
|
61 |
+
-moz-border-radius-bottomright: @bottomright;
|
62 |
+
-moz-border-radius-bottomleft: @bottomleft;
|
63 |
+
-moz-border-radius-topleft: @topleft;
|
64 |
+
border-top-right-radius: @topright;
|
65 |
+
border-bottom-right-radius: @bottomright;
|
66 |
+
border-bottom-left-radius: @bottomleft;
|
67 |
+
border-top-left-radius: @topleft;
|
68 |
+
.background-clip(padding-box);
|
69 |
+
}
|
70 |
+
|
71 |
+
.opacity(@opacity: 0.5) {
|
72 |
+
-moz-opacity: @opacity;
|
73 |
+
-khtml-opacity: @opacity;
|
74 |
+
-webkit-opacity: @opacity;
|
75 |
+
opacity: @opacity;
|
76 |
+
@opperc: @opacity * 100;
|
77 |
+
-ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})";
|
78 |
+
filter: ~"alpha(opacity=@{opperc})";
|
79 |
+
}
|
80 |
+
|
81 |
+
.transition-duration(@duration: 0.2s) {
|
82 |
+
-moz-transition-duration: @duration;
|
83 |
+
-webkit-transition-duration: @duration;
|
84 |
+
-o-transition-duration: @duration;
|
85 |
+
transition-duration: @duration;
|
86 |
+
}
|
87 |
+
|
88 |
+
.transform(...) {
|
89 |
+
-webkit-transform: @arguments;
|
90 |
+
-moz-transform: @arguments;
|
91 |
+
-o-transform: @arguments;
|
92 |
+
-ms-transform: @arguments;
|
93 |
+
transform: @arguments;
|
94 |
+
}
|
95 |
+
|
96 |
+
.rotation(@deg:5deg) {
|
97 |
+
.transform(rotate(@deg));
|
98 |
+
}
|
99 |
+
|
100 |
+
.scale(@ratio:1.5) {
|
101 |
+
.transform(scale(@ratio));
|
102 |
+
}
|
103 |
+
|
104 |
+
.transition(@duration:0.2s, @on: all, @ease:ease) {
|
105 |
+
-webkit-transition: @on @duration @ease;
|
106 |
+
-moz-transition: @on @duration @ease;
|
107 |
+
-o-transition: @on @duration @ease;
|
108 |
+
transition: @on @duration @ease;
|
109 |
+
}
|
110 |
+
|
111 |
+
.inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
|
112 |
+
-webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
|
113 |
+
-moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
|
114 |
+
box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
|
115 |
+
}
|
116 |
+
|
117 |
+
.box-sizing(@sizing: border-box) {
|
118 |
+
-ms-box-sizing: @sizing;
|
119 |
+
-moz-box-sizing: @sizing;
|
120 |
+
-webkit-box-sizing: @sizing;
|
121 |
+
box-sizing: @sizing;
|
122 |
+
}
|
123 |
+
|
124 |
+
.user-select(@argument: none) {
|
125 |
+
-webkit-user-select: @argument;
|
126 |
+
-moz-user-select: @argument;
|
127 |
+
-ms-user-select: @argument;
|
128 |
+
user-select: @argument;
|
129 |
+
}
|
130 |
+
|
131 |
+
.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
|
132 |
+
-moz-column-width: @colwidth;
|
133 |
+
-moz-column-count: @colcount;
|
134 |
+
-moz-column-gap: @colgap;
|
135 |
+
-moz-column-rule-color: @columnRuleColor;
|
136 |
+
-moz-column-rule-style: @columnRuleStyle;
|
137 |
+
-moz-column-rule-width: @columnRuleWidth;
|
138 |
+
-webkit-column-width: @colwidth;
|
139 |
+
-webkit-column-count: @colcount;
|
140 |
+
-webkit-column-gap: @colgap;
|
141 |
+
-webkit-column-rule-color: @columnRuleColor;
|
142 |
+
-webkit-column-rule-style: @columnRuleStyle;
|
143 |
+
-webkit-column-rule-width: @columnRuleWidth;
|
144 |
+
column-width: @colwidth;
|
145 |
+
column-count: @colcount;
|
146 |
+
column-gap: @colgap;
|
147 |
+
column-rule-color: @columnRuleColor;
|
148 |
+
column-rule-style: @columnRuleStyle;
|
149 |
+
column-rule-width: @columnRuleWidth;
|
150 |
+
}
|
151 |
+
|
152 |
+
.translate(@x:0, @y:0) {
|
153 |
+
.transform(translate(@x, @y));
|
154 |
+
}
|
155 |
+
|
156 |
+
.background-clip(@argument: padding-box) {
|
157 |
+
-moz-background-clip: @argument;
|
158 |
+
-webkit-background-clip: @argument;
|
159 |
+
background-clip: @argument;
|
160 |
+
}
|
161 |
+
|
162 |
+
.clearfix() {
|
163 |
+
zoom: 1;
|
164 |
+
&:before {
|
165 |
+
content: '';
|
166 |
+
display: block;
|
167 |
+
}
|
168 |
+
&:after {
|
169 |
+
content: '';
|
170 |
+
display: table;
|
171 |
+
clear: both;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
|
175 |
+
.button-style(@base_color, @bg_var: 3.5%, @border_darken: 18%, @border_var: 4%) {
|
176 |
+
@gradient_start: darken(@base_color, @bg_var);
|
177 |
+
@gradient_end: lighten(@base_color, @bg_var);
|
178 |
+
|
179 |
+
@border_color: darken(@base_color, @border_darken);
|
180 |
+
|
181 |
+
@border_top: lighten(@border_color, @border_var );
|
182 |
+
@border_bottom: darken(@border_color, @border_var );
|
183 |
+
|
184 |
+
.gradient(@base_color, @gradient_start, @gradient_end);
|
185 |
+
.bordered(@border_top, @border_color, @border_bottom, @border_color);
|
186 |
+
}
|
187 |
+
|
188 |
+
.font(@font, @weight) when not (@font = default) {
|
189 |
+
font-family: @font;
|
190 |
+
font-weight: @weight;
|
191 |
+
}
|
192 |
+
|
193 |
+
//this is to remove annoying IDE warnings for not being able to resolve .widget-function() calls
|
194 |
Â
.widget-function(...){}
|
base/siteorigin-widget.class.php
CHANGED
@@ -746,6 +746,9 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
746 |
Â
$upload_dir['basedir'] . '/siteorigin-widgets/' . $name,
|
747 |
Â
$css
|
748 |
Â
);
|
Â
|
|
Â
|
|
Â
|
|
749 |
Â
}
|
750 |
Â
}
|
751 |
Â
|
@@ -781,6 +784,9 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
781 |
Â
//Reindex array
|
782 |
Â
$this->generated_css = array_values( $this->generated_css );
|
783 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
784 |
Â
}
|
785 |
Â
}
|
786 |
Â
|
@@ -850,7 +856,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
850 |
Â
$less = preg_replace_callback( '/\.widget-function\((.*)\);/', array( $this, 'less_widget_inject' ), $less );
|
851 |
Â
|
852 |
Â
//handle less @import statements
|
853 |
-
$less = preg_replace_callback( '/^@import\s+".*?\/?([\w
|
854 |
Â
|
855 |
Â
$vars = apply_filters( 'siteorigin_widgets_less_variables_' . $this->id_base, $this->get_less_variables( $instance ), $instance, $this );
|
856 |
Â
if( !empty( $vars ) ){
|
746 |
Â
$upload_dir['basedir'] . '/siteorigin-widgets/' . $name,
|
747 |
Â
$css
|
748 |
Â
);
|
749 |
+
|
750 |
+
// Alert other plugins that we've added a new CSS file
|
751 |
+
do_action( 'siteorigin_widgets_stylesheet_added', $name, $instance );
|
752 |
Â
}
|
753 |
Â
}
|
754 |
Â
|
784 |
Â
//Reindex array
|
785 |
Â
$this->generated_css = array_values( $this->generated_css );
|
786 |
Â
}
|
787 |
+
|
788 |
+
// Alert other plugins that we've deleted a CSS file
|
789 |
+
do_action( 'siteorigin_widgets_stylesheet_deleted', $name, $instance );
|
790 |
Â
}
|
791 |
Â
}
|
792 |
Â
|
856 |
Â
$less = preg_replace_callback( '/\.widget-function\((.*)\);/', array( $this, 'less_widget_inject' ), $less );
|
857 |
Â
|
858 |
Â
//handle less @import statements
|
859 |
+
$less = preg_replace_callback( '/^@import\s+".*?\/?([\w\-\.]+)";/m', array( $this, 'get_less_import_contents' ), $less );
|
860 |
Â
|
861 |
Â
$vars = apply_filters( 'siteorigin_widgets_less_variables_' . $this->id_base, $this->get_less_variables( $instance ), $instance, $this );
|
862 |
Â
if( !empty( $vars ) ){
|
compat/beaver-builder/sowb-beaver-builder.js
CHANGED
@@ -125,7 +125,7 @@ var sowb = window.sowb || {};
|
|
125 |
Â
// To ensure necessary scripts are executed again when settings are changed
|
126 |
Â
$( document ).on( 'fl-builder.preview-rendered fl-builder.layout-rendered', '.fl-builder-content', function() {
|
127 |
Â
// Trigger Widgets Bundle widgets to setup
|
128 |
-
$( sowb ).trigger( 'setup_widgets' );
|
129 |
Â
} );
|
130 |
Â
|
131 |
Â
})(jQuery);
|
125 |
Â
// To ensure necessary scripts are executed again when settings are changed
|
126 |
Â
$( document ).on( 'fl-builder.preview-rendered fl-builder.layout-rendered', '.fl-builder-content', function() {
|
127 |
Â
// Trigger Widgets Bundle widgets to setup
|
128 |
+
$( sowb ).trigger( 'setup_widgets', { preview: true } );
|
129 |
Â
} );
|
130 |
Â
|
131 |
Â
})(jQuery);
|
compat/beaver-builder/sowb-beaver-builder.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowb=window.sowb||{};!function(c){"undefined"!=typeof FLBuilder&&(sowb.orig_FLBuilder_initJQueryReadyFix=FLBuilder._initJQueryReadyFix,FLBuilder._initJQueryReadyFix=function(){},sowb.orig_FLBuilder_getSettings=FLBuilder._getSettings,FLBuilder._getSettings=function(e){FLBuilder._updateEditorFields();var i=e.serializeArray(),r=0,t=0,n="",l="",d="",o=[],u=[],s={};for(r=0;r<i.length;r++)if(n=i[r].value.replace(/\r/gm,""),!(-1<i[r].name.indexOf("flrich")))if(-1<i[r].name.indexOf("[")){for(l=i[r].name.replace(/\[(.*)\]/,""),o=[],u=(d=i[r].name.replace(l,"")).match(/\[[^\]]*\]/g),t=0;t<u.length;t++)"[]"!==u[t]&&o.push(u[t].replace(/\[|\]/g,""));var a=function(e,i,r,t){0===t.length?e[r]=i:(void 0===e[r]&&(e[r]={}),a(e[r],i,t.shift(),t))};if(0<o.length){var g=o.slice();void 0===s[l]&&(s[l]={}),a(s[l],n,g.shift(),g)}else void 0===s[l]&&(s[l]=[]),s[l].push(n)}else s[i[r].name]=n;for(d in s)if(void 0!==s["as_values_"+d]){s[d]=c.grep(s["as_values_"+d].split(","),function(e){return""!==e}).join(",");try{delete s["as_values_"+d]}catch(e){}}"function"==typeof FLBuilder._getOriginalSettings&&(s=c.extend({},FLBuilder._getOriginalSettings(e),s));var f=e.find(".siteorigin-widget-form");return f.length&&(s[l]=sowbForms.getWidgetFormValues(f)),s}),c(document).on("fl-builder.preview-rendered fl-builder.layout-rendered",".fl-builder-content",function(){c(sowb).trigger("setup_widgets")})}(jQuery),window.sowb=sowb;
|
1 |
+
var sowb=window.sowb||{};!function(c){"undefined"!=typeof FLBuilder&&(sowb.orig_FLBuilder_initJQueryReadyFix=FLBuilder._initJQueryReadyFix,FLBuilder._initJQueryReadyFix=function(){},sowb.orig_FLBuilder_getSettings=FLBuilder._getSettings,FLBuilder._getSettings=function(e){FLBuilder._updateEditorFields();var i=e.serializeArray(),r=0,t=0,n="",l="",d="",o=[],u=[],s={};for(r=0;r<i.length;r++)if(n=i[r].value.replace(/\r/gm,""),!(-1<i[r].name.indexOf("flrich")))if(-1<i[r].name.indexOf("[")){for(l=i[r].name.replace(/\[(.*)\]/,""),o=[],u=(d=i[r].name.replace(l,"")).match(/\[[^\]]*\]/g),t=0;t<u.length;t++)"[]"!==u[t]&&o.push(u[t].replace(/\[|\]/g,""));var a=function(e,i,r,t){0===t.length?e[r]=i:(void 0===e[r]&&(e[r]={}),a(e[r],i,t.shift(),t))};if(0<o.length){var g=o.slice();void 0===s[l]&&(s[l]={}),a(s[l],n,g.shift(),g)}else void 0===s[l]&&(s[l]=[]),s[l].push(n)}else s[i[r].name]=n;for(d in s)if(void 0!==s["as_values_"+d]){s[d]=c.grep(s["as_values_"+d].split(","),function(e){return""!==e}).join(",");try{delete s["as_values_"+d]}catch(e){}}"function"==typeof FLBuilder._getOriginalSettings&&(s=c.extend({},FLBuilder._getOriginalSettings(e),s));var f=e.find(".siteorigin-widget-form");return f.length&&(s[l]=sowbForms.getWidgetFormValues(f)),s}),c(document).on("fl-builder.preview-rendered fl-builder.layout-rendered",".fl-builder-content",function(){c(sowb).trigger("setup_widgets",{preview:!0})})}(jQuery),window.sowb=sowb;
|
compat/block-editor/widget-block.js
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
Â
var __ = i18n.__;
|
13 |
Â
|
14 |
Â
registerBlockType( 'sowb/widget-block', {
|
15 |
-
title: __( 'SiteOrigin Widget
|
16 |
Â
|
17 |
Â
description: __( 'Select a SiteOrigin widget from the dropdown.', 'so-widgets-bundle' ),
|
18 |
Â
|
@@ -27,6 +27,13 @@
|
|
27 |
Â
|
28 |
Â
category: 'widgets',
|
29 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
30 |
Â
supports: {
|
31 |
Â
html: false,
|
32 |
Â
},
|
@@ -105,7 +112,7 @@
|
|
105 |
Â
|
106 |
Â
function setupWidgetPreview() {
|
107 |
Â
if ( ! props.previewInitialized ) {
|
108 |
-
$( window.sowb ).trigger( 'setup_widgets' );
|
109 |
Â
props.setState( { previewInitialized: true } );
|
110 |
Â
}
|
111 |
Â
}
|
12 |
Â
var __ = i18n.__;
|
13 |
Â
|
14 |
Â
registerBlockType( 'sowb/widget-block', {
|
15 |
+
title: __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
|
16 |
Â
|
17 |
Â
description: __( 'Select a SiteOrigin widget from the dropdown.', 'so-widgets-bundle' ),
|
18 |
Â
|
27 |
Â
|
28 |
Â
category: 'widgets',
|
29 |
Â
|
30 |
+
keywords: [_.reduce( sowbBlockEditorAdmin.widgets, function ( keywords, widgetObj ) {
|
31 |
+
if ( !_.isEmpty( keywords ) ) {
|
32 |
+
keywords += ',';
|
33 |
+
}
|
34 |
+
return keywords + widgetObj.name;
|
35 |
+
}, '' )],
|
36 |
+
|
37 |
Â
supports: {
|
38 |
Â
html: false,
|
39 |
Â
},
|
112 |
Â
|
113 |
Â
function setupWidgetPreview() {
|
114 |
Â
if ( ! props.previewInitialized ) {
|
115 |
+
$( window.sowb ).trigger( 'setup_widgets', { preview: true } );
|
116 |
Â
props.setState( { previewInitialized: true } );
|
117 |
Â
}
|
118 |
Â
}
|
compat/block-editor/widget-block.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t,i,n,o,s){var
|
1 |
+
!function(e,t,i,n,o,s){var r=n.createElement,d=t.registerBlockType,a=e.BlockControls,l=o.SelectControl,w=s.withState,g=o.Toolbar,c=o.IconButton,u=o.Placeholder,m=o.Spinner,b=i.__;d("sowb/widget-block",{title:b("SiteOrigin Widget","so-widgets-bundle"),description:b("Select a SiteOrigin widget from the dropdown.","so-widgets-bundle"),icon:function(){return r("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",keywords:[_.reduce(sowbBlockEditorAdmin.widgets,function(e,t){return _.isEmpty(e)||(e+=","),e+t.name},"")],supports:{html:!1},attributes:{widgetClass:{type:"string"},widgetData:{type:"object"}},edit:w({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})(function(i){function n(){i.setState({editing:!1,previewInitialized:!1})}if(i.editing||!i.attributes.widgetClass){var e=[];sowbBlockEditorAdmin.widgets&&(sowbBlockEditorAdmin.widgets.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),(e=sowbBlockEditorAdmin.widgets.map(function(e){return{value:e.class,label:e.name}})).unshift({value:"",label:b("Select widget type","so-widgets-bundle")}));var t=i.attributes.widgetClass&&!i.widgetFormHtml;t&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass}}).then(function(e){i.setState({widgetFormHtml:e})});var o=i.widgetFormHtml?i.widgetFormHtml:"";return[!!o&&r(a,{key:"controls"},r(g,null,r(c,{className:"components-icon-button components-toolbar__control",label:b("Preview widget.","so-widgets-bundle"),onClick:n,icon:"visibility"}))),r(u,{key:"placeholder",className:"so-widget-placeholder",label:b("SiteOrigin Widget","so-widgets-bundle"),instructions:b("Select the type of widget you want to use:","so-widgets-bundle")},i.loadingWidgets||t?r(m):r("div",{className:"so-widget-block-container"},r(l,{options:e,value:i.attributes.widgetClass,onChange:function(e){if(""!==e){if(i.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;i.setAttributes({widgetClass:e,widgetData:null}),i.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}}}),r("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:o},ref:function(e){var t=$(e).find(".siteorigin-widget-form-main");0<t.length&&!i.formInitialized&&(t.siblings(".siteorigin-widget-preview").find("> a").on("click",function(e){e.stopImmediatePropagation(),n()}),t.data("backupDisabled",!0),t.sowSetupForm(),i.attributes.widgetData?sowbForms.setWidgetFormValues(t,i.attributes.widgetData):i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),t.on("change",function(){i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),i.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1})}),i.setState({formInitialized:!0}))}})))]}var s=!i.loadingWidgets&&!i.editing&&!i.widgetPreviewHtml&&i.attributes.widgetClass;s&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass,widgetData:i.attributes.widgetData||{}}}).then(function(e){i.setState({widgetPreviewHtml:e,previewInitialized:!1})});var d=i.widgetPreviewHtml?i.widgetPreviewHtml:"";return[r(a,{key:"controls"},r(g,null,r(c,{className:"components-icon-button components-toolbar__control",label:b("Edit widget.","so-widgets-bundle"),onClick:function(){i.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),r("div",{key:"preview",className:"so-widget-preview-container"},s?r("div",{className:"so-widgets-spinner-container"},r("span",null,r(m))):r("div",{dangerouslySetInnerHTML:{__html:d},ref:function(){i.previewInitialized||($(window.sowb).trigger("setup_widgets",{preview:!0}),i.setState({previewInitialized:!0}))}}))]}),save:function(){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose);
|
compat/elementor/elementor.php
CHANGED
@@ -18,8 +18,8 @@ class SiteOrigin_Widgets_Bundle_Elementor {
|
|
18 |
Â
function __construct() {
|
19 |
Â
add_action( 'admin_action_elementor', array( $this, 'init_editor' ) );
|
20 |
Â
add_action( 'template_redirect', array( $this, 'init_preview' ) );
|
21 |
-
|
22 |
-
|
23 |
Â
add_action( 'wp_ajax_elementor_editor_get_wp_widget_form', array( $this, 'ajax_render_widget_form' ) );
|
24 |
Â
}
|
25 |
Â
|
@@ -31,51 +31,23 @@ class SiteOrigin_Widgets_Bundle_Elementor {
|
|
31 |
Â
$this->plugin = Elementor\Plugin::instance();
|
32 |
Â
if ( !empty( $this->plugin->preview ) && method_exists( $this->plugin->preview, 'is_preview_mode' ) && $this->plugin->preview->is_preview_mode() ) {
|
33 |
Â
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
|
34 |
-
add_action( 'elementor/preview/enqueue_styles', array( $this, '
|
35 |
Â
}
|
36 |
Â
}
|
37 |
Â
|
38 |
Â
function enqueue_frontend_scripts() {
|
39 |
-
|
40 |
-
$
|
41 |
-
|
42 |
-
if( defined( 'Elementor\\DB::STATUS_DRAFT' ) && ! empty( $this->plugin->db ) && method_exists( $this->plugin->db, 'get_builder' ) ) {
|
43 |
-
// This is necessary to ensure styles and scripts are enqueued. Not sure why this is enough, but I assume
|
44 |
-
// Elementor is calling widgets' `widget` method with instance data in the process of retrieving editor data.
|
45 |
-
$this->plugin->db->get_builder( $post_id, Elementor\DB::STATUS_DRAFT );
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
function enqueue_preview_scripts() {
|
50 |
-
|
51 |
-
global $wp_widget_factory;
|
52 |
-
|
53 |
-
foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
|
54 |
-
if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
|
55 |
-
/* @var $widget_obj SiteOrigin_Widget */
|
56 |
-
ob_start();
|
57 |
-
$widget_obj->widget( array(), array() );
|
58 |
-
ob_clean();
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
Â
}
|
63 |
Â
|
64 |
Â
function enqueue_active_widgets_scripts() {
|
65 |
Â
|
66 |
Â
add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
|
72 |
-
if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
|
73 |
-
/* @var $widget_obj SiteOrigin_Widget */
|
74 |
-
ob_start();
|
75 |
-
$widget_obj->form( array() );
|
76 |
-
ob_clean();
|
77 |
-
}
|
78 |
-
}
|
79 |
Â
|
80 |
Â
wp_enqueue_style( 'sowb-styles-for-elementor', plugin_dir_url( __FILE__ ) . 'styles.css' );
|
81 |
Â
|
@@ -99,8 +71,12 @@ class SiteOrigin_Widgets_Bundle_Elementor {
|
|
99 |
Â
}
|
100 |
Â
}
|
101 |
Â
|
102 |
-
function
|
103 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
104 |
Â
}
|
105 |
Â
|
106 |
Â
function ajax_render_widget_form() {
|
18 |
Â
function __construct() {
|
19 |
Â
add_action( 'admin_action_elementor', array( $this, 'init_editor' ) );
|
20 |
Â
add_action( 'template_redirect', array( $this, 'init_preview' ) );
|
21 |
+
|
22 |
+
add_filter( 'siteorigin_widgets_is_preview', array( $this, 'is_elementor_preview' ) );
|
23 |
Â
add_action( 'wp_ajax_elementor_editor_get_wp_widget_form', array( $this, 'ajax_render_widget_form' ) );
|
24 |
Â
}
|
25 |
Â
|
31 |
Â
$this->plugin = Elementor\Plugin::instance();
|
32 |
Â
if ( !empty( $this->plugin->preview ) && method_exists( $this->plugin->preview, 'is_preview_mode' ) && $this->plugin->preview->is_preview_mode() ) {
|
33 |
Â
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
|
34 |
+
add_action( 'elementor/preview/enqueue_styles', array( $this, 'enqueue_frontend_scripts' ) );
|
35 |
Â
}
|
36 |
Â
}
|
37 |
Â
|
38 |
Â
function enqueue_frontend_scripts() {
|
39 |
+
$so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
|
40 |
+
$so_widgets_bundle->register_general_scripts();
|
41 |
+
$so_widgets_bundle->enqueue_registered_widgets_scripts( true, false );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
42 |
Â
}
|
43 |
Â
|
44 |
Â
function enqueue_active_widgets_scripts() {
|
45 |
Â
|
46 |
Â
add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
|
47 |
+
|
48 |
+
$so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
|
49 |
+
$so_widgets_bundle->register_general_scripts();
|
50 |
+
$so_widgets_bundle->enqueue_registered_widgets_scripts( false, true );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
51 |
Â
|
52 |
Â
wp_enqueue_style( 'sowb-styles-for-elementor', plugin_dir_url( __FILE__ ) . 'styles.css' );
|
53 |
Â
|
71 |
Â
}
|
72 |
Â
}
|
73 |
Â
|
74 |
+
function is_elementor_preview( $is_preview ) {
|
75 |
+
$this->plugin = Elementor\Plugin::instance();
|
76 |
+
$is_elementor_preview = ! empty( $this->plugin->preview ) && method_exists( $this->plugin->preview, 'is_preview_mode' ) && $this->plugin->preview->is_preview_mode();
|
77 |
+
$is_elementor_edit_mode = $this->plugin->editor->is_edit_mode();
|
78 |
+
return $is_preview || $is_elementor_preview || $is_elementor_edit_mode ||
|
79 |
+
( !empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'elementor_ajax' );
|
80 |
Â
}
|
81 |
Â
|
82 |
Â
function ajax_render_widget_form() {
|
compat/elementor/sowb-elementor.js
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
-
var sowb = window.sowb || {};
|
2 |
-
|
3 |
-
( function($){
|
4 |
-
|
5 |
-
// To ensure necessary scripts are executed again when settings are changed
|
6 |
-
$( window ).on( 'elementor:init', function() {
|
7 |
-
elementor.on( 'preview:loaded', function () {
|
8 |
-
var preview_window = elementor.$preview.get( 0 ).contentWindow;
|
9 |
-
var $sowb = preview_window.jQuery( preview_window.sowb );
|
10 |
-
var timeoutId;
|
11 |
-
elementorFrontend.hooks.addAction( 'frontend/element_ready/widget', function(){
|
12 |
-
// Debounce
|
13 |
-
if ( timeoutId ) {
|
14 |
-
clearTimeout( timeoutId );
|
15 |
-
}
|
16 |
-
timeoutId = setTimeout( function () {
|
17 |
-
// Trigger Widgets Bundle widgets to setup
|
18 |
-
$sowb.trigger( 'setup_widgets' );
|
19 |
-
timeoutId = null;
|
20 |
-
}, 300 );
|
21 |
-
} );
|
22 |
-
} );
|
23 |
-
} );
|
24 |
-
|
25 |
-
})(jQuery);
|
1 |
+
var sowb = window.sowb || {};
|
2 |
+
|
3 |
+
( function($){
|
4 |
+
|
5 |
+
// To ensure necessary scripts are executed again when settings are changed
|
6 |
+
$( window ).on( 'elementor:init', function() {
|
7 |
+
elementor.on( 'preview:loaded', function () {
|
8 |
+
var preview_window = elementor.$preview.get( 0 ).contentWindow;
|
9 |
+
var $sowb = preview_window.jQuery( preview_window.sowb );
|
10 |
+
var timeoutId;
|
11 |
+
elementorFrontend.hooks.addAction( 'frontend/element_ready/widget', function(){
|
12 |
+
// Debounce
|
13 |
+
if ( timeoutId ) {
|
14 |
+
clearTimeout( timeoutId );
|
15 |
+
}
|
16 |
+
timeoutId = setTimeout( function () {
|
17 |
+
// Trigger Widgets Bundle widgets to setup
|
18 |
+
$sowb.trigger( 'setup_widgets', { preview: true } );
|
19 |
+
timeoutId = null;
|
20 |
+
}, 300 );
|
21 |
+
} );
|
22 |
+
} );
|
23 |
+
} );
|
24 |
+
|
25 |
+
})(jQuery);
|
compat/elementor/sowb-elementor.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowb=window.sowb||{};jQuery(window).on("elementor:init",function(){elementor.on("preview:loaded",function(){var e,n=elementor.$preview.get(0).contentWindow,o=n.jQuery(n.sowb);elementorFrontend.hooks.addAction("frontend/element_ready/widget",function(){e&&clearTimeout(e),e=setTimeout(function(){o.trigger("setup_widgets"),e=null},300)})})});
|
1 |
+
var sowb=window.sowb||{};jQuery(window).on("elementor:init",function(){elementor.on("preview:loaded",function(){var e,n=elementor.$preview.get(0).contentWindow,o=n.jQuery(n.sowb);elementorFrontend.hooks.addAction("frontend/element_ready/widget",function(){e&&clearTimeout(e),e=setTimeout(function(){o.trigger("setup_widgets",{preview:!0}),e=null},300)})})});
|
compat/visual-composer/sowb-vc-widget.js
CHANGED
@@ -1,80 +1,80 @@
|
|
1 |
-
/* globals jQuery, sowbForms, confirm, soWidgetsVC */
|
2 |
-
var sowbForms = window.sowbForms || {};
|
3 |
-
|
4 |
-
sowbForms.setupVcWidgetForm = function () {
|
5 |
-
var $ = jQuery;
|
6 |
-
var $widgetDropdown = $( '[name="so_widget_class"]' );
|
7 |
-
var $formContainer = $( '.siteorigin_widget_form_container' );
|
8 |
-
var formDirty = false;
|
9 |
-
$formContainer.on( 'change', '.siteorigin-widget-field', function () {
|
10 |
-
formDirty = true;
|
11 |
-
var widgetData = sowbForms.getWidgetFormValues( $formContainer );
|
12 |
-
var widgetClass = $widgetDropdown.val();
|
13 |
-
|
14 |
-
var jsonString = JSON.stringify( { widget_class: widgetClass, widget_data: widgetData } );
|
15 |
-
jsonString = jsonString.replace( /\\/g, '\\\\' );
|
16 |
-
$( '[name="so_widget_data"]' ).val( jsonString );
|
17 |
-
} );
|
18 |
-
|
19 |
-
var prevWidget;
|
20 |
-
$widgetDropdown.mousedown( function () {
|
21 |
-
prevWidget = $widgetDropdown.find( 'option:selected' );
|
22 |
-
} );
|
23 |
-
|
24 |
-
$widgetDropdown.on( 'change', function ( event ) {
|
25 |
-
if ( formDirty && !confirm( soWidgetsVC.confirmChangeWidget ) ) {
|
26 |
-
prevWidget.attr( 'selected', true );
|
27 |
-
return;
|
28 |
-
}
|
29 |
-
|
30 |
-
formDirty = false;
|
31 |
-
|
32 |
-
var widget = $widgetDropdown.val();
|
33 |
-
|
34 |
-
var data = {
|
35 |
-
'action': 'sowb_vc_widget_render_form',
|
36 |
-
'widget': widget,
|
37 |
-
};
|
38 |
-
|
39 |
-
$.post(
|
40 |
-
soWidgetsVC.ajaxUrl,
|
41 |
-
data,
|
42 |
-
function ( result ) {
|
43 |
-
$formContainer.html( result );
|
44 |
-
// To ensure data is updated.
|
45 |
-
$formContainer.trigger( 'change' );
|
46 |
-
},
|
47 |
-
'html'
|
48 |
-
);
|
49 |
-
} );
|
50 |
-
vc.atts.sowb_json_escaped = {
|
51 |
-
parse: function ( param ) {
|
52 |
-
var $field = this.content().find( '.wpb_vc_param_value[name=' + param.param_name + ']' );
|
53 |
-
// We double encode in the front end to prevent accidental decoding when the content is set on the
|
54 |
-
// WP visual editor.
|
55 |
-
return _.escape( _.escape( $field.val().toString() ).replace( /\[/g, '[' ).replace( /\]/g, ']' ) );
|
56 |
-
},
|
57 |
-
render: function ( param, value ) {
|
58 |
-
return _.unescape( _.unescape( value ) ).replace( /[/g, '[' ).replace( /]/g, ']' );
|
59 |
-
}
|
60 |
-
};
|
61 |
-
vc.events.on( "shortcodeView:updated:siteorigin_widget_vc", function () {
|
62 |
-
|
63 |
-
if ( typeof vc.frame_window !== 'undefined' && typeof vc.frame_window.sowb !== 'undefined' ) {
|
64 |
-
|
65 |
-
// Have to use jQuery from iframe window for triggered events to be detected there.
|
66 |
-
var $ = vc.frame_window.jQuery;
|
67 |
-
var sowb = vc.frame_window.sowb;
|
68 |
-
|
69 |
-
// Trigger Widgets Bundle widgets to setup
|
70 |
-
$( sowb ).trigger( 'setup_widgets' );
|
71 |
-
}
|
72 |
-
} );
|
73 |
-
|
74 |
-
};
|
75 |
-
|
76 |
-
jQuery( function ( $ ) {
|
77 |
-
sowbForms.setupVcWidgetForm();
|
78 |
-
} );
|
79 |
-
|
80 |
-
window.sowbForms = sowbForms;
|
1 |
+
/* globals jQuery, sowbForms, confirm, soWidgetsVC */
|
2 |
+
var sowbForms = window.sowbForms || {};
|
3 |
+
|
4 |
+
sowbForms.setupVcWidgetForm = function () {
|
5 |
+
var $ = jQuery;
|
6 |
+
var $widgetDropdown = $( '[name="so_widget_class"]' );
|
7 |
+
var $formContainer = $( '.siteorigin_widget_form_container' );
|
8 |
+
var formDirty = false;
|
9 |
+
$formContainer.on( 'change', '.siteorigin-widget-field', function () {
|
10 |
+
formDirty = true;
|
11 |
+
var widgetData = sowbForms.getWidgetFormValues( $formContainer );
|
12 |
+
var widgetClass = $widgetDropdown.val();
|
13 |
+
|
14 |
+
var jsonString = JSON.stringify( { widget_class: widgetClass, widget_data: widgetData } );
|
15 |
+
jsonString = jsonString.replace( /\\/g, '\\\\' );
|
16 |
+
$( '[name="so_widget_data"]' ).val( jsonString );
|
17 |
+
} );
|
18 |
+
|
19 |
+
var prevWidget;
|
20 |
+
$widgetDropdown.mousedown( function () {
|
21 |
+
prevWidget = $widgetDropdown.find( 'option:selected' );
|
22 |
+
} );
|
23 |
+
|
24 |
+
$widgetDropdown.on( 'change', function ( event ) {
|
25 |
+
if ( formDirty && !confirm( soWidgetsVC.confirmChangeWidget ) ) {
|
26 |
+
prevWidget.attr( 'selected', true );
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
|
30 |
+
formDirty = false;
|
31 |
+
|
32 |
+
var widget = $widgetDropdown.val();
|
33 |
+
|
34 |
+
var data = {
|
35 |
+
'action': 'sowb_vc_widget_render_form',
|
36 |
+
'widget': widget,
|
37 |
+
};
|
38 |
+
|
39 |
+
$.post(
|
40 |
+
soWidgetsVC.ajaxUrl,
|
41 |
+
data,
|
42 |
+
function ( result ) {
|
43 |
+
$formContainer.html( result );
|
44 |
+
// To ensure data is updated.
|
45 |
+
$formContainer.trigger( 'change' );
|
46 |
+
},
|
47 |
+
'html'
|
48 |
+
);
|
49 |
+
} );
|
50 |
+
vc.atts.sowb_json_escaped = {
|
51 |
+
parse: function ( param ) {
|
52 |
+
var $field = this.content().find( '.wpb_vc_param_value[name=' + param.param_name + ']' );
|
53 |
+
// We double encode in the front end to prevent accidental decoding when the content is set on the
|
54 |
+
// WP visual editor.
|
55 |
+
return _.escape( _.escape( $field.val().toString() ).replace( /\[/g, '[' ).replace( /\]/g, ']' ) );
|
56 |
+
},
|
57 |
+
render: function ( param, value ) {
|
58 |
+
return _.unescape( _.unescape( value ) ).replace( /[/g, '[' ).replace( /]/g, ']' );
|
59 |
+
}
|
60 |
+
};
|
61 |
+
vc.events.on( "shortcodeView:updated:siteorigin_widget_vc", function () {
|
62 |
+
|
63 |
+
if ( typeof vc.frame_window !== 'undefined' && typeof vc.frame_window.sowb !== 'undefined' ) {
|
64 |
+
|
65 |
+
// Have to use jQuery from iframe window for triggered events to be detected there.
|
66 |
+
var $ = vc.frame_window.jQuery;
|
67 |
+
var sowb = vc.frame_window.sowb;
|
68 |
+
|
69 |
+
// Trigger Widgets Bundle widgets to setup
|
70 |
+
$( sowb ).trigger( 'setup_widgets', { preview: true } );
|
71 |
+
}
|
72 |
+
} );
|
73 |
+
|
74 |
+
};
|
75 |
+
|
76 |
+
jQuery( function ( $ ) {
|
77 |
+
sowbForms.setupVcWidgetForm();
|
78 |
+
} );
|
79 |
+
|
80 |
+
window.sowbForms = sowbForms;
|
compat/visual-composer/sowb-vc-widget.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var n
|
1 |
+
var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var i,n=jQuery,t=n('[name="so_widget_class"]'),r=n(".siteorigin_widget_form_container"),s=!1;r.on("change",".siteorigin-widget-field",function(){s=!0;var e=sowbForms.getWidgetFormValues(r),o=t.val(),i=JSON.stringify({widget_class:o,widget_data:e});i=i.replace(/\\/g,"\\\\"),n('[name="so_widget_data"]').val(i)}),t.mousedown(function(){i=t.find("option:selected")}),t.on("change",function(e){if(!s||confirm(soWidgetsVC.confirmChangeWidget)){s=!1;var o={action:"sowb_vc_widget_render_form",widget:t.val()};n.post(soWidgetsVC.ajaxUrl,o,function(e){r.html(e),r.trigger("change")},"html")}else i.attr("selected",!0)}),vc.atts.sowb_json_escaped={parse:function(e){var o=this.content().find(".wpb_vc_param_value[name="+e.param_name+"]");return _.escape(_.escape(o.val().toString()).replace(/\[/g,"[").replace(/\]/g,"]"))},render:function(e,o){return _.unescape(_.unescape(o)).replace(/[/g,"[").replace(/]/g,"]")}},vc.events.on("shortcodeView:updated:siteorigin_widget_vc",function(){void 0!==vc.frame_window&&void 0!==vc.frame_window.sowb&&(0,vc.frame_window.jQuery)(vc.frame_window.sowb).trigger("setup_widgets",{preview:!0})})},jQuery(function(e){sowbForms.setupVcWidgetForm()}),window.sowbForms=sowbForms;
|
icons/fontawesome/filter.php
CHANGED
@@ -2,792 +2,1659 @@
|
|
2 |
Â
|
3 |
Â
function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
4 |
Â
return array_merge($icons, array(
|
5 |
-
'500px' => '',
|
6 |
-
'
|
7 |
-
'
|
8 |
-
'
|
9 |
-
'
|
10 |
-
'
|
11 |
-
'
|
12 |
-
'
|
13 |
-
'
|
14 |
-
'
|
15 |
-
'
|
16 |
-
'
|
17 |
-
'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
29 |
-
'
|
30 |
-
'
|
31 |
-
'
|
32 |
-
'
|
33 |
-
'
|
34 |
-
'
|
35 |
-
'
|
36 |
-
'
|
37 |
-
'
|
38 |
-
'
|
39 |
-
'
|
40 |
-
'
|
41 |
-
'
|
42 |
-
'
|
43 |
-
'
|
44 |
-
'
|
45 |
-
'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
'
|
49 |
-
'
|
50 |
-
'
|
51 |
-
'
|
52 |
-
'
|
53 |
-
'
|
54 |
-
'
|
55 |
-
'
|
56 |
-
'
|
57 |
-
'
|
58 |
-
'
|
59 |
-
'
|
60 |
-
'
|
61 |
-
'
|
62 |
-
'
|
63 |
-
'
|
64 |
-
'
|
65 |
-
'
|
66 |
-
'
|
67 |
-
'
|
68 |
-
'
|
69 |
-
'
|
70 |
-
'
|
71 |
-
'
|
72 |
-
'
|
73 |
-
'
|
74 |
-
'
|
75 |
-
'
|
76 |
-
'
|
77 |
-
'
|
78 |
-
'
|
79 |
-
'
|
80 |
-
'
|
81 |
-
'
|
82 |
-
'
|
83 |
-
'
|
84 |
-
'
|
85 |
-
'
|
86 |
-
'
|
87 |
-
'
|
88 |
-
'
|
89 |
-
'
|
90 |
-
'
|
91 |
-
'
|
92 |
-
'
|
93 |
-
'
|
94 |
-
'
|
95 |
-
'
|
96 |
-
'
|
97 |
-
'
|
98 |
-
'
|
99 |
-
'
|
100 |
-
'
|
101 |
-
'
|
102 |
-
'
|
103 |
-
'
|
104 |
-
'
|
105 |
-
'
|
106 |
-
'
|
107 |
-
'
|
108 |
-
'
|
109 |
-
'
|
110 |
-
'
|
111 |
-
'
|
112 |
-
'
|
113 |
-
'
|
114 |
-
'
|
115 |
-
'
|
116 |
-
'
|
117 |
-
'
|
118 |
-
'
|
119 |
-
'
|
120 |
-
'
|
121 |
-
'
|
122 |
-
'
|
123 |
-
'
|
124 |
-
'
|
125 |
-
'
|
126 |
-
'
|
127 |
-
'
|
128 |
-
'
|
129 |
-
'
|
130 |
-
'
|
131 |
-
'
|
132 |
-
'
|
133 |
-
'
|
134 |
-
'
|
135 |
-
'
|
136 |
-
'
|
137 |
-
'
|
138 |
-
'
|
139 |
-
'
|
140 |
-
'
|
141 |
-
'
|
142 |
-
'
|
143 |
-
'
|
144 |
-
'
|
145 |
-
'
|
146 |
-
'
|
147 |
-
'
|
148 |
-
'
|
149 |
-
'
|
150 |
-
'
|
151 |
-
'
|
152 |
-
'
|
153 |
-
'
|
154 |
-
'
|
155 |
-
'
|
156 |
-
'
|
157 |
-
'
|
158 |
-
'
|
159 |
-
'
|
160 |
-
'
|
161 |
-
'
|
162 |
-
'
|
163 |
-
'
|
164 |
-
'
|
165 |
-
'
|
166 |
-
'
|
167 |
-
'
|
168 |
-
'
|
169 |
-
'
|
170 |
-
'
|
171 |
-
'
|
172 |
-
'
|
173 |
-
'
|
174 |
-
'
|
175 |
-
'
|
176 |
-
'
|
177 |
-
'
|
178 |
-
'
|
179 |
-
'
|
180 |
-
'
|
181 |
-
'
|
182 |
-
'
|
183 |
-
'
|
184 |
-
'
|
185 |
-
'
|
186 |
-
'
|
187 |
-
'
|
188 |
-
'
|
189 |
-
'
|
190 |
-
'
|
191 |
-
'
|
192 |
-
'
|
193 |
-
'
|
194 |
-
'
|
195 |
-
'
|
196 |
-
'
|
197 |
-
'
|
198 |
-
'
|
199 |
-
'
|
200 |
-
'
|
201 |
-
'
|
202 |
-
'
|
203 |
-
'
|
204 |
-
'
|
205 |
-
'
|
206 |
-
'
|
207 |
-
'
|
208 |
-
'
|
209 |
-
'
|
210 |
-
'
|
211 |
-
'
|
212 |
-
'
|
213 |
-
'
|
214 |
-
'
|
215 |
-
'
|
216 |
-
'
|
217 |
-
'
|
218 |
-
'
|
219 |
-
'
|
220 |
-
'
|
221 |
-
'
|
222 |
-
'
|
223 |
-
'
|
224 |
-
'
|
225 |
-
'
|
226 |
-
'
|
227 |
-
'
|
228 |
-
'
|
229 |
-
'
|
230 |
-
'
|
231 |
-
'
|
232 |
-
'
|
233 |
-
'
|
234 |
-
'
|
235 |
-
'
|
236 |
-
'
|
237 |
-
'
|
238 |
-
'
|
239 |
-
'
|
240 |
-
'
|
241 |
-
'
|
242 |
-
'
|
243 |
-
'
|
244 |
-
'
|
245 |
-
'
|
246 |
-
'
|
247 |
-
'
|
248 |
-
'
|
249 |
-
'
|
250 |
-
'
|
251 |
-
'
|
252 |
-
'
|
253 |
-
'
|
254 |
-
'
|
255 |
-
'
|
256 |
-
'
|
257 |
-
'
|
258 |
-
'
|
259 |
-
'
|
260 |
-
'
|
261 |
-
'
|
262 |
-
'
|
263 |
-
'
|
264 |
-
'
|
265 |
-
'
|
266 |
-
'
|
267 |
-
'
|
268 |
-
'
|
269 |
-
'
|
270 |
-
'
|
271 |
-
'
|
272 |
-
'
|
273 |
-
'
|
274 |
-
'
|
275 |
-
'
|
276 |
-
'
|
277 |
-
'
|
278 |
-
'
|
279 |
-
'
|
280 |
-
'
|
281 |
-
'
|
282 |
-
'
|
283 |
-
'
|
284 |
-
'
|
285 |
-
'
|
286 |
-
'
|
287 |
-
'
|
288 |
-
'
|
289 |
-
'
|
290 |
-
'
|
291 |
-
'
|
292 |
-
'
|
293 |
-
'
|
294 |
-
'
|
295 |
-
'
|
296 |
-
'
|
297 |
-
'
|
298 |
-
'
|
299 |
-
'
|
300 |
-
'
|
301 |
-
'
|
302 |
-
'
|
303 |
-
'
|
304 |
-
'
|
305 |
-
'
|
306 |
-
'
|
307 |
-
'
|
308 |
-
'
|
309 |
-
'
|
310 |
-
'
|
311 |
-
'
|
312 |
-
'
|
313 |
-
'
|
314 |
-
'
|
315 |
-
'
|
316 |
-
'
|
317 |
-
'
|
318 |
-
'
|
319 |
-
'
|
320 |
-
'
|
321 |
-
'
|
322 |
-
'
|
323 |
-
'
|
324 |
-
'
|
325 |
-
'
|
326 |
-
'
|
327 |
-
'
|
328 |
-
'
|
329 |
-
'
|
330 |
-
'
|
331 |
-
'
|
332 |
-
'
|
333 |
-
'
|
334 |
-
'
|
335 |
-
'
|
336 |
-
'
|
337 |
-
'
|
338 |
-
'
|
339 |
-
'
|
340 |
-
'
|
341 |
-
'
|
342 |
-
'
|
343 |
-
'
|
344 |
-
'
|
345 |
-
'
|
346 |
-
'
|
347 |
-
'
|
348 |
-
'
|
349 |
-
'
|
350 |
-
'
|
351 |
-
'
|
352 |
-
'
|
353 |
-
'
|
354 |
-
'
|
355 |
-
'
|
356 |
-
'
|
357 |
-
'
|
358 |
-
'
|
359 |
-
'
|
360 |
-
'
|
361 |
-
'
|
362 |
-
'
|
363 |
-
'
|
364 |
-
'
|
365 |
-
'
|
366 |
-
'
|
367 |
-
'
|
368 |
-
'
|
369 |
-
'
|
370 |
-
'
|
371 |
-
'
|
372 |
-
'
|
373 |
-
'
|
374 |
-
'
|
375 |
-
'
|
376 |
-
'
|
377 |
-
'
|
378 |
-
'
|
379 |
-
'
|
380 |
-
'
|
381 |
-
'
|
382 |
-
'
|
383 |
-
'
|
384 |
-
'
|
385 |
-
'
|
386 |
-
'
|
387 |
-
'
|
388 |
-
'
|
389 |
-
'
|
390 |
-
'
|
391 |
-
'
|
392 |
-
'
|
393 |
-
'
|
394 |
-
'
|
395 |
-
'
|
396 |
-
'
|
397 |
-
'
|
398 |
-
'
|
399 |
-
'
|
400 |
-
'
|
401 |
-
'
|
402 |
-
'
|
403 |
-
'
|
404 |
-
'
|
405 |
-
'
|
406 |
-
'
|
407 |
-
'
|
408 |
-
'
|
409 |
-
'
|
410 |
-
'
|
411 |
-
'
|
412 |
-
'
|
413 |
-
'
|
414 |
-
'
|
415 |
-
'
|
416 |
-
'
|
417 |
-
'
|
418 |
-
'
|
419 |
-
'
|
420 |
-
'
|
421 |
-
'
|
422 |
-
'
|
423 |
-
'
|
424 |
-
'
|
425 |
-
'
|
426 |
-
'
|
427 |
-
'
|
428 |
-
'
|
429 |
-
'
|
430 |
-
'
|
431 |
-
'
|
432 |
-
'
|
433 |
-
'
|
434 |
-
'
|
435 |
-
'
|
436 |
-
'
|
437 |
-
'
|
438 |
-
'
|
439 |
-
'
|
440 |
-
'
|
441 |
-
'
|
442 |
-
'
|
443 |
-
'
|
444 |
-
'
|
445 |
-
'
|
446 |
-
'
|
447 |
-
'
|
448 |
-
'
|
449 |
-
'
|
450 |
-
'
|
451 |
-
'
|
452 |
-
'
|
453 |
-
'
|
454 |
-
'
|
455 |
-
'
|
456 |
-
'
|
457 |
-
'
|
458 |
-
'
|
459 |
-
'
|
460 |
-
'
|
461 |
-
'
|
462 |
-
'
|
463 |
-
'
|
464 |
-
'
|
465 |
-
'
|
466 |
-
'
|
467 |
-
'
|
468 |
-
'
|
469 |
-
'
|
470 |
-
'
|
471 |
-
'
|
472 |
-
'
|
473 |
-
'
|
474 |
-
'
|
475 |
-
'
|
476 |
-
'
|
477 |
-
'
|
478 |
-
'
|
479 |
-
'
|
480 |
-
'
|
481 |
-
'
|
482 |
-
'
|
483 |
-
'
|
484 |
-
'
|
485 |
-
'
|
486 |
-
'
|
487 |
-
'
|
488 |
-
'
|
489 |
-
'
|
490 |
-
'
|
491 |
-
'
|
492 |
-
'
|
493 |
-
'
|
494 |
-
'
|
495 |
-
'
|
496 |
-
'
|
497 |
-
'
|
498 |
-
'
|
499 |
-
'
|
500 |
-
'
|
501 |
-
'
|
502 |
-
'
|
503 |
-
'
|
504 |
-
'
|
505 |
-
'
|
506 |
-
'
|
507 |
-
'
|
508 |
-
'
|
509 |
-
'
|
510 |
-
'
|
511 |
-
'
|
512 |
-
'
|
513 |
-
'
|
514 |
-
'
|
515 |
-
'
|
516 |
-
'
|
517 |
-
'
|
518 |
-
'
|
519 |
-
'
|
520 |
-
'
|
521 |
-
'
|
522 |
-
'
|
523 |
-
'
|
524 |
-
'
|
525 |
-
'
|
526 |
-
'
|
527 |
-
'
|
528 |
-
'
|
529 |
-
'
|
530 |
-
'
|
531 |
-
'
|
532 |
-
'
|
533 |
-
'
|
534 |
-
'
|
535 |
-
'
|
536 |
-
'
|
537 |
-
'
|
538 |
-
'
|
539 |
-
'
|
540 |
-
'
|
541 |
-
'
|
542 |
-
'
|
543 |
-
'
|
544 |
-
'
|
545 |
-
'
|
546 |
-
'
|
547 |
-
'
|
548 |
-
'
|
549 |
-
'
|
550 |
-
'
|
551 |
-
'
|
552 |
-
'
|
553 |
-
'
|
554 |
-
'
|
555 |
-
'
|
556 |
-
'
|
557 |
-
'
|
558 |
-
'
|
559 |
-
'
|
560 |
-
'
|
561 |
-
'
|
562 |
-
'
|
563 |
-
'
|
564 |
-
'
|
565 |
-
'
|
566 |
-
'
|
567 |
-
'
|
568 |
-
'
|
569 |
-
'
|
570 |
-
'
|
571 |
-
'
|
572 |
-
'
|
573 |
-
'
|
574 |
-
'
|
575 |
-
'
|
576 |
-
'
|
577 |
-
'
|
578 |
-
'
|
579 |
-
'
|
580 |
-
'
|
581 |
-
'
|
582 |
-
'
|
583 |
-
'
|
584 |
-
'
|
585 |
-
'
|
586 |
-
'
|
587 |
-
'
|
588 |
-
'
|
589 |
-
'
|
590 |
-
'
|
591 |
-
'
|
592 |
-
'
|
593 |
-
'
|
594 |
-
'
|
595 |
-
'
|
596 |
-
'
|
597 |
-
'
|
598 |
-
'
|
599 |
-
'
|
600 |
-
'
|
601 |
-
'
|
602 |
-
'
|
603 |
-
'
|
604 |
-
'
|
605 |
-
'
|
606 |
-
'
|
607 |
-
'
|
608 |
-
'
|
609 |
-
'
|
610 |
-
'
|
611 |
-
'
|
612 |
-
'
|
613 |
-
'
|
614 |
-
'
|
615 |
-
'
|
616 |
-
'
|
617 |
-
'
|
618 |
-
'
|
619 |
-
'
|
620 |
-
'
|
621 |
-
'
|
622 |
-
'
|
623 |
-
'
|
624 |
-
'
|
625 |
-
'
|
626 |
-
'
|
627 |
-
'
|
628 |
-
'
|
629 |
-
'
|
630 |
-
'
|
631 |
-
'
|
632 |
-
'
|
633 |
-
'
|
634 |
-
'
|
635 |
-
'
|
636 |
-
'
|
637 |
-
'
|
638 |
-
'
|
639 |
-
'
|
640 |
-
'
|
641 |
-
'
|
642 |
-
'
|
643 |
-
'
|
644 |
-
'
|
645 |
-
'
|
646 |
-
'
|
647 |
-
'
|
648 |
-
'
|
649 |
-
'
|
650 |
-
'
|
651 |
-
'
|
652 |
-
'
|
653 |
-
'
|
654 |
-
'
|
655 |
-
'
|
656 |
-
'
|
657 |
-
'
|
658 |
-
'
|
659 |
-
'
|
660 |
-
'
|
661 |
-
'
|
662 |
-
'
|
663 |
-
'
|
664 |
-
'
|
665 |
-
'
|
666 |
-
'
|
667 |
-
'
|
668 |
-
'
|
669 |
-
'
|
670 |
-
'
|
671 |
-
'
|
672 |
-
'
|
673 |
-
'
|
674 |
-
'
|
675 |
-
'
|
676 |
-
'
|
677 |
-
'
|
678 |
-
'
|
679 |
-
'
|
680 |
-
'
|
681 |
-
'
|
682 |
-
'
|
683 |
-
'
|
684 |
-
'
|
685 |
-
'
|
686 |
-
'
|
687 |
-
'
|
688 |
-
'
|
689 |
-
'
|
690 |
-
'
|
691 |
-
'
|
692 |
-
'
|
693 |
-
'
|
694 |
-
'
|
695 |
-
'
|
696 |
-
'
|
697 |
-
'
|
698 |
-
'
|
699 |
-
'
|
700 |
-
'
|
701 |
-
'
|
702 |
-
'
|
703 |
-
'
|
704 |
-
'
|
705 |
-
'
|
706 |
-
'
|
707 |
-
'
|
708 |
-
'
|
709 |
-
'
|
710 |
-
'
|
711 |
-
'
|
712 |
-
'
|
713 |
-
'
|
714 |
-
'
|
715 |
-
'
|
716 |
-
'
|
717 |
-
'
|
718 |
-
'
|
719 |
-
'
|
720 |
-
'
|
721 |
-
'
|
722 |
-
'
|
723 |
-
'
|
724 |
-
'
|
725 |
-
'
|
726 |
-
'
|
727 |
-
'
|
728 |
-
'
|
729 |
-
'
|
730 |
-
'
|
731 |
-
'
|
732 |
-
'
|
733 |
-
'
|
734 |
-
'
|
735 |
-
'
|
736 |
-
'
|
737 |
-
'
|
738 |
-
'
|
739 |
-
'
|
740 |
-
'
|
741 |
-
'
|
742 |
-
'
|
743 |
-
'
|
744 |