Ditty News Ticker - Version 2.2.16

Version Description

  • Swapped play and pause button icons
Download this release

Release Info

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

Code changes from version 2.2.15 to 2.2.16

ditty-news-ticker.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://dittynewsticker.com/
5
  Description: Ditty News Ticker is a multi-functional data display plugin
6
  Text Domain: ditty-news-ticker
7
  Domain Path: languages
8
- Version: 2.2.15
9
  Author: Metaphor Creations
10
  Author URI: http://www.metaphorcreations.com
11
  Contributors: metaphorcreations
@@ -62,7 +62,7 @@ final class Ditty_News_Ticker {
62
 
63
  // Plugin version
64
  if ( ! defined( 'MTPHR_DNT_VERSION' ) ) {
65
- define( 'MTPHR_DNT_VERSION', '2.2.15' );
66
  }
67
 
68
  // Plugin Folder Path
5
  Description: Ditty News Ticker is a multi-functional data display plugin
6
  Text Domain: ditty-news-ticker
7
  Domain Path: languages
8
+ Version: 2.2.16
9
  Author: Metaphor Creations
10
  Author URI: http://www.metaphorcreations.com
11
  Contributors: metaphorcreations
62
 
63
  // Plugin version
64
  if ( ! defined( 'MTPHR_DNT_VERSION' ) ) {
65
+ define( 'MTPHR_DNT_VERSION', '2.2.16' );
66
  }
67
 
68
  // Plugin Folder Path
inc/filters.php CHANGED
@@ -47,6 +47,14 @@ function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
47
  );
48
  $args = wp_parse_args( $meta_data, $defaults );
49
 
 
 
 
 
 
 
 
 
50
  if( $args['_mtphr_dnt_grid'] ) {
51
 
52
  $grid_ticks = array();
47
  );
48
  $args = wp_parse_args( $meta_data, $defaults );
49
 
