EditArea suggestions

7 views
Skip to first unread message

Markus Gritsch

unread,
Jan 1, 2008, 11:43:38 AM1/1/08
to gl...@googlegroups.com
Hi,

* at the EditArea example page[1] the widths of the EditAreas resize
as the browser window width is changed. It would be nice if the
EditArea in Gluon acts the same way.

* In the last example at [1] tabs are replaced by 4 Spaces. I think
this would also be appropriate for Gluon.

* Would it be possible to retain the settings like Font Size,
Fullscreen,... when editing the files several times?

[1] http://www.cdolivet.net/editarea/editarea/exemples/exemple_full.html

mdipierro

unread,
Jan 3, 2008, 11:41:23 AM1/3/08
to Gluon Web Framework
I am swamped. Could you help me with this and tell me which code to
replace?

Markus Gritsch

unread,
Jan 3, 2008, 5:33:31 PM1/3/08
to gl...@googlegroups.com
On 01/01/2008, Markus Gritsch <m.gr...@gmail.com> wrote:
> Hi,
>
> * at the EditArea example page[1] the widths of the EditAreas resize
> as the browser window width is changed. It would be nice if the
> EditArea in Gluon acts the same way.
>
> * In the last example at [1] tabs are replaced by 4 Spaces. I think
> this would also be appropriate for Gluon.

I made two small modifications to
gluon/applications/admin/views/default/edit.html which can be found in
the attachment.

> * Would it be possible to retain the settings like Font Size,
> Fullscreen,... when editing the files several times?

I think this is not possible, however I am a total beginner to JS.

Markus

edit.html

Massimo Di Pierro

unread,
Jan 3, 2008, 5:39:04 PM1/3/08
to gl...@googlegroups.com
It still does not resize it for me. does it work for you?

about pygments. It is more difficult than I thought because they
assume it will be imported as pygments and not as
gluon.contrib.pygments. I would have to edit all their files to use it.

Massimo

> <edit.html>

Markus Gritsch

unread,
Jan 3, 2008, 6:03:23 PM1/3/08
to gl...@googlegroups.com
On 03/01/2008, Massimo Di Pierro <mdip...@cs.depaul.edu> wrote:
>
> It still does not resize it for me. does it work for you?

No, it does not, because gluon/applications/admin/views/layout.html
specifies most widths using px units instead of %. I am no CSS expert
either, but things improve when changing line 11 from
div.fixed { width: 800px !important; }
to
div.fixed { width: 90% !important; }

> about pygments. It is more difficult than I thought because they
> assume it will be imported as pygments and not as
> gluon.contrib.pygments. I would have to edit all their files to use it.

Hmm, I assume you have already tried using the following:

import gluon.contrib.pygments as pygments

Markus

Markus Gritsch

unread,
Jan 3, 2008, 6:47:44 PM1/3/08
to gl...@googlegroups.com
On 04/01/2008, Markus Gritsch <m.gr...@gmail.com> wrote:
>
> > about pygments. It is more difficult than I thought because they
> > assume it will be imported as pygments and not as
> > gluon.contrib.pygments. I would have to edit all their files to use it.
>
> Hmm, I assume you have already tried using the following:
>
> import gluon.contrib.pygments as pygments

And if everything else fails you can add the pygments directory to
sys.path, something like

sys.path.append('gluon/contrib/pygments')
import pygments

Markus Gritsch

unread,
Jan 4, 2008, 3:42:36 AM1/4/08
to gl...@googlegroups.com
On 03/01/2008, Massimo Di Pierro <mdip...@cs.depaul.edu> wrote:
>
> about pygments. It is more difficult than I thought because they
> assume it will be imported as pygments and not as
> gluon.contrib.pygments. I would have to edit all their files to use it.

Have you been able to get around this? The following script test.py

import os
import sys
sys.path.append(os.path.join('gluon', 'contrib'))

from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter

code = 'print "Hello World"'
print highlight(code, PythonLexer(), HtmlFormatter())

