Ditty News Ticker - Version 3.0.23

Version Description

  • Fontawesome slug update
Download this release

Release Info

Developer metaphorcreations
Plugin Icon 128x128 Ditty News Ticker
Version 3.0.23
Comparing to
See all releases

Code changes from version 3.0.22 to 3.0.23

ditty-news-ticker.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
 
3
  /**
4
- * Plugin Name: Ditty (formerly Ditty News Ticker)
5
  * Plugin URI: https://www.metaphorcreations.com/ditty
6
- * Description: Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
7
- * Version: 3.0.22
8
  * Author: Metaphor Creations
9
  * Author URI: https://www.metaphorcreations.com
10
  * License: GPL-2.0+
@@ -20,7 +20,7 @@ if ( ! defined( 'WPINC' ) ) {
20
 
21
  // Plugin version.
22
  if ( ! defined( 'DITTY_VERSION' ) ) {
23
- define( 'DITTY_VERSION', '3.0.22' );
24
  }
25
 
26
  // Plugin Folder Path.
1
  <?php
2
 
3
  /**
4
+ * Plugin Name: Ditty
5
  * Plugin URI: https://www.metaphorcreations.com/ditty
6
+ * Description: Formerly Ditty News Ticker, Ditty is a multi-functional content display WordPress plugin.
7
+ * Version: 3.0.23
8
  * Author: Metaphor Creations
9
  * Author URI: https://www.metaphorcreations.com
10
  * License: GPL-2.0+
20
 
21
  // Plugin version.
22
  if ( ! defined( 'DITTY_VERSION' ) ) {
23
+ define( 'DITTY_VERSION', '3.0.23' );
24
  }
25
 
26
  // Plugin Folder Path.
includes/class-ditty.php CHANGED
@@ -249,6 +249,7 @@ class Ditty {
249
  require_once DITTY_DIR . 'includes/fields/ditty-field-heading.php';
250
  require_once DITTY_DIR . 'includes/fields/ditty-field-html.php';
251
  require_once DITTY_DIR . 'includes/fields/ditty-field-image.php';
 
252
  require_once DITTY_DIR . 'includes/fields/ditty-field-number.php';
253
  require_once DITTY_DIR . 'includes/fields/ditty-field-radio.php';
254
  require_once DITTY_DIR . 'includes/fields/ditty-field-text.php';
@@ -436,15 +437,13 @@ class Ditty {
436
  wp_enqueue_style( 'ditty', DITTY_URL . 'includes/css/ditty.css', array(), $this->version, 'all' );
437
  wp_register_style( 'ditty-admin', DITTY_URL . 'includes/css/ditty-admin.css', array(), $this->version, 'all' );
438
 
439
- wp_register_style( 'fontawesome', 'https://use.fontawesome.com/releases/v5.15.3/css/all.css', false, '5.15.3', false );
440
-
441
  wp_register_style( 'protip', DITTY_URL . 'includes/libs/protip/protip.min.css', false, '1.4.21', false );
442
  wp_register_style( 'ion-rangeslider', DITTY_URL . 'includes/libs/ion.rangeSlider/css/ion.rangeSlider.min.css', false, '2.3.1', false );
443
  wp_register_style( 'jquery-minicolors', DITTY_URL . 'includes/libs/jquery-minicolors/jquery.minicolors.css', false, '2.3.5', false );
444
 
445
  $disable_fontawesome = ditty_settings( 'disable_fontawesome' );
446
- if ( ! $disable_fontawesome ) {
447
- wp_enqueue_style( 'fontawesome' );
448
  }
449
 
450
  if ( is_admin() ) {
@@ -453,9 +452,7 @@ class Ditty {
453
  wp_enqueue_style( 'ion-rangeslider' );
454
  wp_enqueue_style( 'jquery-minicolors' );
455
  wp_enqueue_style( 'ditty-admin' );
456
- if ( $disable_fontawesome ) {
457
- wp_enqueue_style( 'fontawesome' );
458
- }
459
  }
460
  }
461
 
249
  require_once DITTY_DIR . 'includes/fields/ditty-field-heading.php';
250
  require_once DITTY_DIR . 'includes/fields/ditty-field-html.php';
251
  require_once DITTY_DIR . 'includes/fields/ditty-field-image.php';
252
+ require_once DITTY_DIR . 'includes/fields/ditty-field-layout_element.php';
253
  require_once DITTY_DIR . 'includes/fields/ditty-field-number.php';
254
  require_once DITTY_DIR . 'includes/fields/ditty-field-radio.php';
255
  require_once DITTY_DIR . 'includes/fields/ditty-field-text.php';
437
  wp_enqueue_style( 'ditty', DITTY_URL . 'includes/css/ditty.css', array(), $this->version, 'all' );
438
  wp_register_style( 'ditty-admin', DITTY_URL . 'includes/css/ditty-admin.css', array(), $this->version, 'all' );
439
 
 
 
440
  wp_register_style( 'protip', DITTY_URL . 'includes/libs/protip/protip.min.css', false, '1.4.21', false );
441
  wp_register_style( 'ion-rangeslider', DITTY_URL . 'includes/libs/ion.rangeSlider/css/ion.rangeSlider.min.css', false, '2.3.1', false );
442
  wp_register_style( 'jquery-minicolors', DITTY_URL . 'includes/libs/jquery-minicolors/jquery.minicolors.css', false, '2.3.5', false );
443
 
444
  $disable_fontawesome = ditty_settings( 'disable_fontawesome' );
445
+ if ( ! is_admin() && ! $disable_fontawesome ) {
446
+ wp_enqueue_style( 'ditty-fontawesome', 'https://use.fontawesome.com/releases/v5.15.3/css/all.css', false, '5.15.3', false );
447
  }
448
 
449
  if ( is_admin() ) {
452
  wp_enqueue_style( 'ion-rangeslider' );
453
  wp_enqueue_style( 'jquery-minicolors' );
454
  wp_enqueue_style( 'ditty-admin' );
455
+ wp_enqueue_style( 'ditty-fontawesome', 'https://use.fontawesome.com/releases/v5.15.3/css/all.css', false, '5.15.3', false );
 
 
456
  }
457
  }
458
 
includes/css/ditty.css CHANGED
@@ -190,6 +190,72 @@
190
  padding: 8px;
191
  border-bottom: none; }
192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  /* Checkboxes */
194
  .ditty-input--checkboxes__group {
195
  display: flex;
@@ -1283,6 +1349,33 @@
1283
  -webkit-transform: rotate(180deg);
1284
  transform: rotate(180deg); }
1285
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1286
  /**
1287
  * Ditty Editor Styles
1288
  */
@@ -1322,11 +1415,16 @@
1322
  #ditty-editor__settings .ditty-field-type--group {
1323
  padding: 0;
1324
  border-color: rgba(0, 0, 0, 0.05); }
 
 
 
 
 
 
 
1325
  #ditty-editor__settings .ditty-field-type--checkboxes .ditty-field {
1326
  padding: 0 10px 0 0;
1327
  border: none; }
1328
- #ditty-editor__settings .ditty-input--group__container > .ditty-field {
1329
- width: 100%; }
1330
  #ditty-editor .ditty-editor__panels {
1331
  background: #F7F7F7; }
1332
  #ditty-editor .ditty-editor__contents {
190
  padding: 8px;
191
  border-bottom: none; }
192
 
193
+ /* Layout element */
194
+ .ditty-field-type--layout_element {
195
+ padding: 0;
196
+ border-color: rgba(0, 0, 0, 0.05); }
197
+ .ditty-field-type--layout_element > .ditty-field__input__container {
198
+ overflow: hidden; }
199
+ .ditty-field-type--layout_element .ditty-input--layout_element__container {
200
+ display: flex;
201
+ flex-direction: row;
202
+ align-items: center;
203
+ justify-content: flex-start;
204
+ flex-wrap: wrap; }
205
+ .ditty-field-type--layout_element .ditty-input--layout_element__container > .ditty-field {
206
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
207
+ .ditty-field-type--layout_element > .ditty-field__heading {
208
+ display: flex;
209
+ flex-direction: column;
210
+ align-items: flex-start;
211
+ justify-content: flex-start;
212
+ color: #FFF;
213
+ background: #19BF7C;
214
+ padding: 15px;
215
+ padding-left: 65px;
216
+ margin: 0; }
217
+ .ditty-field-type--layout_element > .ditty-field__heading .fa-pencil-ruler {
218
+ position: absolute;
219
+ left: 15px; }
220
+ .ditty-field-type--layout_element > .ditty-field__heading label {
221
+ margin-bottom: 0; }
222
+ .ditty-field-type--layout_element > .ditty-field__heading .ditty-field__help,
223
+ .ditty-field-type--layout_element > .ditty-field__heading .ditty-field__desciption {
224
+ margin-bottom: 0 !important; }
225
+ .ditty-field-type--layout_element .ditty-field__collapsible-toggle {
226
+ position: absolute;
227
+ right: 10px;
228
+ top: 50%;
229
+ width: 20px;
230
+ height: 20px;
231
+ display: flex;
232
+ flex-direction: row;
233
+ align-items: center;
234
+ justify-content: center;
235
+ text-decoration: none;
236
+ margin-top: -10px;
237
+ color: #FFF;
238
+ background: rgba(255, 255, 255, 0.2);
239
+ border-radius: 50%;
240
+ transition: -webkit-transform .25s ease;
241
+ transition: transform .25s ease;
242
+ transition: transform .25s ease, -webkit-transform .25s ease; }
243
+ .ditty-field-type--layout_element[data-collapsible] > .ditty-field__heading {
244
+ padding-right: 40px; }
245
+ .ditty-field-type--layout_element[data-collapsible="expanded"] .ditty-field__collapsible-toggle {
246
+ -webkit-transform: rotate(180deg);
247
+ transform: rotate(180deg); }
248
+
249
+ .ditty-input--layout_element {
250
+ margin: 0; }
251
+ .ditty-input--layout_element__container > .ditty-field {
252
+ width: 100%; }
253
+
254
+ .ditty-field-type--layout_element-child {
255
+ margin: 0;
256
+ padding: 8px;
257
+ border-bottom: none; }
258
+
259
  /* Checkboxes */
260
  .ditty-input--checkboxes__group {
261
  display: flex;
1349
  -webkit-transform: rotate(180deg);
1350
  transform: rotate(180deg); }
1351
 
1352
+ .ditty-switch {
1353
+ position: absolute;
1354
+ left: 15px; }
1355
+ .ditty-switch__elements {
1356
+ position: relative;
1357
+ width: 40px;
1358
+ height: 16px;
1359
+ border: 1px solid #FFF;
1360
+ border-radius: 3px;
1361
+ cursor: pointer; }
1362
+ .ditty-switch__bg {
1363
+ position: absolute;
1364
+ top: 0;
1365
+ left: 0;
1366
+ width: 38px;
1367
+ height: 14px;
1368
+ border-radius: 1px;
1369
+ background: #FFF; }
1370
+ .ditty-switch__button {
1371
+ position: absolute;
1372
+ top: 0;
1373
+ left: 0;
1374
+ width: 18px;
1375
+ height: 14px;
1376
+ background: #19BF7C;
1377
+ border-radius: 3px; }
1378
+
1379
  /**
1380
  * Ditty Editor Styles
1381
  */
1415
  #ditty-editor__settings .ditty-field-type--group {
1416
  padding: 0;
1417
  border-color: rgba(0, 0, 0, 0.05); }
1418
+ #ditty-editor__settings .ditty-input--group__container > .ditty-field {
1419
+ width: 100%; }
1420
+ #ditty-editor__settings .ditty-field-type--layout_element {
1421
+ padding: 0;
1422
+ border-color: rgba(0, 0, 0, 0.05); }
1423
+ #ditty-editor__settings .ditty-input--layout_element__container > .ditty-field {
1424
+ width: 100%; }
1425
  #ditty-editor__settings .ditty-field-type--checkboxes .ditty-field {
1426
  padding: 0 10px 0 0;
1427
  border: none; }
 
 
1428
  #ditty-editor .ditty-editor__panels {
1429
  background: #F7F7F7; }
1430
  #ditty-editor .ditty-editor__contents {
includes/fields/ditty-field-layout_element.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Ditty Layout Element Field Class
5
+ *
6
+ * @package Ditty
7
+ * @subpackage Classes/Ditty Field Group
8
+ * @copyright Copyright (c) 2020, Metaphor Creations
9
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
+ * @since 3.0.23
11
+ */
12
+ class Ditty_Field_Layout_Element extends Ditty_Field {
13
+
14
+ public $type = 'layout_element';
15
+
16
+ /**
17
+ * Return the default atts
18
+ *
19
+ * @access private
20
+ * @since 3.0
21
+ */
22
+ public function defaults() {
23
+ $atts = array(
24
+ 'fields' => array(),
25
+ 'collapsible' => false,
26
+ 'default_state' => 'expanded',
27
+ );
28
+ return wp_parse_args( $atts, $this->common );
29
+ }
30
+
31
+ /**
32
+ * Return the html
33
+ *
34
+ * @since 3.0
35
+ * @return $html string
36
+ */
37
+ public function html() {
38
+ $atts = $this->html_atts();
39
+ if ( $this->args['collapsible'] ) {
40
+ $atts['data-collapsible'] = $this->args['default_state'];
41
+ }
42
+ $html = '';
43
+ $html .= '<div ' . ditty_attr_to_html( $atts ) . '>';
44
+ $html .= '<div class="ditty-field__heading">';
45
+ $html .= '<div class="ditty-switch">';
46
+ $html .= '<div class="ditty-switch__elements">';
47
+ $html .= '<div class="ditty-switch__bg"></div>';
48
+ $html .= '<div class="ditty-switch__button"></div>';
49
+ $html .= '</div>';
50
+ $html .= '</div>';
51
+ //$html .= '<i class="fas fa-pencil-ruler" data-class="fas fa-pencil-ruler"></i>';
52
+ $html .= $this->label();
53
+ if ( $this->args['collapsible'] ) {
54
+ $html .= '<a href="#" class="ditty-field__collapsible-toggle"><i class="fas fa-angle-down"></i></a>';
55
+ }
56
+ $html .= parent::help();
57
+ $html .= parent::description();
58
+ $html .= '</div>';
59
+ $html .= $this->input_container();
60
+ $html .= '</div>';
61
+ return $html;
62
+ }
63
+
64
+ /**
65
+ * Return the input
66
+ *
67
+ * @since 3.0
68
+ * @return $html string
69
+ */
70
+ public function input( $name, $std = false ) {
71
+ $inputs = array();
72
+
73
+ foreach ( $this->args['fields'] as $field_args ) {
74
+ $id = $field_args['id'];
75
+ $field_args['id'] = "{$name}[{$id}]";
76
+ $field_args['baseid'] = $id;
77
+ $field_args['class'] = 'ditty-field-type--layout_element-child';
78
+ $field_args['std'] = isset( $std[$id] ) ? $std[$id] : false;
79
+ $inputs[] = ditty_field( $field_args );
80
+ }
81
+
82
+ $html = '<div class="ditty-input--layout_element__container">' . implode( ' ', $inputs ) . '</div>';
83
+ return $html;
84
+ }
85
+ }
includes/fields/ditty-field.php CHANGED
@@ -143,7 +143,6 @@ class Ditty_Field {
143
  if ( '' != $this->args['name'] ) {
144
  $html .= ' ';
145
  }
146
- //$html .= '<i class="ditty-help-icon protip fas fa-question-circle" data-pt-title="' . sanitize_text_field( $this->args['help'] ) . '"></i>';
147
  $html .= '<a href="#" class="ditty-help-icon protip" data-pt-title="' . esc_html__( 'Toggle Description', 'metaphoravada' ) . '"><i class="fas fa-question-circle"></i></a>';
148
  }
149
  $html .= '</label>';
143
  if ( '' != $this->args['name'] ) {
144
  $html .= ' ';
145
  }
 
146
  $html .= '<a href="#" class="ditty-help-icon protip" data-pt-title="' . esc_html__( 'Toggle Description', 'metaphoravada' ) . '"><i class="fas fa-question-circle"></i></a>';
147
  }
148
  $html .= '</label>';
includes/fields/js/ditty-fields.js CHANGED
@@ -11,31 +11,27 @@
11
  // @codekit-append 'fields/slider.js
12
  // @codekit-append 'fields/wysiwyg.js
13
  // @codekit-append 'fields/group.js
 
14
 
15
-
16
- jQuery( function( $ ) {
17
-
18
  // Setup strict mode
19
  (function() {
 
20
 
21
- "use strict";
22
-
23
- $( 'body' ).on( 'click', '.ditty-help-icon', function( e ) {
24
  e.preventDefault();
25
 
26
- var $icon = $( this ),
27
- $label = $icon.parents( '.ditty-field__label' ),
28
- $help = $label.siblings( '.ditty-field__help' );
29
 
30
- if ( $icon.hasClass( 'active' ) ) {
31
- $icon.removeClass( 'active' );
32
  $help.hide();
33
  } else {
34
- $icon.addClass( 'active' );
35
  $help.show();
36
  }
37
- } );
38
-
39
- }() );
40
-
41
- } );
11
  // @codekit-append 'fields/slider.js
12
  // @codekit-append 'fields/wysiwyg.js
13
  // @codekit-append 'fields/group.js
14
+ // @codekit-append 'fields/layout_element.js
15
 
16
+ jQuery(function($) {
 
 
17
  // Setup strict mode
18
  (function() {
19
+ 'use strict';
20
 
21
+ $('body').on('click', '.ditty-help-icon', function(e) {
 
 
22
  e.preventDefault();
23
 
24
+ var $icon = $(this),
25
+ $label = $icon.parents('.ditty-field__label'),
26
+ $help = $label.siblings('.ditty-field__help');
27
 
28
+ if ($icon.hasClass('active')) {
29
+ $icon.removeClass('active');
30
  $help.hide();
31
  } else {
32
+ $icon.addClass('active');
33
  $help.show();
34
  }
35
+ });
36
+ })();
37
+ });
 
 
includes/fields/js/ditty-fields.min.js CHANGED
@@ -1 +1 @@
1
- jQuery((function($){!function(){"use strict";$("body").on("click",".ditty-help-icon",(function(t){t.preventDefault();var i=$(this),e=i.parents(".ditty-field__label").siblings(".ditty-field__help");i.hasClass("active")?(i.removeClass("active"),e.hide()):(i.addClass("active"),e.show())}))}()})),jQuery((function($){!function(){"use strict";function t(t){var i=t.children(".ditty-field__input__container"),e=t.data("clone_name"),n=t.data("clone_max"),d=[];i.children(".ditty-field__input").each((function(t){$(this).find(":input").each((function(){var i,n=$(this).parents(".ditty-field__input").data("baseid");i=n?e+"["+t+"]["+n+"]":e+"["+t+"]",$(this).attr("name",i),d.push({name:i,value:$(this).val()})}))})),t.data("input_count",i.children(".ditty-field__input").length),n>0&&i.children(".ditty-field__input").length>=n?t.addClass("ditty-field--clone-enabled--max"):t.removeClass("ditty-field--clone-enabled--max"),t.trigger("ditty_field_update"),t.trigger("ditty_field_clone_update",[d,e])}function i(i,n,d){d=d||i.data("clone_field");var a=$(d);n.after(a),t(i),e(i,a),i.trigger("ditty_init_fields")}function e(e,n){var d=n.find(".ditty-field__input__action--remove"),a=n.find(".ditty-field__input__action--add"),o=n.find(".ditty-field__input__action--clone");d.on("click",(function(d){d.preventDefault(),$(this).protipHide(),1===n.siblings().length&&i(e,n),n.remove(),t(e)})),a.on("click",(function(t){t.preventDefault(),i(e,n)})),o.on("click",(function(t){t.preventDefault(),i(e,n,n.clone())}))}$(document).on("ditty_init_fields",(function(n){$(n.target).find(".ditty-field--clone-enabled:not(.ditty-field--clone-enabled--init)").each((function(){!function(n){$.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}});var d=n.children(".ditty-field__input__container");n.addClass("ditty-field--clone-enabled--init"),n.data("input_count",d.children(".ditty-field__input").length),d.children(".ditty-field__input").each((function(){e(n,$(this))})),n.find(".ditty-field__actions__clone").on("click",(function(t){t.preventDefault();var e=d.children(".ditty-field__input").last();i(n,e)})),d.sortable({handle:".ditty-field__input__action--arrange",items:"> .ditty-field__input",axis:"y",start:function(t,i){$(i.item).addClass("ditty-field__input--moving")},stop:function(t,i){$(i.item).removeClass("ditty-field__input--moving")},update:function(){t(n)}})}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--code:not(.ditty-input--code--init)").each((function(){!function(t){t.addClass("ditty-input--code--init");var i=t.find("textarea"),e=wp.codeEditor.defaultSettings?_.clone(wp.codeEditor.defaultSettings):{};e.codemirror=_.extend({},e.codemirror,{mode:i.data("mode")?i.data("mode"):null,indentUnit:2,tabSize:2}),wp.codeEditor.initialize(i[0],e)}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--color:not(.ditty-input--color--init)").each((function(){var t;(t=$(this)).addClass("ditty-input--color--init"),t.find('input[type="text"]').minicolors({format:"rgb",opacity:!0})}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--date").each((function(){var t,i;t=$(this),i=t.find('input[type="text"]').data("dateformat"),t.find('input[type="text"]').datepicker({dateFormat:i})}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--file:not(.ditty-input--file--init)").each((function(){!function(t){t.addClass("ditty-input--file--init");var i,e=t.find('input[type="text"]');t.on("click",".ditty-input--file__upload",(function(n){return n.preventDefault(),void 0===i&&(i=wp.media({title:e.data("media_title"),button:{text:e.data("media_button"),size:"small"},multiple:e.data("multiple"),library:{type:e.data("file_types")}})),i.on("open",(function(){var t=i.state().get("selection"),n=wp.media.attachment(e.val());n&&t.add(n)})),i.on("select",(function(){var n=i.state().get("selection").toJSON(),d=[];n.length>0&&$(n).each((function(){d.push({id:$(this)[0].id,title:$(this)[0].title,caption:$(this)[0].caption,description:$(this)[0].description,link:$(this)[0].link,url:$(this)[0].url})})),e.val(d[0].url),t.trigger("ditty_field_file_select",[t,d]),t.trigger("ditty_field_update")})),i.open(),!1}))}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--image:not(.ditty-input--image--init)").each((function(){!function(t){t.addClass("ditty-input--image--init");var i,e=t.find('input[type="hidden"]'),n=t.find(".ditty-input--image__preview"),d=n.children("img");t.on("click",".ditty-input--image__upload",(function(a){return a.preventDefault(),void 0===i&&(i=wp.media({title:e.data("media_title"),button:{text:e.data("media_button"),size:"small"},multiple:e.data("multiple"),library:{type:"image"}})),i.on("open",(function(){var t=i.state().get("selection"),n=wp.media.attachment(e.val());n&&t.add(n)})),i.on("select",(function(){var a=i.state().get("selection").toJSON(),o=[];a.length>0&&$(a).each((function(){o.push({id:$(this)[0].id,title:$(this)[0].title,caption:$(this)[0].caption,description:$(this)[0].description,link:$(this)[0].link,url:$(this)[0].sizes.medium?$(this)[0].sizes.medium.url:$(this)[0].sizes.full.url})})),e.val(o[0].id),d.length&&d.remove(),d=$('<img src="'+o[0].url+'" alt="" />'),n.prepend(d),n.find("i").remove(),t.trigger("ditty_field_image_select",[t,o]),t.trigger("ditty_field_update")})),i.open(),!1}))}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--slider:not(.ditty-input--slider--init)").each((function(){var t;(t=$(this)).addClass("ditty-input--slider--init"),t.find('input[type="text"]').ionRangeSlider()}))}))}()})),jQuery((function($){!function(){"use strict";function t(t){if(t.addClass("ditty-input--wysiwyg--init"),t.hasClass("ditty-input--clone--clone")){var i=Math.floor(1e8*Math.random()+1);t.find("textarea").attr("id","ditty-input--"+i)}var e,n=t.find(".wp-editor-wrap"),d=t.find("textarea").attr("id");if(tinyMCEPreInit.mceInit[d])(e=tinymce.get(d)).on("keyup change",(function(){tinymce.triggerSave(),t.trigger("ditty_input_wysiwyg_update")}));else{var a=function(t){var i=function(){var t=wp.editor.getDefaultSettings();return t.tinymce.toolbar1="formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,fullscreen,wp_adv",t.tinymce.toolbar2="strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",t.quicktags.buttons="strong,em,link,block,del,ins,img,ul,ol,li,code,more,close",t}();t&&tinyMCEPreInit.mceInit.hasOwnProperty(t)&&(i.tinymce=tinyMCEPreInit.mceInit[t]);t&&window.quicktags&&tinyMCEPreInit.qtInit.hasOwnProperty(t)&&(i.quicktags=tinyMCEPreInit.qtInit[t]);return i}(function(t){var i=t.siblings(".ditty-input--wysiwyg.ditty-input--clone--orig").find("textarea").attr("id");/_\d+$/.test(i)&&(i=i.replace(/_\d+$/,""));if(tinyMCEPreInit.mceInit.hasOwnProperty(i)||tinyMCEPreInit.qtInit.hasOwnProperty(i))return i;return""}(t));!function(t,i){t.attr("id","wp-"+i+"-wrap").find(".mce-container").remove().end().find(".wp-editor-tools").attr("id","wp-"+i+"-editor-tools").find(".wp-media-buttons").attr("id","wp-"+i+"-media-buttons").find("button").data("editor",i).attr("data-editor",i),t.removeClass("html-active tmce-active"),t.addClass(window.tinymce?"tmce-active":"html-active"),t.find(".switch-tmce").attr("id",i+"tmce").data("wp-editor-id",i).attr("data-wp-editor-id",i).end().find(".switch-html").attr("id",i+"html").data("wp-editor-id",i).attr("data-wp-editor-id",i),t.find(".wp-editor-container").attr("id","wp-"+i+"-editor-container").find(".quicktags-toolbar").attr("id","qt_"+i+"_toolbar").html("")}(n,d),window.tinymce&&(tinymce.execCommand("mceRemoveEditor",!0,d),(e=new tinymce.Editor(d,a.tinymce,tinymce.EditorManager)).render(),e.on("keyup change",(function(){tinymce.triggerSave(),t.trigger("ditty_input_wysiwyg_update")}))),window.quicktags&&(a.quicktags.id=d,quicktags(a.quicktags),QTags._buttonsInit())}}$(document).on("ditty_pre_save_fields",(function(t){window.tinymce&&$(t.target).find(".ditty-input--wysiwyg--init .wp-editor-area").length&&tinymce.triggerSave()})),$(document).on("ditty_init_fields",(function(i){$(i.target).find(".ditty-input--wysiwyg:not(.ditty-input--wysiwyg--init)").each((function(){t($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-field-type--group[data-collapsible]:not(.ditty-field-type--group--init)").each((function(){!function(t){t.addClass("ditty-field-type--group--init");var i=t.children(".ditty-field__input__container").children(".ditty-input--group"),e=0;"collapsed"===t.attr("data-collapsible")&&i.hide(),t.on("click",".ditty-field__collapsible-toggle",(function(t){t.preventDefault(),"expanded"===$(this).parents(".ditty-field-type--group").attr("data-collapsible")?($(this).parents(".ditty-field-type--group").attr("data-collapsible","collapsed"),e=i.outerHeight(),i.stop().animate({marginTop:"-"+e+"px"},1e3,"easeInOutQuint",(function(){i.hide()}))):($(this).parents(".ditty-field-type--group").attr("data-collapsible","expanded"),e=i.outerHeight(),i.stop().css("marginTop","-"+e+"px"),i.show(),i.stop().animate({marginTop:0},1e3,"easeInOutQuint",(function(){})))}))}($(this))}))}))}()}));
1
+ jQuery((function($){!function(){"use strict";$("body").on("click",".ditty-help-icon",(function(t){t.preventDefault();var i=$(this),e=i.parents(".ditty-field__label").siblings(".ditty-field__help");i.hasClass("active")?(i.removeClass("active"),e.hide()):(i.addClass("active"),e.show())}))}()})),jQuery((function($){!function(){"use strict";function t(t){var i=t.children(".ditty-field__input__container"),e=t.data("clone_name"),n=t.data("clone_max"),d=[];i.children(".ditty-field__input").each((function(t){$(this).find(":input").each((function(){var i,n=$(this).parents(".ditty-field__input").data("baseid");i=n?e+"["+t+"]["+n+"]":e+"["+t+"]",$(this).attr("name",i),d.push({name:i,value:$(this).val()})}))})),t.data("input_count",i.children(".ditty-field__input").length),n>0&&i.children(".ditty-field__input").length>=n?t.addClass("ditty-field--clone-enabled--max"):t.removeClass("ditty-field--clone-enabled--max"),t.trigger("ditty_field_update"),t.trigger("ditty_field_clone_update",[d,e])}function i(i,n,d){d=d||i.data("clone_field");var a=$(d);n.after(a),t(i),e(i,a),i.trigger("ditty_init_fields")}function e(e,n){var d=n.find(".ditty-field__input__action--remove"),a=n.find(".ditty-field__input__action--add"),o=n.find(".ditty-field__input__action--clone");d.on("click",(function(d){d.preventDefault(),$(this).protipHide(),1===n.siblings().length&&i(e,n),n.remove(),t(e)})),a.on("click",(function(t){t.preventDefault(),i(e,n)})),o.on("click",(function(t){t.preventDefault(),i(e,n,n.clone())}))}$(document).on("ditty_init_fields",(function(n){$(n.target).find(".ditty-field--clone-enabled:not(.ditty-field--clone-enabled--init)").each((function(){!function(n){$.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}});var d=n.children(".ditty-field__input__container");n.addClass("ditty-field--clone-enabled--init"),n.data("input_count",d.children(".ditty-field__input").length),d.children(".ditty-field__input").each((function(){e(n,$(this))})),n.find(".ditty-field__actions__clone").on("click",(function(t){t.preventDefault();var e=d.children(".ditty-field__input").last();i(n,e)})),d.sortable({handle:".ditty-field__input__action--arrange",items:"> .ditty-field__input",axis:"y",start:function(t,i){$(i.item).addClass("ditty-field__input--moving")},stop:function(t,i){$(i.item).removeClass("ditty-field__input--moving")},update:function(){t(n)}})}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--code:not(.ditty-input--code--init)").each((function(){!function(t){t.addClass("ditty-input--code--init");var i=t.find("textarea"),e=wp.codeEditor.defaultSettings?_.clone(wp.codeEditor.defaultSettings):{};e.codemirror=_.extend({},e.codemirror,{mode:i.data("mode")?i.data("mode"):null,indentUnit:2,tabSize:2}),wp.codeEditor.initialize(i[0],e)}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--color:not(.ditty-input--color--init)").each((function(){var t;(t=$(this)).addClass("ditty-input--color--init"),t.find('input[type="text"]').minicolors({format:"rgb",opacity:!0})}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--date").each((function(){var t,i;t=$(this),i=t.find('input[type="text"]').data("dateformat"),t.find('input[type="text"]').datepicker({dateFormat:i})}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--file:not(.ditty-input--file--init)").each((function(){!function(t){t.addClass("ditty-input--file--init");var i,e=t.find('input[type="text"]');t.on("click",".ditty-input--file__upload",(function(n){return n.preventDefault(),void 0===i&&(i=wp.media({title:e.data("media_title"),button:{text:e.data("media_button"),size:"small"},multiple:e.data("multiple"),library:{type:e.data("file_types")}})),i.on("open",(function(){var t=i.state().get("selection"),n=wp.media.attachment(e.val());n&&t.add(n)})),i.on("select",(function(){var n=i.state().get("selection").toJSON(),d=[];n.length>0&&$(n).each((function(){d.push({id:$(this)[0].id,title:$(this)[0].title,caption:$(this)[0].caption,description:$(this)[0].description,link:$(this)[0].link,url:$(this)[0].url})})),e.val(d[0].url),t.trigger("ditty_field_file_select",[t,d]),t.trigger("ditty_field_update")})),i.open(),!1}))}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--image:not(.ditty-input--image--init)").each((function(){!function(t){t.addClass("ditty-input--image--init");var i,e=t.find('input[type="hidden"]'),n=t.find(".ditty-input--image__preview"),d=n.children("img");t.on("click",".ditty-input--image__upload",(function(a){return a.preventDefault(),void 0===i&&(i=wp.media({title:e.data("media_title"),button:{text:e.data("media_button"),size:"small"},multiple:e.data("multiple"),library:{type:"image"}})),i.on("open",(function(){var t=i.state().get("selection"),n=wp.media.attachment(e.val());n&&t.add(n)})),i.on("select",(function(){var a=i.state().get("selection").toJSON(),o=[];a.length>0&&$(a).each((function(){o.push({id:$(this)[0].id,title:$(this)[0].title,caption:$(this)[0].caption,description:$(this)[0].description,link:$(this)[0].link,url:$(this)[0].sizes.medium?$(this)[0].sizes.medium.url:$(this)[0].sizes.full.url})})),e.val(o[0].id),d.length&&d.remove(),d=$('<img src="'+o[0].url+'" alt="" />'),n.prepend(d),n.find("i").remove(),t.trigger("ditty_field_image_select",[t,o]),t.trigger("ditty_field_update")})),i.open(),!1}))}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-input--slider:not(.ditty-input--slider--init)").each((function(){var t;(t=$(this)).addClass("ditty-input--slider--init"),t.find('input[type="text"]').ionRangeSlider()}))}))}()})),jQuery((function($){!function(){"use strict";function t(t){if(t.addClass("ditty-input--wysiwyg--init"),t.hasClass("ditty-input--clone--clone")){var i=Math.floor(1e8*Math.random()+1);t.find("textarea").attr("id","ditty-input--"+i)}var e,n=t.find(".wp-editor-wrap"),d=t.find("textarea").attr("id");if(tinyMCEPreInit.mceInit[d])(e=tinymce.get(d)).on("keyup change",(function(){tinymce.triggerSave(),t.trigger("ditty_input_wysiwyg_update")}));else{var a=function(t){var i=function(){var t=wp.editor.getDefaultSettings();return t.tinymce.toolbar1="formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,fullscreen,wp_adv",t.tinymce.toolbar2="strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",t.quicktags.buttons="strong,em,link,block,del,ins,img,ul,ol,li,code,more,close",t}();t&&tinyMCEPreInit.mceInit.hasOwnProperty(t)&&(i.tinymce=tinyMCEPreInit.mceInit[t]);t&&window.quicktags&&tinyMCEPreInit.qtInit.hasOwnProperty(t)&&(i.quicktags=tinyMCEPreInit.qtInit[t]);return i}(function(t){var i=t.siblings(".ditty-input--wysiwyg.ditty-input--clone--orig").find("textarea").attr("id");/_\d+$/.test(i)&&(i=i.replace(/_\d+$/,""));if(tinyMCEPreInit.mceInit.hasOwnProperty(i)||tinyMCEPreInit.qtInit.hasOwnProperty(i))return i;return""}(t));!function(t,i){t.attr("id","wp-"+i+"-wrap").find(".mce-container").remove().end().find(".wp-editor-tools").attr("id","wp-"+i+"-editor-tools").find(".wp-media-buttons").attr("id","wp-"+i+"-media-buttons").find("button").data("editor",i).attr("data-editor",i),t.removeClass("html-active tmce-active"),t.addClass(window.tinymce?"tmce-active":"html-active"),t.find(".switch-tmce").attr("id",i+"tmce").data("wp-editor-id",i).attr("data-wp-editor-id",i).end().find(".switch-html").attr("id",i+"html").data("wp-editor-id",i).attr("data-wp-editor-id",i),t.find(".wp-editor-container").attr("id","wp-"+i+"-editor-container").find(".quicktags-toolbar").attr("id","qt_"+i+"_toolbar").html("")}(n,d),window.tinymce&&(tinymce.execCommand("mceRemoveEditor",!0,d),(e=new tinymce.Editor(d,a.tinymce,tinymce.EditorManager)).render(),e.on("keyup change",(function(){tinymce.triggerSave(),t.trigger("ditty_input_wysiwyg_update")}))),window.quicktags&&(a.quicktags.id=d,quicktags(a.quicktags),QTags._buttonsInit())}}$(document).on("ditty_pre_save_fields",(function(t){window.tinymce&&$(t.target).find(".ditty-input--wysiwyg--init .wp-editor-area").length&&tinymce.triggerSave()})),$(document).on("ditty_init_fields",(function(i){$(i.target).find(".ditty-input--wysiwyg:not(.ditty-input--wysiwyg--init)").each((function(){t($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-field-type--group[data-collapsible]:not(.ditty-field-type--group--init)").each((function(){!function(t){t.addClass("ditty-field-type--group--init");var i=t.children(".ditty-field__input__container").children(".ditty-input--group"),e=0;"collapsed"===t.attr("data-collapsible")&&i.hide(),t.on("click",".ditty-field__collapsible-toggle",(function(t){t.preventDefault(),"expanded"===$(this).parents(".ditty-field-type--group").attr("data-collapsible")?($(this).parents(".ditty-field-type--group").attr("data-collapsible","collapsed"),e=i.outerHeight(),i.stop().animate({marginTop:"-"+e+"px"},1e3,"easeInOutQuint",(function(){i.hide()}))):($(this).parents(".ditty-field-type--group").attr("data-collapsible","expanded"),e=i.outerHeight(),i.stop().css("marginTop","-"+e+"px"),i.show(),i.stop().animate({marginTop:0},1e3,"easeInOutQuint",(function(){})))}))}($(this))}))}))}()})),jQuery((function($){!function(){"use strict";$(document).on("ditty_init_fields",(function(t){$(t.target).find(".ditty-field-type--layout_element[data-collapsible]:not(.ditty-field-type--layout_element--init)").each((function(){!function(t){t.addClass("ditty-field-type--layout_element--init");var i=t.children(".ditty-field__input__container").children(".ditty-input--layout_element"),e=0;"collapsed"===t.attr("data-collapsible")&&i.hide(),t.on("click",".ditty-field__collapsible-toggle",(function(t){t.preventDefault(),"expanded"===$(this).parents(".ditty-field-type--layout_element").attr("data-collapsible")?($(this).parents(".ditty-field-type--layout_element").attr("data-collapsible","collapsed"),e=i.outerHeight(),i.stop().animate({marginTop:"-"+e+"px"},1e3,"easeInOutQuint",(function(){i.hide()}))):($(this).parents(".ditty-field-type--layout_element").attr("data-collapsible","expanded"),e=i.outerHeight(),i.stop().css("marginTop","-"+e+"px"),i.show(),i.stop().animate({marginTop:0},1e3,"easeInOutQuint",(function(){})))}))}($(this))}))}))}()}));
includes/fields/js/fields/file.js CHANGED
@@ -1,79 +1,78 @@
1
- jQuery( function( $ ) {
2
-
3
  // Setup strict mode
4
  (function() {
 
5
 
6
- "use strict";
 
7
 
8
- function setup( $field ) {
9
- $field.addClass( 'ditty-input--file--init' );
10
-
11
- var $input = $field.find( 'input[type="text"]' ),
12
- uploader;
13
-
14
- $field.on( 'click', '.ditty-input--file__upload', function( e ) {
15
  e.preventDefault();
16
- if ( undefined === uploader ) {
17
- uploader = wp.media( {
18
- title: $input.data( 'media_title' ),
19
- button: { text: $input.data( 'media_button' ), size: 'small' },
20
- multiple: $input.data( 'multiple' ),
21
- library : {
22
- type : $input.data( 'file_types' ),
23
- }
24
- } );
25
  }
26
 
27
- uploader.on( 'open', function() {
28
- var selection = uploader.state().get( 'selection' );
29
- var attachment = wp.media.attachment( $input.val() );
30
- if ( attachment ) {
31
- selection.add( attachment );
32
  }
33
  // let ids = [13, 14, 56];
34
  // ids.forEach(function(id) {
35
  // let attachment = wp.media.attachment(id);
36
  // selection.add(attachment ? [attachment] : []);
37
  // } );
38
- } );
39
-
40
- uploader.on( 'select', function() {
41
- var attachments = uploader.state().get( 'selection' ).toJSON(),
42
- file_data = [];
43
-
44
- if ( attachments.length > 0 ) {
45
- $(attachments).each( function() {
46
- file_data.push( {
47
- id : $(this)[0].id,
48
- title : $(this)[0].title,
49
- caption : $(this)[0].caption,
50
- description : $(this)[0].description,
51
- link : $(this)[0].link,
52
- url : $(this)[0].url
53
- } );
54
- } );
 
 
 
55
  }
56
 
57
- $input.val( file_data[0].url );
 
 
 
 
58
 
59
- $field.trigger( 'ditty_field_file_select', [$field, file_data] );
60
- $field.trigger( 'ditty_field_update' );
61
- } );
62
-
63
  uploader.open();
64
  return false;
65
-
66
- } );
67
-
68
  }
69
 
70
- function init( e ) {
71
- $( e.target ).find( '.ditty-input--file:not(.ditty-input--file--init)' ).each( function() {
72
- setup( $( this ) );
73
- } );
 
 
74
  }
75
- $( document ).on( 'ditty_init_fields', init );
76
-
77
- }() );
78
-
79
- } );
1
+ jQuery(function($) {
 
2
  // Setup strict mode
3
  (function() {
4
+ 'use strict';
5
 
6
+ function setup($field) {
7
+ $field.addClass('ditty-input--file--init');
8
 
9
+ var $input = $field.find('input[type="text"]'),
10
+ uploader;
11
+
12
+ $field.on('click', '.ditty-input--file__upload', function(e) {
 
 
 
13
  e.preventDefault();
14
+ if (undefined === uploader) {
15
+ uploader = wp.media({
16
+ title: $input.data('media_title'),
17
+ button: { text: $input.data('media_button'), size: 'small' },
18
+ multiple: $input.data('multiple'),
19
+ library: {
20
+ type: $input.data('file_types'),
21
+ },
22
+ });
23
  }
24
 
25
+ uploader.on('open', function() {
26
+ var selection = uploader.state().get('selection');
27
+ var attachment = wp.media.attachment($input.val());
28
+ if (attachment) {
29
+ selection.add(attachment);
30
  }
31
  // let ids = [13, 14, 56];
32
  // ids.forEach(function(id) {
33
  // let attachment = wp.media.attachment(id);
34
  // selection.add(attachment ? [attachment] : []);
35
  // } );
36
+ });
37
+
38
+ uploader.on('select', function() {
39
+ var attachments = uploader
40
+ .state()
41
+ .get('selection')
42
+ .toJSON(),
43
+ file_data = [];
44
+
45
+ if (attachments.length > 0) {
46
+ $(attachments).each(function() {
47
+ file_data.push({
48
+ id: $(this)[0].id,
49
+ title: $(this)[0].title,
50
+ caption: $(this)[0].caption,
51
+ description: $(this)[0].description,
52
+ link: $(this)[0].link,
53
+ url: $(this)[0].url,
54
+ });
55
+ });
56
  }
57
 
58
+ $input.val(file_data[0].url);
59
+
60
+ $field.trigger('ditty_field_file_select', [$field, file_data]);
61
+ $field.trigger('ditty_field_update');
62
+ });
63
 
 
 
 
 
64
  uploader.open();
65
  return false;
66
+ });
 
 
67
  }
68
 
69
+ function init(e) {
70
+ $(e.target)
71
+ .find('.ditty-input--file:not(.ditty-input--file--init)')
72
+ .each(function() {
73
+ setup($(this));
74
+ });
75
  }
76
+ $(document).on('ditty_init_fields', init);
77
+ })();
78
+ });
 
 
includes/fields/js/fields/layout_element.js ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function($) {
2
+ // Setup strict mode
3
+ (function() {
4
+ 'use strict';
5
+
6
+ function setup($field) {
7
+ $field.addClass('ditty-field-type--layout_element--init');
8
+
9
+ var $input = $field.children('.ditty-field__input__container').children('.ditty-input--layout_element'),
10
+ height = 0;
11
+
12
+ if ('collapsed' === $field.attr('data-collapsible')) {
13
+ $input.hide();
14
+ }
15
+
16
+ $field.on('click', '.ditty-field__collapsible-toggle', function(e) {
17
+ e.preventDefault();
18
+ if (
19
+ 'expanded' ===
20
+ $(this)
21
+ .parents('.ditty-field-type--layout_element')
22
+ .attr('data-collapsible')
23
+ ) {
24
+ $(this)
25
+ .parents('.ditty-field-type--layout_element')
26
+ .attr('data-collapsible', 'collapsed');
27
+ height = $input.outerHeight();
28
+ $input.stop().animate(
29
+ {
30
+ marginTop: '-' + height + 'px',
31
+ },
32
+ 1000,
33
+ 'easeInOutQuint',
34
+ function() {
35
+ $input.hide();
36
+ }
37
+ );
38
+ } else {
39
+ $(this)
40
+ .parents('.ditty-field-type--layout_element')
41
+ .attr('data-collapsible', 'expanded');
42
+ height = $input.outerHeight();
43
+ $input.stop().css('marginTop', '-' + height + 'px');
44
+ $input.show();
45
+ $input.stop().animate(
46
+ {
47
+ marginTop: 0,
48
+ },
49
+ 1000,
50
+ 'easeInOutQuint',
51
+ function() {}
52
+ );
53
+ }
54
+ });
55
+ }
56
+
57
+ function init(e) {
58
+ $(e.target)
59
+ .find('.ditty-field-type--layout_element[data-collapsible]:not(.ditty-field-type--layout_element--init)')
60
+ .each(function() {
61
+ setup($(this));
62
+ });
63
+ }
64
+ $(document).on('ditty_init_fields', init);
65
+ })();
66
+ });
includes/layout-tag-fields.php CHANGED
@@ -55,9 +55,10 @@ function ditty_item_type_layout_tag_fields( $fields, $item_type, $values ) {
55
  $attribute_fields[$att] = $field;
56
  }
57
 
58
- $tag_name = sprintf( esc_html__( '%s Settings', 'ditty-news-ticker' ), ucwords( implode( ' ', explode( '_', $tag ) ) ) );
 
59
  $fields["layout_tag_{$tag}"] = array(
60
- 'type' => 'group',
61
  'tab' => esc_html__( 'Layout Elements', 'ditty-news-ticker' ),
62
  'id' => "layout_tag_{$tag}",
63
  'collapsible' => true,
55
  $attribute_fields[$att] = $field;
56
  }
57
 
58
+ //$tag_name = sprintf( esc_html__( '%s Settings', 'ditty-news-ticker' ), ucwords( implode( ' ', explode( '_', $tag ) ) ) );
59
+ $tag_name = ucwords( implode( ' ', explode( '_', $tag ) ) );
60
  $fields["layout_tag_{$tag}"] = array(
61
+ 'type' => 'layout_element',
62
  'tab' => esc_html__( 'Layout Elements', 'ditty-news-ticker' ),
63
  'id' => "layout_tag_{$tag}",
64
  'collapsible' => true,
includes/sass/editor/_editor.scss CHANGED
@@ -56,19 +56,30 @@ $update_color: orange;
56
  padding: 0;
57
  border-color: rgba(0, 0, 0, 0.05);
58
  }
59
- .ditty-field-type--checkboxes {
60
- .ditty-field {
61
- padding: 0 10px 0 0;
62
- border: none;
 
63
  }
64
  }
65
- .ditty-input--group {
 
 
 
 
66
  &__container {
67
  > .ditty-field {
68
  width: 100%;
69
  }
70
  }
71
  }
 
 
 
 
 
 
72
  }
73
  .ditty-editor {
74
  &__panels {
56
  padding: 0;
57
  border-color: rgba(0, 0, 0, 0.05);
58
  }
59
+ .ditty-input--group {
60
+ &__container {
61
+ > .ditty-field {
62
+ width: 100%;
63
+ }
64
  }
65
  }
66
+ .ditty-field-type--layout_element {
67
+ padding: 0;
68
+ border-color: rgba(0, 0, 0, 0.05);
69
+ }
70
+ .ditty-input--layout_element {
71
  &__container {
72
  > .ditty-field {
73
  width: 100%;
74
  }
75
  }
76
  }
77
+ .ditty-field-type--checkboxes {
78
+ .ditty-field {
79
+ padding: 0 10px 0 0;
80
+ border: none;
81
+ }
82
+ }
83
  }
84
  .ditty-editor {
85
  &__panels {
includes/sass/partials/_ditty-ui.scss CHANGED
@@ -296,4 +296,35 @@
296
  }
297
  }
298
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  }
296
  }
297
  }
298
  }
299
+ }
300
+
301
+ .ditty-switch {
302
+ position: absolute;
303
+ left: 15px;
304
+ &__elements {
305
+ position: relative;
306
+ width: 40px;
307
+ height: 16px;
308
+ border: 1px solid #FFF;
309
+ border-radius: 3px;
310
+ cursor: pointer;
311
+ }
312
+ &__bg {
313
+ position: absolute;
314
+ top: 0;
315
+ left: 0;
316
+ width: 38px;
317
+ height: 14px;
318
+ border-radius: 1px;
319
+ background: #FFF;
320
+ }
321
+ &__button {
322
+ position: absolute;
323
+ top: 0;
324
+ left: 0;
325
+ width: 18px;
326
+ height: 14px;
327
+ background: #19BF7C;
328
+ border-radius: 3px;
329
+ }
330
  }
includes/sass/partials/_fields.scss CHANGED
@@ -258,6 +258,87 @@
258
  border-bottom: none;
259
  }
260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  /* Checkboxes */
262
  .ditty-input--checkboxes__group {
263
  display: flex;
258
  border-bottom: none;
259
  }
260
 
261
+ /* Layout element */
262
+ .ditty-field-type--layout_element {
263
+ padding: 0;
264
+ border-color: rgba(0, 0, 0, 0.05);
265
+ > .ditty-field__input__container {
266
+ overflow: hidden;
267
+ }
268
+ .ditty-input--layout_element__container {
269
+ display: flex;
270
+ flex-direction: row;
271
+ align-items: center;
272
+ justify-content: flex-start;
273
+ flex-wrap: wrap;
274
+ > .ditty-field {
275
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
276
+ }
277
+ }
278
+ > .ditty-field__heading {
279
+ display: flex;
280
+ flex-direction: column;
281
+ align-items: flex-start;
282
+ justify-content: flex-start;
283
+ color: #FFF;
284
+ background: $green;
285
+ padding: 15px;
286
+ padding-left: 65px;
287
+ margin: 0;
288
+ .fa-pencil-ruler {
289
+ position: absolute;
290
+ left: 15px;
291
+ }
292
+ label {
293
+ margin-bottom: 0;
294
+ }
295
+ .ditty-field__help,
296
+ .ditty-field__desciption {
297
+ margin-bottom: 0 !important;
298
+ }
299
+ }
300
+ .ditty-field__collapsible-toggle {
301
+ position: absolute;
302
+ right: 10px;
303
+ top: 50%;
304
+ width: 20px;
305
+ height: 20px;
306
+ display: flex;
307
+ flex-direction: row;
308
+ align-items: center;
309
+ justify-content: center;
310
+ text-decoration: none;
311
+ margin-top: -10px;
312
+ color: #FFF;
313
+ background: rgba(255, 255, 255, .2);
314
+ border-radius: 50%;
315
+ transition: transform .25s ease;
316
+ }
317
+ &[data-collapsible] {
318
+ > .ditty-field__heading {
319
+ padding-right: 40px;
320
+ }
321
+ }
322
+ &[data-collapsible="expanded"] {
323
+ .ditty-field__collapsible-toggle {
324
+ transform: rotate( 180deg );
325
+ }
326
+ }
327
+ }
328
+ .ditty-input--layout_element {
329
+ margin: 0;
330
+ &__container {
331
+ > .ditty-field {
332
+ width: 100%;
333
+ }
334
+ }
335
+ }
336
+ .ditty-field-type--layout_element-child {
337
+ margin: 0;
338
+ padding: 8px;
339
+ border-bottom: none;
340
+ }
341
+
342
  /* Checkboxes */
343
  .ditty-input--checkboxes__group {
344
  display: flex;
readme.txt CHANGED
@@ -1,29 +1,93 @@
1
- === Ditty (formerly Ditty News Ticker) ===
2
  Contributors: metaphorcreations
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FUZKZGAJSBAE6
4
- Tags: ticker, post ticker, news ticker, content aggregator, latest posts, live refresh, rotator, data rotator, lists, data, aggregator
5
  Requires at least: 4.5
6
  Tested up to: 5.9.3
7
- Stable tag: 3.0.22
8
  License: GPL2
9
 
10
- Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
11
 
12
  == Description ==
13
 
14
- Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin. Easily render custom data feeds to your site through a customizable news ticker, list, or slider.
15
 
16
- #### Item Types
17
- * Default - Add custom text to your Ditty.
18
- * WP Editor - Add custom text to your Ditty using the WP Editor.
19
- * WP Posts Feed - Add your latest blog posts to your Ditty.
20
 
21
- #### Display Types
22
- * Ticker - Create a unique news ticker using the Ticker Display type. Control the direction, spacing, speed, styling and many other options.
23
- * List - Create paged lists of your combined content. Multiple settings give you full control of the look and feel on your lists.
24
 
25
- #### Paid Extensions
26
- Additional plugins can be purchased to extend Ditty and it's functionality. Add more Item types, Display types, and utilities to enhance your Ditty. View all [**Extensions**](https://www.metaphorcreations.com/ditty/extensions/).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  == Installation ==
29
 
@@ -66,6 +130,9 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
66
 
67
  == Changelog ==
68
 
 
 
 
69
  = 3.0.22 =
70
  * Dashboard menu order updates
71
 
@@ -714,4 +781,4 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
714
 
715
  == Upgrade Notice ==
716
 
717
- Dashboard menu order updates
1
+ === Ditty - WordPress Content Display in a Ticker, Slider, List & More! ===
2
  Contributors: metaphorcreations
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FUZKZGAJSBAE6
4
+ Tags: ticker, post ticker, content slider, content list, responsive slider, content display
5
  Requires at least: 4.5
6
  Tested up to: 5.9.3
7
+ Stable tag: 3.0.23
8
  License: GPL2
9
 
10
+ Formerly Ditty News Ticker, Ditty is a multi-functional content display WordPress plugin.
11
 
12
  == Description ==
13
 
14
+ Formerly Ditty News Ticker, Ditty is a multi-functional content display WordPress plugin. Easily render your latest blog posts or custom content through multiple display options. Included display options are: News Ticker, Slider, and List. Add more content sources and display options through extensions. With extensions you can display RSS feeds, social media, image galleries, custom post types, and more to your site through the included displays or additional display extensions like grid and carousel.
15
 
16
+ ### Overview
 
 
 
17
 
18
+ Enhance your website with moving, scrolling, or sliding content. The Ditty plugin makes it easy to display your latest blog posts or custom text on your WordPress website. Display your content in a variety of customizable formats, including ticker, list, and slider. Customize your display with built-in options and use HTML or CSS to further customize the layouts of your content items. Choose from the variety of Ditty extensions to add even more or utilize Ditty Everything to access all features and display types. Ditty is compatible with all WordPress builders including the WordPress Block Editor (Gutenberg), Elementor, Divi, Beaver Builder, and more. Ditty is responsive and SEO friendly!
 
 
19
 
20
+ ### Included Display Types
21
+
22
+ * **Ticker** - Create a unique news ticker using the Ticker Display type. Control the direction, spacing, speed, styling, and many other options.
23
+ * **List** - Create paged lists of your combined content. Multiple settings give you full control of the look and feel on your lists.
24
+ * **Slider** - Display your content in a responsive slider. Get full control over your slider's speed, direction, and design.
25
+
26
+ ### Included Item Types
27
+
28
+ * **Default** - Add custom text to your Ditty.
29
+ * **WP Editor** - Add custom text to your Ditty using the WP Editor.
30
+ * **WP Posts Feed (Lite)** - Add your latest blog posts to your Ditty. Check out [**Ditty Posts**](https://www.metaphorcreations.com/downloads/ditty-posts/) for custom post types, advanced WordPress queries, custom fields, and more!
31
+
32
+ ### Add more features with Ditty Extensions!
33
+
34
+ * [**Ditty Facebook**](https://www.metaphorcreations.com/downloads/ditty-facebook/) - Easily add Facebook posts or images to your site using the Ditty Facebook extension. Add multiple Facebook feeds and Facebook albums.
35
+ * [**Ditty Grid**](https://www.metaphorcreations.com/downloads/ditty-grid/) - Display your Ditty items in a customizable and responsive grid
36
+ * [**Ditty Images**](https://www.metaphorcreations.com/downloads/ditty-images/) - Add internal and external images to your site through a Ditty.
37
+ * [**Ditty Instagram**](https://www.metaphorcreations.com/downloads/ditty-instagram/) - Ditty Instagram allows you to easily add your Instagram feed to your site.
38
+ * [**Ditty Posts**](https://www.metaphorcreations.com/downloads/ditty-posts/) - Easily add any posts to your site using the Ditty Posts extension. Build out a custom WP\_Query or select a specific post.
39
+ * [**Ditty RSS**](https://www.metaphorcreations.com/downloads/ditty-rss/) - Easily add multiple RSS feeds to your site.
40
+ * [**Ditty Timing**](https://www.metaphorcreations.com/downloads/ditty-timing/) - Use date ranges, weekly settings, and daily settings to schedule when your Ditty Items are visible or hidden.
41
+ * [**Ditty Twitter**](https://www.metaphorcreations.com/downloads/ditty-twitter/) - Easily add Twitter feeds and specific Tweets to your site.
42
+ * [**Ditty XML**](https://www.metaphorcreations.com/downloads/ditty-xml/) - Easily add multiple XML data feeds to your site.
43
+
44
+ ## Key Features
45
+
46
+ Web developers and theme builders will love how Ditty's flexible and professional-looking display options help to enhance the look and feel of your website. Because of the HTML and CSS styling capabilities, the Ditty plugin will fit seamlessly into any WordPress website. Key plugin features include:
47
+
48
+ ### Live Updates
49
+
50
+ Ditty will update in the background for users without the need to refresh the browser. Keep your content fresh and engaging.
51
+
52
+ ### Live Editing
53
+
54
+ See the changes you make while editing your Ditty as you make them. Add Items, edit Layouts and Displays, and see what it looks like before saving.
55
+
56
+ ### Global Rendering
57
+
58
+ Easily add your Ditty globally on your site, anywhere, without modifying theme files. Want a ticker scrolling at the top of your site, no problem!
59
+
60
+ ### Mix & Match Content
61
+
62
+ Combine multiple content feeds or custom content in a single Ditty. Merging custom default Items and feeds from various Ditty extensions together has never been easier.
63
+
64
+ ### Customized Displays
65
+
66
+ Render your Ditty as a custom ticker, list, slider, or other Display through extensions. Customize multiple settings to show your content the way you want.
67
+
68
+ ### Customized Layouts
69
+
70
+ Take control of the style of your content. Every Ditty Item type can be customized to reflect the style of your site. Use a pre-made template, or edit and customize it to your needs!
71
+
72
+ ## Easy to Use
73
+
74
+ The Ditty interface is intuitive and easy to navigate, making managing your content a quick and seamless experience. With a few clicks, you can add content, customize your settings, and see your changes in real-time. Whether you're new to WordPress or a seasoned pro, Ditty will help you to easily add content to your site.
75
+
76
+ ## SEO Friendly
77
+
78
+ Ditty is built with SEO best practices in mind. With CSS and HTML editing options, you can customize your Ditties to match the style of your website, without compromising on SEO. Not only will you be able to customize your content with SEO in mind, but the plugin files are clean and won't bog down your website with bloated code.
79
+
80
+ ## Extensions
81
+
82
+ Ditty comes with numerous extensions and growing! Easily add RSS feeds, social media content, images, blog posts, and more to your website through Ditty. With new extensions being added regularly, you'll be able to easily add the content that's important to you and your visitors.
83
+
84
+ ## Responsive & Mobile Friendly
85
+
86
+ Ditty is responsive and mobile-friendly. All the Ditty display types will adapt to any screen size, including mobile devices. Whether your visitors are viewing Ditty on a desktop computer or using their smartphone, you can be sure that your content will be easily viewed and interactive.
87
+
88
+ ## Technical Support
89
+
90
+ Whether you're having trouble with a basic plugin feature or customizing advanced display settings, our ongoing support team are here to answer your questions and help get your Ditty up and running on your website. The existing Ditty documentation is also available to help you get started, or if you need a little extra guidance. So what are you waiting for? Start adding Ditty to your WordPress site today and take control of your content!
91
 
92
  == Installation ==
93
 
130
 
131
  == Changelog ==
132
 
133
+ = 3.0.23 =
134
+ * Fontawesome slug update
135
+
136
  = 3.0.22 =
137
  * Dashboard menu order updates
138
 
781
 
782
  == Upgrade Notice ==
783
 
784
+ Fontawesome slug update