|
1 | 1 | function initDisqus($content) {
|
| 2 | + if ($('#disqus_thread').length > 0) { |
| 3 | + return; |
| 4 | + } |
2 | 5 | $content.append('<div id="disqus_thread"></div>');
|
3 | 6 | var disqus_shortname = 'graphgist';
|
4 | 7 |
|
@@ -30,58 +33,58 @@ function share() {
|
30 | 33 | }
|
31 | 34 |
|
32 | 35 | function initSocial(heading) {
|
33 |
| -(function () { |
34 |
| - var po = document.createElement('script'); |
35 |
| - po.type = 'text/javascript'; |
36 |
| - po.async = true; |
37 |
| - po.src = 'https://apis.google.com/js/platform.js'; |
38 |
| - var s = document.getElementsByTagName('script')[0]; |
39 |
| - s.parentNode.insertBefore(po, s); |
40 |
| -})(); |
| 36 | + (function () { |
| 37 | + var po = document.createElement('script'); |
| 38 | + po.type = 'text/javascript'; |
| 39 | + po.async = true; |
| 40 | + po.src = 'https://apis.google.com/js/platform.js'; |
| 41 | + var s = document.getElementsByTagName('script')[0]; |
| 42 | + s.parentNode.insertBefore(po, s); |
| 43 | + })(); |
| 44 | + |
| 45 | + !function (d, s, id) { |
| 46 | + var js, fjs = d.getElementsByTagName(s)[0]; |
| 47 | + if (!d.getElementById(id)) { |
| 48 | + js = d.createElement(s); |
| 49 | + js.id = id; |
| 50 | + js.src = "https://platform.twitter.com/widgets.js"; |
| 51 | + fjs.parentNode.insertBefore(js, fjs); |
| 52 | + } |
| 53 | + }(document, "script", "twitter-wjs"); |
41 | 54 |
|
42 |
| -!function (d, s, id) { |
43 |
| - var js, fjs = d.getElementsByTagName(s)[0]; |
44 |
| - if (!d.getElementById(id)) { |
| 55 | + (function (d, s, id) { |
| 56 | + var js, fjs = d.getElementsByTagName(s)[0]; |
| 57 | + if (d.getElementById(id)) return; |
45 | 58 | js = d.createElement(s);
|
46 | 59 | js.id = id;
|
47 |
| - js.src = "https://platform.twitter.com/widgets.js"; |
| 60 | + js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=442180952526716"; |
48 | 61 | fjs.parentNode.insertBefore(js, fjs);
|
49 |
| - } |
50 |
| -}(document, "script", "twitter-wjs"); |
51 |
| - |
52 |
| -(function (d, s, id) { |
53 |
| - var js, fjs = d.getElementsByTagName(s)[0]; |
54 |
| - if (d.getElementById(id)) return; |
55 |
| - js = d.createElement(s); |
56 |
| - js.id = id; |
57 |
| - js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=442180952526716"; |
58 |
| - fjs.parentNode.insertBefore(js, fjs); |
59 |
| -}(document, 'script', 'facebook-jssdk')); |
| 62 | + }(document, 'script', 'facebook-jssdk')); |
60 | 63 |
|
61 |
| -var location = window.location.href; |
62 |
| -var index = location.indexOf('#'); |
63 |
| -if ( index !== -1) { |
64 |
| - location = location.substr(0, index); |
65 |
| -} |
66 |
| -var uniqueId = window.location.search; |
67 |
| -if (typeof uniqueId === 'undefined' || (!uniqueId) || uniqueId === '?') { |
68 |
| - uniqueId = 'graphgist-home'; |
69 |
| -} |
70 |
| -PDRTJS_settings_7478426 = { |
71 |
| - "id" : "7478426", |
72 |
| - "unique_id" : uniqueId, |
73 |
| - "title" : heading, |
74 |
| - "permalink" : location |
75 |
| -}; |
| 64 | + var location = window.location.href; |
| 65 | + var index = location.indexOf('#'); |
| 66 | + if (index !== -1) { |
| 67 | + location = location.substr(0, index); |
| 68 | + } |
| 69 | + var uniqueId = window.location.search; |
| 70 | + if (typeof uniqueId === 'undefined' || (!uniqueId) || uniqueId === '?') { |
| 71 | + uniqueId = 'graphgist-home'; |
| 72 | + } |
| 73 | + PDRTJS_settings_7478426 = { |
| 74 | + "id": "7478426", |
| 75 | + "unique_id": uniqueId, |
| 76 | + "title": heading, |
| 77 | + "permalink": location |
| 78 | + }; |
76 | 79 |
|
77 |
| -(function (d, s, id) { |
78 |
| - var js, fjs = d.getElementsByTagName(s)[0]; |
79 |
| - if (d.getElementById(id)) return; |
80 |
| - js = d.createElement(s); |
81 |
| - js.id = id; |
82 |
| - js.src = "http://i0.poll.fm/js/rating/rating.js"; |
83 |
| - fjs.parentNode.insertBefore(js, fjs); |
84 |
| -}(document, 'script', 'polldaddy-rating')); |
| 80 | + (function (d, s, id) { |
| 81 | + var js, fjs = d.getElementsByTagName(s)[0]; |
| 82 | + if (d.getElementById(id)) return; |
| 83 | + js = d.createElement(s); |
| 84 | + js.id = id; |
| 85 | + js.src = "http://i0.poll.fm/js/rating/rating.js"; |
| 86 | + fjs.parentNode.insertBefore(js, fjs); |
| 87 | + }(document, 'script', 'polldaddy-rating')); |
85 | 88 |
|
86 | 89 | }
|
87 | 90 |
|
0 commit comments