Closed selir27 closed 10 years ago
Babelsberg supports a standalone version that works without the lively-kernel environment. You should include prototype.js (Version 1.7.2.0), babelsberg.core.js and then any solver library you want to use, in that particular order.
One thing that might went wrong is that Chrome by default does not allow to access your local files (which is required for http requests by BabelsbergScript). You can allow the access by starting Chrome with the following flags: --flag-switches-begin --allow-file-access-from-files --flag-switches-end
The example have worked after the remove of "text/babelsbergscript" from the code of layout.html.
@iliicho7 so you only wanted fabric.js, not the constraints provided by babelsberg?
My goal is to use babelsberg and fabric.js and to experiment with the constraints. If it is possible without http server.
Firstly, I tried the example online from babelsberg.github.io. It worked in Chrome and Internet Explorer for Windows Mobile. No success with Firefox.
Secondly, I downloaded the example locally on my computer. It did not worked with Chrome. I opened this issue in github.
Thirdly, I removed the mime type (type="text/babelsbergscript") from script tags pointing to source file layout.js in layout.html. (Sorry, I was not able to paste the whole line here, because the html tags are not visible in this comment system.)
After the removal, the example works and the constraints still work in Chrome. At least with Cassowary, when I change the angle of the blue rectangle, it can move only according to the restrictions. The other rectangles also follow the restrictions. Anyway, if there is a problem, I will fall back to use a web server.
The example works fine online. I tried to make work it on my computer without installing node.js/lively-kernel. I downloaded layout.html, fabric.js and layout.js. Prototype.js source is unchanged. I changed the source files for babelsberg and solvers to point to live-kernel.org as in the online version, but the example did not work. It looks it needed lively-kernel runtime to work.
Either there are restrictions to get data from lively-kernel.org as source or I do not understand exactly how it works?