Ditty News Ticker - Version 1.4.12

Version Description

  • Modified jQuery script to allow hidden tickers to function correctly after they become visible on screen
  • Added the ability to add all ticks from a selected type to the mixed ticker
Download this release

Release Info

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

Code changes from version 1.4.11 to 1.4.12

assets/css/style.css CHANGED
File without changes
assets/js/admin/script.js CHANGED
@@ -150,7 +150,7 @@ jQuery( document ).ready( function($) {
150
 
151
 
152
  /* --------------------------------------------------------- */
153
- /* !Advanced list - 1.4.5 */
154
  /* --------------------------------------------------------- */
155
 
156
  if( $('.mtphr-dnt-advanced-list').length > 0 ) {
@@ -229,7 +229,11 @@ jQuery( document ).ready( function($) {
229
 
230
  // Reset the duplicate
231
  $dup.find('textarea, input, select').each( function() {
232
- $(this).val('');
 
 
 
 
233
  });
234
 
235
  // Add the duplicate
150
 
151
 
152
  /* --------------------------------------------------------- */
153
+ /* !Advanced list - 1.4.12 */
154
  /* --------------------------------------------------------- */
155
 
156
  if( $('.mtphr-dnt-advanced-list').length > 0 ) {
229
 
230
  // Reset the duplicate
231
  $dup.find('textarea, input, select').each( function() {
232
+ if( $(this).attr('type') == 'checkbox' || $(this).attr('type') == 'radio' ) {
233
+ $(this).removeAttr('checked');
234
+ } else {
235
+ $(this).val('');
236
+ }
237
  });
238
 
239
  // Add the duplicate
assets/js/ditty-news-ticker.js CHANGED
@@ -1,9 +1,9 @@
1
  /**
2
  * Ditty News Ticker
3
- * Date: 9/17/2013
4
  *
5
  * @author Metaphor Creations
6
- * @version 1.2.0
7
  *
8
  **/
9
 
@@ -81,17 +81,32 @@
81
  // Save the tick count & total
82
  vars.tick_count = $ticker.find('.mtphr-dnt-tick').length;
83
 
84
- // Start the first tick
85
- if( vars.tick_count > 0 ) {
86
 
87
- // Setup a ticker scroll
88
- if( settings.type == 'scroll' ) {
89
- mtphr_dnt_scroll_setup();
90
 
91
- // Setup a ticker rotator
92
- } else if( settings.type == 'rotate' ) {
93
- mtphr_dnt_rotator_setup();
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
96
 
97
 
@@ -1261,14 +1276,23 @@
1261
  }
1262
  }
1263
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1264
 
1265
-
1266
-
1267
-
1268
- // Trigger the afterLoad callback
1269
- settings.after_load.call($container, $ticker);
1270
- $container.trigger('mtphr_dnt_after_load_single', [vars, ticks]);
1271
- $('body').trigger('mtphr_dnt_after_load', [$container, vars, ticks]);
1272
  });
1273
  }
1274
  };
1
  /**
2
  * Ditty News Ticker
3
+ * Date: 10/06/2014
4
  *
5
  * @author Metaphor Creations
6
+ * @version 1.4.12
7
  *
8
  **/
9
 
81
  // Save the tick count & total
82
  vars.tick_count = $ticker.find('.mtphr-dnt-tick').length;
83
 
 
 
84
 
 
 
 
85
 
86
+ /**
87
+ * Initialize the ticker
88
+ *
89
+ * @since 1.0.0
90
+ */
91
+ function mtphr_dnt_init() {
92
+
93
+ // Start the first tick
94
+ if( vars.tick_count > 0 ) {
95
+
96
+ // Setup a ticker scroll
97
+ if( settings.type == 'scroll' ) {
98
+ mtphr_dnt_scroll_setup();
99
+
100
+ // Setup a ticker rotator
101
+ } else if( settings.type == 'rotate' ) {
102
+ mtphr_dnt_rotator_setup();
103
+ }
104
+ }
105
+
106
+ // Trigger the afterLoad callback
107
+ settings.after_load.call($container, $ticker);
108
+ $container.trigger('mtphr_dnt_after_load_single', [vars, ticks]);
109
+ $('body').trigger('mtphr_dnt_after_load', [$container, vars, ticks]);
110
  }
111
 
112
 
1276
  }
1277
  }
1278
  });
