PageSourceSearch

https://civilmplus.org/wp-content/themes/civilmplus-2017/js/custom-upload.js

js civilmplus.org collected 2026-10-02 10:47:46 UTC 1,122 bytes, 30 lines download raw bytes

1jQuery(function($){
2	/*
3	 * действие при нажатии на кнопку загрузки изображения
4	 * вы также можете привязать это действие к клику по самому изображению
5	 */
6	$('.upload_image_button').click(function(){
7		var send_attachment_bkp = wp.media.editor.send.attachment;
8		var button = $(this);
9		wp.media.editor.send.attachment = function(props, attachment) {
10			$(button).parent().prev().attr('src', attachment.url);
11			$(button).prev().val(attachment.id);
12			wp.media.editor.send.attachment = send_attachment_bkp;
13		}
14		wp.media.editor.open(button);
15		return false;    
16	});
17	/*
18	 * удаляем значение произвольного поля
19	 * если быть точным, то мы просто удаляем value у input type="hidden"
20	 */
21	$('.remove_image_button').click(function(){
22		var r = confirm("Уверены?");
23		if (r == true) {
24			var src = $(this).parent().prev().attr('data-src');
25			$(this).parent().prev().attr('src', src);
26			$(this).prev().prev().val('');
27		}
28		return false;
29	});
30});

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.