forked from meetuparchive/widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheverywhere_badge.live.html
175 lines (175 loc) · 5.3 KB
/
everywhere_badge.live.html
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="local.js"></script>
<script src="api_key.js"></script>
<script id="config" type="text/javascript" charset="utf-8">
var $parameters = {
urlname: "techcrunch",
width: 200,
_height: 200,
_name: "Everywhere Badge",
_description: "Shows stats for the specified container."
};
var $queries = {
containers: function() {
return mup_widget.api_call("/ew/containers", {urlname: $parameters.urlname, fields: "meetup_count,past_meetup_count,member_count,geo_ip"});
}
};
</script>
<link rel="stylesheet" type="text/css" href="http://static2.meetupstatic.com/style/widget.css">
<script type="text/javascript" charset="utf-8">
mup_widget.with_jquery(function($, ctx) {
var container = '',
addLink = function( content, link ) {
return '<a href="' + link + '">' + content + '</a>';
},
numberFormat = function(nStr){
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
};
$.getJSON($queries.containers(), function(data) {
if (data.results.length == 0) {
$('.mup-widget-2', ctx).width($parameters.width);
$('.mup-widget-2', ctx).append(
'<div class="mup-widget error">\
<div class="errorMsg">Oops. No results for "' + $parameters.urlname + '"</div>\
</div>');
}
else {
container = data.results[0];
$('.mup-widget-2', ctx).width($parameters.width);
$('.mup-widget-2', ctx).append(
'<div class="mup-widget">\
<div class="mup-bd">\
<h3>' + addLink( container.name, container.meetup_url ) + '</h3>\
<span class="mup-stats">' + numberFormat(container.meetup_count+container.past_meetup_count) + '<span class="mup-tlabel"> MEETUPS</span> <span style="color:#000">|</span> ' + numberFormat(container.member_count) + '<span class="mup-tlabel"> PEOPLE</span></span>\
<div style="overflow:hidden;"><span style="font-size:11px; float:left; display:block; padding:2px 0 0 3px;">Find a meetup near you </span><span class="mup-button" style="float:right;margin-right:2px;">' + addLink( 'GO', container.meetup_url ) + '</span></div>\
</div>\
<div class="mup-ft">\
<div class="mup-logo">' + addLink( '<img src="http://img1.meetupstatic.com/84869143793177372874/img/birddog/everywhere_widget.png" />', container.meetup_url ) + '</div>\
<div class="mup-getwdgt">' + addLink( 'ADD THIS TO YOUR SITE', 'http://www.meetup.com/meetup_api/foundry/#'+$parameters._name.toLowerCase().replace(/ /g,"-") ) + '</div>\
</div>\
</div>'
);
}
});
});
</script>
<style type="text/css" media="screen">
.mup-widget-2 {
font-family: "lucida grande", lucida, tahoma, helvetica, arial, sans-serif !important;
font-size: 12px;
}
.mup-widget-2 .mup-widget,
.mup-widget-2 .mup-widget .mup-hd a {
background: #1A1A1A;
color: #f2f2f2;
}
.mup-widget-2 .mup-widget {
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding-top: 8px;
}
.mup-widget-2 .mup-widget h3,
.mup-widget-2 .mup-widget h4,
.mup-widget-2 .mup-widget p {
line-height: 1.2 !important;
text-align: center;
}
.mup-widget-2 .mup-widget h3 {
font-size: 15px;
color: #f2f2f2;
font-weight: bold;
}
.mup-widget-2 .mup-widget h4 {
font-size: 13px;
}
.mup-widget-2 .mup-widget h5 {
font-size: 20px;
margin: 0 auto;
text-align: center;
letter-spacing: -1px;
text-shadow: 1px 1px 1px #1A1A1A;
}
.mup-widget-2 .mup-widget p {
text-align: center;
}
.mup-widget-2 .mup-widget .mup-bd,
.mup-widget-2 .mup-widget .mup-timeline,
.mup-widget-2 .mup-widget .mup-bd p {
color: #f2f2f2;
}
.mup-widget-2 .mup-widget .mup-bd {
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 8px 6px;
margin: 0 8px;
background: #333;
}
.mup-widget-2 .mup-widget a,
.mup-widget-2 .mup-widget a:active,
.mup-widget-2 .mup-widget a:visited,
.mup-widget-2 .mup-widget a:hover {
color: #f2f2f2;
text-decoration: none;
}
.mup-widget-2 .mup-widget .mup-tlabel {
font-size: 8px;
color: #AAA;
}
.mup-widget-2 .mup-widget .mup-stats {
display: block;
margin: 6px 0;
padding: 4px;
text-align: center;
background: #1A1A1A;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
.mup-widget-2 .mup-widget .mup-button {
display:block;
margin: 0 auto;
padding: 2px 4px;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#2266BB), to(#102f56));
background: -moz-linear-gradient(0% 100% 90deg,#102F56, #2266BB);
background-color: #2266BB;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font-size: 10px;
font-weight: bold;
color: #f2f2f2 !important;
text-align: center;
border: 1px solid #0d2748;
}
.mup-widget-2 .mup-widget .mup-ft .mup-getwdgt {
padding: 3px 0;
font-size: 8px;
text-align: center;
background: #0A0A0A;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
.mup-widget-2 .mup-widget .mup-ft .mup-logo {
padding: 6px 8px;
}
</style>
</head>
<body class="framed-mup-widget">
<div class="mup-widget-2"></div>
</body>
</html>