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

Identifying the author of the document #82

Closed
programLyrique opened this issue Apr 22, 2014 · 10 comments · Fixed by #844
Closed

Identifying the author of the document #82

programLyrique opened this issue Apr 22, 2014 · 10 comments · Fixed by #844
Labels
client (Javascript) client code and CSS docs Documentation of the project feature

Comments

@programLyrique
Copy link

It would be useful to identify the comments of author of the document (or, if it is difficult to do it per document, per website) which is commented, by looking at the email and the username for instance, with a chosen color for the background of the comments for example (and maybe some indication next to the username and some enhancement for the avatar).
isso
.

@posativ
Copy link
Collaborator

posativ commented Apr 24, 2014

You can do it yourself with a CSS rule that matches data-hash=<your hash> which is generated from the email field. Doable in Isso, but that means I need to edit the CSS, probably introduce yet another DIV and generally work on the client design which I do not enjoy to be honest.

@rndmh3ro
Copy link

Can you describe how exactly this works?
In the source code of my website I can see that the data-hash variable is found in the svg for the avatar, nowhere else. How exactly does the rule have to look like?

@samer
Copy link

samer commented Oct 19, 2014

You can do this via JavaScript using something like document.querySelectorAll("svg[data-hash='4505c1eeda98']") and then iterate on each node, finding the appropriate child and injecting the desired CSS styles onto it. I hope this helps.

@ix5
Copy link
Member

ix5 commented Feb 24, 2022

Closing in favour of discussion in #321.

Especially #321 (comment) is a nice solution.

@ix5 ix5 closed this as completed Feb 24, 2022
@ix5
Copy link
Member

ix5 commented Apr 23, 2022

Re-opening until someone adds the proposed CSS solution to the docs.

@ix5 ix5 reopened this Apr 23, 2022
@ix5 ix5 added the docs Documentation of the project label Apr 23, 2022
@BBaoVanC
Copy link
Contributor

I think a badge next to the author's name plus a different name color would be better than a message background. I think it's easier than trying to deal with trying to make the background fit in with the visual style.

@ix5
Copy link
Member

ix5 commented Apr 23, 2022

As a first step to allow better styling, the author hash should be inserted into the .isso-comment div, not only as the hash to the svg.

@BBaoVanC would you like to work on something like this?

@BBaoVanC
Copy link
Contributor

As a first step to allow better styling, the author hash should be inserted into the .isso-comment div, not only as the hash to the svg.

@BBaoVanC would you like to work on something like this?

I'll try and see what I can do. I haven't ever done much with JS so for that part of the client I might need help. I'll make a draft PR if I can figure something out.

@ix5
Copy link
Member

ix5 commented Apr 23, 2022

That's what I mean:

diff --git a/isso/js/app/templates/comment.js b/isso/js/app/templates/comment.js
index d0daf99..53738b2 100644
--- a/isso/js/app/templates/comment.js
+++ b/isso/js/app/templates/comment.js
@@ -9,7 +9,7 @@ var html = function (globals) {
   var author = comment.author ? comment.author : i18n('comment-anonymous');
 
   return "" +
-"<div class='isso-comment' id='isso-" + comment.id + "'>"
+"<div class='isso-comment' id='isso-" + comment.id + "' data-hash='" + comment.hash + "'>"
 + (conf.gravatar ? "<div class='isso-avatar'><img src='" + comment.gravatar_image + "'></div>" : '')
 + (conf.avatar ? "<div class='isso-avatar'><svg data-hash='" + comment.hash + "'</svg></div>" : '')
 + "<div class='isso-text-wrapper'>"

You could then use .isso-comments[data-hash="0bb73c4f5196"] as a style selector, or e.g. .isso-comments[data-hash="0bb73c4f5196"] > .isso-author for styling only the author's name.

@ix5
Copy link
Member

ix5 commented Apr 26, 2022

Tracked in #844

@ix5 ix5 closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client (Javascript) client code and CSS docs Documentation of the project feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants