Ditty News Ticker - Version 3.0.15

Version Description

  • Ticker container border width render issue fix
  • Data sanitization updates
  • Added Display type fields filter
Download this release

Release Info

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

Code changes from version 3.0.14 to 3.0.15

ditty-news-ticker.php CHANGED
@@ -4,7 +4,7 @@
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.14
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.14' );
24
  }
25
 
26
  // Plugin Folder Path.
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.15
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.15' );
24
  }
25
 
26
  // Plugin Folder Path.
includes/admin/settings.php CHANGED
@@ -21,50 +21,50 @@ add_action( 'admin_menu', 'ditty_settings_pages', 5 );
21
  /**
22
  * Render the settings page
23
  *
24
- * @since 3.0.13
25
  */
26
  function ditty_settings_display() {
27
  ?>
28
  <div id="ditty-page" class="wrap">
29
 
30
  <div id="ditty-page__header">
31
- <h2><?php _e( 'Ditty Settings', 'ditty-news-ticker' ); ?></h2>
32
  </div>
33
 
34
  <div id="ditty-page__content">
35
  <div id="ditty-settings">
36
 
37
  <?php
38
- $init_panel = isset( $_GET['tab'] ) ? $_GET['tab'] : false;
39
  $settings = apply_filters( 'ditty_settings_tabs', array(
40
  'general' => array(
41
  'icon' => 'fas fa-cog',
42
- 'label' => __( 'General', 'ditty-news-ticker' ),
43
  'fields' => 'ditty_settings_general',
44
  ),
45
  'global_ditty' => array(
46
  'icon' => 'fas fa-globe-americas',
47
- 'label' => __( 'Global Ditty', 'ditty-news-ticker' ),
48
  'fields' => 'ditty_settings_global_ditty',
49
  ),
50
  'layout_defaults' => array(
51
  'icon' => 'fas fa-pencil-ruler',
52
- 'label' => __( 'Layout Defaults', 'ditty-news-ticker' ),
53
  'fields' => 'ditty_settings_variation_defaults',
54
  ),
55
  'layout_templates' => array(
56
  'icon' => 'fas fa-pencil-ruler',
57
- 'label' => __( 'Layout Templates', 'ditty-news-ticker' ),
58
  'fields' => 'ditty_settings_layout_templates',
59
  ),
60
  'display_templates' => array(
61
  'icon' => 'fas fa-tablet-alt',
62
- 'label' => __( 'Display Templates', 'ditty-news-ticker' ),
63
  'fields' => 'ditty_settings_display_templates',
64
  ),
65
  'advanced' => array(
66
  'icon' => 'fas fa-pencil-alt',
67
- 'label' => __( 'Advanced', 'ditty-news-ticker' ),
68
  'fields' => 'ditty_settings_advanced',
69
  ),
70
  // 'import_export' => array(
@@ -79,9 +79,9 @@ function ditty_settings_display() {
79
  <?php
80
  if ( is_array( $settings ) && count( $settings ) > 0 ) {
81
  foreach ( $settings as $slug => $setting ) {
82
- echo '<a href="#" class="ditty-settings__tab ditty-settings__tab--' . $slug . '" data-panel="' . $slug . '">';
83
- echo '<i class="' . $setting['icon'] . '"></i>';
84
- echo '<span>' . $setting['label'] . '</span>';
85
  echo '</a>';
86
  }
87
  }
@@ -90,19 +90,19 @@ function ditty_settings_display() {
90
 
91
  <form class="ditty-settings__form">
92
  <div class="ditty-settings__header">
93
- <a href="#" class="ditty-button ditty-button--primary ditty-settings__save"><?php echo ditty_admin_strings( 'settings_save' ); ?></a>
94
  </div>
95
  <div class="ditty-notification-bar">
96
- <div class="ditty-notification ditty-notification--updated"><?php echo ditty_admin_strings( 'settings_updated' ); ?></div>
97
- <div class="ditty-notification ditty-notification--warning"><?php echo ditty_admin_strings( 'settings_changed' ); ?></div>
98
- <div class="ditty-notification ditty-notification--error"><?php echo ditty_admin_strings( 'settings_error' ); ?></div>
99
  </div>
100
- <div class="ditty-settings__panels" data-init_panel="<?php echo $init_panel; ?>">
101
  <?php
102
  if ( is_array( $settings ) && count( $settings ) > 0 ) {
103
  foreach ( $settings as $slug => $setting ) {
104
  ?>
105
- <div class="ditty-settings__panel ditty-settings__panel--<?php echo $slug; ?>" data-slide_id="<?php echo $slug; ?>" data-slide_cache="true">
106
  <?php
107
  if ( isset( $setting['fields'] ) && function_exists( $setting['fields'] ) ) {
108
  call_user_func( $setting['fields'] );
@@ -115,7 +115,7 @@ function ditty_settings_display() {
115
  ?>
116
  </div>
117
  <div class="ditty-settings__footer">
118
- <a href="#" class="ditty-button ditty-button--primary ditty-settings__save"><?php echo ditty_admin_strings( 'settings_save' ); ?></a>
119
  </div>
120
  <div class="ditty-updating-overlay"></div>
121
  </form>
@@ -128,21 +128,21 @@ function ditty_settings_display() {
128
  /**
129
  * Setup the general settings fields
130
  *
131
- * @since 3.0
132
  */
133
  function ditty_settings_general() {
134
  $fields = array(
135
  'heading' => array(
136
  'type' => 'heading',
137
  'id' => 'heading',
138
- 'name' => __( 'General Settings', 'ditty-news-ticker' ),
139
  ),
140
  'live_refresh' => array(
141
  'type' => 'number',
142
  'id' => 'live_refresh',
143
- 'name' => __( 'Live Refresh Rate', 'ditty-news-ticker' ),
144
- 'after' => __( 'Minute(s)', 'ditty-news-ticker' ),
145
- 'desc' => __( 'Set the live update refresh interval for your Ditty.', 'ditty-news-ticker' ),
146
  'std' => ditty_settings( 'live_refresh' ),
147
  ),
148
  // 'notification_email' => array(
@@ -159,24 +159,24 @@ function ditty_settings_general() {
159
  'ditty_layout_ui' => array(
160
  'type' => 'radio',
161
  'id' => 'ditty_layout_ui',
162
- 'name' => __( 'Layout Posts', 'ditty-news-ticker' ),
163
- 'desc' => __( 'Edit Layouts directly as post types.', 'ditty-news-ticker' ),
164
  'inline' => true,
165
  'options' => array(
166
- 'disabled' => __( 'Disabled', 'ditty-news-ticker' ),
167
- 'enabled' => __( 'Enabled', 'ditty-news-ticker' ),
168
  ),
169
  'std' => ditty_settings( 'ditty_layout_ui' ),
170
  ),
171
  'ditty_display_ui' => array(
172
  'type' => 'radio',
173
  'id' => 'ditty_display_ui',
174
- 'name' => __( 'Ditty Display Posts', 'ditty-news-ticker' ),
175
- 'desc' => __( 'Edit Ditty Displays directly as post types.', 'ditty-news-ticker' ),
176
  'inline' => true,
177
  'options' => array(
178
- 'disabled' => __( 'Disabled', 'ditty-news-ticker' ),
179
- 'enabled' => __( 'Enabled', 'ditty-news-ticker' ),
180
  ),
181
  'std' => ditty_settings( 'ditty_display_ui' ),
182
  ),
@@ -187,19 +187,19 @@ function ditty_settings_general() {
187
  /**
188
  * Setup the layouts fields
189
  *
190
- * @since 3.0
191
  */
192
  function ditty_settings_variation_defaults() {
193
  $fields = array(
194
  'heading' => array(
195
  'type' => 'heading',
196
  'id' => 'heading',
197
- 'name' => __( 'Variation Defaults', 'ditty-news-ticker' ),
198
  ),
199
  'layout_variation_defaults' => array(
200
  'type' => 'html',
201
  'id' => 'layout_variation_defaults',
202
- 'name' => __( 'Layout Variation Defaults', 'ditty-news-ticker' ),
203
  'std' => Ditty()->layouts->variation_defaults(),
204
  ),
205
  );
@@ -209,19 +209,19 @@ function ditty_settings_variation_defaults() {
209
  /**
210
  * Setup the layout templates fields
211
  *
212
- * @since 3.0
213
  */
214
  function ditty_settings_layout_templates() {
215
  $fields = array(
216
  'heading' => array(
217
  'type' => 'heading',
218
  'id' => 'heading',
219
- 'name' => __( 'Layout Templates', 'ditty-news-ticker' ),
220
  ),
221
  'layout_templates' => array(
222
  'type' => 'html',
223
  'id' => 'layout_templates',
224
- 'name' => __( 'Layout Templates', 'ditty-news-ticker' ),
225
  'std' => Ditty()->layouts->layout_templates_list(),
226
  ),
227
  );
@@ -231,19 +231,19 @@ function ditty_settings_layout_templates() {
231
  /**
232
  * Setup the display templates fields
233
  *
234
- * @since 3.0
235
  */
236
  function ditty_settings_display_templates() {
237
  $fields = array(
238
  'heading' => array(
239
  'type' => 'heading',
240
  'id' => 'heading',
241
- 'name' => __( 'Display Defaults', 'ditty-news-ticker' ),
242
  ),
243
  'display_templates' => array(
244
  'type' => 'html',
245
  'id' => 'display_templates',
246
- 'name' => __( 'Default Displays', 'ditty-news-ticker' ),
247
  'std' => Ditty()->displays->display_templates_list(),
248
  ),
249
  );
@@ -253,23 +253,23 @@ function ditty_settings_display_templates() {
253
  /**
254
  * Setup the editor settings fields
255
  *
256
- * @since 3.0
257
  */
258
  function ditty_settings_advanced() {
259
  $fields = array(
260
  'heading' => array(
261
  'type' => 'heading',
262
  'id' => 'heading',
263
- 'name' => __( 'Advanced Settings', 'ditty-news-ticker' ),
264
  ),
265
  'ditty_wizard' => array(
266
  'type' => 'radio',
267
  'id' => 'ditty_wizard',
268
- 'name' => __( 'Ditty Wizard (Beta)', 'ditty-news-ticker' ),
269
- 'desc' => __( "The Ditty Wizard helps you set up your new Dittys with a step by step guide.", 'ditty-news-ticker' ),
270
  'options' => array(
271
- 'enabled' => __( 'Enabled', 'ditty-news-ticker' ),
272
- 'disabled' => __( 'Disabled', 'ditty-news-ticker' ),
273
  ),
274
  'inline' => true,
275
  'std' => ditty_settings( 'ditty_wizard' ),
@@ -277,17 +277,17 @@ function ditty_settings_advanced() {
277
  'disable_fontawesome' => array(
278
  'type' => 'checkbox',
279
  'id' => 'disable_fontawesome',
280
- 'name' => __( 'Font Awesome', 'ditty-news-ticker' ),
281
- 'label' => __( 'Disable Font Awesome from loading on the front-end', 'ditty-news-ticker' ),
282
- 'desc' => __( 'This will disable the rendering of certain icons used in default Layouts and Layout tags.', 'ditty-news-ticker' ),
283
  'std' => ditty_settings( 'disable_fontawesome' ),
284
  ),
285
  'ditty_news_ticker' => array(
286
  'type' => 'checkbox',
287
  'id' => 'ditty_news_ticker',
288
- 'name' => __( 'Ditty News Ticker', 'ditty-news-ticker' ),
289
- 'label' => __( 'Enable Ditty News Ticker (Legacy code)', 'ditty-news-ticker' ),
290
- 'desc' => __( 'This will enable loading of all legacy scripts and post types. Only enable this option if you have active Ditty News Ticker posts displaying on your site. You must refresh your browser after saving before changes take place.', 'ditty-news-ticker' ),
291
  'std' => ditty_settings( 'ditty_news_ticker' ),
292
  ),
293
  // 'ditty_layouts_sass' => array(
@@ -305,70 +305,70 @@ function ditty_settings_advanced() {
305
  /**
306
  * Setup the global Ditty fields
307
  *
308
- * @since 3.0
309
  */
310
  function ditty_settings_global_ditty() {
311
  $fields = array(
312
  'heading' => array(
313
  'type' => 'heading',
314
  'id' => 'heading',
315
- 'name' => __( 'Global Ditty', 'ditty-news-ticker' ),
316
- 'desc' => __( 'Add Ditty dynamically anywhere on your site. You just need to specify an html selector and the position for the Ditty in relation to the selector. Then choose a Ditty and optionally set other customization options.', 'ditty-news-ticker' ),
317
  ),
318
  'global_ditty' => array(
319
  'type' => 'group',
320
  'id' => 'global_ditty',
321
  'clone' => true,
322
- 'clone_button' => __( 'Add More Global Tickers', 'ditty-news-ticker' ),
323
  'multiple_fields' => false,
324
  'fields' => array(
325
  'selector' => array(
326
  'type' => 'text',
327
  'id' => 'selector',
328
- 'name' => __( 'HTML Selector', 'ditty-news-ticker' ),
329
- 'help' => __( 'Add a jQuery HTML element selector to add a Ditty to.', 'ditty-news-ticker' ),
330
- 'placeholder' => __( 'Example: #site-header', 'ditty-news-ticker' ),
331
  ),
332
  array(
333
  'type' => 'select',
334
  'id' => 'position',
335
- 'name' => __( 'Position', 'ditty-news-ticker' ),
336
- 'help' => __( 'Select the position of the Ditty in relation to the HTML selector.', 'ditty-news-ticker' ),
337
- 'placeholder' => __( 'Select Position', 'ditty-news-ticker' ),
338
  'options' => array(
339
- 'prepend' => __( 'Start of Element', 'ditty-news-ticker' ),
340
- 'append' => __( 'End of Element', 'ditty-news-ticker' ),
341
- 'before' => __( 'Before Element', 'ditty-news-ticker' ),
342
- 'after' => __( 'After Element', 'ditty-news-ticker' ),
343
  ),
344
  ),
345
  array(
346
  'type' => 'select',
347
  'id' => 'ditty',
348
- 'name' => __( 'Ditty', 'ditty-news-ticker' ),
349
- 'help' => __( 'Select a Ditty you want to display globally.', 'ditty-news-ticker' ),
350
- 'placeholder' => __( 'Select a Ditty', 'ditty-news-ticker' ),
351
  'options' => Ditty()->singles->select_field_options(),
352
  ),
353
  array(
354
  'type' => 'select',
355
  'id' => 'display',
356
- 'name' => __( 'Display', 'ditty-news-ticker' ),
357
- 'help' => __( 'Optional: Select a custom display to use with the Ditty.', 'ditty-news-ticker' ),
358
- 'placeholder' => __( 'Use Default Display', 'ditty-news-ticker' ),
359
  'options' => Ditty()->displays->select_field_options(),
360
  ),
361
  array(
362
  'type' => 'text',
363
  'id' => 'custom_id',
364
- 'name' => __( 'Custom ID', 'ditty-news-ticker' ),
365
- 'help' => __( 'Optional: Add a custom ID to the Ditty', 'ditty-news-ticker' ),
366
  ),
367
  array(
368
  'type' => 'text',
369
  'id' => 'custom_classes',
370
- 'name' => __( 'Custom Classes', 'ditty-news-ticker' ),
371
- 'help' => __( 'Optional: Add custom classes to the Ditty', 'ditty-news-ticker' ),
372
  ),
373
  ),
374
  'std' => ditty_settings( 'global_ditty' ),
@@ -380,65 +380,65 @@ function ditty_settings_global_ditty() {
380
  /**
381
  * Setup the import and export fields
382
  *
383
- * @since 3.0.13
384
  */
385
  function ditty_settings_import_export() {
386
  $fields = array(
387
  'ditty_heading' => array(
388
  'type' => 'heading',
389
  'id' => 'heading',
390
- 'name' => __( 'Ditty Import / Export', 'ditty-news-ticker' ),
391
  ),
392
  'ditty_import' => array(
393
  'type' => 'html',
394
  'id' => 'ditty_import',
395
- 'name' => __( 'Ditty Import', 'ditty-news-ticker' ),
396
- 'help' => __( 'Import Ditty posts', 'ditty-news-ticker' ),
397
  'std' => 'Import button should go here',
398
  ),
399
  'ditty_export' => array(
400
  'type' => 'html',
401
  'id' => 'ditty_export',
402
- 'name' => __( 'Ditty Export', 'ditty-news-ticker' ),
403
- 'desc' => __( 'Export Ditty posts', 'ditty-news-ticker' ),
404
  'std' => ditty_export_ditty(),
405
  ),
406
  'layout_heading' => array(
407
  'type' => 'heading',
408
  'id' => 'heading',
409
- 'name' => __( 'Layout Import / Export', 'ditty-news-ticker' ),
410
  ),
411
  'layout_import' => array(
412
  'type' => 'html',
413
  'id' => 'layout_import',
414
- 'name' => __( 'Layout Import', 'ditty-news-ticker' ),
415
- 'help' => __( 'Import Layout posts', 'ditty-news-ticker' ),
416
  'std' => 'Import button should go here',
417
  ),
418
  'layout_export' => array(
419
  'type' => 'html',
420
  'id' => 'layout_export',
421
- 'name' => __( 'Layout Export', 'ditty-news-ticker' ),
422
- 'help' => __( 'Export Layout posts', 'ditty-news-ticker' ),
423
  'std' => 'Export button should go here',
424
  ),
425
  'display_heading' => array(
426
  'type' => 'heading',
427
  'id' => 'heading',
428
- 'name' => __( 'Display Import / Export', 'ditty-news-ticker' ),
429
  ),
430
  'display_import' => array(
431
  'type' => 'html',
432
  'id' => 'display_import',
433
- 'name' => __( 'Display Import', 'ditty-news-ticker' ),
434
- 'help' => __( 'Import Display posts', 'ditty-news-ticker' ),
435
  'std' => 'Import button should go here',
436
  ),
437
  'display_export' => array(
438
  'type' => 'html',
439
  'id' => 'display_export',
440
- 'name' => __( 'Display Export', 'ditty-news-ticker' ),
441
- 'help' => __( 'Export Display posts', 'ditty-news-ticker' ),
442
  'std' => 'Export button should go here',
443
  ),
444
  );
@@ -451,8 +451,8 @@ function ditty_export_ditty() {
451
  'type' => 'checkboxes',
452
  'id' => 'ditty_export_options',
453
  'options' => array(
454
- 'layouts' => __( 'Export Attached Layouts', 'ditty-news-ticker' ),
455
- 'displays' => __( 'Export Attached Displays', 'ditty-news-ticker' ),
456
  ),
457
  'inline' => true,
458
  'field_only' => true,
@@ -464,7 +464,7 @@ function ditty_export_ditty() {
464
  'ditty_export_button' => array(
465
  'type' => 'button',
466
  'id' => 'ditty_export_button',
467
- 'label' => __( 'Export All Ditty posts', 'ditty-news-ticker' ) . ' <i class="fas fa-sync-alt fa-spin"></i>',
468
  'field_only' => true,
469
  'icon_after' => 'fas fa-sync-alt fa-spin',
470
  'atts' => array(
@@ -494,7 +494,7 @@ add_action( 'wp_ajax_ditty_settings_save', 'ditty_settings_save_ajax' );
494
  /**
495
  * Save settings
496
  *
497
- * @since 3.0
498
  */
499
  function ditty_settings_save( $data, $json_data ) {
500
 
@@ -513,9 +513,9 @@ function ditty_settings_save( $data, $json_data ) {
513
  }
514
  $sanitized_data = array(
515
  'selector' => isset( $global_ditty['selector'] ) ? wp_kses_post( $global_ditty['selector'] ) : false,
516
- 'position' => isset( $global_ditty['position'] ) ? esc_attr( $global_ditty['position'] ) : false,
517
  'ditty' => isset( $global_ditty['ditty'] ) ? intval( $global_ditty['ditty'] ) : false,
518
- 'display' => isset( $global_ditty['display'] ) ? esc_attr( $global_ditty['display'] ) : false,
519
  'custom_id' => isset( $global_ditty['custom_id'] ) ? sanitize_title( $global_ditty['custom_id'] ) : false,
520
  'custom_classes' => isset( $global_ditty['custom_classes'] ) ? implode( ' ', $sanitized_classes ) : false,
521
  );
@@ -546,14 +546,14 @@ function ditty_settings_save( $data, $json_data ) {
546
 
547
  $settings = array(
548
  'live_refresh' => isset( $data['live_refresh'] ) ? intval( $data['live_refresh'] ) : 10,
549
- 'ditty_display_ui' => isset( $data['ditty_display_ui'] ) ? esc_attr( $data['ditty_display_ui'] ) : 'disabled',
550
- 'ditty_layout_ui' => isset( $data['ditty_layout_ui'] ) ? esc_attr( $data['ditty_layout_ui'] ) : 'disabled',
551
- 'ditty_layouts_sass' => isset( $data['ditty_layouts_sass'] ) ? esc_attr( $data['ditty_layouts_sass'] ) : false,
552
  'variation_defaults' => $sanitized_variation_defaults,
553
  'global_ditty' => $sanitized_global_ditty,
554
- 'ditty_news_ticker' => isset( $data['ditty_news_ticker'] ) ? esc_attr( $data['ditty_news_ticker'] ) : false,
555
- 'ditty_wizard' => isset( $data['ditty_wizard'] ) ? esc_attr( $data['ditty_wizard'] ) : false,
556
- 'disable_fontawesome' => isset( $data['disable_fontawesome'] ) ? esc_attr( $data['disable_fontawesome'] ) : false,
557
  'notification_email' => ( isset( $data['notification_email'] ) && is_email( $data['notification_email'] ) ) ? $data['notification_email'] : false,
558
  );
559
  ditty_settings( $settings );
21
  /**
22
  * Render the settings page
23
  *
24
+ * @since 3.0.14
25
  */
26
  function ditty_settings_display() {
27
  ?>
28
  <div id="ditty-page" class="wrap">
29
 
30
  <div id="ditty-page__header">
31
+ <h2><?php esc_html_e( 'Ditty Settings', 'ditty-news-ticker' ); ?></h2>
32
  </div>
33
 
34
  <div id="ditty-page__content">
35
  <div id="ditty-settings">
36
 
37
  <?php
38
+ $init_panel = isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : false;
39
  $settings = apply_filters( 'ditty_settings_tabs', array(
40
  'general' => array(
41
  'icon' => 'fas fa-cog',
42
+ 'label' => esc_html__( 'General', 'ditty-news-ticker' ),
43
  'fields' => 'ditty_settings_general',
44
  ),
45
  'global_ditty' => array(
46
  'icon' => 'fas fa-globe-americas',
47
+ 'label' => esc_html__( 'Global Ditty', 'ditty-news-ticker' ),
48
  'fields' => 'ditty_settings_global_ditty',
49
  ),
50
  'layout_defaults' => array(
51
  'icon' => 'fas fa-pencil-ruler',
52
+ 'label' => esc_html__( 'Layout Defaults', 'ditty-news-ticker' ),
53
  'fields' => 'ditty_settings_variation_defaults',
54
  ),
55
  'layout_templates' => array(
56
  'icon' => 'fas fa-pencil-ruler',
57
+ 'label' => esc_html__( 'Layout Templates', 'ditty-news-ticker' ),
58
  'fields' => 'ditty_settings_layout_templates',
59
  ),
60
  'display_templates' => array(
61
  'icon' => 'fas fa-tablet-alt',
62
+ 'label' => esc_html__( 'Display Templates', 'ditty-news-ticker' ),
63
  'fields' => 'ditty_settings_display_templates',
64
  ),
65
  'advanced' => array(
66
  'icon' => 'fas fa-pencil-alt',
67
+ 'label' => esc_html__( 'Advanced', 'ditty-news-ticker' ),
68
  'fields' => 'ditty_settings_advanced',
69
  ),
70
  // 'import_export' => array(
79
  <?php
80
  if ( is_array( $settings ) && count( $settings ) > 0 ) {
81
  foreach ( $settings as $slug => $setting ) {
82
+ echo '<a href="#" class="ditty-settings__tab ditty-settings__tab--' . esc_attr( $slug ) . '" data-panel="' . esc_attr( $slug ) . '">';
83
+ echo '<i class="' . esc_attr( $setting['icon'] ) . '"></i>';
84
+ echo '<span>' . esc_html( $setting['label'] ) . '</span>';
85
  echo '</a>';
86
  }
87
  }
90
 
91
  <form class="ditty-settings__form">
92
  <div class="ditty-settings__header">
93
+ <a href="#" class="ditty-button ditty-button--primary ditty-settings__save"><?php echo esc_html( ditty_admin_strings( 'settings_save' ) ); ?></a>
94
  </div>
95
  <div class="ditty-notification-bar">
96
+ <div class="ditty-notification ditty-notification--updated"><?php echo esc_html( ditty_admin_strings( 'settings_updated' ) ); ?></div>
97
+ <div class="ditty-notification ditty-notification--warning"><?php echo esc_html( ditty_admin_strings( 'settings_changed' ) ); ?></div>
98
+ <div class="ditty-notification ditty-notification--error"><?php echo esc_html( ditty_admin_strings( 'settings_error' ) ); ?></div>
99
  </div>
100
+ <div class="ditty-settings__panels" data-init_panel="<?php echo esc_attr( $init_panel ); ?>">
101
  <?php
102
  if ( is_array( $settings ) && count( $settings ) > 0 ) {
103
  foreach ( $settings as $slug => $setting ) {
104
  ?>
105
+ <div class="ditty-settings__panel ditty-settings__panel--<?php echo esc_attr( $slug ); ?>" data-slide_id="<?php echo esc_attr( $slug ); ?>" data-slide_cache="true">
106
  <?php
107
  if ( isset( $setting['fields'] ) && function_exists( $setting['fields'] ) ) {
108
  call_user_func( $setting['fields'] );
115
  ?>
116
  </div>
117
  <div class="ditty-settings__footer">
118
+ <a href="#" class="ditty-button ditty-button--primary ditty-settings__save"><?php echo esc_html( ditty_admin_strings( 'settings_save' ) ); ?></a>
119
  </div>
120
  <div class="ditty-updating-overlay"></div>
121
  </form>
128
  /**
129
  * Setup the general settings fields
130
  *
131
+ * @since 3.0.14
132
  */
133
  function ditty_settings_general() {
134
  $fields = array(
135
  'heading' => array(
136
  'type' => 'heading',
137
  'id' => 'heading',
138
+ 'name' => esc_html__( 'General Settings', 'ditty-news-ticker' ),
139
  ),
140
  'live_refresh' => array(
141
  'type' => 'number',
142
  'id' => 'live_refresh',
143
+ 'name' => esc_html__( 'Live Refresh Rate', 'ditty-news-ticker' ),
144
+ 'after' => esc_html__( 'Minute(s)', 'ditty-news-ticker' ),
145
+ 'desc' => esc_html__( 'Set the live update refresh interval for your Ditty.', 'ditty-news-ticker' ),
146
  'std' => ditty_settings( 'live_refresh' ),
147
  ),
148
  // 'notification_email' => array(
159
  'ditty_layout_ui' => array(
160
  'type' => 'radio',
161
  'id' => 'ditty_layout_ui',
162
+ 'name' => esc_html__( 'Layout Posts', 'ditty-news-ticker' ),
163
+ 'desc' => esc_html__( 'Edit Layouts directly as post types.', 'ditty-news-ticker' ),
164
  'inline' => true,
165
  'options' => array(
166
+ 'disabled' => esc_html__( 'Disabled', 'ditty-news-ticker' ),
167
+ 'enabled' => esc_html__( 'Enabled', 'ditty-news-ticker' ),
168
  ),
169
  'std' => ditty_settings( 'ditty_layout_ui' ),
170
  ),
171
  'ditty_display_ui' => array(
172
  'type' => 'radio',
173
  'id' => 'ditty_display_ui',
174
+ 'name' => esc_html__( 'Ditty Display Posts', 'ditty-news-ticker' ),
175
+ 'desc' => esc_html__( 'Edit Ditty Displays directly as post types.', 'ditty-news-ticker' ),
176
  'inline' => true,
177
  'options' => array(
178
+ 'disabled' => esc_html__( 'Disabled', 'ditty-news-ticker' ),
179
+ 'enabled' => esc_html__( 'Enabled', 'ditty-news-ticker' ),
180
  ),
181
  'std' => ditty_settings( 'ditty_display_ui' ),
182
  ),
187
  /**
188
  * Setup the layouts fields
189
  *
190
+ * @since 3.0.14
191
  */
192
  function ditty_settings_variation_defaults() {
193
  $fields = array(
194
  'heading' => array(
195
  'type' => 'heading',
196
  'id' => 'heading',
197
+ 'name' => esc_html__( 'Variation Defaults', 'ditty-news-ticker' ),
198
  ),
199
  'layout_variation_defaults' => array(
200
  'type' => 'html',
201
  'id' => 'layout_variation_defaults',
202
+ 'name' => esc_html__( 'Layout Variation Defaults', 'ditty-news-ticker' ),
203
  'std' => Ditty()->layouts->variation_defaults(),
204
  ),
205
  );
209
  /**
210
  * Setup the layout templates fields
211
  *
212
+ * @since 3.0 .14
213
  */
214
  function ditty_settings_layout_templates() {
215
  $fields = array(
216
  'heading' => array(
217
  'type' => 'heading',
218
  'id' => 'heading',
219
+ 'name' => esc_html__( 'Layout Templates', 'ditty-news-ticker' ),
220
  ),
221
  'layout_templates' => array(
222
  'type' => 'html',
223
  'id' => 'layout_templates',
224
+ 'name' => esc_html__( 'Layout Templates', 'ditty-news-ticker' ),
225
  'std' => Ditty()->layouts->layout_templates_list(),
226
  ),
227
  );
231
  /**
232
  * Setup the display templates fields
233
  *
234
+ * @since 3.0.14
235
  */
236
  function ditty_settings_display_templates() {
237
  $fields = array(
238
  'heading' => array(
239
  'type' => 'heading',
240
  'id' => 'heading',
241
+ 'name' => esc_html__( 'Display Defaults', 'ditty-news-ticker' ),
242
  ),
243
  'display_templates' => array(
244
  'type' => 'html',
245
  'id' => 'display_templates',
246
+ 'name' => esc_html__( 'Default Displays', 'ditty-news-ticker' ),
247
  'std' => Ditty()->displays->display_templates_list(),
248
  ),
249
  );
253
  /**
254
  * Setup the editor settings fields
255
  *
256
+ * @since 3.0.14
257
  */
258
  function ditty_settings_advanced() {
259
  $fields = array(
260
  'heading' => array(
261
  'type' => 'heading',
262
  'id' => 'heading',
263
+ 'name' => esc_html__( 'Advanced Settings', 'ditty-news-ticker' ),
264
  ),
265
  'ditty_wizard' => array(
266
  'type' => 'radio',
267
  'id' => 'ditty_wizard',
268
+ 'name' => esc_html__( 'Ditty Wizard (Beta)', 'ditty-news-ticker' ),
269
+ 'desc' => esc_html__( "The Ditty Wizard helps you set up your new Dittys with a step by step guide.", 'ditty-news-ticker' ),
270
  'options' => array(
271
+ 'enabled' => esc_html__( 'Enabled', 'ditty-news-ticker' ),
272
+ 'disabled' => esc_html__( 'Disabled', 'ditty-news-ticker' ),
273
  ),
274
  'inline' => true,
275
  'std' => ditty_settings( 'ditty_wizard' ),
277
  'disable_fontawesome' => array(
278
  'type' => 'checkbox',
279
  'id' => 'disable_fontawesome',
280
+ 'name' => esc_html__( 'Font Awesome', 'ditty-news-ticker' ),
281
+ 'label' => esc_html__( 'Disable Font Awesome from loading on the front-end', 'ditty-news-ticker' ),
282
+ 'desc' => esc_html__( 'This will disable the rendering of certain icons used in default Layouts and Layout tags.', 'ditty-news-ticker' ),
283
  'std' => ditty_settings( 'disable_fontawesome' ),
284
  ),
285
  'ditty_news_ticker' => array(
286
  'type' => 'checkbox',
287
  'id' => 'ditty_news_ticker',
288
+ 'name' => esc_html__( 'Ditty News Ticker', 'ditty-news-ticker' ),
289
+ 'label' => esc_html__( 'Enable Ditty News Ticker (Legacy code)', 'ditty-news-ticker' ),
290
+ 'desc' => esc_html__( 'This will enable loading of all legacy scripts and post types. Only enable this option if you have active Ditty News Ticker posts displaying on your site. You must refresh your browser after saving before changes take place.', 'ditty-news-ticker' ),
291
  'std' => ditty_settings( 'ditty_news_ticker' ),
292
  ),
293
  // 'ditty_layouts_sass' => array(
305
  /**
306
  * Setup the global Ditty fields
307
  *
308
+ * @since 3.0.14
309
  */
310
  function ditty_settings_global_ditty() {
311
  $fields = array(
312
  'heading' => array(
313
  'type' => 'heading',
314
  'id' => 'heading',
315
+ 'name' => esc_html__( 'Global Ditty', 'ditty-news-ticker' ),
316
+ 'desc' => esc_html__( 'Add Ditty dynamically anywhere on your site. You just need to specify an html selector and the position for the Ditty in relation to the selector. Then choose a Ditty and optionally set other customization options.', 'ditty-news-ticker' ),
317
  ),
318
  'global_ditty' => array(
319
  'type' => 'group',
320
  'id' => 'global_ditty',
321
  'clone' => true,
322
+ 'clone_button' => esc_html__( 'Add More Global Tickers', 'ditty-news-ticker' ),
323
  'multiple_fields' => false,
324
  'fields' => array(
325
  'selector' => array(
326
  'type' => 'text',
327
  'id' => 'selector',
328
+ 'name' => esc_html__( 'HTML Selector', 'ditty-news-ticker' ),
329
+ 'help' => esc_html__( 'Add a jQuery HTML element selector to add a Ditty to.', 'ditty-news-ticker' ),
330
+ 'placeholder' => esc_html__( 'Example: #site-header', 'ditty-news-ticker' ),
331
  ),
332
  array(
333
  'type' => 'select',
334
  'id' => 'position',
335
+ 'name' => esc_html__( 'Position', 'ditty-news-ticker' ),
336
+ 'help' => esc_html__( 'Select the position of the Ditty in relation to the HTML selector.', 'ditty-news-ticker' ),
337
+ 'placeholder' => esc_html__( 'Select Position', 'ditty-news-ticker' ),
338
  'options' => array(
339
+ 'prepend' => esc_html__( 'Start of Element', 'ditty-news-ticker' ),
340
+ 'append' => esc_html__( 'End of Element', 'ditty-news-ticker' ),
341
+ 'before' => esc_html__( 'Before Element', 'ditty-news-ticker' ),
342
+ 'after' => esc_html__( 'After Element', 'ditty-news-ticker' ),
343
  ),
344
  ),
345
  array(
346
  'type' => 'select',
347
  'id' => 'ditty',
348
+ 'name' => esc_html__( 'Ditty', 'ditty-news-ticker' ),
349
+ 'help' => esc_html__( 'Select a Ditty you want to display globally.', 'ditty-news-ticker' ),
350
+ 'placeholder' => esc_html__( 'Select a Ditty', 'ditty-news-ticker' ),
351
  'options' => Ditty()->singles->select_field_options(),
352
  ),
353
  array(
354
  'type' => 'select',
355
  'id' => 'display',
356
+ 'name' => esc_html__( 'Display', 'ditty-news-ticker' ),
357
+ 'help' => esc_html__( 'Optional: Select a custom display to use with the Ditty.', 'ditty-news-ticker' ),
358
+ 'placeholder' => esc_html__( 'Use Default Display', 'ditty-news-ticker' ),
359
  'options' => Ditty()->displays->select_field_options(),
360
  ),
361
  array(
362
  'type' => 'text',
363
  'id' => 'custom_id',
364
+ 'name' => esc_html__( 'Custom ID', 'ditty-news-ticker' ),
365
+ 'help' => esc_html__( 'Optional: Add a custom ID to the Ditty', 'ditty-news-ticker' ),
366
  ),
367
  array(
368
  'type' => 'text',
369
  'id' => 'custom_classes',
370
+ 'name' => esc_html__( 'Custom Classes', 'ditty-news-ticker' ),
371
+ 'help' => esc_html__( 'Optional: Add custom classes to the Ditty', 'ditty-news-ticker' ),
372
  ),
373
  ),
374
  'std' => ditty_settings( 'global_ditty' ),
380
  /**
381
  * Setup the import and export fields
382
  *
383
+ * @since 3.0.14
384
  */
385
  function ditty_settings_import_export() {
386
  $fields = array(
387
  'ditty_heading' => array(
388
  'type' => 'heading',
389
  'id' => 'heading',
390
+ 'name' => esc_html__( 'Ditty Import / Export', 'ditty-news-ticker' ),
391
  ),
392
  'ditty_import' => array(
393
  'type' => 'html',
394
  'id' => 'ditty_import',
395
+ 'name' => esc_html__( 'Ditty Import', 'ditty-news-ticker' ),
396
+ 'help' => esc_html__( 'Import Ditty posts', 'ditty-news-ticker' ),
397
  'std' => 'Import button should go here',
398
  ),
399
  'ditty_export' => array(
400
  'type' => 'html',
401
  'id' => 'ditty_export',
402
+ 'name' => esc_html__( 'Ditty Export', 'ditty-news-ticker' ),
403
+ 'desc' => esc_html__( 'Export Ditty posts', 'ditty-news-ticker' ),
404
  'std' => ditty_export_ditty(),
405
  ),
406
  'layout_heading' => array(
407
  'type' => 'heading',
408
  'id' => 'heading',
409
+ 'name' => esc_html__( 'Layout Import / Export', 'ditty-news-ticker' ),
410
  ),
411
  'layout_import' => array(
412
  'type' => 'html',
413
  'id' => 'layout_import',
414
+ 'name' => esc_html__( 'Layout Import', 'ditty-news-ticker' ),
415
+ 'help' => esc_html__( 'Import Layout posts', 'ditty-news-ticker' ),
416
  'std' => 'Import button should go here',
417
  ),
418
  'layout_export' => array(
419
  'type' => 'html',
420
  'id' => 'layout_export',
421
+ 'name' => esc_html__( 'Layout Export', 'ditty-news-ticker' ),
422
+ 'help' => esc_html__( 'Export Layout posts', 'ditty-news-ticker' ),
423
  'std' => 'Export button should go here',
424
  ),
425
  'display_heading' => array(
426
  'type' => 'heading',
427
  'id' => 'heading',
428
+ 'name' => esc_html__( 'Display Import / Export', 'ditty-news-ticker' ),
429
  ),
430
  'display_import' => array(
431
  'type' => 'html',
432
  'id' => 'display_import',
433
+ 'name' => esc_html__( 'Display Import', 'ditty-news-ticker' ),
434
+ 'help' => esc_html__( 'Import Display posts', 'ditty-news-ticker' ),
435
  'std' => 'Import button should go here',
436
  ),
437
  'display_export' => array(
438
  'type' => 'html',
439
  'id' => 'display_export',
440
+ 'name' => esc_html__( 'Display Export', 'ditty-news-ticker' ),
441
+ 'help' => esc_html__( 'Export Display posts', 'ditty-news-ticker' ),
442
  'std' => 'Export button should go here',
443
  ),
444
  );
451
  'type' => 'checkboxes',
452
  'id' => 'ditty_export_options',
453
  'options' => array(
454
+ 'layouts' => esc_html__( 'Export Attached Layouts', 'ditty-news-ticker' ),
455
+ 'displays' => esc_html__( 'Export Attached Displays', 'ditty-news-ticker' ),
456
  ),
457
  'inline' => true,
458
  'field_only' => true,
464
  'ditty_export_button' => array(
465
  'type' => 'button',
466
  'id' => 'ditty_export_button',
467
+ 'label' => esc_html__( 'Export All Ditty posts', 'ditty-news-ticker' ) . ' <i class="fas fa-sync-alt fa-spin"></i>',
468
  'field_only' => true,
469
  'icon_after' => 'fas fa-sync-alt fa-spin',
470
  'atts' => array(
494
  /**
495
  * Save settings
496
  *
497
+ * @since 3.0.14
498
  */
499
  function ditty_settings_save( $data, $json_data ) {
500
 
513
  }
514
  $sanitized_data = array(
515
  'selector' => isset( $global_ditty['selector'] ) ? wp_kses_post( $global_ditty['selector'] ) : false,
516
+ 'position' => isset( $global_ditty['position'] ) ? sanitize_key( $global_ditty['position'] ) : false,
517
  'ditty' => isset( $global_ditty['ditty'] ) ? intval( $global_ditty['ditty'] ) : false,
518
+ 'display' => isset( $global_ditty['display'] ) ? intval( $global_ditty['display'] ) : false,
519
  'custom_id' => isset( $global_ditty['custom_id'] ) ? sanitize_title( $global_ditty['custom_id'] ) : false,
520
  'custom_classes' => isset( $global_ditty['custom_classes'] ) ? implode( ' ', $sanitized_classes ) : false,
521
  );
546
 
547
  $settings = array(
548
  'live_refresh' => isset( $data['live_refresh'] ) ? intval( $data['live_refresh'] ) : 10,
549
+ 'ditty_display_ui' => isset( $data['ditty_display_ui'] ) ? sanitize_key( $data['ditty_display_ui'] ) : 'disabled',
550
+ 'ditty_layout_ui' => isset( $data['ditty_layout_ui'] ) ? sanitize_key( $data['ditty_layout_ui'] ) : 'disabled',
551
+ 'ditty_layouts_sass' => isset( $data['ditty_layouts_sass'] ) ? sanitize_key( $data['ditty_layouts_sass'] ) : false,
552
  'variation_defaults' => $sanitized_variation_defaults,
553
  'global_ditty' => $sanitized_global_ditty,
554
+ 'ditty_news_ticker' => isset( $data['ditty_news_ticker'] ) ? sanitize_key( $data['ditty_news_ticker'] ) : false,
555
+ 'ditty_wizard' => isset( $data['ditty_wizard'] ) ? sanitize_key( $data['ditty_wizard'] ) : false,
556
+ 'disable_fontawesome' => isset( $data['disable_fontawesome'] ) ? sanitize_key( $data['disable_fontawesome'] ) : false,
557
  'notification_email' => ( isset( $data['notification_email'] ) && is_email( $data['notification_email'] ) ) ? $data['notification_email'] : false,
558
  );
559
  ditty_settings( $settings );
includes/class-ditty-display-type-list.php CHANGED
@@ -22,7 +22,7 @@ class Ditty_Display_Type_List extends Ditty_Display_Type {
22
  * Setup the display settings
23
  *
24
  * @access public
25
- * @since 3.0
26
  */
27
  public function fields( $values = array() ) {
28
  $fields = array(
@@ -247,7 +247,7 @@ class Ditty_Display_Type_List extends Ditty_Display_Type {
247
  ),
248
  );
249
  }
250
- return $fields;
251
  }
252
 
253
 
22
  * Setup the display settings
23
  *
24
  * @access public
25
+ * @since 3.0.14
26
  */
27
  public function fields( $values = array() ) {
28
  $fields = array(
247
  ),
248
  );
249
  }
250
+ return apply_filters( 'ditty_display_type_fields', $fields, $this->get_type() );
251
  }
252
 
253
 
includes/class-ditty-display-type-ticker.php CHANGED
@@ -22,7 +22,7 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
22
  * Setup the fields
23
  *
24
  * @access public
25
- * @since 3.0
26
  */
27
  public function fields( $values = array() ) {
28
  $fields = array(
@@ -145,7 +145,7 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
145
  'no' => __( 'No', 'ditty-news-ticker' ),
146
  ),
147
  'inline' => true,
148
- 'std' => isset( $values['hoverPause'] ) ? $values['hoverPause'] : false,
149
  ),
150
  'hoverPause' => array(
151
  'type' => 'checkbox',
@@ -208,7 +208,7 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
208
  ),
209
  );
210
  }
211
- return $fields;
212
  }
213
 
214
  /**
@@ -218,7 +218,7 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
218
  */
219
  public function default_settings() {
220
 
221
- $defaults = json_decode( '{"direction":"left","minHeight":"300px","maxHeight":"","spacing":"25","speed":"10","heightEase":"easeInOutQuint","heightSpeed":"1.5","scrollInit":"empty","scrollDelay":"3","hoverPause":"1","maxWidth":"","bgColor":"","padding":{"paddingTop":"","paddingBottom":"","paddingLeft":"","paddingRight":""},"margin":{"marginTop":"","marginBottom":"","marginLeft":"","marginRight":""},"borderColor":"","borderStyle":"none","borderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"borderRadius":{"borderTopLeftRadius":"","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"titleDisplay":"none","titleElement":"h3","titleElementPosition":"start","titleFontSize":"","titleLineHeight":"","titleColor":"rgba(255, 255, 255, 1)","titleBgColor":"rgba(0, 0, 0, 1)","titleMargin":{"marginTop":"","marginBottom":"","marginLeft":"","marginRight":""},"titlePadding":{"paddingTop":"10px","paddingBottom":"10px","paddingLeft":"15px","paddingRight":"15px"},"titleBorderColor":"","titleBorderStyle":"none","titleBorderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"titleBorderRadius":{"borderTopLeftRadius":"","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"contentsBgColor":"rgba(255, 255, 255, 0.5)","contentsPadding":{"paddingTop":"10px","paddingBottom":"10px","paddingLeft":"10px","paddingRight":"10px"},"contentsBorderColor":"","contentsBorderStyle":"none","contentsBorderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"contentsBorderRadius":{"borderTopLeftRadius":"0","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"itemTextColor":"","itemBgColor":"","itemPadding":{"paddingTop":"","paddingBottom":"","paddingLeft":"","paddingRight":""},"itemBorderColor":"","itemBorderStyle":"none","itemBorderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"itemBorderRadius":{"borderTopLeftRadius":"","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"itemMaxWidth":"300px","itemElementsWrap":"wrap"}', true );
222
 
223
  return apply_filters( 'ditty_display_default_settings', $defaults, $this->type );
224
  }
22
  * Setup the fields
23
  *
24
  * @access public
25
+ * @since 3.0.14
26
  */
27
  public function fields( $values = array() ) {
28
  $fields = array(
145
  'no' => __( 'No', 'ditty-news-ticker' ),
146
  ),
147
  'inline' => true,
148
+ 'std' => isset( $values['cloneItems'] ) ? $values['cloneItems'] : false,
149
  ),
150
  'hoverPause' => array(
151
  'type' => 'checkbox',
208
  ),
209
  );
210
  }
211
+ return apply_filters( 'ditty_display_type_fields', $fields, $this->get_type() );
212
  }
213
 
214
  /**
218
  */
219
  public function default_settings() {
220
 
221
+ $defaults = json_decode( '{"direction":"left","minHeight":"300px","maxHeight":"","spacing":"25","speed":"10","heightEase":"easeInOutQuint","heightSpeed":"1.5","scrollInit":"empty","scrollDelay":"3","cloneItems":"yes","hoverPause":"1","maxWidth":"","bgColor":"","padding":{"paddingTop":"","paddingBottom":"","paddingLeft":"","paddingRight":""},"margin":{"marginTop":"","marginBottom":"","marginLeft":"","marginRight":""},"borderColor":"","borderStyle":"none","borderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"borderRadius":{"borderTopLeftRadius":"","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"titleDisplay":"none","titleElement":"h3","titleElementPosition":"start","titleFontSize":"","titleLineHeight":"","titleColor":"rgba(255, 255, 255, 1)","titleBgColor":"rgba(0, 0, 0, 1)","titleMargin":{"marginTop":"","marginBottom":"","marginLeft":"","marginRight":""},"titlePadding":{"paddingTop":"10px","paddingBottom":"10px","paddingLeft":"15px","paddingRight":"15px"},"titleBorderColor":"","titleBorderStyle":"none","titleBorderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"titleBorderRadius":{"borderTopLeftRadius":"","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"contentsBgColor":"rgba(255, 255, 255, 0.5)","contentsPadding":{"paddingTop":"10px","paddingBottom":"10px","paddingLeft":"10px","paddingRight":"10px"},"contentsBorderColor":"","contentsBorderStyle":"none","contentsBorderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"contentsBorderRadius":{"borderTopLeftRadius":"0","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"itemTextColor":"","itemBgColor":"","itemPadding":{"paddingTop":"","paddingBottom":"","paddingLeft":"","paddingRight":""},"itemBorderColor":"","itemBorderStyle":"none","itemBorderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"itemBorderRadius":{"borderTopLeftRadius":"","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"itemMaxWidth":"300px","itemElementsWrap":"wrap"}', true );
222
 
223
  return apply_filters( 'ditty_display_default_settings', $defaults, $this->type );
224
  }
includes/class-ditty-display-type.php CHANGED
@@ -123,12 +123,17 @@ class Ditty_Display_Type {
123
  /**
124
  * Setup the display settings
125
  * @access public
126
- * @since 3.0
127
  */
128
  public function settings( $display_values = false, $action = 'render' ) {
129
  $values = $this->get_values( $display_values );
130
  $fields = $this->fields( $values );
131
- ditty_fields( $fields, $values, $action );
 
 
 
 
 
132
  }
133
 
134
  /**
123
  /**
124
  * Setup the display settings
125
  * @access public
126
+ * @since 3.0.14
127
  */
128
  public function settings( $display_values = false, $action = 'render' ) {
129
  $values = $this->get_values( $display_values );
130
  $fields = $this->fields( $values );
131
+
132
+ if ( 'return' == $action ) {
133
+ return ditty_fields( $fields, $values, $action );
134
+ } else {
135
+ ditty_fields( $fields, $values, $action );
136
+ }
137
  }
138
 
139
  /**
includes/class-ditty-display.php CHANGED
@@ -33,8 +33,8 @@ class Ditty_Display {
33
 
34
  // Else, this is an existing display
35
  } elseif ( get_post( $display_id ) ) {
36
- $this->construct_from_id( $display_id );
37
- $this->parse_draft_data( $display_id );
38
  }
39
  $this->construct_display_object_data();
40
  return $this;
@@ -237,12 +237,12 @@ class Ditty_Display {
237
  /**
238
  * Return the display metabox
239
  * @access public
240
- * @since 3.0
241
  * @return int $id
242
  */
243
- public function object_settings() {
244
  $display_object = $this->get_display_object();
245
- return $display_object->settings( $this->get_values() );
246
  }
247
 
248
  /**
33
 
34
  // Else, this is an existing display
35
  } elseif ( get_post( $display_id ) ) {
36
+ $this->construct_from_id( $display_id );
37
+ $this->parse_draft_data( $display_id );
38
  }
39
  $this->construct_display_object_data();
40
  return $this;
237
  /**
238
  * Return the display metabox
239
  * @access public
240
+ * @since 3.0.14
241
  * @return int $id
242
  */
243
+ public function object_settings( $action = 'render' ) {
244
  $display_object = $this->get_display_object();
245
+ return $display_object->settings( $this->get_values(), $action );
246
  }
247
 
248
  /**
includes/class-ditty.php CHANGED
@@ -430,30 +430,27 @@ class Ditty {
430
  */
431
  public function enqueue_styles() {
432
  wp_enqueue_style( 'ditty', DITTY_URL . 'includes/css/ditty.css', array(), $this->version, 'all' );
 
 
 
 
 
 
 
433
 
434
  $disable_fontawesome = ditty_settings( 'disable_fontawesome' );
435
  if ( ! $disable_fontawesome ) {
436
- wp_enqueue_style( 'fontawesome', 'https://use.fontawesome.com/releases/v5.15.3/css/all.css', false, '5.15.3', false );
437
  }
 
438
  if ( is_admin() ) {
439
  wp_enqueue_style( 'wp-codemirror' );
440
- wp_enqueue_style( 'protip', DITTY_URL . 'includes/libs/protip/protip.min.css', false, '1.4.21', false );
441
- wp_enqueue_style( 'ion-rangeslider', DITTY_URL . 'includes/libs/ion.rangeSlider/css/ion.rangeSlider.min.css', false, '2.3.1', false );
442
- wp_enqueue_style( 'jquery-minicolors', DITTY_URL . 'includes/libs/jquery-minicolors/jquery.minicolors.css', false, '2.3.5', false );
443
- wp_enqueue_style( 'ditty-admin', DITTY_URL . 'includes/css/ditty-admin.css', array(), $this->version, 'all' );
444
  if ( $disable_fontawesome ) {
445
- wp_enqueue_style( 'fontawesome', 'https://use.fontawesome.com/releases/v5.15.3/css/all.css', false, '5.15.3', false );
446
- }
447
- } else {
448
-
449
- // Add scripts for the global Dittys
450
- $global_ditty = ditty_settings( 'global_ditty' );
451
- if ( is_array( $global_ditty ) && count( $global_ditty ) > 0 ) {
452
- foreach ( $global_ditty as $i => $global_ditty ) {
453
- if ( 'publish' === get_post_status( $global_ditty['ditty'] ) ) {
454
- ditty_add_scripts( $global_ditty['ditty'], $global_ditty['display'] );
455
- }
456
- }
457
  }
458
  }
459
  }
@@ -461,13 +458,26 @@ class Ditty {
461
  /**
462
  * Register the JavaScript for the public-facing side of the site.
463
  *
464
- * @since 3.0.12
465
  */
466
  public function enqueue_scripts( $hook ) {
467
  global $ditty_scripts_enqueued;
468
  $min = WP_DEBUG ? '' : '.min';
469
 
470
  wp_register_script( 'hammer', DITTY_URL . 'includes/libs/hammer.min.js', array( 'jquery' ), '2.0.8.1', true );
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  wp_register_script( 'ditty', DITTY_URL . 'includes/js/ditty.min.js', array( 'jquery', 'jquery-effects-core', ), $this->version, true );
472
  if ( empty( $ditty_scripts_enqueued ) ) {
473
  wp_add_inline_script( 'ditty', 'const dittyVars = ' . json_encode( array(
@@ -495,17 +505,10 @@ class Ditty {
495
  wp_enqueue_script( 'ditty-display-ticker' );
496
  wp_enqueue_script( 'ditty-display-list' );
497
 
498
- wp_enqueue_script( 'ion-rangeslider', DITTY_URL . 'includes/libs/ion.rangeSlider/js/ion.rangeSlider.min.js', array( 'jquery' ), '2.3.1', true );
499
- wp_enqueue_script( 'jquery-minicolors', DITTY_URL . 'includes/libs/jquery-minicolors/jquery.minicolors.min.js', array( 'jquery' ), '2.3.5', true );
500
- wp_register_script( 'protip', DITTY_URL . 'includes/libs/protip/protip.min.js', array( 'jquery' ), '1.4.21', true );
501
- wp_enqueue_script( 'ditty-fields', DITTY_URL . 'includes/fields/js/ditty-fields.min.js', array(
502
- 'jquery',
503
- 'protip',
504
- 'jquery-effects-core',
505
- 'wp-codemirror',
506
- 'ion-rangeslider',
507
- 'jquery-minicolors',
508
- ), $this->version, true );
509
  wp_register_script( 'ditty-editor', DITTY_URL . 'includes/js/ditty-editor.min.js', array(
510
  'jquery',
511
  'protip',
@@ -517,6 +520,7 @@ class Ditty {
517
  'ditty-slider',
518
  'ditty-fields',
519
  ), $this->version, true );
 
520
  wp_register_script( 'ditty-admin', DITTY_URL . 'includes/js/ditty-admin.min.js', array(
521
  'jquery',
522
  'jquery-ui-core',
@@ -556,6 +560,18 @@ class Ditty {
556
  }
557
  }
558
 
 
 
 
 
 
 
 
 
 
 
 
 
559
  $ditty_scripts_enqueued = 'enqueued';
560
  }
561
 
@@ -609,13 +625,17 @@ class Ditty {
609
  /**
610
  * Enqueue global scripts for any Ditty's displayed
611
  *
612
- * @since 3.0.12
613
  */
614
  public function enqueue_global_scripts() {
 
 
615
  global $ditty_item_scripts;
616
  if ( empty( $ditty_item_scripts ) ) {
617
  $ditty_item_scripts = array();
618
  }
 
 
619
  global $ditty_display_scripts;
620
  if ( empty( $ditty_display_scripts ) ) {
621
  $ditty_display_scripts = array();
@@ -638,6 +658,8 @@ class Ditty {
638
  wp_print_scripts( 'ditty' );
639
  }
640
  }
 
 
641
  global $ditty_singles;
642
  if ( empty( $ditty_singles ) ) {
643
  $ditty_singles = array();
@@ -654,7 +676,7 @@ class Ditty {
654
  } );
655
  </script>
656
  <?php
657
- }
658
  }
659
 
660
  }
430
  */
431
  public function enqueue_styles() {
432
  wp_enqueue_style( 'ditty', DITTY_URL . 'includes/css/ditty.css', array(), $this->version, 'all' );
433
+ wp_register_style( 'ditty-admin', DITTY_URL . 'includes/css/ditty-admin.css', array(), $this->version, 'all' );
434
+
435
+ wp_register_style( 'fontawesome', 'https://use.fontawesome.com/releases/v5.15.3/css/all.css', false, '5.15.3', false );
436
+
437
+ wp_register_style( 'protip', DITTY_URL . 'includes/libs/protip/protip.min.css', false, '1.4.21', false );
438
+ wp_register_style( 'ion-rangeslider', DITTY_URL . 'includes/libs/ion.rangeSlider/css/ion.rangeSlider.min.css', false, '2.3.1', false );
439
+ wp_register_style( 'jquery-minicolors', DITTY_URL . 'includes/libs/jquery-minicolors/jquery.minicolors.css', false, '2.3.5', false );
440
 
441
  $disable_fontawesome = ditty_settings( 'disable_fontawesome' );
442
  if ( ! $disable_fontawesome ) {
443
+ wp_enqueue_style( 'fontawesome' );
444
  }
445
+
446
  if ( is_admin() ) {
447
  wp_enqueue_style( 'wp-codemirror' );
448
+ wp_enqueue_style( 'protip' );
449
+ wp_enqueue_style( 'ion-rangeslider' );
450
+ wp_enqueue_style( 'jquery-minicolors' );
451
+ wp_enqueue_style( 'ditty-admin' );
452
  if ( $disable_fontawesome ) {
453
+ wp_enqueue_style( 'fontawesome' );
 
 
 
 
 
 
 
 
 
 
 
454
  }
455
  }
456
  }
458
  /**
459
  * Register the JavaScript for the public-facing side of the site.
460
  *
461
+ * @since 3.0.14
462
  */
463
  public function enqueue_scripts( $hook ) {
464
  global $ditty_scripts_enqueued;
465
  $min = WP_DEBUG ? '' : '.min';
466
 
467
  wp_register_script( 'hammer', DITTY_URL . 'includes/libs/hammer.min.js', array( 'jquery' ), '2.0.8.1', true );
468
+ wp_register_script( 'protip', DITTY_URL . 'includes/libs/protip/protip.min.js', array( 'jquery' ), '1.4.21', true );
469
+ wp_register_script( 'ion-rangeslider', DITTY_URL . 'includes/libs/ion.rangeSlider/js/ion.rangeSlider.min.js', array( 'jquery' ), '2.3.1', true );
470
+ wp_register_script( 'jquery-minicolors', DITTY_URL . 'includes/libs/jquery-minicolors/jquery.minicolors.min.js', array( 'jquery' ), '2.3.5', true );
471
+ wp_register_script( 'ditty-fields', DITTY_URL . 'includes/fields/js/ditty-fields.min.js', array(
472
+ 'jquery',
473
+ 'protip',
474
+ 'jquery-effects-core',
475
+ 'wp-codemirror',
476
+ 'ion-rangeslider',
477
+ 'jquery-minicolors',
478
+ ), $this->version, true );
479
+ wp_register_script( 'ditty-editor-hooks', DITTY_URL . 'includes/js/ditty-editor-hooks.min.js', array( 'jquery' ), $this->version, true );
480
+
481
  wp_register_script( 'ditty', DITTY_URL . 'includes/js/ditty.min.js', array( 'jquery', 'jquery-effects-core', ), $this->version, true );
482
  if ( empty( $ditty_scripts_enqueued ) ) {
483
  wp_add_inline_script( 'ditty', 'const dittyVars = ' . json_encode( array(
505
  wp_enqueue_script( 'ditty-display-ticker' );
506
  wp_enqueue_script( 'ditty-display-list' );
507
 
508
+ wp_enqueue_script( 'ion-rangeslider' );
509
+ wp_enqueue_script( 'jquery-minicolors' );
510
+ wp_enqueue_script( 'protip' );
511
+ wp_enqueue_script( 'ditty-fields' );
 
 
 
 
 
 
 
512
  wp_register_script( 'ditty-editor', DITTY_URL . 'includes/js/ditty-editor.min.js', array(
513
  'jquery',
514
  'protip',
520
  'ditty-slider',
521
  'ditty-fields',
522
  ), $this->version, true );
523
+ wp_enqueue_script( 'ditty-editor-hooks' );
524
  wp_register_script( 'ditty-admin', DITTY_URL . 'includes/js/ditty-admin.min.js', array(
525
  'jquery',
526
  'jquery-ui-core',
560
  }
561
  }
562
 
563
+ // Ensure global scripts are being added
564
+ if ( ! is_admin() ) {
565
+ $global_ditty = ditty_settings( 'global_ditty' );
566
+ if ( is_array( $global_ditty ) && count( $global_ditty ) > 0 ) {
567
+ foreach ( $global_ditty as $i => $global_ditty ) {
568
+ if ( 'publish' === get_post_status( $global_ditty['ditty'] ) ) {
569
+ ditty_add_scripts( $global_ditty['ditty'], $global_ditty['display'] );
570
+ }
571
+ }
572
+ }
573
+ }
574
+
575
  $ditty_scripts_enqueued = 'enqueued';
576
  }
577
 
625
  /**
626
  * Enqueue global scripts for any Ditty's displayed
627
  *
628
+ * @since 3.0.14
629
  */
630
  public function enqueue_global_scripts() {
631
+
632
+ // Add item scripts
633
  global $ditty_item_scripts;
634
  if ( empty( $ditty_item_scripts ) ) {
635
  $ditty_item_scripts = array();
636
  }
637
+
638
+ // Add display scripts
639
  global $ditty_display_scripts;
640
  if ( empty( $ditty_display_scripts ) ) {
641
  $ditty_display_scripts = array();
658
  wp_print_scripts( 'ditty' );
659
  }
660
  }
661
+
662
+ // Add ditty scripts
663
  global $ditty_singles;
664
  if ( empty( $ditty_singles ) ) {
665
  $ditty_singles = array();
676
  } );
677
  </script>
678
  <?php
679
+ }
680
  }
681
 
682
  }
includes/css/ditty-admin.css CHANGED
@@ -115,503 +115,6 @@ table.wp-list-table .type-ditty_display .row-actions {
115
  border-top-right-radius: 3px;
116
  border-bottom-right-radius: 3px; }
117
 
118
- .ditty-help-icon {
119
- color: #93999F;
120
- text-decoration: underline; }
121
- .ditty-help-icon.active {
122
- color: #19BF7C; }
123
-
124
- .ditty-field {
125
- padding: 10px 0;
126
- border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
127
- .ditty-field:last-of-type {
128
- border-bottom: none; }
129
- .ditty-field__heading {
130
- position: relative; }
131
- .ditty-field__label {
132
- display: block;
133
- font-size: 14px;
134
- font-weight: 600;
135
- margin-bottom: 10px;
136
- cursor: default; }
137
- .ditty-field__help {
138
- display: none;
139
- margin: 7px 0 10px; }
140
- .ditty-field__input {
141
- display: flex;
142
- flex-direction: row;
143
- align-items: center;
144
- justify-content: flex-start;
145
- flex-wrap: wrap;
146
- position: relative;
147
- margin: 5px 0; }
148
- .ditty-field__input__container {
149
- position: relative; }
150
- .ditty-field__input__primary {
151
- flex: 1; }
152
- .ditty-field__input__before {
153
- flex: 0 0 auto;
154
- margin-right: 5px; }
155
- .ditty-field__input__after {
156
- margin-left: 5px; }
157
- .ditty-field__input__description {
158
- width: 100%; }
159
- .ditty-field__input input:not([type="button"]):not([type="checkbox"]):not([type="radio"]),
160
- .ditty-field__input select,
161
- .ditty-field__input textarea {
162
- width: 100%;
163
- min-height: 0;
164
- font-size: 14px;
165
- line-height: 24px;
166
- border: 1px solid #dfdfdf;
167
- border-radius: 3px;
168
- padding: 5px 10px;
169
- margin: 0; }
170
- .ditty-field__input input[type="number"] {
171
- width: auto; }
172
- .ditty-field__input textarea {
173
- padding: 10px 10px; }
174
- .ditty-field__input:hover .ditty-field__actions {
175
- display: flex; }
176
- .ditty-field__input__actions {
177
- width: 100%;
178
- display: flex;
179
- flex-direction: row;
180
- align-items: center;
181
- justify-content: flex-end;
182
- background: #FFF;
183
- border: 1px solid #dfdfdf;
184
- padding: 3px;
185
- border-radius: 3px;
186
- margin-bottom: 3px; }
187
- .ditty-field__input__actions a {
188
- display: block;
189
- flex: 0 0 auto;
190
- text-decoration: none;
191
- color: rgba(0, 0, 0, 0.4);
192
- margin: 0 2px;
193
- overflow: hidden;
194
- transition: color 0.25s ease; }
195
- .ditty-field__input__actions a.ditty-field__input__action--arrange {
196
- margin-right: auto; }
197
- .ditty-field__input__actions a:hover {
198
- color: rgba(0, 0, 0, 0.7); }
199
- .ditty-field__input__actions a:hover i {
200
- -webkit-transform: scale(1.2);
201
- transform: scale(1.2); }
202
- .ditty-field__input__actions i {
203
- display: block;
204
- width: 20px;
205
- height: 20px;
206
- text-align: center;
207
- line-height: 20px;
208
- transition: -webkit-transform 0.3s ease;
209
- transition: transform 0.3s ease;
210
- transition: transform 0.3s ease, -webkit-transform 0.3s ease; }
211
- .ditty-field__actions__clone {
212
- margin-bottom: 0; }
213
-
214
- .ditty-field__label + .ditty-field__description,
215
- .ditty-field__help + .ditty-field__description {
216
- margin-top: 7px; }
217
-
218
- .ditty-field--clone-enabled .ditty-input--clone {
219
- background: #f7f7f7;
220
- border: 1px dashed rgba(0, 0, 0, 0.1);
221
- padding: 5px; }
222
-
223
- .ditty-field--clone-enabled[data-input_count="1"] > .ditty-field__input__container > .ditty-field__input > .ditty-field__input__actions .ditty-field__input__action--arrange,
224
- .ditty-field--clone-enabled[data-input_count="1"] > .ditty-field__input__container > .ditty-field__input > .ditty-field__input__actions .ditty-field__input__action--remove {
225
- display: none; }
226
-
227
- .ditty-field--clone-enabled.ditty-field--clone-enabled--max > .ditty-field__clone {
228
- display: none; }
229
-
230
- .ditty-field--clone-enabled.ditty-field--clone-enabled--max > .ditty-field__input__container > .ditty-field__input__container > .ditty-field__input > .ditty-field__input__actions .ditty-field__input__action--add,
231
- .ditty-field--clone-enabled.ditty-field--clone-enabled--max > .ditty-field__input__container > .ditty-field__input__container > .ditty-field__input > .ditty-field__input__actions .ditty-field__input__action--clone {
232
- display: none; }
233
-
234
- /* Group */
235
- .ditty-field-type--group {
236
- padding: 0;
237
- border-color: rgba(0, 0, 0, 0.05); }
238
- .ditty-field-type--group > .ditty-field__input__container {
239
- overflow: hidden; }
240
- .ditty-field-type--group .ditty-input--group__container {
241
- display: flex;
242
- flex-direction: row;
243
- align-items: center;
244
- justify-content: flex-start;
245
- flex-wrap: wrap; }
246
- .ditty-field-type--group > .ditty-field__heading {
247
- display: flex;
248
- flex-direction: column;
249
- align-items: flex-start;
250
- justify-content: flex-start;
251
- color: #FFF;
252
- background: #32373C;
253
- padding: 15px;
254
- margin: 0; }
255
- .ditty-field-type--group > .ditty-field__heading label {
256
- margin-bottom: 0; }
257
- .ditty-field-type--group > .ditty-field__heading .ditty-field__help,
258
- .ditty-field-type--group > .ditty-field__heading .ditty-field__desciption {
259
- margin-bottom: 0; }
260
- .ditty-field-type--group .ditty-field__collapsible-toggle {
261
- position: absolute;
262
- right: 10px;
263
- top: 50%;
264
- width: 20px;
265
- height: 20px;
266
- display: flex;
267
- flex-direction: row;
268
- align-items: center;
269
- justify-content: center;
270
- text-decoration: none;
271
- margin-top: -10px;
272
- color: #FFF;
273
- background: rgba(255, 255, 255, 0.2);
274
- border-radius: 50%;
275
- transition: -webkit-transform .25s ease;
276
- transition: transform .25s ease;
277
- transition: transform .25s ease, -webkit-transform .25s ease; }
278
- .ditty-field-type--group[data-collapsible] > .ditty-field__heading {
279
- padding-right: 40px; }
280
- .ditty-field-type--group[data-collapsible="expanded"] .ditty-field__collapsible-toggle {
281
- -webkit-transform: rotate(180deg);
282
- transform: rotate(180deg); }
283
-
284
- .ditty-field-only + .ditty-field-only {
285
- margin-top: 20px; }
286
-
287
- .ditty-input--group {
288
- margin: 0; }
289
- .ditty-input--group__container > .ditty-field {
290
- width: 100%; }
291
-
292
- .ditty-field-type--group-child {
293
- margin: 0;
294
- padding: 8px;
295
- border-bottom: none; }
296
-
297
- /* Checkboxes */
298
- .ditty-input--checkboxes__group {
299
- display: flex;
300
- flex-direction: column;
301
- align-items: stretch;
302
- justify-content: flex-start;
303
- flex-wrap: wrap; }
304
- .ditty-input--checkboxes__group .ditty-input--checkboxes__option {
305
- display: block;
306
- margin-top: 2px;
307
- margin-bottom: 5px; }
308
- .ditty-input--checkboxes__group--inline {
309
- flex-direction: row;
310
- align-items: center; }
311
- .ditty-input--checkboxes__group--inline .ditty-input--checkboxes__option {
312
- margin-right: 15px; }
313
- .ditty-input--checkboxes__group--inline .ditty-input--checkboxes__option:last-child {
314
- margin-right: 0; }
315
- .ditty-input--checkboxes__group input[type="checkbox"] {
316
- margin-top: 0; }
317
-
318
- .ditty-field-type--checkbox input[type="checkbox"] {
319
- margin-top: 0; }
320
-
321
- /* Radio */
322
- .ditty-field-type--radio .ditty-input--radio {
323
- margin-bottom: 0; }
324
- .ditty-field-type--radio .ditty-input--radio .ditty-field__input__primary {
325
- display: flex;
326
- flex-direction: column;
327
- align-items: flex-start;
328
- justify-content: flex-start; }
329
- .ditty-field-type--radio .ditty-input--radio--inline .ditty-field__input__primary {
330
- flex-direction: row;
331
- align-items: center; }
332
- .ditty-field-type--radio .ditty-input--radio--inline .ditty-input--radio__option {
333
- margin-bottom: 0;
334
- margin-right: 15px; }
335
- .ditty-field-type--radio .ditty-input--radio--inline .ditty-input--radio__option:last-child {
336
- margin-right: 0; }
337
- .ditty-field-type--radio .ditty-input--radio__option {
338
- display: block;
339
- margin-top: 2px;
340
- margin-bottom: 5px; }
341
-
342
- /* Slider */
343
- .ditty-field-type--slider .irs--flat .irs-bar,
344
- .ditty-field-type--slider .irs--flat .irs-from,
345
- .ditty-field-type--slider .irs--flat .irs-to,
346
- .ditty-field-type--slider .irs--flat .irs-single {
347
- background-color: #19BF7C; }
348
-
349
- .ditty-field-type--slider .irs--flat .irs-from:before,
350
- .ditty-field-type--slider .irs--flat .irs-to:before,
351
- .ditty-field-type--slider .irs--flat .irs-single:before {
352
- border-top-color: #19BF7C; }
353
-
354
- .ditty-field-type--slider .irs--flat .irs-handle > i:first-child {
355
- background-color: #19BF7C; }
356
-
357
- .ditty-field-type--slider .irs--flat .irs-handle {
358
- top: 0; }
359
-
360
- .ditty-field-type--slider .irs--flat .irs-line,
361
- .ditty-field-type--slider .irs--flat .irs-bar {
362
- top: 3px; }
363
-
364
- .ditty-field-type--slider .irs-from,
365
- .ditty-field-type--slider .irs-to,
366
- .ditty-field-type--slider .irs-single {
367
- top: 25px; }
368
-
369
- .ditty-field-type--slider .irs--flat .irs-min,
370
- .ditty-field-type--slider .irs--flat .irs-max {
371
- top: 25px; }
372
-
373
- .ditty-field-type--slider .irs--flat .irs-from:before,
374
- .ditty-field-type--slider .irs--flat .irs-to:before,
375
- .ditty-field-type--slider .irs--flat .irs-single:before {
376
- top: -6px;
377
- bottom: auto;
378
- border-top-color: transparent;
379
- border-bottom-color: #19BF7C; }
380
-
381
- /* Color */
382
- .ditty-field-type--color input[type="text"] {
383
- height: auto;
384
- padding-left: 40px !important; }
385
-
386
- .ditty-field-type--color .minicolors-theme-default.minicolors {
387
- width: 100%; }
388
-
389
- .ditty-field-type--color .minicolors-theme-default .minicolors-swatch {
390
- top: 5px;
391
- left: 5px;
392
- width: 26px;
393
- height: 26px; }
394
-
395
- /* Spacing */
396
- .ditty-input--spacing__group {
397
- display: flex;
398
- flex-direction: row;
399
- align-items: center;
400
- justify-content: flex-start;
401
- flex-wrap: wrap;
402
- margin: 0 -2px; }
403
- .ditty-input--spacing__group .ditty-field {
404
- width: 25%;
405
- background: transparent;
406
- padding: 2px !important;
407
- margin: 0;
408
- border: none; }
409
- .ditty-input--spacing__group .ditty-field__input {
410
- position: relative;
411
- border-radius: 3px;
412
- overflow: hidden; }
413
- .ditty-input--spacing__group .ditty-field__input:before {
414
- position: absolute;
415
- content: '';
416
- background: #19BF7C; }
417
- .ditty-input--spacing__group .ditty-field:nth-child(1) .ditty-field__input:before {
418
- top: 0;
419
- left: 0;
420
- height: 5px;
421
- width: 100%; }
422
- .ditty-input--spacing__group .ditty-field:nth-child(2) .ditty-field__input:before {
423
- bottom: 0;
424
- left: 0;
425
- height: 5px;
426
- width: 100%; }
427
- .ditty-input--spacing__group .ditty-field:nth-child(3) .ditty-field__input:before {
428
- top: 0;
429
- left: 0;
430
- width: 5px;
431
- height: 100%; }
432
- .ditty-input--spacing__group .ditty-field:nth-child(4) .ditty-field__input:before {
433
- top: 0;
434
- right: 0;
435
- width: 5px;
436
- height: 100%; }
437
-
438
- /* Radius */
439
- .ditty-input--radius__group {
440
- display: flex;
441
- flex-direction: row;
442
- align-items: center;
443
- justify-content: flex-start;
444
- flex-wrap: wrap;
445
- margin: 0 -2px; }
446
- .ditty-input--radius__group .ditty-field {
447
- width: 25%;
448
- background: transparent;
449
- padding: 2px !important;
450
- margin: 0; }
451
- .ditty-input--radius__group .ditty-field__input {
452
- position: relative;
453
- border-radius: 3px;
454
- overflow: hidden; }
455
- .ditty-input--radius__group .ditty-field__input:before {
456
- position: absolute;
457
- content: '';
458
- width: 0;
459
- height: 0;
460
- border: 8px solid transparent; }
461
- .ditty-input--radius__group .ditty-field:nth-child(1) .ditty-field__input:before {
462
- top: 0;
463
- left: 0;
464
- border-top-color: #19BF7C;
465
- border-left-color: #19BF7C; }
466
- .ditty-input--radius__group .ditty-field:nth-child(2) .ditty-field__input:before {
467
- top: 0;
468
- right: 0;
469
- border-top-color: #19BF7C;
470
- border-right-color: #19BF7C; }
471
- .ditty-input--radius__group .ditty-field:nth-child(3) .ditty-field__input:before {
472
- bottom: 0;
473
- left: 0;
474
- border-bottom-color: #19BF7C;
475
- border-left-color: #19BF7C; }
476
- .ditty-input--radius__group .ditty-field:nth-child(4) .ditty-field__input:before {
477
- bottom: 0;
478
- right: 0;
479
- border-bottom-color: #19BF7C;
480
- border-right-color: #19BF7C; }
481
-
482
- /* Divider */
483
- .ditty-field-type--divider {
484
- display: flex;
485
- flex-direction: row;
486
- align-items: center;
487
- justify-content: flex-start;
488
- color: #FFF;
489
- background: #32373C; }
490
- .ditty-field-type--divider .ditty-field__label {
491
- flex: 0 0 auto;
492
- margin-bottom: 0;
493
- margin-right: 10px;
494
- white-space: nowrap; }
495
- .ditty-field-type--divider .ditty-field__input {
496
- flex: 1; }
497
-
498
- .ditty-input--divider__wrapper {
499
- display: flex;
500
- flex-direction: row;
501
- align-items: center;
502
- justify-content: flex-start;
503
- flex-wrap: wrap; }
504
-
505
- .ditty-input--divider__heading {
506
- flex: 0 0 auto;
507
- white-space: nowrap;
508
- margin-right: 10px; }
509
-
510
- .ditty-input--divider__line {
511
- flex: 1;
512
- background: rgba(0, 0, 0, 0.05); }
513
-
514
- .ditty-input--divider__description {
515
- width: 100%;
516
- margin-bottom: 10px; }
517
-
518
- /* Date */
519
- .ditty-field-type--date .ditty-field__input {
520
- position: relative; }
521
- .ditty-field-type--date .ditty-field__input:after {
522
- position: absolute;
523
- top: 50%;
524
- left: 10px;
525
- -webkit-transform: translateY(-50%);
526
- transform: translateY(-50%);
527
- margin-top: -1px;
528
- font-family: 'Font Awesome 5 Pro';
529
- content: '\f073';
530
- font-size: 18px;
531
- opacity: .3;
532
- transition: opacity .25s ease; }
533
- .ditty-field-type--date .ditty-field__input:focus-within:after {
534
- opacity: 1; }
535
- .ditty-field-type--date .ditty-field__input input[type="text"] {
536
- padding-left: 32px !important; }
537
-
538
- /* WYSIWYG */
539
- .ditty-input--wysiwyg .wp-editor-tabs * {
540
- box-sizing: content-box; }
541
-
542
- /* Image */
543
- .ditty-input--image__preview {
544
- position: relative;
545
- width: 100%;
546
- height: 80px;
547
- background: #FFF;
548
- border: 1px solid #dfdfdf;
549
- border-radius: 3px; }
550
- .ditty-input--image__preview a {
551
- position: absolute;
552
- top: 0;
553
- left: 0;
554
- z-index: 9;
555
- display: flex;
556
- flex-direction: row;
557
- align-items: center;
558
- justify-content: center;
559
- width: 100%;
560
- height: 100%;
561
- text-align: center;
562
- text-decoration: none;
563
- cursor: pointer; }
564
- .ditty-input--image__preview a i {
565
- color: #58ca68; }
566
- .ditty-input--image__preview img {
567
- display: block;
568
- line-height: 0;
569
- position: absolute;
570
- top: 0;
571
- left: 0;
572
- width: 100%;
573
- height: 100%;
574
- -o-object-fit: cover;
575
- object-fit: cover; }
576
-
577
- /* Button */
578
- .ditty-field__input__primary > .ditty-button,
579
- .ditty-field-only--button > .ditty-button {
580
- margin: 0; }
581
-
582
- /* File */
583
- .ditty-input--file .ditty-field__input__primary {
584
- display: flex;
585
- flex-direction: row;
586
- align-items: stretch;
587
- justify-content: flex-start; }
588
-
589
- .ditty-input--file input[type="text"] {
590
- border-top-right-radius: 0 !important;
591
- border-bottom-right-radius: 0 !important; }
592
-
593
- .ditty-input--file .ditty-button {
594
- padding-left: 20px;
595
- padding-right: 20px;
596
- margin: 0;
597
- border-top-left-radius: 0;
598
- border-bottom-left-radius: 0; }
599
-
600
- /* Heading */
601
- .ditty-field-type--heading {
602
- background: #f7f7f7; }
603
- .ditty-field-type--heading .ditty-field__heading {
604
- flex: 0 0 100% !important;
605
- width: 100% !important;
606
- padding: 0 !important; }
607
- .ditty-field-type--heading .ditty-field__label {
608
- font-size: 16px;
609
- line-height: 20px;
610
- margin-top: 0;
611
- margin-bottom: 0; }
612
- .ditty-field-type--heading .ditty-field__description {
613
- margin-bottom: 0; }
614
-
615
  .datepicker-container {
616
  background-color: #fff;
617
  direction: ltr;
115
  border-top-right-radius: 3px;
116
  border-bottom-right-radius: 3px; }
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  .datepicker-container {
119
  background-color: #fff;
120
  direction: ltr;
includes/css/ditty.css CHANGED
@@ -1,3 +1,523 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  .ditty-metabox .rwmb-label,
2
  .ditty-metabox .rwmb-input {
3
  width: 100%; }
@@ -1131,21 +1651,13 @@
1131
  overflow-y: scroll;
1132
  -webkit-overflow-scrolling: touch; }
1133
 
1134
- #ditty-editor__settings .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field.ditty-field--minHeight {
1135
- width: 50%;
1136
- padding-right: 7.5px; }
1137
-
1138
- #ditty-editor__settings .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field.ditty-field--maxHeight {
1139
- width: 50%;
1140
- padding-left: 7.5px; }
1141
-
1142
- #ditty-editor__settings .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field.ditty-field--titleFontSize {
1143
- width: 50%;
1144
- padding-right: 7.5px; }
1145
 
1146
- #ditty-editor__settings .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field.ditty-field--titleLineHeight {
1147
- width: 50%;
1148
- padding-left: 7.5px; }
1149
 
1150
  .ditty-editor-layout {
1151
  cursor: pointer; }
1
+ .ditty-help-icon {
2
+ color: #93999F;
3
+ text-decoration: underline; }
4
+ .ditty-help-icon.active {
5
+ color: #19BF7C; }
6
+
7
+ .ditty-field {
8
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif !important;
9
+ padding: 15px;
10
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
11
+ .ditty-field:last-of-type {
12
+ border-bottom: none; }
13
+ .ditty-field__heading {
14
+ position: relative; }
15
+ .ditty-field__label {
16
+ display: block;
17
+ font-size: 14px;
18
+ font-weight: 600;
19
+ margin-bottom: 10px;
20
+ cursor: default; }
21
+ .ditty-field__help {
22
+ display: none;
23
+ font-size: 13px;
24
+ line-height: 16px;
25
+ margin: 7px 0 10px !important; }
26
+ .ditty-field__input {
27
+ display: flex;
28
+ flex-direction: row;
29
+ align-items: center;
30
+ justify-content: flex-start;
31
+ flex-wrap: wrap;
32
+ position: relative;
33
+ margin: 5px 0; }
34
+ .ditty-field__input__container {
35
+ position: relative; }
36
+ .ditty-field__input__primary {
37
+ flex: 1; }
38
+ .ditty-field__input__before {
39
+ flex: 0 0 auto;
40
+ margin-right: 5px; }
41
+ .ditty-field__input__after {
42
+ margin-left: 5px; }
43
+ .ditty-field__input__description {
44
+ width: 100%;
45
+ font-size: 13px;
46
+ line-height: 16px; }
47
+ .ditty-field__input input:not([type="button"]):not([type="checkbox"]):not([type="radio"]),
48
+ .ditty-field__input select,
49
+ .ditty-field__input textarea {
50
+ width: 100%;
51
+ min-height: 0;
52
+ font-size: 14px;
53
+ line-height: 24px;
54
+ border: 1px solid #dfdfdf;
55
+ border-radius: 3px;
56
+ padding: 5px 10px;
57
+ margin: 0; }
58
+ .ditty-field__input input[type="number"] {
59
+ width: auto; }
60
+ .ditty-field__input textarea {
61
+ padding: 10px 10px; }
62
+ .ditty-field__input:hover .ditty-field__actions {
63
+ display: flex; }
64
+ .ditty-field__input__actions {
65
+ width: 100%;
66
+ display: flex;
67
+ flex-direction: row;
68
+ align-items: center;
69
+ justify-content: flex-end;
70
+ background: #FFF;
71
+ border: 1px solid #dfdfdf;
72
+ padding: 3px;
73
+ border-radius: 3px;
74
+ margin-bottom: 3px; }
75
+ .ditty-field__input__actions a {
76
+ display: block;
77
+ flex: 0 0 auto;
78
+ text-decoration: none;
79
+ color: rgba(0, 0, 0, 0.4);
80
+ margin: 0 2px;
81
+ overflow: hidden;
82
+ transition: color 0.25s ease; }
83
+ .ditty-field__input__actions a.ditty-field__input__action--arrange {
84
+ margin-right: auto; }
85
+ .ditty-field__input__actions a:hover {
86
+ color: rgba(0, 0, 0, 0.7); }
87
+ .ditty-field__input__actions a:hover i {
88
+ -webkit-transform: scale(1.2);
89
+ transform: scale(1.2); }
90
+ .ditty-field__input__actions i {
91
+ display: block;
92
+ width: 20px;
93
+ height: 20px;
94
+ text-align: center;
95
+ line-height: 20px;
96
+ transition: -webkit-transform 0.3s ease;
97
+ transition: transform 0.3s ease;
98
+ transition: transform 0.3s ease, -webkit-transform 0.3s ease; }
99
+ .ditty-field__actions__clone {
100
+ margin-bottom: 0; }
101
+
102
+ .ditty-field__label + .ditty-field__description,
103
+ .ditty-field__help + .ditty-field__description {
104
+ margin-top: 7px !important; }
105
+
106
+ .ditty-field--clone-enabled .ditty-input--clone {
107
+ background: #f7f7f7;
108
+ border: 1px dashed rgba(0, 0, 0, 0.1);
109
+ padding: 5px; }
110
+
111
+ .ditty-field--clone-enabled[data-input_count="1"] > .ditty-field__input__container > .ditty-field__input > .ditty-field__input__actions .ditty-field__input__action--arrange,
112
+ .ditty-field--clone-enabled[data-input_count="1"] > .ditty-field__input__container > .ditty-field__input > .ditty-field__input__actions .ditty-field__input__action--remove {
113
+ display: none; }
114
+
115
+ .ditty-field--clone-enabled.ditty-field--clone-enabled--max > .ditty-field__clone {
116
+ display: none; }
117
+
118
+ .ditty-field--clone-enabled.ditty-field--clone-enabled--max > .ditty-field__input__container > .ditty-field__input__container > .ditty-field__input > .ditty-field__input__actions .ditty-field__input__action--add,
119
+ .ditty-field--clone-enabled.ditty-field--clone-enabled--max > .ditty-field__input__container > .ditty-field__input__container > .ditty-field__input > .ditty-field__input__actions .ditty-field__input__action--clone {
120
+ display: none; }
121
+
122
+ /* Group */
123
+ .ditty-field-type--group {
124
+ padding: 0;
125
+ border-color: rgba(0, 0, 0, 0.05); }
126
+ .ditty-field-type--group > .ditty-field__input__container {
127
+ overflow: hidden; }
128
+ .ditty-field-type--group .ditty-input--group__container {
129
+ display: flex;
130
+ flex-direction: row;
131
+ align-items: center;
132
+ justify-content: flex-start;
133
+ flex-wrap: wrap; }
134
+ .ditty-field-type--group > .ditty-field__heading {
135
+ display: flex;
136
+ flex-direction: column;
137
+ align-items: flex-start;
138
+ justify-content: flex-start;
139
+ color: #FFF;
140
+ background: #32373C;
141
+ padding: 15px;
142
+ margin: 0; }
143
+ .ditty-field-type--group > .ditty-field__heading label {
144
+ margin-bottom: 0; }
145
+ .ditty-field-type--group > .ditty-field__heading .ditty-field__help,
146
+ .ditty-field-type--group > .ditty-field__heading .ditty-field__desciption {
147
+ margin-bottom: 0 !important; }
148
+ .ditty-field-type--group .ditty-field__collapsible-toggle {
149
+ position: absolute;
150
+ right: 10px;
151
+ top: 50%;
152
+ width: 20px;
153
+ height: 20px;
154
+ display: flex;
155
+ flex-direction: row;
156
+ align-items: center;
157
+ justify-content: center;
158
+ text-decoration: none;
159
+ margin-top: -10px;
160
+ color: #FFF;
161
+ background: rgba(255, 255, 255, 0.2);
162
+ border-radius: 50%;
163
+ transition: -webkit-transform .25s ease;
164
+ transition: transform .25s ease;
165
+ transition: transform .25s ease, -webkit-transform .25s ease; }
166
+ .ditty-field-type--group[data-collapsible] > .ditty-field__heading {
167
+ padding-right: 40px; }
168
+ .ditty-field-type--group[data-collapsible="expanded"] .ditty-field__collapsible-toggle {
169
+ -webkit-transform: rotate(180deg);
170
+ transform: rotate(180deg); }
171
+
172
+ .ditty-field-only + .ditty-field-only {
173
+ margin-top: 20px; }
174
+
175
+ .ditty-input--group {
176
+ margin: 0; }
177
+ .ditty-input--group__container > .ditty-field {
178
+ width: 100%; }
179
+
180
+ .ditty-field-type--group-child {
181
+ margin: 0;
182
+ padding: 8px;
183
+ border-bottom: none; }
184
+
185
+ /* Checkboxes */
186
+ .ditty-input--checkboxes__group {
187
+ display: flex;
188
+ flex-direction: column;
189
+ align-items: stretch;
190
+ justify-content: flex-start;
191
+ flex-wrap: wrap; }
192
+ .ditty-input--checkboxes__group .ditty-input--checkboxes__option {
193
+ display: block;
194
+ margin-top: 2px;
195
+ margin-bottom: 5px; }
196
+ .ditty-input--checkboxes__group .ditty-input--checkboxes__option label {
197
+ font-size: 13px;
198
+ line-break: 13px; }
199
+ .ditty-input--checkboxes__group--inline {
200
+ flex-direction: row;
201
+ align-items: center; }
202
+ .ditty-input--checkboxes__group--inline .ditty-input--checkboxes__option {
203
+ margin-right: 15px; }
204
+ .ditty-input--checkboxes__group--inline .ditty-input--checkboxes__option:last-child {
205
+ margin-right: 0; }
206
+ .ditty-input--checkboxes__group input[type="checkbox"] {
207
+ margin-top: 0; }
208
+
209
+ .ditty-field-type--checkbox .ditty-field__input__primary input[type="checkbox"] {
210
+ margin: 0; }
211
+
212
+ .ditty-field-type--checkbox .ditty-field__input__primary label {
213
+ font-size: 13px;
214
+ line-height: 13px;
215
+ margin-left: 7px; }
216
+
217
+ /* Radio */
218
+ .ditty-field-type--radio .ditty-input--radio {
219
+ margin-bottom: 0; }
220
+ .ditty-field-type--radio .ditty-input--radio .ditty-field__input__primary {
221
+ display: flex;
222
+ flex-direction: column;
223
+ align-items: flex-start;
224
+ justify-content: flex-start; }
225
+ .ditty-field-type--radio .ditty-input--radio--inline .ditty-field__input__primary {
226
+ flex-direction: row;
227
+ align-items: center; }
228
+ .ditty-field-type--radio .ditty-input--radio--inline .ditty-input--radio__option {
229
+ margin-bottom: 0;
230
+ margin-right: 15px; }
231
+ .ditty-field-type--radio .ditty-input--radio--inline .ditty-input--radio__option:last-child {
232
+ margin-right: 0; }
233
+ .ditty-field-type--radio .ditty-input--radio__option {
234
+ display: flex;
235
+ flex-direction: row;
236
+ align-items: center;
237
+ margin-top: 2px;
238
+ margin-bottom: 5px; }
239
+ .ditty-field-type--radio .ditty-input--radio__option input[type="radio"] {
240
+ margin: 0; }
241
+ .ditty-field-type--radio .ditty-input--radio__option label {
242
+ font-size: 13px;
243
+ line-height: 13px;
244
+ margin-left: 7px; }
245
+
246
+ /* Slider */
247
+ .ditty-field-type--slider .irs--flat .irs-bar,
248
+ .ditty-field-type--slider .irs--flat .irs-from,
249
+ .ditty-field-type--slider .irs--flat .irs-to,
250
+ .ditty-field-type--slider .irs--flat .irs-single {
251
+ background-color: #19BF7C; }
252
+
253
+ .ditty-field-type--slider .irs--flat .irs-from:before,
254
+ .ditty-field-type--slider .irs--flat .irs-to:before,
255
+ .ditty-field-type--slider .irs--flat .irs-single:before {
256
+ border-top-color: #19BF7C; }
257
+
258
+ .ditty-field-type--slider .irs--flat .irs-handle > i:first-child {
259
+ background-color: #19BF7C; }
260
+
261
+ .ditty-field-type--slider .irs--flat .irs-handle {
262
+ top: 0; }
263
+
264
+ .ditty-field-type--slider .irs--flat .irs-line,
265
+ .ditty-field-type--slider .irs--flat .irs-bar {
266
+ top: 3px; }
267
+
268
+ .ditty-field-type--slider .irs-from,
269
+ .ditty-field-type--slider .irs-to,
270
+ .ditty-field-type--slider .irs-single {
271
+ top: 25px; }
272
+
273
+ .ditty-field-type--slider .irs--flat .irs-min,
274
+ .ditty-field-type--slider .irs--flat .irs-max {
275
+ top: 25px; }
276
+
277
+ .ditty-field-type--slider .irs--flat .irs-from:before,
278
+ .ditty-field-type--slider .irs--flat .irs-to:before,
279
+ .ditty-field-type--slider .irs--flat .irs-single:before {
280
+ top: -6px;
281
+ bottom: auto;
282
+ border-top-color: transparent;
283
+ border-bottom-color: #19BF7C; }
284
+
285
+ /* Color */
286
+ .ditty-field-type--color input[type="text"] {
287
+ height: auto;
288
+ padding-left: 40px !important; }
289
+
290
+ .ditty-field-type--color .minicolors-theme-default.minicolors {
291
+ width: 100%; }
292
+
293
+ .ditty-field-type--color .minicolors-theme-default .minicolors-swatch {
294
+ top: 5px;
295
+ left: 5px;
296
+ width: 26px;
297
+ height: 26px; }
298
+
299
+ /* Spacing */
300
+ .ditty-input--spacing__group {
301
+ display: flex;
302
+ flex-direction: row;
303
+ align-items: center;
304
+ justify-content: flex-start;
305
+ flex-wrap: wrap;
306
+ margin: 0 -2px; }
307
+ .ditty-input--spacing__group .ditty-field {
308
+ width: 25%;
309
+ background: transparent;
310
+ padding: 2px !important;
311
+ margin: 0;
312
+ border: none; }
313
+ .ditty-input--spacing__group .ditty-field__input {
314
+ position: relative;
315
+ border-radius: 3px;
316
+ overflow: hidden; }
317
+ .ditty-input--spacing__group .ditty-field__input:before {
318
+ position: absolute;
319
+ content: '';
320
+ background: #19BF7C; }
321
+ .ditty-input--spacing__group .ditty-field:nth-child(1) .ditty-field__input:before {
322
+ top: 0;
323
+ left: 0;
324
+ height: 5px;
325
+ width: 100%; }
326
+ .ditty-input--spacing__group .ditty-field:nth-child(2) .ditty-field__input:before {
327
+ bottom: 0;
328
+ left: 0;
329
+ height: 5px;
330
+ width: 100%; }
331
+ .ditty-input--spacing__group .ditty-field:nth-child(3) .ditty-field__input:before {
332
+ top: 0;
333
+ left: 0;
334
+ width: 5px;
335
+ height: 100%; }
336
+ .ditty-input--spacing__group .ditty-field:nth-child(4) .ditty-field__input:before {
337
+ top: 0;
338
+ right: 0;
339
+ width: 5px;
340
+ height: 100%; }
341
+
342
+ /* Radius */
343
+ .ditty-input--radius__group {
344
+ display: flex;
345
+ flex-direction: row;
346
+ align-items: center;
347
+ justify-content: flex-start;
348
+ flex-wrap: wrap;
349
+ margin: 0 -2px; }
350
+ .ditty-input--radius__group .ditty-field {
351
+ width: 25%;
352
+ background: transparent;
353
+ padding: 2px !important;
354
+ margin: 0; }
355
+ .ditty-input--radius__group .ditty-field__input {
356
+ position: relative;
357
+ border-radius: 3px;
358
+ overflow: hidden; }
359
+ .ditty-input--radius__group .ditty-field__input:before {
360
+ position: absolute;
361
+ content: '';
362
+ width: 0;
363
+ height: 0;
364
+ border: 8px solid transparent; }
365
+ .ditty-input--radius__group .ditty-field:nth-child(1) .ditty-field__input:before {
366
+ top: 0;
367
+ left: 0;
368
+ border-top-color: #19BF7C;
369
+ border-left-color: #19BF7C; }
370
+ .ditty-input--radius__group .ditty-field:nth-child(2) .ditty-field__input:before {
371
+ top: 0;
372
+ right: 0;
373
+ border-top-color: #19BF7C;
374
+ border-right-color: #19BF7C; }
375
+ .ditty-input--radius__group .ditty-field:nth-child(3) .ditty-field__input:before {
376
+ bottom: 0;
377
+ left: 0;
378
+ border-bottom-color: #19BF7C;
379
+ border-left-color: #19BF7C; }
380
+ .ditty-input--radius__group .ditty-field:nth-child(4) .ditty-field__input:before {
381
+ bottom: 0;
382
+ right: 0;
383
+ border-bottom-color: #19BF7C;
384
+ border-right-color: #19BF7C; }
385
+
386
+ /* Divider */
387
+ .ditty-field-type--divider {
388
+ display: flex;
389
+ flex-direction: row;
390
+ align-items: center;
391
+ justify-content: flex-start;
392
+ color: #FFF;
393
+ background: #32373C; }
394
+ .ditty-field-type--divider .ditty-field__label {
395
+ flex: 0 0 auto;
396
+ margin-bottom: 0;
397
+ margin-right: 10px;
398
+ white-space: nowrap; }
399
+ .ditty-field-type--divider .ditty-field__input {
400
+ flex: 1; }
401
+
402
+ .ditty-input--divider__wrapper {
403
+ display: flex;
404
+ flex-direction: row;
405
+ align-items: center;
406
+ justify-content: flex-start;
407
+ flex-wrap: wrap; }
408
+
409
+ .ditty-input--divider__heading {
410
+ flex: 0 0 auto;
411
+ white-space: nowrap;
412
+ margin-right: 10px; }
413
+
414
+ .ditty-input--divider__line {
415
+ flex: 1;
416
+ background: rgba(0, 0, 0, 0.05); }
417
+
418
+ .ditty-input--divider__description {
419
+ width: 100%;
420
+ margin-bottom: 10px; }
421
+
422
+ /* Date */
423
+ .ditty-field-type--date .ditty-field__input {
424
+ position: relative; }
425
+ .ditty-field-type--date .ditty-field__input:after {
426
+ position: absolute;
427
+ top: 50%;
428
+ left: 10px;
429
+ -webkit-transform: translateY(-50%);
430
+ transform: translateY(-50%);
431
+ margin-top: -1px;
432
+ font-family: 'Font Awesome 5 Pro';
433
+ content: '\f073';
434
+ font-size: 18px;
435
+ opacity: .3;
436
+ transition: opacity .25s ease; }
437
+ .ditty-field-type--date .ditty-field__input:focus-within:after {
438
+ opacity: 1; }
439
+ .ditty-field-type--date .ditty-field__input input[type="text"] {
440
+ padding-left: 32px !important; }
441
+
442
+ /* WYSIWYG */
443
+ .ditty-input--wysiwyg .wp-editor-tabs * {
444
+ box-sizing: content-box; }
445
+
446
+ /* Image */
447
+ .ditty-input--image__preview {
448
+ position: relative;
449
+ width: 100%;
450
+ height: 80px;
451
+ background: #FFF;
452
+ border: 1px solid #dfdfdf;
453
+ border-radius: 3px; }
454
+ .ditty-input--image__preview a {
455
+ position: absolute;
456
+ top: 0;
457
+ left: 0;
458
+ z-index: 9;
459
+ display: flex;
460
+ flex-direction: row;
461
+ align-items: center;
462
+ justify-content: center;
463
+ width: 100%;
464
+ height: 100%;
465
+ text-align: center;
466
+ text-decoration: none;
467
+ cursor: pointer; }
468
+ .ditty-input--image__preview a i {
469
+ color: #58ca68; }
470
+ .ditty-input--image__preview img {
471
+ display: block;
472
+ line-height: 0;
473
+ position: absolute;
474
+ top: 0;
475
+ left: 0;
476
+ width: 100%;
477
+ height: 100%;
478
+ -o-object-fit: cover;
479
+ object-fit: cover; }
480
+
481
+ /* Button */
482
+ .ditty-field__input__primary > .ditty-button,
483
+ .ditty-field-only--button > .ditty-button {
484
+ margin: 0; }
485
+
486
+ /* File */
487
+ .ditty-input--file .ditty-field__input__primary {
488
+ display: flex;
489
+ flex-direction: row;
490
+ align-items: stretch;
491
+ justify-content: flex-start; }
492
+
493
+ .ditty-input--file input[type="text"] {
494
+ border-top-right-radius: 0 !important;
495
+ border-bottom-right-radius: 0 !important; }
496
+
497
+ .ditty-input--file .ditty-button {
498
+ padding-left: 20px;
499
+ padding-right: 20px;
500
+ margin: 0;
501
+ border-top-left-radius: 0;
502
+ border-bottom-left-radius: 0; }
503
+
504
+ /* Heading */
505
+ .ditty-field-type--heading {
506
+ background: #f7f7f7; }
507
+ .ditty-field-type--heading .ditty-field__heading {
508
+ flex: 0 0 100% !important;
509
+ width: 100% !important;
510
+ padding: 0 !important; }
511
+ .ditty-field-type--heading .ditty-field__label {
512
+ font-size: 16px;
513
+ line-height: 20px;
514
+ margin-top: 0;
515
+ margin-bottom: 0; }
516
+ .ditty-field-type--heading .ditty-field__description {
517
+ font-size: 13px;
518
+ line-height: 16px;
519
+ margin-bottom: 0; }
520
+
521
  .ditty-metabox .rwmb-label,
522
  .ditty-metabox .rwmb-input {
523
  width: 100%; }
1651
  overflow-y: scroll;
1652
  -webkit-overflow-scrolling: touch; }
1653
 
1654
+ .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field.ditty-field--minHeight, .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field.ditty-field--titleFontSize {
1655
+ width: 50% !important;
1656
+ padding-right: 7.5px !important; }
 
 
 
 
 
 
 
 
1657
 
1658
+ .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field.ditty-field--maxHeight, .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field.ditty-field--titleLineHeight {
1659
+ width: 50% !important;
1660
+ padding-left: 7.5px !important; }
1661
 
1662
  .ditty-editor-layout {
1663
  cursor: pointer; }
includes/fields/js/ditty-fields.js CHANGED
@@ -20,7 +20,7 @@ jQuery( function( $ ) {
20
 
21
  "use strict";
22
 
23
- $( '#ditty-page' ).on( 'click', '.ditty-help-icon', function( e ) {
24
  e.preventDefault();
25
 
26
  var $icon = $( this ),
20
 
21
  "use strict";
22
 
23
+ $( 'body' ).on( 'click', '.ditty-help-icon', function( e ) {
24
  e.preventDefault();
25
 
26
  var $icon = $( this ),
includes/fields/js/ditty-fields.min.js CHANGED
@@ -1 +1 @@
1
- jQuery((function($){!function(){"use strict";$("#ditty-page").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))}))}))}()}));
includes/js/class-ditty-display-ticker.js CHANGED
@@ -848,9 +848,10 @@
848
  borderColor: this.settings.borderColor,
849
  borderStyle: this.settings.borderStyle
850
  } );
851
- this.$elmt.css( this.settings.padding );
852
- this.$elmt.css( this.settings.margin );
853
  this.$elmt.css( this.settings.borderRadius );
 
 
 
854
 
855
  this.$contents.css( {
856
  backgroundColor: this.settings.contentsBgColor,
848
  borderColor: this.settings.borderColor,
849
  borderStyle: this.settings.borderStyle
850
  } );
 
 
851
  this.$elmt.css( this.settings.borderRadius );
852
+ this.$elmt.css( this.settings.borderWidth );
853
+ this.$elmt.css( this.settings.margin );
854
+ this.$elmt.css( this.settings.padding );
855
 
856
  this.$contents.css( {
857
  backgroundColor: this.settings.contentsBgColor,
includes/js/class-ditty-display-ticker.min.js CHANGED
@@ -1 +1 @@
1
- !function($){"use strict";var t={id:0,title:"",display:0,status:"",direction:"left",spacing:20,speed:10,cloneItems:"yes",hoverPause:0,height:null,minHeight:null,maxHeight:null,heightEase:"easeInOutQuint",heightSpeed:1.5,scrollInit:"empty",scrollDelay:2,maxWidth:"",bgColor:"",padding:{},margin:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},contentsBgColor:"",contentsPadding:{},contentsBorderColor:{},contentsBorderStyle:{},contentsBorderWidth:{},contentsBorderRadius:{},titleDisplay:"none",titleElement:"h3",titleElementPosition:"topLeft",titleFontSize:"",titleLineHeight:"",titleColor:"",titleBgColor:"",titleMargin:{},titlePadding:{},titleBorderColor:{},titleBorderStyle:{},titleBorderWidth:{},titleBorderRadius:{},itemTextColor:"",itemBgColor:"",itemBorderColor:{},itemBorderStyle:{},itemBorderWidth:{},itemBorderRadius:{},itemPadding:{},itemMaxWidth:"",itemElementsWrap:"wrap",item:0,shuffle:0,showEditor:0,items:[]},i=function(i,e){this.displayType="ticker",this.elmt=i,this.settings=$.extend({},t,$.ditty_ticker.defaults,e),this.nextItem=null,this.total=this.settings.items.length,this.$elmt=$(i),this.$title=null,this.$titleContents=null,this.$contents=null,this.$items=null,this.$currentItem=null,this.$lastItem=null,this.scrollPercent=.13,this.running=!1,this.interval=!1,this.currentHeight=this.settings.height,this.visibleItems=[],1===parseInt(this.settings.shuffle)&&this.shuffle(),this._init()};i.prototype={_init:function(){var t,i,e=this;0===this.total&&this.hide(),this.$elmt.removeClass("ditty--pre"),this.$elmt.addClass("ditty ditty-ticker"),this.$elmt.attr("data-id",this.settings.id),this.$elmt.attr("data-type",this.displayType),this.$elmt.attr("data-display",this.settings.display),t=$('<div class="ditty-ticker__contents"></div>'),this.$contents=t,this.$title=$('<div class="ditty-ticker__title"></div>'),this.$titleContents=$('<div class="ditty-ticker__title__contents"></div>'),this.$title.append(this.$titleContents),i=$('<div class="ditty-ticker__items"></div>'),this.$items=i,this.$items.height(this.currentHeight),t.append(i),this.$elmt.append(t),this._styleDisplay(),this._styleTitle(),this.$elmt.on("mouseenter",{self:this},this._mouseenter),this.$elmt.on("mouseleave",{self:this},this._mouseleave),this.settings.showEditor?dittyEditorInit(this):this.trigger("start_live_updates"),setTimeout((function(){for(var t=0;t<e.total;t++)e._preloadItem(e.settings.items[t]);e._initializeItems(),e.trigger("init")}),1)},_initializeItems:function(){"filled"===this.settings.scrollInit?this._fillTicker():this.running||this._timerStart()},_preloadItem:function(t){$(t.html).find("img").each((function(){(new Image).src=$(this).attr("src")}))},_positionItems:function(t){var i=this;if(0===i.visibleItems.length){var e=i.settings.item;this._isItemEnabled(e)||(e=this._getNextItem(e)),i._initializeItem(e)}$.each(i.visibleItems,(function(e,s){if(s){var n=i.visibleItems[e].$item,r=i._calculateItemPosition(e,t);i.visibleItems[e].posX=r.posX,i.visibleItems[e].posY=r.posY,i._itemSetTransform(n,r),i._newItemShouldStart(n,r)&&i._initializeItem(parseInt(i.nextItem)),i._itemShouldTerminate(n,r)&&i._terminateItem(e)}}))},_timerStart:function(){var t=this;this.running=!0,this.trigger("start"),cancelAnimationFrame(this.interval),t.interval=requestAnimationFrame((function i(){t._positionItems(),t.interval=requestAnimationFrame(i)}))},_timerStop:function(){cancelAnimationFrame(this.interval),this.running=!1,this.trigger("stop")},_mouseenter:function(t){var i=t.data.self;i.settings.hoverPause&&i._timerStop()},_mouseleave:function(t){var i=t.data.self;i.settings.hoverPause&&i._timerStart()},_newItemShouldStart:function(t,i){if(this.$currentItem[0]!==t[0])return!1;var e=!1;switch(this.settings.direction){case"left":i.posX<=this.$items.outerWidth()-t.outerWidth()&&(e=!0);break;case"right":i.posX>=0&&(e=!0);break;case"down":i.posY>=0&&(e=!0);break;case"up":i.posY<=this.$items.outerHeight()-t.outerHeight()&&(e=!0)}return e},_initializeItem:function(t,i){if(void 0===this.settings.items[t])return!1;var e=this.$items.children(".ditty-item--"+this.settings.items[t].uniq_id);if("yes"!==this.settings.cloneItems&&e.length)return!1;var s=$(this.settings.items[t].html);if(s.css({top:0,left:0}),this.$items.children(".ditty-item--"+this.settings.items[t].id).not(".ditty-item--clone").length>0&&s.addClass("ditty-item--clone"),this._styleItem(s),this.settings.items[t].css&&dittyLayoutCss(this.settings.items[t].css,this.settings.items[t].layout_id),this._itemSpacing(s),this._itemSetTransform(s,this._itemResetPosition(s)),this.$items.append(s),s.css({display:"block",top:0,left:0,opacity:1}),s.addClass("ditty-item--current"),null!==this.$currentItem&&this.$currentItem.removeClass("ditty-item--current"),this.$currentItem=s,null===this.$lastItem&&(s.addClass("ditty-item--last"),this.$lastItem=s),this.settings.item=t,this.nextItem=this._getNextItem(t),"custom"!==i){var n=this._itemResetPosition(s);this._itemSetTransform(s,n),this.visibleItems.push({$item:s,itemId:this.settings.items[t].id,posX:n.posX,posY:n.posY}),this._setCurrentHeight()}return this.trigger("active_items_update"),s},_getNextItem:function(t){var i,e=this,s=!1;if(null!==this.nextItem&&t!==this.nextItem){var n=parseInt(this.nextItem);n<this.total&&n>=0&&e._isItemEnabled(n)&&(s=parseInt(this.nextItem))}if(!s)for(i=t;i<this.total;i++)if(i!==t&&e._isItemEnabled(i)){s=parseInt(i);break}if(!s)for(i=0;i<this.total;i++)if(e._isItemEnabled(i)){s=parseInt(i);break}return s},_itemShouldTerminate:function(t,i){var e=!1;switch(this.settings.direction){case"left":i.posX<-t.outerWidth()&&(e=!0);break;case"right":i.posX>this.$items.outerWidth()&&(e=!0);break;case"up":i.posY<-t.outerHeight()&&(e=!0);break;case"down":i.posY>this.$items.outerHeight()&&(e=!0)}return e},_terminateItem:function(t){var i=this.visibleItems[t].$item,e=i.next();i.remove(),this.visibleItems.splice(t,1),e.length&&(e.addClass("ditty-item--last"),this.$lastItem=e),this._setCurrentHeight(),this.trigger("active_items_update")},_setCurrentHeight:function(){var t=this.currentHeight;"up"===this.settings.direction||"down"===this.settings.direction?(t=this.$items.outerHeight(),this.$items.css({height:"100%"})):(t=0,$.each(this.visibleItems,(function(i,e){var s=e.$item.outerHeight();s>t&&(t=s)})),t!==this.currentHeight&&this.$items.stop().animate({height:t+"px"},1e3*parseFloat(this.settings.heightSpeed),this.settings.heightEase,(function(){}))),t!==this.currentHeight&&(this.currentHeight=t,this.trigger("height_updated"))},_itemSpacing:function(t){switch(this.settings.direction){case"left":case"right":t.css({paddingLeft:this.settings.spacing/2+"px",paddingRight:this.settings.spacing/2+"px",paddingTop:0,paddingBottom:0});break;case"up":case"down":t.css({paddingLeft:0,paddingRight:0,paddingTop:this.settings.spacing/2+"px",paddingBottom:this.settings.spacing/2+"px"})}},_itemSetTransform:function(t,i){var e=i.posX,s=i.posY;0!==e&&(e+="px"),0!==s&&(s+="px"),t.css({transform:"translate( "+e+", "+s+" )"})},_calculateItemPosition:function(t,i){var e=0,s=0,n=parseFloat(this.settings.speed)*this.scrollPercent;switch(i&&(n=i),this.settings.direction){case"left":e=parseFloat(this.visibleItems[t].posX)-n;break;case"right":e=parseFloat(this.visibleItems[t].posX)+n;break;case"up":s=parseFloat(this.visibleItems[t].posY)-n;break;case"down":s=parseFloat(this.visibleItems[t].posY)+n}return{posX:e,posY:s}},_itemResetPosition:function(t){var i=0,e=0;switch(this.settings.direction){case"left":i=this.$items.outerWidth();break;case"right":i="-"+t.outerWidth();break;case"up":e=this.$items.outerHeight();break;case"down":e="-"+t.outerHeight()}return{posX:i,posY:e}},_reverseItems:function(){if(this.$currentItem===this.$lastItem)return!1;var t=this.$currentItem,i=this.$lastItem;this.$currentItem=i,this.$lastItem=t,this.$currentItem.removeClass("ditty-item--last").addClass("ditty-item--current"),this.$lastItem.removeClass("ditty-item--current").addClass("ditty-item--last");var e=this.$items.children(".ditty-item");this.$items.append(e.get().reverse())},_resetItems:function(){this.$items.empty(),this.visibleItems=[],this.trigger("active_items_update")},_fillTicker:function(){var t=this,i=parseFloat(this.$items.outerWidth()),e=parseFloat(this.$items.outerHeight()),s=0,n=0,r=!1,h=this.settings.item,o=null;this._isItemEnabled(h)||(h=this._getNextItem(h)),"right"===this.settings.direction?s=i:"down"===this.settings.direction&&(n=e),o=setInterval((function(){var a=t._initializeItem(h);if(a){var l=t._filledItemInit(h,a,s,n,i,e);s=l.posX,n=l.posY,r=l.filled,h=t._getNextItem(h)}else r=!0;r&&(clearInterval(o),t.trigger("active_items_update"),setTimeout((function(){t.running||t._timerStart()}),1e3*parseFloat(t.settings.scrollDelay)))}),100)},_filledItemInit:function(t,i,e,s,n,r){var h=i.data("id"),o=parseFloat(i.outerWidth()),a=parseFloat(i.outerHeight()),l=0,d=0,m=!1;switch(i.css({display:"block",opacity:0}),this.settings.direction){case"left":l=e,this._itemSetTransform(i,{posX:l,posY:s}),(e+=o)>n&&(m=!0);break;case"right":l=e-=o,this._itemSetTransform(i,{posX:l,posY:s}),e<0&&(m=!0);break;case"up":d=s,this._itemSetTransform(i,{posX:e,posY:d}),(s+=a)>r&&(m=!0);break;case"down":d=s-=a,this._itemSetTransform(i,{posX:e,posY:d}),s<0&&(m=!0)}return i.stop().animate({opacity:1},1e3,"linear",(function(){})),this.visibleItems.push({$item:i,itemId:h,posX:l,posY:d}),this._setCurrentHeight(),{posX:e,posY:s,filled:m}},_setDirection:function(t){return!!$.inArray(t,this.settings.directions)&&(t!==this.settings.directions&&(this.settings.direction=t,this._timerStop(),this._resetItems(),this.settings.item=0,this._initializeItems(),void this.trigger("direction")))},_styleDisplay:function(){if(this.$elmt.css({maxWidth:this.settings.maxWidth,backgroundColor:this.settings.bgColor,borderColor:this.settings.borderColor,borderStyle:this.settings.borderStyle}),this.$elmt.css(this.settings.padding),this.$elmt.css(this.settings.margin),this.$elmt.css(this.settings.borderRadius),this.$contents.css({backgroundColor:this.settings.contentsBgColor,borderColor:this.settings.contentsBorderColor,borderStyle:this.settings.contentsBorderStyle}),this.$contents.css(this.settings.contentsPadding),this.$contents.css(this.settings.contentsBorderRadius),this.$contents.css(this.settings.contentsBorderWidth),"up"===this.settings.direction||"down"===this.settings.direction){var t=this.settings.minHeight?this.settings.minHeight:0,i=this.settings.maxHeight?this.settings.maxHeight:"none";this.$items.css({minHeight:t,maxHeight:i})}else this.$items.css({minHeight:"",maxHeight:""})},_styleTitle:function(){if(this.$elmt.attr("data-title",this.settings.titleDisplay),this.$elmt.attr("data-title_position",this.settings.titleElementPosition),"none"===this.settings.titleDisplay)this.$title.remove();else{var t=$("<"+this.settings.titleElement+' class="ditty-ticker__title__element">'+this.settings.title+"</"+this.settings.titleElement+">");t.css({fontSize:this.settings.titleFontSize,lineHeight:this.settings.titleLineHeight,color:this.settings.titleColor,margin:0,padding:0}),this.$title.css({backgroundColor:this.settings.titleBgColor,borderColor:this.settings.titleBorderColor,borderStyle:this.settings.titleBorderStyle}),this.$title.css(this.settings.titleMargin),this.$title.css(this.settings.titlePadding),this.$title.css(this.settings.titleBorderRadius),this.$title.css(this.settings.titleBorderWidth),this.$titleContents.html(t),this.$elmt.prepend(this.$title)}},_styleItem:function(t){t.children(".ditty-item__elements").css({color:this.settings.itemTextColor,backgroundColor:this.settings.itemBgColor,borderColor:this.settings.itemBorderColor,borderStyle:this.settings.itemBorderStyle}),t.children(".ditty-item__elements").css(this.settings.itemPadding),t.children(".ditty-item__elements").css(this.settings.itemBorderRadius),t.children(".ditty-item__elements").css(this.settings.itemBorderWidth),""!==this.settings.itemElementsWrap&&t.children(".ditty-item__elements").css({whiteSpace:this.settings.itemElementsWrap}),""!==this.settings.itemMaxWidth&&t.children(".ditty-item__elements").css({maxWidth:this.settings.itemMaxWidth})},_getOption:function(t){switch(t){case"ditty":return this;case"type":return this.displayType;case"display":return this.settings.display;case"items":return this.settings.items;case"height":return this.currentHeight;default:return this.settings[t]}},_setOption:function(t,i){if(void 0===i)return!1;switch(t){case"items":this.updateItems(i);break;case"direction":this.settings[t]=i,this._styleDisplay(),this._setDirection(i);break;case"titleDisplay":case"titleElement":case"titleElementPosition":case"titleFontSize":case"titleLineHeight":case"titleColor":case"titleBgColor":case"titleMargin":case"titlePadding":case"titleBorderColor":case"titleBorderStyle":case"titleBorderWidth":case"titleBorderRadius":this.settings[t]=i,this._styleTitle();break;case"minHeight":case"maxHeight":case"bgColor":case"padding":case"borderColor":case"borderStyle":case"borderWidth":case"borderRadius":case"contentsBgColor":case"contentsPadding":case"contentsBorderRadius":this.settings[t]=i,this._styleDisplay(),this._setCurrentHeight();break;default:this.settings[t]=i}this.trigger("update")},shuffle:function(){for(var t,i,e=this.total-1;e>0;e--)i=Math.floor(Math.random()*(e+1)),t=this.settings.items[e],this.settings.items[e]=this.settings.items[i],this.settings.items[i]=t},play:function(){this.running||this._timerStart()},pause:function(){this.running&&this._timerStop()},direction:function(t){this._setDirection(t)},toggle:function(){this.running?this.pause():this.play()},running:function(){return this.running},current:function(){return this.$currentItem},_isItemEnabled:function(t){return void 0!==this.settings.items[parseInt(t)]&&(void 0===this.settings.items[parseInt(t)].is_disabled||!(this.settings.items[parseInt(t)].is_disabled.length>0))},_disabledItemsStatus:function(){var t=this,i={};return $.each(this.settings.items,(function(e,s){t._isItemEnabled(e)?i[s.id]="enabled":i[s.id]="disabled"})),i},addItemDisabled:function(t,i){var e=this;$.each(this.settings.items,(function(s,n){String(n.id)===String(t)&&($.isArray(e.settings.items[s].is_disabled)||(e.settings.items[s].is_disabled=[]),e.settings.items[s].is_disabled.push(i))})),this.trigger("disabled_items_update")},removeItemDisabled:function(t,i){var e=this;$.each(this.settings.items,(function(s,n){String(n.id)===String(t)&&$.isArray(e.settings.items[s].is_disabled)&&e.settings.items[s].is_disabled.length&&(e.settings.items[s].is_disabled=$.grep(e.settings.items[s].is_disabled,(function(t){return t!==i})))})),this.trigger("disabled_items_update")},showItem:function(t){var i=[];if($.each(this.settings.items,(function(e,s){String(s.id)===String(t)&&i.push(e)})),0!==i.length)return this.nextItem=i[0],this.nextItem},addItem:function(t,i,e){var s=this.settings.items.slice(),n=!0;(i>=this.total||i<0)&&(n=!1),"replace"===e&&n?s.splice(i,1,t):null===i||""===i?s.splice(this.nextItem,0,t):i>=this.total?s.push(t):i<0?s.splice(0,0,t):s.splice(i,0,t),this.updateItems(s)},deleteItem:function(t){var i=[];$.each(this.settings.items,(function(e,s){String(s.id)!==String(t)&&i.push(s)})),this.updateItems(i)},updateItems:function(t,i,e,s){if(void 0===t)return!1;var n=[];if(i){var r=this.settings.items.slice(),h=[],o=!1;$.each(r,(function(s,r){String(r.id)===String(i)?"after"===e?(h.push(r),$.each(t,(function(t,i){h.push(i)})),o=!0):"before"===e?($.each(t,(function(t,i){h.push(i)})),h.push(r),o=!0):o||($.each(t,(function(t,i){h.push(i),n.push(String(i.uniq_id))})),o=!0):h.push(r)})),o||($.each(this.settings.items,(function(t,i){h.push(i)})),o=!0),0!==this.total&&(t=h)}this.settings.items=t,this.total=t.length,0===this.total?this.hide():this.show(),this.nextItem>=this.total&&(this.nextItem=0),this.trigger("update")},getActiveItems:function(){var t=[];return $.each(this.visibleItems,(function(i,e){t.push({id:e.itemId})})),t},hide:function(){this.$elmt.hide(),this.pause()},show:function(){this.$elmt.show(),this.play()},trigger:function(t){var i=[];switch(t){case"active_items_update":i=[this,this.getActiveItems()];break;case"disabled_items_update":i=[this._disabledItemsStatus()];break;case"height_updated":i=[this.currentHeight,this.$elmt];break;case"start_live_updates":i=[this.settings.id];break;default:i=[this.settings,this.$elmt]}this.$elmt.trigger("ditty_"+t,i),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,i),$("body").trigger("ditty_"+t,i)},options:function(t,i){var e=this;if("object"==typeof t)$.each(t,(function(t,i){e._setOption(t,i)}));else{if("string"!=typeof t)return e.settings;if(void 0===i)return e._getOption(t);e._setOption(t,i)}},destroy:function(){this.$elmt.off("mouseenter",{self:this},this._mouseenter),this.$elmt.off("mouseleave",{self:this},this._mouseleave),cancelAnimationFrame(this.interval),this.$elmt.removeClass("ditty ditty-ticker"),this.$elmt.removeAttr("data-id"),this.$elmt.removeAttr("data-type"),this.$elmt.removeAttr("data-display"),this.$elmt.removeAttr("style"),this.$elmt.empty(),this.elmt._ditty_ticker=null}},$.fn.ditty_ticker=function(t){var e,s=arguments,n=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_ticker||(this._ditty_ticker=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_ticker;if(!i)throw new Error("No Ditty_Ticker applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):n=!0})),n)throw new Error('No method "'+t+'" in Ditty_Ticker.');return void 0!==e?e:this}},$.ditty_ticker={},$.ditty_ticker.defaults=t}(jQuery);
1
+ !function($){"use strict";var t={id:0,title:"",display:0,status:"",direction:"left",spacing:20,speed:10,cloneItems:"yes",hoverPause:0,height:null,minHeight:null,maxHeight:null,heightEase:"easeInOutQuint",heightSpeed:1.5,scrollInit:"empty",scrollDelay:2,maxWidth:"",bgColor:"",padding:{},margin:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},contentsBgColor:"",contentsPadding:{},contentsBorderColor:{},contentsBorderStyle:{},contentsBorderWidth:{},contentsBorderRadius:{},titleDisplay:"none",titleElement:"h3",titleElementPosition:"topLeft",titleFontSize:"",titleLineHeight:"",titleColor:"",titleBgColor:"",titleMargin:{},titlePadding:{},titleBorderColor:{},titleBorderStyle:{},titleBorderWidth:{},titleBorderRadius:{},itemTextColor:"",itemBgColor:"",itemBorderColor:{},itemBorderStyle:{},itemBorderWidth:{},itemBorderRadius:{},itemPadding:{},itemMaxWidth:"",itemElementsWrap:"wrap",item:0,shuffle:0,showEditor:0,items:[]},i=function(i,e){this.displayType="ticker",this.elmt=i,this.settings=$.extend({},t,$.ditty_ticker.defaults,e),this.nextItem=null,this.total=this.settings.items.length,this.$elmt=$(i),this.$title=null,this.$titleContents=null,this.$contents=null,this.$items=null,this.$currentItem=null,this.$lastItem=null,this.scrollPercent=.13,this.running=!1,this.interval=!1,this.currentHeight=this.settings.height,this.visibleItems=[],1===parseInt(this.settings.shuffle)&&this.shuffle(),this._init()};i.prototype={_init:function(){var t,i,e=this;0===this.total&&this.hide(),this.$elmt.removeClass("ditty--pre"),this.$elmt.addClass("ditty ditty-ticker"),this.$elmt.attr("data-id",this.settings.id),this.$elmt.attr("data-type",this.displayType),this.$elmt.attr("data-display",this.settings.display),t=$('<div class="ditty-ticker__contents"></div>'),this.$contents=t,this.$title=$('<div class="ditty-ticker__title"></div>'),this.$titleContents=$('<div class="ditty-ticker__title__contents"></div>'),this.$title.append(this.$titleContents),i=$('<div class="ditty-ticker__items"></div>'),this.$items=i,this.$items.height(this.currentHeight),t.append(i),this.$elmt.append(t),this._styleDisplay(),this._styleTitle(),this.$elmt.on("mouseenter",{self:this},this._mouseenter),this.$elmt.on("mouseleave",{self:this},this._mouseleave),this.settings.showEditor?dittyEditorInit(this):this.trigger("start_live_updates"),setTimeout((function(){for(var t=0;t<e.total;t++)e._preloadItem(e.settings.items[t]);e._initializeItems(),e.trigger("init")}),1)},_initializeItems:function(){"filled"===this.settings.scrollInit?this._fillTicker():this.running||this._timerStart()},_preloadItem:function(t){$(t.html).find("img").each((function(){(new Image).src=$(this).attr("src")}))},_positionItems:function(t){var i=this;if(0===i.visibleItems.length){var e=i.settings.item;this._isItemEnabled(e)||(e=this._getNextItem(e)),i._initializeItem(e)}$.each(i.visibleItems,(function(e,s){if(s){var n=i.visibleItems[e].$item,r=i._calculateItemPosition(e,t);i.visibleItems[e].posX=r.posX,i.visibleItems[e].posY=r.posY,i._itemSetTransform(n,r),i._newItemShouldStart(n,r)&&i._initializeItem(parseInt(i.nextItem)),i._itemShouldTerminate(n,r)&&i._terminateItem(e)}}))},_timerStart:function(){var t=this;this.running=!0,this.trigger("start"),cancelAnimationFrame(this.interval),t.interval=requestAnimationFrame((function i(){t._positionItems(),t.interval=requestAnimationFrame(i)}))},_timerStop:function(){cancelAnimationFrame(this.interval),this.running=!1,this.trigger("stop")},_mouseenter:function(t){var i=t.data.self;i.settings.hoverPause&&i._timerStop()},_mouseleave:function(t){var i=t.data.self;i.settings.hoverPause&&i._timerStart()},_newItemShouldStart:function(t,i){if(this.$currentItem[0]!==t[0])return!1;var e=!1;switch(this.settings.direction){case"left":i.posX<=this.$items.outerWidth()-t.outerWidth()&&(e=!0);break;case"right":i.posX>=0&&(e=!0);break;case"down":i.posY>=0&&(e=!0);break;case"up":i.posY<=this.$items.outerHeight()-t.outerHeight()&&(e=!0)}return e},_initializeItem:function(t,i){if(void 0===this.settings.items[t])return!1;var e=this.$items.children(".ditty-item--"+this.settings.items[t].uniq_id);if("yes"!==this.settings.cloneItems&&e.length)return!1;var s=$(this.settings.items[t].html);if(s.css({top:0,left:0}),this.$items.children(".ditty-item--"+this.settings.items[t].id).not(".ditty-item--clone").length>0&&s.addClass("ditty-item--clone"),this._styleItem(s),this.settings.items[t].css&&dittyLayoutCss(this.settings.items[t].css,this.settings.items[t].layout_id),this._itemSpacing(s),this._itemSetTransform(s,this._itemResetPosition(s)),this.$items.append(s),s.css({display:"block",top:0,left:0,opacity:1}),s.addClass("ditty-item--current"),null!==this.$currentItem&&this.$currentItem.removeClass("ditty-item--current"),this.$currentItem=s,null===this.$lastItem&&(s.addClass("ditty-item--last"),this.$lastItem=s),this.settings.item=t,this.nextItem=this._getNextItem(t),"custom"!==i){var n=this._itemResetPosition(s);this._itemSetTransform(s,n),this.visibleItems.push({$item:s,itemId:this.settings.items[t].id,posX:n.posX,posY:n.posY}),this._setCurrentHeight()}return this.trigger("active_items_update"),s},_getNextItem:function(t){var i,e=this,s=!1;if(null!==this.nextItem&&t!==this.nextItem){var n=parseInt(this.nextItem);n<this.total&&n>=0&&e._isItemEnabled(n)&&(s=parseInt(this.nextItem))}if(!s)for(i=t;i<this.total;i++)if(i!==t&&e._isItemEnabled(i)){s=parseInt(i);break}if(!s)for(i=0;i<this.total;i++)if(e._isItemEnabled(i)){s=parseInt(i);break}return s},_itemShouldTerminate:function(t,i){var e=!1;switch(this.settings.direction){case"left":i.posX<-t.outerWidth()&&(e=!0);break;case"right":i.posX>this.$items.outerWidth()&&(e=!0);break;case"up":i.posY<-t.outerHeight()&&(e=!0);break;case"down":i.posY>this.$items.outerHeight()&&(e=!0)}return e},_terminateItem:function(t){var i=this.visibleItems[t].$item,e=i.next();i.remove(),this.visibleItems.splice(t,1),e.length&&(e.addClass("ditty-item--last"),this.$lastItem=e),this._setCurrentHeight(),this.trigger("active_items_update")},_setCurrentHeight:function(){var t=this.currentHeight;"up"===this.settings.direction||"down"===this.settings.direction?(t=this.$items.outerHeight(),this.$items.css({height:"100%"})):(t=0,$.each(this.visibleItems,(function(i,e){var s=e.$item.outerHeight();s>t&&(t=s)})),t!==this.currentHeight&&this.$items.stop().animate({height:t+"px"},1e3*parseFloat(this.settings.heightSpeed),this.settings.heightEase,(function(){}))),t!==this.currentHeight&&(this.currentHeight=t,this.trigger("height_updated"))},_itemSpacing:function(t){switch(this.settings.direction){case"left":case"right":t.css({paddingLeft:this.settings.spacing/2+"px",paddingRight:this.settings.spacing/2+"px",paddingTop:0,paddingBottom:0});break;case"up":case"down":t.css({paddingLeft:0,paddingRight:0,paddingTop:this.settings.spacing/2+"px",paddingBottom:this.settings.spacing/2+"px"})}},_itemSetTransform:function(t,i){var e=i.posX,s=i.posY;0!==e&&(e+="px"),0!==s&&(s+="px"),t.css({transform:"translate( "+e+", "+s+" )"})},_calculateItemPosition:function(t,i){var e=0,s=0,n=parseFloat(this.settings.speed)*this.scrollPercent;switch(i&&(n=i),this.settings.direction){case"left":e=parseFloat(this.visibleItems[t].posX)-n;break;case"right":e=parseFloat(this.visibleItems[t].posX)+n;break;case"up":s=parseFloat(this.visibleItems[t].posY)-n;break;case"down":s=parseFloat(this.visibleItems[t].posY)+n}return{posX:e,posY:s}},_itemResetPosition:function(t){var i=0,e=0;switch(this.settings.direction){case"left":i=this.$items.outerWidth();break;case"right":i="-"+t.outerWidth();break;case"up":e=this.$items.outerHeight();break;case"down":e="-"+t.outerHeight()}return{posX:i,posY:e}},_reverseItems:function(){if(this.$currentItem===this.$lastItem)return!1;var t=this.$currentItem,i=this.$lastItem;this.$currentItem=i,this.$lastItem=t,this.$currentItem.removeClass("ditty-item--last").addClass("ditty-item--current"),this.$lastItem.removeClass("ditty-item--current").addClass("ditty-item--last");var e=this.$items.children(".ditty-item");this.$items.append(e.get().reverse())},_resetItems:function(){this.$items.empty(),this.visibleItems=[],this.trigger("active_items_update")},_fillTicker:function(){var t=this,i=parseFloat(this.$items.outerWidth()),e=parseFloat(this.$items.outerHeight()),s=0,n=0,r=!1,h=this.settings.item,o=null;this._isItemEnabled(h)||(h=this._getNextItem(h)),"right"===this.settings.direction?s=i:"down"===this.settings.direction&&(n=e),o=setInterval((function(){var a=t._initializeItem(h);if(a){var l=t._filledItemInit(h,a,s,n,i,e);s=l.posX,n=l.posY,r=l.filled,h=t._getNextItem(h)}else r=!0;r&&(clearInterval(o),t.trigger("active_items_update"),setTimeout((function(){t.running||t._timerStart()}),1e3*parseFloat(t.settings.scrollDelay)))}),100)},_filledItemInit:function(t,i,e,s,n,r){var h=i.data("id"),o=parseFloat(i.outerWidth()),a=parseFloat(i.outerHeight()),l=0,d=0,m=!1;switch(i.css({display:"block",opacity:0}),this.settings.direction){case"left":l=e,this._itemSetTransform(i,{posX:l,posY:s}),(e+=o)>n&&(m=!0);break;case"right":l=e-=o,this._itemSetTransform(i,{posX:l,posY:s}),e<0&&(m=!0);break;case"up":d=s,this._itemSetTransform(i,{posX:e,posY:d}),(s+=a)>r&&(m=!0);break;case"down":d=s-=a,this._itemSetTransform(i,{posX:e,posY:d}),s<0&&(m=!0)}return i.stop().animate({opacity:1},1e3,"linear",(function(){})),this.visibleItems.push({$item:i,itemId:h,posX:l,posY:d}),this._setCurrentHeight(),{posX:e,posY:s,filled:m}},_setDirection:function(t){return!!$.inArray(t,this.settings.directions)&&(t!==this.settings.directions&&(this.settings.direction=t,this._timerStop(),this._resetItems(),this.settings.item=0,this._initializeItems(),void this.trigger("direction")))},_styleDisplay:function(){if(this.$elmt.css({maxWidth:this.settings.maxWidth,backgroundColor:this.settings.bgColor,borderColor:this.settings.borderColor,borderStyle:this.settings.borderStyle}),this.$elmt.css(this.settings.borderRadius),this.$elmt.css(this.settings.borderWidth),this.$elmt.css(this.settings.margin),this.$elmt.css(this.settings.padding),this.$contents.css({backgroundColor:this.settings.contentsBgColor,borderColor:this.settings.contentsBorderColor,borderStyle:this.settings.contentsBorderStyle}),this.$contents.css(this.settings.contentsPadding),this.$contents.css(this.settings.contentsBorderRadius),this.$contents.css(this.settings.contentsBorderWidth),"up"===this.settings.direction||"down"===this.settings.direction){var t=this.settings.minHeight?this.settings.minHeight:0,i=this.settings.maxHeight?this.settings.maxHeight:"none";this.$items.css({minHeight:t,maxHeight:i})}else this.$items.css({minHeight:"",maxHeight:""})},_styleTitle:function(){if(this.$elmt.attr("data-title",this.settings.titleDisplay),this.$elmt.attr("data-title_position",this.settings.titleElementPosition),"none"===this.settings.titleDisplay)this.$title.remove();else{var t=$("<"+this.settings.titleElement+' class="ditty-ticker__title__element">'+this.settings.title+"</"+this.settings.titleElement+">");t.css({fontSize:this.settings.titleFontSize,lineHeight:this.settings.titleLineHeight,color:this.settings.titleColor,margin:0,padding:0}),this.$title.css({backgroundColor:this.settings.titleBgColor,borderColor:this.settings.titleBorderColor,borderStyle:this.settings.titleBorderStyle}),this.$title.css(this.settings.titleMargin),this.$title.css(this.settings.titlePadding),this.$title.css(this.settings.titleBorderRadius),this.$title.css(this.settings.titleBorderWidth),this.$titleContents.html(t),this.$elmt.prepend(this.$title)}},_styleItem:function(t){t.children(".ditty-item__elements").css({color:this.settings.itemTextColor,backgroundColor:this.settings.itemBgColor,borderColor:this.settings.itemBorderColor,borderStyle:this.settings.itemBorderStyle}),t.children(".ditty-item__elements").css(this.settings.itemPadding),t.children(".ditty-item__elements").css(this.settings.itemBorderRadius),t.children(".ditty-item__elements").css(this.settings.itemBorderWidth),""!==this.settings.itemElementsWrap&&t.children(".ditty-item__elements").css({whiteSpace:this.settings.itemElementsWrap}),""!==this.settings.itemMaxWidth&&t.children(".ditty-item__elements").css({maxWidth:this.settings.itemMaxWidth})},_getOption:function(t){switch(t){case"ditty":return this;case"type":return this.displayType;case"display":return this.settings.display;case"items":return this.settings.items;case"height":return this.currentHeight;default:return this.settings[t]}},_setOption:function(t,i){if(void 0===i)return!1;switch(t){case"items":this.updateItems(i);break;case"direction":this.settings[t]=i,this._styleDisplay(),this._setDirection(i);break;case"titleDisplay":case"titleElement":case"titleElementPosition":case"titleFontSize":case"titleLineHeight":case"titleColor":case"titleBgColor":case"titleMargin":case"titlePadding":case"titleBorderColor":case"titleBorderStyle":case"titleBorderWidth":case"titleBorderRadius":this.settings[t]=i,this._styleTitle();break;case"minHeight":case"maxHeight":case"bgColor":case"padding":case"borderColor":case"borderStyle":case"borderWidth":case"borderRadius":case"contentsBgColor":case"contentsPadding":case"contentsBorderRadius":this.settings[t]=i,this._styleDisplay(),this._setCurrentHeight();break;default:this.settings[t]=i}this.trigger("update")},shuffle:function(){for(var t,i,e=this.total-1;e>0;e--)i=Math.floor(Math.random()*(e+1)),t=this.settings.items[e],this.settings.items[e]=this.settings.items[i],this.settings.items[i]=t},play:function(){this.running||this._timerStart()},pause:function(){this.running&&this._timerStop()},direction:function(t){this._setDirection(t)},toggle:function(){this.running?this.pause():this.play()},running:function(){return this.running},current:function(){return this.$currentItem},_isItemEnabled:function(t){return void 0!==this.settings.items[parseInt(t)]&&(void 0===this.settings.items[parseInt(t)].is_disabled||!(this.settings.items[parseInt(t)].is_disabled.length>0))},_disabledItemsStatus:function(){var t=this,i={};return $.each(this.settings.items,(function(e,s){t._isItemEnabled(e)?i[s.id]="enabled":i[s.id]="disabled"})),i},addItemDisabled:function(t,i){var e=this;$.each(this.settings.items,(function(s,n){String(n.id)===String(t)&&($.isArray(e.settings.items[s].is_disabled)||(e.settings.items[s].is_disabled=[]),e.settings.items[s].is_disabled.push(i))})),this.trigger("disabled_items_update")},removeItemDisabled:function(t,i){var e=this;$.each(this.settings.items,(function(s,n){String(n.id)===String(t)&&$.isArray(e.settings.items[s].is_disabled)&&e.settings.items[s].is_disabled.length&&(e.settings.items[s].is_disabled=$.grep(e.settings.items[s].is_disabled,(function(t){return t!==i})))})),this.trigger("disabled_items_update")},showItem:function(t){var i=[];if($.each(this.settings.items,(function(e,s){String(s.id)===String(t)&&i.push(e)})),0!==i.length)return this.nextItem=i[0],this.nextItem},addItem:function(t,i,e){var s=this.settings.items.slice(),n=!0;(i>=this.total||i<0)&&(n=!1),"replace"===e&&n?s.splice(i,1,t):null===i||""===i?s.splice(this.nextItem,0,t):i>=this.total?s.push(t):i<0?s.splice(0,0,t):s.splice(i,0,t),this.updateItems(s)},deleteItem:function(t){var i=[];$.each(this.settings.items,(function(e,s){String(s.id)!==String(t)&&i.push(s)})),this.updateItems(i)},updateItems:function(t,i,e,s){if(void 0===t)return!1;var n=[];if(i){var r=this.settings.items.slice(),h=[],o=!1;$.each(r,(function(s,r){String(r.id)===String(i)?"after"===e?(h.push(r),$.each(t,(function(t,i){h.push(i)})),o=!0):"before"===e?($.each(t,(function(t,i){h.push(i)})),h.push(r),o=!0):o||($.each(t,(function(t,i){h.push(i),n.push(String(i.uniq_id))})),o=!0):h.push(r)})),o||($.each(this.settings.items,(function(t,i){h.push(i)})),o=!0),0!==this.total&&(t=h)}this.settings.items=t,this.total=t.length,0===this.total?this.hide():this.show(),this.nextItem>=this.total&&(this.nextItem=0),this.trigger("update")},getActiveItems:function(){var t=[];return $.each(this.visibleItems,(function(i,e){t.push({id:e.itemId})})),t},hide:function(){this.$elmt.hide(),this.pause()},show:function(){this.$elmt.show(),this.play()},trigger:function(t){var i=[];switch(t){case"active_items_update":i=[this,this.getActiveItems()];break;case"disabled_items_update":i=[this._disabledItemsStatus()];break;case"height_updated":i=[this.currentHeight,this.$elmt];break;case"start_live_updates":i=[this.settings.id];break;default:i=[this.settings,this.$elmt]}this.$elmt.trigger("ditty_"+t,i),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,i),$("body").trigger("ditty_"+t,i)},options:function(t,i){var e=this;if("object"==typeof t)$.each(t,(function(t,i){e._setOption(t,i)}));else{if("string"!=typeof t)return e.settings;if(void 0===i)return e._getOption(t);e._setOption(t,i)}},destroy:function(){this.$elmt.off("mouseenter",{self:this},this._mouseenter),this.$elmt.off("mouseleave",{self:this},this._mouseleave),cancelAnimationFrame(this.interval),this.$elmt.removeClass("ditty ditty-ticker"),this.$elmt.removeAttr("data-id"),this.$elmt.removeAttr("data-type"),this.$elmt.removeAttr("data-display"),this.$elmt.removeAttr("style"),this.$elmt.empty(),this.elmt._ditty_ticker=null}},$.fn.ditty_ticker=function(t){var e,s=arguments,n=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_ticker||(this._ditty_ticker=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_ticker;if(!i)throw new Error("No Ditty_Ticker applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):n=!0})),n)throw new Error('No method "'+t+'" in Ditty_Ticker.');return void 0!==e?e:this}},$.ditty_ticker={},$.ditty_ticker.defaults=t}(jQuery);
includes/js/ditty-editor-hooks.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /* global jQuery:true */
2
+ // @codekit-append 'editor_hooks/ditty-list-display-editor.js';
3
+ // @codekit-append 'editor_hooks/ditty-ticker-display-editor.js';
4
+ // @codekit-append 'editor_hooks/ditty-item-edit-editor.js';
includes/js/ditty-editor-hooks.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery((function($){!function(){"use strict";function i(i,t){0===parseInt(t)?i.hide():i.show()}function t(i,t){"none"===t?i.hide():i.show()}function n(i,t){"none"===t?i.hide():i.show()}$("#ditty-editor").on("ditty_display_editor_panel_init",".ditty-editor__panel--displayEditor",(function(e,d){if("list"===d.displayType){var o=d.$form,f=o.find(".ditty-field--perPage"),l=o.find(".ditty-field--arrows").siblings(),a=o.find(".ditty-field--bullets").siblings();i(f,o.find('input[name="paging"]:checked').val()),o.find('input[name="paging"]').on("change",(function(){i(f,$(this).val())})),t(l,o.find('select[name="arrows"]').val()),o.find('select[name="arrows"]').on("change",(function(){t(l,$(this).val())})),n(a,o.find('select[name="bullets"]').val()),o.find('select[name="bullets"]').on("change",(function(){n(a,$(this).val())}))}}))}()})),jQuery((function($){!function(){"use strict";function i(i,t){var n=i.find('input[name="direction"]:checked').val(),e=i.find(".ditty-field--minHeight"),d=i.find(".ditty-field--maxHeight"),o=i.find('input[name="minHeight"]');if("down"===n||"up"===n){if(e.show(),d.show(),""===o.val()){var f="300px";o.val(f),t.options("minHeight",f)}}else e.hide(),d.hide()}function t(i){"filled"===i.find('input[name="scrollInit"]:checked').val()?i.find(".ditty-field--scrollDelay").show():i.find(".ditty-field--scrollDelay").hide()}function n(i){var t=i.find('select[name="titleDisplay"]').val(),n=i.find(".ditty-field--titleDisplay");"none"===t?n.siblings().hide():n.siblings().show()}function e(e,d){i(e,d),e.find('input[name="direction"]').on("click",(function(){i(e,d)})),t(e),e.find('input[name="scrollInit"]').on("click",(function(){t(e)})),n(e),e.find('select[name="titleDisplay"]').on("change",(function(){n(e)}))}$("#ditty-editor").on("ditty_display_editor_panel_init",".ditty-editor__panel--displayEditor",(function(i,t){if("ticker"===t.displayType){var n=t.$form,d=n.parents("#ditty-editor__settings")[0];e(n,d._ditty_editor.ditty)}})),$(".ditty-sandbox").on("ditty_sandbox_init",(function(i,t,n){"ticker"===t.displayType&&e($(this).find("form"),n)}))}()})),jQuery((function($){!function(){"use strict";function i(i){"full"===i.find('input[name="content_display"]:checked').val()?(i.find(".ditty-field--more_link").hide(),i.find(".ditty-field--excerpt_length").hide(),i.find(".ditty-field--more").hide(),i.find(".ditty-field--more_before").hide(),i.find(".ditty-field--more_after").hide()):(i.find(".ditty-field--more_link").show(),i.find(".ditty-field--excerpt_length").show(),i.find(".ditty-field--more").show(),i.find(".ditty-field--more_before").show(),i.find(".ditty-field--more_after").show())}$("#ditty-editor").on("ditty_item_editor_panel_init",".ditty-editor__panel--item_editor",(function(t,n){if("posts_feed"!==n.itemType&&"post"!==n.itemType)return!1;var e=n.$form;i(e),e.on("click",'input[name="content_display"]',(function(){i(e)}))}))}()}));
includes/js/{editor → editor_hooks}/ditty-item-edit-editor.js RENAMED
File without changes
includes/js/{editor → editor_hooks}/ditty-list-display-editor.js RENAMED
@@ -1,5 +1,3 @@
1
- /* global dittyVars:true */
2
-
3
  jQuery( function( $ ) {
4
 
5
  // Setup strict mode
 
 
1
  jQuery( function( $ ) {
2
 
3
  // Setup strict mode
includes/js/{editor → editor_hooks}/ditty-ticker-display-editor.js RENAMED
@@ -1,5 +1,3 @@
1
- /* global dittyVars:true */
2
-
3
  jQuery( function( $ ) {
4
 
5
  // Setup strict mode
@@ -10,9 +8,9 @@ jQuery( function( $ ) {
10
  /**
11
  * Set the min height
12
  *
13
- * @since 3.0.13
14
  */
15
- function setMinHeight( $form ) {
16
  var val = $form.find( 'input[name="direction"]:checked' ).val(),
17
  $minHeight = $form.find( '.ditty-field--minHeight' ),
18
  $maxHeight = $form.find( '.ditty-field--maxHeight' ),
@@ -22,11 +20,10 @@ jQuery( function( $ ) {
22
  $minHeight.show();
23
  $maxHeight.show();
24
  if ( '' === $minHeightInput.val() ) {
25
- var dittyEditor = $form.parents( '#ditty-editor__settings' )[0],
26
- defaultValue = '300px';
27
 
28
  $minHeightInput.val( defaultValue );
29
- dittyEditor._ditty_editor.ditty.options( 'minHeight', defaultValue );
30
  }
31
  } else {
32
  $minHeight.hide();
@@ -63,30 +60,49 @@ jQuery( function( $ ) {
63
  $displayField.siblings().show();
64
  }
65
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  $( '#ditty-editor' ).on( 'ditty_display_editor_panel_init', '.ditty-editor__panel--displayEditor', function( e, editorPanel ) {
68
  if ( 'ticker' === editorPanel.displayType ) {
69
- var $form = editorPanel.$form;
70
-
71
- // Set minHeight
72
- setMinHeight( $form );
73
- $form.find( 'input[name="direction"]' ).on( 'click', function() {
74
- setMinHeight( $form );
75
- } );
76
-
77
- // Set scroll delay
78
- setScrollDelay( $form );
79
- $form.find( 'input[name="scrollInit"]' ).on( 'click', function() {
80
- setScrollDelay( $form );
81
- } );
82
-
83
- // Set the title styles
84
- setTitleStyles( $form );
85
- $form.find( 'select[name="titleDisplay"]' ).on( 'change', function() {
86
- setTitleStyles( $form );
87
- } );
88
  }
89
- } );
90
 
91
  }() );
92
 
 
 
1
  jQuery( function( $ ) {
2
 
3
  // Setup strict mode
8
  /**
9
  * Set the min height
10
  *
11
+ * @since 3.0.14
12
  */
13
+ function setMinHeight( $form, ditty ) {
14
  var val = $form.find( 'input[name="direction"]:checked' ).val(),
15
  $minHeight = $form.find( '.ditty-field--minHeight' ),
16
  $maxHeight = $form.find( '.ditty-field--maxHeight' ),
20
  $minHeight.show();
21
  $maxHeight.show();
22
  if ( '' === $minHeightInput.val() ) {
23
+ var defaultValue = '300px';
 
24
 
25
  $minHeightInput.val( defaultValue );
26
+ ditty.options( 'minHeight', defaultValue );
27
  }
28
  } else {
29
  $minHeight.hide();
60
  $displayField.siblings().show();
61
  }
62
  }
63
+
64
+ /**
65
+ * Set the title field visibility
66
+ *
67
+ * @since 3.0.14
68
+ */
69
+ function initEditorHooks( $form, ditty ) {
70
+
71
+ // Set minHeight
72
+ setMinHeight( $form, ditty );
73
+ $form.find( 'input[name="direction"]' ).on( 'click', function() {
74
+ setMinHeight( $form, ditty );
75
+ } );
76
+
77
+ // Set scroll delay
78
+ setScrollDelay( $form );
79
+ $form.find( 'input[name="scrollInit"]' ).on( 'click', function() {
80
+ setScrollDelay( $form );
81
+ } );
82
+
83
+ // Set the title styles
84
+ setTitleStyles( $form );
85
+ $form.find( 'select[name="titleDisplay"]' ).on( 'change', function() {
86
+ setTitleStyles( $form );
87
+ } );
88
+ }
89
 
90
  $( '#ditty-editor' ).on( 'ditty_display_editor_panel_init', '.ditty-editor__panel--displayEditor', function( e, editorPanel ) {
91
  if ( 'ticker' === editorPanel.displayType ) {
92
+ var $form = editorPanel.$form,
93
+ dittyEditor = $form.parents( '#ditty-editor__settings' )[0],
94
+ ditty = dittyEditor._ditty_editor.ditty;
95
+
96
+ initEditorHooks( $form, ditty );
97
+ }
98
+ } );
99
+
100
+ $( '.ditty-sandbox' ).on( 'ditty_sandbox_init', function( e, settings, ditty ) {
101
+ if ( 'ticker' === settings.displayType ) {
102
+ var $form = $( this ).find( 'form' );
103
+ initEditorHooks( $form, ditty );
 
 
 
 
 
 
 
104
  }
105
+ } );
106
 
107
  }() );
108
 
includes/sass/ditty-admin.scss CHANGED
@@ -2,7 +2,6 @@
2
  @import "partials/colors_2";
3
  @import "partials/mixins";
4
  @import "admin/dashboard";
5
- @import "admin/fields";
6
  @import "admin/datepicker";
7
  @import "admin/extensions";
8
  @import "admin/extensions-app";
2
  @import "partials/colors_2";
3
  @import "partials/mixins";
4
  @import "admin/dashboard";
 
5
  @import "admin/datepicker";
6
  @import "admin/extensions";
7
  @import "admin/extensions-app";
includes/sass/ditty.scss CHANGED
@@ -1,6 +1,7 @@
1
  @import "partials/colors";
2
  @import "partials/colors_2";
3
  @import "partials/mixins";
 
4
  @import "partials/metabox";
5
  @import "partials/general";
6
  @import "partials/slider";
1
  @import "partials/colors";
2
  @import "partials/colors_2";
3
  @import "partials/mixins";
4
+ @import "partials/fields";
5
  @import "partials/metabox";
6
  @import "partials/general";
7
  @import "partials/slider";
includes/sass/editor/_displays_panel.scss CHANGED
@@ -32,21 +32,15 @@
32
  -webkit-overflow-scrolling: touch;
33
  }
34
  }
35
- #ditty-editor__settings .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field {
36
- &.ditty-field--minHeight {
37
- width: 50%;
38
- padding-right: 7.5px;
39
- }
40
- &.ditty-field--maxHeight {
41
- width: 50%;
42
- padding-left: 7.5px;
43
- }
44
  &.ditty-field--titleFontSize {
45
- width: 50%;
46
- padding-right: 7.5px;
47
  }
 
48
  &.ditty-field--titleLineHeight {
49
- width: 50%;
50
- padding-left: 7.5px;
51
  }
52
  }
32
  -webkit-overflow-scrolling: touch;
33
  }
34
  }
35
+ .ditty-display-type-options--ticker .ditty-input--group__container > .ditty-field {
36
+ &.ditty-field--minHeight,
 
 
 
 
 
 
 
37
  &.ditty-field--titleFontSize {
38
+ width: 50% !important;
39
+ padding-right: 7.5px !important;
40
  }
41
+ &.ditty-field--maxHeight,
42
  &.ditty-field--titleLineHeight {
43
+ width: 50% !important;
44
+ padding-left: 7.5px !important;
45
  }
46
  }
includes/sass/{admin → partials}/_fields.scss RENAMED
@@ -7,8 +7,8 @@
7
  }
8
 
9
  .ditty-field {
10
- //padding: 15px;
11
- padding: 10px 0;
12
  border-bottom: 1px solid rgba( 0, 0, 0, .05 );
13
  &:last-of-type {
14
  border-bottom: none;
@@ -25,8 +25,9 @@
25
  }
26
  &__help {
27
  display: none;
28
- margin: 7px 0 10px;
29
- //font-size: 0.8em;
 
30
  }
31
  &__input {
32
  display: flex;
@@ -51,6 +52,8 @@
51
  }
52
  &__description {
53
  width: 100%;
 
 
54
  }
55
  input:not([type="button"]):not([type="checkbox"]):not([type="radio"]),
56
  select,
@@ -122,7 +125,7 @@
122
  }
123
  .ditty-field__label + .ditty-field__description,
124
  .ditty-field__help + .ditty-field__description {
125
- margin-top: 7px;
126
  }
127
  .ditty-field--clone-enabled {
128
  .ditty-input--clone {
@@ -189,7 +192,7 @@
189
  }
190
  .ditty-field__help,
191
  .ditty-field__desciption {
192
- margin-bottom: 0;
193
  }
194
  }
195
  .ditty-field__collapsible-toggle {
@@ -255,6 +258,10 @@
255
  display: block;
256
  margin-top: 2px;
257
  margin-bottom: 5px;
 
 
 
 
258
  }
259
  &--inline {
260
  flex-direction: row;
@@ -271,8 +278,15 @@
271
  }
272
  }
273
  .ditty-field-type--checkbox {
274
- input[type="checkbox"] {
275
- margin-top: 0;
 
 
 
 
 
 
 
276
  }
277
  }
278
 
@@ -301,9 +315,19 @@
301
  }
302
  }
303
  &__option {
304
- display: block;
 
 
305
  margin-top: 2px;
306
  margin-bottom: 5px;
 
 
 
 
 
 
 
 
307
  }
308
  }
309
  }
@@ -653,6 +677,8 @@
653
  margin-bottom: 0;
654
  }
655
  .ditty-field__description {
 
 
656
  margin-bottom: 0;
657
  }
658
  }
7
  }
8
 
9
  .ditty-field {
10
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif !important;
11
+ padding: 15px;
12
  border-bottom: 1px solid rgba( 0, 0, 0, .05 );
13
  &:last-of-type {
14
  border-bottom: none;
25
  }
26
  &__help {
27
  display: none;
28
+ font-size: 13px;
29
+ line-height: 16px;
30
+ margin: 7px 0 10px !important;
31
  }
32
  &__input {
33
  display: flex;
52
  }
53
  &__description {
54
  width: 100%;
55
+ font-size: 13px;
56
+ line-height: 16px;
57
  }
58
  input:not([type="button"]):not([type="checkbox"]):not([type="radio"]),
59
  select,
125
  }
126
  .ditty-field__label + .ditty-field__description,
127
  .ditty-field__help + .ditty-field__description {
128
+ margin-top: 7px !important;
129
  }
130
  .ditty-field--clone-enabled {
131
  .ditty-input--clone {
192
  }
193
  .ditty-field__help,
194
  .ditty-field__desciption {
195
+ margin-bottom: 0 !important;
196
  }
197
  }
198
  .ditty-field__collapsible-toggle {
258
  display: block;
259
  margin-top: 2px;
260
  margin-bottom: 5px;
261
+ label {
262
+ font-size: 13px;
263
+ line-break: 13px;
264
+ }
265
  }
266
  &--inline {
267
  flex-direction: row;
278
  }
279
  }
280
  .ditty-field-type--checkbox {
281
+ .ditty-field__input__primary {
282
+ input[type="checkbox"] {
283
+ margin: 0;
284
+ }
285
+ label {
286
+ font-size: 13px;
287
+ line-height: 13px;
288
+ margin-left: 7px;
289
+ }
290
  }
291
  }
292
 
315
  }
316
  }
317
  &__option {
318
+ display: flex;
319
+ flex-direction: row;
320
+ align-items: center;
321
  margin-top: 2px;
322
  margin-bottom: 5px;
323
+ input[type="radio"] {
324
+ margin: 0;
325
+ }
326
+ label {
327
+ font-size: 13px;
328
+ line-height: 13px;
329
+ margin-left: 7px;
330
+ }
331
  }
332
  }
333
  }
677
  margin-bottom: 0;
678
  }
679
  .ditty-field__description {
680
+ font-size: 13px;
681
+ line-height: 16px;
682
  margin-bottom: 0;
683
  }
684
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
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
7
- Stable tag: 3.0.14
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
@@ -66,6 +66,11 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
69
  = 3.0.14 =
70
  * Ticker cloneItems bug fix
71
 
@@ -675,4 +680,4 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
675
 
676
  == Upgrade Notice ==
677
 
678
- Added ticker title and multiple other updates
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
7
+ Stable tag: 3.0.15
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
66
 
67
  == Changelog ==
68
 
69
+ = 3.0.15 =
70
+ * Ticker container border width render issue fix
71
+ * Data sanitization updates
72
+ * Added Display type fields filter
73
+
74
  = 3.0.14 =
75
  * Ticker cloneItems bug fix
76
 
680
 
681
  == Upgrade Notice ==
682
 
683
+ Data sanitization and other updates