[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: integrating Facebook JS SDK
From:       "Thiago H de Paula Figueiredo" <thiagohp () gmail ! com>
Date:       2016-04-11 20:18:18
Message-ID: op.yfruosviovlrp5 () arsdesktop
[Download RAW message or body]

Thanks for your very useful example, Carlos!

On Sat, 09 Apr 2016 15:48:58 -0300, Carlos Montero Canabal  
<carlosmonterocanabal@gmail.com> wrote:

> In your controller class (.java) you can write this:
>
>
> 		javaScriptSupport.addModuleConfigurationCallback(new  
> ModuleConfigurationCallback() {
>
> 			@Override
> 			public JSONObject configure(final JSONObject configuration) {
> 				final JSONObject facebookExports = new JSONObject();
> 				facebookExports.put("exports", "FB");
> 				configuration.getJSONObject("shim").put("facebook", facebookExports);
>
> 				final JSONObject paths = new JSONObject();
> 				paths.put("facebook", "//connect.facebook.net/es_ES/sdk");
> 				configuration.put("paths", paths);
>
> 				return configuration;
> 			}
> 		});
>
> And in your module file:
>
> define(['facebook'], function(FB){
> 	
> 	init = function(appId){
> 		
> 	  FB.init({
> 	    appId      : appId,
> 	    version    : 'v2.5',
> 	    xfbml      : true
> 	  });
> 	
> 	}
> 	
> 	return {
> 		init: init
> 	}
> });
>
> For example.
>
> I hope help you.
>
> Regards
>
> Carlos Montero
>
>
>> El 9/4/2016, a las 14:11, Pavel Chernyak <justancux@gmail.com> escribió:
>>
>> 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' } } }); define(["jquery", "ymaps",
>> "geolib","./lodash.min","./graham_scan.min"], function ($,  
>> ymaps,geolib) {
>> code... });
>>
>> Pavel Chernyak.
>> 9 апр. 2016 г. 15:05 пользователь "Ilya Obshadko" <xfyre@xfyre.com>  
>> написал:
>>
>>> 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
>>>
>


-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic