Ditty News Ticker - Version 2.3.2

Version Description

  • Deprecated javascript updates
Download this release

Release Info

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

Code changes from version 2.3.1 to 2.3.2

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.3.1
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.3.1' );
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.3.2
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.3.2' );
66
  }
67
 
68
  // Plugin Folder Path
inc/static/js/ditty-news-ticker-images.js DELETED
@@ -1,107 +0,0 @@
1
- jQuery( document ).ready( function($) {
2
-
3
-
4
- var preload_limit = 4,
5
- currently_preloading = 0;
6
-
7
-
8
- /* --------------------------------------------------------- */
9
- /* !Preload images */
10
- /* --------------------------------------------------------- */
11
-
12
- function mtphr_dnt_image_preload() {
13
-
14
- var start = currently_preloading;
15
- for( var i=start; i < preload_limit; i++ ) {
16
-
17
- var $placeholder = $('.mtphr-dnt-image-placeholder:visible:first');
18
- if( $placeholder.length === 0 ) {
19
- $placeholder = $('.mtphr-dnt-image-placeholder:first');
20
- }
21
-
22
- if( $placeholder.length > 0 ) {
23
-
24
- // Add 1 to the currently preloading var
25
- currently_preloading++;
26
-
27
- // Replace the placeholder class
28
- $placeholder.attr('class', 'mtphr-dnt-image-placeholder-loading');
29
-
30
- // Load the image
31
- mtphr_dnt_image_preload_image( $placeholder );
32
- }
33
- }
34
- }
35
-
36
- function mtphr_dnt_image_preload_image( $placeholder ) {
37
-
38
- var path = $placeholder.attr('data-src');
39
-
40
- var img = new Image();
41
- $(img).load(function () {
42
-
43
- var $img = $(this);
44
- $placeholder.after( $img );
45
- $placeholder.css('position', 'absolute').fadeOut( function() {
46
-
47
- // Remove the placeholder
48
- $(this).next('.mtphr-dnt-image-placeholder-sizer').remove();
49
- $(this).remove();
50
-
51
- // Trigger a ticker resize
52
- $('body').trigger('mtphr_dnt_resize', [$img.parents('.mtphr-dnt').attr('id')]);
53
-
54
- // Resize the placeholders
55
- mtphr_dnt_image_resize_placeholders();
56
-
57
- // Subtract 1 to the currently preloading var
58
- currently_preloading--;
59
-
60
- // Preload the next image
61
- if( $('.mtphr-dnt-image-placeholder').length > 0 ) {
62
- mtphr_dnt_image_preload();
63
- }
64
- });
65
- $(this).fadeIn();
66
-
67
- }).attr('src', path);
68
- }
69
-
70
- mtphr_dnt_image_preload();
71
-
72
-
73
-
74
-
75
-
76
- /* --------------------------------------------------------- */
77
- /* !Resize the placholders - 1.0.0 */
78
- /* --------------------------------------------------------- */
79
-
80
- function mtphr_dnt_image_resize_placeholders() {
81
-
82
- $('.mtphr-dnt-image-placeholder, .mtphr-dnt-image-placeholder-loading').each( function() {
83
-
84
- var init_w = $(this).data('width'),
85
- init_h = $(this).data('height'),
86
- percent = init_h/init_w,
87
- w = $(this).next('.mtphr-dnt-image-placeholder-sizer').width(),
88
- h = w*percent;
89
-
90
- $(this).css({
91
- display: 'block',
92
- width: w+'px',
93
- height: h+'px'
94
- });
95
-
96
- });
97
- }
98
-
99
-
100
-
101
-
102
- $(window).on( 'resize', function() {
103
- mtphr_dnt_image_resize_placeholders();
104
- });
105
- mtphr_dnt_image_resize_placeholders();
106
-
107
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/static/js/ditty-news-ticker-images.min.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready((function(t){function e(){for(var e,i=n;i<4;i++){var r=t(".mtphr-dnt-image-placeholder:visible:first");0===r.length&&(r=t(".mtphr-dnt-image-placeholder:first")),r.length>0&&(n++,r.attr("class","mtphr-dnt-image-placeholder-loading"),a(r))}}function a(a){var r=a.attr("data-src"),h=new Image;t(h).load((function(){var r=t(this);a.after(r),a.css("position","absolute").fadeOut((function(){t(this).next(".mtphr-dnt-image-placeholder-sizer").remove(),t(this).remove(),t("body").trigger("mtphr_dnt_resize",[r.parents(".mtphr-dnt").attr("id")]),i(),n--,t(".mtphr-dnt-image-placeholder").length>0&&e()})),t(this).fadeIn()})).attr("src",r)}function i(){t(".mtphr-dnt-image-placeholder, .mtphr-dnt-image-placeholder-loading").each((function(){var e=t(this).data("width"),a,i=t(this).data("height")/e,r=t(this).next(".mtphr-dnt-image-placeholder-sizer").width(),n=r*i;t(this).css({display:"block",width:r+"px",height:n+"px"})}))}var r=4,n=0;e(),t(window).on("resize",(function(){i()})),i()}));
 
inc/static/js/ditty-news-ticker.js CHANGED
@@ -1472,13 +1472,12 @@
1472
  * @since 1.0.0
1473
  */
1474
  $.fn.ditty_news_ticker = function( method ) {
1475
-
1476
  if ( methods[method] ) {
1477
  return methods[method].apply( this, Array.prototype.slice.call(arguments, 1) );
1478
  } else if ( typeof method === 'object' || !method ) {
1479
  return methods.init.apply( this, arguments );
1480
  } else {
1481
- $.error( 'Method ' + method + ' does not exist in ditty_news_ticker' );
1482
  }
1483
  };
1484
 
1472
  * @since 1.0.0
1473
  */
1474
  $.fn.ditty_news_ticker = function( method ) {
 
1475
  if ( methods[method] ) {
1476
  return methods[method].apply( this, Array.prototype.slice.call(arguments, 1) );
1477
  } else if ( typeof method === 'object' || !method ) {
1478
  return methods.init.apply( this, arguments );
1479
  } else {
1480
+ throw new Error( 'Method ' + method + ' does not exist in ditty_news_ticker' );
1481
  }
1482
  };
1483
 
inc/static/js/ditty-news-ticker.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={init:function(e){return this.each((function(){function r(){P.tick_count=S.find(".mtphr-dnt-tick").length,P.tick_count>0&&("scroll"===N.type?i():"rotate"===N.type&&m()),N.after_load.call(R,S),R.trigger("mtphr_dnt_after_load_single",[P,rt]),t("body").trigger("mtphr_dnt_after_load",[R,P,rt])}function n(){S.find(".mtphr-dnt-tick").each((function(){t(this).height()>et&&(et=t(this).height()),"up"!==N.scroll_direction&&"down"!==N.scroll_direction||t(this).css("height","auto")})),S.css("height",et+"px")}function i(){var e=S.find(".mtphr-dnt-tick:first");if(e.attr("style")){var r,i=e.attr("style").split("width:");it=!(i.length>1)}rt=[],S.find("img").length?S.imagesLoaded((function(){n(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];rt.push(e)})),g(),o()})):(n(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];rt.push(e)})),g(),o()),S.on({mouseenter:function(){N.scroll_pause&&s()},mouseleave:function(){N.scroll_pause&&!P.paused&&a()}})}function s(){clearInterval(nt)}function a(){o()}function o(){clearInterval(nt),nt=setInterval((function(){for(var t=0;t<P.tick_count;t++)if(!0===rt[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=rt[t][0].reset,rt[t][0].headline.css("opacity",0)):rt[t][0].headline.css("opacity",1),rt[t][0].headline.css({transform:"translateX( "+e+"px )"})):("reset"===(e="up"===N.scroll_direction?l(t):_(t))?(e=rt[t][0].reset,rt[t][0].headline.css("opacity",0)):rt[t][0].headline.css("opacity",1),rt[t][0].headline.css({transform:"translateY( "+e+"px )"})),rt[t][0].position=e}}),1)}function c(t){var e=parseFloat(rt[t][0].position-.05*N.scroll_speed);return e<-(rt[t][0].headline.width()+N.offset)?e=f(t):e<parseFloat(tt-rt[t][0].headline.width()-N.scroll_spacing)&&u(t),e}function p(t){var e=parseFloat(rt[t][0].position+.05*N.scroll_speed);return e>tt+N.offset?e=f(t):e>N.scroll_spacing&&u(t),e}function l(t){var e=parseFloat(rt[t][0].position-.05*N.scroll_speed);return e<-(rt[t][0].headline.height()+N.offset)?e=f(t):e<et-rt[t][0].headline.height()-N.scroll_spacing&&u(t),e}function _(t){var e=parseFloat(rt[t][0].position+.05*N.scroll_speed);return e>et+N.offset?e=f(t):e>N.scroll_spacing&&u(t),e}function f(e){return P.tick_count>1&&(rt[e][0].visible=!1),P.tick_count===e+1&&(R.trigger("mtphr_dnt_scroll_complete",[P,rt]),t("body").trigger("mtphr_dnt_scroll_complete",[R,P,rt])),"reset"}function d(t){!1===rt[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 u(t){t===P.tick_count-1?N.scroll_loop&&(d(0),rt[0][0].visible=!0):(d(parseInt(t+1)),rt[t+1][0].visible=!0)}function h(){for(var t=0;t<P.tick_count;t++){var e,r=rt[t][0].headline;switch(N.scroll_direction){case"left":e=tt+N.offset,!1===rt[t][0].visible&&r.css("transform","translateX( "+e+"px )");break;case"right":e=parseInt("-"+(r.width()+N.offset)),!1===rt[t][0].visible&&r.css("transform","translateX( "+e+"px )");break;case"up":it&&r.css("width",tt),e=parseInt(et+N.offset),!1===rt[t][0].visible&&r.css("transform","translateY( "+e+"px )");break;case"down":it&&r.css("width",tt),e=parseInt("-"+(r.height()+N.offset)),!1===rt[t][0].visible&&r.css("transform","translateY( "+e+"px )");break}rt[t][0].width=r.width(),rt[t][0].height=r.height(),!1===rt[t][0].visible&&(rt[t][0].position=e),rt[t][0].reset=e}}function g(){for(var t,e,r=0;r<P.tick_count;r++)if(rt[r]){switch(e=rt[r][0].headline,N.scroll_direction){case"left":t=tt+N.offset,e.css("transform","translateX( "+t+"px )");break;case"right":t=parseInt("-"+(e.width()+N.offset)),e.css("transform","translateX( "+t+"px )");break;case"up":it&&e.css("width",tt),t=parseInt(et+N.offset),e.css("transform","translateY( "+t+"px )");break;case"down":it&&e.css("width",tt),t=parseInt("-"+(e.height()+N.offset)),e.css("transform","translateY( "+t+"px )");break}rt[r][0].width=e.width(),rt[r][0].height=e.height(),rt[r][0].position=t,rt[r][0].reset=t,rt[r][0].visible=!1}if(P.current_tick=0,rt[P.current_tick][0].visible=!0,N.scroll_init)for("left"===N.scroll_direction?t=.1*tt:"right"===N.scroll_direction?t=.9*tt:"up"===N.scroll_direction?t=.1*et:"down"===N.scroll_direction&&(t=.9*et),r=0;r<P.tick_count;r++)switch(e=rt[r][0].headline,N.scroll_direction){case"left":t<tt&&(e.css("transform","translateX( "+t+"px )"),rt[r][0].position=t,rt[r][0].visible=!0,t=t+rt[r][0].width+N.scroll_spacing);break;case"right":t>0&&(t-=rt[r][0].width,e.css("transform","translateX( "+t+"px )"),rt[r][0].position=t,rt[r][0].visible=!0,t-=N.scroll_spacing);break;case"up":t<et&&(e.css("transform","translateY( "+t+"px )"),rt[r][0].position=t,rt[r][0].visible=!0,t=t+rt[r][0].height+N.scroll_spacing);break;case"down":t>0&&(e.css("transform","translateY( "+t+"px )"),e.stop(!0,!0).css("top",t+"px"),rt[r][0].position=t,rt[r][0].visible=!0,t-=N.scroll_spacing);break}}function v(){y()}function k(){clearInterval(st)}function m(){switch(S.find(".mtphr-dnt-tick").each((function(){rt.push(t(this)),t(this).imagesLoaded((function(){F()}))})),F(),S.find(".mtphr-dnt-tick").show(),N.rotate_type){case"fade":X(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":D(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":z(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":O(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":M(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break}w(0),N.auto_rotate&&v(),S.on({mouseenter:function(){N.auto_rotate&&N.rotate_pause&&!P.running&&k()},mouseleave:function(){N.auto_rotate&&N.rotate_pause&&!P.running&&!P.paused&&v()}})}function y(){k(),st=setInterval((function(){var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),b(t)}),parseInt(1e3*N.rotate_delay))}function b(e){P.current_tick!==e&&(N.auto_rotate&&k(),P.next_tick=e,N.before_change.call(R,S),R.trigger("mtphr_dnt_before_change_single",[P,rt]),t("body").trigger("mtphr_dnt_before_change",[R,P,rt]),P.running=1,I(e),x(e),P.previous_tick=P.current_tick,P.current_tick=e,ot=setTimeout((function(){N.after_change.call(R,S),R.trigger("mtphr_dnt_after_change_single",[P,rt]),t("body").trigger("mtphr_dnt_after_change",[R,P,rt]),at=N.rotate_type,P.reverse=0,P.running=0,N.auto_rotate&&!P.paused&&y()}),parseInt(100*N.rotate_speed)))}function w(t){Z&&(Z.children("a").removeClass("active"),Z.children('a[href="'+t+'"]').addClass("active"))}function x(e){switch(w(e),at){case"fade":Y(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":L(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":E(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":T(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":Q(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function I(e){switch(at){case"fade":C(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":W(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":j(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":A(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":q(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function F(){for(var e=0;e<P.tick_count;e++)t(rt[e]).width(tt+"px"),P.current_tick!==e&&t(rt[e]).css({left:parseFloat(tt+N.offset)+"px"});var r=t(rt[P.current_tick]).height();S.stop().css("height",r+"px")}function X(t,e){var r=e[0],n=r.height();t.css("height",n+"px"),r.css({opacity:1,left:"auto"})}function Y(t,e,r,n,i){e.css({opacity:0,left:"auto"}),e.stop().animate({opacity:1},n,i);var s=e.height();t.stop().animate({height:s+"px"},n,i)}function C(e,r,n,i,s){r.stop().animate({opacity:0},i,s,(function(){t(this).css({left:parseFloat(tt+N.offset)+"px"}),r.remove(),e.append(r)}))}function D(t,e){var r=e[0],n=r.height();t.css("height",n+"px"),r.css({opacity:1,left:0})}function L(t,e,r,n,i){var s=e.height();e.css({opacity:1,left:parseFloat(tt+N.offset)+"px"}),t.stop().animate({height:s+"px"},n,i,(function(){})),e.stop().animate({left:"0"},n,i,(function(){}))}function W(t,e,r,n,i){e.stop().animate({left:"-"+parseFloat(tt+N.offset)+"px"},n,i,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function z(t,e){var r=e[0],n=r.height();t.css("height",n+"px"),r.css({opacity:1,left:0})}function E(t,e,r,n,i){var s=e.height();e.css({opacity:1,left:"-"+parseFloat(tt+N.offset)+"px"}),t.stop().animate({height:s+"px"},n,i,(function(){})),e.stop().animate({left:"0"},n,i)}function j(t,e,r,n,i){e.stop().animate({left:parseFloat(tt+N.offset)+"px"},n,i,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function O(t,e){var r=e[0],n=r.height();t.css("height",n+"px"),r.css({opacity:1,top:0,left:"auto"})}function T(t,e,r,n,i){var s=e.height();e.css({opacity:1,top:"-"+parseFloat(s+N.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},n,i),e.stop().animate({top:"0"},n,i)}function A(t,e,r,n,i){var s=r.height();e.stop().animate({top:parseFloat(s+N.offset)+"px"},n,i,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function M(t,e){var r=e[0],n=r.height();t.css({height:n+"px",left:"auto"}),r.css({opacity:1,top:0})}function Q(t,e,r,n,i){var s=e.height();e.css({opacity:1,top:parseFloat(r.height()+N.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},n,i),e.stop().animate({top:"0"},n,i)}function q(t,e,r,n,i){var s=e.height();e.stop().animate({top:"-"+parseFloat(s+N.offset)+"px"},n,i,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function B(){if(P.running)return!1;var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),b(t)}function G(){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?at="slide_right":"slide_right"===N.rotate_type?at="slide_left":"slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(t)}function H(t){t?(P.paused=!1,$.removeClass("paused"),"scroll"===N.type?a():v()):(P.paused=!0,$.addClass("paused"),"scroll"===N.type?s():k()),R.trigger("mtphr_dnt_play_pause",[P,rt])}function J(){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||(at="slide_left"),b(t)}function K(){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||(at="slide_right"),N.nav_reverse&&("slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(t)}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 R=t(this),S=R.find(".mtphr-dnt-tick-contents"),U=R.find(".mtphr-dnt-nav-prev"),V=R.find(".mtphr-dnt-nav-next"),Z=R.find(".mtphr-dnt-control-links"),$=R.find(".mtphr-dnt-play-pause"),tt=S.outerWidth(!0),et=0,rt=[],nt,it=!0,st,at=N.rotate_type,ot;if(S.data("ditty:vars",P),U&&"rotate"===N.type&&(U.on("click",(function(t){t.preventDefault(),G()})),V.on("click",(function(t){t.preventDefault(),B()}))),Z&&"rotate"===N.type&&Z.children("a").on("click",(function(e){e.preventDefault();var r=parseInt(t(this).attr("href"));if(P.running)return!1;if(r===P.current_tick)return!1;var n=r<P.current_tick?1:0;N.nav_reverse&&n&&("slide_left"===N.rotate_type?at="slide_right":"slide_right"===N.rotate_type?at="slide_left":"slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(r)})),$.on("click",(function(t){t.preventDefault(),H(P.paused)})),"rotate"!==N.type||N.disable_touchswipe||(S[0].addEventListener("swiped-left",(function(){J()})),S[0].addEventListener("swiped-right",(function(){K()}))),R.on("mtphr_dnt_next",(function(){B()})),R.on("mtphr_dnt_prev",(function(){G()})),R.on("mtphr_dnt_goto",(function(t,e){b(parseInt(e))})),R.on("mtphr_dnt_pause",(function(){H()})),R.on("mtphr_dnt_play",(function(){H(!0)})),t(window).on("resize",(function(){S.outerWidth()!==tt&&(tt=S.outerWidth(!0),"scroll"===N.type?("up"===N.scroll_direction||"down"===N.scroll_direction)&&it?g():h():"rotate"===N.type&&F())})),R.on("mtphr_dnt_resize_single",(function(){"scroll"===N.type?h():"rotate"===N.type&&F()})),t("body").on("mtphr_dnt_resize",(function(t,e){e&&e.indexOf(N.id)>=0&&("scroll"===N.type?h():"rotate"===N.type&&F())})),R.on("mtphr_dnt_replace_ticks",(function(e,n,i){clearInterval(nt),R.find(".mtphr-dnt-tick").remove(),n.each((function(){S.append(t(this))})),setTimeout((function(){r()}),i)})),0===R.width())var ct=setInterval((function(){R.width()>10&&(clearInterval(ct),tt=S.outerWidth(!0),r())}),100);else r()}))}};t.fn.ditty_news_ticker=function(r){return e[r]?e[r].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof r&&r?void t.error("Method "+r+" 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 r(){P.tick_count=S.find(".mtphr-dnt-tick").length,P.tick_count>0&&("scroll"===N.type?i():"rotate"===N.type&&m()),N.after_load.call(R,S),R.trigger("mtphr_dnt_after_load_single",[P,rt]),t("body").trigger("mtphr_dnt_after_load",[R,P,rt])}function n(){S.find(".mtphr-dnt-tick").each((function(){t(this).height()>et&&(et=t(this).height()),"up"!==N.scroll_direction&&"down"!==N.scroll_direction||t(this).css("height","auto")})),S.css("height",et+"px")}function i(){var e=S.find(".mtphr-dnt-tick:first");if(e.attr("style")){var r,i=e.attr("style").split("width:");it=!(i.length>1)}rt=[],S.find("img").length?S.imagesLoaded((function(){n(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];rt.push(e)})),g(),o()})):(n(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];rt.push(e)})),g(),o()),S.on({mouseenter:function(){N.scroll_pause&&s()},mouseleave:function(){N.scroll_pause&&!P.paused&&a()}})}function s(){clearInterval(nt)}function a(){o()}function o(){clearInterval(nt),nt=setInterval((function(){for(var t=0;t<P.tick_count;t++)if(!0===rt[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=rt[t][0].reset,rt[t][0].headline.css("opacity",0)):rt[t][0].headline.css("opacity",1),rt[t][0].headline.css({transform:"translateX( "+e+"px )"})):("reset"===(e="up"===N.scroll_direction?l(t):_(t))?(e=rt[t][0].reset,rt[t][0].headline.css("opacity",0)):rt[t][0].headline.css("opacity",1),rt[t][0].headline.css({transform:"translateY( "+e+"px )"})),rt[t][0].position=e}}),1)}function c(t){var e=parseFloat(rt[t][0].position-.05*N.scroll_speed);return e<-(rt[t][0].headline.width()+N.offset)?e=f(t):e<parseFloat(tt-rt[t][0].headline.width()-N.scroll_spacing)&&u(t),e}function p(t){var e=parseFloat(rt[t][0].position+.05*N.scroll_speed);return e>tt+N.offset?e=f(t):e>N.scroll_spacing&&u(t),e}function l(t){var e=parseFloat(rt[t][0].position-.05*N.scroll_speed);return e<-(rt[t][0].headline.height()+N.offset)?e=f(t):e<et-rt[t][0].headline.height()-N.scroll_spacing&&u(t),e}function _(t){var e=parseFloat(rt[t][0].position+.05*N.scroll_speed);return e>et+N.offset?e=f(t):e>N.scroll_spacing&&u(t),e}function f(e){return P.tick_count>1&&(rt[e][0].visible=!1),P.tick_count===e+1&&(R.trigger("mtphr_dnt_scroll_complete",[P,rt]),t("body").trigger("mtphr_dnt_scroll_complete",[R,P,rt])),"reset"}function d(t){!1===rt[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 u(t){t===P.tick_count-1?N.scroll_loop&&(d(0),rt[0][0].visible=!0):(d(parseInt(t+1)),rt[t+1][0].visible=!0)}function h(){for(var t=0;t<P.tick_count;t++){var e,r=rt[t][0].headline;switch(N.scroll_direction){case"left":e=tt+N.offset,!1===rt[t][0].visible&&r.css("transform","translateX( "+e+"px )");break;case"right":e=parseInt("-"+(r.width()+N.offset)),!1===rt[t][0].visible&&r.css("transform","translateX( "+e+"px )");break;case"up":it&&r.css("width",tt),e=parseInt(et+N.offset),!1===rt[t][0].visible&&r.css("transform","translateY( "+e+"px )");break;case"down":it&&r.css("width",tt),e=parseInt("-"+(r.height()+N.offset)),!1===rt[t][0].visible&&r.css("transform","translateY( "+e+"px )");break}rt[t][0].width=r.width(),rt[t][0].height=r.height(),!1===rt[t][0].visible&&(rt[t][0].position=e),rt[t][0].reset=e}}function g(){for(var t,e,r=0;r<P.tick_count;r++)if(rt[r]){switch(e=rt[r][0].headline,N.scroll_direction){case"left":t=tt+N.offset,e.css("transform","translateX( "+t+"px )");break;case"right":t=parseInt("-"+(e.width()+N.offset)),e.css("transform","translateX( "+t+"px )");break;case"up":it&&e.css("width",tt),t=parseInt(et+N.offset),e.css("transform","translateY( "+t+"px )");break;case"down":it&&e.css("width",tt),t=parseInt("-"+(e.height()+N.offset)),e.css("transform","translateY( "+t+"px )");break}rt[r][0].width=e.width(),rt[r][0].height=e.height(),rt[r][0].position=t,rt[r][0].reset=t,rt[r][0].visible=!1}if(P.current_tick=0,rt[P.current_tick][0].visible=!0,N.scroll_init)for("left"===N.scroll_direction?t=.1*tt:"right"===N.scroll_direction?t=.9*tt:"up"===N.scroll_direction?t=.1*et:"down"===N.scroll_direction&&(t=.9*et),r=0;r<P.tick_count;r++)switch(e=rt[r][0].headline,N.scroll_direction){case"left":t<tt&&(e.css("transform","translateX( "+t+"px )"),rt[r][0].position=t,rt[r][0].visible=!0,t=t+rt[r][0].width+N.scroll_spacing);break;case"right":t>0&&(t-=rt[r][0].width,e.css("transform","translateX( "+t+"px )"),rt[r][0].position=t,rt[r][0].visible=!0,t-=N.scroll_spacing);break;case"up":t<et&&(e.css("transform","translateY( "+t+"px )"),rt[r][0].position=t,rt[r][0].visible=!0,t=t+rt[r][0].height+N.scroll_spacing);break;case"down":t>0&&(e.css("transform","translateY( "+t+"px )"),e.stop(!0,!0).css("top",t+"px"),rt[r][0].position=t,rt[r][0].visible=!0,t-=N.scroll_spacing);break}}function v(){y()}function k(){clearInterval(st)}function m(){switch(S.find(".mtphr-dnt-tick").each((function(){rt.push(t(this)),t(this).imagesLoaded((function(){F()}))})),F(),S.find(".mtphr-dnt-tick").show(),N.rotate_type){case"fade":X(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":D(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":W(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":O(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":M(S,rt,parseInt(100*N.rotate_speed),N.rotate_ease);break}w(0),N.auto_rotate&&v(),S.on({mouseenter:function(){N.auto_rotate&&N.rotate_pause&&!P.running&&k()},mouseleave:function(){N.auto_rotate&&N.rotate_pause&&!P.running&&!P.paused&&v()}})}function y(){k(),st=setInterval((function(){var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),b(t)}),parseInt(1e3*N.rotate_delay))}function b(e){P.current_tick!==e&&(N.auto_rotate&&k(),P.next_tick=e,N.before_change.call(R,S),R.trigger("mtphr_dnt_before_change_single",[P,rt]),t("body").trigger("mtphr_dnt_before_change",[R,P,rt]),P.running=1,I(e),x(e),P.previous_tick=P.current_tick,P.current_tick=e,ot=setTimeout((function(){N.after_change.call(R,S),R.trigger("mtphr_dnt_after_change_single",[P,rt]),t("body").trigger("mtphr_dnt_after_change",[R,P,rt]),at=N.rotate_type,P.reverse=0,P.running=0,N.auto_rotate&&!P.paused&&y()}),parseInt(100*N.rotate_speed)))}function w(t){Z&&(Z.children("a").removeClass("active"),Z.children('a[href="'+t+'"]').addClass("active"))}function x(e){switch(w(e),at){case"fade":Y(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":E(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":z(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":T(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":Q(S,t(rt[e]),t(rt[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function I(e){switch(at){case"fade":C(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":L(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":j(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":A(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":q(S,t(rt[P.current_tick]),t(rt[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function F(){for(var e=0;e<P.tick_count;e++)t(rt[e]).width(tt+"px"),P.current_tick!==e&&t(rt[e]).css({left:parseFloat(tt+N.offset)+"px"});var r=t(rt[P.current_tick]).height();S.stop().css("height",r+"px")}function X(t,e){var r=e[0],n=r.height();t.css("height",n+"px"),r.css({opacity:1,left:"auto"})}function Y(t,e,r,n,i){e.css({opacity:0,left:"auto"}),e.stop().animate({opacity:1},n,i);var s=e.height();t.stop().animate({height:s+"px"},n,i)}function C(e,r,n,i,s){r.stop().animate({opacity:0},i,s,(function(){t(this).css({left:parseFloat(tt+N.offset)+"px"}),r.remove(),e.append(r)}))}function D(t,e){var r=e[0],n=r.height();t.css("height",n+"px"),r.css({opacity:1,left:0})}function E(t,e,r,n,i){var s=e.height();e.css({opacity:1,left:parseFloat(tt+N.offset)+"px"}),t.stop().animate({height:s+"px"},n,i,(function(){})),e.stop().animate({left:"0"},n,i,(function(){}))}function L(t,e,r,n,i){e.stop().animate({left:"-"+parseFloat(tt+N.offset)+"px"},n,i,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function W(t,e){var r=e[0],n=r.height();t.css("height",n+"px"),r.css({opacity:1,left:0})}function z(t,e,r,n,i){var s=e.height();e.css({opacity:1,left:"-"+parseFloat(tt+N.offset)+"px"}),t.stop().animate({height:s+"px"},n,i,(function(){})),e.stop().animate({left:"0"},n,i)}function j(t,e,r,n,i){e.stop().animate({left:parseFloat(tt+N.offset)+"px"},n,i,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function O(t,e){var r=e[0],n=r.height();t.css("height",n+"px"),r.css({opacity:1,top:0,left:"auto"})}function T(t,e,r,n,i){var s=e.height();e.css({opacity:1,top:"-"+parseFloat(s+N.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},n,i),e.stop().animate({top:"0"},n,i)}function A(t,e,r,n,i){var s=r.height();e.stop().animate({top:parseFloat(s+N.offset)+"px"},n,i,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function M(t,e){var r=e[0],n=r.height();t.css({height:n+"px",left:"auto"}),r.css({opacity:1,top:0})}function Q(t,e,r,n,i){var s=e.height();e.css({opacity:1,top:parseFloat(r.height()+N.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},n,i),e.stop().animate({top:"0"},n,i)}function q(t,e,r,n,i){var s=e.height();e.stop().animate({top:"-"+parseFloat(s+N.offset)+"px"},n,i,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function B(){if(P.running)return!1;var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),b(t)}function G(){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?at="slide_right":"slide_right"===N.rotate_type?at="slide_left":"slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(t)}function H(t){t?(P.paused=!1,$.removeClass("paused"),"scroll"===N.type?a():v()):(P.paused=!0,$.addClass("paused"),"scroll"===N.type?s():k()),R.trigger("mtphr_dnt_play_pause",[P,rt])}function J(){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||(at="slide_left"),b(t)}function K(){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||(at="slide_right"),N.nav_reverse&&("slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(t)}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 R=t(this),S=R.find(".mtphr-dnt-tick-contents"),U=R.find(".mtphr-dnt-nav-prev"),V=R.find(".mtphr-dnt-nav-next"),Z=R.find(".mtphr-dnt-control-links"),$=R.find(".mtphr-dnt-play-pause"),tt=S.outerWidth(!0),et=0,rt=[],nt,it=!0,st,at=N.rotate_type,ot;if(S.data("ditty:vars",P),U&&"rotate"===N.type&&(U.on("click",(function(t){t.preventDefault(),G()})),V.on("click",(function(t){t.preventDefault(),B()}))),Z&&"rotate"===N.type&&Z.children("a").on("click",(function(e){e.preventDefault();var r=parseInt(t(this).attr("href"));if(P.running)return!1;if(r===P.current_tick)return!1;var n=r<P.current_tick?1:0;N.nav_reverse&&n&&("slide_left"===N.rotate_type?at="slide_right":"slide_right"===N.rotate_type?at="slide_left":"slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(r)})),$.on("click",(function(t){t.preventDefault(),H(P.paused)})),"rotate"!==N.type||N.disable_touchswipe||(S[0].addEventListener("swiped-left",(function(){J()})),S[0].addEventListener("swiped-right",(function(){K()}))),R.on("mtphr_dnt_next",(function(){B()})),R.on("mtphr_dnt_prev",(function(){G()})),R.on("mtphr_dnt_goto",(function(t,e){b(parseInt(e))})),R.on("mtphr_dnt_pause",(function(){H()})),R.on("mtphr_dnt_play",(function(){H(!0)})),t(window).on("resize",(function(){S.outerWidth()!==tt&&(tt=S.outerWidth(!0),"scroll"===N.type?("up"===N.scroll_direction||"down"===N.scroll_direction)&&it?g():h():"rotate"===N.type&&F())})),R.on("mtphr_dnt_resize_single",(function(){"scroll"===N.type?h():"rotate"===N.type&&F()})),t("body").on("mtphr_dnt_resize",(function(t,e){e&&e.indexOf(N.id)>=0&&("scroll"===N.type?h():"rotate"===N.type&&F())})),R.on("mtphr_dnt_replace_ticks",(function(e,n,i){clearInterval(nt),R.find(".mtphr-dnt-tick").remove(),n.each((function(){S.append(t(this))})),setTimeout((function(){r()}),i)})),0===R.width())var ct=setInterval((function(){R.width()>10&&(clearInterval(ct),tt=S.outerWidth(!0),r())}),100);else r()}))}};t.fn.ditty_news_ticker=function(t){if(e[t])return e[t].apply(this,Array.prototype.slice.call(arguments,1));if("object"!=typeof t&&t)throw new Error("Method "+t+" does not exist in ditty_news_ticker");return e.init.apply(this,arguments)}}(jQuery);
inc/static/js/partials/admin-general.js CHANGED
@@ -521,7 +521,7 @@ jQuery( document ).ready( function($) {
521
  } else if ( typeof method === 'object' || !method ) {
522
  return methods.init.apply( this, arguments );
523
  } else {
524
- $.error( 'Method ' + method + ' does not exist in mtphr_dnt_list' );
525
  }
526
  };
527
 
521
  } else if ( typeof method === 'object' || !method ) {
522
  return methods.init.apply( this, arguments );
523
  } else {
524
+ throw new Error( 'Method ' + method + ' does not exist in mtphr_dnt_list' );
525
  }
526
  };
527
 
inc/static/js/script-admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){"use strict";function e(e){return this.each((function(){var n=t(this),r=n.data("bs.mtphr_dnt_affix"),o="object"==typeof e&&e;r||n.data("bs.mtphr_dnt_affix",r=new i(this,o)),"string"==typeof e&&r[e]()}))}var i=function(e,n){this.options=t.extend({},i.DEFAULTS,n),this.$target=t(this.options.target).on("scroll.bs.mtphr_dnt_affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.mtphr_dnt_affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.mtphr_dnt_affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.5",i.RESET="mtphr_dnt_affix mtphr_dnt_affix-top mtphr_dnt_affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,n){var r=this.$target.scrollTop(),o=this.$element.offset(),a=this.$target.height();if(null!==i&&"top"===this.mtphr_dnt_affixed)return r<i&&"top";if("bottom"===this.mtphr_dnt_affixed)return null!==i?!(r+this.unpin<=o.top)&&"bottom":!(r+a<=t-n)&&"bottom";var s=null===this.mtphr_dnt_affixed,h=s?r:o.top,d;return null!==i&&r<=i?"top":null!==n&&h+(s?a:e)>=t-n&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("mtphr_dnt_affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),n=this.options.offset,r=n.top,o=n.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof n&&(o=r=n),"function"==typeof r&&(r=n.top(this.$element)),"function"==typeof o&&(o=n.bottom(this.$element));var s=this.getState(a,e,r,o);if(this.mtphr_dnt_affixed!==s){null!==this.unpin&&this.$element.css("top","");var h="mtphr_dnt_affix"+(s?"-"+s:""),d=t.Event(h+".bs.mtphr_dnt_affix");if(this.$element.trigger(d),d.isDefaultPrevented())return;this.mtphr_dnt_affixed=s,this.unpin="bottom"===s?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(h).trigger(h.replace("mtphr_dnt_affix","mtphr_dnt_affixed")+".bs.mtphr_dnt_affix")}"bottom"===s&&this.$element.offset({top:a-e-o})}};var n=t.fn.mtphr_dnt_affix;t.fn.mtphr_dnt_affix=e,t.fn.mtphr_dnt_affix.Constructor=i,t.fn.mtphr_dnt_affix.noConflict=function(){return t.fn.mtphr_dnt_affix=n,this},t(window).on("load",(function(){t('[data-spy="mtphr_dnt_affix"]').each((function(){var i=t(this),n=i.data();n.offset=n.offset||{},null!==n.offsetBottom&&(n.offset.bottom=n.offsetBottom),null!==n.offsetTop&&(n.offset.top=n.offsetTop),e.call(i,n)}))}))}(jQuery),jQuery(document).ready((function(t){function e(e,i){t("#mtphr-dnt-"+i+"-metaboxes > div").stop(!0,!0).hide();for(var n=e.attr("metabox").split(" "),r=0;r<n.length;r++)t("#"+n[r]).show();e.siblings("a").removeClass("button-primary"),e.addClass("button-primary"),e.siblings("input").val(e.attr("href").substring(1))}function i(t){var e;t.find("input").is(":checked")?t.next().fadeOut():t.next().fadeIn()}var n=t("#mtphr-dnt-settings-select"),r=t("#wpadminbar");n.mtphr_dnt_affix({offset:{top:function(){return t(window).width()<601?this.top=n.offset().top+5:this.top=n.offset().top-r.height()+5}}}),t("#mtphr-dnt-metabox-group-toggles").on("click",".mtphr-dnt-metabox-group-toggle",(function(e){e.preventDefault();var i=t(this).attr("href");t(".mtphr-dnt-metabox-group-toggle").removeClass("active"),t(".mtphr-dnt-metabox-group").removeClass("active"),t(this).addClass("active"),t(i).addClass("active"),t('input[name="_mtphr_dnt_admin_tab"]').val(i)})),t(".mtphr-dnt-codemirror-css").each((function(){var e=t(this).children("textarea");CodeMirror.fromTextArea(e[0],{mode:"css",lineNumbers:!0,lineWrapping:!0,viewportMargin:1/0})})),t(".mtphr-dnt-codemirror-js").each((function(){var e=t(this).children("textarea"),i;CodeMirror.fromTextArea(e[0],{mode:"htmlmixed",lineNumbers:!0,lineWrapping:!0}).setSize(!1,140)})),t('input[name="_mtphr_dnt_admin_javascript"]').length&&t('input[name="_mtphr_dnt_admin_javascript"]').val("ok"),t(".mtphr-dnt-type-toggle.button-primary").length&&e(t(".mtphr-dnt-type-toggle.button-primary"),"type"),t(".mtphr-dnt-mode-toggle.button-primary").length&&e(t(".mtphr-dnt-mode-toggle.button-primary"),"mode"),t("#mtphr-dnt-type-select").on("click",".mtphr-dnt-type-toggle",(function(i){i.preventDefault(),t(this).hasClass("button-primary")||e(t(this),"type")})),t("#mtphr-dnt-mode-select").on("click",".mtphr-dnt-mode-toggle",(function(i){i.preventDefault(),t(this).hasClass("button-primary")||e(t(this),"mode")})),t(".mtphr-dnt-sort").length>0&&(t(".mtphr-dnt-sort").sortable({handle:".mtphr-dnt-sort-heading",items:".mtphr-dnt-sort-item",axis:"y",opacity:.7,placeholder:{element:function(e){var i=t(e).innerHeight();return t('<div class="mtphr-dnt-sort-placeholder" style="height:'+i+'px;"></div>')[0]},update:function(){}},helper:function(e,i){var n=i.children(),r=i.clone();return r.children().each((function(e){t(this).width(n.eq(e).width()),t(this).height(n.eq(e).height())})),r}}),t("body").on("click",".mtphr-dnt-sort-heading.optional",(function(e){e.preventDefault();var i=t(this).parents(".mtphr-dnt-sort-item"),n=t(this).next(".mtphr-dnt-sort-item-fields"),r=t(this).children("input");i.hasClass("active")?(i.removeClass("active"),r.val("off"),n.length&&n.stop(!0,!0).slideUp(1e3,"easeOutQuint")):(i.addClass("active"),r.val("on"),n.length&&n.stop(!0,!0).slideDown(1e3,"easeOutQuint"))}))),t(".mtphr-dnt-list").mtphr_dnt_list(),t("body").on("click",".mtphr-dnt-single-image .mtphr-dnt-delete",(function(e){e.preventDefault();var i=t(this).parent(),n=i.siblings(".mtphr-dnt-single-image-upload"),r;i.siblings("input").val(""),i.remove(),n.show()})),t("body").on("click",".mtphr-dnt-single-image-upload",(function(e){e.preventDefault();var i=t(this),n=i.parent(),r=n.children("input"),o;if(!o)return(o=wp.media({title:ditty_news_ticker_vars.img_title,button:{text:ditty_news_ticker_vars.img_button,size:"small"},multiple:!1,library:{type:"image"}})).on("select",(function(){var t=o.state().get("selection").toJSON();if(t.length>0){r.val(t[0].id);var e={action:"mtphr_dnt_single_image_ajax",attachment:t[0],security:ditty_news_ticker_vars.security};jQuery.post(ajaxurl,e,(function(t){i.hide(),n.append(t)}))}})),o.open(),!1;o.open()})),t.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),t("body").on("click",".mtphr-dnt-list-field-mtphr_dnt_mixed_ticks_all input",(function(){i(t(this).parents(".mtphr-dnt-list-field-mtphr_dnt_mixed_ticks_all"))})),t(".mtphr-dnt-list-field-mtphr_dnt_mixed_ticks_all").each((function(){i(t(this))}))})),function(t){var e={init:function(e){return this.each((function(){function i(){a.find(".mtphr-dnt-list-item").length>1?(a.find(".mtphr-dnt-list-handle").show(),a.find(".mtphr-dnt-list-delete").show()):(a.find(".mtphr-dnt-list-handle").hide(),a.find(".mtphr-dnt-list-delete").hide())}function n(){a.find(".mtphr-dnt-list-item").each((function(e){t(this).find("textarea, input, select").each((function(){var i,n;if(t(this).hasClass("wp-editor-area")){var r=t(this).parents(".mtphr-dnt-field-type-wysiwyg");i=r.attr("data-name"),n=r.attr("data-key")}else i=t(this).attr("data-name"),n=t(this).attr("data-key");i&&n&&t(this).attr("name",i+"["+e+"]["+n+"]")}))})),i()}function r(e,i){var r=e.clone();r.find("textarea, input, select").each((function(){"checkbox"===t(this).attr("type")||"radio"===t(this).attr("type")?t(this).attr("checked",!1):t(this).val("")})),r.find("textarea").each((function(){if(t(this).hasClass("wp-editor-area")){var e=t(this).parents(".mtphr-dnt-field-type-wysiwyg"),i=e.attr("data-name");e.children(".wp-core-ui").remove();var r={action:"mtphr_dnt_wysiwyg_ajax",name:i,security:ditty_news_ticker_vars.security};jQuery.post(ajaxurl,r,(function(i){var r,o=t(i).find("textarea").attr("id");e.append(i),"object"==typeof tinyMCE&&"function"==typeof tinyMCE.execCommand&&tinyMCE.execCommand("mceAddEditor",!1,o),n()}))}})),r.hide(),e.after(r),r.fadeIn().addClass(i),t.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),n(),a.trigger("mtphr_dnt_list_item_added",[r,i])}var o={};e&&t.extend(o,e);var a=t(this);t.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),a.sortable({handle:".mtphr-dnt-list-heading",items:".mtphr-dnt-list-item",axis:"y",opacity:.7,placeholder:{element:function(e){var i=t(e).innerHeight();return t('<div class="mtphr-dnt-sort-placeholder" style="height:'+i+'px;"></div>')[0]},update:function(){}},helper:function(e,i){var n=i.children(),r=i.clone();return r.children().each((function(e){t(this).width(n.eq(e).width()),t(this).height(n.eq(e).height())})),r},start:function(e,i){var n=t(i.item);if(n.find(".wp-editor-container").length){var r=n.find(".wp-editor-area").attr("id");tinyMCE.execCommand("mceRemoveEditor",!0,r)}},stop:function(e,i){var n=t(i.item);if(n.find(".wp-editor-container").length){var r=n.find(".wp-editor-area").attr("id");tinyMCE.execCommand("mceAddEditor",!0,r)}}}),a.on("click",".mtphr-dnt-list-delete",(function(e){e.preventDefault(),t(this).parents(".mtphr-dnt-list-item").fadeOut((function(){t(this).remove(),n()}))})),a.on("click",".mtphr-dnt-list-add",(function(e){e.preventDefault(),r(t(this).parents(".mtphr-dnt-list-item"))})),a.on("mtphr_dnt_list_add_item",(function(t,e,i){r(e,i)})),n()}))}};t.fn.mtphr_dnt_list=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 mtphr_dnt_list"):e.init.apply(this,arguments)}}(jQuery);
1
+ !function(t){"use strict";function e(e){return this.each((function(){var n=t(this),r=n.data("bs.mtphr_dnt_affix"),o="object"==typeof e&&e;r||n.data("bs.mtphr_dnt_affix",r=new i(this,o)),"string"==typeof e&&r[e]()}))}var i=function(e,n){this.options=t.extend({},i.DEFAULTS,n),this.$target=t(this.options.target).on("scroll.bs.mtphr_dnt_affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.mtphr_dnt_affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.mtphr_dnt_affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.5",i.RESET="mtphr_dnt_affix mtphr_dnt_affix-top mtphr_dnt_affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,n){var r=this.$target.scrollTop(),o=this.$element.offset(),a=this.$target.height();if(null!==i&&"top"===this.mtphr_dnt_affixed)return r<i&&"top";if("bottom"===this.mtphr_dnt_affixed)return null!==i?!(r+this.unpin<=o.top)&&"bottom":!(r+a<=t-n)&&"bottom";var s=null===this.mtphr_dnt_affixed,h=s?r:o.top,d;return null!==i&&r<=i?"top":null!==n&&h+(s?a:e)>=t-n&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("mtphr_dnt_affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),n=this.options.offset,r=n.top,o=n.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof n&&(o=r=n),"function"==typeof r&&(r=n.top(this.$element)),"function"==typeof o&&(o=n.bottom(this.$element));var s=this.getState(a,e,r,o);if(this.mtphr_dnt_affixed!==s){null!==this.unpin&&this.$element.css("top","");var h="mtphr_dnt_affix"+(s?"-"+s:""),d=t.Event(h+".bs.mtphr_dnt_affix");if(this.$element.trigger(d),d.isDefaultPrevented())return;this.mtphr_dnt_affixed=s,this.unpin="bottom"===s?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(h).trigger(h.replace("mtphr_dnt_affix","mtphr_dnt_affixed")+".bs.mtphr_dnt_affix")}"bottom"===s&&this.$element.offset({top:a-e-o})}};var n=t.fn.mtphr_dnt_affix;t.fn.mtphr_dnt_affix=e,t.fn.mtphr_dnt_affix.Constructor=i,t.fn.mtphr_dnt_affix.noConflict=function(){return t.fn.mtphr_dnt_affix=n,this},t(window).on("load",(function(){t('[data-spy="mtphr_dnt_affix"]').each((function(){var i=t(this),n=i.data();n.offset=n.offset||{},null!==n.offsetBottom&&(n.offset.bottom=n.offsetBottom),null!==n.offsetTop&&(n.offset.top=n.offsetTop),e.call(i,n)}))}))}(jQuery),jQuery(document).ready((function(t){function e(e,i){t("#mtphr-dnt-"+i+"-metaboxes > div").stop(!0,!0).hide();for(var n=e.attr("metabox").split(" "),r=0;r<n.length;r++)t("#"+n[r]).show();e.siblings("a").removeClass("button-primary"),e.addClass("button-primary"),e.siblings("input").val(e.attr("href").substring(1))}function i(t){var e;t.find("input").is(":checked")?t.next().fadeOut():t.next().fadeIn()}var n=t("#mtphr-dnt-settings-select"),r=t("#wpadminbar");n.mtphr_dnt_affix({offset:{top:function(){return t(window).width()<601?this.top=n.offset().top+5:this.top=n.offset().top-r.height()+5}}}),t("#mtphr-dnt-metabox-group-toggles").on("click",".mtphr-dnt-metabox-group-toggle",(function(e){e.preventDefault();var i=t(this).attr("href");t(".mtphr-dnt-metabox-group-toggle").removeClass("active"),t(".mtphr-dnt-metabox-group").removeClass("active"),t(this).addClass("active"),t(i).addClass("active"),t('input[name="_mtphr_dnt_admin_tab"]').val(i)})),t(".mtphr-dnt-codemirror-css").each((function(){var e=t(this).children("textarea");CodeMirror.fromTextArea(e[0],{mode:"css",lineNumbers:!0,lineWrapping:!0,viewportMargin:1/0})})),t(".mtphr-dnt-codemirror-js").each((function(){var e=t(this).children("textarea"),i;CodeMirror.fromTextArea(e[0],{mode:"htmlmixed",lineNumbers:!0,lineWrapping:!0}).setSize(!1,140)})),t('input[name="_mtphr_dnt_admin_javascript"]').length&&t('input[name="_mtphr_dnt_admin_javascript"]').val("ok"),t(".mtphr-dnt-type-toggle.button-primary").length&&e(t(".mtphr-dnt-type-toggle.button-primary"),"type"),t(".mtphr-dnt-mode-toggle.button-primary").length&&e(t(".mtphr-dnt-mode-toggle.button-primary"),"mode"),t("#mtphr-dnt-type-select").on("click",".mtphr-dnt-type-toggle",(function(i){i.preventDefault(),t(this).hasClass("button-primary")||e(t(this),"type")})),t("#mtphr-dnt-mode-select").on("click",".mtphr-dnt-mode-toggle",(function(i){i.preventDefault(),t(this).hasClass("button-primary")||e(t(this),"mode")})),t(".mtphr-dnt-sort").length>0&&(t(".mtphr-dnt-sort").sortable({handle:".mtphr-dnt-sort-heading",items:".mtphr-dnt-sort-item",axis:"y",opacity:.7,placeholder:{element:function(e){var i=t(e).innerHeight();return t('<div class="mtphr-dnt-sort-placeholder" style="height:'+i+'px;"></div>')[0]},update:function(){}},helper:function(e,i){var n=i.children(),r=i.clone();return r.children().each((function(e){t(this).width(n.eq(e).width()),t(this).height(n.eq(e).height())})),r}}),t("body").on("click",".mtphr-dnt-sort-heading.optional",(function(e){e.preventDefault();var i=t(this).parents(".mtphr-dnt-sort-item"),n=t(this).next(".mtphr-dnt-sort-item-fields"),r=t(this).children("input");i.hasClass("active")?(i.removeClass("active"),r.val("off"),n.length&&n.stop(!0,!0).slideUp(1e3,"easeOutQuint")):(i.addClass("active"),r.val("on"),n.length&&n.stop(!0,!0).slideDown(1e3,"easeOutQuint"))}))),t(".mtphr-dnt-list").mtphr_dnt_list(),t("body").on("click",".mtphr-dnt-single-image .mtphr-dnt-delete",(function(e){e.preventDefault();var i=t(this).parent(),n=i.siblings(".mtphr-dnt-single-image-upload"),r;i.siblings("input").val(""),i.remove(),n.show()})),t("body").on("click",".mtphr-dnt-single-image-upload",(function(e){e.preventDefault();var i=t(this),n=i.parent(),r=n.children("input"),o;if(!o)return(o=wp.media({title:ditty_news_ticker_vars.img_title,button:{text:ditty_news_ticker_vars.img_button,size:"small"},multiple:!1,library:{type:"image"}})).on("select",(function(){var t=o.state().get("selection").toJSON();if(t.length>0){r.val(t[0].id);var e={action:"mtphr_dnt_single_image_ajax",attachment:t[0],security:ditty_news_ticker_vars.security};jQuery.post(ajaxurl,e,(function(t){i.hide(),n.append(t)}))}})),o.open(),!1;o.open()})),t.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),t("body").on("click",".mtphr-dnt-list-field-mtphr_dnt_mixed_ticks_all input",(function(){i(t(this).parents(".mtphr-dnt-list-field-mtphr_dnt_mixed_ticks_all"))})),t(".mtphr-dnt-list-field-mtphr_dnt_mixed_ticks_all").each((function(){i(t(this))}))})),function(t){var e={init:function(e){return this.each((function(){function i(){a.find(".mtphr-dnt-list-item").length>1?(a.find(".mtphr-dnt-list-handle").show(),a.find(".mtphr-dnt-list-delete").show()):(a.find(".mtphr-dnt-list-handle").hide(),a.find(".mtphr-dnt-list-delete").hide())}function n(){a.find(".mtphr-dnt-list-item").each((function(e){t(this).find("textarea, input, select").each((function(){var i,n;if(t(this).hasClass("wp-editor-area")){var r=t(this).parents(".mtphr-dnt-field-type-wysiwyg");i=r.attr("data-name"),n=r.attr("data-key")}else i=t(this).attr("data-name"),n=t(this).attr("data-key");i&&n&&t(this).attr("name",i+"["+e+"]["+n+"]")}))})),i()}function r(e,i){var r=e.clone();r.find("textarea, input, select").each((function(){"checkbox"===t(this).attr("type")||"radio"===t(this).attr("type")?t(this).attr("checked",!1):t(this).val("")})),r.find("textarea").each((function(){if(t(this).hasClass("wp-editor-area")){var e=t(this).parents(".mtphr-dnt-field-type-wysiwyg"),i=e.attr("data-name");e.children(".wp-core-ui").remove();var r={action:"mtphr_dnt_wysiwyg_ajax",name:i,security:ditty_news_ticker_vars.security};jQuery.post(ajaxurl,r,(function(i){var r,o=t(i).find("textarea").attr("id");e.append(i),"object"==typeof tinyMCE&&"function"==typeof tinyMCE.execCommand&&tinyMCE.execCommand("mceAddEditor",!1,o),n()}))}})),r.hide(),e.after(r),r.fadeIn().addClass(i),t.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),n(),a.trigger("mtphr_dnt_list_item_added",[r,i])}var o={};e&&t.extend(o,e);var a=t(this);t.protip({defaults:{position:"top",size:"small",scheme:"black",classes:"ditty-protip"}}),a.sortable({handle:".mtphr-dnt-list-heading",items:".mtphr-dnt-list-item",axis:"y",opacity:.7,placeholder:{element:function(e){var i=t(e).innerHeight();return t('<div class="mtphr-dnt-sort-placeholder" style="height:'+i+'px;"></div>')[0]},update:function(){}},helper:function(e,i){var n=i.children(),r=i.clone();return r.children().each((function(e){t(this).width(n.eq(e).width()),t(this).height(n.eq(e).height())})),r},start:function(e,i){var n=t(i.item);if(n.find(".wp-editor-container").length){var r=n.find(".wp-editor-area").attr("id");tinyMCE.execCommand("mceRemoveEditor",!0,r)}},stop:function(e,i){var n=t(i.item);if(n.find(".wp-editor-container").length){var r=n.find(".wp-editor-area").attr("id");tinyMCE.execCommand("mceAddEditor",!0,r)}}}),a.on("click",".mtphr-dnt-list-delete",(function(e){e.preventDefault(),t(this).parents(".mtphr-dnt-list-item").fadeOut((function(){t(this).remove(),n()}))})),a.on("click",".mtphr-dnt-list-add",(function(e){e.preventDefault(),r(t(this).parents(".mtphr-dnt-list-item"))})),a.on("mtphr_dnt_list_add_item",(function(t,e,i){r(e,i)})),n()}))}};t.fn.mtphr_dnt_list=function(t){if(e[t])return e[t].apply(this,Array.prototype.slice.call(arguments,1));if("object"!=typeof t&&t)throw new Error("Method "+t+" does not exist in mtphr_dnt_list");return e.init.apply(this,arguments)}}(jQuery);
readme.txt CHANGED
@@ -72,6 +72,9 @@ The most common cause for an unresponsive ticker (when using scroll or rotate mo
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 2.3.1 =
76
  * Deprecated javascript updates
77
 
72
 
73
  == Changelog ==
74
 
75
+ = 2.3.2 =
76
+ * Deprecated javascript updates
77
+
78
  = 2.3.1 =
79
  * Deprecated javascript updates
80