Ditty News Ticker - Version 3.0.7

Version Description

  • .ditty-item css updates
  • Added wp_enqueue_script check to ensure wp_add_inline_script is only added once
  • Removed ajax Ditty notification close
  • Added php Ditty notification close
  • Added Wrap Elements option to Ticker display
Download this release

Release Info

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

Code changes from version 3.0.6 to 3.0.7

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.6
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.6' );
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.7
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.7' );
24
  }
25
 
26
  // Plugin Folder Path.
includes/admin/notices.php CHANGED
@@ -7,21 +7,32 @@
7
  */
8
  function ditty_dashboard_notices() {
9
  $ditty_notices = get_option( 'ditty_notices', array() );
 
 
 
 
 
 
 
 
10
  if ( isset( $ditty_notices['v3_0_6'] ) ) {
11
  ?>
12
- <div class="notice notice-info is-dismissible ditty-dashboard-notice" data-notice_id="v3_0_6">
13
- <p><?php printf( __( 'Ditty v%s', 'ditty-news-ticker' ), ditty_version() ); ?></p>
14
- <p><?php _e( '<strong>Ditty News Ticker</strong> has now become <strong>Ditty</strong>!', 'ditty-news-ticker' ); ?></p>
15
- <p><?php _e( "This major upgrade includes a complete rebuild of the Ditty News Ticker package. Due to the size of the ugrade we opted to create a new <strong>Ditty</strong> post type that you can start using right away. Ditty offers you more control over the display and look of your content, along with many highly requested features.", 'ditty-news-ticker' ); ?></p>
16
- <ul class="ditty-features-list">
17
- <li><i class="fas fa-redo-alt"></i> <?php _e( 'Live Updates', 'ditty-news-ticker' ); ?></li>
18
- <li><i class="fas fa-edit"></i> <?php _e( 'Live Editing', 'ditty-news-ticker' ); ?></li>
19
- <li><i class="fas fa-plus-square"></i> <?php _e( 'Global Rendering', 'ditty-news-ticker' ); ?></li>
20
- <li><i class="fas fa-random"></i> <?php _e( 'Mix & Match Content', 'ditty-news-ticker' ); ?></li>
21
- <li><i class="fas fa-tablet-alt"></i> <?php _e( 'Customized Displays', 'ditty-news-ticker' ); ?></li>
22
- <li><i class="fas fa-pencil-ruler"></i> <?php _e( 'Customized Layouts', 'ditty-news-ticker' ); ?></li>
23
- </ul>
24
- <p><?php _e( "Don't worry, all of your existing <strong>News Tickers</strong> will still work! Although, we do urge you to start upgrading and updating your tickers to the new <strong>Ditty</strong> post type. <strong>Ditty News Ticker</strong> is now relegated to legacy code and there will be very limited updates from this point on. Most development time will now be assigned to <strong>Ditty</strong> along with existing and new <strong>Ditty</strong> extensions. Legacy <strong>News Tickers</strong> can be enabled on the <strong>Advanced</strong> tab of the <strong>Ditty > Settings</strong> page.", 'ditty-news-ticker' ); ?></p>
 
 
 
25
  </div>
26
  <?php
27
  }
7
  */
8
  function ditty_dashboard_notices() {
9
  $ditty_notices = get_option( 'ditty_notices', array() );
10
+
11
+ // Remove notice
12
+ $close_notice = isset( $_GET['ditty_close_notice'] ) ? $_GET['ditty_close_notice'] : false;
13
+ if ( $close_notice && isset( $ditty_notices[$close_notice] ) ) {
14
+ unset( $ditty_notices[$close_notice] );
15
+ update_option( 'ditty_notices', $ditty_notices );
16
+ }
17
+
18
  if ( isset( $ditty_notices['v3_0_6'] ) ) {
19
  ?>
20
+ <div class="notice notice-info ditty-dashboard-notice" data-notice_id="v3_0_6">
21
+ <div class="ditty-dashboard-notice__content">
22
+ <p><?php printf( __( 'Ditty v%s', 'ditty-news-ticker' ), ditty_version() ); ?></p>
23
+ <p><?php _e( '<strong>Ditty News Ticker</strong> has now become <strong>Ditty</strong>!', 'ditty-news-ticker' ); ?></p>
24
+ <p><?php _e( "This major upgrade includes a complete rebuild of the Ditty News Ticker package. Due to the size of the ugrade we opted to create a new <strong>Ditty</strong> post type that you can start using right away. Ditty offers you more control over the display and look of your content, along with many highly requested features.", 'ditty-news-ticker' ); ?></p>
25
+ <ul class="ditty-features-list">
26
+ <li><i class="fas fa-redo-alt"></i> <?php _e( 'Live Updates', 'ditty-news-ticker' ); ?></li>
27
+ <li><i class="fas fa-edit"></i> <?php _e( 'Live Editing', 'ditty-news-ticker' ); ?></li>
28
+ <li><i class="fas fa-plus-square"></i> <?php _e( 'Global Rendering', 'ditty-news-ticker' ); ?></li>
29
+ <li><i class="fas fa-random"></i> <?php _e( 'Mix & Match Content', 'ditty-news-ticker' ); ?></li>
30
+ <li><i class="fas fa-tablet-alt"></i> <?php _e( 'Customized Displays', 'ditty-news-ticker' ); ?></li>
31
+ <li><i class="fas fa-pencil-ruler"></i> <?php _e( 'Customized Layouts', 'ditty-news-ticker' ); ?></li>
32
+ </ul>
33
+ <p><?php _e( "Don't worry, all of your existing <strong>News Tickers</strong> will still work! Although, we do urge you to start upgrading and updating your tickers to the new <strong>Ditty</strong> post type. <strong>Ditty News Ticker</strong> is now relegated to legacy code and there will be very limited updates from this point on. Most development time will now be assigned to <strong>Ditty</strong> along with existing and new <strong>Ditty</strong> extensions. Legacy <strong>News Tickers</strong> can be enabled on the <strong>Advanced</strong> tab of the <strong>Ditty > Settings</strong> page.", 'ditty-news-ticker' ); ?></p>
34
+ </div>
35
+ <a href="<?php echo add_query_arg( 'ditty_close_notice', 'v3_0_6' ); ?>" class="ditty-dashboard-notice__close"><?php _e( 'Close', 'ditty-news-ticker' ); ?><i class="dashicons dashicons-dismiss"></i></a>
36
  </div>
37
  <?php
38
  }
includes/class-ditty-display-type-ticker.php CHANGED
@@ -163,6 +163,18 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
163
  'help' => __( 'Set a maximum width for items', 'ditty-news-ticker' ),
164
  'std' => isset( $values['itemMaxWidth'] ) ? $values['itemMaxWidth'] : false,
165
  ),
 
 
 
 
 
 
 
 
 
 
 
 
166
  ) ),
167
  // 'importExportSettings' => array(
168
  // 'type' => 'group',
@@ -191,7 +203,7 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
191
  */
192
  public function default_settings() {
193
 
194
- $defaults = json_decode( '{"direction":"left","spacing":"25","speed":"10","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"}', true );
195
 
196
  return apply_filters( 'ditty_display_default_settings', $defaults, $this->type );
197
  }
@@ -209,7 +221,7 @@ class Ditty_Display_Type_Ticker extends Ditty_Display_Type {
209
  'label' => __( 'Default Ticker', 'ditty-news-ticker' ),
210
  'description' => __( 'Default ticker display', 'ditty-news-ticker' ),
211
  'settings' => $defaults,
212
- 'version' => '1.0',
213
  );
214
  return apply_filters( 'ditty_display_type_templates', $templates, $this->type );
215
  }
163
  'help' => __( 'Set a maximum width for items', 'ditty-news-ticker' ),
164
  'std' => isset( $values['itemMaxWidth'] ) ? $values['itemMaxWidth'] : false,
165
  ),
166
+ 'itemElementsWrap' => array(
167
+ 'type' => 'radio',
168
+ 'id' => 'itemElementsWrap',
169
+ 'name' => __( 'Wrap Elements', 'ditty-news-ticker' ),
170
+ 'help' => __( 'Allow item elements to wrap, or force them to not wrap.', 'ditty-news-ticker' ),
171
+ 'inline' => true,
172
+ 'options' => array(
173
+ 'wrap' => __( 'Wrap', 'ditty-news-ticker' ),
174
+ 'nowrap' => __( 'No Wrap', 'ditty-news-ticker' ),
175
+ ),
176
+ 'std' => isset( $values['itemElementsWrap'] ) ? $values['itemElementsWrap'] : false,
177
+ ),
178
  ) ),
