View difference between Paste ID: 4K31LhW7 and hyGHY5iJ
SHOW: | | - or go back to the newest paste.
1
$('.post')
2
        .live('mouseup', function(e) {
3
            var text = "";
4
5
            if (window.getSelection) {
6
                text = window.getSelection()
7
                    .toString();
8
9
            } else if (document.selection && document.selection.type != "Control") {
10
                text = document.selection.createRange()
11
                    .text;
12
            }
13
            text = text + '';
14
15
            if (!text) {
16
                selectednum = 0;
17
                lastselected = '';
18
                return;
19
            }
20
            lastselected = text;
21
            selectednum = num;
22-
                .join("\n>");
22+
23
            lastselected = '>' + lastselected.split("\n")
24
                .join("\n>");
25
})
26
27
$('.postbtn-reply-href')
28
        .live('click', function() {
29
            var num = $(this)
30
                .attr('name');
31
	    //↓↓↓↓↓↓
32
            var str = '>>' + num + '\n';
33
34
            if (selectednum == num) {
35
		//↓↓↓↓↓↓
36
                str += lastselected + '\n';
37
                selectednum = 0;
38
            }
39
40
            if (Store.get('old.append_postform', false)) {
41
                if (appendPostForm(num)) insert(str);
42
43
            } else {
44
                insert(str);
45
            }
46
47
            return false;
48
        });
49
});