plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Clicking "Preview" does nothing when creating a comment on a research note.

Open Fastie opened this issue 10 years ago • 4 comments

What happened just before the problem occurred

When creating a new comment on a research note the "Preview" button does not show a preview of the note or do anything at all.

When editing an existing comment, it seems to work as it has in the past (the edit window is replaced with a display of the rendered markdown).

Relevant URLs

https://publiclab.org/notes/LaPa/03-31-2016/raspberry-noir-cam-sensors-to-detect-water-stress-of-the-plants-during-their-growing

PublicLab.org username

cfastie

Browser, version, and operating system

Chrome, Windows 10

Fastie avatar Apr 03 '16 04:04 Fastie

I am interested in giving this a go. @Zanibas and I will update if we have any progess.

IanThorp avatar Apr 16 '16 19:04 IanThorp

Oh, that's super. Thank you and please ask if you have questions or need tips on existing code organization! The code for the preview button is at:

https://github.com/publiclab/plots2/tree/master/app/views/comments/_form.html.erb#L88

and it's duplicated at:

https://github.com/publiclab/plots2/tree/master/app/views/comments/_edit.html.erb#L124

Although this needn't be part of your fix, perhaps the JavaScript code in these files should eventually be consolidated in a file at /app/assets/javascripts/comments.js and then included using <%= javascript_include_tag "comments" %> instead of being inline. I may open an issue for this as well.

Thanks again!

jywarren avatar Apr 16 '16 20:04 jywarren

Oh, and to be specific, the code in _edit.html.erb is what's shown when editing an existing comment, whereas _form.html.erb is shown in the form for new comments.

jywarren avatar Apr 16 '16 20:04 jywarren

This isn't Happening now. Confirmed at the same link given above. We can perhaps write a javascript test later for this. The JavaScript label will be reminder for that. Closing this for now.

ananyo2012 avatar Aug 19 '16 12:08 ananyo2012