179
  // 'importExportSettings' => array(
180
  // 'type' => 'group',
203
  */
204
  public function default_settings() {
205
 
206
+ $defaults = json_decode( '{"direction":"left","spacing":"25","speed":"10","minHeight":"","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 );
207
 
208
  return apply_filters( 'ditty_display_default_settings', $defaults, $this->type );
209
  }
221
  'label' => __( 'Default Ticker', 'ditty-news-ticker' ),
222
  'description' => __( 'Default ticker display', 'ditty-news-ticker' ),
223
  'settings' => $defaults,
224
+ 'version' => '1.1',
225
  );
226
  return apply_filters( 'ditty_display_type_templates', $templates, $this->type );
227
  }
includes/class-ditty.php CHANGED
@@ -442,7 +442,7 @@ class Ditty {
442
  /**
443
  * Register the JavaScript for the public-facing side of the site.
444
  *
445
- * @since 3.0
446
  */
447
  public function enqueue_scripts( $hook ) {
448
  $min = WP_DEBUG ? '' : '.min';
@@ -495,22 +495,18 @@ class Ditty {
495
  'jquery-ui-sortable',
496
  'wp-i18n',
497
  ), $this->version, true );
498
- wp_add_inline_script( 'ditty-admin', 'const dittyAdminVars = ' . json_encode( array(
499
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
500
- 'security' => wp_create_nonce( 'ditty' ),
501
- 'mode' => WP_DEBUG ? 'development' : 'production',
502
- 'adminStrings' => is_admin() ? ditty_admin_strings() : false,
503
- 'updateIcon' => 'fas fa-sync-alt fa-spin',
504
- ) ), 'before' );
505
-
506
- // wp_localize_script( 'ditty-admin', 'dittyAdminVars', array(
507
- // 'ajaxurl' => admin_url( 'admin-ajax.php' ),
508
- // 'security' => wp_create_nonce( 'ditty' ),
509
- // 'adminStrings' => is_admin() ? ditty_admin_strings() : false,
510
- // 'update_icon' => 'fas fa-sync-alt fa-spin',
511
- // )
512
- // );
513
 
 
 
 
 
 
 
 
 
 
 
 
514
 
515
  if ( is_admin() ) {
516
 
442
  /**
443
  * Register the JavaScript for the public-facing side of the site.
444
  *
445
+ * @since 3.0.7
446
  */
447
  public function enqueue_scripts( $hook ) {
448
  $min = WP_DEBUG ? '' : '.min';
495
  'jquery-ui-sortable',
496
  'wp-i18n',
497
  ), $this->version, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
498
 
499
+ global $ditty_scripts_enqueued;
500
+ if ( empty( $ditty_scripts_enqueued ) ) {
501
+ wp_add_inline_script( 'ditty-admin', 'const dittyAdminVars = ' . json_encode( array(
502
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
503
+ 'security' => wp_create_nonce( 'ditty' ),
504
+ 'mode' => WP_DEBUG ? 'development' : 'production',
505
+ 'adminStrings' => is_admin() ? ditty_admin_strings() : false,
506
+ 'updateIcon' => 'fas fa-sync-alt fa-spin',
507
+ ) ), 'before' );
508
+ }
509
+ $ditty_scripts_enqueued = 'enqueued';
510
 
511
  if ( is_admin() ) {
512
 
includes/css/ditty-admin.css CHANGED
@@ -1,19 +1,25 @@
1
- .wp-admin.post-php.post-type-ditty #poststuff {
 
2
  min-width: inherit; }
3
 
4
- .wp-admin.post-php.post-type-ditty #post-body-content {
 
5
  min-width: inherit; }
6
 
7
- .wp-admin.post-php.post-type-ditty #post-body.columns-2 #postbox-container-1 {
 
8
  margin-right: -400px;
9
  width: 380px; }
10
 
11
- .wp-admin.post-php.post-type-ditty #poststuff #post-body.columns-2 {
 
12
  margin-right: 400px; }
13
- .wp-admin.post-php.post-type-ditty #poststuff #post-body.columns-2 #side-sortables {
 
14
  width: 380px; }
15
 
16
- .wp-admin.post-php.post-type-ditty #titlediv {
 
17
  display: none; }
18
 
