From 265e6a621ed3a171c0672866105b92c61678c0dc Mon Sep 17 00:00:00 2001 From: Jayaram Pai Date: Sun, 24 Nov 2013 12:28:34 +0530 Subject: adding timestamp, dynamic emails --- js/cloud_comments.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/cloud_comments.js b/js/cloud_comments.js index 9f4c2ad..59523d4 100644 --- a/js/cloud_comments.js +++ b/js/cloud_comments.js @@ -1,10 +1,29 @@ $(document).ready(function(){ - $(".feedback a").click(function(){ + /* to avoid CKE partial loading... */ + $('.form-wrapper').slideToggle(); + + /* reply button action */ + $(".btn-reply a").click(function(){ var clicked = $(this).attr("class"); - console.log(clicked); $('#'+clicked).slideToggle(); + console.log($(this).html()); + if ($(this).html() == "Reply") { + $(this).html("Close"); + } else { + $(this).html("Reply"); + } }); - /* to avoid CKE partial loading... */ - $('.form-wrapper').slideToggle(); + /* delete link */ + $(".delete").click(function(e){ + sure = confirm("Are you sure ?"); + console.log(sure); + if (sure) { + window.location.href = $(this).attr("href"); + } + else { + console.log("nopees"); + } + e.preventDefault(); + }); }); -- cgit