Skip to content

Add copy preview buttons #12576

Merged
Siedlerchr merged 8 commits into
JabRef:mainfrom
antPinot:fix-for-issue-12551
Mar 2, 2025
Merged

Add copy preview buttons #12576
Siedlerchr merged 8 commits into
JabRef:mainfrom
antPinot:fix-for-issue-12551

Conversation

@antPinot

Copy link
Copy Markdown
Contributor

Fixes #12551

This PR adds in the context menu of the preview a copy citation as text button and an export to clipboard button. It also changes the copy preview button to copy citation (html). All buttons have the same functionality as the context menu in the main menu.

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Copy Citation (html)

COPY_CITATION_HTML

Copy Citation (text)

COPY_CITATION_TEXT

Export to clipboard

EXPORT_CLIPBOARD

Export to clipboard dialog

EXPORT_CLIPBOARD_DIALOG

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.
In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

@Siedlerchr Siedlerchr changed the title Fix for issue 12551 Add copy preview buttons Feb 27, 2025
InAnYan
InAnYan previously requested changes Mar 1, 2025

@InAnYan InAnYan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

Haven't tested yet. I've proposed some small changes

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread src/main/java/org/jabref/gui/preview/PreviewViewer.java
Comment thread src/main/java/org/jabref/gui/preview/PreviewViewer.java
Comment thread src/main/java/org/jabref/gui/preview/PreviewViewer.java
Siedlerchr
Siedlerchr previously approved these changes Mar 2, 2025
@Siedlerchr Siedlerchr enabled auto-merge March 2, 2025 20:39
@Siedlerchr Siedlerchr dismissed InAnYan’s stale review March 2, 2025 20:39

fixed the changelog, rest is okay feature works

@Siedlerchr Siedlerchr added this pull request to the merge queue Mar 2, 2025
Merged via the queue into JabRef:main with commit d88d7a5 Mar 2, 2025
@koppor

koppor commented May 1, 2025

Copy link
Copy Markdown
Member

This PR is wrong for the HTML part.

compare

<font face="sans-serif"><b>Article</b><a name="Richard_2017"> (Richard_2017)</a>
<BR><BR>Richard, Anna / Meule, Adrian / Friese, Malte / Blechert, Jens

<BR><b>Effects of Chocolate Deprivation on Implicit and Explicit Evaluation of Chocolate in High and Low Trait Chocolate Cravers</b> 
<BR>2017-09


<BR><BR><i>Frontiers in Psychology</i>  , Vol. 8


<BR>Frontiers Media SA




</font>

with

<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
   </head>
   <body>

 Article (Richard_2017)
Richard, Anna / Meule, Adrian / Friese, Malte / Blechert, Jens

Effects of Chocolate Deprivation on Implicit and Explicit Evaluation of Chocolate in High and Low Trait Chocolate Cravers 
2017-09


Frontiers in Psychology  , Vol. 8


Frontiers Media SA





 
   </body>
</html>

I will create a follow-up issue.

@koppor

koppor commented May 1, 2025

Copy link
Copy Markdown
Member

I filed #13041 as follow-up

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.

Add two copy options also to context menu of preview

4 participants