-
Notifications
You must be signed in to change notification settings - Fork 3
Replace Prototype.js with jQuery #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Prototype.js with jQuery #412
Conversation
Co-authored-by: rvosa <[email protected]>
|
@copilot 1. Pivot to jQuery |
Co-authored-by: rvosa <[email protected]>
Co-authored-by: rvosa <[email protected]>
Co-authored-by: rvosa <[email protected]>
Done. Pivoted to jQuery 3.7.1 (loaded via CDN with SRI hash). All Prototype.js patterns in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Update image paths in styles.css
|
@copilot can we just have jQuery locally in the same place as the other scripts? There's really no need for complicated CDN trickery and it feels more fragile to me. Call me oldschool. |
Co-authored-by: rvosa <[email protected]>
Added jQuery 3.7.1 locally to Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot not quite there yet: |
Co-authored-by: rvosa <[email protected]>
|
@copilot in /treebase-web/user/citationForm.html, when I attempt to enter a |
Co-authored-by: rvosa <[email protected]>
Fixed. The "undefined" error was caused by DWR's default error handler being triggered when the database returns no results. Added proper error handlers to all DWR autocomplete callbacks and configured a global DWR error handler to suppress alerts for autocomplete errors. The error will now log to console instead of showing an alert. See commit 73aaf9b. |
Replaces Prototype.js patterns with jQuery to avoid
Array.prototypepollution that was interfering with phylotree.js.Changes Made
jQuery Integration
/scripts/jquery-3.7.1.min.jsmainTemplate.jspanddefaultTemplate.jspto load local jQueryJavaScript File Updates
common.js:new Ajax.Request()→$.ajax()withdataType: 'text'$$('.class')→$('.class')$('id')→$('#id')new Element()→$('<tag>').observe()→.on().hasClassName()→.hasClass().firstDescendant()→.children().first()submissionSummary.js:.addClassName()→.addClass().select()→.find().update()→.html().invoke('setStyle', ...)→.css().size()→.lengthdataType: 'text'to prevent auto script executionanalysisEditor.js:DWR Autocomplete Error Handling
defaultTemplate.jspCode Review Fixes
.prop()method for checkbox/radio checked propertyRemoved
native-compat.js(no longer needed with jQuery)Security
Notes
The
eval()usage insubmissionSummary.jsis pre-existing code that parses the server response. This should be addressed separately with proper JSON parsing.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.