From c4338d2ae878a167c409e91dea6d1783fc7e30ba Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 18 Jul 2012 00:02:21 -0400 Subject: put away back --- static/js/src/palette.js | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 static/js/src/palette.js (limited to 'static/js/src/palette.js') diff --git a/static/js/src/palette.js b/static/js/src/palette.js new file mode 100644 index 0000000..c9be597 --- /dev/null +++ b/static/js/src/palette.js @@ -0,0 +1,61 @@ + +function paletteToChat(img){ + var chatText = $("#msgInput").val() + if (chatText.length && chatText[chatText.length - 1] != " ") + chatText += " " + chatText += $(img).attr("src") + " " + $("#msgInput").val(chatText) + $("#msgInput").focus().val($("#msgInput").val()) // http://stackoverflow.com/questions/1056359/ + paletteHide() +} + +paletteImageCache = false +function paletteBuildImageThumbs(){ + if (paletteImageCache) { + var imgs = paletteImageCache + } else { + var imgs = [] + var dupeFilter = {} + for(fav in RawFavs){ + var parsedImgs = getImagesAsArray(RawFavs[fav]) + for (var i=0; i") + } +} + +function paletteShow(){ + $("#palette").css("display", "block") + if (isEmptyObject(RawFavs)) { + $('#palette-thumbs').html('
This is where all the stuff you FAV goes!

To FAV a post click the little heart next to a users name.

Everything you fav gets saved to your profile.. Have fun!
'); + } else { + paletteBuildImageThumbs(); + } +} +function paletteHide(){ + $("#palette").css("display", "none") + $("#palette-thumbs").html("") +} + +function paletteToggle(){ + if ($("#palette").css("display") == "none") + paletteShow() + else + paletteHide() +} + + +function paletteClicked(){ + track('UI', 'FavPaletteActuallyClicked'); + paletteToggle(); +} -- cgit v1.2.3-70-g09d2