Unyson - Version 2.4.12

Version Description

  • WordPress 4.4 fixes
  • Fixed #1039, #1044, #1055, #1072, #1049, #1086, PageBuilder#40
Download this release

Release Info

Developer Unyson
Plugin Icon 128x128 Unyson
Version 2.4.12
Comparing to
See all releases

Code changes from version 2.4.11 to 2.4.12

README.md CHANGED
@@ -8,7 +8,7 @@ To get started, check out the [Scratch Theme](https://github.com/ThemeFuse/Scrat
8
 
9
  If you are not a developer, please use the [Unyson plugin page](https://wordpress.org/plugins/unyson/) on WordPress.org.
10
 
11
- [![Build Status](https://travis-ci.org/ThemeFuse/Unyson.svg?branch=master)](https://travis-ci.org/ThemeFuse/Unyson)
12
 
13
  ## Table of contents
14
 
@@ -87,3 +87,4 @@ If you have a bug report or feature request related to a specific extension, fol
87
  * [Blog Posts](https://github.com/ThemeFuse/Unyson-Blog-Extension)
88
  * [Learning](https://github.com/ThemeFuse/Unyson-Learning-Extension)
89
  * [Translation](https://github.com/ThemeFuse/Unyson-Translation-Extension)
 
8
 
9
  If you are not a developer, please use the [Unyson plugin page](https://wordpress.org/plugins/unyson/) on WordPress.org.
10
 
11
+ [![Build Status](https://travis-ci.org/ThemeFuse/Unyson.svg?branch=master)](https://travis-ci.org/ThemeFuse/Unyson) [![Stories in Ready](https://badge.waffle.io/ThemeFuse/Unyson.svg?label=ready&title=Ready)](http://waffle.io/ThemeFuse/Unyson)
12
 
13
  ## Table of contents
14
 
87
  * [Blog Posts](https://github.com/ThemeFuse/Unyson-Blog-Extension)
88
  * [Learning](https://github.com/ThemeFuse/Unyson-Learning-Extension)
89
  * [Translation](https://github.com/ThemeFuse/Unyson-Translation-Extension)
90
+
framework/core/components/backend.php CHANGED
@@ -1669,7 +1669,7 @@ final class _FW_Component_Backend {
1669
 
1670
  /**
1671
  * used <small> not <span> because there is a lot of css and js
1672
- * that thinks inside <h3 class="hndle"> there is only one <span>
1673
  * so do not brake their logic
1674
  */
1675
  '<small class="fw-html-before-title">' . $placeholders['html_before_title'] . '</small>' .
1669
 
1670
  /**
1671
  * used <small> not <span> because there is a lot of css and js
1672
+ * that thinks inside <h2 class="hndle"> there is only one <span>
1673
  * so do not brake their logic
1674
  */
1675
  '<small class="fw-html-before-title">' . $placeholders['html_before_title'] . '</small>' .
framework/core/extends/class-fw-option-type.php CHANGED
@@ -128,13 +128,16 @@ abstract class FW_Option_Type
128
  $data
129
  );
130
 
131
- $option = array_merge(
132
- $this->get_defaults(),
133
- $option,
134
- array(
135
- 'type' => $this->get_type()
136
- )
137
- );
 
 
 
138
 
139
  if (!isset($data['value'])) {
140
  // if no input value, use default
128
  $data
129
  );
130
 
131
+ $defaults = $this->get_defaults();
132
+ $merge_attr = !empty($option['attr']) && !empty($defaults['attr']);
133
+
134
+ $option = array_merge($defaults, $option, array(
135
+ 'type' => $this->get_type()
136
+ ));
137
+
138
+ if ($merge_attr) {
139
+ $option['attr'] = array_merge($defaults['attr'], $option['attr']);
140
+ }
141
 
142
  if (!isset($data['value'])) {
143
  // if no input value, use default
framework/includes/option-types/addable-box/static/css/styles.css CHANGED
@@ -2,13 +2,13 @@
2
  min-width: 100%;
3
  }
4
 
5
- .fw-option-type-addable-box > .fw-option-boxes.ui-sortable > .fw-option-box > .fw-postbox > h3.hndle {
6
  cursor: move !important; /* to rewrite .fw-postbox h3.hndle */
7
  word-break: break-all; /* if box text is too long, do not move controls outside box */
8
  position: relative;
9
  }
10
 
11
- .fw-option-type-addable-box > .fw-option-boxes.ui-sortable > .fw-option-box > .fw-postbox > h3.hndle > span {
12
  overflow: hidden;
13
  white-space: nowrap;
14
  max-width: 100%;
@@ -24,11 +24,11 @@
24
  margin-bottom: 20px;
25
  }
26
 
27
- .fw-option-type-addable-box > .fw-option-boxes.ui-sortable > .fw-option-box > .fw-postbox > h3.hndle span:after {
28
  content: '\00a0'; /* &nbsp; - when title is empty, box has too small (broken) height */
29
  }
30
 
31
- .fw-option-type-addable-box > .fw-option-boxes.ui-sortable > .fw-option-box > .fw-postbox > h3.hndle img {
32
  vertical-align: middle;
33
  }
34
 
@@ -40,7 +40,7 @@
40
  /* Controls */
41
 
42
 
43
- .fw-option-type-addable-box > .fw-option-boxes > .fw-option-box h3.hndle .fw-html-after-title {
44
  position: absolute;
45
  top: 0;
46
  right: 27px;
@@ -52,11 +52,11 @@
52
  padding-top: inherit;
53
  }
54
 
55
- .fw-option-type-addable-box > .fw-option-boxes > .fw-option-box h3.hndle .fw-html-after-title .fw-option-box-controls .fw-option-box-control {
56
  text-decoration: none;
57
  }
58
 
59
- .fw-option-type-addable-box > .fw-option-boxes > .fw-option-box h3.hndle .fw-html-after-title .fw-option-box-controls .fw-option-box-control-wrapper {
60
  color: #cccccc;
61
  }
62
 
2
  min-width: 100%;
3
  }
4
 
5
+ .fw-option-type-addable-box > .fw-option-boxes.ui-sortable > .fw-option-box > .fw-postbox > .hndle {
6
  cursor: move !important; /* to rewrite .fw-postbox h3.hndle */
7
  word-break: break-all; /* if box text is too long, do not move controls outside box */
8
  position: relative;
9
  }
10
 
11
+ .fw-option-type-addable-box > .fw-option-boxes.ui-sortable > .fw-option-box > .fw-postbox > .hndle > span {
12
  overflow: hidden;
13
  white-space: nowrap;
14
  max-width: 100%;
24
  margin-bottom: 20px;
25
  }
26
 
27
+ .fw-option-type-addable-box > .fw-option-boxes.ui-sortable > .fw-option-box > .fw-postbox > .hndle span:after {
28
  content: '\00a0'; /* &nbsp; - when title is empty, box has too small (broken) height */
29
  }
30
 
31
+ .fw-option-type-addable-box > .fw-option-boxes.ui-sortable > .fw-option-box > .fw-postbox > .hndle img {
32
  vertical-align: middle;
33
  }
34
 
40
  /* Controls */
41
 
42
 
43
+ .fw-option-type-addable-box > .fw-option-boxes > .fw-option-box .hndle .fw-html-after-title {
44
  position: absolute;
45
  top: 0;
46
  right: 27px;
52
  padding-top: inherit;
53
  }
54
 
55
+ .fw-option-type-addable-box > .fw-option-boxes > .fw-option-box .hndle .fw-html-after-title .fw-option-box-controls .fw-option-box-control {
56
  text-decoration: none;
57
  }
58
 
59
+ .fw-option-type-addable-box > .fw-option-boxes > .fw-option-box .hndle .fw-html-after-title .fw-option-box-controls .fw-option-box-control-wrapper {
60
  color: #cccccc;
61
  }
62
 
framework/includes/option-types/addable-box/static/js/scripts.js CHANGED
@@ -15,7 +15,7 @@ jQuery(document).ready(function ($) {
15
  data.$options = $box.find('.fw-option-box-options:first');
16
 
17
  data.$box = $box.find('.fw-postbox:first');
18
- data.$title = data.$box.find('> h3.hndle:first');
19
  data.$titleText = data.$title.find('> span:first');
20
 
21
  return data;
@@ -163,7 +163,7 @@ jQuery(document).ready(function ($) {
163
 
164
  $box.removeClass(titleUpdater.pendingClass);
165
 
166
- $box.find('> h3.hndle span:not([class])').first().html(
167
  this.template(data.template, JSON.parse(values))
168
  );
169
 
@@ -196,7 +196,7 @@ jQuery(document).ready(function ($) {
196
  template = '[Ajax Error] '+ response.data.message
197
  }
198
 
199
- $box.find('> h3.hndle span:not([class])').first().html(template);
200
 
201
  delete data;
202
 
@@ -205,7 +205,7 @@ jQuery(document).ready(function ($) {
205
  this.isBusy = false;
206
  $box.removeClass(titleUpdater.pendingClass);
207
 
208
- $box.find('> h3.hndle span:not([class])').first().text('[Server Error] '+ status +': '+ error.message);
209
 
210
  delete data;
211
 
@@ -268,7 +268,7 @@ jQuery(document).ready(function ($) {
268
  $(this).addClass(titleUpdater.pendingClass);
269
 
270
  /*
271
- $(this).find('> h3.hndle span:not([class])').first().html(
272
  $('<img>').attr('src', fw.img.loadingSpinner)
273
  );
274
  */
15
  data.$options = $box.find('.fw-option-box-options:first');
16
 
17
  data.$box = $box.find('.fw-postbox:first');
18
+ data.$title = data.$box.find('> .hndle:first');
19
  data.$titleText = data.$title.find('> span:first');
20
 
21
  return data;
163
 
164
  $box.removeClass(titleUpdater.pendingClass);
165
 
166
+ $box.find('> .hndle span:not([class])').first().html(
167
  this.template(data.template, JSON.parse(values))
168
  );
169
 
196
  template = '[Ajax Error] '+ response.data.message
197
  }
198
 
199
+ $box.find('> .hndle span:not([class])').first().html(template);
200
 
201
  delete data;
202
 
205
  this.isBusy = false;
206
  $box.removeClass(titleUpdater.pendingClass);
207
 
208
+ $box.find('> .hndle span:not([class])').first().text('[Server Error] '+ status +': '+ error.message);
209
 
210
  delete data;
211
 
268
  $(this).addClass(titleUpdater.pendingClass);
269
 
270
  /*
271
+ $(this).find('> .hndle span:not([class])').first().html(
272
  $('<img>').attr('src', fw.img.loadingSpinner)
273
  );
274
  */
framework/includes/option-types/color-picker/class-fw-option-type-color-picker.php CHANGED
@@ -55,6 +55,14 @@ class FW_Option_Type_Color_Picker extends FW_Option_Type
55
  $option['attr']['onclick'] = 'this.select()';
56
  $option['attr']['data-default'] = $option['value'];
57
 
 
 
 
 
 
 
 
 
58
  return '<input type="text" '. fw_attr_to_html($option['attr']) .'>';
59
  }
60
 
@@ -84,7 +92,8 @@ class FW_Option_Type_Color_Picker extends FW_Option_Type
84
  protected function _get_defaults()
85
  {
86
  return array(
87
- 'value' => ''
 
88
  );
89
  }
90
  }
55
  $option['attr']['onclick'] = 'this.select()';
56
  $option['attr']['data-default'] = $option['value'];
57
 
58
+
59
+ $palettes = (bool) $option['palettes'];
60
+ if ( ! empty( $option['palettes'] ) && is_array( $option['palettes'] ) ) {
61
+ $palettes = $option['palettes'];
62
+ }
63
+
64
+ $option['attr']['data-palettes'] = json_encode( $palettes );
65
+
66
  return '<input type="text" '. fw_attr_to_html($option['attr']) .'>';
67
  }
68
 
92
  protected function _get_defaults()
93
  {
94
  return array(
95
+ 'value' => '',
96
+ 'palettes'=> true
97
  );
98
  }
99
  }
framework/includes/option-types/color-picker/static/js/scripts.js CHANGED
@@ -72,7 +72,7 @@ jQuery(document).ready(function($){
72
  $input.trigger('change');
73
  }, 12);
74
  },
75
- palettes: true
76
  });
77
 
78
  var $picker = helpers.getInstance($input).picker;
72
  $input.trigger('change');
73
  }, 12);
74
  },
75
+ palettes: JSON.parse($input.attr('data-palettes'))
76
  });
77
 
78
  var $picker = helpers.getInstance($input).picker;
framework/includes/option-types/datetime-picker/class-fw-option-type-datetime-picker.php CHANGED
@@ -20,10 +20,14 @@ class FW_Option_Type_Datetime_Picker extends FW_Option_Type {
20
  */
21
  protected function _get_defaults() {
22
  return array(
 
 
 
23
  'value' => '',
24
  'datetime-picker' => array(
25
  'format' => 'Y/m/d H:i',
26
  'extra-formats' => array(),
 
27
  'moment-format' => 'YYYY/MM/DD HH:mm',
28
  'maxDate' => false,
29
  'minDate' => false,
20
  */
21
  protected function _get_defaults() {
22
  return array(
23
+ 'attr' => array(
24
+ 'readonly' => 'readonly'
25
+ ),
26
  'value' => '',
27
  'datetime-picker' => array(
28
  'format' => 'Y/m/d H:i',
29
  'extra-formats' => array(),
30
+ // it is used in event option type.
31
  'moment-format' => 'YYYY/MM/DD HH:mm',
32
  'maxDate' => false,
33
  'minDate' => false,
framework/includes/option-types/datetime-picker/static/css/style.css CHANGED
@@ -4,4 +4,8 @@
4
 
5
  .fw-backend-option-input-type-datetime-picker .fw-option-help-in-input {
6
  top: 4px !important;
 
 
 
 
7
  }
4
 
5
  .fw-backend-option-input-type-datetime-picker .fw-option-help-in-input {
6
  top: 4px !important;
7
+ }
8
+ .fw-option-type-datetime-picker input[readonly] {
9
+ background-color: #fff;
10
+ cursor: pointer;
11
  }
framework/includes/option-types/popup/class-fw-option-type-popup.php CHANGED
@@ -124,6 +124,11 @@ class FW_Option_Type_Popup extends FW_Option_Type {
124
  }
125
 
126
  $values = fw_get_options_values_from_input($popup_options, array());
 
 
 
 
 
127
  } else {
128
  $values = json_decode( $input_value, true );
129
  }
124
  }
125
 
126
  $values = fw_get_options_values_from_input($popup_options, array());
127
+ } else if (is_array( $input_value )) {
128
+ /**
129
+ * Don't decode if we have already an array
130
+ */
131
+ $values = $input_value;
132
  } else {
133
  $values = json_decode( $input_value, true );
134
  }
framework/includes/option-types/rgba-color-picker/class-fw-option-type-rgba-color-picker.php CHANGED
@@ -56,6 +56,13 @@ class FW_Option_Type_Rgba_Color_Picker extends FW_Option_Type {
56
  $option['attr']['value'] = empty($data['value']) ? $option['value'] : $data['value'];
57
  $option['attr']['data-default'] = $option['value'];
58
 
 
 
 
 
 
 
 
59
  return '<input type="text" ' . fw_attr_to_html( $option['attr'] ) . '>';
60
  }
61
 
@@ -82,7 +89,8 @@ class FW_Option_Type_Rgba_Color_Picker extends FW_Option_Type {
82
  */
83
  protected function _get_defaults() {
84
  return array(
85
- 'value' => ''
 
86
  );
87
  }
88
  }
56
  $option['attr']['value'] = empty($data['value']) ? $option['value'] : $data['value'];
57
  $option['attr']['data-default'] = $option['value'];
58
 
59
+ $palettes = (bool) $option['palettes'];
60
+ if ( ! empty( $option['palettes'] ) && is_array( $option['palettes'] ) ) {
61
+ $palettes = $option['palettes'];
62
+ }
63
+
64
+ $option['attr']['data-palettes'] = json_encode( $palettes );
65
+
66
  return '<input type="text" ' . fw_attr_to_html( $option['attr'] ) . '>';
67
  }
68
 
89
  */
90
  protected function _get_defaults() {
91
  return array(
92
+ 'value' => '',
93
+ 'palettes'=> true
94
  );
95
  }
96
  }
framework/includes/option-types/rgba-color-picker/static/js/scripts.js CHANGED
@@ -97,7 +97,7 @@ jQuery(function($){
97
  */
98
  $input.one('focus', function(){
99
  $input.iris({
100
- palettes: true,
101
  defaultColor: false,
102
  change: function (event, ui) {
103
  var $transparency = $input.next('.iris-picker').find('.transparency');
97
  */
98
  $input.one('focus', function(){
99
  $input.iris({
100
+ palettes: JSON.parse($input.attr('data-palettes')),
101
  defaultColor: false,
102
  change: function (event, ui) {
103
  var $transparency = $input.next('.iris-picker').find('.transparency');
framework/includes/option-types/wp-editor/static/js/scripts.js CHANGED
@@ -1,6 +1,6 @@
1
- (function($, fwe) {
2
 
3
- var init = function() {
4
 
5
  var width = jQuery(this).data('width-type');
6
 
@@ -26,26 +26,26 @@
26
  if (dynamicId === "textarea_dynamic_id") {
27
 
28
  window.tinyMCE.execCommand("mceRemoveEditor", false, dynamicId);
29
- $('#qt_'+ dynamicId +'_toolbar').remove();
30
 
31
- var id = 'wp-editor-textarea-'+ fw.randomMD5();
32
  $textarea.attr('id', id);
33
  $textareaWrapper.find('[id="insert-media-button"]').data('editor', id);
34
  reachTexEditorReinit($textarea);
35
  }
36
 
37
- $(document).on('mouseenter click', '.fw-option-type-wp-editor', function(){
38
  window.wpActiveEditor = $(this).find('textarea').attr('id');
39
  });
40
 
41
  };
42
 
43
- var reachTexEditorReinit = function($textarea){
44
  var parent = $textarea.parents('.wp-editor-wrap:eq(0)'),
45
- $activeEditorBtn =$textarea.parents('.fw-option-type-wp-editor').data('editor-type') === 'tinymce' ? parent.find('.switch-tmce') : parent.find('.switch-html'),
46
  $btnTabs = parent.find('.wp-switch-editor').removeAttr("onclick"),
47
  id = $textarea.attr('id'),
48
- settings = {id: id , buttons: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'};
49
 
50
  var tmceCustomSettings = $textarea.parents('.fw-option-type-wp-editor').data('tinymce'),
51
  tmce_teeny = $textarea.parents('.fw-option-type-wp-editor').data('tmce-teeny'),
@@ -55,31 +55,38 @@
55
  var initTinyMCESettings = {};
56
  if (tmce_config_name === 'custom') {
57
  initTinyMCESettings = tmceCustomSettings;
58
- } else if (tmce_config_name === 'teeny') {
59
  initTinyMCESettings = tmce_teeny;
60
  } else {
61
  initTinyMCESettings = tmce_extended;
62
  }
63
 
 
 
 
 
 
 
64
  /**
65
  * add autoupdate textarea value to tinyMCE settings
66
  */
67
- initTinyMCESettings.setup = function(ed) {
68
- ed.onChange.add(function(ed, l) {
69
- tinyMCE.triggerSave();
70
  });
71
  };
72
 
73
  /**
74
  * add \ remove editors by change tabs
75
  */
76
- $btnTabs.bind('click', function()
77
- {
 
 
78
  var button = $(this);
79
  var value = '';
80
 
81
- if(button.is('.switch-tmce'))
82
- {
83
 
84
  //add <p> html tags
85
  //fixme: window.switchEditors.switchto
@@ -88,17 +95,21 @@
88
  $textarea.val(value);
89
  }
90
 
91
-
92
  initTinyMCESettings.selector = '#' + id;
93
- tinymce.init(initTinyMCESettings);
94
- parent.removeClass('html-active').addClass('tmce-active');
 
95
  if (QTags != undefined) {
96
  QTags._buttonsInit();
97
  }
98
 
99
- }
100
- else
101
- {
 
 
 
 
102
  parent.removeClass('tmce-active').addClass('html-active');
103
 
104
  //Get content before removing the Visual editor, because it removes multiple new lines
@@ -110,15 +121,16 @@
110
  }
111
  });
112
 
113
- $activeEditorBtn.trigger('click');
114
  /**
115
  * adding Qtags buttons panel
116
  */
117
  quicktags(settings);
118
  QTags._buttonsInit();
 
 
119
  };
120
 
121
- fwe.on('fw:options:init', function(data) {
122
  data.$elements
123
  .find('.fw-option-type-wp-editor:not(.fw-option-initialized)')
124
  .each(init)
1
+ (function ($, fwe) {
2
 
3
+ var init = function () {
4
 
5
  var width = jQuery(this).data('width-type');
6
 
26
  if (dynamicId === "textarea_dynamic_id") {
27
 
28
  window.tinyMCE.execCommand("mceRemoveEditor", false, dynamicId);
29
+ $('#qt_' + dynamicId + '_toolbar').remove();
30
 
31
+ var id = 'wp-editor-textarea-' + fw.randomMD5();
32
  $textarea.attr('id', id);
33
  $textareaWrapper.find('[id="insert-media-button"]').data('editor', id);
34
  reachTexEditorReinit($textarea);
35
  }
36
 
37
+ $(document).on('mouseenter click', '.fw-option-type-wp-editor', function () {
38
  window.wpActiveEditor = $(this).find('textarea').attr('id');
39
  });
40
 
41
  };
42
 
43
+ var reachTexEditorReinit = function ($textarea) {
44
  var parent = $textarea.parents('.wp-editor-wrap:eq(0)'),
45
+ $activeEditorBtn = $textarea.parents('.fw-option-type-wp-editor').data('editor-type') === 'tinymce' ? parent.find('.switch-tmce') : parent.find('.switch-html'),
46
  $btnTabs = parent.find('.wp-switch-editor').removeAttr("onclick"),
47
  id = $textarea.attr('id'),
48
+ settings = {id: id, buttons: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'};
49
 
50
  var tmceCustomSettings = $textarea.parents('.fw-option-type-wp-editor').data('tinymce'),
51
  tmce_teeny = $textarea.parents('.fw-option-type-wp-editor').data('tmce-teeny'),
55
  var initTinyMCESettings = {};
56
  if (tmce_config_name === 'custom') {
57
  initTinyMCESettings = tmceCustomSettings;
58
+ } else if (tmce_config_name === 'teeny') {
59
  initTinyMCESettings = tmce_teeny;
60
  } else {
61
  initTinyMCESettings = tmce_extended;
62
  }
63
 
64
+ /**
65
+ * set the right wp-editor-id.
66
+ */
67
+ $btnTabs.each(function () {
68
+ $(this).attr('data-wp-editor-id', id);
69
+ });
70
  /**
71
  * add autoupdate textarea value to tinyMCE settings
72
  */
73
+ initTinyMCESettings.setup = function (editor) {
74
+ editor.on('change', function () {
75
+ editor.save();
76
  });
77
  };
78
 
79
  /**
80
  * add \ remove editors by change tabs
81
  */
82
+ $btnTabs.bind('click', function (e) {
83
+
84
+ e.stopPropagation();
85
+
86
  var button = $(this);
87
  var value = '';
88
 
89
+ if (button.is('.switch-tmce')) {
 
90
 
91
  //add <p> html tags
92
  //fixme: window.switchEditors.switchto
95
  $textarea.val(value);
96
  }
97
 
 
98
  initTinyMCESettings.selector = '#' + id;
99
+ initTinyMCESettings.onpageload = false;
100
+
101
+
102
  if (QTags != undefined) {
103
  QTags._buttonsInit();
104
  }
105
 
106
+ window.tinyMCEPreInit.mceInit[id] = tinymce.extend({}, initTinyMCESettings, tinyMCEPreInit.mceInit[id]);
107
+ if (tinymce.get(id) === null) {
108
+ tinymce.init(window.tinyMCEPreInit.mceInit[id]);
109
+ }
110
+
111
+ parent.removeClass('html-active').addClass('tmce-active');
112
+ } else {
113
  parent.removeClass('tmce-active').addClass('html-active');
114
 
115
  //Get content before removing the Visual editor, because it removes multiple new lines
121
  }
122
  });
123
 
 
124
  /**
125
  * adding Qtags buttons panel
126
  */
127
  quicktags(settings);
128
  QTags._buttonsInit();
129
+
130
+ $activeEditorBtn.trigger('click');
131
  };
132
 
133
+ fwe.on('fw:options:init', function (data) {
134
  data.$elements
135
  .find('.fw-option-type-wp-editor:not(.fw-option-initialized)')
136
  .each(init)
framework/manifest.php CHANGED
@@ -4,4 +4,4 @@ $manifest = array();
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
- $manifest['version'] = '2.4.11';
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
+ $manifest['version'] = '2.4.12';
framework/static/css/backend-options.css CHANGED
@@ -86,6 +86,7 @@ body.rtl .fw-options-tabs-wrapper > .fw-options-tabs-list ul li {
86
  color: #000;
87
  border-bottom: 1px solid #ccc;
88
  margin-top: 0;
 
89
  }
90
 
91
  .fw-options-tabs-wrapper > .fw-options-tabs-list ul li a.nav-tab:hover {
@@ -242,11 +243,11 @@ form.fw-settings-form.fw-backend-side-tabs {
242
 
243
  .fw-backend-side-tabs .fw-options-tabs-first-level {
244
  background:
245
- #fff
246
- url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAABCAYAAAAo/lyUAAAAIklEQVQ4T2N8/Pjxf4ZRMBoCoyEwGgKjITAaAqMhMKRDAACcIAOqH7nZlwAAAABJRU5ErkJgggAA') /* #e3e3e3 500x1 */
247
- -302px /* 198-500 */
248
- 0
249
- repeat-y;
250
  }
251
 
252
  .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-list {
@@ -279,6 +280,7 @@ body.rtl .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-l
279
  margin-right: 0;
280
  border: 1px solid #d3d3d3;
281
  border-width: 0 0 1px;
 
282
  }
283
 
284
  body.rtl .fw-backend-side-tabs .fw-options-tabs-wrapper > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list {
@@ -305,8 +307,11 @@ body.rtl .fw-backend-side-tabs .fw-options-tabs-wrapper > .fw-options-tabs-list
305
  margin: 0;
306
  padding: 0 10px 0 20px;
307
  display: block;
308
- height: 44px;
309
- line-height: 44px;
 
 
 
310
  border: none;
311
  font-size: 14px;
312
  font-weight: 400;
@@ -315,6 +320,14 @@ body.rtl .fw-backend-side-tabs .fw-options-tabs-wrapper > .fw-options-tabs-list
315
  box-shadow: none;
316
  }
317
 
 
 
 
 
 
 
 
 
318
  .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-list .ui-tabs-nav a:hover {
319
  background: #dadada;
320
  }
@@ -381,8 +394,14 @@ body.rtl .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-c
381
  margin-bottom: -1px;
382
  }
383
 
384
- .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list ul,
385
- .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list ul li {
 
 
 
 
 
 
386
  border-bottom: 1px solid #e5e5e5;
387
  }
388
 
@@ -452,17 +471,24 @@ body.rtl .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-c
452
  margin-bottom: 0;
453
  }
454
 
455
- .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > h3 {
456
  position: relative;
457
  padding: 0 25px;
458
- height: 47px;
459
  line-height: 45px;
460
  border-bottom: none !important;
461
  font-size: 17px;
462
  color: #0074a2;
463
  }
464
 
465
- .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > h3:after {
 
 
 
 
 
 
 
466
  content: "";
467
  display: block;
468
  position: absolute;
@@ -473,9 +499,9 @@ body.rtl .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-c
473
  z-index: 1;
474
  }
475
 
476
- .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > h3 .handlediv {
477
  display: none;
478
- }
479
 
480
  .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .handlediv:before {
481
  top: 4px;
@@ -597,6 +623,7 @@ body.admin-color-sunrise .fw-backend-side-tabs .fw-settings-form-header { backgr
597
  line-height: 1;
598
  color: #fff;
599
  padding: 0;
 
600
  }
601
 
602
  .fw-backend-side-tabs .fw-settings-form-header h2 small {
@@ -628,6 +655,7 @@ body.rtl .fw-backend-side-tabs .fw-settings-form-header .form-header-buttons {
628
  .fw-backend-side-tabs .fw-settings-form-header .form-header-buttons input {
629
  -webkit-box-shadow: none;
630
  box-shadow: none;
 
631
  vertical-align: middle;
632
  }
633
 
@@ -646,10 +674,14 @@ body.rtl .fw-backend-side-tabs .fw-settings-form-header .form-header-buttons {
646
  width: 1px;
647
  }
648
 
 
 
 
 
 
649
  .fw-backend-side-tabs .fw-settings-form-header .form-header-buttons .submit-button-reset {
650
  padding: 0;
651
  height: 26px;
652
- line-height: 26px;
653
  color: #fff;
654
  background-color: transparent;
655
  border-width: 0;
@@ -766,33 +798,35 @@ form#post .fw-options-tabs-wrapper > .fw-options-tabs-contents .fw-backend-postb
766
 
767
  /* Fixes postboxes */
768
 
769
- .fw-postbox-without-name > h3.hndle,
770
- .fw-postbox-without-name > .handlediv {
 
 
771
  display: none;
772
  }
773
 
774
- .fw-postbox h3.hndle {
775
  cursor: pointer !important; /* to rewrite .js .postbox .hndle */
776
  }
777
 
778
- .fw-postbox:not(.initialized) h3.hndle {
779
  display: none;
780
  }
781
 
782
- .fw-postbox h3.hndle .fw-html-before-title small:not(.dashicons),
783
- .fw-postbox h3.hndle .fw-html-after-title small:not(.dashicons) {
784
  font-size: medium !important;
785
  }
786
 
787
- .fw-postbox h3.hndle .fw-html-before-title .dashicons,
788
- .fw-postbox h3.hndle .fw-html-after-title .dashicons {
789
  width: auto;
790
  height: auto;
791
  color: #AAA; /* copied from .handlediv */
792
  }
793
 
794
- .fw-postbox h3.hndle .fw-html-before-title .dashicons:hover,
795
- .fw-postbox h3.hndle .fw-html-after-title .dashicons:hover {
796
  color: #777; /* copied from .handlediv */
797
  }
798
 
@@ -1108,4 +1142,4 @@ body.rtl .fw-backend-option-design-default.with-help > .fw-backend-option-label
1108
  font-size: 13px;
1109
  }
1110
 
1111
- /* end: Edit Term page */
86
  color: #000;
87
  border-bottom: 1px solid #ccc;
88
  margin-top: 0;
89
+ margin-bottom: -1px;
90
  }
91
 
92
  .fw-options-tabs-wrapper > .fw-options-tabs-list ul li a.nav-tab:hover {
243
 
244
  .fw-backend-side-tabs .fw-options-tabs-first-level {
245
  background:
246
+ #fff
247
+ url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAABCAYAAAAo/lyUAAAAIklEQVQ4T2N8/Pjxf4ZRMBoCoyEwGgKjITAaAqMhMKRDAACcIAOqH7nZlwAAAABJRU5ErkJgggAA') /* #e3e3e3 500x1 */
248
+ -302px /* 198-500 */
249
+ 0
250
+ repeat-y;
251
  }
252
 
253
  .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-list {
280
  margin-right: 0;
281
  border: 1px solid #d3d3d3;
282
  border-width: 0 0 1px;
283
+ overflow: hidden;
284
  }
285
 
286
  body.rtl .fw-backend-side-tabs .fw-options-tabs-wrapper > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list {
307
  margin: 0;
308
  padding: 0 10px 0 20px;
309
  display: block;
310
+ box-sizing: border-box;
311
+ width: 100%;
312
+ max-width: 100%;
313
+ height: 43px;
314
+ line-height: 43px;
315
  border: none;
316
  font-size: 14px;
317
  font-weight: 400;
320
  box-shadow: none;
321
  }
322
 
323
+ body.branch-4-0 .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-list ul li a.nav-tab,
324
+ body.branch-4-1 .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-list ul li a.nav-tab,
325
+ body.branch-4-2 .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-list ul li a.nav-tab,
326
+ body.branch-4-3 .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-list ul li a.nav-tab {
327
+ height: 44px;
328
+ line-height: 44px;
329
+ }
330
+
331
  .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-list .ui-tabs-nav a:hover {
332
  background: #dadada;
333
  }
394
  margin-bottom: -1px;
395
  }
396
 
397
+ .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list ul {
398
+ border-bottom: 1px solid #e5e5e5;
399
+ }
400
+
401
+ body.branch-4-0 .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list ul li,
402
+ body.branch-4-1 .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list ul li,
403
+ body.branch-4-2 .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list ul li,
404
+ body.branch-4-3 .fw-backend-side-tabs .fw-options-tabs-first-level > .fw-options-tabs-contents > .fw-inner > .fw-options-tab > .fw-options-tabs-wrapper > .fw-options-tabs-list ul li {
405
  border-bottom: 1px solid #e5e5e5;
406
  }
407
 
471
  margin-bottom: 0;
472
  }
473
 
474
+ .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .hndle {
475
  position: relative;
476
  padding: 0 25px;
477
+ height: 46px;
478
  line-height: 45px;
479
  border-bottom: none !important;
480
  font-size: 17px;
481
  color: #0074a2;
482
  }
483
 
484
+ body.branch-4-0 .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .hndle,
485
+ body.branch-4-1 .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .hndle,
486
+ body.branch-4-2 .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .hndle,
487
+ body.branch-4-3 .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .hndle {
488
+ height: 47px;
489
+ }
490
+
491
+ .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .hndle:after {
492
  content: "";
493
  display: block;
494
  position: absolute;
499
  z-index: 1;
500
  }
501
 
502
+ /*.fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .handlediv {
503
  display: none;
504
+ }*/
505
 
506
  .fw-backend-side-tabs .fw-backend-postboxes > .fw-postbox > .handlediv:before {
507
  top: 4px;
623
  line-height: 1;
624
  color: #fff;
625
  padding: 0;
626
+ margin: 0;
627
  }
628
 
629
  .fw-backend-side-tabs .fw-settings-form-header h2 small {
655
  .fw-backend-side-tabs .fw-settings-form-header .form-header-buttons input {
656
  -webkit-box-shadow: none;
657
  box-shadow: none;
658
+ text-shadow: none;
659
  vertical-align: middle;
660
  }
661
 
674
  width: 1px;
675
  }
676
 
677
+ .fw-backend-side-tabs .fw-settings-form-header .form-header-buttons > * {
678
+ line-height: 26px;
679
+ vertical-align: middle;
680
+ }
681
+
682
  .fw-backend-side-tabs .fw-settings-form-header .form-header-buttons .submit-button-reset {
683
  padding: 0;
684
  height: 26px;
 
685
  color: #fff;
686
  background-color: transparent;
687
  border-width: 0;
798
 
799
  /* Fixes postboxes */
800
 
801
+ .fw-postbox-without-name > .hndle,
802
+ .fw-postbox-without-name > .handlediv,
803
+ .js .fw-postbox-without-name > .hndle,
804
+ .js .fw-postbox-without-name > .handlediv {
805
  display: none;
806
  }
807
 
808
+ .fw-postbox .hndle {
809
  cursor: pointer !important; /* to rewrite .js .postbox .hndle */
810
  }
811
 
812
+ .fw-postbox:not(.initialized) .hndle {
813
  display: none;
814
  }
815
 
816
+ .fw-postbox .hndle .fw-html-before-title small:not(.dashicons),
817
+ .fw-postbox .hndle .fw-html-after-title small:not(.dashicons) {
818
  font-size: medium !important;
819
  }
820
 
821
+ .fw-postbox .hndle .fw-html-before-title .dashicons,
822
+ .fw-postbox .hndle .fw-html-after-title .dashicons {
823
  width: auto;
824
  height: auto;
825
  color: #AAA; /* copied from .handlediv */
826
  }
827
 
828
+ .fw-postbox .hndle .fw-html-before-title .dashicons:hover,
829
+ .fw-postbox .hndle .fw-html-after-title .dashicons:hover {
830
  color: #777; /* copied from .handlediv */
831
  }
832
 
1142
  font-size: 13px;
1143
  }
1144
 
1145
+ /* end: Edit Term page */
framework/static/js/backend-customizer.js CHANGED
@@ -1,6 +1,8 @@
1
  jQuery(function($){
2
  var initialized = false,
3
  changeTimeoutId = 0,
 
 
4
  /**
5
  * @type {Object} {'#options_wrapper_id':'~'}
6
  */
@@ -11,8 +13,11 @@ jQuery(function($){
11
  processPendingChanges = function(){
12
  $.each(pendingChanges, function(optionsWrapperId){
13
  var $optionsWrapper = $('#'+ optionsWrapperId),
14
- $input = $optionsWrapper.closest('.fw-backend-customizer-option').find('> input.fw-backend-customizer-option-input'),
15
- newValue = JSON.stringify($optionsWrapper.find(':input').serializeArray());
 
 
 
16
 
17
  if ($input.val() === newValue) {
18
  return;
@@ -23,8 +28,36 @@ jQuery(function($){
23
 
24
  pendingChanges = {};
25
  },
26
- randomIdIncrement = 0,
27
- localized = _fw_backend_customizer_localized,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  init = function(){
29
  if (initialized) {
30
  return;
@@ -35,9 +68,9 @@ jQuery(function($){
35
  */
36
  $('#customize-theme-controls .fw-backend-customizer-option').each(function(){
37
  $(this).find('> input.fw-backend-customizer-option-input').val(
38
- JSON.stringify(
39
  $(this).find('> .fw-backend-customizer-option-inner :input').serializeArray()
40
- )
41
  );
42
  });
43
 
1
  jQuery(function($){
2
  var initialized = false,
3
  changeTimeoutId = 0,
4
+ randomIdIncrement = 0,
5
+ localized = _fw_backend_customizer_localized,
6
  /**
7
  * @type {Object} {'#options_wrapper_id':'~'}
8
  */
13
  processPendingChanges = function(){
14
  $.each(pendingChanges, function(optionsWrapperId){
15
  var $optionsWrapper = $('#'+ optionsWrapperId),
16
+ $input = $optionsWrapper.closest('.fw-backend-customizer-option')
17
+ .find('> input.fw-backend-customizer-option-input'),
18
+ newValue = JSON.stringify(fixSerializedValues(
19
+ $optionsWrapper.find(':input').serializeArray()
20
+ ));
21
 
22
  if ($input.val() === newValue) {
23
  return;
28
 
29
  pendingChanges = {};
30
  },
31
+ fixSerializedValues = function(values) {
32
+ var inputNameToIndex = {},
33
+ fixedValues = [];
34
+
35
+ /**
36
+ * Traverse reversed array to leave only the last values.
37
+ * This is how _POST works, if you have
38
+ * fw_options[option_name][x]: 3
39
+ * fw_options[option_name][x]: 7
40
+ * the last one "wins" and the value of $_POST['fw_options']['option_name']['x'] will be 7
41
+ */
42
+ for (var i = values.length - 1; i >= 0; i--) {
43
+ if (values[i].name.slice(-2) === '[]') {
44
+ // this will be sent in _POST as array
45
+ } else {
46
+ if (typeof inputNameToIndex[values[i].name] === 'undefined') {
47
+ inputNameToIndex[values[i].name] = i;
48
+ } else {
49
+ continue; // skip if already added (the last overwrites others)
50
+ }
51
+ }
52
+
53
+ fixedValues.push(values[i]);
54
+ }
55
+
56
+ /**
57
+ * The array was traversed in revers order, now restore the initial order
58
+ */
59
+ return fixedValues.reverse();
60
+ },
61
  init = function(){
62
  if (initialized) {
63
  return;
68
  */
69
  $('#customize-theme-controls .fw-backend-customizer-option').each(function(){
70
  $(this).find('> input.fw-backend-customizer-option-input').val(
71
+ JSON.stringify(fixSerializedValues(
72
  $(this).find('> .fw-backend-customizer-option-inner :input').serializeArray()
73
+ ))
74
  );
75
  });
76
 
framework/static/js/backend-options.js CHANGED
@@ -37,14 +37,14 @@ jQuery(document).ready(function($){
37
  */
38
  function addPostboxToggles($boxes) {
39
  /** Remove events added by /wp-admin/js/postbox.js */
40
- $boxes.find('h3, .handlediv').off('click.postboxes');
41
 
42
  var eventNamespace = '.fw-backend-postboxes';
43
 
44
  // make postboxes to close/open on click
45
  $boxes
46
  .off('click'+ eventNamespace) // remove already attached, just to be sure, prevent multiple execution
47
- .on('click'+ eventNamespace, '> h3.hndle, > .handlediv', function(e){
48
  var $box = $(this).closest('.fw-postbox');
49
 
50
  $box.toggleClass('closed');
@@ -58,7 +58,7 @@ jQuery(document).ready(function($){
58
 
59
  /** Remove box header if title is empty */
60
  function hideBoxEmptyTitles($boxes) {
61
- $boxes.find('> h3.hndle > span').each(function(){
62
  var $this = $(this);
63
 
64
  if (!$.trim($this.html()).length) {
@@ -136,7 +136,7 @@ jQuery(document).ready(function($){
136
  * If not prevented, boxes within options can be dragged out of parent box to first level boxes
137
  */
138
  .off('mousedown'+ eventNamespace) // remove already attached (happens when this script is executed multiple times on the same elements)
139
- .on('mousedown'+ eventNamespace, '.fw-postbox > h3.hndle, .fw-postbox > .handlediv', function(e){
140
  e.stopPropagation();
141
  });
142
  }
37
  */
38
  function addPostboxToggles($boxes) {
39
  /** Remove events added by /wp-admin/js/postbox.js */
40
+ $boxes.find('h2, h3, .handlediv').off('click.postboxes');
41
 
42
  var eventNamespace = '.fw-backend-postboxes';
43
 
44
  // make postboxes to close/open on click
45
  $boxes
46
  .off('click'+ eventNamespace) // remove already attached, just to be sure, prevent multiple execution
47
+ .on('click'+ eventNamespace, '> .hndle, > .handlediv', function(e){
48
  var $box = $(this).closest('.fw-postbox');
49
 
50
  $box.toggleClass('closed');
58
 
59
  /** Remove box header if title is empty */
60
  function hideBoxEmptyTitles($boxes) {
61
+ $boxes.find('> .hndle > span').each(function(){
62
  var $this = $(this);
63
 
64
  if (!$.trim($this.html()).length) {
136
  * If not prevented, boxes within options can be dragged out of parent box to first level boxes
137
  */
138
  .off('mousedown'+ eventNamespace) // remove already attached (happens when this script is executed multiple times on the same elements)
139
+ .on('mousedown'+ eventNamespace, '.fw-postbox > .hndle, .fw-postbox > .handlediv', function(e){
140
  e.stopPropagation();
141
  });
142
  }
framework/static/js/fw-form-helpers.js CHANGED
@@ -39,8 +39,15 @@ var fwForm = {
39
  } else {
40
  // Frontend
41
  jQuery.each(data.errors, function (inputName, message) {
 
 
 
42
  var $input = elements.$form.find('[name="' + inputName + '"]').last();
43
- message = '<p class="form-error" style="color: #9b2922;">{message}</p>'.replace('{message}', message);
 
 
 
 
44
 
45
  if ($input.length) {
46
  // error message under input
39
  } else {
40
  // Frontend
41
  jQuery.each(data.errors, function (inputName, message) {
42
+ message = '<p class="form-error" style="color: #9b2922;">{message}</p>'
43
+ .replace('{message}', message);
44
+
45
  var $input = elements.$form.find('[name="' + inputName + '"]').last();
46
+
47
+ if (!$input.length) {
48
+ // maybe input name has array format, try to find by prefix: name[
49
+ $input = elements.$form.find('[name^="'+ inputName +'["]').last();
50
+ }
51
 
52
  if ($input.length) {
53
  // error message under input
framework/static/js/fw.js CHANGED
@@ -290,6 +290,10 @@ fw.md5 = (function(){
290
  return false;
291
  }
292
 
 
 
 
 
293
  this.current = this.queue.shift();
294
 
295
  if (!this.current) {
@@ -391,6 +395,10 @@ fw.md5 = (function(){
391
 
392
  this.$getEl().hide().removeClass('opening open closing').addClass('closed');
393
 
 
 
 
 
394
  this.current = null;
395
 
396
  this.show();
@@ -587,7 +595,7 @@ fw.getQueryString = function(name) {
587
  * Usage:
588
  * var modal = new fw.Modal();
589
  *
590
- * modal.on('open|closing|close', function(){});
591
  */
592
  fw.Modal = Backbone.Model.extend({
593
  defaults: {
@@ -614,15 +622,15 @@ fw.getQueryString = function(name) {
614
  });
615
  },
616
  render: function() {
617
- this.$el.html(
618
- this.model.get('html')
619
- );
620
 
621
- fwEvents.trigger('fw:options:init', {$elements: this.$el});
 
622
 
623
- this.trigger('render');
624
 
625
- this.afterHtmlReplaceFixes();
 
626
  },
627
  initialize: function() {
628
  this.listenTo(this.model, 'change:html', this.render);
@@ -649,7 +657,9 @@ fw.getQueryString = function(name) {
649
  /**
650
  * Create and init this.frame
651
  */
652
- initializeFrame: function() {
 
 
653
  var modal = this;
654
 
655
  var ControllerMainState = wp.media.controller.State.extend({
@@ -858,8 +868,8 @@ fw.getQueryString = function(name) {
858
  */
859
  jQuery.data(this.content.el, 'modal', this);
860
  },
861
- initialize: function() {
862
- this.initializeFrame();
863
  this.initializeContent();
864
  },
865
  open: function() {
@@ -1060,46 +1070,53 @@ fw.getQueryString = function(name) {
1060
  values: {}
1061
  }
1062
  ),
1063
- initializeFrame: function() {
1064
- fw.Modal.prototype.initializeFrame.call(this);
1065
-
1066
- this.frame.once('ready', _.bind(function() {
1067
- this.frame.$el.removeClass('hide-toolbar');
1068
- this.frame.modal.$el.addClass('fw-options-modal');
1069
- }, this));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1070
 
1071
- var modal = this;
 
 
1072
 
1073
  this.frame.on('content:create:main', function () {
1074
  modal.frame.toolbar.set(
1075
  new wp.media.view.Toolbar({
1076
  controller: modal.frame,
1077
- items: [
1078
- {
1079
- style: 'primary',
1080
- text: _fw_localized.l10n.save,
1081
- priority: 40,
1082
- click: function () {
1083
- /**
1084
- * Simulate form submit
1085
- * Important: Empty input[required] must not start form submit
1086
- * and must show default browser warning popup "This field is required"
1087
- */
1088
- modal.content.$el.find('input[type="submit"].hidden-submit').trigger('click');
1089
- }
1090
- },
1091
- {
1092
- style: '',
1093
- text: _fw_localized.l10n.reset,
1094
- priority: -1,
1095
- click: function () {
1096
- modal.content.resetForm();
1097
- }
1098
- }
1099
- ]
1100
  })
1101
  );
1102
  });
 
 
 
 
 
1103
  },
1104
  /**
1105
  * @param {Object} [values] Offer custom values for display. The user can reject them by closing the modal
@@ -1654,6 +1671,7 @@ fw.soleModal = (function(){
1654
  hidePrevious: false,
1655
  updateIfCurrent: false,
1656
  backdrop: null,
 
1657
  afterOpen: function(){},
1658
  afterClose: function(){}
1659
  }, opts || {});
@@ -1682,8 +1700,16 @@ fw.soleModal = (function(){
1682
  &&
1683
  this.queue[0].updateIfCurrent
1684
  ) {
 
 
 
 
1685
  this.current = this.queue.shift();
1686
 
 
 
 
 
1687
  this.setContent(this.current.html);
1688
 
1689
  return true;
@@ -1692,8 +1718,11 @@ fw.soleModal = (function(){
1692
  }
1693
  }
1694
 
1695
- this.currentMethod = '';
 
 
1696
 
 
1697
  this.current = this.queue.shift();
1698
 
1699
  if (!this.current) {
@@ -1718,6 +1747,10 @@ fw.soleModal = (function(){
1718
  this.$modal.removeClass('fw-modal-closing');
1719
  this.$modal.addClass('fw-modal-open');
1720
 
 
 
 
 
1721
  this.$modal.css('display', '');
1722
 
1723
  this.setSize(this.current.width, this.current.height);
@@ -1784,6 +1817,10 @@ fw.soleModal = (function(){
1784
  this.$getContent().fadeOut('fast', _.bind(function(){
1785
  this.current.afterClose();
1786
 
 
 
 
 
1787
  this.currentMethod = '';
1788
  this.current = null;
1789
  this.show();
@@ -1805,6 +1842,10 @@ fw.soleModal = (function(){
1805
  this.$modal.removeClass('fw-modal-open');
1806
  this.$modal.removeClass('fw-modal-closing');
1807
 
 
 
 
 
1808
  this.setContent('');
1809
 
1810
  this.current = null;
290
  return false;
291
  }
292
 
293
+ if (this.current && this.current.customClass !== null) {
294
+ this.$modal.removeClass(this.current.customClass);
295
+ }
296
+
297
  this.current = this.queue.shift();
298
 
299
  if (!this.current) {
395
 
396
  this.$getEl().hide().removeClass('opening open closing').addClass('closed');
397
 
398
+ if (this.$modal && this.current.customClass !== null) {
399
+ this.$modal.removeClass(this.current.customClass);
400
+ }
401
+
402
  this.current = null;
403
 
404
  this.show();
595
  * Usage:
596
  * var modal = new fw.Modal();
597
  *
598
+ * modal.on('open|render|closing|close', function(){});
599
  */
600
  fw.Modal = Backbone.Model.extend({
601
  defaults: {
622
  });
623
  },
624
  render: function() {
625
+ this.$el.html(this.model.get('html'));
 
 
626
 
627
+ if (this.model.get('html').length) {
628
+ fwEvents.trigger('fw:options:init', {$elements: this.$el});
629
 
630
+ this.model.trigger('render');
631
 
632
+ this.afterHtmlReplaceFixes();
633
+ }
634
  },
635
  initialize: function() {
636
  this.listenTo(this.model, 'change:html', this.render);
657
  /**
658
  * Create and init this.frame
659
  */
660
+ initializeFrame: function(settings) {
661
+ settings = settings || {};
662
+
663
  var modal = this;
664
 
665
  var ControllerMainState = wp.media.controller.State.extend({
868
  */
869
  jQuery.data(this.content.el, 'modal', this);
870
  },
871
+ initialize: function(attributes, settings) {
872
+ this.initializeFrame(settings);
873
  this.initializeContent();
874
  },
875
  open: function() {
1070
  values: {}
1071
  }
1072
  ),
1073
+ initializeFrame: function(settings) {
1074
+ fw.Modal.prototype.initializeFrame.call(this, settings);
1075
+
1076
+ settings = settings || {};
1077
+
1078
+ var modal = this,
1079
+ buttons = [
1080
+ {
1081
+ style: 'primary',
1082
+ text: _fw_localized.l10n.save,
1083
+ priority: 40,
1084
+ click: function () {
1085
+ /**
1086
+ * Simulate form submit
1087
+ * Important: Empty input[required] must not start form submit
1088
+ * and must show default browser warning popup "This field is required"
1089
+ */
1090
+ modal.content.$el.find('input[type="submit"].hidden-submit').trigger('click');
1091
+ }
1092
+ },
1093
+ {
1094
+ style: '',
1095
+ text: _fw_localized.l10n.reset,
1096
+ priority: -1,
1097
+ click: function () {
1098
+ modal.content.resetForm();
1099
+ }
1100
+ }
1101
+ ];
1102
 
1103
+ if (settings.buttons) {
1104
+ buttons = buttons.concat(settings.buttons);
1105
+ }
1106
 
1107
  this.frame.on('content:create:main', function () {
1108
  modal.frame.toolbar.set(
1109
  new wp.media.view.Toolbar({
1110
  controller: modal.frame,
1111
+ items: buttons
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1112
  })
1113
  );
1114
  });
1115
+
1116
+ this.frame.once('ready', _.bind(function() {
1117
+ this.frame.$el.removeClass('hide-toolbar');
1118
+ this.frame.modal.$el.addClass('fw-options-modal');
1119
+ }, this));
1120
  },
1121
  /**
1122
  * @param {Object} [values] Offer custom values for display. The user can reject them by closing the modal
1671
  hidePrevious: false,
1672
  updateIfCurrent: false,
1673
  backdrop: null,
1674
+ customClass: null,
1675
  afterOpen: function(){},
1676
  afterClose: function(){}
1677
  }, opts || {});
1700
  &&
1701
  this.queue[0].updateIfCurrent
1702
  ) {
1703
+ if (this.$modal && this.current.customClass !== null) {
1704
+ this.$modal.removeClass(this.current.customClass);
1705
+ }
1706
+
1707
  this.current = this.queue.shift();
1708
 
1709
+ if (this.$modal && this.current.customClass !== null) {
1710
+ this.$modal.addClass(this.current.customClass);
1711
+ }
1712
+
1713
  this.setContent(this.current.html);
1714
 
1715
  return true;
1718
  }
1719
  }
1720
 
1721
+ if (this.current && this.$modal && this.current.customClass !== null) {
1722
+ this.$modal.removeClass(this.current.customClass);
1723
+ }
1724
 
1725
+ this.currentMethod = '';
1726
  this.current = this.queue.shift();
1727
 
1728
  if (!this.current) {
1747
  this.$modal.removeClass('fw-modal-closing');
1748
  this.$modal.addClass('fw-modal-open');
1749
 
1750
+ if (this.$modal && this.current.customClass !== null) {
1751
+ this.$modal.addClass(this.current.customClass);
1752
+ }
1753
+
1754
  this.$modal.css('display', '');
1755
 
1756
  this.setSize(this.current.width, this.current.height);
1817
  this.$getContent().fadeOut('fast', _.bind(function(){
1818
  this.current.afterClose();
1819
 
1820
+ if (this.$modal && this.current.customClass !== null) {
1821
+ this.$modal.removeClass(this.current.customClass);
1822
+ }
1823
+
1824
  this.currentMethod = '';
1825
  this.current = null;
1826
  this.show();
1842
  this.$modal.removeClass('fw-modal-open');
1843
  this.$modal.removeClass('fw-modal-closing');
1844
 
1845
+ if (this.$modal && this.current.customClass !== null) {
1846
+ this.$modal.removeClass(this.current.customClass);
1847
+ }
1848
+
1849
  this.setContent('');
1850
 
1851
  this.current = null;
framework/views/backend-settings-form.php CHANGED
@@ -396,7 +396,7 @@ jQuery(function($){
396
  <!-- end: ajax submit -->
397
  <?php endif; ?>
398
 
399
- <?php if ($side_tabs): ?>
400
  <!-- open all postboxes -->
401
  <script type="text/javascript">
402
  jQuery(function ($) {
396
  <!-- end: ajax submit -->
397
  <?php endif; ?>
398
 
399
+ <?php if ($side_tabs && apply_filters('fw:settings-form:side-tabs:open-all-boxes', true)): ?>
400
  <!-- open all postboxes -->
401
  <script type="text/javascript">
402
  jQuery(function ($) {
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: unyson, themefusecom
3
  Tags: page builder, cms, grid, layout, responsive, back up, backup, db backup, dump, migrate, schedule, search engine optimization, seo, media, slideshow, shortcode, slide, slideshare, slideshow, google sitemaps, sitemaps, analytics, google analytics, calendar, event, events, google maps, learning, lessons, sidebars, breadcrumbs, review, portfolio, framework
4
  Requires at least: 4.0.0
5
- Tested up to: 4.3
6
- Stable tag: 2.4.11
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -82,6 +82,17 @@ Yes; Unyson will work with any theme.
82
 
83
  == Changelog ==
84
 
 
 
 
 
 
 
 
 
 
 
 
85
  = 2.4.11 =
86
  * Fixed a bug in `popup` option-type: Options were not saved
87
 
2
  Contributors: unyson, themefusecom
3
  Tags: page builder, cms, grid, layout, responsive, back up, backup, db backup, dump, migrate, schedule, search engine optimization, seo, media, slideshow, shortcode, slide, slideshare, slideshow, google sitemaps, sitemaps, analytics, google analytics, calendar, event, events, google maps, learning, lessons, sidebars, breadcrumbs, review, portfolio, framework
4
  Requires at least: 4.0.0
5
+ Tested up to: 4.4
6
+ Stable tag: 2.4.12
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
82
 
83
  == Changelog ==
84
 
85
+ = 2.4.12 =
86
+ * WordPress 4.4 fixes
87
+ * Fixed
88
+ [#1039](https://github.com/ThemeFuse/Unyson/issues/1039),
89
+ [#1044](https://github.com/ThemeFuse/Unyson/issues/1044),
90
+ [#1055](https://github.com/ThemeFuse/Unyson/pull/1055),
91
+ [#1072](https://github.com/ThemeFuse/Unyson/issues/1072),
92
+ [#1049](https://github.com/ThemeFuse/Unyson/issues/1049),
93
+ [#1086](https://github.com/ThemeFuse/Unyson/issues/1086),
94
+ [PageBuilder#40](https://github.com/ThemeFuse/Unyson-PageBuilder-Extension/issues/40#issuecomment-160135453)
95
+
96
  = 2.4.11 =
97
  * Fixed a bug in `popup` option-type: Options were not saved
98
 
unyson.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Unyson
4
  * Plugin URI: http://unyson.io/
5
  * Description: A free drag & drop framework that comes with a bunch of built in extensions that will help you develop premium themes fast & easy.
6
- * Version: 2.4.11
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+
@@ -123,94 +123,5 @@ if (defined('FW')) {
123
  return dirname( __FILE__ ) . '/tmp';
124
  }
125
  add_filter( 'fw_tmp_dir', '_filter_fw_tmp_dir' );
126
-
127
- /** @internal */
128
- final class _FW_Update_Hooks {
129
- public static function _init() {
130
- add_filter( 'upgrader_pre_install', array(__CLASS__, '_filter_fw_check_if_plugin_pre_update'), 9999, 2 );
131
- add_filter( 'upgrader_post_install', array(__CLASS__, '_filter_fw_check_if_plugin_post_update'), 9999, 2 );
132
- add_action( 'automatic_updates_complete', array(__CLASS__, '_action_fw_automatic_updates_complete') );
133
- }
134
-
135
- public static function _filter_fw_check_if_plugin_pre_update( $result, $data ) {
136
- if (
137
- !is_wp_error($result)
138
- &&
139
- isset( $data['plugin'] )
140
- &&
141
- plugin_basename( __FILE__ ) === $data['plugin']
142
- ) {
143
- /**
144
- * Before plugin update
145
- * The plugin was already download and extracted to a temp directory
146
- * and it's right before being replaced with the new downloaded version
147
- */
148
- do_action( 'fw_plugin_pre_update' ); self::_fw_update_debug_log('fw_plugin_pre_update');
149
- }
150
-
151
- return $result;
152
- }
153
-
154
- public static function _filter_fw_check_if_plugin_post_update( $result, $data ) {
155
- if (
156
- !is_wp_error($result)
157
- &&
158
- isset( $data['plugin'] )
159
- &&
160
- plugin_basename( __FILE__ ) === $data['plugin']
161
- ) {
162
- /**
163
- * After plugin successfully updated
164
- */
165
- do_action( 'fw_plugin_post_update' ); self::_fw_update_debug_log('fw_plugin_post_update');
166
- }
167
-
168
- return $result;
169
- }
170
-
171
- public static function _action_fw_automatic_updates_complete($results) {
172
- if (!isset($results['plugin'])) {
173
- return;
174
- }
175
-
176
- foreach ($results['plugin'] as $plugin) {
177
- if (plugin_basename( __FILE__ ) === strtolower($plugin->item->plugin)) {
178
- do_action( 'fw_automatic_update_complete', $plugin->result ); self::_fw_update_debug_log('fw_automatic_update_complete '. ($plugin->result ? 'OK' : 'NOT OK'));
179
- break;
180
- }
181
- }
182
- }
183
-
184
- /**
185
- * Log debug information in ABSPATH/fw-update.log
186
- * @param string $message
187
- * @return bool|void
188
- */
189
- private static function _fw_update_debug_log($message) {
190
- /** @var WP_Filesystem_Base $wp_filesystem */
191
- global $wp_filesystem;
192
-
193
- if (!$wp_filesystem) {
194
- return;
195
- }
196
-
197
- $file_fs_path = fw_fix_path($wp_filesystem->abspath()) .'/fw-update.log';
198
-
199
- if ($wp_filesystem->exists($file_fs_path)) {
200
- $current_log = $wp_filesystem->get_contents($file_fs_path);
201
-
202
- if ($current_log === false) {
203
- return false;
204
- }
205
- } else {
206
- $current_log = '';
207
- }
208
-
209
- $message = '['. date('Y-m-d H:i:s') .'] '. $message;
210
-
211
- $wp_filesystem->put_contents($file_fs_path, $current_log . $message ."\n");
212
- }
213
- }
214
- _FW_Update_Hooks::_init();
215
  }
216
  }
3
  * Plugin Name: Unyson
4
  * Plugin URI: http://unyson.io/
5
  * Description: A free drag & drop framework that comes with a bunch of built in extensions that will help you develop premium themes fast & easy.
6
+ * Version: 2.4.12
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+
123
  return dirname( __FILE__ ) . '/tmp';
124
  }
125
  add_filter( 'fw_tmp_dir', '_filter_fw_tmp_dir' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  }
127
  }