From carlos.crosetti at afilha.com.ar Fri Aug 15 21:38:13 2014 From: carlos.crosetti at afilha.com.ar (carlos.crosetti at afilha.com.ar) Date: Fri, 15 Aug 2014 16:38:13 -0300 Subject: [lively-kernel] adding a JS library to my world Message-ID: Hi, it is possible to add a JavaScript library at my world level, thus not affecting other LK users working on the same LK server? Thanks, Carlos -------------- next part -------------- An HTML attachment was scrubbed... URL: From lars.wassermann at googlemail.com Fri Aug 15 23:32:00 2014 From: lars.wassermann at googlemail.com (Lars) Date: Fri, 15 Aug 2014 14:32:00 -0700 Subject: [lively-kernel] adding a JS library to my world In-Reply-To: References: Message-ID: Hi Carlos, a way would be to add an empty module which requires the library and add that to world requirements. The code for requiring an external library by a lively module is: module(<>).requires().requiresLib({ url: Config.codeBase + <>, loadTest: function() { return !!Global.<>; } }).toRun(function() { /* ... */ } The loadTest has to be correct, otherwise the JSLoader might assume the library is loaded and not load your URL, or load your module although the lib is missing. We keep all our libs in /core/lib/, and that worked fine so far. Does that help you? Lars P.S.: On lively web you can see that pattern in users/larswassermann/relax.js or in some of the acorn files for ast parsing. On 15 August 2014 12:38, wrote: > Hi, it is possible to add a JavaScript library at my world level, thus > not affecting other LK users working on the same LK server? > > Thanks, Carlos > > > _______________________________________________ > lively-kernel mailing list > lively-kernel at hpi.uni-potsdam.de > http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: