View difference between Paste ID: xtukwAVL and 5wTaC2k9
SHOW: | | - or go back to the newest paste.
1-
var $txtarea = $("textarea").attr('id', 'form_comment'), 
1+
var $txtarea = $("textarea").attr('id', 'form_comment'), 
2-
    $c_temp = $(document.createElement('div')),
2+
    $c_temp = $(document.createElement('div')),
3-
    quote_this = function(a,c) {return '[quote='+ a + ']\n'+ c.split('<br>').join('\n') +'\n[/quote]\n'};
3+
    quote_this = function(a,c) {return '[quote='+ a + ']\n'+ c.split('<br>').join('\n') +'\n[/quote]\n'};
4-
;
4+
;
5-
5+
6-
$(".reply").off().live("click", function(){
6+
$(".reply").off().live("click", function(){
7-
    var comment = $.trim($(this).closest(".comment").find(".content").html()),   
7+
    var comment = $.trim($(this).closest(".comment").find(".content").html()),   
8-
        author = $(this).closest(".comment").find(".header b").text(),   
8+
        author = $(this).closest(".comment").find(".header b").text(),   
9-
        currval = $txtarea.val();
9+
        currval = $txtarea.val();
10-
    ;
10+
    ;
11-
11+
12-
    comment = $c_temp.html(comment).find('fieldset').replaceWith(function() {
12+
    comment = $c_temp.html(comment).find('fieldset').replaceWith(function() {
13-
        var $n = $('> legend', this), n = $n.text(); $n.remove();
13+
        var $n = $('> legend', this), n = $n.text(); $n.remove();
14-
        return quote_this(n, $(this).html())
14+
        return quote_this(n, $(this).html())
15-
    }).end().html();
15+
    }).end().html();
16-
16+
17-
    window.location.hash = '#form_comment';
17+
    window.location.hash = '#form_comment';
18-
18+
19-
    $txtarea.val(quote_this(author, comment)).focus();  
19+
    $txtarea.val(quote_this(author, comment)).focus();  
20-
    return false;
20+
    return false;
21
});