Ditty News Ticker - Version 3.0.13

Version Description

  • Added Ditty Wizard (Beta)
  • Ditty settings page updates
  • Added Heading field type
  • Default layout updates
  • Updated German translation
  • Added uniq_id meta to Ditty, Layouts & Displays
  • Added init meta to Ditty
  • Resolved editor layout bugs
  • Added Item Created and Modified date meta
  • Added Item Author meta and Layout tags
  • Modified field help functionality
  • Added option to not clone ticker items
  • Ticker display now hides if there are no items
  • Added Ticker title settings
Download this release

Release Info

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

Code changes from version 3.0.12 to 3.0.13

Files changed (58) hide show
  1. ditty-news-ticker.php +2 -2
  2. includes/admin/export.php +58 -0
  3. includes/admin/settings.php +159 -11
  4. includes/class-ditty-db-items.php +15 -9
  5. includes/class-ditty-display-item.php +83 -9
  6. includes/class-ditty-display-type-ticker.php +42 -29
  7. includes/class-ditty-display-type.php +125 -1
  8. includes/class-ditty-displays.php +7 -2
  9. includes/class-ditty-item.php +119 -16
  10. includes/class-ditty-items.php +4 -1
  11. includes/class-ditty-layout.php +15 -1
  12. includes/class-ditty-layouts.php +18 -7
  13. includes/class-ditty-singles.php +104 -66
  14. includes/class-ditty.php +6 -1
  15. includes/css/ditty-admin.css +309 -32
  16. includes/css/ditty.css +69 -4
  17. includes/fields/ditty-field-checkboxes.php +21 -17
  18. includes/fields/ditty-field-group.php +3 -2
  19. includes/fields/ditty-field-heading.php +81 -0
  20. includes/fields/ditty-field.php +23 -3
  21. includes/fields/helpers.php +7 -6
  22. includes/fields/js/ditty-fields.js +29 -1
  23. includes/fields/js/ditty-fields.min.js +1 -644
  24. includes/helpers.php +90 -12
  25. includes/hooks.php +20 -1
  26. includes/js/admin/class-ditty-settings.js +101 -22
  27. includes/js/admin/ditty-wizard.js +225 -0
  28. includes/js/class-ditty-display-list.js +1 -0
  29. includes/js/class-ditty-display-list.min.js +1 -1
  30. includes/js/class-ditty-display-ticker.js +141 -44
  31. includes/js/class-ditty-display-ticker.min.js +1 -1
  32. includes/js/class-ditty-slider.js +55 -32
  33. includes/js/class-ditty-slider.min.js +1 -1
  34. includes/js/ditty-admin.js +1 -0
  35. includes/js/ditty-admin.min.js +1 -888
  36. includes/js/ditty-editor.min.js +2 -2
  37. includes/js/editor/class-ditty-layout-css-editor-panel.js +4 -1
  38. includes/js/editor/class-ditty-layout-html-editor-panel.js +4 -1
  39. includes/js/editor/class-ditty-layout-variations-panel.js +4 -4
  40. includes/js/editor/class-ditty-layouts-panel.js +3 -0
  41. includes/js/editor/ditty-ticker-display-editor.js +67 -10
  42. includes/layout-tag-helpers.php +19 -0
  43. includes/layout-tag-hooks-default.php +113 -0
  44. includes/layout-tag-hooks.php +1 -24
  45. includes/sass/admin/_dashboard.scss +21 -0
  46. includes/sass/admin/_fields.scss +78 -15
  47. includes/sass/admin/_settings.scss +20 -12
  48. includes/sass/admin/_wizard.scss +271 -0
  49. includes/sass/ditty-admin.scss +2 -1
  50. includes/sass/editor/_displays_panel.scss +8 -0
  51. includes/sass/editor/_editor.scss +8 -1
  52. includes/sass/partials/_display_ticker.scss +69 -1
  53. includes/sass/partials/_general.scss +13 -6
  54. includes/upgrades.php +116 -15
  55. includes/wizard.php +280 -0
  56. languages/ditty-news-ticker-de_DE.mo +0 -0
  57. languages/ditty-news-ticker-de_DE.po +2902 -0
  58. readme.txt +19 -2
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.12
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.12' );
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.13
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.13' );
24
  }
25
 
26
  // Plugin Folder Path.
includes/admin/export.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Export posts
5
+ *
6
+ * @since 3.0.13
7
+ */
8
+ function ditty_export_posts_ajax() {
9
+ check_ajax_referer( 'ditty', 'security' );
10
+ if ( ! current_user_can( 'manage_ditty_settings' ) ) {
11
+ return false;
12
+ }
13
+ $export_type_ajax = isset( $_POST['export_type'] ) ? $_POST['export_type'] : false;
14
+ $export_options_ajax = isset( $_POST['export_options'] ) ? $_POST['export_options'] : false;
15
+
16
+ switch( $export_type_ajax ) {
17
+ case 'ditty':
18
+ $data = ditty_export_ditty_posts();
19
+ break;
20
+ default:
21
+ break;
22
+ }
23
+
24
+ $json_data = apply_filters( 'ditty_settings_save', $_POST, array() );
25
+ wp_send_json( $json_data );
26
+ }
27
+ add_action( 'wp_ajax_ditty_export_posts', 'ditty_export_posts_ajax' );
28
+
29
+ /**
30
+ * Export posts
31
+ *
32
+ * @since 3.0.13
33
+ */
34
+ function ditty_export_ditty_posts() {
35
+ $args = array(
36
+ 'posts_per_page' => -1,
37
+ 'orderby' => 'post_date',
38
+ 'post_type' => 'ditty',
39
+ );
40
+ $posts = get_posts( $args );
41
+
42
+ $post_exports = array();
43
+ if ( is_array( $posts ) && count( $posts ) > 0 ) {
44
+ foreach ( $posts as $i => $post ) {
45
+ $post_data = array();
46
+
47
+ // Post object data
48
+ $post_data['post'] = ( array ) $post;
49
+
50
+ // Post custom meta
51
+ $post_data['meta'] = get_post_custom( $post->ID );
52
+
53
+ // Post items
54
+ $items = ditty_items_meta( $post->ID );
55
+ $post_data['items'] = ( array ) $items;
56
+ }
57
+ }
58
+ }
includes/admin/settings.php CHANGED
@@ -21,7 +21,7 @@ add_action( 'admin_menu', 'ditty_settings_pages', 5 );
21
  /**
22
  * Render the settings page
23
  *
24
- * @since 3.0
25
  */
26
  function ditty_settings_display() {
27
  ?>
@@ -66,7 +66,12 @@ function ditty_settings_display() {
66
  'icon' => 'fas fa-pencil-alt',
67
  'label' => __( 'Advanced', 'ditty-news-ticker' ),
68
  'fields' => 'ditty_settings_advanced',
69
- ),
 
 
 
 
 
70
  ) );
71
  ?>
72
 
@@ -127,12 +132,17 @@ function ditty_settings_display() {
127
  */
128
  function ditty_settings_general() {
129
  $fields = array(
 
 
 
 
 
130
  'live_refresh' => array(
131
  'type' => 'number',
132
  'id' => 'live_refresh',
133
  'name' => __( 'Live Refresh Rate', 'ditty-news-ticker' ),
134
  'after' => __( 'Minute(s)', 'ditty-news-ticker' ),
135
- 'help' => __( 'Set the live update refresh interval for your Ditty.', 'ditty-news-ticker' ),
136
  'std' => ditty_settings( 'live_refresh' ),
137
  ),
138
  // 'notification_email' => array(
@@ -181,6 +191,11 @@ function ditty_settings_general() {
181
  */
182
  function ditty_settings_variation_defaults() {
183
  $fields = array(
 
 
 
 
 
184
  'layout_variation_defaults' => array(
185
  'type' => 'html',
186
  'id' => 'layout_variation_defaults',
@@ -198,6 +213,11 @@ function ditty_settings_variation_defaults() {
198
  */
199
  function ditty_settings_layout_templates() {
200
  $fields = array(
 
 
 
 
 
201
  'layout_templates' => array(
202
  'type' => 'html',
203
  'id' => 'layout_templates',
@@ -215,6 +235,11 @@ function ditty_settings_layout_templates() {
215
  */
216
  function ditty_settings_display_templates() {
217
  $fields = array(
 
 
 
 
 
218
  'display_templates' => array(
219
  'type' => 'html',
220
  'id' => 'display_templates',
@@ -232,12 +257,29 @@ function ditty_settings_display_templates() {
232
  */
233
  function ditty_settings_advanced() {
234
  $fields = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  'disable_fontawesome' => array(
236
  'type' => 'checkbox',
237
  'id' => 'disable_fontawesome',
238
  'name' => __( 'Font Awesome', 'ditty-news-ticker' ),
239
  'label' => __( 'Disable Font Awesome from loading on the front-end', 'ditty-news-ticker' ),
240
- 'help' => __( 'This will disable the rendering of certain icons used in default Layouts and Layout tags.', 'ditty-news-ticker' ),
241
  'std' => ditty_settings( 'disable_fontawesome' ),
242
  ),
243
  'ditty_news_ticker' => array(
@@ -245,7 +287,7 @@ function ditty_settings_advanced() {
245
  'id' => 'ditty_news_ticker',
246
  'name' => __( 'Ditty News Ticker', 'ditty-news-ticker' ),
247
  'label' => __( 'Enable Ditty News Ticker (Legacy code)', 'ditty-news-ticker' ),
248
- 'input_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' ),
249
  'std' => ditty_settings( 'ditty_news_ticker' ),
250
  ),
251
  // 'ditty_layouts_sass' => array(
@@ -267,6 +309,12 @@ function ditty_settings_advanced() {
267
  */
268
  function ditty_settings_global_ditty() {
269
  $fields = array(
 
 
 
 
 
 
270
  'global_ditty' => array(
271
  'type' => 'group',
272
  'id' => 'global_ditty',
@@ -329,6 +377,105 @@ function ditty_settings_global_ditty() {
329
  ditty_fields( $fields );
330
  }
331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  /**
333
  * Save settings via ajax
334
  *
@@ -398,14 +545,15 @@ function ditty_settings_save( $data, $json_data ) {
398
  }
399
 
400
  $settings = array(
401
- 'live_refresh' => isset( $data['live_refresh'] ) ? intval( $data['live_refresh'] ) : 10,
402
- 'ditty_display_ui' => isset( $data['ditty_display_ui'] ) ? esc_attr( $data['ditty_display_ui'] ) : 'disabled',
403
- 'ditty_layout_ui' => isset( $data['ditty_layout_ui'] ) ? esc_attr( $data['ditty_layout_ui'] ) : 'disabled',
404
- 'ditty_layouts_sass' => isset( $data['ditty_layouts_sass'] ) ? esc_attr( $data['ditty_layouts_sass'] ) : false,
405
  'variation_defaults' => $sanitized_variation_defaults,
406
  'global_ditty' => $sanitized_global_ditty,
407
- 'ditty_news_ticker' => isset( $data['ditty_news_ticker'] ) ? esc_attr( $data['ditty_news_ticker'] ) : false,
408
- 'disable_fontawesome' => isset( $data['disable_fontawesome'] ) ? esc_attr( $data['disable_fontawesome'] ) : false,
 
409
  'notification_email' => ( isset( $data['notification_email'] ) && is_email( $data['notification_email'] ) ) ? $data['notification_email'] : false,
410
  );
411
  ditty_settings( $settings );
21
  /**
22
  * Render the settings page
23
  *
24
+ * @since 3.0.13
25
  */
26
  function ditty_settings_display() {
27
  ?>
66
  'icon' => 'fas fa-pencil-alt',
67
  'label' => __( 'Advanced', 'ditty-news-ticker' ),
68
  'fields' => 'ditty_settings_advanced',
69
+ ),
70
+ // 'import_export' => array(
71
+ // 'icon' => 'fas fa-download',
72
+ // 'label' => __( 'Import / Export', 'ditty-news-ticker' ),
73
+ // 'fields' => 'ditty_settings_import_export',
74
+ // ),
75
  ) );
76
  ?>
77
 
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(
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',
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',
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',
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' ),
276
+ ),
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(
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(
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',
377
  ditty_fields( $fields );
378
  }
379
 
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
+ );
445
+ ditty_fields( $fields );
446
+ }
447
+
448
+ function ditty_export_ditty() {
449
+ $fields = array(
450
+ 'ditty_export_options' => array(
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,
459
+ 'std' => array(
460
+ 'layouts',
461
+ 'displays'
462
+ ),
463
+ ),
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(
471
+ 'data-export_type' => 'ditty',
472
+ ),
473
+ ),
474
+ );
475
+ $render_fields = ditty_fields( $fields, false, 'return' );
476
+ return $render_fields;
477
+ }
478
+
479
  /**
480
  * Save settings via ajax
481
  *
545
  }
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 );
includes/class-ditty-db-items.php CHANGED
@@ -8,7 +8,7 @@
8
  * @subpackage Classes/Ditty DB Items
9
  * @copyright Copyright (c) 2021, Metaphor Creations
10
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
11
- * @since 3.0
12
  */
13
 
14
  // Exit if accessed directly
@@ -26,7 +26,7 @@ class Ditty_DB_Items extends Ditty_DB {
26
 
27
  $this->table_name = $wpdb->prefix . 'ditty_items';
28
  $this->primary_key = 'item_id';
29
- $this->version = '1.0';
30
 
31
  add_action( 'plugins_loaded', array( $this, 'register_table' ), 11 );
32
  }
@@ -34,7 +34,7 @@ class Ditty_DB_Items extends Ditty_DB {
34
  /**
35
  * Get table columns and data types
36
  *
37
- * @since 3.0
38
  */
39
  public function get_columns() {
40
  return array(
@@ -42,26 +42,30 @@ class Ditty_DB_Items extends Ditty_DB {
42
  'item_type' => '%s',
43
  'item_value' => '%s',
44
  'ditty_id' => '%d',
45
- 'layout_id' => '%s',
46
  'layout_value' => '%s',
47
  'item_index' => '%d',
 
 
 
48
  );
49
  }
50
 
51
  /**
52
  * Get default column values
53
  *
54
- * @since 3.0
55
  */
56
  public function get_column_defaults() {
57
  return array(
58
  'item_id' => 0,
59
  'item_type' => '',
60
  'item_value' => '',
61
- 'ditty_id' => 0,
62
- 'layout_id' => '',
63
  'layout_value' => '',
64
  'item_index' => 0,
 
 
 
65
  );
66
  }
67
 
@@ -147,7 +151,7 @@ class Ditty_DB_Items extends Ditty_DB {
147
  /**
148
  * Create the table
149
  *
150
- * @since 3.0
151
  */
152
  public function create_table() {
153
 
@@ -158,9 +162,11 @@ class Ditty_DB_Items extends Ditty_DB {
158
  item_type varchar(255),
159
  item_value longtext,
160
  ditty_id bigint(20) NOT NULL,
161
- layout_id bigint(20),
162
  layout_value longtext,
163
  item_index bigint(20),
 
 
 
164
  PRIMARY KEY (item_id),
165
  KEY ditty_id (ditty_id)
166
  ) CHARACTER SET utf8 COLLATE utf8_general_ci;";
8
  * @subpackage Classes/Ditty DB Items
9
  * @copyright Copyright (c) 2021, Metaphor Creations
10
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
11
+ * @since 3.0.13
12
  */
13
 
14
  // Exit if accessed directly
26
 
27
  $this->table_name = $wpdb->prefix . 'ditty_items';
28
  $this->primary_key = 'item_id';
29
+ $this->version = '1.1';
30
 
31
  add_action( 'plugins_loaded', array( $this, 'register_table' ), 11 );
32
  }
34
  /**
35
  * Get table columns and data types
36
  *
37
+ * @since 3.0.13
38
  */
39
  public function get_columns() {
40
  return array(
42
  'item_type' => '%s',
43
  'item_value' => '%s',
44
  'ditty_id' => '%d',
 
45
  'layout_value' => '%s',
46
  'item_index' => '%d',
47
+ 'item_author' => '%d',
48
+ 'date_created' => '%s',
49
+ 'date_modified' => '%s',
50
  );
51
  }
52
 
53
  /**
54
  * Get default column values
55
  *
56
+ * @since 3.0.13
57
  */
58
  public function get_column_defaults() {
59
  return array(
60
  'item_id' => 0,
61
  'item_type' => '',
62
  'item_value' => '',
63
+ 'ditty_id' => 0,
 
64
  'layout_value' => '',
65
  'item_index' => 0,
66
+ 'item_author' => 0,
67
+ 'date_created' => date( 'Y-m-d H:i:s' ),
68
+ 'date_modified' => date( 'Y-m-d H:i:s' ),
69
  );
70
  }
71
 
151
  /**
152
  * Create the table
153
  *
154
+ * @since 3.0.13
155
  */
156
  public function create_table() {
157
 
162
  item_type varchar(255),
163
  item_value longtext,
164
  ditty_id bigint(20) NOT NULL,
 
165
  layout_value longtext,
166
  item_index bigint(20),
167
+ item_author bigint(20),
168
+ date_created datetime NOT NULL,
169
+ date_modified datetime NOT NULL,
170
  PRIMARY KEY (item_id),
171
  KEY ditty_id (ditty_id)
172
  ) CHARACTER SET utf8 COLLATE utf8_general_ci;";
includes/class-ditty-display-item.php CHANGED
@@ -18,14 +18,17 @@ class Ditty_Display_Item {
18
  private $item_type;
19
  private $item_type_object;
20
  private $item_value;
 
21
  private $ditty_id;
22
  private $has_error;
23
  private $custom_classes;
 
 
24
 
25
  /**
26
  * Get things started\*
27
  * @access public
28
- * @since 3.0
29
  */
30
  public function __construct( $meta ) {
31
  $this->layout_value = isset( $meta['layout_value'] ) ? maybe_unserialize( $meta['layout_value'] ) : false;
@@ -36,9 +39,31 @@ class Ditty_Display_Item {
36
  $this->ditty_id = isset( $meta['ditty_id'] ) ? $meta['ditty_id'] : -1;
37
  $this->has_error = isset( $meta['has_error'] ) ? $meta['has_error'] : false;
38
  $this->custom_classes = isset( $meta['custom_classes'] ) ? $meta['custom_classes'] : false;
39
- if ( ! $this->has_error ) {
40
- $this->parse_layout_id();
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
  /**
@@ -74,6 +99,17 @@ class Ditty_Display_Item {
74
  return 0;
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
77
  /**
78
  * Return the item value
79
  *
@@ -95,6 +131,17 @@ class Ditty_Display_Item {
95
  public function get_item_type() {
96
  return $this->item_type;
97
  }
 
 
 
 
 
 
 
 
 
 
 
98
 
99
  /**
100
  * Return the layout id
@@ -117,6 +164,28 @@ class Ditty_Display_Item {
117
  public function get_layout_value() {
118
  return $this->layout_value;
119
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
 
121
  /**
122
  * Return the layout css
@@ -155,7 +224,7 @@ class Ditty_Display_Item {
155
  */
156
  public function get_layout_object() {
157
  if ( ! $this->layout_object ) {
158
- $this->layout_object = new Ditty_Layout( $this->get_layout_id(), $this->get_item_type(), $this->item_value );
159
  }
160
  return $this->layout_object;
161
  }
@@ -164,16 +233,21 @@ class Ditty_Display_Item {
164
  * Confirm that the layout exists
165
  *
166
  * @access public
167
- * @since 3.0
168
  * @return int $id
169
  */
170
  private function parse_layout_id() {
171
  $layout_value = $this->get_layout_value();
172
  $layout_id = isset( $layout_value['default'] ) ? $layout_value['default'] : 0;
173
  $this->layout_id = apply_filters( 'ditty_display_item_layout_id', $layout_id, $this );
174
- if ( false === strpos( $layout_id, 'new-' ) && 'publish' != get_post_status( $this->layout_id ) ) {
175
- $this->item_value = array( 'ditty_feed_error' => sprintf( __( 'Ditty Layout does not exist for %s item!', 'ditty-news-ticker' ), $this->get_item_type() ) );
176
- $this->has_error = true;
 
 
 
 
 
177
  }
178
  }
179
 
18
  private $item_type;
19
  private $item_type_object;
20
  private $item_value;
21
+ private $item_author;
22
  private $ditty_id;
23
  private $has_error;
24
  private $custom_classes;
25
+ private $date_created;
26
+ private $date_modified;
27
 
28
  /**
29
  * Get things started\*
30
  * @access public
31
+ * @since 3.0.13
32
  */
33
  public function __construct( $meta ) {
34
  $this->layout_value = isset( $meta['layout_value'] ) ? maybe_unserialize( $meta['layout_value'] ) : false;
39
  $this->ditty_id = isset( $meta['ditty_id'] ) ? $meta['ditty_id'] : -1;
40
  $this->has_error = isset( $meta['has_error'] ) ? $meta['has_error'] : false;
41
  $this->custom_classes = isset( $meta['custom_classes'] ) ? $meta['custom_classes'] : false;
42
+ $this->item_author = isset( $meta['item_author'] ) ? intval( $meta['item_author'] ) : false;
43
+ $this->date_created = isset( $meta['date_created'] ) ? $meta['date_created'] : false;
44
+ $this->date_modified = isset( $meta['date_modified'] ) ? $meta['date_modified'] : false;
45
+ $this->parse_layout_id();
46
+ }
47
+
48
+ /**
49
+ * Return the database data for the item
50
+ *
51
+ * @access public
52
+ * @since 3.0.13
53
+ * @return string $db_data
54
+ */
55
+ public function get_db_data() {
56
+ $db_data = array(
57
+ 'item_id' => $this->get_id(),
58
+ 'item_type' => $this->get_item_type(),
59
+ 'item_value' => $this->get_value(),
60
+ 'item_author' => $this->get_item_author(),
61
+ 'ditty_id' => $this->get_ditty_id(),
62
+ 'layout_value' => $this->get_layout_value(),
63
+ 'date_created' => $this->get_date_created(),
64
+ 'date_modified' => $this->get_date_modified(),
65
+ );
66
+ return $db_data;
67
  }
68
 
69
  /**
99
  return 0;
100
  }
101
 
102
+ /**
103
+ * Return the Ditty id
104
+ *
105
+ * @access public
106
+ * @since 3.0.13
107
+ * @return int $ditty_id
108
+ */
109
+ public function get_ditty_id() {
110
+ return $this->ditty_id;
111
+ }
112
+
113
  /**
114
  * Return the item value
115
  *
131
  public function get_item_type() {
132
  return $this->item_type;
133
  }
134
+
135
+ /**
136
+ * Return the item author
137
+ *
138
+ * @access public
139
+ * @since 3.0.13
140
+ * @return int $item_author
141
+ */
142
+ public function get_item_author() {
143
+ return $this->item_author;
144
+ }
145
 
146
  /**
147
  * Return the layout id
164
  public function get_layout_value() {
165
  return $this->layout_value;
166
  }
167
+
168
+ /**
169
+ * Return the date created
170
+ *
171
+ * @access public
172
+ * @since 3.0.13
173
+ * @return date $date_created
174
+ */
175
+ public function get_date_created() {
176
+ return $this->date_created;
177
+ }
178
+
179
+ /**
180
+ * Return the date modified
181
+ *
182
+ * @access public
183
+ * @since 3.0.13
184
+ * @return date $date_modified
185
+ */
186
+ public function get_date_modified() {
187
+ return $this->date_modified;
188
+ }
189
 
190
  /**
191
  * Return the layout css
224
  */
225
  public function get_layout_object() {
226
  if ( ! $this->layout_object ) {
227
+ $this->layout_object = new Ditty_Layout( $this->get_layout_id(), $this->get_item_type(), $this->item_value, $this->get_db_data() );
228
  }
229
  return $this->layout_object;
230
  }
233
  * Confirm that the layout exists
234
  *
235
  * @access public
236
+ * @since 3.0.13
237
  * @return int $id
238
  */
239
  private function parse_layout_id() {
240
  $layout_value = $this->get_layout_value();
241
  $layout_id = isset( $layout_value['default'] ) ? $layout_value['default'] : 0;
242
  $this->layout_id = apply_filters( 'ditty_display_item_layout_id', $layout_id, $this );
243
+ if ( ! $this->layout_id || ( false === strpos( $layout_id, 'new-' ) && 'publish' != get_post_status( $this->layout_id ) ) ) {
244
+ $default_layout = ditty_get_default_layout();
245
+ if ( $default_layout && 'publish' == get_post_status( $this->layout_id ) ) {
246
+ $this->layout_id = $default_layout;
247
+ } else {
248
+ $this->item_value = array( 'ditty_feed_error' => sprintf( __( 'Choose a layout to render your %s item!', 'ditty-news-ticker' ), $this->get_item_type() ) );
249
+ $this->has_error = true;
250
+ }
251
  }
252
  }
253
 
includes/class-ditty-display-type-ticker.php CHANGED
@@ -89,13 +89,26 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
89
  ),
90
  'std' => isset( $values['speed'] ) ? $values['speed'] : false,
91
  ),
92
- 'hoverPause' => array(
93
- 'type' => 'checkbox',
94
- 'id' => 'hoverPause',
95
- 'name' => __( 'Hover Pause', 'ditty-news-ticker' ),
96
- 'label' => __( 'Pause the ticker on mouse over', 'ditty-news-ticker' ),
97
- 'help' => __( 'Pause the ticker on mouse over.', 'ditty-news-ticker' ),
98
- 'std' => isset( $values['hoverPause'] ) ? $values['hoverPause'] : false,
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  ),
100
  'scrollInit' => array(
101
  'type' => 'radio',
@@ -122,26 +135,25 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
122
  ),
123
  'std' => isset( $values['scrollDelay'] ) ? $values['scrollDelay'] : false,
124
  ),
125
- 'heightEase' => array(
126
- 'type' => 'select',
127
- 'id' => 'heightEase',
128
- 'name' => __( 'Height Ease', 'ditty-news-ticker' ),
129
- 'help' => __( 'Set the easing of the ticker height.', 'ditty-news-ticker' ),
130
- 'options' => ditty_ease_array(),
131
- 'std' => isset( $values['heightEase'] ) ? $values['heightEase'] : false,
132
- ),
133
- 'heightSpeed' => array(
134
- 'type' => 'slider',
135
- 'id' => 'heightSpeed',
136
- 'name' => __( 'Height Speed', 'ditty-news-ticker' ),
137
- 'help' => __( 'Set the speed of the ticker height.', 'ditty-news-ticker' ),
138
- 'suffix' => ' ' . __( 'second(s)', 'ditty-news-ticker' ),
139
- 'js_options' => array(
140
- 'min' => 0,
141
- 'max' => 10,
142
- 'step' => 0.25,
143
  ),
144
- 'std' => isset( $values['heightSpeed'] ) ? $values['heightSpeed'] : false,
 
 
 
 
 
 
 
 
 
145
  ),
146
  'shuffle' => array(
147
  'type' => 'checkbox',
@@ -154,6 +166,7 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
154
  ),
155
  ),
156
  'containerStyles' => parent::container_style_settings( $values ),
 
157
  'contentStyles' => parent::content_style_settings( $values ),
158
  'itemStyles' => parent::item_style_settings( $values, false, array(
159
  'itemMaxWidth' => array(
@@ -201,11 +214,11 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
201
  /**
202
  * Set the metabox defaults
203
  * @access public
204
- * @since 3.0
205
  */
206
  public function default_settings() {
207
 
208
- $defaults = json_decode( '{"direction":"left","spacing":"25","speed":"10","minHeight":"300px","maxHeight":"","hoverPause":"1","scrollInit":"empty","scrollDelay":"3","heightEase":"easeInOutQuint","heightSpeed":"1.5","maxWidth":"","bgColor":"","padding":{"paddingTop":"5px","paddingBottom":"5px","paddingLeft":"5px","paddingRight":"5px"},"margin":{"marginTop":"","marginBottom":"","marginLeft":"","marginRight":""},"borderColor":"","borderStyle":"none","borderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"borderRadius":{"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":"3px","borderTopRightRadius":"3px","borderBottomLeftRadius":"3px","borderBottomRightRadius":"3px"},"itemTextColor":"","itemBgColor":"","itemPadding":{"paddingTop":"","paddingBottom":"","paddingLeft":"","paddingRight":""},"itemBorderColor":"","itemBorderStyle":"none","itemBorderWidth":{"borderTopWidth":"","borderBottomWidth":"","borderLeftWidth":"","borderRightWidth":""},"itemBorderRadius":{"borderTopLeftRadius":"","borderTopRightRadius":"","borderBottomLeftRadius":"","borderBottomRightRadius":""},"itemMaxWidth":"400px","itemElementsWrap":"wrap"}', true );
209
 
210
  return apply_filters( 'ditty_display_default_settings', $defaults, $this->type );
211
  }
@@ -223,7 +236,7 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
223
  'label' => __( 'Default Ticker', 'ditty-news-ticker' ),
224
  'description' => __( 'Default ticker display', 'ditty-news-ticker' ),
225
  'settings' => $defaults,
226
- 'version' => '1.2',
227
  );
228
  return apply_filters( 'ditty_display_type_templates', $templates, $this->type );
229
  }
89
  ),
90
  'std' => isset( $values['speed'] ) ? $values['speed'] : false,
91
  ),
92
+ 'heightEase' => array(
93
+ 'type' => 'select',
94
+ 'id' => 'heightEase',
95
+ 'name' => __( 'Height Ease', 'ditty-news-ticker' ),
96
+ 'help' => __( 'Set the easing of the ticker height.', 'ditty-news-ticker' ),
97
+ 'options' => ditty_ease_array(),
98
+ 'std' => isset( $values['heightEase'] ) ? $values['heightEase'] : false,
99
+ ),
100
+ 'heightSpeed' => array(
101
+ 'type' => 'slider',
102
+ 'id' => 'heightSpeed',
103
+ 'name' => __( 'Height Speed', 'ditty-news-ticker' ),
104
+ 'help' => __( 'Set the speed of the ticker height.', 'ditty-news-ticker' ),
105
+ 'suffix' => ' ' . __( 'second(s)', 'ditty-news-ticker' ),
106
+ 'js_options' => array(
107
+ 'min' => 0,
108
+ 'max' => 10,
109
+ 'step' => 0.25,
110
+ ),
111
+ 'std' => isset( $values['heightSpeed'] ) ? $values['heightSpeed'] : false,
112
  ),
113
  'scrollInit' => array(
114
  'type' => 'radio',
135
  ),
136
  'std' => isset( $values['scrollDelay'] ) ? $values['scrollDelay'] : false,
137
  ),
138
+ 'cloneItems' => array(
139
+ 'type' => 'radio',
140
+ 'id' => 'cloneItems',
141
+ 'name' => __( 'Clone Items?', 'ditty-news-ticker' ),
142
+ 'help' => __( 'Should items continually clone to fill the ticker?', 'ditty-news-ticker' ),
143
+ 'options' => array(
144
+ 'yes' => __( 'Yes', 'ditty-news-ticker' ),
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',
152
+ 'id' => 'hoverPause',
153
+ 'name' => __( 'Hover Pause', 'ditty-news-ticker' ),
154
+ 'label' => __( 'Pause the ticker on mouse over', 'ditty-news-ticker' ),
155
+ 'help' => __( 'Pause the ticker on mouse over.', 'ditty-news-ticker' ),
156
+ 'std' => isset( $values['hoverPause'] ) ? $values['hoverPause'] : false,
157
  ),
158
  'shuffle' => array(
159
  'type' => 'checkbox',
166
  ),
167
  ),
168
  'containerStyles' => parent::container_style_settings( $values ),
169
+ 'titleStyles' => parent::title_style_settings( $values ),
170
  'contentStyles' => parent::content_style_settings( $values ),
171
  'itemStyles' => parent::item_style_settings( $values, false, array(
172
  'itemMaxWidth' => array(
214
  /**
215
  * Set the metabox defaults
216
  * @access public
217
+ * @since 3.0.13
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
  }
236
  'label' => __( 'Default Ticker', 'ditty-news-ticker' ),
237
  'description' => __( 'Default ticker display', 'ditty-news-ticker' ),
238
  'settings' => $defaults,
239
+ 'version' => '1.3',
240
  );
241
  return apply_filters( 'ditty_display_type_templates', $templates, $this->type );
242
  }
includes/class-ditty-display-type.php CHANGED
@@ -371,13 +371,14 @@ class Ditty_Display_Type {
371
  'type' => 'color',
372
  'id' => "{$prefixed}Color",
373
  'name' => __( 'Border Color', 'ditty-news-ticker' ),
 
374
  'std' => isset( $values["{$prefixed}Color"] ) ? $values["{$prefixed}Color"] : false,
375
  );
376
  $settings["{$prefixed}Style"] = array(
377
  'type' => 'select',
378
  'id' => "{$prefixed}Style",
379
  'name' => __( 'Border Style', 'ditty-news-ticker' ),
380
- 'help' => __( 'A border style must be set for a border to render', 'ditty-news-ticker' ),
381
  'options' => ditty_border_styles_array(),
382
  'std' => isset( $values["{$prefixed}Style"] ) ? $values["{$prefixed}Style"] : false,
383
  );
@@ -385,6 +386,7 @@ class Ditty_Display_Type {
385
  'type' => 'spacing',
386
  'id' => "{$prefixed}Width",
387
  'name' => __( 'Border Width', 'ditty-news-ticker' ),
 
388
  'options' => array(
389
  'borderTopWidth' => __( 'Top', 'ditty-news-ticker' ),
390
  'borderBottomWidth' => __( 'Bottom', 'ditty-news-ticker' ),
@@ -397,6 +399,7 @@ class Ditty_Display_Type {
397
  'type' => 'radius',
398
  'id' => "{$prefixed}Radius",
399
  'name' => __( 'Border Radius', 'ditty-news-ticker' ),
 
400
  'std' => isset( $values["{$prefixed}Radius"] ) ? $values["{$prefixed}Radius"] : false,
401
  );
402
  return $settings;
@@ -457,6 +460,127 @@ class Ditty_Display_Type {
457
  return $settings;
458
  }
459
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460
  /**
461
  * Return content style settings
462
  *
371
  'type' => 'color',
372
  'id' => "{$prefixed}Color",
373
  'name' => __( 'Border Color', 'ditty-news-ticker' ),
374
+ 'help' => __( 'Choose a color for the border.', 'ditty-news-ticker' ),
375
  'std' => isset( $values["{$prefixed}Color"] ) ? $values["{$prefixed}Color"] : false,
376
  );
377
  $settings["{$prefixed}Style"] = array(
378
  'type' => 'select',
379
  'id' => "{$prefixed}Style",
380
  'name' => __( 'Border Style', 'ditty-news-ticker' ),
381
+ 'help' => __( 'A border style must be set for a border to render.', 'ditty-news-ticker' ),
382
  'options' => ditty_border_styles_array(),
383
  'std' => isset( $values["{$prefixed}Style"] ) ? $values["{$prefixed}Style"] : false,
384
  );
386
  'type' => 'spacing',
387
  'id' => "{$prefixed}Width",
388
  'name' => __( 'Border Width', 'ditty-news-ticker' ),
389
+ 'help' => __( 'Set custom border widths.', 'ditty-news-ticker' ),
390
  'options' => array(
391
  'borderTopWidth' => __( 'Top', 'ditty-news-ticker' ),
392
  'borderBottomWidth' => __( 'Bottom', 'ditty-news-ticker' ),
399
  'type' => 'radius',
400
  'id' => "{$prefixed}Radius",
401
  'name' => __( 'Border Radius', 'ditty-news-ticker' ),
402
+ 'help' => __( 'Choose a custom border radius.', 'ditty-news-ticker' ),
403
  'std' => isset( $values["{$prefixed}Radius"] ) ? $values["{$prefixed}Radius"] : false,
404
  );
405
  return $settings;
460
  return $settings;
461
  }
462
 
463
+ /**
464
+ * Return title style settings
465
+ *
466
+ * @since 3.0.13
467
+ * @var $settings array
468
+ */
469
+ public function title_style_settings( $values, $id = 'titleStyles', $extra_fields = array() ) {
470
+ $base_fields = array(
471
+ 'titleDisplay' => array(
472
+ 'type' => 'select',
473
+ 'id' => 'titleDisplay',
474
+ 'name' => __( 'Display', 'ditty-news-ticker' ),
475
+ 'help' => __( 'Show the Ditty title with your ticker.', 'ditty-news-ticker' ),
476
+ 'options' => [
477
+ 'none' => __( 'None', 'ditty-news-ticker' ),
478
+ 'top' => __( 'Top', 'ditty-news-ticker' ),
479
+ 'bottom' => __( 'Bottom', 'ditty-news-ticker' ),
480
+ 'left' => __( 'Left', 'ditty-news-ticker' ),
481
+ 'right' => __( 'Right', 'ditty-news-ticker' ),
482
+ ],
483
+ 'std' => isset( $values['titleDisplay'] ) ? $values['titleDisplay'] : false,
484
+ ),
485
+ 'titleElement' => array(
486
+ 'type' => 'select',
487
+ 'id' => 'titleElement',
488
+ 'name' => __( 'Element', 'ditty-news-ticker' ),
489
+ 'help' => __( 'Select the HTML element to use for the title.', 'ditty-news-ticker' ),
490
+ 'options' => [
491
+ 'h1' => 'h1',
492
+ 'h2' => 'h2',
493
+ 'h3' => 'h3',
494
+ 'h4' => 'h4',
495
+ 'h5' => 'h5',
496
+ 'h6' => 'h6',
497
+ 'p' => 'p',
498
+ ],
499
+ 'std' => isset( $values['titleElement'] ) ? $values['titleElement'] : false,
500
+ ),
501
+ 'titleElementPosition' => array(
502
+ 'type' => 'radio',
503
+ 'id' => 'titleElementPosition',
504
+ 'name' => __( 'Element Position', 'ditty-news-ticker' ),
505
+ 'help' => __( 'Set the position of the element within the title area.', 'ditty-news-ticker' ),
506
+ 'options' => [
507
+ 'start' => __( 'Start', 'ditty-news-ticker' ),
508
+ 'center' => __( 'Center', 'ditty-news-ticker' ),
509
+ 'end' => __( 'End', 'ditty-news-ticker' ),
510
+ ],
511
+ 'inline' => true,
512
+ 'std' => isset( $values['titleElementPosition'] ) ? $values['titleElementPosition'] : false,
513
+ ),
514
+ 'titleFontSize' => array(
515
+ 'type' => 'text',
516
+ 'id' => 'titleFontSize',
517
+ 'name' => __( 'Font Size', 'ditty-news-ticker' ),
518
+ 'help' => __( 'Set a custom font size.', 'ditty-news-ticker' ),
519
+ 'std' => isset( $values['titleFontSize'] ) ? $values['titleFontSize'] : false,
520
+ ),
521
+ 'titleLineHeight' => array(
522
+ 'type' => 'text',
523
+ 'id' => 'titleLineHeight',
524
+ 'name' => __( 'Line Height', 'ditty-news-ticker' ),
525
+ 'help' => __( 'Set a custom line height.', 'ditty-news-ticker' ),
526
+ 'std' => isset( $values['titleLineHeight'] ) ? $values['titleLineHeight'] : false,
527
+ ),
528
+ 'titleColor' => array(
529
+ 'type' => 'color',
530
+ 'id' => 'titleColor',
531
+ 'name' => __( 'Text Color', 'ditty-news-ticker' ),
532
+ 'help' => __( 'Set a custom font color.', 'ditty-news-ticker' ),
533
+ 'std' => isset( $values['titleColor'] ) ? $values['titleColor'] : false,
534
+ ),
535
+ 'titleBgColor' => array(
536
+ 'type' => 'color',
537
+ 'id' => 'titleBgColor',
538
+ 'name' => __( 'Background Color', 'ditty-news-ticker' ),
539
+ 'help' => __( 'Add a background title to the title area.', 'ditty-news-ticker' ),
540
+ 'std' => isset( $values['titleBgColor'] ) ? $values['titleBgColor'] : false,
541
+ ),
542
+ 'titleMargin' => array(
543
+ 'type' => 'spacing',
544
+ 'id' => 'titleMargin',
545
+ 'name' => __( 'Margin', 'ditty-news-ticker' ),
546
+ 'help' => __( 'Add custom margins around the title area.', 'ditty-news-ticker' ),
547
+ 'options' => array(
548
+ 'marginTop' => __( 'Top', 'ditty-news-ticker' ),
549
+ 'marginBottom' => __( 'Bottom', 'ditty-news-ticker' ),
550
+ 'marginLeft' => __( 'Left', 'ditty-news-ticker' ),
551
+ 'marginRight' => __( 'Right', 'ditty-news-ticker' ),
552
+ ),
553
+ 'std' => isset( $values['titleMargin'] ) ? $values['titleMargin'] : false,
554
+ ),
555
+ 'titlePadding' => array(
556
+ 'type' => 'spacing',
557
+ 'id' => 'titlePadding',
558
+ 'name' => __( 'Padding', 'ditty-news-ticker' ),
559
+ 'help' => __( 'Add custom padding around the title area.', 'ditty-news-ticker' ),
560
+ 'options' => array(
561
+ 'paddingTop' => __( 'Top', 'ditty-news-ticker' ),
562
+ 'paddingBottom' => __( 'Bottom', 'ditty-news-ticker' ),
563
+ 'paddingLeft' => __( 'Left', 'ditty-news-ticker' ),
564
+ 'paddingRight' => __( 'Right', 'ditty-news-ticker' ),
565
+ ),
566
+ 'std' => isset( $values['titlePadding'] ) ? $values['titlePadding'] : false,
567
+ ),
568
+ );
569
+ $border_fields = $this->border_settings( $values, 'title' );
570
+ $fields = array_merge( $base_fields, $border_fields, $extra_fields );
571
+ $settings = array(
572
+ 'type' => 'group',
573
+ 'id' => $id,
574
+ 'collapsible' => true,
575
+ 'default_state' => 'collapsed',
576
+ 'multiple_fields' => true,
577
+ 'name' => __( 'Title Styles', 'ditty-news-ticker' ),
578
+ 'help' => __( 'Add custom title styles.', 'ditty-news-ticker' ),
579
+ 'fields' => $fields,
580
+ );
581
+ return $settings;
582
+ }
583
+
584
  /**
585
  * Return content style settings
586
  *
includes/class-ditty-displays.php CHANGED
@@ -277,6 +277,9 @@ class Ditty_Displays {
277
  update_post_meta( $post_id, '_ditty_display_description', $display_description );
278
  }
279
 
 
 
 
280
  // Remove the version number of edited displays
281
  delete_post_meta( $post_id, '_ditty_display_template' );
282
  delete_post_meta( $post_id, '_ditty_display_version' );
@@ -778,7 +781,6 @@ class Ditty_Displays {
778
  $editor_display->set_version( '' );
779
  $draft_data = array(
780
  'label' => $editor_display->get_label(),
781
- 'description' => $editor_display->get_description(),
782
  'display_type' => $editor_display->get_display_type(),
783
  'settings' => $editor_display->get_settings(),
784
  );
@@ -841,7 +843,7 @@ class Ditty_Displays {
841
  * Save display draft values on Ditty update
842
  *
843
  * @access public
844
- * @since 3.0
845
  */
846
  public function update_drafts( $ditty_id, $draft_values ) {
847
  if ( ! current_user_can( 'edit_ditty_displays' ) ) {
@@ -904,6 +906,9 @@ class Ditty_Displays {
904
  update_post_meta( $display_id, '_ditty_display_settings', $sanitized_settings );
905
  }
906
 
 
 
 
907
  // Remove the version number of edited displays
908
  delete_post_meta( $display_id, '_ditty_display_version' );
909
  }
277
  update_post_meta( $post_id, '_ditty_display_description', $display_description );
278
  }
279
 
280
+ // Possibly add a uniq_id
281
+ ditty_maybe_add_uniq_id( $post_id );
282
+
283
  // Remove the version number of edited displays
284
  delete_post_meta( $post_id, '_ditty_display_template' );
285
  delete_post_meta( $post_id, '_ditty_display_version' );
781
  $editor_display->set_version( '' );
782
  $draft_data = array(
783
  'label' => $editor_display->get_label(),
 
784
  'display_type' => $editor_display->get_display_type(),
785
  'settings' => $editor_display->get_settings(),
786
  );
843
  * Save display draft values on Ditty update
844
  *
845
  * @access public
846
+ * @since 3.0.13
847
  */
848
  public function update_drafts( $ditty_id, $draft_values ) {
849
  if ( ! current_user_can( 'edit_ditty_displays' ) ) {
906
  update_post_meta( $display_id, '_ditty_display_settings', $sanitized_settings );
907
  }
908
 
909
+ // Possibly add a uniq_id
910
+ ditty_maybe_add_uniq_id( $display_id );
911
+
912
  // Remove the version number of edited displays
913
  delete_post_meta( $display_id, '_ditty_display_version' );
914
  }
includes/class-ditty-item.php CHANGED
@@ -20,6 +20,9 @@ class Ditty_Item {
20
  private $icon;
21
  private $label;
22
  private $item_type_object;
 
 
 
23
 
24
  /**
25
  * Get things started
@@ -69,11 +72,12 @@ class Ditty_Item {
69
  return $meta;
70
  }
71
  $meta['item_id'] = isset( $draft_values['item_id'] ) ? $draft_values['item_id'] : ( isset( $meta['item_id'] ) ? $meta['item_id'] : $this->item_id );
72
- $meta['ditty_id'] = isset( $draft_values['ditty_id'] ) ? $draft_values['ditty_id'] : ( isset( $meta['ditty_id'] ) ? $meta['ditty_id'] : $this->ditty_id );
73
  $meta['item_type'] = isset( $draft_values['item_type'] ) ? $draft_values['item_type'] : ( isset( $meta['item_type'] ) ? $meta['item_type'] : $this->item_type );
74
  $meta['item_value'] = isset( $draft_values['item_value'] ) ? $draft_values['item_value'] : ( isset( $meta['item_value'] ) ? $meta['item_value'] : $this->item_value );
75
  $meta['layout_value'] = isset( $draft_values['layout_value'] ) ? $draft_values['layout_value'] : ( isset( $meta['layout_value'] ) ? $meta['layout_value'] : $this->layout_value );
76
  $meta['item_index'] = isset( $draft_values['item_index'] ) ? $draft_values['item_index'] : ( isset( $meta['item_index'] ) ? $meta['item_index'] : $this->item_index );
 
77
  return $meta;
78
  }
79
 
@@ -91,13 +95,16 @@ class Ditty_Item {
91
  $meta = ( array ) $meta;
92
  }
93
  if ( is_array( $meta ) ) {
94
- $this->item_id = isset( $meta['item_id'] ) ? $meta['item_id'] : $this->item_id;
95
- $this->item_uniq_id = isset( $meta['item_uniq_id'] ) ? $meta['item_uniq_id'] : $this->item_id;
96
- $this->ditty_id = isset( $meta['ditty_id'] ) ? $meta['ditty_id'] : $this->ditty_id;
97
- $this->item_type = isset( $meta['item_type'] ) ? $meta['item_type'] : $this->item_type;
98
- $this->layout_value = isset( $meta['layout_value'] ) ? maybe_unserialize( $meta['layout_value'] ) : $this->layout_value;
99
- $this->item_value = isset( $meta['item_value'] ) ? maybe_unserialize( $meta['item_value'] ) : false;
100
- $this->item_index = isset( $meta['item_index'] ) ? $meta['item_index'] : $this->item_index;
 
 
 
101
  if ( $item_type_object = $this->get_type_object() ) {
102
  $this->icon = $item_type_object->get_icon();
103
  $this->label = $item_type_object->get_label();
@@ -109,17 +116,20 @@ class Ditty_Item {
109
  /**
110
  * Return the database data for the item
111
  * @access public
112
- * @since 3.0
113
  * @return string $db_data
114
  */
115
  public function get_db_data() {
116
  $db_data = array(
117
- 'item_id' => $this->get_id(),
118
- 'item_type' => $this->get_type(),
119
- 'item_value' => $this->get_value(),
120
- 'ditty_id' => $this->get_ditty_id(),
121
- 'layout_value' => $this->get_layout_value(),
122
- 'item_index' => $this->get_index(),
 
 
 
123
  );
124
  return $db_data;
125
  }
@@ -269,13 +279,18 @@ class Ditty_Item {
269
  /**
270
  * Set the item value
271
  * @access public
272
- * @since 3.0
273
  * @return array $sanitized_item_value
274
  */
275
  public function set_item_value( $item_value = array() ) {
276
  if ( $item_type_object = $this->get_type_object() ) {
277
  $sanitized_item_value = $item_type_object->sanitize_settings( $item_value );
278
  $this->item_value = maybe_serialize( $sanitized_item_value );
 
 
 
 
 
279
  return $sanitized_item_value;
280
  }
281
  }
@@ -305,6 +320,91 @@ class Ditty_Item {
305
  return $this->item_index;
306
  }
307
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  /**
309
  * Return the item icon
310
  * @access public
@@ -338,6 +438,9 @@ class Ditty_Item {
338
  'item_type' => $this->get_type(),
339
  'item_value' => $this->get_value(),
340
  'layout_value' => $this->get_layout_value(),
 
 
 
341
  );
342
  return $values;
343
  }
20
  private $icon;
21
  private $label;
22
  private $item_type_object;
23
+ private $item_author;
24
+ private $date_created;
25
+ private $date_modified;
26
 
27
  /**
28
  * Get things started
72
  return $meta;
73
  }
74
  $meta['item_id'] = isset( $draft_values['item_id'] ) ? $draft_values['item_id'] : ( isset( $meta['item_id'] ) ? $meta['item_id'] : $this->item_id );
75
+ $meta['ditty_id'] = isset( $draft_values['ditty_id'] ) ? $draft_values['ditty_id'] : ( isset( $meta['ditty_id'] ) ? $meta['ditty_id'] : $this->ditty_id );
76
  $meta['item_type'] = isset( $draft_values['item_type'] ) ? $draft_values['item_type'] : ( isset( $meta['item_type'] ) ? $meta['item_type'] : $this->item_type );
77
  $meta['item_value'] = isset( $draft_values['item_value'] ) ? $draft_values['item_value'] : ( isset( $meta['item_value'] ) ? $meta['item_value'] : $this->item_value );
78
  $meta['layout_value'] = isset( $draft_values['layout_value'] ) ? $draft_values['layout_value'] : ( isset( $meta['layout_value'] ) ? $meta['layout_value'] : $this->layout_value );
79
  $meta['item_index'] = isset( $draft_values['item_index'] ) ? $draft_values['item_index'] : ( isset( $meta['item_index'] ) ? $meta['item_index'] : $this->item_index );
80
+ $meta['item_author'] = isset( $draft_values['item_author'] ) ? $draft_values['item_author'] : ( isset( $meta['item_author'] ) ? $meta['item_author'] : $this->item_author );
81
  return $meta;
82
  }
83
 
95
  $meta = ( array ) $meta;
96
  }
97
  if ( is_array( $meta ) ) {
98
+ $this->item_id = isset( $meta['item_id'] ) ? $meta['item_id'] : $this->item_id;
99
+ $this->item_uniq_id = isset( $meta['item_uniq_id'] ) ? $meta['item_uniq_id'] : $this->item_id;
100
+ $this->ditty_id = isset( $meta['ditty_id'] ) ? $meta['ditty_id'] : $this->ditty_id;
101
+ $this->item_type = isset( $meta['item_type'] ) ? $meta['item_type'] : $this->item_type;
102
+ $this->layout_value = isset( $meta['layout_value'] ) ? maybe_unserialize( $meta['layout_value'] ) : $this->layout_value;
103
+ $this->item_value = isset( $meta['item_value'] ) ? maybe_unserialize( $meta['item_value'] ) : false;
104
+ $this->item_index = isset( $meta['item_index'] ) ? $meta['item_index'] : $this->item_index;
105
+ $this->item_author = isset( $meta['item_author'] ) ? $meta['item_author'] : $this->item_author;
106
+ $this->date_created = isset( $meta['date_created'] ) ? $meta['date_created'] : date( 'Y-m-d H:i:s' );
107
+ $this->date_modified = isset( $meta['date_modified'] ) ? $meta['date_modified'] : date( 'Y-m-d H:i:s' );
108
  if ( $item_type_object = $this->get_type_object() ) {
109
  $this->icon = $item_type_object->get_icon();
110
  $this->label = $item_type_object->get_label();
116
  /**
117
  * Return the database data for the item
118
  * @access public
119
+ * @since 3.0.13
120
  * @return string $db_data
121
  */
122
  public function get_db_data() {
123
  $db_data = array(
124
+ 'item_id' => $this->get_id(),
125
+ 'item_type' => $this->get_type(),
126
+ 'item_value' => $this->get_value(),
127
+ 'ditty_id' => $this->get_ditty_id(),
128
+ 'layout_value' => $this->get_layout_value(),
129
+ 'item_index' => $this->get_index(),
130
+ 'item_author' => $this->get_item_author(),
131
+ 'date_created' => $this->get_date_created(),
132
+ 'date_modified' => $this->get_date_modified(),
133
  );
134
  return $db_data;
135
  }
279
  /**
280
  * Set the item value
281
  * @access public
282
+ * @since 3.0.13
283
  * @return array $sanitized_item_value
284
  */
285
  public function set_item_value( $item_value = array() ) {
286
  if ( $item_type_object = $this->get_type_object() ) {
287
  $sanitized_item_value = $item_type_object->sanitize_settings( $item_value );
288
  $this->item_value = maybe_serialize( $sanitized_item_value );
289
+
290
+ // Set the modified time
291
+ $this->set_date_modified();
292
+
293
+ // Return the value
294
  return $sanitized_item_value;
295
  }
296
  }
320
  return $this->item_index;
321
  }
322
 
323
+ /**
324
+ * Return the item author
325
+ * @access public
326
+ * @since 3.0.13
327
+ * @return int $item_author
328
+ */
329
+ public function get_item_author() {
330
+ if ( $this->item_author ) {
331
+ return $this->item_author;
332
+ }
333
+ }
334
+
335
+ /**
336
+ * Set the date created
337
+ * @access public
338
+ * @since 3.0.13
339
+ * @return int $item_author
340
+ */
341
+ public function set_item_author( $author = false ) {
342
+ if ( $author ) {
343
+ $this->item_author = intval( $author );
344
+ } else {
345
+ $this->item_author = get_current_user_id();
346
+ }
347
+ return $this->item_author;
348
+ }
349
+
350
+ /**
351
+ * Return the date created
352
+ * @access public
353
+ * @since 3.0.13
354
+ * @return date $date_created
355
+ */
356
+ public function get_date_created() {
357
+ if ( $this->date_created ) {
358
+ return $this->date_created;
359
+ } else {
360
+ return date( 'Y-m-d H:i:s' );
361
+ }
362
+ }
363
+
364
+ /**
365
+ * Set the date created
366
+ * @access public
367
+ * @since 3.0.13
368
+ * @return date $date_created
369
+ */
370
+ public function set_date_created( $date = false ) {
371
+ if ( $date ) {
372
+ $this->date_created = sanitize_text_field( $date );
373
+ } else {
374
+ $this->date_created = date( 'Y-m-d H:i:s' );
375
+ }
376
+ return $this->date_created;
377
+ }
378
+
379
+ /**
380
+ * Return the date modified
381
+ * @access public
382
+ * @since 3.0.13
383
+ * @return date $date_modified
384
+ */
385
+ public function get_date_modified() {
386
+ if ( $this->date_modified ) {
387
+ return $this->date_modified;
388
+ } else {
389
+ return date( 'Y-m-d H:i:s' );
390
+ }
391
+ }
392
+
393
+ /**
394
+ * Set the date modified
395
+ * @access public
396
+ * @since 3.0.13
397
+ * @return date $date_created
398
+ */
399
+ public function set_date_modified( $date = false ) {
400
+ if ( $date ) {
401
+ $this->date_modified = sanitize_text_field( $date );
402
+ } else {
403
+ $this->date_modified = date( 'Y-m-d H:i:s' );
404
+ }
405
+ return $this->date_modified;
406
+ }
407
+
408
  /**
409
  * Return the item icon
410
  * @access public
438
  'item_type' => $this->get_type(),
439
  'item_value' => $this->get_value(),
440
  'layout_value' => $this->get_layout_value(),
441
+ 'item_author' => $this->get_item_author(),
442
+ 'date_created' => $this->get_date_created(),
443
+ 'date_modified' => $this->get_date_modified(),
444
  );
445
  return $values;
446
  }
includes/class-ditty-items.php CHANGED
@@ -365,6 +365,8 @@ class Ditty_Items {
365
  $draft_id = uniqid( 'new-' );
366
  $draft_index = $editor_item->get_index() + 1;
367
  $editor_item->set_id( $draft_id );
 
 
368
  $editor_item->set_item_index( $draft_index );
369
  $data = array(
370
  'editor_item' => $editor_item->render_editor_list_item( 'return' ),
@@ -394,6 +396,8 @@ class Ditty_Items {
394
  unset( $_POST['security'] );
395
  unset( $_POST['item_id'] );
396
 
 
 
397
  $editor_item = new Ditty_Item( $item_id_ajax );
398
  $editor_item->set_item_value( $_POST );
399
 
@@ -472,7 +476,6 @@ class Ditty_Items {
472
  if ( is_array( $item_ids_ajax ) && count( $item_ids_ajax ) > 0 ) {
473
  foreach ( $item_ids_ajax as $index => $item_id ) {
474
  $editor_item = new Ditty_Item( $item_id );
475
- //$editor_item->init_draft( $ditty_id_ajax, $item_id );
476
  $editor_item->set_item_index( $index );
477
  }
478
  }
365
  $draft_id = uniqid( 'new-' );
366
  $draft_index = $editor_item->get_index() + 1;
367
  $editor_item->set_id( $draft_id );
368
+ $editor_item->set_date_created();
369
+ $editor_item->set_date_modified();
370
  $editor_item->set_item_index( $draft_index );
371
  $data = array(
372
  'editor_item' => $editor_item->render_editor_list_item( 'return' ),
396
  unset( $_POST['security'] );
397
  unset( $_POST['item_id'] );
398
 
399
+ //ChromePhp::log( '$item_id_ajax: ', $item_id_ajax );
400
+
401
  $editor_item = new Ditty_Item( $item_id_ajax );
402
  $editor_item->set_item_value( $_POST );
403
 
476
  if ( is_array( $item_ids_ajax ) && count( $item_ids_ajax ) > 0 ) {
477
  foreach ( $item_ids_ajax as $index => $item_id ) {
478
  $editor_item = new Ditty_Item( $item_id );
 
479
  $editor_item->set_item_index( $index );
480
  }
481
  }
includes/class-ditty-layout.php CHANGED
@@ -28,6 +28,7 @@ class Ditty_Layout {
28
  private $layout_id;
29
  private $item_type;
30
  private $item_value;
 
31
  private $version;
32
 
33
  /**
@@ -35,9 +36,10 @@ class Ditty_Layout {
35
  * @access public
36
  * @since 3.0
37
  */
38
- public function __construct( $layout_id, $item_type = false, $item_value = array() ) {
39
  $this->item_value = $item_value;
40
  $this->item_type = $item_type;
 
41
 
42
  // If this is a new layout
43
  if ( is_string( $layout_id ) && false !== strpos( $layout_id, 'new-' ) ) {
@@ -48,6 +50,7 @@ class Ditty_Layout {
48
  $this->construct_from_id( $layout_id );
49
  $this->parse_draft_data( $layout_id );
50
  }
 
51
  return $this;
52
  }
53
 
@@ -119,6 +122,16 @@ class Ditty_Layout {
119
  public function get_item_type() {
120
  return $this->item_type;
121
  }
 
 
 
 
 
 
 
 
 
 
122
 
123
  /**
124
  * Return the html tags
@@ -424,6 +437,7 @@ class Ditty_Layout {
424
  if ( is_array( $tags ) && count( $tags ) > 0 ) {
425
  foreach ( $tags as $i => $tag ) {
426
  $handlers->add( $tag['tag'], function( ShortcodeInterface $s ) use ( $tag, $value ) {
 
427
  $defaults = isset( $tag['atts'] ) ? $tag['atts'] : array();
428
  $atts = $this->parse_atts( $defaults, $s );
429
  $atts = apply_filters( 'ditty_layout_tag_atts', $atts, $tag['tag'], $this->get_item_type(), $value );
28
  private $layout_id;
29
  private $item_type;
30
  private $item_value;
31
+ private $item_meta;
32
  private $version;
33
 
34
  /**
36
  * @access public
37
  * @since 3.0
38
  */
39
+ public function __construct( $layout_id, $item_type = false, $item_value = array(), $item_meta = array() ) {
40
  $this->item_value = $item_value;
41
  $this->item_type = $item_type;
42
+ $this->item_meta = $item_meta;
43
 
44
  // If this is a new layout
45
  if ( is_string( $layout_id ) && false !== strpos( $layout_id, 'new-' ) ) {
50
  $this->construct_from_id( $layout_id );
51
  $this->parse_draft_data( $layout_id );
52
  }
53
+
54
  return $this;
55
  }
56
 
122
  public function get_item_type() {
123
  return $this->item_type;
124
  }
125
+
126
+ /**
127
+ * Return the item meta
128
+ * @access public
129
+ * @since 3.0.13
130
+ * @return string $item_type
131
+ */
132
+ public function get_item_meta() {
133
+ return $this->item_meta;
134
+ }
135
 
136
  /**
137
  * Return the html tags
437
  if ( is_array( $tags ) && count( $tags ) > 0 ) {
438
  foreach ( $tags as $i => $tag ) {
439
  $handlers->add( $tag['tag'], function( ShortcodeInterface $s ) use ( $tag, $value ) {
440
+ $value['item_meta'] = $this->get_item_meta();
441
  $defaults = isset( $tag['atts'] ) ? $tag['atts'] : array();
442
  $atts = $this->parse_atts( $defaults, $s );
443
  $atts = apply_filters( 'ditty_layout_tag_atts', $atts, $tag['tag'], $this->get_item_type(), $value );
includes/class-ditty-layouts.php CHANGED
@@ -332,6 +332,9 @@ class Ditty_Layouts {
332
  update_post_meta( $post_id, '_ditty_layout_html', $layout_html );
333
  update_post_meta( $post_id, '_ditty_layout_css', $layout_css );
334
 
 
 
 
335
  // Remove the version number of edited layouts
336
  delete_post_meta( $post_id, '_ditty_layout_template' );
337
  delete_post_meta( $post_id, '_ditty_layout_version' );
@@ -708,7 +711,7 @@ class Ditty_Layouts {
708
  * Return the html field to edit
709
  *
710
  * @access public
711
- * @since 3.0.12
712
  * @param json.
713
  */
714
  public function editor_fields_ajax() {
@@ -727,7 +730,7 @@ class Ditty_Layouts {
727
  if ( ! $layout = new Ditty_Layout( $layout_id_ajax, $item_type_ajax, $item_value_ajax ) ) {
728
  wp_die();
729
  }
730
-
731
  $quick_change = '';
732
  $textarea_val = '';
733
  $tags_list = '';
@@ -741,7 +744,8 @@ class Ditty_Layouts {
741
 
742
  switch( $edit_type_ajax ) {
743
  case 'html':
744
- $textarea_val = stripslashes( $layout->get_html() );
 
745
  $tags_list = $layout->get_tags_list();
746
  $quick_change = '<a href="#" class="ditty-editor-options__edit-css protip" data-pt-title="' . __( 'Edit CSS', 'ditty-news-ticker' ) . '"><i class="fas fa-eye" data-class="fas fa-eye"></i></a>';
747
  break;
@@ -856,7 +860,7 @@ class Ditty_Layouts {
856
  /**
857
  * Clone a layout via ajax
858
  *
859
- * @since 3.0
860
  */
861
  public function editor_clone_ajax() {
862
  check_ajax_referer( 'ditty', 'security' );
@@ -874,10 +878,13 @@ class Ditty_Layouts {
874
  $editor_layout->set_layout_id( $draft_id );
875
  $editor_layout->set_label( $draft_label );
876
  $editor_layout->remove_version();
 
 
 
877
  $data = array(
878
  'editor_layout' => $editor_layout->render_editor_list_item( 'return' ),
879
  'draft_id' => $draft_id,
880
- 'draft_meta' => $editor_layout->custom_meta(),
881
  );
882
  wp_send_json( $data );
883
  }
@@ -973,7 +980,7 @@ class Ditty_Layouts {
973
  * Save layout draft values on Ditty update
974
  *
975
  * @access public
976
- * @since 3.0
977
  */
978
  public function update_drafts( $ditty_id, $draft_values ) {
979
  if ( ! current_user_can( 'edit_ditty_layouts' ) ) {
@@ -1021,7 +1028,8 @@ class Ditty_Layouts {
1021
 
1022
  // Update a layout html
1023
  if ( isset( $layout_data['html'] ) ) {
1024
- update_post_meta( $layout_id, '_ditty_layout_html', wp_kses_post( $layout_data['html'] ) );
 
1025
  }
1026
 
1027
  // Update a layout css
@@ -1029,6 +1037,9 @@ class Ditty_Layouts {
1029
  update_post_meta( $layout_id, '_ditty_layout_css', wp_kses_post( $layout_data['css'] ) );
1030
  }
1031
 
 
 
 
1032
  // Remove the version number of edited layouts
1033
  delete_post_meta( $layout_id, '_ditty_layout_version' );
1034
  delete_post_meta( $layout_id, '_ditty_layout_template' );
332
  update_post_meta( $post_id, '_ditty_layout_html', $layout_html );
333
  update_post_meta( $post_id, '_ditty_layout_css', $layout_css );
334
 
335
+ // Possibly add a uniq_id
336
+ ditty_maybe_add_uniq_id( $post_id );
337
+
338
  // Remove the version number of edited layouts
339
  delete_post_meta( $post_id, '_ditty_layout_template' );
340
  delete_post_meta( $post_id, '_ditty_layout_version' );
711
  * Return the html field to edit
712
  *
713
  * @access public
714
+ * @since 3.0.13
715
  * @param json.
716
  */
717
  public function editor_fields_ajax() {
730
  if ( ! $layout = new Ditty_Layout( $layout_id_ajax, $item_type_ajax, $item_value_ajax ) ) {
731
  wp_die();
732
  }
733
+
734
  $quick_change = '';
735
  $textarea_val = '';
736
  $tags_list = '';
744
 
745
  switch( $edit_type_ajax ) {
746
  case 'html':
747
+ //$textarea_val = stripslashes( $layout->get_html() );
748
+ $textarea_val = $layout->get_html();
749
  $tags_list = $layout->get_tags_list();
750
  $quick_change = '<a href="#" class="ditty-editor-options__edit-css protip" data-pt-title="' . __( 'Edit CSS', 'ditty-news-ticker' ) . '"><i class="fas fa-eye" data-class="fas fa-eye"></i></a>';
751
  break;
860
  /**
861
  * Clone a layout via ajax
862
  *
863
+ * @since 3.0.13
864
  */
865
  public function editor_clone_ajax() {
866
  check_ajax_referer( 'ditty', 'security' );
878
  $editor_layout->set_layout_id( $draft_id );
879
  $editor_layout->set_label( $draft_label );
880
  $editor_layout->remove_version();
881
+
882
+ $draft_meta = $editor_layout->custom_meta();
883
+ unset( $draft_meta['description'] );
884
  $data = array(
885
  'editor_layout' => $editor_layout->render_editor_list_item( 'return' ),
886
  'draft_id' => $draft_id,
887
+ 'draft_meta' => $draft_meta,
888
  );
889
  wp_send_json( $data );
890
  }
980
  * Save layout draft values on Ditty update
981
  *
982
  * @access public
983
+ * @since 3.0.13
984
  */
985
  public function update_drafts( $ditty_id, $draft_values ) {
986
  if ( ! current_user_can( 'edit_ditty_layouts' ) ) {
1028
 
1029
  // Update a layout html
1030
  if ( isset( $layout_data['html'] ) ) {
1031
+ $html = str_replace( '\\', '\\\\', $layout_data['html'] );
1032
+ update_post_meta( $layout_id, '_ditty_layout_html', wp_kses_post( $html ) );
1033
  }
1034
 
1035
  // Update a layout css
1037
  update_post_meta( $layout_id, '_ditty_layout_css', wp_kses_post( $layout_data['css'] ) );
1038
  }
1039
 
1040
+ // Possibly add a uniq_id
1041
+ ditty_maybe_add_uniq_id( $layout_id );
1042
+
1043
  // Remove the version number of edited layouts
1044
  delete_post_meta( $layout_id, '_ditty_layout_version' );
1045
  delete_post_meta( $layout_id, '_ditty_layout_template' );
includes/class-ditty-singles.php CHANGED
@@ -32,6 +32,7 @@ class Ditty_Singles {
32
  // General hooks
33
  add_filter( 'post_row_actions', array( $this, 'modify_list_row_actions' ), 10, 2 );
34
  add_action( 'mtphr_post_duplicator_created', array( $this, 'after_duplicate_post' ), 10, 3 );
 
35
 
36
  // Editor elements
37
  add_action( 'ditty_editor_tabs', array( $this, 'editor_tab' ), 100, 2 );
@@ -95,11 +96,13 @@ class Ditty_Singles {
95
  $initialized = get_post_meta( $ditty_id, '_ditty_init', true );
96
  $title = ( ! $initialized ) ? sprintf( __( 'Ditty %d', 'ditty-news-ticker' ), $ditty_id ) : get_the_title( $ditty_id );
97
  $status = get_post_status( $ditty_id );
98
- $settings = get_post_meta( $ditty_id, '_ditty_settings', true );
99
  if ( ! $initialized ) {
100
  $status = 'publish';
101
  }
102
  $shortcode = "[ditty id={$ditty_id}]";
 
 
 
103
  $fields = array(
104
  'title' => array(
105
  'type' => 'text',
@@ -193,66 +196,83 @@ class Ditty_Singles {
193
  return false;
194
  }
195
  $initialized = get_post_meta( $post->ID, '_ditty_init', true );
196
- $settings = get_post_meta( $post->ID, '_ditty_settings', true );
197
- $title = ( ! $initialized ) ? sprintf( __( 'Ditty %d', 'ditty-news-ticker' ), $post->ID ) : $post->post_title;
198
- $style = '';
199
- if ( is_array( $settings ) && isset( $settings['previewBg'] ) ) {
200
- $style .= "background-color:{$settings['previewBg']};";
201
- }
202
- if ( is_array( $settings ) && isset( $settings['previewPadding'] ) && is_array( $settings['previewPadding'] ) ) {
203
- if ( isset( $settings['previewPadding']['paddingTop'] ) ) {
204
- $style .= "padding-top:{$settings['previewPadding']['paddingTop']};";
205
- }
206
- if ( isset( $settings['previewPadding']['paddingBottom'] ) ) {
207
- $style .= "padding-bottom:{$settings['previewPadding']['paddingBottom']};";
208
  }
209
- if ( isset( $settings['previewPadding']['paddingLeft'] ) ) {
210
- $style .= "padding-left:{$settings['previewPadding']['paddingLeft']};";
211
- }
212
- if ( isset( $settings['previewPadding']['paddingRight'] ) ) {
213
- $style .= "padding-right:{$settings['previewPadding']['paddingRight']};";
 
 
 
 
 
 
 
 
214
  }
215
- }
216
- ?>
217
- <div id="ditty-page" class="wrap">
218
- <div id="ditty-page__header">
219
- <h2><span class="ditty-post__title"><?php echo $title; ?></span></h2>
220
- </div>
221
- <div id="ditty-page__content">
222
- <div id="ditty-editor">
223
- <div id="ditty-editor__settings"></div>
224
- <div id="ditty-editor__preview" style="<?php echo $style; ?>">
225
- <?php
226
- $display = get_post_meta( $post->ID, '_ditty_display', true );
227
- if ( ! $display || ! ditty_display_exists( $display ) ) {
228
- $display = ditty_default_display( $post->ID );
229
- }
230
- $atts = array(
231
- 'id' => $post->ID,
232
- 'display' => $display,
233
- 'uniqid' => 'ditty-preview-' . $post->ID,
234
- 'class' => 'ditty-preview',
235
- 'show_editor' => 1,
236
- //'load_type' => '',
237
- );
238
- echo ditty_render( $atts );
239
- ?>
240
- <div id="ditty-preview__overlay" class="ditty-updating-overlay">
241
- <div class="ditty-updating-overlay__inner">
242
- <i class="fas fa-sync-alt fa-spin"></i>
243
  </div>
244
  </div>
245
  </div>
246
  </div>
247
- </div>
248
- </div><!-- /.wrap -->
249
- <?php
250
  }
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  /**
253
  * Duplicate Ditty items on Post Duplicator duplication
254
  *
255
- * @since 3.0.10
256
  * @return void
257
  */
258
  public function after_duplicate_post( $original_id, $duplicate_id, $settings ) {
@@ -263,6 +283,8 @@ class Ditty_Singles {
263
  if ( is_array( $all_meta ) && count( $all_meta ) > 0 ) {
264
  foreach ( $all_meta as $i => $meta ) {
265
  unset( $meta->item_id );
 
 
266
  $meta->ditty_id = $duplicate_id;
267
  Ditty()->db_items->insert( $meta, 'item' );
268
  }
@@ -405,7 +427,6 @@ class Ditty_Singles {
405
  $display_settings_ajax = isset( $_POST['display_settings'] ) ? esc_attr( $_POST['display_settings'] ) : false;
406
  $layout_settings_ajax = isset( $_POST['layout_settings'] ) ? esc_attr( $_POST['layout_settings'] ) : false;
407
  $editor_ajax = isset( $_POST['editor'] ) ? intval( $_POST['editor'] ) : false;
408
- //$load_type = isset( $_POST['loud_type'] ) ? intval( $_POST['loud_type'] ) : '';
409
 
410
  // Get the display attributes
411
  if ( ! $display_ajax ) {
@@ -419,13 +440,13 @@ class Ditty_Singles {
419
 
420
  // Setup the ditty values
421
  $status = get_post_status( $id_ajax );
422
- $args = $display->get_values();
423
- $args['id'] = $id_ajax;
424
- $args['uniqid'] = $uniqid_ajax;
425
- $args['title'] = get_the_title( $id_ajax );
426
- $args['status'] = $status;
427
- $args['display'] = $display->get_display_id();
428
- $args['showEditor'] = $editor_ajax;
429
 
430
  $items = ditty_display_items( $id_ajax, 'force', $layout_settings_ajax );
431
  if ( ! is_array( $items ) ) {
@@ -453,7 +474,7 @@ class Ditty_Singles {
453
  if ( ! $atts['data-id'] ) {
454
  return false;
455
  }
456
-
457
  $ditty_id = $atts['data-id'];
458
  $uniqid = isset( $atts['data-uniqid'] ) ? $atts['data-uniqid'] : false;
459
  $display_id = isset( $atts['data-display'] ) ? $atts['data-display'] : false;
@@ -544,13 +565,17 @@ class Ditty_Singles {
544
  * Sanitize setting values before saving to the database
545
  *
546
  * @access public
547
- * @since 3.0.11
548
  */
549
  public function sanitize_settings( $settings ) {
 
 
550
  $sanitized_settings = array();
551
- $sanitized_settings['ajax_loading'] = isset( $settings['ajax_loading'] ) ? esc_attr( $settings['ajax_loading'] ) : 'no';
552
- $sanitized_settings['live_updates'] = isset( $settings['live_updates'] ) ? esc_attr( $settings['live_updates'] ) : 'no';
553
- $sanitized_settings['previewBg'] = isset( $settings['previewBg'] ) ? sanitize_text_field( $settings['previewBg'] ) : false;
 
 
554
  $sanitized_padding = array();
555
  if ( isset( $settings['previewPadding'] ) && is_array( $settings['previewPadding'] ) && count( $settings['previewPadding'] ) > 0 ) {
556
  foreach ( $settings['previewPadding'] as $key => $value ) {
@@ -593,7 +618,7 @@ class Ditty_Singles {
593
  $sanitized_item['ditty_id'] = intval( $item_data['ditty_id'] );
594
  }
595
  if ( isset( $item_data['item_id'] ) ) {
596
- $sanitized_item['item_id'] = intval( $item_data['item_id'] );
597
  }
598
  if ( isset( $item_data['item_index'] ) ) {
599
  $sanitized_item['item_index'] = intval( $item_data['item_index'] );
@@ -617,7 +642,7 @@ class Ditty_Singles {
617
  * Save draft values on Ditty editor update
618
  *
619
  * @access public
620
- * @since 3.0.12
621
  */
622
  public function editor_save_ajax() {
623
  check_ajax_referer( 'ditty', 'security' );
@@ -649,6 +674,9 @@ class Ditty_Singles {
649
  }
650
  $sanitized_settings = $this->sanitize_settings( $draft_values_ajax['settings'] );
651
  update_post_meta( $ditty_id_ajax, '_ditty_settings', $sanitized_settings );
 
 
 
652
  }
653
 
654
  // Publish the ditty if this is a new post
@@ -704,6 +732,9 @@ class Ditty_Singles {
704
  if ( isset( $item_data['data'] ) ) {
705
  $sanitized_item_data = $this->sanitize_item_data( $item_data['data'] );
706
  if ( false !== strpos( $item_id, 'new-' ) ) {
 
 
 
707
  if ( $new_item_id = Ditty()->db_items->insert( apply_filters( 'ditty_item_db_data', $sanitized_item_data, $ditty_id_ajax ), 'item' ) ) {
708
  if ( ! isset( $json_data['ditty_new_item_ids'] ) ) {
709
  $json_data['ditty_new_item_ids'] = array();
@@ -712,6 +743,10 @@ class Ditty_Singles {
712
  $item_id = $new_item_id;
713
  }
714
  } else {
 
 
 
 
715
  Ditty()->db_items->update( $item_id, apply_filters( 'ditty_item_db_data', $sanitized_item_data, $ditty_id_ajax ), 'item_id' );
716
  }
717
  }
@@ -734,7 +769,10 @@ class Ditty_Singles {
734
  unset( $item['item_id'] );
735
  $sanitized_item_data = $this->sanitize_item_data( $item );
736
  Ditty()->db_items->insert( apply_filters( 'ditty_item_db_data', $sanitized_item_data, $ditty_id_ajax ), 'item' );
737
- }
 
 
 
738
 
739
  $display_items = ditty_display_items( $ditty_id_ajax, 'force' );
740
  if ( boolval( $return_items_ajax ) ) {
32
  // General hooks
33
  add_filter( 'post_row_actions', array( $this, 'modify_list_row_actions' ), 10, 2 );
34
  add_action( 'mtphr_post_duplicator_created', array( $this, 'after_duplicate_post' ), 10, 3 );
35
+ add_filter( 'admin_body_class', array( $this, 'add_admin_body_class' ) );
36
 
37
  // Editor elements
38
  add_action( 'ditty_editor_tabs', array( $this, 'editor_tab' ), 100, 2 );
96
  $initialized = get_post_meta( $ditty_id, '_ditty_init', true );
97
  $title = ( ! $initialized ) ? sprintf( __( 'Ditty %d', 'ditty-news-ticker' ), $ditty_id ) : get_the_title( $ditty_id );
98
  $status = get_post_status( $ditty_id );
 
99
  if ( ! $initialized ) {
100
  $status = 'publish';
101
  }
102
  $shortcode = "[ditty id={$ditty_id}]";
103
+
104
+ $settings = ditty_single_settings( $ditty_id );
105
+
106
  $fields = array(
107
  'title' => array(
108
  'type' => 'text',
196
  return false;
197
  }
198
  $initialized = get_post_meta( $post->ID, '_ditty_init', true );
199
+ if ( ! $initialized && ditty_wizard_enabled() ) {
200
+ ditty_wizard( $post );
201
+ } else {
202
+ $settings = get_post_meta( $post->ID, '_ditty_settings', true );
203
+ $title = ( ! $initialized ) ? sprintf( __( 'Ditty %d', 'ditty-news-ticker' ), $post->ID ) : $post->post_title;
204
+ $style = '';
205
+ if ( is_array( $settings ) && isset( $settings['previewBg'] ) ) {
206
+ $style .= "background-color:{$settings['previewBg']};";
 
 
 
 
207
  }
208
+ if ( is_array( $settings ) && isset( $settings['previewPadding'] ) && is_array( $settings['previewPadding'] ) ) {
209
+ if ( isset( $settings['previewPadding']['paddingTop'] ) ) {
210
+ $style .= "padding-top:{$settings['previewPadding']['paddingTop']};";
211
+ }
212
+ if ( isset( $settings['previewPadding']['paddingBottom'] ) ) {
213
+ $style .= "padding-bottom:{$settings['previewPadding']['paddingBottom']};";
214
+ }
215
+ if ( isset( $settings['previewPadding']['paddingLeft'] ) ) {
216
+ $style .= "padding-left:{$settings['previewPadding']['paddingLeft']};";
217
+ }
218
+ if ( isset( $settings['previewPadding']['paddingRight'] ) ) {
219
+ $style .= "padding-right:{$settings['previewPadding']['paddingRight']};";
220
+ }
221
  }
222
+ ?>
223
+ <div id="ditty-page" class="wrap">
224
+ <div id="ditty-page__header">
225
+ <h2><span class="ditty-post__title"><?php echo $title; ?></span></h2>
226
+ </div>
227
+ <div id="ditty-page__content">
228
+ <div id="ditty-editor">
229
+ <div id="ditty-editor__settings"></div>
230
+ <div id="ditty-editor__preview" style="<?php echo $style; ?>">
231
+ <?php
232
+ $display = get_post_meta( $post->ID, '_ditty_display', true );
233
+ if ( ! $display || ! ditty_display_exists( $display ) ) {
234
+ $display = ditty_default_display( $post->ID );
235
+ }
236
+ $atts = array(
237
+ 'id' => $post->ID,
238
+ 'display' => $display,
239
+ 'uniqid' => 'ditty-preview-' . $post->ID,
240
+ 'class' => 'ditty-preview',
241
+ 'show_editor' => 1,
242
+ //'load_type' => '',
243
+ );
244
+ echo ditty_render( $atts );
245
+ ?>
246
+ <div id="ditty-preview__overlay" class="ditty-updating-overlay">
247
+ <div class="ditty-updating-overlay__inner">
248
+ <i class="fas fa-sync-alt fa-spin"></i>
249
+ </div>
250
  </div>
251
  </div>
252
  </div>
253
  </div>
254
+ </div><!-- /.wrap -->
255
+ <?php
256
+ }
257
  }
258
 
259
+ /**
260
+ * Add to the admin body class
261
+ *
262
+ * @access public
263
+ * @since 3.0.13
264
+ */
265
+ public function add_admin_body_class( $classes ) {
266
+ if ( ditty_wizard_enabled() ) {
267
+ $classes .= ' ditty-wizard-enabled ';
268
+ }
269
+ return $classes;
270
+ }
271
+
272
  /**
273
  * Duplicate Ditty items on Post Duplicator duplication
274
  *
275
+ * @since 3.0.13
276
  * @return void
277
  */
278
  public function after_duplicate_post( $original_id, $duplicate_id, $settings ) {
283
  if ( is_array( $all_meta ) && count( $all_meta ) > 0 ) {
284
  foreach ( $all_meta as $i => $meta ) {
285
  unset( $meta->item_id );
286
+ unset( $meta->date_created );
287
+ unset( $meta->date_modified );
288
  $meta->ditty_id = $duplicate_id;
289
  Ditty()->db_items->insert( $meta, 'item' );
290
  }
427
  $display_settings_ajax = isset( $_POST['display_settings'] ) ? esc_attr( $_POST['display_settings'] ) : false;
428
  $layout_settings_ajax = isset( $_POST['layout_settings'] ) ? esc_attr( $_POST['layout_settings'] ) : false;
429
  $editor_ajax = isset( $_POST['editor'] ) ? intval( $_POST['editor'] ) : false;
 
430
 
431
  // Get the display attributes
432
  if ( ! $display_ajax ) {
440
 
441
  // Setup the ditty values
442
  $status = get_post_status( $id_ajax );
443
+ $args = $display->get_values();
444
+ $args['id'] = $id_ajax;
445
+ $args['uniqid'] = $uniqid_ajax;
446
+ $args['title'] = get_the_title( $id_ajax );
447
+ $args['status'] = $status;
448
+ $args['display'] = $display->get_display_id();
449
+ $args['showEditor'] = $editor_ajax;
450
 
451
  $items = ditty_display_items( $id_ajax, 'force', $layout_settings_ajax );
452
  if ( ! is_array( $items ) ) {
474
  if ( ! $atts['data-id'] ) {
475
  return false;
476
  }
477
+
478
  $ditty_id = $atts['data-id'];
479
  $uniqid = isset( $atts['data-uniqid'] ) ? $atts['data-uniqid'] : false;
480
  $display_id = isset( $atts['data-display'] ) ? $atts['data-display'] : false;
565
  * Sanitize setting values before saving to the database
566
  *
567
  * @access public
568
+ * @since 3.0.13
569
  */
570
  public function sanitize_settings( $settings ) {
571
+ $defaults = ditty_single_settings_defaults();
572
+
573
  $sanitized_settings = array();
574
+ $sanitized_settings['ajax_loading'] = isset( $settings['ajax_loading'] ) ? esc_attr( $settings['ajax_loading'] ) : esc_attr( $defaults['ajax_loading'] ) ;
575
+ $sanitized_settings['live_updates'] = isset( $settings['live_updates'] ) ? esc_attr( $settings['live_updates'] ) : esc_attr( $defaults['ajax_loading'] ) ;
576
+
577
+ // Sanitize preview settings
578
+ $sanitized_settings['previewBg'] = isset( $settings['previewBg'] ) ? sanitize_text_field( $settings['previewBg'] ) : sanitize_text_field( $defaults['previewBg'] );
579
  $sanitized_padding = array();
580
  if ( isset( $settings['previewPadding'] ) && is_array( $settings['previewPadding'] ) && count( $settings['previewPadding'] ) > 0 ) {
581
  foreach ( $settings['previewPadding'] as $key => $value ) {
618
  $sanitized_item['ditty_id'] = intval( $item_data['ditty_id'] );
619
  }
620
  if ( isset( $item_data['item_id'] ) ) {
621
+ $sanitized_item['item_id'] = esc_attr( $item_data['item_id'] );
622
  }
623
  if ( isset( $item_data['item_index'] ) ) {
624
  $sanitized_item['item_index'] = intval( $item_data['item_index'] );
642
  * Save draft values on Ditty editor update
643
  *
644
  * @access public
645
+ * @since 3.0.13
646
  */
647
  public function editor_save_ajax() {
648
  check_ajax_referer( 'ditty', 'security' );
674
  }
675
  $sanitized_settings = $this->sanitize_settings( $draft_values_ajax['settings'] );
676
  update_post_meta( $ditty_id_ajax, '_ditty_settings', $sanitized_settings );
677
+ } elseif( ! $initialized ) {
678
+ $sanitized_settings = $this->sanitize_settings( array() );
679
+ update_post_meta( $ditty_id_ajax, '_ditty_settings', $sanitized_settings );
680
  }
681
 
682
  // Publish the ditty if this is a new post
732
  if ( isset( $item_data['data'] ) ) {
733
  $sanitized_item_data = $this->sanitize_item_data( $item_data['data'] );
734
  if ( false !== strpos( $item_id, 'new-' ) ) {
735
+
736
+ // Set the item_author
737
+ $sanitized_item_data['item_author'] = get_current_user_id();
738
  if ( $new_item_id = Ditty()->db_items->insert( apply_filters( 'ditty_item_db_data', $sanitized_item_data, $ditty_id_ajax ), 'item' ) ) {
739
  if ( ! isset( $json_data['ditty_new_item_ids'] ) ) {
740
  $json_data['ditty_new_item_ids'] = array();
743
  $item_id = $new_item_id;
744
  }
745
  } else {
746
+ // Only update the modified date if the value is changed
747
+ if ( array_key_exists( 'item_value', $sanitized_item_data ) ) {
748
+ $sanitized_item_data['date_modified'] = date( 'Y-m-d H:i:s' );
749
+ }
750
  Ditty()->db_items->update( $item_id, apply_filters( 'ditty_item_db_data', $sanitized_item_data, $ditty_id_ajax ), 'item_id' );
751
  }
752
  }
769
  unset( $item['item_id'] );
770
  $sanitized_item_data = $this->sanitize_item_data( $item );
771
  Ditty()->db_items->insert( apply_filters( 'ditty_item_db_data', $sanitized_item_data, $ditty_id_ajax ), 'item' );
772
+ }
773
+
774
+ // Possibly add a uniq_id
775
+ ditty_maybe_add_uniq_id( $ditty_id_ajax );
776
 
777
  $display_items = ditty_display_items( $ditty_id_ajax, 'force' );
778
  if ( boolval( $return_items_ajax ) ) {
includes/class-ditty.php CHANGED
@@ -224,7 +224,7 @@ class Ditty {
224
  * Create an instance of the loader which will be used to register the hooks
225
  * with WordPress.
226
  *
227
- * @since 3.0
228
  * @access private
229
  */
230
  private function includes() {
@@ -246,6 +246,7 @@ class Ditty {
246
  require_once DITTY_DIR . 'includes/fields/ditty-field-divider.php';
247
  require_once DITTY_DIR . 'includes/fields/ditty-field-file.php';
248
  require_once DITTY_DIR . 'includes/fields/ditty-field-group.php';
 
249
  require_once DITTY_DIR . 'includes/fields/ditty-field-html.php';
250
  require_once DITTY_DIR . 'includes/fields/ditty-field-image.php';
251
  require_once DITTY_DIR . 'includes/fields/ditty-field-number.php';
@@ -265,11 +266,13 @@ class Ditty {
265
  require_once DITTY_DIR . 'includes/layout-tags.php';
266
  require_once DITTY_DIR . 'includes/layout-tag-helpers.php';
267
  require_once DITTY_DIR . 'includes/layout-tag-hooks.php';
 
268
  require_once DITTY_DIR . 'includes/layout-tag-hooks-posts.php';
269
  require_once DITTY_DIR . 'includes/layout-templates.php';
270
  require_once DITTY_DIR . 'includes/post-types.php';
271
  require_once DITTY_DIR . 'includes/upgrades.php';
272
  require_once DITTY_DIR . 'includes/widget.php';
 
273
 
274
  // Add database files
275
  require_once DITTY_DIR . 'includes/class-ditty-db.php';
@@ -316,6 +319,7 @@ class Ditty {
316
  require_once DITTY_DIR . 'includes/admin/Ditty_Plugin_Updater.php';
317
  }
318
  require_once DITTY_DIR . 'includes/admin/columns.php';
 
319
  require_once DITTY_DIR . 'includes/admin/notices.php';
320
  require_once DITTY_DIR . 'includes/admin/settings.php';
321
  //require_once DITTY_DIR . 'includes/admin/info.php';
@@ -517,6 +521,7 @@ class Ditty {
517
  'jquery',
518
  'jquery-ui-core',
519
  'jquery-ui-sortable',
 
520
  'wp-i18n',
521
  ), $this->version, true );
522
 
224
  * Create an instance of the loader which will be used to register the hooks
225
  * with WordPress.
226
  *
227
+ * @since 3.0.13
228
  * @access private
229
  */
230
  private function includes() {
246
  require_once DITTY_DIR . 'includes/fields/ditty-field-divider.php';
247
  require_once DITTY_DIR . 'includes/fields/ditty-field-file.php';
248
  require_once DITTY_DIR . 'includes/fields/ditty-field-group.php';
249
+ require_once DITTY_DIR . 'includes/fields/ditty-field-heading.php';
250
  require_once DITTY_DIR . 'includes/fields/ditty-field-html.php';
251
  require_once DITTY_DIR . 'includes/fields/ditty-field-image.php';
252
  require_once DITTY_DIR . 'includes/fields/ditty-field-number.php';
266
  require_once DITTY_DIR . 'includes/layout-tags.php';
267
  require_once DITTY_DIR . 'includes/layout-tag-helpers.php';
268
  require_once DITTY_DIR . 'includes/layout-tag-hooks.php';
269
+ require_once DITTY_DIR . 'includes/layout-tag-hooks-default.php';
270
  require_once DITTY_DIR . 'includes/layout-tag-hooks-posts.php';
271
  require_once DITTY_DIR . 'includes/layout-templates.php';
272
  require_once DITTY_DIR . 'includes/post-types.php';
273
  require_once DITTY_DIR . 'includes/upgrades.php';
274
  require_once DITTY_DIR . 'includes/widget.php';
275
+ require_once DITTY_DIR . 'includes/wizard.php';
276
 
277
  // Add database files
278
  require_once DITTY_DIR . 'includes/class-ditty-db.php';
319
  require_once DITTY_DIR . 'includes/admin/Ditty_Plugin_Updater.php';
320
  }
321
  require_once DITTY_DIR . 'includes/admin/columns.php';
322
+ require_once DITTY_DIR . 'includes/admin/export.php';
323
  require_once DITTY_DIR . 'includes/admin/notices.php';
324
  require_once DITTY_DIR . 'includes/admin/settings.php';
325
  //require_once DITTY_DIR . 'includes/admin/info.php';
521
  'jquery',
522
  'jquery-ui-core',
523
  'jquery-ui-sortable',
524
+ 'jquery-effects-core',
525
  'wp-i18n',
526
  ), $this->version, true );
527
 
includes/css/ditty-admin.css CHANGED
@@ -96,6 +96,31 @@ table.wp-list-table .type-ditty_display .row-actions {
96
  .ditty-dashboard-notice .ditty-features-list li i {
97
  margin-right: 5px; }
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  .ditty-field {
100
  padding: 10px 0;
101
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
@@ -105,11 +130,13 @@ table.wp-list-table .type-ditty_display .row-actions {
105
  position: relative; }
106
  .ditty-field__label {
107
  display: block;
 
108
  font-weight: 600;
109
  margin-bottom: 10px;
110
  cursor: default; }
111
  .ditty-field__help {
112
- font-size: 0.8em; }
 
113
  .ditty-field__input {
114
  display: flex;
115
  flex-direction: row;
@@ -127,6 +154,8 @@ table.wp-list-table .type-ditty_display .row-actions {
127
  margin-right: 5px; }
128
  .ditty-field__input__after {
129
  margin-left: 5px; }
 
 
130
  .ditty-field__input input:not([type="button"]):not([type="checkbox"]):not([type="radio"]),
131
  .ditty-field__input select,
132
  .ditty-field__input textarea {
@@ -182,8 +211,9 @@ table.wp-list-table .type-ditty_display .row-actions {
182
  .ditty-field__actions__clone {
183
  margin-bottom: 0; }
184
 
185
- .ditty-field__label + .ditty-field__description {
186
- margin-top: 5px; }
 
187
 
188
  .ditty-field--clone-enabled .ditty-input--clone {
189
  background: #f7f7f7;
@@ -215,8 +245,8 @@ table.wp-list-table .type-ditty_display .row-actions {
215
  flex-wrap: wrap; }
216
  .ditty-field-type--group > .ditty-field__heading {
217
  display: flex;
218
- flex-direction: row;
219
- align-items: center;
220
  justify-content: flex-start;
221
  color: #FFF;
222
  background: #32373C;
@@ -224,6 +254,9 @@ table.wp-list-table .type-ditty_display .row-actions {
224
  margin: 0; }
225
  .ditty-field-type--group > .ditty-field__heading label {
226
  margin-bottom: 0; }
 
 
 
227
  .ditty-field-type--group .ditty-field__collapsible-toggle {
228
  position: absolute;
229
  right: 10px;
@@ -242,10 +275,15 @@ table.wp-list-table .type-ditty_display .row-actions {
242
  transition: -webkit-transform .25s ease;
243
  transition: transform .25s ease;
244
  transition: transform .25s ease, -webkit-transform .25s ease; }
 
 
245
  .ditty-field-type--group[data-collapsible="expanded"] .ditty-field__collapsible-toggle {
246
  -webkit-transform: rotate(180deg);
247
  transform: rotate(180deg); }
248
 
 
 
 
249
  .ditty-input--group {
250
  margin: 0; }
251
  .ditty-input--group__container > .ditty-field {
@@ -257,20 +295,25 @@ table.wp-list-table .type-ditty_display .row-actions {
257
  border-bottom: none; }
258
 
259
  /* Checkboxes */
260
- .ditty-field-type--checkboxes > .ditty-field__input {
261
- margin: -2px; }
262
-
263
- .ditty-field-type--checkboxes .ditty-input--checkboxes__group {
264
  display: flex;
265
- flex-direction: row;
266
- align-items: center;
267
  justify-content: flex-start;
268
  flex-wrap: wrap; }
269
- .ditty-field-type--checkboxes .ditty-input--checkboxes__group > .ditty-field {
270
- margin: 2px; }
271
-
272
- .ditty-field-type--checkboxes input[type="checkbox"] {
273
- margin-top: 0; }
 
 
 
 
 
 
 
 
274
 
275
  .ditty-field-type--checkbox input[type="checkbox"] {
276
  margin-top: 0; }
@@ -282,8 +325,7 @@ table.wp-list-table .type-ditty_display .row-actions {
282
  display: flex;
283
  flex-direction: column;
284
  align-items: flex-start;
285
- justify-content: flex-start;
286
- min-height: 36px; }
287
  .ditty-field-type--radio .ditty-input--radio--inline .ditty-field__input__primary {
288
  flex-direction: row;
289
  align-items: center; }
@@ -362,7 +404,8 @@ table.wp-list-table .type-ditty_display .row-actions {
362
  width: 25%;
363
  background: transparent;
364
  padding: 2px !important;
365
- margin: 0; }
 
366
  .ditty-input--spacing__group .ditty-field__input {
367
  position: relative;
368
  border-radius: 3px;
@@ -469,7 +512,8 @@ table.wp-list-table .type-ditty_display .row-actions {
469
  background: rgba(0, 0, 0, 0.05); }
470
 
471
  .ditty-input--divider__description {
472
- width: 100%; }
 
473
 
474
  /* Date */
475
  .ditty-field-type--date .ditty-field__input {
@@ -530,6 +574,11 @@ table.wp-list-table .type-ditty_display .row-actions {
530
  -o-object-fit: cover;
531
  object-fit: cover; }
532
 
 
 
 
 
 
533
  /* File */
534
  .ditty-input--file .ditty-field__input__primary {
535
  display: flex;
@@ -548,6 +597,21 @@ table.wp-list-table .type-ditty_display .row-actions {
548
  border-top-left-radius: 0;
549
  border-bottom-left-radius: 0; }
550
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  .datepicker-container {
552
  background-color: #fff;
553
  direction: ltr;
@@ -1494,8 +1558,7 @@ table.wp-list-table .type-ditty_display .row-actions {
1494
  text-align: center;
1495
  text-decoration: none;
1496
  background-color: #32373C;
1497
- border: none;
1498
- transition: color .25s ease, background-color .25s ease; }
1499
  .ditty-settings__tab i {
1500
  position: absolute;
1501
  top: 10px;
@@ -1508,11 +1571,17 @@ table.wp-list-table .type-ditty_display .row-actions {
1508
  color: #FFF;
1509
  outline: none;
1510
  box-shadow: none; }
1511
- .ditty-settings__tab:hover {
1512
  color: #FFF;
1513
- background-color: rgba(255, 255, 255, 0.2); }
 
 
 
 
1514
  .ditty-settings__tab.active {
1515
  background-color: #19BF7C; }
 
 
1516
  .ditty-settings__tab.active:after {
1517
  right: 0;
1518
  border: 9px solid transparent;
@@ -1528,8 +1597,7 @@ table.wp-list-table .type-ditty_display .row-actions {
1528
  .ditty-settings__panel {
1529
  display: none; }
1530
  .ditty-settings__panel > .ditty-field {
1531
- padding-left: 30px;
1532
- padding-right: 30px; }
1533
 
1534
  .ditty-settings__form {
1535
  position: relative;
@@ -1593,9 +1661,6 @@ table.wp-list-table .type-ditty_display .row-actions {
1593
  margin-left: 10px; }
1594
 
1595
  /* Global Dittys */
1596
- .ditty-settings__panel--global_ditty {
1597
- padding: 10px 0; }
1598
-
1599
  .ditty-field--global_ditty .ditty-input--clone {
1600
  margin-bottom: 5px; }
1601
 
@@ -1604,7 +1669,8 @@ table.wp-list-table .type-ditty_display .row-actions {
1604
 
1605
  @media (max-width: 600px) {
1606
  .ditty-settings__tabs {
1607
- width: 44px; }
 
1608
  .ditty-settings__tab {
1609
  padding: 10px 4px 10px 14px;
1610
  width: auto; }
@@ -1635,8 +1701,8 @@ table.wp-list-table .type-ditty_display .row-actions {
1635
  align-items: flex-start;
1636
  justify-content: flex-start; }
1637
  .ditty-settings__panel:not(.ditty-settings__panel--global_ditty) > .ditty-field > .ditty-field__heading {
1638
- flex: 0 0 200px;
1639
- margin-right: 30px; }
1640
  .ditty-settings__panel:not(.ditty-settings__panel--global_ditty) > .ditty-field > .ditty-field__heading > .ditty-field__label,
1641
  .ditty-settings__panel:not(.ditty-settings__panel--global_ditty) > .ditty-field > .ditty-field__heading > .ditty-field__description {
1642
  margin-bottom: 0; }
@@ -1704,3 +1770,214 @@ table.wp-list-table .type-ditty_display .row-actions {
1704
  font-weight: 400;
1705
  color: #FFF;
1706
  margin: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  .ditty-dashboard-notice .ditty-features-list li i {
97
  margin-right: 5px; }
98
 
99
+ .ditty-upgrade__element {
100
+ display: flex;
101
+ flex-direction: row;
102
+ align-items: stretch;
103
+ justify-content: flex-start;
104
+ flex-wrap: wrap; }
105
+
106
+ .ditty-upgrade__start {
107
+ flex: 0 0 auto;
108
+ border-top-right-radius: 0 !important;
109
+ border-bottom-right-radius: 0 !important; }
110
+
111
+ .ditty-upgrade__bar {
112
+ flex: 1;
113
+ background: #F7F7F7;
114
+ border: 1px solid #c3c4c7;
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); }
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;
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 {
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;
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;
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;
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 {
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; }
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; }
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;
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 {
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;
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;
1558
  text-align: center;
1559
  text-decoration: none;
1560
  background-color: #32373C;
1561
+ border: none; }
 
1562
  .ditty-settings__tab i {
1563
  position: absolute;
1564
  top: 10px;
1571
  color: #FFF;
1572
  outline: none;
1573
  box-shadow: none; }
1574
+ .ditty-settings__tab:active {
1575
  color: #FFF;
1576
+ outline: none;
1577
+ box-shadow: none; }
1578
+ .ditty-settings__tab:not(.active):hover {
1579
+ color: #19BF7C;
1580
+ background-color: rgba(0, 0, 0, 0.5); }
1581
  .ditty-settings__tab.active {
1582
  background-color: #19BF7C; }
1583
+ .ditty-settings__tab.active:hover {
1584
+ color: #FFF; }
1585
  .ditty-settings__tab.active:after {
1586
  right: 0;
1587
  border: 9px solid transparent;
1597
  .ditty-settings__panel {
1598
  display: none; }
1599
  .ditty-settings__panel > .ditty-field {
1600
+ padding: 25px 30px; }
 
1601
 
1602
  .ditty-settings__form {
1603
  position: relative;
1661
  margin-left: 10px; }
1662
 
1663
  /* Global Dittys */
 
 
 
1664
  .ditty-field--global_ditty .ditty-input--clone {
1665
  margin-bottom: 5px; }
1666
 
1669
 
1670
  @media (max-width: 600px) {
1671
  .ditty-settings__tabs {
1672
+ width: 44px;
1673
+ flex: 0 0 44px; }
1674
  .ditty-settings__tab {
1675
  padding: 10px 4px 10px 14px;
1676
  width: auto; }
1701
  align-items: flex-start;
1702
  justify-content: flex-start; }
1703
  .ditty-settings__panel:not(.ditty-settings__panel--global_ditty) > .ditty-field > .ditty-field__heading {
1704
+ flex: 0 0 50%;
1705
+ padding-right: 60px; }
1706
  .ditty-settings__panel:not(.ditty-settings__panel--global_ditty) > .ditty-field > .ditty-field__heading > .ditty-field__label,
1707
  .ditty-settings__panel:not(.ditty-settings__panel--global_ditty) > .ditty-field > .ditty-field__heading > .ditty-field__description {
1708
  margin-bottom: 0; }
1770
  font-weight: 400;
1771
  color: #FFF;
1772
  margin: 0; }
1773
+
1774
+ .wp-admin.post-new-php.post-type-ditty.ditty-wizard-enabled .wp-heading-inline,
1775
+ .wp-admin.post-new-php.post-type-ditty.ditty-wizard-enabled .wp-header-end {
1776
+ display: none; }
1777
+
1778
+ #ditty-page.ditty-wizard #ditty-page__header {
1779
+ display: flex;
1780
+ flex-direction: column;
1781
+ align-items: flex-start;
1782
+ justify-content: flex-start; }
1783
+
1784
+ #ditty-page.ditty-wizard input[name="ditty_title"] {
1785
+ width: 100%;
1786
+ height: 52px;
1787
+ font-size: 1.3em;
1788
+ font-weight: 600;
1789
+ color: #1d2327;
1790
+ border-color: #e0e3e7; }
1791
+
1792
+ .ditty-wizard-header * {
1793
+ box-sizing: border-box; }
1794
+
1795
+ .ditty-wizard-header__contents ul {
1796
+ display: flex;
1797
+ flex-direction: row;
1798
+ align-items: center;
1799
+ justify-content: flex-start;
1800
+ gap: 5px; }
1801
+ .ditty-wizard-header__contents ul li {
1802
+ padding: 10px;
1803
+ border: 1px solid #e0e3e7;
1804
+ border-radius: 3px; }
1805
+
1806
+ .ditty-instruction-number {
1807
+ flex: 0 0 auto;
1808
+ width: 40px;
1809
+ height: 40px;
1810
+ display: flex;
1811
+ flex-direction: column;
1812
+ align-items: center;
1813
+ justify-content: center;
1814
+ border: 2px solid #e0e3e7;
1815
+ border-radius: 50%;
1816
+ margin-right: 15px; }
1817
+ .ditty-instruction-number span {
1818
+ font-size: 20px;
1819
+ line-height: 20px;
1820
+ font-weight: bold;
1821
+ color: #e0e3e7; }
1822
+
1823
+ .ditty-wizard-setting {
1824
+ position: relative;
1825
+ display: flex;
1826
+ flex-direction: row;
1827
+ align-items: flex-start;
1828
+ justify-content: flex-start;
1829
+ background: #FFF;
1830
+ border-bottom: 1px solid #f7f7f7;
1831
+ padding: 20px; }
1832
+ .ditty-wizard-setting .ditty-wizard-setting__content {
1833
+ flex: 1; }
1834
+ .ditty-wizard-setting:hover {
1835
+ background: #f7f7f7; }
1836
+ .ditty-wizard-setting:hover .ditty-instruction-number {
1837
+ border-color: #19BF7C; }
1838
+ .ditty-wizard-setting:hover .ditty-instruction-number span {
1839
+ color: #19BF7C; }
1840
+ .ditty-wizard-setting.complete .ditty-instruction-number {
1841
+ background-color: #19BF7C;
1842
+ border-color: #19BF7C; }
1843
+ .ditty-wizard-setting.complete .ditty-instruction-number span {
1844
+ color: #FFF; }
1845
+ .ditty-wizard-setting__title {
1846
+ margin: 0 0 5px; }
1847
+ .ditty-wizard-setting__description {
1848
+ margin: 5px 0 15px; }
1849
+ .ditty-wizard-setting--title input {
1850
+ width: 100%;
1851
+ padding-left: 15px;
1852
+ padding-right: 15px; }
1853
+ .ditty-wizard-setting--item-type, .ditty-wizard-setting--item-type-settings, .ditty-wizard-setting--layout, .ditty-wizard-setting--display, .ditty-wizard-setting--submit {
1854
+ display: none; }
1855
+ .ditty-wizard-setting--layout .ditty-option-grid__item {
1856
+ width: 250px;
1857
+ padding-bottom: 30px; }
1858
+ .ditty-wizard-setting--layout__variation {
1859
+ display: none;
1860
+ padding: 20px;
1861
+ border: 1px solid #e0e3e7;
1862
+ border-radius: 3px;
1863
+ margin-top: 15px; }
1864
+ .ditty-wizard-setting--layout__variation__title {
1865
+ margin: 0; }
1866
+ .ditty-wizard-setting--layout__variation .ditty-option-grid {
1867
+ margin-top: 15px; }
1868
+ .ditty-wizard-setting--display .ditty-option-grid__item {
1869
+ width: 250px;
1870
+ padding-bottom: 30px; }
1871
+ .ditty-wizard-setting--display .ditty-option-grid__item__title {
1872
+ margin-bottom: 0; }
1873
+ .ditty-wizard-setting--submit {
1874
+ justify-content: flex-end;
1875
+ padding-top: 20px;
1876
+ padding-bottom: 10px;
1877
+ border-top: 1px solid rgba(0, 0, 0, 0.05); }
1878
+ .ditty-wizard-setting--submit .ditty-button {
1879
+ margin: 0; }
1880
+
1881
+ .ditty-option-grid {
1882
+ display: flex;
1883
+ flex-direction: row;
1884
+ align-items: stretch;
1885
+ justify-content: flex-start;
1886
+ flex-wrap: wrap;
1887
+ gap: 5px; }
1888
+ .ditty-option-grid__item {
1889
+ position: relative;
1890
+ display: flex;
1891
+ flex-direction: column;
1892
+ align-items: center;
1893
+ justify-content: flex-start;
1894
+ box-sizing: border-box;
1895
+ font-size: 12px;
1896
+ line-height: 18px;
1897
+ text-align: center;
1898
+ color: #3c434a;
1899
+ padding: 20px;
1900
+ background: #FFF;
1901
+ border: 2px solid #e0e3e7;
1902
+ border-radius: 3px;
1903
+ width: 200px;
1904
+ transition: border-color .25s ease, background-color .25s ease;
1905
+ -webkit-appearance: none; }
1906
+ .ditty-option-grid__item i {
1907
+ font-size: 30px;
1908
+ line-height: 30px;
1909
+ transition: color .25s ease; }
1910
+ .ditty-option-grid__item__title {
1911
+ font-size: 14px;
1912
+ line-height: 18px;
1913
+ margin: 15px 0 5px; }
1914
+ .ditty-option-grid__item__description {
1915
+ display: none;
1916
+ color: #93999f; }
1917
+ .ditty-option-grid__item__id {
1918
+ position: absolute;
1919
+ bottom: 2px;
1920
+ left: 5px;
1921
+ color: #93999f; }
1922
+ .ditty-option-grid__item__date {
1923
+ position: absolute;
1924
+ bottom: 2px;
1925
+ right: 5px;
1926
+ color: #93999f; }
1927
+ .ditty-option-grid__item:not(.active) {
1928
+ cursor: pointer; }
1929
+ .ditty-option-grid__item:not(.active):hover {
1930
+ border-color: #c2c9d0; }
1931
+ .ditty-option-grid__item.active {
1932
+ background-color: #EDF8ED;
1933
+ border-color: #19BF7C; }
1934
+ .ditty-option-grid__item.active .ditty-option-grid__item__description {
1935
+ display: block; }
1936
+
1937
+ .ditty-option-list {
1938
+ display: flex;
1939
+ flex-direction: column;
1940
+ align-items: flex;
1941
+ justify-content: flex-start;
1942
+ flex-wrap: wrap;
1943
+ gap: 5px; }
1944
+ .ditty-option-list__item {
1945
+ display: flex;
1946
+ flex-direction: column;
1947
+ align-items: flex-start;
1948
+ justify-content: flex-start;
1949
+ box-sizing: border-box;
1950
+ font-size: 12px;
1951
+ line-height: 18px;
1952
+ text-align: left;
1953
+ color: #3c434a;
1954
+ padding: 5px 10px;
1955
+ background: #FFF;
1956
+ border: 2px solid #e0e3e7;
1957
+ border-radius: 3px;
1958
+ min-width: 150px;
1959
+ transition: border-color .25s ease, background-color .25s ease;
1960
+ -webkit-appearance: none; }
1961
+ .ditty-option-list__item__title {
1962
+ font-size: 14px;
1963
+ line-height: 18px;
1964
+ margin: 0;
1965
+ transition: color .25s ease; }
1966
+ .ditty-option-list__item__description {
1967
+ color: #93999f;
1968
+ transition: color .25s ease;
1969
+ margin: 0; }
1970
+ .ditty-option-list__item__date {
1971
+ font-size: 11px;
1972
+ color: #93999f;
1973
+ transition: color .25s ease;
1974
+ margin: 0; }
1975
+ .ditty-option-list__item:not(.active) {
1976
+ cursor: pointer; }
1977
+ .ditty-option-list__item:not(.active):hover {
1978
+ border-color: #c2c9d0; }
1979
+ .ditty-option-list__item.active {
1980
+ background-color: #EDF8ED;
1981
+ border-color: #19BF7C; }
1982
+ .ditty-option-list__item.active .ditty-option-grid__item__description {
1983
+ display: block; }
includes/css/ditty.css CHANGED
@@ -280,10 +280,19 @@
280
  left: 0;
281
  right: 0;
282
  bottom: 0;
283
- opacity: 0.10;
284
- background: #000;
285
  z-index: 200;
286
  display: none; }
 
 
 
 
 
 
 
 
 
 
287
 
288
  .ditty-notification {
289
  font-weight: 600;
@@ -406,10 +415,52 @@
406
  padding-right: 12px; }
407
 
408
  .ditty-ticker {
409
- box-sizing: border-box; }
 
 
 
410
  .ditty-ticker * {
411
  box-sizing: border-box; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  .ditty-ticker__items {
 
413
  position: relative;
414
  overflow: hidden; }
415
  .ditty-ticker .ditty-item {
@@ -709,6 +760,12 @@
709
  align-items: stretch;
710
  justify-content: flex-start;
711
  box-sizing: border-box; }
 
 
 
 
 
 
712
  #ditty-editor__preview {
713
  order: 0;
714
  flex: 1;
@@ -728,7 +785,7 @@
728
  padding: 15px;
729
  border-color: rgba(0, 0, 0, 0.05); }
730
  #ditty-editor__settings .ditty-field__label {
731
- font-weight: 400; }
732
  #ditty-editor__settings .ditty-field-type--group {
733
  padding: 0;
734
  border-color: rgba(0, 0, 0, 0.05); }
@@ -1082,6 +1139,14 @@
1082
  width: 50%;
1083
  padding-left: 7.5px; }
1084
 
 
 
 
 
 
 
 
 
1085
  .ditty-editor-layout {
1086
  cursor: pointer; }
1087
  .ditty-editor-layout:not(.active):hover .ditty-data-list__item__edit_html,
280
  left: 0;
281
  right: 0;
282
  bottom: 0;
283
+ background: rgba(255, 255, 255, 0.7);
 
284
  z-index: 200;
285
  display: none; }
286
+ .ditty-updating-overlay i {
287
+ display: none;
288
+ color: #19BF7C;
289
+ font-size: 20px;
290
+ line-break: 20px; }
291
+ .ditty-updating-overlay.active {
292
+ display: flex;
293
+ flex-direction: row;
294
+ align-items: center;
295
+ justify-content: center; }
296
 
297
  .ditty-notification {
298
  font-weight: 600;
415
  padding-right: 12px; }
416
 
417
  .ditty-ticker {
418
+ box-sizing: border-box;
419
+ display: flex;
420
+ flex-direction: row;
421
+ flex-wrap: wrap; }
422
  .ditty-ticker * {
423
  box-sizing: border-box; }
424
+ .ditty-ticker[data-title="top"] .ditty-ticker__title, .ditty-ticker[data-title="bottom"] .ditty-ticker__title {
425
+ width: 100%; }
426
+ .ditty-ticker[data-title="bottom"] .ditty-ticker__title {
427
+ order: 1; }
428
+ .ditty-ticker[data-title="bottom"] .ditty-ticker__contents {
429
+ order: 0; }
430
+ .ditty-ticker[data-title="left"], .ditty-ticker[data-title="right"] {
431
+ flex-direction: row;
432
+ flex-wrap: nowrap;
433
+ align-items: stretch; }
434
+ .ditty-ticker[data-title="left"] .ditty-ticker__title, .ditty-ticker[data-title="right"] .ditty-ticker__title {
435
+ flex: 0 0 auto; }
436
+ .ditty-ticker[data-title="left"] .ditty-ticker__title__contents, .ditty-ticker[data-title="right"] .ditty-ticker__title__contents {
437
+ height: 100%;
438
+ display: flex;
439
+ flex-direction: row; }
440
+ .ditty-ticker[data-title="left"][data-title="right"] .ditty-ticker__title, .ditty-ticker[data-title="right"][data-title="right"] .ditty-ticker__title {
441
+ order: 1; }
442
+ .ditty-ticker[data-title="left"][data-title="right"] .ditty-ticker__contents, .ditty-ticker[data-title="right"][data-title="right"] .ditty-ticker__contents {
443
+ order: 0; }
444
+ .ditty-ticker[data-title_position="start"] .ditty-ticker__title__contents {
445
+ align-items: flex-start;
446
+ justify-content: flex-start; }
447
+ .ditty-ticker[data-title_position="center"] .ditty-ticker__title__contents {
448
+ align-items: center;
449
+ justify-content: center; }
450
+ .ditty-ticker[data-title_position="end"] .ditty-ticker__title__contents {
451
+ align-items: flex-end;
452
+ justify-content: flex-end; }
453
+ .ditty-ticker__title__contents {
454
+ display: flex;
455
+ flex-direction: row; }
456
+ .ditty-ticker__contents {
457
+ width: 100%;
458
+ display: flex;
459
+ flex-direction: row;
460
+ align-items: center;
461
+ justify-content: flex-start; }
462
  .ditty-ticker__items {
463
+ width: 100%;
464
  position: relative;
465
  overflow: hidden; }
466
  .ditty-ticker .ditty-item {
760
  align-items: stretch;
761
  justify-content: flex-start;
762
  box-sizing: border-box; }
763
+ #ditty-editor__initialize {
764
+ order: 0;
765
+ flex: 1;
766
+ width: 100%;
767
+ background: #FFF;
768
+ box-sizing: border-box; }
769
  #ditty-editor__preview {
770
  order: 0;
771
  flex: 1;
785
  padding: 15px;
786
  border-color: rgba(0, 0, 0, 0.05); }
787
  #ditty-editor__settings .ditty-field__label {
788
+ font-weight: 600; }
789
  #ditty-editor__settings .ditty-field-type--group {
790
  padding: 0;
791
  border-color: rgba(0, 0, 0, 0.05); }
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; }
1152
  .ditty-editor-layout:not(.active):hover .ditty-data-list__item__edit_html,
includes/fields/ditty-field-checkboxes.php CHANGED
@@ -17,11 +17,12 @@ class Ditty_Field_Checkboxes extends Ditty_Field {
17
  * Return the default atts
18
  *
19
  * @access private
20
- * @since 3.0
21
  */
22
  public function defaults() {
23
  $atts = array(
24
  'options' => array(),
 
25
  );
26
  return wp_parse_args( $atts, $this->common );
27
  }
@@ -32,23 +33,26 @@ class Ditty_Field_Checkboxes extends Ditty_Field {
32
  * @since 3.0
33
  * @return $html string
34
  */
35
- public function input( $name, $standard = false ) {
36
- $inputs = array();
37
- foreach ( $this->args['options'] as $key => $label ) {
38
- $std = ( is_array( $standard ) && isset( $standard[ $key ] ) ) ? $standard[ $key ] : false;
39
- $atts = array(
40
- 'id' => "{$name}[{$key}]",
41
- 'label' => $label,
42
- 'value' => $key,
43
- 'std' => $std,
44
- );
45
- $input = new Ditty_Field_Checkbox();
46
- $input->init( $atts );
47
- $inputs[] = $input->html();
 
 
 
 
 
48
  }
49
-
50
- $html = '<div class="ditty-input--checkboxes__group">' . implode( ' ', $inputs ) . '</div>';
51
- return $html;
52
  }
53
 
54
  }
17
  * Return the default atts
18
  *
19
  * @access private
20
+ * @since 3.0.13
21
  */
22
  public function defaults() {
23
  $atts = array(
24
  'options' => array(),
25
+ 'inline' => false,
26
  );
27
  return wp_parse_args( $atts, $this->common );
28
  }
33
  * @since 3.0
34
  * @return $html string
35
  */
36
+ public function input( $name, $std = false ) {
37
+ $std = ( $std ) ? $std : $this->args['std'];
38
+ $html = '';
39
+ if ( is_array( $this->args['options'] ) && count( $this->args['options'] ) > 0 ) {
40
+ $classes = 'ditty-input--checkboxes__group';
41
+ if ( $this->args['inline'] ) {
42
+ $classes .= ' ditty-input--checkboxes__group--inline';
43
+ }
44
+ $html .= '<div class="' . esc_attr( $classes ) . '">';
45
+ foreach ( $this->args['options'] as $value => $label ) {
46
+ $input_id = uniqid( 'ditty-input--' );
47
+ $html .= '<span class="ditty-input--checkboxes__option ditty-input--checkboxes__option--' . esc_attr( $value ) . '">';
48
+ $sanitized_value = sanitize_text_field( $value );
49
+ $curr_std = ( is_array( $std ) && in_array( $value, $std ) ) ? $value : false;
50
+ $html .= '<input id="' . esc_attr( $input_id ) . '" name="' . esc_attr( "{$name}[{$value}]" ) . '" type="checkbox" value="' . esc_attr( $sanitized_value ) . '" ' . checked( $sanitized_value, $curr_std, false ) . ' /> <label for="' . esc_attr( $input_id ) . '">' . sanitize_text_field( $label ) . '</label>';
51
+ $html .= '</span>';
52
+ }
53
+ $html .= '</div>';
54
  }
55
+ return $html;
 
 
56
  }
57
 
58
  }
includes/fields/ditty-field-group.php CHANGED
@@ -45,11 +45,12 @@ class Ditty_Field_Group extends Ditty_Field {
45
  $html .= '<div ' . ditty_attr_to_html( $atts ) . '>';
46
  if ( '' != $this->label() || '' != $this->description() ) {
47
  $html .= '<div class="ditty-field__heading">';
48
- $html .= $this->label();
49
- $html .= $this->description();
50
  if ( $this->args['collapsible'] ) {
51
  $html .= '<a href="#" class="ditty-field__collapsible-toggle"><i class="fas fa-angle-down"></i></a>';
52
  }
 
 
53
  $html .= '</div>';
54
  }
55
  $html .= $this->input_container();
45
  $html .= '<div ' . ditty_attr_to_html( $atts ) . '>';
46
  if ( '' != $this->label() || '' != $this->description() ) {
47
  $html .= '<div class="ditty-field__heading">';
48
+ $html .= $this->label();
 
49
  if ( $this->args['collapsible'] ) {
50
  $html .= '<a href="#" class="ditty-field__collapsible-toggle"><i class="fas fa-angle-down"></i></a>';
51
  }
52
+ $html .= parent::help();
53
+ $html .= parent::description();
54
  $html .= '</div>';
55
  }
56
  $html .= $this->input_container();
includes/fields/ditty-field-heading.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Ditty Field Divider Class
5
+ *
6
+ * @package Ditty
7
+ * @subpackage Classes/Ditty Field Heading
8
+ * @copyright Copyright (c) 2022, Metaphor Creations
9
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
+ * @since 3.0.13
11
+ */
12
+ class Ditty_Field_Heading extends Ditty_Field {
13
+
14
+ public $type = 'heading';
15
+
16
+ /**
17
+ * Return the default atts
18
+ *
19
+ * @access private
20
+ * @since 3.0
21
+ */
22
+ public function defaults() {
23
+ $atts = array(
24
+ 'element' => 'h3',
25
+ );
26
+ return wp_parse_args( $atts, $this->common );
27
+ }
28
+
29
+ /**
30
+ * Return the html
31
+ *
32
+ * @since 3.0
33
+ * @return $html string
34
+ */
35
+ public function html() {
36
+ $html = '';
37
+
38
+ $id = parent::sanitize_id( $this->args['id'] );
39
+ $classes = 'ditty-field ditty-field-type--' . $this->type . ' ' . $this->sanitize_id( 'ditty-field--' . $id );
40
+ $classes .= ( '' != $this->args['baseid'] ) ? ' ditty-field--' . esc_attr( $this->args['baseid'] ) : '';
41
+ $classes .= ( '' != $this->args['class'] ) ? ' ' . esc_attr( $this->args['class'] ) : '';
42
+
43
+ $atts = array(
44
+ 'class' => $classes,
45
+ );
46
+ $html .= '<div ' . ditty_attr_to_html( $atts ) . '>';
47
+ $html .= '<div class="ditty-field__heading">';
48
+ $html .= $this->label();
49
+ $html .= parent::help();
50
+ $html .= parent::description();
51
+ $html .= '</div>';
52
+ $html .= '</div>';
53
+ return $html;
54
+ }
55
+
56
+ /**
57
+ * Return the label
58
+ *
59
+ * @since 3.0
60
+ * @return $html string
61
+ */
62
+ public function label() {
63
+ $html = '';
64
+ if ( '' != $this->args['name'] || '' != $this->args['help'] ) {
65
+ $html .= '<' . $this->args['element'] . ' class="ditty-field__label">';
66
+ if ( '' != $this->args['name'] ) {
67
+ $add_space = true;
68
+ $html .= wp_kses_post( $this->args['name'] );
69
+ }
70
+ if ( '' != $this->args['help'] ) {
71
+ if ( '' != $this->args['name'] ) {
72
+ $html .= ' ';
73
+ }
74
+ $html .= '<a href="#" class="ditty-help-icon protip" data-pt-title="' . esc_html__( 'Toggle Description', 'metaphoravada' ) . '"><i class="fas fa-question-circle"></i></a>';
75
+ }
76
+ $html .= '</' . $this->args['element'] . '>';
77
+ }
78
+ return $html;
79
+ }
80
+
81
+ }
includes/fields/ditty-field.php CHANGED
@@ -101,18 +101,21 @@ class Ditty_Field {
101
  /**
102
  * Return the html
103
  *
104
- * @since 3.0
105
  * @return $html string
106
  */
107
  public function html() {
108
  $html = '';
109
  if ( $this->args['field_only'] ) {
110
- $html .= $this->input( $this->args['id'] );
 
 
111
  } else {
112
  $html .= '<div ' . ditty_attr_to_html( $this->html_atts() ) . '>';
113
  if ( '' != $this->label() || '' != $this->description() ) {
114
  $html .= '<div class="ditty-field__heading">';
115
  $html .= $this->label();
 
116
  $html .= $this->description();
117
  $html .= '</div>';
118
  }
@@ -140,13 +143,30 @@ class Ditty_Field {
140
  if ( '' != $this->args['name'] ) {
141
  $html .= ' ';
142
  }
143
- $html .= '<i class="ditty-help-icon protip fas fa-question-circle" data-pt-title="' . sanitize_text_field( $this->args['help'] ) . '"></i>';
 
144
  }
145
  $html .= '</label>';
146
  }
147
  return $html;
148
  }
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  /**
151
  * Return the description
152
  *
101
  /**
102
  * Return the html
103
  *
104
+ * @since 3.0.13
105
  * @return $html string
106
  */
107
  public function html() {
108
  $html = '';
109
  if ( $this->args['field_only'] ) {
110
+ $html .= '<div class="ditty-field-only ditty-field-only--' . $this->type . ' ditty-field-only--' . $this->args['id'] . '">';
111
+ $html .= $this->input( $this->args['id'] );
112
+ $html .= '</div>';
113
  } else {
114
  $html .= '<div ' . ditty_attr_to_html( $this->html_atts() ) . '>';
115
  if ( '' != $this->label() || '' != $this->description() ) {
116
  $html .= '<div class="ditty-field__heading">';
117
  $html .= $this->label();
118
+ $html .= $this->help();
119
  $html .= $this->description();
120
  $html .= '</div>';
121
  }
143
  if ( '' != $this->args['name'] ) {
144
  $html .= ' ';
145
  }
146
+ //$html .= '<i class="ditty-help-icon protip fas fa-question-circle" data-pt-title="' . sanitize_text_field( $this->args['help'] ) . '"></i>';
147
+ $html .= '<a href="#" class="ditty-help-icon protip" data-pt-title="' . esc_html__( 'Toggle Description', 'metaphoravada' ) . '"><i class="fas fa-question-circle"></i></a>';
148
  }
149
  $html .= '</label>';
150
  }
151
  return $html;
152
  }
153
 
154
+ /**
155
+ * Return the help
156
+ *
157
+ * @since 3.0.13
158
+ * @return $html string
159
+ */
160
+ public function help() {
161
+ $html = '';
162
+ if ( '' != $this->args['help'] ) {
163
+ $html .= '<p class="ditty-field__help">';
164
+ $html .= wp_kses_post( $this->args['help'] );
165
+ $html .= '</p>';
166
+ }
167
+ return $html;
168
+ }
169
+
170
  /**
171
  * Return the description
172
  *
includes/fields/helpers.php CHANGED
@@ -28,6 +28,7 @@ function ditty_field( $args = array() ) {
28
  * @since 3.0.12
29
  */
30
  function ditty_fields( $fields = array(), $values = array(), $action = 'render' ) {
 
31
  if ( is_array( $fields ) && count( $fields ) > 0 ) {
32
  foreach ( $fields as &$field ) {
33
  if ( ! is_array( $field ) ) {
@@ -36,14 +37,14 @@ function ditty_fields( $fields = array(), $values = array(), $action = 'render'
36
  if ( isset( $values[$field['id']] ) ) {
37
  $field['std'] = $values[$field['id']];
38
  }
39
-
40
- if ( 'return' == $action ) {
41
- return ditty_field( $field );
42
- } else {
43
- echo ditty_field( $field );
44
- }
45
  }
46
  }
 
 
 
 
 
47
  }
48
 
49
  /**
28
  * @since 3.0.12
29
  */
30
  function ditty_fields( $fields = array(), $values = array(), $action = 'render' ) {
31
+ $rendered_fields = '';
32
  if ( is_array( $fields ) && count( $fields ) > 0 ) {
33
  foreach ( $fields as &$field ) {
34
  if ( ! is_array( $field ) ) {
37
  if ( isset( $values[$field['id']] ) ) {
38
  $field['std'] = $values[$field['id']];
39
  }
40
+ $rendered_fields .= ditty_field( $field );;
 
 
 
 
 
41
  }
42
  }
43
+ if ( 'return' == $action ) {
44
+ return $rendered_fields;
45
+ } else {
46
+ echo $rendered_fields;
47
+ }
48
  }
49
 
50
  /**
includes/fields/js/ditty-fields.js CHANGED
@@ -10,4 +10,32 @@
10
  // @codekit-append 'fields/image.js
11
  // @codekit-append 'fields/slider.js
12
  // @codekit-append 'fields/wysiwyg.js
13
- // @codekit-append 'fields/group.js
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  // @codekit-append 'fields/image.js
11
  // @codekit-append 'fields/slider.js
12
  // @codekit-append 'fields/wysiwyg.js
13
+ // @codekit-append 'fields/group.js
14
+
15
+
16
+ jQuery( function( $ ) {
17
+
18
+ // Setup strict mode
19
+ (function() {
20
+
21
+ "use strict";
22
+
23
+ $( '#ditty-page' ).on( 'click', '.ditty-help-icon', function( e ) {
24
+ e.preventDefault();
25
+
26
+ var $icon = $( this ),
27
+ $label = $icon.parents( '.ditty-field__label' ),
28
+ $help = $label.siblings( '.ditty-field__help' );
29
+
30
+ if ( $icon.hasClass( 'active' ) ) {
31
+ $icon.removeClass( 'active' );
32
+ $help.hide();
33
+ } else {
34
+ $icon.addClass( 'active' );
35
+ $help.show();
36
+ }
37
+ } );
38
+
39
+ }() );
40
+
41
+ } );
includes/fields/js/ditty-fields.min.js CHANGED
@@ -1,644 +1 @@
1
- /* global jQuery:true */
2
- /* //global dittyVars:true */
3
- /* //global console:true */
4
-
5
- // @codekit-append 'fields/clone.js
6
- // @codekit-append 'fields/code.js
7
- // @codekit-append 'fields/color.js
8
- // @codekit-append 'fields/date.js
9
- // @codekit-append 'fields/file.js
10
- // @codekit-append 'fields/image.js
11
- // @codekit-append 'fields/slider.js
12
- // @codekit-append 'fields/wysiwyg.js
13
- // @codekit-append 'fields/group.js
14
-
15
- jQuery( function( $ ) {
16
-
17
- // Setup strict mode
18
- (function() {
19
-
20
- "use strict";
21
-
22
- function setup( $field ) {
23
-
24
- // Setup protip
25
- $.protip( {
26
- defaults: {
27
- position: 'top',
28
- size: 'small',
29
- scheme: 'black',
30
- classes: 'ditty-protip'
31
- }
32
- } );
33
-
34
- var $inputContainer = $field.children( '.ditty-field__input__container' );
35
-
36
- $field.addClass( 'ditty-field--clone-enabled--init' );
37
- $field.data( 'input_count', $inputContainer.children( '.ditty-field__input' ).length );
38
-
39
- $inputContainer.children( '.ditty-field__input' ).each( function() {
40
- setupButtons( $field, $( this ) );
41
- } );
42
-
43
- $field.find( '.ditty-field__actions__clone' ).on( 'click', function( e ) {
44
- e.preventDefault();
45
- var $input = $inputContainer.children( '.ditty-field__input' ).last();
46
- addInput( $field, $input );
47
- } );
48
-
49
- $inputContainer.sortable( {
50
- handle: '.ditty-field__input__action--arrange',
51
- items: '> .ditty-field__input',
52
- axis: 'y',
53
- start: function( event, ui ) {
54
- var $item = $( ui.item );
55
- $item.addClass( 'ditty-field__input--moving' );
56
- },
57
- stop: function( event, ui ) {
58
- var $item = $( ui.item );
59
- $item.removeClass( 'ditty-field__input--moving' );
60
- },
61
- update: function() {
62
- updateField( $field );
63
- }
64
- } );
65
- }
66
-
67
- /**
68
- * Update the field class and input names
69
- *
70
- * @since 3.0
71
- * @return null
72
- */
73
- function updateField( $field ) {
74
- var $inputContainer = $field.children( '.ditty-field__input__container' ),
75
- cloneName = $field.data( 'clone_name' ),
76
- cloneMax = $field.data( 'clone_max' ),
77
- fieldData = [];
78
-
79
- $inputContainer.children( '.ditty-field__input' ).each( function( index ) {
80
- var $input = $( this );
81
- $input.find( ':input' ).each( function() {
82
- var baseId = $( this ).parents( '.ditty-field__input' ).data( 'baseid' ),
83
- fieldName;
84
-
85
- if ( baseId ) {
86
- fieldName = cloneName + '[' + index + '][' + baseId + ']';
87
- //$( this ).attr( 'name', cloneName + '[' + index + '][' + baseId + ']' );
88
- } else {
89
- fieldName = cloneName + '[' + index + ']';
90
- //$( this ).attr( 'name', cloneName + '[' + index + ']' );
91
- }
92
- $( this ).attr( 'name', fieldName );
93
- fieldData.push( {
94
- name : fieldName,
95
- value : $(this).val()
96
- } );
97
- } );
98
- } );
99
- $field.data( 'input_count', $inputContainer.children( '.ditty-field__input' ).length );
100
-
101
- if ( cloneMax > 0 && $inputContainer.children( '.ditty-field__input' ).length >= cloneMax ) {
102
- $field.addClass( 'ditty-field--clone-enabled--max' );
103
- } else {
104
- $field.removeClass( 'ditty-field--clone-enabled--max' );
105
- }
106
-
107
- $field.trigger( 'ditty_field_update' );
108
- $field.trigger( 'ditty_field_clone_update', [fieldData, cloneName] );
109
- }
110
-
111
- /**
112
- * Add a new clone input
113
- *
114
- * @since 3.0
115
- * @return null
116
- */
117
- function addInput( $field, $input, cloneField ) {
118
- cloneField = cloneField ? cloneField : $field.data( 'clone_field' );
119
-
120
- var $clone = $( cloneField );
121
-
122
- $input.after( $clone );
123
-
124
- updateField( $field );
125
- setupButtons( $field, $clone );
126
-
127
- $field.trigger( 'ditty_init_fields' );
128
- }
129
-
130
- /**
131
- * Setup clone buttons
132
- *
133
- * @since 3.0
134
- * @return null
135
- */
136
- function setupButtons( $field, $input ) {
137
- var $remove = $input.find( '.ditty-field__input__action--remove' ),
138
- $add = $input.find( '.ditty-field__input__action--add' ),
139
- $clone = $input.find( '.ditty-field__input__action--clone' );
140
-
141
- $remove.on( 'click', function( e ) {
142
- e.preventDefault();
143
- $( this ).protipHide();
144
- if ( 1 === $input.siblings().length ) {
145
- addInput( $field, $input );
146
- }
147
- $input.remove();
148
- updateField( $field );
149
- //$( 'body' ).trigger( 'ditty_enable_settings_update' );
150
- } );
151
-
152
- $add.on( 'click', function( e ) {
153
- e.preventDefault();
154
- addInput( $field, $input );
155
- //$( 'body' ).trigger( 'ditty_enable_settings_update' );
156
- } );
157
-
158
- $clone.on( 'click', function( e ) {
159
- e.preventDefault();
160
- addInput( $field, $input, $input.clone() );
161
- //$( 'body' ).trigger( 'ditty_enable_settings_update' );
162
- } );
163
- }
164
-
165
- function init( e ) {
166
- $( e.target ).find( '.ditty-field--clone-enabled:not(.ditty-field--clone-enabled--init)' ).each( function() {
167
- setup( $( this ) );
168
- } );
169
- }
170
- $( document ).on( 'ditty_init_fields', init );
171
-
172
- }() );
173
-
174
- } );
175
-
176
- /* global _:true */
177
-
178
- jQuery( function( $ ) {
179
-
180
- // Setup strict mode
181
- (function() {
182
-
183
- "use strict";
184
-
185
- function setup( $field ) {
186
- $field.addClass( 'ditty-input--code--init' );
187
-
188
- var $textarea = $field.find( 'textarea' ),
189
- codeEditor = null,
190
- codeEditorSettings = wp.codeEditor.defaultSettings ? _.clone( wp.codeEditor.defaultSettings ) : {};
191
-
192
- codeEditorSettings.codemirror = _.extend(
193
- {},
194
- codeEditorSettings.codemirror,
195
- {
196
- mode : $textarea.data( 'mode' ) ? $textarea.data( 'mode' ) : null,
197
- indentUnit : 2,
198
- tabSize : 2
199
- }
200
- );
201
- codeEditor = wp.codeEditor.initialize( $textarea[0], codeEditorSettings );
202
- }
203
-
204
- function init( e ) {
205
- $( e.target ).find( '.ditty-input--code:not(.ditty-input--code--init)' ).each( function() {
206
- setup( $( this ) );
207
- } );
208
- }
209
- $( document ).on( 'ditty_init_fields', init );
210
-
211
- }() );
212
-
213
- } );
214
-
215
- jQuery( function( $ ) {
216
-
217
- // Setup strict mode
218
- (function() {
219
-
220
- "use strict";
221
-
222
- function setup( $field ) {
223
- $field.addClass( 'ditty-input--color--init' );
224
- $field.find( 'input[type="text"]' ).minicolors( {
225
- format: 'rgb',
226
- opacity: true
227
- } );
228
- }
229
-
230
- function init( e ) {
231
- $( e.target ).find( '.ditty-input--color:not(.ditty-input--color--init)' ).each( function() {
232
- setup( $( this ) );
233
- } );
234
- }
235
- $( document ).on( 'ditty_init_fields', init );
236
-
237
- }() );
238
-
239
- } );
240
-
241
- jQuery( function( $ ) {
242
-
243
- // Setup strict mode
244
- (function() {
245
-
246
- "use strict";
247
-
248
- function setup( $field ) {
249
- var format = $field.find( 'input[type="text"]' ).data( 'dateformat' );
250
- $field.find( 'input[type="text"]' ).datepicker( {
251
- dateFormat: format
252
- } );
253
- }
254
-
255
- function init( e ) {
256
- $( e.target ).find( '.ditty-input--date' ).each( function() {
257
- setup( $( this ) );
258
- } );
259
- }
260
- $( document ).on( 'ditty_init_fields', init );
261
-
262
- }() );
263
-
264
- } );
265
-
266
- jQuery( function( $ ) {
267
-
268
- // Setup strict mode
269
- (function() {
270
-
271
- "use strict";
272
-
273
- function setup( $field ) {
274
- $field.addClass( 'ditty-input--file--init' );
275
-
276
- var $input = $field.find( 'input[type="text"]' ),
277
- uploader;
278
-
279
- $field.on( 'click', '.ditty-input--file__upload', function( e ) {
280
- e.preventDefault();
281
- if ( undefined === uploader ) {
282
- uploader = wp.media( {
283
- title: $input.data( 'media_title' ),
284
- button: { text: $input.data( 'media_button' ), size: 'small' },
285
- multiple: $input.data( 'multiple' ),
286
- library : {
287
- type : $input.data( 'file_types' ),
288
- }
289
- } );
290
- }
291
-
292
- uploader.on( 'open', function() {
293
- var selection = uploader.state().get( 'selection' );
294
- var attachment = wp.media.attachment( $input.val() );
295
- if ( attachment ) {
296
- selection.add( attachment );
297
- }
298
- // let ids = [13, 14, 56];
299
- // ids.forEach(function(id) {
300
- // let attachment = wp.media.attachment(id);
301
- // selection.add(attachment ? [attachment] : []);
302
- // } );
303
- } );
304
-
305
- uploader.on( 'select', function() {
306
- var attachments = uploader.state().get( 'selection' ).toJSON(),
307
- file_data = [];
308
-
309
- if ( attachments.length > 0 ) {
310
- $(attachments).each( function() {
311
- file_data.push( {
312
- id : $(this)[0].id,
313
- title : $(this)[0].title,
314
- caption : $(this)[0].caption,
315
- description : $(this)[0].description,
316
- link : $(this)[0].link,
317
- url : $(this)[0].url
318
- } );
319
- } );
320
- }
321
-
322
- $input.val( file_data[0].url );
323
-
324
- $field.trigger( 'ditty_field_file_select', [$field, file_data] );
325
- $field.trigger( 'ditty_field_update' );
326
- } );
327
-
328
- uploader.open();
329
- return false;
330
-
331
- } );
332
-
333
- }
334
-
335
- function init( e ) {
336
- $( e.target ).find( '.ditty-input--file:not(.ditty-input--file--init)' ).each( function() {
337
- setup( $( this ) );
338
- } );
339
- }
340
- $( document ).on( 'ditty_init_fields', init );
341
-
342
- }() );
343
-
344
- } );
345
-
346
- jQuery( function( $ ) {
347
-
348
- // Setup strict mode
349
- (function() {
350
-
351
- "use strict";
352
-
353
- function setup( $field ) {
354
- $field.addClass( 'ditty-input--image--init' );
355
-
356
- var $input = $field.find( 'input[type="hidden"]' ),
357
- $preview = $field.find( '.ditty-input--image__preview' ),
358
- $preview_img = $preview.children( 'img' ),
359
- uploader;
360
-
361
- $field.on( 'click', '.ditty-input--image__upload', function( e ) {
362
- e.preventDefault();
363
-
364
- if ( undefined === uploader ) {
365
- uploader = wp.media({
366
- title: $input.data( 'media_title' ),
367
- button: { text: $input.data( 'media_button' ), size: 'small' },
368
- multiple: $input.data( 'multiple' ),
369
- library : {
370
- type : 'image'
371
- }
372
- } );
373
- }
374
-
375
- uploader.on( 'open', function() {
376
- var selection = uploader.state().get( 'selection' );
377
- var attachment = wp.media.attachment( $input.val() );
378
- if ( attachment ) {
379
- selection.add( attachment );
380
- }
381
- // let ids = [13, 14, 56];
382
- // ids.forEach(function(id) {
383
- // let attachment = wp.media.attachment(id);
384
- // selection.add(attachment ? [attachment] : []);
385
- // } );
386
- } );
387
-
388
- uploader.on( 'select', function() {
389
- var attachments = uploader.state().get( 'selection' ).toJSON(),
390
- image_data = [];
391
-
392
- if ( attachments.length > 0 ) {
393
- $(attachments).each( function() {
394
- image_data.push( {
395
- id : $(this)[0].id,
396
- title : $(this)[0].title,
397
- caption : $(this)[0].caption,
398
- description : $(this)[0].description,
399
- link : $(this)[0].link,
400
- url : $(this)[0].sizes.medium ? $(this)[0].sizes.medium.url : $(this)[0].sizes.full.url
401
- } );
402
- } );
403
- }
404
-
405
- $input.val( image_data[0].id );
406
- if ( $preview_img.length ) {
407
- $preview_img.remove();
408
- }
409
- $preview_img = $( '<img src="' + image_data[0].url + '" alt="" />' );
410
- $preview.prepend( $preview_img );
411
- $preview.find( 'i' ).remove();
412
-
413
- $field.trigger( 'ditty_field_image_select', [$field, image_data] );
414
- $field.trigger( 'ditty_field_update' );
415
- } );
416
-
417
- uploader.open();
418
- return false;
419
-
420
- } );
421
-
422
- }
423
-
424
- function init( e ) {
425
- $( e.target ).find( '.ditty-input--image:not(.ditty-input--image--init)' ).each( function() {
426
- setup( $( this ) );
427
- } );
428
- }
429
- $( document ).on( 'ditty_init_fields', init );
430
-
431
- }() );
432
-
433
- } );
434
-
435
- jQuery( function( $ ) {
436
-
437
- // Setup strict mode
438
- (function() {
439
-
440
- "use strict";
441
-
442
- function setup( $field ) {
443
- $field.addClass( 'ditty-input--slider--init' );
444
- $field.find( 'input[type="text"]' ).ionRangeSlider();
445
- }
446
-
447
- function init( e ) {
448
- $( e.target ).find( '.ditty-input--slider:not(.ditty-input--slider--init)' ).each( function() {
449
- setup( $( this ) );
450
- } );
451
- }
452
- $( document ).on( 'ditty_init_fields', init );
453
-
454
- }() );
455
-
456
- } );
457
-
458
- /* global tinyMCEPreInit:true */
459
- /* global tinymce:true */
460
- /* global quicktags:true */
461
- /* global QTags:true */
462
- /* global wp:true */
463
-
464
- jQuery( function( $ ) {
465
-
466
- // Setup strict mode
467
- (function() {
468
-
469
- "use strict";
470
-
471
- /**
472
- * Transform textarea into wysiwyg editor.
473
- */
474
- function transform( $field ) {
475
-
476
- $field.addClass( 'ditty-input--wysiwyg--init' );
477
- if ( $field.hasClass( 'ditty-input--clone--clone' ) ) {
478
- var ranId = Math.floor( ( Math.random() * 100000000 ) + 1 );
479
- $field.find( 'textarea' ).attr( 'id', 'ditty-input--' + ranId );
480
- }
481
-
482
- var $wrapper = $field.find( '.wp-editor-wrap' ),
483
- id = $field.find( 'textarea' ).attr( 'id' ),
484
- editor;
485
-
486
- // Ignore existing editor.
487
- if ( tinyMCEPreInit.mceInit[id] ) {
488
- editor = tinymce.get( id );
489
- editor.on( 'keyup change', function() {
490
- tinymce.triggerSave();
491
- $field.trigger( 'ditty_input_wysiwyg_update' );
492
- } );
493
- return;
494
- }
495
-
496
- var originalId = getOriginalId( $field ),
497
- settings = getEditorSettings( originalId );
498
-
499
- updateDom( $wrapper, id );
500
-
501
- // TinyMCE
502
- if ( window.tinymce ) {
503
- tinymce.execCommand( 'mceRemoveEditor', true, id );
504
- editor = new tinymce.Editor( id, settings.tinymce, tinymce.EditorManager );
505
- editor.render();
506
- editor.on( 'keyup change', function() {
507
- tinymce.triggerSave();
508
- $field.trigger( 'ditty_input_wysiwyg_update' );
509
- } );
510
- }
511
-
512
- // Quick tags
513
- if ( window.quicktags ) {
514
- settings.quicktags.id = id;
515
- quicktags( settings.quicktags );
516
- QTags._buttonsInit();
517
- }
518
- }
519
-
520
- function getOriginalId( $clone ) {
521
- var $original = $clone.siblings( '.ditty-input--wysiwyg.ditty-input--clone--orig' ),
522
- origingalID = $original.find( 'textarea' ).attr( 'id' );
523
-
524
- if ( /_\d+$/.test( origingalID ) ) {
525
- origingalID = origingalID.replace( /_\d+$/, '' );
526
- }
527
- if ( tinyMCEPreInit.mceInit.hasOwnProperty( origingalID ) || tinyMCEPreInit.qtInit.hasOwnProperty( origingalID ) ) {
528
- return origingalID;
529
- }
530
- return '';
531
- }
532
-
533
- function updateDom( $wrapper, id ) {
534
- // Wrapper div and media buttons
535
- $wrapper.attr( 'id', 'wp-' + id + '-wrap' )
536
- .find( '.mce-container' ).remove().end() // Remove rendered tinyMCE editor
537
- .find( '.wp-editor-tools' ).attr( 'id', 'wp-' + id + '-editor-tools' )
538
- .find( '.wp-media-buttons' ).attr( 'id', 'wp-' + id + '-media-buttons' )
539
- .find( 'button' ).data( 'editor', id ).attr( 'data-editor', id );
540
-
541
- // Set default active mode.
542
- $wrapper.removeClass( 'html-active tmce-active' );
543
- $wrapper.addClass( window.tinymce ? 'tmce-active' : 'html-active' );
544
-
545
- // Editor tabs
546
- $wrapper.find( '.switch-tmce' )
547
- .attr( 'id', id + 'tmce' )
548
- .data( 'wp-editor-id', id ).attr( 'data-wp-editor-id', id ).end()
549
- .find( '.switch-html' )
550
- .attr( 'id', id + 'html' )
551
- .data( 'wp-editor-id', id ).attr( 'data-wp-editor-id', id );
552
-
553
- // Quick tags
554
- $wrapper.find( '.wp-editor-container' ).attr( 'id', 'wp-' + id + '-editor-container' )
555
- .find( '.quicktags-toolbar' ).attr( 'id', 'qt_' + id + '_toolbar' ).html( '' );
556
- }
557
-
558
- function getEditorSettings( id ) {
559
- var settings = getDefaultEditorSettings();
560
- if ( id && tinyMCEPreInit.mceInit.hasOwnProperty( id ) ) {
561
- settings.tinymce = tinyMCEPreInit.mceInit[id];
562
- }
563
- if ( id && window.quicktags && tinyMCEPreInit.qtInit.hasOwnProperty( id ) ) {
564
- settings.quicktags = tinyMCEPreInit.qtInit[id];
565
- }
566
- return settings;
567
- }
568
-
569
- function getDefaultEditorSettings() {
570
- var settings = wp.editor.getDefaultSettings();
571
- settings.tinymce.toolbar1 = 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,fullscreen,wp_adv';
572
- settings.tinymce.toolbar2 = 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help';
573
- settings.quicktags.buttons = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
574
- return settings;
575
- }
576
-
577
- function pre_save( e ) {
578
- if ( window.tinymce && $( e.target ).find( '.ditty-input--wysiwyg--init .wp-editor-area' ).length ) {
579
- tinymce.triggerSave();
580
- }
581
- }
582
- $( document ).on( 'ditty_pre_save_fields', pre_save );
583
-
584
- function init( e ) {
585
- $( e.target ).find( '.ditty-input--wysiwyg:not(.ditty-input--wysiwyg--init)' ).each( function() {
586
- transform( $( this ) );
587
- } );
588
- }
589
- $( document ).on( 'ditty_init_fields', init );
590
-
591
- }() );
592
-
593
- } );
594
-
595
- jQuery( function( $ ) {
596
-
597
- // Setup strict mode
598
- (function() {
599
-
600
- "use strict";
601
-
602
- function setup( $field ) {
603
- $field.addClass( 'ditty-field-type--group--init' );
604
-
605
- var $input = $field.children( '.ditty-field__input__container' ).children( '.ditty-input--group' ),
606
- height = 0;
607
-
608
- if ( 'collapsed' === $field.attr( 'data-collapsible' ) ) {
609
- $input.hide();
610
- }
611
-
612
- $field.on( 'click', '.ditty-field__collapsible-toggle', function( e ) {
613
- e.preventDefault();
614
- if ( 'expanded' === $( this ).parents( '.ditty-field-type--group' ).attr( 'data-collapsible' ) ) {
615
- $( this ).parents( '.ditty-field-type--group' ).attr( 'data-collapsible', 'collapsed' );
616
- height = $input.outerHeight();
617
- $input.stop().animate( {
618
- marginTop: '-' + height + 'px'
619
- }, 1000, 'easeInOutQuint', function() {
620
- $input.hide();
621
- } );
622
- } else {
623
- $( this ).parents( '.ditty-field-type--group' ).attr( 'data-collapsible', 'expanded' );
624
- height = $input.outerHeight();
625
- $input.stop().css( 'marginTop', '-' + height + 'px' );
626
- $input.show();
627
- $input.stop().animate( {
628
- marginTop: 0
629
- }, 1000, 'easeInOutQuint', function() {
630
- } );
631
- }
632
- } );
633
- }
634
-
635
- function init( e ) {
636
- $( e.target ).find( '.ditty-field-type--group[data-collapsible]:not(.ditty-field-type--group--init)' ).each( function() {
637
- setup( $( this ) );
638
- } );
639
- }
640
- $( document ).on( 'ditty_init_fields', init );
641
-
642
- }() );
643
-
644
- } );
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))}))}))}()}));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/helpers.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Return the settings defaults
5
  *
6
- * @since 3.0.11
7
  */
8
  function ditty_settings_defaults() {
9
  $defaults = array(
@@ -15,7 +15,8 @@ function ditty_settings_defaults() {
15
  'variation_defaults' => array(),
16
  'global_ditty' => array(),
17
  'ditty_news_ticker' => '',
18
- 'disable_fontawesome' => '',
 
19
  'notification_email' => '',
20
  );
21
  return apply_filters( 'ditty_settings_defaults', $defaults );
@@ -54,10 +55,25 @@ function ditty_settings( $key=false, $value='' ) {
54
  }
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  /**
58
  * Return a single Ditty setting
59
  *
60
- * @since 3.0
61
  */
62
  function ditty_single_settings( $ditty_id, $key = false ) {
63
  global $ditty_single_settings;
@@ -67,6 +83,7 @@ function ditty_single_settings( $ditty_id, $key = false ) {
67
  if ( ! is_array( $ditty_single_settings[$ditty_id] ) ) {
68
  $ditty_single_settings[$ditty_id] = array();
69
  }
 
70
  if ( $key ) {
71
  if ( isset( $ditty_single_settings[$ditty_id][$key] ) ) {
72
  return $ditty_single_settings[$ditty_id][$key];
@@ -79,7 +96,7 @@ function ditty_single_settings( $ditty_id, $key = false ) {
79
  /**
80
  * Return an array of item types
81
  *
82
- * @since 3.0
83
  */
84
  function ditty_item_types() {
85
  $item_types = array();
@@ -104,7 +121,9 @@ function ditty_item_types() {
104
  'description' => __( 'Add a WP Posts feed.', 'ditty-news-ticker' ),
105
  'class_name' => 'Ditty_Item_Type_Posts_Lite',
106
  );
107
- return apply_filters( 'ditty_item_types', $item_types );
 
 
108
  }
109
 
110
  /**
@@ -646,6 +665,8 @@ function ditty_layouts_posts( $atts = array() ) {
646
  'posts_per_page' => -1,
647
  'post_type' => 'ditty_layout',
648
  'post_status' => 'publish',
 
 
649
  'fields' => $args['fields'],
650
  );
651
  $meta_query = array();
@@ -996,7 +1017,7 @@ function ditty_display_items( $ditty_id, $load_type = 'cache', $custom_layouts =
996
  * @access public
997
  * @var array $items_meta Array of items connected to a Ditty
998
  */
999
- function ditty_items_meta( $ditty_id=false ) {
1000
  $ditty_id = $ditty_id ? $ditty_id : get_the_id();
1001
  global $items_meta;
1002
 
@@ -1034,24 +1055,45 @@ function ditty_item_meta( $item_id ) {
1034
  return apply_filters( 'ditty_item_meta', $meta, $item_id, $ditty_id );
1035
  }
1036
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1037
  /**
1038
  * Return an array of new item meta
1039
  *
1040
- * @since 3.0
1041
  * @access public
1042
  * @var array $item_meta Array of item data
1043
  */
1044
  function ditty_get_new_item_meta( $ditty_id ) {
1045
  $item_type_object = ditty_item_type_object( 'default' );
1046
  $item_value = $item_type_object->default_settings();
1047
- $variation_defaults = ditty_settings( 'variation_defaults' );
1048
- $layout_id = ( isset( $variation_defaults['default'] ) && isset( $variation_defaults['default']['default'] ) ) ? $variation_defaults['default']['default'] : 0;
1049
  $meta = array(
1050
  'item_id' => uniqid( 'new-' ),
1051
  'item_type' => 'default',
1052
  'item_value' => $item_value,
 
1053
  'ditty_id' => $ditty_id,
1054
- 'layout_value' => array( 'default' => $layout_id ),
1055
  );
1056
  return apply_filters( 'ditty_editor_new_item_meta', $meta, $ditty_id );
1057
  }
@@ -1464,10 +1506,23 @@ function ditty_decrypt( $string = '', $key_1 = 'pbQttfc*y2bdNV', $key_2 = '3tq!D
1464
  }
1465
 
1466
  /**
1467
- * Decrypt values
 
 
 
 
 
 
 
 
 
 
 
 
 
1468
  *
1469
  * @since 3.0
1470
- * @var string $output
1471
  */
1472
  function ditty_news_ticker_enabled() {
1473
  if ( '' != ditty_settings( 'ditty_news_ticker' ) ) {
@@ -1475,6 +1530,29 @@ function ditty_news_ticker_enabled() {
1475
  }
1476
  }
1477
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1478
  /**
1479
  * Return the current version
1480
  *
3
  /**
4
  * Return the settings defaults
5
  *
6
+ * @since 3.0.13
7
  */
8
  function ditty_settings_defaults() {
9
  $defaults = array(
15
  'variation_defaults' => array(),
16
  'global_ditty' => array(),
17
  'ditty_news_ticker' => '',
18
+ 'ditty_wizard' => 'disabled',
19
+ 'disable_fontawesome' => '',
20
  'notification_email' => '',
21
  );
22
  return apply_filters( 'ditty_settings_defaults', $defaults );
55
  }
56
  }
57
 
58
+ /**
59
+ * Return the single settings defaults
60
+ *
61
+ * @since 3.0.13
62
+ */
63
+ function ditty_single_settings_defaults() {
64
+ $defaults = array(
65
+ 'ajax_loading' => 'no',
66
+ 'live_updates' => 'no',
67
+ 'previewBg' => false,
68
+ 'previewPadding' => array(),
69
+ );
70
+ return apply_filters( 'ditty_single_settings_defaults', $defaults );
71
+ }
72
+
73
  /**
74
  * Return a single Ditty setting
75
  *
76
+ * @since 3.0.13
77
  */
78
  function ditty_single_settings( $ditty_id, $key = false ) {
79
  global $ditty_single_settings;
83
  if ( ! is_array( $ditty_single_settings[$ditty_id] ) ) {
84
  $ditty_single_settings[$ditty_id] = array();
85
  }
86
+ $ditty_single_settings[$ditty_id] = wp_parse_args( $ditty_single_settings[$ditty_id], ditty_single_settings_defaults() );
87
  if ( $key ) {
88
  if ( isset( $ditty_single_settings[$ditty_id][$key] ) ) {
89
  return $ditty_single_settings[$ditty_id][$key];
96
  /**
97
  * Return an array of item types
98
  *
99
+ * @since 3.0.13
100
  */
101
  function ditty_item_types() {
102
  $item_types = array();
121
  'description' => __( 'Add a WP Posts feed.', 'ditty-news-ticker' ),
122
  'class_name' => 'Ditty_Item_Type_Posts_Lite',
123
  );
124
+ $item_types = apply_filters( 'ditty_item_types', $item_types );
125
+ ksort( $item_types );
126
+ return $item_types;
127
  }
128
 
129
  /**
665
  'posts_per_page' => -1,
666
  'post_type' => 'ditty_layout',
667
  'post_status' => 'publish',
668
+ 'orderby' => 'title',
669
+ 'order' => 'ASC',
670
  'fields' => $args['fields'],
671
  );
672
  $meta_query = array();
1017
  * @access public
1018
  * @var array $items_meta Array of items connected to a Ditty
1019
  */
1020
+ function ditty_items_meta( $ditty_id = false ) {
1021
  $ditty_id = $ditty_id ? $ditty_id : get_the_id();
1022
  global $items_meta;
1023
 
1055
  return apply_filters( 'ditty_item_meta', $meta, $item_id, $ditty_id );
1056
  }
1057
 
1058
+ /**
1059
+ * Return the default layout
1060
+ *
1061
+ * @since 3.0.13
1062
+ * @access public
1063
+ * @var int $layout_id
1064
+ */
1065
+ function ditty_get_default_layout() {
1066
+ $variation_defaults = ditty_settings( 'variation_defaults' );
1067
+ $layout_id = ( isset( $variation_defaults['default'] ) && isset( $variation_defaults['default']['default'] ) ) ? $variation_defaults['default']['default'] : 0;
1068
+ if ( ! $layout_id || 0 == $layout_id ) {
1069
+ $atts = array(
1070
+ 'template' => 'default',
1071
+ 'fields' => 'ids',
1072
+ );
1073
+ if ( $layouts = ditty_layouts_posts( $atts ) ) {
1074
+ return reset( $layouts );
1075
+ }
1076
+ }
1077
+ return $layout_id;
1078
+ }
1079
+
1080
  /**
1081
  * Return an array of new item meta
1082
  *
1083
+ * @since 3.0.13
1084
  * @access public
1085
  * @var array $item_meta Array of item data
1086
  */
1087
  function ditty_get_new_item_meta( $ditty_id ) {
1088
  $item_type_object = ditty_item_type_object( 'default' );
1089
  $item_value = $item_type_object->default_settings();
 
 
1090
  $meta = array(
1091
  'item_id' => uniqid( 'new-' ),
1092
  'item_type' => 'default',
1093
  'item_value' => $item_value,
1094
+ 'item_author' => get_current_user_id(),
1095
  'ditty_id' => $ditty_id,
1096
+ 'layout_value' => array( 'default' => ditty_get_default_layout() ),
1097
  );
1098
  return apply_filters( 'ditty_editor_new_item_meta', $meta, $ditty_id );
1099
  }
1506
  }
1507
 
1508
  /**
1509
+ * Add a uniq_id to a post if it doesn't exist
1510
+ *
1511
+ * @since 3.0.13
1512
+ * @var boolean
1513
+ */
1514
+ function ditty_maybe_add_uniq_id( $post_id ) {
1515
+ if ( ! get_post_meta( $post_id, '_ditty_uniq_id', true ) ) {
1516
+ $uniq_id = $post_id . current_time( 'timestamp', true );
1517
+ update_post_meta( $post_id, '_ditty_uniq_id', $uniq_id );
1518
+ }
1519
+ }
1520
+
1521
+ /**
1522
+ * Check if Ditty News Ticker is enabled
1523
  *
1524
  * @since 3.0
1525
+ * @var boolean
1526
  */
1527
  function ditty_news_ticker_enabled() {
1528
  if ( '' != ditty_settings( 'ditty_news_ticker' ) ) {
1530
  }
1531
  }
1532
 
1533
+ /**
1534
+ * Check if Ditty Wizard is enabled
1535
+ *
1536
+ * @since 3.0.13
1537
+ * @var boolean
1538
+ */
1539
+ function ditty_wizard_enabled() {
1540
+ if ( 'enabled' == ditty_settings( 'ditty_wizard' ) ) {
1541
+ return true;
1542
+ }
1543
+ }
1544
+
1545
+ /**
1546
+ * Write to the Ditty log
1547
+ *
1548
+ * @since 3.0.13
1549
+ */
1550
+ function ditty_log( $log = false ) {
1551
+ if ( $log ) {
1552
+ Ditty()->write_log( $log );
1553
+ }
1554
+ }
1555
+
1556
  /**
1557
  * Return the current version
1558
  *
includes/hooks.php CHANGED
@@ -101,15 +101,34 @@ function ditty_kses_allowed_html( $allowed, $context ) {
101
  }
102
  add_filter( 'wp_kses_allowed_html', 'ditty_kses_allowed_html', 10, 2 );
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  * Filter the available item tags for layout editing
106
  *
107
- * @since 3.0
108
  */
109
  function ditty_default_layout_tags_list( $tags, $item_type ) {
110
  if ( 'default' == $item_type || 'wp_editor' == $item_type ) {
111
  $allowed_tags = array(
112
  'content',
 
 
 
 
113
  );
114
  $tags = array_intersect_key( $tags, array_flip( $allowed_tags ) );
115
  }
101
  }
102
  add_filter( 'wp_kses_allowed_html', 'ditty_kses_allowed_html', 10, 2 );
103
 
104
+ /**
105
+ * Add to the item tags for default item type layouts
106
+ *
107
+ * @since 3.0.13
108
+ */
109
+ function ditty_default_layout_tags( $tags, $item_type ) {
110
+ if ( 'default' == $item_type || 'wp_editor' == $item_type ) {
111
+ if ( isset( $tags['time'] ) ) {
112
+ $tags['time']['atts']['type'] = 'item_created';
113
+ }
114
+ }
115
+ return $tags;
116
+ }
117
+ add_filter( 'ditty_layout_tags', 'ditty_default_layout_tags', 10, 2 );
118
+
119
  /**
120
  * Filter the available item tags for layout editing
121
  *
122
+ * @since 3.0.13
123
  */
124
  function ditty_default_layout_tags_list( $tags, $item_type ) {
125
  if ( 'default' == $item_type || 'wp_editor' == $item_type ) {
126
  $allowed_tags = array(
127
  'content',
128
+ 'time',
129
+ 'author_avatar',
130
+ 'author_bio',
131
+ 'author_name',
132
  );
133
  $tags = array_intersect_key( $tags, array_flip( $allowed_tags ) );
134
  }
includes/js/admin/class-ditty-settings.js CHANGED
@@ -13,17 +13,18 @@
13
 
14
  var Ditty_Settings = function ( elmt, options ) {
15
 
16
- this.elmt = elmt;
17
- this.settings = $.extend( {}, defaults, $.ditty_settings.defaults, options );
18
- this.$elmt = $( elmt );
19
- this.$form = this.$elmt.find( '.ditty-settings__form' );
20
- this.$panels = this.$elmt.find( '.ditty-settings__panels' );
21
- this.saveBtns = this.$elmt.find( '.ditty-settings__save' );
22
- this.tabs = this.$elmt.find( '.ditty-settings__tab' );
23
  this.$notice_update = this.$elmt.find( '.ditty-notification--updated' );
24
- this.$notice_error = this.$elmt.find( '.ditty-notification--error' );
25
- this.$notice_warning = this.$elmt.find( '.ditty-notification--warning' );
26
- this.initData = null;
 
27
  this._init();
28
  };
29
 
@@ -52,23 +53,35 @@
52
  this.$form.on( 'ditty_input_wysiwyg_update', '.ditty-input--wysiwyg', { self: this }, this._checkUpdates );
53
  this.$form.on( 'click', '.ditty-default-layout-install', { self: this }, this._installLayout );
54
  this.$form.on( 'click', '.ditty-default-display-install', { self: this }, this._installDisplay );
 
 
 
 
 
 
55
  },
56
 
57
  /**
58
- * Initialize the extensions
59
  *
60
- * @since 3.0
61
  * @return null
62
  */
63
  _initSlider: function () {
64
  var initPanel = this.$panels.data( 'init_panel' );
65
  this.$panels.ditty_slider( {
66
- transition : 'fade',
67
- transitionSpeed : 0.75,
68
- heightSpeed : 0.75,
69
- touchSwipe : false,
70
- slidesEl : '.ditty-settings__panel',
71
- slideId : ( '' !== initPanel ) ? initPanel : false
 
 
 
 
 
 
72
  } );
73
  },
74
 
@@ -180,6 +193,24 @@
180
  }
181
  },
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  /**
184
  * Listen for a tab click
185
  *
@@ -196,11 +227,17 @@
196
  if ( $currentTab === $tab ) {
197
  return false;
198
  }
199
-
200
- self.$elmt.find( '.ditty-extension__tab' ).removeClass( 'active' );
201
- $tab.addClass( 'active' );
202
 
203
- self.$panels.ditty_slider( 'showSlideById', slideId );
 
 
 
 
 
 
 
 
 
204
  },
205
 
206
  /**
@@ -331,6 +368,47 @@
331
  }
332
  } );
333
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
 
335
  /**
336
  * Return a specific setting
@@ -402,6 +480,7 @@
402
  this.$form.off( 'ditty_input_wysiwyg_update', '.ditty-input--wysiwyg', { self: this }, this._checkUpdates );
403
  this.$form.off( 'click', '.ditty-default-layout-install', { self: this }, this._installLayout );
404
  this.$form.off( 'click', '.ditty-default-display-install', { self: this }, this._installDisplay );
 
405
 
406
  this.$panels.ditty_slider( 'destroy' );
407
  this.elmt._ditty_settings = null;
13
 
14
  var Ditty_Settings = function ( elmt, options ) {
15
 
16
+ this.elmt = elmt;
17
+ this.settings = $.extend( {}, defaults, $.ditty_settings.defaults, options );
18
+ this.$elmt = $( elmt );
19
+ this.$form = this.$elmt.find( '.ditty-settings__form' );
20
+ this.$panels = this.$elmt.find( '.ditty-settings__panels' );
21
+ this.saveBtns = this.$elmt.find( '.ditty-settings__save' );
22
+ this.tabs = this.$elmt.find( '.ditty-settings__tab' );
23
  this.$notice_update = this.$elmt.find( '.ditty-notification--updated' );
24
+ this.$notice_error = this.$elmt.find( '.ditty-notification--error' );
25
+ this.$notice_warning = this.$elmt.find( '.ditty-notification--warning' );
26
+ this.initData = null;
27
+ this.url = window.location.href;
28
  this._init();
29
  };
30
 
53
  this.$form.on( 'ditty_input_wysiwyg_update', '.ditty-input--wysiwyg', { self: this }, this._checkUpdates );
54
  this.$form.on( 'click', '.ditty-default-layout-install', { self: this }, this._installLayout );
55
  this.$form.on( 'click', '.ditty-default-display-install', { self: this }, this._installDisplay );
56
+ //this.$form.on( 'click', 'button[name="ditty_export_button"]', { self: this }, this._exportPosts );
57
+
58
+ if ( this.url.indexOf( "#" ) > 0 ) {
59
+ var activePanel = this.url.substring( this.url.indexOf( "#" ) + 1 );
60
+ this._activatePanel( activePanel );
61
+ }
62
  },
63
 
64
  /**
65
+ * Initialize the slider
66
  *
67
+ * @since 3.0.13
68
  * @return null
69
  */
70
  _initSlider: function () {
71
  var initPanel = this.$panels.data( 'init_panel' );
72
  this.$panels.ditty_slider( {
73
+ transition : 'fade',
74
+ transitionEase : 'linear',
75
+ transitionSpeed : 0,
76
+ heightSpeed : 0,
77
+ initTransition : 'fade',
78
+ initTransitionEase : 'linear',
79
+ initTransitionSpeed : 0,
80
+ initHeightEase : 'linear',
81
+ initHeightSpeed : 0,
82
+ touchSwipe : false,
83
+ slidesEl : '.ditty-settings__panel',
84
+ slideId : ( '' !== initPanel ) ? initPanel : false
85
  } );
86
  },
87
 
193
  }
194
  },
195
 
196
+ /**
197
+ * Activate a panel
198
+ *
199
+ * @since 3.0.13
200
+ * @return null
201
+ */
202
+ _activatePanel: function( panelId ) {
203
+ var $tab = this.$elmt.find( '.ditty-settings__tab[data-panel="' + panelId + '"]' );
204
+ if ( ! $tab.length ) {
205
+ return false;
206
+ }
207
+
208
+ this.$elmt.find( '.ditty-settings__tab' ).removeClass( 'active' );
209
+ $tab.addClass( 'active' );
210
+
211
+ this.$panels.ditty_slider( 'showSlideById', panelId );
212
+ },
213
+
214
  /**
215
  * Listen for a tab click
216
  *
227
  if ( $currentTab === $tab ) {
228
  return false;
229
  }
 
 
 
230
 
231
+ var newUrl;
232
+ if ( slideId ) {
233
+ var hash = '#' + slideId;
234
+ newUrl = self.url.split("#")[0] + hash;
235
+ } else {
236
+ newUrl = self.url.split("#")[0];
237
+ }
238
+ history.replaceState( null, null, newUrl );
239
+
240
+ self._activatePanel( slideId );
241
  },
242
 
243
  /**
368
  }
369
  } );
370
  },
371
+
372
+ /**
373
+ * Export posts
374
+ *
375
+ * @since 3.0.13
376
+ * @return null
377
+ */
378
+ // _exportPosts: function( e ) {
379
+ // e.preventDefault();
380
+ // var self = e.data.self,
381
+ // $button = $( e.target ).is( 'button' ) ? $( e.target ) : $( e.target ).parents( 'button' ),
382
+ // $parent = $button.parent( '.ditty-field-only' ),
383
+ // $options = $parent.siblings( '.ditty-field-only--ditty_export_options' ),
384
+ // $icon = $button.find( 'i' ),
385
+ // export_options = [];
386
+ //
387
+ // if ( $button.attr( 'disabled' ) ) {
388
+ // return false;
389
+ // }
390
+ // $button.attr( 'disabled', 'disabled' );
391
+ // $icon.show();
392
+ //
393
+ // if ( $options.length ) {
394
+ // $options.find( 'input[type="checkbox"]' ).each( function() {
395
+ // if ( $( this ).is( ':checked' ) ) {
396
+ // export_options.push( $( this ).val() );
397
+ // }
398
+ // } );
399
+ // }
400
+ //
401
+ // var data = {
402
+ // action : 'ditty_export_posts',
403
+ // export_type : $button.data( 'export_type' ),
404
+ // export_options : export_options,
405
+ // security : dittyAdminVars.security
406
+ // };
407
+ // $.post( dittyAdminVars.ajaxurl, data, function( response ) {
408
+ // $icon.hide();
409
+ // self.$elmt.removeAttr( 'disabled' );
410
+ // } );
411
+ // },
412
 
413
  /**
414
  * Return a specific setting
480
  this.$form.off( 'ditty_input_wysiwyg_update', '.ditty-input--wysiwyg', { self: this }, this._checkUpdates );
481
  this.$form.off( 'click', '.ditty-default-layout-install', { self: this }, this._installLayout );
482
  this.$form.off( 'click', '.ditty-default-display-install', { self: this }, this._installDisplay );
483
+ //this.$form.off( 'click', 'button[name="ditty_export_button"]', { self: this }, this._exportPosts );
484
 
485
  this.$panels.ditty_slider( 'destroy' );
486
  this.elmt._ditty_settings = null;
includes/js/admin/ditty-wizard.js ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ jQuery( function( $ ) {
3
+ // Setup strict mode
4
+ (function() {
5
+
6
+ "use strict";
7
+
8
+ var dittyWizardValues = {};
9
+
10
+ /**
11
+ * Ditty title
12
+ *
13
+ * @since 3.0.13
14
+ */
15
+ $( '.ditty-wizard-setting--title input[name="ditty_title"]' ).on( 'keyup', function() {
16
+ var $setting = $( this ).parents( '.ditty-wizard-setting' ),
17
+ val = $( this ).val();
18
+
19
+ if ( '' !== val ) {
20
+ $setting.addClass( 'complete' );
21
+
22
+ // Show the layout settings
23
+ $( '.ditty-wizard-setting--item-type').css( 'display', 'flex' );
24
+ }
25
+ dittyWizardValues.title = val;
26
+ } );
27
+
28
+ /**
29
+ * Item Type
30
+ *
31
+ * @since 3.0.13
32
+ */
33
+ $( '.ditty-wizard-setting--item-type .ditty-option-grid__item' ).on( 'click', function( e ) {
34
+ e.preventDefault();
35
+ var $setting = $( this ).parents( '.ditty-wizard-setting' ),
36
+ slug = $( this ).data( 'value' );
37
+
38
+ if ( ! $( this ).hasClass( 'active' ) ) {
39
+
40
+ $( this ).siblings().removeClass( 'active' );
41
+ $( this ).addClass( 'active' );
42
+
43
+ // Reset & show item type settings
44
+ $( '.ditty-wizard-setting--item-type-settings' ).removeClass( 'complete' );
45
+ $( '.ditty-wizard-setting--item-type-settings .ditty-option-submit' ).addClass( 'ditty-button--primary' );
46
+ $( '.ditty-wizard-setting--item-type-settings').css( 'display', 'flex' );
47
+
48
+ // Display the correct item type settings group
49
+ var $itemSettings = $( '.ditty-item-type-settings__group[data-id="' + slug + '"]' );
50
+ $( '.ditty-item-type-settings__group' ).removeClass( 'active' ).hide();
51
+ $itemSettings.addClass( 'active' ).show();
52
+ $itemSettings.trigger( 'ditty_init_fields' );
53
+ if ( ! $itemSettings.hasClass( 'init' ) ) {
54
+ $itemSettings.trigger( 'ditty_wizard_init', [slug] );
55
+ $itemSettings.addClass( 'init' );
56
+ }
57
+
58
+ // Reset the layout settings
59
+ $( '.ditty-wizard-setting--layout' ).removeClass( 'complete' );
60
+ $( '.ditty-wizard-setting--layout .ditty-option-grid__item' ).removeClass( 'active' );
61
+ $( '.ditty-wizard-setting--layout').hide();
62
+
63
+ // Display the correct layout variation settings group
64
+ $( '.ditty-wizard-setting--layout__variation' ).removeClass( 'complete' ).removeClass( 'active' ).hide();
65
+ $( '.ditty-wizard-setting--layout__variation.' + slug ).addClass( 'active' ).show();
66
+
67
+ // Reset the display settings
68
+ $( '.ditty-wizard-setting--display' ).removeClass( 'complete' );
69
+ $( '.ditty-wizard-setting--display .ditty-option-grid__item' ).removeClass( 'active' );
70
+ $( '.ditty-wizard-setting--display').hide();
71
+
72
+ // Reset the submit settings
73
+ $( '.ditty-wizard-setting--submit').hide();
74
+
75
+ // Add to the initialize object
76
+ dittyWizardValues.itemType = $( this ).data( 'value' );
77
+
78
+ // Animate to the next setting
79
+ if ( ! $setting.hasClass( 'complete' ) ) {
80
+ $setting.addClass( 'complete' );
81
+ $( [document.documentElement, document.body] ).stop().animate( {
82
+ scrollTop: $( '.ditty-wizard-setting--item-type-settings' ).offset().top
83
+ }, 700 );
84
+ }
85
+ }
86
+ } );
87
+
88
+ /**
89
+ * Item Type Settings Submit
90
+ *
91
+ * @since 3.0.13
92
+ */
93
+ $( '.ditty-wizard-setting--item-type-settings .ditty-option-submit' ).on( 'click', function( e ) {
94
+ e.preventDefault();
95
+ var $setting = $( this ).parents( '.ditty-wizard-setting' ),
96
+ $settings_group = $setting.find( '.ditty-item-type-settings__group.active' ),
97
+ values = {};
98
+
99
+ $( this ).removeClass( 'ditty-button--primary' );
100
+
101
+ $settings_group.find( ':input' ).each( function() {
102
+ var type = $( this ).prop( 'type' );
103
+
104
+ // checked radios/checkboxes
105
+ if ( ( type === "checkbox" || type === "radio" ) ) {
106
+ if ( this.checked ) {
107
+ values[$( this ).attr( 'name' )] = $( this ).val();
108
+ }
109
+ } else if ( type !== "button" && type !== "submit" ) {
110
+ values[$( this ).attr( 'name' )] = $( this ).val();
111
+ }
112
+ } );
113
+
114
+ // Show the layout settings
115
+ $( '.ditty-wizard-setting--layout').css( 'display', 'flex' );
116
+
117
+ // Add to the initialize object
118
+ dittyWizardValues.itemTypeValues = values;
119
+
120
+ // Animate to the next setting
121
+ if ( ! $setting.hasClass( 'complete' ) ) {
122
+ $setting.addClass( 'complete' );
123
+ $( [document.documentElement, document.body] ).stop().animate( {
124
+ scrollTop: $( '.ditty-wizard-setting--layout' ).offset().top
125
+ }, 700 );
126
+ }
127
+ } );
128
+
129
+ /**
130
+ * Variation Layout
131
+ *
132
+ * @since 3.0.13
133
+ */
134
+ $( '.ditty-wizard-setting--layout .ditty-option-grid__item' ).on( 'click', function( e ) {
135
+ e.preventDefault();
136
+ var $setting = $( this ).parents( '.ditty-wizard-setting' ),
137
+ $variations = $( this ).parents( '.ditty-wizard-setting--layout__variation' );
138
+
139
+ if ( ! $( this ).hasClass( 'active' ) ) {
140
+ $( this ).siblings().removeClass( 'active' );
141
+ $( this ).addClass( 'active' );
142
+ $variations.addClass( 'complete' );
143
+
144
+ // Check for all variations complete
145
+ if ( $( '.ditty-wizard-setting--layout__variation.active' ).length === $( '.ditty-wizard-setting--layout__variation.complete' ).length ) {
146
+ var layoutVariations = {};
147
+ $( '.ditty-wizard-setting--layout__variation.complete' ).each( function() {
148
+ layoutVariations[$( this ).data( 'id' )] = $( this ).find( '.ditty-option-grid__item.active' ).data( 'value' );
149
+ } );
150
+
151
+ // Show the display settings
152
+ $( '.ditty-wizard-setting--display').css( 'display', 'flex' );
153
+
154
+ dittyWizardValues.layoutVariations = layoutVariations;
155
+
156
+ // Animate to the next setting
157
+ if ( ! $setting.hasClass( 'complete' ) ) {
158
+ $setting.addClass( 'complete' );
159
+ $( [document.documentElement, document.body] ).stop().animate( {
160
+ scrollTop: $( '.ditty-wizard-setting--display' ).offset().top
161
+ }, 700 );
162
+ }
163
+ }
164
+ }
165
+ } );
166
+
167
+ /**
168
+ * Display
169
+ *
170
+ * @since 3.0.13
171
+ */
172
+ $( '.ditty-wizard-setting--display .ditty-option-grid__item' ).on( 'click', function( e ) {
173
+ e.preventDefault();
174
+ var $setting = $( this ).parents( '.ditty-wizard-setting' ),
175
+ id = $( this ).data( 'value' );
176
+
177
+ if ( ! $( this ).hasClass( 'active' ) ) {
178
+ $( this ).siblings().removeClass( 'active' );
179
+ $( this ).addClass( 'active' );
180
+
181
+ // Show the submit settings
182
+ $( '.ditty-wizard-setting--submit').css( 'display', 'flex' );
183
+
184
+ dittyWizardValues.display = id;
185
+
186
+ // Animate to the next setting
187
+ if ( ! $setting.hasClass( 'complete' ) ) {
188
+ $setting.addClass( 'complete' );
189
+ $( [document.documentElement, document.body] ).stop().animate( {
190
+ scrollTop: $( '.ditty-wizard-setting--submit' ).offset().top
191
+ }, 700 );
192
+ }
193
+ }
194
+ } );
195
+
196
+ /**
197
+ * Submit the wizard
198
+ *
199
+ * @since 3.0.13
200
+ */
201
+ $( '#ditty-wizard-submit' ).on( 'click', function( e ) {
202
+ e.preventDefault();
203
+
204
+ var dittyId = $( this ).data( 'ditty_id' );
205
+
206
+ $( '#ditty-wizard-overlay' ).addClass( 'active' );
207
+
208
+ //$( this ).text( $( this ).data( 'submitting' ) );
209
+
210
+ var data = {
211
+ action : 'ditty_submit_wizard',
212
+ ditty_id : dittyId,
213
+ init_values : dittyWizardValues,
214
+ security : dittyVars.security
215
+ };
216
+ $.post( dittyVars.ajaxurl, data, function( response ) {
217
+ window.history.pushState( null, '', '/wp-admin/post.php?post=' + dittyId + '&action=edit' );
218
+ location.reload();
219
+ }, 'json' );
220
+
221
+ } );
222
+
223
+ }() );
224
+
225
+ } );
includes/js/class-ditty-display-list.js CHANGED
@@ -17,6 +17,7 @@
17
  var defaults = {
18
  id : 0,
19
  title : '',
 
20
  display : 0,
21
  status : '',
22
  spacing : 30,
17
  var defaults = {
18
  id : 0,
19
  title : '',
20
+ titleDisplay : 'none',
21
  display : 0,
22
  status : '',
23
  spacing : 30,
includes/js/class-ditty-display-list.min.js CHANGED
@@ -1 +1 @@
1
- !function($){"use strict";var t={id:0,title:"",display:0,status:"",spacing:30,paging:0,perPage:0,transition:"fade",transitionEase:"easeInOutQuint",transitionSpeed:1.5,autoplay:0,autoplayPause:0,autoplaySpeed:8,height:0,heightEase:"easeInOutQuint",heightSpeed:1.5,arrows:"none",arrowsIconColor:"",arrowsBgColor:"",arrowsPosition:"center",arrowsPadding:{},arrowsStatic:0,navPrev:'<i class="fas fa-angle-left"></i>',navNext:'<i class="fas fa-angle-right"></i>',bullets:"none",bulletsColor:"",bulletsColorActive:"",bulletsPosition:"bottomCenter",bulletsSpacing:2,bulletsPadding:{},bullet:"",maxWidth:"",bgColor:"",padding:{},margin:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},contentsBgColor:"",contentsPadding:{},contentsBorderColor:{},contentsBorderStyle:{},contentsBorderWidth:{},contentsBorderRadius:{},pageBgColor:"",pagePadding:{},pageBorderColor:{},pageBorderStyle:{},pageBorderWidth:{},pageBorderRadius:{},itemTextColor:"",itemBgColor:"",itemBorderColor:{},itemBorderStyle:{},itemBorderWidth:{},itemBorderRadius:{},itemPadding:{},page:0,shuffle:0,showEditor:0,items:[]},i=function(i,e){this.displayType="list",this.elmt=i,this.$elmt=$(i),this.settings=$.extend({},t,$.ditty_list.defaults,e),this.total=this.settings.items.length,this.totalPages=1,this.page=this.settings.page,this.pages=[],this.enabledItems=[],this.visibleItems=[],this.editItem=null,1===parseInt(this.settings.shuffle)&&this.shuffle(),this._init()};i.prototype={_init:function(){this.$elmt.removeClass("ditty--pre"),this.$elmt.addClass("ditty ditty-list"),this.$elmt.attr("data-id",this.settings.id),this.$elmt.attr("data-type",this.displayType),this.$elmt.attr("data-display",this.settings.display),this._calculatePages(),this._initSlider(),this.settings.showEditor?dittyEditorInit(this):this.trigger("start_live_updates")},_initSlider:function(){var t=[];$.each(this.settings,(function(i,e){var s=i.replace("page","slide");t[s]=e})),t.slides=this.pages,this.$elmt.ditty_slider(t),this.$elmt.on("ditty_slider_init",{self:this},this._triggerInit),this.$elmt.on("ditty_slider_update",{self:this},this._triggerUpdate),this.$elmt.on("ditty_slider_after_slide_update",{self:this},this._triggerShowSlide)},_destroySlider:function(){this.$elmt.ditty_slider&&(this.$elmt.off("ditty_slider_init",{self:this},this._triggerInit),this.$elmt.off("ditty_slider_update",{self:this},this._triggerUpdate),this.$elmt.off("ditty_slider_after_slide_update",{self:this},this._triggerShowSlide),this.$elmt.ditty_slider("destroy"))},_updateSlider:function(t){var i=t||this.$elmt.ditty_slider("options","slide");this.$elmt.ditty_slider("options","slides",this.settings.pages),this.$elmt.ditty_slider("options","slide",-1),this.$elmt.ditty_slider("showSlide",i)},_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),t.css({paddingBottom:this.settings.spacing+"px"})},_createPage:function(t){var i=this,e=$('<div class="ditty-list__page ditty-list__page--'+t+'"></div>'),s=this._getItemsByPageIndex(t);return $.each(s,(function(t,s){var n=$(s.html);i._styleItem(n),s.css&&dittyLayoutCss(s.css,s.layout_id),e.append(n)})),e.children().last().css({paddingBottom:0}),{id:"page"+parseInt(t+1),html:e,items:s}},_calculatePages:function(){var t=this,i=[];$.each(this.settings.items,(function(e,s){t._isItemEnabled(e)&&i.push(s)})),this.enabledItems=i,this.total=i.length,parseInt(this.settings.paging)&&parseInt(this.settings.perPage)>0?this.totalPages=Math.ceil(parseInt(this.total)/parseInt(this.settings.perPage)):this.totalPages=1,this.pages=[];for(var e=0;e<this.totalPages;e++)this.pages.push(this._createPage(e))},_getPageByItemIndex:function(t){return Math.ceil((parseInt(t)+1)/this.settings.perPage)-1},_getItemsByPageIndex:function(t){var i=this.enabledItems;if(parseInt(this.totalPages)>1){var e=parseInt(this.settings.perPage)*t,s=e+parseInt(this.settings.perPage);i=this.enabledItems.slice(e,s)}return i},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},_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.updateItems(this.settings.items),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.updateItems(this.settings.items),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){var e=this._getPageByItemIndex(parseInt(i[0]));this.$elmt.ditty_slider("showSlide",e)}},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(parseInt(this.item)+1,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=this,a=this.$elmt.ditty_slider("options","slide"),r=[];if(i){var d=this.settings.items.slice(),l=[],h=!1;$.each(d,(function(s,n){String(n.id)===String(i)?"after"===e?(l.push(n),$.each(t,(function(t,i){l.push(i)})),h=!0):"before"===e?($.each(t,(function(t,i){l.push(i)})),l.push(n),h=!0):h||($.each(t,(function(t,i){l.push(i),r.push(String(i.uniq_id))})),h=!0):l.push(n)})),h||($.each(this.settings.items,(function(t,i){l.push(i)})),h=!0),t=l}this.settings.items=t,this.total=t.length,this._calculatePages(),this.$elmt.ditty_slider("options","slides",this.pages);var o=this.$elmt.ditty_slider("options","currentSlide"),g=o.children(".ditty-item"),m=this.$elmt.ditty_slider("options","slide"),c=[];if(a!==m)return!1;var p,u=0,_=null,f=-1,y=[];this.pages[m]&&(p=this.pages[m].items,u=p.length,$.each(p,(function(t,i){var e=$(i.html);if(i.css&&dittyLayoutCss(i.css,i.layout_id),n._styleItem(e),t===u-1&&e.css({paddingBottom:0}),g[t]){var a=$(g[t]);_=a,y.push(t),(s||String(a.data("item_uniq_id"))!==String(i.uniq_id)||r.includes(String(i.uniq_id)))&&c.push({currentItem:a,newItem:e})}else{var d=$('<div class="ditty-temp-item"></div>');o.append(d),c.push({currentItem:d,newItem:e}),f=parseInt(n.settings.spacing)}}))),$.each(g,(function(t){if(!y.includes(t)){var i=$(g[t]),e=$('<div class="ditty-temp-item"></div>');c.push({currentItem:i,newItem:e}),f=0}})),null!==_&&f>=0&&_.css({paddingBottom:f+"px"}),dittyUpdateItems(c),this.trigger("update")},getActiveItems:function(){return this._getItemsByPageIndex(this.page)},_triggerInit:function(t){t.data.self.trigger("init")},_triggerUpdate:function(t){t.data.self.trigger("update")},_triggerShowSlide:function(t,i){var e=t.data.self;e.page=i,e.trigger("active_items_update")},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"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)},_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;default:return this.settings[t]}},_setOption:function(t,i){if(void 0===i)return!1;var e=t,s=i,n=!0,a=this;switch(t){case"items":n=!1,this.updateItems(i);break;case"perPage":case"paging":n=!1,this.settings[t]=i,this.updateItems(this.settings.items);break;case"spacing":this.settings[t]=i,this.$elmt.find(".ditty-item").each((function(){$(this).css({paddingBottom:a.settings.spacing+"px"})})),this.$elmt.find(".ditty-list__page").each((function(){$(this).children(".ditty-item:last-child").css({paddingBottom:0})}));break;case"itemTextColor":case"itemBgColor":case"itemBorderColor":case"itemBorderStyle":case"itemBorderWidth":case"itemBorderRadius":case"itemPadding":this.settings[t]=i,this.$elmt.find(".ditty-item").each((function(){a._styleItem($(this))}));break;default:this.settings[t]=i}n&&(e=e.replace("page","slide"),this.$elmt.ditty_slider("options",e,s))},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._destroySlider(),this.$elmt.removeClass("ditty ditty-list"),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_list=null}},$.fn.ditty_list=function(t){var e,s=arguments,n=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_list||(this._ditty_list=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_list;if(!i)throw new Error("No Ditty_List 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_List.');return void 0!==e?e:this}},$.ditty_list={},$.ditty_list.defaults=t}(jQuery);
1
+ !function($){"use strict";var t={id:0,title:"",titleDisplay:"none",display:0,status:"",spacing:30,paging:0,perPage:0,transition:"fade",transitionEase:"easeInOutQuint",transitionSpeed:1.5,autoplay:0,autoplayPause:0,autoplaySpeed:8,height:0,heightEase:"easeInOutQuint",heightSpeed:1.5,arrows:"none",arrowsIconColor:"",arrowsBgColor:"",arrowsPosition:"center",arrowsPadding:{},arrowsStatic:0,navPrev:'<i class="fas fa-angle-left"></i>',navNext:'<i class="fas fa-angle-right"></i>',bullets:"none",bulletsColor:"",bulletsColorActive:"",bulletsPosition:"bottomCenter",bulletsSpacing:2,bulletsPadding:{},bullet:"",maxWidth:"",bgColor:"",padding:{},margin:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},contentsBgColor:"",contentsPadding:{},contentsBorderColor:{},contentsBorderStyle:{},contentsBorderWidth:{},contentsBorderRadius:{},pageBgColor:"",pagePadding:{},pageBorderColor:{},pageBorderStyle:{},pageBorderWidth:{},pageBorderRadius:{},itemTextColor:"",itemBgColor:"",itemBorderColor:{},itemBorderStyle:{},itemBorderWidth:{},itemBorderRadius:{},itemPadding:{},page:0,shuffle:0,showEditor:0,items:[]},i=function(i,e){this.displayType="list",this.elmt=i,this.$elmt=$(i),this.settings=$.extend({},t,$.ditty_list.defaults,e),this.total=this.settings.items.length,this.totalPages=1,this.page=this.settings.page,this.pages=[],this.enabledItems=[],this.visibleItems=[],this.editItem=null,1===parseInt(this.settings.shuffle)&&this.shuffle(),this._init()};i.prototype={_init:function(){this.$elmt.removeClass("ditty--pre"),this.$elmt.addClass("ditty ditty-list"),this.$elmt.attr("data-id",this.settings.id),this.$elmt.attr("data-type",this.displayType),this.$elmt.attr("data-display",this.settings.display),this._calculatePages(),this._initSlider(),this.settings.showEditor?dittyEditorInit(this):this.trigger("start_live_updates")},_initSlider:function(){var t=[];$.each(this.settings,(function(i,e){var s=i.replace("page","slide");t[s]=e})),t.slides=this.pages,this.$elmt.ditty_slider(t),this.$elmt.on("ditty_slider_init",{self:this},this._triggerInit),this.$elmt.on("ditty_slider_update",{self:this},this._triggerUpdate),this.$elmt.on("ditty_slider_after_slide_update",{self:this},this._triggerShowSlide)},_destroySlider:function(){this.$elmt.ditty_slider&&(this.$elmt.off("ditty_slider_init",{self:this},this._triggerInit),this.$elmt.off("ditty_slider_update",{self:this},this._triggerUpdate),this.$elmt.off("ditty_slider_after_slide_update",{self:this},this._triggerShowSlide),this.$elmt.ditty_slider("destroy"))},_updateSlider:function(t){var i=t||this.$elmt.ditty_slider("options","slide");this.$elmt.ditty_slider("options","slides",this.settings.pages),this.$elmt.ditty_slider("options","slide",-1),this.$elmt.ditty_slider("showSlide",i)},_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),t.css({paddingBottom:this.settings.spacing+"px"})},_createPage:function(t){var i=this,e=$('<div class="ditty-list__page ditty-list__page--'+t+'"></div>'),s=this._getItemsByPageIndex(t);return $.each(s,(function(t,s){var n=$(s.html);i._styleItem(n),s.css&&dittyLayoutCss(s.css,s.layout_id),e.append(n)})),e.children().last().css({paddingBottom:0}),{id:"page"+parseInt(t+1),html:e,items:s}},_calculatePages:function(){var t=this,i=[];$.each(this.settings.items,(function(e,s){t._isItemEnabled(e)&&i.push(s)})),this.enabledItems=i,this.total=i.length,parseInt(this.settings.paging)&&parseInt(this.settings.perPage)>0?this.totalPages=Math.ceil(parseInt(this.total)/parseInt(this.settings.perPage)):this.totalPages=1,this.pages=[];for(var e=0;e<this.totalPages;e++)this.pages.push(this._createPage(e))},_getPageByItemIndex:function(t){return Math.ceil((parseInt(t)+1)/this.settings.perPage)-1},_getItemsByPageIndex:function(t){var i=this.enabledItems;if(parseInt(this.totalPages)>1){var e=parseInt(this.settings.perPage)*t,s=e+parseInt(this.settings.perPage);i=this.enabledItems.slice(e,s)}return i},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},_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.updateItems(this.settings.items),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.updateItems(this.settings.items),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){var e=this._getPageByItemIndex(parseInt(i[0]));this.$elmt.ditty_slider("showSlide",e)}},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(parseInt(this.item)+1,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=this,a=this.$elmt.ditty_slider("options","slide"),r=[];if(i){var d=this.settings.items.slice(),l=[],h=!1;$.each(d,(function(s,n){String(n.id)===String(i)?"after"===e?(l.push(n),$.each(t,(function(t,i){l.push(i)})),h=!0):"before"===e?($.each(t,(function(t,i){l.push(i)})),l.push(n),h=!0):h||($.each(t,(function(t,i){l.push(i),r.push(String(i.uniq_id))})),h=!0):l.push(n)})),h||($.each(this.settings.items,(function(t,i){l.push(i)})),h=!0),t=l}this.settings.items=t,this.total=t.length,this._calculatePages(),this.$elmt.ditty_slider("options","slides",this.pages);var o=this.$elmt.ditty_slider("options","currentSlide"),g=o.children(".ditty-item"),m=this.$elmt.ditty_slider("options","slide"),c=[];if(a!==m)return!1;var p,u=0,_=null,f=-1,y=[];this.pages[m]&&(p=this.pages[m].items,u=p.length,$.each(p,(function(t,i){var e=$(i.html);if(i.css&&dittyLayoutCss(i.css,i.layout_id),n._styleItem(e),t===u-1&&e.css({paddingBottom:0}),g[t]){var a=$(g[t]);_=a,y.push(t),(s||String(a.data("item_uniq_id"))!==String(i.uniq_id)||r.includes(String(i.uniq_id)))&&c.push({currentItem:a,newItem:e})}else{var d=$('<div class="ditty-temp-item"></div>');o.append(d),c.push({currentItem:d,newItem:e}),f=parseInt(n.settings.spacing)}}))),$.each(g,(function(t){if(!y.includes(t)){var i=$(g[t]),e=$('<div class="ditty-temp-item"></div>');c.push({currentItem:i,newItem:e}),f=0}})),null!==_&&f>=0&&_.css({paddingBottom:f+"px"}),dittyUpdateItems(c),this.trigger("update")},getActiveItems:function(){return this._getItemsByPageIndex(this.page)},_triggerInit:function(t){t.data.self.trigger("init")},_triggerUpdate:function(t){t.data.self.trigger("update")},_triggerShowSlide:function(t,i){var e=t.data.self;e.page=i,e.trigger("active_items_update")},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"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)},_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;default:return this.settings[t]}},_setOption:function(t,i){if(void 0===i)return!1;var e=t,s=i,n=!0,a=this;switch(t){case"items":n=!1,this.updateItems(i);break;case"perPage":case"paging":n=!1,this.settings[t]=i,this.updateItems(this.settings.items);break;case"spacing":this.settings[t]=i,this.$elmt.find(".ditty-item").each((function(){$(this).css({paddingBottom:a.settings.spacing+"px"})})),this.$elmt.find(".ditty-list__page").each((function(){$(this).children(".ditty-item:last-child").css({paddingBottom:0})}));break;case"itemTextColor":case"itemBgColor":case"itemBorderColor":case"itemBorderStyle":case"itemBorderWidth":case"itemBorderRadius":case"itemPadding":this.settings[t]=i,this.$elmt.find(".ditty-item").each((function(){a._styleItem($(this))}));break;default:this.settings[t]=i}n&&(e=e.replace("page","slide"),this.$elmt.ditty_slider("options",e,s))},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._destroySlider(),this.$elmt.removeClass("ditty ditty-list"),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_list=null}},$.fn.ditty_list=function(t){var e,s=arguments,n=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_list||(this._ditty_list=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_list;if(!i)throw new Error("No Ditty_List 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_List.');return void 0!==e?e:this}},$.ditty_list={},$.ditty_list.defaults=t}(jQuery);
includes/js/class-ditty-display-ticker.js CHANGED
@@ -20,6 +20,7 @@
20
  direction : 'left',
21
  spacing : 20,
22
  speed : 10, // 1 - 10
 
23
  hoverPause : 0, // 0, 1
24
  height : null,
25
  minHeight : null,
@@ -42,6 +43,19 @@
42
  contentsBorderStyle : {},
43
  contentsBorderWidth : {},
44
  contentsBorderRadius : {},
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  itemTextColor : '',
46
  itemBgColor : '',
47
  itemBorderColor : {},
@@ -54,10 +68,6 @@
54
  item : 0,
55
  shuffle : 0,
56
  showEditor : 0,
57
- // init : function () {},
58
- // play : function () {},
59
- // pause : function () {},
60
- // walk : function () {},
61
  items : [
62
  // {
63
  // id: null,
@@ -77,6 +87,8 @@
77
  this.nextItem = null;
78
  this.total = this.settings.items.length;
79
  this.$elmt = $( elmt );
 
 
80
  this.$contents = null;
81
  this.$items = null;
82
  this.$currentItem = null;
@@ -84,25 +96,9 @@
84
  this.scrollPercent = 0.13;
85
  this.running = false;
86
  this.interval = false;
87
- // this.easeTimer = false;
88
  this.currentHeight = this.settings.height;
89
  this.visibleItems = [];
90
- // this.editItem = null;
91
- // this.cachedItems = [];
92
-
93
- // this.directions = [
94
- // 'left',
95
- // 'right',
96
- // 'up',
97
- // 'down'
98
- // ];
99
- //
100
- // if ( this.settings.directionsRegister instanceof Array === false ) {
101
- // this.settings.directionsRegister = [ this.settings.directionsRegister ];
102
- // }
103
- //
104
- // this.directions = this.directions.concat( this.settings.directionsRegister );
105
-
106
  if ( 1 === parseInt( this.settings.shuffle ) ) {
107
  this.shuffle();
108
  }
@@ -117,7 +113,9 @@
117
  $contents,
118
  $items;
119
 
120
-
 
 
121
 
122
  // Remove the pre class
123
  this.$elmt.removeClass( 'ditty--pre' );
@@ -131,6 +129,11 @@
131
  // Create the ticker contents
132
  $contents = $( '<div class="ditty-ticker__contents"></div>' );
133
  this.$contents = $contents;
 
 
 
 
 
134
 
135
  // Create the ticker items container
136
  $items = $( '<div class="ditty-ticker__items"></div>' );
@@ -145,10 +148,11 @@
145
 
146
  // Setup styles
147
  this._styleDisplay();
 
148
 
149
  // Add listeners
150
- this.$contents.on( 'mouseenter', { self: this }, this._mouseenter );
151
- this.$contents.on( 'mouseleave', { self: this }, this._mouseleave );
152
 
153
  // Show the editor or start live updates
154
  if ( this.settings.showEditor ) {
@@ -159,10 +163,10 @@
159
 
160
  // Trigger the init
161
  setTimeout( function () {
162
-
163
  // Preload images
164
- for ( var i = 0; i < this.total; i++ ) {
165
- this._preloadItem( this.settings.items[i] );
166
  }
167
 
168
  // Initialize the items
@@ -312,6 +316,11 @@
312
  if ( undefined === this.settings.items[index] ) {
313
  return false;
314
  }
 
 
 
 
 
315
 
316
  // Create and add a new item
317
  var $item = $( this.settings.items[index].html );
@@ -704,13 +713,16 @@
704
 
705
  fillTimer = setInterval( function() {
706
 
707
- var $item = self._initializeItem( current ),
708
- data = self._filledItemInit( current, $item, posX, posY, tickerW, tickerH );
709
-
710
- posX = data.posX;
711
- posY = data.posY;
712
- filled = data.filled;
713
- current = self._getNextItem( current );
 
 
 
714
 
715
  if ( filled ) {
716
  clearInterval( fillTimer );
@@ -818,6 +830,7 @@
818
  this.settings.direction = direction;
819
  this._timerStop();
820
  this._resetItems();
 
821
  this._initializeItems();
822
  this.trigger( 'direction' );
823
  },
@@ -863,6 +876,43 @@
863
  }
864
  },
865
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
866
  /**
867
  * Style item elemtents
868
  *
@@ -921,15 +971,30 @@
921
  if ( undefined === value ) {
922
  return false;
923
  }
924
-
925
  switch( key ) {
926
  case 'items':
927
  this.updateItems( value );
928
  break;
929
  case 'direction':
930
- this.settings[key] = value;
931
- this._styleDisplay();
932
- this._setDirection( value );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
933
  break;
934
  case 'minHeight':
935
  case 'maxHeight':
@@ -950,7 +1015,7 @@
950
  this.settings[key] = value;
951
  break;
952
  }
953
-
954
  this.trigger( 'update' );
955
  },
956
 
@@ -1159,6 +1224,7 @@
1159
  if ( undefined === newItems ) {
1160
  return false;
1161
  }
 
1162
  var forceSwaps = [];
1163
 
1164
  // Update a single item id
@@ -1166,7 +1232,7 @@
1166
  var tempCurrentItems = this.settings.items.slice(),
1167
  tempNewItems = [],
1168
  tempSwapped = false;
1169
-
1170
  $.each( tempCurrentItems, function( index, item ) {
1171
  if ( String( item.id ) === String( itemId ) ) {
1172
 
@@ -1206,11 +1272,20 @@
1206
  } );
1207
  tempSwapped = true;
1208
  }
1209
- newItems = tempNewItems;
 
 
 
1210
  }
1211
-
1212
  this.settings.items = newItems;
1213
  this.total = newItems.length;
 
 
 
 
 
 
1214
  if ( this.nextItem >= this.total ) {
1215
  this.nextItem = 0;
1216
  }
@@ -1230,6 +1305,28 @@
1230
  } );
1231
  return activeItems;
1232
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1233
 
1234
  /**
1235
  * Trigger events
@@ -1302,8 +1399,8 @@
1302
  destroy: function () {
1303
 
1304
  // Remove listeners
1305
- this.$contents.off( 'mouseenter', { self: this }, this._mouseenter );
1306
- this.$contents.off( 'mouseleave', { self: this }, this._mouseleave );
1307
 
1308
  cancelAnimationFrame( this.interval );
1309
 
20
  direction : 'left',
21
  spacing : 20,
22
  speed : 10, // 1 - 10
23
+ cloneItems : 'yes',
24
  hoverPause : 0, // 0, 1
25
  height : null,
26
  minHeight : null,
43
  contentsBorderStyle : {},
44
  contentsBorderWidth : {},
45
  contentsBorderRadius : {},
46
+ titleDisplay : 'none',
47
+ titleElement : 'h3',
48
+ titleElementPosition : 'topLeft',
49
+ titleFontSize : '',
50
+ titleLineHeight : '',
51
+ titleColor : '',
52
+ titleBgColor : '',
53
+ titleMargin : {},
54
+ titlePadding : {},
55
+ titleBorderColor : {},
56
+ titleBorderStyle : {},
57
+ titleBorderWidth : {},
58
+ titleBorderRadius : {},
59
  itemTextColor : '',
60
  itemBgColor : '',
61
  itemBorderColor : {},
68
  item : 0,
69
  shuffle : 0,
70
  showEditor : 0,
 
 
 
 
71
  items : [
72
  // {
73
  // id: null,
87
  this.nextItem = null;
88
  this.total = this.settings.items.length;
89
  this.$elmt = $( elmt );
90
+ this.$title = null;
91
+ this.$titleContents = null;
92
  this.$contents = null;
93
  this.$items = null;
94
  this.$currentItem = null;
96
  this.scrollPercent = 0.13;
97
  this.running = false;
98
  this.interval = false;
 
99
  this.currentHeight = this.settings.height;
100
  this.visibleItems = [];
101
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  if ( 1 === parseInt( this.settings.shuffle ) ) {
103
  this.shuffle();
104
  }
113
  $contents,
114
  $items;
115
 
116
+ if ( 0 === this.total ) {
117
+ this.hide();
118
+ }
119
 
120
  // Remove the pre class
121
  this.$elmt.removeClass( 'ditty--pre' );
129
  // Create the ticker contents
130
  $contents = $( '<div class="ditty-ticker__contents"></div>' );
131
  this.$contents = $contents;
132
+
133
+ // Create the ticker title
134
+ this.$title = $( '<div class="ditty-ticker__title"></div>' );
135
+ this.$titleContents = $( '<div class="ditty-ticker__title__contents"></div>' );
136
+ this.$title.append( this.$titleContents );
137
 
138
  // Create the ticker items container
139
  $items = $( '<div class="ditty-ticker__items"></div>' );
148
 
149
  // Setup styles
150
  this._styleDisplay();
151
+ this._styleTitle();
152
 
153
  // Add listeners
154
+ this.$elmt.on( 'mouseenter', { self: this }, this._mouseenter );
155
+ this.$elmt.on( 'mouseleave', { self: this }, this._mouseleave );
156
 
157
  // Show the editor or start live updates
158
  if ( this.settings.showEditor ) {
163
 
164
  // Trigger the init
165
  setTimeout( function () {
166
+
167
  // Preload images
168
+ for ( var i = 0; i < self.total; i++ ) {
169
+ self._preloadItem( self.settings.items[i] );
170
  }
171
 
172
  // Initialize the items
316
  if ( undefined === this.settings.items[index] ) {
317
  return false;
318
  }
319
+
320
+ var existingItems = this.$items.children( '.ditty-item--' + this.settings.items[index].id );
321
+ if ( 'yes' !== this.settings.cloneItems && existingItems.length ) {
322
+ return false;
323
+ }
324
 
325
  // Create and add a new item
326
  var $item = $( this.settings.items[index].html );
713
 
714
  fillTimer = setInterval( function() {
715
 
716
+ var $item = self._initializeItem( current );
717
+ if ( $item ) {
718
+ var data = self._filledItemInit( current, $item, posX, posY, tickerW, tickerH );
719
+ posX = data.posX;
720
+ posY = data.posY;
721
+ filled = data.filled;
722
+ current = self._getNextItem( current );
723
+ } else {
724
+ filled = true;
725
+ }
726
 
727
  if ( filled ) {
728
  clearInterval( fillTimer );
830
  this.settings.direction = direction;
831
  this._timerStop();
832
  this._resetItems();
833
+ this.settings.item = 0;
834
  this._initializeItems();
835
  this.trigger( 'direction' );
836
  },
876
  }
877
  },
878
 
879
+ /**
880
+ * Style the title element
881
+ *
882
+ * @since 3.0
883
+ * @return null
884
+ */
885
+ _styleTitle: function () {
886
+ this.$elmt.attr( 'data-title', this.settings.titleDisplay );
887
+ this.$elmt.attr( 'data-title_position', this.settings.titleElementPosition );
888
+ if ( 'none' === this.settings.titleDisplay ) {
889
+ this.$title.remove();
890
+ } else {
891
+ var $element = $( '<' + this.settings.titleElement + ' class="ditty-ticker__title__element">' + this.settings.title + '</' + this.settings.titleElement + '>' );
892
+
893
+ $element.css( {
894
+ fontSize: this.settings.titleFontSize,
895
+ lineHeight: this.settings.titleLineHeight,
896
+ color: this.settings.titleColor,
897
+ margin: 0,
898
+ padding: 0
899
+ } );
900
+
901
+ this.$title.css( {
902
+ backgroundColor: this.settings.titleBgColor,
903
+ borderColor: this.settings.titleBorderColor,
904
+ borderStyle: this.settings.titleBorderStyle
905
+ } );
906
+ this.$title.css( this.settings.titleMargin );
907
+ this.$title.css( this.settings.titlePadding );
908
+ this.$title.css( this.settings.titleBorderRadius );
909
+ this.$title.css( this.settings.titleBorderWidth );
910
+
911
+ this.$titleContents.html( $element );
912
+ this.$elmt.prepend( this.$title );
913
+ }
914
+ },
915
+
916
  /**
917
  * Style item elemtents
918
  *
971
  if ( undefined === value ) {
972
  return false;
973
  }
 
974
  switch( key ) {
975
  case 'items':
976
  this.updateItems( value );
977
  break;
978
  case 'direction':
979
+ this.settings[key] = value;
980
+ this._styleDisplay();
981
+ this._setDirection( value );
982
+ break;
983
+ case 'titleDisplay':
984
+ case 'titleElement':
985
+ case 'titleElementPosition':
986
+ case 'titleFontSize':
987
+ case 'titleLineHeight':
988
+ case 'titleColor':
989
+ case 'titleBgColor':
990
+ case 'titleMargin':
991
+ case 'titlePadding':
992
+ case 'titleBorderColor':
993
+ case 'titleBorderStyle':
994
+ case 'titleBorderWidth':
995
+ case 'titleBorderRadius':
996
+ this.settings[key] = value;
997
+ this._styleTitle();
998
  break;
999
  case 'minHeight':
1000
  case 'maxHeight':
1015
  this.settings[key] = value;
1016
  break;
1017
  }
1018
+
1019
  this.trigger( 'update' );
1020
  },
1021
 
1224
  if ( undefined === newItems ) {
1225
  return false;
1226
  }
1227
+
1228
  var forceSwaps = [];
1229
 
1230
  // Update a single item id
1232
  var tempCurrentItems = this.settings.items.slice(),
1233
  tempNewItems = [],
1234
  tempSwapped = false;
1235
+
1236
  $.each( tempCurrentItems, function( index, item ) {
1237
  if ( String( item.id ) === String( itemId ) ) {
1238
 
1272
  } );
1273
  tempSwapped = true;
1274
  }
1275
+
1276
+ if ( 0 !== this.total ) {
1277
+ newItems = tempNewItems;
1278
+ }
1279
  }
1280
+
1281
  this.settings.items = newItems;
1282
  this.total = newItems.length;
1283
+ if ( 0 === this.total ) {
1284
+ this.hide();
1285
+ } else {
1286
+ this.show();
1287
+ }
1288
+
1289
  if ( this.nextItem >= this.total ) {
1290
  this.nextItem = 0;
1291
  }
1305
  } );
1306
  return activeItems;
1307
  },
1308
+
1309
+ /**
1310
+ * Hide the ticker
1311
+ *
1312
+ * @since 3.0
1313
+ * @return null
1314
+ */
1315
+ hide: function () {
1316
+ this.$elmt.hide();
1317
+ this.pause();
1318
+ },
1319
+
1320
+ /**
1321
+ * Show the ticker
1322
+ *
1323
+ * @since 3.0
1324
+ * @return null
1325
+ */
1326
+ show: function () {
1327
+ this.$elmt.show();
1328
+ this.play();
1329
+ },
1330
 
1331
  /**
1332
  * Trigger events
1399
  destroy: function () {
1400
 
1401
  // Remove listeners
1402
+ this.$elmt.off( 'mouseenter', { self: this }, this._mouseenter );
1403
+ this.$elmt.off( 'mouseleave', { self: this }, this._mouseleave );
1404
 
1405
  cancelAnimationFrame( this.interval );
1406
 
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,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:{},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.$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;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,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.$contents.on("mouseenter",{self:this},this._mouseenter),this.$contents.on("mouseleave",{self:this},this._mouseleave),this.settings.showEditor?dittyEditorInit(this):this.trigger("start_live_updates"),setTimeout((function(){for(var t=0;t<this.total;t++)this._preloadItem(this.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.settings.items[t].html);if(e.css({top:0,left:0}),this.$items.children(".ditty-item--"+this.settings.items[t].id).not(".ditty-item--clone").length>0&&e.addClass("ditty-item--clone"),this._styleItem(e),this.settings.items[t].css&&dittyLayoutCss(this.settings.items[t].css,this.settings.items[t].layout_id),this._itemSpacing(e),this._itemSetTransform(e,this._itemResetPosition(e)),this.$items.append(e),e.css({display:"block",top:0,left:0,opacity:1}),e.addClass("ditty-item--current"),null!==this.$currentItem&&this.$currentItem.removeClass("ditty-item--current"),this.$currentItem=e,null===this.$lastItem&&(e.addClass("ditty-item--last"),this.$lastItem=e),this.settings.item=t,this.nextItem=this._getNextItem(t),"custom"!==i){var s=this._itemResetPosition(e);this._itemSetTransform(e,s),this.visibleItems.push({$item:e,itemId:this.settings.items[t].id,posX:s.posX,posY:s.posY}),this._setCurrentHeight()}return this.trigger("active_items_update"),e},_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,a=null;this._isItemEnabled(h)||(h=this._getNextItem(h)),"right"===this.settings.direction?s=i:"down"===this.settings.direction&&(n=e),a=setInterval((function(){var o=t._initializeItem(h),m=t._filledItemInit(h,o,s,n,i,e);s=m.posX,n=m.posY,r=m.filled,h=t._getNextItem(h),r&&(clearInterval(a),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"),a=parseFloat(i.outerWidth()),o=parseFloat(i.outerHeight()),m=0,l=0,d=!1;switch(i.css({display:"block",opacity:0}),this.settings.direction){case"left":m=e,this._itemSetTransform(i,{posX:m,posY:s}),(e+=a)>n&&(d=!0);break;case"right":m=e-=a,this._itemSetTransform(i,{posX:m,posY:s}),e<0&&(d=!0);break;case"up":l=s,this._itemSetTransform(i,{posX:e,posY:l}),(s+=o)>r&&(d=!0);break;case"down":l=s-=o,this._itemSetTransform(i,{posX:e,posY:l}),s<0&&(d=!0)}return i.stop().animate({opacity:1},1e3,"linear",(function(){})),this.visibleItems.push({$item:i,itemId:h,posX:m,posY:l}),this._setCurrentHeight(),{posX:e,posY:s,filled:d}},_setDirection:function(t){return!!$.inArray(t,this.settings.directions)&&(t!==this.settings.directions&&(this.settings.direction=t,this._timerStop(),this._resetItems(),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:""})},_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"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=[],a=!1;$.each(r,(function(s,r){String(r.id)===String(i)?"after"===e?(h.push(r),$.each(t,(function(t,i){h.push(i)})),a=!0):"before"===e?($.each(t,(function(t,i){h.push(i)})),h.push(r),a=!0):a||($.each(t,(function(t,i){h.push(i),n.push(String(i.uniq_id))})),a=!0):h.push(r)})),a||($.each(this.settings.items,(function(t,i){h.push(i)})),a=!0),t=h}this.settings.items=t,this.total=t.length,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},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.$contents.off("mouseenter",{self:this},this._mouseenter),this.$contents.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].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);
includes/js/class-ditty-slider.js CHANGED
@@ -96,14 +96,9 @@
96
  this.animateHeight = false;
97
  this.slidesDisplayed = 0,
98
  this.paused = false;
99
- this.transitions = [
100
- 'fade',
101
- 'slideLeft',
102
- 'slideRight',
103
- 'slideDown',
104
- 'slideUp'
105
- ];
106
-
107
  this._init();
108
  };
109
 
@@ -436,31 +431,44 @@
436
  /**
437
  * Animate a slide into view
438
  *
439
- * @since 3.0
440
  * @return null
441
  */
442
  _animateIn: function( $slide, actionParams ) {
443
  var self = this,
444
  transitionSpeed = ( 0 === parseInt( this.slidesDisplayed ) ) ? this.settings.initTransitionSpeed : this.settings.transitionSpeed,
445
  transitionEase = ( 0 === parseInt( this.slidesDisplayed ) ) ? this.settings.initTransitionEase : this.settings.transitionEase;
446
-
447
- this.transitioning = true;
448
- this._timerStop();
449
- $slide.show();
450
- $slide.addClass( 'ditty-slide-animating' );
451
- $slide.stop( true ).animate( {
452
  left : 0,
453
  top : 0,
454
  opacity : 1
455
- }, parseFloat( transitionSpeed ) * 1000, transitionEase, function() {
456
- $slide.removeClass( 'ditty-slide-animating' );
 
 
 
457
  $slide.css( 'position', 'relative' );
458
  self.transitioning = false;
459
  self.animateTransition = false;
460
  self._removeStaticHeight();
461
  self._timerStart();
462
  self.trigger( 'after_slide_update', actionParams );
463
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  },
465
 
466
  /**
@@ -471,9 +479,6 @@
471
  */
472
  _animateOut: function( $slide, $nextSlide, direction ) {
473
  this.$lastSlide = $slide;
474
-
475
- $slide.removeClass( 'ditty-slider__slide--current' );
476
- $slide.css( 'position', 'absolute' );
477
 
478
  var posX = 0,
479
  posY = 0,
@@ -502,19 +507,28 @@
502
  break;
503
  }
504
 
 
 
505
  $slide.css( {
506
  zIndex: 1
507
  } );
508
 
509
- $slide.addClass( 'ditty-slide-animating' );
510
- $slide.stop( true ).animate( {
511
  left : posX + 'px',
512
  top : posY + 'px',
513
  opacity : opacity
514
- }, parseFloat( this.settings.transitionSpeed ) * 1000, this.settings.transitionEase, function() {
515
- $slide.removeClass( 'ditty-slide-animating' );
516
- $slide.hide();
517
- } );
 
 
 
 
 
 
 
 
518
  },
519
 
520
  /**
@@ -593,7 +607,7 @@
593
  /**
594
  * Animate the height of the slider
595
  *
596
- * @since 3.0
597
  * @return null
598
  */
599
  _animateHeight: function () {
@@ -603,14 +617,23 @@
603
  heightEase = ( 0 === parseInt( this.slidesDisplayed ) ) ? this.settings.initHeightEase : this.settings.heightEase;
604
 
605
  this.currentHeight = height;
606
-
607
- this.$slides.stop( true ).animate( {
608
  height: height + 'px'
609
- }, parseFloat( heightSpeed ) * 1000, heightEase, function() {
 
 
 
610
  self.animateHeight = false;
611
  self._removeStaticHeight();
612
  self.trigger( 'height_updated' );
613
- });
 
 
 
 
 
 
614
  },
615
 
616
  /**
96
  this.animateHeight = false;
97
  this.slidesDisplayed = 0,
98
  this.paused = false;
99
+ this.transitions = ['fade','slideLeft','slideRight','slideDown','slideUp'];
100
+ this.eases = ['linear','swing','jswing','easeInQuad','easeInCubic','easeInQuart','easeInQuint','easeInSine','easeInExpo','easeInCirc','easeInElastic','easeInBack','easeInBounce','easeOutQuad','easeOutCubic','easeOutQuart','easeOutQuint','easeOutSine','easeOutExpo','easeOutCirc','easeOutElastic','easeOutBack','easeOutBounce','easeInOutQuad','easeInOutCubic','easeInOutQuart','easeInOutQuint','easeInOutSine','easeInOutExpo','easeInOutCirc','easeInOutElastic','easeInOutBack','easeInOutBounce'];
101
+
 
 
 
 
 
102
  this._init();
103
  };
104
 
431
  /**
432
  * Animate a slide into view
433
  *
434
+ * @since 3.0.13
435
  * @return null
436
  */
437
  _animateIn: function( $slide, actionParams ) {
438
  var self = this,
439
  transitionSpeed = ( 0 === parseInt( this.slidesDisplayed ) ) ? this.settings.initTransitionSpeed : this.settings.transitionSpeed,
440
  transitionEase = ( 0 === parseInt( this.slidesDisplayed ) ) ? this.settings.initTransitionEase : this.settings.transitionEase;
441
+
442
+ var animateCss = {
 
 
 
 
443
  left : 0,
444
  top : 0,
445
  opacity : 1
446
+ };
447
+
448
+ if ( 0 === parseFloat( transitionSpeed ) ) {
449
+ $slide.show();
450
+ $slide.stop().css( animateCss );
451
  $slide.css( 'position', 'relative' );
452
  self.transitioning = false;
453
  self.animateTransition = false;
454
  self._removeStaticHeight();
455
  self._timerStart();
456
  self.trigger( 'after_slide_update', actionParams );
457
+ } else {
458
+ this.transitioning = true;
459
+ this._timerStop();
460
+ $slide.show();
461
+ $slide.addClass( 'ditty-slide-animating' );
462
+ $slide.stop( true ).animate( animateCss, parseFloat( transitionSpeed ) * 1000, transitionEase, function() {
463
+ $slide.removeClass( 'ditty-slide-animating' );
464
+ $slide.css( 'position', 'relative' );
465
+ self.transitioning = false;
466
+ self.animateTransition = false;
467
+ self._removeStaticHeight();
468
+ self._timerStart();
469
+ self.trigger( 'after_slide_update', actionParams );
470
+ } );
471
+ }
472
  },
473
 
474
  /**
479
  */
480
  _animateOut: function( $slide, $nextSlide, direction ) {
481
  this.$lastSlide = $slide;
 
 
 
482
 
483
  var posX = 0,
484
  posY = 0,
507
  break;
508
  }
509
 
510
+ $slide.removeClass( 'ditty-slider__slide--current' );
511
+ $slide.css( 'position', 'absolute' );
512
  $slide.css( {
513
  zIndex: 1
514
  } );
515
 
516
+ var animateCss = {
 
517
  left : posX + 'px',
518
  top : posY + 'px',
519
  opacity : opacity
520
+ };
521
+
522
+ if ( 0 === parseFloat( this.settings.transitionSpeed ) ) {
523
+ $slide.hide();
524
+ $slide.stop().css( animateCss );
525
+ } else {
526
+ $slide.addClass( 'ditty-slide-animating' );
527
+ $slide.stop( true ).animate( animateCss, parseFloat( this.settings.transitionSpeed ) * 1000, this.settings.transitionEase, function() {
528
+ $slide.removeClass( 'ditty-slide-animating' );
529
+ $slide.hide();
530
+ } );
531
+ }
532
  },
533
 
534
  /**
607
  /**
608
  * Animate the height of the slider
609
  *
610
+ * @since 3.0.13
611
  * @return null
612
  */
613
  _animateHeight: function () {
617
  heightEase = ( 0 === parseInt( this.slidesDisplayed ) ) ? this.settings.initHeightEase : this.settings.heightEase;
618
 
619
  this.currentHeight = height;
620
+
621
+ var animateCss = {
622
  height: height + 'px'
623
+ };
624
+
625
+ if ( 0 === parseFloat( heightSpeed ) ) {
626
+ this.$slides.stop().css( animateCss );
627
  self.animateHeight = false;
628
  self._removeStaticHeight();
629
  self.trigger( 'height_updated' );
630
+ } else {
631
+ this.$slides.stop( true ).animate( animateCss, parseFloat( heightSpeed ) * 1000, heightEase, function() {
632
+ self.animateHeight = false;
633
+ self._removeStaticHeight();
634
+ self.trigger( 'height_updated' );
635
+ } );
636
+ }
637
  },
638
 
639
  /**
includes/js/class-ditty-slider.min.js CHANGED
@@ -1 +1 @@
1
- !function($){"use strict";var t={transition:"fade",transitionEase:"easeInOutQuint",transitionSpeed:1.5,autoplay:0,autoplayPause:0,autoplaySpeed:7,height:0,heightEase:"easeInOutQuint",heightSpeed:1.5,initTransition:"fade",initTransitionEase:"easeInOutQuint",initTransitionSpeed:1.5,initHeightEase:"easeInOutQuint",initHeightSpeed:.5,arrows:"none",arrowsIconColor:"",arrowsBgColor:"",arrowsPosition:"center",arrowsPadding:{},arrowsStatic:0,navPrev:'<i class="fas fa-angle-left"></i>',navNext:'<i class="fas fa-angle-right"></i>',bullets:"none",bulletsColor:"",bulletsColorActive:"",bulletsPosition:"bottomCenter",bulletsSpacing:2,bulletsPadding:{},bullet:"",maxWidth:"",bgColor:"",padding:{},margin:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},contentsBgColor:"",contentsPadding:{},contentsBorderColor:{},contentsBorderStyle:{},contentsBorderWidth:{},contentsBorderRadius:{},slideBgColor:"",slidePadding:{},slideBorderColor:{},slideBorderStyle:{},slideBorderWidth:{},slideBorderRadius:{},slide:0,slideId:!1,touchSwipe:!0,slidesEl:!1,slides:[]},s=function(s,i){this.elmt=s,this.settings=$.extend({},t,$.ditty_slider.defaults,i),this.slide=this.settings.slide,this.slideObj={},this.total=this.settings.slides.length,this.$elmt=$(s),this.$contents=null,this.$slides=null,this.$bullets=null,this.$arrows=null,this.$currentSlide=null,this.$lastSlide=null,this.transitioning=!1,this.hovering=!1,this.timer=null,this.currentHeight=this.settings.height,this.animateTransition=!1,this.animateHeight=!1,this.slidesDisplayed=0,this.paused=!1,this.transitions=["fade","slideLeft","slideRight","slideDown","slideUp"],this._init()};s.prototype={_init:function(){var t,s,i=this;(this.$elmt.addClass("ditty-slider"),t=$('<div class="ditty-slider__contents"></div>'),this.$contents=t,s=$('<div class="ditty-slider__slides"></div>'),this.$slides=s,this.$slides.height(this.currentHeight),t.append(s),this.$elmt.append(t),this._styleDisplay(),this._setupBullets(),this._setupArrows(),t.on("mouseenter",{self:this},this._mouseenter),t.on("mouseleave",{self:this},this._mouseleave),this.settings.touchSwipe)&&(delete Hammer.defaults.cssProps.userSelect,new Hammer(t[0]).on("swipe",(function(t){switch(t.direction){case 2:i._swipeLeft();break;case 4:i._swipeRight()}})));this._convertSlideElements(),!0===this.settings.shuffle&&this.shuffle();for(var e=0;e<this.total;e++)this._preloadSlide(this.settings.slides[e].html);setTimeout((function(){i.settings.slideId?i.showSlideById(i.settings.slideId,"force"):i._showSlide(),i.trigger("init")}),1)},_convertSlideElements:function(){if(this.settings.slidesEl){var t=this,s=this.$elmt.find(this.settings.slidesEl);t.settings.slides=[],s.each((function(i){var e=$(s[i]),l=!!e.data("slide_id")&&e.data("slide_id");t.settings.slides.push({id:l,html:e.prop("outerHTML"),$elmt:e}),t.$slides.append(e),e.hide()})),t.total=t.settings.slides.length}},_preloadSlide:function(t){var s;$(t).find("img").each((function(){var t=$(this).attr("src");s=new Image,$(s).on("load",(function(){})).attr("src",t)}))},_timerStart:function(){var t=this;if(0===parseInt(this.settings.autoplay)||this.total<2||this.timer||this.hovering||this.paused)return!1;cancelAnimationFrame(this.timer);var s=Date.now();t.timer=requestAnimationFrame((function i(){var e=Date.now();Math.floor((e-s)/1e3)>=t.settings.autoplaySpeed&&(s=e,t._showSlide(t._getNextSlide())),t.timer=requestAnimationFrame(i)}))},_timerStop:function(){this.timer&&(cancelAnimationFrame(this.timer),this.timer=null)},_mouseenter:function(t){var s=t.data.self;s.settings.autoplay&&s.settings.autoplayPause&&(s.hovering=!0,s._timerStop())},_mouseleave:function(t){var s=t.data.self;s.settings.autoplay&&s.settings.autoplayPause&&(s.hovering=!1,s._timerStart())},_swipeLeft:function(){if("slideRight"===this.settings.transition)this._showPrevSlide();else this._showNextSlide()},_swipeRight:function(){if("slideRight"===this.settings.transition)this._showNextSlide();else this._showPrevSlide()},_showSlide:function(t,s){var i=null,e=!1;if(null!==this.$currentSlide&&this.$currentSlide.hasClass("ditty-slide-animating"))return!1;if(void 0===t&&(t=this.settings.slide,e=!0),t>=this.total?t=this.total-1:t<0&&(t=0),!e&&t===this.settings.slide)return!1;if(void 0===this.settings.slides[t])return!1;var l=this.settings.slide,n=this.settings.slides[l];this.settings.slides[t].$elmt?i=this.settings.slides[t].$elmt:(i=$(this.settings.slides[t].html),this.settings.slides[t].$elmt=i),i.addClass("ditty-slider__slide"),i.addClass("ditty-slider__slide--current"),i.addClass("ditty-slider__slide--"+t),$(this.$slides.children(".ditty-slider__slide--"+t).not(i)).remove(),this._styleSlide(i),i.stop(!0).css({position:"absolute",display:"block",opacity:0}),this.$slides.append(i),this.animateTransition=!0,this.animateHeight=!0,this._setStaticHeight();var r=[t,this.settings.slides[t],l,n];this.trigger("before_slide_update",r),null!==this.$currentSlide&&this._animateOut(this.$currentSlide,i,s),this.$currentSlide=i,this.settings.slide=t,this.slideObj=this.settings.slides[t],this.visibleSlides=[this.settings.slides[t]],i.hasClass("ditty-slide-animating")||this._slideResetPosition(i,s),this._animateIn(i,r),this._animateHeight(),this._activateBullet(),this.slidesDisplayed=this.slidesDisplayed+1},_animateIn:function(t,s){var i=this,e=0===parseInt(this.slidesDisplayed)?this.settings.initTransitionSpeed:this.settings.transitionSpeed,l=0===parseInt(this.slidesDisplayed)?this.settings.initTransitionEase:this.settings.transitionEase;this.transitioning=!0,this._timerStop(),t.show(),t.addClass("ditty-slide-animating"),t.stop(!0).animate({left:0,top:0,opacity:1},1e3*parseFloat(e),l,(function(){t.removeClass("ditty-slide-animating"),t.css("position","relative"),i.transitioning=!1,i.animateTransition=!1,i._removeStaticHeight(),i._timerStart(),i.trigger("after_slide_update",s)}))},_animateOut:function(t,s,i){this.$lastSlide=t,t.removeClass("ditty-slider__slide--current"),t.css("position","absolute");var e=0,l=0,n=1,r=this.settings.transition;switch("reverse"===i&&(r=this._reverseTransition(r)),r){case"fade":n=0;break;case"slideRight":e=this.$slides.outerWidth();break;case"slideLeft":e="-"+t.outerWidth();break;case"slideDown":l=s.outerHeight();break;case"slideUp":l="-"+t.outerHeight()}t.css({zIndex:1}),t.addClass("ditty-slide-animating"),t.stop(!0).animate({left:e+"px",top:l+"px",opacity:n},1e3*parseFloat(this.settings.transitionSpeed),this.settings.transitionEase,(function(){t.removeClass("ditty-slide-animating"),t.hide()}))},_slideResetPosition:function(t,s){var i=0,e=0,l=1,n=0===parseInt(this.slidesDisplayed)?this.settings.initTransition:this.settings.transition;switch("reverse"===s&&(n=this._reverseTransition(n)),n){case"fade":l=0;break;case"slideLeft":i=this.$slides.outerWidth();break;case"slideRight":i="-"+t.outerWidth();break;case"slideUp":null!==this.$lastSlide?e=this.$lastSlide.outerHeight():(e=this.$slides.outerHeight(),t.outerHeight()>e&&(e=t.outerHeight()));break;case"slideDown":e="-"+t.outerHeight()}t.stop(!0).css({display:"block",opacity:l,left:i+"px",top:e+"px",zIndex:9})},_setStaticHeight:function(){var t=this.$slides.outerHeight();this.$slides.stop(!0).css("height",t+"px")},_removeStaticHeight:function(){this.animateTransition||this.animateHeight||this.$slides.stop(!0).css("height","auto")},_animateHeight:function(){var t=this,s=this.$currentSlide.outerHeight(),i=0===parseInt(this.slidesDisplayed)?this.settings.initHeightSpeed:this.settings.heightSpeed,e=0===parseInt(this.slidesDisplayed)?this.settings.initHeightEase:this.settings.heightEase;this.currentHeight=s,this.$slides.stop(!0).animate({height:s+"px"},1e3*parseFloat(i),e,(function(){t.animateHeight=!1,t._removeStaticHeight(),t.trigger("height_updated")}))},_reverseTransition:function(t){var s=t;switch(t){case"slideLeft":s="slideRight";break;case"slideRight":s="slideLeft";break;case"slideUp":s="slideDown";break;case"slideDown":s="slideUp"}return s},_getNextSlide:function(){var t=this.settings.slide+1;return t>=this.total&&(t=0),t},_showNextSlide:function(){this._showSlide(this._getNextSlide())},_getPrevSlide:function(){var t=this.settings.slide-1;return t<0&&(t=this.total-1),t},_showPrevSlide:function(){this._showSlide(this._getPrevSlide(),"reverse")},_clickBullet:function(t){t.preventDefault();var s,i=t.data.self,e=$(t.target).data("index");e<i.settings.slide&&(s="reverse"),i._showSlide(e,s)},_activateBullet:function(){if("none"===this.settings.bullets||2>parseInt(this.total))return!1;var t=this._getPrevSlide(),s=this._getNextSlide();this.$bullets.find(".ditty-slider__bullet").removeClass("ditty-slider__bullet--active ditty-slider__bullet--next ditty-slider__bullet--prev"),this.$bullets.find('.ditty-slider__bullet[data-index="'+this.settings.slide+'"]').addClass("ditty-slider__bullet--active"),this.$bullets.find('.ditty-slider__bullet[data-index="'+t+'"]').addClass("ditty-slider__bullet--prev"),this.$bullets.find('.ditty-slider__bullet[data-index="'+s+'"]').addClass("ditty-slider__bullet--next"),this._styleBullets()},_setupBullets:function(){if(null===this.$bullets){var t=$('<div class="ditty-slider__bullets"></div>');this.$bullets=t,this.$elmt.append(t)}if("none"===this.settings.bullets||2>parseInt(this.total))this.$bullets.hide();else{this.$bullets.empty();for(var s=0;s<this.total;s++){var i=$('<a href="#" class="ditty-slider__bullet" data-index="'+s+'">'+this.settings.bullet+"</a>");i.on("click",{self:this},this._clickBullet),this.$bullets.append(i)}this.$bullets.show(),this._activateBullet()}},_styleBullets:function(){switch(this.$bullets.removeAttr("style"),this.$bullets.find("a").css({backgroundColor:this.settings.bulletsColor,marginLeft:this.settings.bulletsSpacing+"px",marginRight:this.settings.bulletsSpacing+"px"}),this.$bullets.find("a.ditty-slider__bullet--active").css({backgroundColor:this.settings.bulletsColorActive}),this.$bullets.css(this.settings.bulletsPadding),this.settings.bulletsPosition){case"topLeft":this.$bullets.css({order:0,justifyContent:"flex-start"});break;case"topCenter":this.$bullets.css({order:0,justifyContent:"center"});break;case"topRight":this.$bullets.css({order:0,justifyContent:"flex-end"});break;case"bottomLeft":this.$bullets.css({order:2,justifyContent:"flex-start"});break;case"bottomCenter":this.$bullets.css({order:2,justifyContent:"center"});break;case"bottomRight":this.$bullets.css({order:2,justifyContent:"flex-end"})}},_clickPrev:function(t){t.preventDefault(),t.data.self._showPrevSlide()},_clickNext:function(t){t.preventDefault(),t.data.self._showNextSlide()},_setupArrows:function(){if(null===this.$arrows){var t=$('<div class="ditty-slider__arrows"></div>'),s=$('<a href="#" class="ditty-slider__prev">'+this.settings.navPrev+"</a>"),i=$('<a href="#" class="ditty-slider__next">'+this.settings.navNext+"</a>");s.on("click",{self:this},this._clickPrev),i.on("click",{self:this},this._clickNext),t.append(s,i),this.$arrows=t,this.$contents.append(t)}this.$arrows.removeAttr("style"),"none"===this.settings.arrows||2>this.total?this.$arrows.hide():this.$arrows.css("display","flex"),this.$arrows.css(this.settings.arrowsPadding),this.$arrows.css({alignItems:this.settings.arrowsPosition}),this.$arrows.find("i").css({color:this.settings.arrowsIconColor}),this.$arrows.find("a").css({backgroundColor:this.settings.arrowsBgColor}),1===parseInt(this.settings.arrowsStatic)?this.$arrows.addClass("ditty-slider__arrows--static"):this.$arrows.removeClass("ditty-slider__arrows--static")},_styleDisplay:function(){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.$elmt.css(this.settings.borderWidth),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)},_styleSlide:function(t){t.css({backgroundColor:this.settings.slideBgColor,borderColor:this.settings.slideBorderColor,borderStyle:this.settings.slideBorderStyle}),t.css(this.settings.slidePadding),t.css(this.settings.slideBorderRadius),t.css(this.settings.slideBorderWidth)},updateSlides:function(t){for(var s=this.settings.slides.length,i=t.length,e=this.settings.slide,l=this.settings.slide,n=0;n<t.length;n++)this._preloadSlide(t[n]);this.settings.slides=t,s!==i&&(this.total=t.length,this._setupBullets(),this._setupArrows()),e>=this.total&&(l=this.total-1),e!==l&&this._showSlide(l)},_getOption:function(t){switch(t){case"elmnt":return this;case"height":return this.$slides.outerHeight();case"currentSlide":return this.$currentSlide;default:return this.settings[t]}},_setOption:function(t,s){if(void 0===s)return!1;switch("slides"!==t&&(this.settings[t]=s),t){case"slides":this.updateSlides(s);break;case"slide":this.slide=s;break;case"autoplay":1===parseInt(s)?this.timer||this._timerStart():this._timerStop();break;case"bgColor":case"padding":case"borderColor":case"borderStyle":case"borderWidth":case"borderRadius":case"contentsBgColor":case"contentsPadding":case"contentsBorderColor":case"contentsBorderStyle":case"contentsBorderWidth":case"contentsBorderRadius":this.animateHeight=!0,this._setStaticHeight(),this._styleDisplay(),this._animateHeight();break;case"slideBgColor":case"slidePadding":case"slideBorderColor":case"slideBorderStyle":case"slideBorderWidth":case"slideBorderRadius":this.animateHeight=!0,this._setStaticHeight(),this._styleSlide(this.$currentSlide),this._animateHeight();break;case"arrows":case"arrowsIconColor":case"arrowsBgColor":case"arrowsPadding":case"arrowsPosition":case"arrowsStatic":this._setupArrows();break;case"bullets":this._setupBullets();break;case"bulletsColor":case"bulletsColorActive":case"bulletsPosition":case"bulletsSpacing":case"bulletsPadding":this._styleBullets();break;default:this.settings[t]=s}this.trigger("update")},shuffle:function(){for(var t,s,i=this.total-1;i>0;i--)s=Math.floor(Math.random()*(i+1)),t=this.settings.slides[i],this.settings.slides[i]=this.settings.slides[s],this.settings.slides[s]=t},start:function(){this._timerStart()},stop:function(){this._timerStop()},pause:function(){this.paused=!0},resume:function(){this.paused=!1,this._timerStart()},current:function(){return this.$currentSlide},showSlide:function(t){this._showSlide(t)},showSlideById:function(t,s){var i=this;$.each(this.settings.slides,(function(e,l){if(l.id===t)return"force"===s?(i.settings.slide=e,i._showSlide()):i._showSlide(e),!1}))},addSlide:function(t,s,i){var e=!0;if((s>=this.total||s<0)&&(e=!1),"replace"===i&&e){var l=this.settings.slides[s];this.trigger("slide_removed",[l]),this.settings.slides.splice(s,1,t)}else null!==s&&""!==s&&e?this.settings.slides.splice(s,0,t):this.settings.slides.splice(parseInt(this.settings.slide)+1,0,t);this.total=this.settings.slides.length,this._preloadSlide(t),this.trigger("update")},addSlideById:function(t,s){var i={id:t,html:s},e=!1;if($.each(this.settings.slides,(function(s,i){String(i.id)!==String(t)||(e=s)})),e){var l=this.settings.slides[e];this.trigger("slide_removed",[l]),this.settings.slides[e].$elmt&&this.settings.slides[e].$elmt.remove(),this.settings.slides.splice(e,1,i)}else this.settings.slides.push(i);this.total=this.settings.slides.length,this._preloadSlide(i),this.trigger("update")},deleteSlideById:function(t){var s=[];$.each(this.settings.slides,(function(i,e){String(e.id)!==String(t)&&s.push(e)})),this.settings.slides=s,this.total=this.settings.slides.length,this.trigger("update")},deleteSlide:function(t){if(t>=this.total||t<0)return!1;var s=this.settings.slides[t];this.trigger("slide_removed",[s]),this.settings.slides[t].$elmt&&this.settings.slides[t].$elmt.remove(),this.settings.slides.splice(t,1),this.total=this.settings.slides.length,this.trigger("update")},setStaticHeight:function(){this.animateHeight=!0,this._setStaticHeight()},animateHeight:function(){this._animateHeight()},trigger:function(t,s){var i=[];if("height_updated"===t)i=[this.currentHeight];else i=[this.settings,this.$elmt];s&&(i=s),this.$elmt.trigger("ditty_slider_"+t,i),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,i)},options:function(t,s){var i=this;if("object"==typeof t)$.each(t,(function(t,s){i._setOption(t,s)}));else{if("string"!=typeof t)return i.settings;if(void 0===s)return i._getOption(t);i._setOption(t,s)}},destroy:function(){clearInterval(this.timer),this.$elmt.removeClass("ditty-slider"),this.$elmt.removeAttr("style"),this.$elmt.empty(),this.trigger("destroy"),this.elmt._ditty_slider=null}},$.fn.ditty_slider=function(t){var i,e=arguments,l=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_slider||(this._ditty_slider=new s(this,t))}));if("string"==typeof t){if(this.each((function(){var s=this._ditty_slider;if(!s)throw new Error("No Ditty_Slider applied to this element.");"function"==typeof s[t]&&"_"!==t[0]?i=s[t].apply(s,[].slice.call(e,1)):l=!0})),l)throw new Error('No method "'+t+'" in Ditty_Slider.');return void 0!==i?i:this}},$.ditty_slider={},$.ditty_slider.defaults=t}(jQuery);
1
+ !function($){"use strict";var t={transition:"fade",transitionEase:"easeInOutQuint",transitionSpeed:1.5,autoplay:0,autoplayPause:0,autoplaySpeed:7,height:0,heightEase:"easeInOutQuint",heightSpeed:1.5,initTransition:"fade",initTransitionEase:"easeInOutQuint",initTransitionSpeed:1.5,initHeightEase:"easeInOutQuint",initHeightSpeed:.5,arrows:"none",arrowsIconColor:"",arrowsBgColor:"",arrowsPosition:"center",arrowsPadding:{},arrowsStatic:0,navPrev:'<i class="fas fa-angle-left"></i>',navNext:'<i class="fas fa-angle-right"></i>',bullets:"none",bulletsColor:"",bulletsColorActive:"",bulletsPosition:"bottomCenter",bulletsSpacing:2,bulletsPadding:{},bullet:"",maxWidth:"",bgColor:"",padding:{},margin:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},contentsBgColor:"",contentsPadding:{},contentsBorderColor:{},contentsBorderStyle:{},contentsBorderWidth:{},contentsBorderRadius:{},slideBgColor:"",slidePadding:{},slideBorderColor:{},slideBorderStyle:{},slideBorderWidth:{},slideBorderRadius:{},slide:0,slideId:!1,touchSwipe:!0,slidesEl:!1,slides:[]},s=function(s,e){this.elmt=s,this.settings=$.extend({},t,$.ditty_slider.defaults,e),this.slide=this.settings.slide,this.slideObj={},this.total=this.settings.slides.length,this.$elmt=$(s),this.$contents=null,this.$slides=null,this.$bullets=null,this.$arrows=null,this.$currentSlide=null,this.$lastSlide=null,this.transitioning=!1,this.hovering=!1,this.timer=null,this.currentHeight=this.settings.height,this.animateTransition=!1,this.animateHeight=!1,this.slidesDisplayed=0,this.paused=!1,this.transitions=["fade","slideLeft","slideRight","slideDown","slideUp"],this.eases=["linear","swing","jswing","easeInQuad","easeInCubic","easeInQuart","easeInQuint","easeInSine","easeInExpo","easeInCirc","easeInElastic","easeInBack","easeInBounce","easeOutQuad","easeOutCubic","easeOutQuart","easeOutQuint","easeOutSine","easeOutExpo","easeOutCirc","easeOutElastic","easeOutBack","easeOutBounce","easeInOutQuad","easeInOutCubic","easeInOutQuart","easeInOutQuint","easeInOutSine","easeInOutExpo","easeInOutCirc","easeInOutElastic","easeInOutBack","easeInOutBounce"],this._init()};s.prototype={_init:function(){var t,s,e=this;(this.$elmt.addClass("ditty-slider"),t=$('<div class="ditty-slider__contents"></div>'),this.$contents=t,s=$('<div class="ditty-slider__slides"></div>'),this.$slides=s,this.$slides.height(this.currentHeight),t.append(s),this.$elmt.append(t),this._styleDisplay(),this._setupBullets(),this._setupArrows(),t.on("mouseenter",{self:this},this._mouseenter),t.on("mouseleave",{self:this},this._mouseleave),this.settings.touchSwipe)&&(delete Hammer.defaults.cssProps.userSelect,new Hammer(t[0]).on("swipe",(function(t){switch(t.direction){case 2:e._swipeLeft();break;case 4:e._swipeRight()}})));this._convertSlideElements(),!0===this.settings.shuffle&&this.shuffle();for(var i=0;i<this.total;i++)this._preloadSlide(this.settings.slides[i].html);setTimeout((function(){e.settings.slideId?e.showSlideById(e.settings.slideId,"force"):e._showSlide(),e.trigger("init")}),1)},_convertSlideElements:function(){if(this.settings.slidesEl){var t=this,s=this.$elmt.find(this.settings.slidesEl);t.settings.slides=[],s.each((function(e){var i=$(s[e]),n=!!i.data("slide_id")&&i.data("slide_id");t.settings.slides.push({id:n,html:i.prop("outerHTML"),$elmt:i}),t.$slides.append(i),i.hide()})),t.total=t.settings.slides.length}},_preloadSlide:function(t){var s;$(t).find("img").each((function(){var t=$(this).attr("src");s=new Image,$(s).on("load",(function(){})).attr("src",t)}))},_timerStart:function(){var t=this;if(0===parseInt(this.settings.autoplay)||this.total<2||this.timer||this.hovering||this.paused)return!1;cancelAnimationFrame(this.timer);var s=Date.now();t.timer=requestAnimationFrame((function e(){var i=Date.now();Math.floor((i-s)/1e3)>=t.settings.autoplaySpeed&&(s=i,t._showSlide(t._getNextSlide())),t.timer=requestAnimationFrame(e)}))},_timerStop:function(){this.timer&&(cancelAnimationFrame(this.timer),this.timer=null)},_mouseenter:function(t){var s=t.data.self;s.settings.autoplay&&s.settings.autoplayPause&&(s.hovering=!0,s._timerStop())},_mouseleave:function(t){var s=t.data.self;s.settings.autoplay&&s.settings.autoplayPause&&(s.hovering=!1,s._timerStart())},_swipeLeft:function(){if("slideRight"===this.settings.transition)this._showPrevSlide();else this._showNextSlide()},_swipeRight:function(){if("slideRight"===this.settings.transition)this._showNextSlide();else this._showPrevSlide()},_showSlide:function(t,s){var e=null,i=!1;if(null!==this.$currentSlide&&this.$currentSlide.hasClass("ditty-slide-animating"))return!1;if(void 0===t&&(t=this.settings.slide,i=!0),t>=this.total?t=this.total-1:t<0&&(t=0),!i&&t===this.settings.slide)return!1;if(void 0===this.settings.slides[t])return!1;var n=this.settings.slide,l=this.settings.slides[n];this.settings.slides[t].$elmt?e=this.settings.slides[t].$elmt:(e=$(this.settings.slides[t].html),this.settings.slides[t].$elmt=e),e.addClass("ditty-slider__slide"),e.addClass("ditty-slider__slide--current"),e.addClass("ditty-slider__slide--"+t),$(this.$slides.children(".ditty-slider__slide--"+t).not(e)).remove(),this._styleSlide(e),e.stop(!0).css({position:"absolute",display:"block",opacity:0}),this.$slides.append(e),this.animateTransition=!0,this.animateHeight=!0,this._setStaticHeight();var r=[t,this.settings.slides[t],n,l];this.trigger("before_slide_update",r),null!==this.$currentSlide&&this._animateOut(this.$currentSlide,e,s),this.$currentSlide=e,this.settings.slide=t,this.slideObj=this.settings.slides[t],this.visibleSlides=[this.settings.slides[t]],e.hasClass("ditty-slide-animating")||this._slideResetPosition(e,s),this._animateIn(e,r),this._animateHeight(),this._activateBullet(),this.slidesDisplayed=this.slidesDisplayed+1},_animateIn:function(t,s){var e=this,i=0===parseInt(this.slidesDisplayed)?this.settings.initTransitionSpeed:this.settings.transitionSpeed,n=0===parseInt(this.slidesDisplayed)?this.settings.initTransitionEase:this.settings.transitionEase,l={left:0,top:0,opacity:1};0===parseFloat(i)?(t.show(),t.stop().css(l),t.css("position","relative"),e.transitioning=!1,e.animateTransition=!1,e._removeStaticHeight(),e._timerStart(),e.trigger("after_slide_update",s)):(this.transitioning=!0,this._timerStop(),t.show(),t.addClass("ditty-slide-animating"),t.stop(!0).animate(l,1e3*parseFloat(i),n,(function(){t.removeClass("ditty-slide-animating"),t.css("position","relative"),e.transitioning=!1,e.animateTransition=!1,e._removeStaticHeight(),e._timerStart(),e.trigger("after_slide_update",s)})))},_animateOut:function(t,s,e){this.$lastSlide=t;var i=0,n=0,l=1,r=this.settings.transition;switch("reverse"===e&&(r=this._reverseTransition(r)),r){case"fade":l=0;break;case"slideRight":i=this.$slides.outerWidth();break;case"slideLeft":i="-"+t.outerWidth();break;case"slideDown":n=s.outerHeight();break;case"slideUp":n="-"+t.outerHeight()}t.removeClass("ditty-slider__slide--current"),t.css("position","absolute"),t.css({zIndex:1});var a={left:i+"px",top:n+"px",opacity:l};0===parseFloat(this.settings.transitionSpeed)?(t.hide(),t.stop().css(a)):(t.addClass("ditty-slide-animating"),t.stop(!0).animate(a,1e3*parseFloat(this.settings.transitionSpeed),this.settings.transitionEase,(function(){t.removeClass("ditty-slide-animating"),t.hide()})))},_slideResetPosition:function(t,s){var e=0,i=0,n=1,l=0===parseInt(this.slidesDisplayed)?this.settings.initTransition:this.settings.transition;switch("reverse"===s&&(l=this._reverseTransition(l)),l){case"fade":n=0;break;case"slideLeft":e=this.$slides.outerWidth();break;case"slideRight":e="-"+t.outerWidth();break;case"slideUp":null!==this.$lastSlide?i=this.$lastSlide.outerHeight():(i=this.$slides.outerHeight(),t.outerHeight()>i&&(i=t.outerHeight()));break;case"slideDown":i="-"+t.outerHeight()}t.stop(!0).css({display:"block",opacity:n,left:e+"px",top:i+"px",zIndex:9})},_setStaticHeight:function(){var t=this.$slides.outerHeight();this.$slides.stop(!0).css("height",t+"px")},_removeStaticHeight:function(){this.animateTransition||this.animateHeight||this.$slides.stop(!0).css("height","auto")},_animateHeight:function(){var t=this,s=this.$currentSlide.outerHeight(),e=0===parseInt(this.slidesDisplayed)?this.settings.initHeightSpeed:this.settings.heightSpeed,i=0===parseInt(this.slidesDisplayed)?this.settings.initHeightEase:this.settings.heightEase;this.currentHeight=s;var n={height:s+"px"};0===parseFloat(e)?(this.$slides.stop().css(n),t.animateHeight=!1,t._removeStaticHeight(),t.trigger("height_updated")):this.$slides.stop(!0).animate(n,1e3*parseFloat(e),i,(function(){t.animateHeight=!1,t._removeStaticHeight(),t.trigger("height_updated")}))},_reverseTransition:function(t){var s=t;switch(t){case"slideLeft":s="slideRight";break;case"slideRight":s="slideLeft";break;case"slideUp":s="slideDown";break;case"slideDown":s="slideUp"}return s},_getNextSlide:function(){var t=this.settings.slide+1;return t>=this.total&&(t=0),t},_showNextSlide:function(){this._showSlide(this._getNextSlide())},_getPrevSlide:function(){var t=this.settings.slide-1;return t<0&&(t=this.total-1),t},_showPrevSlide:function(){this._showSlide(this._getPrevSlide(),"reverse")},_clickBullet:function(t){t.preventDefault();var s,e=t.data.self,i=$(t.target).data("index");i<e.settings.slide&&(s="reverse"),e._showSlide(i,s)},_activateBullet:function(){if("none"===this.settings.bullets||2>parseInt(this.total))return!1;var t=this._getPrevSlide(),s=this._getNextSlide();this.$bullets.find(".ditty-slider__bullet").removeClass("ditty-slider__bullet--active ditty-slider__bullet--next ditty-slider__bullet--prev"),this.$bullets.find('.ditty-slider__bullet[data-index="'+this.settings.slide+'"]').addClass("ditty-slider__bullet--active"),this.$bullets.find('.ditty-slider__bullet[data-index="'+t+'"]').addClass("ditty-slider__bullet--prev"),this.$bullets.find('.ditty-slider__bullet[data-index="'+s+'"]').addClass("ditty-slider__bullet--next"),this._styleBullets()},_setupBullets:function(){if(null===this.$bullets){var t=$('<div class="ditty-slider__bullets"></div>');this.$bullets=t,this.$elmt.append(t)}if("none"===this.settings.bullets||2>parseInt(this.total))this.$bullets.hide();else{this.$bullets.empty();for(var s=0;s<this.total;s++){var e=$('<a href="#" class="ditty-slider__bullet" data-index="'+s+'">'+this.settings.bullet+"</a>");e.on("click",{self:this},this._clickBullet),this.$bullets.append(e)}this.$bullets.show(),this._activateBullet()}},_styleBullets:function(){switch(this.$bullets.removeAttr("style"),this.$bullets.find("a").css({backgroundColor:this.settings.bulletsColor,marginLeft:this.settings.bulletsSpacing+"px",marginRight:this.settings.bulletsSpacing+"px"}),this.$bullets.find("a.ditty-slider__bullet--active").css({backgroundColor:this.settings.bulletsColorActive}),this.$bullets.css(this.settings.bulletsPadding),this.settings.bulletsPosition){case"topLeft":this.$bullets.css({order:0,justifyContent:"flex-start"});break;case"topCenter":this.$bullets.css({order:0,justifyContent:"center"});break;case"topRight":this.$bullets.css({order:0,justifyContent:"flex-end"});break;case"bottomLeft":this.$bullets.css({order:2,justifyContent:"flex-start"});break;case"bottomCenter":this.$bullets.css({order:2,justifyContent:"center"});break;case"bottomRight":this.$bullets.css({order:2,justifyContent:"flex-end"})}},_clickPrev:function(t){t.preventDefault(),t.data.self._showPrevSlide()},_clickNext:function(t){t.preventDefault(),t.data.self._showNextSlide()},_setupArrows:function(){if(null===this.$arrows){var t=$('<div class="ditty-slider__arrows"></div>'),s=$('<a href="#" class="ditty-slider__prev">'+this.settings.navPrev+"</a>"),e=$('<a href="#" class="ditty-slider__next">'+this.settings.navNext+"</a>");s.on("click",{self:this},this._clickPrev),e.on("click",{self:this},this._clickNext),t.append(s,e),this.$arrows=t,this.$contents.append(t)}this.$arrows.removeAttr("style"),"none"===this.settings.arrows||2>this.total?this.$arrows.hide():this.$arrows.css("display","flex"),this.$arrows.css(this.settings.arrowsPadding),this.$arrows.css({alignItems:this.settings.arrowsPosition}),this.$arrows.find("i").css({color:this.settings.arrowsIconColor}),this.$arrows.find("a").css({backgroundColor:this.settings.arrowsBgColor}),1===parseInt(this.settings.arrowsStatic)?this.$arrows.addClass("ditty-slider__arrows--static"):this.$arrows.removeClass("ditty-slider__arrows--static")},_styleDisplay:function(){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.$elmt.css(this.settings.borderWidth),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)},_styleSlide:function(t){t.css({backgroundColor:this.settings.slideBgColor,borderColor:this.settings.slideBorderColor,borderStyle:this.settings.slideBorderStyle}),t.css(this.settings.slidePadding),t.css(this.settings.slideBorderRadius),t.css(this.settings.slideBorderWidth)},updateSlides:function(t){for(var s=this.settings.slides.length,e=t.length,i=this.settings.slide,n=this.settings.slide,l=0;l<t.length;l++)this._preloadSlide(t[l]);this.settings.slides=t,s!==e&&(this.total=t.length,this._setupBullets(),this._setupArrows()),i>=this.total&&(n=this.total-1),i!==n&&this._showSlide(n)},_getOption:function(t){switch(t){case"elmnt":return this;case"height":return this.$slides.outerHeight();case"currentSlide":return this.$currentSlide;default:return this.settings[t]}},_setOption:function(t,s){if(void 0===s)return!1;switch("slides"!==t&&(this.settings[t]=s),t){case"slides":this.updateSlides(s);break;case"slide":this.slide=s;break;case"autoplay":1===parseInt(s)?this.timer||this._timerStart():this._timerStop();break;case"bgColor":case"padding":case"borderColor":case"borderStyle":case"borderWidth":case"borderRadius":case"contentsBgColor":case"contentsPadding":case"contentsBorderColor":case"contentsBorderStyle":case"contentsBorderWidth":case"contentsBorderRadius":this.animateHeight=!0,this._setStaticHeight(),this._styleDisplay(),this._animateHeight();break;case"slideBgColor":case"slidePadding":case"slideBorderColor":case"slideBorderStyle":case"slideBorderWidth":case"slideBorderRadius":this.animateHeight=!0,this._setStaticHeight(),this._styleSlide(this.$currentSlide),this._animateHeight();break;case"arrows":case"arrowsIconColor":case"arrowsBgColor":case"arrowsPadding":case"arrowsPosition":case"arrowsStatic":this._setupArrows();break;case"bullets":this._setupBullets();break;case"bulletsColor":case"bulletsColorActive":case"bulletsPosition":case"bulletsSpacing":case"bulletsPadding":this._styleBullets();break;default:this.settings[t]=s}this.trigger("update")},shuffle:function(){for(var t,s,e=this.total-1;e>0;e--)s=Math.floor(Math.random()*(e+1)),t=this.settings.slides[e],this.settings.slides[e]=this.settings.slides[s],this.settings.slides[s]=t},start:function(){this._timerStart()},stop:function(){this._timerStop()},pause:function(){this.paused=!0},resume:function(){this.paused=!1,this._timerStart()},current:function(){return this.$currentSlide},showSlide:function(t){this._showSlide(t)},showSlideById:function(t,s){var e=this;$.each(this.settings.slides,(function(i,n){if(n.id===t)return"force"===s?(e.settings.slide=i,e._showSlide()):e._showSlide(i),!1}))},addSlide:function(t,s,e){var i=!0;if((s>=this.total||s<0)&&(i=!1),"replace"===e&&i){var n=this.settings.slides[s];this.trigger("slide_removed",[n]),this.settings.slides.splice(s,1,t)}else null!==s&&""!==s&&i?this.settings.slides.splice(s,0,t):this.settings.slides.splice(parseInt(this.settings.slide)+1,0,t);this.total=this.settings.slides.length,this._preloadSlide(t),this.trigger("update")},addSlideById:function(t,s){var e={id:t,html:s},i=!1;if($.each(this.settings.slides,(function(s,e){String(e.id)!==String(t)||(i=s)})),i){var n=this.settings.slides[i];this.trigger("slide_removed",[n]),this.settings.slides[i].$elmt&&this.settings.slides[i].$elmt.remove(),this.settings.slides.splice(i,1,e)}else this.settings.slides.push(e);this.total=this.settings.slides.length,this._preloadSlide(e),this.trigger("update")},deleteSlideById:function(t){var s=[];$.each(this.settings.slides,(function(e,i){String(i.id)!==String(t)&&s.push(i)})),this.settings.slides=s,this.total=this.settings.slides.length,this.trigger("update")},deleteSlide:function(t){if(t>=this.total||t<0)return!1;var s=this.settings.slides[t];this.trigger("slide_removed",[s]),this.settings.slides[t].$elmt&&this.settings.slides[t].$elmt.remove(),this.settings.slides.splice(t,1),this.total=this.settings.slides.length,this.trigger("update")},setStaticHeight:function(){this.animateHeight=!0,this._setStaticHeight()},animateHeight:function(){this._animateHeight()},trigger:function(t,s){var e=[];if("height_updated"===t)e=[this.currentHeight];else e=[this.settings,this.$elmt];s&&(e=s),this.$elmt.trigger("ditty_slider_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(t,s){var e=this;if("object"==typeof t)$.each(t,(function(t,s){e._setOption(t,s)}));else{if("string"!=typeof t)return e.settings;if(void 0===s)return e._getOption(t);e._setOption(t,s)}},destroy:function(){clearInterval(this.timer),this.$elmt.removeClass("ditty-slider"),this.$elmt.removeAttr("style"),this.$elmt.empty(),this.trigger("destroy"),this.elmt._ditty_slider=null}},$.fn.ditty_slider=function(t){var e,i=arguments,n=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_slider||(this._ditty_slider=new s(this,t))}));if("string"==typeof t){if(this.each((function(){var s=this._ditty_slider;if(!s)throw new Error("No Ditty_Slider applied to this element.");"function"==typeof s[t]&&"_"!==t[0]?e=s[t].apply(s,[].slice.call(i,1)):n=!0})),n)throw new Error('No method "'+t+'" in Ditty_Slider.');return void 0!==e?e:this}},$.ditty_slider={},$.ditty_slider.defaults=t}(jQuery);
includes/js/ditty-admin.js CHANGED
@@ -6,6 +6,7 @@
6
  // @codekit-append 'admin/class-ditty-extension.js';
7
  // @codekit-append 'admin/ditty-extensions.js';
8
  // @codekit-append 'admin/ditty-displays.js';
 
9
 
10
  jQuery( function( $ ) {
11
 
6
  // @codekit-append 'admin/class-ditty-extension.js';
7
  // @codekit-append 'admin/ditty-extensions.js';
8
  // @codekit-append 'admin/ditty-displays.js';
9
+ // @codekit-append 'admin/ditty-wizard.js';
10
 
11
  jQuery( function( $ ) {
12
 
includes/js/ditty-admin.min.js CHANGED
@@ -1,888 +1 @@
1
- /* global jQuery:true */
2
- /* global dittyAdminVars:true */
3
- /* global console:true */
4
-
5
- // @codekit-append 'admin/class-ditty-settings.js';
6
- // @codekit-append 'admin/class-ditty-extension.js';
7
- // @codekit-append 'admin/ditty-extensions.js';
8
- // @codekit-append 'admin/ditty-displays.js';
9
-
10
- jQuery( function( $ ) {
11
-
12
- // Setup strict mode
13
- (function() {
14
-
15
- "use strict";
16
-
17
- $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
- $( '#ditty-settings' ).ditty_settings();
19
-
20
- }() );
21
-
22
- } );
23
-
24
- /**
25
- * Ditty Settings
26
- *
27
- * @since 3.0
28
- * @return null
29
- */
30
-
31
- (function ($) {
32
- 'use strict';
33
-
34
- var defaults = {
35
- };
36
-
37
- var Ditty_Settings = function ( elmt, options ) {
38
-
39
- this.elmt = elmt;
40
- this.settings = $.extend( {}, defaults, $.ditty_settings.defaults, options );
41
- this.$elmt = $( elmt );
42
- this.$form = this.$elmt.find( '.ditty-settings__form' );
43
- this.$panels = this.$elmt.find( '.ditty-settings__panels' );
44
- this.saveBtns = this.$elmt.find( '.ditty-settings__save' );
45
- this.tabs = this.$elmt.find( '.ditty-settings__tab' );
46
- this.$notice_update = this.$elmt.find( '.ditty-notification--updated' );
47
- this.$notice_error = this.$elmt.find( '.ditty-notification--error' );
48
- this.$notice_warning = this.$elmt.find( '.ditty-notification--warning' );
49
- this.initData = null;
50
- this._init();
51
- };
52
-
53
-
54
- Ditty_Settings.prototype = {
55
-
56
- /**
57
- * Initialize the data list
58
- *
59
- * @since 3.0
60
- * @return null
61
- */
62
- _init: function () {
63
-
64
- // Initialize the slider
65
- this._initSlider();
66
-
67
- // Add listeners
68
- $( 'body' ).on( 'ditty_field_clone_update', { self: this }, this._enableSettingsUpdates );
69
- this.saveBtns.on( 'click', { self: this }, this._submitForm );
70
- this.tabs.on( 'click', { self: this }, this._tabClick );
71
- this.$panels.on( 'ditty_slider_init', { self: this }, this._sliderInit );
72
- this.$panels.on( 'ditty_slider_before_slide_update', { self: this }, this._beforeSlideUpdate );
73
- this.$form.on( 'keyup change', 'input[type="text"], input[type="number"], textarea, select', { self: this }, this._checkUpdates );
74
- this.$form.on( 'click', 'input[type="radio"], input[type="checkbox"]', { self: this }, this._checkUpdates );
75
- this.$form.on( 'ditty_input_wysiwyg_update', '.ditty-input--wysiwyg', { self: this }, this._checkUpdates );
76
- this.$form.on( 'click', '.ditty-default-layout-install', { self: this }, this._installLayout );
77
- this.$form.on( 'click', '.ditty-default-display-install', { self: this }, this._installDisplay );
78
- },
79
-
80
- /**
81
- * Initialize the extensions
82
- *
83
- * @since 3.0
84
- * @return null
85
- */
86
- _initSlider: function () {
87
- var initPanel = this.$panels.data( 'init_panel' );
88
- this.$panels.ditty_slider( {
89
- transition : 'fade',
90
- transitionSpeed : 0.75,
91
- heightSpeed : 0.75,
92
- touchSwipe : false,
93
- slidesEl : '.ditty-settings__panel',
94
- slideId : ( '' !== initPanel ) ? initPanel : false
95
- } );
96
- },
97
-
98
- /**
99
- * Slider init
100
- *
101
- * @since 3.0
102
- * @return null
103
- */
104
- _sliderInit: function( e ) {
105
- var self = e.data.self;
106
- self.initData = self.$form.serialize();
107
- },
108
-
109
- /**
110
- * Before slide update
111
- *
112
- * @since 3.0
113
- * @return null
114
- */
115
- _beforeSlideUpdate: function( e, index, slide ) {
116
- var self = e.data.self;
117
- self._initFields( slide.$elmt );
118
- self.$elmt.find( '.ditty-settings__tab' ).removeClass( 'active' );
119
- self.$elmt.find( '.ditty-settings__tab[data-panel="' + slide.id + '"]' ).addClass( 'active' );
120
- },
121
-
122
- /**
123
- * Preview button add updates class
124
- *
125
- * @since 3.0
126
- * @return null
127
- */
128
- _enableSettingsUpdates: function( e ) {
129
- var self = ( e ) ? e.data.self : this;
130
- self.saveBtns.addClass( 'has-updates' );
131
- //self.notice_warning.slideDown();
132
- },
133
-
134
- /**
135
- * Preview button remove updates class
136
- *
137
- * @since 3.0
138
- * @return null
139
- */
140
- _disableSettingsUpdates: function() {
141
- this.saveBtns.removeClass( 'has-updates' );
142
- },
143
-
144
- /**
145
- * Check for updates
146
- *
147
- * @since 3.0
148
- * @return null
149
- */
150
- _checkUpdates: function( e ) {
151
- var self = e ? e.data.self : this;
152
- var currentData = self.$form.serialize();
153
- if ( currentData !== self.initData ) {
154
- self._enableSettingsUpdates();
155
- } else {
156
- self._disableSettingsUpdates();
157
- }
158
- },
159
-
160
- /**
161
- * Initialize dynamic fields
162
- *
163
- * @since 3.0
164
- * @return null
165
- */
166
- _initFields: function ( $fields ) {
167
- $fields.find( '.ditty-data-list' ).ditty_ui_data_list();
168
- $fields.trigger( 'ditty_init_fields' );
169
- $.protip( {
170
- defaults: {
171
- position: 'top',
172
- size: 'small',
173
- scheme: 'black',
174
- classes: 'ditty-protip'
175
- }
176
- } );
177
- },
178
-
179
- /**
180
- * Show or hide post types
181
- *
182
- * @since 3.0
183
- * @return null
184
- */
185
- _togglePostTypes: function () {
186
- if ( $( 'input[name="ditty_layout_ui"]' ).length ) {
187
- var layoutUiVal = $( 'input[name="ditty_layout_ui"]:checked' ).val(),
188
- $layoutMenu = $( '#adminmenu .wp-submenu > li > a[href="edit.php?post_type=ditty_layout"]' );
189
- if ( 'disabled' === layoutUiVal ) {
190
- $layoutMenu.hide();
191
- } else {
192
- $layoutMenu.css( 'display', 'block' );
193
- }
194
- }
195
- if ( $( 'input[name="ditty_display_ui"]' ).length ) {
196
- var displayUiVal = $( 'input[name="ditty_display_ui"]:checked' ).val(),
197
- $displayMenu = $( '#adminmenu .wp-submenu > li > a[href="edit.php?post_type=ditty_display"]' );
198
- if ( 'disabled' === displayUiVal ) {
199
- $displayMenu.hide();
200
- } else {
201
- $displayMenu.css( 'display', 'block' );
202
- }
203
- }
204
- },
205
-
206
- /**
207
- * Listen for a tab click
208
- *
209
- * @since 3.0
210
- * @return null
211
- */
212
- _tabClick: function( e ) {
213
- e.preventDefault();
214
- var self = e.data.self,
215
- $tab = $( e.target ).is( 'a' ) ? $( e.target ) : $( e.target ).parent( 'a' ),
216
- slideId = $tab.data( 'panel' ),
217
- $currentTab = self.$elmt.find( '.ditty-settings__tab.active' );
218
-
219
- if ( $currentTab === $tab ) {
220
- return false;
221
- }
222
-
223
- self.$elmt.find( '.ditty-extension__tab' ).removeClass( 'active' );
224
- $tab.addClass( 'active' );
225
-
226
- self.$panels.ditty_slider( 'showSlideById', slideId );
227
- },
228
-
229
- /**
230
- * Update inputs after save and sanitize
231
- *
232
- * @since 3.0
233
- * @return null
234
- */
235
- _upateInputs: function( updates ) {
236
- $.each( updates, function( inputName, updatedValue ) {
237
- if ( $( 'input[name="' + inputName + '"]' ).length ) {
238
- $( 'input[name="' + inputName + '"]' ).val( updatedValue );
239
- }
240
- } );
241
- },
242
-
243
- /**
244
- * Submit updates
245
- *
246
- * @since 3.0
247
- * @return null
248
- */
249
- _submitForm: function( e ) {
250
- e.preventDefault();
251
- var self = e.data.self;
252
-
253
- if ( self.$elmt.hasClass( 'updating' ) ) {
254
- return false;
255
- }
256
-
257
- self.$elmt.trigger( 'ditty_pre_save_fields' );
258
- self.$elmt.addClass( 'updating' );
259
- self.saveBtns.text( dittyAdminVars.adminStrings.settingsSaving );
260
-
261
- self.$form.ajaxSubmit( {
262
- url : dittyAdminVars.ajaxurl,
263
- type : 'post',
264
- dataType : 'json',
265
- data : {
266
- action : 'ditty_settings_save',
267
- security : dittyAdminVars.security
268
- },
269
- success: function( data ) {
270
- if ( data.input_updates ) {
271
- self._upateInputs( data.input_updates );
272
- }
273
- self.initData = self.$form.serialize();
274
- self.saveBtns.text( dittyAdminVars.adminStrings.settings_updated );
275
- setTimeout( function() {
276
- self.saveBtns.text( dittyAdminVars.adminStrings.settings_save );
277
- }, 2000 );
278
- self.$elmt.removeClass( 'updating' );
279
- self._disableSettingsUpdates();
280
-
281
- //self.$notice_update.slideDown();
282
-
283
- // Check the post types display
284
- self._togglePostTypes();
285
- }
286
- } );
287
- },
288
-
289
- /**
290
- * Install a layout
291
- *
292
- * @since 3.0
293
- * @return null
294
- */
295
- _installLayout: function( e ) {
296
- e.preventDefault();
297
- var self = e.data.self,
298
- $button = $( e.target ).is( 'button' ) ? $( e.target ) : $( e.target ).parents( 'button' ),
299
- $icon = $button.find( 'i' ),
300
- iconClass = $icon.attr( 'class' );
301
-
302
- if ( $button.hasClass( 'updating' ) ) {
303
- return false;
304
- }
305
- $button.addClass( 'updating' );
306
- $icon.attr( 'class', dittyAdminVars.updateIcon );
307
-
308
- var data = {
309
- action : 'ditty_install_layout',
310
- layout_template : $button.data( 'layout_template' ),
311
- layout_version : $button.data( 'layout_version' ),
312
- security : dittyAdminVars.security
313
- };
314
- $.post( dittyAdminVars.ajaxurl, data, function( response ) {
315
- $icon.attr( 'class', iconClass );
316
- self.$elmt.removeClass( 'updating' );
317
- if ( response ) {
318
- $button.replaceWith( response.button );
319
- }
320
- } );
321
- },
322
-
323
- /**
324
- * Install a display
325
- *
326
- * @since 3.0
327
- * @return null
328
- */
329
- _installDisplay: function( e ) {
330
- e.preventDefault();
331
- var self = e.data.self,
332
- $button = $( e.target ).is( 'button' ) ? $( e.target ) : $( e.target ).parents( 'button' ),
333
- $icon = $button.find( 'i' ),
334
- iconClass = $icon.attr( 'class' );
335
-
336
- if ( $button.hasClass( 'updating' ) ) {
337
- return false;
338
- }
339
- $button.addClass( 'updating' );
340
- $icon.attr( 'class', dittyAdminVars.updateIcon );
341
-
342
- var data = {
343
- action : 'ditty_install_display',
344
- display_type : $button.data( 'display_type' ),
345
- display_template : $button.data( 'display_template' ),
346
- display_version : $button.data( 'display_version' ),
347
- security : dittyAdminVars.security
348
- };
349
- $.post( dittyAdminVars.ajaxurl, data, function( response ) {
350
- $icon.attr( 'class', iconClass );
351
- self.$elmt.removeClass( 'updating' );
352
- if ( response ) {
353
- $button.replaceWith( response.button );
354
- }
355
- } );
356
- },
357
-
358
- /**
359
- * Return a specific setting
360
- *
361
- * @since 3.0
362
- * @return null
363
- */
364
- _options: function ( key ) {
365
- return this.settings[key];
366
- },
367
-
368
- /**
369
- * Setup triggers
370
- *
371
- * @since 3.0
372
- * @return null
373
- */
374
- trigger: function ( fn, customParams ) {
375
- var params = [this.settings];
376
- if ( customParams ) {
377
- params = customParams;
378
- }
379
-
380
- this.$elmt.trigger( 'ditty_settings_' + fn, params );
381
-
382
- if ( typeof this.settings[fn] === 'function' ) {
383
- this.settings[fn].apply( this.$elmt, params );
384
- }
385
- },
386
-
387
- /**
388
- * Allow settings to be modified
389
- *
390
- * @since 3.0
391
- * @return null
392
- */
393
- options: function ( key, value ) {
394
-
395
- if ( typeof key === 'object' ) {
396
- this.settings = $.extend( {}, defaults, $.ditty_settings.defaults, key );
397
- } else if ( typeof key === 'string' ) {
398
- if ( value === undefined ) {
399
- return this.settings[key];
400
- }
401
- this.settings[key] = value;
402
- } else {
403
- return this.settings;
404
- }
405
-
406
- this.trigger( 'options_update' );
407
- },
408
-
409
- /**
410
- * Destroy the editor
411
- *
412
- * @since 3.0
413
- * @return null
414
- */
415
- destroy: function () {
416
-
417
- // Remove listeners
418
- $( 'body' ).off( 'ditty_field_clone_update', { self: this }, this._enableSettingsUpdates );
419
- this.saveBtns.off( 'click', { self: this }, this._submitForm );
420
- this.tabs.off( 'click', { self: this }, this._tabClick );
421
- this.$panels.off( 'ditty_slider_init', { self: this }, this._sliderInit );
422
- this.$panels.off( 'ditty_slider_before_slide_update', { self: this }, this._beforeSlideUpdate );
423
- this.$form.off( 'keyup change', 'input[type="text"], input[type="number"], textarea, select', { self: this }, this._checkUpdates );
424
- this.$form.off( 'click', 'input[type="radio"], input[type="checkbox"]', { self: this }, this._checkUpdates );
425
- this.$form.off( 'ditty_input_wysiwyg_update', '.ditty-input--wysiwyg', { self: this }, this._checkUpdates );
426
- this.$form.off( 'click', '.ditty-default-layout-install', { self: this }, this._installLayout );
427
- this.$form.off( 'click', '.ditty-default-display-install', { self: this }, this._installDisplay );
428
-
429
- this.$panels.ditty_slider( 'destroy' );
430
- this.elmt._ditty_settings = null;
431
- }
432
- };
433
-
434
- /**
435
- * Create the data list
436
- *
437
- * @since 3.0
438
- * @return null
439
- */
440
- $.fn.ditty_settings = function( options ) {
441
- var args = arguments,
442
- error = false,
443
- returns;
444
-
445
- if ( options === undefined || typeof options === 'object' ) {
446
- return this.each( function () {
447
- if ( ! this._ditty_settings ) {
448
- this._ditty_settings = new Ditty_Settings( this, options );
449
- }
450
- });
451
- } else if ( typeof options === 'string' ) {
452
- this.each( function () {
453
- var instance = this._ditty_settings;
454
-
455
- if ( ! instance ) {
456
- throw new Error( 'No Ditty_Settings applied to this element.' );
457
- }
458
- if ( typeof instance[options] === 'function' && options[0] !== '_' ) {
459
- returns = instance[options].apply( instance, [].slice.call( args, 1 ) );
460
- } else {
461
- error = true;
462
- }
463
- } );
464
-
465
- if ( error ) {
466
- throw new Error( 'No method "' + options + '" in Ditty_Settings.' );
467
- }
468
-
469
- return returns !== undefined ? returns : this;
470
- }
471
- };
472
-
473
- $.ditty_settings = {};
474
- $.ditty_settings.defaults = defaults;
475
-
476
- } )( jQuery );
477
-
478
-
479
- /**
480
- * Ditty Extension class
481
- *
482
- * @since 3.0
483
- * @return null
484
- */
485
-
486
- (function ($) {
487
- 'use strict';
488
-
489
- var defaults = {
490
- };
491
-
492
- var Ditty_Extension = function ( elmt, options ) {
493
-
494
- this.elmt = elmt;
495
- this.settings = $.extend( {}, defaults, $.ditty_extension.defaults, options );
496
- this.$elmt = $( elmt );
497
- this.$panels = $( elmt ).find( '.ditty-extension__panels' );
498
- this.initPanel = this.$panels.data( 'init_panel' );
499
-
500
- this._init();
501
- };
502
-
503
- Ditty_Extension.prototype = {
504
-
505
- _init: function () {
506
-
507
- // Add listeners
508
- this.$elmt.on( 'click', '.ditty-extension__tab', { self: this }, this._tabClick );
509
- this.$elmt.on( 'click', 'button[name="submit"]', { self: this }, this._updatePanel );
510
- this.$elmt.on( 'click', '.ditty-extension__license__submit', { self: this, action: 'ditty_extension_license_activate' }, this._licenseUpdate );
511
- this.$elmt.on( 'click', '.ditty-extension__license__refresh', { self: this, action: 'ditty_extension_license_refresh' }, this._licenseUpdate );
512
- this.$elmt.on( 'click', '.ditty-extension__license__deactivate', { self: this, action: 'ditty_extension_license_deactivate' }, this._licenseUpdate );
513
- this.$panels.on( 'ditty_slider_before_slide_update', { self: this }, this._beforePanelUpdate );
514
- this._initSlider();
515
- },
516
-
517
- /**
518
- * Initialize the slider
519
- *
520
- * @since 3.0
521
- * @return null
522
- */
523
- _initSlider: function () {
524
- var args = {
525
- transition : 'fade',
526
- transitionSpeed : 0.75,
527
- heightSpeed : 0.75,
528
- touchSwipe : false,
529
- slidesEl : '.ditty-extension__panel',
530
- slideId : ( '' !== this.initPanel ) ? this.initPanel : false
531
- };
532
- this.$panels.ditty_slider( args );
533
- },
534
-
535
- /**
536
- * Initialize the slider
537
- *
538
- * @since 3.0
539
- * @return null
540
- */
541
- _beforePanelUpdate: function ( e, index, slide ) {
542
- var self = e.data.self;
543
- self.$elmt.find( '.ditty-extension__tab' ).removeClass( 'active' );
544
- self.$elmt.find( '.ditty-extension__tab[data-slide_id="' + slide.id + '"]' ).addClass( 'active' );
545
- },
546
-
547
- /**
548
- * Tab click
549
- *
550
- * @since 3.0
551
- * @return null
552
- */
553
- _tabClick: function ( e ) {
554
- e.preventDefault();
555
- var self = e.data.self;
556
- var $tab = $( this ),
557
- slideId = $tab.data( 'slide_id' ),
558
- transition = 'slideLeft',
559
- $currentTab = self.$elmt.find( '.ditty-extension__tab.active' );
560
-
561
- if ( $currentTab === $tab ) {
562
- return false;
563
- }
564
-
565
- if ( $tab.index() < $currentTab.index() ) {
566
- transition = 'slideRight';
567
- }
568
-
569
- //self.$elmt.find( '.ditty-extension__tab' ).removeClass( 'active' );
570
- //$tab.addClass( 'active' );
571
-
572
- self.$panels.ditty_slider( 'options', 'transition', transition );
573
- self.$panels.ditty_slider( 'showSlideById', slideId );
574
- },
575
-
576
- /**
577
- * Panel update listener
578
- *
579
- * @since 3.0
580
- * @return null
581
- */
582
- _updatePanel: function ( e ) {
583
- e.preventDefault();
584
- var self = e.data.self;
585
-
586
- var $button = $( this ),
587
- $panel = $button.parents( '.ditty-extension__panel' ),
588
- $form = $button.parents( '.ditty-extension__form' ),
589
- $icon = $button.find( 'i' ),
590
- iconClass = $icon.attr( 'class' ),
591
- extension = self.$elmt.data( 'extension' ),
592
- panel = $panel.data( 'slide_id' );
593
-
594
- if ( self.$elmt.hasClass( 'updating' ) ) {
595
- return false;
596
- }
597
-
598
- self.$elmt.addClass( 'updating' );
599
- $icon.attr( 'class', dittyAdminVars.updateIcon );
600
-
601
- $form.ajaxSubmit( {
602
- url : dittyAdminVars.ajaxurl,
603
- type : 'post',
604
- dataType : 'json',
605
- data : {
606
- action : 'ditty_extension_panel_update',
607
- extension : extension,
608
- panel : panel,
609
- security : dittyAdminVars.security
610
- },
611
- success: function( response ) {
612
- $icon.attr( 'class', iconClass );
613
- self.$elmt.removeClass( 'updating' );
614
- $( '#ditty-extensions' ).trigger( 'ditty_extension_panel_updated', [ response, self.$elmt, $panel ] );
615
- }
616
- } );
617
- },
618
-
619
- /**
620
- * Update a license
621
- *
622
- * @since 3.0
623
- * @return null
624
- */
625
- _licenseUpdate: function ( e ) {
626
- e.preventDefault();
627
- var self = e.data.self,
628
- action = e.data.action;
629
-
630
- var $button = $( this ),
631
- $message = self.$elmt.find( '.ditty-extension__license__message' ),
632
- $input = $button.siblings( '.ditty-extension__license__input' ),
633
- license = $input.val(),
634
- extension = $button.data( 'extension' ),
635
- extensionId = $button.data( 'extension_id' ),
636
- extensionName = $button.data( 'extension_name' ),
637
- $icon = $button.children( 'i' );
638
-
639
- if ( self.$elmt.hasClass( 'updating' ) ) {
640
- return false;
641
- }
642
-
643
- self.$elmt.addClass( 'updating' );
644
- $icon.attr( 'class', dittyAdminVars.updateIcon );
645
-
646
- // Load the new display data
647
- var data = {
648
- action : action,
649
- license : license,
650
- extension : extension,
651
- extension_id : extensionId,
652
- extension_name : extensionName,
653
- security : dittyAdminVars.security
654
- };
655
- $.post( dittyAdminVars.ajaxurl, data, function( response ) {
656
- if ( response ) {
657
- self.$elmt.attr( 'data-license_status', response.status );
658
- $message.text( response.message );
659
- }
660
- if ( response.license_key ) {
661
- if ( 'DELETE' === response.license_key ) {
662
- $input.val( '' );
663
- } else {
664
- $input.val( response.license_key );
665
- }
666
- }
667
- $icon.attr( 'class', $icon.data( 'class' ) );
668
- self.$elmt.removeClass( 'updating' );
669
- }, 'json' );
670
- },
671
-
672
- /**
673
- * Return data for the object
674
- *
675
- * @since 3.0
676
- * @return null
677
- */
678
- _getOption: function( key ) {
679
- switch( key ) {
680
- default:
681
- return this.settings[key];
682
- }
683
- },
684
-
685
- /**
686
- * Set data for the object
687
- *
688
- * @since 3.0
689
- * @return null
690
- */
691
- _setOption: function( key, value ) {
692
- if ( undefined === value ) {
693
- return false;
694
- }
695
-
696
- this.settings[key] = value;
697
- },
698
-
699
- /**
700
- * Get or set ditty options
701
- *
702
- * @since 3.0
703
- * @return null
704
- */
705
- options: function ( key, value ) {
706
- var self = this;
707
- if ( typeof key === 'object' ) {
708
- $.each( key, function( k, v ) {
709
- self._setOption( k, v );
710
- });
711
- } else if ( typeof key === 'string' ) {
712
- if ( value === undefined ) {
713
- return self._getOption( key );
714
- }
715
- self._setOption( key, value );
716
- } else {
717
- return self.settings;
718
- }
719
- },
720
-
721
- /**
722
- * Destroy this object
723
- *
724
- * @since 3.0
725
- * @return null
726
- */
727
- destroy: function () {
728
- // Remove listeners
729
- this.$elmt.off( 'click', '.ditty-extension__tab', { self: this }, this._tabClick );
730
- this.$elmt.off( 'click', 'button[name="submit"]', { self: this }, this._updatePanel );
731
- this.$elmt.off( 'click', '.ditty-extension__license__submit, .ditty-extension__license__refresh', { self: this, action: 'ditty_extension_license_activate' }, this._licenseUpdate );
732
- this.$elmt.off( 'click', '.ditty-extension__license__deactivate', { self: this, action: 'ditty_extension_license_deactivate' }, this._licenseUpdate );
733
- this.$panels.off( 'ditty_slider_after_slide_update', { self: this }, this._afterPanelUpdate );
734
-
735
- this.$panels.ditty_slider( 'destroy' );
736
- this.elmt._ditty_extension = null;
737
- }
738
- };
739
-
740
- $.fn.ditty_extension = function( options ) {
741
- var args = arguments,
742
- error = false,
743
- returns;
744
-
745
- if ( options === undefined || typeof options === 'object' ) {
746
- return this.each( function () {
747
- if ( ! this._ditty_extension ) {
748
- this._ditty_extension = new Ditty_Extension( this, options );
749
- }
750
- });
751
- } else if ( typeof options === 'string' ) {
752
- this.each( function () {
753
- var instance = this._ditty_extension;
754
-
755
- if ( ! instance ) {
756
- throw new Error( 'No Ditty_Extension applied to this element.' );
757
- }
758
- if ( typeof instance[options] === 'function' && options[0] !== '_' ) {
759
- returns = instance[options].apply( instance, [].slice.call( args, 1 ) );
760
- } else {
761
- error = true;
762
- }
763
- } );
764
-
765
- if ( error ) {
766
- throw new Error( 'No method "' + options + '" in Ditty_Extension.' );
767
- }
768
-
769
- return returns !== undefined ? returns : this;
770
- }
771
- };
772
-
773
- $.ditty_extension = {};
774
- $.ditty_extension.defaults = defaults;
775
-
776
- } )( jQuery );
777
-
778
-
779
-
780
- jQuery( function( $ ) {
781
- // Setup strict mode
782
- (function() {
783
-
784
- "use strict";
785
-
786
- // Setup protip
787
- $.protip( {
788
- defaults: {
789
- position: 'top',
790
- size: 'small',
791
- scheme: 'black',
792
- classes: 'ditty-protip'
793
- }
794
- } );
795
-
796
- /**
797
- * Listen for an accordion toggle click
798
- *
799
- * @since 3.0
800
- * @return null
801
- */
802
- // $( '#ditty-extensions' ).on( 'click', '.ditty-accordion__toggle', function( e ) {
803
- // e.preventDefault();
804
- // var $accordion = $( this ).parent(),
805
- // $content = $( this ).next();
806
- //
807
- // if ( $accordion.hasClass( 'active' ) ) {
808
- // $accordion.removeClass( 'active' );
809
- // $content.stop().slideUp( { duration: 750, easing: "easeInOutQuint" } );
810
- // } else {
811
- // $accordion.addClass( 'active' );
812
- // $content.stop().slideDown( { duration: 750, easing: "easeInOutQuint" }, function() {
813
- // $content.css( 'height', 'auto' );
814
- // } );
815
- // }
816
- // } );
817
- //
818
- /**
819
- * Initialize the extensions
820
- *
821
- * @since 3.0
822
- * @return null
823
- */
824
- function ditty_extensions_init() {
825
- $( '#ditty-extensions' ).find( '.ditty-extension' ).each( function( index ) {
826
-
827
- var $extension = $( this ),
828
- $panels = $extension.find( '.ditty-extension__panels' );
829
-
830
- if ( $panels.length ) {
831
- $extension.ditty_extension();
832
- }
833
-
834
- $( '#ditty-extensions' ).trigger( 'ditty_init_fields' );
835
-
836
- setTimeout( function() {
837
- $extension.addClass( 'ditty-extension--init' );
838
- }, index * 250 );
839
-
840
- } );
841
- }
842
- ditty_extensions_init();
843
-
844
- }() );
845
-
846
- } );
847
-
848
-
849
- jQuery( function( $ ) {
850
- // Setup strict mode
851
- (function() {
852
-
853
- "use strict";
854
-
855
- var isDisplayPost = ( $( 'input[name="post_type"]' ).length && 'ditty_display' == $( 'input[name="post_type"]' ).val() ),
856
- ajaxSubmitComplete = false;
857
-
858
- $( 'form#post' ).on( 'submit', function( e ) {
859
- if ( isDisplayPost && ! ajaxSubmitComplete ) {
860
- e.preventDefault();
861
-
862
- var $button = $( '#publishing-action' ).children( 'input[type="submit"]' ),
863
- $spinner = $( '#publishing-action' ).children( '.spinner' );
864
-
865
- $button.attr( 'disabled', 'disabled' );
866
- $spinner.css( 'visibility', 'visible' );
867
-
868
- var data = {
869
- action : 'ditty_admin_display_update',
870
- display_id : $( 'input[name="post_ID"]' ).val(),
871
- security : dittyAdminVars.security
872
- };
873
- $( '#ditty-display-settings' ).ajaxSubmit( {
874
- url : dittyAdminVars.ajaxurl,
875
- type : 'post',
876
- dataType : 'json',
877
- data : data,
878
- success: function( response ) {
879
- ajaxSubmitComplete = true;
880
- $( 'form#post' ).submit();
881
- }
882
- } );
883
- }
884
- } );
885
-
886
- }() );
887
-
888
- } );
1
+ jQuery((function($){!function(){"use strict";$("#poststuff").trigger("ditty_init_fields"),$("#ditty-settings").ditty_settings()}()})),function($){"use strict";var t={},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_settings.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-settings__form"),this.$panels=this.$elmt.find(".ditty-settings__panels"),this.saveBtns=this.$elmt.find(".ditty-settings__save"),this.tabs=this.$elmt.find(".ditty-settings__tab"),this.$notice_update=this.$elmt.find(".ditty-notification--updated"),this.$notice_error=this.$elmt.find(".ditty-notification--error"),this.$notice_warning=this.$elmt.find(".ditty-notification--warning"),this.initData=null,this.url=window.location.href,this._init()};i.prototype={_init:function(){if(this._initSlider(),$("body").on("ditty_field_clone_update",{self:this},this._enableSettingsUpdates),this.saveBtns.on("click",{self:this},this._submitForm),this.tabs.on("click",{self:this},this._tabClick),this.$panels.on("ditty_slider_init",{self:this},this._sliderInit),this.$panels.on("ditty_slider_before_slide_update",{self:this},this._beforeSlideUpdate),this.$form.on("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.on("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.on("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.$form.on("click",".ditty-default-layout-install",{self:this},this._installLayout),this.$form.on("click",".ditty-default-display-install",{self:this},this._installDisplay),this.url.indexOf("#")>0){var t=this.url.substring(this.url.indexOf("#")+1);this._activatePanel(t)}},_initSlider:function(){var t=this.$panels.data("init_panel");this.$panels.ditty_slider({transition:"fade",transitionEase:"linear",transitionSpeed:0,heightSpeed:0,initTransition:"fade",initTransitionEase:"linear",initTransitionSpeed:0,initHeightEase:"linear",initHeightSpeed:0,touchSwipe:!1,slidesEl:".ditty-settings__panel",slideId:""!==t&&t})},_sliderInit:function(t){var i=t.data.self;i.initData=i.$form.serialize()},_beforeSlideUpdate:function(t,i,e){var s=t.data.self;s._initFields(e.$elmt),s.$elmt.find(".ditty-settings__tab").removeClass("active"),s.$elmt.find('.ditty-settings__tab[data-panel="'+e.id+'"]').addClass("active")},_enableSettingsUpdates:function(t){(t?t.data.self:this).saveBtns.addClass("has-updates")},_disableSettingsUpdates:function(){this.saveBtns.removeClass("has-updates")},_checkUpdates:function(t){var i=t?t.data.self:this;i.$form.serialize()!==i.initData?i._enableSettingsUpdates():i._disableSettingsUpdates()},_initFields:function(t){t.find(".ditty-data-list").ditty_ui_data_list(),t.trigger("ditty_init_fields"),$.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}})},_togglePostTypes:function(){if($('input[name="ditty_layout_ui"]').length){var t=$('input[name="ditty_layout_ui"]:checked').val(),i=$('#adminmenu .wp-submenu > li > a[href="edit.php?post_type=ditty_layout"]');"disabled"===t?i.hide():i.css("display","block")}if($('input[name="ditty_display_ui"]').length){var e=$('input[name="ditty_display_ui"]:checked').val(),s=$('#adminmenu .wp-submenu > li > a[href="edit.php?post_type=ditty_display"]');"disabled"===e?s.hide():s.css("display","block")}},_activatePanel:function(t){var i=this.$elmt.find('.ditty-settings__tab[data-panel="'+t+'"]');if(!i.length)return!1;this.$elmt.find(".ditty-settings__tab").removeClass("active"),i.addClass("active"),this.$panels.ditty_slider("showSlideById",t)},_tabClick:function(t){t.preventDefault();var i,e=t.data.self,s=$(t.target).is("a")?$(t.target):$(t.target).parent("a"),n=s.data("panel");if(e.$elmt.find(".ditty-settings__tab.active")===s)return!1;if(n){var a="#"+n;i=e.url.split("#")[0]+a}else i=e.url.split("#")[0];history.replaceState(null,null,i),e._activatePanel(n)},_upateInputs:function(t){$.each(t,(function(t,i){$('input[name="'+t+'"]').length&&$('input[name="'+t+'"]').val(i)}))},_submitForm:function(t){t.preventDefault();var i=t.data.self;if(i.$elmt.hasClass("updating"))return!1;i.$elmt.trigger("ditty_pre_save_fields"),i.$elmt.addClass("updating"),i.saveBtns.text(dittyAdminVars.adminStrings.settingsSaving),i.$form.ajaxSubmit({url:dittyAdminVars.ajaxurl,type:"post",dataType:"json",data:{action:"ditty_settings_save",security:dittyAdminVars.security},success:function(t){t.input_updates&&i._upateInputs(t.input_updates),i.initData=i.$form.serialize(),i.saveBtns.text(dittyAdminVars.adminStrings.settings_updated),setTimeout((function(){i.saveBtns.text(dittyAdminVars.adminStrings.settings_save)}),2e3),i.$elmt.removeClass("updating"),i._disableSettingsUpdates(),i._togglePostTypes()}})},_installLayout:function(t){t.preventDefault();var i=t.data.self,e=$(t.target).is("button")?$(t.target):$(t.target).parents("button"),s=e.find("i"),n=s.attr("class");if(e.hasClass("updating"))return!1;e.addClass("updating"),s.attr("class",dittyAdminVars.updateIcon);var a={action:"ditty_install_layout",layout_template:e.data("layout_template"),layout_version:e.data("layout_version"),security:dittyAdminVars.security};$.post(dittyAdminVars.ajaxurl,a,(function(t){s.attr("class",n),i.$elmt.removeClass("updating"),t&&e.replaceWith(t.button)}))},_installDisplay:function(t){t.preventDefault();var i=t.data.self,e=$(t.target).is("button")?$(t.target):$(t.target).parents("button"),s=e.find("i"),n=s.attr("class");if(e.hasClass("updating"))return!1;e.addClass("updating"),s.attr("class",dittyAdminVars.updateIcon);var a={action:"ditty_install_display",display_type:e.data("display_type"),display_template:e.data("display_template"),display_version:e.data("display_version"),security:dittyAdminVars.security};$.post(dittyAdminVars.ajaxurl,a,(function(t){s.attr("class",n),i.$elmt.removeClass("updating"),t&&e.replaceWith(t.button)}))},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_settings_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_settings.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){$("body").off("ditty_field_clone_update",{self:this},this._enableSettingsUpdates),this.saveBtns.off("click",{self:this},this._submitForm),this.tabs.off("click",{self:this},this._tabClick),this.$panels.off("ditty_slider_init",{self:this},this._sliderInit),this.$panels.off("ditty_slider_before_slide_update",{self:this},this._beforeSlideUpdate),this.$form.off("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.off("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.off("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.$form.off("click",".ditty-default-layout-install",{self:this},this._installLayout),this.$form.off("click",".ditty-default-display-install",{self:this},this._installDisplay),this.$panels.ditty_slider("destroy"),this.elmt._ditty_settings=null}},$.fn.ditty_settings=function(t){var e,s=arguments,n=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_settings||(this._ditty_settings=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_settings;if(!i)throw new Error("No Ditty_Settings 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_Settings.');return void 0!==e?e:this}},$.ditty_settings={},$.ditty_settings.defaults=t}(jQuery),function($){"use strict";var t={},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_extension.defaults,e),this.$elmt=$(i),this.$panels=$(i).find(".ditty-extension__panels"),this.initPanel=this.$panels.data("init_panel"),this._init()};i.prototype={_init:function(){this.$elmt.on("click",".ditty-extension__tab",{self:this},this._tabClick),this.$elmt.on("click",'button[name="submit"]',{self:this},this._updatePanel),this.$elmt.on("click",".ditty-extension__license__submit",{self:this,action:"ditty_extension_license_activate"},this._licenseUpdate),this.$elmt.on("click",".ditty-extension__license__refresh",{self:this,action:"ditty_extension_license_refresh"},this._licenseUpdate),this.$elmt.on("click",".ditty-extension__license__deactivate",{self:this,action:"ditty_extension_license_deactivate"},this._licenseUpdate),this.$panels.on("ditty_slider_before_slide_update",{self:this},this._beforePanelUpdate),this._initSlider()},_initSlider:function(){var t={transition:"fade",transitionSpeed:.75,heightSpeed:.75,touchSwipe:!1,slidesEl:".ditty-extension__panel",slideId:""!==this.initPanel&&this.initPanel};this.$panels.ditty_slider(t)},_beforePanelUpdate:function(t,i,e){var s=t.data.self;s.$elmt.find(".ditty-extension__tab").removeClass("active"),s.$elmt.find('.ditty-extension__tab[data-slide_id="'+e.id+'"]').addClass("active")},_tabClick:function(t){t.preventDefault();var i=t.data.self,e=$(this),s=e.data("slide_id"),n="slideLeft",a=i.$elmt.find(".ditty-extension__tab.active");if(a===e)return!1;e.index()<a.index()&&(n="slideRight"),i.$panels.ditty_slider("options","transition",n),i.$panels.ditty_slider("showSlideById",s)},_updatePanel:function(t){t.preventDefault();var i=t.data.self,e=$(this),s=e.parents(".ditty-extension__panel"),n=e.parents(".ditty-extension__form"),a=e.find("i"),d=a.attr("class"),l=i.$elmt.data("extension"),o=s.data("slide_id");if(i.$elmt.hasClass("updating"))return!1;i.$elmt.addClass("updating"),a.attr("class",dittyAdminVars.updateIcon),n.ajaxSubmit({url:dittyAdminVars.ajaxurl,type:"post",dataType:"json",data:{action:"ditty_extension_panel_update",extension:l,panel:o,security:dittyAdminVars.security},success:function(t){a.attr("class",d),i.$elmt.removeClass("updating"),$("#ditty-extensions").trigger("ditty_extension_panel_updated",[t,i.$elmt,s])}})},_licenseUpdate:function(t){t.preventDefault();var i=t.data.self,e=t.data.action,s=$(this),n=i.$elmt.find(".ditty-extension__license__message"),a=s.siblings(".ditty-extension__license__input"),d=a.val(),l=s.data("extension"),o=s.data("extension_id"),r=s.data("extension_name"),p=s.children("i");if(i.$elmt.hasClass("updating"))return!1;i.$elmt.addClass("updating"),p.attr("class",dittyAdminVars.updateIcon);var c={action:e,license:d,extension:l,extension_id:o,extension_name:r,security:dittyAdminVars.security};$.post(dittyAdminVars.ajaxurl,c,(function(t){t&&(i.$elmt.attr("data-license_status",t.status),n.text(t.message)),t.license_key&&("DELETE"===t.license_key?a.val(""):a.val(t.license_key)),p.attr("class",p.data("class")),i.$elmt.removeClass("updating")}),"json")},_getOption:function(t){return this.settings[t]},_setOption:function(t,i){if(void 0===i)return!1;this.settings[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("click",".ditty-extension__tab",{self:this},this._tabClick),this.$elmt.off("click",'button[name="submit"]',{self:this},this._updatePanel),this.$elmt.off("click",".ditty-extension__license__submit, .ditty-extension__license__refresh",{self:this,action:"ditty_extension_license_activate"},this._licenseUpdate),this.$elmt.off("click",".ditty-extension__license__deactivate",{self:this,action:"ditty_extension_license_deactivate"},this._licenseUpdate),this.$panels.off("ditty_slider_after_slide_update",{self:this},this._afterPanelUpdate),this.$panels.ditty_slider("destroy"),this.elmt._ditty_extension=null}},$.fn.ditty_extension=function(t){var e,s=arguments,n=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_extension||(this._ditty_extension=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_extension;if(!i)throw new Error("No Ditty_Extension 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_Extension.');return void 0!==e?e:this}},$.ditty_extension={},$.ditty_extension.defaults=t}(jQuery),jQuery((function($){!function(){"use strict";$.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),$("#ditty-extensions").find(".ditty-extension").each((function(t){var i=$(this);i.find(".ditty-extension__panels").length&&i.ditty_extension(),$("#ditty-extensions").trigger("ditty_init_fields"),setTimeout((function(){i.addClass("ditty-extension--init")}),250*t)}))}()})),jQuery((function($){!function(){"use strict";var t=$('input[name="post_type"]').length&&"ditty_display"==$('input[name="post_type"]').val(),i=!1;$("form#post").on("submit",(function(e){if(t&&!i){e.preventDefault();var s=$("#publishing-action").children('input[type="submit"]'),n=$("#publishing-action").children(".spinner");s.attr("disabled","disabled"),n.css("visibility","visible");var a={action:"ditty_admin_display_update",display_id:$('input[name="post_ID"]').val(),security:dittyAdminVars.security};$("#ditty-display-settings").ajaxSubmit({url:dittyAdminVars.ajaxurl,type:"post",dataType:"json",data:a,success:function(t){i=!0,$("form#post").submit()}})}}))}()})),jQuery((function($){!function(){"use strict";var t={};$('.ditty-wizard-setting--title input[name="ditty_title"]').on("keyup",(function(){var i=$(this).parents(".ditty-wizard-setting"),e=$(this).val();""!==e&&(i.addClass("complete"),$(".ditty-wizard-setting--item-type").css("display","flex")),t.title=e})),$(".ditty-wizard-setting--item-type .ditty-option-grid__item").on("click",(function(i){i.preventDefault();var e=$(this).parents(".ditty-wizard-setting"),s=$(this).data("value");if(!$(this).hasClass("active")){$(this).siblings().removeClass("active"),$(this).addClass("active"),$(".ditty-wizard-setting--item-type-settings").removeClass("complete"),$(".ditty-wizard-setting--item-type-settings .ditty-option-submit").addClass("ditty-button--primary"),$(".ditty-wizard-setting--item-type-settings").css("display","flex");var n=$('.ditty-item-type-settings__group[data-id="'+s+'"]');$(".ditty-item-type-settings__group").removeClass("active").hide(),n.addClass("active").show(),n.trigger("ditty_init_fields"),n.hasClass("init")||(n.trigger("ditty_wizard_init",[s]),n.addClass("init")),$(".ditty-wizard-setting--layout").removeClass("complete"),$(".ditty-wizard-setting--layout .ditty-option-grid__item").removeClass("active"),$(".ditty-wizard-setting--layout").hide(),$(".ditty-wizard-setting--layout__variation").removeClass("complete").removeClass("active").hide(),$(".ditty-wizard-setting--layout__variation."+s).addClass("active").show(),$(".ditty-wizard-setting--display").removeClass("complete"),$(".ditty-wizard-setting--display .ditty-option-grid__item").removeClass("active"),$(".ditty-wizard-setting--display").hide(),$(".ditty-wizard-setting--submit").hide(),t.itemType=$(this).data("value"),e.hasClass("complete")||(e.addClass("complete"),$([document.documentElement,document.body]).stop().animate({scrollTop:$(".ditty-wizard-setting--item-type-settings").offset().top},700))}})),$(".ditty-wizard-setting--item-type-settings .ditty-option-submit").on("click",(function(i){i.preventDefault();var e=$(this).parents(".ditty-wizard-setting"),s=e.find(".ditty-item-type-settings__group.active"),n={};$(this).removeClass("ditty-button--primary"),s.find(":input").each((function(){var t=$(this).prop("type");"checkbox"===t||"radio"===t?this.checked&&(n[$(this).attr("name")]=$(this).val()):"button"!==t&&"submit"!==t&&(n[$(this).attr("name")]=$(this).val())})),$(".ditty-wizard-setting--layout").css("display","flex"),t.itemTypeValues=n,e.hasClass("complete")||(e.addClass("complete"),$([document.documentElement,document.body]).stop().animate({scrollTop:$(".ditty-wizard-setting--layout").offset().top},700))})),$(".ditty-wizard-setting--layout .ditty-option-grid__item").on("click",(function(i){i.preventDefault();var e=$(this).parents(".ditty-wizard-setting"),s=$(this).parents(".ditty-wizard-setting--layout__variation");if(!$(this).hasClass("active")&&($(this).siblings().removeClass("active"),$(this).addClass("active"),s.addClass("complete"),$(".ditty-wizard-setting--layout__variation.active").length===$(".ditty-wizard-setting--layout__variation.complete").length)){var n={};$(".ditty-wizard-setting--layout__variation.complete").each((function(){n[$(this).data("id")]=$(this).find(".ditty-option-grid__item.active").data("value")})),$(".ditty-wizard-setting--display").css("display","flex"),t.layoutVariations=n,e.hasClass("complete")||(e.addClass("complete"),$([document.documentElement,document.body]).stop().animate({scrollTop:$(".ditty-wizard-setting--display").offset().top},700))}})),$(".ditty-wizard-setting--display .ditty-option-grid__item").on("click",(function(i){i.preventDefault();var e=$(this).parents(".ditty-wizard-setting"),s=$(this).data("value");$(this).hasClass("active")||($(this).siblings().removeClass("active"),$(this).addClass("active"),$(".ditty-wizard-setting--submit").css("display","flex"),t.display=s,e.hasClass("complete")||(e.addClass("complete"),$([document.documentElement,document.body]).stop().animate({scrollTop:$(".ditty-wizard-setting--submit").offset().top},700)))})),$("#ditty-wizard-submit").on("click",(function(i){i.preventDefault();var e=$(this).data("ditty_id");$("#ditty-wizard-overlay").addClass("active");var s={action:"ditty_submit_wizard",ditty_id:e,init_values:t,security:dittyVars.security};$.post(dittyVars.ajaxurl,s,(function(t){window.history.pushState(null,"","/wp-admin/post.php?post="+e+"&action=edit"),location.reload()}),"json")}))}()}));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/js/ditty-editor.min.js CHANGED
@@ -1,3 +1,3 @@
1
  function dittyEditorInit(t){if(!t)return!1;jQuery("#ditty-editor__settings").ditty_editor({ditty:t})}function dittyGetItemsById(t,i){var e=[];return jQuery.each(t,(function(t,s){String(s.id)===String(i)&&e.push(s)})),e}function dittyItemsReorder(t,i){var e=[];return jQuery.each(i,(function(i,s){e=jQuery.merge(e,dittyGetItemsById(t,s))})),e}function dittyDraftUpdate(t,i,e,s){var a=t.settings.editor.getDraftValues(i);return a||(a={}),e?a[e]=s:a=s,t.settings.editor.updateDraftValues(i,a)}function dittyDraftGet(t,i,e){var s=t.settings.editor.getDraftValues(i);return!!s&&(e&&s[e]?s[e]:s)}function dittyDraftDelete(t,i,e){var s=i.settings.editor.getDraftValues(t),a={};return jQuery.each(s,(function(t,i){String(e)!==String(t)&&(a[t]=i)})),"new-"!==String(e).substring(0,4)&&(a[e]="DELETE"),i.settings.editor.updateDraftValues(t,a)}function dittyDraftItemDelete(t,i){return dittyDraftDelete("items",t,i)}function dittyDraftLayoutDelete(t,i){return dittyDraftDelete("layouts",t,i)}function dittyDraftDisplayDelete(t,i){return dittyDraftDelete("displays",t,i)}function dittyDraftItemUpdateData(t,i,e,s){var a=t.settings.editor.getDraftValues("items");return a||(a={}),a[i]||(a[i]={}),a[i].data||(a[i].data={}),e?a[i].data[e]=s:a[i].data=s,t.settings.editor.updateDraftValues("items",a)}function dittyDraftItemGetData(t,i,e){var s=t.settings.editor.getDraftValues("items");return!!s[i]&&(!!s[i].data&&(e?s[i].data[e]?s[i].data[e]:void 0:s[i].data))}function dittyDraftItemUpdateMeta(t,i,e,s){var a=t.settings.editor.getDraftValues("items");return a||(a={}),a[i]||(a[i]={}),a[i].meta||(a[i].meta={}),e?a[i].meta[e]=s:a[i].meta=s,t.settings.editor.updateDraftValues("items",a)}function dittyDraftItemGetMeta(t,i,e){var s=t.settings.editor.getDraftValues("items");return!!s[i]&&(!!s[i].meta&&(e?s[i].meta[e]?s[i].meta[e]:void 0:s[i].meta))}function dittyDraftLayoutUpdate(t,i,e,s){var a=t.settings.editor.getDraftValues("layouts");return a||(a={}),a[i]||(a[i]={}),e?a[i][e]=s:a[i]=s,t.settings.editor.updateDraftValues("layouts",a)}function dittyDraftLayoutGet(t,i,e){var s=t.settings.editor.getDraftValues("layouts");return!!s[i]&&(e?s[i][e]?s[i][e]:void 0:s[i])}function dittyDraftDisplayUpdate(t,i,e,s){var a=t.settings.editor.getDraftValues("displays");return a||(a={}),a[i]||(a[i]={}),e?a[i][e]=s:a[i]=s,t.settings.editor.updateDraftValues("displays",a)}function dittyDraftDisplayGet(t,i,e){var s=t.settings.editor.getDraftValues("layouts");return!!s[i]&&(e?s[i][e]?s[i][e]:void 0:s[i])}jQuery((function($){!function(){"use strict";$("body").on("ditty_editor_before_panel_update",(function(t,i,e,s,a,d){switch(d.delayedSubmitDisable(),$.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),i){case"settings":e.hasClass("init")||e.ditty_settings_panel({editor:d});break;case"items":e.hasClass("init")?e.ditty_items_panel("panelVisible"):e.ditty_items_panel({editor:d});break;case"displays":e.find(".ditty-data-list__item").removeClass("editing"),e.hasClass("init")?e.ditty_displays_panel("panelVisible"):e.ditty_displays_panel({editor:d});break;case"item_types":e.find(".ditty-data-list__item").removeClass("editing"),e.hasClass("init")?e.ditty_item_types_panel("panelVisible"):e.ditty_item_types_panel({editor:d});break;case"item_editor":e.ditty_item_editor_panel({editor:d});break;case"display_editor":e.ditty_display_editor_panel({editor:d});break;case"layouts":"layoutHtmlEditor"!==s&&"layoutCssEditor"!==s&&e.ditty_layouts_panel({editor:d});break;case"layout_variations":e.hasClass("init")?e.ditty_layout_variations_panel("panelVisible"):e.ditty_layout_variations_panel({editor:d});break;case"layout_html_editor":e.ditty_layout_html_editor_panel({editor:d,prevPanel:s});break;case"layout_css_editor":e.ditty_layout_css_editor_panel({editor:d,prevPanel:s})}})),$("body").on("ditty_editor_panel_removed",(function(t,i,e){switch(i){case"item_editor":e.ditty_item_editor_panel&&e.ditty_item_editor_panel("destroy");break;case"display_editor":e.ditty_display_editor_panel&&e.ditty_display_editor_panel("destroy");break;case"layouts":case"layouts":e.ditty_layouts_panel&&e.ditty_layouts_panel("destroy");break;case"layout_variations":e.ditty_layout_variations_panel&&e.ditty_layout_variations_panel("destroy");break;case"layout_html_editor":e.ditty_layout_html_editor_panel&&e.ditty_layout_html_editor_panel("destroy");break;case"layout_css_editor":e.ditty_layout_css_editor_panel&&e.ditty_layout_css_editor_panel("destroy")}}))}()})),dittyEditorInit(),function($){"use strict";var t={listType:"toggle",showAll:!0,activeFilter:"*",filter:".ditty-data-list__filter",filterSelector:"filter",item:".ditty-data-list__item",itemSelector:"filter"},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_ui_data_list.defaults,e),this.$elmt=$(i),this.filters=[],this._init()};i.prototype={_init:function(){var t=this;this.$elmt.on("click",this.settings.filter,{self:this},this._filterClick),this.$elmt.find(this.settings.filter+".active").each((function(){t._filterList($(this).data(t.settings.filterSelector))})),"*"!==this.settings.activeFilter&&this._filterList(this.settings.activeFilter),setTimeout((function(){t.trigger("init")}),1)},_filterList:function(t){var i=this,e=this.filters;if("toggle"===this.settings.listType)this.filters.includes(t)?this.settings.showAll&&(this.filters=[],this.$elmt.find(this.settings.filter).removeClass("active"),this.$elmt.find(this.settings.item).show()):(this.filters=[t],this.$elmt.find(this.settings.filter).removeClass("active"),this.$elmt.find(this.settings.filter+"[data-"+this.settings.filterSelector+'="'+t+'"]').addClass("active"),this.$elmt.find(this.settings.item).hide(),this.$elmt.find(this.settings.item+"[data-"+this.settings.itemSelector+'="'+t+'"]').show());else if("filter"===this.settings.listType){if(this.$elmt.find(this.settings.item).hide(),this.filters.includes(t)){this.$elmt.find(this.settings.filter+"[data-"+this.settings.filterSelector+'="'+t+'"]').removeClass("active");for(var s=0;s<this.filters.length;s++)i.filters[s]===t&&i.filters.splice(s,1)}else this.$elmt.find(this.settings.filter+"[data-"+this.settings.filterSelector+'="'+t+'"]').addClass("active"),this.filters.push(t);$.each(this.filters,(function(t,e){i.$elmt.find(this.settings.item+"[data-"+this.settings.itemSelector+'="'+e+'"]').show()})),0===this.filters.length&&i.$elmt.find(this.settings.item).show()}e!==this.filters&&i.trigger("update")},_filterClick:function(t){t.preventDefault();var i=t.data.self,e=$(t.target);e.is("a")||(e=e.parents("a")),i._filterList(e.data(i.settings.filterSelector))},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings,this.filters];i&&(e=i),this.$elmt.trigger("ditty_ui_data_list_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_ui_data_list.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.off("click",this.settings.filter,{self:this},this._filterClick),this.trigger("destroy"),this.elmt._ditty_ui_data_list=null}},$.fn.ditty_ui_data_list=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_ui_data_list||(this._ditty_ui_data_list=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_ui_data_list;if(!i)throw new Error("No Ditty_UI_Data_List applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_UI_Data_List.');return void 0!==e?e:this}},$.ditty_ui_data_list={},$.ditty_ui_data_list.defaults=t}(jQuery),function($){"use strict";var t={screen:"admin",ditty:null,panel:""},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_editor.defaults,e),this.$elmt=$(i),this.ditty=this.settings.ditty,this.dittyId=this.settings.ditty.options("id"),this.dittyType=this.settings.ditty.options("type"),this.displayId=0,this.panelsLoaded=0,this.unsavedUpdates={},this.draftValues={},this.$overlay=null,this.$contents=null,this.$header=null,this.$update=null,this.$updateCount=null,this.$updateLabel=null,this.$tabs=null,this.$panels=null,this.currentTab=0,this.currentPanel=this.settings.panel,this.delayedSubmit=!1,this.tabs=[],this.panels=[],this.activeItems=[],this._init()};i.prototype={_init:function(){var t,i,e,s,a,d,r,o=this;t=$('<div class="ditty-editor__contents"></div>'),this.$contents=t,i=$('<div class="ditty-editor__header"></div>'),this.$header=i,e=$('<span class="ditty-editor__update__count"></span>'),this.$updateCount=e,s=$('<span class="ditty-editor__update__label">Save Ditty</span>'),this.$updateLabel=s,a=$('<button type="submit" class="ditty-editor__update ditty-button ditty-button--primary"></button>'),this.$update=a,d=$('<div class="ditty-editor__tabs"></div>'),this.$tabs=d,r=$('<div class="ditty-editor__panels"></div>'),this.$panels=r,a.prepend(e,s),i.append(a),t.append(i,d,r),this.$elmt.append(t),this.$overlay=$('<div class="ditty-updating-overlay ditty-admin-item__overlay"><div class="ditty-updating-overlay__inner"><i class="fas fa-sync-alt fa-spin"></i></div></div>'),this.$elmt.append(this.$overlay),$(document).on("postbox-moved",{self:this},this._postboxMoved),$(document).on("postboxes-columnchange",{self:this},this._postboxMoved),$(window).on("beforeunload",{self:this},this._beforeunload),this.ditty.$elmt.on("ditty_active_items_update",{self:this},this._dittyItemsUpdated),this.ditty.$elmt.on("ditty_disabled_items_update",{self:this},this._disabledItemsUpdate),this.$tabs.on("click",".ditty-editor__tab",{self:this},this._showPanel),this.$update.on("click",{self:this},this._saveClick),this.$panels.on("ditty_slider_init",{self:this},this._editorLoaded),this.$panels.on("ditty_slider_before_slide_update",{self:this},this._beforeSlideUpdate),this.$panels.on("ditty_slider_after_slide_update",{self:this},this._afterSlideUpdate),this.$panels.on("ditty_slider_slide_removed",{self:this},this._slideRemoved),this._loadContents(),this.trigger("stop_live_updates"),setTimeout((function(){o.trigger("init")}),1)},_loadContents:function(){var t=this,i={action:"ditty_editor_load_contents",ditty_id:this.dittyId,security:dittyVars.security};$.post(dittyVars.ajaxurl,i,(function(i){t._initTabs(i.tabs),t._initPanels(i.panels),t._initSlider()}),"json")},_editorLoaded:function(t){var i=t.data.self;$("body").trigger("ditty_editor_loaded",[i])},_setUpdateCount:function(){},_initSlider:function(){var t=this.tabs[0].id;this.currentPanel&&""!==this.currentPanel&&(t=this.currentPanel),this.$panels.ditty_slider({transition:"fade",transitionSpeed:.75,heightSpeed:.75,touchSwipe:!1,slides:this.panels,slideId:t})},_beforeSlideUpdate:function(t,i,e,s,a){var d=t.data.self;d.updateStart(),d._updateTab(e.id),$("body").trigger("ditty_editor_before_panel_update",[e.id,e.$elmt,a.id,a.$elmt,d])},_afterSlideUpdate:function(t,i,e,s,a){var d=t.data.self;d.updateStop(),$("body").trigger("ditty_editor_after_panel_update",[e.id,e.$elmt,a.id,a.$elmt,d])},_slideRemoved:function(t,i){var e=t.data.self;$("body").trigger("ditty_editor_panel_removed",[i.id,i.$elmt,e])},_showPanel:function(t){t.preventDefault();var i=t.data.self,e=$(t.target).is("a")?$(t.target):$(t.target).parent("a"),s=e.data("panel"),a=parseInt(e.data("index"));if(s===i.currentTab)return!1;var d=a>i.currentTab?"slideLeft":"slideRight";i.$panels.ditty_slider("options","transition",d),i.$panels.ditty_slider("showSlideById",s),i.currentTab=a,i.$elmt.trigger("ditty_editor_add_drafts")},_updateTab:function(t){var i=$('.ditty-editor__tab[data-panel="'+t+'"]');void 0!==i[0]&&($(".ditty-editor__tab").removeClass("active"),i.addClass("active"),this.currentTab=parseInt(i.data("index")))},_initTabs:function(t){var i=this,e=0;$.each(t,(function(t,s){var a=$('<a href="#" class="ditty-editor__tab ditty-editor__tab--'+t+'" data-panel="'+t+'" data-index="'+e+'"><i class="'+s.icon+'"></i><span>'+s.label+"</span></a>");i.$tabs.append(a),i.tabs.push({id:t,tab:a}),e++}))},_initPanels:function(t){var i=this;$.each(t,(function(t,e){var s='<div class="ditty-editor__panel ditty-editor__panel--'+t+'">'+e+"</div>";i.panels.push({id:t,html:s,cache:!0})}))},_initFields:function(t){t.find(".ditty-data-list").ditty_ui_data_list(),t.trigger("ditty_init_fields"),$.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}})},saveDitty:function(t){var i=this,e=i.dittyId;i.$updateLabel.text("Updating..."),i.updateStart();var s={action:"ditty_editor_save",ditty_id:e,draft_values:i.draftValues,return_items:1,security:dittyVars.security};s=$.extend({},s,t),$.post(dittyVars.ajaxurl,s,(function(t){$("body").trigger("ditty_editor_save_ditty_response",[t]),t.display_items&&i.ditty.options("items",t.display_items),i.draftValues={},i.unsavedUpdates={},i._setUpdateCount(),i.$elmt.removeClass("ditty-editor--updates-exist"),i.$updateLabel.text("Ditty Saved!"),setTimeout((function(){i.$updateLabel.text("Save Ditty")}),2e3),i.updateStop(),t.new_ditty_url&&window.history.pushState(null,"","/wp-admin/post.php?post="+e+"&action=edit")}))},_saveClick:function(t){t.preventDefault();var i=t.data.self;i.$elmt.trigger("ditty_editor_save_drafts"),i.delayedSubmit||i.saveDitty()},_dittyItemsUpdated:function(t,i,e){var s=t.data.self;s.activeItems=e,s.trigger("active_items_update")},_disabledItemsUpdate:function(t,i){var e=t.data.self;$.each(i,(function(t,i){"disabled"===i?e.$elmt.find("#ditty-editor-item--"+t).addClass("ditty-editor-item--disabled"):e.$elmt.find("#ditty-editor-item--"+t).removeClass("ditty-editor-item--disabled")}))},_postboxMoved:function(t,i){if(!window.tinymce)return!1;$(i).find(".wp-editor-area").each((function(){var t=$(this).attr("id");tinymce.execCommand("mceRemoveEditor",!0,t),tinymce.execCommand("mceAddEditor",!0,t)}))},_beforeunload:function(t){var i=t.data.self;return Object.keys(i.unsavedUpdates).length>0||void 0},_windowResize:function(t){t.preventDefault()},_options:function(t){return this.settings[t]},panelExists:function(t){var i=this.$panels.ditty_slider("options","slides"),e=!1;return $.each(i,(function(i,s){String(s.id)!==String(t)||(e=!0)})),e},showPanel:function(t,i){i&&this.$panels.ditty_slider("addSlideById",t,i),this.$panels.ditty_slider("showSlideById",t,!0)},updateExists:function(t,i){if(void 0===this.unsavedUpdates[t]&&(this.unsavedUpdates[t]=[]),-1!==$.inArray(i,this.unsavedUpdates[t]))return!0},addUpdate:function(t,i){var e=!1;return void 0===this.unsavedUpdates[t]&&(this.unsavedUpdates[t]=[]),-1===$.inArray(i,this.unsavedUpdates[t])&&(e=!0,this.unsavedUpdates[t].push(i)),this._setUpdateCount(),this.$elmt.addClass("ditty-editor--updates-exist"),e},removeUpdate:function(t,i){if(void 0===this.unsavedUpdates[t])return!1;if(-1===$.inArray(i,this.unsavedUpdates[t]))return!1;var e=!1,s=[];return $.each(this.unsavedUpdates[t],(function(t,a){String(i)===String(a)?e=!0:s.push(a)})),this.unsavedUpdates[t]=s,this._setUpdateCount(),""===this.$updateCount.text()&&this.$elmt.removeClass("ditty-editor--updates-exist"),e},updateStart:function(){this.$overlay.fadeIn()},updateStop:function(){this.$overlay.fadeOut()},initFields:function(t){this._initFields(t)},updateDraftValues:function(t,i){return this.$elmt.addClass("ditty-editor--updates-exist"),t?(this.draftValues[t]=i,"development"===dittyVars.mode&&window.console&&console.log("draftValues:",this.draftValues),this.draftValues[t]):(this.draftValues=i,"development"===dittyVars.mode&&window.console&&console.log("draftValues:",this.draftValues),this.draftValues)},getDraftValues:function(t){return t?!!this.draftValues[t]&&this.draftValues[t]:this.draftValues},delayedSubmitEnable:function(){this.delayedSubmit=!0},delayedSubmitDisable:function(){this.delayedSubmit=!1},trigger:function(t,i){var e=[];switch(t){case"active_items_update":e=[this.ditty,this.activeItems];break;case"stop_live_updates":e=[this.dittyId];break;default:e=[this.settings]}i&&(e=i),this.$elmt.trigger("ditty_editor_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e),$("body").trigger("ditty_"+t,e)},_getPanelOption:function(t){return"elmnt"===t?this.$panels:this.settings[t]},_setPanelOption:function(t,i){if(void 0===i)return!1;this.$panels.ditty_slider("options",t,i),this.trigger("update")},panelOptions:function(t,i){var e=this;if("object"==typeof t)$.each(t,(function(t,i){e._setPanelOption(t,i)}));else{if("string"!=typeof t)return e.$panels.ditty_slider("options");if(void 0===i)return e._getPanelOption(t);e._setPanelOption(t,i)}},_getOption:function(t){return"elmnt"===t?this:this.settings[t]},_setOption:function(t,i){if(void 0===i)return!1;this.settings[t]=i,this.trigger("update")},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.$panels.ditty_slider&&this.$panels.ditty_slider("destroy"),$(document).off("postbox-moved",{self:this},this._postboxMoved),$(document).off("postboxes-columnchange",{self:this},this._postboxMoved),$(window).off("beforeunload",{self:this},this._beforeunload),this.ditty.$elmt.off("ditty_active_items_update",{self:this},this._dittyItemsUpdated),this.ditty.$elmt.off("ditty_disabled_items_update",{self:this},this._disabledItemsUpdate),this.$tabs.off("click","ditty-editor__tab",{self:this},this._showPanel),this.$update.off("click",{self:this},this._saveClick),this.$panels.off("ditty_slider_init",{self:this},this._editorLoaded),this.$panels.off("ditty_slider_before_slide_update",{self:this},this._beforeSlideUpdate),this.$panels.off("ditty_slider_after_slide_update",{self:this},this._afterSlideUpdate),this.$panels.off("ditty_slider_slide_removed",{self:this},this._slideRemoved),this.trigger("destroy"),this.elmt._ditty_editor=null}},$.fn.ditty_editor=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_editor||(this._ditty_editor=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_editor;if(!i)throw new Error("No Ditty_Editor applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Editor.');return void 0!==e?e:this}},$.ditty_editor={},$.ditty_editor.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_settings_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$title=this.$elmt.find('input[name="title]'),this.$previewBg=this.$elmt.find('input[name="previewBg"]'),this.$previewPaddingTop=this.$elmt.find('input[name="previewPadding[paddingTop]"]'),this.$previewPaddingBottom=this.$elmt.find('input[name="previewPadding[paddingBottom]"]'),this.$previewPaddingLeft=this.$elmt.find('input[name="previewPadding[paddingLeft]"]'),this.$previewPaddingRight=this.$elmt.find('input[name="previewPadding[paddingRight]"]'),this.$postTitle=$(".ditty-post__title"),this.$editorPreview=$("#ditty-editor__preview"),this.dittyId=this.$form.data("ditty_id"),this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){this.initData=this.$form.serialize(),this.settings.editor.initFields(this.$elmt),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.on("submit",{self:this},this._submitForm),this.$form.on("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.on("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.on("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.$form.on("keyup change",'input[name="title"]',{self:this},this._titleChange),this.$form.on("keyup change",".ditty-field--preview_settings *",{self:this},this._previewBgChange),this.$elmt.addClass("init")},_checkUpdates:function(t){var i=t?t.data.self:this;i.$form.serialize()!==i.initData?(i.settings.editor.addUpdate("settings",i.itemId),i.settings.editor.delayedSubmitEnable()):i.settings.editor.removeUpdate("settings",i.itemId)},_titleChange:function(t){var i=t?t.data.self:this,e=$(t.target).val();i.$postTitle.text(e)},_previewBgChange:function(t){var i=t?t.data.self:this,e={backgroundColor:i.$previewBg.val(),paddingTop:i.$previewPaddingTop.val(),paddingBottom:i.$previewPaddingBottom.val(),paddingLeft:i.$previewPaddingLeft.val(),paddingRight:i.$previewPaddingRight.val()};i.$editorPreview.css(e)},_addDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_submitForm:function(t){t.preventDefault();var i=t.data.self,e=i.dittyId;i.settings.editor.updateStart();var s={action:"ditty_editor_settings_update",ditty_id:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:s,success:function(t){i.initData=i.$form.serialize(),dittyDraftUpdate(i,"settings",!1,t),i.settings.editor.delayedSubmitDisable(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty({return_items:0}),i.afterUpdateAction=""}})},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_settings_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_settings_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._addDrafts),this.$form.off("submit",{self:this},this._submitForm),this.$form.off("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.off("keyup change",'input[name="previewBg"]',{self:this},this._previewBg_cahnge),this.$form.off("keyup change",'input[name="title"]',{self:this},this._titleChange),this.$form.off("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.off("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.trigger("destroy"),this.elmt._ditty_settings_panel=null}},$.fn.ditty_settings_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_settings_panel||(this._ditty_settings_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_settings_panel;if(!i)throw new Error("No Ditty_Settings_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Settings_Panel.');return void 0!==e?e:this}},$.ditty_settings_panel={},$.ditty_settings_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_items_panel.defaults,e),this.$elmt=$(i),this.$add=$(i).find(".ditty-editor-options__add"),this.$contents=$(i).find(".ditty-editor__panel__contents"),this.$list=$(i).find(".ditty-data-list"),this.$listItems=$(i).find(".ditty-data-list__items"),this.isEmptyTicker=!1,this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.settings.editor.$elmt.on("ditty_editor_active_items_update",{self:this},this._dittyActiveItemsUpdated),this.$add.on("click",{self:this},this._add_item),this.$elmt.on("click",".ditty-data-list__item",{self:this},this._showItem),this.$elmt.on("click",".ditty-data-list__item__icon",{self:this},this._editType),this.$elmt.on("click",".ditty-data-list__item__edit",{self:this},this._editItem),this.$elmt.on("click",".ditty-data-list__item__layout",{self:this},this._editLayoutVariations),this.$elmt.on("click",".ditty-data-list__item__clone",{self:this},this._cloneItem),this.$elmt.on("click",".ditty-data-list__item__delete",{self:this},this._deleteItem),this.$list.on("click",".ditty-editor-item > a",{self:this},this._actionClick),$("body").on("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),1>this.$elmt.find(".ditty-data-list__item").length&&(this.isEmptyTicker=!0,this.$add.trigger("click")),this._initializeSorting(),this._highlightListItems(this.settings.editor.activeItems)},dittyUpdateSavedDraftLayouts:function(t,i){$.each($(".ditty-editor-item"),(function(){var e=$(this).data("layout_value");$.each(e,(function(s,a){String(a)===String(t)&&(e[s]=String(i))})),$(this).attr("data-layout_value",e).data("layout_value",e)}))},_dittyEditorSaveResponse:function(t,i){var e=t.data.self;i.ditty_new_item_ids&&$.each(i.ditty_new_item_ids,(function(t,i){var e=$("#ditty-editor-item--"+t);e.length&&(e.attr("id","ditty-editor-item--"+i),e.attr("data-item_id",i).data("item_id",i))})),i.ditty_new_layout_ids&&$.each(i.ditty_new_layout_ids,(function(t,i){e.dittyUpdateSavedDraftLayouts(t,i)}))},_highlightListItem:function(t){var i=t.id+"";i=i.split("_"),this.$elmt.find("#ditty-editor-item--"+i[0]).addClass("active")},_highlightListItems:function(t){this.$elmt.find(".ditty-data-list__item").removeClass("active");var i=this;Array.isArray(t)?$.each(t,(function(t,e){i._highlightListItem(e)})):i._highlightListItem(t)},_dittyActiveItemsUpdated:function(t,i,e){t.data.self._highlightListItems(e)},_initializeSorting:function(){var t=this;this.$listItems.sortable({handle:".ditty-data-list__item__move",items:".ditty-data-list__item",axis:"y",start:function(t,i){$(i.item).addClass("ditty-data-list__item--moving")},stop:function(i,e){$(e.item).removeClass("ditty-data-list__item--moving"),t.settings.editor.addUpdate("item_order",t.settings.editor.dittyId)},update:function(){t._updateItemIndexes("updateDitty")}})},_showItem:function(t){t.preventDefault();var i=t.data.self;if(!$(t.target).is("a")&&!$(t.target).parent().is("a")){var e=($(t.target).is(".ditty-data-list__item")?$(t.target):$(t.target).parents(".ditty-data-list__item")).data("item_id");i.settings.editor.ditty.showItem(e)}},_actionClick:function(t){t.preventDefault();var i=t.data.self,e=$(t.target).is("a")?$(t.target):$(t.target).parent("a"),s=e.parents(".ditty-data-list__item"),a=s.data("ditty_id"),d=s.data("item_id");dittyVars.editor.currentItem=s,$("body").trigger("ditty_editor_item_action_click",[e,s,d,a,i.settings.editor])},_editType:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item");e.trigger("click"),e.addClass("editing"),i.settings.editor.updateStart(),i.settings.editor.panelOptions("transition","slideRight"),i.settings.editor.showPanel("item_types")},_editItem:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("item_id");e.trigger("click"),e.addClass("editing"),i.settings.editor.updateStart();var a={action:"ditty_editor_item_fields",item_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t){var e='<div class="ditty-editor__panel ditty-editor__panel--item_editor">'+t+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel("item_editor",e)}}))},_editLayoutVariations:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("item_type"),a=e.data("layout_value"),d=e.find(".ditty-data-list__item__label").html();e.trigger("click"),e.addClass("editing"),i.settings.editor.updateStart();var r={action:"ditty_editor_layout_variations",ditty_id:i.settings.editor.dittyId,item_type:s,item_label:d,layout_value:a,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,r,(function(t){if(t){var e='<div class="ditty-editor__panel ditty-editor__panel--layout-variations">'+t+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel("layout_variations",e)}}))},_add_item:function(t){t.preventDefault();var i=t.data.self,e={action:"ditty_editor_item_add",ditty_id:i.settings.editor.dittyId,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,e,(function(t){if(t.display_items){if(i.isEmptyTicker){var e=i.settings.editor.ditty.options("items");$.each(e,(function(t,e){i.settings.editor.ditty.deleteItem(e.id)})),i.isEmptyTicker=!1}$.each(t.display_items,(function(t,e){i.settings.editor.ditty.addItem(e,0)}))}if(t.editor_item){var s=$(t.editor_item);s.hide(),i.$listItems.prepend(s),s.slideDown(),i._updateItemIndexes()}t.draft_id&&t.draft_data&&dittyDraftItemUpdateData(i,t.draft_id,null,t.draft_data),t.draft_id&&t.draft_meta&&dittyDraftItemUpdateMeta(i,t.draft_id,null,t.draft_meta)}),"json")},_cloneItem:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("item_id");i.settings.editor.updateStart();var a={action:"ditty_editor_item_clone",item_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t.display_items&&t.display_items.length&&i.settings.editor.ditty.updateItems(t.display_items,s,"after"),t.editor_item){var a=$(t.editor_item);a.hide(),e.after(a),a.slideDown(),i._updateItemIndexes()}t.draft_id&&t.draft_data&&dittyDraftItemUpdateData(i,t.draft_id,null,t.draft_data),t.draft_id&&t.draft_meta&&dittyDraftItemUpdateMeta(i,t.draft_id,null,t.draft_meta),i.settings.editor.updateStop()}),"json")},_deleteItem:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("item_id");1>=i.$elmt.find(".ditty-data-list__item").length&&i.$add.trigger("click"),e.slideUp((function(){$(this).remove()})),i.settings.editor.ditty.deleteItem(s),dittyDraftItemDelete(i,s)},_updateItemIndexes:function(t){var i=this,e=[];if(this.$elmt.find(".ditty-data-list__item").each((function(t){var s=$(this).data("item_id");e.push(s),dittyDraftItemUpdateData(i,s,"item_index",t)})),"updateDitty"===t){var s=dittyItemsReorder(i.settings.editor.ditty.options("items"),e);i.settings.editor.ditty.options("items",s)}},panelVisible:function(){this.$elmt.find(".ditty-data-list__item").removeClass("editing")},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_items_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_items_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.settings.editor.$elmt.off("ditty_editor_active_items_update",{self:this},this._dittyActiveItemsUpdated),this.$add.off("click",{self:this},this._add_item),this.$elmt.off("click",".ditty-data-list__item",{self:this},this._showItem),this.$elmt.off("click",".ditty-data-list__item__icon",{self:this},this._editType),this.$elmt.off("click",".ditty-data-list__item__edit",{self:this},this._editItem),this.$elmt.off("click",".ditty-data-list__item__layout",{self:this
2
- },this._editLayoutVariations),this.$elmt.off("click",".ditty-data-list__item__clone",{self:this},this._cloneItem),this.$elmt.off("click",".ditty-data-list__item__delete",{self:this},this._deleteItem),this.$list.off("click",".ditty-editor-item > a",{self:this},this._actionClick),$("body").off("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),this.trigger("destroy"),this.elmt._ditty_items_panel=null}},$.fn.ditty_items_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_items_panel||(this._ditty_items_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_items_panel;if(!i)throw new Error("No Ditty_Items_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Items_Panel.');return void 0!==e?e:this}},$.ditty_items_panel={},$.ditty_items_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_item_types_panel.defaults,e),this.$elmt=$(i),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$editorItem=this.settings.editor.$panels.find(".ditty-editor__panel--items").find(".ditty-data-list__item.editing"),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.currentType=null,this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.settings.editor.initFields(this.$elmt),this.$back.on("click",{self:this},this._backClick),this.$elmt.on("click",".ditty-editor-item-type",{self:this},this._typeClick),this.panelVisible()},_showItemsList:function(){this.settings.editor.panelOptions("transition","slideLeft"),this.settings.editor.showPanel("items")},_backClick:function(t){t.preventDefault(),t.data.self._showItemsList()},_typeClick:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is(".ditty-editor-item-type")?$(t.target):$(t.target).parents(".ditty-editor-item-type")).data("item_type");if(e===i.currentType)i._showItemsList();else{i.settings.editor.updateStart();var s={action:"ditty_editor_item_type_update",item_id:i.editorItemId,item_type:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,s,(function(t){if(t.display_items&&i.settings.editor.ditty.updateItems(t.display_items,i.editorItemId),t.editor_item){var e=$(t.editor_item);i.$editorItem.after(e),i.$editorItem.remove(),i.$editorItem=e}t.draft_id&&t.draft_data&&dittyDraftItemUpdateData(i,t.draft_id,null,t.draft_data),i._showItemsList(),i.settings.editor.updateStop()}),"json")}},panelVisible:function(){this.$editorItem=this.settings.editor.$panels.find(".ditty-editor__panel--items").find(".ditty-data-list__item.editing"),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.currentType=this.$editorItem.data("item_type"),this.$elmt.find(".ditty-editor-item-type").removeClass("active"),this.$elmt.find('.ditty-editor-item-type[data-item_type="'+this.currentType+'"]').addClass("active")},panelHidden:function(){var t=this.$editorItem.find(".ditty-data-list__item__icon").children("i");t.attr("class",t.data("class"))},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_item_types_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_item_types_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.$back.off("click",{self:this},this._backClick),this.$elmt.off("click",".ditty-editor-item-type",{self:this},this._typeClick),this.trigger("destroy"),this.elmt._ditty_item_types_panel=null}},$.fn.ditty_item_types_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_item_types_panel||(this._ditty_item_types_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_item_types_panel;if(!i)throw new Error("No Ditty_Item_Types_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Item_Types_Panel.');return void 0!==e?e:this}},$.ditty_item_types_panel={},$.ditty_item_types_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_item_editor_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$preview=this.$elmt.find(".ditty-editor-options__preview"),this.$title=this.$elmt.find(".ditty-editor-options__title"),this.itemId=this.$form.data("item_id"),this.itemType=this.$form.data("item_type"),this.dittyId=this.$form.data("ditty_id"),this.$editorItem=this.settings.editor.$panels.find(".ditty-editor__panel--items").find(".ditty-data-list__item.editing"),this.$editorItemTitle=this.$editorItem.find(".ditty-data-list__item__label"),this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){var t=this;this.initData=this.$form.serialize(),this.settings.editor.initFields(this.$elmt),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.on("submit",{self:this},this._submitForm),this.$back.on("click",{self:this},this._backClick),this.$preview.on("click",{self:this},this._previewClick),this.$form.on("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.on("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.on("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.$form.on("ditty_field_update",".ditty-field__input",{self:this},this._checkUpdates),setTimeout((function(){t.trigger("init",[t])}),1)},_showItemList:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById","items")},_enablePreviewButton:function(){this.$preview.addClass("ditty-has-updates")},_disablePreviewButton:function(){this.$preview.removeClass("ditty-has-updates"),this.$preview.children("i").attr("class",this.$preview.children("i").data("class"))},_checkUpdates:function(t){var i=t?t.data.self:this;i.$form.serialize()!==i.initData?(i._enablePreviewButton(),i.settings.editor.addUpdate("item_settings",i.itemId),i.settings.editor.delayedSubmitEnable()):(i._disablePreviewButton(),i.settings.editor.removeUpdate("item_settings",i.itemId))},_addDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_backClick:function(t){t.preventDefault();var i=t.data.self;i.$form.serialize()===i.initData?i._showItemList():(i.afterUpdateAction="return",i.$form.trigger("submit"))},_previewClick:function(t){t.preventDefault();var i=t.data.self;i.$form.serialize()!==i.initData&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit"))},_submitForm:function(t){t.preventDefault();var i=t.data.self,e=i.itemId;i.settings.editor.updateStart();var s={action:"ditty_editor_item_update",item_id:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:s,error:function(){},success:function(t){if(t.value_updates&&i._updateValues(t.value_updates),i.initData=i.$form.serialize(),i._disablePreviewButton(),t.display_items&&i.settings.editor.ditty.updateItems(t.display_items,e),t.editor_item){var s=$(t.editor_item).children(".ditty-data-list__item__label").text();i.$title.html(s),i.$editorItemTitle.html(s)}t.draft_id&&t.draft_data&&dittyDraftItemUpdateData(i,t.draft_id,null,t.draft_data),t.draft_id&&t.draft_meta&&dittyDraftItemUpdateMeta(i,t.draft_id,null,t.draft_meta),i.settings.editor.updateStop(),i.settings.editor.delayedSubmitDisable(),"return"===i.afterUpdateAction&&i._showItemList(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty({return_items:0}),i.afterUpdateAction=""}})},_updateValues:function(t){var i=this;$.each(t,(function(t,e){var s=i.$form.find('[name="'+t+'"]');s.length&&s.val(e)}))},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_item_editor_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_item_editor_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._saveDrafts),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.off("submit",{self:this},this._submitForm),this.$back.off("click",{self:this},this._backClick),this.$preview.off("click",{self:this},this._previewClick),this.$form.off("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.off("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.off("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.$form.off("ditty_field_update",".ditty-field__input",{self:this},this._checkUpdates),this.elmt._ditty_item_editor_panel=null}},$.fn.ditty_item_editor_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_item_editor_panel||(this._ditty_item_editor_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_item_editor_panel;if(!i)throw new Error("No Ditty_Item_Editor_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Item_Editor_Panel.');return void 0!==e?e:this}},$.ditty_item_editor_panel={},$.ditty_item_editor_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_displays_panel.defaults,e),this.$elmt=$(i),this.$list=$(i).find(".ditty-data-list__items"),this.$contents=$(i).find(".ditty-editor__panel__contents"),this.initDisplay=null,this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.$elmt.ditty_ui_data_list({filter:".ditty-display-panel__filter",item:".ditty-editor-display",itemSelector:"display_type"}),this.initDisplay=this.$list.data("active"),this._activateDisplay(this.$list.find("#ditty-editor-display--"+this.initDisplay)),this.$elmt.on("click",".ditty-data-list__item",{self:this},this._selectDisplay),this.$elmt.on("click",".ditty-data-list__item__edit",{self:this},this._editDisplay),this.$elmt.on("click",".ditty-data-list__item__clone",{self:this},this._cloneDisplay),this.$elmt.on("click",".ditty-data-list__item__delete",{self:this},this._deleteDisplay),this.settings.editor.$elmt.on("ditty_editor_saveDrafts",{self:this},this._saveDrafts)},_saveDrafts:function(t){var i=t.data.self;i.initDisplay=i.$list.find(".ditty-editor-display.active").data("display_id")},_activateDisplay:function(t){this.$list.find(".ditty-editor-display").removeClass("active"),t.addClass("active")},_initDitty:function(t,i,e){var s=this.settings.editor.ditty.$elmt;e.display=i,e.id=this.settings.editor.ditty.options("id"),e.items=this.settings.editor.ditty.options("items"),e.height=this.settings.editor.ditty.options("height"),this.settings.editor.ditty.destroy(),s["ditty_"+t](e),this.settings.editor.ditty=s["ditty_"+t]("options","ditty")},_selectDisplay:function(t){t.preventDefault();var i=t.data.self;if($(t.target).parent().is("a"))return!1;var e=$(t.target).is(".ditty-data-list__item")?$(t.target):$(t.target).parents(".ditty-data-list__item"),s=e.data("display_id"),a=e.data("display_type");if(e.hasClass("active"))return!1;i.settings.editor.updateStart(),dittyDraftUpdate(i,"post_meta","_ditty_display",s),i._activateDisplay(e);var d={action:"ditty_editor_select_display",display_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,d,(function(t){if(!t)return!1;i._initDitty(a,s,t),i.settings.editor.updateStop()}),"json")},_cloneDisplay:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("display_id");i.settings.editor.updateStart();var a={action:"ditty_editor_display_clone",display_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t.editor_display){var s=$(t.editor_display);s.hide(),e.after(s),s.slideDown()}t.draft_id&&t.draft_data&&dittyDraftDisplayUpdate(i,t.draft_id,null,t.draft_data),i.settings.editor.updateStop()}),"json")},_deleteDisplay:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=null,a=e.data("display_id");e.hasClass("active")&&(e.prev().length?s=e.prev():e.next().length&&(s=e.next())),e.slideUp((function(){$(this).remove()})),dittyDraftDisplayDelete(i,a),null!==s&&s.trigger("click")},_editDisplay:function(t){t.preventDefault();var i=t.data.self;i.$displayEdit=$(this).parents(".ditty-data-list__item");var e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("display_id");i.settings.editor.updateStart(),e.addClass("editing");var a={action:"ditty_editor_display_fields",display_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t){var e='<div class="ditty-editor__panel ditty-editor__panel--displayEditor">'+t+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel("display_editor",e)}}))},panelVisible:function(){this.$elmt.find(".ditty-data-list__item").removeClass("editing")},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_displays_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_displays_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.$elmt.ditty_ui_data_list("destroy"),this.$elmt.off("click",".ditty-data-list__item",{self:this},this._selectDisplay),this.$elmt.off("click",".ditty-data-list__item__edit",{self:this},this._editDisplay),this.$elmt.off("click",".ditty-data-list__item__clone",{self:this},this._cloneDisplay),this.$elmt.off("click",".ditty-data-list__item__delete",{self:this},this._deleteDisplay),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.trigger("destroy"),this.elmt._ditty_displays_panel=null}},$.fn.ditty_displays_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_displays_panel||(this._ditty_displays_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_displays_panel;if(!i)throw new Error("No Ditty_Displays_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Displays_Panel.');return void 0!==e?e:this}},$.ditty_displays_panel={},$.ditty_displays_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_display_editor_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$optionsTitle=this.$elmt.find(".ditty-editor-options__title"),this.$importExportField=this.$elmt.find(".ditty-editor__import-export__field"),this.$importExportUpdate=this.$elmt.find(".ditty-editor__import-export__update"),this.displayTitle=null,this.displayId=this.settings.editor.ditty.options("display"),this.displayType=this.settings.editor.ditty.options("type"),this.$editorDisplay=this.settings.editor.$panels.find(".ditty-editor__panel--displays").find(".ditty-data-list__item.editing"),this.$editorDisplayTitle=this.$editorDisplay.find(".ditty-data-list__item__label"),this.displayOptions=null,this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){var t,i=this;this.initData=this.$form.serialize(),this.settings.editor.initFields(this.$elmt),t=this.settings.editor.ditty.$elmt["ditty_"+this.displayType]("options"),this.displayOptions=$.extend({},t),this.displayTitle=this.$optionsTitle.val(),this.$importExportUpdate.on("click",{self:this},this._importUpdate),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.on("submit",{self:this},this._submitForm),this.$back.on("click",{self:this},this._backClick),this.$elmt.on("change",'input[type="text"], input[type="number"]',{self:this},this._textfieldListeners),this.$form.on("click",'input[type="radio"]',{self:this},this._radioListeners),this.$form.on("click",'input[type="checkbox"]',{self:this},this._checkboxListeners),this.$form.on("change","select",{self:this},this._selectListeners),this.$form.on("ditty_field_clone_update",{self:this},this._cloneListeners),setTimeout((function(){i.trigger("init",[i])}),1)},_showDisplayList:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById","displays")},_checkUpdates:function(){this.$form.serialize()!==this.initData?(this.settings.editor.addUpdate("displaySettings",this.displayId),this.settings.editor.delayedSubmitEnable()):this.settings.editor.removeUpdate("displaySettings",this.displayId)},_addDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_backClick:function(t){t.preventDefault();var i=t.data.self;i.$form.serialize()===i.initData?i._showDisplayList():(i.afterUpdateAction="return",i.$form.trigger("submit"))},_submitForm:function(t){t.preventDefault();var i=t.data.self;i.settings.editor.updateStart();var e={action:"ditty_editor_display_update",display_id:i.displayId,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:e,success:function(t){i.initData=i.$form.serialize(),t.draft_id&&t.draft_label&&(i.displayTitle=t.draft_label,i.$editorDisplayTitle.text(t.draft_label),dittyDraftDisplayUpdate(i,t.draft_id,"label",t.draft_label)),t.draft_id&&t.draft_settings&&(i.displayOptions=t.draft_settings,dittyDraftDisplayUpdate(i,t.draft_id,"settings",t.draft_settings)),t.draft_settings_json&&i.$importExportField.length&&i.$importExportField.val(t.draft_settings_json),i.settings.editor.updateStop(),i.settings.editor.delayedSubmitDisable(),"return"===i.afterUpdateAction&&i._showDisplayList(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty(),i.afterUpdateAction=""}})},_importUpdate:function(t){t.preventDefault()},_cloneListeners:function(t,i,e){var s=t.data.self;$(t.target);s.settings.editor.ditty.options(e,i)},_textfieldListeners:function(t){var i=t.data.self,e=$(t.target),s=e.attr("name"),a=e.parents(".ditty-input--spacing__group, .ditty-input--radius__group");if(a.length){var d="",r={};a.find("input").each((function(){s=$(this).attr("name"),d=(d=s.split("["))[0];var t=s.match(/\[(.*)\]/);r[t[1]]=$(this).val()})),i.settings.editor.ditty.options(d,r)}else i.settings.editor.ditty.options(s,e.val());i._checkUpdates()},_radioListeners:function(t){var i=t.data.self,e=$(t.target),s=e.val(),a=e.attr("name");i.settings.editor.ditty.options(a,s),i._checkUpdates()},_checkboxListeners:function(t){var i=t.data.self,e=$(t.target),s=!!e.is(":checked")&&$(this).val(),a=e.attr("name");i.settings.editor.ditty.options(a,s),i._checkUpdates()},_selectListeners:function(t){var i=t.data.self,e=$(t.target),s=e.val(),a=e.attr("name");i.settings.editor.ditty.options(a,s),i._checkUpdates()},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_display_editor_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_display_editor_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.trigger("destroy",[this]),this.$importExportUpdate.off("click",{this:this},this._importUpdate),this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.off("submit",{this:this},this._submitForm),this.$back.off("click",{this:this},this._cancel_click),this.$elmt.off("change",'input[type="text"], input[type="number"]',{self:this},this._textfieldListeners),this.$form.off("click",'input[type="radio"]',{self:this},this._radioListeners),this.$form.off("click",'input[type="checkbox"]',{self:this},this._checkboxListeners),this.$form.off("change","select",{self:this},this._selectListeners),this.$form.off("ditty_field_clone_update",{self:this},this._cloneListeners),this.elmt._ditty_display_editor_panel=null}},$.fn.ditty_display_editor_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_display_editor_panel||(this._ditty_display_editor_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_display_editor_panel;if(!i)throw new Error("No Ditty_Display_Editor_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Display_Editor_Panel.');return void 0!==e?e:this}},$.ditty_display_editor_panel={},$.ditty_display_editor_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_layout_variations_panel.defaults,e),this.$elmt=$(i),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$list=$(i).find(".ditty-data-list__items"),this.$editorItem=dittyVars.editor.currentItem,this.editorItemLabel=this.$editorItem.find(".ditty-data-list__item__label").text(),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.editorItemType=this.$editorItem.data("item_type"),this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.$back.on("click",{self:this},this._backClick),this.$elmt.on("click",".ditty-layout-variation__change",{self:this},this._changeTemplate),this.$elmt.on("click",".ditty-layout-variation__edit_html",{self:this,editType:"html"},this._editLayout),this.$elmt.on("click",".ditty-layout-variation__edit_css",{self:this,editType:"css"},this._editLayout),$("body").on("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse)},_showItemList:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById","items")},_backClick:function(t){t.preventDefault(),t.data.self._showItemList()},_dittyEditorSaveResponse:function(t,i){t.data.self;i.ditty_new_layout_ids&&$.each(i.ditty_new_layout_ids,(function(t,i){var e=$('.ditty-layout-variation[data-layout_id="'+t+'"]');e.length&&e.attr("data-layout_id",i).data("layout_id",i)}))},_changeTemplate:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("layout_id"),a=e.data("layout_variation_id"),d=e.data("layout_variation_label");dittyVars.editor.currentLayoutVariation=e,i.settings.editor.updateStart(),e.addClass("editing");var r={action:"ditty_editor_layouts",ditty_id:i.editorDittyId,item_type:i.editorItemType,variation_id:a,variation_label:d,layout_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,r,(function(t){if(t){var e='<div class="ditty-editor__panel ditty-editor__panel--layouts">'+t+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel("layouts",e)}}))},_editLayout:function(t){t.preventDefault();var i=t.data.self,e=t.data.editType,s=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),a=s.data("layout_id"),d=s.data("item_type");dittyVars.editor.currentLayoutVariation=s,i.settings.editor.updateStart(),i.$list.find(".ditty-data-list__item").removeClass("editing"),s.addClass("editing");var r=[],o=i.settings.editor.ditty.options("items");$.each(o,(function(t,i){r.push(i.uniqId)}));var n={action:"ditty_editor_layout_fields",layout_id:a,item_type:d,item_value:i.$editorItem.data("item_value"),ditty_id:i.editorDittyId,item_id:i.editorItemId,item_ids:r,edit_type:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,n,(function(t){if(t){var s="layout_"+e+"_editor",a='<div class="ditty-editor__panel ditty-editor__panel--'+s+'">'+t.form+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel(s,a)}}),"json")},panelVisible:function(){this.$list.find(".ditty-layout-variation").removeClass("editing")},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_layout_variations_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_layout_variations_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.$back.off("click",{self:this},this._backClick),this.$elmt.off("click",".ditty-layout-variation__change",{self:this},this._changeTemplate),this.$elmt.off("click",".ditty-layout-variation__edit_html",{self:this,editType:"html"},this._editLayout),this.$elmt.off("click",".ditty-layout-variation__edit_css",{self:this,editType:"css"},this._editLayout),$("body").off("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),this.elmt._ditty_layout_variations_panel=null}},$.fn.ditty_layout_variations_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_layout_variations_panel||(this._ditty_layout_variations_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_layout_variations_panel;if(!i)throw new Error("No Ditty_Layout_Variations_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Layout_Variations_Panel.');return void 0!==e?e:this}},$.ditty_layout_variations_panel={},$.ditty_layout_variations_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_layouts_panel.defaults,e),this.$elmt=$(i),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$list=$(i).find(".ditty-data-list__items"),this.$editorItem=dittyVars.editor.currentItem,this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.editorItemtype=this.$editorItem.data("item_type"),this.$editorVariation=dittyVars.editor.currentLayoutVariation,this.editorVariationId=this.$editorVariation.data("layout_variation_id"),this.editorLayoutId=this.$editorVariation.data("layout_id"),this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.$back.on("click",{self:this},this._backClick),this.$elmt.on("click",".ditty-data-list__item",{self:this},this._selectLayout),this.$elmt.on("click",".ditty-data-list__item__edit_html",{self:this,editType:"html"},this._editLayout),this.$elmt.on("click",".ditty-data-list__item__edit_css",{self:this,editType:"css"},this._editLayout),this.$elmt.on("click",".ditty-data-list__item__clone",{self:this},this._cloneLayout),this.$elmt.on("click",".ditty-data-list__item__delete",{self:this},this._deleteLayout),this.$list.on("click",".ditty-editor-layout > a",{self:this},this._actionClick),$("body").on("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),this._activateLayout(this.$list.find("#ditty-editor-layout--"+this.editorLayoutId))},_activateLayout:function(t){this.$list.find(".ditty-editor-layout").removeClass("active"),t.addClass("active")},_showVariationsList:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById","layout_variations")},_backClick:function(t){t.preventDefault(),t.data.self._showVariationsList()},_dittyEditorSaveResponse:function(t,i){t.data.self;i.ditty_new_layout_ids&&$.each(i.ditty_new_layout_ids,(function(t,i){var e=$("#ditty-editor-layout--"+t);e.length&&(e.attr("id","ditty-editor-layout--"+i),e.attr("data-layout_id",i).data("layout_id",i))}))},_selectLayout:function(t){t.preventDefault();var i=t.data.self;if($(t.target).parent().is("a"))return!1;var e=$(t.target).is(".ditty-data-list__item")?$(t.target):$(t.target).parents(".ditty-data-list__item"),s=e.data("layout_id"),a=e.data("layout_version"),d=i.$editorItem.data("layout_value");if(e.hasClass("active"))return!1;$.each(d,(function(t){i.editorVariationId===t&&(d[t]=String(s))})),i.settings.editor.updateStart(),dittyDraftItemUpdateData(i,i.editorItemId,"layout_value",d),i._activateLayout(e);var r={action:"ditty_editor_select_layout",layout_id:s,item_id:i.editorItemId,ditty_id:i.editorDittyId,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,r,(function(t){if(i.settings.editor.updateStop(),t.display_items&&i.settings.editor.ditty.updateItems(t.display_items,i.editorItemId),t.editor_item){var e=$(t.editor_item);i.$editorItem.replaceWith(e)}i.$editorItem.attr("data-layout_value",d).data("layout_value",d),i.$editorVariation.attr("data-layout_id",s).data("layout_id",s),i.$editorVariation.find(".ditty-layout-variation__template > span").text(t.layout_label),a?i.$editorVariation.find(".ditty-layout-variation__template > small").text("("+a+")"):i.$editorVariation.find(".ditty-layout-variation__template > small").text("")}),"json")},_cloneLayout:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("layout_id");i.settings.editor.updateStart();var a={action:"ditty_editor_layout_clone",layout_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t.editor_layout){var s=$(t.editor_layout)
3
- ;s.hide(),e.after(s),s.slideDown()}t.draft_id&&t.draft_meta&&dittyDraftLayoutUpdate(i,t.draft_id,null,t.draft_meta),i.settings.editor.updateStop()}),"json")},_deleteLayout:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=null,a=e.data("layout_id");e.hasClass("active")&&(e.prev().length?s=e.prev():e.next().length&&(s=e.next())),e.slideUp((function(){$(this).remove()})),dittyDraftLayoutDelete(i,a),null!==s&&s.trigger("click")},_editLayout:function(t){t.preventDefault();var i=t.data.self,e=t.data.editType,s=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),a=s.data("layout_id");i.settings.editor.updateStart(),i.$list.find(".ditty-data-list__item").removeClass("editing"),s.addClass("editing");var d={action:"ditty_editor_layout_fields",layout_id:a,item_id:i.editorItemId,edit_type:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,d,(function(t){if(t){var s="layout_"+e+"_editor",a='<div class="ditty-editor__panel ditty-editor__panel--'+s+'">'+t.form+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel(s,a)}}),"json")},_actionClick:function(t){t.preventDefault();var i=t.data.self,e=$(t.target).is("a")?$(t.target):$(t.target).parent("a"),s=e.parents(".ditty-data-list__item"),a=s.data("layout_id");dittyVars.editor.currentLayout=s,$("body").trigger("ditty_editor_layout_action_click",[e,s,a,i.editorDittyId,i.settings.editor])},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_layouts_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_layouts_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.$back.off("click",{self:this},this._backClick),this.$elmt.off("click",".ditty-data-list__item",{self:this},this._selectLayout),this.$elmt.off("click",".ditty-data-list__item__edit_html",{self:this,editType:"html"},this._editLayout),this.$elmt.off("click",".ditty-data-list__item__edit_css",{self:this,editType:"css"},this._editLayout),this.$elmt.off("click",".ditty-data-list__item__clone",{self:this},this._cloneLayout),this.$elmt.off("click",".ditty-data-list__item__delete",{self:this},this._deleteLayout),this.$list.off("click",".ditty-editor-layout > a",{self:this},this._actionClick),$("body").off("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),this.elmt._ditty_layouts_panel=null}},$.fn.ditty_layouts_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_layouts_panel||(this._ditty_layouts_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_layouts_panel;if(!i)throw new Error("No Ditty_Layouts_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Layouts_Panel.');return void 0!==e?e:this}},$.ditty_layouts_panel={},$.ditty_layouts_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null,prevPanel:""},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_layout_html_editor_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$textarea=this.$elmt.find(".ditty-editor-options__code"),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$preview=this.$elmt.find(".ditty-editor-options__preview"),this.$editCss=this.$elmt.find(".ditty-editor-options__edit-css"),this.$title=this.$elmt.find(".ditty-editor-options__title"),this.$tags=this.$elmt.find(".ditty-editor-options__tags"),this.itemType=this.$form.data("item_type"),this.layoutId=this.$form.data("layout_id"),this.$editorItem=dittyVars.editor.currentItem,this.$editorLayout=dittyVars.editor.currentLayout,this.$editorLayoutTitle=!!this.$editorLayout&&this.$editorLayout.find(".ditty-data-list__item__label"),this.$editorLayoutVariation=dittyVars.editor.currentLayoutVariation,this.$editorLayoutVariationTitle=this.$editorLayoutVariation.find(".ditty-layout-variation__template span"),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.codeEditor=null,this.codeHasUpdates=!1,this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){this.initData=this.$form.serialize(),this._initEditor(),this.$back.on("click",{self:this},this._backClick),this.$preview.on("click",{self:this},this._previewClick),this.$editCss.on("click",{self:this},this._editCss),this.$form.on("submit",{self:this},this._submitForm),this.$form.on("click",".ditty-editor-options__tag",{self:this},this._insertTag),this.$title.on("keyup",{self:this},this._titleUpdate),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts)},_showPrevPanel:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById",this.settings.prevPanel)},_titleUpdate:function(t){var i=t.data.self;i.settings.editor.addUpdate("layoutUpdate",i.layoutId)},_enablePreviewButton:function(){this.$preview.addClass("ditty-has-updates")},_disablePreviewButton:function(){this.$preview.removeClass("ditty-has-updates"),this.$preview.children("i").attr("class",this.$preview.children("i").data("class"))},_getLayoutItems:function(){var t=this.settings.editor.ditty.options("items"),i=[];return $.each(t,(function(t,e){String(e.layoutId)===String(this.layoutId)&&i.push(e.id)})),i},_addDrafts:function(t){var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_backClick:function(t){t.preventDefault();var i=t.data.self;i.codeEditor.codemirror.save(),i.$form.serialize()!==i.initData||i.codeHasUpdates?(i.afterUpdateAction="return",i.$form.trigger("submit")):i._showPrevPanel()},_previewClick:function(t){t.preventDefault();var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit"))},_editCss:function(t){t.preventDefault();var i=t.data.self,e="layout_css_editor";if(i.settings.editor.updateStart(),i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit")),i.settings.editor.panelExists(e))i.settings.editor.$elmt.find(".ditty-editor__panel--layout_css_editor input.ditty-editor-options__title").val(i.$title.val()),i.settings.editor.panelOptions("transition","fade"),i.settings.editor.showPanel(e);else{var s={action:"ditty_editor_layout_fields",layout_id:i.layoutId,layout_title:i.$title.val(),ditty_id:i.editorDittyId,item_id:i.editorItemId,item_type:i.itemType,edit_type:"css",draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,s,(function(t){if(t){var s='<div class="ditty-editor__panel ditty-editor__panel--'+e+'">'+t.form+"</div>";i.settings.editor.panelOptions("transition","fade"),i.settings.editor.showPanel(e,s)}}),"json")}},_submitForm:function(t){t.preventDefault();var i=t.data.self,e=i.layoutId,s=i.itemType,a=i._getLayoutItems();if(i.$form.hasClass("ditty-editor-has-errors"))return!1;i.codeEditor.codemirror.save(),i.settings.editor.updateStart();var d={action:"ditty_editor_layout_update",layout_id:e,item_type:s,item_ids:a,edit_type:"html",draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:d,success:function(t){i.initData=i.$form.serialize(),i._disablePreviewButton(),t.label&&(i.$editorLayoutTitle&&i.$editorLayoutTitle.html(t.label),i.$editorLayoutVariationTitle.html(t.label)),i.$editorLayoutTitle&&i.$editorLayoutTitle.find(".ditty-layout-version").remove(),i.$editorLayoutVariationTitle&&i.$editorLayoutVariationTitle.find(".ditty-layout-version").remove(),t.display_items&&i.settings.editor.ditty.updateItems(t.display_items,!1,!1,!0),t.draft_id&&t.draft_meta&&dittyDraftLayoutUpdate(i,t.draft_id,null,t.draft_meta),i.codeHasUpdates=!1,i.settings.editor.updateStop(),i.settings.editor.delayedSubmitDisable(),"return"===i.afterUpdateAction&&i._showPrevPanel(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty({return_items:0}),i.afterUpdateAction=""}})},_initEditor:function(){var t=this,i=wp.codeEditor.defaultSettings?_.clone(wp.codeEditor.defaultSettings):{};i.codemirror=_.extend({},i.codemirror,{indentUnit:2,tabSize:2}),this.codeEditor=wp.codeEditor.initialize(this.$textarea[0],i),this.codeEditor.codemirror.on("change",(function(){t.codeEditor.codemirror.save(),t.settings.editor.addUpdate("layout_html_update",t.layoutId),t.codeHasUpdates=!0,t._enablePreviewButton(),t.settings.editor.delayedSubmitEnable()}))},_insertTag:function(t){var i=t.data.self,e=$(t.target),s=e.text(),a=e.data("atts"),d=i.codeEditor.codemirror.getCursor();if(t.shiftKey&&a){var r="",o=s.length-1;$.each(a,(function(t,i){r+=" "+t+'="'+i.toString()+'"'})),s=s.substring(0,o)+r+s.substring(o)}i.codeEditor.codemirror.replaceRange(s,d),d.ch=d.ch+s.length,i.codeEditor.codemirror.setCursor(d)},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_layout_html_editor_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_layout_html_editor_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$back.off("click",{self:this},this._backClick),this.$preview.off("click",{self:this},this._previewClick),this.$editCss.off("click",{self:this},this._editCss),this.$form.off("submit",{self:this},this._submitForm),this.$form.off("click",".ditty-editor-options__tag",{self:this},this._insertTag),this.$title.off("keyup",{self:this},this._titleUpdate),this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.codeEditor.codemirror.off("change"),this.codeEditor.codemirror.toTextArea(),this.elmt._ditty_layout_html_editor_panel=null}},$.fn.ditty_layout_html_editor_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_layout_html_editor_panel||(this._ditty_layout_html_editor_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_layout_html_editor_panel;if(!i)throw new Error("No Ditty_Layout_Html_Editor_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Layout_Html_Editor_Panel.');return void 0!==e?e:this}},$.ditty_layout_html_editor_panel={},$.ditty_layout_html_editor_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null,prevPanel:""},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_layout_css_editor_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$textarea=this.$elmt.find(".ditty-editor-options__code"),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$preview=this.$elmt.find(".ditty-editor-options__preview"),this.$editHtml=this.$elmt.find(".ditty-editor-options__edit-html"),this.$title=this.$elmt.find(".ditty-editor-options__title"),this.$body=this.$elmt.find(".ditty-editor-options__body"),this.$tags=this.$elmt.find(".ditty-editor-options__tags"),this.itemType=this.$form.data("item_type"),this.layoutId=this.$form.data("layout_id"),this.$editorItem=dittyVars.editor.currentItem,this.$editorLayout=dittyVars.editor.currentLayout,this.$editorLayoutTitle=!!this.$editorLayout&&this.$editorLayout.find(".ditty-data-list__item__label"),this.$editorLayoutVariation=dittyVars.editor.currentLayoutVariation,this.$editorLayoutVariationTitle=this.$editorLayoutVariation.find(".ditty-layout-variation__template span"),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.itemSelector="",this.codeEditor=null,this.codeHasUpdates=!1,this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){this.initData=this.$form.serialize(),this._setCssSelector(),this._initEditor(),this.$back.on("click",{self:this},this._backClick),this.$preview.on("click",{self:this},this._previewClick),this.$editHtml.on("click",{self:this},this._editHtml),this.$form.on("submit",{self:this},this._submitForm),this.$form.on("click",".ditty-editor-options__tag",{self:this},this._insertTag),this.$title.on("keyup",{self:this},this._titleUpdate),this.$body.on("click",".ditty-editor-options__body__error",{self:this},this._removeErrorNotice),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts)},_setCssSelector:function(){dittyVars.isTickerPost?this.itemSelector="#poststuff .ditty-layout--"+this.layoutId:this.itemSelector=".ditty-layout--"+this.layoutId},_showPrevPanel:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById",this.settings.prevPanel)},_titleUpdate:function(t){var i=t.data.self;i.settings.editor.addUpdate("layoutUpdate",i.layoutId)},_enablePreviewButton:function(){this.$preview.addClass("ditty-has-updates")},_disablePreviewButton:function(){this.$preview.removeClass("ditty-has-updates"),this.$preview.children("i").attr("class",this.$preview.children("i").data("class"))},_addDrafts:function(t){var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_backClick:function(t){t.preventDefault();var i=t.data.self;i.codeEditor.codemirror.save(),i.$form.serialize()!==i.initData||i.codeHasUpdates?(i.afterUpdateAction="return",i.$form.trigger("submit")):i._showPrevPanel()},_previewClick:function(t){t.preventDefault();var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit"))},_editHtml:function(t){t.preventDefault();var i=t.data.self,e="layout_html_editor";if(i.settings.editor.updateStart(),i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit")),i.settings.editor.panelExists(e))i.settings.editor.$elmt.find(".ditty-editor__panel--layout_html_editor input.ditty-editor-options__title").val(i.$title.val()),i.settings.editor.panelOptions("transition","fade"),i.settings.editor.showPanel(e);else{var s={action:"ditty_editor_layout_fields",layout_id:i.layoutId,layout_title:i.$title.val(),ditty_id:i.editorDittyId,item_id:i.editorItemId,item_type:i.itemType,edit_type:"html",draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,s,(function(t){if(t){var s='<div class="ditty-editor__panel ditty-editor__panel--'+e+'">'+t.form+"</div>";i.settings.editor.panelOptions("transition","fade"),i.settings.editor.showPanel(e,s)}}),"json")}},_showErrorNotice:function(){var t=$('<div class="ditty-editor-options__body__error"><span>'+dittyVars.strings.layout_css_error+"</span></div>");this.$body.append(t)},_removeErrorNotice:function(t){t.data.self.$body.find(".ditty-editor-options__body__error").remove()},_submitForm:function(t){t.preventDefault();var i=t.data.self,e=i.layoutId,s=i.itemType;if(i.$form.hasClass("ditty-editor-has-errors"))return!1;i.codeEditor.codemirror.save(),i.settings.editor.updateStart();var a={action:"ditty_editor_layout_update",layout_id:e,item_type:s,edit_type:"css",draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:a,success:function(t){i.initData=i.$form.serialize(),i._disablePreviewButton(),t.label&&(i.$editorLayoutTitle&&i.$editorLayoutTitle.html(t.label),i.$editorLayoutVariationTitle.html(t.label)),i.$editorLayoutTitle&&i.$editorLayoutTitle.find(".ditty-layout-version").remove(),i.$editorLayoutVariationTitle&&i.$editorLayoutVariationTitle.find(".ditty-layout-version").remove(),t.code?dittyLayoutCss(t.code,i.layoutId,"update"):i._showErrorNotice(),t.draft_id&&t.draft_meta&&dittyDraftLayoutUpdate(i,t.draft_id,null,t.draft_meta),i.codeHasUpdates=!1,i.settings.editor.updateStop(),i.settings.editor.delayedSubmitDisable(),"return"===i.afterUpdateAction&&i._showPrevPanel(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty(),i.afterUpdateAction=""}})},_initEditor:function(){var t=this,i=wp.codeEditor.defaultSettings?_.clone(wp.codeEditor.defaultSettings):{},e=dittyVars.editor.ditty_layouts_sass?"sass":"css";i.codemirror=_.extend({},i.codemirror,{mode:e,indentUnit:2,tabSize:2}),this.codeEditor=wp.codeEditor.initialize(this.$textarea[0],i),this.codeEditor.codemirror.on("change",(function(){t.codeEditor.codemirror.save(),t.settings.editor.addUpdate("layoutCssUpdate",t.layoutId),t.codeHasUpdates=!0,t._enablePreviewButton(),t.settings.editor.delayedSubmitEnable()}))},_insertTag:function(t){var i=t.data.self,e=$(t.target).text(),s=i.codeEditor.codemirror.getCursor();i.codeEditor.codemirror.replaceRange(e,s),s.ch=s.ch+e.length,i.codeEditor.codemirror.setCursor(s)},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_layout_css_editor_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_layout_css_editor_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$back.off("click",{self:this},this._backClick),this.$preview.off("click",{self:this},this._previewClick),this.$editHtml.off("click",{self:this},this._editHtml),this.$form.off("submit",{self:this},this._submitForm),this.$form.off("click",".ditty-editor-options__tag",{self:this},this._insertTag),this.$title.off("keyup",{self:this},this._titleUpdate),this.$body.off("click",".ditty-editor-options__body__error",{self:this},this._removeErrorNotice),this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.codeEditor.codemirror.off("change"),this.codeEditor.codemirror.toTextArea(),this.elmt._ditty_layout_css_editor_panel=null}},$.fn.ditty_layout_css_editor_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_layout_css_editor_panel||(this._ditty_layout_css_editor_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_layout_css_editor_panel;if(!i)throw new Error("No Ditty_Layout_Css_Editor_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Layout_Css_Editor_Panel.');return void 0!==e?e:this}},$.ditty_layout_css_editor_panel={},$.ditty_layout_css_editor_panel.defaults=t}(jQuery),jQuery((function($){!function(){"use strict";function t(t,i){0===parseInt(i)?t.hide():t.show()}function i(t,i){"none"===i?t.hide():t.show()}function e(t,i){"none"===i?t.hide():t.show()}$("#ditty-editor").on("ditty_display_editor_panel_init",".ditty-editor__panel--displayEditor",(function(s,a){if("list"===a.displayType){var d=a.$form,r=d.find(".ditty-field--perPage"),o=d.find(".ditty-field--arrows").siblings(),n=d.find(".ditty-field--bullets").siblings();t(r,d.find('input[name="paging"]:checked').val()),d.find('input[name="paging"]').on("change",(function(){t(r,$(this).val())})),i(o,d.find('select[name="arrows"]').val()),d.find('select[name="arrows"]').on("change",(function(){i(o,$(this).val())})),e(n,d.find('select[name="bullets"]').val()),d.find('select[name="bullets"]').on("change",(function(){e(n,$(this).val())}))}}))}()})),jQuery((function($){!function(){"use strict";function t(t,i,e){"down"===e||"up"===e?(t.show(),i.show()):(t.hide(),i.hide())}$("#ditty-editor").on("ditty_display_editor_panel_init",".ditty-editor__panel--displayEditor",(function(i,e){if("ticker"===e.displayType){var s=e.$form,a=s.find(".ditty-field--minHeight"),d=s.find(".ditty-field--maxHeight");t(a,d,s.find('input[name="direction"]:checked').val()),s.find('input[name="direction"]').on("change",(function(){t(a,d,$(this).val())}))}}))}()})),jQuery((function($){!function(){"use strict";function t(t){"full"===t.find('input[name="content_display"]:checked').val()?(t.find(".ditty-field--more_link").hide(),t.find(".ditty-field--excerpt_length").hide(),t.find(".ditty-field--more").hide(),t.find(".ditty-field--more_before").hide(),t.find(".ditty-field--more_after").hide()):(t.find(".ditty-field--more_link").show(),t.find(".ditty-field--excerpt_length").show(),t.find(".ditty-field--more").show(),t.find(".ditty-field--more_before").show(),t.find(".ditty-field--more_after").show())}$("#ditty-editor").on("ditty_item_editor_panel_init",".ditty-editor__panel--item_editor",(function(i,e){if("posts_feed"!==e.itemType&&"post"!==e.itemType)return!1;var s=e.$form;t(s),s.on("click",'input[name="content_display"]',(function(){t(s)}))}))}()}));
1
  function dittyEditorInit(t){if(!t)return!1;jQuery("#ditty-editor__settings").ditty_editor({ditty:t})}function dittyGetItemsById(t,i){var e=[];return jQuery.each(t,(function(t,s){String(s.id)===String(i)&&e.push(s)})),e}function dittyItemsReorder(t,i){var e=[];return jQuery.each(i,(function(i,s){e=jQuery.merge(e,dittyGetItemsById(t,s))})),e}function dittyDraftUpdate(t,i,e,s){var a=t.settings.editor.getDraftValues(i);return a||(a={}),e?a[e]=s:a=s,t.settings.editor.updateDraftValues(i,a)}function dittyDraftGet(t,i,e){var s=t.settings.editor.getDraftValues(i);return!!s&&(e&&s[e]?s[e]:s)}function dittyDraftDelete(t,i,e){var s=i.settings.editor.getDraftValues(t),a={};return jQuery.each(s,(function(t,i){String(e)!==String(t)&&(a[t]=i)})),"new-"!==String(e).substring(0,4)&&(a[e]="DELETE"),i.settings.editor.updateDraftValues(t,a)}function dittyDraftItemDelete(t,i){return dittyDraftDelete("items",t,i)}function dittyDraftLayoutDelete(t,i){return dittyDraftDelete("layouts",t,i)}function dittyDraftDisplayDelete(t,i){return dittyDraftDelete("displays",t,i)}function dittyDraftItemUpdateData(t,i,e,s){var a=t.settings.editor.getDraftValues("items");return a||(a={}),a[i]||(a[i]={}),a[i].data||(a[i].data={}),e?a[i].data[e]=s:a[i].data=s,t.settings.editor.updateDraftValues("items",a)}function dittyDraftItemGetData(t,i,e){var s=t.settings.editor.getDraftValues("items");return!!s[i]&&(!!s[i].data&&(e?s[i].data[e]?s[i].data[e]:void 0:s[i].data))}function dittyDraftItemUpdateMeta(t,i,e,s){var a=t.settings.editor.getDraftValues("items");return a||(a={}),a[i]||(a[i]={}),a[i].meta||(a[i].meta={}),e?a[i].meta[e]=s:a[i].meta=s,t.settings.editor.updateDraftValues("items",a)}function dittyDraftItemGetMeta(t,i,e){var s=t.settings.editor.getDraftValues("items");return!!s[i]&&(!!s[i].meta&&(e?s[i].meta[e]?s[i].meta[e]:void 0:s[i].meta))}function dittyDraftLayoutUpdate(t,i,e,s){var a=t.settings.editor.getDraftValues("layouts");return a||(a={}),a[i]||(a[i]={}),e?a[i][e]=s:a[i]=s,t.settings.editor.updateDraftValues("layouts",a)}function dittyDraftLayoutGet(t,i,e){var s=t.settings.editor.getDraftValues("layouts");return!!s[i]&&(e?s[i][e]?s[i][e]:void 0:s[i])}function dittyDraftDisplayUpdate(t,i,e,s){var a=t.settings.editor.getDraftValues("displays");return a||(a={}),a[i]||(a[i]={}),e?a[i][e]=s:a[i]=s,t.settings.editor.updateDraftValues("displays",a)}function dittyDraftDisplayGet(t,i,e){var s=t.settings.editor.getDraftValues("layouts");return!!s[i]&&(e?s[i][e]?s[i][e]:void 0:s[i])}jQuery((function($){!function(){"use strict";$("body").on("ditty_editor_before_panel_update",(function(t,i,e,s,a,d){switch(d.delayedSubmitDisable(),$.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),i){case"settings":e.hasClass("init")||e.ditty_settings_panel({editor:d});break;case"items":e.hasClass("init")?e.ditty_items_panel("panelVisible"):e.ditty_items_panel({editor:d});break;case"displays":e.find(".ditty-data-list__item").removeClass("editing"),e.hasClass("init")?e.ditty_displays_panel("panelVisible"):e.ditty_displays_panel({editor:d});break;case"item_types":e.find(".ditty-data-list__item").removeClass("editing"),e.hasClass("init")?e.ditty_item_types_panel("panelVisible"):e.ditty_item_types_panel({editor:d});break;case"item_editor":e.ditty_item_editor_panel({editor:d});break;case"display_editor":e.ditty_display_editor_panel({editor:d});break;case"layouts":"layoutHtmlEditor"!==s&&"layoutCssEditor"!==s&&e.ditty_layouts_panel({editor:d});break;case"layout_variations":e.hasClass("init")?e.ditty_layout_variations_panel("panelVisible"):e.ditty_layout_variations_panel({editor:d});break;case"layout_html_editor":e.ditty_layout_html_editor_panel({editor:d,prevPanel:s});break;case"layout_css_editor":e.ditty_layout_css_editor_panel({editor:d,prevPanel:s})}})),$("body").on("ditty_editor_panel_removed",(function(t,i,e){switch(i){case"item_editor":e.ditty_item_editor_panel&&e.ditty_item_editor_panel("destroy");break;case"display_editor":e.ditty_display_editor_panel&&e.ditty_display_editor_panel("destroy");break;case"layouts":case"layouts":e.ditty_layouts_panel&&e.ditty_layouts_panel("destroy");break;case"layout_variations":e.ditty_layout_variations_panel&&e.ditty_layout_variations_panel("destroy");break;case"layout_html_editor":e.ditty_layout_html_editor_panel&&e.ditty_layout_html_editor_panel("destroy");break;case"layout_css_editor":e.ditty_layout_css_editor_panel&&e.ditty_layout_css_editor_panel("destroy")}}))}()})),dittyEditorInit(),function($){"use strict";var t={listType:"toggle",showAll:!0,activeFilter:"*",filter:".ditty-data-list__filter",filterSelector:"filter",item:".ditty-data-list__item",itemSelector:"filter"},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_ui_data_list.defaults,e),this.$elmt=$(i),this.filters=[],this._init()};i.prototype={_init:function(){var t=this;this.$elmt.on("click",this.settings.filter,{self:this},this._filterClick),this.$elmt.find(this.settings.filter+".active").each((function(){t._filterList($(this).data(t.settings.filterSelector))})),"*"!==this.settings.activeFilter&&this._filterList(this.settings.activeFilter),setTimeout((function(){t.trigger("init")}),1)},_filterList:function(t){var i=this,e=this.filters;if("toggle"===this.settings.listType)this.filters.includes(t)?this.settings.showAll&&(this.filters=[],this.$elmt.find(this.settings.filter).removeClass("active"),this.$elmt.find(this.settings.item).show()):(this.filters=[t],this.$elmt.find(this.settings.filter).removeClass("active"),this.$elmt.find(this.settings.filter+"[data-"+this.settings.filterSelector+'="'+t+'"]').addClass("active"),this.$elmt.find(this.settings.item).hide(),this.$elmt.find(this.settings.item+"[data-"+this.settings.itemSelector+'="'+t+'"]').show());else if("filter"===this.settings.listType){if(this.$elmt.find(this.settings.item).hide(),this.filters.includes(t)){this.$elmt.find(this.settings.filter+"[data-"+this.settings.filterSelector+'="'+t+'"]').removeClass("active");for(var s=0;s<this.filters.length;s++)i.filters[s]===t&&i.filters.splice(s,1)}else this.$elmt.find(this.settings.filter+"[data-"+this.settings.filterSelector+'="'+t+'"]').addClass("active"),this.filters.push(t);$.each(this.filters,(function(t,e){i.$elmt.find(this.settings.item+"[data-"+this.settings.itemSelector+'="'+e+'"]').show()})),0===this.filters.length&&i.$elmt.find(this.settings.item).show()}e!==this.filters&&i.trigger("update")},_filterClick:function(t){t.preventDefault();var i=t.data.self,e=$(t.target);e.is("a")||(e=e.parents("a")),i._filterList(e.data(i.settings.filterSelector))},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings,this.filters];i&&(e=i),this.$elmt.trigger("ditty_ui_data_list_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_ui_data_list.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.off("click",this.settings.filter,{self:this},this._filterClick),this.trigger("destroy"),this.elmt._ditty_ui_data_list=null}},$.fn.ditty_ui_data_list=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_ui_data_list||(this._ditty_ui_data_list=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_ui_data_list;if(!i)throw new Error("No Ditty_UI_Data_List applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_UI_Data_List.');return void 0!==e?e:this}},$.ditty_ui_data_list={},$.ditty_ui_data_list.defaults=t}(jQuery),function($){"use strict";var t={screen:"admin",ditty:null,panel:""},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_editor.defaults,e),this.$elmt=$(i),this.ditty=this.settings.ditty,this.dittyId=this.settings.ditty.options("id"),this.dittyType=this.settings.ditty.options("type"),this.displayId=0,this.panelsLoaded=0,this.unsavedUpdates={},this.draftValues={},this.$overlay=null,this.$contents=null,this.$header=null,this.$update=null,this.$updateCount=null,this.$updateLabel=null,this.$tabs=null,this.$panels=null,this.currentTab=0,this.currentPanel=this.settings.panel,this.delayedSubmit=!1,this.tabs=[],this.panels=[],this.activeItems=[],this._init()};i.prototype={_init:function(){var t,i,e,s,a,d,r,o=this;t=$('<div class="ditty-editor__contents"></div>'),this.$contents=t,i=$('<div class="ditty-editor__header"></div>'),this.$header=i,e=$('<span class="ditty-editor__update__count"></span>'),this.$updateCount=e,s=$('<span class="ditty-editor__update__label">Save Ditty</span>'),this.$updateLabel=s,a=$('<button type="submit" class="ditty-editor__update ditty-button ditty-button--primary"></button>'),this.$update=a,d=$('<div class="ditty-editor__tabs"></div>'),this.$tabs=d,r=$('<div class="ditty-editor__panels"></div>'),this.$panels=r,a.prepend(e,s),i.append(a),t.append(i,d,r),this.$elmt.append(t),this.$overlay=$('<div class="ditty-updating-overlay ditty-admin-item__overlay"><div class="ditty-updating-overlay__inner"><i class="fas fa-sync-alt fa-spin"></i></div></div>'),this.$elmt.append(this.$overlay),$(document).on("postbox-moved",{self:this},this._postboxMoved),$(document).on("postboxes-columnchange",{self:this},this._postboxMoved),$(window).on("beforeunload",{self:this},this._beforeunload),this.ditty.$elmt.on("ditty_active_items_update",{self:this},this._dittyItemsUpdated),this.ditty.$elmt.on("ditty_disabled_items_update",{self:this},this._disabledItemsUpdate),this.$tabs.on("click",".ditty-editor__tab",{self:this},this._showPanel),this.$update.on("click",{self:this},this._saveClick),this.$panels.on("ditty_slider_init",{self:this},this._editorLoaded),this.$panels.on("ditty_slider_before_slide_update",{self:this},this._beforeSlideUpdate),this.$panels.on("ditty_slider_after_slide_update",{self:this},this._afterSlideUpdate),this.$panels.on("ditty_slider_slide_removed",{self:this},this._slideRemoved),this._loadContents(),this.trigger("stop_live_updates"),setTimeout((function(){o.trigger("init")}),1)},_loadContents:function(){var t=this,i={action:"ditty_editor_load_contents",ditty_id:this.dittyId,security:dittyVars.security};$.post(dittyVars.ajaxurl,i,(function(i){t._initTabs(i.tabs),t._initPanels(i.panels),t._initSlider()}),"json")},_editorLoaded:function(t){var i=t.data.self;$("body").trigger("ditty_editor_loaded",[i])},_setUpdateCount:function(){},_initSlider:function(){var t=this.tabs[0].id;this.currentPanel&&""!==this.currentPanel&&(t=this.currentPanel),this.$panels.ditty_slider({transition:"fade",transitionSpeed:.75,heightSpeed:.75,touchSwipe:!1,slides:this.panels,slideId:t})},_beforeSlideUpdate:function(t,i,e,s,a){var d=t.data.self;d.updateStart(),d._updateTab(e.id),$("body").trigger("ditty_editor_before_panel_update",[e.id,e.$elmt,a.id,a.$elmt,d])},_afterSlideUpdate:function(t,i,e,s,a){var d=t.data.self;d.updateStop(),$("body").trigger("ditty_editor_after_panel_update",[e.id,e.$elmt,a.id,a.$elmt,d])},_slideRemoved:function(t,i){var e=t.data.self;$("body").trigger("ditty_editor_panel_removed",[i.id,i.$elmt,e])},_showPanel:function(t){t.preventDefault();var i=t.data.self,e=$(t.target).is("a")?$(t.target):$(t.target).parent("a"),s=e.data("panel"),a=parseInt(e.data("index"));if(s===i.currentTab)return!1;var d=a>i.currentTab?"slideLeft":"slideRight";i.$panels.ditty_slider("options","transition",d),i.$panels.ditty_slider("showSlideById",s),i.currentTab=a,i.$elmt.trigger("ditty_editor_add_drafts")},_updateTab:function(t){var i=$('.ditty-editor__tab[data-panel="'+t+'"]');void 0!==i[0]&&($(".ditty-editor__tab").removeClass("active"),i.addClass("active"),this.currentTab=parseInt(i.data("index")))},_initTabs:function(t){var i=this,e=0;$.each(t,(function(t,s){var a=$('<a href="#" class="ditty-editor__tab ditty-editor__tab--'+t+'" data-panel="'+t+'" data-index="'+e+'"><i class="'+s.icon+'"></i><span>'+s.label+"</span></a>");i.$tabs.append(a),i.tabs.push({id:t,tab:a}),e++}))},_initPanels:function(t){var i=this;$.each(t,(function(t,e){var s='<div class="ditty-editor__panel ditty-editor__panel--'+t+'">'+e+"</div>";i.panels.push({id:t,html:s,cache:!0})}))},_initFields:function(t){t.find(".ditty-data-list").ditty_ui_data_list(),t.trigger("ditty_init_fields"),$.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}})},saveDitty:function(t){var i=this,e=i.dittyId;i.$updateLabel.text("Updating..."),i.updateStart();var s={action:"ditty_editor_save",ditty_id:e,draft_values:i.draftValues,return_items:1,security:dittyVars.security};s=$.extend({},s,t),$.post(dittyVars.ajaxurl,s,(function(t){$("body").trigger("ditty_editor_save_ditty_response",[t]),t.display_items&&i.ditty.options("items",t.display_items),i.draftValues={},i.unsavedUpdates={},i._setUpdateCount(),i.$elmt.removeClass("ditty-editor--updates-exist"),i.$updateLabel.text("Ditty Saved!"),setTimeout((function(){i.$updateLabel.text("Save Ditty")}),2e3),i.updateStop(),t.new_ditty_url&&window.history.pushState(null,"","/wp-admin/post.php?post="+e+"&action=edit")}))},_saveClick:function(t){t.preventDefault();var i=t.data.self;i.$elmt.trigger("ditty_editor_save_drafts"),i.delayedSubmit||i.saveDitty()},_dittyItemsUpdated:function(t,i,e){var s=t.data.self;s.activeItems=e,s.trigger("active_items_update")},_disabledItemsUpdate:function(t,i){var e=t.data.self;$.each(i,(function(t,i){"disabled"===i?e.$elmt.find("#ditty-editor-item--"+t).addClass("ditty-editor-item--disabled"):e.$elmt.find("#ditty-editor-item--"+t).removeClass("ditty-editor-item--disabled")}))},_postboxMoved:function(t,i){if(!window.tinymce)return!1;$(i).find(".wp-editor-area").each((function(){var t=$(this).attr("id");tinymce.execCommand("mceRemoveEditor",!0,t),tinymce.execCommand("mceAddEditor",!0,t)}))},_beforeunload:function(t){var i=t.data.self;return Object.keys(i.unsavedUpdates).length>0||void 0},_windowResize:function(t){t.preventDefault()},_options:function(t){return this.settings[t]},panelExists:function(t){var i=this.$panels.ditty_slider("options","slides"),e=!1;return $.each(i,(function(i,s){String(s.id)!==String(t)||(e=!0)})),e},showPanel:function(t,i){i&&this.$panels.ditty_slider("addSlideById",t,i),this.$panels.ditty_slider("showSlideById",t,!0)},updateExists:function(t,i){if(void 0===this.unsavedUpdates[t]&&(this.unsavedUpdates[t]=[]),-1!==$.inArray(i,this.unsavedUpdates[t]))return!0},addUpdate:function(t,i){var e=!1;return void 0===this.unsavedUpdates[t]&&(this.unsavedUpdates[t]=[]),-1===$.inArray(i,this.unsavedUpdates[t])&&(e=!0,this.unsavedUpdates[t].push(i)),this._setUpdateCount(),this.$elmt.addClass("ditty-editor--updates-exist"),e},removeUpdate:function(t,i){if(void 0===this.unsavedUpdates[t])return!1;if(-1===$.inArray(i,this.unsavedUpdates[t]))return!1;var e=!1,s=[];return $.each(this.unsavedUpdates[t],(function(t,a){String(i)===String(a)?e=!0:s.push(a)})),this.unsavedUpdates[t]=s,this._setUpdateCount(),""===this.$updateCount.text()&&this.$elmt.removeClass("ditty-editor--updates-exist"),e},updateStart:function(){this.$overlay.fadeIn()},updateStop:function(){this.$overlay.fadeOut()},initFields:function(t){this._initFields(t)},updateDraftValues:function(t,i){return this.$elmt.addClass("ditty-editor--updates-exist"),t?(this.draftValues[t]=i,"development"===dittyVars.mode&&window.console&&console.log("draftValues:",this.draftValues),this.draftValues[t]):(this.draftValues=i,"development"===dittyVars.mode&&window.console&&console.log("draftValues:",this.draftValues),this.draftValues)},getDraftValues:function(t){return t?!!this.draftValues[t]&&this.draftValues[t]:this.draftValues},delayedSubmitEnable:function(){this.delayedSubmit=!0},delayedSubmitDisable:function(){this.delayedSubmit=!1},trigger:function(t,i){var e=[];switch(t){case"active_items_update":e=[this.ditty,this.activeItems];break;case"stop_live_updates":e=[this.dittyId];break;default:e=[this.settings]}i&&(e=i),this.$elmt.trigger("ditty_editor_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e),$("body").trigger("ditty_"+t,e)},_getPanelOption:function(t){return"elmnt"===t?this.$panels:this.settings[t]},_setPanelOption:function(t,i){if(void 0===i)return!1;this.$panels.ditty_slider("options",t,i),this.trigger("update")},panelOptions:function(t,i){var e=this;if("object"==typeof t)$.each(t,(function(t,i){e._setPanelOption(t,i)}));else{if("string"!=typeof t)return e.$panels.ditty_slider("options");if(void 0===i)return e._getPanelOption(t);e._setPanelOption(t,i)}},_getOption:function(t){return"elmnt"===t?this:this.settings[t]},_setOption:function(t,i){if(void 0===i)return!1;this.settings[t]=i,this.trigger("update")},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.$panels.ditty_slider&&this.$panels.ditty_slider("destroy"),$(document).off("postbox-moved",{self:this},this._postboxMoved),$(document).off("postboxes-columnchange",{self:this},this._postboxMoved),$(window).off("beforeunload",{self:this},this._beforeunload),this.ditty.$elmt.off("ditty_active_items_update",{self:this},this._dittyItemsUpdated),this.ditty.$elmt.off("ditty_disabled_items_update",{self:this},this._disabledItemsUpdate),this.$tabs.off("click","ditty-editor__tab",{self:this},this._showPanel),this.$update.off("click",{self:this},this._saveClick),this.$panels.off("ditty_slider_init",{self:this},this._editorLoaded),this.$panels.off("ditty_slider_before_slide_update",{self:this},this._beforeSlideUpdate),this.$panels.off("ditty_slider_after_slide_update",{self:this},this._afterSlideUpdate),this.$panels.off("ditty_slider_slide_removed",{self:this},this._slideRemoved),this.trigger("destroy"),this.elmt._ditty_editor=null}},$.fn.ditty_editor=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_editor||(this._ditty_editor=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_editor;if(!i)throw new Error("No Ditty_Editor applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Editor.');return void 0!==e?e:this}},$.ditty_editor={},$.ditty_editor.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_settings_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$title=this.$elmt.find('input[name="title]'),this.$previewBg=this.$elmt.find('input[name="previewBg"]'),this.$previewPaddingTop=this.$elmt.find('input[name="previewPadding[paddingTop]"]'),this.$previewPaddingBottom=this.$elmt.find('input[name="previewPadding[paddingBottom]"]'),this.$previewPaddingLeft=this.$elmt.find('input[name="previewPadding[paddingLeft]"]'),this.$previewPaddingRight=this.$elmt.find('input[name="previewPadding[paddingRight]"]'),this.$postTitle=$(".ditty-post__title"),this.$editorPreview=$("#ditty-editor__preview"),this.dittyId=this.$form.data("ditty_id"),this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){this.initData=this.$form.serialize(),this.settings.editor.initFields(this.$elmt),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.on("submit",{self:this},this._submitForm),this.$form.on("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.on("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.on("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.$form.on("keyup change",'input[name="title"]',{self:this},this._titleChange),this.$form.on("keyup change",".ditty-field--preview_settings *",{self:this},this._previewBgChange),this.$elmt.addClass("init")},_checkUpdates:function(t){var i=t?t.data.self:this;i.$form.serialize()!==i.initData?(i.settings.editor.addUpdate("settings",i.itemId),i.settings.editor.delayedSubmitEnable()):i.settings.editor.removeUpdate("settings",i.itemId)},_titleChange:function(t){var i=t?t.data.self:this,e=$(t.target).val();i.$postTitle.text(e)},_previewBgChange:function(t){var i=t?t.data.self:this,e={backgroundColor:i.$previewBg.val(),paddingTop:i.$previewPaddingTop.val(),paddingBottom:i.$previewPaddingBottom.val(),paddingLeft:i.$previewPaddingLeft.val(),paddingRight:i.$previewPaddingRight.val()};i.$editorPreview.css(e)},_addDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_submitForm:function(t){t.preventDefault();var i=t.data.self,e=i.dittyId;i.settings.editor.updateStart();var s={action:"ditty_editor_settings_update",ditty_id:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:s,success:function(t){i.initData=i.$form.serialize(),dittyDraftUpdate(i,"settings",!1,t),i.settings.editor.delayedSubmitDisable(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty({return_items:0}),i.afterUpdateAction=""}})},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_settings_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_settings_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._addDrafts),this.$form.off("submit",{self:this},this._submitForm),this.$form.off("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.off("keyup change",'input[name="previewBg"]',{self:this},this._previewBg_cahnge),this.$form.off("keyup change",'input[name="title"]',{self:this},this._titleChange),this.$form.off("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.off("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.trigger("destroy"),this.elmt._ditty_settings_panel=null}},$.fn.ditty_settings_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_settings_panel||(this._ditty_settings_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_settings_panel;if(!i)throw new Error("No Ditty_Settings_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Settings_Panel.');return void 0!==e?e:this}},$.ditty_settings_panel={},$.ditty_settings_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_items_panel.defaults,e),this.$elmt=$(i),this.$add=$(i).find(".ditty-editor-options__add"),this.$contents=$(i).find(".ditty-editor__panel__contents"),this.$list=$(i).find(".ditty-data-list"),this.$listItems=$(i).find(".ditty-data-list__items"),this.isEmptyTicker=!1,this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.settings.editor.$elmt.on("ditty_editor_active_items_update",{self:this},this._dittyActiveItemsUpdated),this.$add.on("click",{self:this},this._add_item),this.$elmt.on("click",".ditty-data-list__item",{self:this},this._showItem),this.$elmt.on("click",".ditty-data-list__item__icon",{self:this},this._editType),this.$elmt.on("click",".ditty-data-list__item__edit",{self:this},this._editItem),this.$elmt.on("click",".ditty-data-list__item__layout",{self:this},this._editLayoutVariations),this.$elmt.on("click",".ditty-data-list__item__clone",{self:this},this._cloneItem),this.$elmt.on("click",".ditty-data-list__item__delete",{self:this},this._deleteItem),this.$list.on("click",".ditty-editor-item > a",{self:this},this._actionClick),$("body").on("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),1>this.$elmt.find(".ditty-data-list__item").length&&(this.isEmptyTicker=!0,this.$add.trigger("click")),this._initializeSorting(),this._highlightListItems(this.settings.editor.activeItems)},dittyUpdateSavedDraftLayouts:function(t,i){$.each($(".ditty-editor-item"),(function(){var e=$(this).data("layout_value");$.each(e,(function(s,a){String(a)===String(t)&&(e[s]=String(i))})),$(this).attr("data-layout_value",e).data("layout_value",e)}))},_dittyEditorSaveResponse:function(t,i){var e=t.data.self;i.ditty_new_item_ids&&$.each(i.ditty_new_item_ids,(function(t,i){var e=$("#ditty-editor-item--"+t);e.length&&(e.attr("id","ditty-editor-item--"+i),e.attr("data-item_id",i).data("item_id",i))})),i.ditty_new_layout_ids&&$.each(i.ditty_new_layout_ids,(function(t,i){e.dittyUpdateSavedDraftLayouts(t,i)}))},_highlightListItem:function(t){var i=t.id+"";i=i.split("_"),this.$elmt.find("#ditty-editor-item--"+i[0]).addClass("active")},_highlightListItems:function(t){this.$elmt.find(".ditty-data-list__item").removeClass("active");var i=this;Array.isArray(t)?$.each(t,(function(t,e){i._highlightListItem(e)})):i._highlightListItem(t)},_dittyActiveItemsUpdated:function(t,i,e){t.data.self._highlightListItems(e)},_initializeSorting:function(){var t=this;this.$listItems.sortable({handle:".ditty-data-list__item__move",items:".ditty-data-list__item",axis:"y",start:function(t,i){$(i.item).addClass("ditty-data-list__item--moving")},stop:function(i,e){$(e.item).removeClass("ditty-data-list__item--moving"),t.settings.editor.addUpdate("item_order",t.settings.editor.dittyId)},update:function(){t._updateItemIndexes("updateDitty")}})},_showItem:function(t){t.preventDefault();var i=t.data.self;if(!$(t.target).is("a")&&!$(t.target).parent().is("a")){var e=($(t.target).is(".ditty-data-list__item")?$(t.target):$(t.target).parents(".ditty-data-list__item")).data("item_id");i.settings.editor.ditty.showItem(e)}},_actionClick:function(t){t.preventDefault();var i=t.data.self,e=$(t.target).is("a")?$(t.target):$(t.target).parent("a"),s=e.parents(".ditty-data-list__item"),a=s.data("ditty_id"),d=s.data("item_id");dittyVars.editor.currentItem=s,$("body").trigger("ditty_editor_item_action_click",[e,s,d,a,i.settings.editor])},_editType:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item");e.trigger("click"),e.addClass("editing"),i.settings.editor.updateStart(),i.settings.editor.panelOptions("transition","slideRight"),i.settings.editor.showPanel("item_types")},_editItem:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("item_id");e.trigger("click"),e.addClass("editing"),i.settings.editor.updateStart();var a={action:"ditty_editor_item_fields",item_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t){var e='<div class="ditty-editor__panel ditty-editor__panel--item_editor">'+t+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel("item_editor",e)}}))},_editLayoutVariations:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("item_type"),a=e.data("layout_value"),d=e.find(".ditty-data-list__item__label").html();e.trigger("click"),e.addClass("editing"),i.settings.editor.updateStart();var r={action:"ditty_editor_layout_variations",ditty_id:i.settings.editor.dittyId,item_type:s,item_label:d,layout_value:a,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,r,(function(t){if(t){var e='<div class="ditty-editor__panel ditty-editor__panel--layout-variations">'+t+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel("layout_variations",e)}}))},_add_item:function(t){t.preventDefault();var i=t.data.self,e={action:"ditty_editor_item_add",ditty_id:i.settings.editor.dittyId,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,e,(function(t){if(t.display_items){if(i.isEmptyTicker){var e=i.settings.editor.ditty.options("items");$.each(e,(function(t,e){i.settings.editor.ditty.deleteItem(e.id)})),i.isEmptyTicker=!1}$.each(t.display_items,(function(t,e){i.settings.editor.ditty.addItem(e,0)}))}if(t.editor_item){var s=$(t.editor_item);s.hide(),i.$listItems.prepend(s),s.slideDown(),i._updateItemIndexes()}t.draft_id&&t.draft_data&&dittyDraftItemUpdateData(i,t.draft_id,null,t.draft_data),t.draft_id&&t.draft_meta&&dittyDraftItemUpdateMeta(i,t.draft_id,null,t.draft_meta)}),"json")},_cloneItem:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("item_id");i.settings.editor.updateStart();var a={action:"ditty_editor_item_clone",item_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t.display_items&&t.display_items.length&&i.settings.editor.ditty.updateItems(t.display_items,s,"after"),t.editor_item){var a=$(t.editor_item);a.hide(),e.after(a),a.slideDown(),i._updateItemIndexes()}t.draft_id&&t.draft_data&&dittyDraftItemUpdateData(i,t.draft_id,null,t.draft_data),t.draft_id&&t.draft_meta&&dittyDraftItemUpdateMeta(i,t.draft_id,null,t.draft_meta),i.settings.editor.updateStop()}),"json")},_deleteItem:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("item_id");1>=i.$elmt.find(".ditty-data-list__item").length&&i.$add.trigger("click"),e.slideUp((function(){$(this).remove()})),i.settings.editor.ditty.deleteItem(s),dittyDraftItemDelete(i,s)},_updateItemIndexes:function(t){var i=this,e=[];if(this.$elmt.find(".ditty-data-list__item").each((function(t){var s=$(this).data("item_id");e.push(s),dittyDraftItemUpdateData(i,s,"item_index",t)})),"updateDitty"===t){var s=dittyItemsReorder(i.settings.editor.ditty.options("items"),e);i.settings.editor.ditty.options("items",s)}},panelVisible:function(){this.$elmt.find(".ditty-data-list__item").removeClass("editing")},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_items_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_items_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.settings.editor.$elmt.off("ditty_editor_active_items_update",{self:this},this._dittyActiveItemsUpdated),this.$add.off("click",{self:this},this._add_item),this.$elmt.off("click",".ditty-data-list__item",{self:this},this._showItem),this.$elmt.off("click",".ditty-data-list__item__icon",{self:this},this._editType),this.$elmt.off("click",".ditty-data-list__item__edit",{self:this},this._editItem),this.$elmt.off("click",".ditty-data-list__item__layout",{self:this
2
+ },this._editLayoutVariations),this.$elmt.off("click",".ditty-data-list__item__clone",{self:this},this._cloneItem),this.$elmt.off("click",".ditty-data-list__item__delete",{self:this},this._deleteItem),this.$list.off("click",".ditty-editor-item > a",{self:this},this._actionClick),$("body").off("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),this.trigger("destroy"),this.elmt._ditty_items_panel=null}},$.fn.ditty_items_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_items_panel||(this._ditty_items_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_items_panel;if(!i)throw new Error("No Ditty_Items_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Items_Panel.');return void 0!==e?e:this}},$.ditty_items_panel={},$.ditty_items_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_item_types_panel.defaults,e),this.$elmt=$(i),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$editorItem=this.settings.editor.$panels.find(".ditty-editor__panel--items").find(".ditty-data-list__item.editing"),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.currentType=null,this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.settings.editor.initFields(this.$elmt),this.$back.on("click",{self:this},this._backClick),this.$elmt.on("click",".ditty-editor-item-type",{self:this},this._typeClick),this.panelVisible()},_showItemsList:function(){this.settings.editor.panelOptions("transition","slideLeft"),this.settings.editor.showPanel("items")},_backClick:function(t){t.preventDefault(),t.data.self._showItemsList()},_typeClick:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is(".ditty-editor-item-type")?$(t.target):$(t.target).parents(".ditty-editor-item-type")).data("item_type");if(e===i.currentType)i._showItemsList();else{i.settings.editor.updateStart();var s={action:"ditty_editor_item_type_update",item_id:i.editorItemId,item_type:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,s,(function(t){if(t.display_items&&i.settings.editor.ditty.updateItems(t.display_items,i.editorItemId),t.editor_item){var e=$(t.editor_item);i.$editorItem.after(e),i.$editorItem.remove(),i.$editorItem=e}t.draft_id&&t.draft_data&&dittyDraftItemUpdateData(i,t.draft_id,null,t.draft_data),i._showItemsList(),i.settings.editor.updateStop()}),"json")}},panelVisible:function(){this.$editorItem=this.settings.editor.$panels.find(".ditty-editor__panel--items").find(".ditty-data-list__item.editing"),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.currentType=this.$editorItem.data("item_type"),this.$elmt.find(".ditty-editor-item-type").removeClass("active"),this.$elmt.find('.ditty-editor-item-type[data-item_type="'+this.currentType+'"]').addClass("active")},panelHidden:function(){var t=this.$editorItem.find(".ditty-data-list__item__icon").children("i");t.attr("class",t.data("class"))},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_item_types_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_item_types_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.$back.off("click",{self:this},this._backClick),this.$elmt.off("click",".ditty-editor-item-type",{self:this},this._typeClick),this.trigger("destroy"),this.elmt._ditty_item_types_panel=null}},$.fn.ditty_item_types_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_item_types_panel||(this._ditty_item_types_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_item_types_panel;if(!i)throw new Error("No Ditty_Item_Types_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Item_Types_Panel.');return void 0!==e?e:this}},$.ditty_item_types_panel={},$.ditty_item_types_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_item_editor_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$preview=this.$elmt.find(".ditty-editor-options__preview"),this.$title=this.$elmt.find(".ditty-editor-options__title"),this.itemId=this.$form.data("item_id"),this.itemType=this.$form.data("item_type"),this.dittyId=this.$form.data("ditty_id"),this.$editorItem=this.settings.editor.$panels.find(".ditty-editor__panel--items").find(".ditty-data-list__item.editing"),this.$editorItemTitle=this.$editorItem.find(".ditty-data-list__item__label"),this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){var t=this;this.initData=this.$form.serialize(),this.settings.editor.initFields(this.$elmt),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.on("submit",{self:this},this._submitForm),this.$back.on("click",{self:this},this._backClick),this.$preview.on("click",{self:this},this._previewClick),this.$form.on("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.on("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.on("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.$form.on("ditty_field_update",".ditty-field__input",{self:this},this._checkUpdates),setTimeout((function(){t.trigger("init",[t])}),1)},_showItemList:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById","items")},_enablePreviewButton:function(){this.$preview.addClass("ditty-has-updates")},_disablePreviewButton:function(){this.$preview.removeClass("ditty-has-updates"),this.$preview.children("i").attr("class",this.$preview.children("i").data("class"))},_checkUpdates:function(t){var i=t?t.data.self:this;i.$form.serialize()!==i.initData?(i._enablePreviewButton(),i.settings.editor.addUpdate("item_settings",i.itemId),i.settings.editor.delayedSubmitEnable()):(i._disablePreviewButton(),i.settings.editor.removeUpdate("item_settings",i.itemId))},_addDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_backClick:function(t){t.preventDefault();var i=t.data.self;i.$form.serialize()===i.initData?i._showItemList():(i.afterUpdateAction="return",i.$form.trigger("submit"))},_previewClick:function(t){t.preventDefault();var i=t.data.self;i.$form.serialize()!==i.initData&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit"))},_submitForm:function(t){t.preventDefault();var i=t.data.self,e=i.itemId;i.settings.editor.updateStart();var s={action:"ditty_editor_item_update",item_id:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:s,error:function(){},success:function(t){if(t.value_updates&&i._updateValues(t.value_updates),i.initData=i.$form.serialize(),i._disablePreviewButton(),t.display_items&&i.settings.editor.ditty.updateItems(t.display_items,e),t.editor_item){var s=$(t.editor_item).children(".ditty-data-list__item__label").text();i.$title.html(s),i.$editorItemTitle.html(s)}t.draft_id&&t.draft_data&&dittyDraftItemUpdateData(i,t.draft_id,null,t.draft_data),t.draft_id&&t.draft_meta&&dittyDraftItemUpdateMeta(i,t.draft_id,null,t.draft_meta),i.settings.editor.updateStop(),i.settings.editor.delayedSubmitDisable(),"return"===i.afterUpdateAction&&i._showItemList(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty({return_items:0}),i.afterUpdateAction=""}})},_updateValues:function(t){var i=this;$.each(t,(function(t,e){var s=i.$form.find('[name="'+t+'"]');s.length&&s.val(e)}))},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_item_editor_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_item_editor_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._saveDrafts),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.off("submit",{self:this},this._submitForm),this.$back.off("click",{self:this},this._backClick),this.$preview.off("click",{self:this},this._previewClick),this.$form.off("keyup change",'input[type="text"], input[type="number"], textarea, select',{self:this},this._checkUpdates),this.$form.off("click",'input[type="radio"], input[type="checkbox"]',{self:this},this._checkUpdates),this.$form.off("ditty_input_wysiwyg_update",".ditty-input--wysiwyg",{self:this},this._checkUpdates),this.$form.off("ditty_field_update",".ditty-field__input",{self:this},this._checkUpdates),this.elmt._ditty_item_editor_panel=null}},$.fn.ditty_item_editor_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_item_editor_panel||(this._ditty_item_editor_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_item_editor_panel;if(!i)throw new Error("No Ditty_Item_Editor_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Item_Editor_Panel.');return void 0!==e?e:this}},$.ditty_item_editor_panel={},$.ditty_item_editor_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_displays_panel.defaults,e),this.$elmt=$(i),this.$list=$(i).find(".ditty-data-list__items"),this.$contents=$(i).find(".ditty-editor__panel__contents"),this.initDisplay=null,this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.$elmt.ditty_ui_data_list({filter:".ditty-display-panel__filter",item:".ditty-editor-display",itemSelector:"display_type"}),this.initDisplay=this.$list.data("active"),this._activateDisplay(this.$list.find("#ditty-editor-display--"+this.initDisplay)),this.$elmt.on("click",".ditty-data-list__item",{self:this},this._selectDisplay),this.$elmt.on("click",".ditty-data-list__item__edit",{self:this},this._editDisplay),this.$elmt.on("click",".ditty-data-list__item__clone",{self:this},this._cloneDisplay),this.$elmt.on("click",".ditty-data-list__item__delete",{self:this},this._deleteDisplay),this.settings.editor.$elmt.on("ditty_editor_saveDrafts",{self:this},this._saveDrafts)},_saveDrafts:function(t){var i=t.data.self;i.initDisplay=i.$list.find(".ditty-editor-display.active").data("display_id")},_activateDisplay:function(t){this.$list.find(".ditty-editor-display").removeClass("active"),t.addClass("active")},_initDitty:function(t,i,e){var s=this.settings.editor.ditty.$elmt;e.display=i,e.id=this.settings.editor.ditty.options("id"),e.items=this.settings.editor.ditty.options("items"),e.height=this.settings.editor.ditty.options("height"),this.settings.editor.ditty.destroy(),s["ditty_"+t](e),this.settings.editor.ditty=s["ditty_"+t]("options","ditty")},_selectDisplay:function(t){t.preventDefault();var i=t.data.self;if($(t.target).parent().is("a"))return!1;var e=$(t.target).is(".ditty-data-list__item")?$(t.target):$(t.target).parents(".ditty-data-list__item"),s=e.data("display_id"),a=e.data("display_type");if(e.hasClass("active"))return!1;i.settings.editor.updateStart(),dittyDraftUpdate(i,"post_meta","_ditty_display",s),i._activateDisplay(e);var d={action:"ditty_editor_select_display",display_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,d,(function(t){if(!t)return!1;i._initDitty(a,s,t),i.settings.editor.updateStop()}),"json")},_cloneDisplay:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("display_id");i.settings.editor.updateStart();var a={action:"ditty_editor_display_clone",display_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t.editor_display){var s=$(t.editor_display);s.hide(),e.after(s),s.slideDown()}t.draft_id&&t.draft_data&&dittyDraftDisplayUpdate(i,t.draft_id,null,t.draft_data),i.settings.editor.updateStop()}),"json")},_deleteDisplay:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=null,a=e.data("display_id");e.hasClass("active")&&(e.prev().length?s=e.prev():e.next().length&&(s=e.next())),e.slideUp((function(){$(this).remove()})),dittyDraftDisplayDelete(i,a),null!==s&&s.trigger("click")},_editDisplay:function(t){t.preventDefault();var i=t.data.self;i.$displayEdit=$(this).parents(".ditty-data-list__item");var e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("display_id");i.settings.editor.updateStart(),e.addClass("editing");var a={action:"ditty_editor_display_fields",display_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,a,(function(t){if(t){var e='<div class="ditty-editor__panel ditty-editor__panel--displayEditor">'+t+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel("display_editor",e)}}))},panelVisible:function(){this.$elmt.find(".ditty-data-list__item").removeClass("editing")},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_displays_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_displays_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.$elmt.ditty_ui_data_list("destroy"),this.$elmt.off("click",".ditty-data-list__item",{self:this},this._selectDisplay),this.$elmt.off("click",".ditty-data-list__item__edit",{self:this},this._editDisplay),this.$elmt.off("click",".ditty-data-list__item__clone",{self:this},this._cloneDisplay),this.$elmt.off("click",".ditty-data-list__item__delete",{self:this},this._deleteDisplay),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.trigger("destroy"),this.elmt._ditty_displays_panel=null}},$.fn.ditty_displays_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_displays_panel||(this._ditty_displays_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_displays_panel;if(!i)throw new Error("No Ditty_Displays_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Displays_Panel.');return void 0!==e?e:this}},$.ditty_displays_panel={},$.ditty_displays_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_display_editor_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$optionsTitle=this.$elmt.find(".ditty-editor-options__title"),this.$importExportField=this.$elmt.find(".ditty-editor__import-export__field"),this.$importExportUpdate=this.$elmt.find(".ditty-editor__import-export__update"),this.displayTitle=null,this.displayId=this.settings.editor.ditty.options("display"),this.displayType=this.settings.editor.ditty.options("type"),this.$editorDisplay=this.settings.editor.$panels.find(".ditty-editor__panel--displays").find(".ditty-data-list__item.editing"),this.$editorDisplayTitle=this.$editorDisplay.find(".ditty-data-list__item__label"),this.displayOptions=null,this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){var t,i=this;this.initData=this.$form.serialize(),this.settings.editor.initFields(this.$elmt),t=this.settings.editor.ditty.$elmt["ditty_"+this.displayType]("options"),this.displayOptions=$.extend({},t),this.displayTitle=this.$optionsTitle.val(),this.$importExportUpdate.on("click",{self:this},this._importUpdate),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.on("submit",{self:this},this._submitForm),this.$back.on("click",{self:this},this._backClick),this.$elmt.on("change",'input[type="text"], input[type="number"]',{self:this},this._textfieldListeners),this.$form.on("click",'input[type="radio"]',{self:this},this._radioListeners),this.$form.on("click",'input[type="checkbox"]',{self:this},this._checkboxListeners),this.$form.on("change","select",{self:this},this._selectListeners),this.$form.on("ditty_field_clone_update",{self:this},this._cloneListeners),setTimeout((function(){i.trigger("init",[i])}),1)},_showDisplayList:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById","displays")},_checkUpdates:function(){this.$form.serialize()!==this.initData?(this.settings.editor.addUpdate("displaySettings",this.displayId),this.settings.editor.delayedSubmitEnable()):this.settings.editor.removeUpdate("displaySettings",this.displayId)},_addDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.$form.serialize()!==i.initData&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_backClick:function(t){t.preventDefault();var i=t.data.self;i.$form.serialize()===i.initData?i._showDisplayList():(i.afterUpdateAction="return",i.$form.trigger("submit"))},_submitForm:function(t){t.preventDefault();var i=t.data.self;i.settings.editor.updateStart();var e={action:"ditty_editor_display_update",display_id:i.displayId,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:e,success:function(t){i.initData=i.$form.serialize(),t.draft_id&&t.draft_label&&(i.displayTitle=t.draft_label,i.$editorDisplayTitle.text(t.draft_label),dittyDraftDisplayUpdate(i,t.draft_id,"label",t.draft_label)),t.draft_id&&t.draft_settings&&(i.displayOptions=t.draft_settings,dittyDraftDisplayUpdate(i,t.draft_id,"settings",t.draft_settings)),t.draft_settings_json&&i.$importExportField.length&&i.$importExportField.val(t.draft_settings_json),i.settings.editor.updateStop(),i.settings.editor.delayedSubmitDisable(),"return"===i.afterUpdateAction&&i._showDisplayList(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty(),i.afterUpdateAction=""}})},_importUpdate:function(t){t.preventDefault()},_cloneListeners:function(t,i,e){var s=t.data.self;$(t.target);s.settings.editor.ditty.options(e,i)},_textfieldListeners:function(t){var i=t.data.self,e=$(t.target),s=e.attr("name"),a=e.parents(".ditty-input--spacing__group, .ditty-input--radius__group");if(a.length){var d="",r={};a.find("input").each((function(){s=$(this).attr("name"),d=(d=s.split("["))[0];var t=s.match(/\[(.*)\]/);r[t[1]]=$(this).val()})),i.settings.editor.ditty.options(d,r)}else i.settings.editor.ditty.options(s,e.val());i._checkUpdates()},_radioListeners:function(t){var i=t.data.self,e=$(t.target),s=e.val(),a=e.attr("name");i.settings.editor.ditty.options(a,s),i._checkUpdates()},_checkboxListeners:function(t){var i=t.data.self,e=$(t.target),s=!!e.is(":checked")&&$(this).val(),a=e.attr("name");i.settings.editor.ditty.options(a,s),i._checkUpdates()},_selectListeners:function(t){var i=t.data.self,e=$(t.target),s=e.val(),a=e.attr("name");i.settings.editor.ditty.options(a,s),i._checkUpdates()},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_display_editor_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_display_editor_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.trigger("destroy",[this]),this.$importExportUpdate.off("click",{this:this},this._importUpdate),this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.$form.off("submit",{this:this},this._submitForm),this.$back.off("click",{this:this},this._cancel_click),this.$elmt.off("change",'input[type="text"], input[type="number"]',{self:this},this._textfieldListeners),this.$form.off("click",'input[type="radio"]',{self:this},this._radioListeners),this.$form.off("click",'input[type="checkbox"]',{self:this},this._checkboxListeners),this.$form.off("change","select",{self:this},this._selectListeners),this.$form.off("ditty_field_clone_update",{self:this},this._cloneListeners),this.elmt._ditty_display_editor_panel=null}},$.fn.ditty_display_editor_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_display_editor_panel||(this._ditty_display_editor_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_display_editor_panel;if(!i)throw new Error("No Ditty_Display_Editor_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Display_Editor_Panel.');return void 0!==e?e:this}},$.ditty_display_editor_panel={},$.ditty_display_editor_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_layout_variations_panel.defaults,e),this.$elmt=$(i),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$list=$(i).find(".ditty-data-list__items"),this.$editorItem=dittyVars.editor.currentItem,this.editorItemLabel=this.$editorItem.find(".ditty-data-list__item__label").text(),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.editorItemType=this.$editorItem.data("item_type"),this.editorItemValue=this.$editorItem.data("item_value"),this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.$back.on("click",{self:this},this._backClick),this.$elmt.on("click",".ditty-layout-variation__change",{self:this},this._changeTemplate),this.$elmt.on("click",".ditty-layout-variation__edit_html",{self:this,editType:"html"},this._editLayout),this.$elmt.on("click",".ditty-layout-variation__edit_css",{self:this,editType:"css"},this._editLayout),$("body").on("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse)},_showItemList:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById","items")},_backClick:function(t){t.preventDefault(),t.data.self._showItemList()},_dittyEditorSaveResponse:function(t,i){t.data.self;i.ditty_new_layout_ids&&$.each(i.ditty_new_layout_ids,(function(t,i){var e=$('.ditty-layout-variation[data-layout_id="'+t+'"]');e.length&&e.attr("data-layout_id",i).data("layout_id",i)}))},_changeTemplate:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("layout_id"),a=e.data("layout_variation_id"),d=e.data("layout_variation_label");dittyVars.editor.currentLayoutVariation=e,i.settings.editor.updateStart(),e.addClass("editing");var r={action:"ditty_editor_layouts",ditty_id:i.editorDittyId,item_type:i.editorItemType,variation_id:a,variation_label:d,layout_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,r,(function(t){if(t){var e='<div class="ditty-editor__panel ditty-editor__panel--layouts">'+t+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel("layouts",e)}}))},_editLayout:function(t){t.preventDefault();var i=t.data.self,e=t.data.editType,s=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),a=s.data("layout_id");dittyVars.editor.currentLayoutVariation=s,i.settings.editor.updateStart(),i.$list.find(".ditty-data-list__item").removeClass("editing"),s.addClass("editing");var d=[],r=i.settings.editor.ditty.options("items");$.each(r,(function(t,i){d.push(i.uniqId)}));var o={action:"ditty_editor_layout_fields",layout_id:a,item_type:i.editorItemType,item_value:i.editorItemValue,ditty_id:i.editorDittyId,item_id:i.editorItemId,item_ids:d,edit_type:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,o,(function(t){if(t){var s="layout_"+e+"_editor",a='<div class="ditty-editor__panel ditty-editor__panel--'+s+'">'+t.form+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel(s,a)}}),"json")},panelVisible:function(){this.$list.find(".ditty-layout-variation").removeClass("editing")},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_layout_variations_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_layout_variations_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.$back.off("click",{self:this},this._backClick),this.$elmt.off("click",".ditty-layout-variation__change",{self:this},this._changeTemplate),this.$elmt.off("click",".ditty-layout-variation__edit_html",{self:this,editType:"html"},this._editLayout),this.$elmt.off("click",".ditty-layout-variation__edit_css",{self:this,editType:"css"},this._editLayout),$("body").off("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),this.elmt._ditty_layout_variations_panel=null}},$.fn.ditty_layout_variations_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_layout_variations_panel||(this._ditty_layout_variations_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_layout_variations_panel;if(!i)throw new Error("No Ditty_Layout_Variations_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Layout_Variations_Panel.');return void 0!==e?e:this}},$.ditty_layout_variations_panel={},$.ditty_layout_variations_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_layouts_panel.defaults,e),this.$elmt=$(i),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$list=$(i).find(".ditty-data-list__items"),this.$editorItem=dittyVars.editor.currentItem,this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.editorItemtype=this.$editorItem.data("item_type"),this.editorItemValue=this.$editorItem.data("item_value"),this.$editorVariation=dittyVars.editor.currentLayoutVariation,this.editorVariationId=this.$editorVariation.data("layout_variation_id"),this.editorLayoutId=this.$editorVariation.data("layout_id"),this._init()};i.prototype={_init:function(){this.$elmt.addClass("init"),this.$back.on("click",{self:this},this._backClick),this.$elmt.on("click",".ditty-data-list__item",{self:this},this._selectLayout),this.$elmt.on("click",".ditty-data-list__item__edit_html",{self:this,editType:"html"},this._editLayout),this.$elmt.on("click",".ditty-data-list__item__edit_css",{self:this,editType:"css"},this._editLayout),this.$elmt.on("click",".ditty-data-list__item__clone",{self:this},this._cloneLayout),this.$elmt.on("click",".ditty-data-list__item__delete",{self:this},this._deleteLayout),this.$list.on("click",".ditty-editor-layout > a",{self:this},this._actionClick),$("body").on("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),this._activateLayout(this.$list.find("#ditty-editor-layout--"+this.editorLayoutId))},_activateLayout:function(t){this.$list.find(".ditty-editor-layout").removeClass("active"),t.addClass("active")},_showVariationsList:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById","layout_variations")},_backClick:function(t){t.preventDefault(),t.data.self._showVariationsList()},_dittyEditorSaveResponse:function(t,i){t.data.self;i.ditty_new_layout_ids&&$.each(i.ditty_new_layout_ids,(function(t,i){var e=$("#ditty-editor-layout--"+t);e.length&&(e.attr("id","ditty-editor-layout--"+i),e.attr("data-layout_id",i).data("layout_id",i))}))},_selectLayout:function(t){t.preventDefault();var i=t.data.self;if($(t.target).parent().is("a"))return!1;var e=$(t.target).is(".ditty-data-list__item")?$(t.target):$(t.target).parents(".ditty-data-list__item"),s=e.data("layout_id"),a=e.data("layout_version"),d=i.$editorItem.data("layout_value");if(e.hasClass("active"))return!1;$.each(d,(function(t){i.editorVariationId===t&&(d[t]=String(s))})),i.settings.editor.updateStart(),dittyDraftItemUpdateData(i,i.editorItemId,"layout_value",d),i._activateLayout(e);var r={action:"ditty_editor_select_layout",layout_id:s,item_id:i.editorItemId,ditty_id:i.editorDittyId,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,r,(function(t){if(i.settings.editor.updateStop(),t.display_items&&i.settings.editor.ditty.updateItems(t.display_items,i.editorItemId),t.editor_item){var e=$(t.editor_item);i.$editorItem.replaceWith(e)}i.$editorItem.attr("data-layout_value",d).data("layout_value",d),i.$editorVariation.attr("data-layout_id",s).data("layout_id",s),i.$editorVariation.find(".ditty-layout-variation__template > span").text(t.layout_label),a?i.$editorVariation.find(".ditty-layout-variation__template > small").text("("+a+")"):i.$editorVariation.find(".ditty-layout-variation__template > small").text("")}),"json")},_cloneLayout:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=e.data("layout_id");i.settings.editor.updateStart();var a={action:"ditty_editor_layout_clone",layout_id:s,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security}
3
+ ;$.post(dittyVars.ajaxurl,a,(function(t){if(t.editor_layout){var s=$(t.editor_layout);s.hide(),e.after(s),s.slideDown()}t.draft_id&&t.draft_meta&&dittyDraftLayoutUpdate(i,t.draft_id,null,t.draft_meta),i.settings.editor.updateStop()}),"json")},_deleteLayout:function(t){t.preventDefault();var i=t.data.self,e=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),s=null,a=e.data("layout_id");e.hasClass("active")&&(e.prev().length?s=e.prev():e.next().length&&(s=e.next())),e.slideUp((function(){$(this).remove()})),dittyDraftLayoutDelete(i,a),null!==s&&s.trigger("click")},_editLayout:function(t){t.preventDefault();var i=t.data.self,e=t.data.editType,s=($(t.target).is("a")?$(t.target):$(t.target).parent("a")).parents(".ditty-data-list__item"),a=s.data("layout_id");i.settings.editor.updateStart(),i.$list.find(".ditty-data-list__item").removeClass("editing"),s.addClass("editing");var d={action:"ditty_editor_layout_fields",layout_id:a,item_id:i.editorItemId,item_type:i.editorItemtype,item_value:i.editorItemValue,edit_type:e,draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,d,(function(t){if(t){var s="layout_"+e+"_editor",a='<div class="ditty-editor__panel ditty-editor__panel--'+s+'">'+t.form+"</div>";i.settings.editor.panelOptions("transition","slideLeft"),i.settings.editor.showPanel(s,a)}}),"json")},_actionClick:function(t){t.preventDefault();var i=t.data.self,e=$(t.target).is("a")?$(t.target):$(t.target).parent("a"),s=e.parents(".ditty-data-list__item"),a=s.data("layout_id");dittyVars.editor.currentLayout=s,$("body").trigger("ditty_editor_layout_action_click",[e,s,a,i.editorDittyId,i.settings.editor])},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_layouts_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_layouts_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$elmt.removeClass("init"),this.$back.off("click",{self:this},this._backClick),this.$elmt.off("click",".ditty-data-list__item",{self:this},this._selectLayout),this.$elmt.off("click",".ditty-data-list__item__edit_html",{self:this,editType:"html"},this._editLayout),this.$elmt.off("click",".ditty-data-list__item__edit_css",{self:this,editType:"css"},this._editLayout),this.$elmt.off("click",".ditty-data-list__item__clone",{self:this},this._cloneLayout),this.$elmt.off("click",".ditty-data-list__item__delete",{self:this},this._deleteLayout),this.$list.off("click",".ditty-editor-layout > a",{self:this},this._actionClick),$("body").off("ditty_editor_save_ditty_response",{self:this},this._dittyEditorSaveResponse),this.elmt._ditty_layouts_panel=null}},$.fn.ditty_layouts_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_layouts_panel||(this._ditty_layouts_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_layouts_panel;if(!i)throw new Error("No Ditty_Layouts_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Layouts_Panel.');return void 0!==e?e:this}},$.ditty_layouts_panel={},$.ditty_layouts_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null,prevPanel:""},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_layout_html_editor_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$textarea=this.$elmt.find(".ditty-editor-options__code"),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$preview=this.$elmt.find(".ditty-editor-options__preview"),this.$editCss=this.$elmt.find(".ditty-editor-options__edit-css"),this.$title=this.$elmt.find(".ditty-editor-options__title"),this.$tags=this.$elmt.find(".ditty-editor-options__tags"),this.itemType=this.$form.data("item_type"),this.layoutId=this.$form.data("layout_id"),this.$editorItem=dittyVars.editor.currentItem,this.$editorLayout=dittyVars.editor.currentLayout,this.$editorLayoutTitle=!!this.$editorLayout&&this.$editorLayout.find(".ditty-data-list__item__label"),this.$editorLayoutVariation=dittyVars.editor.currentLayoutVariation,this.$editorLayoutVariationTitle=this.$editorLayoutVariation.find(".ditty-layout-variation__template span"),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.editorItemType=this.$editorItem.data("item_type"),this.editorItemValue=this.$editorItem.data("item_value"),this.codeEditor=null,this.codeHasUpdates=!1,this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){this.initData=this.$form.serialize(),this._initEditor(),this.$back.on("click",{self:this},this._backClick),this.$preview.on("click",{self:this},this._previewClick),this.$editCss.on("click",{self:this},this._editCss),this.$form.on("submit",{self:this},this._submitForm),this.$form.on("click",".ditty-editor-options__tag",{self:this},this._insertTag),this.$title.on("keyup",{self:this},this._titleUpdate),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts)},_showPrevPanel:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById",this.settings.prevPanel)},_titleUpdate:function(t){var i=t.data.self;i.settings.editor.addUpdate("layoutUpdate",i.layoutId)},_enablePreviewButton:function(){this.$preview.addClass("ditty-has-updates")},_disablePreviewButton:function(){this.$preview.removeClass("ditty-has-updates"),this.$preview.children("i").attr("class",this.$preview.children("i").data("class"))},_getLayoutItems:function(){var t=this.settings.editor.ditty.options("items"),i=[];return $.each(t,(function(t,e){String(e.layoutId)===String(this.layoutId)&&i.push(e.id)})),i},_addDrafts:function(t){var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_backClick:function(t){t.preventDefault();var i=t.data.self;i.codeEditor.codemirror.save(),i.$form.serialize()!==i.initData||i.codeHasUpdates?(i.afterUpdateAction="return",i.$form.trigger("submit")):i._showPrevPanel()},_previewClick:function(t){t.preventDefault();var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit"))},_editCss:function(t){t.preventDefault();var i=t.data.self,e="layout_css_editor";if(i.settings.editor.updateStart(),i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit")),i.settings.editor.panelExists(e))i.settings.editor.$elmt.find(".ditty-editor__panel--layout_css_editor input.ditty-editor-options__title").val(i.$title.val()),i.settings.editor.panelOptions("transition","fade"),i.settings.editor.showPanel(e);else{var s={action:"ditty_editor_layout_fields",layout_id:i.layoutId,layout_title:i.$title.val(),ditty_id:i.editorDittyId,item_id:i.editorItemId,item_type:i.editorItemType,item_value:i.editorItemValue,edit_type:"css",draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,s,(function(t){if(t){var s='<div class="ditty-editor__panel ditty-editor__panel--'+e+'">'+t.form+"</div>";i.settings.editor.panelOptions("transition","fade"),i.settings.editor.showPanel(e,s)}}),"json")}},_submitForm:function(t){t.preventDefault();var i=t.data.self,e=i.layoutId,s=i.itemType,a=i._getLayoutItems();if(i.$form.hasClass("ditty-editor-has-errors"))return!1;i.codeEditor.codemirror.save(),i.settings.editor.updateStart();var d={action:"ditty_editor_layout_update",layout_id:e,item_type:s,item_ids:a,edit_type:"html",draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:d,success:function(t){i.initData=i.$form.serialize(),i._disablePreviewButton(),t.label&&(i.$editorLayoutTitle&&i.$editorLayoutTitle.html(t.label),i.$editorLayoutVariationTitle.html(t.label)),i.$editorLayoutTitle&&i.$editorLayoutTitle.find(".ditty-layout-version").remove(),i.$editorLayoutVariationTitle&&i.$editorLayoutVariationTitle.find(".ditty-layout-version").remove(),t.display_items&&i.settings.editor.ditty.updateItems(t.display_items,!1,!1,!0),t.draft_id&&t.draft_meta&&dittyDraftLayoutUpdate(i,t.draft_id,null,t.draft_meta),i.codeHasUpdates=!1,i.settings.editor.updateStop(),i.settings.editor.delayedSubmitDisable(),"return"===i.afterUpdateAction&&i._showPrevPanel(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty({return_items:0}),i.afterUpdateAction=""}})},_initEditor:function(){var t=this,i=wp.codeEditor.defaultSettings?_.clone(wp.codeEditor.defaultSettings):{};i.codemirror=_.extend({},i.codemirror,{indentUnit:2,tabSize:2}),this.codeEditor=wp.codeEditor.initialize(this.$textarea[0],i),this.codeEditor.codemirror.on("change",(function(){t.codeEditor.codemirror.save(),t.settings.editor.addUpdate("layout_html_update",t.layoutId),t.codeHasUpdates=!0,t._enablePreviewButton(),t.settings.editor.delayedSubmitEnable()}))},_insertTag:function(t){var i=t.data.self,e=$(t.target),s=e.text(),a=e.data("atts"),d=i.codeEditor.codemirror.getCursor();if(t.shiftKey&&a){var r="",o=s.length-1;$.each(a,(function(t,i){r+=" "+t+'="'+i.toString()+'"'})),s=s.substring(0,o)+r+s.substring(o)}i.codeEditor.codemirror.replaceRange(s,d),d.ch=d.ch+s.length,i.codeEditor.codemirror.setCursor(d)},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_layout_html_editor_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_layout_html_editor_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$back.off("click",{self:this},this._backClick),this.$preview.off("click",{self:this},this._previewClick),this.$editCss.off("click",{self:this},this._editCss),this.$form.off("submit",{self:this},this._submitForm),this.$form.off("click",".ditty-editor-options__tag",{self:this},this._insertTag),this.$title.off("keyup",{self:this},this._titleUpdate),this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.codeEditor.codemirror.off("change"),this.codeEditor.codemirror.toTextArea(),this.elmt._ditty_layout_html_editor_panel=null}},$.fn.ditty_layout_html_editor_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_layout_html_editor_panel||(this._ditty_layout_html_editor_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_layout_html_editor_panel;if(!i)throw new Error("No Ditty_Layout_Html_Editor_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Layout_Html_Editor_Panel.');return void 0!==e?e:this}},$.ditty_layout_html_editor_panel={},$.ditty_layout_html_editor_panel.defaults=t}(jQuery),function($){"use strict";var t={editor:null,prevPanel:""},i=function(i,e){this.elmt=i,this.settings=$.extend({},t,$.ditty_layout_css_editor_panel.defaults,e),this.$elmt=$(i),this.$form=this.$elmt.find(".ditty-editor-options"),this.$textarea=this.$elmt.find(".ditty-editor-options__code"),this.$back=this.$elmt.find(".ditty-editor-options__back"),this.$preview=this.$elmt.find(".ditty-editor-options__preview"),this.$editHtml=this.$elmt.find(".ditty-editor-options__edit-html"),this.$title=this.$elmt.find(".ditty-editor-options__title"),this.$body=this.$elmt.find(".ditty-editor-options__body"),this.$tags=this.$elmt.find(".ditty-editor-options__tags"),this.itemType=this.$form.data("item_type"),this.layoutId=this.$form.data("layout_id"),this.$editorItem=dittyVars.editor.currentItem,this.$editorLayout=dittyVars.editor.currentLayout,this.$editorLayoutTitle=!!this.$editorLayout&&this.$editorLayout.find(".ditty-data-list__item__label"),this.$editorLayoutVariation=dittyVars.editor.currentLayoutVariation,this.$editorLayoutVariationTitle=this.$editorLayoutVariation.find(".ditty-layout-variation__template span"),this.editorDittyId=this.$editorItem.data("ditty_id"),this.editorItemId=this.$editorItem.data("item_id"),this.editorItemType=this.$editorItem.data("item_type"),this.editorItemValue=this.$editorItem.data("item_value"),this.itemSelector="",this.codeEditor=null,this.codeHasUpdates=!1,this.initData=null,this.afterUpdateAction="",this._init()};i.prototype={_init:function(){this.initData=this.$form.serialize(),this._setCssSelector(),this._initEditor(),this.$back.on("click",{self:this},this._backClick),this.$preview.on("click",{self:this},this._previewClick),this.$editHtml.on("click",{self:this},this._editHtml),this.$form.on("submit",{self:this},this._submitForm),this.$form.on("click",".ditty-editor-options__tag",{self:this},this._insertTag),this.$title.on("keyup",{self:this},this._titleUpdate),this.$body.on("click",".ditty-editor-options__body__error",{self:this},this._removeErrorNotice),this.settings.editor.$elmt.on("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.on("ditty_editor_save_drafts",{self:this},this._saveDrafts)},_setCssSelector:function(){dittyVars.isTickerPost?this.itemSelector="#poststuff .ditty-layout--"+this.layoutId:this.itemSelector=".ditty-layout--"+this.layoutId},_showPrevPanel:function(){this.settings.editor.$panels.ditty_slider("options","transition","slideRight"),this.settings.editor.$panels.ditty_slider("showSlideById",this.settings.prevPanel)},_titleUpdate:function(t){var i=t.data.self;i.settings.editor.addUpdate("layoutUpdate",i.layoutId)},_enablePreviewButton:function(){this.$preview.addClass("ditty-has-updates")},_disablePreviewButton:function(){this.$preview.removeClass("ditty-has-updates"),this.$preview.children("i").attr("class",this.$preview.children("i").data("class"))},_addDrafts:function(t){var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&i.$form.trigger("submit")},_saveDrafts:function(t){var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.afterUpdateAction="save",i.$form.trigger("submit"))},_backClick:function(t){t.preventDefault();var i=t.data.self;i.codeEditor.codemirror.save(),i.$form.serialize()!==i.initData||i.codeHasUpdates?(i.afterUpdateAction="return",i.$form.trigger("submit")):i._showPrevPanel()},_previewClick:function(t){t.preventDefault();var i=t.data.self;i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit"))},_editHtml:function(t){t.preventDefault();var i=t.data.self,e="layout_html_editor";if(i.settings.editor.updateStart(),i.codeEditor.codemirror.save(),(i.$form.serialize()!==i.initData||i.codeHasUpdates)&&(i.$preview.children("i").attr("class",dittyVars.updateIcon),i.$form.trigger("submit")),i.settings.editor.panelExists(e))i.settings.editor.$elmt.find(".ditty-editor__panel--layout_html_editor input.ditty-editor-options__title").val(i.$title.val()),i.settings.editor.panelOptions("transition","fade"),i.settings.editor.showPanel(e);else{var s={action:"ditty_editor_layout_fields",layout_id:i.layoutId,layout_title:i.$title.val(),ditty_id:i.editorDittyId,item_id:i.editorItemId,item_type:i.editorItemType,item_value:i.editorItemValue,edit_type:"html",draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};$.post(dittyVars.ajaxurl,s,(function(t){if(t){var s='<div class="ditty-editor__panel ditty-editor__panel--'+e+'">'+t.form+"</div>";i.settings.editor.panelOptions("transition","fade"),i.settings.editor.showPanel(e,s)}}),"json")}},_showErrorNotice:function(){var t=$('<div class="ditty-editor-options__body__error"><span>'+dittyVars.strings.layout_css_error+"</span></div>");this.$body.append(t)},_removeErrorNotice:function(t){t.data.self.$body.find(".ditty-editor-options__body__error").remove()},_submitForm:function(t){t.preventDefault();var i=t.data.self,e=i.layoutId,s=i.itemType;if(i.$form.hasClass("ditty-editor-has-errors"))return!1;i.codeEditor.codemirror.save(),i.settings.editor.updateStart();var a={action:"ditty_editor_layout_update",layout_id:e,item_type:s,edit_type:"css",draft_values:i.settings.editor.getDraftValues(),security:dittyVars.security};i.$form.ajaxSubmit({url:dittyVars.ajaxurl,type:"post",dataType:"json",data:a,success:function(t){i.initData=i.$form.serialize(),i._disablePreviewButton(),t.label&&(i.$editorLayoutTitle&&i.$editorLayoutTitle.html(t.label),i.$editorLayoutVariationTitle.html(t.label)),i.$editorLayoutTitle&&i.$editorLayoutTitle.find(".ditty-layout-version").remove(),i.$editorLayoutVariationTitle&&i.$editorLayoutVariationTitle.find(".ditty-layout-version").remove(),t.code?dittyLayoutCss(t.code,i.layoutId,"update"):i._showErrorNotice(),t.draft_id&&t.draft_meta&&dittyDraftLayoutUpdate(i,t.draft_id,null,t.draft_meta),i.codeHasUpdates=!1,i.settings.editor.updateStop(),i.settings.editor.delayedSubmitDisable(),"return"===i.afterUpdateAction&&i._showPrevPanel(),"save"===i.afterUpdateAction&&i.settings.editor.saveDitty(),i.afterUpdateAction=""}})},_initEditor:function(){var t=this,i=wp.codeEditor.defaultSettings?_.clone(wp.codeEditor.defaultSettings):{},e=dittyVars.editor.ditty_layouts_sass?"sass":"css";i.codemirror=_.extend({},i.codemirror,{mode:e,indentUnit:2,tabSize:2}),this.codeEditor=wp.codeEditor.initialize(this.$textarea[0],i),this.codeEditor.codemirror.on("change",(function(){t.codeEditor.codemirror.save(),t.settings.editor.addUpdate("layoutCssUpdate",t.layoutId),t.codeHasUpdates=!0,t._enablePreviewButton(),t.settings.editor.delayedSubmitEnable()}))},_insertTag:function(t){var i=t.data.self,e=$(t.target).text(),s=i.codeEditor.codemirror.getCursor();i.codeEditor.codemirror.replaceRange(e,s),s.ch=s.ch+e.length,i.codeEditor.codemirror.setCursor(s)},_options:function(t){return this.settings[t]},trigger:function(t,i){var e=[this.settings];i&&(e=i),this.$elmt.trigger("ditty_layout_css_editor_panel_"+t,e),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,e)},options:function(i,e){if("object"==typeof i)this.settings=$.extend({},t,$.ditty_layout_css_editor_panel.defaults,i);else{if("string"!=typeof i)return this.settings;if(void 0===e)return this.settings[i];this.settings[i]=e}this.trigger("options_update")},destroy:function(){this.$back.off("click",{self:this},this._backClick),this.$preview.off("click",{self:this},this._previewClick),this.$editHtml.off("click",{self:this},this._editHtml),this.$form.off("submit",{self:this},this._submitForm),this.$form.off("click",".ditty-editor-options__tag",{self:this},this._insertTag),this.$title.off("keyup",{self:this},this._titleUpdate),this.$body.off("click",".ditty-editor-options__body__error",{self:this},this._removeErrorNotice),this.settings.editor.$elmt.off("ditty_editor_add_drafts",{self:this},this._addDrafts),this.settings.editor.$elmt.off("ditty_editor_save_drafts",{self:this},this._saveDrafts),this.codeEditor.codemirror.off("change"),this.codeEditor.codemirror.toTextArea(),this.elmt._ditty_layout_css_editor_panel=null}},$.fn.ditty_layout_css_editor_panel=function(t){var e,s=arguments,a=!1;if(void 0===t||"object"==typeof t)return this.each((function(){this._ditty_layout_css_editor_panel||(this._ditty_layout_css_editor_panel=new i(this,t))}));if("string"==typeof t){if(this.each((function(){var i=this._ditty_layout_css_editor_panel;if(!i)throw new Error("No Ditty_Layout_Css_Editor_Panel applied to this element.");"function"==typeof i[t]&&"_"!==t[0]?e=i[t].apply(i,[].slice.call(s,1)):a=!0})),a)throw new Error('No method "'+t+'" in Ditty_Layout_Css_Editor_Panel.');return void 0!==e?e:this}},$.ditty_layout_css_editor_panel={},$.ditty_layout_css_editor_panel.defaults=t}(jQuery),jQuery((function($){!function(){"use strict";function t(t,i){0===parseInt(i)?t.hide():t.show()}function i(t,i){"none"===i?t.hide():t.show()}function e(t,i){"none"===i?t.hide():t.show()}$("#ditty-editor").on("ditty_display_editor_panel_init",".ditty-editor__panel--displayEditor",(function(s,a){if("list"===a.displayType){var d=a.$form,r=d.find(".ditty-field--perPage"),o=d.find(".ditty-field--arrows").siblings(),n=d.find(".ditty-field--bullets").siblings();t(r,d.find('input[name="paging"]:checked').val()),d.find('input[name="paging"]').on("change",(function(){t(r,$(this).val())})),i(o,d.find('select[name="arrows"]').val()),d.find('select[name="arrows"]').on("change",(function(){i(o,$(this).val())})),e(n,d.find('select[name="bullets"]').val()),d.find('select[name="bullets"]').on("change",(function(){e(n,$(this).val())}))}}))}()})),jQuery((function($){!function(){"use strict";function t(t){var i=t.find('input[name="direction"]:checked').val(),e=t.find(".ditty-field--minHeight"),s=t.find(".ditty-field--maxHeight"),a=t.find('input[name="minHeight"]');if("down"===i||"up"===i){if(e.show(),s.show(),""===a.val()){var d=t.parents("#ditty-editor__settings")[0],r="300px";a.val(r),d._ditty_editor.ditty.options("minHeight",r)}}else e.hide(),s.hide()}function i(t){"filled"===t.find('input[name="scrollInit"]:checked').val()?t.find(".ditty-field--scrollDelay").show():t.find(".ditty-field--scrollDelay").hide()}function e(t){var i=t.find('select[name="titleDisplay"]').val(),e=t.find(".ditty-field--titleDisplay");"none"===i?e.siblings().hide():e.siblings().show()}$("#ditty-editor").on("ditty_display_editor_panel_init",".ditty-editor__panel--displayEditor",(function(s,a){if("ticker"===a.displayType){var d=a.$form;t(d),d.find('input[name="direction"]').on("click",(function(){t(d)})),i(d),d.find('input[name="scrollInit"]').on("click",(function(){i(d)})),e(d),d.find('select[name="titleDisplay"]').on("change",(function(){e(d)}))}}))}()})),jQuery((function($){!function(){"use strict";function t(t){"full"===t.find('input[name="content_display"]:checked').val()?(t.find(".ditty-field--more_link").hide(),t.find(".ditty-field--excerpt_length").hide(),t.find(".ditty-field--more").hide(),t.find(".ditty-field--more_before").hide(),t.find(".ditty-field--more_after").hide()):(t.find(".ditty-field--more_link").show(),t.find(".ditty-field--excerpt_length").show(),t.find(".ditty-field--more").show(),t.find(".ditty-field--more_before").show(),t.find(".ditty-field--more_after").show())}$("#ditty-editor").on("ditty_item_editor_panel_init",".ditty-editor__panel--item_editor",(function(i,e){if("posts_feed"!==e.itemType&&"post"!==e.itemType)return!1;var s=e.$form;t(s),s.on("click",'input[name="content_display"]',(function(){t(s)}))}))}()}));
includes/js/editor/class-ditty-layout-css-editor-panel.js CHANGED
@@ -36,6 +36,8 @@
36
  this.$editorLayoutVariationTitle = this.$editorLayoutVariation.find( '.ditty-layout-variation__template span' );
37
  this.editorDittyId = this.$editorItem.data( 'ditty_id' );
38
  this.editorItemId = this.$editorItem.data( 'item_id' );
 
 
39
  this.itemSelector = '';
40
  this.codeEditor = null;
41
  this.codeHasUpdates = false;
@@ -229,7 +231,8 @@
229
  layout_title : self.$title.val(),
230
  ditty_id : self.editorDittyId,
231
  item_id : self.editorItemId,
232
- item_type : self.itemType,
 
233
  edit_type : 'html',
234
  draft_values : self.settings.editor.getDraftValues(),
235
  security : dittyVars.security
36
  this.$editorLayoutVariationTitle = this.$editorLayoutVariation.find( '.ditty-layout-variation__template span' );
37
  this.editorDittyId = this.$editorItem.data( 'ditty_id' );
38
  this.editorItemId = this.$editorItem.data( 'item_id' );
39
+ this.editorItemType = this.$editorItem.data( 'item_type' );
40
+ this.editorItemValue = this.$editorItem.data( 'item_value' );
41
  this.itemSelector = '';
42
  this.codeEditor = null;
43
  this.codeHasUpdates = false;
231
  layout_title : self.$title.val(),
232
  ditty_id : self.editorDittyId,
233
  item_id : self.editorItemId,
234
+ item_type : self.editorItemType,
235
+ item_value : self.editorItemValue,
236
  edit_type : 'html',
237
  draft_values : self.settings.editor.getDraftValues(),
238
  security : dittyVars.security
includes/js/editor/class-ditty-layout-html-editor-panel.js CHANGED
@@ -36,6 +36,8 @@
36
  this.$editorLayoutVariationTitle = this.$editorLayoutVariation.find( '.ditty-layout-variation__template span' );
37
  this.editorDittyId = this.$editorItem.data( 'ditty_id' );
38
  this.editorItemId = this.$editorItem.data( 'item_id' );
 
 
39
  this.codeEditor = null;
40
  this.codeHasUpdates = false;
41
  this.initData = null;
@@ -227,7 +229,8 @@
227
  layout_title : self.$title.val(),
228
  ditty_id : self.editorDittyId,
229
  item_id : self.editorItemId,
230
- item_type : self.itemType,
 
231
  edit_type : 'css',
232
  draft_values : self.settings.editor.getDraftValues(),
233
  security : dittyVars.security
36
  this.$editorLayoutVariationTitle = this.$editorLayoutVariation.find( '.ditty-layout-variation__template span' );
37
  this.editorDittyId = this.$editorItem.data( 'ditty_id' );
38
  this.editorItemId = this.$editorItem.data( 'item_id' );
39
+ this.editorItemType = this.$editorItem.data( 'item_type' );
40
+ this.editorItemValue = this.$editorItem.data( 'item_value' );
41
  this.codeEditor = null;
42
  this.codeHasUpdates = false;
43
  this.initData = null;
229
  layout_title : self.$title.val(),
230
  ditty_id : self.editorDittyId,
231
  item_id : self.editorItemId,
232
+ item_type : self.editorItemType,
233
+ item_value : self.editorItemValue,
234
  edit_type : 'css',
235
  draft_values : self.settings.editor.getDraftValues(),
236
  security : dittyVars.security
includes/js/editor/class-ditty-layout-variations-panel.js CHANGED
@@ -22,6 +22,7 @@
22
  this.editorDittyId = this.$editorItem.data( 'ditty_id' );
23
  this.editorItemId = this.$editorItem.data( 'item_id' );
24
  this.editorItemType = this.$editorItem.data( 'item_type' );
 
25
 
26
  this._init();
27
  };
@@ -140,8 +141,7 @@
140
  editType = e.data.editType,
141
  $button = $( e.target ).is( 'a' ) ? $( e.target ) : $( e.target ).parent( 'a' ),
142
  $layoutVariation = $button.parents( '.ditty-data-list__item' ),
143
- layoutId = $layoutVariation.data( 'layout_id' ),
144
- itemType = $layoutVariation.data( 'item_type' );
145
 
146
  dittyVars.editor.currentLayoutVariation = $layoutVariation; // Set the current layout variation
147
 
@@ -160,8 +160,8 @@
160
  var data = {
161
  action : 'ditty_editor_layout_fields',
162
  layout_id : layoutId,
163
- item_type : itemType,
164
- item_value : self.$editorItem.data( 'item_value' ),
165
  ditty_id : self.editorDittyId,
166
  item_id : self.editorItemId,
167
  item_ids : itemIds,
22
  this.editorDittyId = this.$editorItem.data( 'ditty_id' );
23
  this.editorItemId = this.$editorItem.data( 'item_id' );
24
  this.editorItemType = this.$editorItem.data( 'item_type' );
25
+ this.editorItemValue = this.$editorItem.data( 'item_value' );
26
 
27
  this._init();
28
  };
141
  editType = e.data.editType,
142
  $button = $( e.target ).is( 'a' ) ? $( e.target ) : $( e.target ).parent( 'a' ),
143
  $layoutVariation = $button.parents( '.ditty-data-list__item' ),
144
+ layoutId = $layoutVariation.data( 'layout_id' );
 
145
 
146
  dittyVars.editor.currentLayoutVariation = $layoutVariation; // Set the current layout variation
147
 
160
  var data = {
161
  action : 'ditty_editor_layout_fields',
162
  layout_id : layoutId,
163
+ item_type : self.editorItemType,
164
+ item_value : self.editorItemValue,
165
  ditty_id : self.editorDittyId,
166
  item_id : self.editorItemId,
167
  item_ids : itemIds,
includes/js/editor/class-ditty-layouts-panel.js CHANGED
@@ -21,6 +21,7 @@
21
  this.editorDittyId = this.$editorItem.data( 'ditty_id' );
22
  this.editorItemId = this.$editorItem.data( 'item_id' );
23
  this.editorItemtype = this.$editorItem.data( 'item_type' );
 
24
  this.$editorVariation = dittyVars.editor.currentLayoutVariation;
25
  this.editorVariationId = this.$editorVariation.data( 'layout_variation_id' );
26
  this.editorLayoutId = this.$editorVariation.data( 'layout_id' );
@@ -289,6 +290,8 @@
289
  action : 'ditty_editor_layout_fields',
290
  layout_id : layoutId,
291
  item_id : self.editorItemId,
 
 
292
  edit_type : editType,
293
  draft_values : self.settings.editor.getDraftValues(),
294
  security : dittyVars.security
21
  this.editorDittyId = this.$editorItem.data( 'ditty_id' );
22
  this.editorItemId = this.$editorItem.data( 'item_id' );
23
  this.editorItemtype = this.$editorItem.data( 'item_type' );
24
+ this.editorItemValue = this.$editorItem.data( 'item_value' );
25
  this.$editorVariation = dittyVars.editor.currentLayoutVariation;
26
  this.editorVariationId = this.$editorVariation.data( 'layout_variation_id' );
27
  this.editorLayoutId = this.$editorVariation.data( 'layout_id' );
290
  action : 'ditty_editor_layout_fields',
291
  layout_id : layoutId,
292
  item_id : self.editorItemId,
293
+ item_type : self.editorItemtype,
294
+ item_value : self.editorItemValue,
295
  edit_type : editType,
296
  draft_values : self.settings.editor.getDraftValues(),
297
  security : dittyVars.security
includes/js/editor/ditty-ticker-display-editor.js CHANGED
@@ -6,27 +6,84 @@ jQuery( function( $ ) {
6
  (function() {
7
 
8
  "use strict";
9
-
10
- function modifyHeights( $minHeight, $maxHeight, directionValue ) {
11
- if ( 'down' === directionValue || 'up' === directionValue ) {
 
 
 
 
 
 
 
 
 
 
12
  $minHeight.show();
13
  $maxHeight.show();
 
 
 
 
 
 
 
14
  } else {
15
  $minHeight.hide();
16
  $maxHeight.hide();
17
  }
18
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  $( '#ditty-editor' ).on( 'ditty_display_editor_panel_init', '.ditty-editor__panel--displayEditor', function( e, editorPanel ) {
21
  if ( 'ticker' === editorPanel.displayType ) {
22
- var $form = editorPanel.$form,
23
- $minHeight = $form.find( '.ditty-field--minHeight' ),
24
- $maxHeight = $form.find( '.ditty-field--maxHeight' );
 
 
 
 
 
 
 
 
 
 
25
 
26
- // Set heights
27
- modifyHeights( $minHeight, $maxHeight, $form.find( 'input[name="direction"]:checked' ).val() );
28
- $form.find( 'input[name="direction"]' ).on( 'change', function() {
29
- modifyHeights( $minHeight, $maxHeight, $( this ).val() );
30
  } );
31
  }
32
  } );
6
  (function() {
7
 
8
  "use strict";
9
+
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' ),
19
+ $minHeightInput = $form.find( 'input[name="minHeight"]' );
20
+
21
+ if ( 'down' === val || 'up' === val ) {
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();
33
  $maxHeight.hide();
34
  }
35
  }
36
+
37
+ /**
38
+ * Set the scroll delay field visibility
39
+ *
40
+ * @since 3.0.13
41
+ */
42
+ function setScrollDelay( $form ) {
43
+ var val = $form.find( 'input[name="scrollInit"]:checked' ).val();
44
+ if ( 'filled' === val ) {
45
+ $form.find( '.ditty-field--scrollDelay' ).show();
46
+ } else {
47
+ $form.find( '.ditty-field--scrollDelay' ).hide();
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Set the title field visibility
53
+ *
54
+ * @since 3.0.13
55
+ */
56
+ function setTitleStyles( $form ) {
57
+ var val = $form.find( 'select[name="titleDisplay"]' ).val(),
58
+ $displayField = $form.find( '.ditty-field--titleDisplay' );
59
+
60
+ if ( 'none' === val ) {
61
+ $displayField.siblings().hide();
62
+ } else {
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
  } );
includes/layout-tag-helpers.php CHANGED
@@ -1,5 +1,24 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  /**
4
  * Return a rendered link
5
  *
1
  <?php
2
 
3
+ /**
4
+ * Return item meta
5
+ *
6
+ * @since 3.0.13
7
+ * @var html
8
+ */
9
+ function ditty_layout_item_meta( $data, $key = false ) {
10
+ if ( ! is_array( $data ) || ! isset( $data['item_meta'] ) ) {
11
+ return false;
12
+ }
13
+ if ( $key ) {
14
+ if ( ! isset( $data['item_meta'][$key] ) ) {
15
+ return false;
16
+ }
17
+ return $data['item_meta'][$key];
18
+ }
19
+ return $data['item_meta'];
20
+ }
21
+
22
  /**
23
  * Return a rendered link
24
  *
includes/layout-tag-hooks-default.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Modify the layout user avatar
5
+ *
6
+ * @since 3.0.13
7
+ * @var html
8
+ */
9
+ function ditty_default_layout_tag_author_avatar_data( $avatar_data, $item_type, $data, $atts ) {
10
+ $types = array(
11
+ 'default',
12
+ 'wp_editor',
13
+ );
14
+ if ( in_array( $item_type, $types ) ) {
15
+ if ( $item_author = ditty_layout_item_meta( $data, 'item_author' ) ) {
16
+ $avatar_data = array(
17
+ 'src' => get_avatar_url( $item_author ),
18
+ 'alt' => get_the_author_meta( 'display_name', $item_author ),
19
+ );
20
+ }
21
+ }
22
+ return $avatar_data;
23
+ }
24
+ add_filter( 'ditty_layout_tag_author_avatar_data', 'ditty_default_layout_tag_author_avatar_data', 10, 4 );
25
+
26
+ /**
27
+ * Modify the layout author name
28
+ *
29
+ * @since 3.0.13
30
+ * @var html
31
+ */
32
+ function ditty_default_layout_tag_author_name( $author_name, $item_type, $data, $atts ) {
33
+ $types = array(
34
+ 'default',
35
+ 'wp_editor',
36
+ );
37
+ if ( in_array( $item_type, $types ) ) {
38
+ if ( $item_author = ditty_layout_item_meta( $data, 'item_author' ) ) {
39
+ $author_name = get_the_author_meta( 'display_name', $item_author );
40
+ }
41
+ }
42
+ return $author_name;
43
+ }
44
+ add_filter( 'ditty_layout_tag_author_name', 'ditty_default_layout_tag_author_name', 10, 4 );
45
+
46
+ /**
47
+ * Modify the layout author bio
48
+ *
49
+ * @since 3.0.13
50
+ * @var html
51
+ */
52
+ function ditty_default_layout_tag_author_bio( $author_bio, $item_type, $data, $atts ) {
53
+ $types = array(
54
+ 'default',
55
+ 'wp_editor',
56
+ );
57
+ if ( in_array( $item_type, $types ) ) {
58
+ if ( $item_author = ditty_layout_item_meta( $data, 'item_author' ) ) {
59
+ $author_bio = get_the_author_meta( 'description', $item_author );
60
+ }
61
+ }
62
+ return $author_bio;
63
+ }
64
+ add_filter( 'ditty_layout_tag_author_bio', 'ditty_default_layout_tag_author_bio', 10, 4 );
65
+
66
+ /**
67
+ * Modify the layout content
68
+ *
69
+ * @since 3.0.12
70
+ * @var html
71
+ */
72
+ function ditty_default_layout_tag_content( $content, $item_type, $data, $atts ) {
73
+ if ( 'default' == $item_type ) {
74
+ $content = $data['content'];
75
+ $url = ( isset( $data['link_url'] ) && '' != $data['link_url'] ) ? $data['link_url'] : false;
76
+ if ( $url ) {
77
+ $target = isset( $data['link_target'] ) ? $data['link_target'] : '_self';
78
+ $rel = isset( $data['link_nofollow'] ) ? 'nofollow' : '';
79
+ $title = isset( $data['link_title'] ) ? $data['link_title'] : '';
80
+ $content = sprintf( '<a href="%2$s" class="ditty-rss__author__link" target="%3$s" rel="%4$s" title="%5$s">%1$s</a>', $content, $url, $target, $rel, $title );
81
+ }
82
+ } elseif ( 'wp_editor' == $item_type ) {
83
+ $content = $data['content'];
84
+ }
85
+ return $content;
86
+ }
87
+ add_filter( 'ditty_layout_tag_content', 'ditty_default_layout_tag_content', 10, 4 );
88
+
89
+ /**
90
+ * Modify the layout timestamp
91
+ *
92
+ * @since 3.0.13
93
+ * @var html
94
+ */
95
+ function ditty_default_layout_tag_timestamp( $timestamp, $item_type, $data, $atts ) {
96
+ $types = array(
97
+ 'default',
98
+ 'wp_editor',
99
+ );
100
+ if ( in_array( $item_type, $types ) ) {
101
+ $timestamp = false;
102
+ if ( isset( $atts['type'] ) && 'item_modified' == $atts['type'] ) {
103
+ if ( $date_modified = ditty_layout_item_meta( $data, 'date_modified' ) ) {
104
+ $timestamp = strtotime( get_date_from_gmt( $date_modified ) );
105
+ }
106
+ }
107
+ if ( ! $timestamp && $date_created = ditty_layout_item_meta( $data, 'date_created' ) ) {
108
+ $timestamp = strtotime( get_date_from_gmt( $date_created ) );
109
+ }
110
+ }
111
+ return $timestamp;
112
+ }
113
+ add_filter( 'ditty_layout_tag_timestamp', 'ditty_default_layout_tag_timestamp', 10, 4 );
includes/layout-tag-hooks.php CHANGED
@@ -266,27 +266,4 @@ function ditty_init_layout_tag_time( $time, $item_type, $data, $atts ) {
266
  }
267
  return $time;
268
  }
269
- add_filter( 'ditty_layout_tag_time', 'ditty_init_layout_tag_time', 10, 4 );
270
-
271
- /**
272
- * Modify the layout content
273
- *
274
- * @since 3.0
275
- * @var html
276
- */
277
- function ditty_default_layout_tag_content( $content, $item_type, $data, $atts ) {
278
- if ( 'default' == $item_type ) {
279
- $content = $data['content'];
280
- $url = ( isset( $data['link_url'] ) && '' != $data['link_url'] ) ? $data['link_url'] : false;
281
- if ( $url ) {
282
- $target = isset( $data['link_target'] ) ? $data['link_target'] : '_self';
283
- $rel = isset( $data['link_nofollow'] ) ? 'nofollow' : '';
284
- $title = isset( $data['link_title'] ) ? $data['link_title'] : '';
285
- $content = sprintf( '<a href="%2$s" class="ditty-rss__author__link" target="%3$s" rel="%4$s" title="%5$s">%1$s</a>', $content, $url, $target, $rel, $title );
286
- }
287
- } elseif ( 'wp_editor' == $item_type ) {
288
- $content = $data['content'];
289
- }
290
- return $content;
291
- }
292
- add_filter( 'ditty_layout_tag_content', 'ditty_default_layout_tag_content', 10, 4 );
266
  }
267
  return $time;
268
  }
269
+ add_filter( 'ditty_layout_tag_time', 'ditty_init_layout_tag_time', 10, 4 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/sass/admin/_dashboard.scss CHANGED
@@ -110,4 +110,25 @@ table.wp-list-table .type-ditty_display .row-actions {
110
  }
111
  }
112
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
110
  }
111
  }
112
  }
113
+ .ditty-upgrade {
114
+ &__element {
115
+ display: flex;
116
+ flex-direction: row;
117
+ align-items: stretch;
118
+ justify-content: flex-start;
119
+ flex-wrap: wrap
120
+ }
121
+ &__start {
122
+ flex: 0 0 auto;
123
+ border-top-right-radius: 0 !important;
124
+ border-bottom-right-radius: 0 !important;
125
+ }
126
+ &__bar {
127
+ flex: 1;
128
+ background: #F7F7F7;
129
+ border: 1px solid #c3c4c7;
130
+ border-top-right-radius: 3px;
131
+ border-bottom-right-radius: 3px;
132
+ }
133
+ }
134
 
includes/sass/admin/_fields.scss CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  .ditty-field {
2
  //padding: 15px;
3
  padding: 10px 0;
@@ -10,12 +18,15 @@
10
  }
11
  &__label {
12
  display: block;
 
13
  font-weight: 600;
14
  margin-bottom: 10px;
15
  cursor: default;
16
  }
17
  &__help {
18
- font-size: 0.8em;
 
 
19
  }
20
  &__input {
21
  display: flex;
@@ -38,6 +49,9 @@
38
  &__after {
39
  margin-left: 5px;
40
  }
 
 
 
41
  input:not([type="button"]):not([type="checkbox"]):not([type="radio"]),
42
  select,
43
  textarea {
@@ -106,8 +120,9 @@
106
  }
107
  }
108
  }
109
- .ditty-field__label + .ditty-field__description {
110
- margin-top: 5px;
 
111
  }
112
  .ditty-field--clone-enabled {
113
  .ditty-input--clone {
@@ -162,8 +177,8 @@
162
  }
163
  > .ditty-field__heading {
164
  display: flex;
165
- flex-direction: row;
166
- align-items: center;
167
  justify-content: flex-start;
168
  color: #FFF;
169
  background: #32373C;
@@ -172,6 +187,10 @@
172
  label {
173
  margin-bottom: 0;
174
  }
 
 
 
 
175
  }
176
  .ditty-field__collapsible-toggle {
177
  position: absolute;
@@ -190,6 +209,11 @@
190
  border-radius: 50%;
191
  transition: transform .25s ease;
192
  }
 
 
 
 
 
193
  &[data-collapsible="expanded"] {
194
  .ditty-field__collapsible-toggle {
195
  transform: rotate( 180deg );
@@ -203,6 +227,9 @@
203
  // }
204
  // }
205
  }
 
 
 
206
  .ditty-input--group {
207
  margin: 0;
208
  &__container {
@@ -218,18 +245,25 @@
218
  }
219
 
220
  /* Checkboxes */
221
- .ditty-field-type--checkboxes {
222
- > .ditty-field__input {
223
- margin: -2px;
 
 
 
 
 
 
 
224
  }
225
- .ditty-input--checkboxes__group {
226
- display: flex;
227
  flex-direction: row;
228
  align-items: center;
229
- justify-content: flex-start;
230
- flex-wrap: wrap;
231
- > .ditty-field {
232
- margin: 2px;
 
233
  }
234
  }
235
  input[type="checkbox"] {
@@ -251,7 +285,7 @@
251
  flex-direction: column;
252
  align-items: flex-start;
253
  justify-content: flex-start;
254
- min-height: 36px;
255
  }
256
  &--inline {
257
  .ditty-field__input__primary {
@@ -349,6 +383,7 @@
349
  background: transparent;
350
  padding: 2px !important;
351
  margin: 0;
 
352
  &__input {
353
  position: relative;
354
  border-radius: 3px;
@@ -494,6 +529,7 @@
494
  }
495
  &__description {
496
  width: 100%;
 
497
  }
498
  }
499
 
@@ -573,6 +609,14 @@
573
  }
574
  }
575
 
 
 
 
 
 
 
 
 
576
  /* File */
577
  .ditty-input--file {
578
  .ditty-field__input__primary {
@@ -592,4 +636,23 @@
592
  border-top-left-radius: 0;
593
  border-bottom-left-radius: 0;
594
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
  }
1
+ .ditty-help-icon {
2
+ color: #93999F;
3
+ text-decoration: underline;
4
+ &.active {
5
+ color: $green;
6
+ }
7
+ }
8
+
9
  .ditty-field {
10
  //padding: 15px;
11
  padding: 10px 0;
18
  }
19
  &__label {
20
  display: block;
21
+ font-size: 14px;
22
  font-weight: 600;
23
  margin-bottom: 10px;
24
  cursor: default;
25
  }
26
  &__help {
27
+ display: none;
28
+ margin: 7px 0 10px;
29
+ //font-size: 0.8em;
30
  }
31
  &__input {
32
  display: flex;
49
  &__after {
50
  margin-left: 5px;
51
  }
52
+ &__description {
53
+ width: 100%;
54
+ }
55
  input:not([type="button"]):not([type="checkbox"]):not([type="radio"]),
56
  select,
57
  textarea {
120
  }
121
  }
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 {
177
  }
178
  > .ditty-field__heading {
179
  display: flex;
180
+ flex-direction: column;
181
+ align-items: flex-start;
182
  justify-content: flex-start;
183
  color: #FFF;
184
  background: #32373C;
187
  label {
188
  margin-bottom: 0;
189
  }
190
+ .ditty-field__help,
191
+ .ditty-field__desciption {
192
+ margin-bottom: 0;
193
+ }
194
  }
195
  .ditty-field__collapsible-toggle {
196
  position: absolute;
209
  border-radius: 50%;
210
  transition: transform .25s ease;
211
  }
212
+ &[data-collapsible] {
213
+ > .ditty-field__heading {
214
+ padding-right: 40px;
215
+ }
216
+ }
217
  &[data-collapsible="expanded"] {
218
  .ditty-field__collapsible-toggle {
219
  transform: rotate( 180deg );
227
  // }
228
  // }
229
  }
230
+ .ditty-field-only + .ditty-field-only {
231
+ margin-top: 20px;
232
+ }
233
  .ditty-input--group {
234
  margin: 0;
235
  &__container {
245
  }
246
 
247
  /* Checkboxes */
248
+ .ditty-input--checkboxes__group {
249
+ display: flex;
250
+ flex-direction: column;
251
+ align-items: stretch;
252
+ justify-content: flex-start;
253
+ flex-wrap: wrap;
254
+ .ditty-input--checkboxes__option {
255
+ display: block;
256
+ margin-top: 2px;
257
+ margin-bottom: 5px;
258
  }
259
+ &--inline {
 
260
  flex-direction: row;
261
  align-items: center;
262
+ .ditty-input--checkboxes__option {
263
+ margin-right: 15px;
264
+ &:last-child {
265
+ margin-right: 0;
266
+ }
267
  }
268
  }
269
  input[type="checkbox"] {
285
  flex-direction: column;
286
  align-items: flex-start;
287
  justify-content: flex-start;
288
+ //min-height: 36px;
289
  }
290
  &--inline {
291
  .ditty-field__input__primary {
383
  background: transparent;
384
  padding: 2px !important;
385
  margin: 0;
386
+ border: none;
387
  &__input {
388
  position: relative;
389
  border-radius: 3px;
529
  }
530
  &__description {
531
  width: 100%;
532
+ margin-bottom: 10px;
533
  }
534
  }
535
 
609
  }
610
  }
611
 
612
+ /* Button */
613
+ .ditty-field__input__primary,
614
+ .ditty-field-only--button {
615
+ > .ditty-button {
616
+ margin: 0;
617
+ }
618
+ }
619
+
620
  /* File */
621
  .ditty-input--file {
622
  .ditty-field__input__primary {
636
  border-top-left-radius: 0;
637
  border-bottom-left-radius: 0;
638
  }
639
+ }
640
+
641
+ /* Heading */
642
+ .ditty-field-type--heading {
643
+ background: #f7f7f7;
644
+ .ditty-field__heading {
645
+ flex: 0 0 100% !important;
646
+ width: 100% !important;
647
+ padding: 0 !important;
648
+ }
649
+ .ditty-field__label {
650
+ font-size: 16px;
651
+ line-height: 20px;
652
+ margin-top: 0;
653
+ margin-bottom: 0;
654
+ }
655
+ .ditty-field__description {
656
+ margin-bottom: 0;
657
+ }
658
  }
includes/sass/admin/_settings.scss CHANGED
@@ -110,7 +110,7 @@
110
  text-decoration: none;
111
  background-color: #32373C;
112
  border: none;
113
- transition: color .25s ease, background-color .25s ease;
114
  i {
115
  position: absolute;
116
  top: 10px;
@@ -122,16 +122,27 @@
122
  padding-left: 30px;
123
  }
124
  &:focus {
 
 
 
 
 
 
125
  color: #FFF;
126
  outline: none;
127
  box-shadow: none;
128
  }
129
- &:hover {
130
- color: #FFF;
131
- background-color: rgba(255, 255, 255, .2);
132
- }
 
 
133
  &.active {
134
  background-color: $green;
 
 
 
135
  &:after {
136
  right: 0;
137
  border: 9px solid transparent;
@@ -149,8 +160,7 @@
149
  &__panel {
150
  display: none;
151
  > .ditty-field {
152
- padding-left: 30px;
153
- padding-right: 30px;
154
  }
155
  }
156
  &__form {
@@ -234,9 +244,6 @@
234
  }
235
 
236
  /* Global Dittys */
237
- .ditty-settings__panel--global_ditty {
238
- padding: 10px 0;
239
- }
240
  .ditty-field--global_ditty {
241
  .ditty-input--clone {
242
  margin-bottom: 5px;
@@ -249,6 +256,7 @@
249
  .ditty-settings {
250
  &__tabs {
251
  width: 44px;
 
252
  }
253
  &__tab {
254
  padding: 10px 4px 10px 14px;
@@ -295,8 +303,8 @@
295
  align-items: flex-start;
296
  justify-content: flex-start;
297
  > .ditty-field__heading {
298
- flex: 0 0 200px;
299
- margin-right: 30px;
300
  > .ditty-field__label,
301
  > .ditty-field__description {
302
  margin-bottom: 0;
110
  text-decoration: none;
111
  background-color: #32373C;
112
  border: none;
113
+ //transition: color .25s ease, background-color .25s ease;
114
  i {
115
  position: absolute;
116
  top: 10px;
122
  padding-left: 30px;
123
  }
124
  &:focus {
125
+ color: #FFF;
126
+ outline: none;
127
+ //box-shadow: inset 0px 0px 2px;
128
+ box-shadow: none;
129
+ }
130
+ &:active {
131
  color: #FFF;
132
  outline: none;
133
  box-shadow: none;
134
  }
135
+ &:not(.active) {
136
+ &:hover {
137
+ color: $green;
138
+ background-color: rgba(0, 0, 0, .5);
139
+ }
140
+ }
141
  &.active {
142
  background-color: $green;
143
+ &:hover {
144
+ color: #FFF;
145
+ }
146
  &:after {
147
  right: 0;
148
  border: 9px solid transparent;
160
  &__panel {
161
  display: none;
162
  > .ditty-field {
163
+ padding: 25px 30px;
 
164
  }
165
  }
166
  &__form {
244
  }
245
 
246
  /* Global Dittys */
 
 
 
247
  .ditty-field--global_ditty {
248
  .ditty-input--clone {
249
  margin-bottom: 5px;
256
  .ditty-settings {
257
  &__tabs {
258
  width: 44px;
259
+ flex: 0 0 44px;
260
  }
261
  &__tab {
262
  padding: 10px 4px 10px 14px;
303
  align-items: flex-start;
304
  justify-content: flex-start;
305
  > .ditty-field__heading {
306
+ flex: 0 0 50%;
307
+ padding-right: 60px;
308
  > .ditty-field__label,
309
  > .ditty-field__description {
310
  margin-bottom: 0;
includes/sass/admin/_wizard.scss ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wp-admin.post-new-php.post-type-ditty {
2
+ &.ditty-wizard-enabled {
3
+ .wp-heading-inline,
4
+ .wp-header-end {
5
+ display: none;
6
+ }
7
+ }
8
+ }
9
+ #ditty-page.ditty-wizard {
10
+ #ditty-page__header {
11
+ display: flex;
12
+ flex-direction: column;
13
+ align-items: flex-start;
14
+ justify-content: flex-start;
15
+ }
16
+ input[name="ditty_title"] {
17
+ width: 100%;
18
+ height: 52px;
19
+ font-size: 1.3em;
20
+ font-weight: 600;
21
+ color: #1d2327;
22
+ border-color: #e0e3e7;
23
+ }
24
+ }
25
+ .ditty-wizard-header {
26
+ * {
27
+ box-sizing: border-box;
28
+ }
29
+ &__contents {
30
+ ul {
31
+ display: flex;
32
+ flex-direction: row;
33
+ align-items: center;
34
+ justify-content: flex-start;
35
+ gap: 5px;
36
+ li {
37
+ padding: 10px;
38
+ border: 1px solid #e0e3e7;
39
+ border-radius: 3px;
40
+ }
41
+ }
42
+ }
43
+ }
44
+ .ditty-instruction-number {
45
+ flex: 0 0 auto;
46
+ width: 40px;
47
+ height: 40px;
48
+ display: flex;
49
+ flex-direction: column;
50
+ align-items: center;
51
+ justify-content: center;
52
+ border: 2px solid #e0e3e7;
53
+ border-radius: 50%;
54
+ margin-right: 15px;
55
+ span {
56
+ font-size: 20px;
57
+ line-height: 20px;
58
+ font-weight: bold;
59
+ color: #e0e3e7;
60
+ }
61
+ }
62
+ .ditty-wizard-setting {
63
+ position: relative;
64
+ display: flex;
65
+ flex-direction: row;
66
+ align-items: flex-start;
67
+ justify-content: flex-start;
68
+ background: #FFF;
69
+ border-bottom: 1px solid #f7f7f7;
70
+ padding: 20px;
71
+ .ditty-wizard-setting__content {
72
+ flex: 1;
73
+ }
74
+ &:hover {
75
+ background: #f7f7f7;
76
+ .ditty-instruction-number {
77
+ border-color: $green;
78
+ span {
79
+ color: $green;
80
+ }
81
+ }
82
+ }
83
+ &.complete {
84
+ .ditty-instruction-number {
85
+ background-color: $green;
86
+ border-color: $green;
87
+ span {
88
+ color: #FFF;
89
+ }
90
+ }
91
+ }
92
+ &__title {
93
+ margin: 0 0 5px;
94
+ }
95
+ &__description {
96
+ margin: 5px 0 15px;
97
+ }
98
+ &--title {
99
+ input {
100
+ width: 100%;
101
+ padding-left: 15px;
102
+ padding-right: 15px;
103
+ }
104
+ }
105
+ &--item-type,
106
+ &--item-type-settings,
107
+ &--layout,
108
+ &--display,
109
+ &--submit {
110
+ display: none;
111
+ }
112
+ &--layout {
113
+ .ditty-option-grid__item {
114
+ width: 250px;
115
+ padding-bottom: 30px;
116
+ }
117
+ &__variation {
118
+ display: none;
119
+ padding: 20px;
120
+ border: 1px solid #e0e3e7;
121
+ border-radius: 3px;
122
+ margin-top: 15px;
123
+ &__title {
124
+ margin: 0;
125
+ }
126
+ .ditty-option-grid {
127
+ margin-top: 15px;
128
+ }
129
+ }
130
+ }
131
+ &--display {
132
+ .ditty-option-grid__item {
133
+ width: 250px;
134
+ padding-bottom: 30px;
135
+ &__title {
136
+ margin-bottom: 0;
137
+ }
138
+ }
139
+ }
140
+ &--submit {
141
+ justify-content: flex-end;
142
+ padding-top: 20px;
143
+ padding-bottom: 10px;
144
+ border-top: 1px solid rgba(0, 0, 0, 0.05);
145
+ .ditty-button {
146
+ margin: 0;
147
+ }
148
+ }
149
+ }
150
+ .ditty-option-grid {
151
+ display: flex;
152
+ flex-direction: row;
153
+ align-items: stretch;
154
+ justify-content: flex-start;
155
+ flex-wrap: wrap;
156
+ gap: 5px;
157
+ &__item {
158
+ position: relative;
159
+ display: flex;
160
+ flex-direction: column;
161
+ align-items: center;
162
+ justify-content: flex-start;
163
+ box-sizing: border-box;
164
+ font-size: 12px;
165
+ line-height: 18px;
166
+ text-align: center;
167
+ color: #3c434a;
168
+ padding: 20px;
169
+ background: #FFF;
170
+ border: 2px solid #e0e3e7;
171
+ border-radius: 3px;
172
+ width: 200px;
173
+ transition: border-color .25s ease, background-color .25s ease;
174
+ -webkit-appearance: none;
175
+ i {
176
+ font-size: 30px;
177
+ line-height: 30px;
178
+ transition: color .25s ease;
179
+ }
180
+ &__title {
181
+ font-size: 14px;
182
+ line-height: 18px;
183
+ margin: 15px 0 5px;
184
+ }
185
+ &__description {
186
+ display: none;
187
+ color: #93999f;
188
+ }
189
+ &__id {
190
+ position: absolute;
191
+ bottom: 2px;
192
+ left: 5px;
193
+ color: #93999f;
194
+ }
195
+ &__date {
196
+ position: absolute;
197
+ bottom: 2px;
198
+ right: 5px;
199
+ color: #93999f;
200
+ }
201
+ &:not(.active) {
202
+ cursor: pointer;
203
+ &:hover {
204
+ border-color: #c2c9d0;
205
+ }
206
+ }
207
+ &.active {
208
+ background-color: #EDF8ED;
209
+ border-color: $green;
210
+ .ditty-option-grid__item__description {
211
+ display: block;
212
+ }
213
+ }
214
+ }
215
+ }
216
+ .ditty-option-list {
217
+ display: flex;
218
+ flex-direction: column;
219
+ align-items: flex;
220
+ justify-content: flex-start;
221
+ flex-wrap: wrap;
222
+ gap: 5px;
223
+ &__item {
224
+ display: flex;
225
+ flex-direction: column;
226
+ align-items: flex-start;
227
+ justify-content: flex-start;
228
+ box-sizing: border-box;
229
+ font-size: 12px;
230
+ line-height: 18px;
231
+ text-align: left;
232
+ color: #3c434a;
233
+ padding: 5px 10px;
234
+ background: #FFF;
235
+ border: 2px solid #e0e3e7;
236
+ border-radius: 3px;
237
+ min-width: 150px;
238
+ transition: border-color .25s ease, background-color .25s ease;
239
+ -webkit-appearance: none;
240
+ &__title {
241
+ font-size: 14px;
242
+ line-height: 18px;
243
+ margin: 0;
244
+ transition: color .25s ease;
245
+ }
246
+ &__description {
247
+ color: #93999f;
248
+ transition: color .25s ease;
249
+ margin: 0;
250
+ }
251
+ &__date {
252
+ font-size: 11px;
253
+ color: #93999f;
254
+ transition: color .25s ease;
255
+ margin: 0;
256
+ }
257
+ &:not(.active) {
258
+ cursor: pointer;
259
+ &:hover {
260
+ border-color: #c2c9d0;
261
+ }
262
+ }
263
+ &.active {
264
+ background-color: #EDF8ED;
265
+ border-color: $green;
266
+ .ditty-option-grid__item__description {
267
+ display: block;
268
+ }
269
+ }
270
+ }
271
+ }
includes/sass/ditty-admin.scss CHANGED
@@ -10,4 +10,5 @@
10
  @import "admin/metabox";
11
  @import "admin/settings";
12
  @import "admin/upgrade_details";
13
- @import "admin/pages";
 
10
  @import "admin/metabox";
11
  @import "admin/settings";
12
  @import "admin/upgrade_details";
13
+ @import "admin/pages";
14
+ @import "admin/wizard";
includes/sass/editor/_displays_panel.scss CHANGED
@@ -41,4 +41,12 @@
41
  width: 50%;
42
  padding-left: 7.5px;
43
  }
 
 
 
 
 
 
 
 
44
  }
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
  }
includes/sass/editor/_editor.scss CHANGED
@@ -22,6 +22,13 @@ $update_color: orange;
22
  // * {
23
  // box-sizing: border-box;
24
  // }
 
 
 
 
 
 
 
25
  &__preview {
26
  order: 0;
27
  flex: 1;
@@ -42,7 +49,7 @@ $update_color: orange;
42
  padding: 15px;
43
  border-color: rgba( 0, 0, 0, 0.05 );
44
  &__label {
45
- font-weight: 400;
46
  }
47
  }
48
  .ditty-field-type--group {
22
  // * {
23
  // box-sizing: border-box;
24
  // }
25
+ &__initialize {
26
+ order: 0;
27
+ flex: 1;
28
+ width: 100%;
29
+ background: #FFF;
30
+ box-sizing: border-box;
31
+ }
32
  &__preview {
33
  order: 0;
34
  flex: 1;
49
  padding: 15px;
50
  border-color: rgba( 0, 0, 0, 0.05 );
51
  &__label {
52
+ font-weight: 600;
53
  }
54
  }
55
  .ditty-field-type--group {
includes/sass/partials/_display_ticker.scss CHANGED
@@ -4,10 +4,78 @@
4
  * {
5
  box-sizing: border-box;
6
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  &__contents {
8
- //transition: background .25s ease, padding .25s ease, border-radius .25s ease;
 
 
 
 
9
  }
10
  &__items {
 
11
  position: relative;
12
  overflow: hidden;
13
  }
4
  * {
5
  box-sizing: border-box;
6
  }
7
+ display: flex;
8
+ flex-direction: row;
9
+ flex-wrap: wrap;
10
+ &[data-title="top"],
11
+ &[data-title="bottom"] {
12
+ .ditty-ticker__title {
13
+ width: 100%;
14
+ }
15
+ }
16
+ &[data-title="bottom"] {
17
+ .ditty-ticker__title {
18
+ order: 1;
19
+ }
20
+ .ditty-ticker__contents {
21
+ order: 0;
22
+ }
23
+ }
24
+ &[data-title="left"],
25
+ &[data-title="right"] {
26
+ flex-direction: row;
27
+ flex-wrap: nowrap;
28
+ align-items: stretch;
29
+ .ditty-ticker__title {
30
+ flex: 0 0 auto;
31
+ &__contents {
32
+ height: 100%;
33
+ display: flex;
34
+ flex-direction: row;
35
+ }
36
+ }
37
+ &[data-title="right"] {
38
+ .ditty-ticker__title {
39
+ order: 1;
40
+ }
41
+ .ditty-ticker__contents {
42
+ order: 0;
43
+ }
44
+ }
45
+ }
46
+ &[data-title_position="start"] {
47
+ .ditty-ticker__title__contents {
48
+ align-items: flex-start;
49
+ justify-content: flex-start;
50
+ }
51
+ }
52
+ &[data-title_position="center"] {
53
+ .ditty-ticker__title__contents {
54
+ align-items: center;
55
+ justify-content: center;
56
+ }
57
+ }
58
+ &[data-title_position="end"] {
59
+ .ditty-ticker__title__contents {
60
+ align-items: flex-end;
61
+ justify-content: flex-end;
62
+ }
63
+ }
64
+ &__title {
65
+ &__contents {
66
+ display: flex;
67
+ flex-direction: row;
68
+ }
69
+ }
70
  &__contents {
71
+ width: 100%;
72
+ display: flex;
73
+ flex-direction: row;
74
+ align-items: center;
75
+ justify-content: flex-start;
76
  }
77
  &__items {
78
+ width: 100%;
79
  position: relative;
80
  overflow: hidden;
81
  }
includes/sass/partials/_general.scss CHANGED
@@ -32,8 +32,7 @@
32
  left: 0;
33
  right: 0;
34
  bottom: 0;
35
- opacity: 0.10;
36
- background: #000;
37
  z-index: 200;
38
  display: none;
39
  // display: none;
@@ -62,10 +61,18 @@
62
  // opacity: .5;
63
  // }
64
  // }
65
- // i {
66
- // color: $green;
67
- // font-size: 30px;
68
- // }
 
 
 
 
 
 
 
 
69
  }
70
  .ditty-notification {
71
  font-weight: 600;
32
  left: 0;
33
  right: 0;
34
  bottom: 0;
35
+ background: rgba( 255, 255, 255, .7 );
 
36
  z-index: 200;
37
  display: none;
38
  // display: none;
61
  // opacity: .5;
62
  // }
63
  // }
64
+ i {
65
+ display: none;
66
+ color: $green;
67
+ font-size: 20px;
68
+ line-break: 20px;
69
+ }
70
+ &.active {
71
+ display: flex;
72
+ flex-direction: row;
73
+ align-items: center;
74
+ justify-content: center;
75
+ }
76
  }
77
  .ditty-notification {
78
  font-weight: 600;
includes/upgrades.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Run updates
5
  *
6
- * @since 3.0.3
7
  * @return void
8
  */
9
  function ditty_updates() {
@@ -18,7 +18,10 @@ function ditty_updates() {
18
  if ( version_compare( $current_version, '3.0.6', '<' ) ) {
19
  ditty_v3_0_6_upgrades();
20
  }
21
-
 
 
 
22
  if ( DITTY_VERSION != $current_version ) {
23
  update_option( 'ditty_plugin_version_upgraded_from', $current_version );
24
  update_option( 'ditty_plugin_version', DITTY_VERSION );
@@ -26,6 +29,94 @@ function ditty_updates() {
26
  }
27
  add_action( 'admin_init', 'ditty_updates' );
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  /**
30
  * Version 3.0 Updates
31
  *
@@ -126,19 +217,29 @@ function ditty_v3_upgrades() {
126
  }
127
 
128
  /**
129
- * Version 3.0.6 Updates
130
  *
131
- * @since 3.0.6
132
- * @return void
133
- */
134
- function ditty_v3_0_6_upgrades() {
135
- $ditty_notices = get_option( 'ditty_notices', array() );
136
- $args = array(
137
- 'post_type' => 'ditty_news_ticker',
138
  );
139
- $news_tickers = get_posts( $args );
140
- if ( is_array( $news_tickers ) && count( $news_tickers ) > 0 ) {
141
- $ditty_notices['v3_0_6'] = 'v3_0_6';
142
- update_option( 'ditty_notices', $ditty_notices );
 
 
 
 
 
 
 
 
 
 
143
  }
144
- }
 
3
  /**
4
  * Run updates
5
  *
6
+ * @since 3.0.13
7
  * @return void
8
  */
9
  function ditty_updates() {
18
  if ( version_compare( $current_version, '3.0.6', '<' ) ) {
19
  ditty_v3_0_6_upgrades();
20
  }
21
+ if ( version_compare( $current_version, '3.0.13', '<' ) ) {
22
+ //ditty_v3_0_13_upgrades();
23
+ }
24
+
25
  if ( DITTY_VERSION != $current_version ) {
26
  update_option( 'ditty_plugin_version_upgraded_from', $current_version );
27
  update_option( 'ditty_plugin_version', DITTY_VERSION );
29
  }
30
  add_action( 'admin_init', 'ditty_updates' );
31
 
32
+ /**
33
+ * Version 3.0.13 Updates
34
+ *
35
+ * @since 3.0.13
36
+ * @return void
37
+ */
38
+ function ditty_v3_0_13_upgrades() {
39
+
40
+ // Update the database
41
+ $db_items = new Ditty_DB_Items();
42
+ @$db_items->create_table();
43
+
44
+ // Add uniq_ids to each Layout & Display
45
+ $args = array(
46
+ 'posts_per_page' => -1,
47
+ 'post_type' => array( 'ditty_layout', 'ditty_display' ),
48
+ 'post_status' => 'any',
49
+ 'meta_query' => array(
50
+ array(
51
+ 'key' => '_ditty_uniq_id',
52
+ 'compare' => 'NOT EXISTS',
53
+ )
54
+ ),
55
+ );
56
+ $posts = get_posts( $args );
57
+ if ( is_array( $posts ) && count( $posts ) > 0 ) {
58
+ foreach ( $posts as $i => $post ) {
59
+ ditty_maybe_add_uniq_id( $post->ID );
60
+ }
61
+ }
62
+
63
+ // Add uniq_ids and init data to each Ditty
64
+ $args = array(
65
+ 'posts_per_page' => -1,
66
+ 'post_type' => 'ditty',
67
+ 'post_status' => 'any',
68
+ 'meta_query' => array(
69
+ 'relation' => 'OR',
70
+ array(
71
+ 'key' => '_ditty_uniq_id',
72
+ 'compare' => 'NOT EXISTS',
73
+ ),
74
+ array(
75
+ 'key' => '_ditty_init',
76
+ 'compare' => 'NOT EXISTS',
77
+ )
78
+ ),
79
+ );
80
+ $posts = get_posts( $args );
81
+ if ( is_array( $posts ) && count( $posts ) > 0 ) {
82
+ foreach ( $posts as $i => $post ) {
83
+ ditty_maybe_add_uniq_id( $post->ID );
84
+ update_post_meta( $post->ID, '_ditty_init', 'yes' );
85
+
86
+ // Add a date created and modified based on post created time
87
+ $all_meta = Ditty()->db_items->get_items( $post->ID );
88
+ if ( is_array( $all_meta ) && count( $all_meta ) > 0 ) {
89
+ foreach ( $all_meta as $i => $meta ) {
90
+ $add_data = array(
91
+ 'item_author' => intval( $post->post_author ),
92
+ 'date_created' => sanitize_text_field( $post->post_date_gmt ),
93
+ 'date_modified' => sanitize_text_field( $post->post_date_gmt ),
94
+ );
95
+ Ditty()->db_items->update( $meta->item_id, $add_data, 'item_id' );
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Version 3.0.6 Updates
104
+ *
105
+ * @since 3.0.6
106
+ * @return void
107
+ */
108
+ function ditty_v3_0_6_upgrades() {
109
+ $ditty_notices = get_option( 'ditty_notices', array() );
110
+ $args = array(
111
+ 'post_type' => 'ditty_news_ticker',
112
+ );
113
+ $news_tickers = get_posts( $args );
114
+ if ( is_array( $news_tickers ) && count( $news_tickers ) > 0 ) {
115
+ $ditty_notices['v3_0_6'] = 'v3_0_6';
116
+ update_option( 'ditty_notices', $ditty_notices );
117
+ }
118
+ }
119
+
120
  /**
121
  * Version 3.0 Updates
122
  *
217
  }
218
 
219
  /**
220
+ * Add upgrade notices
221
  *
222
+ * @since 3.0.13
223
+ */
224
+ function ditty_upgrade_notices() {
225
+ $ditty_upgrades = get_option( 'ditty_upgrades', array() );
226
+ $ditty_upgrades = array(
227
+ '3_1' => 'testing',
 
228
  );
229
+ if ( ! empty( $ditty_upgrades ) ) {
230
+ ?>
231
+ <div class="notice notice-info ditty-dashboard-notice ditty-dashboard-notice--upgrade">
232
+ <div class="ditty-dashboard-notice__content">
233
+ <p><?php printf( __( 'Ditty v%s requires updates. Click the button below to get started!', 'ditty-news-ticker' ), ditty_version() ); ?></p>
234
+ <p class="ditty-upgrade__element">
235
+ <a href="#" class="button ditty-upgrade__start"><?php _e( 'Start Update', 'ditty-news-ticker' ); ?></a>
236
+ <span class="ditty-upgrade__bar">
237
+ <span class="ditty-upgrade__progress"></span>
238
+ </span>
239
+ </p>
240
+ </div>
241
+ </div>
242
+ <?php
243
  }
244
+ }
245
+ //add_action( 'admin_notices', 'ditty_upgrade_notices' );
includes/wizard.php ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Render the wizard
5
+ *
6
+ * @since 3.0.13
7
+ * @return void
8
+ */
9
+ function ditty_wizard( $post ) {
10
+ $item_types = ditty_item_types();
11
+ $item_type_variations = array();
12
+ $counter = 0;
13
+ ?>
14
+ <div id="ditty-page" class="wrap ditty-wizard">
15
+ <div id="ditty-page__header" class="ditty-wizard-header">
16
+ <h2><?php _e( 'Ditty Wizard', 'ditty-news-ticker' ); ?></h2>
17
+ <!-- <div class="ditty-wizard-header__contents">
18
+ <ul>
19
+ <li>
20
+ <h4><i class="fas fa-stream"></i> <?php esc_html_e( 'Add your first Item type', 'ditty-news-ticker' ); ?></h4>
21
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
22
+ </li>
23
+ <li>
24
+ <h4><i class="fas fa-pencil-ruler"></i> <?php esc_html_e( 'Select a Layout', 'ditty-news-ticker' ); ?></h4>
25
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
26
+ </li>
27
+ <li>
28
+ <h4><i class="fas fa-tablet-alt"></i> <?php esc_html_e( 'Select a Display', 'ditty-news-ticker' ); ?></h4>
29
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
30
+ </li>
31
+ </ul>
32
+ </div> -->
33
+ </div>
34
+ <div id="ditty-page__content">
35
+ <div id="ditty-editor">
36
+ <div id="ditty-editor__initialize">
37
+
38
+ <?php $counter++; // Ditty title ?>
39
+ <div class="ditty-wizard-setting ditty-wizard-setting--title">
40
+ <div class="ditty-instruction-number"><span><?php echo intval( $counter ); ?></span></div>
41
+ <div class="ditty-wizard-setting__content">
42
+ <h3 class="ditty-wizard-setting__title"><?php _e( 'Add a title', 'ditty-news-ticker' ); ?></h3>
43
+ <p class="ditty-wizard-setting__description"><?php _e( 'Set a title for your Ditty.', 'ditty-news-ticker' ); ?></p>
44
+ <input type="text" name="ditty_title" placeholder="<?php printf( __( 'Ditty %d', 'ditty-news-ticker' ), $post->ID ); ?>" />
45
+ </div>
46
+ </div>
47
+
48
+ <?php $counter++; // Item type selection ?>
49
+ <div class="ditty-wizard-setting ditty-wizard-setting--item-type">
50
+ <div class="ditty-instruction-number"><span><?php echo intval( $counter ); ?></span></div>
51
+ <div class="ditty-wizard-setting__content">
52
+ <h3 class="ditty-wizard-setting__title"><?php _e( 'Create your first Item', 'ditty-news-ticker' ); ?></h3>
53
+ <p class="ditty-wizard-setting__description"><?php _e( 'Choose the Item type you want to use with your first item. You will be able to add more once the Ditty has been created!', 'ditty-news-ticker' ); ?></p>
54
+ <div class="ditty-wizard-option ditty-option-grid">
55
+ <?php
56
+ if ( is_array( $item_types ) && count( $item_types ) > 0 ) {
57
+ foreach ( $item_types as $slug => $item_type ) {
58
+ $item_type_object = ditty_item_type_object( $slug );
59
+ $variation_types = $item_type_object->get_layout_variation_types();
60
+ if ( is_array( $variation_types ) && count( $variation_types ) > 0 ) {
61
+ foreach ( $variation_types as $id => $variation_type ) {
62
+ if ( ! isset( $item_type_variations[$id] ) ) {
63
+ $item_type_variations[$id] = array(
64
+ 'title' => $variation_type['label'],
65
+ 'description' => $variation_type['description'],
66
+ 'item_types' => array(),
67
+ );
68
+ }
69
+ $item_type_variations[$id]['item_types'][] = $slug;
70
+ }
71
+ }
72
+ echo '<button class="ditty-option-grid__item" data-value="' . esc_attr( $slug ) . '" data-layout_variations="' . htmlspecialchars( json_encode( $variation_types ) ). ' ">';
73
+ echo '<i class="' . esc_attr( $item_type['icon'] ) . '"></i>';
74
+ echo '<h4 class="ditty-option-grid__item__title">' . sanitize_text_field( $item_type['label'] ) . '</h4>';
75
+ echo '<span class="ditty-option-grid__item__description">' . sanitize_text_field( $item_type['description'] ) . '</span>';
76
+ echo '</button>';
77
+ }
78
+ }
79
+ ?>
80
+ </div>
81
+ </div>
82
+ </div>
83
+
84
+ <?php $counter++; // Item type settings ?>
85
+ <div class="ditty-wizard-setting ditty-wizard-setting--item-type-settings">
86
+ <div class="ditty-instruction-number"><span><?php echo intval( $counter ); ?></span></div>
87
+ <div class="ditty-wizard-setting__content">
88
+
89
+ <h3 class="ditty-wizard-setting__title"><?php _e( "Set the Item options", 'ditty-news-ticker' ); ?></h3>
90
+ <p class="ditty-wizard-setting__description"><?php _e( "Each item type has it's own set of options to customize.", 'ditty-news-ticker' ); ?></p>
91
+ <div class="ditty-wizard-option ditty-item-type-settings">
92
+ <?php
93
+ if ( is_array( $item_types ) && count( $item_types ) > 0 ) {
94
+ foreach ( $item_types as $slug => $item_type ) {
95
+ echo '<div class="ditty-item-type-settings__group" data-id="' . esc_attr( $slug ) . '">';
96
+ $item_type_object = ditty_item_type_object( $slug );
97
+ $item_type_object->settings();
98
+ echo '</div>';
99
+ }
100
+ }
101
+ ?>
102
+ </div>
103
+ <button href="#" class="ditty-option-submit ditty-button ditty-button--primary"><?php _e( 'Confirm Settings', 'ditty-news-ticker' ); ?></button>
104
+
105
+ <div class="ditty-updating-overlay">
106
+ <div class="ditty-updating-overlay__inner">
107
+ <i class="fas fa-sync-alt fa-spin"></i>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ </div>
112
+
113
+ <?php $counter++; // Layouts ?>
114
+ <div class="ditty-wizard-setting ditty-wizard-setting--layout">
115
+ <div class="ditty-instruction-number"><span><?php echo intval( $counter ); ?></span></div>
116
+ <div class="ditty-wizard-setting__content">
117
+ <h3 class="ditty-wizard-setting__title"><?php _e( 'Select Variation Layouts for the Item', 'ditty-news-ticker' ); ?></h3>
118
+ <p class="ditty-wizard-setting__description"><?php _e( 'Layouts are used to render the Item data. Each Item type may have multiple Layout variations.', 'ditty-news-ticker' ); ?></p>
119
+ <?php
120
+ $layouts = ditty_layouts_posts();
121
+ $layout_options = '';
122
+ $layout_options .= '<div class="ditty-wizard-option ditty-option-grid">';
123
+ if ( is_array( $layouts ) && count( $layouts ) > 0 ) {
124
+ foreach ( $layouts as $layout ) {
125
+ $icon = get_post_meta( $layout->ID, '_ditty_layout_icon', true );
126
+ $description = get_post_meta( $layout->ID, '_ditty_layout_description', true );
127
+ $version_string = '';
128
+ $version = get_post_meta( $layout->ID, '_ditty_layout_version', true );
129
+ if ( $version ) {
130
+ $version_string = " <small class='ditty-layout-version'>(v{$version})</small>";
131
+ }
132
+ $layout_options .= '<button class="ditty-option-grid__item" data-value="' . esc_attr( $layout->ID ) . '">';
133
+ if ( '' == $icon ) {
134
+ $icon = 'fas fa-pencil-ruler';
135
+ }
136
+ $layout_options .= '<i class="' . esc_attr( $icon ) . '"></i>';
137
+ $layout_options .= '<h4 class="ditty-option-grid__item__title">' . sanitize_text_field( $layout->post_title ) . $version_string . '</h4>';
138
+ $layout_options .= '<span class="ditty-option-grid__item__id">' . sprintf( __( 'ID: %d' ), $layout->ID ) . '</span>';
139
+ $layout_options .= '<span class="ditty-option-grid__item__date">' . get_the_time( 'm/d/y \a\t g:ia', $layout->ID ) . '</span>';
140
+ if ( $description ) {
141
+ $layout_options .= '<span class="ditty-option-grid__item__description">' . sanitize_text_field( $description ) . '</span>';
142
+ }
143
+ $layout_options .= '</button>';
144
+ }
145
+ }
146
+ $layout_options .= '</div>';
147
+
148
+ if ( is_array( $item_type_variations ) && count( $item_type_variations ) > 0 ) {
149
+ foreach ( $item_type_variations as $id => $item_type_variation ) {
150
+ echo '<div class="ditty-wizard-setting--layout__variation ' . esc_attr( implode( ' ', $item_type_variation['item_types'] ) ) . '" data-id="' . esc_attr( $id ) . '">';
151
+ echo '<h4 class="ditty-wizard-setting--layout__variation__title">' . sprintf( __( 'Layout Variation: %s', 'ditty-news-ticker' ), sanitize_text_field( $item_type_variation['title'] ) ) . '</h4>';
152
+ echo '<div class="ditty-wizard-setting--layout__variation__description">' . sanitize_text_field( $item_type_variation['description'] ) . '</div>';
153
+ echo $layout_options;
154
+ echo '</div>';
155
+ }
156
+ }
157
+ ?>
158
+ </div>
159
+ </div>
160
+
161
+ <?php $counter++; // Display ?>
162
+ <div class="ditty-wizard-setting ditty-wizard-setting--display">
163
+ <div class="ditty-instruction-number"><span><?php echo intval( $counter ); ?></span></div>
164
+ <div class="ditty-wizard-setting__content">
165
+ <h3 class="ditty-wizard-setting__title"><?php _e( 'Select a Display', 'ditty-news-ticker' ); ?></h3>
166
+ <p class="ditty-wizard-setting__description"><?php _e( 'Displays are what ulimately display your Ditty on your site.', 'ditty-news-ticker' ); ?></p>
167
+ <?php
168
+ $args = array(
169
+ 'posts_per_page' => -1,
170
+ 'orderby' => 'post_title',
171
+ 'order' => 'ASC',
172
+ 'post_type' => 'ditty_display',
173
+ );
174
+ $displays = get_posts( $args );
175
+ $display_types = ditty_display_types();
176
+ $display_options = '';
177
+ $display_options .= '<div class="ditty-wizard-option ditty-option-grid">';
178
+ if ( is_array( $displays ) && count( $displays ) > 0 ) {
179
+ foreach ( $displays as $display ) {
180
+ $type = get_post_meta( $display->ID, '_ditty_display_type', true );
181
+ if ( ! isset( $display_types[$type] ) ) {
182
+ continue;
183
+ }
184
+ $description = get_post_meta( $display->ID, '_ditty_display_description', true );
185
+ $version_string = '';
186
+ $version = get_post_meta( $display->ID, '_ditty_display_version', true );
187
+ if ( $version ) {
188
+ $version_string = " <small class='ditty-display-version'>(v{$version})</small>";
189
+ }
190
+ $display_options .= '<button class="ditty-option-grid__item" data-value="' . esc_attr( $display->ID ) . '">';
191
+ $display_options .= '<i class="' . esc_attr( $display_types[$type]['icon'] ) . '"></i>';
192
+ $display_options .= '<h4 class="ditty-option-grid__item__title">' . sanitize_text_field( $display->post_title ) . $version_string . '</h4>';
193
+ $display_options .= '<span class="ditty-option-grid__item__type">' . sanitize_text_field( $display_types[$type]['label'] ) . '</span>';
194
+ $display_options .= '<span class="ditty-option-grid__item__id">' . sprintf( __( 'ID: %d' ), $display->ID ) . '</span>';
195
+ $display_options .= '<span class="ditty-option-grid__item__date">' . get_the_time( 'm/d/y \a\t g:ia', $display->ID ) . '</span>';
196
+ if ( $description ) {
197
+ $display_options .= '<span class="ditty-option-grid__item__description">' . sanitize_text_field( $description ) . '</span>';
198
+ }
199
+ $display_options .= '</button>';
200
+ }
201
+ }
202
+ $display_options .= '</div>';
203
+ echo $display_options;
204
+ ?>
205
+ </div>
206
+ </div>
207
+
208
+ <div class="ditty-wizard-setting ditty-wizard-setting--submit">
209
+ <button id="ditty-wizard-submit" class="ditty-button ditty-button--primary" data-ditty_id="<?php echo $post->ID; ?>" data-submitting="<?php _e( 'Building Your Ditty...', 'ditty-news-ticker' ); ?>"><?php _e( 'Create Ditty!', 'ditty-news-ticker' ); ?></button>
210
+ </div>
211
+
212
+ <div id="ditty-wizard-overlay" class="ditty-updating-overlay">
213
+ <div class="ditty-updating-overlay__inner">
214
+ <i class="fas fa-sync-alt fa-spin"></i>
215
+ </div>
216
+ </div>
217
+
218
+ </div>
219
+ </div>
220
+ </div>
221
+ </div><!-- /.wrap -->
222
+ <?php
223
+ }
224
+
225
+ /**
226
+ * Save the wizard options
227
+ *
228
+ * @access public
229
+ * @since 3.0.13
230
+ */
231
+ function ditty_submit_wizard_ajax() {
232
+ check_ajax_referer( 'ditty', 'security' );
233
+ $ditty_id_ajax = isset( $_POST['ditty_id'] ) ? $_POST['ditty_id'] : false;
234
+ $init_values_ajax = isset( $_POST['init_values'] ) ? $_POST['init_values'] : false;
235
+ if ( ! $ditty_id_ajax || ! $init_values_ajax ) {
236
+ wp_die();
237
+ }
238
+
239
+ // Set the initialized wp_ajax_toggle
240
+ update_post_meta( $ditty_id_ajax, '_ditty_init', 'yes' );
241
+
242
+ // Update the post data
243
+ $ditty_post_data = array();
244
+ $ditty_post_data['post_title'] = ( isset( $init_values_ajax['title'] ) && '' != $init_values_ajax['title'] ) ? sanitize_text_field( $init_values_ajax['title'] ) : sprintf( __( 'Ditty %d', 'ditty-news-ticker' ), $ditty_id_ajax );
245
+ $ditty_post_data['post_status'] = 'publish';
246
+ $ditty_post_data['post_type'] = 'ditty';
247
+ $ditty_post_data['ID'] = $ditty_id_ajax;
248
+ wp_update_post( $ditty_post_data );
249
+
250
+ // Add the ditty settings
251
+ $sanitized_settings = Ditty()->singles->sanitize_settings( array() );
252
+ update_post_meta( $ditty_id_ajax, '_ditty_settings', $sanitized_settings );
253
+
254
+ // Add the display
255
+ $display = isset( $init_values_ajax['display'] ) ? intval( $init_values_ajax['display'] ) : ditty_default_display( $ditty_id_ajax );
256
+ update_post_meta( $ditty_id_ajax, '_ditty_display', $display );
257
+
258
+ // Possibly add a uniq_id
259
+ ditty_maybe_add_uniq_id( $ditty_id_ajax );
260
+
261
+ // Add the first item
262
+ $item_data = array(
263
+ 'ditty_id' => intval( $ditty_id_ajax ),
264
+ 'item_type' => isset( $init_values_ajax['itemType'] ) ? esc_attr( $init_values_ajax['itemType'] ) : 'default',
265
+ 'item_value' => isset( $init_values_ajax['itemTypeValues'] ) ? $init_values_ajax['itemTypeValues'] : false,
266
+ 'layout_value' => isset( $init_values_ajax['layoutVariations'] ) ? $init_values_ajax['layoutVariations'] : false,
267
+ );
268
+ $sanitized_item_data = Ditty()->singles->sanitize_item_data( $item_data );
269
+
270
+ // Add the item to the database
271
+ Ditty()->db_items->insert( apply_filters( 'ditty_item_db_data', $sanitized_item_data, $ditty_id_ajax ), 'item' );
272
+
273
+ $data = array(
274
+ 'id' => $ditty_id_ajax,
275
+ 'values' => $init_values_ajax,
276
+ 'edit_url' => get_edit_post_link( $ditty_id_ajax ),
277
+ );
278
+ wp_send_json( $data );
279
+ }
280
+ add_action( 'wp_ajax_ditty_submit_wizard', 'ditty_submit_wizard_ajax' );
languages/ditty-news-ticker-de_DE.mo ADDED
Binary file
languages/ditty-news-ticker-de_DE.po ADDED
@@ -0,0 +1,2902 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Ditty\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2021-12-22 16:19-0600\n"
6
+ "PO-Revision-Date: 2022-01-27 11:58+0100\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: Deutsch\n"
9
+ "Language: de_DE\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14
+ "X-Generator: Poedit 3.0.1\n"
15
+ "X-Poedit-Basepath: ..\n"
16
+ "X-Poedit-Flags-xgettext: --add-comments=translators:\n"
17
+ "X-Poedit-WPHeader: ditty-news-ticker.php\n"
18
+ "X-Poedit-SourceCharset: UTF-8\n"
19
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
20
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
21
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
22
+ "X-Loco-Version: 2.5.8; wp-5.9\n"
23
+ "X-Poedit-SearchPath-0: .\n"
24
+ "X-Poedit-SearchPathExcluded-0: *.min.js\n"
25
+ "X-Poedit-SearchPathExcluded-1: vendor\n"
26
+ "X-Poedit-SearchPathExcluded-2: node_modules\n"
27
+
28
+ #: blocks/ditty-block/index.js:24 blocks/ditty-block/index.js:87
29
+ #: includes/admin/upgrade_details.php:26 includes/post-types.php:14
30
+ #: includes/post-types.php:15 includes/post-types.php:25
31
+ msgid "Ditty"
32
+ msgstr "Ditty"
33
+
34
+ #: blocks/ditty-block/index.js:25
35
+ msgid "Display your Ditty within the content of the post."
36
+ msgstr "Zeigen Sie Ihr Ditty innerhalb des Inhalts des Posts an."
37
+
38
+ #: blocks/ditty-block/index.js:32 includes/helpers.php:104
39
+ msgid "Ticker"
40
+ msgstr "Ticker"
41
+
42
+ #: blocks/ditty-block/index.js:33 blocks/ditty-block/index.js:98
43
+ #: includes/admin/columns.php:24 includes/admin/settings.php:300
44
+ #: includes/class-ditty-displays.php:593 includes/post-types.php:83
45
+ msgid "Display"
46
+ msgstr "Sichtbar"
47
+
48
+ #: blocks/ditty-block/index.js:34 includes/class-ditty-item-type-default.php:32
49
+ #: includes/class-ditty-item-type-wp-editor.php:32
50
+ #: legacy/inc/admin/fields/fields.php:619
51
+ msgid "Content"
52
+ msgstr "Inhalte"
53
+
54
+ #: blocks/ditty-block/index.js:59 legacy/inc/helpers.php:349
55
+ msgid "Select a Ticker"
56
+ msgstr "Wähle einen Ticker"
57
+
58
+ #: blocks/ditty-block/index.js:67 includes/admin/settings.php:302
59
+ msgid "Use Default Display"
60
+ msgstr "Standardanzeige verwenden"
61
+
62
+ #: blocks/ditty-block/index.js:93
63
+ msgid "Loading Tickers"
64
+ msgstr "Lade Ticker"
65
+
66
+ #: blocks/ditty-block/index.js:104
67
+ msgid "Loading Displays"
68
+ msgstr "Lade Anzeigen"
69
+
70
+ #: blocks/ditty-block/index.js:114 blocks/ditty-block/index.js:119
71
+ #: blocks/ditty-block/index.js:137
72
+ msgid "ID:"
73
+ msgstr "ID:"
74
+
75
+ #: blocks/ditty-block/index.js:115 blocks/ditty-block/index.js:126
76
+ #: blocks/ditty-block/index.js:138
77
+ msgid "Display:"
78
+ msgstr "Anziege:"
79
+
80
+ #. translators: the plugin name.
81
+ #: includes/admin/EDD_SL_Plugin_Updater.php:224
82
+ #, php-format
83
+ msgid "There is a new version of %1$s available."
84
+ msgstr "Es ist eine neue Version von %1$s verfügbar."
85
+
86
+ #: includes/admin/EDD_SL_Plugin_Updater.php:230
87
+ msgid "Contact your network administrator to install the update."
88
+ msgstr ""
89
+ "Wenden Sie sich an Ihren Netzwerkadministrator, um das Update zu "
90
+ "installieren."
91
+
92
+ #. translators: 1. opening anchor tag, do not translate 2. the new plugin version 3. closing anchor tag, do not translate.
93
+ #: includes/admin/EDD_SL_Plugin_Updater.php:235
94
+ #, php-format
95
+ msgid "%1$sView version %2$s details%3$s."
96
+ msgstr "%1$sVersionsdetails %2$s anzeigen%3$s."
97
+
98
+ #: includes/admin/EDD_SL_Plugin_Updater.php:243
99
+ #, php-format
100
+ msgid "%1$sView version %2$s details%3$s or %4$supdate now%5$s."
101
+ msgstr ""
102
+ "%1$sVersionsdetails %2$s anzeigen%3$s oder %4$sJetzt aktualisieren%5$s."
103
+
104
+ #: includes/admin/EDD_SL_Plugin_Updater.php:254
105
+ msgid "Update now."
106
+ msgstr "Jetzt aktualisieren."
107
+
108
+ #: includes/admin/EDD_SL_Plugin_Updater.php:486
109
+ msgid "You do not have permission to install plugin updates"
110
+ msgstr "Du hast keine Berechtigung, Plugin-Aktualisierungen zu installieren"
111
+
112
+ #: includes/admin/EDD_SL_Plugin_Updater.php:486
113
+ msgid "Error"
114
+ msgstr "Fehler"
115
+
116
+ #: includes/admin/columns.php:16 includes/admin/columns.php:20
117
+ msgid "Version"
118
+ msgstr "Version"
119
+
120
+ #: includes/admin/columns.php:17 includes/admin/columns.php:25
121
+ #: includes/class-ditty-displays.php:332
122
+ msgid "Display Type"
123
+ msgstr "Anzeigeart"
124
+
125
+ #: includes/admin/columns.php:21
126
+ msgid "Layout Template"
127
+ msgstr "Layout Vorlage"
128
+
129
+ #: includes/admin/columns.php:81
130
+ msgid "Edit"
131
+ msgstr "Bearbeiten"
132
+
133
+ #: includes/admin/columns.php:173 legacy/inc/admin/edit-columns.php:138
134
+ msgid "Show all Types"
135
+ msgstr "Zeige alle Typen"
136
+
137
+ #: includes/admin/columns.php:185
138
+ msgid "Show all Templates"
139
+ msgstr "Zeige alle Vorlagen"
140
+
141
+ #: includes/admin/settings.php:11 includes/admin/settings.php:12
142
+ #: includes/class-ditty-singles.php:74 legacy/inc/settings.php:11
143
+ #: legacy/inc/settings.php:12
144
+ msgid "Settings"
145
+ msgstr "Einstellungen"
146
+
147
+ #: includes/admin/settings.php:31
148
+ msgid "Ditty Settings"
149
+ msgstr "Ditty News Ticker Einstellungen"
150
+
151
+ #: includes/admin/settings.php:42
152
+ msgid "General"
153
+ msgstr "Allgemein"
154
+
155
+ #: includes/admin/settings.php:47
156
+ msgid "Global Ditty"
157
+ msgstr "Global"
158
+
159
+ #: includes/admin/settings.php:52
160
+ msgid "Layout Defaults"
161
+ msgstr "Layout Grundeinstellungen"
162
+
163
+ #: includes/admin/settings.php:57 includes/admin/settings.php:204
164
+ #: includes/class-ditty-layouts.php:210
165
+ msgid "Layout Templates"
166
+ msgstr "Vorlagen"
167
+
168
+ #: includes/admin/settings.php:62
169
+ msgid "Display Templates"
170
+ msgstr "Anzeige Vorlagen"
171
+
172
+ #: includes/admin/settings.php:67
173
+ msgid "Advanced"
174
+ msgstr "Erweitert"
175
+
176
+ #: includes/admin/settings.php:133
177
+ msgid "Live Refresh Rate"
178
+ msgstr "Aktualisierungsfrequenz"
179
+
180
+ #: includes/admin/settings.php:134
181
+ msgid "Minute(s)"
182
+ msgstr "Minute(n)"
183
+
184
+ #: includes/admin/settings.php:135
185
+ msgid "Set the live update refresh interval for your Ditty."
186
+ msgstr "Legt das Aktualisierungsintervall für das Ditty fest."
187
+
188
+ #: includes/admin/settings.php:152
189
+ msgid "Layout Posts"
190
+ msgstr "Aufbau Beiträge"
191
+
192
+ #: includes/admin/settings.php:153
193
+ msgid "Edit Layouts directly as post types."
194
+ msgstr "Layouts direkt als Post-Typen bearbeiten."
195
+
196
+ #: includes/admin/settings.php:156 includes/admin/settings.php:168
197
+ #: includes/class-ditty-singles.php:122
198
+ msgid "Disabled"
199
+ msgstr "Gesperrt/Deaktiviert"
200
+
201
+ #: includes/admin/settings.php:157 includes/admin/settings.php:169
202
+ msgid "Enabled"
203
+ msgstr "Aktiv"
204
+
205
+ #: includes/admin/settings.php:164
206
+ msgid "Ditty Display Posts"
207
+ msgstr "Anzeige Beiträge"
208
+
209
+ #: includes/admin/settings.php:165
210
+ msgid "Edit Ditty Displays directly as post types."
211
+ msgstr "Ditty bearbeiten, wird direkt als Posttyp angezeigt."
212
+
213
+ #: includes/admin/settings.php:187
214
+ msgid "Layout Variation Defaults"
215
+ msgstr "Anzeige-Varianten"
216
+
217
+ #: includes/admin/settings.php:221
218
+ msgid "Default Displays"
219
+ msgstr "Standardanzeige"
220
+
221
+ #: includes/admin/settings.php:238 legacy/inc/composer.php:10
222
+ #: legacy/inc/composer.php:17 legacy/inc/help.php:95 legacy/inc/widget.php:14
223
+ msgid "Ditty News Ticker"
224
+ msgstr "Ditty News Ticker"
225
+
226
+ #: includes/admin/settings.php:239
227
+ msgid "Enable Ditty News Ticker (Legacy code)"
228
+ msgstr "Ditty News Ticker aktivieren (Legacy-Code)"
229
+
230
+ #: includes/admin/settings.php:240
231
+ msgid ""
232
+ "This will enable loading of all legacy scripts and post types. Only enable "
233
+ "this option if you have active Ditty News Ticker posts displaying on your "
234
+ "site. You must refresh your browser after saving before changes take place."
235
+ msgstr ""
236
+ "Dies ermöglicht das Laden aller alten Skripte und Beitragstypen. Aktivieren "
237
+ "Sie diese Option nur, wenn Sie aktive Ditty News Ticker-Beiträge auf Ihrer "
238
+ "Seite anzeigen lassen. Sie müssen Ihren Browser nach dem Speichern "
239
+ "aktualisieren, bevor die Änderungen wirksam werden."
240
+
241
+ #: includes/admin/settings.php:266
242
+ msgid "Add More Global Tickers"
243
+ msgstr "Ergänze mit News-Tickern"
244
+
245
+ #: includes/admin/settings.php:272
246
+ msgid "HTML Selector"
247
+ msgstr "HTML Auswahl"
248
+
249
+ #: includes/admin/settings.php:273
250
+ msgid "Add a jQuery HTML element selector to add a Ditty to."
251
+ msgstr ""
252
+ "Fügen Sie einen jQuery-HTML-Element-Selektor hinzu, um ein Ditty "
253
+ "hinzuzufügen."
254
+
255
+ #: includes/admin/settings.php:274
256
+ msgid "Example: #site-header"
257
+ msgstr "Zum Beispiel: #Seiten-Header"
258
+
259
+ #: includes/admin/settings.php:279
260
+ msgid "Position"
261
+ msgstr "Position"
262
+
263
+ #: includes/admin/settings.php:280
264
+ msgid "Select the position of the Ditty in relation to the HTML selector."
265
+ msgstr ""
266
+ "Wählen Sie die Position des Ditty in Bezug auf den jeweiligen HTML-Selektor."
267
+
268
+ #: includes/admin/settings.php:281
269
+ msgid "Select Position"
270
+ msgstr "Wähle Position"
271
+
272
+ #: includes/admin/settings.php:283
273
+ msgid "Start of Element"
274
+ msgstr "Start Element"
275
+
276
+ #: includes/admin/settings.php:284
277
+ msgid "End of Element"
278
+ msgstr "End Element"
279
+
280
+ #: includes/admin/settings.php:285
281
+ msgid "Before Element"
282
+ msgstr "Vor dem Element"
283
+
284
+ #: includes/admin/settings.php:286
285
+ msgid "After Element"
286
+ msgstr "Nach dem Element"
287
+
288
+ #: includes/admin/settings.php:292
289
+ msgid "Ditty Ticker"
290
+ msgstr "Ditty News Ticker"
291
+
292
+ #: includes/admin/settings.php:293
293
+ msgid "Select a Ditty you want to display globally."
294
+ msgstr "Wähle den Ticker, den du global anzeigen möchtest."
295
+
296
+ #: includes/admin/settings.php:294
297
+ msgid "Select a Ditty"
298
+ msgstr "Wähle ein Ditty"
299
+
300
+ #: includes/admin/settings.php:301
301
+ msgid "Optional: Select a custom display to use with the Ditty."
302
+ msgstr "Optional: Bitte wähle eine benutzerdefinierte Anzeige für das Ditty."
303
+
304
+ #: includes/admin/settings.php:308
305
+ msgid "Custom ID"
306
+ msgstr "Individuelle ID"
307
+
308
+ #: includes/admin/settings.php:309
309
+ msgid "Optional: Add a custom ID to the Ditty"
310
+ msgstr "Optional: Dem Ditty eine eigene ID hinzufügen"
311
+
312
+ #: includes/admin/settings.php:314
313
+ msgid "Custom Classes"
314
+ msgstr "Benutzerdefiniert"
315
+
316
+ #: includes/admin/settings.php:315
317
+ msgid "Optional: Add custom classes to the Ditty"
318
+ msgstr "Optional: Hinzufügen von benutzerdefinierten Klassen zum Ditty"
319
+
320
+ #: includes/admin/upgrade_details.php:11
321
+ msgid "Ditty Upgrade Details"
322
+ msgstr "Ditty Upgrade Details"
323
+
324
+ #: includes/admin/upgrade_details.php:12
325
+ msgid "Upgrade Details"
326
+ msgstr "Upgrade Details"
327
+
328
+ #: includes/admin/upgrade_details.php:25
329
+ #, php-format
330
+ msgid "Ditty v%s"
331
+ msgstr "Ditty v%s"
332
+
333
+ #: includes/admin/upgrade_details.php:27
334
+ msgid "News Ticker was just the beginning"
335
+ msgstr "News-Ticker beginnt gerade"
336
+
337
+ #: includes/admin/upgrade_details.php:33
338
+ msgid ""
339
+ "<strong>Ditty News Ticker</strong> has now become <strong>Ditty</strong>!"
340
+ msgstr ""
341
+ "Aus <strong>Ditty News Ticker</strong> wurde jetzt <strong>Ditty</strong>!"
342
+
343
+ #: includes/admin/upgrade_details.php:34
344
+ msgid ""
345
+ "This update has been a long time in the making! Due to the complete rebuild "
346
+ "of code for <strong>Ditty 3.0</strong> we decided to limit the upgrade "
347
+ "process. We created a new post type you can start using right away without "
348
+ "potentially causing issues with your existing <strong>News Tickers</strong>."
349
+ msgstr ""
350
+ "Dieses Update hat lange auf sich warten lassen! Aufgrund der kompletten "
351
+ "Erneuerung des Codes für <strong>Ditty 3.0</strong> haben wir uns "
352
+ "entschieden, den Upgrade-Prozess zu begrenzen. Wir haben einen neuen "
353
+ "Beitragstyp erstellt, den ihr sofort verwenden könnt, ohne dass es zu "
354
+ "Problemen mit euren bestehenden <strong>News Tickers</strong> kommt."
355
+
356
+ #: includes/admin/upgrade_details.php:35
357
+ msgid ""
358
+ "Don't worry, all of your existing <strong>News Tickers</strong> will still "
359
+ "work! Although, we do urge you to start upgrading and updating your tickers "
360
+ "to the new <strong>Ditty</strong> post type. <strong>Ditty News Ticker</"
361
+ "strong> is now relagated to legacy code and there will be very limited "
362
+ "updates from this point on. Most development time will now be assigned to "
363
+ "<strong>Ditty</strong> and existing and new <strong>Ditty</strong> "
364
+ "extensions."
365
+ msgstr ""
366
+ "Keine Sorge, alle Ihre bestehenden News-Ticker funktionieren weiterhin! Wir "
367
+ "raten euch jedoch dringend, eure Ticker auf den neuen Ditty-Post-Typ zu "
368
+ "aktualisieren. Der Ditty News Ticker ist nun mit dem alten Code verknüpft "
369
+ "und es wird nur noch sehr wenige Updates geben. Die meiste Entwicklungszeit "
370
+ "wird nun für Ditty und existierende und neue Ditty-Erweiterungen verwendet "
371
+ "werden."
372
+
373
+ #: includes/admin/upgrade_details.php:41
374
+ #, php-format
375
+ msgid "Ditty %s Features"
376
+ msgstr "Ditty %s Funktionen"
377
+
378
+ #: includes/admin/upgrade_details.php:50 includes/class-ditty-singles.php:141
379
+ msgid "Live Updates"
380
+ msgstr "Live Aktualisierungen"
381
+
382
+ #: includes/admin/upgrade_details.php:51
383
+ msgid ""
384
+ "Ditty will update in the background for users without the need to refresh "
385
+ "the browser. Keep your content fresh and engaging."
386
+ msgstr ""
387
+ "Ditty wird im Hintergrund aktualisiert, ohne dass Sie den Browser "
388
+ "aktualisieren müssen. Halten Sie Ihre Inhalte aktuell und attraktiv."
389
+
390
+ #: includes/admin/upgrade_details.php:59
391
+ msgid "Live Editing"
392
+ msgstr "Live Bearbeitung"
393
+
394
+ #: includes/admin/upgrade_details.php:60
395
+ msgid ""
396
+ "See the changes you make while editing your Ditty as you make them. Add "
397
+ "Items, edit Layouts and Displays and see what it looks like before saving."
398
+ msgstr ""
399
+ "Sehen Sie die Änderungen während der Bearbeitung Ihres Ditty. Fügen Sie "
400
+ "Elemente hinzu, bearbeiten Sie Layouts und Displays und sehen Sie, wie es "
401
+ "vor dem Speichern aussieht."
402
+
403
+ #: includes/admin/upgrade_details.php:68
404
+ msgid "Global Rendering"
405
+ msgstr "<span>Globale </span>Darstellung"
406
+
407
+ #: includes/admin/upgrade_details.php:69
408
+ msgid ""
409
+ "Easily add your Ditty globally on your site, anywhere, without modifying "
410
+ "theme files. Want a ticker scrolling at the top of your site, no problem!"
411
+ msgstr ""
412
+ "Fügen Sie Ihr Ditty ganz einfach global auf Ihrer Website ein, überall, ohne "
413
+ "die Theme-Dateien zu ändern. Du willst eine Laufschrift oben auf deiner "
414
+ "Seite, kein Problem!"
415
+
416
+ #: includes/admin/upgrade_details.php:77
417
+ msgid "Mix & Match Content"
418
+ msgstr "Inhalte mischen & anpassen"
419
+
420
+ #: includes/admin/upgrade_details.php:78
421
+ msgid ""
422
+ "Combine multiple content feeds or custom content in a single Ditty. Merging "
423
+ "custom default Items and feeds from various Ditty extensions together has "
424
+ "never been easier."
425
+ msgstr ""
426
+ "Kombinieren Sie mehrere Einträge oder eigene Inhalte in einem einzigen "
427
+ "Ditty. Das Zusammenführen von benutzerdefinierten Standard-Elementen und "
428
+ "Beiträgen aus verschiedenen Ditty-Erweiterungen war noch nie so einfach."
429
+
430
+ #: includes/admin/upgrade_details.php:86
431
+ msgid "Customized Displays"
432
+ msgstr "Benutzerdefinierte Anzeige"
433
+
434
+ #: includes/admin/upgrade_details.php:87
435
+ msgid ""
436
+ "Render your Ditty as a custom ticker, list, slider, or other Display through "
437
+ "extensions. Customize multiple settings to show your content the way you "
438
+ "want."
439
+ msgstr ""
440
+ "Rendere dein Ditty als benutzerdefinierte Laufschrift, Liste, Slider oder "
441
+ "andere Anzeige durch Erweiterungen. Gestalte mehrere Einstellungen, um deine "
442
+ "Inhalte so darzustellen, wie du es möchtest."
443
+
444
+ #: includes/admin/upgrade_details.php:95
445
+ msgid "Customized Layouts"
446
+ msgstr "Individuelle Layouts"
447
+
448
+ #: includes/admin/upgrade_details.php:96
449
+ msgid ""
450
+ "Take control of the the style of your content. Every Ditty Item type can be "
451
+ "customized to reflect the style of your site. Use a pre-made template, or "
452
+ "edit and customize to your needs!"
453
+ msgstr ""
454
+ "Übernimm die Kontrolle über den Stil deines Inhalts. Jeder Ditty Artikeltyp "
455
+ "kann angepasst werden, um den Stil Ihrer Seite zu berücksichtigen. Verwende "
456
+ "eine vorgefertigte Vorlage oder bearbeite und passe sie an deine Bedürfnisse "
457
+ "an!"
458
+
459
+ #: includes/class-ditty-display-item.php:175
460
+ #, php-format
461
+ msgid "Ditty Layout does not exist for %s item!"
462
+ msgstr "Ditty Layout existiert nicht für %s Eintrag!"
463
+
464
+ #: includes/class-ditty-display-type-list.php:35
465
+ #: includes/class-ditty-display-type-ticker.php:35
466
+ msgid "General Settings"
467
+ msgstr "Generelle Einstellungen"
468
+
469
+ #: includes/class-ditty-display-type-list.php:36
470
+ #: includes/class-ditty-display-type-ticker.php:36
471
+ msgid "Configure the general functionality settings."
472
+ msgstr "Setze Allgemeine Einstellungen."
473
+
474
+ #: includes/class-ditty-display-type-list.php:41
475
+ #: includes/class-ditty-display-type-ticker.php:55
476
+ msgid "Spacing"
477
+ msgstr "Abstand"
478
+
479
+ #: includes/class-ditty-display-type-list.php:42
480
+ #: includes/class-ditty-display-type-ticker.php:56
481
+ msgid "Set the amount of space between items (in pixels)."
482
+ msgstr "Lege den Abstand zwischen den Elementen fest."
483
+
484
+ #: includes/class-ditty-display-type-list.php:54
485
+ msgid "Paging"
486
+ msgstr "Aufruf"
487
+
488
+ #: includes/class-ditty-display-type-list.php:55
489
+ msgid "Split the list into pages"
490
+ msgstr "Teile die Liste in Seiten"
491
+
492
+ #: includes/class-ditty-display-type-list.php:58
493
+ #: includes/class-ditty-display-type-list.php:128
494
+ #: includes/class-ditty-singles.php:132 includes/class-ditty-singles.php:143
495
+ msgid "No"
496
+ msgstr "Nein"
497
+
498
+ #: includes/class-ditty-display-type-list.php:59
499
+ #: includes/class-ditty-display-type-list.php:129
500
+ #: includes/class-ditty-singles.php:133 includes/class-ditty-singles.php:144
501
+ msgid "Yes"
502
+ msgstr "Ja"
503
+
504
+ #: includes/class-ditty-display-type-list.php:66
505
+ msgid "Items Per Page"
506
+ msgstr "Elemente pro Seite"
507
+
508
+ #: includes/class-ditty-display-type-list.php:67
509
+ msgid "Set the number of items to show per page"
510
+ msgstr "Anzahl der Elemente je Seite"
511
+
512
+ #: includes/class-ditty-display-type-list.php:74
513
+ msgid "Page Transition"
514
+ msgstr "Seiten-Übergang"
515
+
516
+ #: includes/class-ditty-display-type-list.php:75
517
+ msgid "Set the type of transition to use between pages"
518
+ msgstr "Wähle die Art des Übergangs zwischen den Seiten"
519
+
520
+ #: includes/class-ditty-display-type-list.php:82
521
+ msgid "Page Transition Ease"
522
+ msgstr "Effekt Seitenübergang"
523
+
524
+ #: includes/class-ditty-display-type-list.php:83
525
+ msgid "Set the easing of the transition between pages."
526
+ msgstr "Legt fest, wie der Übergang zwischen den Seiten gestaltet werden soll."
527
+
528
+ #: includes/class-ditty-display-type-list.php:90
529
+ msgid "Page Transition Speed"
530
+ msgstr "Seiten-Übergangsgeschwindigkeit"
531
+
532
+ #: includes/class-ditty-display-type-list.php:91
533
+ msgid "Set the speed of the transition between pages."
534
+ msgstr ""
535
+ "Legen Sie die Geschwindigkeit für den Übergang zwischen den Seiten fest."
536
+
537
+ #: includes/class-ditty-display-type-list.php:92
538
+ #: includes/class-ditty-display-type-list.php:113
539
+ #: includes/class-ditty-display-type-list.php:194
540
+ #: includes/class-ditty-display-type-list.php:215
541
+ #: includes/class-ditty-display-type-ticker.php:138
542
+ msgid "second(s)"
543
+ msgstr "Sekunde(n)"
544
+
545
+ #: includes/class-ditty-display-type-list.php:103
546
+ #: includes/class-ditty-display-type-ticker.php:128
547
+ msgid "Height Ease"
548
+ msgstr "Höhe"
549
+
550
+ #: includes/class-ditty-display-type-list.php:104
551
+ msgid "Set the easing of the list height."
552
+ msgstr "Wähle die Höhe der Auflistung."
553
+
554
+ #: includes/class-ditty-display-type-list.php:111
555
+ #: includes/class-ditty-display-type-ticker.php:136
556
+ msgid "Height Speed"
557
+ msgstr "Erhöhe Geschwindigkeit"
558
+
559
+ #: includes/class-ditty-display-type-list.php:112
560
+ msgid "Set the speed of the list height."
561
+ msgstr "Wähle die Geschwindigkeit der scrollenden Liste."
562
+
563
+ #: includes/class-ditty-display-type-list.php:124
564
+ msgid "Auto Play"
565
+ msgstr "Auto-Abspielen"
566
+
567
+ #: includes/class-ditty-display-type-list.php:125
568
+ msgid "Auto play the slider"
569
+ msgstr "Auto-Abspielen des sliders"
570
+
571
+ #: includes/class-ditty-display-type-list.php:136
572
+ msgid "Pause Autoplay on Hover"
573
+ msgstr "Autoplay beim Überfahren anhalten"
574
+
575
+ #: includes/class-ditty-display-type-list.php:137
576
+ #: includes/class-ditty-display-type-list.php:138
577
+ msgid "Pause the autoplay on mouse over"
578
+ msgstr "Beim Überfahren mit der Maus pausieren"
579
+
580
+ #: includes/class-ditty-display-type-list.php:144
581
+ msgid "Auto Play Speed"
582
+ msgstr "Autoplay Geschwindigkeit"
583
+
584
+ #: includes/class-ditty-display-type-list.php:145
585
+ msgid "Set the amount of delay between slides"
586
+ msgstr "Wähle die Pause zwischen Rotationen"
587
+
588
+ #: includes/class-ditty-display-type-list.php:146
589
+ #: includes/class-ditty-display-type-ticker.php:117
590
+ #: legacy/inc/admin/fields/fields.php:609
591
+ #: legacy/inc/admin/fields/fields.php:625
592
+ msgid "seconds"
593
+ msgstr "Sekunden"
594
+
595
+ #: includes/class-ditty-display-type-list.php:157
596
+ #: includes/class-ditty-display-type-ticker.php:149
597
+ msgid "Shuffle Items"
598
+ msgstr "Elemente mischen"
599
+
600
+ #: includes/class-ditty-display-type-list.php:158
601
+ #: includes/class-ditty-display-type-list.php:159
602
+ #: includes/class-ditty-display-type-ticker.php:150
603
+ msgid "Randomly shuffle items on each page load"
604
+ msgstr "Zufällige Mischung der Elemente bei jedem Laden der Seite"
605
+
606
+ #: includes/class-ditty-display-type-list.php:170
607
+ msgid "Initial Settings"
608
+ msgstr "Grundeinstellungen"
609
+
610
+ #: includes/class-ditty-display-type-list.php:171
611
+ msgid "Configure the initial display settings."
612
+ msgstr "Konfiguration Anzeige-Grundeinstellungen."
613
+
614
+ #: includes/class-ditty-display-type-list.php:176
615
+ msgid "Initial Page Transition"
616
+ msgstr "Grundlegender Seitenübergang"
617
+
618
+ #: includes/class-ditty-display-type-list.php:177
619
+ msgid "Set the transition for initial display."
620
+ msgstr "Wähle den Übergang für die erste Anzeige."
621
+
622
+ #: includes/class-ditty-display-type-list.php:184
623
+ msgid "Initial Page Transition Ease"
624
+ msgstr "Einfacher Seitenwechsel"
625
+
626
+ #: includes/class-ditty-display-type-list.php:185
627
+ msgid "Set the easing for initial display."
628
+ msgstr "Vereinfachte Anzeige-Grundeinstellung."
629
+
630
+ #: includes/class-ditty-display-type-list.php:192
631
+ msgid "Initial Page Transition Speed"
632
+ msgstr "Seiten-Übergangsgeschwindigkeit"
633
+
634
+ #: includes/class-ditty-display-type-list.php:193
635
+ msgid "Set the transition speed for initial display."
636
+ msgstr "Legt die Übergangsgeschwindigkeit für die erste Anzeige fest."
637
+
638
+ #: includes/class-ditty-display-type-list.php:205
639
+ msgid "Initial Height Ease"
640
+ msgstr "Mindest-Höhe"
641
+
642
+ #: includes/class-ditty-display-type-list.php:206
643
+ msgid "Set the height easing for initial display."
644
+ msgstr "Legt die Höheneinstellung für die erste Anzeige fest."
645
+
646
+ #: includes/class-ditty-display-type-list.php:213
647
+ msgid "Initial Height Speed"
648
+ msgstr "Mindest-Geschwindigkeit"
649
+
650
+ #: includes/class-ditty-display-type-list.php:214
651
+ msgid "Set the height speed for initial display."
652
+ msgstr "Wähle die Höhengeschwindigkeit für die erste Anzeige ein."
653
+
654
+ #: includes/class-ditty-display-type-list.php:234
655
+ #: includes/class-ditty-display-type-ticker.php:170
656
+ msgid "Import/Export"
657
+ msgstr "Export/Import"
658
+
659
+ #: includes/class-ditty-display-type-list.php:235
660
+ #: includes/class-ditty-display-type-ticker.php:171
661
+ msgid "Import or export the display settings."
662
+ msgstr "Export/Import der Anzeigeeinstellung."
663
+
664
+ #: includes/class-ditty-display-type-list.php:267
665
+ msgid "Default List"
666
+ msgstr "Standardliste"
667
+
668
+ #: includes/class-ditty-display-type-list.php:268
669
+ msgid "Default list display"
670
+ msgstr "Standardanzeige Liste"
671
+
672
+ #: includes/class-ditty-display-type-list.php:273
673
+ msgid "Default Slider"
674
+ msgstr "Standard-Slider"
675
+
676
+ #: includes/class-ditty-display-type-list.php:274
677
+ msgid "Default slider display"
678
+ msgstr "Standardanzeige Slider"
679
+
680
+ #: includes/class-ditty-display-type-ticker.php:41
681
+ msgid "Direction"
682
+ msgstr "Richtung"
683
+
684
+ #: includes/class-ditty-display-type-ticker.php:42
685
+ msgid "Set the direction of the ticker."
686
+ msgstr "Wähle Richtung des Tickers."
687
+
688
+ #: includes/class-ditty-display-type-ticker.php:44
689
+ #: includes/class-ditty-display-type.php:391
690
+ #: includes/class-ditty-display-type.php:439
691
+ #: includes/fields/ditty-field-spacing.php:27
692
+ #: legacy/inc/admin/meta-boxes.php:481
693
+ msgid "Left"
694
+ msgstr "Links"
695
+
696
+ #: includes/class-ditty-display-type-ticker.php:45
697
+ #: includes/class-ditty-display-type.php:392
698
+ #: includes/class-ditty-display-type.php:440
699
+ #: includes/fields/ditty-field-spacing.php:28
700
+ #: legacy/inc/admin/meta-boxes.php:482
701
+ msgid "Right"
702
+ msgstr "Rechts"
703
+
704
+ #: includes/class-ditty-display-type-ticker.php:46
705
+ #: legacy/inc/admin/meta-boxes.php:484
706
+ msgid "Down"
707
+ msgstr "Runter"
708
+
709
+ #: includes/class-ditty-display-type-ticker.php:47
710
+ #: legacy/inc/admin/meta-boxes.php:483
711
+ msgid "Up"
712
+ msgstr "Rauf"
713
+
714
+ #: includes/class-ditty-display-type-ticker.php:69
715
+ msgid "Speed"
716
+ msgstr "Geschwindigkeit"
717
+
718
+ #: includes/class-ditty-display-type-ticker.php:70
719
+ msgid "Set the speed of the ticker."
720
+ msgstr "Wähle die Geschwindigkeit des Tickers."
721
+
722
+ #: includes/class-ditty-display-type-ticker.php:81
723
+ msgid "Min. Height"
724
+ msgstr "Min-Höhe"
725
+
726
+ #: includes/class-ditty-display-type-ticker.php:82
727
+ msgid "Set the minimum height of the Ditty for vertical scrolling tickers."
728
+ msgstr "Legt die Mindesthöhe des Ditty für vertikal scrollende Ticker fest."
729
+
730
+ #: includes/class-ditty-display-type-ticker.php:88
731
+ msgid "Max. Height"
732
+ msgstr "Max-Höhe"
733
+
734
+ #: includes/class-ditty-display-type-ticker.php:89
735
+ msgid "Set the maximum height of the Ditty for vertical scrolling tickers."
736
+ msgstr ""
737
+ "Legen Sie die maximale Höhe des Ditty für vertikal scrollende Ticker fest."
738
+
739
+ #: includes/class-ditty-display-type-ticker.php:95
740
+ msgid "Hover Pause"
741
+ msgstr "Pause beim Überfahren"
742
+
743
+ #: includes/class-ditty-display-type-ticker.php:96
744
+ msgid "Pause the ticker on mouse over"
745
+ msgstr "Beim Überfahren mit der Maus pausieren"
746
+
747
+ #: includes/class-ditty-display-type-ticker.php:97
748
+ msgid "Pause the ticker on mouse over."
749
+ msgstr "Beim Überfahren mit der Maus pausieren."
750
+
751
+ #: includes/class-ditty-display-type-ticker.php:103
752
+ msgid "Initial Display"
753
+ msgstr "Grundanzeige"
754
+
755
+ #: includes/class-ditty-display-type-ticker.php:104
756
+ msgid "Choose how the ticker should initialize."
757
+ msgstr "Wählen Sie, wie der Ticker initialisiert werden soll."
758
+
759
+ #: includes/class-ditty-display-type-ticker.php:106
760
+ msgid "Empty"
761
+ msgstr "Leer"
762
+
763
+ #: includes/class-ditty-display-type-ticker.php:107
764
+ msgid "Filled"
765
+ msgstr "Gefüllt"
766
+
767
+ #: includes/class-ditty-display-type-ticker.php:115
768
+ msgid "Scroll Delay"
769
+ msgstr "Scrollenverzögerung"
770
+
771
+ #: includes/class-ditty-display-type-ticker.php:116
772
+ msgid "Delay the start of scrolling for filled tickers."
773
+ msgstr "Verzögerung des Starts des Tickers."
774
+
775
+ #: includes/class-ditty-display-type-ticker.php:129
776
+ msgid "Set the easing of the ticker height."
777
+ msgstr "Wähle die Vereinfachung der Tickerhöhe."
778
+
779
+ #: includes/class-ditty-display-type-ticker.php:137
780
+ msgid "Set the speed of the ticker height."
781
+ msgstr "Wähle die Höhe der Geschwindigkeit des Tickers."
782
+
783
+ #: includes/class-ditty-display-type-ticker.php:151
784
+ msgid "Randomly shuffle items on each page load."
785
+ msgstr "Zufällige Mischung der Elemente bei jedem Laden der Seite."
786
+
787
+ #: includes/class-ditty-display-type-ticker.php:162
788
+ msgid "Max Width"
789
+ msgstr "Max Breite"
790
+
791
+ #: includes/class-ditty-display-type-ticker.php:163
792
+ msgid "Set a maximum width for items"
793
+ msgstr "Wähle die Max-Breite der Elemente"
794
+
795
+ #: includes/class-ditty-display-type-ticker.php:204
796
+ msgid "Default Ticker"
797
+ msgstr "Standard-Ticker"
798
+
799
+ #: includes/class-ditty-display-type-ticker.php:205
800
+ msgid "Default ticker display"
801
+ msgstr "Anzeige Standard-Ticker"
802
+
803
+ #: includes/class-ditty-display-type.php:202
804
+ #: includes/class-ditty-extensions.php:380 legacy/inc/admin/meta-boxes.php:76
805
+ msgid "Update"
806
+ msgstr "Aktualisieren"
807
+
808
+ #: includes/class-ditty-display-type.php:220
809
+ msgid "Arrow Navigation Settings"
810
+ msgstr "Pfeil-Navigationseinstellungen"
811
+
812
+ #: includes/class-ditty-display-type.php:221
813
+ msgid "Configure arrow navigation settings."
814
+ msgstr "Einstellungen für die Pfeilnavigation konfigurieren."
815
+
816
+ #: includes/class-ditty-display-type.php:226
817
+ msgid "Arrows"
818
+ msgstr "Pfeile"
819
+
820
+ #: includes/class-ditty-display-type.php:227
821
+ msgid "Set the arrow navigation style"
822
+ msgstr "Wähle die Optionen für die Navigations-Steuerung"
823
+
824
+ #: includes/class-ditty-display-type.php:229
825
+ #: includes/class-ditty-display-type.php:302
826
+ msgid "Hide"
827
+ msgstr "Verbergen"
828
+
829
+ #: includes/class-ditty-display-type.php:230
830
+ #: includes/class-ditty-display-type.php:303
831
+ msgid "Show"
832
+ msgstr "Anzeigen"
833
+
834
+ #: includes/class-ditty-display-type.php:237
835
+ msgid "Arrows Icon Color"
836
+ msgstr "Farbe der Pfeile"
837
+
838
+ #: includes/class-ditty-display-type.php:238
839
+ msgid "Add a custom icon color to the arrows"
840
+ msgstr "Hinzufügen einer eigenen Symbolfarbe für die Pfeile"
841
+
842
+ #: includes/class-ditty-display-type.php:244
843
+ msgid "Arrows Background Color"
844
+ msgstr "Pfeil Hintergrundfarbe"
845
+
846
+ #: includes/class-ditty-display-type.php:245
847
+ msgid "Add a custom background color to the arrows"
848
+ msgstr "Die Pfeile mit einer eigenen Hintergrundfarbe versehen"
849
+
850
+ #: includes/class-ditty-display-type.php:251
851
+ msgid "Arrows Position"
852
+ msgstr "Pfeil-Position"
853
+
854
+ #: includes/class-ditty-display-type.php:252
855
+ msgid "Set the position of the arrows"
856
+ msgstr "Wähle die Pfeil-Position"
857
+
858
+ #: includes/class-ditty-display-type.php:254
859
+ #: includes/class-ditty-display-type.php:389
860
+ #: includes/class-ditty-display-type.php:437
861
+ #: includes/fields/ditty-field-spacing.php:25
862
+ msgid "Top"
863
+ msgstr "Oben"
864
+
865
+ #: includes/class-ditty-display-type.php:255
866
+ msgid "Center"
867
+ msgstr "Zentriert"
868
+
869
+ #: includes/class-ditty-display-type.php:256
870
+ #: includes/class-ditty-display-type.php:390
871
+ #: includes/class-ditty-display-type.php:438
872
+ #: includes/fields/ditty-field-spacing.php:26
873
+ msgid "Bottom"
874
+ msgstr "Unten"
875
+
876
+ #: includes/class-ditty-display-type.php:263
877
+ msgid "Arrows Padding"
878
+ msgstr "Pfeilabstand"
879
+
880
+ #: includes/class-ditty-display-type.php:264
881
+ msgid "Add padding to the arrows container"
882
+ msgstr "Hinzufügen von Abstand für den Pfeilcontainer"
883
+
884
+ #: includes/class-ditty-display-type.php:270
885
+ msgid "Arrows Visibility"
886
+ msgstr "Pfeil-Sichtbarkeit"
887
+
888
+ #: includes/class-ditty-display-type.php:271
889
+ #: includes/class-ditty-display-type.php:272
890
+ msgid "Keep arrows visible at all times"
891
+ msgstr "Halten Sie die Pfeile immer sichtbar"
892
+
893
+ #: includes/class-ditty-display-type.php:293
894
+ msgid "Bullet Navigation Settings"
895
+ msgstr "Einstellung der Punktnavigation"
896
+
897
+ #: includes/class-ditty-display-type.php:294
898
+ msgid "Configure bullet navigation settings."
899
+ msgstr "Konfiguration der Punktnavigation."
900
+
901
+ #: includes/class-ditty-display-type.php:299
902
+ msgid "Bullets"
903
+ msgstr "Punkte"
904
+
905
+ #: includes/class-ditty-display-type.php:300
906
+ msgid "Set the bullet navigation style"
907
+ msgstr "Einstellen des Punkt-Stils"
908
+
909
+ #: includes/class-ditty-display-type.php:310
910
+ msgid "Bullets Color"
911
+ msgstr "Punktfarbe"
912
+
913
+ #: includes/class-ditty-display-type.php:311
914
+ msgid "Add a custom color to the bullets"
915
+ msgstr "Individuelle Farbe für die Punkte"
916
+
917
+ #: includes/class-ditty-display-type.php:317
918
+ msgid "Bullets Active Color"
919
+ msgstr "Punkte Aktivfarbe"
920
+
921
+ #: includes/class-ditty-display-type.php:318
922
+ msgid "Add a custom color to the active bullet"
923
+ msgstr ""
924
+ "Hinzufügen einer benutzerdefinierten Farbe für das aktive Aufzählungszeichen"
925
+
926
+ #: includes/class-ditty-display-type.php:324
927
+ msgid "Bullets Position"
928
+ msgstr "Position des Punkts"
929
+
930
+ #: includes/class-ditty-display-type.php:325
931
+ msgid "Set the position of the bullets"
932
+ msgstr "Wähle die Position des Punkts"
933
+
934
+ #: includes/class-ditty-display-type.php:327
935
+ #: includes/fields/ditty-field-radius.php:25
936
+ msgid "Top Left"
937
+ msgstr "Oben links"
938
+
939
+ #: includes/class-ditty-display-type.php:328
940
+ msgid "Top Center"
941
+ msgstr "Oben Zentriert"
942
+
943
+ #: includes/class-ditty-display-type.php:329
944
+ #: includes/fields/ditty-field-radius.php:26
945
+ msgid "Top Right"
946
+ msgstr "Oben rechts"
947
+
948
+ #: includes/class-ditty-display-type.php:330
949
+ #: includes/fields/ditty-field-radius.php:27
950
+ msgid "Bottom Left"
951
+ msgstr "Unten links"
952
+
953
+ #: includes/class-ditty-display-type.php:331
954
+ msgid "Bottom Center"
955
+ msgstr "Unten Zentriert"
956
+
957
+ #: includes/class-ditty-display-type.php:332
958
+ #: includes/fields/ditty-field-radius.php:28
959
+ msgid "Bottom Right"
960
+ msgstr "Unten rechts"
961
+
962
+ #: includes/class-ditty-display-type.php:339
963
+ msgid "Bullets Spacing"
964
+ msgstr "Punkt-Abstand"
965
+
966
+ #: includes/class-ditty-display-type.php:340
967
+ msgid "Set the amount of space between bullets (in pixels)."
968
+ msgstr "Lege den Abstand zwischen den Punkten fest (in Pixels)."
969
+
970
+ #: includes/class-ditty-display-type.php:352
971
+ msgid "Bullets Padding"
972
+ msgstr "Punktabstand"
973
+
974
+ #: includes/class-ditty-display-type.php:353
975
+ msgid "Add padding to the bullets container"
976
+ msgstr "Hinzufügen von Abstand für den Punktecontainer"
977
+
978
+ #: includes/class-ditty-display-type.php:373
979
+ msgid "Border Color"
980
+ msgstr "Rahmenfarbe"
981
+
982
+ #: includes/class-ditty-display-type.php:379
983
+ msgid "Border Style"
984
+ msgstr "Rahmenstil"
985
+
986
+ #: includes/class-ditty-display-type.php:380
987
+ msgid "A border style must be set for a border to render"
988
+ msgstr ""
989
+ "Damit ein Rahmen dargestellt werden kann, muss ein Rahmenstil festgelegt "
990
+ "werden"
991
+
992
+ #: includes/class-ditty-display-type.php:387
993
+ msgid "Border Width"
994
+ msgstr "Randbreite"
995
+
996
+ #: includes/class-ditty-display-type.php:399
997
+ msgid "Border Radius"
998
+ msgstr "Rand-Radius"
999
+
1000
+ #: includes/class-ditty-display-type.php:416
1001
+ msgid "Max. Width"
1002
+ msgstr "Max. Breite"
1003
+
1004
+ #: includes/class-ditty-display-type.php:417
1005
+ msgid "Set a maximum width for the container"
1006
+ msgstr "Wähle die maximale Breite des Containers"
1007
+
1008
+ #: includes/class-ditty-display-type.php:423
1009
+ #: includes/class-ditty-display-type.php:471
1010
+ #: includes/class-ditty-display-type.php:507
1011
+ #: includes/class-ditty-display-type.php:549
1012
+ msgid "Background Color"
1013
+ msgstr "Hintergrundfarbe"
1014
+
1015
+ #: includes/class-ditty-display-type.php:429
1016
+ #: includes/class-ditty-display-type.php:477
1017
+ #: includes/class-ditty-display-type.php:513
1018
+ #: includes/class-ditty-display-type.php:555
1019
+ msgid "Padding"
1020
+ msgstr "Padding"
1021
+
1022
+ #: includes/class-ditty-display-type.php:435
1023
+ msgid "Margin"
1024
+ msgstr "Rand"
1025
+
1026
+ #: includes/class-ditty-display-type.php:453
1027
+ msgid "Container Styles"
1028
+ msgstr "Container-Stile"
1029
+
1030
+ #: includes/class-ditty-display-type.php:454
1031
+ msgid "Add custom container styles."
1032
+ msgstr "Benutzerdefinierte Container-Stile."
1033
+
1034
+ #: includes/class-ditty-display-type.php:489
1035
+ msgid "Content Styles"
1036
+ msgstr "Stil des Inhalts"
1037
+
1038
+ #: includes/class-ditty-display-type.php:490
1039
+ msgid "Add custom content styles."
1040
+ msgstr "Benutzerdefinierte Inhalts-Stile."
1041
+
1042
+ #: includes/class-ditty-display-type.php:525
1043
+ msgid "Page Styles"
1044
+ msgstr "Stil der Seite"
1045
+
1046
+ #: includes/class-ditty-display-type.php:526
1047
+ msgid "Add custom page styles."
1048
+ msgstr "Benutzerdefinierte Stile für die Seiten."
1049
+
1050
+ #: includes/class-ditty-display-type.php:543
1051
+ msgid "Text Color"
1052
+ msgstr "Textfarbe"
1053
+
1054
+ #: includes/class-ditty-display-type.php:567
1055
+ msgid "Item Styles"
1056
+ msgstr "Element-Stile"
1057
+
1058
+ #: includes/class-ditty-display-type.php:568
1059
+ msgid "Add custom item styles."
1060
+ msgstr "Benutzerdefinierte Element-Stile."
1061
+
1062
+ #: includes/class-ditty-displays.php:119 includes/class-ditty-displays.php:173
1063
+ #: includes/class-ditty-displays.php:181 includes/class-ditty-layouts.php:125
1064
+ #: includes/class-ditty-layouts.php:229 includes/class-ditty-layouts.php:237
1065
+ msgid "Installed"
1066
+ msgstr "Installiert"
1067
+
1068
+ #: includes/class-ditty-displays.php:186 includes/class-ditty-layouts.php:242
1069
+ #, php-format
1070
+ msgid "Install Version %s"
1071
+ msgstr "Version %s jetzt installieren"
1072
+
1073
+ #: includes/class-ditty-displays.php:196 includes/class-ditty-layouts.php:251
1074
+ msgid "Install Template"
1075
+ msgstr "Template installieren"
1076
+
1077
+ #: includes/class-ditty-displays.php:228 includes/class-ditty-layouts.php:279
1078
+ #: includes/class-ditty-singles.php:260
1079
+ #, php-format
1080
+ msgid "ID: %d"
1081
+ msgstr "ID: %d"
1082
+
1083
+ #: includes/class-ditty-displays.php:242
1084
+ msgid "Display Info"
1085
+ msgstr "Anzeige-Info"
1086
+
1087
+ #: includes/class-ditty-displays.php:243
1088
+ msgid "Display Settings"
1089
+ msgstr "Einstellungen anzeigen"
1090
+
1091
+ #: includes/class-ditty-displays.php:309
1092
+ msgid "Display type does not exist"
1093
+ msgstr "Anzeigetyp nicht vorhanden"
1094
+
1095
+ #: includes/class-ditty-displays.php:341 includes/class-ditty-layouts.php:354
1096
+ msgid "Description"
1097
+ msgstr "Beschreibung"
1098
+
1099
+ #: includes/class-ditty-displays.php:364
1100
+ #, php-format
1101
+ msgid "% display type does not exist."
1102
+ msgstr "%d Anzeigetyp nicht vorhanden."
1103
+
1104
+ #: includes/class-ditty-displays.php:400 includes/post-types.php:86
1105
+ msgid "Edit Display"
1106
+ msgstr "Anzeige bearbeiten"
1107
+
1108
+ #: includes/class-ditty-displays.php:411 includes/class-ditty-items.php:158
1109
+ #: includes/class-ditty-layouts.php:526 includes/fields/ditty-field.php:223
1110
+ msgid "Clone"
1111
+ msgstr "Kopieren"
1112
+
1113
+ #: includes/class-ditty-displays.php:422 includes/class-ditty-items.php:169
1114
+ #: includes/class-ditty-layouts.php:537 includes/fields/ditty-field.php:221
1115
+ msgid "Delete"
1116
+ msgstr "Löschen"
1117
+
1118
+ #: includes/class-ditty-displays.php:573
1119
+ msgid "Display does not exist"
1120
+ msgstr "Anzeige nicht vorhanden"
1121
+
1122
+ #: includes/class-ditty-displays.php:695 includes/class-ditty-layouts.php:764
1123
+ msgid "Title Goes Here..."
1124
+ msgstr "Titel geht hier..."
1125
+
1126
+ #: includes/class-ditty-displays.php:775 includes/class-ditty-layouts.php:872
1127
+ #, php-format
1128
+ msgid "%s Clone"
1129
+ msgstr "%s kopieren"
1130
+
1131
+ #: includes/class-ditty-editor.php:64
1132
+ msgid "Ditty updated"
1133
+ msgstr "Ditty News Ticker wurde aktualisiert"
1134
+
1135
+ #: includes/class-ditty-extensions.php:49
1136
+ #: includes/class-ditty-extensions.php:52
1137
+ #: includes/class-ditty-extensions.php:422
1138
+ msgid "Ditty Extensions"
1139
+ msgstr "Ditty Erweiterungen"
1140
+
1141
+ #: includes/class-ditty-extensions.php:49
1142
+ #: includes/class-ditty-extensions.php:52
1143
+ msgid "Extensions"
1144
+ msgstr "Erweiterungen"
1145
+
1146
+ #: includes/class-ditty-extensions.php:78
1147
+ msgid "Ditty..."
1148
+ msgstr "Ditty..."
1149
+
1150
+ #: includes/class-ditty-extensions.php:93 includes/helpers.php:636
1151
+ msgid "License is active."
1152
+ msgstr "Lizenz ist aktiv."
1153
+
1154
+ #: includes/class-ditty-extensions.php:94
1155
+ #: includes/class-ditty-extensions.php:95 includes/helpers.php:637
1156
+ #: includes/helpers.php:638
1157
+ msgid "An error occurred, please try again."
1158
+ msgstr "Ein Fehler ist aufgetreten. Bitte versuche es nochmal."
1159
+
1160
+ #: includes/class-ditty-extensions.php:96 includes/helpers.php:639
1161
+ #, php-format
1162
+ msgid "Your license key expired on %s."
1163
+ msgstr "Dein Lizenzschlüssel läuft am %s ab."
1164
+
1165
+ #: includes/class-ditty-extensions.php:97
1166
+ #: includes/class-ditty-extensions.php:98 includes/helpers.php:640
1167
+ #: includes/helpers.php:641
1168
+ msgid "Your license key has been disabled."
1169
+ msgstr "Deine Lizenz wurde deaktiviert."
1170
+
1171
+ #: includes/class-ditty-extensions.php:99 includes/helpers.php:642
1172
+ msgid "Invalid license."
1173
+ msgstr "Ungültige Lizenz."
1174
+
1175
+ #: includes/class-ditty-extensions.php:100
1176
+ #: includes/class-ditty-extensions.php:101 includes/helpers.php:643
1177
+ #: includes/helpers.php:644
1178
+ msgid "Your license is not active for this URL."
1179
+ msgstr "Diese Lizenz ist hier nicht aktiv."
1180
+
1181
+ #: includes/class-ditty-extensions.php:102
1182
+ #, php-format
1183
+ msgid "This appears to be an invalid license key for %s."
1184
+ msgstr "Ungültiger Lizenzschlüssel für %s."
1185
+
1186
+ #: includes/class-ditty-extensions.php:103 includes/helpers.php:646
1187
+ msgid "Your license key has reached its activation limit."
1188
+ msgstr "Ihr Lizenzschlüssel hat sein aktives Limit erreicht."
1189
+
1190
+ #: includes/class-ditty-extensions.php:104 includes/helpers.php:647
1191
+ msgid "License is deactivated."
1192
+ msgstr "Lizenz wurde deaktiviert."
1193
+
1194
+ #: includes/class-ditty-extensions.php:105 includes/helpers.php:648
1195
+ msgid "Update failed."
1196
+ msgstr "Aktualisierung fehlgeschlagen."
1197
+
1198
+ #: includes/class-ditty-extensions.php:116
1199
+ #, php-format
1200
+ msgid ""
1201
+ "Please <a href=\"%s\" target=\"_blank\">update or renew your license</a>."
1202
+ msgstr ""
1203
+ "Bitte Deine Lizenz <a href=\"%s\" target=\"_blank\">aktualisieren oder "
1204
+ "erneuern</a>."
1205
+
1206
+ #: includes/class-ditty-extensions.php:266
1207
+ msgid "License"
1208
+ msgstr "Lizenzschlüssel"
1209
+
1210
+ #: includes/class-ditty-extensions.php:330
1211
+ msgid "Preview Extension"
1212
+ msgstr "Vorschau Erweiterungen"
1213
+
1214
+ #: includes/class-ditty-extensions.php:362 legacy/eddsl/eddsl.php:202
1215
+ msgid "Add your license key here"
1216
+ msgstr "Gib deinen Lizenzschlüssel hier ein"
1217
+
1218
+ #: includes/class-ditty-extensions.php:363 legacy/inc/helpers.php:396
1219
+ msgid "Activate License"
1220
+ msgstr "Lizenz aktivieren"
1221
+
1222
+ #: includes/class-ditty-extensions.php:364 legacy/inc/helpers.php:397
1223
+ msgid "Refresh License"
1224
+ msgstr "Lizenz erneuern"
1225
+
1226
+ #: includes/class-ditty-extensions.php:365
1227
+ msgid "Deactive License"
1228
+ msgstr "Deaktivierter Lizenzschlüssel"
1229
+
1230
+ #: includes/class-ditty-extensions.php:429
1231
+ msgid "Active Extensions"
1232
+ msgstr "Aktive Erweiterung"
1233
+
1234
+ #: includes/class-ditty-extensions.php:445
1235
+ msgid "Additional Ditty Extensions"
1236
+ msgstr "Zusätzliche Ditty Erweiterungen"
1237
+
1238
+ #: includes/class-ditty-item-type-default.php:33
1239
+ #: includes/class-ditty-item-type-wp-editor.php:33
1240
+ msgid "Add the content of your item. HTML and inline styles are supported."
1241
+ msgstr ""
1242
+ "Füge deinem Tick Inhalt hinzu. HTML und Inline-Styles werden unterstützt."
1243
+
1244
+ #: includes/class-ditty-item-type-default.php:39
1245
+ #: legacy/inc/admin/meta-boxes.php:288
1246
+ msgid "Link"
1247
+ msgstr "Link"
1248
+
1249
+ #: includes/class-ditty-item-type-default.php:40
1250
+ msgid ""
1251
+ "Add a custom link to your content. You can also add a link directly into "
1252
+ "your content."
1253
+ msgstr ""
1254
+ "Erstelle einen Link um deinen Tick-Inhalt. Du kannst einen Link auch direkt "
1255
+ "im Inhalt angeben."
1256
+
1257
+ #: includes/class-ditty-item-type-default.php:49
1258
+ #: includes/class-ditty-singles.php:106 legacy/inc/admin/fields/fields.php:139
1259
+ msgid "Title"
1260
+ msgstr "Titel"
1261
+
1262
+ #: includes/class-ditty-item-type-default.php:50
1263
+ msgid "Add a title to the custom lnk."
1264
+ msgstr "Gib einen Titel zum Benutzer-link ein."
1265
+
1266
+ #: includes/class-ditty-item-type-default.php:56
1267
+ #: legacy/inc/admin/meta-boxes.php:296
1268
+ msgid "Target"
1269
+ msgstr "Ziel"
1270
+
1271
+ #: includes/class-ditty-item-type-default.php:57
1272
+ #: legacy/inc/admin/meta-boxes.php:297
1273
+ msgid "Set a target for your link."
1274
+ msgstr "Lege ein Ziel für deinen Link fest."
1275
+
1276
+ #: includes/class-ditty-item-type-default.php:67
1277
+ #: legacy/inc/admin/meta-boxes.php:307
1278
+ msgid "No Follow"
1279
+ msgstr "No Follow"
1280
+
1281
+ #: includes/class-ditty-item-type-default.php:68
1282
+ #: legacy/inc/admin/meta-boxes.php:310
1283
+ msgid "Add \"nofollow\" to link"
1284
+ msgstr "Füge dem Link „nofollow“ hinzu"
1285
+
1286
+ #: includes/class-ditty-item-type-default.php:69
1287
+ #: legacy/inc/admin/meta-boxes.php:308
1288
+ msgid ""
1289
+ "Enabling this setting will add an attribute called 'nofollow' to your link. "
1290
+ "This tells search engines to not follow this link."
1291
+ msgstr ""
1292
+ "Das Aktivieren dieser Einstellung fügt deinem Link das „nofollow“-Attribut "
1293
+ "hinzu. Dies weist Suchmaschinen an, diesem Link nicht zu folgen."
1294
+
1295
+ #: includes/class-ditty-item-type-default.php:84
1296
+ #: includes/class-ditty-item-type-wp-editor.php:48
1297
+ msgid "This is a sample item. Please edit me!"
1298
+ msgstr "Dies ist ein Beispieltick. Bitte bearbeiten!"
1299
+
1300
+ #: includes/class-ditty-item-type-default.php:119
1301
+ #: includes/class-ditty-item.php:35
1302
+ msgid "No text set..."
1303
+ msgstr "Kein Text vorhanden..."
1304
+
1305
+ #: includes/class-ditty-item-type-posts.php:68
1306
+ msgid "Limit"
1307
+ msgstr "Limit"
1308
+
1309
+ #: includes/class-ditty-item-type-posts.php:69
1310
+ msgid "Set the number of latest posts to display."
1311
+ msgstr ""
1312
+ "Legen Sie die Anzahl der neuesten Beiträge fest, die angezeigt werden sollen."
1313
+
1314
+ #: includes/class-ditty-item-type-posts.php:141
1315
+ #, php-format
1316
+ msgid "Displaying the latest %d posts"
1317
+ msgstr "Zeige die letzten %d Posts an"
1318
+
1319
+ #: includes/class-ditty-item-type-wp-editor.php:62
1320
+ msgid "No content set..."
1321
+ msgstr "Kein Inhalt vorhanden..."
1322
+
1323
+ #: includes/class-ditty-item-type.php:145 includes/helpers.php:65
1324
+ #: legacy/inc/helpers.php:12 legacy/inc/helpers.php:55
1325
+ msgid "Default"
1326
+ msgstr "Standard"
1327
+
1328
+ #: includes/class-ditty-item-type.php:146
1329
+ msgid "Default variation."
1330
+ msgstr "Standard-Variante."
1331
+
1332
+ #: includes/class-ditty-item.php:365
1333
+ #, php-format
1334
+ msgid "<strong>%s</strong> item type does not exist!"
1335
+ msgstr "<strong>%s</strong> Artikeltyp existiert nicht!"
1336
+
1337
+ #: includes/class-ditty-items.php:89
1338
+ msgid "The item elements container"
1339
+ msgstr "Inhalts-Elemente"
1340
+
1341
+ #: includes/class-ditty-items.php:103
1342
+ msgid "Change Type"
1343
+ msgstr "Ändere Typ"
1344
+
1345
+ #: includes/class-ditty-items.php:125 includes/fields/ditty-field.php:220
1346
+ msgid "Re-arrange"
1347
+ msgstr "Neu anordnen"
1348
+
1349
+ #: includes/class-ditty-items.php:136
1350
+ msgid "Edit Item"
1351
+ msgstr "Element bearbeiten"
1352
+
1353
+ #: includes/class-ditty-items.php:147 includes/post-types.php:51
1354
+ msgid "Edit Layout"
1355
+ msgstr "Layout bearbeiten"
1356
+
1357
+ #: includes/class-ditty-items.php:186
1358
+ msgid "Items"
1359
+ msgstr "Artikel"
1360
+
1361
+ #: includes/class-ditty-items.php:208
1362
+ msgid "Add Item"
1363
+ msgstr "Element hinzufügen"
1364
+
1365
+ #: includes/class-ditty-items.php:246
1366
+ msgid "Item Types"
1367
+ msgstr "Elementtypen"
1368
+
1369
+ #: includes/class-ditty-items.php:248
1370
+ msgid "Go Back"
1371
+ msgstr "Gehe zurück"
1372
+
1373
+ #: includes/class-ditty-layout.php:88
1374
+ msgid "Ditty Layout does not exist."
1375
+ msgstr "Das Layout ist nicht vorhanden."
1376
+
1377
+ #: includes/class-ditty-layouts.php:155
1378
+ msgid "Choose a Layout"
1379
+ msgstr "Ein Layout auswählen"
1380
+
1381
+ #: includes/class-ditty-layouts.php:159
1382
+ msgid "Layout Variations"
1383
+ msgstr "Layout Varianten"
1384
+
1385
+ #: includes/class-ditty-layouts.php:293
1386
+ msgid "Layout Info"
1387
+ msgstr "Layout Info"
1388
+
1389
+ #: includes/class-ditty-layouts.php:294
1390
+ msgid "Layout HTML"
1391
+ msgstr "Layout HTML"
1392
+
1393
+ #: includes/class-ditty-layouts.php:295
1394
+ msgid "Layout CSS"
1395
+ msgstr "Layout CSS"
1396
+
1397
+ #: includes/class-ditty-layouts.php:504 includes/class-ditty-layouts.php:599
1398
+ #: includes/class-ditty-layouts.php:751
1399
+ msgid "Edit HTML"
1400
+ msgstr "HTML bearbeiten"
1401
+
1402
+ #: includes/class-ditty-layouts.php:515 includes/class-ditty-layouts.php:600
1403
+ #: includes/class-ditty-layouts.php:746
1404
+ msgid "Edit CSS"
1405
+ msgstr "CSS-Code bearbeiten"
1406
+
1407
+ #: includes/class-ditty-layouts.php:570
1408
+ #, php-format
1409
+ msgid "Layout: <span>%s</span>"
1410
+ msgstr "Layout: <span>%s</span>"
1411
+
1412
+ #: includes/class-ditty-layouts.php:596
1413
+ #, php-format
1414
+ msgid "Variation: %s"
1415
+ msgstr "Variante: %s"
1416
+
1417
+ #: includes/class-ditty-layouts.php:597
1418
+ #, php-format
1419
+ msgid "Template: <span>%s</span>%s"
1420
+ msgstr "Vorlage: <span>%s</span>%s"
1421
+
1422
+ #: includes/class-ditty-layouts.php:603
1423
+ msgid "Change Template"
1424
+ msgstr "Wechsle Vorlage"
1425
+
1426
+ #: includes/class-ditty-layouts.php:642
1427
+ #, php-format
1428
+ msgid "Variation: <span>%s</span>"
1429
+ msgstr "Variante: <span>%s</span>"
1430
+
1431
+ #: includes/class-ditty-layouts.php:775
1432
+ msgid "Tags"
1433
+ msgstr "Schlagwörter"
1434
+
1435
+ #: includes/class-ditty-layouts.php:778
1436
+ msgid ""
1437
+ "Hold the shift key when clicking the tag to paste all default attributes"
1438
+ msgstr ""
1439
+ "Beim Anklicken des Tags die Umschalttaste gedrückt halten, um alle "
1440
+ "Standardattribute einzufügen"
1441
+
1442
+ #: includes/class-ditty-singles.php:95 includes/class-ditty-singles.php:194
1443
+ #: includes/class-ditty-singles.php:612
1444
+ #, php-format
1445
+ msgid "Ditty %d"
1446
+ msgstr "Ditty %d"
1447
+
1448
+ #: includes/class-ditty-singles.php:113 legacy/inc/admin/edit-columns.php:15
1449
+ #: legacy/inc/admin/meta-boxes.php:19
1450
+ msgid "Shortcode"
1451
+ msgstr "Shortcode"
1452
+
1453
+ #: includes/class-ditty-singles.php:119
1454
+ msgid "Status"
1455
+ msgstr "Status"
1456
+
1457
+ #: includes/class-ditty-singles.php:121
1458
+ msgid "Active"
1459
+ msgstr "Aktiv"
1460
+
1461
+ #: includes/class-ditty-singles.php:130
1462
+ msgid "Ajax Loading"
1463
+ msgstr "Lade Ajax"
1464
+
1465
+ #: includes/class-ditty-singles.php:155
1466
+ msgid "Preview Settings"
1467
+ msgstr "Vorschau der Einstellungen"
1468
+
1469
+ #: includes/class-ditty-singles.php:156
1470
+ msgid "Configure the editor preview style."
1471
+ msgstr "Legen Sie den Stil der Editorvorschau fest."
1472
+
1473
+ #: includes/class-ditty-singles.php:161
1474
+ msgid "Preview Background Color"
1475
+ msgstr "Hintergrundfarbe der Vorschau"
1476
+
1477
+ #: includes/class-ditty-singles.php:162
1478
+ msgid "Set a custom background color for the preview area while editing."
1479
+ msgstr ""
1480
+ "Legt eine benutzerdefinierte Hintergrundfarbe für den Vorschaubereich "
1481
+ "während der Bearbeitung fest."
1482
+
1483
+ #: includes/class-ditty-singles.php:168
1484
+ msgid "Preview Padding"
1485
+ msgstr "Abstand der Vorschau"
1486
+
1487
+ #: includes/class-ditty.php:189 includes/class-ditty.php:201
1488
+ msgid "Cheatin&#8217; huh?"
1489
+ msgstr "Schummeln&#8217; oder?"
1490
+
1491
+ #: includes/fields/ditty-field-button.php:24
1492
+ msgid "Button"
1493
+ msgstr "Button"
1494
+
1495
+ #: includes/fields/ditty-field-image.php:25 legacy/inc/static.php:34
1496
+ msgid "Upload or select an image"
1497
+ msgstr "Wähle ein Bild oder lade eines hoch"
1498
+
1499
+ #: includes/fields/ditty-field-image.php:26
1500
+ msgid "Insert Image"
1501
+ msgstr "Bild einfügen"
1502
+
1503
+ #: includes/fields/ditty-field.php:37
1504
+ msgid "Add More"
1505
+ msgstr "Füge mehr hinzu"
1506
+
1507
+ #: includes/fields/ditty-field.php:222
1508
+ msgid "Add"
1509
+ msgstr "Hinzufügen"
1510
+
1511
+ #: includes/fields/helpers.php:11
1512
+ msgid "No field type specified."
1513
+ msgstr "Kein Feldtyp festgelegt."
1514
+
1515
+ #: includes/fields/helpers.php:16
1516
+ #, php-format
1517
+ msgid "%s class does not exists."
1518
+ msgstr "%s Klasse existiert nicht."
1519
+
1520
+ #: includes/helpers.php:67
1521
+ msgid "Manually add HTML to the item."
1522
+ msgstr "Manuelle HTML-Ergänzung zum Element."
1523
+
1524
+ #: includes/helpers.php:73
1525
+ msgid "WP Editor"
1526
+ msgstr "WP Editor"
1527
+
1528
+ #: includes/helpers.php:75
1529
+ msgid "Manually add wp editor content to the item."
1530
+ msgstr "Füge dem Artikel manuell wp-Editor-Inhalte hinzu."
1531
+
1532
+ #: includes/helpers.php:106
1533
+ msgid "Basic news ticker display."
1534
+ msgstr "News-Ticker Anzeige."
1535
+
1536
+ #: includes/helpers.php:111 legacy/inc/helpers.php:141
1537
+ msgid "List"
1538
+ msgstr "Liste"
1539
+
1540
+ #: includes/helpers.php:113
1541
+ msgid "Display items in a static list."
1542
+ msgstr "Ein Element in der Statischen Liste anzeigen."
1543
+
1544
+ #: includes/helpers.php:159
1545
+ msgid "Instagram"
1546
+ msgstr "Instagram"
1547
+
1548
+ #: includes/helpers.php:171
1549
+ msgid "RSS"
1550
+ msgstr "RSS"
1551
+
1552
+ #: includes/helpers.php:177
1553
+ msgid "Twitter"
1554
+ msgstr "Twitter"
1555
+
1556
+ #: includes/helpers.php:645
1557
+ msgid "This appears to be an invalid license key."
1558
+ msgstr "Dies könnte ein Lizenzschlüssel sein."
1559
+
1560
+ #: includes/helpers.php:649
1561
+ msgid "Save Settings"
1562
+ msgstr "Einstellungen speichern"
1563
+
1564
+ #: includes/helpers.php:650
1565
+ msgid "Saving..."
1566
+ msgstr "Speichern..."
1567
+
1568
+ #: includes/helpers.php:651
1569
+ msgid "Settings have changed, make sure to save them!"
1570
+ msgstr "Die Einstellungen haben sich geändert, speichern Sie sie unbedingt!"
1571
+
1572
+ #: includes/helpers.php:652
1573
+ msgid "Settings Updated!"
1574
+ msgstr "Einstellungen aktualisiert!"
1575
+
1576
+ #: includes/helpers.php:653
1577
+ msgid "Error Updating!"
1578
+ msgstr "Fehler beim Aktualisieren!"
1579
+
1580
+ #: includes/helpers.php:677
1581
+ msgid "Add title"
1582
+ msgstr "Ergänze Titel"
1583
+
1584
+ #: includes/helpers.php:678
1585
+ msgid ""
1586
+ "Are you sure you want to delete this Item? This action cannot be undone."
1587
+ msgstr ""
1588
+ "Möchtest du dieses Element wirklich löschen? Diese Aktion kann nicht "
1589
+ "widerrufen werden."
1590
+
1591
+ #: includes/helpers.php:679
1592
+ msgid "Are you sure you want to delete this Display?"
1593
+ msgstr "Bist du sicher, dass du diese Anzeige löschen willst?"
1594
+
1595
+ #: includes/helpers.php:680
1596
+ msgid "Are you sure you want to delete this Layout?"
1597
+ msgstr "Bist du sicher, dass du dieses Layout löschen willst?"
1598
+
1599
+ #: includes/helpers.php:681
1600
+ msgid "There is an error in your css.<br/>Click to close this message."
1601
+ msgstr ""
1602
+ "Da ist ein Fehler in Ihrem css.<br/>Klicken Sie, um diese Nachricht zu "
1603
+ "schließen."
1604
+
1605
+ #: includes/helpers.php:956 legacy/inc/admin/meta-boxes.php:666
1606
+ msgid "Fade"
1607
+ msgstr "Ein-/ Ausblenden"
1608
+
1609
+ #: includes/helpers.php:957
1610
+ msgid "Slide Left"
1611
+ msgstr "Nach links gleiten"
1612
+
1613
+ #: includes/helpers.php:958
1614
+ msgid "Slide Right"
1615
+ msgstr "Nach rechts gleiten"
1616
+
1617
+ #: includes/helpers.php:959
1618
+ msgid "Slide Down"
1619
+ msgstr "Nach unten gleiten"
1620
+
1621
+ #: includes/helpers.php:960
1622
+ msgid "Slide Up"
1623
+ msgstr "Nach oben gleiten"
1624
+
1625
+ #: includes/layout-tags.php:12
1626
+ msgid "Render the item's author avatar"
1627
+ msgstr "Avatar-URLs für den Objekt-Autor"
1628
+
1629
+ #: includes/layout-tags.php:30
1630
+ msgid "Render the item's author banner"
1631
+ msgstr "Autorbanner anzeigen, wenn verfügbar"
1632
+
1633
+ #: includes/layout-tags.php:48
1634
+ msgid "Render the item's author biography"
1635
+ msgstr "Autorbiographie anzeigen, wenn verfügbar"
1636
+
1637
+ #: includes/layout-tags.php:63
1638
+ msgid "Render the item's author name"
1639
+ msgstr "Autorname anzeigen, wenn verfügbar"
1640
+
1641
+ #: includes/layout-tags.php:78
1642
+ msgid "Render the item's author screen name"
1643
+ msgstr "Autorname anzeigen, wenn verfügbar"
1644
+
1645
+ #: includes/layout-tags.php:93
1646
+ msgid "Render the item caption."
1647
+ msgstr "Die Beschriftung des Artikels anzeigen."
1648
+
1649
+ #: includes/layout-tags.php:109
1650
+ msgid "Render the item categories"
1651
+ msgstr "Artikelkategorie anzeigen"
1652
+
1653
+ #: includes/layout-tags.php:121
1654
+ msgid "Render the item content."
1655
+ msgstr "Zusammenstellen des Inhaltes."
1656
+
1657
+ #: includes/layout-tags.php:131
1658
+ msgid "Render a custom field for the item"
1659
+ msgstr "Rendering eines benutzerdefinierten Feldes für den Artikel"
1660
+
1661
+ #: includes/layout-tags.php:142
1662
+ msgid "Render the item excerpt."
1663
+ msgstr "Rendering des Artikel-Auszugs."
1664
+
1665
+ #: includes/layout-tags.php:160
1666
+ msgid "Render the item icon."
1667
+ msgstr "Rendering des Artikel-Icons."
1668
+
1669
+ #: includes/layout-tags.php:175
1670
+ msgid "Render the item image."
1671
+ msgstr "Rendering des Artikel-Bildes."
1672
+
1673
+ #: includes/layout-tags.php:193
1674
+ msgid "Render the item image url."
1675
+ msgstr "Rendering der Bild URL."
1676
+
1677
+ #: includes/layout-tags.php:197
1678
+ msgid "Render the item permalink."
1679
+ msgstr "Rendering des Permalinks."
1680
+
1681
+ #: includes/layout-tags.php:201
1682
+ msgid "Render the item source."
1683
+ msgstr "Rendern der Artikelquelle."
1684
+
1685
+ #: includes/layout-tags.php:216
1686
+ msgid "Render the item terms"
1687
+ msgstr "Rendern der Artikelbegriffe"
1688
+
1689
+ #: includes/layout-tags.php:229
1690
+ msgid "Render the item date/time."
1691
+ msgstr "Rendern von Datum/Zeit."
1692
+
1693
+ #: includes/layout-tags.php:234
1694
+ #, php-format
1695
+ msgid "%s ago"
1696
+ msgstr "vor %s"
1697
+
1698
+ #: includes/layout-tags.php:247
1699
+ msgid "Render the item title."
1700
+ msgstr "Rendern des Anzeigenamen."
1701
+
1702
+ #: includes/layout-templates.php:12
1703
+ msgid "Default Layout"
1704
+ msgstr "Standard-Layout"
1705
+
1706
+ #: includes/layout-templates.php:13
1707
+ msgid "Default layout for custom content."
1708
+ msgstr "Standard-Layout für Benutzerinhalte."
1709
+
1710
+ #: includes/layout-templates.php:19
1711
+ msgid "Default Image Layout"
1712
+ msgstr "Standard Bild-Layout"
1713
+
1714
+ #: includes/layout-templates.php:20
1715
+ msgid "Default layout for Images."
1716
+ msgstr "Standard-Layout für Bilder."
1717
+
1718
+ #: includes/layout-templates.php:26
1719
+ msgid "Default Post Layout"
1720
+ msgstr "Standard-Layout für Posts"
1721
+
1722
+ #: includes/layout-templates.php:27
1723
+ msgid "Default layout for Posts."
1724
+ msgstr "Standard-Layout für Posts."
1725
+
1726
+ #: includes/post-types.php:16 includes/post-types.php:49
1727
+ #: includes/post-types.php:84 legacy/inc/post-types.php:16
1728
+ msgid "Add New"
1729
+ msgstr "Neu hinzufügen"
1730
+
1731
+ #: includes/post-types.php:17
1732
+ msgid "Add New Ditty"
1733
+ msgstr "Neues Ditty hinzufügen"
1734
+
1735
+ #: includes/post-types.php:18
1736
+ msgid "Edit Ditty"
1737
+ msgstr "Bearbeite Ditty"
1738
+
1739
+ #: includes/post-types.php:19
1740
+ msgid "New Ditty"
1741
+ msgstr "Neues Ditty"
1742
+
1743
+ #: includes/post-types.php:20
1744
+ msgid "View Ditty"
1745
+ msgstr "Ditty anzeigen"
1746
+
1747
+ #: includes/post-types.php:21
1748
+ msgid "Search Ditty"
1749
+ msgstr "Suche nach Ditty"
1750
+
1751
+ #: includes/post-types.php:22
1752
+ msgid "No Ditty Found"
1753
+ msgstr "Kein Ditty gefunden"
1754
+
1755
+ #: includes/post-types.php:23
1756
+ msgid "No Ditty Found In Trash"
1757
+ msgstr "Keine Ticks im Papierkorb gefunden"
1758
+
1759
+ #: includes/post-types.php:47 includes/post-types.php:58
1760
+ msgid "Layouts"
1761
+ msgstr "Layouts"
1762
+
1763
+ #: includes/post-types.php:48
1764
+ msgid "Layout"
1765
+ msgstr "Layout"
1766
+
1767
+ #: includes/post-types.php:50
1768
+ msgid "Add New Layout"
1769
+ msgstr "Neues Layout hinzufügen"
1770
+
1771
+ #: includes/post-types.php:52
1772
+ msgid "New Layout"
1773
+ msgstr "Neues Layout"
1774
+
1775
+ #: includes/post-types.php:53
1776
+ msgid "View Layout"
1777
+ msgstr "Layout anschauen"
1778
+
1779
+ #: includes/post-types.php:54
1780
+ msgid "Search Layouts"
1781
+ msgstr "Suche nach Layouts"
1782
+
1783
+ #: includes/post-types.php:55
1784
+ msgid "No Layouts Found"
1785
+ msgstr "Keine Layouts gefunden"
1786
+
1787
+ #: includes/post-types.php:56
1788
+ msgid "No Layouts Found In Trash"
1789
+ msgstr "Keine Layouts im Papierkorb gefunden"
1790
+
1791
+ #: includes/post-types.php:82 includes/post-types.php:93
1792
+ msgid "Displays"
1793
+ msgstr "Ansicht"
1794
+
1795
+ #: includes/post-types.php:85
1796
+ msgid "Add New Display"
1797
+ msgstr "Neue Ansicht hinzufügen"
1798
+
1799
+ #: includes/post-types.php:87
1800
+ msgid "New Display"
1801
+ msgstr "Neue Anzeige"
1802
+
1803
+ #: includes/post-types.php:88
1804
+ msgid "View Display"
1805
+ msgstr "Anzeigen"
1806
+
1807
+ #: includes/post-types.php:89
1808
+ msgid "Search Displays"
1809
+ msgstr "Anzeige Suchen"
1810
+
1811
+ #: includes/post-types.php:90
1812
+ msgid "No Displays Found"
1813
+ msgstr "Keine Anzeigen gefunden"
1814
+
1815
+ #: includes/post-types.php:91
1816
+ msgid "No Displays Found In Trash"
1817
+ msgstr "Keine Anzeigen im Papierkorb gefunden"
1818
+
1819
+ #: includes/post-types.php:123
1820
+ msgid "Ditty Updated!"
1821
+ msgstr "Ditty News Ticker aktualisiert!"
1822
+
1823
+ #: includes/post-types.php:124
1824
+ msgid "Layout Updated!"
1825
+ msgstr "Layout aktualisiert!"
1826
+
1827
+ #: includes/post-types.php:125
1828
+ msgid "Display Updated!"
1829
+ msgstr "Anzeige aktualisiert!"
1830
+
1831
+ #: legacy/eddsl/eddsl.php:89 legacy/eddsl/eddsl.php:90
1832
+ #: legacy/eddsl/eddsl.php:100 legacy/eddsl/eddsl.php:101
1833
+ msgid "Metaphor Licenses"
1834
+ msgstr "Metaphor Lizenzen"
1835
+
1836
+ #: legacy/eddsl/eddsl.php:123
1837
+ msgid "Metaphor Creations Licenses"
1838
+ msgstr "Metaphor Créations Lizenzen"
1839
+
1840
+ #: legacy/eddsl/eddsl.php:214 legacy/inc/helpers.php:391
1841
+ msgid "Your license is activated!"
1842
+ msgstr "Deine Lizenz ist aktiviert!"
1843
+
1844
+ #: legacy/eddsl/eddsl.php:216
1845
+ #, php-format
1846
+ msgid "Your license key expires on %s"
1847
+ msgstr "Deine Lizenz läuft am %s ab"
1848
+
1849
+ #: legacy/eddsl/eddsl.php:224 legacy/eddsl/eddsl.php:247
1850
+ msgid "Sorry, it looks like all of your licenses have already been activated."
1851
+ msgstr "Es sieht so aus, als ob alle Deine Lizenzen bereits aktiviert wurden."
1852
+
1853
+ #: legacy/eddsl/eddsl.php:225 legacy/eddsl/eddsl.php:248
1854
+ #, php-format
1855
+ msgid "View your license activations <a href=\"%s\" target=\"_blank\">here</a>"
1856
+ msgstr ""
1857
+ "Sehen Sie Ihre Lizenzaktivierungen <a href=\"%s\" target=\"_blank\">hier</a>"
1858
+
1859
+ #: legacy/eddsl/eddsl.php:230
1860
+ #, php-format
1861
+ msgid ""
1862
+ "Sorry, this license is not valid. View your licenses <a href=\"%s\" target="
1863
+ "\"_blank\">here</a>"
1864
+ msgstr ""
1865
+ "Sorry, diese Lizenz ist nicht gültig. Deine Lizenz <a href=\"%s\" target="
1866
+ "\"_blank\">hier</a> anzeigen"
1867
+
1868
+ #: legacy/eddsl/eddsl.php:238
1869
+ #, php-format
1870
+ msgid ""
1871
+ "Sorry, your license has expired. Update your license <a href=\"%s\" target="
1872
+ "\"_blank\">here</a>"
1873
+ msgstr ""
1874
+ "Sorry, deine Lizenz ist abgelaufen. Update <a href=\"%s\" target=\"_blank"
1875
+ "\">hier</a>"
1876
+
1877
+ #: legacy/eddsl/eddsl.php:242
1878
+ msgid "Sorry, your license has been disabled."
1879
+ msgstr "Deine Lizenz wurde leider deaktiviert."
1880
+
1881
+ #: legacy/eddsl/eddsl.php:388
1882
+ #, php-format
1883
+ msgid ""
1884
+ "Don't forget to <a href=\"%1s\">activate your license</a> for your Ditty "
1885
+ "Extensions!"
1886
+ msgstr ""
1887
+ "Vergessen Sie nicht, Ihre <a href=\"%1s\">Lizenz</a> für Ihre Ditty "
1888
+ "Extensions zu aktivieren!"
1889
+
1890
+ #: legacy/eddsl/eddsl.php:460
1891
+ msgid "This license is not active."
1892
+ msgstr "Diese Lizenz ist nicht aktiv."
1893
+
1894
+ #: legacy/eddsl/eddsl.php:465 legacy/eddsl/eddsl.php:559
1895
+ msgid "Error: Plugin slug does not exist."
1896
+ msgstr "Fehler: Diese Regel existiert nicht."
1897
+
1898
+ #: legacy/eddsl/eddsl.php:495 legacy/eddsl/eddsl.php:588
1899
+ #, php-format
1900
+ msgid "Error: %s."
1901
+ msgstr "Fehler: %s."
1902
+
1903
+ #: legacy/eddsl/eddsl.php:555
1904
+ msgid "Please add a valid license."
1905
+ msgstr "Gib bitte eine gültige Lizenz an."
1906
+
1907
+ #: legacy/inc/admin/edit-columns.php:13
1908
+ msgid "Type"
1909
+ msgstr "Typ"
1910
+
1911
+ #: legacy/inc/admin/edit-columns.php:14
1912
+ msgid "Mode"
1913
+ msgstr "Modus"
1914
+
1915
+ #: legacy/inc/admin/edit-columns.php:16 legacy/inc/admin/meta-boxes.php:27
1916
+ msgid "Direct Function"
1917
+ msgstr "Direkte Funktion"
1918
+
1919
+ #: legacy/inc/admin/edit-columns.php:147
1920
+ msgid "Show all Modes"
1921
+ msgstr "Zeige alle Modi"
1922
+
1923
+ #: legacy/inc/admin/fields/fields.php:36 legacy/inc/admin/fields/fields.php:66
1924
+ #: legacy/inc/admin/fields/fields.php:113
1925
+ #: legacy/inc/admin/fields/fields.php:157
1926
+ #: legacy/inc/admin/fields/fields.php:187
1927
+ #: legacy/inc/admin/fields/fields.php:224
1928
+ #: legacy/inc/admin/fields/fields.php:259
1929
+ #: legacy/inc/admin/fields/fields.php:298
1930
+ #: legacy/inc/admin/fields/fields.php:327
1931
+ #: legacy/inc/admin/fields/fields.php:360
1932
+ #: legacy/inc/admin/fields/fields.php:392
1933
+ #: legacy/inc/admin/fields/fields.php:431
1934
+ #: legacy/inc/admin/fields/fields.php:470
1935
+ #: legacy/inc/admin/fields/fields.php:503
1936
+ #: legacy/inc/admin/fields/fields.php:563
1937
+ #: legacy/inc/admin/fields/fields.php:636
1938
+ #: legacy/inc/admin/fields/fields.php:682
1939
+ #: legacy/inc/admin/fields/fields.php:761
1940
+ msgid "Missing required data"
1941
+ msgstr "Erforderliche Daten fehlen"
1942
+
1943
+ #: legacy/inc/admin/fields/fields.php:137
1944
+ msgid "ID"
1945
+ msgstr "ID"
1946
+
1947
+ #: legacy/inc/admin/fields/fields.php:138
1948
+ msgid "Author"
1949
+ msgstr "Autor"
1950
+
1951
+ #: legacy/inc/admin/fields/fields.php:140
1952
+ msgid "Name"
1953
+ msgstr "Vorname"
1954
+
1955
+ #: legacy/inc/admin/fields/fields.php:141
1956
+ msgid "Date"
1957
+ msgstr "Datum"
1958
+
1959
+ #: legacy/inc/admin/fields/fields.php:142
1960
+ msgid "Modified"
1961
+ msgstr "Modifiziert"
1962
+
1963
+ #: legacy/inc/admin/fields/fields.php:143
1964
+ msgid "Parent"
1965
+ msgstr "Vorläufer"
1966
+
1967
+ #: legacy/inc/admin/fields/fields.php:144
1968
+ msgid "Random"
1969
+ msgstr "Zuf&auml;llig"
1970
+
1971
+ #: legacy/inc/admin/fields/fields.php:145
1972
+ msgid "Comment Count"
1973
+ msgstr "Kommentaranzahl"
1974
+
1975
+ #: legacy/inc/admin/fields/fields.php:146
1976
+ msgid "Menu Order"
1977
+ msgstr "Menü Anordnung"
1978
+
1979
+ #: legacy/inc/admin/fields/fields.php:149
1980
+ msgid "Ascending"
1981
+ msgstr "Aufsteigend"
1982
+
1983
+ #: legacy/inc/admin/fields/fields.php:150
1984
+ msgid "Descending"
1985
+ msgstr "Absteigend"
1986
+
1987
+ #: legacy/inc/admin/fields/fields.php:417
1988
+ #: legacy/inc/admin/fields/fields.php:457
1989
+ msgid "Use default"
1990
+ msgstr "Standardwert"
1991
+
1992
+ #: legacy/inc/admin/fields/fields.php:419
1993
+ #: legacy/inc/admin/fields/helpers.php:339
1994
+ msgid "None"
1995
+ msgstr "Nichts"
1996
+
1997
+ #: legacy/inc/admin/fields/fields.php:494
1998
+ #: legacy/inc/admin/fields/fields.php:496
1999
+ msgid "Add Image"
2000
+ msgstr "Bild hinzufügen"
2001
+
2002
+ #: legacy/inc/admin/fields/fields.php:543
2003
+ msgid "Override default opacity"
2004
+ msgstr "Standard-Deckkraft überschreiben"
2005
+
2006
+ #: legacy/inc/admin/fields/fields.php:545
2007
+ msgid "Opacity"
2008
+ msgstr "Deckkraft"
2009
+
2010
+ #: legacy/inc/admin/fields/fields.php:592
2011
+ msgid "Element"
2012
+ msgstr "Element"
2013
+
2014
+ #: legacy/inc/admin/fields/fields.php:593
2015
+ msgid "Animation"
2016
+ msgstr "Animations-"
2017
+
2018
+ #: legacy/inc/admin/fields/fields.php:594
2019
+ msgid "Delay"
2020
+ msgstr "Verzögern"
2021
+
2022
+ #: legacy/inc/admin/fields/fields.php:603
2023
+ msgid "Header"
2024
+ msgstr "Kopfbereich"
2025
+
2026
+ #: legacy/inc/admin/fields/helpers.php:337
2027
+ msgid "Use Default Value"
2028
+ msgstr "Benutze den Standardwert"
2029
+
2030
+ #: legacy/inc/admin/meta-boxes.php:20
2031
+ msgid ""
2032
+ "Copy and paste this shortcode into a page or post to display the ticker "
2033
+ "within the post content."
2034
+ msgstr ""
2035
+ "Füge diesen Shortcode per „Kopieren und Einfügen“ einer Seite oder einem "
2036
+ "Beitrag hinzu, um den Ticker innerhalb des Inhaltes anzuzeigen."
2037
+
2038
+ #: legacy/inc/admin/meta-boxes.php:28
2039
+ msgid ""
2040
+ "Copy and paste this code directly into one of your theme files to display "
2041
+ "the ticker any where you want on your site."
2042
+ msgstr ""
2043
+ "Füge diesen Code per „Kopieren und Einfügen“ einer Theme-Datei hinzu, um den "
2044
+ "Ticker wo immer du möchtest auf deiner Website anzuzeigen."
2045
+
2046
+ #: legacy/inc/admin/meta-boxes.php:71
2047
+ msgid "<span>Ticker </span>Type"
2048
+ msgstr "<span>Ticker </span>Typ"
2049
+
2050
+ #: legacy/inc/admin/meta-boxes.php:73
2051
+ msgid "<span>Ticker </span>Mode"
2052
+ msgstr "<span>Ticker </span>Modus"
2053
+
2054
+ #: legacy/inc/admin/meta-boxes.php:75
2055
+ msgid "<span>Global </span>Settings"
2056
+ msgstr "<span>Globale </span>Einstellungen"
2057
+
2058
+ #: legacy/inc/admin/meta-boxes.php:104 legacy/inc/admin/meta-boxes.php:139
2059
+ msgid "More Extensions"
2060
+ msgstr "Mehr Erweiterungen"
2061
+
2062
+ #: legacy/inc/admin/meta-boxes.php:269
2063
+ msgid "Ticks"
2064
+ msgstr "Ticks"
2065
+
2066
+ #: legacy/inc/admin/meta-boxes.php:270
2067
+ msgid "Add an unlimited number of ticks to your ticker"
2068
+ msgstr "Füge deinem Ticker eine unbegrenzte Anzahl Ticks hinzu"
2069
+
2070
+ #: legacy/inc/admin/meta-boxes.php:271
2071
+ msgid ""
2072
+ "Use the '+' and 'x' buttons on the right to add and delete ticks. Drag and "
2073
+ "drop the arrows on the left to re-order your ticks."
2074
+ msgstr ""
2075
+ "Benutze die „+“ und „x“-Buttons zur Rechten, um Ticks hinzuzufügen und zu "
2076
+ "löschen. Benutze Drag & Drop mit den Pfeilen zur Linken, um deine Ticks "
2077
+ "umzuordnen."
2078
+
2079
+ #: legacy/inc/admin/meta-boxes.php:279
2080
+ msgid "Ticker text"
2081
+ msgstr "Text des Tickers"
2082
+
2083
+ #: legacy/inc/admin/meta-boxes.php:280
2084
+ msgid "Add the content of your tick. HTML and inline styles are supported."
2085
+ msgstr ""
2086
+ "Füge deinem Tick Inhalt hinzu. HTML und Inline-Styles werden unterstützt."
2087
+
2088
+ #: legacy/inc/admin/meta-boxes.php:282
2089
+ msgid "Add your content here. HTML and inline styles are supported."
2090
+ msgstr ""
2091
+ "Füge hier deinen Inhalt hinzu. HTML und Inline-Styles werden unterstützt."
2092
+
2093
+ #: legacy/inc/admin/meta-boxes.php:289
2094
+ msgid ""
2095
+ "Wrap a link around your tick content. You can also add a link directly into "
2096
+ "your content."
2097
+ msgstr ""
2098
+ "Erstelle einen Link um deinen Tick-Inhalt. Du kannst einen Link auch direkt "
2099
+ "im Inhalt angeben."
2100
+
2101
+ #: legacy/inc/admin/meta-boxes.php:291
2102
+ msgid "Add a URL (optional)"
2103
+ msgstr "Füge eine URL hinzu (optional)"
2104
+
2105
+ #: legacy/inc/admin/meta-boxes.php:317
2106
+ msgid "Line breaks"
2107
+ msgstr "Zeilenumbrüche"
2108
+
2109
+ #: legacy/inc/admin/meta-boxes.php:318
2110
+ msgid "Force line breaks on carriage returns (not used for wysiwyg editors)"
2111
+ msgstr ""
2112
+ "Erzwinge Zeilenumbruch bei Wagenrücklauf (nicht für WYSIWYG-Editoren benutzt)"
2113
+
2114
+ #: legacy/inc/admin/meta-boxes.php:319
2115
+ msgid ""
2116
+ "Enabling this setting will create new lines for all carrige returns "
2117
+ "contained in your tick text"
2118
+ msgstr ""
2119
+ "Das Aktivieren dieser Einstellung erstellt neue Zeilen für alle "
2120
+ "Wagenrückläufe, die in deinem Tick-Text erhalten sind"
2121
+
2122
+ #: legacy/inc/admin/meta-boxes.php:323
2123
+ msgid "Force line breaks"
2124
+ msgstr "Zeilenumbrüche erzwingen"
2125
+
2126
+ #: legacy/inc/admin/meta-boxes.php:377
2127
+ msgid "Tick selection"
2128
+ msgstr "Tick-Auswahl"
2129
+
2130
+ #: legacy/inc/admin/meta-boxes.php:378
2131
+ msgid ""
2132
+ "Select the ticks you would like to display by choosing the tick type and the "
2133
+ "offset position of the selected feed"
2134
+ msgstr ""
2135
+ "Wähle die Ticks, die du anzeigen möchtest, durch Wählen des Typs und der "
2136
+ "Versatz-Position des gewählten Feeds"
2137
+
2138
+ #: legacy/inc/admin/meta-boxes.php:386
2139
+ msgid "Ticker type"
2140
+ msgstr "Typ des Tickers"
2141
+
2142
+ #: legacy/inc/admin/meta-boxes.php:387
2143
+ msgid "Select the ticker type to use."
2144
+ msgstr "Wähle den zu benutzenden Ticker-Typ."
2145
+
2146
+ #: legacy/inc/admin/meta-boxes.php:394
2147
+ msgid "All ticks"
2148
+ msgstr "Alle Ticks"
2149
+
2150
+ #: legacy/inc/admin/meta-boxes.php:395
2151
+ msgid "All ticks from the specified type will be show when this is enabled."
2152
+ msgstr ""
2153
+ "Alle Ticks des spezifischen Typs werden angezeigt, wenn dies aktiviert ist."
2154
+
2155
+ #: legacy/inc/admin/meta-boxes.php:397
2156
+ msgid "Display all ticks"
2157
+ msgstr "Zeige alle Ticks"
2158
+
2159
+ #: legacy/inc/admin/meta-boxes.php:402
2160
+ msgid "Offset"
2161
+ msgstr "Versatz"
2162
+
2163
+ #: legacy/inc/admin/meta-boxes.php:403
2164
+ msgid ""
2165
+ "Choose the specific tick you would like to use from the specified type. '0' "
2166
+ "will display the first tick, '1' will display the second tick, and so on."
2167
+ msgstr ""
2168
+ "Wähle den konkreten Tick eines bestimmten Typs. '0' wird den ersten Tick "
2169
+ "anzeigen, '1' wird den zweiten Tick anzeigen, usw."
2170
+
2171
+ #: legacy/inc/admin/meta-boxes.php:474
2172
+ msgid "Scroll direction"
2173
+ msgstr "Scroll-Richtung"
2174
+
2175
+ #: legacy/inc/admin/meta-boxes.php:475
2176
+ msgid "Set the scroll direction of the ticker"
2177
+ msgstr "Scroll-Richtung des Tickers festlegen"
2178
+
2179
+ #: legacy/inc/admin/meta-boxes.php:476
2180
+ msgid ""
2181
+ "Set the direction you want the ticker to scroll. By default, the ticker "
2182
+ "starts off-screen, but you can enable the 'Show first tick on init' setting "
2183
+ "to force the content to start on-screen."
2184
+ msgstr ""
2185
+ "Wähle die Richtung, in die der Ticker scrollen soll. Als Standard startet "
2186
+ "der Ticker außerhalb des Bildschirms, aber du kannst die Einstellung „Zeige "
2187
+ "den ersten Tick beim Initialisieren“ aktivieren, um zu das Starten des "
2188
+ "Inhaltes auf dem Bildschirm zu erzwingen."
2189
+
2190
+ #: legacy/inc/admin/meta-boxes.php:492
2191
+ msgid "Show first tick on init"
2192
+ msgstr "Zeige den ersten Tick beim Initialisieren"
2193
+
2194
+ #: legacy/inc/admin/meta-boxes.php:499
2195
+ msgid "Delay scroll start (in seconds)"
2196
+ msgstr "Start-Verzögerung in Sekunden"
2197
+
2198
+ #: legacy/inc/admin/meta-boxes.php:507 legacy/inc/admin/meta-boxes.php:686
2199
+ msgid "Tick dimensions"
2200
+ msgstr "Tick-Abmessungen"
2201
+
2202
+ #: legacy/inc/admin/meta-boxes.php:508 legacy/inc/admin/meta-boxes.php:687
2203
+ msgid "Override the auto dimensions with specific values"
2204
+ msgstr "Überschreibe die automatischen Ausmaße mit bestimmten Werten"
2205
+
2206
+ #: legacy/inc/admin/meta-boxes.php:509
2207
+ msgid ""
2208
+ "Set a specific width and height for the ticks. When using a vertically "
2209
+ "scrolling ticker the height will define the overall height of the ticker."
2210
+ msgstr ""
2211
+ "Wähle eine bestimmte Breite und Höhe für die Ticks. Wenn du einen vertikal "
2212
+ "scrollenden Ticker benutzt, wird die Höhe die Gesamthöhe des Tickers "
2213
+ "definieren."
2214
+
2215
+ #: legacy/inc/admin/meta-boxes.php:513
2216
+ msgid "Width"
2217
+ msgstr "Breite"
2218
+
2219
+ #: legacy/inc/admin/meta-boxes.php:514 legacy/inc/admin/meta-boxes.php:523
2220
+ #: legacy/inc/admin/meta-boxes.php:537 legacy/inc/admin/meta-boxes.php:546
2221
+ #: legacy/inc/admin/meta-boxes.php:579 legacy/inc/admin/meta-boxes.php:693
2222
+ #: legacy/inc/admin/meta-boxes.php:705 legacy/inc/admin/meta-boxes.php:714
2223
+ #: legacy/inc/admin/meta-boxes.php:897 legacy/inc/admin/meta-boxes.php:906
2224
+ #: legacy/inc/admin/meta-boxes.php:919 legacy/inc/admin/meta-boxes.php:1128
2225
+ #: legacy/inc/admin/meta-boxes.php:1138
2226
+ msgid "pixels"
2227
+ msgstr "Pixel"
2228
+
2229
+ #: legacy/inc/admin/meta-boxes.php:522 legacy/inc/admin/meta-boxes.php:692
2230
+ msgid "Height"
2231
+ msgstr "Höhe"
2232
+
2233
+ #: legacy/inc/admin/meta-boxes.php:530
2234
+ msgid "Scroller padding"
2235
+ msgstr "Scroller-Innenabstand"
2236
+
2237
+ #: legacy/inc/admin/meta-boxes.php:531
2238
+ msgid "Set the vertical spacing of the scrolling data"
2239
+ msgstr "Wähle den vertikalen Abstand der scrollenden Daten"
2240
+
2241
+ #: legacy/inc/admin/meta-boxes.php:532 legacy/inc/admin/meta-boxes.php:700
2242
+ #: legacy/inc/admin/meta-boxes.php:892
2243
+ msgid "Add custom vertical padding and margins to each of your ticks."
2244
+ msgstr ""
2245
+ "Füge individuelle vertikale Innenabstände und Außenabstände zu jedem deiner "
2246
+ "Ticks hinzu."
2247
+
2248
+ #: legacy/inc/admin/meta-boxes.php:536 legacy/inc/admin/meta-boxes.php:704
2249
+ #: legacy/inc/admin/meta-boxes.php:896
2250
+ msgid "Vertical padding"
2251
+ msgstr "Vertikaler Innenabstand"
2252
+
2253
+ #: legacy/inc/admin/meta-boxes.php:545 legacy/inc/admin/meta-boxes.php:713
2254
+ #: legacy/inc/admin/meta-boxes.php:905
2255
+ msgid "Vertical margin"
2256
+ msgstr "Vertikaler Außenabstand"
2257
+
2258
+ #: legacy/inc/admin/meta-boxes.php:553
2259
+ msgid "Scroll speed"
2260
+ msgstr "Scroll-Geschwindigkeit"
2261
+
2262
+ #: legacy/inc/admin/meta-boxes.php:554
2263
+ msgid "Set the speed of the scrolling data"
2264
+ msgstr "Wähle die Geschwindigkeit der scrollenden Daten"
2265
+
2266
+ #: legacy/inc/admin/meta-boxes.php:555
2267
+ msgid ""
2268
+ "Set the speed of the ticker. You may need to try different speeds to get "
2269
+ "optimum results when using different fonts. Enable the checkbox to pause the "
2270
+ "ticker when a user's have their mouse over the ticker."
2271
+ msgstr ""
2272
+ "Wähle die Geschwindigkeit des Tickers. Du musst vielleicht verschiedene "
2273
+ "Geschwindigkeiten versuchen, um optimale Ergebnisse zu erhalten, wenn du "
2274
+ "verschiedene Schriften benutzt. Aktiviere das Feld, um den Ticker "
2275
+ "anzuhalten, wenn ein Benutzer die Maus über den Ticker bewegt."
2276
+
2277
+ #: legacy/inc/admin/meta-boxes.php:566 legacy/inc/admin/meta-boxes.php:743
2278
+ msgid "Pause on mouse over"
2279
+ msgstr "Beim Überfahren mit der Maus pausieren"
2280
+
2281
+ #: legacy/inc/admin/meta-boxes.php:573 legacy/inc/admin/meta-boxes.php:913
2282
+ msgid "Tick spacing"
2283
+ msgstr "Abstand der Ticks"
2284
+
2285
+ #: legacy/inc/admin/meta-boxes.php:574
2286
+ msgid "Set the spacing between scrolling data"
2287
+ msgstr "Wähle den Abstand zwischen scrollenden Daten"
2288
+
2289
+ #: legacy/inc/admin/meta-boxes.php:575
2290
+ msgid ""
2291
+ "Set the amount of space that should be rendered between the ticks within "
2292
+ "your ticker."
2293
+ msgstr ""
2294
+ "Wähle den Abstand, der zwischen deinen Ticks innerhalb deines Tickers "
2295
+ "eingefügt werden soll."
2296
+
2297
+ #: legacy/inc/admin/meta-boxes.php:659
2298
+ msgid "Rotation type"
2299
+ msgstr "Typ der Rotation"
2300
+
2301
+ #: legacy/inc/admin/meta-boxes.php:660
2302
+ msgid "Set the type of rotation for the ticker"
2303
+ msgstr "Wähle den Typ der Rotation für den Ticker"
2304
+
2305
+ #: legacy/inc/admin/meta-boxes.php:661
2306
+ msgid ""
2307
+ "Select the rotation type. Enable 'Dynamic Slide Direction' to reverse the "
2308
+ "slide direction when previous items are selected."
2309
+ msgstr ""
2310
+ "Wähle den Typ der Rotation. Aktiviere „Dynamische Richtung“, um die Richtung "
2311
+ "umzudrehen, wenn vorherige Elemente ausgewählt wurden."
2312
+
2313
+ #: legacy/inc/admin/meta-boxes.php:667
2314
+ msgid "Slide left"
2315
+ msgstr "Nach links gleiten"
2316
+
2317
+ #: legacy/inc/admin/meta-boxes.php:668
2318
+ msgid "Slide right"
2319
+ msgstr "Nach rechts gleiten"
2320
+
2321
+ #: legacy/inc/admin/meta-boxes.php:669
2322
+ msgid "Slide up"
2323
+ msgstr "Nach oben gleiten"
2324
+
2325
+ #: legacy/inc/admin/meta-boxes.php:670
2326
+ msgid "Slide down"
2327
+ msgstr "Nach unten gleiten"
2328
+
2329
+ #: legacy/inc/admin/meta-boxes.php:678
2330
+ msgid "Dynamic slide direction"
2331
+ msgstr "Dynamische Richtung"
2332
+
2333
+ #: legacy/inc/admin/meta-boxes.php:688
2334
+ msgid "Set a specific height for the ticks."
2335
+ msgstr "Wähle eine konkrete Höhe für die Ticks."
2336
+
2337
+ #: legacy/inc/admin/meta-boxes.php:698
2338
+ msgid "Rotator padding"
2339
+ msgstr "Rotator-Innenabstand"
2340
+
2341
+ #: legacy/inc/admin/meta-boxes.php:699
2342
+ msgid "Set the vertical spacing of the rotating data"
2343
+ msgstr "Wähle den vertikalen Abstand der rotierenden Daten"
2344
+
2345
+ #: legacy/inc/admin/meta-boxes.php:721
2346
+ msgid "Auto rotate"
2347
+ msgstr "Auto-rotieren"
2348
+
2349
+ #: legacy/inc/admin/meta-boxes.php:722
2350
+ msgid "Set the delay between rotations"
2351
+ msgstr "Wähle die Pause zwischen Rotationen"
2352
+
2353
+ #: legacy/inc/admin/meta-boxes.php:723
2354
+ msgid ""
2355
+ "Enable auto rotation of your ticks with and set the amount of time each tick "
2356
+ "should display. Optionally, force the rotator to pause when the user hovers "
2357
+ "over the ticker."
2358
+ msgstr ""
2359
+ "Aktiviere Auto-Rotation deiner Ticks und wähle die Anzeigedauer jedes Ticks. "
2360
+ "Optional kannst du den Rotator anhalten lassen, wenn ein Benutzer den Ticker "
2361
+ "mit der Maus berührt."
2362
+
2363
+ #: legacy/inc/admin/meta-boxes.php:727 legacy/inc/admin/meta-boxes.php:780
2364
+ #: legacy/inc/admin/meta-boxes.php:801 legacy/inc/admin/meta-boxes.php:930
2365
+ msgid "Enable"
2366
+ msgstr "Aktivieren"
2367
+
2368
+ #: legacy/inc/admin/meta-boxes.php:735
2369
+ msgid "Seconds delay"
2370
+ msgstr "Sekunden Verzögerung"
2371
+
2372
+ #: legacy/inc/admin/meta-boxes.php:750
2373
+ msgid "Rotate speed"
2374
+ msgstr "Rotationsgeschwindigkeit"
2375
+
2376
+ #: legacy/inc/admin/meta-boxes.php:751
2377
+ msgid "Set the speed & easing of the rotation"
2378
+ msgstr "Wähle die Geschwindigkeit und Abschwächung der Rotation"
2379
+
2380
+ #: legacy/inc/admin/meta-boxes.php:752
2381
+ msgid ""
2382
+ "Set the speed of the rotation based on tenths of a second. Also, choose the "
2383
+ "type of easing you want to use when the ticks rotate."
2384
+ msgstr ""
2385
+ "Wähle die Geschwindigkeit der Rotation, basierend auf Zehntelsekunden. Wähle "
2386
+ "auch den Typ der Abschwächung, den du benutzen möchtest, wenn die Ticks "
2387
+ "rotieren."
2388
+
2389
+ #: legacy/inc/admin/meta-boxes.php:756
2390
+ msgid "Tenths of a second"
2391
+ msgstr "Zehntelsekunden"
2392
+
2393
+ #: legacy/inc/admin/meta-boxes.php:774
2394
+ msgid "Directional navigation"
2395
+ msgstr "Richtungs-Navigation"
2396
+
2397
+ #: legacy/inc/admin/meta-boxes.php:775
2398
+ msgid "Set the directional navigation options"
2399
+ msgstr "Wähle die Optionen für die Richtungs-Navigation"
2400
+
2401
+ #: legacy/inc/admin/meta-boxes.php:776
2402
+ msgid ""
2403
+ "Enable the directional navigation. Optionally, set the navigation to auto-"
2404
+ "hide when the user is not hovering over the ticker."
2405
+ msgstr ""
2406
+ "Aktiviere die Richtungs-Navigation. Wähle optional das Auto-Verbergen, wenn "
2407
+ "der Benutzer nicht mit der Maus den Ticker berührt."
2408
+
2409
+ #: legacy/inc/admin/meta-boxes.php:788
2410
+ msgid "Autohide navigation"
2411
+ msgstr "Auto-Ausblenden der Navigation"
2412
+
2413
+ #: legacy/inc/admin/meta-boxes.php:795
2414
+ msgid "Control navigation"
2415
+ msgstr "Navigations-Steuerung"
2416
+
2417
+ #: legacy/inc/admin/meta-boxes.php:796
2418
+ msgid "Set the control navigation options"
2419
+ msgstr "Wähle die Optionen für die Navigations-Steuerung"
2420
+
2421
+ #: legacy/inc/admin/meta-boxes.php:797
2422
+ msgid "Enable the control navigation and choose the type of display."
2423
+ msgstr "Aktiviere die Richtungs-Navigation und wähle den Anzeige-Typ."
2424
+
2425
+ #: legacy/inc/admin/meta-boxes.php:810
2426
+ msgid "Buttons"
2427
+ msgstr "Buttons"
2428
+
2429
+ #: legacy/inc/admin/meta-boxes.php:811
2430
+ msgid "Numbers"
2431
+ msgstr "Zahlen"
2432
+
2433
+ #: legacy/inc/admin/meta-boxes.php:819
2434
+ msgid "Disable Touchswipe"
2435
+ msgstr "Deaktiviere TouchSwipe"
2436
+
2437
+ #: legacy/inc/admin/meta-boxes.php:820 legacy/inc/admin/meta-boxes.php:821
2438
+ msgid "Disable touchswipe navigation on touch devices"
2439
+ msgstr "Deaktiviere TouchSwipe-Navigation auf Touch-Geräten"
2440
+
2441
+ #: legacy/inc/admin/meta-boxes.php:825
2442
+ msgid "Disable"
2443
+ msgstr "Deaktivieren"
2444
+
2445
+ #: legacy/inc/admin/meta-boxes.php:851 legacy/inc/admin/meta-boxes.php:1380
2446
+ msgid "« Previous"
2447
+ msgstr "« Vorherige"
2448
+
2449
+ #: legacy/inc/admin/meta-boxes.php:852 legacy/inc/admin/meta-boxes.php:1381
2450
+ msgid "Next »"
2451
+ msgstr "Nächster »"
2452
+
2453
+ #: legacy/inc/admin/meta-boxes.php:890
2454
+ msgid "List padding"
2455
+ msgstr "Innenabstand Liste"
2456
+
2457
+ #: legacy/inc/admin/meta-boxes.php:891
2458
+ msgid "Set the vertical spacing of the list container"
2459
+ msgstr "Wähle den vertikalen Abstand des Listen-Containers"
2460
+
2461
+ #: legacy/inc/admin/meta-boxes.php:914
2462
+ msgid "Set the spacing between ticks"
2463
+ msgstr "Wähle den Abstand zwischen Ticks"
2464
+
2465
+ #: legacy/inc/admin/meta-boxes.php:915
2466
+ msgid "Set the amount of space that should be added between the ticks."
2467
+ msgstr "Lege die Größe des Abstandes zwischen den Ticks fest."
2468
+
2469
+ #: legacy/inc/admin/meta-boxes.php:924
2470
+ msgid "List paging"
2471
+ msgstr "Liste als Seiten"
2472
+
2473
+ #: legacy/inc/admin/meta-boxes.php:925
2474
+ msgid "Break the list up into pages"
2475
+ msgstr "Teile die Liste in Seiten"
2476
+
2477
+ #: legacy/inc/admin/meta-boxes.php:926
2478
+ msgid ""
2479
+ "Break your list up into pages with navigation. Set the number of ticks to "
2480
+ "show per page and customize the previous and next links."
2481
+ msgstr ""
2482
+ "Teilt deine Liste in Seiten mit Navigation auf. Wähle die Anzahl der Ticks, "
2483
+ "die pro Seite angezeigt werden und individualisiere die Vorher- und Nachher-"
2484
+ "Links."
2485
+
2486
+ #: legacy/inc/admin/meta-boxes.php:938
2487
+ msgid "Ticks per page"
2488
+ msgstr "Ticks pro Seite"
2489
+
2490
+ #: legacy/inc/admin/meta-boxes.php:946
2491
+ msgid "Enable previous & next links"
2492
+ msgstr "Aktiviere Links für Vorherige und Nächste"
2493
+
2494
+ #: legacy/inc/admin/meta-boxes.php:954
2495
+ msgid "Previous text"
2496
+ msgstr "Vorheriger Text"
2497
+
2498
+ #: legacy/inc/admin/meta-boxes.php:962
2499
+ msgid "Next text"
2500
+ msgstr "Nächster Text"
2501
+
2502
+ #: legacy/inc/admin/meta-boxes.php:1052
2503
+ msgid "Ticker title"
2504
+ msgstr "Titel des Tickers"
2505
+
2506
+ #: legacy/inc/admin/meta-boxes.php:1053
2507
+ msgid "Set the display of the title"
2508
+ msgstr "Wähle die Anzeige des Titels"
2509
+
2510
+ #: legacy/inc/admin/meta-boxes.php:1054
2511
+ msgid "Enable the display and set the position of the ticker title."
2512
+ msgstr "Aktiviere die Anzeige und wähle die Position des Ticker-Titels."
2513
+
2514
+ #: legacy/inc/admin/meta-boxes.php:1058
2515
+ msgid "Display title"
2516
+ msgstr "Titel anzeigen"
2517
+
2518
+ #: legacy/inc/admin/meta-boxes.php:1066
2519
+ msgid "Inline title"
2520
+ msgstr "Eingereihter Titel"
2521
+
2522
+ #: legacy/inc/admin/meta-boxes.php:1073
2523
+ msgid "Ticker options"
2524
+ msgstr "Ticker-Optionen"
2525
+
2526
+ #: legacy/inc/admin/meta-boxes.php:1074
2527
+ msgid "General ticker options"
2528
+ msgstr "Allgemeine Ticker-Optionen"
2529
+
2530
+ #: legacy/inc/admin/meta-boxes.php:1083
2531
+ msgid "Hide ticker if no ticks exist"
2532
+ msgstr "Ticker ausblenden, wenn keine Ticks vorhanden sind"
2533
+
2534
+ #: legacy/inc/admin/meta-boxes.php:1091
2535
+ msgid "Randomly shuffle the ticks"
2536
+ msgstr "Ticks zufällig abwechseln"
2537
+
2538
+ #: legacy/inc/admin/meta-boxes.php:1099
2539
+ msgid "Reverse the order of the ticks"
2540
+ msgstr "Sortierung umkehren"
2541
+
2542
+ #: legacy/inc/admin/meta-boxes.php:1107
2543
+ msgid "Remove margin and padding from all tick contents"
2544
+ msgstr "Entferne Außen- und Innenabstände von allen Tick-Inhalten"
2545
+
2546
+ #: legacy/inc/admin/meta-boxes.php:1115
2547
+ msgid "Add a play/pause button to scrolling and auto-rotating tickers"
2548
+ msgstr ""
2549
+ "Füge scrollenden und auto-rotierenden Tickern einen Abspielen/Pause-Button "
2550
+ "hinzu"
2551
+
2552
+ #: legacy/inc/admin/meta-boxes.php:1122
2553
+ msgid "Ticker width"
2554
+ msgstr "Breite des Tickers"
2555
+
2556
+ #: legacy/inc/admin/meta-boxes.php:1123
2557
+ msgid "Set a static width for the ticker"
2558
+ msgstr "Wähle eine feste Breite für den Ticker"
2559
+
2560
+ #: legacy/inc/admin/meta-boxes.php:1124
2561
+ msgid ""
2562
+ "Leave blank or set to '0' if you want the ticker width to be responsive."
2563
+ msgstr ""
2564
+ "Leer lassen oder wähle '0', falls du die Ticker-Breite bedarfsabhängig haben "
2565
+ "möchtest."
2566
+
2567
+ #: legacy/inc/admin/meta-boxes.php:1133
2568
+ msgid "Offset ticks"
2569
+ msgstr "Versatz für Ticks"
2570
+
2571
+ #: legacy/inc/admin/meta-boxes.php:1134
2572
+ msgid "Set the amount of pixels ticks should start and end off the screen"
2573
+ msgstr ""
2574
+ "Wähle die Anzahl Pixel, bei denen die Ticks außerhalb des Bildschirms "
2575
+ "beginnen und enden sollen"
2576
+
2577
+ #: legacy/inc/admin/meta-boxes.php:1143
2578
+ msgid "Grid Display"
2579
+ msgstr "Raster-Anzeige"
2580
+
2581
+ #: legacy/inc/admin/meta-boxes.php:1144
2582
+ msgid "Enable a grid display of your tickers and adjust the grid settings"
2583
+ msgstr ""
2584
+ "Aktiviere die Raster-Anzeige deiner Ticker und passe die Raster-"
2585
+ "Einstellungen an"
2586
+
2587
+ #: legacy/inc/admin/meta-boxes.php:1145
2588
+ msgid ""
2589
+ "You should only use this option if you need to display multiple ticks at the "
2590
+ "same time. You should not use this functionality if you are using a normal "
2591
+ "scrolling ticker."
2592
+ msgstr ""
2593
+ "Du solltest diese Option nur wählen, falls du mehrere Ticks zur gleichen "
2594
+ "Zeit anzeigen möchtest. Du solltest diese Funktion nicht wählen, falls du "
2595
+ "einen normalen, scrollenden Ticker benutzt."
2596
+
2597
+ #: legacy/inc/admin/meta-boxes.php:1149
2598
+ msgid "Display ticks in a grid"
2599
+ msgstr "Ticks in einem Raster anzeigen"
2600
+
2601
+ #: legacy/inc/admin/meta-boxes.php:1157
2602
+ msgid "Render empty rows"
2603
+ msgstr "Leere Zeilen darstellen"
2604
+
2605
+ #: legacy/inc/admin/meta-boxes.php:1165
2606
+ msgid "Force equal column width"
2607
+ msgstr "Einheitliche Spaltenbreite erzwingen"
2608
+
2609
+ #: legacy/inc/admin/meta-boxes.php:1173
2610
+ msgid "Columns"
2611
+ msgstr "Spalten"
2612
+
2613
+ #: legacy/inc/admin/meta-boxes.php:1181
2614
+ msgid "Rows"
2615
+ msgstr "Zeilen"
2616
+
2617
+ #: legacy/inc/admin/meta-boxes.php:1189
2618
+ msgid "Cell padding"
2619
+ msgstr "Innenabstand Zelle"
2620
+
2621
+ #: legacy/inc/admin/meta-boxes.php:1197
2622
+ msgid "Remove padding on table edges"
2623
+ msgstr "Entferne Innenabstände bei Tabellenrändern"
2624
+
2625
+ #: legacy/inc/composer.php:19
2626
+ msgid "Select the ticker you want to display"
2627
+ msgstr "Wähle den Ticker, den du anzeigen möchtest"
2628
+
2629
+ #: legacy/inc/composer.php:25
2630
+ msgid "Custom Class"
2631
+ msgstr "Eigene CSS-Klasse"
2632
+
2633
+ #: legacy/inc/composer.php:27
2634
+ msgid "Add a custom class name to the ticker"
2635
+ msgstr "Gib dem Ticker einen individuellen Klassennamen"
2636
+
2637
+ #: legacy/inc/filters.php:224
2638
+ msgid "<i class=\"mtphr-dnt-icon-gear\"></i> Edit ticker"
2639
+ msgstr "<i class=\"mtphr-dnt-icon-gear\"></i> Ticker bearbeiten"
2640
+
2641
+ #: legacy/inc/help.php:59
2642
+ msgid "Scroll Mode"
2643
+ msgstr "Scroll-Modus"
2644
+
2645
+ #: legacy/inc/help.php:66
2646
+ msgid "Rotate Mode"
2647
+ msgstr "Rotations-Modus"
2648
+
2649
+ #: legacy/inc/help.php:73
2650
+ msgid "List Mode"
2651
+ msgstr "Listen-Modus"
2652
+
2653
+ #: legacy/inc/help.php:110
2654
+ msgid "For more information:"
2655
+ msgstr "Für weiterführende Informationen:"
2656
+
2657
+ #: legacy/inc/help.php:111
2658
+ msgid ""
2659
+ "Visit the <a href=\"http://www.metaphorcreations.com\" target=\"_blank"
2660
+ "\">documentation</a> on the Ditty News Ticker website"
2661
+ msgstr ""
2662
+ "Lies die <a href=\"http://www.metaphorcreations.com\" target=\"_blank"
2663
+ "\">Dokumentation</a> auf der Ditty News Ticker Website"
2664
+
2665
+ #: legacy/inc/help.php:112
2666
+ msgid "View DNT extensions"
2667
+ msgstr "DNT-Erweiterungen ansehen"
2668
+
2669
+ #: legacy/inc/help.php:126
2670
+ msgid "Add general information about Ditty News Ticker."
2671
+ msgstr "Füge allgemeine Informationen über Ditty News Ticker hinzu."
2672
+
2673
+ #: legacy/inc/help.php:135
2674
+ msgid "Add scroll mode info."
2675
+ msgstr "Füge Scroll-Modus-Information hinzu."
2676
+
2677
+ #: legacy/inc/help.php:144
2678
+ msgid "Add rotate mode info."
2679
+ msgstr "Füge Rotations-Modus-Information hinzu."
2680
+
2681
+ #: legacy/inc/help.php:153
2682
+ msgid "Add list mode info."
2683
+ msgstr "Füge Listen-Modus-Information hinzu."
2684
+
2685
+ #: legacy/inc/helpers.php:17
2686
+ msgid "Mixed"
2687
+ msgstr "Diverse"
2688
+
2689
+ #: legacy/inc/helpers.php:57
2690
+ msgid "Manually add HTML to the tick."
2691
+ msgstr "Manuelles Hinzufügen von HTML zum Tick."
2692
+
2693
+ #: legacy/inc/helpers.php:62
2694
+ msgid "Twitter Feed"
2695
+ msgstr "Twitter-Feed"
2696
+
2697
+ #: legacy/inc/helpers.php:64
2698
+ msgid "Display a Twitter feed using a set of parameters."
2699
+ msgstr ""
2700
+ "Anzeige eines Twitter-Feeds unter Verwendung einer Reihe von Parametern."
2701
+
2702
+ #: legacy/inc/helpers.php:70
2703
+ msgid "Single Tweet"
2704
+ msgstr "Einzelner Tweet"
2705
+
2706
+ #: legacy/inc/helpers.php:72
2707
+ msgid "Display a single Tweet by entering a URL or ID."
2708
+ msgstr ""
2709
+ "Zeigen Sie einen einzelnen Tweet an, indem Sie eine URL oder ID eingeben."
2710
+
2711
+ #: legacy/inc/helpers.php:131
2712
+ msgid "Scroll"
2713
+ msgstr "Scrollen"
2714
+
2715
+ #: legacy/inc/helpers.php:136
2716
+ msgid "Rotate"
2717
+ msgstr "Rotieren"
2718
+
2719
+ #: legacy/inc/helpers.php:359
2720
+ msgid "No tickers found"
2721
+ msgstr "Keine Ticker gefunden"
2722
+
2723
+ #: legacy/inc/helpers.php:392
2724
+ msgid "Sorry, this license is not valid."
2725
+ msgstr "Diese Lizenz ist leider nicht gültig."
2726
+
2727
+ #: legacy/inc/helpers.php:393
2728
+ msgid "Your license has been deactivated."
2729
+ msgstr "Deine Lizenz wurde deaktiviert."
2730
+
2731
+ #: legacy/inc/helpers.php:394
2732
+ msgid "Sorry, something went wrong with the deactivation."
2733
+ msgstr "Bei der Deaktivierung ist leider ein Fehler aufgetreten."
2734
+
2735
+ #: legacy/inc/helpers.php:395
2736
+ msgid "Deactivate License"
2737
+ msgstr "Lizenz deaktivieren"
2738
+
2739
+ #: legacy/inc/helpers.php:414
2740
+ #, php-format
2741
+ msgid "% string does not exist"
2742
+ msgstr "% string existiert nicht"
2743
+
2744
+ #: legacy/inc/post-types.php:14 legacy/inc/post-types.php:25
2745
+ msgid "News Tickers"
2746
+ msgstr "News-Ticker"
2747
+
2748
+ #: legacy/inc/post-types.php:15
2749
+ msgid "News Ticker"
2750
+ msgstr "News-Ticker"
2751
+
2752
+ #: legacy/inc/post-types.php:17
2753
+ msgid "Add New News Ticker"
2754
+ msgstr "Neuen News-Ticker hinzufügen"
2755
+
2756
+ #: legacy/inc/post-types.php:18
2757
+ msgid "Edit News Ticker"
2758
+ msgstr "News-Ticker bearbeiten"
2759
+
2760
+ #: legacy/inc/post-types.php:19
2761
+ msgid "New News Ticker"
2762
+ msgstr "Neuer News-Ticker"
2763
+
2764
+ #: legacy/inc/post-types.php:20
2765
+ msgid "View News Ticker"
2766
+ msgstr "News-Ticker ansehen"
2767
+
2768
+ #: legacy/inc/post-types.php:21
2769
+ msgid "Search News Tickers"
2770
+ msgstr "Suche News-Ticker"
2771
+
2772
+ #: legacy/inc/post-types.php:22
2773
+ msgid "No News Tickers Found"
2774
+ msgstr "Keine News-Ticker gefunden"
2775
+
2776
+ #: legacy/inc/post-types.php:23
2777
+ msgid "No News Tickers Found In Trash"
2778
+ msgstr "Keine News-Ticker im Papierkorb gefunden"
2779
+
2780
+ #: legacy/inc/post-types.php:25 legacy/inc/settings.php:11
2781
+ #: legacy/inc/settings.php:12
2782
+ msgid "(Legacy)"
2783
+ msgstr "(ehemalig Version)"
2784
+
2785
+ #: legacy/inc/post-types.php:61
2786
+ msgid "Ditty News Ticker Updated!"
2787
+ msgstr "Ditty News Ticker aktualisiert!"
2788
+
2789
+ #: legacy/inc/settings.php:28
2790
+ msgid "The global settings to your news tickers."
2791
+ msgstr "Die globalen Einstellungen deiner News-Ticker."
2792
+
2793
+ #: legacy/inc/settings.php:44
2794
+ msgid "Ditty News Ticker Settings"
2795
+ msgstr "Ditty News Ticker Einstellungen"
2796
+
2797
+ #: legacy/inc/settings.php:116
2798
+ msgid "Ditty News Ticker settings"
2799
+ msgstr "Ditty News Ticker Einstellungen"
2800
+
2801
+ #: legacy/inc/settings.php:120
2802
+ msgid "Visual Editor"
2803
+ msgstr "Visueller Editor"
2804
+
2805
+ #: legacy/inc/settings.php:120
2806
+ msgid "Use the visual editor to create tick contents"
2807
+ msgstr "Benutze den visuellen Editor, um Tick-Inhalte zu erstellen"
2808
+
2809
+ #: legacy/inc/settings.php:124
2810
+ msgid "Quick Edit Links"
2811
+ msgstr "Quick-Edit-Links"
2812
+
2813
+ #: legacy/inc/settings.php:124
2814
+ msgid ""
2815
+ "Add quick edit links on the front-end of the site for editors and admins"
2816
+ msgstr ""
2817
+ "Füge Quick-Edit-Links zum Frontend der Website für Redakteure und "
2818
+ "Administratoren hinzu"
2819
+
2820
+ #: legacy/inc/settings.php:128
2821
+ msgid "Private Ticker Posts"
2822
+ msgstr "Ob Beiträge mit diesem Status privat sein sollen"
2823
+
2824
+ #: legacy/inc/settings.php:128
2825
+ msgid "Make all ticker posts private"
2826
+ msgstr "Alle Tickerbeiträge privat machen"
2827
+
2828
+ #: legacy/inc/settings.php:132
2829
+ msgid "Custom CSS"
2830
+ msgstr "Benutzerdefiniertes CSS"
2831
+
2832
+ #: legacy/inc/settings.php:132
2833
+ msgid ""
2834
+ "Add custom css to style your ticker without modifying any external files"
2835
+ msgstr ""
2836
+ "Füge individuellen CSS-Code hinzu, um deinen Ticker-Stil zu gestalten, ohne "
2837
+ "externe Dateien zu verändern"
2838
+
2839
+ #: legacy/inc/settings.php:158
2840
+ msgid "Use the visual editor for ticks"
2841
+ msgstr "Den visuellen Editor für Ticks benutzen"
2842
+
2843
+ #: legacy/inc/settings.php:172
2844
+ msgid "Add quick edit links"
2845
+ msgstr "Füge Quick-Edit-Links hinzu"
2846
+
2847
+ #: legacy/inc/settings.php:186
2848
+ msgid "Private ticker posts"
2849
+ msgstr "Ob Beiträge mit diesem Status privat sein sollen"
2850
+
2851
+ #: legacy/inc/static.php:35
2852
+ msgid "Use Image"
2853
+ msgstr "Bild verwenden"
2854
+
2855
+ #: legacy/inc/templates/directional_nav.php:16
2856
+ msgid "Previous"
2857
+ msgstr "Zurück"
2858
+
2859
+ #: legacy/inc/templates/directional_nav.php:17
2860
+ msgid "Next"
2861
+ msgstr "Weiter"
2862
+
2863
+ #: legacy/inc/widget.php:17
2864
+ msgid "Displays a Ditty News Ticker."
2865
+ msgstr "Zeigt einen Ditty News Ticker."
2866
+
2867
+ #: legacy/inc/widget.php:127
2868
+ msgid "Title:"
2869
+ msgstr "Titel:"
2870
+
2871
+ #: legacy/inc/widget.php:133
2872
+ msgid "Select a Ticker:"
2873
+ msgstr "Wähle einen Ticker:"
2874
+
2875
+ #: legacy/inc/widget.php:151
2876
+ msgid "Display Ticker Title?"
2877
+ msgstr "Titel des Tickers anzeigen?"
2878
+
2879
+ #: legacy/inc/widget.php:157
2880
+ msgid "Hide widget if no ticks exist?"
2881
+ msgstr "Widget ausblenden, wenn keine Ticks vorhanden sind?"
2882
+
2883
+ #. Plugin Name of the plugin/theme
2884
+ msgid "Ditty (formerly Ditty News Ticker)"
2885
+ msgstr "Ditty (ehemals Ditty News Ticker)"
2886
+
2887
+ #. Plugin URI of the plugin/theme
2888
+ msgid "https://www.metaphorcreations.com/ditty"
2889
+ msgstr "https://www.metaphorcreations.com/ditty"
2890
+
2891
+ #. Description of the plugin/theme
2892
+ msgid ""
2893
+ "Formally Ditty News Ticker. Ditty is a multi-functional data display plugin."
2894
+ msgstr "Ditty News Ticker ist ein multifunktionelles Daten-Ticker-Plugin."
2895
+
2896
+ #. Author of the plugin/theme
2897
+ msgid "Metaphor Creations"
2898
+ msgstr "Metaphor Creations"
2899
+
2900
+ #. Author URI of the plugin/theme
2901
+ msgid "https://www.metaphorcreations.com"
2902
+ msgstr "https://www.metaphorcreations.com"
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.12
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
@@ -66,6 +66,22 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  = 3.0.12 =
70
  * Modified custom display check when rendering Ditty
71
  * Resolved current Item(s) bug in Ditty Editor
@@ -82,6 +98,7 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
82
  * Removed auto-draft checks
83
  * Customized plugin updater file and references
84
  * Resolved bug in extension updater
 
85
 
86
  = 3.0.11 =
87
  * Resolved bug in ditty_add_scripts function that was causing a javascript error
@@ -655,4 +672,4 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
655
 
656
  == Upgrade Notice ==
657
 
658
- Resolved bug in extension updater. 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.13
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
66
 
67
  == Changelog ==
68
 
69
+ = 3.0.13 =
70
+ * Added Ditty Wizard (Beta)
71
+ * Ditty settings page updates
72
+ * Added Heading field type
73
+ * Default layout updates
74
+ * Updated German translation
75
+ * Added uniq_id meta to Ditty, Layouts & Displays
76
+ * Added init meta to Ditty
77
+ * Resolved editor layout bugs
78
+ * Added Item Created and Modified date meta
79
+ * Added Item Author meta and Layout tags
80
+ * Modified field help functionality
81
+ * Added option to not clone ticker items
82
+ * Ticker display now hides if there are no items
83
+ * Added Ticker title settings
84
+
85
  = 3.0.12 =
86
  * Modified custom display check when rendering Ditty
87
  * Resolved current Item(s) bug in Ditty Editor
98
  * Removed auto-draft checks
99
  * Customized plugin updater file and references
100
  * Resolved bug in extension updater
101
+ * Ticker editor min height updates
102
 
103
  = 3.0.11 =
104
  * Resolved bug in ditty_add_scripts function that was causing a javascript error
672
 
673
  == Upgrade Notice ==
674
 
675
+ Added ticker title and multiple other updates