Gears is an browser extension at the client side. Therefore I have to check first if it is installed, store the result and then display the "create shortcut" link if necessary. The problem is that I don't know where to store this user session related information at the server side.
On 28 Okt., 23:53, Jason Grout <[EMAIL PROTECTED]> wrote: > sonium wrote: > > Hi, I'm new to sage development and have a few problems getting into > > it. > > > As a start and to get better known to the code I wanted to implement > >http://trac.sagemath.org/sage_trac/ticket/4069in the following way: > > > 1. After login check if gears is installed > > 2. Store this, if so > > 3. Next time when the home page is loaded, display a "Create Shortcut" > > link > > > I'm now figured out how the ajax part basicaly works e.g. I'm able to > > send information to the server through async_request(...) that is then > > processed in twist.py. > > > The problem Is that given that I send this information to the server > > by e.g. requesting a certain file if gears is installed (is this the > > right way to do this?), I don't know where to store the result. > > I think you need to pass a callback function to the async_request. When > the browser returns information from your request, the callback is > called with the information. There are numerous examples of this in the > js.py file; usually the function calling async_request is immediately > followed by the definition of the callback function. > > So you could, in the callback, check the return status or some other > returned piece of information. If things are good, enable the link. > > How is gears "installed"? Is it an installed spkg on the server side? > If so, then this all becomes much simpler. In notebook.py, just check > to see if the spkg is installed. If it is, then insert something into > the html for the home page. You can see an example of this by looking > for the jsmath-image-fonts code, where something is conditionally > included in the html based on whether or not an spkg is installed. > > Thanks, > > Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---