1export function init($) { 2/* -------------------------------------------------- 3/// ãã©ã¼ã é¢é£ 4-------------------------------------------------- */ 5$(function(){ 6 7 if(0 < $('.formStyleA').length){ 8 $('a.formSubmit').click(function(){ 9 $(this).parents("form").submit(); 10 }) 11 12 $('input[type="file"]').on("change", function() { 13 var file = this.files[0]; 14 if(file != null) { 15 $(this).next('input[type="text"]').val(file.name) 16 } 17 }); 18 if(0 < $('.inputFileWrap').length){ 19 20 $('.inputFileWrap').each(function(i){ 21 var inputTx = $('input.fileText[type="text"]',this); 22 $('input.fileInput[type="file"]',this).on("change", function() { 23 var file = $(this).prop('files')[0].name; 24 if(file != null) { 25 console.log(file); 26 inputTx.val(file); 27 } 28 }); 29 }); 30 31 $(".inputFileWrap .fileText").click(function (e) { 32 $(this).parents(".inputFileWrap").find(".fileLabel").trigger('click'); 33 }); 34 $(".inputFileWrap a.fileClear").click(function (e) { 35 $(this).parents(".inputFileWrap").children('input.fileInput[type="file"]').val(""); 36 $(this).parents(".inputFileWrap").children('input.fileText[type="text"]').val(""); 37 }); 38 } 39 if(0 < $('.phConfirmA').length){ 40 $('.phConfirmA').each(function(i){ 41 var _imageBox_ = $('.image1',this); 42 var _src_ = $('.image1 img',this).attr("src"); 43 var _type_ = _src_.split('.').slice(-1)[0]; 44 if(_type_.indexOf("jpg")!=-1 || _type_.indexOf("jpeg")!=-1 || _type_.indexOf("gif")!=-1 || _type_.indexOf("png")!=-1){ 45 var _image_ = true; 46 } else { 47 var _image_ = false; 48 } 49 if(_image_) { 50 _imageBox_.attr('style','background-image:url('+_src_+')'); 51 } else { 52 _imageBox_.addClass("noImg"); 53 } 54 }); 55 } 56 } 57}); 58 59 60/* -------------------------------------------------- 61/// formStyleA checkbox radio 62-------------------------------------------------- */ 63$(function(){ 64 if(0 < $('.formStyleA').length){ 65 /* 66 $('.formStyleA input[type="checkbox"]').each(function(i){ 67 $(this).parent("label").addClass("checkbox"); 68 }); 69 */ 70 $('.formStyleA input[type="checkbox"]').each(function(i){ 71 if ($(this).is(':checked')) { 72 $(this).parent('.checkbox').addClass("on"); 73 } else { 74 $(this).parent('.checkbox').removeClass("on"); 75 } 76 }); 77 $('.formStyleA input[type="checkbox"]').on('change', function(){ 78 if ($(this).is(':checked')) { 79 $(this).parent('.checkbox').addClass("on"); 80 } else { 81 $(this).parent('.checkbox').removeClass("on"); 82 } 83 }); 84 85 /* 86 $('.formStyleA input[type="radio"]').each(function(i){ 87 $(this).parent("label").addClass("radio"); 88 }); 89 */ 90 $('.formStyleA input[type="radio"]').each(function(i){ 91 if ($(this).is(':checked')) { 92 $(this).parent('.radio').addClass("on"); 93 } else { 94 $(this).parent('.radio').removeClass("on"); 95 } 96 }); 97 $('.formStyleA input[type="radio"]').on('change', function(){ 98 var name = $(this).attr("name"); 99 $('.formStyleA input[name="'+name+'"]').each(function(i){ 100 $(this).parent('.radio').removeClass("on"); 101 }); 102 if ($(this).is(':checked')) { 103 $(this).parent('.radio').addClass("on"); 104 } 105 }); 106 $('.formStyleA .radioGroup input[type="radio"]').on('change', function(){ 107 $(this).parents(".radioGroup").find(".radio").each(function(i){ 108 $(this).removeClass("on"); 109 $('input[type="radio"]',this).prop('checked', false); 110 }); 111 $(this).prop('checked', true); 112 $(this).parents(".radio").addClass("on"); 113 }); 114 115 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.