Advertisement
Guest User

Sodika forum valasz gomb

a guest
Jan 17th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.78 KB | None | 0 0
  1. var $txtarea = $("textarea").attr('id', 'form_comment'),
  2.     $c_temp = $(document.createElement('div')),
  3.     quote_this = function(a,c) {return '[quote='+ a + ']\n'+ c.split('<br>').join('\n') +'\n[/quote]\n'};
  4. ;
  5.  
  6. $(".reply").off().live("click", function(){
  7.     var comment = $.trim($(this).closest(".comment").find(".content").html()),  
  8.         author = $(this).closest(".comment").find(".header b").text(),  
  9.         currval = $txtarea.val();
  10.     ;
  11.  
  12.     comment = $c_temp.html(comment).find('fieldset').replaceWith(function() {
  13.         var $n = $('> legend', this), n = $n.text(); $n.remove();
  14.         return quote_this(n, $(this).html())
  15.     }).end().html();
  16.  
  17.     window.location.hash = '#form_comment';
  18.  
  19.     $txtarea.val(quote_this(author, comment)).focus();  
  20.     return false;
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement