@@ -70,6 +70,14 @@ javascript:
70
70
</dd >
71
71
</dl >
72
72
73
+ <dl class =" want__votes" >
74
+ <dt >Votes</dt >
75
+ <dd >{{ webmentions .children | votesForWant ( absoluteUrl ) }}
76
+ <br >
77
+ <small ><a href =" /voting" >What are votes for and how are they tallied?</a ></small >
78
+ </dd >
79
+ </dl >
80
+
73
81
{% if ( eventData [id ] ) and ( eventData [id ].pitched .length > 0 ) %}
74
82
<dl class =" want__presented_at" id =" events" >
75
83
<dt >This was presented at</dt >
@@ -95,36 +103,26 @@ javascript:
95
103
<dl class =" want__share" >
96
104
<dt >Do you want this too? Share it!</dt >
97
105
<script >
98
- var $want__share = document .querySelector (' .want__share' );
99
- var url = ' {{ absoluteUrl }}' ;
100
- var title = ' {{ title | urlencode }}' ;
101
- var text = ' {{ description | striptags | truncate( 140 ) | urlencode }}' ;
102
- var $button = document .createElement (' button' );
103
- $button .className = ' button button--share' ;
104
- $button .onlick = function () {
105
- navigator .share ({
106
- title: title,
107
- text: text,
108
- url: url
106
+ var $share = document .querySelector (' .want__share' );
107
+ if ( " share" in navigator ) {
108
+ var url = ' {{ absoluteUrl }}' ;
109
+ var title = " {{ title }}" ;
110
+ var $button = document .createElement (' button' );
111
+ $button .className = ' button--share' ;
112
+ $button .innerText = " Share this want" ;
113
+ $button .addEventListener (" click" , function () {
114
+ navigator .share ({
115
+ title,
116
+ url
117
+ });
109
118
});
119
+ $share .appendChild ($button);
120
+ } else {
121
+ $share .parentNode .removeChild ($share);
110
122
}
111
- $want__share .appendChild ($button);
112
123
</script >
113
124
</dl >
114
125
115
- <dl class =" want__votes" >
116
- <dt >Votes</dt >
117
- <dd >{{ webmentions .children | votesForWant ( absoluteUrl ) }}
118
- <br >
119
- <a class =" button button--vote" href =" https://twitter.com/intent/tweet?original_referer={{ absoluteUrl }}& ; source=tweetbutton& ; url={{ absoluteUrl }}& ; text={{ title }}& ; via=webwewantfyi" >
120
- <svg class =" button__icon" xmlns =" http://www.w3.org/2000/svg" width =" 28" height =" 28" viewBox =" 0 0 28 28" ><path d =" M24.253 8.756C24.69 17.08 18.297 24.182 9.97 24.62c-3.122.162-6.22-.646-8.86-2.32 2.702.18 5.375-.648 7.507-2.32-2.072-.248-3.818-1.662-4.49-3.64.802.13 1.62.077 2.4-.154-2.482-.466-4.312-2.586-4.412-5.11.688.276 1.426.408 2.168.387-2.135-1.65-2.73-4.62-1.394-6.965C5.574 7.816 9.54 9.84 13.802 10.07c-.842-2.738.694-5.64 3.434-6.48 2.018-.624 4.212.043 5.546 1.682 1.186-.213 2.318-.662 3.33-1.317-.386 1.256-1.248 2.312-2.4 2.942 1.048-.106 2.07-.394 3.02-.85-.458 1.182-1.343 2.15-2.48 2.71z" ></path ></svg >
121
- <b class =" button__text" >Vote by sharing on Twitter</b >
122
- </a >
123
- <br >
124
- <small ><a href =" /voting" >What are votes for and how are they tallied?</a ></small >
125
- </dd >
126
- </dl >
127
-
128
126
</aside >
129
127
130
128
<div class =" pagination" >
0 commit comments