SiteOrigin Widgets Bundle - Version 1.9.4

Version Description

  • 24 July 2017 =
  • Using new Editor JS API for TinyMCE field.
  • Carousel: apply static position on .overlay.
  • Layout Slider: Add ability to set Background image to Title and spaced the code.
  • Add capabilities check to widget activation action.
  • Testimonial: Corrected typo in description and corrected formatting.
  • Enabling translation for "From:" in contact mail.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.9.4
Comparing to
See all releases

Code changes from version 1.9.3 to 1.9.4

base/inc/fields/js/tinymce-field-pre48.js ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global tinyMCEPreInit, quicktags, QTags, tinymce */
2
+
3
+ (function( $ ) {
4
+ var setup = function(widgetForm) {
5
+ if(typeof tinyMCEPreInit !== 'undefined') {
6
+ //BS TinyMCE widget sometimes adds 'undefined' as an id when opening PB, which causes a JS error when using repeaters.
7
+ if (tinyMCEPreInit.mceInit.hasOwnProperty('undefined')) {
8
+ delete tinyMCEPreInit.mceInit['undefined'];
9
+ }
10
+ if (tinyMCEPreInit.qtInit.hasOwnProperty('undefined')) {
11
+ delete tinyMCEPreInit.qtInit['undefined'];
12
+ }
13
+ if (QTags.instances.hasOwnProperty('undefined')) {
14
+ delete QTags.instances['undefined'];
15
+ }
16
+ $(widgetForm).find('> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container').each(function (index, element) {
17
+ var $container = $(element);
18
+ var $textarea = $container.find('textarea');
19
+ var id = $textarea.attr('id');
20
+ if( typeof tinymce !== 'undefined') {
21
+ if (id.indexOf('__i__') > -1) return;
22
+ var mceSettings = $container.data('mceSettings');
23
+ var widgetIdBase = $container.data('widgetIdBase');
24
+ var name = $textarea.attr('name').replace(/\[\d*\]/g, '');
25
+ var fieldName = /[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(name)[1];
26
+ var idPattern = new RegExp('widget-' + widgetIdBase + '-?.*-' + fieldName.replace(/\]\[/g, '-') + '[-\d]*');
27
+ for (var initId in tinyMCEPreInit.mceInit) {
28
+ if (initId.match(idPattern)) {
29
+ mceSettings = $.extend({}, tinyMCEPreInit.mceInit[initId], mceSettings);
30
+ }
31
+ }
32
+ var content;
33
+ var curEd = tinymce.get(id);
34
+ if ( curEd !== null ) {
35
+ // Only keep content when we're not in Visual Composer.
36
+ if ( typeof vc === 'undefined' && $container.closest('.vc_active').length === 0 ) {
37
+ content = curEd.getContent();
38
+ }
39
+ curEd.remove();
40
+ }
41
+ var setupEditor = function (editor) {
42
+ editor.on('change',
43
+ function () {
44
+ tinymce.get(id).save();
45
+ $textarea.trigger('change');
46
+ $textarea.val(window.switchEditors.pre_wpautop(editor.getContent()));
47
+ }
48
+ );
49
+ editor.on('init',
50
+ function () {
51
+ if (content) {
52
+ editor.setContent(content);
53
+ }
54
+ }
55
+ );
56
+ };
57
+ mceSettings = $.extend({}, mceSettings, {selector: '#' + id, setup: setupEditor});
58
+ tinyMCEPreInit.mceInit[id] = mceSettings;
59
+ var wrapDiv = $container.find('div#wp-' + id + '-wrap');
60
+ if (wrapDiv.hasClass('tmce-active')) {
61
+ // Add a small timeout to make sure everything is ready - mainly for customizer and widgets interface
62
+ if ($('#' + id).is(':visible')) {
63
+ tinymce.init(tinyMCEPreInit.mceInit[id]);
64
+ }
65
+ else {
66
+ var intervalId = setInterval(function () {
67
+ if ($('#' + id).is(':visible')) {
68
+ tinymce.init(tinyMCEPreInit.mceInit[id]);
69
+ clearInterval(intervalId);
70
+ }
71
+ }, 500);
72
+ }
73
+ }
74
+ }
75
+ var qtSettings = $container.data('qtSettings');
76
+ qtSettings = $.extend({}, tinyMCEPreInit.qtInit['siteorigin-widget-input-tinymce-field'], qtSettings, {id: id});
77
+ tinyMCEPreInit.qtInit[id] = qtSettings;
78
+ $container.find('.quicktags-toolbar').remove();
79
+ quicktags(tinyMCEPreInit.qtInit[id]);
80
+
81
+ $(this).on( 'click', function(event) {
82
+
83
+ var $target = $(event.target);
84
+ if ( $target.hasClass( 'wp-switch-editor' ) ) {
85
+ var mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
86
+ if ( mode == 'tmce') {
87
+ // Quick bit of sanitization to prevent catastrophic backtracking in TinyMCE HTML parser regex
88
+ var editor = tinymce.get(id);
89
+ if (editor != null) {
90
+ var content = $textarea.val();
91
+ if (content.search('<') != -1) {
92
+ if (content.search('>') == -1) {
93
+ content = content.replace(/</g, '');
94
+ $textarea.val(content);
95
+ }
96
+ }
97
+ editor.setContent(window.switchEditors.wpautop(content));
98
+ }
99
+ }
100
+
101
+ $(this).find('+ .siteorigin-widget-tinymce-selected-editor').val(mode);
102
+ }
103
+ });
104
+ });
105
+ QTags._buttonsInit();
106
+ }
107
+ else {
108
+ setTimeout(function(){
109
+ setup(widgetForm);
110
+ }, 500);
111
+ }
112
+ };
113
+
114
+ $(document).on( 'sowsetupform', function(e) {
115
+ var $f = $(e.target);
116
+
117
+ if($f.is('.siteorigin-widget-field-repeater-item-form')){
118
+ if($f.is(':visible')) {
119
+ setup( $f );
120
+ }
121
+ else {
122
+ $f.on('slideToggleOpenComplete', function onSlideToggleComplete() {
123
+ if( $f.is(':visible') ){
124
+ setup($f);
125
+ $f.off('slideToggleOpenComplete');
126
+ }
127
+ });
128
+ }
129
+ }
130
+ else {
131
+ setup($f);
132
+ }
133
+ });
134
+ $(document).on('sortstop', function (event, ui) {
135
+ if(ui.item.is('.siteorigin-widget-field-repeater-item')) {
136
+ ui.item.find('> .siteorigin-widget-field-repeater-item-form').each(function(){
137
+ setup( $(this) );
138
+ });
139
+ }
140
+ else {
141
+ setup(ui.item.find('.siteorigin-widget-form'));
142
+ }
143
+ });
144
+
145
+ })( jQuery );
base/inc/fields/js/tinymce-field-pre48.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),a=r.attr("id");if("undefined"!=typeof tinymce){if(a.indexOf("__i__")>-1)return;var s=n.data("mceSettings"),o=n.data("widgetIdBase"),c=r.attr("name").replace(/\[\d*\]/g,""),d=/[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(c)[1],f=new RegExp("widget-"+o+"-?.*-"+d.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(s=e.extend({},tinyMCEPreInit.mceInit[g],s));var l,m=tinymce.get(a);null!==m&&("undefined"==typeof vc&&0===n.closest(".vc_active").length&&(l=m.getContent()),m.remove());var u=function(e){e.on("change",function(){tinymce.get(a).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){l&&e.setContent(l)})};s=e.extend({},s,{selector:"#"+a,setup:u}),tinyMCEPreInit.mceInit[a]=s;var v=n.find("div#wp-"+a+"-wrap");if(v.hasClass("tmce-active"))if(e("#"+a).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[a]);else var y=setInterval(function(){e("#"+a).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[a]),clearInterval(y))},500)}var p=n.data("qtSettings");p=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],p,{id:a}),tinyMCEPreInit.qtInit[a]=p,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[a]),e(this).on("click",function(t){var i=e(t.target);if(i.hasClass("wp-switch-editor")){var n=i.hasClass("switch-tmce")?"tmce":"html";if("tmce"==n){var s=tinymce.get(a);if(null!=s){var o=r.val();o.search("<")!=-1&&o.search(">")==-1&&(o=o.replace(/</g,""),r.val(o)),s.setContent(window.switchEditors.wpautop(o))}}e(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(n)}})}),QTags._buttonsInit()):setTimeout(function(){t(i)},500)};e(document).on("sowsetupform",function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))}):t(n)}),e(document).on("sortstop",function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){t(e(this))}):t(n.item.find(".siteorigin-widget-form"))})}(jQuery);
base/inc/fields/js/tinymce-field.js CHANGED
@@ -1,145 +1,76 @@
1
- /* global tinyMCEPreInit, quicktags, QTags, tinymce */
2
 