50
+ // If rows or columns are less than one, disable the grid
51
+ if ( intval( $args['_mtphr_dnt_grid_cols'] ) < 1 ) {
52
+ return $dnt_ticks;
53
+ }
54
+ if ( intval( $args['_mtphr_dnt_grid_rows'] ) < 1 ) {
55
+ return $dnt_ticks;
56
+ }
57
+
58
  if( $args['_mtphr_dnt_grid'] ) {
59
 
60
  $grid_ticks = array();
inc/static.php CHANGED
@@ -67,7 +67,8 @@ function mtphr_dnt_scripts() {
67
  // Register the Ditty News Ticker scripts
68
  wp_enqueue_style( 'ditty-news-ticker', plugins_url('ditty-news-ticker/inc/static/css/style.css'), false, filemtime(MTPHR_DNT_DIR.'inc/static/css/style.css') );
69
 
70
- wp_enqueue_script( 'ditty-news-ticker', plugins_url('ditty-news-ticker/inc/static/js/ditty-news-ticker.min.js'), array('jquery', 'imagesLoaded', 'touchSwipe', 'jquery-easing'), filemtime(MTPHR_DNT_DIR.'inc/static/js/ditty-news-ticker.min.js'), true );
 
71
  wp_localize_script( 'ditty-news-ticker', 'mtphr_dnt_vars', array(
72
  'is_rtl' => is_rtl(),
73
  )
67
  // Register the Ditty News Ticker scripts
68
  wp_enqueue_style( 'ditty-news-ticker', plugins_url('ditty-news-ticker/inc/static/css/style.css'), false, filemtime(MTPHR_DNT_DIR.'inc/static/css/style.css') );
69
 
70
+ //wp_enqueue_script( 'ditty-news-ticker', plugins_url('ditty-news-ticker/inc/static/js/ditty-news-ticker.min.js'), array('jquery', 'imagesLoaded', 'touchSwipe', 'jquery-easing'), filemtime(MTPHR_DNT_DIR.'inc/static/js/ditty-news-ticker.min.js'), true );
71
+ wp_enqueue_script( 'ditty-news-ticker', plugins_url('ditty-news-ticker/inc/static/js/ditty-news-ticker.min.js'), array('jquery', 'imagesLoaded', 'touchSwipe', 'jquery-easing'), time(), true );
72
  wp_localize_script( 'ditty-news-ticker', 'mtphr_dnt_vars', array(
73
  'is_rtl' => is_rtl(),
74
  )
inc/static/css/style.css CHANGED
@@ -21,7 +21,8 @@
21
  padding-left: 5px; }
22
 
23
  .mtphr-dnt-tick-container {
24
- position: relative; }
 
25
 
26
  .mtphr-dnt-tick-contents {
27
  position: relative;
@@ -140,8 +141,10 @@
140
  font-size: 30px;
141
  color: #FFF;
142
  margin: -15px 0 0 -15px;
143
- -webkit-animation: mtphr-dnt-spinner-rotation .8s infinite linear;
144
- animation: mtphr-dnt-spinner-rotation .8s infinite linear; }
 
 
145
 
146
  @-webkit-keyframes mtphr-dnt-spinner-rotation {
147
  from {
@@ -149,13 +152,23 @@
149
  to {
150
  -webkit-transform: rotate(359deg); } }
151
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  @keyframes mtphr-dnt-spinner-rotation {
153
  from {
154
- -webkit-transform: rotate(0deg);
155
- transform: rotate(0deg); }
156
  to {
157
- -webkit-transform: rotate(359deg);
158
- transform: rotate(359deg); } }
159
 
160
  /* --------------------------------------------------------- */
161
  /* !Images */
@@ -172,10 +185,12 @@
172
  margin-top: 0; }
173
  .mtphr-dnt-image-container > *:last-child {
174
  margin-bottom: 0; }
175
- .mtphr-dnt-image-container.mtphr-dnt-image-caption-top .mtphr-dnt-image-photo, .mtphr-dnt-image-container.mtphr-dnt-image-caption-bottom .mtphr-dnt-image-photo {
 
176
  margin-top: 0;
177
  margin-bottom: 0; }
178
- .mtphr-dnt-image-container.mtphr-dnt-image-caption-top .mtphr-dnt-image-caption, .mtphr-dnt-image-container.mtphr-dnt-image-caption-bottom .mtphr-dnt-image-caption {
 
179
  position: absolute;
180
  left: 0;
181
  bottom: 0;
@@ -193,8 +208,8 @@
193
  display: block; }
194
  .mtphr-dnt-image-container.mtphr-dnt-image-caption-hover .mtphr-dnt-image-caption {
195
  opacity: 0;
196
- -webkit-transition: opacity .25s ease;
197
- transition: opacity .25s ease; }
198
  .mtphr-dnt-image-container.mtphr-dnt-image-caption-hover:hover .mtphr-dnt-image-caption {
199
  opacity: 1; }
200
  .mtphr-dnt-image-container .mtphr-dnt-image-photo {
@@ -253,8 +268,10 @@
253
 
254
  .mtphr-dnt-nav-hide {
255
  opacity: 0;
256
- -webkit-transition: opacity .3s linear;
257
- transition: opacity .3s linear; }
 
 
258
 
259
  .mtphr-dnt-tick-container:hover .mtphr-dnt-nav-hide {
260
  opacity: 1; }
@@ -306,9 +323,9 @@
306
  outline: none;
307
  text-decoration: none; }
308
  .mtphr-dnt-play-pause.paused i.mtphr-dnt-icon-play {
309
- display: none; }
310
- .mtphr-dnt-play-pause.paused i.mtphr-dnt-icon-pause {
311
  display: inline-block; }
 
 
312
  .mtphr-dnt-play-pause i {
313
  display: inline-block;
314
  box-sizing: border-box;
@@ -321,13 +338,12 @@
321
  background-color: #333;
322
  border-radius: 20px;
323
  opacity: .8;
324
- -webkit-transition: opacity .25s ease;
325
- transition: opacity .25s ease; }
326
  .mtphr-dnt-play-pause i:before {
327
  vertical-align: middle; }
328
  .mtphr-dnt-play-pause i.mtphr-dnt-icon-play {
329
- padding-left: 4px; }
330
- .mtphr-dnt-play-pause i.mtphr-dnt-icon-pause {
331
  display: none; }
332
 
333
  /* --------------------------------------------------------- */
@@ -344,13 +360,17 @@
344
  color: #666;
345
  background: #FFF;
346
  padding: 6px 8px 4px 7px;
 
 
347
  border-radius: 5px;
348
  filter: alpha(opacity=50);
349
  -moz-opacity: .5;
350
  -khtml-opacity: .5;
351
  opacity: .5;
352
- -webkit-transition: opacity .2s linear;
353
- transition: opacity .2s linear; }
 
 
354
 
355
  .mtphr-dnt-edit-link:hover {
356
  color: #666;
21
  padding-left: 5px; }
22
 
23
  .mtphr-dnt-tick-container {
24
+ position: relative;
25
+ overflow: hidden; }
26
 
27
  .mtphr-dnt-tick-contents {
28
  position: relative;
141
  font-size: 30px;
142
  color: #FFF;
143
  margin: -15px 0 0 -15px;
144
+ -webkit-animation: mtphr-dnt-spinner-rotation 0.8s infinite linear;
145
+ -moz-animation: mtphr-dnt-spinner-rotation 0.8s infinite linear;
146
+ -o-animation: mtphr-dnt-spinner-rotation 0.8s infinite linear;
147
+ animation: mtphr-dnt-spinner-rotation 0.8s infinite linear; }
148
 
149
  @-webkit-keyframes mtphr-dnt-spinner-rotation {
150
  from {
152
  to {
153
  -webkit-transform: rotate(359deg); } }
154
 
155
+ @-moz-keyframes mtphr-dnt-spinner-rotation {
156
+ from {
157
+ -moz-transform: rotate(0deg); }
158
+ to {
159
+ -moz-transform: rotate(359deg); } }
160
+
161
+ @-o-keyframes mtphr-dnt-spinner-rotation {
162
+ from {
163
+ -o-transform: rotate(0deg); }
164
+ to {
165
+ -o-transform: rotate(359deg); } }
166
+
167
  @keyframes mtphr-dnt-spinner-rotation {
168
  from {
169
+ transform: rotate(0deg); }
 
170
  to {
171
+ transform: rotate(359deg); } }
 
172
 
173
  /* --------------------------------------------------------- */
174
  /* !Images */
185
  margin-top: 0; }
186
  .mtphr-dnt-image-container > *:last-child {
187
  margin-bottom: 0; }
188
+ .mtphr-dnt-image-container.mtphr-dnt-image-caption-top .mtphr-dnt-image-photo,
189
+ .mtphr-dnt-image-container.mtphr-dnt-image-caption-bottom .mtphr-dnt-image-photo {
190
  margin-top: 0;
191
  margin-bottom: 0; }
192
+ .mtphr-dnt-image-container.mtphr-dnt-image-caption-top .mtphr-dnt-image-caption,
193
+ .mtphr-dnt-image-container.mtphr-dnt-image-caption-bottom .mtphr-dnt-image-caption {
194
  position: absolute;
195
  left: 0;
196
  bottom: 0;
208
  display: block; }
209
  .mtphr-dnt-image-container.mtphr-dnt-image-caption-hover .mtphr-dnt-image-caption {
210
  opacity: 0;
211
+ -webkit-transition: opacity 0.25s ease;
212
+ transition: opacity 0.25s ease; }
213
  .mtphr-dnt-image-container.mtphr-dnt-image-caption-hover:hover .mtphr-dnt-image-caption {
214
  opacity: 1; }
215
  .mtphr-dnt-image-container .mtphr-dnt-image-photo {
268
 
269
  .mtphr-dnt-nav-hide {
270
  opacity: 0;
271
+ -webkit-transition: opacity 0.3s linear;
272
+ -moz-transition: opacity 0.3s linear;
273
+ -o-transition: opacity 0.3s linear;
274
+ transition: opacity 0.3s linear; }
275
 
276
  .mtphr-dnt-tick-container:hover .mtphr-dnt-nav-hide {
277
  opacity: 1; }
323
  outline: none;
324
  text-decoration: none; }
325
  .mtphr-dnt-play-pause.paused i.mtphr-dnt-icon-play {
 
 
326
  display: inline-block; }
327
+ .mtphr-dnt-play-pause.paused i.mtphr-dnt-icon-pause {
328
+ display: none; }
329
  .mtphr-dnt-play-pause i {
330
  display: inline-block;
331
  box-sizing: border-box;
338
  background-color: #333;
339
  border-radius: 20px;
340
  opacity: .8;
341
+ -webkit-transition: opacity 0.25s ease;
342
+ transition: opacity 0.25s ease; }
343
  .mtphr-dnt-play-pause i:before {
344
  vertical-align: middle; }
345
  .mtphr-dnt-play-pause i.mtphr-dnt-icon-play {
346
+ padding-left: 4px;
 
347
  display: none; }
348
 
349
  /* --------------------------------------------------------- */
360
  color: #666;
361
  background: #FFF;
362
  padding: 6px 8px 4px 7px;
363
+ -webkit-border-radius: 5px;
364
+ -moz-border-radius: 5px;
365
  border-radius: 5px;
366
  filter: alpha(opacity=50);
367
  -moz-opacity: .5;
368
  -khtml-opacity: .5;
369
  opacity: .5;
370
+ -webkit-transition: opacity 0.2s linear;
371
+ -moz-transition: opacity 0.2s linear;
372
+ -o-transition: opacity 0.2s linear;
373
+ transition: opacity 0.2s linear; }
374
 
375
  .mtphr-dnt-edit-link:hover {
376
  color: #666;
inc/static/js/ditty-news-ticker.js CHANGED
@@ -3,7 +3,7 @@
3
  * Date: 10/06/2014
4
  *
5
  * @author Metaphor Creations
6
- * @version 1.4.12
7
  *
8
  **/
9
 
@@ -122,8 +122,8 @@
122
  $ticker.find('.mtphr-dnt-tick').each( function() {
123
 
124
  // Find the greatest tick height
125
- if( $(this).height() > ticker_height ) {
126
- ticker_height = $(this).height();
127
  }
128
 
129
  if( settings.scroll_direction === 'up' || settings.scroll_direction === 'down' ) {
@@ -143,6 +143,12 @@
143
  var style_array = style.split('width:');
144
  ticker_scroll_resize = (style_array.length > 1) ? false : true;
145
  }
 
 
 
 
 
 
146
 
147
  // Reset the ticks
148
  ticks = [];
@@ -240,7 +246,7 @@
240
 
241
  pos = (settings.scroll_direction === 'left') ? mtphr_dnt_scroll_left(i) : mtphr_dnt_scroll_right(i);
242
  if( pos === 'reset' ) {
243
- pos = ticks[i][0].reset;
244
  ticks[i][0].headline.css('opacity', 0);
245
  ticks[i][0].headline.stop(true,true).css('left',pos+'px');
246
  } else {
@@ -253,7 +259,7 @@
253
 
254
  pos = (settings.scroll_direction === 'up') ? mtphr_dnt_scroll_up(i) : mtphr_dnt_scroll_down(i);
255
  if( pos === 'reset' ) {
256
- pos = ticks[i][0].reset;
257
  ticks[i][0].headline.css('opacity', 0);
258
  ticks[i][0].headline.stop(true,true).css('top',pos+'px');
259
  } else {
@@ -281,9 +287,9 @@
281
  var pos = parseFloat(ticks[i][0].position - settings.scroll_speed);
282
 
283
  // Reset the tick if off the screen
284
- if( pos < -(ticks[i][0].headline.width()+settings.offset) ) {
285
  pos = mtphr_dnt_scroll_check_current(i);
286
- } else if( pos < parseFloat(ticker_width-ticks[i][0].headline.width()-settings.scroll_spacing) ) {
287
  mtphr_dnt_scroll_check_next(i);
288
  }
289
 
@@ -301,7 +307,7 @@
301
  var pos = ticks[i][0].position + settings.scroll_speed;
302
 
303
  // Reset the tick if off the screen
304
- if( pos > ticker_width+settings.offset ) {
305
  pos = mtphr_dnt_scroll_check_current(i);
306
  } else if( pos > settings.scroll_spacing ) {
307
  mtphr_dnt_scroll_check_next(i);
@@ -321,9 +327,9 @@
321
  var pos = ticks[i][0].position - settings.scroll_speed;
322
 
323
  // Reset the tick if off the screen
324
- if( pos < -(ticks[i][0].headline.height()+settings.offset) ) {
325
  pos = mtphr_dnt_scroll_check_current(i);
326
- } else if( pos < ticker_height-ticks[i][0].headline.height()-settings.scroll_spacing ) {
327
  mtphr_dnt_scroll_check_next(i);
328
  }
329
 
@@ -341,7 +347,7 @@
341
  var pos = ticks[i][0].position + settings.scroll_speed;
342
 
343
  // Reset the tick if off the screen
344
- if( pos > ticker_height+settings.offset ) {
345
  pos = mtphr_dnt_scroll_check_current(i);
346
  } else if( pos > settings.scroll_spacing ) {
347
  mtphr_dnt_scroll_check_next(i);
@@ -403,6 +409,46 @@
403
  ticks[(i+1)][0].visible = true;
404
  }
405
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
 
407
  /**
408
  * Resize the scroll ticks
@@ -420,14 +466,14 @@
420
 
421
  switch( settings.scroll_direction ) {
422
  case 'left':
423
- position = ticker_width+settings.offset;
424
  if( ticks[i][0].visible === false ) {
425
  $tick.css('left',position+'px');
426
  }
427
  break;
428
 
429
  case 'right':
430
- position = parseInt('-'+($tick.width()+settings.offset));
431
  if( ticks[i][0].visible === false ) {
432
  $tick.css('left',position+'px');
433
  }
@@ -437,7 +483,7 @@
437
  if( ticker_scroll_resize ) {
438
  $tick.css('width',ticker_width);
439
  }
440
- position = parseInt(ticker_height+settings.offset);
441
  if( ticks[i][0].visible === false ) {
442
  $tick.css('top',position+'px');
443
  }
@@ -447,7 +493,7 @@
447
  if( ticker_scroll_resize ) {
448
  $tick.css('width',ticker_width);
449
  }
450
- position = parseInt('-'+($tick.height()+settings.offset));
451
  if( ticks[i][0].visible === false ) {
452
  $tick.css('top',position+'px');
453
  }
@@ -455,8 +501,8 @@
455
  }
456
 
457
  // Adjust the tick data
458
- ticks[i][0].width = $tick.width();
459
- ticks[i][0].height = $tick.height();
460
  if( ticks[i][0].visible === false ) {
461
  ticks[i][0].position = position;
462
  }
@@ -473,6 +519,9 @@
473
 
474
  var position,
475
  $tick;
 
 
 
476
 
477
  for( var i=0; i<vars.tick_count; i++ ) {
478
 
@@ -482,16 +531,16 @@
482
 
483
  switch( settings.scroll_direction ) {
484
  case 'left':
485
- position = ticker_width+settings.offset;
486
  $tick.stop(true,true).css('left',position+'px');
487
  break;
488
 
489
  case 'right':
490
  //console.log(settings.offset);
491
- position = parseInt('-'+($tick.width()+settings.offset));
492
  /*
493
  if( mtphr_dnt_vars.is_rtl ) {
494
- position = parseInt('-'+($tick.width()+(ticker_width/2)));
495
  }
496
  */
497
  $tick.stop(true,true).css('left',position+'px');
@@ -501,7 +550,7 @@
501
  if( ticker_scroll_resize ) {
502
  $tick.css('width',ticker_width);
503
  }
504
- position = parseInt(ticker_height+settings.offset);
505
  $tick.stop(true,true).css('top',position+'px');
506
  break;
507
 
@@ -509,13 +558,13 @@
509
  if( ticker_scroll_resize ) {
510
  $tick.css('width',ticker_width);
511
  }
512
- position = parseInt('-'+($tick.height()+settings.offset));
513
  $tick.stop(true,true).css('top',position+'px');
514
  break;
515
  }
516
 
517
- ticks[i][0].width = $tick.width();
518
- ticks[i][0].height = $tick.height();
519
  ticks[i][0].position = position;
520
  ticks[i][0].reset = position;
521
  ticks[i][0].visible = false;
@@ -1447,13 +1496,13 @@
1447
 
1448
  });
1449
 
1450
- if( $container.width() === 0 ) {
1451
 
1452
  var mtphr_dnt_init_timer = setInterval( function() {
1453
 
1454
- if( $container.width() > 10 ) {
1455
  clearInterval(mtphr_dnt_init_timer);
1456
- ticker_width = $ticker.outerWidth(true);
1457
  mtphr_dnt_init();
1458
  }
1459
 
3
  * Date: 10/06/2014
4
  *
5
  * @author Metaphor Creations
6
+ * @version 2.2.15
7
  *
8
  **/
9
 
122
  $ticker.find('.mtphr-dnt-tick').each( function() {
123
 
124
  // Find the greatest tick height
125
+ if( $(this).outerHeight() > ticker_height ) {
126
+ ticker_height = $(this).outerHeight();
127
  }
128
 
129
  if( settings.scroll_direction === 'up' || settings.scroll_direction === 'down' ) {
143
  var style_array = style.split('width:');
144
  ticker_scroll_resize = (style_array.length > 1) ? false : true;
145
  }
146
+
147
+ // Set the offset
148
+ $ticker.css({
149
+ marginLeft: '-' + settings.offset + 'px',
150
+ width: 'calc( 100% + ' + parseFloat(settings.offset * 2) + 'px )',
151
+ });
152
 
153
  // Reset the ticks
154
  ticks = [];
246
 
247
  pos = (settings.scroll_direction === 'left') ? mtphr_dnt_scroll_left(i) : mtphr_dnt_scroll_right(i);
248
  if( pos === 'reset' ) {
249
+ pos = mtphr_dnt_scroll_reset_tick( i );
250
  ticks[i][0].headline.css('opacity', 0);
251
  ticks[i][0].headline.stop(true,true).css('left',pos+'px');
252
  } else {
259
 
260
  pos = (settings.scroll_direction === 'up') ? mtphr_dnt_scroll_up(i) : mtphr_dnt_scroll_down(i);
261
  if( pos === 'reset' ) {
262
+ pos = mtphr_dnt_scroll_reset_tick( i );
263
  ticks[i][0].headline.css('opacity', 0);
264
  ticks[i][0].headline.stop(true,true).css('top',pos+'px');
265
  } else {
287
  var pos = parseFloat(ticks[i][0].position - settings.scroll_speed);
288
 
289
  // Reset the tick if off the screen
290
+ if( pos < -(ticks[i][0].headline.outerWidth()) ) {
291
  pos = mtphr_dnt_scroll_check_current(i);
292
+ } else if( pos < parseFloat(ticker_width-ticks[i][0].headline.outerWidth()-settings.scroll_spacing) ) {
293
  mtphr_dnt_scroll_check_next(i);
294
  }
295
 
307
  var pos = ticks[i][0].position + settings.scroll_speed;
308
 
309
  // Reset the tick if off the screen
310
+ if( pos > ticker_width ) {
311
  pos = mtphr_dnt_scroll_check_current(i);
312
  } else if( pos > settings.scroll_spacing ) {
313
  mtphr_dnt_scroll_check_next(i);
327
  var pos = ticks[i][0].position - settings.scroll_speed;
328
 
329
  // Reset the tick if off the screen
330
+ if( pos < -(ticks[i][0].headline.outerHeight() ) ) {
331
  pos = mtphr_dnt_scroll_check_current(i);
332
+ } else if( pos < ticker_height-ticks[i][0].headline.outerHeight()-settings.scroll_spacing ) {
333
  mtphr_dnt_scroll_check_next(i);
334
  }
335
 
347
  var pos = ticks[i][0].position + settings.scroll_speed;
348
 
349
  // Reset the tick if off the screen
350
+ if( pos > ticker_height ) {
351
  pos = mtphr_dnt_scroll_check_current(i);
352
  } else if( pos > settings.scroll_spacing ) {
353
  mtphr_dnt_scroll_check_next(i);
409
  ticks[(i+1)][0].visible = true;
410
  }
411
  }
412
+
413
+ /**
414
+ * Reset a tick
415
+ *
416
+ * @since 1.1.0
417
+ */
418
+ function mtphr_dnt_scroll_reset_tick( i ) {
419
+
420
+ ticker_width = $ticker.outerWidth();
421
+ ticker_height = $ticker.outerHeight();
422
+
423
+ // Set the tick position
424
+ var position;
425
+
426
+ var $tick = ticks[i][0].headline;
427
+
428
+ switch( settings.scroll_direction ) {
429
+ case 'left':
430
+ position = ticker_width;
431
+ break;
432
+
433
+ case 'right':
434
+ position = parseFloat('-'+($tick.outerWidth()));
435
+ break;
436
+
437
+ case 'up':
438
+ position = parseFloat(ticker_height);
439
+ break;
440
+
441
+ case 'down':
442
+ position = parseFloat('-'+($tick.outerHeight()));
443
+ break;
444
+ }
445
+
446
+ ticks[i][0].width = $tick.outerWidth();
447
+ ticks[i][0].height = $tick.outerHeight();
448
+ ticks[i][0].reset = position;
449
+ ticks[i][0].position = position;
450
+ return position;
451
+ }
452
 
453
  /**
454
  * Resize the scroll ticks
466
 
467
  switch( settings.scroll_direction ) {
468
  case 'left':
469
+ position = ticker_width;
470
  if( ticks[i][0].visible === false ) {
471
  $tick.css('left',position+'px');
472
  }
473
  break;
474
 
475
  case 'right':
476
+ position = parseFloat('-'+($tick.outerWidth()));
477
  if( ticks[i][0].visible === false ) {
478
  $tick.css('left',position+'px');
479
  }
483
  if( ticker_scroll_resize ) {
484
  $tick.css('width',ticker_width);
485
  }
486
+ position = parseFloat(ticker_height);
487
  if( ticks[i][0].visible === false ) {
488
  $tick.css('top',position+'px');
489
  }
493
  if( ticker_scroll_resize ) {
494
  $tick.css('width',ticker_width);
495
  }
496
+ position = parseFloat('-'+($tick.outerHeight()));
497
  if( ticks[i][0].visible === false ) {
498
  $tick.css('top',position+'px');
499
  }
501
  }
502
 
503
  // Adjust the tick data
504
+ ticks[i][0].width = $tick.outerWidth();
505
+ ticks[i][0].height = $tick.outerHeight();
506
  if( ticks[i][0].visible === false ) {
507
  ticks[i][0].position = position;
508
  }
519
 
520
  var position,
521
  $tick;
522
+
523
+ ticker_width = $ticker.outerWidth(true);
524
+ ticker_height = $ticker.outerHeight(true);
525
 
526
  for( var i=0; i<vars.tick_count; i++ ) {
527
 
531
 
532
  switch( settings.scroll_direction ) {
533
  case 'left':
534
+ position = ticker_width;
535
  $tick.stop(true,true).css('left',position+'px');
536
  break;
537
 
538
  case 'right':
539
  //console.log(settings.offset);
540
+ position = parseFloat('-'+($tick.outerWidth()));
541
  /*
542
  if( mtphr_dnt_vars.is_rtl ) {
543
+ position = parseFloat('-'+($tick.outerWidth()+(ticker_width/2)));
544
  }
545
  */
546
  $tick.stop(true,true).css('left',position+'px');
550
  if( ticker_scroll_resize ) {
551
  $tick.css('width',ticker_width);
552
  }
553
+ position = parseFloat(ticker_height);
554
  $tick.stop(true,true).css('top',position+'px');
555
  break;
556
 
558
  if( ticker_scroll_resize ) {
559
  $tick.css('width',ticker_width);
560
  }
561
+ position = parseFloat('-'+($tick.outerHeight()));
562
  $tick.stop(true,true).css('top',position+'px');
563
  break;
564
  }
565
 
566
+ ticks[i][0].width = $tick.outerWidth();
567
+ ticks[i][0].height = $tick.outerHeight();
568
  ticks[i][0].position = position;
569
  ticks[i][0].reset = position;
570
  ticks[i][0].visible = false;
1496
 
1497
  });
1498
 
1499
+ if( $container.outerWidth() === 0 ) {
1500
 
1501
  var mtphr_dnt_init_timer = setInterval( function() {
1502
 
1503
+ if( $container.outerWidth() > 10 ) {
1504
  clearInterval(mtphr_dnt_init_timer);
1505
+ ticker_width = $ticker.outerWidth();
1506
  mtphr_dnt_init();
1507
  }
1508
 
inc/static/js/ditty-news-ticker.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={init:function(e){return this.each((function(){function i(){N.tick_count=S.find(".mtphr-dnt-tick").length,N.tick_count>0&&("scroll"===K.type?r():"rotate"===K.type&&y()),K.after_load.call(P,S),P.trigger("mtphr_dnt_after_load_single",[N,tt]),t("body").trigger("mtphr_dnt_after_load",[P,N,tt])}function n(){S.find(".mtphr-dnt-tick").each((function(){t(this).height()>$&&($=t(this).height()),"up"!==K.scroll_direction&&"down"!==K.scroll_direction||t(this).css("height","auto")})),S.css("height",$+"px")}function r(){var e=S.find(".mtphr-dnt-tick:first");if(e.attr("style")){var i,r=e.attr("style").split("width:");it=!(r.length>1)}tt=[],S.find("img").length?S.imagesLoaded((function(){n(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];tt.push(e)})),g(),a()})):(n(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];tt.push(e)})),g(),a()),S.hover((function(){K.scroll_pause&&s()}),(function(){K.scroll_pause&&!N.paused&&o()}))}function s(){clearInterval(et)}function o(){a()}function a(){clearInterval(et),et=setInterval((function(){for(var t=0;t<N.tick_count;t++)if(!0===tt[t][0].visible){var e="reset";"left"===K.scroll_direction||"right"===K.scroll_direction?"reset"===(e="left"===K.scroll_direction?c(t):p(t))?(e=tt[t][0].reset,tt[t][0].headline.css("opacity",0),tt[t][0].headline.stop(!0,!0).css("left",e+"px")):(tt[t][0].headline.css("opacity",1),tt[t][0].headline.stop(!0,!0).animate({left:e+"px"},100,"linear")):"reset"===(e="up"===K.scroll_direction?l(t):_(t))?(e=tt[t][0].reset,tt[t][0].headline.css("opacity",0),tt[t][0].headline.stop(!0,!0).css("top",e+"px")):(tt[t][0].headline.css("opacity",1),tt[t][0].headline.stop(!0,!0).animate({top:e+"px"},100,"linear")),tt[t][0].position=e}}),100)}function c(t){var e=parseFloat(tt[t][0].position-K.scroll_speed);return e<-(tt[t][0].headline.width()+K.offset)?e=d(t):e<parseFloat(Z-tt[t][0].headline.width()-K.scroll_spacing)&&u(t),e}function p(t){var e=tt[t][0].position+K.scroll_speed;return e>Z+K.offset?e=d(t):e>K.scroll_spacing&&u(t),e}function l(t){var e=tt[t][0].position-K.scroll_speed;return e<-(tt[t][0].headline.height()+K.offset)?e=d(t):e<$-tt[t][0].headline.height()-K.scroll_spacing&&u(t),e}function _(t){var e=tt[t][0].position+K.scroll_speed;return e>$+K.offset?e=d(t):e>K.scroll_spacing&&u(t),e}function d(e){return N.tick_count>1&&(tt[e][0].visible=!1),N.tick_count===e+1&&(P.trigger("mtphr_dnt_scroll_complete",[N,tt]),t("body").trigger("mtphr_dnt_scroll_complete",[P,N,tt])),"reset"}function f(t){!1===tt[t][0].visible&&(N.previous_tick=parseInt(t-1),N.previous_tick<0&&(N.previous_tick=parseInt(N.tick_count-1)),N.current_tick=t,N.next_tick=parseInt(t+1),N.next_tick>=N.tick_count&&(N.next_tick=0))}function u(t){t===N.tick_count-1?K.scroll_loop&&(f(0),tt[0][0].visible=!0):(f(parseInt(t+1)),tt[t+1][0].visible=!0)}function h(){for(var t=0;t<N.tick_count;t++){var e,i=tt[t][0].headline;switch(K.scroll_direction){case"left":e=Z+K.offset,!1===tt[t][0].visible&&i.css("left",e+"px");break;case"right":e=parseInt("-"+(i.width()+K.offset)),!1===tt[t][0].visible&&i.css("left",e+"px");break;case"up":it&&i.css("width",Z),e=parseInt($+K.offset),!1===tt[t][0].visible&&i.css("top",e+"px");break;case"down":it&&i.css("width",Z),e=parseInt("-"+(i.height()+K.offset)),!1===tt[t][0].visible&&i.css("top",e+"px");break}tt[t][0].width=i.width(),tt[t][0].height=i.height(),!1===tt[t][0].visible&&(tt[t][0].position=e),tt[t][0].reset=e}}function g(){for(var t,e,i=0;i<N.tick_count;i++)if(tt[i]){switch(e=tt[i][0].headline,K.scroll_direction){case"left":t=Z+K.offset,e.stop(!0,!0).css("left",t+"px");break;case"right":t=parseInt("-"+(e.width()+K.offset)),e.stop(!0,!0).css("left",t+"px");break;case"up":it&&e.css("width",Z),t=parseInt($+K.offset),e.stop(!0,!0).css("top",t+"px");break;case"down":it&&e.css("width",Z),t=parseInt("-"+(e.height()+K.offset)),e.stop(!0,!0).css("top",t+"px");break}tt[i][0].width=e.width(),tt[i][0].height=e.height(),tt[i][0].position=t,tt[i][0].reset=t,tt[i][0].visible=!1}if(N.current_tick=0,tt[N.current_tick][0].visible=!0,K.scroll_init)for("left"===K.scroll_direction?t=.1*Z:"right"===K.scroll_direction?t=.9*Z:"up"===K.scroll_direction?t=.1*$:"down"===K.scroll_direction&&(t=.9*$),i=0;i<N.tick_count;i++)switch(e=tt[i][0].headline,K.scroll_direction){case"left":t<Z&&(e.stop(!0,!0).css("left",t+"px"),tt[i][0].position=t,tt[i][0].visible=!0,t=t+tt[i][0].width+K.scroll_spacing);break;case"right":t>0&&(t-=tt[i][0].width,e.stop(!0,!0).css("left",t+"px"),tt[i][0].position=t,tt[i][0].visible=!0,t-=K.scroll_spacing);break;case"up":t<$&&(e.stop(!0,!0).css("top",t+"px"),tt[i][0].position=t,tt[i][0].visible=!0,t=t+tt[i][0].height+K.scroll_spacing);break;case"down":t>0&&(t-=tt[i][0].height,e.stop(!0,!0).css("top",t+"px"),tt[i][0].position=t,tt[i][0].visible=!0,t-=K.scroll_spacing);break}}function v(){m()}function k(){clearInterval(nt)}function y(){switch(S.find(".mtphr-dnt-tick").each((function(){tt.push(t(this)),t(this).imagesLoaded((function(){F()}))})),F(),S.find(".mtphr-dnt-tick").show(),K.rotate_type){case"fade":C(S,tt,parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_left":z(S,tt,parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_right":T(S,tt,parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_down":A(S,tt,parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_up":R(S,tt,parseInt(100*K.rotate_speed),K.rotate_ease);break}w(0),K.auto_rotate&&v(),S.hover((function(){K.auto_rotate&&K.rotate_pause&&!N.running&&k()}),(function(){K.auto_rotate&&K.rotate_pause&&!N.running&&!N.paused&&v()}))}function m(){k(),nt=setInterval((function(){var t=parseInt(N.current_tick+1);t===N.tick_count&&(t=0),b(t)}),parseInt(1e3*K.rotate_delay))}function b(e){N.current_tick!==e&&(K.auto_rotate&&k(),N.next_tick=e,K.before_change.call(P,S),P.trigger("mtphr_dnt_before_change_single",[N,tt]),t("body").trigger("mtphr_dnt_before_change",[P,N,tt]),N.running=1,I(e),x(e),N.previous_tick=N.current_tick,N.current_tick=e,st=setTimeout((function(){K.after_change.call(P,S),P.trigger("mtphr_dnt_after_change_single",[N,tt]),t("body").trigger("mtphr_dnt_after_change",[P,N,tt]),rt=K.rotate_type,N.reverse=0,N.running=0,K.auto_rotate&&!N.paused&&m()}),parseInt(100*K.rotate_speed)))}function w(t){X&&(X.children("a").removeClass("active"),X.children('a[href="'+t+'"]').addClass("active"))}function x(e){switch(w(e),rt){case"fade":D(S,t(tt[e]),t(tt[N.current_tick]),parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_left":L(S,t(tt[e]),t(tt[N.current_tick]),parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_right":j(S,t(tt[e]),t(tt[N.current_tick]),parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_down":M(S,t(tt[e]),t(tt[N.current_tick]),parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_up":q(S,t(tt[e]),t(tt[N.current_tick]),parseInt(100*K.rotate_speed),K.rotate_ease);break}}function I(e){switch(rt){case"fade":W(S,t(tt[N.current_tick]),t(tt[e]),parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_left":O(S,t(tt[N.current_tick]),t(tt[e]),parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_right":E(S,t(tt[N.current_tick]),t(tt[e]),parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_down":Q(S,t(tt[N.current_tick]),t(tt[e]),parseInt(100*K.rotate_speed),K.rotate_ease);break;case"slide_up":B(S,t(tt[N.current_tick]),t(tt[e]),parseInt(100*K.rotate_speed),K.rotate_ease);break}}function F(){for(var e=0;e<N.tick_count;e++)t(tt[e]).width(Z+"px"),N.current_tick!==e&&t(tt[e]).css({left:parseFloat(Z+K.offset)+"px"});var i=t(tt[N.current_tick]).height();S.stop().css("height",i+"px")}function C(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:"auto"})}function D(t,e,i,n,r){e.css({opacity:0,left:"auto"}),e.stop().animate({opacity:1},n,r);var s=e.height();t.stop().animate({height:s+"px"},n,r)}function W(e,i,n,r,s){i.stop().animate({opacity:0},r,s,(function(){t(this).css({left:parseFloat(Z+K.offset)+"px"}),i.remove(),e.append(i)}))}function z(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:0})}function L(t,e,i,n,r){var s=e.height();e.css({opacity:1,left:parseFloat(Z+K.offset)+"px"}),t.stop().animate({height:s+"px"},n,r,(function(){})),e.stop().animate({left:"0"},n,r,(function(){}))}function O(t,e,i,n,r){e.stop().animate({left:"-"+parseFloat(Z+K.offset)+"px"},n,r,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function T(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:0})}function j(t,e,i,n,r){var s=e.height();e.css({opacity:1,left:"-"+parseFloat(Z+K.offset)+"px"}),t.stop().animate({height:s+"px"},n,r,(function(){})),e.stop().animate({left:"0"},n,r)}function E(t,e,i,n,r){e.stop().animate({left:parseFloat(Z+K.offset)+"px"},n,r,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function A(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,top:0,left:"auto"})}function M(t,e,i,n,r){var s=e.height();e.css({opacity:1,top:"-"+parseFloat(s+K.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},n,r),e.stop().animate({top:"0"},n,r)}function Q(t,e,i,n,r){var s=i.height();e.stop().animate({top:parseFloat(s+K.offset)+"px"},n,r,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function R(t,e){var i=e[0],n=i.height();t.css({height:n+"px",left:"auto"}),i.css({opacity:1,top:0})}function q(t,e,i,n,r){var s=e.height();e.css({opacity:1,top:parseFloat(i.height()+K.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},n,r),e.stop().animate({top:"0"},n,r)}function B(t,e,i,n,r){var s=e.height();e.stop().animate({top:"-"+parseFloat(s+K.offset)+"px"},n,r,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function G(){if(N.running)return!1;var t=parseInt(N.current_tick+1);t===N.tick_count&&(t=0),b(t)}function H(){if(N.running)return!1;var t=parseInt(N.current_tick-1);t<0&&(t=N.tick_count-1),K.nav_reverse&&("slide_left"===K.rotate_type?rt="slide_right":"slide_right"===K.rotate_type?rt="slide_left":"slide_down"===K.rotate_type?rt="slide_up":"slide_up"===K.rotate_type&&(rt="slide_down"),N.reverse=1),b(t)}function J(t){t?(N.paused=!1,Y.removeClass("paused"),"scroll"===K.type?o():v()):(N.paused=!0,Y.addClass("paused"),"scroll"===K.type?s():k()),P.trigger("mtphr_dnt_play_pause",[N,tt])}var K={id:"",type:"scroll",scroll_direction:"left",scroll_speed:10,scroll_pause:0,scroll_spacing:40,scroll_units:10,scroll_init:0,scroll_loop:1,rotate_type:"fade",auto_rotate:0,rotate_delay:10,rotate_pause:0,rotate_speed:10,rotate_ease:"easeOutExpo",nav_reverse:0,disable_touchswipe:0,offset:20,before_change:function(){},after_change:function(){},after_load:function(){}},N={id:K.id,tick_count:0,previous_tick:0,current_tick:0,next_tick:0,reverse:0,running:0,paused:0};e&&t.extend(K,e);var P=t(this),S=P.find(".mtphr-dnt-tick-contents"),U=P.find(".mtphr-dnt-nav-prev"),V=P.find(".mtphr-dnt-nav-next"),X=P.find(".mtphr-dnt-control-links"),Y=P.find(".mtphr-dnt-play-pause"),Z=S.outerWidth(!0),$=0,tt=[],et,it=!0,nt,rt=K.rotate_type,st;if(S.data("ditty:vars",N),U&&"rotate"===K.type&&(U.bind("click",(function(t){t.preventDefault(),H()})),V.bind("click",(function(t){t.preventDefault(),G()}))),X&&"rotate"===K.type&&X.children("a").bind("click",(function(e){e.preventDefault();var i=parseInt(t(this).attr("href"));if(N.running)return!1;if(i===N.current_tick)return!1;var n=i<N.current_tick?1:0;K.nav_reverse&&n&&("slide_left"===K.rotate_type?rt="slide_right":"slide_right"===K.rotate_type?rt="slide_left":"slide_down"===K.rotate_type?rt="slide_up":"slide_up"===K.rotate_type&&(rt="slide_down"),N.reverse=1),b(i)})),Y.bind("click",(function(t){t.preventDefault(),J(N.paused)})),"rotate"!==K.type||K.disable_touchswipe||S.swipe({triggerOnTouchEnd:!0,swipeLeft:function(){if(N.running)return!1;var t=parseInt(N.current_tick+1);t===N.tick_count&&(t=0),"slide_left"!==K.rotate_type&&"slide_right"!==K.rotate_type||(rt="slide_left"),b(t)},swipeRight:function(){if(N.running)return!1;var t=parseInt(N.current_tick-1);t<0&&(t=N.tick_count-1),"slide_left"!==K.rotate_type&&"slide_right"!==K.rotate_type||(rt="slide_right"),K.nav_reverse&&("slide_down"===K.rotate_type?rt="slide_up":"slide_up"===K.rotate_type&&(rt="slide_down"),N.reverse=1),b(t)}}),P.on("mtphr_dnt_next",(function(){G()})),P.on("mtphr_dnt_prev",(function(){H()})),P.on("mtphr_dnt_goto",(function(t,e){b(parseInt(e))})),P.on("mtphr_dnt_pause",(function(){J()})),P.on("mtphr_dnt_play",(function(){J(!0)})),t(window).resize((function(){S.outerWidth()!==Z&&(Z=S.outerWidth(!0),"scroll"===K.type?("up"===K.scroll_direction||"down"===K.scroll_direction)&&it?g():h():"rotate"===K.type&&F())})),P.on("mtphr_dnt_resize_single",(function(){"scroll"===K.type?h():"rotate"===K.type&&F()})),t("body").on("mtphr_dnt_resize",(function(t,e){e&&e.indexOf(K.id)>=0&&("scroll"===K.type?h():"rotate"===K.type&&F())})),P.on("mtphr_dnt_replace_ticks",(function(e,n,r){clearInterval(et),P.find(".mtphr-dnt-tick").remove(),n.each((function(){S.append(t(this))})),setTimeout((function(){i()}),r)})),0===P.width())var ot=setInterval((function(){P.width()>10&&(clearInterval(ot),Z=S.outerWidth(!0),i())}),100);else i()}))}};t.fn.ditty_news_ticker=function(i){return e[i]?e[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?void t.error("Method "+i+" does not exist in ditty_news_ticker"):e.init.apply(this,arguments)}}(jQuery);
1
+ !function(t){var e={init:function(e){return this.each((function(){function i(){P.tick_count=U.find(".mtphr-dnt-tick").length,P.tick_count>0&&("scroll"===N.type?n():"rotate"===N.type&&b()),N.after_load.call(S,U),S.trigger("mtphr_dnt_after_load_single",[P,et]),t("body").trigger("mtphr_dnt_after_load",[S,P,et])}function r(){U.find(".mtphr-dnt-tick").each((function(){t(this).outerHeight()>tt&&(tt=t(this).outerHeight()),"up"!==N.scroll_direction&&"down"!==N.scroll_direction||t(this).css("height","auto")})),U.css("height",tt+"px")}function n(){var e=U.find(".mtphr-dnt-tick:first");if(e.attr("style")){var i,n=e.attr("style").split("width:");rt=!(n.length>1)}U.css({marginLeft:"-"+N.offset+"px",width:"calc( 100% + "+parseFloat(2*N.offset)+"px )"}),et=[],U.find("img").length?U.imagesLoaded((function(){r(),U.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];et.push(e)})),v(),a()})):(r(),U.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];et.push(e)})),v(),a()),U.hover((function(){N.scroll_pause&&o()}),(function(){N.scroll_pause&&!P.paused&&s()}))}function o(){clearInterval(it)}function s(){a()}function a(){clearInterval(it),it=setInterval((function(){for(var t=0;t<P.tick_count;t++)if(!0===et[t][0].visible){var e="reset";"left"===N.scroll_direction||"right"===N.scroll_direction?"reset"===(e="left"===N.scroll_direction?c(t):p(t))?(e=f(t),et[t][0].headline.css("opacity",0),et[t][0].headline.stop(!0,!0).css("left",e+"px")):(et[t][0].headline.css("opacity",1),et[t][0].headline.stop(!0,!0).animate({left:e+"px"},100,"linear")):"reset"===(e="up"===N.scroll_direction?l(t):_(t))?(e=f(t),et[t][0].headline.css("opacity",0),et[t][0].headline.stop(!0,!0).css("top",e+"px")):(et[t][0].headline.css("opacity",1),et[t][0].headline.stop(!0,!0).animate({top:e+"px"},100,"linear")),et[t][0].position=e}}),100)}function c(t){var e=parseFloat(et[t][0].position-N.scroll_speed);return e<-et[t][0].headline.outerWidth()?e=u(t):e<parseFloat($-et[t][0].headline.outerWidth()-N.scroll_spacing)&&h(t),e}function p(t){var e=et[t][0].position+N.scroll_speed;return e>$?e=u(t):e>N.scroll_spacing&&h(t),e}function l(t){var e=et[t][0].position-N.scroll_speed;return e<-et[t][0].headline.outerHeight()?e=u(t):e<tt-et[t][0].headline.outerHeight()-N.scroll_spacing&&h(t),e}function _(t){var e=et[t][0].position+N.scroll_speed;return e>tt?e=u(t):e>N.scroll_spacing&&h(t),e}function u(e){return P.tick_count>1&&(et[e][0].visible=!1),P.tick_count===e+1&&(S.trigger("mtphr_dnt_scroll_complete",[P,et]),t("body").trigger("mtphr_dnt_scroll_complete",[S,P,et])),"reset"}function d(t){!1===et[t][0].visible&&(P.previous_tick=parseInt(t-1),P.previous_tick<0&&(P.previous_tick=parseInt(P.tick_count-1)),P.current_tick=t,P.next_tick=parseInt(t+1),P.next_tick>=P.tick_count&&(P.next_tick=0))}function h(t){t===P.tick_count-1?N.scroll_loop&&(d(0),et[0][0].visible=!0):(d(parseInt(t+1)),et[t+1][0].visible=!0)}function f(t){var e;$=U.outerWidth(),tt=U.outerHeight();var i=et[t][0].headline;switch(N.scroll_direction){case"left":e=$;break;case"right":e=parseFloat("-"+i.outerWidth());break;case"up":e=parseFloat(tt);break;case"down":e=parseFloat("-"+i.outerHeight());break}return et[t][0].width=i.outerWidth(),et[t][0].height=i.outerHeight(),et[t][0].reset=e,et[t][0].position=e,e}function g(){for(var t=0;t<P.tick_count;t++){var e,i=et[t][0].headline;switch(N.scroll_direction){case"left":e=$,!1===et[t][0].visible&&i.css("left",e+"px");break;case"right":e=parseFloat("-"+i.outerWidth()),!1===et[t][0].visible&&i.css("left",e+"px");break;case"up":rt&&i.css("width",$),e=parseFloat(tt),!1===et[t][0].visible&&i.css("top",e+"px");break;case"down":rt&&i.css("width",$),e=parseFloat("-"+i.outerHeight()),!1===et[t][0].visible&&i.css("top",e+"px");break}et[t][0].width=i.outerWidth(),et[t][0].height=i.outerHeight(),!1===et[t][0].visible&&(et[t][0].position=e),et[t][0].reset=e}}function v(){var t,e;$=U.outerWidth(!0),tt=U.outerHeight(!0);for(var i=0;i<P.tick_count;i++)if(et[i]){switch(e=et[i][0].headline,N.scroll_direction){case"left":t=$,e.stop(!0,!0).css("left",t+"px");break;case"right":t=parseFloat("-"+e.outerWidth()),e.stop(!0,!0).css("left",t+"px");break;case"up":rt&&e.css("width",$),t=parseFloat(tt),e.stop(!0,!0).css("top",t+"px");break;case"down":rt&&e.css("width",$),t=parseFloat("-"+e.outerHeight()),e.stop(!0,!0).css("top",t+"px");break}et[i][0].width=e.outerWidth(),et[i][0].height=e.outerHeight(),et[i][0].position=t,et[i][0].reset=t,et[i][0].visible=!1}if(P.current_tick=0,et[P.current_tick][0].visible=!0,N.scroll_init)for("left"===N.scroll_direction?t=.1*$:"right"===N.scroll_direction?t=.9*$:"up"===N.scroll_direction?t=.1*tt:"down"===N.scroll_direction&&(t=.9*tt),i=0;i<P.tick_count;i++)switch(e=et[i][0].headline,N.scroll_direction){case"left":t<$&&(e.stop(!0,!0).css("left",t+"px"),et[i][0].position=t,et[i][0].visible=!0,t=t+et[i][0].width+N.scroll_spacing);break;case"right":t>0&&(t-=et[i][0].width,e.stop(!0,!0).css("left",t+"px"),et[i][0].position=t,et[i][0].visible=!0,t-=N.scroll_spacing);break;case"up":t<tt&&(e.stop(!0,!0).css("top",t+"px"),et[i][0].position=t,et[i][0].visible=!0,t=t+et[i][0].height+N.scroll_spacing);break;case"down":t>0&&(t-=et[i][0].height,e.stop(!0,!0).css("top",t+"px"),et[i][0].position=t,et[i][0].visible=!0,t-=N.scroll_spacing);break}}function k(){m()}function y(){clearInterval(nt)}function b(){switch(U.find(".mtphr-dnt-tick").each((function(){et.push(t(this)),t(this).imagesLoaded((function(){W()}))})),W(),U.find(".mtphr-dnt-tick").show(),N.rotate_type){case"fade":H(U,et,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":L(U,et,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":T(U,et,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":A(U,et,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":R(U,et,parseInt(100*N.rotate_speed),N.rotate_ease);break}w(0),N.auto_rotate&&k(),U.hover((function(){N.auto_rotate&&N.rotate_pause&&!P.running&&y()}),(function(){N.auto_rotate&&N.rotate_pause&&!P.running&&!P.paused&&k()}))}function m(){y(),nt=setInterval((function(){var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),x(t)}),parseInt(1e3*N.rotate_delay))}function x(e){P.current_tick!==e&&(N.auto_rotate&&y(),P.next_tick=e,N.before_change.call(S,U),S.trigger("mtphr_dnt_before_change_single",[P,et]),t("body").trigger("mtphr_dnt_before_change",[S,P,et]),P.running=1,F(e),I(e),P.previous_tick=P.current_tick,P.current_tick=e,st=setTimeout((function(){N.after_change.call(S,U),S.trigger("mtphr_dnt_after_change_single",[P,et]),t("body").trigger("mtphr_dnt_after_change",[S,P,et]),ot=N.rotate_type,P.reverse=0,P.running=0,N.auto_rotate&&!P.paused&&m()}),parseInt(100*N.rotate_speed)))}function w(t){Y&&(Y.children("a").removeClass("active"),Y.children('a[href="'+t+'"]').addClass("active"))}function I(e){switch(w(e),ot){case"fade":C(U,t(et[e]),t(et[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":z(U,t(et[e]),t(et[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":j(U,t(et[e]),t(et[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":M(U,t(et[e]),t(et[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":q(U,t(et[e]),t(et[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function F(e){switch(ot){case"fade":D(U,t(et[P.current_tick]),t(et[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":O(U,t(et[P.current_tick]),t(et[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":E(U,t(et[P.current_tick]),t(et[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":Q(U,t(et[P.current_tick]),t(et[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":B(U,t(et[P.current_tick]),t(et[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function W(){for(var e=0;e<P.tick_count;e++)t(et[e]).width($+"px"),P.current_tick!==e&&t(et[e]).css({left:parseFloat($+N.offset)+"px"});var i=t(et[P.current_tick]).height();U.stop().css("height",i+"px")}function H(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,left:"auto"})}function C(t,e,i,r,n){e.css({opacity:0,left:"auto"}),e.stop().animate({opacity:1},r,n);var o=e.height();t.stop().animate({height:o+"px"},r,n)}function D(e,i,r,n,o){i.stop().animate({opacity:0},n,o,(function(){t(this).css({left:parseFloat($+N.offset)+"px"}),i.remove(),e.append(i)}))}function L(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,left:0})}function z(t,e,i,r,n){var o=e.height();e.css({opacity:1,left:parseFloat($+N.offset)+"px"}),t.stop().animate({height:o+"px"},r,n,(function(){})),e.stop().animate({left:"0"},r,n,(function(){}))}function O(t,e,i,r,n){e.stop().animate({left:"-"+parseFloat($+N.offset)+"px"},r,n,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function T(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,left:0})}function j(t,e,i,r,n){var o=e.height();e.css({opacity:1,left:"-"+parseFloat($+N.offset)+"px"}),t.stop().animate({height:o+"px"},r,n,(function(){})),e.stop().animate({left:"0"},r,n)}function E(t,e,i,r,n){e.stop().animate({left:parseFloat($+N.offset)+"px"},r,n,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function A(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,top:0,left:"auto"})}function M(t,e,i,r,n){var o=e.height();e.css({opacity:1,top:"-"+parseFloat(o+N.offset)+"px",left:"auto"}),t.stop().animate({height:o+"px"},r,n),e.stop().animate({top:"0"},r,n)}function Q(t,e,i,r,n){var o=i.height();e.stop().animate({top:parseFloat(o+N.offset)+"px"},r,n,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function R(t,e){var i=e[0],r=i.height();t.css({height:r+"px",left:"auto"}),i.css({opacity:1,top:0})}function q(t,e,i,r,n){var o=e.height();e.css({opacity:1,top:parseFloat(i.height()+N.offset)+"px",left:"auto"}),t.stop().animate({height:o+"px"},r,n),e.stop().animate({top:"0"},r,n)}function B(t,e,i,r,n){var o=e.height();e.stop().animate({top:"-"+parseFloat(o+N.offset)+"px"},r,n,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function G(){if(P.running)return!1;var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),x(t)}function J(){if(P.running)return!1;var t=parseInt(P.current_tick-1);t<0&&(t=P.tick_count-1),N.nav_reverse&&("slide_left"===N.rotate_type?ot="slide_right":"slide_right"===N.rotate_type?ot="slide_left":"slide_down"===N.rotate_type?ot="slide_up":"slide_up"===N.rotate_type&&(ot="slide_down"),P.reverse=1),x(t)}function K(t){t?(P.paused=!1,Z.removeClass("paused"),"scroll"===N.type?s():k()):(P.paused=!0,Z.addClass("paused"),"scroll"===N.type?o():y()),S.trigger("mtphr_dnt_play_pause",[P,et])}var N={id:"",type:"scroll",scroll_direction:"left",scroll_speed:10,scroll_pause:0,scroll_spacing:40,scroll_units:10,scroll_init:0,scroll_loop:1,rotate_type:"fade",auto_rotate:0,rotate_delay:10,rotate_pause:0,rotate_speed:10,rotate_ease:"easeOutExpo",nav_reverse:0,disable_touchswipe:0,offset:20,before_change:function(){},after_change:function(){},after_load:function(){}},P={id:N.id,tick_count:0,previous_tick:0,current_tick:0,next_tick:0,reverse:0,running:0,paused:0};e&&t.extend(N,e);var S=t(this),U=S.find(".mtphr-dnt-tick-contents"),V=S.find(".mtphr-dnt-nav-prev"),X=S.find(".mtphr-dnt-nav-next"),Y=S.find(".mtphr-dnt-control-links"),Z=S.find(".mtphr-dnt-play-pause"),$=U.outerWidth(!0),tt=0,et=[],it,rt=!0,nt,ot=N.rotate_type,st;if(U.data("ditty:vars",P),V&&"rotate"===N.type&&(V.bind("click",(function(t){t.preventDefault(),J()})),X.bind("click",(function(t){t.preventDefault(),G()}))),Y&&"rotate"===N.type&&Y.children("a").bind("click",(function(e){e.preventDefault();var i=parseInt(t(this).attr("href"));if(P.running)return!1;if(i===P.current_tick)return!1;var r=i<P.current_tick?1:0;N.nav_reverse&&r&&("slide_left"===N.rotate_type?ot="slide_right":"slide_right"===N.rotate_type?ot="slide_left":"slide_down"===N.rotate_type?ot="slide_up":"slide_up"===N.rotate_type&&(ot="slide_down"),P.reverse=1),x(i)})),Z.bind("click",(function(t){t.preventDefault(),K(P.paused)})),"rotate"!==N.type||N.disable_touchswipe||U.swipe({triggerOnTouchEnd:!0,swipeLeft:function(){if(P.running)return!1;var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),"slide_left"!==N.rotate_type&&"slide_right"!==N.rotate_type||(ot="slide_left"),x(t)},swipeRight:function(){if(P.running)return!1;var t=parseInt(P.current_tick-1);t<0&&(t=P.tick_count-1),"slide_left"!==N.rotate_type&&"slide_right"!==N.rotate_type||(ot="slide_right"),N.nav_reverse&&("slide_down"===N.rotate_type?ot="slide_up":"slide_up"===N.rotate_type&&(ot="slide_down"),P.reverse=1),x(t)}}),S.on("mtphr_dnt_next",(function(){G()})),S.on("mtphr_dnt_prev",(function(){J()})),S.on("mtphr_dnt_goto",(function(t,e){x(parseInt(e))})),S.on("mtphr_dnt_pause",(function(){K()})),S.on("mtphr_dnt_play",(function(){K(!0)})),t(window).resize((function(){U.outerWidth()!==$&&($=U.outerWidth(!0),"scroll"===N.type?("up"===N.scroll_direction||"down"===N.scroll_direction)&&rt?v():g():"rotate"===N.type&&W())})),S.on("mtphr_dnt_resize_single",(function(){"scroll"===N.type?g():"rotate"===N.type&&W()})),t("body").on("mtphr_dnt_resize",(function(t,e){e&&e.indexOf(N.id)>=0&&("scroll"===N.type?g():"rotate"===N.type&&W())})),S.on("mtphr_dnt_replace_ticks",(function(e,r,n){clearInterval(it),S.find(".mtphr-dnt-tick").remove(),r.each((function(){U.append(t(this))})),setTimeout((function(){i()}),n)})),0===S.outerWidth())var at=setInterval((function(){S.outerWidth()>10&&(clearInterval(at),$=U.outerWidth(),i())}),100);else i()}))}};t.fn.ditty_news_ticker=function(i){return e[i]?e[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?void t.error("Method "+i+" does not exist in ditty_news_ticker"):e.init.apply(this,arguments)}}(jQuery);
inc/static/sass/style.scss CHANGED
@@ -27,6 +27,7 @@
27
  }
28
  .mtphr-dnt-tick-container {
29
  position: relative;
 
30
  }
31
  .mtphr-dnt-tick-contents {
32
  position: relative;
@@ -369,10 +370,10 @@
369
  }
370
  &.paused {
371
  i.mtphr-dnt-icon-play {
372
- display: none;
373
  }
374
  i.mtphr-dnt-icon-pause {
375
- display: inline-block;
376
  }
377
  }
378
  i {
@@ -394,9 +395,9 @@
394
  }
395
  &.mtphr-dnt-icon-play {
396
  padding-left: 4px;
 
397
  }
398
  &.mtphr-dnt-icon-pause {
399
- display: none;
400
  }
401
  }
402
  }
27
  }
28
  .mtphr-dnt-tick-container {
29
  position: relative;
30
+ overflow: hidden;
31
  }
32
  .mtphr-dnt-tick-contents {
33
  position: relative;
370
  }
371
  &.paused {
372
  i.mtphr-dnt-icon-play {
373
+ display: inline-block;
374
  }
375
  i.mtphr-dnt-icon-pause {
376
+ display: none;
377
  }
378
  }
379
  i {
395
  }
396
  &.mtphr-dnt-icon-play {
397
  padding-left: 4px;
398
+ display: none;
399
  }
400
  &.mtphr-dnt-icon-pause {
 
401
  }
402
  }
403
  }
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: 4.5
6
- Tested up to: 5.3.2
7
  Stable tag: /trunk/
8
  License: GPL2
9
 
@@ -72,6 +72,9 @@ The most common cause for an unresponsive ticker (when using scroll or rotate mo
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 2.2.15 =
76
  * CSS Fix for list mode
77
 
@@ -531,4 +534,4 @@ The most common cause for an unresponsive ticker (when using scroll or rotate mo
531
 
532
  == Upgrade Notice ==
533
 
534
- CSS Fix for list mode
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: 4.5
6
+ Tested up to: 5.4.2
7
  Stable tag: /trunk/
8
  License: GPL2
9
 
72
 
73
  == Changelog ==
74
 
75
+ = 2.2.16 =
76
+ * Swapped play and pause button icons
77
+
78
  = 2.2.15 =
79
  * CSS Fix for list mode
80
 
534
 
535
  == Upgrade Notice ==
536
 
537
+ Swapped play and pause button icons