Version Description
- Javascript updates to scroll functionality
- EDD Software Licensing updates
Download this release
Release Info
Developer | metaphorcreations |
Plugin | Ditty News Ticker |
Version | 2.3.3 |
Comparing to | |
See all releases |
Code changes from version 2.3.4 to 2.3.3
- ditty-news-ticker.php +2 -2
- inc/static.php +1 -1
- inc/static/css/style-admin.css +21 -17
- inc/static/js/ditty-news-ticker.js +40 -50
- inc/static/js/ditty-news-ticker.min.js +1 -1
- inc/static/js/partials/admin-general.js +1 -1
- inc/static/js/script-admin.min.js +1 -1
- inc/static/sass/style-admin.scss +11 -11
- readme.txt +0 -4
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.
|
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.
|
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.3
|
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.3' );
|
66 |
}
|
67 |
|
68 |
// Plugin Folder Path
|
inc/static.php
CHANGED
@@ -40,7 +40,7 @@ function mtphr_dnt_scripts( $hook ) {
|
|
40 |
wp_enqueue_style( 'ditty-news-ticker-font', plugins_url('ditty-news-ticker/inc/static/libs/fontastic/styles.css'), false, MTPHR_DNT_VERSION );
|
41 |
|
42 |
// Load the plugin css
|
43 |
-
wp_enqueue_style( 'ditty-news-ticker', plugins_url('ditty-news-ticker/inc/static/css/style-admin.css'), array('dashicons'),
|
44 |
|
45 |
} else {
|
46 |
|
40 |
wp_enqueue_style( 'ditty-news-ticker-font', plugins_url('ditty-news-ticker/inc/static/libs/fontastic/styles.css'), false, MTPHR_DNT_VERSION );
|
41 |
|
42 |
// Load the plugin css
|
43 |
+
wp_enqueue_style( 'ditty-news-ticker', plugins_url('ditty-news-ticker/inc/static/css/style-admin.css'), array('dashicons'), MTPHR_DNT_VERSION );
|
44 |
|
45 |
} else {
|
46 |
|
inc/static/css/style-admin.css
CHANGED
@@ -125,7 +125,8 @@
|
|
125 |
background: gray;
|
126 |
margin: 2px 0;
|
127 |
box-shadow: none;
|
128 |
-
transition: background-color .25s ease, border-color .25s ease;
|
|
|
129 |
#mtphr-dnt-code-copy .button:hover {
|
130 |
background-color: #999999; }
|
131 |
#mtphr-dnt-code-copy .button:hover i {
|
@@ -205,6 +206,8 @@
|
|
205 |
background: #FFF;
|
206 |
border: 1px solid #dfdfdf;
|
207 |
padding: 3px 24px 3px 3px;
|
|
|
|
|
208 |
border-radius: 3px; }
|
209 |
|
210 |
.mtphr-dnt-single-image img {
|
@@ -264,7 +267,8 @@
|
|
264 |
padding: 5px 10px;
|
265 |
margin: -10px -10px 10px;
|
266 |
cursor: pointer;
|
267 |
-
transition: background-color .25s ease, border-radius .25s ease;
|
|
|
268 |
.mtphr-dnt-list-heading:active, .mtphr-dnt-list-heading:focus {
|
269 |
box-shadow: none;
|
270 |
outline: none; }
|
@@ -274,16 +278,11 @@
|
|
274 |
order: 10; }
|
275 |
|
276 |
.mtphr-dnt-list-buttons {
|
277 |
-
position: relative;
|
278 |
-
z-index: 999;
|
279 |
-
display: flex;
|
280 |
-
flex-direction: row;
|
281 |
-
align-items: stretch;
|
282 |
-
justify-content: flex-start;
|
283 |
margin: -5px -10px;
|
284 |
margin-left: auto;
|
285 |
order: 20; }
|
286 |
.mtphr-dnt-list-buttons a {
|
|
|
287 |
display: block;
|
288 |
width: 30px;
|
289 |
height: 30px;
|
@@ -364,7 +363,8 @@
|
|
364 |
padding: 10px;
|
365 |
border-radius: 5px;
|
366 |
cursor: pointer;
|
367 |
-
transition: background-color .25s ease, border-radius .25s ease;
|
|
|
368 |
.mtphr-dnt-sort-heading:active, .mtphr-dnt-sort-heading:focus {
|
369 |
box-shadow: none;
|
370 |
outline: none; }
|
@@ -388,7 +388,8 @@
|
|
388 |
background: #FFF;
|
389 |
border-radius: 12px;
|
390 |
margin: -2px 8px -3px 0;
|
391 |
-
transition: color .25s ease;
|
|
|
392 |
.mtphr-dnt-sort-heading .dashicons-menu {
|
393 |
color: #333333;
|
394 |
margin-right: 8px; }
|
@@ -497,15 +498,13 @@
|
|
497 |
display: block; }
|
498 |
|
499 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button {
|
500 |
-
min-height: 0 !important;
|
501 |
-
font-size: 13px !important;
|
502 |
-
line-height: 2.15384615 !important;
|
503 |
color: #FFF;
|
504 |
border-color: #333333;
|
505 |
background: gray;
|
506 |
margin: 2px 0;
|
507 |
box-shadow: none;
|
508 |
-
transition: background-color .25s ease, border-color .25s ease;
|
|
|
509 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button:hover {
|
510 |
background-color: #999999; }
|
511 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button:hover i {
|
@@ -529,9 +528,10 @@
|
|
529 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button i {
|
530 |
font-size: 16px;
|
531 |
line-height: 16px;
|
532 |
-
margin:
|
533 |
opacity: .5;
|
534 |
-
transition: opacity .25s ease;
|
|
|
535 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button i:before {
|
536 |
vertical-align: middle; }
|
537 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button i.fontastic {
|
@@ -539,7 +539,7 @@
|
|
539 |
vertical-align: top;
|
540 |
font-size: 14px;
|
541 |
line-height: 14px;
|
542 |
-
margin-top:
|
543 |
|
544 |
.mtphr-dnt-metabox-toggle {
|
545 |
padding-bottom: 20px; }
|
@@ -622,6 +622,10 @@
|
|
622 |
padding-left: 58px; } }
|
623 |
|
624 |
@media (max-width: 782px) {
|
|
|
|
|
|
|
|
|
625 |
.mtphr-dnt-metabox input, .mtphr-dnt-metabox textarea {
|
626 |
font-size: 14px; }
|
627 |
.mtphr-dnt-metabox input[type="text"],
|
125 |
background: gray;
|
126 |
margin: 2px 0;
|
127 |
box-shadow: none;
|
128 |
+
-webkit-transition: background-color 0.25s ease, border-color 0.25s ease;
|
129 |
+
transition: background-color 0.25s ease, border-color 0.25s ease; }
|
130 |
#mtphr-dnt-code-copy .button:hover {
|
131 |
background-color: #999999; }
|
132 |
#mtphr-dnt-code-copy .button:hover i {
|
206 |
background: #FFF;
|
207 |
border: 1px solid #dfdfdf;
|
208 |
padding: 3px 24px 3px 3px;
|
209 |
+
-webkit-border-radius: 3px;
|
210 |
+
-moz-border-radius: 3px;
|
211 |
border-radius: 3px; }
|
212 |
|
213 |
.mtphr-dnt-single-image img {
|
267 |
padding: 5px 10px;
|
268 |
margin: -10px -10px 10px;
|
269 |
cursor: pointer;
|
270 |
+
-webkit-transition: background-color 0.25s ease, border-radius 0.25s ease;
|
271 |
+
transition: background-color 0.25s ease, border-radius 0.25s ease; }
|
272 |
.mtphr-dnt-list-heading:active, .mtphr-dnt-list-heading:focus {
|
273 |
box-shadow: none;
|
274 |
outline: none; }
|
278 |
order: 10; }
|
279 |
|
280 |
.mtphr-dnt-list-buttons {
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
margin: -5px -10px;
|
282 |
margin-left: auto;
|
283 |
order: 20; }
|
284 |
.mtphr-dnt-list-buttons a {
|
285 |
+
float: left;
|
286 |
display: block;
|
287 |
width: 30px;
|
288 |
height: 30px;
|
363 |
padding: 10px;
|
364 |
border-radius: 5px;
|
365 |
cursor: pointer;
|
366 |
+
-webkit-transition: background-color 0.25s ease, border-radius 0.25s ease;
|
367 |
+
transition: background-color 0.25s ease, border-radius 0.25s ease; }
|
368 |
.mtphr-dnt-sort-heading:active, .mtphr-dnt-sort-heading:focus {
|
369 |
box-shadow: none;
|
370 |
outline: none; }
|
388 |
background: #FFF;
|
389 |
border-radius: 12px;
|
390 |
margin: -2px 8px -3px 0;
|
391 |
+
-webkit-transition: color 0.25s ease;
|
392 |
+
transition: color 0.25s ease; }
|
393 |
.mtphr-dnt-sort-heading .dashicons-menu {
|
394 |
color: #333333;
|
395 |
margin-right: 8px; }
|
498 |
display: block; }
|
499 |
|
500 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button {
|
|
|
|
|
|
|
501 |
color: #FFF;
|
502 |
border-color: #333333;
|
503 |
background: gray;
|
504 |
margin: 2px 0;
|
505 |
box-shadow: none;
|
506 |
+
-webkit-transition: background-color 0.25s ease, border-color 0.25s ease;
|
507 |
+
transition: background-color 0.25s ease, border-color 0.25s ease; }
|
508 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button:hover {
|
509 |
background-color: #999999; }
|
510 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button:hover i {
|
528 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button i {
|
529 |
font-size: 16px;
|
530 |
line-height: 16px;
|
531 |
+
margin: 2px 0 0 -5px;
|
532 |
opacity: .5;
|
533 |
+
-webkit-transition: opacity 0.25s ease;
|
534 |
+
transition: opacity 0.25s ease; }
|
535 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button i:before {
|
536 |
vertical-align: middle; }
|
537 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button i.fontastic {
|
539 |
vertical-align: top;
|
540 |
font-size: 14px;
|
541 |
line-height: 14px;
|
542 |
+
margin-top: 5px; }
|
543 |
|
544 |
.mtphr-dnt-metabox-toggle {
|
545 |
padding-bottom: 20px; }
|
622 |
padding-left: 58px; } }
|
623 |
|
624 |
@media (max-width: 782px) {
|
625 |
+
.wp-core-ui #mtphr-dnt-settings-select .button i {
|
626 |
+
margin-top: -1px; }
|
627 |
+
.wp-core-ui #mtphr-dnt-settings-select .button i.fontastic {
|
628 |
+
margin-top: 2px; }
|
629 |
.mtphr-dnt-metabox input, .mtphr-dnt-metabox textarea {
|
630 |
font-size: 14px; }
|
631 |
.mtphr-dnt-metabox input[type="text"],
|
inc/static/js/ditty-news-ticker.js
CHANGED
@@ -69,9 +69,8 @@
|
|
69 |
ticker_height = 0,
|
70 |
ticks = [],
|
71 |
ticker_scroll,
|
72 |
-
ticker_paused = false,
|
73 |
ticker_scroll_resize = true,
|
74 |
-
|
75 |
rotate_adjustment = settings.rotate_type,
|
76 |
after_change_timeout,
|
77 |
scroll_interval = 10,
|
@@ -216,13 +215,11 @@
|
|
216 |
}
|
217 |
|
218 |
function mtphr_dnt_scroll_pause() {
|
219 |
-
|
220 |
-
//clearInterval( ticker_scroll );
|
221 |
}
|
222 |
|
223 |
function mtphr_dnt_scroll_play() {
|
224 |
-
|
225 |
-
//mtphr_dnt_scroll_loop();
|
226 |
}
|
227 |
|
228 |
/**
|
@@ -233,47 +230,44 @@
|
|
233 |
function mtphr_dnt_scroll_loop() {
|
234 |
|
235 |
// Start the ticker timer
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
ticks[i][0].headline.css('opacity', 0);
|
252 |
-
} else {
|
253 |
-
ticks[i][0].headline.css('opacity', 1);
|
254 |
-
}
|
255 |
-
ticks[i][0].headline.css( {
|
256 |
-
transform: 'translateX( ' + pos + 'px )',
|
257 |
-
} );
|
258 |
} else {
|
259 |
-
|
260 |
-
pos = (settings.scroll_direction === 'up') ? mtphr_dnt_scroll_up(i) : mtphr_dnt_scroll_down(i);
|
261 |
-
if( pos === 'reset' ) {
|
262 |
-
pos = ticks[i][0].reset;
|
263 |
-
ticks[i][0].headline.css('opacity', 0);
|
264 |
-
} else {
|
265 |
-
ticks[i][0].headline.css('opacity', 1);
|
266 |
-
}
|
267 |
-
ticks[i][0].headline.css( {
|
268 |
-
transform: 'translateY( ' + pos + 'px )',
|
269 |
-
} );
|
270 |
}
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
}
|
|
|
|
|
274 |
}
|
275 |
}
|
276 |
-
setTimeout( dnt_scroll_run, scroll_interval );
|
277 |
}, scroll_interval );
|
278 |
}
|
279 |
|
@@ -607,7 +601,7 @@
|
|
607 |
}
|
608 |
|
609 |
function mtphr_dnt_rotator_pause() {
|
610 |
-
clearInterval(
|
611 |
}
|
612 |
|
613 |
|
@@ -683,7 +677,7 @@
|
|
683 |
|
684 |
// Start the ticker timer
|
685 |
mtphr_dnt_rotator_pause();
|
686 |
-
|
687 |
|
688 |
// Find the new tick
|
689 |
var new_tick = parseInt(vars.current_tick + 1);
|
@@ -1465,18 +1459,14 @@
|
|
1465 |
|
1466 |
if( $container.width() === 0 ) {
|
1467 |
|
1468 |
-
var
|
1469 |
-
setTimeout( function dnt_init_check() {
|
1470 |
|
1471 |
if( $container.width() > 10 ) {
|
1472 |
-
|
1473 |
ticker_width = $ticker.outerWidth(true);
|
1474 |
mtphr_dnt_init();
|
1475 |
}
|
1476 |
|
1477 |
-
if ( loop_mtphr_dnt_init_timer ) {
|
1478 |
-
setTimeout( dnt_init_check, 100 );
|
1479 |
-
}
|
1480 |
}, 100 );
|
1481 |
|
1482 |
} else {
|
69 |
ticker_height = 0,
|
70 |
ticks = [],
|
71 |
ticker_scroll,
|
|
|
72 |
ticker_scroll_resize = true,
|
73 |
+
ticker_delay,
|
74 |
rotate_adjustment = settings.rotate_type,
|
75 |
after_change_timeout,
|
76 |
scroll_interval = 10,
|
215 |
}
|
216 |
|
217 |
function mtphr_dnt_scroll_pause() {
|
218 |
+
clearInterval( ticker_scroll );
|
|
|
219 |
}
|
220 |
|
221 |
function mtphr_dnt_scroll_play() {
|
222 |
+
mtphr_dnt_scroll_loop();
|
|
|
223 |
}
|
224 |
|
225 |
/**
|
230 |
function mtphr_dnt_scroll_loop() {
|
231 |
|
232 |
// Start the ticker timer
|
233 |
+
clearInterval( ticker_scroll );
|
234 |
+
ticker_scroll = setInterval( function() {
|
235 |
+
|
236 |
+
for( var i=0; i < vars.tick_count; i++ ) {
|
237 |
+
|
238 |
+
if( ticks[i][0].visible === true ) {
|
239 |
+
|
240 |
+
var pos = 'reset';
|
241 |
+
|
242 |
+
if( settings.scroll_direction === 'left' || settings.scroll_direction === 'right' ) {
|
243 |
+
|
244 |
+
pos = (settings.scroll_direction === 'left') ? mtphr_dnt_scroll_left(i) : mtphr_dnt_scroll_right(i);
|
245 |
+
if( pos === 'reset' ) {
|
246 |
+
pos = ticks[i][0].reset;
|
247 |
+
ticks[i][0].headline.css('opacity', 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
} else {
|
249 |
+
ticks[i][0].headline.css('opacity', 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
}
|
251 |
+
ticks[i][0].headline.css( {
|
252 |
+
transform: 'translateX( ' + pos + 'px )',
|
253 |
+
} );
|
254 |
+
} else {
|
255 |
+
|
256 |
+
pos = (settings.scroll_direction === 'up') ? mtphr_dnt_scroll_up(i) : mtphr_dnt_scroll_down(i);
|
257 |
+
if( pos === 'reset' ) {
|
258 |
+
pos = ticks[i][0].reset;
|
259 |
+
ticks[i][0].headline.css('opacity', 0);
|
260 |
+
} else {
|
261 |
+
ticks[i][0].headline.css('opacity', 1);
|
262 |
+
}
|
263 |
+
ticks[i][0].headline.css( {
|
264 |
+
transform: 'translateY( ' + pos + 'px )',
|
265 |
+
} );
|
266 |
}
|
267 |
+
|
268 |
+
ticks[i][0].position = pos;
|
269 |
}
|
270 |
}
|
|
|
271 |
}, scroll_interval );
|
272 |
}
|
273 |
|
601 |
}
|
602 |
|
603 |
function mtphr_dnt_rotator_pause() {
|
604 |
+
clearInterval( ticker_delay );
|
605 |
}
|
606 |
|
607 |
|
677 |
|
678 |
// Start the ticker timer
|
679 |
mtphr_dnt_rotator_pause();
|
680 |
+
ticker_delay = setInterval( function() {
|
681 |
|
682 |
// Find the new tick
|
683 |
var new_tick = parseInt(vars.current_tick + 1);
|
1459 |
|
1460 |
if( $container.width() === 0 ) {
|
1461 |
|
1462 |
+
var mtphr_dnt_init_timer = setInterval( function() {
|
|
|
1463 |
|
1464 |
if( $container.width() > 10 ) {
|
1465 |
+
clearInterval(mtphr_dnt_init_timer);
|
1466 |
ticker_width = $ticker.outerWidth(true);
|
1467 |
mtphr_dnt_init();
|
1468 |
}
|
1469 |
|
|
|
|
|
|
|
1470 |
}, 100 );
|
1471 |
|
1472 |
} else {
|
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(){P.tick_count=S.find(".mtphr-dnt-tick").length,P.tick_count>0&&("scroll"===N.type?n():"rotate"===N.type&&m()),N.after_load.call(R,S),R.trigger("mtphr_dnt_after_load_single",[P,it]),t("body").trigger("mtphr_dnt_after_load",[R,P,it])}function r(){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 n(){var e=S.find(".mtphr-dnt-tick:first");if(e.attr("style")){var i,n=e.attr("style").split("width:");st=!(n.length>1)}it=[],S.find("img").length?S.imagesLoaded((function(){r(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];it.push(e)})),g(),o()})):(r(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];it.push(e)})),g(),o()),S.on({mouseenter:function(){N.scroll_pause&&s()},mouseleave:function(){N.scroll_pause&&!P.paused&&a()}})}function s(){nt=!0}function a(){nt=!1}function o(){setTimeout((function t(){if(!nt)for(var e=0;e<P.tick_count;e++)if(!0===it[e][0].visible){var i="reset";"left"===N.scroll_direction||"right"===N.scroll_direction?("reset"===(i="left"===N.scroll_direction?c(e):p(e))?(i=it[e][0].reset,it[e][0].headline.css("opacity",0)):it[e][0].headline.css("opacity",1),it[e][0].headline.css({transform:"translateX( "+i+"px )"})):("reset"===(i="up"===N.scroll_direction?l(e):_(e))?(i=it[e][0].reset,it[e][0].headline.css("opacity",0)):it[e][0].headline.css("opacity",1),it[e][0].headline.css({transform:"translateY( "+i+"px )"})),it[e][0].position=i}setTimeout(t,pt)}),pt)}function c(t){var e=parseFloat(it[t][0].position-N.scroll_speed*lt);return e<-(it[t][0].headline.width()+N.offset)?e=f(t):e<parseFloat(tt-it[t][0].headline.width()-N.scroll_spacing)&&d(t),e}function p(t){var e=parseFloat(it[t][0].position+N.scroll_speed*lt);return e>tt+N.offset?e=f(t):e>N.scroll_spacing&&d(t),e}function l(t){var e=parseFloat(it[t][0].position-N.scroll_speed*lt);return e<-(it[t][0].headline.height()+N.offset)?e=f(t):e<et-it[t][0].headline.height()-N.scroll_spacing&&d(t),e}function _(t){var e=parseFloat(it[t][0].position+N.scroll_speed*lt);return e>et+N.offset?e=f(t):e>N.scroll_spacing&&d(t),e}function f(e){return P.tick_count>1&&(it[e][0].visible=!1),P.tick_count===e+1&&(R.trigger("mtphr_dnt_scroll_complete",[P,it]),t("body").trigger("mtphr_dnt_scroll_complete",[R,P,it])),"reset"}function u(t){!1===it[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 d(t){t===P.tick_count-1?N.scroll_loop&&(u(0),it[0][0].visible=!0):(u(parseInt(t+1)),it[t+1][0].visible=!0)}function h(){for(var t=0;t<P.tick_count;t++){var e,i=it[t][0].headline;switch(N.scroll_direction){case"left":e=tt+N.offset,!1===it[t][0].visible&&i.css("transform","translateX( "+e+"px )");break;case"right":e=parseInt("-"+(i.width()+N.offset)),!1===it[t][0].visible&&i.css("transform","translateX( "+e+"px )");break;case"up":st&&i.css("width",tt),e=parseInt(et+N.offset),!1===it[t][0].visible&&i.css("transform","translateY( "+e+"px )");break;case"down":st&&i.css("width",tt),e=parseInt("-"+(i.height()+N.offset)),!1===it[t][0].visible&&i.css("transform","translateY( "+e+"px )");break}it[t][0].width=i.width(),it[t][0].height=i.height(),!1===it[t][0].visible&&(it[t][0].position=e),it[t][0].reset=e}}function g(){for(var t,e,i=0;i<P.tick_count;i++)if(it[i]){switch(e=it[i][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":st&&e.css("width",tt),t=parseInt(et+N.offset),e.css("transform","translateY( "+t+"px )");break;case"down":st&&e.css("width",tt),t=parseInt("-"+(e.height()+N.offset)),e.css("transform","translateY( "+t+"px )");break}it[i][0].width=e.width(),it[i][0].height=e.height(),it[i][0].position=t,it[i][0].reset=t,it[i][0].visible=!1,e=it[i][0].headline}if(P.current_tick=0,it[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),i=0;i<P.tick_count;i++)switch(e=it[i][0].headline,N.scroll_direction){case"left":t<tt&&(e.css("transform","translateX( "+t+"px )"),it[i][0].position=t,it[i][0].visible=!0,t=t+it[i][0].width+N.scroll_spacing);break;case"right":t>0&&(t-=it[i][0].width,e.css("transform","translateX( "+t+"px )"),it[i][0].position=t,it[i][0].visible=!0,t-=N.scroll_spacing);break;case"up":t<et&&(e.css("transform","translateY( "+t+"px )"),it[i][0].position=t,it[i][0].visible=!0,t=t+it[i][0].height+N.scroll_spacing);break;case"down":t>0&&(e.css("transform","translateY( "+t+"px )"),e.stop(!0,!0).css("top",t+"px"),it[i][0].position=t,it[i][0].visible=!0,t-=N.scroll_spacing);break}}function k(){y()}function v(){clearInterval(at)}function m(){switch(S.find(".mtphr-dnt-tick").each((function(){it.push(t(this)),t(this).imagesLoaded((function(){F()}))})),F(),S.find(".mtphr-dnt-tick").show(),N.rotate_type){case"fade":X(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":C(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":L(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":j(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":M(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break}w(0),N.auto_rotate&&k(),S.on({mouseenter:function(){N.auto_rotate&&N.rotate_pause&&!P.running&&v()},mouseleave:function(){N.auto_rotate&&N.rotate_pause&&!P.running&&!P.paused&&k()}})}function y(){v(),at=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&&v(),P.next_tick=e,N.before_change.call(R,S),R.trigger("mtphr_dnt_before_change_single",[P,it]),t("body").trigger("mtphr_dnt_before_change",[R,P,it]),P.running=1,I(e),x(e),P.previous_tick=P.current_tick,P.current_tick=e,ct=setTimeout((function(){N.after_change.call(R,S),R.trigger("mtphr_dnt_after_change_single",[P,it]),t("body").trigger("mtphr_dnt_after_change",[R,P,it]),ot=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),ot){case"fade":Y(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":D(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":W(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":O(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":Q(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function I(e){switch(ot){case"fade":T(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":E(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":z(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":A(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":q(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function F(){for(var e=0;e<P.tick_count;e++)t(it[e]).width(tt+"px"),P.current_tick!==e&&t(it[e]).css({left:parseFloat(tt+N.offset)+"px"});var i=t(it[P.current_tick]).height();S.stop().css("height",i+"px")}function X(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,left:"auto"})}function Y(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 T(e,i,r,n,s){i.stop().animate({opacity:0},n,s,(function(){t(this).css({left:parseFloat(tt+N.offset)+"px"}),i.remove(),e.append(i)}))}function C(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,left:0})}function D(t,e,i,r,n){var s=e.height();e.css({opacity:1,left:parseFloat(tt+N.offset)+"px"}),t.stop().animate({height:s+"px"},r,n,(function(){})),e.stop().animate({left:"0"},r,n,(function(){}))}function E(t,e,i,r,n){e.stop().animate({left:"-"+parseFloat(tt+N.offset)+"px"},r,n,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function L(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,left:0})}function W(t,e,i,r,n){var s=e.height();e.css({opacity:1,left:"-"+parseFloat(tt+N.offset)+"px"}),t.stop().animate({height:s+"px"},r,n,(function(){})),e.stop().animate({left:"0"},r,n)}function z(t,e,i,r,n){e.stop().animate({left:parseFloat(tt+N.offset)+"px"},r,n,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function j(t,e){var i=e[0],r=i.height();t.css("height",r+"px"),i.css({opacity:1,top:0,left:"auto"})}function O(t,e,i,r,n){var s=e.height();e.css({opacity:1,top:"-"+parseFloat(s+N.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},r,n),e.stop().animate({top:"0"},r,n)}function A(t,e,i,r,n){var s=i.height();e.stop().animate({top:parseFloat(s+N.offset)+"px"},r,n,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function M(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()+N.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=e.height();e.stop().animate({top:"-"+parseFloat(s+N.offset)+"px"},r,n,(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?ot="slide_right":"slide_right"===N.rotate_type?ot="slide_left":"slide_down"===N.rotate_type?ot="slide_up":"slide_up"===N.rotate_type&&(ot="slide_down"),P.reverse=1),b(t)}function H(t){t?(P.paused=!1,$.removeClass("paused"),"scroll"===N.type?a():k()):(P.paused=!0,$.addClass("paused"),"scroll"===N.type?s():v()),R.trigger("mtphr_dnt_play_pause",[P,it])}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||(ot="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||(ot="slide_right"),N.nav_reverse&&("slide_down"===N.rotate_type?ot="slide_up":"slide_up"===N.rotate_type&&(ot="slide_down"),P.reverse=1),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,it=[],rt,nt=!1,st=!0,at,ot=N.rotate_type,ct,pt=10,lt=.1;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 i=parseInt(t(this).attr("href"));if(P.running)return!1;if(i===P.current_tick)return!1;var r=i<P.current_tick?1:0;N.nav_reverse&&r&&("slide_left"===N.rotate_type?ot="slide_right":"slide_right"===N.rotate_type?ot="slide_left":"slide_down"===N.rotate_type?ot="slide_up":"slide_up"===N.rotate_type&&(ot="slide_down"),P.reverse=1),b(i)})),$.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)&&st?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,r,n){clearInterval(rt),R.find(".mtphr-dnt-tick").remove(),r.each((function(){S.append(t(this))})),setTimeout((function(){i()}),n)})),0===R.width()){var _t=!0;setTimeout((function t(){R.width()>10&&(_t=!1,tt=S.outerWidth(!0),i()),_t&&setTimeout(t,100)}),100)}else i()}))}};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);
|
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}}),ct)}function c(t){var e=parseFloat(rt[t][0].position-N.scroll_speed*pt);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+N.scroll_speed*pt);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-N.scroll_speed*pt);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+N.scroll_speed*pt);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,e=rt[r][0].headline}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,ct=10,pt=.1;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 lt=setInterval((function(){R.width()>10&&(clearInterval(lt),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
@@ -333,7 +333,7 @@ jQuery( document ).ready( function($) {
|
|
333 |
} );
|
334 |
|
335 |
$table.sortable( {
|
336 |
-
handle: '.mtphr-dnt-list-heading
|
337 |
items: '.mtphr-dnt-list-item',
|
338 |
axis: 'y',
|
339 |
opacity: 0.7,
|
333 |
} );
|
334 |
|
335 |
$table.sortable( {
|
336 |
+
handle: '.mtphr-dnt-list-heading',
|
337 |
items: '.mtphr-dnt-list-item',
|
338 |
axis: 'y',
|
339 |
opacity: 0.7,
|
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
|
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);
|
inc/static/sass/style-admin.scss
CHANGED
@@ -366,16 +366,11 @@ $red: hsl(0, 100%, 50%);
|
|
366 |
}
|
367 |
}
|
368 |
.mtphr-dnt-list-buttons {
|
369 |
-
position: relative;
|
370 |
-
z-index: 999;
|
371 |
-
display: flex;
|
372 |
-
flex-direction: row;
|
373 |
-
align-items: stretch;
|
374 |
-
justify-content: flex-start;
|
375 |
margin: -5px -10px;
|
376 |
margin-left: auto;
|
377 |
order: 20;
|
378 |
a {
|
|
|
379 |
display: block;
|
380 |
width: 30px;
|
381 |
height: 30px;
|
@@ -646,9 +641,6 @@ $red: hsl(0, 100%, 50%);
|
|
646 |
display: block;
|
647 |
}
|
648 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button {
|
649 |
-
min-height: 0 !important;
|
650 |
-
font-size: 13px !important;
|
651 |
-
line-height: 2.15384615 !important;
|
652 |
color: #FFF;
|
653 |
border-color: $dark-gray;
|
654 |
background: hsl(0, 0%, 50%);
|
@@ -687,7 +679,7 @@ $red: hsl(0, 100%, 50%);
|
|
687 |
i {
|
688 |
font-size: 16px;
|
689 |
line-height: 16px;
|
690 |
-
margin:
|
691 |
opacity: .5;
|
692 |
-webkit-transition: opacity .25s ease;
|
693 |
transition: opacity .25s ease;
|
@@ -699,7 +691,7 @@ $red: hsl(0, 100%, 50%);
|
|
699 |
vertical-align: top;
|
700 |
font-size: 14px;
|
701 |
line-height: 14px;
|
702 |
-
margin-top:
|
703 |
}
|
704 |
}
|
705 |
}
|
@@ -805,6 +797,14 @@ $red: hsl(0, 100%, 50%);
|
|
805 |
}
|
806 |
|
807 |
@media (max-width: 782px) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
808 |
.mtphr-dnt-metabox {
|
809 |
input, textarea {
|
810 |
font-size: 14px;
|
366 |
}
|
367 |
}
|
368 |
.mtphr-dnt-list-buttons {
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
margin: -5px -10px;
|
370 |
margin-left: auto;
|
371 |
order: 20;
|
372 |
a {
|
373 |
+
float: left;
|
374 |
display: block;
|
375 |
width: 30px;
|
376 |
height: 30px;
|
641 |
display: block;
|
642 |
}
|
643 |
.wp-core-ui #mtphr-dnt-settings-select .mtphr-dnt-button {
|
|
|
|
|
|
|
644 |
color: #FFF;
|
645 |
border-color: $dark-gray;
|
646 |
background: hsl(0, 0%, 50%);
|
679 |
i {
|
680 |
font-size: 16px;
|
681 |
line-height: 16px;
|
682 |
+
margin: 2px 0 0 -5px;
|
683 |
opacity: .5;
|
684 |
-webkit-transition: opacity .25s ease;
|
685 |
transition: opacity .25s ease;
|
691 |
vertical-align: top;
|
692 |
font-size: 14px;
|
693 |
line-height: 14px;
|
694 |
+
margin-top: 5px;
|
695 |
}
|
696 |
}
|
697 |
}
|
797 |
}
|
798 |
|
799 |
@media (max-width: 782px) {
|
800 |
+
.wp-core-ui #mtphr-dnt-settings-select .button {
|
801 |
+
i {
|
802 |
+
margin-top: -1px;
|
803 |
+
&.fontastic {
|
804 |
+
margin-top: 2px;
|
805 |
+
}
|
806 |
+
}
|
807 |
+
}
|
808 |
.mtphr-dnt-metabox {
|
809 |
input, textarea {
|
810 |
font-size: 14px;
|
readme.txt
CHANGED
@@ -72,10 +72,6 @@ The most common cause for an unresponsive ticker (when using scroll or rotate mo
|
|
72 |
|
73 |
== Changelog ==
|
74 |
|
75 |
-
= 2.3.4 =
|
76 |
-
* Javascript updates to scroll functionality
|
77 |
-
* Admin tick drag order updates
|
78 |
-
|
79 |
= 2.3.3 =
|
80 |
* Javascript updates to scroll functionality
|
81 |
* EDD Software Licensing updates
|
72 |
|
73 |
== Changelog ==
|
74 |
|
|
|
|
|
|
|
|
|
75 |
= 2.3.3 =
|
76 |
* Javascript updates to scroll functionality
|
77 |
* EDD Software Licensing updates
|