3
- (function( $ ) {
4
- var setup = function(widgetForm) {
5
- if(typeof tinyMCEPreInit !== 'undefined') {
6
- //BS TinyMCE widget sometimes adds 'undefined' as an id when opening PB, which causes a JS error when using repeaters.
7
- if (tinyMCEPreInit.mceInit.hasOwnProperty('undefined')) {
8
- delete tinyMCEPreInit.mceInit['undefined'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
10
- if (tinyMCEPreInit.qtInit.hasOwnProperty('undefined')) {
11
- delete tinyMCEPreInit.qtInit['undefined'];
 
 
 
 
12
  }
13
- if (QTags.instances.hasOwnProperty('undefined')) {
14
- delete QTags.instances['undefined'];
 
 
 
 
 
 
15
  }
16
- $(widgetForm).find('> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container').each(function (index, element) {
17
- var $container = $(element);
18
- var $textarea = $container.find('textarea');
19
- var id = $textarea.attr('id');
20
- if( typeof tinymce !== 'undefined') {
21
- if (id.indexOf('__i__') > -1) return;
22
- var mceSettings = $container.data('mceSettings');
23
- var widgetIdBase = $container.data('widgetIdBase');
24
- var name = $textarea.attr('name').replace(/\[\d*\]/g, '');
25
- var fieldName = /[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(name)[1];
26
- var idPattern = new RegExp('widget-' + widgetIdBase + '-?.*-' + fieldName.replace(/\]\[/g, '-') + '[-\d]*');
27
- for (var initId in tinyMCEPreInit.mceInit) {
28
- if (initId.match(idPattern)) {
29
- mceSettings = $.extend({}, tinyMCEPreInit.mceInit[initId], mceSettings);
30
- }
31
- }
32
- var content;
33
- var curEd = tinymce.get(id);
34
- if ( curEd !== null ) {
35
- // Only keep content when we're not in Visual Composer.
36
- if ( typeof vc === 'undefined' && $container.closest('.vc_active').length === 0 ) {
37
- content = curEd.getContent();
38
- }
39
- curEd.remove();
40
- }
41
- var setupEditor = function (editor) {
42
- editor.on('change',
43
- function () {
44
- tinymce.get(id).save();
45
- $textarea.trigger('change');
46
- $textarea.val(window.switchEditors.pre_wpautop(editor.getContent()));
47
- }
48
- );
49
- editor.on('init',
50
- function () {
51
- if (content) {
52
- editor.setContent(content);
53
- }
54
- }
55
- );
56
- };
57
- mceSettings = $.extend({}, mceSettings, {selector: '#' + id, setup: setupEditor});
58
- tinyMCEPreInit.mceInit[id] = mceSettings;
59
- var wrapDiv = $container.find('div#wp-' + id + '-wrap');
60
- if (wrapDiv.hasClass('tmce-active')) {
61
- // Add a small timeout to make sure everything is ready - mainly for customizer and widgets interface
62
- if ($('#' + id).is(':visible')) {
63
- tinymce.init(tinyMCEPreInit.mceInit[id]);
64
- }
65
- else {
66
- var intervalId = setInterval(function () {
67
- if ($('#' + id).is(':visible')) {
68
- tinymce.init(tinyMCEPreInit.mceInit[id]);
69
- clearInterval(intervalId);
70
- }
71
- }, 500);
72
- }
73
  }
74
- }
75
- var qtSettings = $container.data('qtSettings');
76
- qtSettings = $.extend({}, tinyMCEPreInit.qtInit['siteorigin-widget-input-tinymce-field'], qtSettings, {id: id});
77
- tinyMCEPreInit.qtInit[id] = qtSettings;
78
- $container.find('.quicktags-toolbar').remove();
79
- quicktags(tinyMCEPreInit.qtInit[id]);
80
-
81
- $(this).on( 'click', function(event) {
82
 
83
- var $target = $(event.target);
84
- if ( $target.hasClass( 'wp-switch-editor' ) ) {
85
- var mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
86
- if ( mode == 'tmce') {
87
- // Quick bit of sanitization to prevent catastrophic backtracking in TinyMCE HTML parser regex
88
- var editor = tinymce.get(id);
89
- if (editor != null) {
90
- var content = $textarea.val();
91
- if (content.search('<') != -1) {
92
- if (content.search('>') == -1) {
93
- content = content.replace(/</g, '');
94
- $textarea.val(content);
95
- }
96
- }
97
- editor.setContent(window.switchEditors.wpautop(content));
98
  }
99
  }
100
-
101
- $(this).find('+ .siteorigin-widget-tinymce-selected-editor').val(mode);
102
  }
103
- });
104
- });
105
- QTags._buttonsInit();
106
- }
107
- else {
108
- setTimeout(function(){
109
- setup(widgetForm);
110
- }, 500);
111
- }
112
- };
113
-
114
- $(document).on( 'sowsetupform', function(e) {
115
- var $f = $(e.target);
116
 
117
- if($f.is('.siteorigin-widget-field-repeater-item-form')){
118
- if($f.is(':visible')) {
119
- setup( $f );
120
  }
121
- else {
122
- $f.on('slideToggleOpenComplete', function onSlideToggleComplete() {
123
- if( $f.is(':visible') ){
124
- setup($f);
125
- $f.off('slideToggleOpenComplete');
126
- }
127
- });
128
- }
129
- }
130
- else {
131
- setup($f);
132
- }
133
- });
134
- $(document).on('sortstop', function (event, ui) {
135
- if(ui.item.is('.siteorigin-widget-field-repeater-item')) {
136
- ui.item.find('> .siteorigin-widget-field-repeater-item-form').each(function(){
137
- setup( $(this) );
138
- });
139
- }
140
- else {
141
- setup(ui.item.find('.siteorigin-widget-form'));
142
- }
143
- });
144
 
145
  })( jQuery );
1
+ /* global tinymce, switchEditors */
2
 
3
+ (function ( $ ) {
4
+ $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-tinymce', function ( e ) {
5
+ var $$ = $( this );
6
+ var $container = $$.find( '.siteorigin-widget-tinymce-container' );
7
+ var settings = $container.data( 'editorSettings' );
8
+ var $textarea = $container.find( 'textarea' );
9
+ var id = $textarea.attr( 'id' );
10
+ var setupEditor = function ( editor ) {
11
+ editor.on( 'change',
12
+ function () {
13
+ window.tinymce.get( id ).save();
14
+ $textarea.trigger( 'change' );
15
+ }
16
+ );
17
+ };
18
+
19
+ settings.tinymce = $.extend( {}, settings.tinymce, { selector: '#' + id, setup: setupEditor } );
20
+ $( document ).one( 'wp-before-tinymce-init', function ( event, init ) {
21
+ if ( init.selector === settings.tinymce.selector ) {
22
+ var mediaButtons = $container.data( 'mediaButtons' );
23
+ $$.find( '.wp-editor-tabs' ).before( mediaButtons.html );
24
  }
25
+ } );
26
+ $( document ).one( 'tinymce-editor-setup', function () {
27
+ if ( ! $$.find( '.wp-editor-wrap' ).hasClass( settings.selectedEditor + '-active' ) ) {
28
+ setTimeout( function () {
29
+ window.switchEditors.go( id );
30
+ }, 10 );
31
  }
32
+ } );
33
+
34
+ wp.editor.remove( id );
35
+
36
+ if (settings.selectedEditor === 'tmce' ) {
37
+ // Add a small timeout to make sure everything is ready - mainly for customizer and widgets interface
38
+ if ( $textarea.is( ':visible' ) ) {
39
+ wp.editor.initialize( id, settings );
40
  }
41
+ else {
42
+ var intervalId = setInterval( function () {
43
+ if ( $textarea.is( ':visible' ) ) {
44
+ wp.editor.initialize( id, settings );
45
+ clearInterval( intervalId );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
+ }, 500);
48
+ }
49
+ }
 
 
 
 
 
50
 
51
+ $$.on( 'click', function ( event ) {
52
+ var $target = $( event.target );
53
+ if ( $target.hasClass( 'wp-switch-editor' ) ) {
54
+ var mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
55
+ if ( mode === 'tmce' ) {
56
+ // TODO: This might not be necessary anymore with the updated version of TinyMCE.
57
+ // Quick bit of sanitization to prevent catastrophic backtracking in TinyMCE HTML parser regex
58
+ var editor = window.tinymce.get( id );
59
+ if ( editor !== null ) {
60
+ var content = $textarea.val();
61
+ if ( content.search( '<' ) !== -1 ) {
62
+ if ( content.search( '>' ) === -1 ) {
63
+ content = content.replace( /</g, '' );
64
+ $textarea.val( content );
 
65
  }
66
  }
67
+ editor.setContent(window.switchEditors.wpautop(content));
 
68
  }
69
+ }
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
+ $$.find( '.siteorigin-widget-tinymce-selected-editor' ).val( mode );
 
 
72
  }
73
+ } );
74
+ } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  })( jQuery );
base/inc/fields/js/tinymce-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),a=r.attr("id");if("undefined"!=typeof tinymce){if(a.indexOf("__i__")>-1)return;var s=n.data("mceSettings"),o=n.data("widgetIdBase"),c=r.attr("name").replace(/\[\d*\]/g,""),d=/[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(c)[1],f=new RegExp("widget-"+o+"-?.*-"+d.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(s=e.extend({},tinyMCEPreInit.mceInit[g],s));var l,m=tinymce.get(a);null!==m&&("undefined"==typeof vc&&0===n.closest(".vc_active").length&&(l=m.getContent()),m.remove());var u=function(e){e.on("change",function(){tinymce.get(a).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){l&&e.setContent(l)})};s=e.extend({},s,{selector:"#"+a,setup:u}),tinyMCEPreInit.mceInit[a]=s;var v=n.find("div#wp-"+a+"-wrap");if(v.hasClass("tmce-active"))if(e("#"+a).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[a]);else var y=setInterval(function(){e("#"+a).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[a]),clearInterval(y))},500)}var p=n.data("qtSettings");p=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],p,{id:a}),tinyMCEPreInit.qtInit[a]=p,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[a]),e(this).on("click",function(t){var i=e(t.target);if(i.hasClass("wp-switch-editor")){var n=i.hasClass("switch-tmce")?"tmce":"html";if("tmce"==n){var s=tinymce.get(a);if(null!=s){var o=r.val();o.search("<")!=-1&&o.search(">")==-1&&(o=o.replace(/</g,""),r.val(o)),s.setContent(window.switchEditors.wpautop(o))}}e(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(n)}})}),QTags._buttonsInit()):setTimeout(function(){t(i)},500)};e(document).on("sowsetupform",function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))}):t(n)}),e(document).on("sortstop",function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){t(e(this))}):t(n.item.find(".siteorigin-widget-form"))})}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(t){var i=e(this),n=i.find(".siteorigin-widget-tinymce-container"),o=n.data("editorSettings"),c=n.find("textarea"),r=c.attr("id"),s=function(e){e.on("change",function(){window.tinymce.get(r).save(),c.trigger("change")})};if(o.tinymce=e.extend({},o.tinymce,{selector:"#"+r,setup:s}),e(document).one("wp-before-tinymce-init",function(e,t){if(t.selector===o.tinymce.selector){var c=n.data("mediaButtons");i.find(".wp-editor-tabs").before(c.html)}}),e(document).one("tinymce-editor-setup",function(){i.find(".wp-editor-wrap").hasClass(o.selectedEditor+"-active")||setTimeout(function(){window.switchEditors.go(r)},10)}),wp.editor.remove(r),"tmce"===o.selectedEditor)if(c.is(":visible"))wp.editor.initialize(r,o);else var a=setInterval(function(){c.is(":visible")&&(wp.editor.initialize(r,o),clearInterval(a))},500);i.on("click",function(t){var n=e(t.target);if(n.hasClass("wp-switch-editor")){var o=n.hasClass("switch-tmce")?"tmce":"html";if("tmce"===o){var s=window.tinymce.get(r);if(null!==s){var a=c.val();a.search("<")!==-1&&a.search(">")===-1&&(a=a.replace(/</g,""),c.val(a)),s.setContent(window.switchEditors.wpautop(a))}}i.find(".siteorigin-widget-tinymce-selected-editor").val(o)}})})}(jQuery);
base/inc/fields/tinymce.class.php CHANGED
@@ -8,6 +8,13 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
8
  * @var int
9
  */
10
  protected $rows = 10;
 
 
 
 
 
 
 
11
  /**
12
  * The editor to be displayed initially.
13
  *
@@ -23,12 +30,40 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
23
  */
24
  protected $selected_editor;
25
  /**
26
- * The editor initial height. Overrides rows if it is set.
27
  *
28
  * @access protected
29
- * @var int
30
  */
31
- protected $editor_height;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  /**
33
  * An array of filter callbacks to apply to the set of buttons which will be rendered for the editor.
34
  *
@@ -36,40 +71,150 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
36
  * @var array
37
  */
38
  protected $button_filters;
39
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  protected function initialize() {
41
  if ( ! is_admin() ) {
42
  return;
43
  }
44
- add_filter( 'mce_buttons', array( $this, 'mce_buttons_filter' ), 10, 2 );
45
- add_filter( 'quicktags_settings', array( $this, 'quicktags_settings' ), 10, 2 );
46
-
47
- if ( !empty( $this->button_filters ) ) {
48
- foreach ( $this->button_filters as $filter_name => $filter ) {
49
- if ( preg_match( '/mce_buttons(?:_[1-4])?|quicktags_settings/', $filter_name ) && !empty( $filter ) && is_callable( $filter ) ) {
50
- add_filter( $filter_name, array( $this, $filter_name ), 10, 2 );
 
 
 
 
 
 
 
 
 
51
  }
52
  }
53
  }
54
-
55
  if( class_exists( 'WC_Shortcodes_TinyMCE_Buttons' ) ) {
56
- $screen = get_current_screen();
57
- if( !is_null( $screen ) && $screen->id != 'widgets' ) {
58
- add_filter( 'mce_external_plugins', array( $this, 'add_wpc_shortcode_plugin' ), 15 );
59
- add_filter( 'mce_buttons', array( $this, 'register_wpc_shortcode_button' ), 15 );
 
 
 
 
 
60
  }
61
  }
62
-
63
  if( class_exists( 'WC_Shortcodes_Admin' ) ) {
64
- $screen = get_current_screen();
65
- if( !is_null( $screen ) && $screen->id != 'widgets' ) {
66
- add_filter( 'mce_external_plugins', array( $this, 'add_wc_shortcode_plugin' ), 15 );
67
- add_filter( 'mce_buttons', array( $this, 'register_wc_shortcode_button' ), 15 );
 
 
 
 
 
 
68
  }
69
  }
70
  }
71
-
72
- function add_wc_shortcode_plugin( $plugins ) {
73
  if( isset( $plugins['woocommerce_shortcodes'] ) ) {
74
  return $plugins;
75
  }
@@ -80,49 +225,43 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
80
  }
81
  return $plugins;
82
  }
83
-
84
- function register_wc_shortcode_button( $buttons ) {
85
- if( in_array( 'woocommerce_shortcodes', $buttons ) ) {
86
- return $buttons;
87
  }
88
- array_push( $buttons, '|', 'woocommerce_shortcodes' );
89
  return $buttons;
90
  }
91
-
92
- function add_wpc_shortcode_plugin( $plugins ) {
93
- global $wp_version;
94
- $ver = WC_SHORTCODES_VERSION;
95
- $wp_ver_gte_3_9 = version_compare( $wp_version, '3.9', '>=' );
96
-
97
  if( ! isset( $plugins['wpc_shortcodes'] ) ) {
98
- $shortcodes_filename = $wp_ver_gte_3_9 ? 'shortcodes-tinymce-4' : 'shortcodes_tinymce';
99
- $shortcodes_path = 'wc-shortcodes/includes/mce/js/' . $shortcodes_filename . '.js';
100
- if( file_exists( WP_PLUGIN_DIR . '/' . $shortcodes_path ) ) {
101
- $plugins['wpc_shortcodes'] = plugins_url( $shortcodes_path . '?ver=' . $ver );
102
  }
103
  }
104
-
105
  if( ! isset( $plugins['wpc_font_awesome'] ) ) {
106
- $fontawesome_filename = $wp_ver_gte_3_9 ? 'font-awesome-tinymce-4' : 'font_awesome_tinymce';
107
- $fontawesome_path = 'wc-shortcodes/includes/mce/js/' . $fontawesome_filename . '.js';
108
- if( file_exists( WP_PLUGIN_DIR . '/' . $fontawesome_path ) ) {
109
- $plugins['wpc_font_awesome'] = plugins_url( $fontawesome_path . '?ver=' . $ver );
110
  }
111
  }
112
-
113
  return $plugins;
114
  }
115
-
116
- function register_wpc_shortcode_button( $buttons ) {
117
  if( ! in_array( 'wpc_shortcodes_button', $buttons ) ) {
118
  array_push( $buttons, 'wpc_shortcodes_button' );
119
  }
120
  if( ! in_array( 'wpcfontAwesomeGlyphSelect', $buttons ) ) {
121
  array_push( $buttons, 'wpcfontAwesomeGlyphSelect' );
122
  }
 
123
  return $buttons;
124
  }
125
-
126
  /**
127
  * @param $name
128
  * @param $arguments
@@ -144,20 +283,26 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
144
  }
145
  }
146
  }
147
-
148
  public function mce_buttons_filter( $buttons, $editor_id ) {
149
  if (($key = array_search('fullscreen', $buttons)) !== false) {
150
  unset($buttons[$key]);
151
  }
152
  return $buttons;
153
  }
154
-
155
  public function quicktags_settings( $settings, $editor_id ) {
156
  $settings['buttons'] = preg_replace( '/,fullscreen/', '', $settings['buttons'] );
157
  $settings['buttons'] = preg_replace( '/,dfw/', '', $settings['buttons'] );
158
  return $settings;
159
  }
160
-
 
 
 
 
 
 
161
  protected function render_before_field( $value, $instance ) {
162
  $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
163
  if( ! empty( $instance[ $selected_editor_name ] ) ) {
@@ -168,10 +313,90 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
168
  }
169
  parent::render_before_field( $value, $instance );
170
  }
171
-
172
-
173
  protected function render_field( $value, $instance ) {
174
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  $settings = array(
176
  'textarea_name' => esc_attr( $this->element_name ),
177
  'default_editor' => $this->selected_editor,
@@ -189,17 +414,17 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
189
  data-mce-settings="<?php echo esc_attr( json_encode( $settings['tinymce'] ) ) ?>"
190
  data-qt-settings="<?php echo esc_attr( json_encode( array() ) ) ?>"
191
  data-widget-id-base="<?php echo esc_attr( $widget_id_base ) ?>"
192
- >
193
  <?php
194
  wp_editor( $value, esc_attr( $this->element_id ), $settings )
195
  ?>
196
  </div>
197
  <input type="hidden"
198
- name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
199
- class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
200
- value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
201
  <?php
202
-
203
  if( $this->selected_editor == 'html' ) {
204
  remove_filter( 'the_editor_content', 'wp_htmledit_pre' );
205
  }
@@ -207,12 +432,24 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
207
  remove_filter( 'the_editor_content', 'wp_richedit_pre' );
208
  }
209
  }
210
-
211
  public function enqueue_scripts() {
212
- wp_enqueue_script( 'so-tinymce-field', plugin_dir_url(__FILE__) . 'js/tinymce-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery', 'editor', 'quicktags' ), SOW_BUNDLE_VERSION );
213
- wp_enqueue_style( 'so-tinymce-field', plugin_dir_url(__FILE__) . 'css/tinymce-field.css', array(), SOW_BUNDLE_VERSION );
 
 
 
 
 
 
 
 
 
 
 
 
214
  }
215
-
216
  protected function sanitize_field_input( $value, $instance ) {
217
  if( current_user_can( 'unfiltered_html' ) ) {
218
  $sanitized_value = $value;
@@ -222,16 +459,16 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
222
  $sanitized_value = balanceTags( $sanitized_value , true );
223
  return $sanitized_value;
224
  }
225
-
226
  public function sanitize_instance( $instance ) {
227
  $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
228
  if( ! empty( $instance[ $selected_editor_name ] ) ) {
229
  $selected_editor = $instance[ $selected_editor_name ];
230
- $instance[ $selected_editor_name ] = in_array( $selected_editor, array( 'tinymce', 'tmce', 'html' ) ) ? $selected_editor : $this->default_editor;
231
  }
232
  return $instance;
233
  }
234
-
235
  public function get_selected_editor_field_name( $base_name ) {
236
  $v_name = $base_name;
237
  if( strpos($v_name, '][') !== false ) {
@@ -240,4 +477,20 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
240
  }
241
  return $v_name . '_selected_editor';
242
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
8
  * @var int
9
  */
10
  protected $rows = 10;
11
+ /**
12
+ * The editor initial height. Overrides rows if it is set.
13
+ *
14
+ * @access protected
15
+ * @var int
16
+ */
17
+ protected $editor_height;
18
  /**
19
  * The editor to be displayed initially.
20
  *
30
  */
31
  protected $selected_editor;
32
  /**
33
+ * An array of the buttons which will be rendered for the first toolbar of the TinyMCE editor.
34
  *
35
  * @access protected
36
+ * @var array
37
  */
38
+ protected $mce_buttons;
39
+ /**
40
+ * An array of the buttons which will be rendered for the second toolbar of the TinyMCE editor.
41
+ *
42
+ * @access protected
43
+ * @var array
44
+ */
45
+ protected $mce_buttons_2;
46
+ /**
47
+ * An array of the buttons which will be rendered for the third toolbar of the TinyMCE editor.
48
+ *
49
+ * @access protected
50
+ * @var array
51
+ */
52
+ protected $mce_buttons_3;
53
+ /**
54
+ * An array of the buttons which will be rendered for the fourth toolbar of the TinyMCE editor.
55
+ *
56
+ * @access protected
57
+ * @var array
58
+ */
59
+ protected $mce_buttons_4;
60
+ /**
61
+ * An array of the buttons which will be rendered for the QuickTags editor.
62
+ *
63
+ * @access protected
64
+ * @var array
65
+ */
66
+ protected $quicktags_buttons;
67
  /**
68
  * An array of filter callbacks to apply to the set of buttons which will be rendered for the editor.
69
  *
71
  * @var array
72
  */
73
  protected $button_filters;
74
+ /**
75
+ * An array of the included plugins to enable for the TinyMCE editor.
76
+ *
77
+ * @access protected
78
+ * @var array
79
+ */
80
+ protected $mce_plugins;
81
+ /**
82
+ * An array of external plugins for the TinyMCE editor.
83
+ *
84
+ * @access protected
85
+ * @var array
86
+ */
87
+ protected $mce_external_plugins;
88
+ /**
89
+ * Updated Editor JS API was introduced in WP 4.8 so need to check for compatibility with older versions.
90
+ *
91
+ * @access private
92
+ * @var bool
93
+ */
94
+ private $wp_version_lt_4_8;
95
+
96
+ protected function get_default_options() {
97
+ return array(
98
+ 'mce_buttons' => array(
99
+ 'formatselect',
100
+ 'bold',
101
+ 'italic',
102
+ 'bullist',
103
+ 'numlist',
104
+ 'blockquote',
105
+ 'alignleft',
106
+ 'aligncenter',
107
+ 'alignright',
108
+ 'link',
109
+ 'unlink',
110
+ 'wp_more',
111
+ 'wp_adv',
112
+ ),
113
+ 'mce_buttons_2' => array(
114
+ 'strikethrough',
115
+ 'hr',
116
+ 'forecolor',
117
+ 'pastetext',
118
+ 'removeformat',
119
+ 'charmap',
120
+ 'outdent',
121
+ 'indent',
122
+ 'undo',
123
+ 'redo',
124
+ 'wp_help',
125
+ ),
126
+ 'quicktags_buttons' => array(
127
+ 'strong',
128
+ 'em',
129
+ 'link',
130
+ 'block',
131
+ 'del',
132
+ 'ins',
133
+ 'img',
134
+ 'ul',
135
+ 'ol',
136
+ 'li',
137
+ 'code',
138
+ 'more',
139
+ 'close',
140
+ ),
141
+ 'mce_plugins' => array(
142
+ 'charmap',
143
+ 'colorpicker',
144
+ 'hr',
145
+ 'lists',
146
+ 'media',
147
+ 'paste',
148
+ 'tabfocus',
149
+ 'textcolor',
150
+ 'fullscreen',
151
+ 'wordpress',
152
+ 'wpautoresize',
153
+ 'wpeditimage',
154
+ 'wpemoji',
155
+ 'wpgallery',
156
+ 'wplink',
157
+ 'wpdialogs',
158
+ 'wptextpattern',
159
+ 'wpview',
160
+ ),
161
+ 'mce_external_plugins' => array(),
162
+ );
163
+ }
164
+
165
  protected function initialize() {
166
  if ( ! is_admin() ) {
167
  return;
168
  }
169
+
170
+ global $wp_version;
171
+ $this->wp_version_lt_4_8 = version_compare( $wp_version, '4.8', '<' );
172
+
173
+ if ( ! empty( $this->wp_version_lt_4_8 ) ) {
174
+ add_filter( 'mce_buttons', array( $this, 'mce_buttons_filter' ), 10, 2 );
175
+ add_filter( 'quicktags_settings', array( $this, 'quicktags_settings' ), 10, 2 );
176
+
177
+ if ( ! empty( $this->button_filters ) ) {
178
+ foreach ( $this->button_filters as $filter_name => $filter ) {
179
+ $is_valid_filter = preg_match(
180
+ '/mce_buttons(?:_[1-4])?|quicktags_settings/', $filter_name
181
+ ) && ! empty( $filter ) && is_callable( $filter );
182
+ if ( $is_valid_filter ) {
183
+ add_filter( $filter_name, array( $this, $filter_name ), 10, 2 );
184
+ }
185
  }
186
  }
187
  }
188
+
189
  if( class_exists( 'WC_Shortcodes_TinyMCE_Buttons' ) ) {
190
+ if ( ! empty( $this->wp_version_lt_4_8 ) ) {
191
+ $screen = get_current_screen();
192
+ if( ! is_null( $screen ) && $screen->id != 'widgets' ) {
193
+ add_filter( 'mce_external_plugins', array( $this, 'add_wpc_shortcodes_plugin' ), 15 );
194
+ add_filter( 'mce_buttons', array( $this, 'register_wpc_shortcodes_button' ), 15 );
195
+ }
196
+ } else {
197
+ $this->mce_external_plugins = $this->add_wpc_shortcodes_plugin( $this->mce_external_plugins );
198
+ $this->mce_buttons = $this->register_wpc_shortcodes_button( $this->mce_buttons );
199
  }
200
  }
201
+
202
  if( class_exists( 'WC_Shortcodes_Admin' ) ) {
203
+ if ( ! empty( $this->wp_version_lt_4_8 ) ) {
204
+
205
+ $screen = get_current_screen();
206
+ if( ! is_null( $screen ) && $screen->id != 'widgets' ) {
207
+ add_filter( 'mce_external_plugins', array( $this, 'add_wc_shortcodes_plugin' ), 15 );
208
+ add_filter( 'mce_buttons', array( $this, 'register_wc_shortcodes_button' ), 15 );
209
+ }
210
+ } else {
211
+ $this->mce_external_plugins = $this->add_wc_shortcodes_plugin( $this->mce_external_plugins );
212
+ $this->mce_buttons = $this->register_wc_shortcodes_button( $this->mce_buttons );
213
  }
214
  }
215
  }
216
+
217
+ function add_wc_shortcodes_plugin( $plugins ) {
218
  if( isset( $plugins['woocommerce_shortcodes'] ) ) {
219
  return $plugins;
220
  }
225
  }
