var checkInput = function() { // 检查后缀名 txt csv excel // upload_file_1数据集 file_id = "upload_file_1" var obj = document.getElementById(file_id); var len = obj.files.length; var full_file_name = ""; for (var i = 0; i < len; i++) { full_file_name = obj.files[i].name; // combined.txt } var index =full_file_name.lastIndexOf("."); // 获取文件名后缀的索引 var suffix = full_file_name.substring(index+1, full_file_name.length); // txt if (suffix != "csv" && suffix != "txt" && suffix != "excel"){ window.alert("Please upload a txt, csv or excel file!"); var draw_form = document.getElementsByClassName("draw_form")[0]; draw_form.focus(); return false; } // upload_file_2 gmt数据集 修改 var gsea = $("input[name='gsea_analysis']:checked").val(); if (gsea == "yes"){ file_id = "upload_file_2" var obj = document.getElementById(file_id); var len = obj.files.length; var full_file_name = ""; for (var i = 0; i < len; i++) { full_file_name = obj.files[i].name; // combined.txt } var index =full_file_name.lastIndexOf("."); // 获取文件名后缀的索引 var suffix = full_file_name.substring(index+1, full_file_name.length); // txt if (suffix != "gmt"){ window.alert("Please upload a gmt file!"); var draw_form = document.getElementsByClassName("draw_form")[0]; draw_form.focus(); return false; } } var confidence = document.getElementById("fc_thr").value; if (confidence == ""){ window.alert("Please input log2FC threshold!"); var draw_form = document.getElementsByClassName("draw_form")[0]; draw_form.focus(); return false; } var confidence = document.getElementById("padj_thr").value; if (confidence == ""){ window.alert("Please input padj threshold!"); var draw_form = document.getElementsByClassName("draw_form")[0]; draw_form.focus(); return false; } var confidence = document.getElementById("top").value; if (confidence == ""){ window.alert("Please input top!"); var draw_form = document.getElementsByClassName("draw_form")[0]; draw_form.focus(); return false; } var confidence = document.getElementById("top_fc_thr").value; if (confidence == ""){ window.alert("Please input log2FC threshold for TOP genes!"); var draw_form = document.getElementsByClassName("draw_form")[0]; draw_form.focus(); return false; } var confidence = document.getElementById("top_padj_thr").value; if (confidence == ""){ window.alert("Please input padj threshold for TOP genes!"); var draw_form = document.getElementsByClassName("draw_form")[0]; draw_form.focus(); return false; } // window.alert('email') // 检查邮件格式 var email = document.getElementById("email").value; //box var regex = /^[\w\-\.]+@[a-z0-9]+(\-[a-z0-9]+)?(\.[a-z0-9]+(\-[a-z0-9]+)?)*\.[a-z]{2,4}$/i; if (!regex.test(email)) { window.alert("Please submit the correct email address"); // document.getElementById("email").enter.focus(); var process_form = document.getElementsByClassName("draw_form")[0]; process_form.focus(); return false; } // if (email != ""){ // var regex = /^[\w\-\.]+@[a-z0-9]+(\-[a-z0-9]+)?(\.[a-z0-9]+(\-[a-z0-9]+)?)*\.[a-z]{2,4}$/i; // if (!regex.test(email)) { // window.alert("Please submit the correct email address"); // var draw_form = document.getElementsByClassName("draw_form")[0]; // draw_form.focus(); // return false; // } // } return true; } var download_example_file1 = function() { // 正儿八经的下载文件功能 const fileUrl = "./example/draw_example/volcano_example.txt"; // 文件的实际路径 const fileName = "volcano_example.txt"; // 下载时保存的文件名 const a = document.createElement("a"); // 创建一个 标签元素 a.href = fileUrl; // 设置下载链接 a.download = fileName; // 设置下载文件名 document.body.appendChild(a); // 将 标签添加到页面 a.click(); // 模拟点击 标签,触发下载 document.body.removeChild(a); // 删除 标签,清理DOM } var download_example_file2 = function() { const fileUrl = "./example/draw_example/volcano_gsea_example.gmt"; // 文件的实际路径 const fileName = "volcano_gsea_example.gmt"; // 下载时保存的文件名 const a = document.createElement("a"); // 创建一个 标签元素 a.href = fileUrl; // 设置下载链接 a.download = fileName; // 设置下载文件名 document.body.appendChild(a); // 将 标签添加到页面 a.click(); // 模拟点击 标签,触发下载 document.body.removeChild(a); // 删除 标签,清理DOM // window.open("./example/draw_example/volcano_gsea_example.gmt") } var checkEmail = function() { // 判断email格式是否正确 写的不对 var email = document.getElementById("email").value; //box var regex = /^[\w\-\.]+@[a-z0-9]+(\-[a-z0-9]+)?(\.[a-z0-9]+(\-[a-z0-9]+)?)*\.[a-z]{2,4}$/i; if (email == '' || !regex.test(email)) { window.alert("Please submit the correct email address"); document.getElementById("email").enter.focus(); return false; } else { return true; } } // 修改 function useGSEA(){ document.getElementById("gmt_file").style.display=""; } function noUseGSEA(){ document.getElementById("gmt_file").style.display="none"; }
Yes No

img