Edgewall Software
Modify

Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#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)

patch_edit_window (1.3 KB ) - added by anonymous 20 years ago.
save_position_js.html (1.7 KB ) - added by tonib 20 years ago.
javascript solution to restore position
save_position_js.2.html (1.7 KB ) - added by anonymous 20 years ago.
patch_javascript_solution (4.0 KB ) - added by tonib 20 years ago.
javascript solution after dln comment

Download all attachments as: .zip

Change History (15)

comment:1 by daniel, 20 years ago

Summary: Edit window in wikiEdit window size in wiki

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 …

comment:2 by BM, 20 years ago

We could even replace the textbox with syntax highlighting goodness:

http://helene.muze.nl/

by anonymous, 20 years ago

Attachment: patch_edit_window added

comment:3 by tonib, 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 tonib, 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 tonib, 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.

by tonib, 20 years ago

Attachment: save_position_js.html added

javascript solution to restore position

comment:6 by tonib, 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 anonymous, 20 years ago

Attachment: save_position_js.2.html added

comment:7 by tonib, 20 years ago

save_position_js.2.html works with IE aswell.

by tonib, 20 years ago

Attachment: patch_javascript_solution added

javascript solution after dln comment

comment:8 by anonymous, 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 daniel, 20 years ago

Milestone: 0.9

comment:10 by daniel, 20 years ago

Resolution: fixed
Status: newclosed

comment:11 by daniel, 20 years ago

Milestone: 0.90.8

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.