PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 6.4
Jetpack – WP Security, Backup, Speed, & Growth v6.4
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / wpgroho.js
wpgroho.js
39 lines 1015 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global WPGroHo:true, Gravatar */
2 WPGroHo = jQuery.extend( {
3 my_hash: '',
4 data: {},
5 renderers: {},
6 syncProfileData: function( hash, id ) {
7 if ( !WPGroHo.data[hash] ) {
8 WPGroHo.data[hash] = {};
9 jQuery( 'div.grofile-hash-map-' + hash + ' span' ).each( function() {
10 WPGroHo.data[hash][this.className] = jQuery( this ).text();
11 } );
12 }
13
14 WPGroHo.appendProfileData( WPGroHo.data[hash], hash, id );
15 },
16 appendProfileData: function( data, hash, id ) {
17 for ( var key in data ) {
18 if ( jQuery.isFunction( WPGroHo.renderers[key] ) ) {
19 return WPGroHo.renderers[key]( data[key], hash, id, key );
20 }
21
22 jQuery( '#' + id ).find( 'h4' ).after( jQuery( '<p class="grav-extra ' + key + '" />' ).html( data[key] ) );
23 }
24 }
25 }, WPGroHo );
26
27 jQuery( document ).ready( function() {
28 if ( 'undefined' === typeof Gravatar ) {
29 return;
30 }
31
32 Gravatar.profile_cb = function( h, d ) {
33 WPGroHo.syncProfileData( h, d );
34 };
35
36 Gravatar.my_hash = WPGroHo.my_hash;
37 Gravatar.init( 'body', '#wpadminbar' );
38 } );
39