-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtweet.tmpl
70 lines (60 loc) · 2.53 KB
/
tweet.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/static/css/flags.css">
<link rel="stylesheet" type="text/css" href="/static/css/pimail.css">
<style>
.hidden {
display: none;
}
</style>
<script type="text/javascript" src="/static/js/jquery-latest.js"></script>
</head>
<title>Tweet your MEP</title>
</head>
<body>
<div id=global>
<h1>Write MEPs! Demand the enforcement of a true and unconditional Net neutrality!</h1>
<div id="sent-message" class="hidden">Your email is in your mail client -
if this doesn't work: the email address is <a href="mailto:{{email}}">{{email}}</a></div>
<div id=mep_infos>
<section id=mep_name>{{name}} <img src="/static/groups/group_icon_{{group_short}}.png" style="vertical-align:middle;"> </section>
<section id=mep_pic><img src="/static/images/{{id}}.jpg" style="height:120px;"></section>
<section id=mep_group>{{group}}</section>
<section id=mep_country><img src="/static/blank.gif" class="flag flag-{{country_short}}" alt="{{country}}"> {{country}}</section>
{% if facebook %}
<a href="{{facebook}}" target="_blank"><img src="/static/images/fb.jpg"></img></a>
{% endif %}
{% if twitter %}
<a href="https://twitter.com/{{twitter}}" target="_blank"><img src="/static/images/tw.png"></img></a>
{% endif %}
</div>
<div id=actionbox>
<textarea id="tweet" name="body" class=tweettext>
Dear @{{twitter}} please vote for the amendments delivering real #NetNeutrality on October 27th! #SaveTheInternet https://savetheinternet.eu
</textarea>
<section><a class="button" id="tweetlink" href="#">Tweet!</a></section>
</div>
<div class="spacer" style="clear: both;"></div>
</div>
<script>
var txt_changed = false;
var tweet = "https://twitter.com/intent/tweet?text=" + encodeURIComponent("Dear @{{twitter}} please vote for the amendments delivering real #NetNeutrality on October 27th! #SaveTheInternet https://savetheinternet.eu");
function log_activity (action, value) {
jQuery.ajax('https://piwik.netzfreiheit.org/piwik.php?idsite=11&rec=1&url=https%3A%2F%2Fsavetheinternet.eu&idgoal=5&e_c=contact&e_n=tweet&e_v=' + (value ? 1 : 0));
}
$(function () {
document.getElementById('tweet').onkeyup = function () {
txt_changed = true;
}
$('#tweet').on('change', function () {
tweet = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(document.getElementById("tweet").value);
});
$('#tweetlink').on('click', function () {
log_activity('tweet', txt_changed);
a = window.open(tweet);
});
});
</script>
</body>
</html>