19
  @media only screen and (max-width: 850px) {
@@ -56,27 +62,39 @@ table.wp-list-table .type-ditty_display .row-actions {
56
  padding-bottom: 8px;
57
  margin-bottom: -8px; }
58
 
59
- .ditty-dashboard-notice.notice-info {
60
- border-left-color: #19BF7C; }
61
-
62
- .ditty-dashboard-notice .ditty-features-list {
63
- display: flex;
64
- flex-direction: row;
65
- align-items: center;
66
- justify-content: flex-start;
67
- flex-wrap: wrap; }
68
- .ditty-dashboard-notice .ditty-features-list li {
 
 
 
 
 
 
69
  display: flex;
70
  flex-direction: row;
71
  align-items: center;
72
  justify-content: flex-start;
73
- color: #FFF;
74
- background: #19BF7C;
75
- border-radius: 3px;
76
- padding: 5px 10px;
77
- margin: 0 5px 5px 0; }
78
- .ditty-dashboard-notice .ditty-features-list li i {
79
- margin-right: 5px; }
 
 
 
 
 
 
80
 
81
  .ditty-field {
82
  padding: 10px 0;
1
+ .wp-admin.post-php.post-type-ditty #poststuff,
2
+ .wp-admin.post-new-php.post-type-ditty #poststuff {
3
  min-width: inherit; }
4
 
5
+ .wp-admin.post-php.post-type-ditty #post-body-content,
6
+ .wp-admin.post-new-php.post-type-ditty #post-body-content {
7
  min-width: inherit; }
8
 
9
+ .wp-admin.post-php.post-type-ditty #post-body.columns-2 #postbox-container-1,
10
+ .wp-admin.post-new-php.post-type-ditty #post-body.columns-2 #postbox-container-1 {
11
  margin-right: -400px;
12
  width: 380px; }
13
 
14
+ .wp-admin.post-php.post-type-ditty #poststuff #post-body.columns-2,
15
+ .wp-admin.post-new-php.post-type-ditty #poststuff #post-body.columns-2 {
16
  margin-right: 400px; }
17
+ .wp-admin.post-php.post-type-ditty #poststuff #post-body.columns-2 #side-sortables,
18
+ .wp-admin.post-new-php.post-type-ditty #poststuff #post-body.columns-2 #side-sortables {
19
  width: 380px; }
20
 
21
+ .wp-admin.post-php.post-type-ditty #titlediv,
22
+ .wp-admin.post-new-php.post-type-ditty #titlediv {
23
  display: none; }
24
 
25
  @media only screen and (max-width: 850px) {
62
  padding-bottom: 8px;
63
  margin-bottom: -8px; }
64
 
