65bf003397e55927776facd7654de161ea8c1e20 lrnassar Fri Jan 30 15:59:33 2026 -0800 Downloading our major CDNs and changing their references to all be local, there are some more corner cases that were low priority as discussed in the ticket. This work is done to improve performance, expecially for overseas users. Refs #33998 diff --git src/hg/lib/jsHelper.c src/hg/lib/jsHelper.c index ff900b9bee4..2630ef49915 100644 --- src/hg/lib/jsHelper.c +++ src/hg/lib/jsHelper.c @@ -241,66 +241,63 @@ if(noScriptMsg && strlen(noScriptMsg)) hPrintf("<noscript><div class='noscript'><div class='noscript-inner'><p>%s</p></div></div></noscript>\n", noScriptMsg); hPrintf("%s",link); freeMem(link); } } void jsIncludeReactLibs() /* Prints out <script src="..."> tags for external libraries including ReactJS & ImmutableJS * and our own model libs, React mixins and components. */ { // We need a module system... webpack? jsIncludeFile("es5-shim.4.0.3.min.js", NULL); jsIncludeFile("es5-sham.4.0.3.min.js", NULL); jsIncludeFile("lodash.3.10.0.compat.min.js", NULL); -puts("<script src=\"//code.jquery.com/jquery-1.9.1.min.js\"></script>"); -puts("<script src=\"//code.jquery.com/ui/1.10.3/jquery-ui.min.js\"></script>"); +jsIncludeFile("jquery.js", NULL); +jsIncludeFile("jquery-ui.js", NULL); jsIncludeFile("react-with-addons-0.12.2.min.js", NULL); jsIncludeFile("immutable.3.7.4.min.js", NULL); jsIncludeFile("jquery.bifrost.1.0.1.min.js", NULL); jsIncludeFile("BackboneExtend.js", NULL); jsIncludeFile("cart.js", NULL); jsIncludeFile("ImModel.js", NULL); jsIncludeFile("CladeOrgDbMixin.js", NULL); jsIncludeFile("PositionSearchMixin.js", NULL); jsIncludeFile("UserRegionsMixin.js", NULL); jsIncludeFile("PathUpdate.js", NULL); jsIncludeFile("PathUpdateOptional.js", NULL); jsIncludeFile("ImmutableUpdate.js", NULL); jsIncludeFile("reactLibBundle.js", NULL); } void jsIncludeAutoCompleteLibs() /* Prints out <script src="..."> tags for autocompleteCat.js */ { jsIncludeFile("jquery.js", NULL); jsIncludeFile("jquery-ui.js", NULL); webIncludeResourceFile("jquery-ui.css"); jsIncludeFile("autocompleteCat.js", NULL); } void jsIncludeDataTablesLibs() -/* Prints out <script src="..."> tags for external libraries: jQuery 1.12.3, the jQuery DataTables +/* Prints out <script src="..."> tags for jQuery and the jQuery DataTables * plugin (version 1.10.12), and the accompanying standard CSS file for DataTables. */ { -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://code.jquery.com/jquery-1.12.3.min.js\"></script>"); -puts("<script type=\"text/javascript\" " - "src=\"https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js\"></script>"); +webIncludeResourceFile("dataTables-1.10.12.min.css"); +jsIncludeFile("jquery.js", NULL); +jsIncludeFile("dataTables-1.10.12.min.js", NULL); } char *jsDataTableStateSave (char *cartPrefix) /* Prints out a javascript function to save the state of a DataTables jQuery plugin-enabled * table to the cart, using the specified cart prefix to help name the variable. */ { static char saveFunction[4096]; safef(saveFunction, sizeof(saveFunction), "function saveTableState (settings, data) { " "var cartVarName = \"%s\".concat(\"%s\"); " "var stateString = JSON.stringify(data); " "setCartVar(cartVarName, encodeURIComponent(stateString)); " "}" , cartPrefix, dataTableStateName); return saveFunction;