226
  return $plugins;
227
  }
228
+
229
+ function register_wc_shortcodes_button( $buttons ) {
230
+ if( ! in_array( 'woocommerce_shortcodes', $buttons ) ) {
231
+ array_push( $buttons, '|', 'woocommerce_shortcodes' );
232
  }
 
233
  return $buttons;
234
  }
235
+
236
+ function add_wpc_shortcodes_plugin( $plugins ) {
 
 
 
 
237
  if( ! isset( $plugins['wpc_shortcodes'] ) ) {
238
+ $shortcodes_path = 'wc-shortcodes/includes/mce/js/shortcodes-tinymce-4.js';
239
+ if ( file_exists( WP_PLUGIN_DIR . '/' . $shortcodes_path ) ) {
240
+ $plugins['wpc_shortcodes'] = plugins_url( $shortcodes_path . '?ver=' . WC_SHORTCODES_VERSION );
 
241
  }
242
  }
243
+
244
  if( ! isset( $plugins['wpc_font_awesome'] ) ) {
245
+ $fontawesome_path = 'wc-shortcodes/includes/mce/js/font-awesome-tinymce-4.js';
246
+ if ( file_exists( WP_PLUGIN_DIR . '/' . $fontawesome_path ) ) {
247
+ $plugins['wpc_font_awesome'] = plugins_url( $fontawesome_path . '?ver=' . WC_SHORTCODES_VERSION );
 
248
  }
249
  }
250
+
251
  return $plugins;
252
  }
253
+
254
+ function register_wpc_shortcodes_button( $buttons ) {
255
  if( ! in_array( 'wpc_shortcodes_button', $buttons ) ) {
256
  array_push( $buttons, 'wpc_shortcodes_button' );
257
  }
258
  if( ! in_array( 'wpcfontAwesomeGlyphSelect', $buttons ) ) {
259
  array_push( $buttons, 'wpcfontAwesomeGlyphSelect' );
260
  }
261
+
262
  return $buttons;
263
  }
264
+
265
  /**
266
  * @param $name
267
  * @param $arguments
283
  }
284
  }
285
  }
286
+
287
  public function mce_buttons_filter( $buttons, $editor_id ) {
288
  if (($key = array_search('fullscreen', $buttons)) !== false) {
289
  unset($buttons[$key]);
290
  }
291
  return $buttons;
292
  }
293
+
294
  public function quicktags_settings( $settings, $editor_id ) {
295
  $settings['buttons'] = preg_replace( '/,fullscreen/', '', $settings['buttons'] );
296
  $settings['buttons'] = preg_replace( '/,dfw/', '', $settings['buttons'] );
297
  return $settings;
298
  }
299
+
300
+ protected function get_input_classes() {
301
+ $classes = parent::get_input_classes();
302
+ $classes[] = 'wp-editor-area';
303
+ return $classes;
304
+ }
305
+
306
  protected function render_before_field( $value, $instance ) {
307
  $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
308
  if( ! empty( $instance[ $selected_editor_name ] ) ) {
313
  }
314
  parent::render_before_field( $value, $instance );
315
  }
316
+
 
317
  protected function render_field( $value, $instance ) {
318
+
319
+ if ( $this->wp_version_lt_4_8 ) {
320
+ $this->render_field_pre48( $value, $instance );
321
+ return;
322
+ }
323
+
324
+ $selected_editor = in_array( $this->selected_editor, array( 'tinymce', 'tmce' ) ) ? 'tmce' : 'html';
325
+
326
+ $tmce_settings = array(
327
+ 'toolbar1' => apply_filters( 'mce_buttons', $this->mce_buttons, $this->element_id ),
328
+ 'toolbar2' => apply_filters( 'mce_buttons_2', $this->mce_buttons_2, $this->element_id ),
329
+ 'toolbar3' => apply_filters( 'mce_buttons_3',$this->mce_buttons_3, $this->element_id ),
330
+ 'toolbar4' => apply_filters( 'mce_buttons_4',$this->mce_buttons_4, $this->element_id ),
331
+ 'plugins' => array_unique( apply_filters( 'tiny_mce_plugins', $this->mce_plugins ) ),
332
+ );
333
+
334
+ foreach ( $tmce_settings as $name => $buttons ) {
335
+ $tmce_settings[ $name ] = is_array( $buttons ) ? implode( ',', $buttons ) : '';
336
+ }
337
+
338
+ $tmce_settings['external_plugins'] = array_unique( apply_filters( 'mce_external_plugins', $this->mce_external_plugins ) );
339
+
340
+ $qt_settings = apply_filters(
341
+ 'quicktags_settings',
342
+ array( 'buttons' => $this->quicktags_buttons ),
343
+ $this->element_id
344
+ );
345
+
346
+ $qt_settings['buttons'] = ! empty( $qt_settings['buttons'] ) ? $qt_settings['buttons'] : array();
347
+ $qt_settings['buttons'] = is_array( $qt_settings['buttons'] ) ? implode( ',', $qt_settings['buttons'] ) : '';
348
+
349
+ $settings = array(
350
+ 'selectedEditor' => $selected_editor,
351
+ 'tinymce' => array(
352
+ 'wp_skip_init' => strpos( $this->element_id, '__i__' ) != false ||
353
+ strpos( $this->element_id, '_id_' ) != false,
354
+ 'wpautop' => true,
355
+ ),
356
+ 'quicktags' => array(
357
+ 'buttons' => $qt_settings['buttons'],
358
+ ),
359
+ );
360
+
361
+ foreach ( $tmce_settings as $name => $setting ) {
362
+ if ( ! empty( $tmce_settings[ $name ] ) ) {
363
+ $settings['tinymce'][$name] = $setting;
364
+ }
365
+ }
366
+
367
+ $value = apply_filters( 'the_editor_content', $value, $this->selected_editor );
368
+
369
+ if ( false !== stripos( $value, 'textarea' ) ) {
370
+ $value = preg_replace( '%</textarea%i', '&lt;/textarea', $value );
371
+ }
372
+
373
+ $media_buttons = $this->render_media_buttons( $this->element_id );
374
+
375
+ ?><div class="siteorigin-widget-tinymce-container"
376
+ data-editor-settings="<?php echo esc_attr( json_encode( $settings ) ) ?>"
377
+ data-media-buttons="<?php echo esc_attr( json_encode( array( 'html' => $media_buttons ) ) ) ?>">
378
+ <textarea id="<?php echo esc_attr( $this->element_id ) ?>"
379
+ name="<?php echo esc_attr( $this->element_name ) ?>"
380
+ <?php if ( isset( $this->editor_height ) ) : ?>
381
+ style="height: <?php echo intval( $this->editor_height ) ?>px"
382
+ <?php else : ?>
383
+ rows="<?php echo esc_attr( $this->rows ) ?>"
384
+ <?php endif; ?>
385
+ <?php $this->render_data_attributes( $this->get_input_data_attributes() ) ?>
386
+ <?php $this->render_CSS_classes( $this->get_input_classes() ) ?>
387
+ <?php if ( ! empty( $this->placeholder ) ) echo 'placeholder="' . esc_attr( $this->placeholder ) . '"' ?>
388
+ <?php if( ! empty( $this->readonly ) ) echo 'readonly' ?>><?php echo $value ?></textarea>
389
+ </div>
390
+ <input type="hidden"
391
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
392
+ class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
393
+ value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
394
+ <?php
395
+
396
+ }
397
+
398
+ private function render_field_pre48( $value, $instance ) {
399
+
400
  $settings = array(
401
  'textarea_name' => esc_attr( $this->element_name ),
402
  'default_editor' => $this->selected_editor,
414
  data-mce-settings="<?php echo esc_attr( json_encode( $settings['tinymce'] ) ) ?>"
415
  data-qt-settings="<?php echo esc_attr( json_encode( array() ) ) ?>"
416
  data-widget-id-base="<?php echo esc_attr( $widget_id_base ) ?>"
417
+ >
418
  <?php
419
  wp_editor( $value, esc_attr( $this->element_id ), $settings )
420
  ?>
421
  </div>
422
  <input type="hidden"
423
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
424
+ class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
425
+ value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
426
  <?php
427
+
428
  if( $this->selected_editor == 'html' ) {
429
  remove_filter( 'the_editor_content', 'wp_htmledit_pre' );
430
  }
432
  remove_filter( 'the_editor_content', 'wp_richedit_pre' );
433
  }
434
  }
435
+
436
  public function enqueue_scripts() {
437
+
438
+ if ( $this->wp_version_lt_4_8 ) {
439
+ $src = plugin_dir_url( __FILE__ ) . 'js/tinymce-field-pre48' . SOW_BUNDLE_JS_SUFFIX . '.js';
440
+ $deps = array( 'jquery', 'editor', 'quicktags' );
441
+ } else {
442
+ wp_enqueue_editor();
443
+ $src = plugin_dir_url( __FILE__ ) . 'js/tinymce-field' . SOW_BUNDLE_JS_SUFFIX . '.js';
444
+ $deps = array( 'jquery' );
445
+ }
446
+
447
+ wp_enqueue_script( 'so-tinymce-field', $src, $deps, SOW_BUNDLE_VERSION );
448
+ wp_enqueue_style(
449
+ 'so-tinymce-field', plugin_dir_url( __FILE__ ) . 'css/tinymce-field.css', array(), SOW_BUNDLE_VERSION
450
+ );
451
  }
452
+
453
  protected function sanitize_field_input( $value, $instance ) {
454
  if( current_user_can( 'unfiltered_html' ) ) {
455
  $sanitized_value = $value;
459
  $sanitized_value = balanceTags( $sanitized_value , true );
460
  return $sanitized_value;
461
  }
462
+
463
  public function sanitize_instance( $instance ) {
464
  $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
465
  if( ! empty( $instance[ $selected_editor_name ] ) ) {
466
  $selected_editor = $instance[ $selected_editor_name ];
467
+ $instance[ $selected_editor_name ] = in_array( $selected_editor, array( 'tinymce', 'tmce', 'quicktags', 'html' ) ) ? $selected_editor : $this->default_editor;
468
  }
469
  return $instance;
470
  }
471
+
472
  public function get_selected_editor_field_name( $base_name ) {
473
  $v_name = $base_name;
474
  if( strpos($v_name, '][') !== false ) {
477
  }
478
  return $v_name . '_selected_editor';
479
  }
480
+
481
+ private function render_media_buttons( $editor_id ) {
482
+
483
+ ob_start();
484
+ if ( ! function_exists( 'media_buttons' ) ) {
485
+ include( ABSPATH . 'wp-admin/includes/media.php' );
486
+ }
487
+
488
+ echo '<div id="wp-' . esc_attr( $editor_id ) . '-media-buttons" class="wp-media-buttons">';
489
+
490
+ do_action( 'media_buttons', $editor_id );
491
+
492
+ echo "</div>\n";
493
+
494
+ return ob_get_clean();
495
+ }
496
  }
base/js/admin.js CHANGED
@@ -12,6 +12,7 @@ var sowbForms = window.sowbForms || {};
12
  formId,
13
  formInitializing = true;
14
 
 
15
  // Skip this if the widget has any fields with an __i__
16
  var $inputs = $el.find('input[name]');
17
  if ($inputs.length && $inputs.attr('name').indexOf('__i__') !== -1) {
@@ -25,7 +26,7 @@ var sowbForms = window.sowbForms || {};
25
  }
26
  // If we're in the main widgets interface and the form isn't visible and it isn't contained in a
27
  // panels dialog (when using the Layout Builder widget), don't worry about setting it up.
28
- if ($('body').hasClass('widgets-php') && !$el.is(':visible') && $el.closest('.panel-dialog').length === 0) {
29
  return true;
30
  }
31
 
@@ -232,11 +233,15 @@ var sowbForms = window.sowbForms || {};
232
  ///////////////////////////////////////
233
  // Handle the sections
234
  var expandContainer = function () {
235
- var $$ = $(this);
236
  $(this).toggleClass('siteorigin-widget-section-visible');
237
- $(this).siblings('.siteorigin-widget-section').slideToggle(function () {
238
  $(window).resize();
239
  $(this).find('> .siteorigin-widget-field-container-state').val($(this).is(':visible') ? 'open' : 'closed');
 
 
 
 
 
240
  });
241
  };
242
  $fields.filter('.siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section').find('> label').click(expandContainer);
@@ -439,6 +444,14 @@ var sowbForms = window.sowbForms || {};
439
 
440
  $el.find('.siteorigin-widget-field-repeater-item').trigger('updateFieldPositions');
441
 
 
 
 
 
 
 
 
 
442
  /////////////////////////////
443
  // The end of the form setup.
444
  /////////////////////////////
@@ -547,6 +560,18 @@ var sowbForms = window.sowbForms || {};
547
  items: '> .siteorigin-widget-field-repeater-item',
548
  update: function () {
549
  $items.trigger('updateFieldPositions');
 
 
 
 
 
 
 
 
 
 
 
 
550
  }
551
  });
552
  $items.trigger('updateFieldPositions');
@@ -657,6 +682,9 @@ var sowbForms = window.sowbForms || {};
657
  $(window).resize();
658
  if ($(this).is(':visible')) {
659
  $(this).trigger('slideToggleOpenComplete');
 
 
 
660
  }
661
  else {
662
  $(this).trigger('slideToggleCloseComplete');
@@ -1082,16 +1110,19 @@ var sowbForms = window.sowbForms || {};
1082
  }, 200);
1083
  });
1084
 
1085
- if ($('body').hasClass('wp-customizer')) {
1086
  // Setup new widgets when they're added in the customizer interface
1087
  $(document).on('widget-added', function (e, widget) {
1088
  widget.find('.siteorigin-widget-form').sowSetupForm();
1089
  });
1090
  }
1091
 
1092
- // When we open a Page Builder widget dialog
1093
- $(document).on('dialogopen', function (e) {
1094
- $(e.target).find('.siteorigin-widget-form-main').sowSetupForm();
 
 
 
1095
  });
1096
 
1097
  $(function () {
12
  formId,
13
  formInitializing = true;
14
 
15
+ var $body = $( 'body' );
16
  // Skip this if the widget has any fields with an __i__
17
  var $inputs = $el.find('input[name]');
18
  if ($inputs.length && $inputs.attr('name').indexOf('__i__') !== -1) {
26
  }
27
  // If we're in the main widgets interface and the form isn't visible and it isn't contained in a
28
  // panels dialog (when using the Layout Builder widget), don't worry about setting it up.
29
+ if ($body.hasClass('widgets-php') && !$el.is(':visible') && $el.closest('.panel-dialog').length === 0) {
30
  return true;
31
  }
32
 
233
  ///////////////////////////////////////
234
  // Handle the sections
235
  var expandContainer = function () {
 
236
  $(this).toggleClass('siteorigin-widget-section-visible');
237
+ $(this).siblings('.siteorigin-widget-section').slideToggle('fast', function () {
238
  $(window).resize();
239
  $(this).find('> .siteorigin-widget-field-container-state').val($(this).is(':visible') ? 'open' : 'closed');
240
+
241
+ if ( $( this ).is( ':visible' ) ) {
242
+ var $fields = $( this ).find( '> .siteorigin-widget-field' );
243
+ $fields.trigger( 'sowsetupformfield' );
244
+ }
245
  });
246
  };
247
  $fields.filter('.siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section').find('> label').click(expandContainer);
444
 
445
  $el.find('.siteorigin-widget-field-repeater-item').trigger('updateFieldPositions');
446
 
447
+ if ( $body.hasClass( 'wp-customizer' ) || $body.hasClass( 'widgets-php' ) ) {
448
+ // Reinitialize widget fields when they're dragged and dropped.
449
+ $el.closest( '.ui-sortable' ).on( 'sortstop', function (event, ui) {
450
+ var $fields = ui.item.find( '.siteorigin-widget-form' ).find( '> .siteorigin-widget-field' );
451
+ $fields.trigger( 'sowsetupformfield' );
452
+ } );
453
+ }
454
+
455
  /////////////////////////////
456
  // The end of the form setup.
457
  /////////////////////////////
560
  items: '> .siteorigin-widget-field-repeater-item',
561
  update: function () {
562
  $items.trigger('updateFieldPositions');
563
+ },
564
+ sortstop: function (event, ui) {
565
+ if ( ui.item.is( '.siteorigin-widget-field-repeater-item' ) ) {
566
+ ui.item.find( '> .siteorigin-widget-field-repeater-item-form' ).each( function () {
567
+ var $fields = $( this ).find( '> .siteorigin-widget-field' );
568
+ $fields.trigger( 'sowsetupformfield' );
569
+ } );
570
+ }
571
+ else {
572
+ var $fields = ui.item.find( '.siteorigin-widget-form' ).find( '> .siteorigin-widget-field' );
573
+ $fields.trigger( 'sowsetupformfield' );
574
+ }
575
  }
576
  });
577
  $items.trigger('updateFieldPositions');
682
  $(window).resize();
683
  if ($(this).is(':visible')) {
684
  $(this).trigger('slideToggleOpenComplete');
685
+
686
+ var $fields = $( this ).find( '> .siteorigin-widget-field' );
687
+ $fields.trigger( 'sowsetupformfield' );
688
  }
689
  else {
690
  $(this).trigger('slideToggleCloseComplete');
1110
  }, 200);
1111
  });
1112
 
1113
+ if ( $('body').hasClass('wp-customizer') ) {
1114
  // Setup new widgets when they're added in the customizer interface
1115
  $(document).on('widget-added', function (e, widget) {
1116
  widget.find('.siteorigin-widget-form').sowSetupForm();
1117
  });
1118
  }
1119
 
1120
+ $( document ).on( 'open_dialog', function ( e, dialog ) {
1121
+ // When we open a Page Builder edit widget dialog
1122
+ if ( dialog.$el.find( '.so-panels-dialog' ).is( '.so-panels-dialog-edit-widget' ) ) {
1123
+ var $fields = $( e.target ).find( '.siteorigin-widget-form-main' ).find( '> .siteorigin-widget-field' );
1124
+ $fields.trigger( 'sowsetupformfield' );
1125
+ }
1126
  });
1127
 
1128
  $(function () {
base/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,r,a=e(t),s=!0,o=a.find("input[name]");if(o.length&&o.attr("name").indexOf("__i__")!==-1)return this;if(a.is(".siteorigin-widget-form-main")){if(a.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!a.is(":visible")&&0===a.closest(".panel-dialog").length)return!0;a.on("sowstatechange",function(i,t,n){a.find("[data-state-handler]").each(function(){var i=e(this),r=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(r).length)return!0;var a,o,d,l,f,g,p={},c=sowbForms.getRepeaterId(i);if(c!==!1){var u={};for(var m in r)u[m.replace("{$repeater}",c)]=r[m];r=u}for(var m in r)if(f=!1,a=m.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/),null!==a){if(o={group:"default",name:"",multi:!1},void 0!==a[2]?(o.group=a[1],o.name=a[3]):o.name=a[0],o.multi=void 0!==a[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof p[o.group];else{g=o.name.split(",").map(function(e){return e.trim()});for(var w=0;w<g.length&&!(f=o.group===t&&g[w]===n);w++);}if(f){d=r[m],o.multi||(d=[d]);for(var w=0;w<d.length;w++)l="undefined"!=typeof d[w][1]&&Boolean(d[w][1])?i.find(d[w][1]):i,l[d[w][0]].apply(l,"undefined"!=typeof d[w][2]?d[w][2]:[]);p[o.group]=!0}}})}),a.sowSetupPreview(),n=a;var d=a.find(".siteorigin-widget-teaser");d.find(".dashicons-dismiss").click(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",function(){d.remove()})});var l=a.find("> .siteorigin-widgets-form-id").val(),f=a.find("> .siteorigin-widgets-form-timestamp"),g=parseInt(f.val()||0),p=JSON.parse(sessionStorage.getItem(l));if(p)if(p._sow_form_timestamp>g){var c=e('<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>");a.prepend(c),c.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(n,p),c.slideUp("fast",function(){c.remove()})}),c.find(".so-backup-dismiss").click(function(){c.slideUp("fast",function(){sessionStorage.removeItem(l),c.remove()})})}else sessionStorage.removeItem(l);a.change(function(){f.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(a);sessionStorage.setItem(l,JSON.stringify(e))})}else n=a.closest(".siteorigin-widget-form-main");r=n.find("> .siteorigin-widgets-form-id").val();var u=a.find("> .siteorigin-widget-field");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),u.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),u.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),a.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),u.find("> .siteorigin-widget-input-color").each(function(){var i=e(this),t={change:function(i,t){setTimeout(function(){e(i.target).trigger("change")},100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)});var m=function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})};u.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(m),u.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(m),u.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,i){t.val(parseInt(i.value)),t.trigger("change")},change:function(e,t){i.find(".siteorigin-widget-slider-value").html(t.value)}}),t.change(function(e,i){i&&i.silent||n.slider("value",parseInt(t.val()))})}),u.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search"),r=n.val(),a=n.data("postTypes"),s=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:r,postTypes:a},function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label="&nbsp;"),s.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]));s.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var r=i.find(".existing-content-selector");r.toggle(),r.is(":visible")&&0===r.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("value")),i.find(".existing-content-selector").toggle()});var r=null;i.find(".content-text-search").keyup(function(){null!==r&&clearTimeout(r),r=setTimeout(function(){n()},500)})}),"undefined"!=typeof jQuery.fn.soPanelsSetupBuilderWidget&&u.filter(".siteorigin-widget-field-type-builder").each(function(){var i=e(this);i.find("> .siteorigin-page-builder-field").soPanelsSetupBuilderWidget()});var w=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var r=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var r=sowbForms.getRepeaterId(i);r!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",r)}));var a=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(n,sowEmitters[t.callback](a,t.args))},a={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=r(t[s],a);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in a)"undefined"!=typeof o[d]&&a[d]===o[d]||(o[d]=a[d],n.trigger("sowstatechange",[d,a[d]]));n.data("states",o)}};u.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",w),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&w.call(i[0]):w.call(i[0])})}),a.trigger("sowsetupform",u).data("sow-form-setup",!0),u.trigger("sowsetupformfield"),a.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n=sowbForms.getWidgetFormValues(i),r=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");r.find('input[name="data"]').val(JSON.stringify(n)),r.find('input[name="class"]').val(i.data("class")),r.find("iframe").on("load",function(){e(this).css("visibility","visible")}),r.find("form").submit(),r.find(".close").click(function(){r.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),r=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");r.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var r=e(n).data("repeater-positions");"undefined"==typeof r&&(r={}),r[a]=i,e(n).data("repeater-positions",r)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),r=e(t);if("undefined"!=typeof n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}}),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t);n.prop("checked",n.prop("defaultChecked"))}),i.data("initialSetup",!0));var r=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(r>0&&t.length>r){var s=t.first().outerHeight();i.css("max-height",s*r).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),r.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){r.trigger("updateFieldPositions")}}),r.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),r=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=a.html().replace(/_id_/g,r),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var r=n.closest(".siteorigin-widget-field-repeater"),a=n.find("> .siteorigin-widget-field-repeater-item-top"),s=r.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}a.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(window).resize(),e(this).is(":visible")?e(this).trigger("slideToggleOpenComplete"):e(this).trigger("slideToggleCloseComplete")}))}),a.find(".siteorigin-widget-field-remove").click(function(i,t){i.preventDefault();var n=e(this).closest(".siteorigin-widget-field-repeater-items"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=function(){r.remove(),n.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()};t&&t.silent?a():confirm(soWidgets.sure)&&r.slideUp("fast",a)}),a.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=r.clone(),s=r.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var g=i.closest(".wp-picker-container"),p=i.closest(".siteorigin-widget-field");g.remove(),p.append(i.remove())}else{var c=r.find('[name="'+l+'"]');c.length&&null!=c.val()&&i.val(c.val())}if(s){var u,m,w;if(i.is('[type="radio"]')){m=s.replace(/-\d+-\d+$/,"");var v=s.replace(/-\d+$/,"");if(!d[m]){var h={};d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").filter(function(i,t){var n=e(t).attr("name");return!h[n]&&(h[n]=!0,!0)}).length+1}var b=m+"-"+d[m];w=b+s.match(/-\d+$/)[0],a.find("label[for="+v+"]").attr("for",b)}else u=new RegExp("-\\d+$"),m=s.replace(u,""),d[m]||(d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").length+1),w=m+"-"+d[m]++;i.attr("id",w),a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var y=r.parents(".siteorigin-widget-field-repeater").length,k=e("body");(k.hasClass("wp-customizer")||k.hasClass("widgets-php"))&&0===n.closest(".panel-dialog").length&&(y+=1);var F=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(y-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",F),i.data("original-name",F)}),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})},sowbForms.getRepeaterId=function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var r=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],a=r.split("]["),s=a.length?n:null;a.length;)s=s[a.shift()];return s[t]},sowbForms.fetchWidgetVariable=function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each(function(){var i=e(this);try{var n=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(n))return!0;n=n[1];var r=n.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),function(i,t){return e(i).val()}))}else s=i.val();for(var f=0;f<r.length;f++)f===r.length-1?""===r[f]?a.push(s):a[r[f]]=s:(_.isUndefined(a[r[f]])&&(_.isNumber(r[f+1])||""===r[f+1]?a[r[f]]=[]:a[r[f]]={}),a=a[r[f]])}catch(g){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+g.message)}}),t},sowbForms.setWidgetFormValues=function(i,t){var n=0,r=function(i,t){10!==++n&&i.find("> .siteorigin-widget-field-type-repeater").each(function(){var i=e(this).find("> .siteorigin-widget-field-repeater"),n=i.data("repeaterName"),a=t.hasOwnProperty(n)?t[n]:null;if(a&&Array.isArray(a)&&0!==a.length){var s=i.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),o=a.length,d=s.length;if(o>d)for(var l=0;l<o-d;l++)i.find("> .siteorigin-widget-field-repeater-add").click();else if(o<d)for(var f=o;f<d;f++){var g=e(s.eq(f));g.find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}s=i.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var p=0;p<s.length;p++)s.eq(p).find("> .siteorigin-widget-field-repeater-item-form"),r(s.eq(p).find("> .siteorigin-widget-field-repeater-item-form"),a[p])}})};r(i,t),i.find("*[name]").each(function(){var i=e(this),n=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===n)return!0;n=n[1];var r=n.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var a,s=t,o=0;o<r.length;o++)o===r.length-1?a=s[r[o]]:s=s[r[o]];if("checkbox"===i.attr("type"))i.prop("checked",a);else if("radio"===i.attr("type"))i.prop("checked",a===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),null===d||"function"!=typeof d.getContent||d.isHidden()?i.val(a):d.setContent(a)}else i.val(a);i.trigger("change")})},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(function(){e(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),n=t.exec(e);if(null===n)return!1;var r="",a="default";return void 0!==n[3]?(a=n[1],r=n[3]):r=n[1],{match:n[4].trim(),group:a,state:r}},_checker:function(e,i,t,n){var r={};"undefined"==typeof i.length&&(i=[i]);for(var a,s=0;s<i.length;s++)a=sowEmitters._match(i[s],t),a!==!1&&("_true"===a.match||n(e,i,a.match))&&(r[a.group]=a.state);return r},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=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 t.split(",").map(function(e){return e.trim()}).indexOf(e)!==-1})}};window.sowbForms=sowbForms;
1
+ var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,r,a=e(t),s=!0,o=e("body"),d=a.find("input[name]");if(d.length&&d.attr("name").indexOf("__i__")!==-1)return this;if(a.is(".siteorigin-widget-form-main")){if(a.data("sow-form-setup")===!0)return!0;if(o.hasClass("widgets-php")&&!a.is(":visible")&&0===a.closest(".panel-dialog").length)return!0;a.on("sowstatechange",function(i,t,n){a.find("[data-state-handler]").each(function(){var i=e(this),r=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(r).length)return!0;var a,o,d,l,f,g,p={},c=sowbForms.getRepeaterId(i);if(c!==!1){var u={};for(var m in r)u[m.replace("{$repeater}",c)]=r[m];r=u}for(var m in r)if(f=!1,a=m.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/),null!==a){if(o={group:"default",name:"",multi:!1},void 0!==a[2]?(o.group=a[1],o.name=a[3]):o.name=a[0],o.multi=void 0!==a[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof p[o.group];else{g=o.name.split(",").map(function(e){return e.trim()});for(var w=0;w<g.length&&!(f=o.group===t&&g[w]===n);w++);}if(f){d=r[m],o.multi||(d=[d]);for(var w=0;w<d.length;w++)l="undefined"!=typeof d[w][1]&&Boolean(d[w][1])?i.find(d[w][1]):i,l[d[w][0]].apply(l,"undefined"!=typeof d[w][2]?d[w][2]:[]);p[o.group]=!0}}})}),a.sowSetupPreview(),n=a;var l=a.find(".siteorigin-widget-teaser");l.find(".dashicons-dismiss").click(function(){var i=e(this);e.get(i.data("dismiss-url")),l.slideUp("normal",function(){l.remove()})});var f=a.find("> .siteorigin-widgets-form-id").val(),g=a.find("> .siteorigin-widgets-form-timestamp"),p=parseInt(g.val()||0),c=JSON.parse(sessionStorage.getItem(f));if(c)if(c._sow_form_timestamp>p){var u=e('<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>");a.prepend(u),u.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(n,c),u.slideUp("fast",function(){u.remove()})}),u.find(".so-backup-dismiss").click(function(){u.slideUp("fast",function(){sessionStorage.removeItem(f),u.remove()})})}else sessionStorage.removeItem(f);a.change(function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(a);sessionStorage.setItem(f,JSON.stringify(e))})}else n=a.closest(".siteorigin-widget-form-main");r=n.find("> .siteorigin-widgets-form-id").val();var m=a.find("> .siteorigin-widget-field");m.find("> .siteorigin-widget-section").sowSetupForm(),m.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),m.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),m.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),a.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),m.find("> .siteorigin-widget-input-color").each(function(){var i=e(this),t={change:function(i,t){setTimeout(function(){e(i.target).trigger("change")},100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)});var w=function(){e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle("fast",function(){if(e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible")){var i=e(this).find("> .siteorigin-widget-field");i.trigger("sowsetupformfield")}})};m.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(w),m.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(w),m.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,i){t.val(parseInt(i.value)),t.trigger("change")},change:function(e,t){i.find(".siteorigin-widget-slider-value").html(t.value)}}),t.change(function(e,i){i&&i.silent||n.slider("value",parseInt(t.val()))})}),m.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search"),r=n.val(),a=n.data("postTypes"),s=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:r,postTypes:a},function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label="&nbsp;"),s.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]));s.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var r=i.find(".existing-content-selector");r.toggle(),r.is(":visible")&&0===r.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("value")),i.find(".existing-content-selector").toggle()});var r=null;i.find(".content-text-search").keyup(function(){null!==r&&clearTimeout(r),r=setTimeout(function(){n()},500)})}),"undefined"!=typeof jQuery.fn.soPanelsSetupBuilderWidget&&m.filter(".siteorigin-widget-field-type-builder").each(function(){var i=e(this);i.find("> .siteorigin-page-builder-field").soPanelsSetupBuilderWidget()});var v=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var r=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var r=sowbForms.getRepeaterId(i);r!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",r)}));var a=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(n,sowEmitters[t.callback](a,t.args))},a={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=r(t[s],a);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in a)"undefined"!=typeof o[d]&&a[d]===o[d]||(o[d]=a[d],n.trigger("sowstatechange",[d,a[d]]));n.data("states",o)}};m.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",v),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&v.call(i[0]):v.call(i[0])})}),a.trigger("sowsetupform",m).data("sow-form-setup",!0),m.trigger("sowsetupformfield"),a.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(o.hasClass("wp-customizer")||o.hasClass("widgets-php"))&&a.closest(".ui-sortable").on("sortstop",function(e,i){var t=i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field");t.trigger("sowsetupformfield")}),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n=sowbForms.getWidgetFormValues(i),r=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");r.find('input[name="data"]').val(JSON.stringify(n)),r.find('input[name="class"]').val(i.data("class")),r.find("iframe").on("load",function(){e(this).css("visibility","visible")}),r.find("form").submit(),r.find(".close").click(function(){r.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),r=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");r.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var r=e(n).data("repeater-positions");"undefined"==typeof r&&(r={}),r[a]=i,e(n).data("repeater-positions",r)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),r=e(t);if("undefined"!=typeof n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}}),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t);n.prop("checked",n.prop("defaultChecked"))}),i.data("initialSetup",!0));var r=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(r>0&&t.length>r){var s=t.first().outerHeight();i.css("max-height",s*r).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),r.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){r.trigger("updateFieldPositions")},sortstop:function(i,t){if(t.item.is(".siteorigin-widget-field-repeater-item"))t.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){var i=e(this).find("> .siteorigin-widget-field");i.trigger("sowsetupformfield")});else{var n=t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field");n.trigger("sowsetupformfield")}}}),r.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),r=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=a.html().replace(/_id_/g,r),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var r=n.closest(".siteorigin-widget-field-repeater"),a=n.find("> .siteorigin-widget-field-repeater-item-top"),s=r.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}a.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){if(e(window).resize(),e(this).is(":visible")){e(this).trigger("slideToggleOpenComplete");var i=e(this).find("> .siteorigin-widget-field");i.trigger("sowsetupformfield")}else e(this).trigger("slideToggleCloseComplete")}))}),a.find(".siteorigin-widget-field-remove").click(function(i,t){i.preventDefault();var n=e(this).closest(".siteorigin-widget-field-repeater-items"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=function(){r.remove(),n.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()};t&&t.silent?a():confirm(soWidgets.sure)&&r.slideUp("fast",a)}),a.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=r.clone(),s=r.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var g=i.closest(".wp-picker-container"),p=i.closest(".siteorigin-widget-field");g.remove(),p.append(i.remove())}else{var c=r.find('[name="'+l+'"]');c.length&&null!=c.val()&&i.val(c.val())}if(s){var u,m,w;if(i.is('[type="radio"]')){m=s.replace(/-\d+-\d+$/,"");var v=s.replace(/-\d+$/,"");if(!d[m]){var h={};d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").filter(function(i,t){var n=e(t).attr("name");return!h[n]&&(h[n]=!0,!0)}).length+1}var b=m+"-"+d[m];w=b+s.match(/-\d+$/)[0],a.find("label[for="+v+"]").attr("for",b)}else u=new RegExp("-\\d+$"),m=s.replace(u,""),d[m]||(d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").length+1),w=m+"-"+d[m]++;i.attr("id",w),a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var y=r.parents(".siteorigin-widget-field-repeater").length,k=e("body");(k.hasClass("wp-customizer")||k.hasClass("widgets-php"))&&0===n.closest(".panel-dialog").length&&(y+=1);var _=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(y-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",_),i.data("original-name",_)}),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})},sowbForms.getRepeaterId=function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var r=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],a=r.split("]["),s=a.length?n:null;a.length;)s=s[a.shift()];return s[t]},sowbForms.fetchWidgetVariable=function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each(function(){var i=e(this);try{var n=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(n))return!0;n=n[1];var r=n.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),function(i,t){return e(i).val()}))}else s=i.val();for(var f=0;f<r.length;f++)f===r.length-1?""===r[f]?a.push(s):a[r[f]]=s:(_.isUndefined(a[r[f]])&&(_.isNumber(r[f+1])||""===r[f+1]?a[r[f]]=[]:a[r[f]]={}),a=a[r[f]])}catch(g){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+g.message)}}),t},sowbForms.setWidgetFormValues=function(i,t){var n=0,r=function(i,t){10!==++n&&i.find("> .siteorigin-widget-field-type-repeater").each(function(){var i=e(this).find("> .siteorigin-widget-field-repeater"),n=i.data("repeaterName"),a=t.hasOwnProperty(n)?t[n]:null;if(a&&Array.isArray(a)&&0!==a.length){var s=i.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),o=a.length,d=s.length;if(o>d)for(var l=0;l<o-d;l++)i.find("> .siteorigin-widget-field-repeater-add").click();else if(o<d)for(var f=o;f<d;f++){var g=e(s.eq(f));g.find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}s=i.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var p=0;p<s.length;p++)s.eq(p).find("> .siteorigin-widget-field-repeater-item-form"),r(s.eq(p).find("> .siteorigin-widget-field-repeater-item-form"),a[p])}})};r(i,t),i.find("*[name]").each(function(){var i=e(this),n=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===n)return!0;n=n[1];var r=n.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var a,s=t,o=0;o<r.length;o++)o===r.length-1?a=s[r[o]]:s=s[r[o]];if("checkbox"===i.attr("type"))i.prop("checked",a);else if("radio"===i.attr("type"))i.prop("checked",a===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),null===d||"function"!=typeof d.getContent||d.isHidden()?i.val(a):d.setContent(a)}else i.val(a);i.trigger("change")})},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("open_dialog",function(i,t){if(t.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")){var n=e(i.target).find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field");n.trigger("sowsetupformfield")}}),e(function(){e(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),n=t.exec(e);if(null===n)return!1;var r="",a="default";return void 0!==n[3]?(a=n[1],r=n[3]):r=n[1],{match:n[4].trim(),group:a,state:r}},_checker:function(e,i,t,n){var r={};"undefined"==typeof i.length&&(i=[i]);for(var a,s=0;s<i.length;s++)a=sowEmitters._match(i[s],t),a!==!1&&("_true"===a.match||n(e,i,a.match))&&(r[a.group]=a.state);return r},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=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 t.split(",").map(function(e){return e.trim()}).indexOf(e)!==-1})}};window.sowbForms=sowbForms;
lang/so-widgets-bundle.pot CHANGED
@@ -105,11 +105,11 @@ msgstr ""
105
  msgid "This field requires: "
106
  msgstr ""
107
 
108
- #: tmp/base/inc/fields/builder.class.php:37, tmp/widgets/layout-slider/layout-slider.php:196
109
  msgid "SiteOrigin Page Builder"
110
  msgstr ""
111
 
112
- #: tmp/base/inc/fields/date-range.class.php:31, tmp/base/inc/fields/date-range.class.php:45
113
  msgid "From"
114
  msgstr ""
115
 
@@ -533,7 +533,7 @@ msgstr ""
533
  msgid "SiteOrigin Widget"
534
  msgstr ""
535
 
536
- #: tmp/compat/visual-composer/visual-composer.php:40, tmp/so-widgets-bundle.php:424, tmp/so-widgets-bundle.php:425
537
  msgid "SiteOrigin Widgets"
538
  msgstr ""
539
 
@@ -573,23 +573,23 @@ msgstr ""
573
  msgid "A new widget!"
574
  msgstr ""
575
 
576
- #: tmp/so-widgets-bundle.php:450
577
  msgid "%s was %s"
578
  msgstr ""
579
 
580
- #: tmp/so-widgets-bundle.php:452
581
  msgid "Activated"
582
  msgstr ""
583
 
584
- #: tmp/so-widgets-bundle.php:452
585
  msgid "Deactivated"
586
  msgstr ""
587
 
588
- #: tmp/so-widgets-bundle.php:699
589
  msgid "Manage Widgets"
590
  msgstr ""
591
 
592
- #: tmp/so-widgets-bundle.php:700
593
  msgid "Support"
594
  msgstr ""
595
 
@@ -605,7 +605,7 @@ msgstr ""
605
  msgid "Button text"
606
  msgstr ""
607
 
608
- #: tmp/widgets/button/button.php:50, tmp/widgets/google-map/google-map.php:104, tmp/widgets/headline/headline.php:44, tmp/widgets/headline/headline.php:115, tmp/widgets/hero/hero.php:119, tmp/widgets/icon/icon.php:56, tmp/widgets/image/image.php:76, tmp/widgets/layout-slider/layout-slider.php:86, tmp/widgets/simple-masonry/simple-masonry.php:78, tmp/widgets/slider/slider.php:84
609
  msgid "Destination URL"
610
  msgstr ""
611
 
@@ -681,7 +681,7 @@ msgstr ""
681
  msgid "Button color"
682
  msgstr ""
683
 
684
- #: tmp/widgets/button/button.php:124, tmp/widgets/contact/contact.php:547, tmp/widgets/hero/hero.php:244, tmp/widgets/layout-slider/layout-slider.php:180
685
  msgid "Text color"
686
  msgstr ""
687
 
@@ -1029,7 +1029,7 @@ msgstr ""
1029
  msgid "Container"
1030
  msgstr ""
1031
 
1032
- #: tmp/widgets/contact/contact.php:280, tmp/widgets/contact/contact.php:509, tmp/widgets/cta/cta.php:77, tmp/widgets/hero/hero.php:113, tmp/widgets/layout-slider/layout-slider.php:80, tmp/widgets/social-media-buttons/social-media-buttons.php:74
1033
  msgid "Background color"
1034
  msgstr ""
1035
 
@@ -1117,7 +1117,7 @@ msgstr ""
1117
  msgid "Margin"
1118
  msgstr ""
1119
 
1120
- #: tmp/widgets/contact/contact.php:395, tmp/widgets/google-map/google-map.php:100, tmp/widgets/hero/hero.php:156, tmp/widgets/layout-slider/layout-slider.php:123
1121
  msgid "Height"
1122
  msgstr ""
1123
 
@@ -1933,51 +1933,51 @@ msgstr ""
1933
  msgid "Background image type"
1934
  msgstr ""
1935
 
1936
- #: tmp/widgets/hero/hero.php:98, tmp/widgets/layout-slider/layout-slider.php:65, tmp/widgets/slider/slider.php:69
1937
  msgid "Cover"
1938
  msgstr ""
1939
 
1940
- #: tmp/widgets/hero/hero.php:104, tmp/widgets/layout-slider/layout-slider.php:71
1941
  msgid "Background image opacity"
1942
  msgstr ""
1943
 
1944
- #: tmp/widgets/hero/hero.php:124, tmp/widgets/layout-slider/layout-slider.php:91
1945
  msgid "Open URL in a new window"
1946
  msgstr ""
1947
 
1948
- #: tmp/widgets/hero/hero.php:129, tmp/widgets/layout-slider/layout-slider.php:96, tmp/widgets/slider/slider.php:43
1949
  msgid "Video"
1950
  msgstr ""
1951
 
1952
- #: tmp/widgets/hero/hero.php:130, tmp/widgets/layout-slider/layout-slider.php:97, tmp/widgets/slider/slider.php:44
1953
  msgid "Background videos"
1954
  msgstr ""
1955
 
1956
- #: tmp/widgets/hero/hero.php:145, tmp/widgets/layout-slider/layout-slider.php:112
1957
  msgid "Slider Controls"
1958
  msgstr ""
1959
 
1960
- #: tmp/widgets/hero/hero.php:151, tmp/widgets/layout-slider/layout-slider.php:118
1961
  msgid "Design and Layout"
1962
  msgstr ""
1963
 
1964
- #: tmp/widgets/hero/hero.php:162, tmp/widgets/layout-slider/layout-slider.php:129
1965
  msgid "Top and bottom padding"
1966
  msgstr ""
1967
 
1968
- #: tmp/widgets/hero/hero.php:168, tmp/widgets/layout-slider/layout-slider.php:135
1969
  msgid "Extra top padding"
1970
  msgstr ""
1971
 
1972
- #: tmp/widgets/hero/hero.php:169, tmp/widgets/layout-slider/layout-slider.php:136
1973
  msgid "Additional padding added to the top of the slider"
1974
  msgstr ""
1975
 
1976
- #: tmp/widgets/hero/hero.php:175, tmp/widgets/layout-slider/layout-slider.php:142
1977
  msgid "Side padding"
1978
  msgstr ""
1979
 
1980
- #: tmp/widgets/hero/hero.php:181, tmp/widgets/layout-slider/layout-slider.php:148
1981
  msgid "Maximum container width"
1982
  msgstr ""
1983
 
@@ -1985,19 +1985,19 @@ msgstr ""
1985
  msgid "Heading font"
1986
  msgstr ""
1987
 
1988
- #: tmp/widgets/hero/hero.php:193, tmp/widgets/layout-slider/layout-slider.php:154
1989
  msgid "Heading color"
1990
  msgstr ""
1991
 
1992
- #: tmp/widgets/hero/hero.php:199, tmp/widgets/layout-slider/layout-slider.php:160
1993
  msgid "Heading size"
1994
  msgstr ""
1995
 
1996
- #: tmp/widgets/hero/hero.php:230, tmp/widgets/layout-slider/layout-slider.php:166
1997
  msgid "Heading shadow intensity"
1998
  msgstr ""
1999
 
2000
- #: tmp/widgets/hero/hero.php:238, tmp/widgets/layout-slider/layout-slider.php:174
2001
  msgid "Text size"
2002
  msgstr ""
2003
 
@@ -2109,11 +2109,15 @@ msgstr ""
2109
  msgid "Slider frames"
2110
  msgstr ""
2111
 
2112
- #: tmp/widgets/layout-slider/layout-slider.php:195
 
 
 
 
2113
  msgid "This widget requires: "
2114
  msgstr ""
2115
 
2116
- #: tmp/widgets/layout-slider/layout-slider.php:261
2117
  msgid "This widget requires Page Builder."
2118
  msgstr ""
2119
 
@@ -2289,10 +2293,6 @@ msgstr ""
2289
  msgid "Background Color"
2290
  msgstr ""
2291
 
2292
- #: tmp/widgets/slider/slider.php:70
2293
- msgid "Tile"
2294
- msgstr ""
2295
-
2296
  #: tmp/widgets/slider/slider.php:78
2297
  msgid "Foreground image"
2298
  msgstr ""
@@ -2577,14 +2577,18 @@ msgstr ""
2577
  msgid "Resolution"
2578
  msgstr ""
2579
 
2580
- #: tmp/widgets/testimonial/testimonial.php:139, tmp/widgets/testimonial/testimonial.php:168
2581
- msgid "The resolution to treat as a tablet resolution."
2582
  msgstr ""
2583
 
2584
  #: tmp/widgets/testimonial/testimonial.php:147
2585
  msgid "Mobile Phone"
2586
  msgstr ""
2587
 
 
 
 
 
2588
  #: tmp/widgets/testimonial/testimonial.php:191
2589
  msgid "Testimonial image shape"
2590
  msgstr ""
105
  msgid "This field requires: "
106
  msgstr ""
107
 
108
+ #: tmp/base/inc/fields/builder.class.php:37, tmp/widgets/layout-slider/layout-slider.php:197
109
  msgid "SiteOrigin Page Builder"
110
  msgstr ""
111
 
112
+ #: tmp/base/inc/fields/date-range.class.php:31, tmp/base/inc/fields/date-range.class.php:45, tmp/widgets/contact/contact.php:1134
113
  msgid "From"
114
  msgstr ""
115
 
533
  msgid "SiteOrigin Widget"
534
  msgstr ""
535
 
536
+ #: tmp/compat/visual-composer/visual-composer.php:40, tmp/so-widgets-bundle.php:425, tmp/so-widgets-bundle.php:426
537
  msgid "SiteOrigin Widgets"
538
  msgstr ""
539
 
573
  msgid "A new widget!"
574
  msgstr ""
575
 
576
+ #: tmp/so-widgets-bundle.php:451
577
  msgid "%s was %s"
578
  msgstr ""
579
 
580
+ #: tmp/so-widgets-bundle.php:453
581
  msgid "Activated"
582
  msgstr ""
583
 
584
+ #: tmp/so-widgets-bundle.php:453
585
  msgid "Deactivated"
586
  msgstr ""
587
 
588
+ #: tmp/so-widgets-bundle.php:700
589
  msgid "Manage Widgets"
590
  msgstr ""
591
 
592
+ #: tmp/so-widgets-bundle.php:701
593
  msgid "Support"
594
  msgstr ""
595
 
605
  msgid "Button text"
606
  msgstr ""
607
 
608
+ #: tmp/widgets/button/button.php:50, tmp/widgets/google-map/google-map.php:104, tmp/widgets/headline/headline.php:44, tmp/widgets/headline/headline.php:115, tmp/widgets/hero/hero.php:119, tmp/widgets/icon/icon.php:56, tmp/widgets/image/image.php:76, tmp/widgets/layout-slider/layout-slider.php:87, tmp/widgets/simple-masonry/simple-masonry.php:78, tmp/widgets/slider/slider.php:84
609
  msgid "Destination URL"
610
  msgstr ""
611
 
681
  msgid "Button color"
682
  msgstr ""
683
 
684
+ #: tmp/widgets/button/button.php:124, tmp/widgets/contact/contact.php:547, tmp/widgets/hero/hero.php:244, tmp/widgets/layout-slider/layout-slider.php:181
685
  msgid "Text color"
686
  msgstr ""
687
 
1029
  msgid "Container"
1030
  msgstr ""
1031
 
1032
+ #: tmp/widgets/contact/contact.php:280, tmp/widgets/contact/contact.php:509, tmp/widgets/cta/cta.php:77, tmp/widgets/hero/hero.php:113, tmp/widgets/layout-slider/layout-slider.php:81, tmp/widgets/social-media-buttons/social-media-buttons.php:74
1033
  msgid "Background color"
1034
  msgstr ""
1035
 
1117
  msgid "Margin"
1118
  msgstr ""
1119
 
1120
+ #: tmp/widgets/contact/contact.php:395, tmp/widgets/google-map/google-map.php:100, tmp/widgets/hero/hero.php:156, tmp/widgets/layout-slider/layout-slider.php:124
1121
  msgid "Height"
1122
  msgstr ""
1123
 
1933
  msgid "Background image type"
1934
  msgstr ""
1935
 
1936
+ #: tmp/widgets/hero/hero.php:98, tmp/widgets/slider/slider.php:69
1937
  msgid "Cover"
1938
  msgstr ""
1939
 
1940
+ #: tmp/widgets/hero/hero.php:104, tmp/widgets/layout-slider/layout-slider.php:72
1941
  msgid "Background image opacity"
1942
  msgstr ""
1943
 
1944
+ #: tmp/widgets/hero/hero.php:124, tmp/widgets/layout-slider/layout-slider.php:92
1945
  msgid "Open URL in a new window"
1946
  msgstr ""
1947
 
1948
+ #: tmp/widgets/hero/hero.php:129, tmp/widgets/layout-slider/layout-slider.php:97, tmp/widgets/slider/slider.php:43
1949
  msgid "Video"
1950
  msgstr ""
1951
 
1952
+ #: tmp/widgets/hero/hero.php:130, tmp/widgets/layout-slider/layout-slider.php:98, tmp/widgets/slider/slider.php:44
1953
  msgid "Background videos"
1954
  msgstr ""
1955
 
1956
+ #: tmp/widgets/hero/hero.php:145, tmp/widgets/layout-slider/layout-slider.php:113
1957
  msgid "Slider Controls"
1958
  msgstr ""
1959
 
1960
+ #: tmp/widgets/hero/hero.php:151, tmp/widgets/layout-slider/layout-slider.php:119
1961
  msgid "Design and Layout"
1962
  msgstr ""
1963
 
1964
+ #: tmp/widgets/hero/hero.php:162, tmp/widgets/layout-slider/layout-slider.php:130
1965
  msgid "Top and bottom padding"
1966
  msgstr ""
1967
 
1968
+ #: tmp/widgets/hero/hero.php:168, tmp/widgets/layout-slider/layout-slider.php:136
1969
  msgid "Extra top padding"
1970
  msgstr ""
1971
 
1972
+ #: tmp/widgets/hero/hero.php:169, tmp/widgets/layout-slider/layout-slider.php:137
1973
  msgid "Additional padding added to the top of the slider"
1974
  msgstr ""
1975
 
1976
+ #: tmp/widgets/hero/hero.php:175, tmp/widgets/layout-slider/layout-slider.php:143
1977
  msgid "Side padding"
1978
  msgstr ""
1979
 
1980
+ #: tmp/widgets/hero/hero.php:181, tmp/widgets/layout-slider/layout-slider.php:149
1981
  msgid "Maximum container width"
1982
  msgstr ""
1983
 
1985
  msgid "Heading font"
1986
  msgstr ""
1987
 
1988
+ #: tmp/widgets/hero/hero.php:193, tmp/widgets/layout-slider/layout-slider.php:155
1989
  msgid "Heading color"
1990
  msgstr ""
1991
 
1992
+ #: tmp/widgets/hero/hero.php:199, tmp/widgets/layout-slider/layout-slider.php:161
1993
  msgid "Heading size"
1994
  msgstr ""
1995
 
1996
+ #: tmp/widgets/hero/hero.php:230, tmp/widgets/layout-slider/layout-slider.php:167
1997
  msgid "Heading shadow intensity"
1998
  msgstr ""
1999
 
2000
+ #: tmp/widgets/hero/hero.php:238, tmp/widgets/layout-slider/layout-slider.php:175
2001
  msgid "Text size"
2002
  msgstr ""
2003
 
2109
  msgid "Slider frames"
2110
  msgstr ""
2111
 
2112
+ #: tmp/widgets/layout-slider/layout-slider.php:66, tmp/widgets/slider/slider.php:70
2113
+ msgid "Tile"
2114
+ msgstr ""
2115
+
2116
+ #: tmp/widgets/layout-slider/layout-slider.php:196
2117
  msgid "This widget requires: "
2118
  msgstr ""
2119
 
2120
+ #: tmp/widgets/layout-slider/layout-slider.php:262
2121
  msgid "This widget requires Page Builder."
2122
  msgstr ""
2123
 
2293
  msgid "Background Color"
2294
  msgstr ""
2295
 
 
 
 
 
2296
  #: tmp/widgets/slider/slider.php:78
2297
  msgid "Foreground image"
2298
  msgstr ""
2577
  msgid "Resolution"
2578
  msgstr ""
2579
 
2580
+ #: tmp/widgets/testimonial/testimonial.php:139
2581
+ msgid "The resolution to treat as a mobile resolution."
2582
  msgstr ""
2583
 
2584
  #: tmp/widgets/testimonial/testimonial.php:147
2585
  msgid "Mobile Phone"
2586
  msgstr ""
2587
 
2588
+ #: tmp/widgets/testimonial/testimonial.php:168
2589
+ msgid "The resolution to treat as a tablet resolution."
2590
+ msgstr ""
2591
+
2592
  #: tmp/widgets/testimonial/testimonial.php:191
2593
  msgid "Testimonial image shape"
2594
  msgstr ""
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
  Requires at least: 4.2
4
  Tested up to: 4.8
5
- Stable tag: 1.9.2
6
- Build time: 2017-07-04T16:52:10+02:00
7
  License: GPLv3 or later
8
  Contributors: gpriday, braam-genis
9
  Donate link: https://siteorigin.com/downloads/contribution/
@@ -54,6 +54,14 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
 
 
 
57
  = 1.9.3 - 3 July 2017 =
58
  * Editor: Fix settings form label.
59
  * Don't select the external fallback field as value input.
2
  Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
  Requires at least: 4.2
4
  Tested up to: 4.8
5
+ Stable tag: 1.9.3
6
+ Build time: 2017-07-24T09:59:35+02:00
7
  License: GPLv3 or later
8
  Contributors: gpriday, braam-genis
9
  Donate link: https://siteorigin.com/downloads/contribution/
54
 
55
  == Changelog ==
56
 
57
+ = 1.9.4 - 24 July 2017 =
58
+ * Using new Editor JS API for TinyMCE field.
59
+ * Carousel: apply static position on `.overlay`.
60
+ * Layout Slider: Add ability to set Background image to Title and spaced the code.
61
+ * Add capabilities check to widget activation action.
62
+ * Testimonial: Corrected typo in description and corrected formatting.
63
+ * Enabling translation for "From:" in contact mail.
64
+
65
  = 1.9.3 - 3 July 2017 =
66
  * Editor: Fix settings form label.
67
  * Don't select the external fallback field as value input.
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
- Version: 1.9.3
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
@@ -12,7 +12,7 @@ License: GPL3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
- define('SOW_BUNDLE_VERSION', '1.9.3');
16
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
 
18
  // Allow JS suffix to be pre-set
@@ -313,7 +313,8 @@ class SiteOrigin_Widgets_Bundle {
313
  */
314
  function admin_activate_widget() {
315
  if(
316
- !empty($_GET['page'])
 
317
  && $_GET['page'] == 'so-widgets-plugins'
318
  && !empty( $_GET['widget_action'] ) && !empty( $_GET['widget'] )
319
  && isset($_GET['_wpnonce'])
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
+ Version: 1.9.4
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
+ define('SOW_BUNDLE_VERSION', '1.9.4');
16
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
 
18
  // Allow JS suffix to be pre-set
313
  */
314
  function admin_activate_widget() {
315
  if(
316
+ current_user_can( apply_filters( 'siteorigin_widgets_admin_menu_capability', 'manage_options' ) )
317
+ && !empty($_GET['page'])
318
  && $_GET['page'] == 'so-widgets-plugins'
319
  && !empty( $_GET['widget_action'] ) && !empty( $_GET['widget'] )
320
  && isset($_GET['_wpnonce'])
widgets/contact/contact.php CHANGED
@@ -1131,7 +1131,7 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
1131
  }
1132
 
1133
  function send_mail( $email_fields, $instance ) {
1134
- $body = '<strong>From:</strong> <a href="mailto:' . sanitize_email( $email_fields['email'] ) . '">' . esc_html( $email_fields['name'] ) . '</a> &#60;' . sanitize_email( $email_fields['email'] ) . "&#62; \n\n";
1135
  foreach ( $email_fields['message'] as $m ) {
1136
  $body .= '<strong>' . $m['label'] . ':</strong>';
1137
  $body .= "\n";
1131
  }
1132
 
1133
  function send_mail( $email_fields, $instance ) {
1134
+ $body = '<strong>' . __( 'From', 'so-widgets-bundle' ) . ':</strong> <a href="mailto:' . sanitize_email( $email_fields['email'] ) . '">' . esc_html( $email_fields['name'] ) . '</a> &#60;' . sanitize_email( $email_fields['email'] ) . "&#62; \n\n";
1135
  foreach ( $email_fields['message'] as $m ) {
1136
  $body .= '<strong>' . $m['label'] . ':</strong>';
1137
  $body .= "\n";
widgets/layout-slider/layout-slider.php CHANGED
@@ -60,9 +60,10 @@ class SiteOrigin_Widget_LayoutSlider_Widget extends SiteOrigin_Widget_Base_Slide
60
 
61
  'image_type' => array(
62
  'type' => 'select',
63
- 'label' => __('Background image type', 'so-widgets-bundle'),
64
  'options' => array(
65
- 'cover' => __('Cover', 'so-widgets-bundle'),
 
66
  ),
67
  'default' => 'cover',
68
  ),
60
 
61
  'image_type' => array(
62
  'type' => 'select',
63
+ 'label' => __( 'Background image type', 'so-widgets-bundle' ),
64
  'options' => array(
65
+ 'cover' => __( 'Cover', 'so-widgets-bundle '),
66
+ 'tile' => __( 'Tile', 'so-widgets-bundle' ),
67
  ),
68
  'default' => 'cover',
69
  ),
widgets/testimonial/testimonial.php CHANGED
@@ -135,8 +135,8 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
135
  ),
136
  'width' => array(
137
  'type' => 'text',
138
- 'label' => __('Resolution', 'so-widgets-bundle'),
139
- 'description' => __('The resolution to treat as a tablet resolution.', 'so-widgets-bundle'),
140
  'default' => 800,
141
  'sanitize' => 'intval',
142
  )
@@ -164,8 +164,8 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
164
  ),
165
  'width' => array(
166
  'type' => 'text',
167
- 'label' => __('Resolution', 'so-widgets-bundle'),
168
- 'description' => __('The resolution to treat as a tablet resolution.', 'so-widgets-bundle'),
169
  'default' => 480,
170
  'sanitize' => 'intval',
171
  )
135
  ),
136
  'width' => array(
137
  'type' => 'text',
138
+ 'label' => __( 'Resolution', 'so-widgets-bundle' ),
139
+ 'description' => __( 'The resolution to treat as a mobile resolution.', 'so-widgets-bundle' ),
140
  'default' => 800,
141
  'sanitize' => 'intval',
142
  )
164
  ),
165
  'width' => array(
166
  'type' => 'text',
167
+ 'label' => __( 'Resolution', 'so-widgets-bundle' ),
168
+ 'description' => __( 'The resolution to treat as a tablet resolution.', 'so-widgets-bundle' ),
169
  'default' => 480,
170
  'sanitize' => 'intval',
171
  )