works fine having this directory structure

.
|-- gluon
| |-- __init__.py
| `-- contrib
| |-- __init__.py
| `-- pygments
| |-- __init__.py
| |-- cmdline.py
| |-- console.py
| |-- filter.py
| |-- filters
| | `-- __init__.py
| |-- formatter.py
| |-- formatters
| | |-- __init__.py
| | |-- _mapping.py
| | |-- bbcode.py
| | |-- html.py
| | |-- latex.py
| | |-- other.py
| | |-- rtf.py
| | |-- svg.py
| | |-- terminal.py
| | `-- terminal256.py
| |-- lexer.py
| |-- lexers
| | |-- __init__.py
| | |-- _clbuiltins.py
| | |-- _luabuiltins.py
| | |-- _mapping.py
| | |-- _phpbuiltins.py
| | |-- _vimbuiltins.py
| | |-- agile.py
| | |-- asm.py
| | |-- compiled.py
| | |-- dotnet.py
| | |-- functional.py
| | |-- math.py
| | |-- other.py
| | |-- special.py
| | |-- templates.py
| | |-- text.py
| | `-- web.py
| |-- plugin.py
| |-- scanner.py
| |-- style.py
| |-- styles
| | |-- __init__.py
| | |-- autumn.py
| | |-- borland.py
| | |-- colorful.py
| | |-- default.py
| | |-- emacs.py
| | |-- friendly.py
| | |-- fruity.py
| | |-- manni.py
| | |-- murphy.py
| | |-- native.py
| | |-- pastie.py
| | |-- perldoc.py
| | |-- trac.py
| | `-- vim.py
| |-- token.py
| |-- unistring.py
| `-- util.py
`-- test.py

Markus

Massimo Di Pierro

unread,
Jan 4, 2008, 9:42:07 AM1/4/08
to gl...@googlegroups.com
It works but since I have pygments installed
when I py2app it does not package it properly.
Is there a way to uninstall a module?
Perhaps I will delete it.

Markus Gritsch

unread,
Jan 4, 2008, 9:46:35 AM1/4/08
to gl...@googlegroups.com
On 04/01/2008, Massimo Di Pierro <mdip...@cs.depaul.edu> wrote:
>
> It works but since I have pygments installed
> when I py2app it does not package it properly.
> Is there a way to uninstall a module?
> Perhaps I will delete it.

Yes, deleting the package folder and removing its entry from
Lib/site-packages/easy-install.pth should do the trick.

Markus

Markus Gritsch

unread,
Jan 5, 2008, 2:13:42 PM1/5/08
to gl...@googlegroups.com
On 04/01/2008, Markus Gritsch <m.gr...@gmail.com> wrote:
> On 03/01/2008, Massimo Di Pierro <mdip...@cs.depaul.edu> wrote:
> >
> > It still does not resize it for me. does it work for you?
>
> No, it does not, because gluon/applications/admin/views/layout.html
> specifies most widths using px units instead of %. I am no CSS expert
> either, but things improve when changing line 11 from
> div.fixed { width: 800px !important; }
> to
> div.fixed { width: 90% !important; }

web2py still uses the fixed layout of 800px width, so EditArea cannot
automatically be as wide as the browser window. The change mentioned
above would fix this.

IMO a fixed width is bad anyways. The attachment shows how the web2py
webpage renders in my Firefox. It would also be fixed with the above
change.

Markus

overlap.png

Massimo Di Pierro

unread,
Jan 5, 2008, 3:16:39 PM1/5/08
to gl...@googlegroups.com
fixed v1.17

> <overlap.png>

Markus Gritsch

unread,
Jan 6, 2008, 7:06:04 AM1/6/08
to gl...@googlegroups.com
Hi,

the dotted line of the footer has currently not the correct width. It
has to be moved out of the "main" and "main_inner" <div> sections. I
made the needed change in the attached layout.html.

Markus

layout.html
Reply all
Reply to author
Forward
0 new messages