diff --git a/js/client/Readme_en_us.md b/js/client/Readme_en_us.md index c524d83..0154440 100644 --- a/js/client/Readme_en_us.md +++ b/js/client/Readme_en_us.md @@ -1,7 +1,7 @@ ## Usage -###Configuração -Para usar o funifier em produção, insira a seguinte linha na tag head de todas as paginas que deseja habilitar: +###configuration +To use the funifier in production, insert the following line in tag head of all the pages you want to enable: ```html @@ -9,8 +9,8 @@ Para usar o funifier em produção, insira a seguinte linha na tag head de todas ``` -### Iniciação Async mode -Para iniciar o funifier de maneira assincrona, insira uma função antes do script do funifier: +### Initiation Async mode +To start the funifier of asynchronous way, insert a function before the script funifier: ```javascript window.funifierAsyncInit = function(){ @@ -20,23 +20,23 @@ window.funifierAsyncInit = function(){ }; ``` -Dessa maneira, assim que o funifier tiver sido processado, irá chamar a função 'funifierAsyncInit' caso exista. +Thus, once the funifier has been processed , it will call the function 'funifierAsyncInit' if any. -### Iniciação Sync mode +### Initiation Sync mode -Você pode inicializar também o funifier a qualquer momento após o carregamento do script do funifier chamando seu método de inicio: +You can also boot the funifier at any time after loading the funifier script calling its start method: ```javascript Funifier.init({ apiKey : 'SUA API KEY' }); ``` -#Documentação +#Documentation -##Componentes -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. +##Components +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. -Funifier contêm os seguintes componentes: +Funifier contain the following components: - [jquery](https://jquery.com/): `Funifier._$` 1.11.1 - [async](https://github.com/caolan/async): `Funifier._async` @@ -47,9 +47,9 @@ Funifier contêm os seguintes componentes: - [magnificPopup](http://dimsemenov.com/plugins/magnific-popup/): `Funifier._$.magnificPopup` - [qs](https://github.com/hapijs/qs): `Funifier._qs` -Para a documentação dos componentes acima, verifique no site do respectivo componente. +For documentation of the above components , check the website of the respective component. -### Métodos +### methods * [`init`](#init) * [`listen`](#listen) * [`unlisten`](#unlisten) @@ -64,30 +64,30 @@ Para a documentação dos componentes acima, verifique no site do respectivo com --------------------------------------- ### init(config, callback) -Utilizado para iniciar a api do funifier. -Recebe como parâmetro um objeto e um callback. +Used to start the api funifier. +Receives as a parameter an object and a callback. __config__ -* `apiKey` : String - Apikey configurada no studio. -* `hideInline` : Boolean - Define a exibição do modo inline para admin. __default__ : false -* `showNotification`: Boolean - Exibir/ocultar as notificações. __default__ : true -* `disableCustomCss` : Boolean - Define se o funifier ira carregar o css dos widgets. __default__ : custom-{api_key}-v{version}.css. -* `disableCustomJs`: Boolean - Define se o funifier ira carregar o js com as funções de widgets. __default__ : custom-{api_key}-v{version}.js. +* `apiKey` : String - Apikey configured in studio. +* `hideInline` : Boolean - Sets the inline mode display for admin. __default__ : false +* `showNotification`: Boolean - Show / hide notifications. __default__ : true +* `disableCustomCss` : Boolean - Sets the wrath funifier load the css widgets. __default__ : custom-{api_key}-v{version}.css. +* `disableCustomJs`: Boolean - Sets the wrath funifier load the js with widgets functions. __default__ : custom-{api_key}-v{version}.js. * `url` * `service` : String - Url do service. __default__ : '//service2.funifier.com/2.0.0/' * `client` : String - Url do client. __default__ : '//client2.funifier.com/2.0.0' * `studio` : String - Url do studio. __default__ : '//studio2.funifier.com' - * `css` : String - Caminho de css para sobrescrever o padrão. __default__ : null - * `js` : String - Caminho do js para sobrescrever o padrão. __default__ : null + * `css` : String - Css path to override the default. __default__ : null + * `js` : String - Js the way to override the default. __default__ : null __callback__ -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. +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. -Parâmetros: -* `err` Recebe um erro caso tenha um +Parameters: +* `err` You receive an error if you have one -__Exemplo__ +__Example__ ```js Funifier.init({ @@ -105,34 +105,34 @@ Funifier.init({ --------------------------------------- ### listen(name, callback) -Monitora um evento do funifier -* `name` : String - Nome do evento a ser monitorado -* `callback` : Function - Função a ser executada. +Monitors a funifier event +* `name` : String - Event name to be monitored +* `callback` : Function - Function to be performed. --------------------------------------- ### unlisten(name) -Para remover eventos do funifier monitorados pelo listen. -* `name` : String - Nome do evento a excluir o listen. +To remove funifier events monitored by the listen. +* `name` : String - Event name to exclude the listen. * --------------------------------------- ### api(endpoint,params,callback) -Método para comunicação com o service. +Method for communication with the Servicen. -* `endpoint` : String - Metodo a ser requisitado no service. -* `params` : Object - Parâmetros a ser enviado para o service. -* `callback` : Function - retorno +* `endpoint` : String - Method to be required in service. +* `params` : Object - Parameters to be sent to the service. +* `callback` : Function - return -__Exemplos__ +__Examples__ ```js Funifier.api('get_leaderboard', {sort: 1, limit: 10, view: 0, group : 1}, function(err,data){ if(err==null){ - alert('Lista de leaderboards recebida') + alert('Received leaderboards list') console.log(data); }else{ - alert('Ocorreu um erro :(') + alert('an error occurred :(') } } ); @@ -143,10 +143,10 @@ Funifier.api('get_widget_data', null, function(err,data){ if(err==null){ - alert('Retorno recebido') - console.log(data); + alert('received return') + console.log(date); }else{ - alert('Ocorreu um erro :(') + alert('an error occurred :(') } } ); @@ -154,14 +154,14 @@ Funifier.api('get_widget_data', --------------------------------------- ### api(endpoint,params,options,callback) -Método para comunicação com o service. +Method for communication with the service. -* `endpoint` : String - Metodo a ser requisitado no service. -* `params` : Object - Parâmetros a ser enviado para o service. -* `options` : Object - Parâmetros adicionais. -* `callback` : Function - retorno +* `endpoint` : String - Method to be required in service. +* `params` : Object - Parameters to be sent to the service. +* `options` : Object - additional parameters. +* `callback` : Function - return -__Exemplos__ +__Examples__ ```js Funifier.api('get_leaderboard', @@ -169,10 +169,10 @@ Funifier.api('get_leaderboard', {type:'GET',contentType:'application/json'}, function(err,data){ if(err==null){ - alert('Lista de leaderboards recebida') - console.log(data); + alert('Received leaderboards list') + console.log(date); }else{ - alert('Ocorreu um erro :(') + alert('an error occurred :(') } } ); @@ -181,19 +181,19 @@ Funifier.api('get_leaderboard', --------------------------------------- ### track(options,callback) -Traqueia uma ação +Trachea action __options__ * `action` : String - Id ou nome da action. -* `attributes` : Array - lista de atributos, opicional. +* `attributes` : Array - list of attributes , optional. __callback__ -Função executada apos o track. -* `err` - Recebe um erro ou nulo. -* `data` - Response do servidor. +Function performed after the track. +* `err` - You receive a zero or. +* `data` - Server Response. -__Exemplo__ +__Example__ ```js Funifier.track({ @@ -208,25 +208,25 @@ Funifier.track({ --------------------------------------- ### auth ####authenticate(options,callback) -Função usada para autenticar jogadores. +Function used to authenticate players. __options__ -* `auth_mode` : String - Tipo de autenticação, valores disponiveis. +* `auth_mode` : String - Authentication type , available values. * facebook * google * IMPLICIT * PASSWORD -* `player` : String - Id do jogador, requerido para auth_mode 'IMPLICIT' e 'PASSWORD'. (String) -* `password` : String - Senha do jogador, requerido para auth_mode 'PASSWORD' -* `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') +* `player` : String - Player ID, required to auth_mode ' IMPLICIT ' and ' PASSWORD'. (String) +* `password` : String - Password Player , required to auth_mode 'PASSWORD' +* `modal` : Boolean - Sets the authentication via google or facebook will be made through a popup, (optional used only for auth_mode ' google' and ' facebook') __callback__ -Função que de retorno. (Não é executada caso o auth_mode for facebook ou google e modal for igual a false ) -* `err` - Recebe um erro ou nulo. -* `data` - Response do servidor: +Function to return. (It is not performed if the auth_mode for facebook or google and modal equals false ) +* `err` - You receive a zero or. +* `data` - Server Response: -__Exemplo Facebook__ +__Example Facebook__ ```js Funifier.auth.authenticate({ @@ -234,12 +234,12 @@ Funifier.auth.authenticate({ modal: true },function(err,data){ if(err==null){ - alert('Seja bem vindo') + alert('Welcome') } }); ``` -__Exemplo via Senha__ +__Example via Password__ ```js Funifier.auth.authenticate({ @@ -248,46 +248,46 @@ Funifier.auth.authenticate({ password: 'pass@123' },function(err,data){ if(err==null){ - alert('Seja bem vindo') + alert('Welcome') } }); ``` ####isAuthenticate(callback) -Verifica se o jogador está autenticado. +Checks if the player is authenticated. __callback__ * `isAuthenticate` :Bollean -__Exemplo__ +__Example__ ```js Funifier.auth.isAuthenticate(function(_isAuthenticate){ if(isAuthenticate){ - alert('Seja bem vindo, você está autenticado'); + alert('Welcome , you are logged'); }else{ - alert('Desculpe, faça login, você não está autenticado'); + alert('Sorry , log , you're not logged in'); } }); ``` ####logout(callback) -Efetua logout do jogador. +Log out Player. __callback__ * `err` * `data` -__Exemplo__ +__Example__ ```js Funifier.auth.logout(function(err){ if(err==null){ - alert('Jogador deslogado com sucesso'); + alert('Successfully offline player'); }else{ - alert('Ocorreu um erro'); + alert('an error occurred'); } }); ``` @@ -296,26 +296,26 @@ Funifier.auth.logout(function(err){ ## Widget -A estrutura basica de um widget: +The basic structure of a widget: ```javascript var ct = '
' render(ct,function(config){ var elemento = config.element; elemento.find('a').click(function(){ - alert('Você clicou no link'); + alert('You clicked the link'); }); }); ``` -O método render recebe uma string ou um objeto jquery e um metodo de retorno onde pode-se incluir eventos. +The render method takes a string or a jquery object and a feedback method which can include events. -Dentro do script você tem acesso a variável 'json' ,'theme_html', '$' e 'jQuery'. -O jquery disponível no widget é um jquery do objeto Funifier, caso queira acessar o jquery da pagina, use window.$ ou window.jQuery. +Within the script you have access to variable 'json' ,'theme_html', '$' e 'jQuery'. +The jquery available on the widget is a jquery Funifier object if you want to access the jquery page , use window . $ Or window.jQuery. -A variável json está disponivel em alguns tipos de widgets. +The json variable is available in some types of widgets. -Você pode usar o mustache para renderizar seu html. +You can use the mustache to render your html. ```javascript Funifier.auth.isAuthenticate(function(isAuthenticate) { @@ -327,7 +327,7 @@ Funifier.auth.isAuthenticate(function(isAuthenticate) { }); }); ``` -Você pode requisitar um recurso no servidor antes de renderizar. +You can request a resource on the server before rendering. ```javascript Funifier.auth.isAuthenticate(function(isAuthenticate) { @@ -344,21 +344,21 @@ Funifier.auth.isAuthenticate(function(isAuthenticate) { ## Debug -Por padrão o Funifier Client não exibe qualquer informação de error/info no console sendo necessário habilitar. -Para habilitar todas as mensagens do funifier, abra o console javascript e digite: +By default Funifier Client does not display any error information / info on the island is necessary to enable. +To enable all funifier messages , open the console and type javascript: ```javascript Funifier.debug.enable('*'); ``` -Você pode habilitar o log para mensagens específicas: +You can enable logging for specific messages: ```javascript Funifier.debug.enable('Funifier:social:*'); ``` ```javascript Funifier.debug.enable('Funifier:core:*'); ``` -Caso queira desabilitar as mensagens: +If you want to disable messages: ```javascript Funifier.debug.disable(); ``` \ No newline at end of file