1/* 2 * This is a file used in wide range of screen, include customer site and admin site 3 **/ 4 5/** 6 * 渡ãã颿°ãwindow.onloadã«ç»é²(ãã¦å®è¡å¾åé¤)ãã 7 * 8 * checkboxã®ãã§ãã¯ç¶æ ããDOMContentLoadedãããã使ç¨ãã¦ããjQuery 3æªæºã® 9 * jQuery(handler)ã®ã¿ã¤ãã³ã°ã§checkboxã®ãã§ãã¯ç¶æ ãåå¾ã§ããªããããããã§ 10 * 代æ¿ããã 11 */ 12function callOnLoadWindow(callback) { 13 const callbackWithRemoveEventListener = function () { 14 callback(); 15 16 window.removeEventListener('load', callbackWithRemoveEventListener); 17 }; 18 19 window.addEventListener('load', callbackWithRemoveEventListener); 20} 21 22$(function () { 23 24 'use strict' 25 26 // ãã¤ãã³å¤æ 27 //Replace all Hyphen-kind character âã¼ââ to ï¼ when input to ensure the input just have Japanese only 28 var hyphenCharacterArray = hyphenCharacterStr.split(""); 29 var hyphenListRegex = new RegExp(hyphenCharacterArray.join("|"), "g") 30 31 $('.auto-hyphen').on("blur", function(e) { 32 $(this).val($(this).val().replace(hyphenListRegex, "â")); 33 }) 34 $('form:has(.auto-hyphen)').on('submit', function () { 35 $('.auto-hyphen', this).each(function () { 36 $(this).val($(this).val().replace(hyphenListRegex, "â")); 37 }); 38 }); 39 40 /** 41 * ç»åãã¡ã¤ã«ã¢ãããã¼ãã®ãã¬ãã¥ã¼é¢ä¿ 42 */ 43 $('input:file.previewable').on('change', function () { 44 var $preview = $(this).siblings('.preview'); 45 46 if (!$preview.length) { 47 return; 48 } 49 50 var file = this.files[0]; 51 var previewImg = $preview.eq(0)[0]; 52 53 if (!file) { 54 if (previewImg.dataset.originalSrc) { 55 previewImg.src = previewImg.dataset.originalSrc; 56 } 57 else { 58 $preview.addClass('none'); 59 } 60 61 return; 62 } 63 64 if (!file.type.match(/^image\//)) { 65 return; 66 } 67 68 previewImg.src = URL.createObjectURL(file); 69 previewImg.onload = function () { 70 URL.revokeObjectURL(this.src); 71 }; 72 73 $preview.removeClass('none'); 74 }); 75 76 function updateMeterReadingControls() { 77 if ($(this).prop('checked')) { 78 $(this).closest('div').find('img').not('.none').hide(); 79 $(this).closest('div').find('input:file, button').prop('disabled', true); 80 } 81 else { 82 $(this).closest('div').find('img').not('.none').show(); 83 $(this).closest('div').find('input:file, button').prop('disabled', false); 84 } 85 } 86 $('.delete_uploaded_file') 87 .on('click', updateMeterReadingControls) 88 .each(updateMeterReadingControls); 89 90 $('.reset_file_upload').on('click', function () { 91 $(this).parent().find('input:file').val('').trigger('change'); 92 }); 93 94 /** 95 * ãã©ã¼ã ã®å¤éãµãããã鲿¢ 96 * 97 * ignore-multiple-submitã¯ã©ã¹ããããã©ã¼ã ããµãããããããå ´åããã¹ã¦ 98 * ã®ãµãããããã¿ã³ãdisabledã«ããããã¶ã¤ã³ã®èª¿æ´ãå¿ è¦ãªå ´å 99 * ã¯ã:disabledã©ããããã¦ã 100 * 101 * è¤æ°ãµãããããã¿ã³ããããã©ã¼ã ã§ã»ãã®ãã¿ã³ãç¡å¹åããã¦ãã¾ãã® 102 * ã¯ãIE対å¿ãå¿ è¦ãªããªã£ããsubmitter使ã£ã¦ç´ãã 103 */ 104 $('.ignore-multiple-submit').on('submit', function () { 105 $('[type=submit]:not([name=form_url])', this).prop('disabled', true); 106 }); 107 108 $('.date-choose select').change(function() { 109 var thisDateField = $(this).parents(".date-choose"); 110 var fieldName = thisDateField.attr("field"); 111 var newDateValue = thisDateField.find('select[name=' + fieldName + '_year]').val() +"-"+ thisDateField.find('select[name=' + fieldName + '_month]').val() + "-" + thisDateField.find('select[name=' + fieldName + '_date]').val(); 112 if(newDateValue == '--') { 113 $('input[name=' + fieldName + ']').val(''); 114 } else { 115 $('input[name=' + fieldName + ']').val(newDateValue); 116 } 117 }); 118})
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.