Default font size and fullscreen for EditArea in Admin interface

103 views
Skip to first unread message

Jonathan Benn

unread,
Mar 3, 2009, 7:45:20 AM3/3/09
to web2py Web Framework
Hi all,


A long-standing issue I've had with the EditArea in web2py's Admin
interface is the default font size. I don't have the best eyes, and so
in Firefox I set the minimum font size to be 12. The default font size
for EditArea is 10. As a result, Firefox ends up garbling the code in
EditArea. This required me to manually change the font size every time
I reloaded an editing page.

I'm not the only one with a similar problem. Here's an old discussion
on the issue from the Gluon days:
http://groups.google.com/group/web2py/browse_thread/thread/8bb6718600ad886/db2f0c855daba4aa?hl=en&lnk=gst&q=font#

Today I figured out how to fix the issue. The fix for this is to edit
the following file:
web2py/applications/admin/views/default/edit.html

Find these lines of code:
editAreaLoader.init({id: "body",start_highlight: true,allow_resize:
"both",allow_toggle: true,language: "en",syntax:
"{{=filetype}}",replace_tab_by_spaces: 4});

And just add a few extra settings:
editAreaLoader.init({id: "body",start_highlight: true,allow_resize:
"both",allow_toggle: true,language: "en",syntax:
"{{=filetype}}",replace_tab_by_spaces: 4, font_size: 12, fullscreen:
false});

The full list of parameters is available here:
http://www.cdolivet.net/editarea/editarea/docs/configuration.html


What I'd like to do is for users to be able to set the defaults in
some kind of initialization file for the Admin interface. This kind of
init file could be generally useful for things other than EditArea
too. There doesn't seem to be any init file at the moment though.

Does anyone else think this is a good idea? Are there any other
default settings that should be moved into a user-editable init file?
Are there any objections to adding an init file to the Admin
interface?


Sincerely,

--Jonathan

Kuba Kucharski

unread,
Mar 3, 2009, 8:24:22 AM3/3/09
to web...@googlegroups.com
-1

Just to be sure that you know:

- in new web2py(1.57) there is no "reloading page" every time you save. New editor is awesome!

why focus on admin-style-customization?

I would say we should keep things simple. For experienced developers every new file is a blessing, for a beginner it is just freaky frightening to have to many decisions to make at the start and to many options to go.. Altough there could be an app or plugin to customize admin look. But I would be rather against new "special init file"..

--
Kuba

Jonathan B

unread,
Mar 3, 2009, 8:49:31 AM3/3/09
to web2py Web Framework
Hi Kuba,


Thanks for your feedback.


On Mar 3, 4:24 pm, Kuba Kucharski <kuba.kuchar...@gmail.com> wrote:

> - in new web2py(1.57) there is no "reloading page" every time you save. New
> editor is awesome!

I'm talking about version 1.57.

Which new editor are you talking about? The one seen in T3?


> why focus on admin-style-customization?

The rule of thumb in user-interface design is to appeal to both
beginners and advanced users if you can. In the case of settings, you
appeal to beginners by having good default values, and you appeal to
advanced users by giving them more control. I think that the defaults
are fine as is, but there is a lack of control when it comes to the
editor. Ideally, the editor should retain whatever settings you
changed, but it's also useful to be able to set the defaults to
whatever you prefer.


> I would say we should keep things simple. For experienced developers every
> new file is a blessing, for a beginner it is just freaky frightening to have
> to many decisions to make at the start and to many options to go.. Altough
> there could be an app or plugin to customize admin look. But I would be
> rather against new "special init file"..

The Admin application *is* an app. I don't think it makes sense to
create a new app to configure it.


Sincerely,

--Jonathan

Kuba Kucharski

unread,
Mar 3, 2009, 9:20:11 AM3/3/09
to web...@googlegroups.com
On Tue, Mar 3, 2009 at 2:49 PM, Jonathan B <jonath...@gmail.com> wrote:

Hi Kuba,


Thanks for your feedback.


On Mar 3, 4:24 pm, Kuba Kucharski <kuba.kuchar...@gmail.com> wrote:

> - in new web2py(1.57) there is no "reloading page" every time you save. New
> editor is awesome!

