WordPress.org

Plugin Directory

Changeset 425964


Ignore:
Timestamp:
08/19/11 17:46:25 (3 years ago)
Author:
lessbloat
Message:

Added web page previews of author URL on mouseover.

Location:
akismet/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • akismet/trunk/admin.php

    r419805 r425964  
    4343        wp_enqueue_style( 'akismet.css'); 
    4444     
    45         wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery') ); 
     45        wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'), '2.5.4.1' ); 
    4646        wp_enqueue_script( 'akismet.js' ); 
    4747    } 
     
    719719        if (current_user_can('edit_comment', $comment['comment_ID'])) { 
    720720            $comment['comment_author_url'] = ''; 
     721            do_action( 'comment_remove_author_url' ); 
    721722            print(wp_update_comment( $comment )); 
    722723            die(); 
     
    733734        if (current_user_can('edit_comment', $comment['comment_ID'])) { 
    734735            $comment['comment_author_url'] = esc_url($_POST['url']); 
     736            do_action( 'comment_add_author_url' ); 
    735737            print(wp_update_comment( $comment )); 
    736738            die(); 
  • akismet/trunk/akismet.css

    r418875 r425964  
    22#the-comment-list .author .akismet-user-comment-count { display: inline; } 
    33#the-comment-list .author a span { text-decoration: none; color: #999; } 
    4 #the-comment-list .remove_url { margin-left: 5px; color: #999; padding: 2px 3px 2px 0; } 
     4#the-comment-list .remove_url { margin-left: 3px; color: #999; padding: 2px 3px 2px 0; } 
    55#the-comment-list .remove_url:hover { color: #A7301F; font-weight: bold; padding: 2px 2px 2px 0; } 
    66#dashboard_recent_comments .akismet-status { display: none; } /* never show the flagged by text on the dashboard */ 
     
    99span.comment-link a { text-decoration: underline; } 
    1010span.comment-link:after { content: " " attr(title) " "; color: #aaa; text-decoration: none; } 
     11.mshot-arrow { width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-right:10px solid #5C5C5C; position: absolute; left: -6px; top: 91px; } 
     12.mshot-container { background: #5C5C5C; position: absolute; top: -94px; padding: 7px; width: 250px; height: 188px; z-index: 20000; -moz-border-radius:6px; border-radius:6px; -webkit-border-radius:6px; } 
  • akismet/trunk/akismet.js

    r418875 r425964  
    1515         
    1616        if (thisTitle) { 
    17             jQuery(this).after('<a href="#" class="remove_url" commentid="'+ thisCommentId[1] +'" title="Remove this URL">x</a>'); 
     17            jQuery(this).after(' <a href="#" class="remove_url" commentid="'+ thisCommentId[1] +'" title="Remove this URL">x</a>'); 
    1818        } 
    1919    }); 
     
    7272        return false; 
    7373    }); 
    74  
     74    jQuery('a[id^="author_comment_url"]').mouseover(function () { 
     75        // Need to determine size of author column 
     76        var thisParentWidth = jQuery(this).parent().width(); 
     77        // It changes based on if there is a gravatar present 
     78        thisParentWidth = (jQuery(this).parent().find('.grav-hijack').length) ? thisParentWidth - 42 + 'px' : thisParentWidth + 'px'; 
     79        if (jQuery(this).find('.mShot').length == 0 && !jQuery(this).hasClass('akismet_undo_link_removal')) { 
     80            var thisId = jQuery(this).attr('id').replace('author_comment_url_', ''); 
     81            jQuery('.widefat td').css('overflow', 'visible'); 
     82            jQuery(this).css('position', 'relative'); 
     83            var thisHref = jQuery.URLEncode(jQuery(this).attr('href')); 
     84            jQuery(this).append('<div class="mShot mshot-container" style="left: '+thisParentWidth+'"><div class="mshot-arrow"></div><img src="http://s.wordpress.com/mshots/v1/'+thisHref+'?w=250" width="250" height="188" class="mshot-image_'+thisId+'" style="margin: 0;" /></div>'); 
     85            setTimeout(function () { 
     86                jQuery('.mshot-image_'+thisId).attr('src', 'http://s.wordpress.com/mshots/v1/'+thisHref+'?w=250&r=2'); 
     87            }, 6000); 
     88            setTimeout(function () { 
     89                jQuery('.mshot-image_'+thisId).attr('src', 'http://s.wordpress.com/mshots/v1/'+thisHref+'?w=250&r=3'); 
     90            }, 12000); 
     91        } else { 
     92            jQuery(this).find('.mShot').css('left', thisParentWidth).show(); 
     93        } 
     94    }).mouseout(function () { 
     95        jQuery(this).find('.mShot').hide(); 
     96    }); 
    7597}); 
     98// URL encode plugin 
     99jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/; 
     100  while(x<c.length){var m=r.exec(c.substr(x)); 
     101    if(m!=null && m.length>1 && m[1]!=''){o+=m[1];x+=m[1].length; 
     102    }else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16); 
     103    o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;} 
     104}); 
  • akismet/trunk/readme.txt

    r420712 r425964  
    3535* Limit Akismet CSS and Javascript loading in wp-admin to just the pages that need it 
    3636* Added author URL quick removal functionality 
     37* Added mShot preview on Author URL hover 
    3738 
    3839= 2.5.3 =  
Note: See TracChangeset for help on using the changeset viewer.