65
+ .ditty-dashboard-notice {
66
+ position: relative; }
67
+ .ditty-dashboard-notice.notice-info {
68
+ border-left-color: #19BF7C; }
69
+ .ditty-dashboard-notice__close {
70
+ position: absolute;
71
+ top: 10px;
72
+ right: 10px;
73
+ display: block;
74
+ text-decoration: none;
75
+ color: #3c434a; }
76
+ .ditty-dashboard-notice__close i {
77
+ font-size: 15px; }
78
+ .ditty-dashboard-notice__close i:before {
79
+ vertical-align: middle; }
80
+ .ditty-dashboard-notice .ditty-features-list {
81
  display: flex;
82
  flex-direction: row;
83
  align-items: center;
84
  justify-content: flex-start;
85
+ flex-wrap: wrap; }
86
+ .ditty-dashboard-notice .ditty-features-list li {
87
+ display: flex;
88
+ flex-direction: row;
89
+ align-items: center;
90
+ justify-content: flex-start;
91
+ color: #FFF;
92
+ background: #19BF7C;
93
+ border-radius: 3px;
94
+ padding: 5px 10px;
95
+ margin: 0 5px 5px 0; }
96
+ .ditty-dashboard-notice .ditty-features-list li i {
97
+ margin-right: 5px; }
98
 
99
  .ditty-field {
100
  padding: 10px 0;
includes/css/ditty.css CHANGED
@@ -260,18 +260,15 @@
260
  max-width: 100%;
261
  box-sizing: border-box; }
262
 
263
- .ditty-item {
264
- max-width: 100%; }
265
- .ditty-item__elements {
266
- max-width: 100%;
267
  box-sizing: border-box; }
268
- .ditty-item__elements * {
269
- box-sizing: border-box; }
270
- .ditty-item__wrapper {
271
- position: relative;
272
- overflow: hidden; }
273
- .ditty-item__elements {
274
- max-width: 100%; }
275
 
276
  .ditty-update-wrapper {
277
  position: relative;
@@ -438,7 +435,8 @@
438
  box-sizing: border-box; }
439
  .ditty-list .ditty-item {
440
  position: relative;
441
- display: block; }
 
442
 
443
  .ditty-item-type--wp_editor > *:first-child {
444
  margin-top: 0; }
@@ -601,7 +599,8 @@
601
  .ditty-data-list__item a:hover {
602
  color: rgba(0, 0, 0, 0.7); }
603
  .ditty-data-list__item a:hover i {
604
- transform: scale(1.2); }
 
605
  .ditty-data-list__item a.ditty-data-list__item__icon,
606
  .ditty-data-list__item span.ditty-data-list__item__icon {
607
  font-size: 14px;
@@ -624,7 +623,9 @@
624
  height: 20px;
625
  text-align: center;
626
  line-height: 20px;
627
- transition: transform 0.3s ease; }
 
 
628
  .ditty-data-list__item i:focus {
629
  outline: none; }
630
  .ditty-data-list__item:hover {
@@ -680,7 +681,9 @@
680
  line-height: 20px;
681
  text-align: center;
682
  margin-top: -10px;
683
- transition: transform .25s ease; }
 
 
684
  .ditty-accordion__content {
685
  display: none;
686
  line-height: 1.5em;
@@ -693,7 +696,8 @@
693
  border-bottom-left-radius: 0;
694
  border-bottom-right-radius: 0; }
695
  .ditty-accordion.active > .ditty-accordion__toggle:after {
696
- transform: rotate(180deg); }
 
697
 
698
  /**
699
  * Ditty Editor Styles
260
  max-width: 100%;
261
  box-sizing: border-box; }
262
 
263
+ .ditty-item__elements {
264
+ max-width: 100%;
265
+ box-sizing: border-box; }
266
+ .ditty-item__elements * {
267
  box-sizing: border-box; }
268
+
269
+ .ditty-item__wrapper {
270
+ position: relative;
271
+ overflow: hidden; }
 
 
 
272
 
273
  .ditty-update-wrapper {
274
  position: relative;
435
  box-sizing: border-box; }
436
  .ditty-list .ditty-item {
437
  position: relative;
438
+ display: block;
439
+ max-width: 100%; }
440
 
441
  .ditty-item-type--wp_editor > *:first-child {
442
  margin-top: 0; }
599
  .ditty-data-list__item a:hover {
600
  color: rgba(0, 0, 0, 0.7); }
601
  .ditty-data-list__item a:hover i {
602
+ -webkit-transform: scale(1.2);
603
+ transform: scale(1.2); }
604
  .ditty-data-list__item a.ditty-data-list__item__icon,
605
  .ditty-data-list__item span.ditty-data-list__item__icon {
606
  font-size: 14px;
623
  height: 20px;
624
  text-align: center;
625
  line-height: 20px;
626
+ transition: -webkit-transform 0.3s ease;
627
+ transition: transform 0.3s ease;
628
+ transition: transform 0.3s ease, -webkit-transform 0.3s ease; }
629
  .ditty-data-list__item i:focus {
630
  outline: none; }
631
  .ditty-data-list__item:hover {
681
  line-height: 20px;
682
  text-align: center;
683
  margin-top: -10px;
684
+ transition: -webkit-transform .25s ease;
685
+ transition: transform .25s ease;
686
+ transition: transform .25s ease, -webkit-transform .25s ease; }
687
  .ditty-accordion__content {
688
  display: none;
689
  line-height: 1.5em;
696
  border-bottom-left-radius: 0;
697
  border-bottom-right-radius: 0; }
698
  .ditty-accordion.active > .ditty-accordion__toggle:after {
699
+ -webkit-transform: rotate(180deg);
700
+ transform: rotate(180deg); }
701
 
702
  /**
703
  * Ditty Editor Styles
includes/js/class-ditty-display-ticker.js CHANGED
@@ -50,6 +50,7 @@
50
  itemBorderRadius : {},
51
  itemPadding : {},
52
  itemMaxWidth : '',
 
53
  item : 0,
54
  shuffle : 0,
55
  showEditor : 0,
@@ -883,6 +884,9 @@
883
  $item.children( '.ditty-item__elements' ).css( this.settings.itemPadding );
884
  $item.children( '.ditty-item__elements' ).css( this.settings.itemBorderRadius );
885
  $item.children( '.ditty-item__elements' ).css( this.settings.itemBorderWidth );
 
 
 
886
  if ( '' !== this.settings.itemMaxWidth ) {
887
  $item.children( '.ditty-item__elements' ).css( { maxWidth: this.settings.itemMaxWidth } );
888
  }
50
  itemBorderRadius : {},
51
  itemPadding : {},
52
  itemMaxWidth : '',
53
+ itemElementsWrap : 'wrap',
54
  item : 0,
55
  shuffle : 0,
56
  showEditor : 0,
884
  $item.children( '.ditty-item__elements' ).css( this.settings.itemPadding );
885
  $item.children( '.ditty-item__elements' ).css( this.settings.itemBorderRadius );
886
  $item.children( '.ditty-item__elements' ).css( this.settings.itemBorderWidth );
887
+ if ( '' !== this.settings.itemElementsWrap ) {
888
+ $item.children( '.ditty-item__elements' ).css( { whiteSpace: this.settings.itemElementsWrap } );
889
+ }
890
  if ( '' !== this.settings.itemMaxWidth ) {
891
  $item.children( '.ditty-item__elements' ).css( { maxWidth: this.settings.itemMaxWidth } );
892
  }
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:"",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,d=0,l=!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&&(l=!0);break;case"right":m=e-=a,this._itemSetTransform(i,{posX:m,posY:s}),e<0&&(l=!0);break;case"up":d=s,this._itemSetTransform(i,{posX:e,posY:d}),(s+=o)>r&&(l=!0);break;case"down":d=s-=o,this._itemSetTransform(i,{posX:e,posY:d}),s<0&&(l=!0)}return i.stop().animate({opacity:1},1e3,"linear",(function(){})),this.visibleItems.push({$item:i,itemId:h,posX:m,posY:d}),this._setCurrentHeight(),{posX:e,posY:s,filled:l}},_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.height?this.settings.height:"100%",i=this.settings.minHeight?this.settings.minHeight:0,e=this.settings.maxHeight?this.settings.maxHeight:"none";this.$elmt.css({height:t,minHeight:i,maxHeight:e}),this.$contents.css({height:t})}else this.$elmt.css({height:"auto",minHeight:0,maxHeight:"none"}),this.$contents.css({height:"auto"})},_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.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"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,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.height?this.settings.height:"100%",i=this.settings.minHeight?this.settings.minHeight:0,e=this.settings.maxHeight?this.settings.maxHeight:"none";this.$elmt.css({height:t,minHeight:i,maxHeight:e}),this.$contents.css({height:t})}else this.$elmt.css({height:"auto",minHeight:0,maxHeight:"none"}),this.$contents.css({height:"auto"})},_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"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);
includes/js/ditty-admin.js CHANGED
@@ -17,20 +17,6 @@ jQuery( document ).ready( function( $ ) {
17
  $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
  $( '#ditty-settings' ).ditty_settings();
19
 
20
- // Notice close
21
- $( '.ditty-dashboard-notice' ).on( 'click', '.notice-dismiss', function() {
22
- var $notice = $( this ).parents( '.ditty-dashboard-notice' ),
23
- notice_id = $notice.data( 'notice_id' );
24
-
25
- var data = {
26
- action : 'ditty_notice_close',
27
- notice_id : notice_id,
28
- security : dittyAdminVars.security
29
- };
30
- $.post( dittyAdminVars.ajaxurl, data );
31
-
32
- } );
33
-
34
  }() );
35
 
36
  } );
17
  $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
  $( '#ditty-settings' ).ditty_settings();
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }() );
21
 
22
  } );
includes/js/ditty-admin.min.js CHANGED
@@ -17,20 +17,6 @@ jQuery( document ).ready( function( $ ) {
17
  $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
  $( '#ditty-settings' ).ditty_settings();
19
 
20
- // Notice close
21
- $( '.ditty-dashboard-notice' ).on( 'click', '.notice-dismiss', function() {
22
- var $notice = $( this ).parents( '.ditty-dashboard-notice' ),
23
- notice_id = $notice.data( 'notice_id' );
24
-
25
- var data = {
26
- action : 'ditty_notice_close',
27
- notice_id : notice_id,
28
- security : dittyAdminVars.security
29
- };
30
- $.post( dittyAdminVars.ajaxurl, data );
31
-
32
- } );
33
-
34
  }() );
35
 
36
  } );
17
  $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
  $( '#ditty-settings' ).ditty_settings();
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }() );
21
 
22
  } );
includes/sass/admin/_dashboard.scss CHANGED
@@ -1,4 +1,5 @@
1
- .wp-admin.post-php.post-type-ditty {
 
2
  #poststuff {
3
  min-width: inherit;
4
  }
@@ -69,9 +70,24 @@ table.wp-list-table .type-ditty_display .row-actions {
69
  }
70
 
71
  .ditty-dashboard-notice {
 
72
  &.notice-info {
73
  border-left-color: $green;
74
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  .ditty-features-list {
76
  display: flex;
77
  flex-direction: row;
1
+ .wp-admin.post-php.post-type-ditty,
2
+ .wp-admin.post-new-php.post-type-ditty {
3
  #poststuff {
4
  min-width: inherit;
5
  }
70
  }
71
 
72
  .ditty-dashboard-notice {
73
+ position: relative;
74
  &.notice-info {
75
  border-left-color: $green;
76
  }
77
+ &__close {
78
+ position: absolute;
79
+ top: 10px;
80
+ right: 10px;
81
+ display: block;
82
+ text-decoration: none;
83
+ color: #3c434a;
84
+ i {
85
+ font-size: 15px;
86
+ &:before {
87
+ vertical-align: middle;
88
+ }
89
+ }
90
+ }
91
  .ditty-features-list {
92
  display: flex;
93
  flex-direction: row;
includes/sass/partials/_display_list.scss CHANGED
@@ -7,5 +7,6 @@
7
  .ditty-item {
8
  position: relative;
9
  display: block;
 
10
  }
11
  }
7
  .ditty-item {
8
  position: relative;
9
  display: block;
10
+ max-width: 100%;
11
  }
12
  }
includes/sass/partials/_general.scss CHANGED
@@ -10,7 +10,6 @@
10
  }
11
  }
12
  .ditty-item {
13
- max-width: 100%;
14
  &__elements {
15
  max-width: 100%;
16
  box-sizing: border-box;
@@ -22,9 +21,6 @@
22
  position: relative;
23
  overflow: hidden;
24
  }
25
- &__elements {
26
- max-width: 100%;
27
- }
28
  }
29
  .ditty-update-wrapper {
30
  position: relative;
10
  }
11
  }
12
  .ditty-item {
 
13
  &__elements {
14
  max-width: 100%;
15
  box-sizing: border-box;
21
  position: relative;
22
  overflow: hidden;
23
  }
 
 
 
24
  }
25
  .ditty-update-wrapper {
26
  position: relative;
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, news, news ticker, rotator, data rotator, lists, data, aggregator, latest posts
5
  Requires at least: 4.5
6
  Tested up to: 5.8.2
7
- Stable tag: 3.0.6
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
@@ -66,6 +66,13 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
 
 
69
  = 3.0.6 =
70
  * Ditty Editor Items javascript helper update
71
  * Minor update in legacy ditty-news-ticker.js file
@@ -609,4 +616,4 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
609
 
610
  == Upgrade Notice ==
611
 
612
- Ditty Editor Items javascript helper update
4
  Tags: ticker, news, news ticker, rotator, data rotator, lists, data, aggregator, latest posts
5
  Requires at least: 4.5
6
  Tested up to: 5.8.2
7
+ Stable tag: 3.0.7
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
66
 
67
  == Changelog ==
68
 
69
+ = 3.0.7 =
70
+ * .ditty-item css updates
71
+ * Added wp_enqueue_script check to ensure wp_add_inline_script is only added once
72
+ * Removed ajax Ditty notification close
73
+ * Added php Ditty notification close
74
+ * Added Wrap Elements option to Ticker display
75
+
76
  = 3.0.6 =
77
  * Ditty Editor Items javascript helper update
78
  * Minor update in legacy ditty-news-ticker.js file
616
 
617
  == Upgrade Notice ==
618
 
619
+ CSS updates, wp_add_inline_script bug fix, Ditty notification system updates, Ticker display updates