Jack Phoenix has submitted this change and it was merged. Change subject: Moved icky inline JS to a separate file. ......................................................................
Moved icky inline JS to a separate file. Change-Id: I86422daf6f31fbf301ce3ebdc7f98990b1430bdd --- M BlueSky.skin.php A resources/js/social.js 2 files changed, 49 insertions(+), 51 deletions(-) Approvals: Jack Phoenix: Verified; Looks good to me, approved diff --git a/BlueSky.skin.php b/BlueSky.skin.php index b5fbebb..c24b0b6 100644 --- a/BlueSky.skin.php +++ b/BlueSky.skin.php @@ -2429,57 +2429,6 @@ } ?> -<script type="text/javascript"> - (function ($) { - $(document).ready(function() { - WH.addScrollEffectToTOC(); - }); - - $(window).load(function() { - if ($('.twitter-share-button').length && (!$.browser.msie || $.browser.version > 7)) { - - $.getScript("https://platform.twitter.com/widgets.js", function() { - twttr.events.bind('tweet', function(event) { - if (event) { - var targetUrl; - if (event.target && event.target.nodeName == 'IFRAME') { - targetUrl = extractParamFromUri(event.target.src, 'url'); - } - _gaq.push(['_trackSocial', 'twitter', 'tweet', targetUrl]); - } - }); - - }); - } - - if (isiPhone < 0 && isiPad < 0 && $('.gplus1_button').length) { - WH.setGooglePlusOneLangCode(); - var node2 = document.createElement('script'); - node2.type = 'text/javascript'; - node2.async = true; - node2.src = 'http://apis.google.com/js/plusone.js'; - $('body').append(node2); - } - if (typeof WH.FB != 'undefined') WH.FB.init('new'); - if (typeof WH.GP != 'undefined') WH.GP.init(); - - if ($('#pinterest').length) { - var node3 = document.createElement('script'); - node3.type = 'text/javascript'; - node3.async = true; - node3.src = 'http://assets.pinterest.com/js/pinit.js'; - $('body').append(node3); - } - - if (typeof WH.imageFeedback != 'undefined') { - WH.imageFeedback(); - } - if (typeof WH.uciFeedback != 'undefined') { - WH.uciFeedback(); - } - }); - })(jQuery); -</script> <?php // Temporarily taking down Jane /* diff --git a/resources/js/social.js b/resources/js/social.js new file mode 100644 index 0000000..4c34b8f --- /dev/null +++ b/resources/js/social.js @@ -0,0 +1,49 @@ + (function ($) { + $(document).ready(function() { + WH.addScrollEffectToTOC(); + }); + + $(window).load(function() { + if ($('.twitter-share-button').length && (!$.browser.msie || $.browser.version > 7)) { + + $.getScript("https://platform.twitter.com/widgets.js", function() { + twttr.events.bind('tweet', function(event) { + if (event) { + var targetUrl; + if (event.target && event.target.nodeName == 'IFRAME') { + targetUrl = extractParamFromUri(event.target.src, 'url'); + } + _gaq.push(['_trackSocial', 'twitter', 'tweet', targetUrl]); + } + }); + + }); + } + + if (isiPhone < 0 && isiPad < 0 && $('.gplus1_button').length) { + WH.setGooglePlusOneLangCode(); + var node2 = document.createElement('script'); + node2.type = 'text/javascript'; + node2.async = true; + node2.src = 'http://apis.google.com/js/plusone.js'; + $('body').append(node2); + } + if (typeof WH.FB != 'undefined') WH.FB.init('new'); + if (typeof WH.GP != 'undefined') WH.GP.init(); + + if ($('#pinterest').length) { + var node3 = document.createElement('script'); + node3.type = 'text/javascript'; + node3.async = true; + node3.src = 'http://assets.pinterest.com/js/pinit.js'; + $('body').append(node3); + } + + if (typeof WH.imageFeedback != 'undefined') { + WH.imageFeedback(); + } + if (typeof WH.uciFeedback != 'undefined') { + WH.uciFeedback(); + } + }); + })(jQuery); \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/134967 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I86422daf6f31fbf301ce3ebdc7f98990b1430bdd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/BlueSky Gerrit-Branch: master Gerrit-Owner: Jack Phoenix <j...@countervandalism.net> Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits