~canonical-sysadmins/wordpress/5.1

« back to all changes in this revision

Viewing changes to wp-content/plugins/akismet/_inc/akismet.js

  • Committer: Barry Price
  • Date: 2016-01-07 06:09:02 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: barry.price@canonical.com-20160107060902-ck851ica42q3m8k6
new upstream release 4.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
                var thisId = $(this).attr('commentid');
23
23
                $(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
24
24
        });
25
 
        $('#the-comment-list').find('tr.comment, tr[id ^= "comment-"]').find('.column-author a[title]').each(function () {
26
 
                // Comment author URLs are the only URL with a title attribute in the author column.
27
 
                var thisTitle = $(this).attr('title');
28
 
 
29
 
                var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
30
 
 
31
 
                $(this).attr("id", "author_comment_url_"+ thisCommentId[1]);
32
 
 
33
 
                if (thisTitle) {
34
 
                        $(this).after(
35
 
                                $( '<a href="#" class="remove_url">x</a>' )
36
 
                                        .attr( 'commentid', thisCommentId[1] )
37
 
                                        .attr( 'title', WPAkismet.strings['Remove this URL'] )
38
 
                        );
 
25
        $('#the-comment-list')
 
26
                .find('tr.comment, tr[id ^= "comment-"]')
 
27
                .find('.column-author a[href^="http"]:first') // Ignore mailto: links, which would be the comment author's email.
 
28
                .each(function () {
 
29
                var linkHref = $(this).attr( 'href' );
 
30
                
 
31
                // Ignore any links to the current domain, which are diagnostic tools, like the IP address link
 
32
                // or any other links another plugin might add.
 
33
                var currentHostParts = document.location.href.split( '/' );
 
34
                var currentHost = currentHostParts[0] + '//' + currentHostParts[2] + '/';
 
35
                
 
36
                if ( linkHref.indexOf( currentHost ) != 0 ) {
 
37
                        var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
 
38
 
 
39
                        $(this)
 
40
                                .attr("id", "author_comment_url_"+ thisCommentId[1])
 
41
                                .after(
 
42
                                        $( '<a href="#" class="remove_url">x</a>' )
 
43
                                                .attr( 'commentid', thisCommentId[1] )
 
44
                                                .attr( 'title', WPAkismet.strings['Remove this URL'] )
 
45
                                );
39
46
                }
40
47
        });
41
48
        $('.remove_url').live('click', function () {