diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2015-04-07 19:07:29 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2015-04-07 19:07:29 -0400 |
| commit | 14a6ca1fa68ccd471066725759da6cdbd24761dd (patch) | |
| tree | 3000d0d22e652a082197c0b6decc8498d040ba85 /static/js/famille.js | |
| parent | 0a9eefd31c92e408ca66e615c3d9d27310b223b1 (diff) | |
| parent | d26b5e0f3a0f79a6b8165004e19b65df836b1e08 (diff) | |
| download | famille-flask-14a6ca1fa68ccd471066725759da6cdbd24761dd.tar.gz | |
Merge branch 'production'
Diffstat (limited to 'static/js/famille.js')
| -rw-r--r-- | static/js/famille.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/static/js/famille.js b/static/js/famille.js new file mode 100644 index 0000000..3bb9e51 --- /dev/null +++ b/static/js/famille.js @@ -0,0 +1,46 @@ +$.fn.wait = function(time, type) { + time = time || 1000; + type = type || "fx"; + return this.queue(type, function() { + var self = this; + setTimeout(function() { + $(self).dequeue(); + }, time); + }); +}; + +$(document).ready(function(){ + $('[data-toggle="tooltip"]').tooltip() + $("div.infobox").wait(2000).slideUp("slow"); + $("div.errorbox").wait(2000).slideUp("slow"); + $("#add").click(function(){ + $(".hidden").fadeIn("slow"); + $(this).hide(0); + $("label.info").hide(0); + $(".tohide").hide(0); + }); + $("#kadobutton").click(function(){ + $(".kadoscope").animate({opacity:"1"},"5000"); + }); + $('span.timeago').timeago(); + var addr = $(location).attr('pathname'); + $("#"+addr.replace(/\//g,"")).addClass("active"); + + $(".edit").click(function(e){ + e.preventDefault(); + $(this).parents(".media-heading").siblings(".comment-content").hide(); + $(this).parents(".media-heading").siblings(".comment-source").show(); + }); + + $(".comment-source").submit(function(e){ + e.preventDefault(); + var comment_id = $(this).data("id"); + var form = $(this); + $.post("/comment/" + comment_id, {content: form.find("textarea").val()}, function(data) { + var comment_content = form.parents(".media-body").find(".comment-content"); + comment_content.html(data.content_cache); + comment_content.show(); + form.hide(); + }); + }); +}); |
