html 罗宾斯卡普兰非托尔和托尔
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 罗宾斯卡普兰非托尔和托尔相关的知识,希望对你有一定的参考价值。
<!-- Accept Popup -->
<script>
$(document).ready(function () {
$('.popup-link').on('click', function () {
// On click "Accept"
$('#element-271 a').on('click', function (e) {
e.preventDefault();
$('form').submit();
$('.lightbox-close, .popup-close-button').click();
$('#element-268').hide();
});
// On click "Cancel"
$('#element-272 a').on('click', function (e) {
e.preventDefault();
$('.lightbox-close, .popup-close-button').click();
});
});
});
</script>
<!-- Bad words validation -->
<script>
var excludeRegex = /^((?!(word|anal|anus|arse|ass|ass fuck|ass hole|assfucker|asshole|assshole|bastard|bitch|black cock|bloody hell|boong|cock|cockfucker|cocksuck|cocksucker|coon|coonnass|crap|cunt|cyberfuck|damn|darn|dick|dirty|douche|dummy|erect|erection|erotic|escort|fag|faggot|fuck|Fuck off|fuck you|fuckass|fuckhole|god damn|gook|hard core|hardcore|homoerotic|hore|lesbian|lesbians|mother fucker|motherfuck|motherfucker|negro|nigger|orgasim|orgasm|penis|penisfucker|piss|piss off|porn|porno|pornography|pussy|retard|sadist|sex|sexy|shit|slut|son of a bitch|suck|tits|viagra|whore|xxx))[\s\S])*$/;
function validateThorInput(field) {
window.__custom_form_validations.push(
{
fieldName: field,
validationFn: function (input) {
return {
isValid: excludeRegex.test(input.value.toLowerCase()),
message: window._Translate.get('contains bad word'),
};
},
}
);
}
function validateOldInput(field) {
$.validator.addMethod('badWords', function (value, element) {
return excludeRegex.test(value.toLowerCase());
});
$('input[name="' + field + '"]').addClass('badWords');
$.extend($.validator.messages, { badWords: 'contains bad word' });
}
$(document).ready(function () {
if (window.__page_generator) {
window.__custom_form_validations = [];
$('input[type="text"], textarea, input[type="email"]').each(function () {
validateThorInput($(this).attr('name'));
});
}
else {
$('input[type="text"], textarea, input[type="email"]').each(function () {
validateOldInput($(this).attr('name'));
});
}
});
</script>
以上是关于html 罗宾斯卡普兰非托尔和托尔的主要内容,如果未能解决你的问题,请参考以下文章