1jQuery(document).ready(function($) { 2 3 $('#download-button-form, #download-button-down, #download-button-admin').on('click', function() { 4 var button = $(this); 5 button.prop('disabled', true); // ÐеакÑивиÑÑем ÐºÐ½Ð¾Ð¿ÐºÑ 6 console.log('Ðнопка нажаÑа, оÑпÑавка AJAX-запÑоÑа...'); 7 var userId = $('#set_user_id').val() ? $('#set_user_id').val() : $('#user_id').text(); 8 $.ajax({ 9 url: '/wp-admin/admin-ajax.php', 10 type: 'POST', 11 data: { 12 action: 'generate_word_document', 13 postId: $('#post_id').text(), // ÐолÑÑаем ID пÑоекÑа 14 userId: userId // ÐолÑÑаем ID полÑзоваÑÐµÐ»Ñ 15 }, 16 success: function(response) { 17 console.log('ÐÑÐ²ÐµÑ Ð¾Ñ ÑеÑвеÑа:', response); 18 if (response.success) { 19 // Создаем вÑеменнÑÑ ÑÑÑÐ»ÐºÑ Ð´Ð»Ñ ÑкаÑÐ¸Ð²Ð°Ð½Ð¸Ñ Ñайла 20 var link = document.createElement('a'); 21 link.href = response.data.file_url; // URL Ñайла 22 link.download = ''; // УÑÑанавливаем аÑÑибÑÑ download 23 document.body.appendChild(link); // ÐобавлÑем ÑÑÑÐ»ÐºÑ Ð² докÑÐ¼ÐµÐ½Ñ 24 link.click(); // ÐниÑиализиÑÑем ÑкаÑивание 25 document.body.removeChild(link); // УдалÑем ÑÑÑÐ»ÐºÑ Ð¸Ð· докÑменÑа 26 27 // ÐÑпÑавлÑем запÑÐ¾Ñ Ð½Ð° Ñдаление Ñайла 28 29 } else { 30 $('#download-status').text(response.data.message); 31 } 32 }, 33 error: function(jqXHR, textStatus, errorThrown) { 34 console.error('ÐÑибка AJAX:', textStatus, errorThrown); 35 $('#download-status').text('ÐÑоизоÑла оÑибка пÑи загÑÑзке Ñайла.'); 36 }, 37 complete: function() { 38 button.prop('disabled', false); // ÐклÑÑаем ÐºÐ½Ð¾Ð¿ÐºÑ Ð¾Ð±ÑаÑно 39 } 40 }); 41 }); 42});
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.