Ditty News Ticker - Version 2.2.12

Version Description

  • Resolved javascript imagesloaded issue
Download this release

Release Info

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

Code changes from version 2.2.11 to 2.2.12

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.11
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.11' );
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.12
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.12' );
66
  }
67
 
68
  // Plugin Folder Path
inc/static.php CHANGED
@@ -62,7 +62,7 @@ function mtphr_dnt_scripts() {
62
  wp_enqueue_script( 'jquery-easing', plugins_url('ditty-news-ticker/inc/static/js/jquery.easing.js'), array('jquery'), '1.4.1', true );
63
 
64
  // Register images loaded
65
- wp_enqueue_script( 'imagesLoaded', plugins_url('ditty-news-ticker/inc/static/js/imagesloaded.pkgd.min.js'), array('jquery'), '4.1.0', true );
66
 
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') );
62
  wp_enqueue_script( 'jquery-easing', plugins_url('ditty-news-ticker/inc/static/js/jquery.easing.js'), array('jquery'), '1.4.1', true );
63
 
64
  // Register images loaded
65
+ wp_enqueue_script( 'imagesLoaded', plugins_url('ditty-news-ticker/inc/static/js/imagesloaded.pkgd.min.js'), array('jquery'), '4.1.4', true );
66
 
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') );
inc/static/js/ditty-news-ticker.js CHANGED
@@ -143,14 +143,37 @@
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 = [];
149
 
150
  //mtphr_dnt_scroll_set_height();
151
-
152
- $ticker.imagesLoaded( function() {
153
- mtphr_dnt_scroll_set_height();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
 
155
  // Loop through the tick items
156
  $ticker.find('.mtphr-dnt-tick').each( function() {
@@ -167,10 +190,11 @@
167
 
168
  // Set the initial position of the ticks
169
  mtphr_dnt_scroll_reset_ticks();
170
-
171
  // Start the scroll loop
172
  mtphr_dnt_scroll_loop();
173
- });
 
174
 
175
  // Clear the loop on mouse hover
176
  $ticker.hover(
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 = [];
149
 
150
  //mtphr_dnt_scroll_set_height();
151
+ if( $ticker.find('img').length ) {
152
+
153
+ $ticker.imagesLoaded( function() {
154
+ mtphr_dnt_scroll_set_height();
155
+
156
+ // Loop through the tick items
157
+ $ticker.find('.mtphr-dnt-tick').each( function() {
158
+
159
+ // Make sure the ticker is visible
160
+ $(this).show();
161
+
162
+ // Add the tick data
163
+ var tick = [{'headline':$(this)}];
164
+
165
+ // Add the tick to the array
166
+ ticks.push(tick);
167
+ });
168
+
169
+ // Set the initial position of the ticks
170
+ mtphr_dnt_scroll_reset_ticks();
171
+
172
+ // Start the scroll loop
173
+ mtphr_dnt_scroll_loop();
174
+ });
175
+ } else {
176
+ mtphr_dnt_scroll_set_height();
177
 
178
  // Loop through the tick items
179
  $ticker.find('.mtphr-dnt-tick').each( function() {
190
 
191
  // Set the initial position of the ticks
192
  mtphr_dnt_scroll_reset_ticks();
193
+
194
  // Start the scroll loop
195
  mtphr_dnt_scroll_loop();
196
+ }
197
+
198
 
199
  // Clear the loop on mouse hover
200
  $ticker.hover(
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?n():"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 r(){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 n(){var e=S.find(".mtphr-dnt-tick:first");if(e.attr("style")){var i,n=e.attr("style").split("width:");it=!(n.length>1)}tt=[],S.imagesLoaded((function(){r(),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.stop(!0,!0).css("left",e+"px")):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.stop(!0,!0).css("top",e+"px")):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=f(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=f(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=f(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=f(t):e>K.scroll_spacing&&u(t),e}function f(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 d(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&&(d(0),tt[0][0].visible=!0):(d(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(rt)}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(),rt=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]),nt=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),nt){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(nt){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],r=i.height();t.css("height",r+"px"),i.css({opacity:1,left:"auto"})}function D(t,e,i,r,n){e.css({opacity:0,left:"auto"}),e.stop().animate({opacity:1},r,n);var s=e.height();t.stop().animate({height:s+"px"},r,n)}function W(e,i,r,n,s){i.stop().animate({opacity:0},n,s,(function(){t(this).css({left:parseFloat(Z+K.offset)+"px"}),i.remove(),e.append(i)}))}function z(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,left:0})}function L(t,e,i,r,n){var s=e.height();e.css({opacity:1,left:parseFloat(Z+K.offset)+"px"}),t.stop().animate({height:s+"px"},r,n,(function(){})),e.stop().animate({left:"0"},r,n,(function(){}))}function O(t,e,i,r,n){e.stop().animate({left:"-"+parseFloat(Z+K.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 s=e.height();e.css({opacity:1,left:"-"+parseFloat(Z+K.offset)+"px"}),t.stop().animate({height:s+"px"},r,n,(function(){})),e.stop().animate({left:"0"},r,n)}function E(t,e,i,r,n){e.stop().animate({left:parseFloat(Z+K.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 s=e.height();e.css({opacity:1,top:"-"+parseFloat(s+K.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},r,n),e.stop().animate({top:"0"},r,n)}function Q(t,e,i,r,n){var s=i.height();e.stop().animate({top:parseFloat(s+K.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 s=e.height();e.css({opacity:1,top:parseFloat(i.height()+K.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},r,n),e.stop().animate({top:"0"},r,n)}function B(t,e,i,r,n){var s=e.height();e.stop().animate({top:"-"+parseFloat(s+K.offset)+"px"},r,n,(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?nt="slide_right":"slide_right"===K.rotate_type?nt="slide_left":"slide_down"===K.rotate_type?nt="slide_up":"slide_up"===K.rotate_type&&(nt="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,rt,nt=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 r=i<N.current_tick?1:0;K.nav_reverse&&r&&("slide_left"===K.rotate_type?nt="slide_right":"slide_right"===K.rotate_type?nt="slide_left":"slide_down"===K.rotate_type?nt="slide_up":"slide_up"===K.rotate_type&&(nt="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||(nt="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||(nt="slide_right"),K.nav_reverse&&("slide_down"===K.rotate_type?nt="slide_up":"slide_up"===K.rotate_type&&(nt="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,r,n){clearInterval(et),P.find(".mtphr-dnt-tick").remove(),r.each((function(){S.append(t(this))})),setTimeout((function(){i()}),n)})),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(){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.stop(!0,!0).css("left",e+"px")):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.stop(!0,!0).css("top",e+"px")):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);
inc/static/js/imagesloaded.pkgd.min.js CHANGED
@@ -1,7 +1,7 @@
1
  /*!
2
- * imagesLoaded PACKAGED v4.1.0
3
  * JavaScript is all like "You images are done yet or what?"
4
  * MIT License
5
  */
6
 
7
- !function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}(this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||[];return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e}function o(t,e,r){return this instanceof o?("string"==typeof t&&(t=document.querySelectorAll(t)),this.elements=n(t),this.options=i({},this.options),"function"==typeof e?r=e:i(this.options,e),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(function(){this.check()}.bind(this))):new o(t,e,r)}function r(t){this.img=t}function s(t,e){this.url=t,this.element=e,this.img=new Image}var h=t.jQuery,a=t.console;o.prototype=Object.create(e.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),this.options.background===!0&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&d[e]){for(var i=t.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=t.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var d={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(e.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,t),n=i.exec(e.backgroundImage)}},o.prototype.addImage=function(t){var e=new r(t);this.images.push(e)},o.prototype.addBackground=function(t,e){var i=new s(t,e);this.images.push(i)},o.prototype.check=function(){function t(t,i,n){setTimeout(function(){e.progress(t,i,n)})}var e=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},o.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,t,e)},o.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},r.prototype=Object.create(e.prototype),r.prototype.check=function(){var t=this.getIsImageComplete();return t?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},r.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},r.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var t=this.getIsImageComplete();t&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},o.makeJQueryPlugin=function(e){e=e||t.jQuery,e&&(h=e,h.fn.imagesLoaded=function(t,e){var i=new o(this,t,e);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});
1
  /*!
2
+ * imagesLoaded PACKAGED v4.1.4
3
  * JavaScript is all like "You images are done yet or what?"
4
  * MIT License
5
  */
6
 
7
+ !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});
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.2.11 =
76
  * Resolved RTL, scrolling right issues
77
 
@@ -519,4 +522,4 @@ The most common cause for an unresponsive ticker (when using scroll or rotate mo
519
 
520
  == Upgrade Notice ==
521
 
522
- Resolved RTL, scrolling right issues
72
 
73
  == Changelog ==
74
 
75
+ = 2.2.12 =
76
+ * Resolved javascript imagesloaded issue
77
+
78
  = 2.2.11 =
79
  * Resolved RTL, scrolling right issues
80
 
522
 
523
  == Upgrade Notice ==
524
 
525
+ Resolved javascript imagesloaded issue