Unyson - Version 2.2.4

Version Description

  • Fixed #398
  • Removed option type runnable #399
Download this release

Release Info

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

Code changes from version 2.2.3 to 2.2.4

framework/includes/option-types.php CHANGED
@@ -893,4 +893,3 @@ require $dir .'/option-types/popup/class-fw-option-type-popup.php';
893
  require $dir .'/option-types/slider/class-fw-option-type-slider.php';
894
  require $dir .'/option-types/range-slider/class-fw-option-type-range-slider.php';
895
  require $dir .'/option-types/rgba-color-picker/class-fw-option-type-rgba-color-picker.php';
896
- require $dir .'/option-types/runnable/class-fw-option-type-runnable.php';
893
  require $dir .'/option-types/slider/class-fw-option-type-slider.php';
894
  require $dir .'/option-types/range-slider/class-fw-option-type-range-slider.php';
895
  require $dir .'/option-types/rgba-color-picker/class-fw-option-type-rgba-color-picker.php';
 
framework/includes/option-types/icon/static/css/backend.css CHANGED
@@ -34,12 +34,16 @@ body.rtl .fw-option-type-icon .option-type-icon-list i {
34
  display: inline-block;
35
  }
36
 
37
- .fw-option-type-icon .option-type-icon-list i.active,
38
  .fw-option-type-icon .option-type-icon-list i:hover {
39
  background: #0074a2;
40
  color: #fff;
41
  cursor: pointer;
42
  }
 
 
 
 
 
43
 
44
  .fw-option-type-icon .fw-backend-option {
45
  border-bottom: none;
34
  display: inline-block;
35
  }
36
 
 
37
  .fw-option-type-icon .option-type-icon-list i:hover {
38
  background: #0074a2;
39
  color: #fff;
40
  cursor: pointer;
41
  }
42
+ .fw-option-type-icon .option-type-icon-list i.active:hover,
43
+ .fw-option-type-icon .option-type-icon-list i.active{
44
+ background: #64bd1f;
45
+ color: #fff;
46
+ }
47
 
