Alex, I too am seeing that .load files are not being saved - add
Chrome on windows 7 to the list.

Firebug shows an error :
area is not defined
      var data = area.textarea.value

I suspect this is due to the regular editor not being defined (it is
just a plain textarea instead of the usual editor with syntax
highlighting, etc).

Massimo, I was able to fix this by editing admin/controllers/
default.py and adding an extra check to edit() so that .load files
would be considered html.  (Of course this still doesn't fix the
general problem of the javascript adit_area_full.js editor apparently
not playing nice with the ajax save for filetypes of "text" which is
the default)

def edit():
    """ File edit handler """
    # Load json only if it is ajax edited...

    filename = '/'.join(request.args)

    # Try to discover the file type
    if filename[-3:] == '.py':
        filetype = 'python'
    elif filename[-5:] == '.html':
        filetype = 'html'
    elif filename[-5:] == '.load': #<-----added so can edit &
save .load components
        filetype = 'html'
    elif filename[-4:] == '.css':
        filetype = 'css'
    elif filename[-3:] == '.js':
        filetype = 'js'
    else:
        filetype = 'text'

~Brian

On Nov 12, 10:55 pm, Alex <[email protected]> wrote:
> Maybe a bug?
>
> When I create a .LOAD component, the save doesn't seem to work in IE
> or Firefox.
>
> On Nov 12, 10:44 pm, mdipierro <[email protected]> wrote:
>
>
>
>
>
>
>
> > The fact is after you upgrade you get the new admin which uses a new
> > API function. Unless you restart the server that API function is not
> > available. This is a one time event since we never made such a big
> > change in admin.
>
> > On Nov 12, 7:26 pm, Anthony <[email protected]> wrote:
>
> > > I had the same exact experience on Windows (in IE). Here's the
> > > traceback I got:
>
> > > Traceback (most recent call last):
> > >   File "C:\web2py\gluon\restricted.py", line 188, in restricted
> > >     exec ccode in environment
> > >   File "C:\web2py\applications\admin/views\default/site.html", line
> > > 182, in <module>
> > > AttributeError: 'translator' object has no attribute
> > > 'get_possible_languages'
>
> > > Referring to:
>
> > >   for language in T.get_possible_languages():
>
> > > Like Andrew, everything was fine after restarting web2py.
>
> > > Anthony
>
> > > On Nov 12, 7:20 pm, Andrew Thompson <[email protected]> wrote:
>
> > > > On 11/12/2010 4:58 PM, mdipierro wrote:> ps. may not work on windows
>
> > > > I doubt this is what you meant, but I seem to have hit a snag with the
> > > > upgrade.
>
> > > > web2py is running on ubuntu, but I'm managing it from chrome on win7.
> > > > After upgrading, the redirect back failed. Attempting to reload the
> > > > admin page gave me more failures.
>
> > > > If anyone wants to glance over the error files:
>
> > > >http://aktzero.com/static/scratch/__ffff_127.0.0.1.2010-11-12.19-03-0......
>
> > > > Restarting the web2py process cleared it up, and it seems to be ok. I've
> > > > got the new admin interface, and my small handfull of sites are still
> > > > running.
>
> > > > --
> > > > Andrew Thompsonhttp://aktzero.com/-Hide quoted text -
>
> > - Show quoted text -

Reply via email to