1/* vim: set tabstop=2 shiftwidth=2 foldmethod=marker: */ 2/** 3 * @author Shogo Kawase <[email protected]> 4 * @copyright 2007-2008 Arc Style Inc. 5 * @version CVS: $Id$ 6 */ 7vw.public = {}; 8 9vw.public.postalSearch = function(url, key) 10{ 11 document.write('<input type="button" name="postalSearchBtn" id="postalSearchBtn" value="æ¤ç´¢" />'); 12 $('#postalSearchBtn').bind('click', function(e){ 13 var zip = [$$(key + '-zip1').value, $$(key + '-zip2').value]; 14 if (isNaN(zip[0]) || isNaN(zip[1]) || zip[0].length < 3 || zip[1].length < 4) { 15 return alert('éµä¾¿çªå·ã¯7æ¡å ¨ã¦æ£ç¢ºã«å ¥åãã¦ãã ãã'); 16 } 17 var params = {zipcode: zip.join('-')}; 18 $.getJSON(url + '/postal/', params, function(json){ 19 if (!json.count) { 20 alert('該å½ãã使ãè¦ã¤ããã¾ããã§ããã'); 21 } else { 22 $('#' + key + '-pref').val(json.pref_code); 23 $('#' + key + '-city').val(json.city_name); 24 $('#' + key + '-addr').val(json.town_name); 25 $('#' + key + '-row').effect('highlight', {}, 1000); 26 vw.form.cursorMoveToEnd($('#' + key + '-addr')[0]); 27 } 28 }); 29 return false; 30 }); 31}; 32
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.