Skip to content

Conversation

@AsH1605
Copy link

@AsH1605 AsH1605 commented Dec 13, 2024

Overview

This PR introduces functionality to edit and delete gold entries within the corpus. Users can now interact with individual gold entries and either modify or remove them as needed.

Changes Made:

  1. btn_gold_edit():

    • Allows users to edit an existing gold entry.
    • A prompt is shown to input the new gold value.
    • The gold value is updated if the user provides a non-empty value.
  2. btn_gold_delete():

    • Enables users to delete a selected gold entry after confirming the action.
    • A confirmation dialog appears to ensure the user wants to remove the gold.
  3. Event Handling in cb_load():

    • Added an event listener to the .rt-gold li elements.
    • Prompts the user with options to either "edit" or "delete" the gold.
    • Calls the respective function (btn_gold_edit or btn_gold_delete) based on the user's choice.

Implementation Details:

  • Editing Gold:

    • When a user selects "edit", the current gold is displayed in a prompt, and they can modify it.
    • The updated gold is saved back to the corpus and updated in the UI.
  • Deleting Gold:

    • When a user selects "delete", they are asked for confirmation before the gold entry is removed from the corpus.

Why This Change Is Important:

  • This feature allows users to maintain and clean up gold entries, improving the flexibility and accuracy of the corpus management.
  • It provides a more interactive and user-friendly way to modify the golds without needing to manually update files.

Related Issue:

}


function make_gold_list(golds) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please also delete the old version of make_gold_list

Copy link
Author

Choose a reason for hiding this comment

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

@mr-martian the changes are made.


$(window).on('resize scroll', event_scroll);
});
});
Copy link
Member

Choose a reason for hiding this comment

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

All lines must be terminated. Do not remove the trailing newlines.

Copy link
Author

Choose a reason for hiding this comment

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

@TinoDidriksen trailing newline is added at the end of the file.

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.

Option to remove golds

3 participants