Re: integrating Facebook JS SDK

2016-04-11 Thread Thiago H de Paula Figueiredo
Thanks for your very useful example, Carlos! On Sat, 09 Apr 2016 15:48:58 -0300, Carlos Montero Canabal wrote: In your controller class (.java) you can write this: javaScriptSupport.addModuleConfigurationCallback(new ModuleConfigurationCallback() { @Override

Re: integrating Facebook JS SDK

2016-04-11 Thread Thiago H de Paula Figueiredo
On Sat, 09 Apr 2016 09:05:17 -0300, Ilya Obshadko wrote: Facebook recommends the following method to integrate FB SDK using AMD approach: https://developers.facebook.com/docs/javascript/howto/requirejs/v2.5 However I can't find any obvious way to configure RequireJS paths in Tapestry. Is ther

Re: integrating Facebook JS SDK

2016-04-09 Thread Carlos Montero Canabal
In your controller class (.java) you can write this: javaScriptSupport.addModuleConfigurationCallback(new ModuleConfigurationCallback() { @Override public JSONObject configure(final JSONObject configuration) {

Re: integrating Facebook JS SDK

2016-04-09 Thread Pavel Chernyak
Greetings, Ilya. Here is my example for Yandex maps module. As you can see I define require.js config in module file. requirejs.config({ paths: { 'ymaps': '//api-maps.yandex.ru/2.1/?lang=ru-RU', 'geolib': 'map/geolib.min' }, "shim": { 'ymaps': { exports: 'ymaps' }, 'geolib' : { exports: 'geolib' }

Re: integrating Facebook JS SDK

2016-04-09 Thread Ilya Obshadko
Pavel, So you just manually add requirejs.config call in every module file that has external AMD dependencies? This is helpful - thanks a lot! On Sat, Apr 9, 2016 at 3:47 PM, Pavel Chernyak wrote: > Greetings, Ilya. > Here is my example for Yandex maps module. As you can see I define > require.

Re: integrating Facebook JS SDK

2016-04-09 Thread Pavel Chernyak
Greetings, Ilya. Here is my example for Yandex maps module. As you can see I define require.js config in module file. requirejs.config({ paths: { 'ymaps': '//api-maps.yandex.ru/2.1/?lang=ru-RU', 'geolib': 'map/geolib.min' }, "shim": { 'ymaps': { exports: 'ymaps' }, 'geolib' : { exports: 'geolib' }

Re: integrating Facebook JS SDK

2016-04-09 Thread Ilya Obshadko
UPD: the obvious workaround is downloading it locally and contributing to ModuleManager: @Contribute(ModuleManager.*class*) *public* *static* *void* contributeModuleConfigiration ( MappedConfiguration configuration, @Path("context:js/facebook/sdk.js") Resource facebookSdk ) {

integrating Facebook JS SDK

2016-04-09 Thread Ilya Obshadko
Facebook recommends the following method to integrate FB SDK using AMD approach: https://developers.facebook.com/docs/javascript/howto/requirejs/v2.5 However I can't find any obvious way to configure RequireJS paths in Tapestry. Is there any way to do it? -- Ilya Obshadko