Hi everyone,
I'm a web2py newbie and I'm trying to use a third party JS library 
(chessboard.js from http://www.chessboardjs.com/). The library is used to 
show a chessboard in the webpage. It does use some images to show the chess 
pieces, the javascript has a relative path in the code:

cfg.pieceTheme = 'img/chesspieces/wikipedia/{piece}.png';

I uploaded the *.js files in "static/js", *.css files in "static/css" and 
the images in "static/images" (actually I also recreated the folder 
structure of the library images "static/img/chesspieces/wikipedia/" for the 
images.

Whenever I launch the app the chessboard is loaded but images are not 
found. I tried overwritting the statement above (in chessboard.js) with:

a) cfg.pieceTheme = 'static/img/chesspieces/wikipedia/{piece}.png'; //and 
it fails
b) cfg.pieceTheme = URL('static','img/chesspieces/wikipedia/{piece}.png'); 
//and it fails also

The only way I found, so far, to display images is to use the absolute 
path, see below, which looks like a really bad work around.

cfg.pieceTheme = 
'http://127.0.0.1:8000/tablero/static/img/chesspieces/wikipedia/{piece}.png';

Is there a proper way to deal with this kind of dependencies inside files 
in 'static' folder?
Thanks, Jon.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to