-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchoose.html
executable file
·308 lines (273 loc) · 11.3 KB
/
choose.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE HTML>
<!--
Dopetrope 2.0 by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>Event Flairs gadget</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,900,300italic" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<script src="js/jquery.dropotron.js"></script>
<script src="js/config.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-panels.min.js"></script>
<script src="js/ZeroClipboard.min.js"></script>
<!-- mine -->
<script src="js/sets.js"></script>
<script src="js/utils.js"></script>
<script src="js/master.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel-noscript.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
</noscript>
<link rel="stylesheet" href="css/choose.css" />
<!--[if lte IE 8]><script src="js/html5shiv.js"></script><link rel="stylesheet" href="static/css/ie8.css" /><![endif]-->
</head>
<body class="homepage">
<div id="cart">
<h5 class="cart-title">Your Custom Flairs Sets</h5>
<div style="text-align:center">
<button id="flairs-button" data-clipboard-text="" class="">Copy flairs set !</button>
<div id="flairs-button-next" style="display: none; text-align: center; background-color: rgb(0, 0, 139); color: white; font-size: 0.8em; background-position: initial initial; background-repeat: initial initial;">Go back to gadget, click "import" and paste</div>
</div>
<div id="custom-icons"></div>
<div style="text-align:center">
<div id="flairs-limit-reached" style="display: none; text-align: center; background-color: rgb(227, 53, 0); color: white; font-size: 0.8em; background-position: initial initial; background-repeat: initial initial;">Limit reached, can't add more...</div>
</div>
</div>
<!-- Header Wrapper -->
<div id="header-wrapper">
<div class="container">
<div class="row">
<div class="12u">
<!-- Header -->
<section id="header">
<!-- Logo -->
<h1><a href="/">Event Flairs</a></h1>
<h3 style="padding-bottom:15px">Build your own flairs set</h3>
<!-- Nav -->
<nav id="nav">
<ul id="repos">
</ul>
</nav>
</section>
</div>
</div>
</div>
</div>
<!-- Main Wrapper -->
<div id="choose-wrapper">
<div class="container">
<div class="row">
<div class="12u">
<section>
<div>
<div class="row">
<div class="12u">
<section class="box">
<header>
<h3 id="repo_name"></h3>
</header>
<p id="repo_icons">
Select an icon collection. Once loaded, just click on the icons you want, your custom flairs set will get filled. When ready, just click on the "Copy flairs set" button, and import <img src="/static/images/import.gif"> button on gadget's toobar.<br><br>
You can suggest a new icon collection and have it displayed here ! Just <a href="https://groups.google.com/forum/#!forum/event-flairs">join</a> the group and post your favorite icon collection. Remember, they must be free use (personal and commercial), should be available in PNG or GIF format, and sized as 16x16.
</p>
</section>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
<!-- Footer Wrapper -->
<div id="footer-wrapper">
<!-- Footer -->
<section id="footer" class="container">
<div class="row">
<div class="8u">
</div>
<div class="4u">
<section>
<header>
<h2>About</h2>
</header>
<p>
Event Flairs gadget is a replacement of original Event Flairs lab for Google Calendar. Event Flairs are used
to add little icons to events. Original lab hasn't been working properly lately so this gadget is an alternative
solution.
</p>
<p>
Event Flairs gadget is an open source project, powered by enthousiastic people and volunteers.
</p>
</section>
</div>
<div class="4u">
<section>
<header>
<h2>Disclaimer</h2>
</header>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
</p>
</section>
</div>
<div class="4u">
<section>
<header>
<h2>Be social</h2>
</header>
<ul class="social">
<li class="facebook"><a href="#" class="icon48 icon48-1">Facebook</a></li>
<li class="twitter"><a href="http://twitter.com/n33co" class="icon48 icon48-2">Twitter</a></li>
<li class="dribbble"><a href="http://dribbble.com/n33" class="icon48 icon48-3">Dribbble</a></li>
<li class="linkedin"><a href="#" class="icon48 icon48-4">LinkedIn</a></li>
<li class="googleplus"><a href="#" class="icon48 icon48-6">Google+</a></li>
</ul>
<ul class="contact">
<li>
<h3>Mail</h3>
<p><a href="#">eventflairs[at]gmail.com</a></p>
</li>
</ul>
</section>
</div>
</div>
<div class="row">
<div class="12u">
<!-- Copyright -->
<div id="copyright">
<ul class="links">
<li>© Sebastien Lelong</li>
<li>Design: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</div>
</div>
</div>
</section>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-42714430-1', 'eventflairs.appspot.com');
ga('send', 'pageview');
</script>
<script>
var userFlairs = {};
function initRepositories()
{
for(var idx in MASTER)
{
var repo = MASTER[idx];
$("#repos").append("<li class='repo' onclick='loadRepository(" + idx + ")'><a>" + repo['name'] + "</a></li>");
}
}
function removeIcon(elem)
{
var res = splitRootIcon(elem.src);
if(res.root in userFlairs)
{
userFlairs[res.root].splice(userFlairs[res.root].indexOf(res.icon),1);
// need to delete root ?
if(!userFlairs[res.root].length)
delete userFlairs[res.root];
elem.remove();
$("#flairs-button").attr("data-clipboard-text",JSON.stringify(userFlairs));
}
}
function selectIcon(elem)
{
var url = elem.src;
// shorten url to save space in userdefault's gadget
// so we can add more icons
$.ajax({
"type":"GET",
"url":"https://eventflairs.appspot.com/shorturl?service=goo.gl&longurl=" + url,"async":false}
).done(function(resp){
url = JSON.parse(resp)['short']
}).fail(function( jqXHR, textStatus ) {
console.log("Will use long URL, cannot shorten URL: " + textStatus);
});
// -> extract root url and check if it exists
var res = splitRootIcon(url);
var icon = res.icon;
var root = res.root;
if(root in userFlairs)
{
userFlairs[root].push(icon);
}
else
{
userFlairs[root] = [icon];
}
// check max limit (userdefault prefs gadget limit)
if(JSON.stringify(userFlairs).length > 1024) {
$("#flairs-limit-reached").show().delay(2000).fadeOut();
return;
}
// update clipboard content
$("#flairs-button").attr("data-clipboard-text",JSON.stringify(userFlairs));
// add img element
var img = $("<img src='" + url + "'>");
$(img).attr("onclick","removeIcon(this)");
$(img).addClass("custom-icon");
$("#custom-icons").append(img);
}
function loadRepository(idx)
{
var repo = MASTER[idx];
$("#repo_name").empty();
$("#repo_icons").empty();
$.getScript(repo['def'],function() {
$("#repo_name").append(REPOSITORY['name']);
var url = REPOSITORY['url'];
$("#repo_icons").append("<div><a href='" + url + "'>" + url + "</a></div>");
$("#repo_icons").append("<br>");
for(var catk in REPOSITORY['categories'])
{
var dcat = REPOSITORY['categories'][catk];
for(var catname in dcat)
{
var e = $("#repo_icons").append("<div>" + catname + "</div>");
for(var url in dcat[catname])
{
e.append("<img class='icon' src='" + dcat[catname][url] + "' onclick='selectIcon(this)'>");
}
}
}
});
var scr = $("<script></script");
}
$(document).ready(initRepositories);
$().ready(function() {
var $scrollingDiv = $("#cart");
$(window).scroll(function(){
$scrollingDiv
.stop()
.animate({"marginTop": ($(window).scrollTop() + 30) + "px"}, "slow" );
});
});
var clip = new ZeroClipboard( document.getElementById("flairs-button"), {
moviePath: "/js/ZeroClipboard.swf"
});
clip.on( "complete", function(client, args) {
document.getElementById(this.id + "-next").style.display = "block";
});
</script>
</body>
</html>