Ditty News Ticker - Version 1.0.8

Version Description

  • Fixed bug in rotator mode with "pause on hover" activated.
  • jQuery now loading on (window).load() instead of (document).ready(). Fixes scrolling issue in Safari.
  • Added .clearfix to .mtphr-dnt-wrapper.
  • Specifically set .mtphr-dnt-tick.clearfix to display:none to override css in certain themes.
  • Added filters to jQuery class callbacks.
  • Added ticker ID to jQuery class vars.
  • Now resizing rotator ticker height on window resize.
Download this release

Release Info

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

Code changes from version 1.0.7 to 1.0.8

assets/css/style.css CHANGED
@@ -16,6 +16,9 @@
16
  white-space: nowrap;
17
  margin: 0;
18
  }
 
 
 
19
  .mtphr-dnt-rotate .mtphr-dnt-tick {
20
  white-space: normal;
21
  }
16
  white-space: nowrap;
17
  margin: 0;
18
  }
19
+ .mtphr-dnt-tick.clearfix {
20
+ display:none;
21
+ }
22
  .mtphr-dnt-rotate .mtphr-dnt-tick {
23
  white-space: normal;
24
  }
assets/js/ditty-news-ticker.js CHANGED
@@ -1,9 +1,9 @@
1
  /**
2
  * Ditty News Ticker
3
- * Date: 1/15/2013
4
  *
5
  * @author Metaphor Creations
6
- * @version 1.0.0
7
  *
8
  **/
9
 
@@ -17,6 +17,7 @@
17
 
18
  // Create default options
19
  var settings = {
 
20
  type : 'scroll',
21
  scroll_direction : 'left',
22
  scroll_speed : 10,
@@ -37,6 +38,7 @@
37
 
38
  // Useful variables. Play carefully.
39
  var vars = {
 
40
  tick_count : 0,
41
  current_tick : 0,
42
  reverse : 0,
@@ -172,11 +174,12 @@
172
  /**
173
  * Create the ticker scroll loop
174
  *
175
- * @since 1.0.0
176
  */
177
  function mtphr_dnt_scroll_loop() {
178
 
179
  // Start the ticker timer
 
180
  ticker_scroll = setInterval( function() {
181
 
182
  for( var i=0; i<vars.tick_count; i++ ) {
@@ -381,7 +384,7 @@
381
  /**
382
  * Setup the ticker rotator
383
  *
384
- * @since 1.0.0
385
  */
386
  function mtphr_dnt_rotator_setup() {
387
 
@@ -409,13 +412,13 @@
409
 
410
  // Clear the loop on mouse hover
411
  $ticker.hover(
412
- function () {
413
- if( settings.auto_rotate && settings.rotate_pause ) {
414
  clearInterval( ticker_delay );
415
  }
416
  },
417
  function () {
418
- if( settings.auto_rotate && settings.rotate_pause ) {
419
  mtphr_dnt_rotator_delay();
420
  }
421
  }
@@ -430,6 +433,7 @@
430
  function mtphr_dnt_rotator_delay() {
431
 
432
  // Start the ticker timer
 
433
  ticker_delay = setInterval( function() {
434
 
435
  // Find the new tick
@@ -533,7 +537,7 @@
533
  /**
534
  * Resize the rotator ticks
535
  *
536
- * @since 1.0.0
537
  */
538
  function mtphr_dnt_rotator_resize_ticks() {
539
 
@@ -542,6 +546,10 @@
542
  // Set the width of the tick
543
  $(ticks[i]).width( ticker_width+'px' );
544
  }
 
 
 
 
545
  }
546
 
547
 
1
  /**
2
  * Ditty News Ticker
3
+ * Date: 3/10/2013
4
  *
5
  * @author Metaphor Creations
6
+ * @version 1.0.8
7
  *
8
  **/
9
 
17
 
18
  // Create default options
19
  var settings = {
20
+ id : '',
21
  type : 'scroll',
22
  scroll_direction : 'left',
23
  scroll_speed : 10,
38
 
39
  // Useful variables. Play carefully.
40
  var vars = {
41
+ id : settings.id,
42
  tick_count : 0,
43
  current_tick : 0,
44
  reverse : 0,
174
  /**
175
  * Create the ticker scroll loop
176
  *
177
+ * @since 1.0.8
178
  */
179
  function mtphr_dnt_scroll_loop() {
180
 
181
  // Start the ticker timer
182
+ clearInterval( ticker_scroll );
183
  ticker_scroll = setInterval( function() {
184
 
185
  for( var i=0; i<vars.tick_count; i++ ) {
384
  /**
385
  * Setup the ticker rotator
386
  *
387
+ * @since 1.0.8
388
  */
389
  function mtphr_dnt_rotator_setup() {
390
 
412
 
413
  // Clear the loop on mouse hover
414
  $ticker.hover(
415
+ function (e) {
416
+ if( settings.auto_rotate && settings.rotate_pause && !vars.running ) {
417
  clearInterval( ticker_delay );
418
  }
419
  },
420
  function () {
421
+ if( settings.auto_rotate && settings.rotate_pause && !vars.running ) {
422
  mtphr_dnt_rotator_delay();
423
  }
424
  }
433
  function mtphr_dnt_rotator_delay() {
434
 
435
  // Start the ticker timer
436
+ clearInterval( ticker_delay );
437
  ticker_delay = setInterval( function() {
438
 
439
  // Find the new tick
537
  /**
538
  * Resize the rotator ticks
539
  *
540
+ * @since 1.0.8
541
  */
542
  function mtphr_dnt_rotator_resize_ticks() {
543
 
546
  // Set the width of the tick
547
  $(ticks[i]).width( ticker_width+'px' );
548
  }
549
+
550
+ // Resize the ticker
551
+ var h = $(ticks[vars.current_tick]).height();
552
+ $ticker.stop().css( 'height', h+'px' );
553
  }
554
 
555
 
ditty-news-ticker.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ditty News Ticker
4
  Plugin URI: http://dittynewsticker.com/
5
  Description: Ditty News Ticker is a multi-functional data display plugin
6
- Version: 1.0.7
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
@@ -45,9 +45,9 @@ The icons are licensed under a Creative Commons Attribution
45
  * @since 1.0.0
46
  */
47
  if ( WP_DEBUG ) {
48
- define ( 'MTPHR_DNT_VERSION', '1.0.7-'.time() );
49
  } else {
50
- define ( 'MTPHR_DNT_VERSION', '1.0.7' );
51
  }
52
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
53
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
3
  Plugin Name: Ditty News Ticker
4
  Plugin URI: http://dittynewsticker.com/
5
  Description: Ditty News Ticker is a multi-functional data display plugin
6
+ Version: 1.0.8
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
45
  * @since 1.0.0
46
  */
47
  if ( WP_DEBUG ) {
48
+ define ( 'MTPHR_DNT_VERSION', '1.0.8-'.time() );
49
  } else {
50
+ define ( 'MTPHR_DNT_VERSION', '1.0.8' );
51
  }
52
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
53
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
includes/functions.php CHANGED
@@ -22,7 +22,7 @@ function ditty_news_ticker( $id='', $class='', $atts=false ) {
22
  /**
23
  * Return the ticker
24
  *
25
- * @since 1.0.3
26
  */
27
  function get_mtphr_dnt_ticker( $id='', $class='', $atts=false ) {
28
 
@@ -99,7 +99,7 @@ function get_mtphr_dnt_ticker( $id='', $class='', $atts=false ) {
99
  }
100
 
101
  echo '<div'.$ticker_width.' id="'.$tick_id.'" '.mtphr_dnt_ticker_class( $id, $class, $meta_data ).'>';
102
- echo '<div class="mtphr-dnt-wrapper">';
103
 
104
  // Display the title
105
  if( isset($_mtphr_dnt_title) ) {
22
  /**
23
  * Return the ticker
24
  *
25
+ * @since 1.0.8
26
  */
27
  function get_mtphr_dnt_ticker( $id='', $class='', $atts=false ) {
28
 
99
  }
100
 
101
  echo '<div'.$ticker_width.' id="'.$tick_id.'" '.mtphr_dnt_ticker_class( $id, $class, $meta_data ).'>';
102
+ echo '<div class="mtphr-dnt-wrapper clearfix">';
103
 
104
  // Display the title
105
  if( isset($_mtphr_dnt_title) ) {
includes/scripts.php CHANGED
@@ -74,7 +74,7 @@ add_action( 'mtphr_dnt_after', 'mtphr_dnt_ticker_scripts', 10, 2 );
74
  /**
75
  * Add the class scripts
76
  *
77
- * @since 1.0.0
78
  */
79
  function mtphr_dnt_ticker_scripts( $id, $meta_data ) {
80
 
@@ -97,8 +97,9 @@ function mtphr_dnt_ticker_scripts( $id, $meta_data ) {
97
  }
98
  ob_start(); ?>
99
  <script>
100
- jQuery( document ).ready( function($) {
101
- $( '<?php echo $ticker; ?>' ).ditty_news_ticker({
 
102
  type : '<?php echo $_mtphr_dnt_mode; ?>',
103
  scroll_direction : '<?php echo $_mtphr_dnt_scroll_direction; ?>',
104
  scroll_speed : <?php echo intval($_mtphr_dnt_scroll_speed); ?>,
@@ -123,8 +124,9 @@ function mtphr_dnt_ticker_scripts( $id, $meta_data ) {
123
  }
124
  ob_start(); ?>
125
  <script>
126
- jQuery( document ).ready( function($) {
127
- $( '<?php echo $ticker; ?>' ).ditty_news_ticker({
 
128
  type : '<?php echo $_mtphr_dnt_mode; ?>',
129
  rotate_type : '<?php echo $_mtphr_dnt_rotate_type; ?>',
130
  auto_rotate : <?php echo $rotate; ?>,
@@ -132,7 +134,16 @@ function mtphr_dnt_ticker_scripts( $id, $meta_data ) {
132
  rotate_pause : <?php echo $pause; ?>,
133
  rotate_speed : <?php echo intval($_mtphr_dnt_rotate_speed); ?>,
134
  rotate_ease : '<?php echo $_mtphr_dnt_rotate_ease; ?>',
135
- nav_reverse : <?php echo $nav_reverse; ?>
 
 
 
 
 
 
 
 
 
136
  });
137
  });
138
  </script>
74
  /**
75
  * Add the class scripts
76
  *
77
+ * @since 1.0.8
78
  */
79
  function mtphr_dnt_ticker_scripts( $id, $meta_data ) {
80
 
97
  }
98
  ob_start(); ?>
99
  <script>
100
+ jQuery( window ).load( function() {
101
+ jQuery( '<?php echo $ticker; ?>' ).ditty_news_ticker({
102
+ id : '<?php echo $id; ?>',
103
  type : '<?php echo $_mtphr_dnt_mode; ?>',
104
  scroll_direction : '<?php echo $_mtphr_dnt_scroll_direction; ?>',
105
  scroll_speed : <?php echo intval($_mtphr_dnt_scroll_speed); ?>,
124
  }
125
  ob_start(); ?>
126
  <script>
127
+ jQuery( window ).load( function() {
128
+ jQuery( '<?php echo $ticker; ?>' ).ditty_news_ticker({
129
+ id : '<?php echo $id; ?>',
130
  type : '<?php echo $_mtphr_dnt_mode; ?>',
131
  rotate_type : '<?php echo $_mtphr_dnt_rotate_type; ?>',
132
  auto_rotate : <?php echo $rotate; ?>,
134
  rotate_pause : <?php echo $pause; ?>,
135
  rotate_speed : <?php echo intval($_mtphr_dnt_rotate_speed); ?>,
136
  rotate_ease : '<?php echo $_mtphr_dnt_rotate_ease; ?>',
137
+ nav_reverse : <?php echo $nav_reverse; ?>,
138
+ after_load : function( $ticker ) {
139
+ <?php echo apply_filters( 'mtphr_dnt_after_load_rotate' , '', $id ); ?>
140
+ },
141
+ before_change : function( $ticker ) {
142
+ <?php echo apply_filters( 'mtphr_dnt_before_change_rotate' , '', $id ); ?>
143
+ },
144
+ after_change : function( $ticker ) {
145
+ <?php echo apply_filters( 'mtphr_dnt_after_change_rotate' , '', $id ); ?>
146
+ }
147
  });
148
  });
149
  </script>
readme.txt CHANGED
@@ -52,6 +52,15 @@ Each individual Ticker post has multiple settings to customize.
52
 
53
  == Changelog ==
54
 
 
 
 
 
 
 
 
 
 
55
  = 1.0.7 =
56
  * Fixed jQuery issue in Firefox when adding new ticks.
57
 
@@ -88,6 +97,9 @@ Each individual Ticker post has multiple settings to customize.
88
 
89
  == Upgrade Notice ==
90
 
 
 
 
91
  = 1.0.7 =
92
  Fixed jQuery issue in Firefox when adding new ticks.
93
 
52
 
53
  == Changelog ==
54
 
55
+ = 1.0.8 =
56
+ * Fixed bug in rotator mode with "pause on hover" activated.
57
+ * jQuery now loading on (window).load() instead of (document).ready(). Fixes scrolling issue in Safari.
58
+ * Added .clearfix to .mtphr-dnt-wrapper.
59
+ * Specifically set .mtphr-dnt-tick.clearfix to display:none to override css in certain themes.
60
+ * Added filters to jQuery class callbacks.
61
+ * Added ticker ID to jQuery class vars.
62
+ * Now resizing rotator ticker height on window resize.
63
+
64
  = 1.0.7 =
65
  * Fixed jQuery issue in Firefox when adding new ticks.
66
 
97
 
98
  == Upgrade Notice ==
99
 
100
+ = 1.0.8 =
101
+ Fixed bug in rotator mode with "pause on hover" activated. jQuery now loading on (window).load() instead of (document).ready(). Fixes scrolling issue in Safari. Added .clearfix to .mtphr-dnt-wrapper. Specifically set .mtphr-dnt-tick.clearfix to display:none to override css in certain themes. Added filters to jQuery class callbacks. Added ticker ID to jQuery class vars. Now resizing rotator ticker height on window resize.
102
+
103
  = 1.0.7 =
104
  Fixed jQuery issue in Firefox when adding new ticks.
105