Commit c328c574cde7202722494a20b8a3b6bd7e087288

Authored by Aline Freitas
1 parent 3229404f

Atualização

Showing 1 changed file with 88 additions and 88 deletions
js/client/Readme_en_us.md
1 ## Usage 1 ## Usage
2 2
3 -###Configuração  
4 -Para usar o funifier em produção, insira a seguinte linha na tag head de todas as paginas que deseja habilitar: 3 +###configuration
  4 +To use the funifier in production, insert the following line in tag head of all the pages you want to enable:
5 5
6 6
7 ```html 7 ```html
@@ -9,8 +9,8 @@ Para usar o funifier em produção, insira a seguinte linha na tag head de todas @@ -9,8 +9,8 @@ Para usar o funifier em produção, insira a seguinte linha na tag head de todas
9 ``` 9 ```
10 10
11 11
12 -### Iniciação Async mode  
13 -Para iniciar o funifier de maneira assincrona, insira uma função antes do script do funifier: 12 +### Initiation Async mode
  13 +To start the funifier of asynchronous way, insert a function before the script funifier:
14 14
15 ```javascript 15 ```javascript
16 window.funifierAsyncInit = function(){ 16 window.funifierAsyncInit = function(){
@@ -20,23 +20,23 @@ window.funifierAsyncInit = function(){ @@ -20,23 +20,23 @@ window.funifierAsyncInit = function(){
20 }; 20 };
21 ``` 21 ```
22 22
23 -Dessa maneira, assim que o funifier tiver sido processado, irá chamar a função 'funifierAsyncInit' caso exista. 23 +Thus, once the funifier has been processed , it will call the function 'funifierAsyncInit' if any.
24 24
25 -### Iniciação Sync mode 25 +### Initiation Sync mode
26 26
27 -Você pode inicializar também o funifier a qualquer momento após o carregamento do script do funifier chamando seu método de inicio: 27 +You can also boot the funifier at any time after loading the funifier script calling its start method:
28 ```javascript 28 ```javascript
29 Funifier.init({ 29 Funifier.init({
30 apiKey : 'SUA API KEY' 30 apiKey : 'SUA API KEY'
31 }); 31 });
32 ``` 32 ```
33 33
34 -#Documentação 34 +#Documentation
35 35
36 -##Componentes  
37 -O funifier tem algumas bibliotecas integradas, que pode ser usado em seus widgets/integrações, note no entanto, que as que tem o prefixo '_' são de uso do core do Funifier e por isso não tem garantia de estar presente numa versão futura. 36 +##Components
  37 +The funifier has some integrated libraries, which can be used in your widgets / integrations note however, that they have the prefix '_' are using the core Funifier and therefore has no guarantee of being present in a future release.
38 38
39 -Funifier contêm os seguintes componentes: 39 +Funifier contain the following components:
40 40
41 - [jquery](https://jquery.com/): `Funifier._$` 1.11.1 41 - [jquery](https://jquery.com/): `Funifier._$` 1.11.1
42 - [async](https://github.com/caolan/async): `Funifier._async` 42 - [async](https://github.com/caolan/async): `Funifier._async`
@@ -47,9 +47,9 @@ Funifier contêm os seguintes componentes: @@ -47,9 +47,9 @@ Funifier contêm os seguintes componentes:
47 - [magnificPopup](http://dimsemenov.com/plugins/magnific-popup/): `Funifier._$.magnificPopup` 47 - [magnificPopup](http://dimsemenov.com/plugins/magnific-popup/): `Funifier._$.magnificPopup`
48 - [qs](https://github.com/hapijs/qs): `Funifier._qs` 48 - [qs](https://github.com/hapijs/qs): `Funifier._qs`
49 49
50 -Para a documentação dos componentes acima, verifique no site do respectivo componente. 50 +For documentation of the above components , check the website of the respective component.
51 51
52 -### Métodos 52 +### methods
53 * [`init`](#init) 53 * [`init`](#init)
54 * [`listen`](#listen) 54 * [`listen`](#listen)
55 * [`unlisten`](#unlisten) 55 * [`unlisten`](#unlisten)
@@ -64,30 +64,30 @@ Para a documentação dos componentes acima, verifique no site do respectivo com @@ -64,30 +64,30 @@ Para a documentação dos componentes acima, verifique no site do respectivo com
64 --------------------------------------- 64 ---------------------------------------
65 ### init(config, callback) 65 ### init(config, callback)
66 66
67 -Utilizado para iniciar a api do funifier.  
68 -Recebe como parâmetro um objeto e um callback. 67 +Used to start the api funifier.
  68 +Receives as a parameter an object and a callback.
69 69
70 __config__ 70 __config__
71 -* `apiKey` : String - Apikey configurada no studio.  
72 -* `hideInline` : Boolean - Define a exibição do modo inline para admin. __default__ : false  
73 -* `showNotification`: Boolean - Exibir/ocultar as notificações. __default__ : true  
74 -* `disableCustomCss` : Boolean - Define se o funifier ira carregar o css dos widgets. __default__ : custom-{api_key}-v{version}.css.  
75 -* `disableCustomJs`: Boolean - Define se o funifier ira carregar o js com as funções de widgets. __default__ : custom-{api_key}-v{version}.js. 71 +* `apiKey` : String - Apikey configured in studio.
  72 +* `hideInline` : Boolean - Sets the inline mode display for admin. __default__ : false
  73 +* `showNotification`: Boolean - Show / hide notifications. __default__ : true
  74 +* `disableCustomCss` : Boolean - Sets the wrath funifier load the css widgets. __default__ : custom-{api_key}-v{version}.css.
  75 +* `disableCustomJs`: Boolean - Sets the wrath funifier load the js with widgets functions. __default__ : custom-{api_key}-v{version}.js.
76 * `url` 76 * `url`
77 * `service` : String - Url do service. __default__ : '//service2.funifier.com/2.0.0/' 77 * `service` : String - Url do service. __default__ : '//service2.funifier.com/2.0.0/'
78 * `client` : String - Url do client. __default__ : '//client2.funifier.com/2.0.0' 78 * `client` : String - Url do client. __default__ : '//client2.funifier.com/2.0.0'
79 * `studio` : String - Url do studio. __default__ : '//studio2.funifier.com' 79 * `studio` : String - Url do studio. __default__ : '//studio2.funifier.com'
80 - * `css` : String - Caminho de css para sobrescrever o padrão. __default__ : null  
81 - * `js` : String - Caminho do js para sobrescrever o padrão. __default__ : null 80 + * `css` : String - Css path to override the default. __default__ : null
  81 + * `js` : String - Js the way to override the default. __default__ : null
82 82
83 __callback__ 83 __callback__
84 84
85 -Recebe uma função que é executada assim que o funifier terminou de inicializar os objetos para a apiKey informada, sendo, que ja carregou todas as dependencias, scripts e styles. 85 +Receives a function that is performed once the funifier finished initializing objects for informed apiKey , with which already loaded all the dependencies , scripts and styles.
86 86
87 -Parâmetros:  
88 -* `err` Recebe um erro caso tenha um 87 +Parameters:
  88 +* `err` You receive an error if you have one
89 89
90 -__Exemplo__ 90 +__Example__
91 91
92 ```js 92 ```js
93 Funifier.init({ 93 Funifier.init({
@@ -105,34 +105,34 @@ Funifier.init({ @@ -105,34 +105,34 @@ Funifier.init({
105 105
106 --------------------------------------- 106 ---------------------------------------
107 ### listen(name, callback) 107 ### listen(name, callback)
108 -Monitora um evento do funifier  
109 -* `name` : String - Nome do evento a ser monitorado  
110 -* `callback` : Function - Função a ser executada. 108 +Monitors a funifier event
  109 +* `name` : String - Event name to be monitored
  110 +* `callback` : Function - Function to be performed.
111 111
112 --------------------------------------- 112 ---------------------------------------
113 ### unlisten(name) 113 ### unlisten(name)
114 -Para remover eventos do funifier monitorados pelo listen.  
115 -* `name` : String - Nome do evento a excluir o listen. 114 +To remove funifier events monitored by the listen.
  115 +* `name` : String - Event name to exclude the listen.
116 * 116 *
117 --------------------------------------- 117 ---------------------------------------
118 ### api(endpoint,params,callback) 118 ### api(endpoint,params,callback)
119 -Método para comunicação com o service. 119 +Method for communication with the Servicen.
120 120
121 -* `endpoint` : String - Metodo a ser requisitado no service.  
122 -* `params` : Object - Parâmetros a ser enviado para o service.  
123 -* `callback` : Function - retorno 121 +* `endpoint` : String - Method to be required in service.
  122 +* `params` : Object - Parameters to be sent to the service.
  123 +* `callback` : Function - return
124 124
125 -__Exemplos__ 125 +__Examples__
126 126
127 ```js 127 ```js
128 Funifier.api('get_leaderboard', 128 Funifier.api('get_leaderboard',
129 {sort: 1, limit: 10, view: 0, group : 1}, 129 {sort: 1, limit: 10, view: 0, group : 1},
130 function(err,data){ 130 function(err,data){
131 if(err==null){ 131 if(err==null){
132 - alert('Lista de leaderboards recebida') 132 + alert('Received leaderboards list')
133 console.log(data); 133 console.log(data);
134 }else{ 134 }else{
135 - alert('Ocorreu um erro :(') 135 + alert('an error occurred :(')
136 } 136 }
137 } 137 }
138 ); 138 );
@@ -143,10 +143,10 @@ Funifier.api('get_widget_data', @@ -143,10 +143,10 @@ Funifier.api('get_widget_data',
143 null, 143 null,
144 function(err,data){ 144 function(err,data){
145 if(err==null){ 145 if(err==null){
146 - alert('Retorno recebido')  
147 - console.log(data); 146 + alert('received return')
  147 + console.log(date);
148 }else{ 148 }else{
149 - alert('Ocorreu um erro :(') 149 + alert('an error occurred :(')
150 } 150 }
151 } 151 }
152 ); 152 );
@@ -154,14 +154,14 @@ Funifier.api('get_widget_data', @@ -154,14 +154,14 @@ Funifier.api('get_widget_data',
154 154
155 --------------------------------------- 155 ---------------------------------------
156 ### api(endpoint,params,options,callback) 156 ### api(endpoint,params,options,callback)
157 -Método para comunicação com o service. 157 +Method for communication with the service.
158 158
159 -* `endpoint` : String - Metodo a ser requisitado no service.  
160 -* `params` : Object - Parâmetros a ser enviado para o service.  
161 -* `options` : Object - Parâmetros adicionais.  
162 -* `callback` : Function - retorno 159 +* `endpoint` : String - Method to be required in service.
  160 +* `params` : Object - Parameters to be sent to the service.
  161 +* `options` : Object - additional parameters.
  162 +* `callback` : Function - return
163 163
164 -__Exemplos__ 164 +__Examples__
165 165
166 ```js 166 ```js
167 Funifier.api('get_leaderboard', 167 Funifier.api('get_leaderboard',
@@ -169,10 +169,10 @@ Funifier.api('get_leaderboard', @@ -169,10 +169,10 @@ Funifier.api('get_leaderboard',
169 {type:'GET',contentType:'application/json'}, 169 {type:'GET',contentType:'application/json'},
170 function(err,data){ 170 function(err,data){
171 if(err==null){ 171 if(err==null){
172 - alert('Lista de leaderboards recebida')  
173 - console.log(data); 172 + alert('Received leaderboards list')
  173 + console.log(date);
174 }else{ 174 }else{
175 - alert('Ocorreu um erro :(') 175 + alert('an error occurred :(')
176 } 176 }
177 } 177 }
178 ); 178 );
@@ -181,19 +181,19 @@ Funifier.api('get_leaderboard', @@ -181,19 +181,19 @@ Funifier.api('get_leaderboard',
181 181
182 --------------------------------------- 182 ---------------------------------------
183 ### track(options,callback) 183 ### track(options,callback)
184 -Traqueia uma ação 184 +Trachea action
185 185
186 __options__ 186 __options__
187 * `action` : String - Id ou nome da action. 187 * `action` : String - Id ou nome da action.
188 -* `attributes` : Array - lista de atributos, opicional. 188 +* `attributes` : Array - list of attributes , optional.
189 189
190 __callback__ 190 __callback__
191 191
192 -Função executada apos o track.  
193 -* `err` - Recebe um erro ou nulo.  
194 -* `data` - Response do servidor. 192 +Function performed after the track.
  193 +* `err` - You receive a zero or.
  194 +* `data` - Server Response.
195 195
196 -__Exemplo__ 196 +__Example__
197 197
198 ```js 198 ```js
199 Funifier.track({ 199 Funifier.track({
@@ -208,25 +208,25 @@ Funifier.track({ @@ -208,25 +208,25 @@ Funifier.track({
208 --------------------------------------- 208 ---------------------------------------
209 ### auth 209 ### auth
210 ####authenticate(options,callback) 210 ####authenticate(options,callback)
211 -Função usada para autenticar jogadores. 211 +Function used to authenticate players.
212 212
213 __options__ 213 __options__
214 -* `auth_mode` : String - Tipo de autenticação, valores disponiveis. 214 +* `auth_mode` : String - Authentication type , available values.
215 * facebook 215 * facebook
216 * google 216 * google
217 * IMPLICIT 217 * IMPLICIT
218 * PASSWORD 218 * PASSWORD
219 -* `player` : String - Id do jogador, requerido para auth_mode 'IMPLICIT' e 'PASSWORD'. (String)  
220 -* `password` : String - Senha do jogador, requerido para auth_mode 'PASSWORD'  
221 -* `modal` : Boolean - Define se a autenticação via google ou facebook sera feita atraves de um popup, (opcional usado apenas para auth_mode 'google' e 'facebook') 219 +* `player` : String - Player ID, ​​required to auth_mode ' IMPLICIT ' and ' PASSWORD'. (String)
  220 +* `password` : String - Password Player , required to auth_mode 'PASSWORD'
  221 +* `modal` : Boolean - Sets the authentication via google or facebook will be made through a popup, (optional used only for auth_mode ' google' and ' facebook')
222 222
223 __callback__ 223 __callback__
224 224
225 -Função que de retorno. (Não é executada caso o auth_mode for facebook ou google e modal for igual a false )  
226 -* `err` - Recebe um erro ou nulo.  
227 -* `data` - Response do servidor: 225 +Function to return. (It is not performed if the auth_mode for facebook or google and modal equals false )
  226 +* `err` - You receive a zero or.
  227 +* `data` - Server Response:
228 228
229 -__Exemplo Facebook__ 229 +__Example Facebook__
230 230
231 ```js 231 ```js
232 Funifier.auth.authenticate({ 232 Funifier.auth.authenticate({
@@ -234,12 +234,12 @@ Funifier.auth.authenticate({ @@ -234,12 +234,12 @@ Funifier.auth.authenticate({
234 modal: true 234 modal: true
235 },function(err,data){ 235 },function(err,data){
236 if(err==null){ 236 if(err==null){
237 - alert('Seja bem vindo') 237 + alert('Welcome')
238 } 238 }
239 }); 239 });
240 ``` 240 ```
241 241
242 -__Exemplo via Senha__ 242 +__Example via Password__
243 243
244 ```js 244 ```js
245 Funifier.auth.authenticate({ 245 Funifier.auth.authenticate({
@@ -248,46 +248,46 @@ Funifier.auth.authenticate({ @@ -248,46 +248,46 @@ Funifier.auth.authenticate({
248 password: 'pass@123' 248 password: 'pass@123'
249 },function(err,data){ 249 },function(err,data){
250 if(err==null){ 250 if(err==null){
251 - alert('Seja bem vindo') 251 + alert('Welcome')
252 } 252 }
253 }); 253 });
254 ``` 254 ```
255 255
256 ####isAuthenticate(callback) 256 ####isAuthenticate(callback)
257 257
258 -Verifica se o jogador está autenticado. 258 +Checks if the player is authenticated.
259 259
260 __callback__ 260 __callback__
261 * `isAuthenticate` :Bollean 261 * `isAuthenticate` :Bollean
262 262
263 -__Exemplo__ 263 +__Example__
264 264
265 ```js 265 ```js
266 Funifier.auth.isAuthenticate(function(_isAuthenticate){ 266 Funifier.auth.isAuthenticate(function(_isAuthenticate){
267 if(isAuthenticate){ 267 if(isAuthenticate){
268 - alert('Seja bem vindo, você está autenticado'); 268 + alert('Welcome , you are logged');
269 }else{ 269 }else{
270 - alert('Desculpe, faça login, você não está autenticado'); 270 + alert('Sorry , log , you're not logged in');
271 } 271 }
272 }); 272 });
273 ``` 273 ```
274 274
275 ####logout(callback) 275 ####logout(callback)
276 276
277 -Efetua logout do jogador. 277 +Log out Player.
278 278
279 __callback__ 279 __callback__
280 * `err` 280 * `err`
281 * `data` 281 * `data`
282 282
283 -__Exemplo__ 283 +__Example__
284 284
285 ```js 285 ```js
286 Funifier.auth.logout(function(err){ 286 Funifier.auth.logout(function(err){
287 if(err==null){ 287 if(err==null){
288 - alert('Jogador deslogado com sucesso'); 288 + alert('Successfully offline player');
289 }else{ 289 }else{
290 - alert('Ocorreu um erro'); 290 + alert('an error occurred');
291 } 291 }
292 }); 292 });
293 ``` 293 ```
@@ -296,26 +296,26 @@ Funifier.auth.logout(function(err){ @@ -296,26 +296,26 @@ Funifier.auth.logout(function(err){
296 296
297 ## Widget 297 ## Widget
298 298
299 -A estrutura basica de um widget: 299 +The basic structure of a widget:
300 ```javascript 300 ```javascript
301 var ct = '<div><a href="#">Hello World!</a></div>' 301 var ct = '<div><a href="#">Hello World!</a></div>'
302 render(ct,function(config){ 302 render(ct,function(config){
303 var elemento = config.element; 303 var elemento = config.element;
304 elemento.find('a').click(function(){ 304 elemento.find('a').click(function(){
305 - alert('Você clicou no link'); 305 + alert('You clicked the link');
306 }); 306 });
307 }); 307 });
308 ``` 308 ```
309 309
310 -O método render recebe uma string ou um objeto jquery e um metodo de retorno onde pode-se incluir eventos. 310 +The render method takes a string or a jquery object and a feedback method which can include events.
311 311
312 -Dentro do script você tem acesso a variável 'json' ,'theme_html', '$' e 'jQuery'.  
313 -O jquery disponível no widget é um jquery do objeto Funifier, caso queira acessar o jquery da pagina, use window.$ ou window.jQuery. 312 +Within the script you have access to variable 'json' ,'theme_html', '$' e 'jQuery'.
  313 +The jquery available on the widget is a jquery Funifier object if you want to access the jquery page , use window . $ Or window.jQuery.
314 314
315 -A variável json está disponivel em alguns tipos de widgets. 315 +The json variable is available in some types of widgets.
316 316
317 317
318 -Você pode usar o mustache para renderizar seu html. 318 +You can use the mustache to render your html.
319 319
320 ```javascript 320 ```javascript
321 Funifier.auth.isAuthenticate(function(isAuthenticate) { 321 Funifier.auth.isAuthenticate(function(isAuthenticate) {
@@ -327,7 +327,7 @@ Funifier.auth.isAuthenticate(function(isAuthenticate) { @@ -327,7 +327,7 @@ Funifier.auth.isAuthenticate(function(isAuthenticate) {
327 }); 327 });
328 }); 328 });
329 ``` 329 ```
330 -Você pode requisitar um recurso no servidor antes de renderizar. 330 +You can request a resource on the server before rendering.
331 331
332 ```javascript 332 ```javascript
333 Funifier.auth.isAuthenticate(function(isAuthenticate) { 333 Funifier.auth.isAuthenticate(function(isAuthenticate) {
@@ -344,21 +344,21 @@ Funifier.auth.isAuthenticate(function(isAuthenticate) { @@ -344,21 +344,21 @@ Funifier.auth.isAuthenticate(function(isAuthenticate) {
344 344
345 ## Debug 345 ## Debug
346 346
347 -Por padrão o Funifier Client não exibe qualquer informação de error/info no console sendo necessário habilitar.  
348 -Para habilitar todas as mensagens do funifier, abra o console javascript e digite: 347 +By default Funifier Client does not display any error information / info on the island is necessary to enable.
  348 +To enable all funifier messages , open the console and type javascript:
349 349
350 ```javascript 350 ```javascript
351 Funifier.debug.enable('*'); 351 Funifier.debug.enable('*');
352 ``` 352 ```
353 353
354 -Você pode habilitar o log para mensagens específicas: 354 +You can enable logging for specific messages:
355 ```javascript 355 ```javascript
356 Funifier.debug.enable('Funifier:social:*'); 356 Funifier.debug.enable('Funifier:social:*');
357 ``` 357 ```
358 ```javascript 358 ```javascript
359 Funifier.debug.enable('Funifier:core:*'); 359 Funifier.debug.enable('Funifier:core:*');
360 ``` 360 ```
361 -Caso queira desabilitar as mensagens: 361 +If you want to disable messages:
362 ```javascript 362 ```javascript
363 Funifier.debug.disable(); 363 Funifier.debug.disable();
364 ``` 364 ```
365 \ No newline at end of file 365 \ No newline at end of file