48
  .fw-option-type-icon .fw-backend-option {
49
  border-bottom: none;
framework/includes/option-types/runnable/class-fw-option-type-runnable.php DELETED
@@ -1,139 +0,0 @@
1
- <?php if ( ! defined( 'FW' ) ) {
2
- die( 'Forbidden' );
3
- }
4
- /**
5
- * This option type let you run a callback by click on Run button.
6
- * example of $option array
7
- * array(
8
- * 'type' => 'runnable',
9
- * 'value' => 'This script have no runs',
10
- * 'label' => __('Convert data', 'fw'),
11
- * 'desc' => __('There are posts, pages, categories or tags without language set. Do you want to set them all to default language.', 'fw'),
12
- * 'help' => __('Help tip', 'fw'),
13
- * 'content'=>__('Run this script'),
14
- * 'callback'=> array('translation' , 'convert_data_to_default_language')
15
- * )
16
- */
17
- /**
18
- * Class FW_Option_Type_Runnable
19
- */
20
- class FW_Option_Type_Runnable extends FW_Option_Type {
21
-
22
- /**
23
- * Option's unique type, used in option array in 'type' key
24
- * @return string
25
- */
26
- public function get_type() {
27
- return 'runnable';
28
-
29
-
30
- }
31
-
32
- /**
33
- * Run callback.
34
- */
35
- public function run_callback() {
36
-
37
- $callback = explode( '.', FW_Request::POST( 'callback' ) );
38
- $length = count( $callback );
39
-
40
- if ( $length === 1 && is_callable( $callback[0] ) ) {
41
- $handler = $callback[0];
42
- } elseif ( $length === 2 && is_callable( $callback ) ) {
43
- $handler = $callback;
44
- } elseif ( $length === 2 && is_callable( $fw_ext_callback = array( fw_ext( $callback[0] ), $callback[1] ) ) ) {
45
- $handler = $fw_ext_callback;
46
- } else {
47
- wp_send_json_error( 'Your callback is not callable' );
48
- }
49
-
50
- call_user_func( $handler );
51
- }
52
-
53
- /**
54
- * Generate option's html from option array.
55
- *
56
- * @param string $id
57
- * @param array $option
58
- * @param array $data
59
- *
60
- * @return string HTML
61
- * @internal
62
- */
63
- protected function _render( $id, $option, $data ) {
64
-
65
- $callback = implode( '.', (array) $option['callback'] );
66
- $option['attr']['value'] = (string) $data['value'];
67
-
68
- return '<div class="runnable-wrapper">
69
- <button data-callback="' . $callback . '" type="button" class="runnable-button button-primary">' . $option['content'] . '</button>
70
- <div class="runnable-last-run">' . $option['attr']['value'] . '</div>
71
- <input type="hidden" ' . fw_attr_to_html( $option['attr'] ) . '/>
72
- </div>';
73
- }
74
-
75
- /**
76
- * Enqueue static.
77
- * @param string $id
78
- * @param array $option
79
- * @param array $data
80
- */
81
- protected function _enqueue_static( $id, $option, $data ) {
82
- $js_path = fw_get_framework_directory_uri( '/includes/option-types/runnable/static/js/runnable.js' );
83
- $css_path = fw_get_framework_directory_uri( '/includes/option-types/runnable/static/css/runnable.css' );
84
-
85
- wp_enqueue_script(
86
- 'fw-option-' . $this->get_type() . '-js',
87
- $js_path,
88
- array( 'jquery', 'fw-moment' ),
89
- fw()->manifest->get_version()
90
- );
91
-
92
- wp_enqueue_style(
93
- 'fw-option-' . $this->get_type() . '-css',
94
- $css_path,
95
- array(),
96
- fw()->manifest->get_version()
97
- );
98
- }
99
-
100
- /**
101
- * Extract correct value for $option['value'] from input array
102
- * If input value is empty, will be returned $option['value']
103
- *
104
- * @param array $option
105
- * @param array|string|null $input_value
106
- *
107
- * @return string|array|int|bool Correct value
108
- * @internal
109
- */
110
- protected function _get_value_from_input( $option, $input_value ) {
111
- return (string) ( is_null( $input_value ) ? $option['value'] : $input_value );
112
- }
113
-
114
- /**
115
- * Default option array
116
- *
117
- * This makes possible an option array to have required only one parameter: array('type' => '...')
118
- * Other parameters are merged with array returned from this method
119
- *
120
- * @return array
121
- *
122
- * array(
123
- * 'value' => '',
124
- * ...
125
- * )
126
- * @internal
127
- */
128
- protected function _get_defaults() {
129
- return array(
130
- 'value' => '',
131
- 'content' => 'Run'
132
- );
133
- }
134
-
135
- }
136
-
137
- FW_Option_Type::register( 'FW_Option_Type_Runnable' );
138
-
139
- add_action( 'wp_ajax_fw_runnable', array( 'FW_Option_Type_Runnable', 'run_callback' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
framework/includes/option-types/runnable/static/css/runnable.css DELETED
@@ -1,9 +0,0 @@
1
- .fw-backend-option-type-runnable .runnable-wrapper .runnable-button {
2
- float: left;
3
- }
4
-
5
- .fw-backend-option-type-runnable .runnable-wrapper .runnable-last-run {
6
- float: left;
7
- padding-left: 20px;
8
- line-height: 28px
9
- }
 
 
 
 
 
 
 
 
 
framework/includes/option-types/runnable/static/js/runnable.js DELETED
@@ -1,43 +0,0 @@
1
- (function ($, fwe) {
2
- var init = function () {
3
- var $hidden = $(this),
4
- $button = $hidden.parent().find('.runnable-button'),
5
- $textDiv = $hidden.parent().find('.runnable-last-run');
6
-
7
- var showDate = function ($timestamp) {
8
- $textDiv.text('Last run was ' + moment($timestamp, 'X').fromNow());
9
- }
10
-
11
- if (moment($hidden.val(), 'X', true).isValid()) {
12
- showDate($hidden.val());
13
- }
14
-
15
- $button.on('click', function (e) {
16
- e.preventDefault();
17
-
18
- $.ajax({
19
- type: "post",
20
- dataType: "json",
21
- url: ajaxurl,
22
- data: {action: 'fw_runnable', callback: $(this).data('callback')}
23
- }).done(function (data) {
24
- if (data.success) {
25
- var $timestamp = moment().format('X');
26
- $hidden.val($timestamp);
27
- showDate($timestamp);
28
- }
29
-
30
- fwe.trigger('fw:option-type:runnable:change', {
31
- $element: $hidden,
32
- response: data
33
- });
34
- });
35
- });
36
- };
37
-
38
- fwe.on('fw:options:init', function (data) {
39
- data.$elements
40
- .find('.fw-option-type-runnable:not(.fw-option-initialized)').each(init)
41
- .addClass('fw-option-initialized');
42
- });
43
- })(jQuery, fwEvents);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
framework/manifest.php CHANGED
@@ -4,4 +4,4 @@ $manifest = array();
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
- $manifest['version'] = '2.2.3';
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
+ $manifest['version'] = '2.2.4';
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.1
6
- Stable tag: 2.2.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -86,9 +86,13 @@ Yes; Unyson will work with any theme.
86
 
87
  == Changelog ==
88
 
 
 
 
 
89
  = 2.2.3 =
90
- * Fixed [#397](https://github.com/ThemeFuse/Unyson/issues/397), [#394](https://github.com/ThemeFuse/Unyson/issues/394), [#389](https://github.com/ThemeFuse/Unyson/issues/389), [384](https://github.com/ThemeFuse/Unyson/issues/384), [#355](https://github.com/ThemeFuse/Unyson/issues/355)
91
- * Added option type `runnable` [code](https://github.com/ThemeFuse/Unyson/blob/master/framework/includes/option-types/runnable/class-fw-option-type-runnable.php)
92
 
93
  = 2.2.2 =
94
  * Added experimental `$option['option_handler']` [636ed56](https://github.com/ThemeFuse/Unyson/commit/636ed56fe499a4e855b5f49198747460833539a3)
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.1
6
+ Stable tag: 2.2.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
86
 
87
  == Changelog ==
88
 
89
+ = 2.2.4 =
90
+ * Fixed [#398](https://github.com/ThemeFuse/Unyson/issues/398)
91
+ * Removed option type `runnable` [#399](https://github.com/ThemeFuse/Unyson/issues/399)
92
+
93
  = 2.2.3 =
94
+ * Fixed [#397](https://github.com/ThemeFuse/Unyson/issues/397), [#394](https://github.com/ThemeFuse/Unyson/issues/394), [#389](https://github.com/ThemeFuse/Unyson/issues/389), [#384](https://github.com/ThemeFuse/Unyson/issues/384), [#355](https://github.com/ThemeFuse/Unyson/issues/355)
95
+ * Added option type `runnable`
96
 
97
  = 2.2.2 =
98
  * Added experimental `$option['option_handler']` [636ed56](https://github.com/ThemeFuse/Unyson/commit/636ed56fe499a4e855b5f49198747460833539a3)
unyson.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Unyson
4
  * Plugin URI: http://unyson.themefuse.com/
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.2.3
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+
3
  * Plugin Name: Unyson
4
  * Plugin URI: http://unyson.themefuse.com/
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.2.4
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+