6627b1c33bdef1886f84fce4df14d0dd5c786657 chmalee Fri Mar 8 17:10:21 2024 -0800 Make the DataTable update dynamically. Correctly use a hidden file input to keep track of submitted and unsubmitted files diff --git src/hg/hgHubConnect/trackHubWizard.c src/hg/hgHubConnect/trackHubWizard.c index 5983908..bbfe9aa 100644 --- src/hg/hgHubConnect/trackHubWizard.c +++ src/hg/hgHubConnect/trackHubWizard.c @@ -61,71 +61,71 @@ } jsonWriteListEnd(jw); } jsonWriteObjectEnd(jw); jsInlineF("var userFiles = %s;\n", dyStringCannibalize(&jw->dy)); jsonWriteFree(&jw); } void doTrackHubWizard() /* Offer an upload form so users can upload all their hub files */ { jsIncludeFile("utils.js", NULL); jsIncludeFile("ajax.js", NULL); jsIncludeFile("lodash.3.10.0.compat.min.js", NULL); jsIncludeFile("cart.js", NULL); -jsIncludeFile("tus.min.js", NULL); +jsIncludeFile("tus.js", NULL); jsIncludeFile("hgMyData.js", NULL); webIncludeResourceFile("../style/bootstrap.min.css"); webIncludeResourceFile("../style/gb.css"); puts("<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">\n"); puts("<link rel=\"stylesheet\" type=\"text/css\" " "href=\"https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css\">\n"); puts("<script type=\"text/javascript\" " "src=\"https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js\"></script>"); puts("<div id='hubUpload' class='hubList'>\n"); puts("<div class='row'>\n"); puts("<div class='col-md-6'>\n"); puts("<div class='row'>\n"); puts("<div class='tabSection'>\n"); puts("<h4>Create your own hub</h4>\n"); puts("<p>After choosing files, click \"Create Hub\" to begin uploading the files to our server</p>\n"); puts("<div class='buttonDiv' id='chooseAndSendFilesRow'>\n"); -puts("<label id='btnForInput' class='button' for=\"uploadedFiles\">Choose files</label>\n"); +puts("<button id='btnForInput' class='button' for=\"chosenFiles\">Choose files</button>\n"); puts("</div>\n"); // .buttonDiv puts("<div id='fileList' style=\"clear: right\"></div>\n"); puts("</div>"); // .tabSection puts("</div>\n"); // row puts("<div class='row'>\n"); puts("<div class='tabSection'>"); puts("For information on making track hubs, see the following pages: \n " "<ul>\n" "<li><a href='../goldenPath/help/hubQuickStart.html' style='color:#121E9A' target=_blank>Quick Start Guide</a></li>\n" "<li><a href=\"../goldenPath/help/hgTrackHubHelp.html\" style='color:#121E9A' TARGET=_blank>Track Hub User's Guide</a></li>\n" "<li><a href=\"../goldenPath/help/hgTrackHubHelp#Hosting\" style='color:#121E9A' target=_blank>Where to Host Your Track Hub</a></li>\n" "<li><a href=\"../goldenPath/help/trackDb/trackDbHub.html\" style='color:#121E9A' target=_blank>Track Hub Settings Reference</a></li>\n" "<li><a href=\"../goldenPath/help/publicHubGuidelines.html\" style='color:#121E9A' target=_blank>Guidelines for Submitting a Public Hub</a></li>\n" "</ul>\n" "<BR>You may also <a href='../contacts.html' style='color:#121E9A'>contact us</a> if you have any " "issues or questions on hub development."); puts("</div>"); // .tabSection puts("</div>\n"); // col-md-6 puts("</div>\n"); // row -puts("<div id='uploadedFilesSection' style=\"display: none\" class='col-md-6 tabSection'>"); +puts("<div id='chosenFilesSection' style=\"display: none\" class='col-md-6 tabSection'>"); puts("<h4>Your uploaded hubs</h4>"); webIncludeFile("inc/hgMyData.html"); puts("</div>\n"); puts("</div>\n"); // row puts("</div>\n"); // row outFilesForUser(); jsInline("$(document).ready(function() {\nhubCreate.init();\n})"); puts("</div>"); // get the current files stored for this user } #define FILEVAR "userFile__filename" #define FILEVARBIN "userFile__binary" void doCreateHub(struct cart *cart)