X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/245e789b234afa4525862e7a6e5e3c2e7a52ef20..3194d1bb103c2d8db4f44feeced5e58ee2756658:/wp-content/plugins/akismet/_inc/akismet.js diff --git a/wp-content/plugins/akismet/_inc/akismet.js b/wp-content/plugins/akismet/_inc/akismet.js index aa0aab42..101db40f 100644 --- a/wp-content/plugins/akismet/_inc/akismet.js +++ b/wp-content/plugins/akismet/_inc/akismet.js @@ -1,4 +1,8 @@ jQuery( function ( $ ) { + var mshotRemovalTimer = null; + var mshotSecondTryTimer = null + var mshotThirdTryTimer = null + $( 'a.activate-option' ).click( function(){ var link = $( this ); if ( link.hasClass( 'clicked' ) ) { @@ -18,18 +22,27 @@ jQuery( function ( $ ) { var thisId = $(this).attr('commentid'); $(this).insertAfter('#comment-' + thisId + ' .author strong:first').show(); }); - $('#the-comment-list').find('tr.comment, tr[id ^= "comment-"]').find('.column-author a[title ^= "http://"]').each(function () { - var thisTitle = $(this).attr('title'); - thisCommentId = $(this).parents('tr:first').attr('id').split("-"); - - $(this).attr("id", "author_comment_url_"+ thisCommentId[1]); - - if (thisTitle) { - $(this).after( - $( 'x' ) - .attr( 'commentid', thisCommentId[1] ) - .attr( 'title', WPAkismet.strings['Remove this URL'] ) - ); + $('#the-comment-list') + .find('tr.comment, tr[id ^= "comment-"]') + .find('.column-author a[href^="http"]:first') // Ignore mailto: links, which would be the comment author's email. + .each(function () { + var linkHref = $(this).attr( 'href' ); + + // Ignore any links to the current domain, which are diagnostic tools, like the IP address link + // or any other links another plugin might add. + var currentHostParts = document.location.href.split( '/' ); + var currentHost = currentHostParts[0] + '//' + currentHostParts[2] + '/'; + + if ( linkHref.indexOf( currentHost ) != 0 ) { + var thisCommentId = $(this).parents('tr:first').attr('id').split("-"); + + $(this) + .attr("id", "author_comment_url_"+ thisCommentId[1]) + .after( + $( 'x' ) + .attr( 'commentid', thisCommentId[1] ) + .attr( 'title', WPAkismet.strings['Remove this URL'] ) + ); } }); $('.remove_url').live('click', function () { @@ -72,7 +85,7 @@ jQuery( function ( $ ) { }); $('.akismet_undo_link_removal').live('click', function () { var thisId = $(this).attr('cid'); - var thisUrl = $(this).attr('href').replace("http://www.", "").replace("http://", ""); + var thisUrl = $(this).attr('href'); var data = { action: 'comment_author_reurl', _wpnonce: WPAkismet.comment_author_url_nonce, @@ -91,38 +104,63 @@ jQuery( function ( $ ) { if (response) { // Add "x" link $("a[commentid='"+ thisId +"']").show(); - // Show link - $("#author_comment_url_"+ thisId).removeClass('akismet_undo_link_removal').html(thisUrl); + // Show link. Core strips leading http://, so let's do that too. + $("#author_comment_url_"+ thisId).removeClass('akismet_undo_link_removal').text( thisUrl.replace( /^http:\/\/(www\.)?/ig, '' ) ); } } }); return false; }); - $('a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type').mouseover(function () { - var wpcomProtocol = ( 'https:' === location.protocol ) ? 'https://' : 'http://'; - // Need to determine size of author column - var thisParentWidth = $(this).parent().width(); - // It changes based on if there is a gravatar present - thisParentWidth = ($(this).parent().find('.grav-hijack').length) ? thisParentWidth - 42 + 'px' : thisParentWidth + 'px'; - if ($(this).find('.mShot').length == 0 && !$(this).hasClass('akismet_undo_link_removal')) { - var self = $( this ); - $('.widefat td').css('overflow', 'visible'); - $(this).css('position', 'relative'); - var thisHref = $.URLEncode( $(this).attr('href') ); - $(this).append('