PageSourceSearch

https://tokyo-kiwanis.or.jp/_templates/_modules/mailform/js/zip.js?t=1790983325

js tokyo-kiwanis.or.jp collected 2026-10-02 23:22:32 UTC 2,426 bytes, 58 lines download raw bytes

1window.onpageshow = function(event) {
2	if (event.persisted) {
3		window.location.reload();
4	}
5};
6(function($){$(function(){
7	var timestamp = new Date().getTime();
8	if( $('form#mailForm').length > 0 ){
9		$.post('/index.php?a=mailform/zip&t='+timestamp,{'getses':1},function(d){
10			if( $('form#mailForm input[name="token"]').length == 0 )
11				$('form#mailForm').append('<input type="hidden" name="token" value="'+d+'">');
12			else
13				$('form#mailForm input[name="token"]').val(d);
14		});
15	} else if( $('form').length > 0 ) {
16		$.post('/index.php?a=mailform/zip&t='+timestamp,{'getses':1},function(d){
17			$('form').append('<input type="hidden" name="token" value="'+d+'">');
18		});
19	}
20	$('.ant2api-zip').unbind().keyup(function(e){
21		e.preventDefault();
22		var n=$(this).attr('name').replace(/\[(\d)\]/,'');
23		var zip_code = $('input[name="'+n+'\[0\]"]').val()+$('input[name="'+n+'\[1\]"]').val();
24		zip_code = zip_code.replace(/[^\d]/g,'');
25		if( zip_code.length === 7 ){
26			$('#zip-select').remove();
27			$.get(zip_connector+'&c='+zip_code+'&f=json',function(d){
28				var json = JSON.parse(d);
29				if( json.result_num === 1 ){
30					$('select[name="'+n+'\[2\]"]').val(json.result[0].pref);
31					$('input[name="'+n+'\[3\]"]').val((json.result[0].city||'')+(json.result[0].sub||'')+(json.result[0].addr||''));
32				} else if(json.result_num > 1 ){
33					$('input[name="'+n+'\[0\]"]').parent().css('position','relative');
34					$('#zip-select').remove();
35					var html = '<div style="position:absolute;background:white;width:400px;padding:10px;display:none;" id="zip-select"><p>2つの住所が見つかりました。選択してください。</p></div>';
36					$('input[name="'+n+'\[0\]"]').parent().append(html);
37					for( var i in json.result ){
38						var pref = json.result[i].pref||'';
39						var addr = (json.result[i].city||'')+(json.result[i].sub||'')+(json.result[i].addr||'');
40						if( pref && addr ){
41							$(document.createElement('a'))
42								.html(pref+addr)
43								.attr({'data-pref':pref,'data-addr':addr})
44								.css({'display':'block','padding':'5px','cursor':'pointer'})
45								.on('click',function(){
46									$('select[name="'+n+'\[2\]"]').val($(this).attr('data-pref'));
47									$('input[name="'+n+'\[3\]"]').val($(this).attr('data-addr'));
48									$('#zip-select').remove();
49								})
50								.appendTo('#zip-select');
51						}
52					}
53					$('#zip-select').slideDown();
54				}
55			});
56		}
57	})
58});})(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.