I'm talking about version 1.57.

Which new editor are you talking about? The one seen in T3?

i misunderstood you, i thought you want to customize the one in admin so.. nevermind. my mistake.

Yarko Tymciurak

unread,
Mar 3, 2009, 12:01:41 PM3/3/09
to web...@googlegroups.com
HI Jonathan -

Funny thing - I (for various reasons) have been using Google Chrome browser, and the editor simply does not work with that (I don't get _anything_ but an editable text area).

If I _really_ want to edit thru browser, I go to my Firefox.   While the editor is _interesting_ there, I (personally) don't find it to be enough for "real work" - so with Firefox I simply install the "Its all text" plugin and configure it to use my favorite editor (gvim in my case, but it can be anything).

Now - all issues of session, font size, etc.  are ... irrelevant and decoupled.

I like it this way - I don't care what web2py editors do;  for me it's just for an occaisional convenience, not main use.

Of course everyone will not approach it this way - but for serious work, I use other channels (its-all-text is only small level;  I really prefer parallel work in WingIDE).

Just to show another perspective on this topic.

Regards,
Yarko

Jonathan B

unread,
Mar 3, 2009, 11:32:31 PM3/3/09
to web2py Web Framework
Hi Yarko,


On Mar 3, 8:01 pm, Yarko Tymciurak <yark...@gmail.com> wrote:

> I like it this way - I don't care what web2py editors do;  for me it's just
> for an occaisional convenience, not main use.

Yeah, it's the same for me. I typically use Eclipse (with the Python
plugin) or IDLE for web2py coding. But a big part of the reason that I
started using external editors was because the internal (EditArea) one
was very annoying for me due to that font size issue. I figured that
it might be handy to give developers some more control over the editor
and how it worked. Perhaps it would increase their use of the internal
editor...


> Just to show another perspective on this topic.

Thanks! It's much appreciated.

Judging by the general lack of responses on this topic, I can guess
that web2py developers don't care too much about this. So I guess I'll
shelve it and work on something else.


--Jonathan

Jonathan B

unread,
Mar 3, 2009, 11:48:58 PM3/3/09
to web2py Web Framework
Hi Kuba,


On Mar 3, 5:20 pm, Kuba Kucharski <kuba.kuchar...@gmail.com> wrote:

> i misunderstood you, i thought you want to customize the one in admin so..
> nevermind. my mistake.

I'm confused now about whether or not we're talking about the same
thing. :)

I'm talking about the EditArea in the Admin application. It looks like
this:
http://sites.google.com/a/benn.ca/file-locker/file-cabinet/EditArea_web2py.png


--Jonathan

mdipierro

unread,
Mar 3, 2009, 11:52:10 PM3/3/09
to web2py Web Framework
Hi Jonathan,

not true that we do not care. The fact is the long term plan is to
move to the Amy editor, rather than mess up with editarea. If you want
to submit a patch to change this, it will probably be accepted.

Massimo

Markus Gritsch

unread,
Mar 4, 2009, 3:30:20 AM3/4/09
to web...@googlegroups.com
On Wed, Mar 4, 2009 at 5:52 AM, mdipierro <mdip...@cs.depaul.edu> wrote:
>
> The fact is the long term plan is to
> move to the Amy editor, rather than mess up with editarea.

Hmm, Amy Editor looks a bit Mac-centric to me. Not just the UI, but
also the shortcuts, which use Mac-style symbols in the menu bar, and
seem to be not working on Windows. For examplt I tried Ctrl+Z for
undo, but the shortcut does not work. (Also tried Alt+Z to no avail).

Markus

Jonathan B

unread,
Mar 4, 2009, 6:49:33 AM3/4/09
to web2py Web Framework
Hi Massimo,


On Mar 4, 7:52 am, mdipierro <mdipie...@cs.depaul.edu> wrote:

> not true that we do not care. The fact is the long term plan is to
> move to the Amy editor, rather than mess up with editarea. If you want
> to submit a patch to change this, it will probably be accepted.

Ok, I'll try writing a patch.

--Jonathan
Reply all
Reply to author
Forward
0 new messages