[web2py] Re: LOAD, javascript and a loading gif

2012-01-12 Thread Liam
So I feel a little sheepish now. Making those two changes gives me the second solution to the problem. On Jan 11, 6:18 pm, Anthony wrote: > Two errors. I forgot to remove the tag -- it isn't needed in > response.js because the returned JS is eval'ed. Also, in your code, you > have request.js, bu

[web2py] Re: LOAD, javascript and a loading gif

2012-01-11 Thread Anthony
Two errors. I forgot to remove the tag -- it isn't needed in response.js because the returned JS is eval'ed. Also, in your code, you have request.js, but it should be response.js, so try: response.js = '''$(function() {$(".replacewloading").click(function() {$(this).parent().html('

[web2py] Re: LOAD, javascript and a loading gif

2012-01-11 Thread Liam
web2py 1.99.4 plugin controller: def overview(): if len(request.args) > 0 and request.args[0] == 'refresh': import time time.sleep(4) body = H2('Component header') refresh = DIV(A('Refresh', _class='button replacewloading', _href=URL(c='plugin_test', f='overview.load',

[web2py] Re: LOAD, javascript and a loading gif

2012-01-11 Thread Anthony
On Wednesday, January 11, 2012 3:53:24 AM UTC-5, Liam wrote: > > Sorry, that was a typo. > > Even something as simple as response.js = 'alert("Here");' or response.js > = 'alert("Here");' doesn't seem to work, although it > does if included in the view. > Can you show the code you tried? I tried

[web2py] Re: LOAD, javascript and a loading gif

2012-01-11 Thread Liam
Sorry, that was a typo. Even something as simple as response.js = 'alert("Here");' or response.js = 'alert("Here");' doesn't seem to work, although it does if included in the view.

[web2py] Re: LOAD, javascript and a loading gif

2012-01-10 Thread Anthony
> > >1. Removing all line breaks from the script and writing " >response.js(script)" in the plugin controller. Again no luck. > > Actually, this should work, but the syntax is: response.js = '''$(function() {$(".replacewloading").click(function() {$(this).parent().html('[web2py] Re: LOAD, javascript and a loading gif
>How do I get javascript in a component plugin to execute each time after the >component >is loaded so the javascript is applied to the loaded component >elements? I'd encountered the similar problem and discussed before: http://groups.google.com/group/web2py-developers/browse_thread/thread/fe6

[web2py] Re: LOAD, javascript and a loading gif

I got it working towards the end of this post. I've included to original text because I thinks it explains my problem better. Solution is in red. I obviously didn't state my problem clearly. The issue isn't replacing all of the loaded html with an image, just the link that gets clicked. A more

[web2py] Re: LOAD, javascript and a loading gif

I don't recall the exact one happened to be my case, but plenty of jquery plugins use ajax, one was working oddly (maybe a js master could see if that plugin was bugged, but I'm not): I didn't want to mess with that one and those following that, so I hacked web2py.js (didn't think much about that,

[web2py] Re: LOAD, javascript and a loading gif

> > for the first problem I actually "hacked" web2py.js (web2py_ajax.js or > so). > the ajax function needs to be modified > the basic idea is to replace content of the target with a spinner (in > this case, a div containing the message "loading...") before sending > the request, and upon

[web2py] Re: LOAD, javascript and a loading gif

uhm, don't know if it'll help you, BTW, I also had to figure a "way" to display some "loading pictures" (from now on, I'll call them "spinners") to my pages. I had to face 2 distinct problems: - loading components via Ajax (through LOAD() or web2py_component()) - prevent FOUC on very complex pages

[web2py] Re: LOAD, javascript and a loading gif

On Monday, January 9, 2012 1:58:30 PM UTC-5, Liam wrote: > > Hi all, > > I'm currently writing a plugin for part of a bigger project that can take > some time doing processing server side and I'm trying to make it as modular > as possible; thus the plugins and components. The problem I'm trying t