#660 closed enhancement (fixed)
[merge]:Edit window size in wiki
Reported by: | tonib | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | 0.8 |
Component: | wiki system | Version: | 0.7.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I would like the edit window to be resized to the size of you wiki text when one presses preview.
The reason for this is that if you have a long wiki page and do edits in the middle. Every time you press preview you have to scroll alot to get to the same position. And it is easy to miss the place.
My suggestion is the size should be like this:
edit_window_size = max(size_today, text_in_window)
Attachments (4)
Change History (15)
comment:1 by , 20 years ago
Summary: | Edit window in wiki → Edit window size in wiki |
---|
by , 20 years ago
Attachment: | patch_edit_window added |
---|
comment:3 by , 20 years ago
Summary: | Edit window size in wiki → [merge]?Edit window size in wiki |
---|
I added a patch to the original problem. Very simple soulution, maybe to simple. Better would be(but more costly) to calculate how many rows of 80 cols the text fits into. Now I just calcute the newlines and add 20. So if you have a lot of lines more than 80 chars the edit box will be to small.
But I think that the javascript idea that remembers where you were would be really cool and much better. But I would still like the default window to be a little bit bigger.
Javascript is not anything I know about and I dont have time to learn it so I cant fix it.
comment:4 by , 20 years ago
About my patch. Think the proper way to do it is to be able to set the maybe set the behaviour from trac.ini.
That is to be able to choose if the edit window should be fixed or be the size of the text.
comment:5 by , 20 years ago
Did a quick search and below is an example how to save the position with javascript.
http://www.faqts.com/knowledge_base/entry/versions/index.phtml?aid=5967
Might add it when I have some time.
comment:6 by , 20 years ago
Did work on it anyway.
I didnt implement the javascript solution in trac. But I have written the function to save and restore the position.
Left to do is to have hidden variables that saves. Position of scrollbar, Start and end postiotion of cursort. And load it when you do preview.
The file save_position_js.html shows the concept of saving and restoring position.
I dont have Internet Explorer so it is only tested in Mozilla.
/Toni
by , 20 years ago
Attachment: | save_position_js.2.html added |
---|
by , 20 years ago
Attachment: | patch_javascript_solution added |
---|
javascript solution after dln comment
comment:8 by , 20 years ago
Summary: | [merge]?Edit window size in wiki → [merge]:Edit window size in wiki |
---|
It is patch_javascript_solution that is the one that I think should be incorporated into trac. It is the javascript solution and works with mozilla and IE.
/Tonib
comment:9 by , 20 years ago
Milestone: | → 0.9 |
---|
comment:10 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:11 by , 20 years ago
Milestone: | 0.9 → 0.8 |
---|
Perhaps we could do even better if it'd be possible to remember the caret position within the textedit… using javascript it might/should be possible to store the position in a hidden variable before submission of the preview-form…
Just an idea …