-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathasana-bookmarklet.js
35 lines (35 loc) · 1.24 KB
/
asana-bookmarklet.js
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
/* globals AsanaRainbow,env,CommonUrl */
/* jshint camelcase: false */
// https://app.asana.com/-/static/apps/asana/media/celebration_unicorn.png
// https://app.asana.com/-/static/apps/asana/media/celebration_phoenix.png
// https://app.asana.com/-/static/apps/asana/media/celebration_narwhal.png
// https://app.asana.com/-/static/apps/asana/media/celebration_yeti.png
(function (win) {
'use strict';
var r,
celebrants,
rain = function () {
var celebrant;
if (win.AsanaRainbow) {
loadCelebrants();
celebrant = Math.floor(Math.random()*celebrants.length);
r = AsanaRainbow.create(celebrants[celebrant]);
r.start();
}
},
loadCelebrants = function () {
if (AsanaRainbow._ALL_CELEBRATIONS) {
celebrants = AsanaRainbow._ALL_CELEBRATIONS;
}
};
if ((win.AsanaRainbow === undefined) && win.env && win.env.dynamic_loader) {
env.dynamic_loader.load({
url:CommonUrl.staticUrl({path:'apps/asana/view/asana_rainbow.js',
compute_hash:!1}),
allow_cached:!1,
callback: rain
});
} else {
rain();
}
}(window));