1279
+
1280
+ if( $container.width() == 0 ) {
1281
+
1282
+ var mtphr_dnt_init_timer = setInterval( function() {
1283
+
1284
+ if( $container.width() > 10 ) {
1285
+ clearInterval(mtphr_dnt_init_timer);
1286
+ ticker_width = $ticker.width();
1287
+ mtphr_dnt_init();
1288
+ }
1289
+
1290
+ }, 100 );
1291
+
1292
+ } else {
1293
+ mtphr_dnt_init();
1294
+ }
1295
 
 
 
 
 
 
 
 
1296
  });
1297
  }
1298
  };
assets/js/jquery.easing.1.3.js CHANGED
File without changes
assets/js/jquery.touchSwipe.min.js CHANGED
File without changes
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.4.11
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
@@ -29,10 +29,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
 
30
 
31
  /* --------------------------------------------------------- */
32
- /* !Define constants - 1.4.10 */
33
  /* --------------------------------------------------------- */
34
 
35
- define ( 'MTPHR_DNT_VERSION', '1.4.11' );
36
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
37
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
38
 
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.4.12
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
29
 
30
 
31
  /* --------------------------------------------------------- */
32
+ /* !Define constants - 1.4.12 */
33
  /* --------------------------------------------------------- */
34
 
35
+ define ( 'MTPHR_DNT_VERSION', '1.4.12' );
36
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
37
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
38
 
includes/admin/filters.php CHANGED
File without changes
includes/admin/meta-boxes.php CHANGED
@@ -331,6 +331,7 @@ function mtphr_dnt_render_mixed_tick( $types, $tick=false, $i=false ) {
331
 
332
  $tick_type = ( isset($tick) && isset($tick['type']) ) ? $tick['type'] : '';
333
  $tick_offset = ( isset($tick) && isset($tick['offset']) ) ? $tick['offset'] : 0;
 
334
 
335
  echo '<tr class="mtphr-dnt-list-item">';
336
  echo '<td class="mtphr-dnt-list-handle"><span></span></td>';
@@ -345,7 +346,11 @@ function mtphr_dnt_render_mixed_tick( $types, $tick=false, $i=false ) {
345
  echo '</label>';
346
  echo '</td>';
347
  echo '<td>';
348
- echo '<label>'.__('Offset:', 'ditty-news-ticker').' ';
 
 
 
 
349
  echo '<input type="number" name="_mtphr_dnt_mixed_ticks[offset]" data-name="_mtphr_dnt_mixed_ticks" data-key="offset" value="'.$tick_offset.'" />';
350
  echo '</label>';
351
  echo '</td>';
@@ -854,7 +859,8 @@ function mtphr_dnt_metabox_save( $post_id ) {
854
  foreach( $_POST['_mtphr_dnt_mixed_ticks'] as $tick ) {
855
  $sanitized_ticks[] = array(
856
  'type' => $tick['type'],
857
- 'offset' => intval($tick['offset'])
 
858
  );
859
  }
860
  }
331
 
332
  $tick_type = ( isset($tick) && isset($tick['type']) ) ? $tick['type'] : '';
333
  $tick_offset = ( isset($tick) && isset($tick['offset']) ) ? $tick['offset'] : 0;
334
+ $tick_all = ( isset($tick) && isset($tick['all']) && $tick['all'] == 'on' ) ? 'on' :'';
335
 
336
  echo '<tr class="mtphr-dnt-list-item">';
337
  echo '<td class="mtphr-dnt-list-handle"><span></span></td>';
346
  echo '</label>';
347
  echo '</td>';
348
  echo '<td>';
349
+ echo '<label>'.__('Display <strong>all</strong> ticks:', 'ditty-news-ticker').' ';
350
+ echo '<input type="checkbox" name="_mtphr_dnt_mixed_ticks[all]" data-name="_mtphr_dnt_mixed_ticks" data-key="all" value="on" '.checked('on', $tick_all, false).' />';
351
+ echo '</label>';
352
+
353
+ echo '<label>'.__(', or choose <strong>offset</strong>:', 'ditty-news-ticker').' ';
354
  echo '<input type="number" name="_mtphr_dnt_mixed_ticks[offset]" data-name="_mtphr_dnt_mixed_ticks" data-key="offset" value="'.$tick_offset.'" />';
355
  echo '</label>';
356
  echo '</td>';
859
  foreach( $_POST['_mtphr_dnt_mixed_ticks'] as $tick ) {
860
  $sanitized_ticks[] = array(
861
  'type' => $tick['type'],
862
+ 'offset' => intval($tick['offset']),
863
+ 'all' => $tick['all']
864
  );
865
  }
866
  }
includes/admin/upgrades.php CHANGED
File without changes
includes/functions.php CHANGED
@@ -232,7 +232,7 @@ add_filter( 'mtphr_dnt_tick_array', 'mtphr_dnt_default_ticks', 10, 3 );
232
 
233
 
234
  /* --------------------------------------------------------- */
235
- /* !Create the mixed ticks - 1.4.0 */
236
  /* --------------------------------------------------------- */
237
 
238
  if( !function_exists('mtphr_dnt_mixed_ticks') ) {
@@ -263,9 +263,21 @@ function mtphr_dnt_mixed_ticks( $id, $meta_data ) {
263
  $meta_data['_mtphr_dnt_type'] = $tick['type'];
264
  $ticks_cache[$tick['type']] = apply_filters( 'mtphr_dnt_tick_array', array(), $id, $meta_data );
265
  }
 
 
 
266
 
267
- // Add the appropriate tick to the tick array
268
- if( isset($ticks_cache[$tick['type']][intval($tick['offset'])]) ) {
 
 
 
 
 
 
 
 
 
269
  $dnt_ticks[] = array(
270
  'type' => $tick['type'],
271
  'tick' => $ticks_cache[$tick['type']][intval($tick['offset'])]
232
 
233
 
234
  /* --------------------------------------------------------- */
235
+ /* !Create the mixed ticks - 1.4.12 */
236
  /* --------------------------------------------------------- */
237
 
238
  if( !function_exists('mtphr_dnt_mixed_ticks') ) {
263
  $meta_data['_mtphr_dnt_type'] = $tick['type'];
264
  $ticks_cache[$tick['type']] = apply_filters( 'mtphr_dnt_tick_array', array(), $id, $meta_data );
265
  }
266
+
267
+ // Add all ticks of the selected type to the array
268
+ if( isset($tick['all']) && $tick['all'] == 'on' && isset($ticks_cache[$tick['type']]) ) {
269
 
270
+ if( is_array($ticks_cache[$tick['type']]) && count($ticks_cache[$tick['type']]) > 0 ) {
271
+ foreach( $ticks_cache[$tick['type']] as $i=>$all_tick ) {
272
+ $dnt_ticks[] = array(
273
+ 'type' => $tick['type'],
274
+ 'tick' => $all_tick
275
+ );
276
+ }
277
+ }
278
+
279
+ // Or, add just the select offset to the array
280
+ } elseif( isset($ticks_cache[$tick['type']][intval($tick['offset'])]) ) {
281
  $dnt_ticks[] = array(
282
  'type' => $tick['type'],
283
  'tick' => $ticks_cache[$tick['type']][intval($tick['offset'])]
includes/help.php CHANGED
File without changes
includes/helpers.php CHANGED
File without changes
includes/post-types.php CHANGED
File without changes
includes/scripts.php CHANGED
File without changes
includes/settings.php CHANGED
File without changes
includes/shortcodes.php CHANGED
File without changes
includes/widget.php CHANGED
File without changes
languages/ditty-news-ticker-en_US.mo CHANGED
File without changes
languages/ditty-news-ticker-en_US.po CHANGED
File without changes
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: metaphorcreations
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FUZKZGAJSBAE6
4
  Tags: ticker, news, news ticker, rotator, data rotator, lists, data
5
  Requires at least: 3.2
6
- Tested up to: 3.9.2
7
  Stable tag: /trunk/
8
  License: GPL2
9
 
@@ -54,6 +54,10 @@ Each individual Ticker post has multiple settings to customize.
54
 
55
  == Changelog ==
56
 
 
 
 
 
57
  = 1.4.11 =
58
  * Fixed bug in ticker script filter when using unique_ids
59
 
@@ -248,4 +252,4 @@ Each individual Ticker post has multiple settings to customize.
248
 
249
  == Upgrade Notice ==
250
 
251
- Fixed bug in ticker script filter when using unique_ids.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FUZKZGAJSBAE6
4
  Tags: ticker, news, news ticker, rotator, data rotator, lists, data
5
  Requires at least: 3.2
6
+ Tested up to: 4.0
7
  Stable tag: /trunk/
8
  License: GPL2
9
 
54
 
55
  == Changelog ==
56
 
57
+ = 1.4.12 =
58
+ * Modified jQuery script to allow hidden tickers to function correctly after they become visible on screen
59
+ * Added the ability to add all ticks from a selected type to the mixed ticker
60
+
61
  = 1.4.11 =
62
  * Fixed bug in ticker script filter when using unique_ids
63
 
252
 
253
  == Upgrade Notice ==
254
 
255
+ Modified to enable hidden ticker functionality and added All ticks option to mixed ticker.