Skip to content

jquery DOM manipulation; ajax http requests#77

Merged
bwaldon merged 8 commits intonschneid:masterfrom
bwaldon:jquery_refactor
Feb 22, 2025
Merged

jquery DOM manipulation; ajax http requests#77
bwaldon merged 8 commits intonschneid:masterfrom
bwaldon:jquery_refactor

Conversation

@bwaldon
Copy link
Collaborator

@bwaldon bwaldon commented Sep 27, 2024

Reflects (in part) changes from bwaldon#4

I have in mind a couple simple UI changes that will make the tool much more usable:

  • Handle validator errors in a scrollable div
  • Assign lemma/xpos tags via graphical edits

Both of those changes will be facilitated by standardizing/modernizing how we manipulate the DOM and handle HTTP requests

bwaldon and others added 2 commits September 27, 2024 16:10
Co-authored-by: Meru Gopalan <merugopalan2007@gmail.com>
Co-authored-by: Meru Gopalan <merugopalan2007@gmail.com>
@bwaldon
Copy link
Collaborator Author

bwaldon commented Sep 27, 2024

TODO: in static/script.js, change document method calls to jQuery calls

@bwaldon bwaldon changed the title in html templates: implement dom editing and POST requests in jquery jquery DOM manipulation; ajax http requests Feb 20, 2025
@bwaldon bwaldon marked this pull request as ready for review February 20, 2025 22:11
@bwaldon bwaldon requested a review from nschneid February 20, 2025 22:14
@bwaldon
Copy link
Collaborator Author

bwaldon commented Feb 21, 2025

Handle validator errors in a scrollable div

Implemented on this branch but depends on this PR

Copy link
Owner

@nschneid nschneid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I'll defer to you on the translation to jQuery.

static/script.js Outdated
} else {
el.style.display = 'none';
link.innerHTML = 'show' + link.innerHTML.substring(4);
link.html('show' + link.html().substring(4));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are lines 23 and 26 meant to set the text of the link? If so, I would probably set .text() instead of .html(). I don't know where in the UI these "show" and "hide" links occur though.

Copy link
Collaborator Author

@bwaldon bwaldon Feb 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out -- this actually reveals a larger issue, which is that togglelink, toggletextbox are never called from within an Activedop html template, or from within a relevant Python module. These functions are also defined within the disco-dop submodule (in a file also called static.js) and in some of disco-dop's own internal web UI functionality that we never use. They seem safe to delete from my own testing -- I imagine that the disco-dop static.js was the basis of Activedop's and that some superfluous code was copied over unintentionally.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

@bwaldon bwaldon merged commit 572b180 into nschneid:master Feb 22, 2025
@bwaldon bwaldon deleted the jquery_refactor branch January 1, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants