Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 717 of 796  Not logged in ELOG logo
ID Date Icon Author Author Email Category OSdown ELOG Version Subject
  69600   Wed Jan 4 09:39:38 2023 Reply Stefan Rittstefan.ritt@psi.chBug fixAllELOG V3.1.4-493a hack around
Ahh, now I remember. Well, the I put that in like 25 years ago ;-)

Let's assume the user write a very long line and relies on the wrapping of the text box. So the input might look like the 
first attachment. Then the user hits submit and gets just one long line (second attachment) and has to scroll one kilometre
to the right to see the full line. So there is an inconsistency between the entry form and what the user sees after the
submission. Having "wrap=hard" tells the browser to put CRLF where the wrapping in the textarea happens, so the text looks
the same during entry and after submission. If we remove the "wrap=hard", we would be back to the situation below in the two
attachments.

Opinions?

Stefan
Attachment 1: Screenshot_2023-01-04_at_9.38.51_.png
Screenshot_2023-01-04_at_9.38.51_.png
Attachment 2: Screenshot_2023-01-04_at_9.39.09_.png
Screenshot_2023-01-04_at_9.39.09_.png
  69601   Wed Jan 4 10:05:38 2023 Reply Andrey Pashninkowaraj4stuff@gmail.comBug fixAllELOG V3.1.4-493editing on a smartphone
oh! so, that's the cause of another problem I faced a while ago. 
When people edited an ELOG page on a narrow screen device (a.k.a smartphone) it put the extra CRLF and made the page look like the attachment below 
(it broke the original formatting).

I had to "fix" this by setting the width of the textarea to a huge number... 

However, removing "wrap=hard" solves both these problems! ;)
Attachment 1: Screenshot_2023-01-04_at_10.06.02.png
Screenshot_2023-01-04_at_10.06.02.png
  69602   Wed Jan 4 10:12:43 2023 Reply Stefan Rittstefan.ritt@psi.chBug fixAllELOG V3.1.4-493editing on a smartphone
Yepp, that's right. But without the "wrap=hard", you could get one single long line which is almost impossible to read. So there is no perfect solution for all cases. I see three options

1) Remove "wrap=hard" and let the user do as the user wants. This can lead to very long lines almost impossible to read.
2) Keep "wrap=hard" and rely on the browser to put in CRLF between lines according to the textarea box during input. The result will then be the same as during editing. Of course this might 
require to make the textarea width wide enough on small screens not to get too many CRLFs. The default "Message width" is 78 chars, but on modern browsers some JavaScript code automatically sets 
the width to equal the screen width which normally is wider.
3) Add artificial CRCL like every 40 or 80 chars. This is the "beautifying" K.O. mentioned and will never be perfect. Not sure if elog should touch the text the user enters.

Looking at the three options, I kind of conclude that 2) would still be the best.

Stefan
  69604   Wed Jan 4 11:03:45 2023 Reply Andrey Pashninkowaraj4stuff@gmail.comBug fixAllELOG V3.1.4-493config option?
How about adding a config option? 
Ideally, it might be nice to have this option "per record" or "per logbook", but "per instance" should be good enough.
  69605   Wed Jan 4 11:39:39 2023 Reply Andrey Pashninkowaraj4stuff@gmail.comBug fixAllELOG V3.1.4-493wrap "pre" tag in a "div" with fixed width
I'm sorry for being annoying... 
but I have tried to wrap the <pre> tag in a <div> and it seems to do the trick
(the text is a single line with repeating aaa-b-cc sequence)

In the READ mode, the width is limited by the div's width 
(see the first attachment)

In the EDIT mode, the width is only limited by the textarea width
(see the second attachment)

All this is with "wrap=hard" removed. 
Attachment 1: (READ)_single_long_line.png
(READ)_single_long_line.png
Attachment 2: (EDIT)_single_long_line.png
(EDIT)_single_long_line.png
  69606   Wed Jan 4 11:43:00 2023 Reply Stefan Rittstefan.ritt@psi.chBug fixAllELOG V3.1.4-493config option?
Ok, I added an option

Hard wrap = 0 | 1

with the default being "1", so same behaviour as before. If you set this now to zero, you turn it off.

Now waiting for the first people complaining about the very long lines not being readable...

Best,
Stefan
  69607   Wed Jan 4 11:53:35 2023 Reply Andrey Pashninkowaraj4stuff@gmail.comBug fixAllELOG V3.1.4-493config option?
That's great! Thank you very much. 
  69611   Wed Jan 4 12:17:46 2023 Reply Stefan Rittstefan.ritt@psi.chBug fixAllELOG V3.1.4-493wrap "pre" tag in a "div" with fixed width
Didn't work for me. The text is just truncated after the width and no extra lines are added.
Attachment 1: Screenshot_2023-01-04_at_12.16.47_.png
Screenshot_2023-01-04_at_12.16.47_.png
ELOG V3.1.5-2eba886