1/* Copyright 2013-2014 Matt Lowe / Squelch Design (http://squelch.it/) 2 3 This program is free software; you can redistribute it and/or modify 4 it under the terms of the GNU General Public License, version 2, as 5 published by the Free Software Foundation. 6 7 This program is distributed in the hope that it will be useful, 8 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 GNU General Public License for more details. 11 12 You should have received a copy of the GNU General Public License 13 along with this program; if not, write to the Free Software 14 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 16*/ 17 18(function($) { 19 $(document).ready(function() { 20 21 if (squelchUnspamAJAX && squelchUnspamAJAX.ajax_enabled) { 22 23 24 // The AJAX option is enabled. Enact on comment form pages only: 25 26 $('#commentform' ).eq(0).each(function( i, elem ) { 27 28 $.ajax({ 29 url: squelchUnspamAJAX.ajaxurl, 30 data: { 31 action: 'lstunspam_get_fields' 32 }, 33 dataType: 'json', 34 success: function(data) { 35 $.each(data, function( index, value ) { 36 37 if ( index === 'injectable' ) return; 38 39 $('#' + index).attr('name', value ); 40 $('#' + index).attr('id', value ); 41 }); 42 43 $('#' + data['injectable']['name']).val(data['injectable']['value']); 44 } 45 }); 46 47 }); 48 49 } else { 50 51 52 // The AJAX option has not been enabled, use original method 53 54 $('#'+injectable.name).val(injectable.val); 55 56 } 57 58 }); 59})(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.