diff options
| author | Jules Laplace <jules@okfoc.us> | 2012-07-18 00:02:21 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2012-07-18 00:02:21 -0400 |
| commit | c4338d2ae878a167c409e91dea6d1783fc7e30ba (patch) | |
| tree | 1e54fac722ac3153f9180a5a8332f2b19e11c00c /static/js/src/favs.js | |
| parent | d891a7ae1b205716c086363fba17a3249a665deb (diff) | |
put away back
Diffstat (limited to 'static/js/src/favs.js')
| -rw-r--r-- | static/js/src/favs.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/static/js/src/favs.js b/static/js/src/favs.js new file mode 100644 index 0000000..ad9ee3b --- /dev/null +++ b/static/js/src/favs.js @@ -0,0 +1,34 @@ +// Favs + +function buildFav(f) { + var h = '<div class="fav-note">' + + '<img src="' + RootDomain + 'static/img/thumbs/chatheartover.gif">' + + '<a href="' + RootDomain + f.from + '">' + f.from + '</a>' + + ' <span>just faved you!</span>' + + '</div>'; + return $(h); +} + +function removeFavAndHideBox() { + $(this).remove(); + if ($('#favbox').children().length == 0) + $('#favbox').hide(); +} + +function showFav(f) { + $('#favbox').show(); + buildFav(f).appendTo('#favbox').animate( + {"opacity": 0}, + {"duration": 9000, + "complete": removeFavAndHideBox + }); +} + + +function updateFavs(fs) { + if (fs.length == 0) + return; +console.log("new faves"); + $('#favbox').show(); + $(fs).each(function(i, f) { showFav(f) }); +} |
