https://prm.ua/wp-content/plugins/email-anti-spam/public/js/exopite-anti-spam-public.js?ver=20201127
1// http://jqueryboilerplate.com 2; (function ($, window, document, undefined) { 3 4 "use strict"; 5 6 var pluginName = "exopiteAntiSpamAjax", 7 defaults = {}; 8 9 function Plugin(element, options) { 10 this.element = element; 11 this.settings = $.extend({}, defaults, options); 12 this._defaults = defaults; 13 this._name = pluginName; 14 this.init(); 15 } 16 17 $.extend(Plugin.prototype, { 18 init: function () { 19 var plugin = this; 20 plugin.buildCache(); 21 22 plugin.ajaxUrl = plugin.$element.data('ajax-url'); 23 24 if (!plugin.ajaxUrl.length) { 25 return; 26 } 27 28 plugin.bindEvents(); 29 }, 30 bindEvents: function () { 31 var plugin = this; 32 33 plugin.$element.find('.eas-cf7-shortcode-load').off().on('click' + '.' + plugin._name, function (e) { 34 plugin.ajaxLoad.call(plugin, e); 35 }); 36 37 }, 38 destroy: function () { 39 this.unbindEvents(); 40 this.$element.removeData(); 41 }, 42 unbindEvents: function () { 43 this.$element.off('.' + this._name); 44 }, 45 buildCache: function () { 46 this.$element = $(this.element); 47 }, 48 setElements: function (plugin, response) { 49 plugin.$element.html(response); 50 var $form = plugin.$element.find('.wpcf7-form'); 51 var action = $form.attr('action').split("#"); 52 $form.attr('action', '#' + action[1]); 53 54 plugin.$element.trigger("easSetElementsBefore", [plugin, response]); 55 56 /** 57 * @link https://wordpress.org/support/topic/init-function-wpcf7initform/ 58 */ 59 var $form = plugin.$element.find('.wpcf7 > form'); 60 61 wpcf7.initForm( $form ); 62 if ( wpcf7.cached ) { 63 wpcf7.refill( $form ); 64 } 65 66 wpcf7cf.initForm($form); 67 68 $form.exopiteAntiSpam(); 69 70 plugin.$element.trigger("easSetElementsAfter", [plugin, response]); 71 72 }, 73 ajaxLoad: function (e) { 74 var plugin = this; 75 e.preventDefault(); 76 77 var dataJSON = { 78 'action': 'eas_get_contact_form_7_ajax', 79 'cf7_id': plugin.$element.data('id'), 80 'cf7_title': plugin.$element.data('title'), 81 'eas_cf7_ajax': true, 82 }; 83 84 $.ajax({ 85 cache: false, 86 type: "POST", 87 url: plugin.ajaxUrl, 88 data: dataJSON, 89 success: function( response ){ 90 plugin.setElements(plugin, response); 91 }, 92 error: function( xhr, status, error ) { 93 console.log( 'Status: ' + xhr.status ); 94 console.log( 'Error: ' + xhr.responseText ); 95 }, 96 }); 97 98 }, 99 }); 100 101 $.fn[pluginName] = function (options) { 102 return this.each(function () { 103 if (!$.data(this, "plugin_" + pluginName)) { 104 $.data(this, "plugin_" + pluginName, new Plugin(this, options)); 105 } 106 }); 107 }; 108 109})(jQuery, window, document); 110 111 112; (function ($, window, document, undefined) { 113 114 "use strict"; 115 116 var pluginName = "exopiteAntiSpam", 117 defaults = {}; 118 119 function Plugin(element, options) { 120 this.element = element; 121 this.settings = $.extend({}, defaults, options); 122 this._defaults = defaults; 123 this._name = pluginName; 124 this.movedOrPressed = false; 125 this.init(); 126 } 127 128 $.extend(Plugin.prototype, { 129 init: function () { 130 var plugin = this; 131 plugin.buildCache(); 132 133 plugin.ajaxUrl = plugin.$element.find('.eas-ajax-url').data('ajax-url'); 134 135 if (!plugin.ajaxUrl.length) { 136 return; 137 } 138 139 plugin.$exanspselAuth = this.$element.find('.exanspsel-auth'); 140 plugin.$timestamp = this.$element.find('.eastimestamp'); 141 plugin.$acceptance = this.$element.find('.wpcf7-acceptance input[type="checkbox"]'); 142 plugin.$acceptanceToken = this.$element.find('#easacceptance'); 143 144 plugin.bindEvents(); 145 plugin.ajaxLoad(); 146 }, 147 ajaxLoad: function () { 148 var plugin = this; 149 if ( plugin.$element.find('.eas-ajax-url').data('ajax-load') ) { 150 plugin.getElements(true, true); 151 } 152 }, 153 bindEvents: function () { 154 var plugin = this; 155 156 plugin.$element.parents('.wpcf7').on('wpcf7mailsent', function (e) { 157 plugin.getElements(true, true); 158 }); 159 160 plugin.$element.parents('.wpcf7').on('wpcf7invalid', function (e) { 161 plugin.getElements(false, true); 162 }); 163 164 plugin.$element.find('.wpcf7-acceptance').on('mousemove keypress', function (e) { 165 plugin.movedOrPressed = true; 166 plugin.$element.find('.wpcf7-acceptance').off('mousemove keypress'); 167 }); 168 169 plugin.$acceptance.on('click', function (e) { 170 if ($(this).is(":checked") && plugin.$acceptanceToken.val() == '' && plugin.movedOrPressed) { 171 plugin.getAcceptanceToken(); 172 } 173 174 }); 175 }, 176 destroy: function () { 177 this.unbindEvents(); 178 this.$element.removeData(); 179 }, 180 unbindEvents: function () { 181 this.$element.off('.' + this._name); 182 }, 183 buildCache: function () { 184 this.$element = $(this.element); 185 }, 186 doAjax: function (dataJSON, callback) { 187 var plugin = this; 188 $.ajax({ 189 cache: false, 190 type: "POST", 191 url: plugin.ajaxUrl, 192 data: dataJSON, 193 success: function (response) { 194 callback(response, status, plugin) 195 }, 196 error: function( xhr, status, error ) { 197 console.log( 'Status: ' + xhr.status ); 198 console.log( 'Error: ' + xhr.responseText ); 199 }, 200 }); 201 },
202 setAcceptanceToken: function (response, status, plugin) { 203 plugin.$acceptanceToken.val(response) 204 plugin.$acceptance.parents('.wpcf7-acceptance').removeClass('loading'); 205 }, 206 getAcceptanceToken: function (getTimestamp, getExanspsel) { 207 var plugin = this; 208 plugin.$acceptance.parents('.wpcf7-acceptance').addClass('loading'); 209 210 var dataJSON = { 211 'action': 'eap_get_acceptance_token', 212 }; 213 214 plugin.doAjax(dataJSON, plugin.setAcceptanceToken); 215 }, 216 processElements: function (response, status, plugin) { 217 var data = {}; 218 try { 219 data = JSON.parse(response); 220 if (typeof data.timestamp !== 'undefined') { 221 plugin.$timestamp.val(data.timestamp); 222 } 223 224 if (typeof data.exanspsel !== 'undefined') { 225 plugin.$element.find('.eas-image-selector-images').find('input:checkbox').prop('checked', false); 226 plugin.$element.find('.exanspsel > .wpcf7-checkbox').html(data.exanspsel); 227 plugin.$exanspselAuth = plugin.$element.find('.exanspsel-auth'); 228 } 229 } catch (error) {} 230 }, 231 getElements: function (getTimestamp, getExanspsel) { 232 var plugin = this; 233 var data = {}; 234 235 var exanspselAuth = ''; 236 if (getExanspsel && plugin.$exanspselAuth.length) { 237 exanspselAuth = plugin.$exanspselAuth.val(); 238 plugin.$element.find('.eas-image-selector').addClass('loading'); 239 } 240 241 var timestamp = ''; 242 if (getTimestamp && plugin.$timestamp.length) { 243 timestamp = true; 244 } 245 246 var dataJSON = { 247 'action': 'eap_reload_cf7_fields', 248 'exanspselAuth': exanspselAuth, 249 'timestamp': timestamp, 250 'eas_cf7_ajax': true, 251 // 'nonce': 'nonce-key', 252 }; 253 254 plugin.doAjax(dataJSON, plugin.processElements); 255 256 return data; 257 }, 258 }); 259 260 $.fn[pluginName] = function (options) { 261 return this.each(function () { 262 if (!$.data(this, "plugin_" + pluginName)) { 263 $.data(this, "plugin_" + pluginName, new Plugin(this, options)); 264 } 265 }); 266 }; 267 268})(jQuery, window, document); 269 270 271(function( $ ) { 272 'use strict'; 273 274 $(function() { 275 276 $('.eas-cf7-shortcode').exopiteAntiSpamAjax(); 277 $('.wpcf7-form').exopiteAntiSpam(); 278 279 $('.eas-cf7-shortcode').on('easSetElementsAfter', function (event, plugin, response){ 280 var TextOJB = dnd_cf7_uploader.drag_n_drop_upload; 281 plugin.$element.find('.wpcf7-drag-n-drop-file').CodeDropz_Uploader({ 282 'color' : '#fff', 283 'ajax_url' : dnd_cf7_uploader.ajax_url, 284 'text' : TextOJB.text, 285 'separator' : TextOJB.or_separator, 286 'button_text' : TextOJB.browse, 287 'server_max_error' : TextOJB.server_max_error, 288 'on_success' : function( input, progressBar, response ){ 289 290 // Progressbar Object 291 var progressDetails = $('#' + progressBar, input.parents('.codedropz-upload-wrapper') ); 292 293 // If it's complete remove disabled attribute in button 294 if( $('.in-progress', input.parents('form') ).length === 0 ) { 295 setTimeout(function(){ $('input[type="submit"]', input.parents('form')).removeAttr('disabled'); }, 1); 296 } 297 298 // Append hidden input field 299 progressDetails 300 .find('.dnd-upload-details') 301 .append('<span><input type="hidden" name="'+ input.attr('data-name') +'[]" value="'+ response.data.path +'/'+ response.data.file +'"></span>'); 302 } 303 }); 304 }); 305 306 307 }); 308 309})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.