first commit

This commit is contained in:
Rachit Bhargava
2023-07-21 17:12:10 -04:00
parent d0fe47dde4
commit 5d0f0734d8
14003 changed files with 2829464 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
(function($) {
'use strict';
if (typeof wpcf7 === 'undefined' || wpcf7 === null) {
return;
}
window.wpcf7dtx = window.wpcf7dtx || {};
wpcf7dtx.taggen = {};
wpcf7dtx.taggen.escapeRegExp = function(str) {
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
};
wpcf7dtx.taggen.replaceAll = function(input, f, r, no_escape) {
if (input !== undefined && input !== null && typeof(input) == 'string' && input.trim() !== '' && input.indexOf(f) > -1) {
var rexp = new RegExp(wpcf7dtx.taggen.escapeRegExp(f), 'g');
if (no_escape) { rexp = new RegExp(f, 'g'); }
return input.replace(rexp, r);
}
return input;
};
wpcf7dtx.taggen.updateOption = function(e) {
var $this = $(e.currentTarget),
value = encodeURIComponent(wpcf7dtx.taggen.replaceAll($this.val(), "'", '''));
$this.siblings('input[type="hidden"].option').val(value);
};
$(function() {
$('form.tag-generator-panel input.dtx-option').on('change keyup', wpcf7dtx.taggen.updateOption);
});
})(jQuery);