Skip to content
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

Toggle Annotate/Highlight Popup // Add Unhighlight Ability #111

Open
Miserlou opened this issue Feb 15, 2018 · 7 comments
Open

Toggle Annotate/Highlight Popup // Add Unhighlight Ability #111

Miserlou opened this issue Feb 15, 2018 · 7 comments

Comments

@Miserlou
Copy link

I highlight text with my mouse as I'm reading this. Apparently, there are lots of us who do this.

This is really annoying on Manubot HTML outputs because the highlight popup comes up every time. One time I clicked it by mistake and now there's no way for me to get rid of my highlight and I feel like a jackass who highlighted some unimportant text.

It'd be great if I could a) toggle the highlight-popup and b) un-highlight.

@dhimmel
Copy link
Member

dhimmel commented Feb 15, 2018

This is due to the Hypothesis integration from #90 / #95.

I agree it'd be nice to have Hypothesis popovers and highlighting be more optional. For example, they could be off by default with the option to activate in the Hypothesis sidebar. @dsiddy do you know if there are any configuration options for https://github.com/hypothesis/client that would allow the user to enable/disable popovers and highlighting as desired?

@Miserlou also note that you can disable Hypothesis integration for a specific manuscript by removing the line:

https://github.com/greenelab/manubot-rootstock/blob/310dd078c4c60bedd63442f93906f26a4ea25a4b/build/build.sh#L41

@dsiddy
Copy link
Contributor

dsiddy commented Feb 19, 2018

@dhimmel, the showHighlights option may be worth a look. It doesn't affect the pop-up, regrettably, but will allow you to hide highlights by default if that's what you're after.

@Miserlou, my tests suggest that your highlights shouldn't persist on page reload unless you're logged in to Hypothesis, in which case you should be able to delete them from the sidebar. If I'm mistaken, though, please feel free to elaborate and we can troubleshoot further.

@dhimmel
Copy link
Member

dhimmel commented Nov 21, 2019

@vincerubinetti: would it be hard for us to create a little button or something that enables/disables hypothesis altogether?

@vincerubinetti
Copy link
Collaborator

Probably not hard. We might be able to make it easier/better to use when it is open/active, too. I'm not thrilled about Hypothesis's UI in general.

As a side note, does Hypothesis have no competitors that we could try out?

@dhimmel
Copy link
Member

dhimmel commented Nov 21, 2019

As a side note, does Hypothesis have no competitors that we could try out?

One aspect of Hypothesis is that they currently host the largest open corpus of annotations. I think we do want comments to become part of this corpus, although that should be possible with a different frontend. Not sure if any of the services listed here are alternative viewers that use the same database backend and account system.

@dhimmel
Copy link
Member

dhimmel commented Dec 4, 2019

Was talking with @dwhly from Hypothesis at a "Beyond Preprints" workshop about the ability to tobble on and off the Hypothesis extension. He pointed me to this source code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hypothesis Button Test</title>
</head>
<body>
    <div class = 'hypothesis_status'></div>
    <script>function toggle_visibility(){var e=document.querySelector(".annotator-frame");if(e&&"none"!=e.style.display)e&&(e.style.display="none"),document.head.removeChild(document.getElementById("hypothesis_embed_script"));else{e&&(e.style.display="block");var t=document.createElement("script");t.type="text/javascript",t.id="hypothesis_embed_script",t.src="https://hypothes.is/embed.js",t.async=!1,document.head.appendChild(t)}}function reqListener(){console.log(this.responseText),respObj=JSON.parse(this.responseText);var e=document.createElement("div");e.style.backgroundImage="url('http://hypothesisjournal.herokuapp.com/static/icon.png')",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="contain",e.style.width="25px",e.style.height="30px",document.querySelector(".hypothesis_status").appendChild(e);var t=document.createElement("div");t.style.textAlign="center",t.innerHTML=respObj.total,document.querySelector(".hypothesis_status").appendChild(t),document.querySelector(".hypothesis_status").addEventListener("click",toggle_visibility)}document.querySelector(".hypothesis_status").style["float"]="left",document.querySelector(".hypothesis_status").style.cursor="pointer";var oReq=new XMLHttpRequest;oReq.addEventListener("load",reqListener),oReq.open("GET","https://hypothes.is//api/search?uri="+window.location.href),oReq.send();</script>
</body>
</html>

@vincerubinetti perhaps this will be of some use.

@dwhly
Copy link

dwhly commented Dec 4, 2019

@judell Probably has a better example ^

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

No branches or pull requests

5 participants