first commit
This commit is contained in:
31
public/js/wpdiscuz/src/use-gravatar.js
Normal file
31
public/js/wpdiscuz/src/use-gravatar.js
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Compatibility functions for the wpDiscuz plugin.
|
||||
*
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* @file This file handles the use_gravatar checkbox for wpDiscuz.
|
||||
* @author Peter Putzer <github@mundschenk.at>
|
||||
* @license GPL-2.0-or-later
|
||||
* @since 2.2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resets the use_gravatar checkbox after posting a new comment in wpDiscuz.
|
||||
*/
|
||||
jQuery( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
const $useGravatarCheckbox = $( '#' + avatarPrivacy.checkbox );
|
||||
|
||||
function resetUseGravatar() {
|
||||
const useGravatar =
|
||||
Cookies.get( avatarPrivacy.cookie ) !== undefined &&
|
||||
'' !== Cookies.get( avatarPrivacy.cookie )
|
||||
? 'checked'
|
||||
: '';
|
||||
|
||||
$useGravatarCheckbox.prop( 'checked', useGravatar );
|
||||
}
|
||||
|
||||
$( document ).on( 'ajaxComplete', resetUseGravatar );
|
||||
} );
|
31
public/js/wpdiscuz/use-gravatar.js
Normal file
31
public/js/wpdiscuz/use-gravatar.js
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Compatibility functions for the wpDiscuz plugin.
|
||||
*
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* @file This file handles the use_gravatar checkbox for wpDiscuz.
|
||||
* @author Peter Putzer <github@mundschenk.at>
|
||||
* @license GPL-2.0-or-later
|
||||
* @since 2.2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resets the use_gravatar checkbox after posting a new comment in wpDiscuz.
|
||||
*/
|
||||
jQuery(function ($) {
|
||||
'use strict';
|
||||
|
||||
var $useGravatarCheckbox = $('#' + avatarPrivacy.checkbox);
|
||||
|
||||
function resetUseGravatar() {
|
||||
var useGravatar =
|
||||
Cookies.get(avatarPrivacy.cookie) !== undefined &&
|
||||
'' !== Cookies.get(avatarPrivacy.cookie) ?
|
||||
'checked' :
|
||||
'';
|
||||
|
||||
$useGravatarCheckbox.prop('checked', useGravatar);
|
||||
}
|
||||
|
||||
$(document).on('ajaxComplete', resetUseGravatar);
|
||||
});
|
2
public/js/wpdiscuz/use-gravatar.min.js
vendored
Normal file
2
public/js/wpdiscuz/use-gravatar.min.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/*! avatar-privacy use-gravatar.js 2023-05-01 10:26:31 PM */
|
||||
jQuery(function(a){"use strict";var e=a("#"+avatarPrivacy.checkbox);a(document).on("ajaxComplete",function(){var a=void 0!==Cookies.get(avatarPrivacy.cookie)&&""!==Cookies.get(avatarPrivacy.cookie)?"checked":"";e.prop("checked",a)})});
|
Reference in New Issue
Block a user