diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2018-06-08 10:09:24 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2018-06-08 10:09:24 -0400 |
commit | a6b006c0f1ef757f23375f7906193370337d8bd7 (patch) | |
tree | 4467c6423b2c54e6ef8c3e79241a833fb17833a5 /plugins/jetpack/modules/shortcodes/polldaddy.php | |
parent | Update akismet 4.0.7 (diff) | |
download | blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.gz blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.bz2 blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.zip |
Update jetpack 6.2
Diffstat (limited to 'plugins/jetpack/modules/shortcodes/polldaddy.php')
-rw-r--r-- | plugins/jetpack/modules/shortcodes/polldaddy.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/jetpack/modules/shortcodes/polldaddy.php b/plugins/jetpack/modules/shortcodes/polldaddy.php index b72866ce..609794ff 100644 --- a/plugins/jetpack/modules/shortcodes/polldaddy.php +++ b/plugins/jetpack/modules/shortcodes/polldaddy.php @@ -76,7 +76,7 @@ CONTAINER; /* * Polldaddy Poll Embed script - transforms code that looks like that: - * <script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/123456.js"></script> + * <script type="text/javascript" charset="utf-8" async src="http://static.polldaddy.com/p/123456.js"></script> * <noscript><a href="http://polldaddy.com/poll/123456/">What is your favourite color?</a></noscript> * into the [polldaddy poll=...] shortcode format */ @@ -221,7 +221,7 @@ CONTAINER; <script type="text/javascript" charset="UTF-8"><!--//--><![CDATA[//><!-- PDRTJS_settings_{$rating}{$item_id}={$settings}; //--><!]]></script> -<script type="text/javascript" charset="UTF-8" src="{$rating_js_file}"></script> +<script type="text/javascript" charset="UTF-8" async src="{$rating_js_file}"></script> SCRIPT; } else { if ( false === self::$scripts ) { @@ -338,7 +338,7 @@ SCRIPT; <a id="pd_a_{$poll}"></a> <div class="PDS_Poll" id="PDI_container{$poll}" style="display:inline-block;{$float}{$margins}"></div> <div id="PD_superContainer"></div> -<script type="text/javascript" charset="UTF-8" src="{$poll_js}{$cb}"></script> +<script type="text/javascript" charset="UTF-8" async src="{$poll_js}{$cb}"></script> <noscript>{$poll_link}</noscript> CONTAINER; } @@ -496,13 +496,13 @@ CONTAINER; foreach( self::$scripts['rating'] as $rating ) { $script .= "PDRTJS_settings_{$rating['id']}{$rating['item_id']}={$rating['settings']}; if ( typeof PDRTJS_RATING !== 'undefined' ){if ( typeof PDRTJS_{$rating['id']}{$rating['item_id']} == 'undefined' ){PDRTJS_{$rating['id']}{$rating['item_id']} = new PDRTJS_RATING( PDRTJS_settings_{$rating['id']}{$rating['item_id']} );}}"; } - $script .= "\n//--><!]]></script><script type='text/javascript' charset='UTF-8' src='{$rating_js_file}'></script>"; + $script .= "\n//--><!]]></script><script type='text/javascript' charset='UTF-8' async src='{$rating_js_file}'></script>"; } if ( isset( self::$scripts['poll'] ) ) { foreach( self::$scripts['poll'] as $poll ) { - $script .= "<script type='text/javascript' charset='UTF-8' src='{$poll['url']}'></script>"; + $script .= "<script type='text/javascript' charset='UTF-8' async src='{$poll['url']}'></script>"; } } } @@ -544,6 +544,7 @@ CONTAINER; if ( !d.getElementById( j ) ) { var pd = d.createElement( c ), s; pd.id = j; + pd.async = true; pd.src = '{$script_url}'; s = d.getElementsByTagName( c )[0]; s.parentNode.insertBefore( pd, s ); @@ -565,7 +566,7 @@ new PolldaddyShortcode(); if ( ! function_exists( 'polldaddy_link' ) ) { // http://polldaddy.com/poll/1562975/?view=results&msg=voted function polldaddy_link( $content ) { - return jetpack_preg_replace_outside_tags( '!(?:\n|\A)http://polldaddy.com/poll/([0-9]+?)/(.+)?(?:\n|\Z)!i', "\n<script type='text/javascript' charset='utf-8' src='//static.polldaddy.com/p/$1.js'></script><noscript> <a href='http://polldaddy.com/poll/$1/'>View Poll</a></noscript>\n", $content, 'polldaddy.com/poll' ); + return jetpack_preg_replace_outside_tags( '!(?:\n|\A)http://polldaddy.com/poll/([0-9]+?)/(.+)?(?:\n|\Z)!i', "\n<script type='text/javascript' charset='utf-8' async src='//static.polldaddy.com/p/$1.js'></script><noscript> <a href='http://polldaddy.com/poll/$1/'>View Poll</a></noscript>\n", $content, 'polldaddy.com/poll' ); } // higher priority because we need it before auto-link and autop get to it |