1let isSaved = false; 2 3$(function () { 4 $('#postal_code').jpostal({ 5 postcode: ['#postal_code'], 6 address: { 7 '#prefecture': '%3', 8 '#address': '%4%5', 9 }, 10 }); 11 12 $('#subject').on('change', function () { 13 changeRequired(); 14 }); 15 16 coverStrings(); 17 // getStock(); 18 19 $('#payment').on('submit', function (e) { 20 saveOrder(e); 21 }); 22}); 23 24function coverStrings() { 25 $('.items') 26 .children('p') 27 .each(function () { 28 const text = $(this).html(); 29 const replace = text.replace( 30 /SELF-re/g, 31 '<span class="slfr_font">SELF-re</span>' 32 ); 33 34 $(this).html(replace); 35 }); 36} 37 38function saveOrder(event) { 39 if (isSaved) return; 40 41 event.preventDefault(); 42 43 $.ajax({ 44 url: '/self-re/buy/create', 45 type: 'POST', 46 data: {}, 47 headers: { 48 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'), 49 }, 50 }) 51 .done(function () { 52 isSaved = true; 53 $('#payment').trigger('submit'); 54 }) 55 .fail(function () { 56 alert('ã¨ã©ã¼ãçºçãã¾ããã'); 57 }); 58} 59 60function changeRequired() { 61 const subject = $('#subject').val(); 62 63 const labels = [ 64 $('label[for="postal_code"]'), 65 $('label[for="address"]'), 66 $('label[for="phone_number"]'), 67 ]; 68 69 labels.forEach(function (label) { 70 if (subject === '2') { 71 label.addClass('require'); 72 } else { 73 label.removeClass('require'); 74 } 75 }); 76} 77 78/* 79function getStock() { 80 $('input[type="radio"]').on('change', function () { 81 const name = $(this).attr('name'); 82 const pattern = /_variation$/; 83 84 if (!name.match(/_variation$/)) return; 85 86 const target = name.replace(pattern, '') + '_stock'; 87 88 if (!$(`#${target}`).length) return; 89 90 const variation_id = $(`input[name="${name}"]:checked`).val(); 91 const product_id = $(this).parent().attr('data-id'); 92 93 if (!variation_id || !product_id) return; 94 95 $.ajax({ 96 type: 'post', 97 url: '/self-re/buy/stock', 98 headers: { 99 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'), 100 }, 101 data: { 102 product_id: product_id, 103 variation_id: variation_id, 104 }, 105 }) 106 .done(function (data) { 107 if (data.stock > 0) { 108 $(`#${target}`).text(`å¨åº«æ° ${data.stock}å`); 109 } else { 110 $(`#${target}`).text( 111 `å¨åº«ãããã¾ããã ${data.shipment_days}æ¥ä»¥å ã«çºéã§ãã¾ãã` 112 ); 113 } 114 }) 115 .fail(function () { 116 alert('å¨åº«æ°ã®åå¾ã«å¤±æãã¾ããã'); 117 }); 118 }); 119} 120*/
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.