From 7ee8d268e46101900058848a6eeb9bf4bcfadd72 Mon Sep 17 00:00:00 2001 From: Marcos Oliveira Date: Wed, 17 Jun 2015 12:18:22 +0000 Subject: [PATCH] validar --- js/inline/Readme.md | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------- 1 file changed, 97 insertions(+), 117 deletions(-) diff --git a/js/inline/Readme.md b/js/inline/Readme.md index 81a4a13..e28462a 100644 --- a/js/inline/Readme.md +++ b/js/inline/Readme.md @@ -1,70 +1,64 @@ -Trigger # +# Trigger -### Action +# Action Action to be triggered to Execultar the event. * Attributes (optional) -    * Name: string - name attribute -    * Type: option - type attribute -    * Function: string - function that will dynamically capture the value of the attribute. Example: -`` `Javascript - return Funifier ._ $ ('# age') val ().; -`` ` +* Name: string - name attribute +* Type: option - type attribute +* Function: string - function that will dynamically capture the value of the attribute. -### Event +### Example +``` sh +Javascript + return Funifier ._ $ ('# age') val ().; +``` +# Event Event Type to be monitored - -### Selector +# Selector Element will be done bind the event. - -Page ### Page (s) that will be monitoring the event. - -### Pre Script (optional) +# Pre Script (optional) Function performed prior to bind the element. - Available variables: - Element: element gift - Trigger: object -    * _id: String -    * Name: string -    * Actions: array -    * Trigger: string ('click', 'pageview' ...) -    * Selector: string, -    * Page: string, -    * Pre_script: string -    * Port_script: string, -    * Pre_validation_script: string - -Example: - +    * _id: **String** - Required +    * Name: **String** +    * Actions:**array** +    * Trigger: **string ('click', 'pageview' ...)** +    * Selector: **String** - Required +    * Page: s**String** - Required +    * Pre_script: s**String** - Required +    * Port_script: **String** - Required +    * Pre_validation_script: **String** - Required + +### Example If the element to be rendered via ajax, one can create a function to make the track manually. - `` `Javascript  Funifier ._ $ ('body'). On ('click', trigger.selector, function () {     Funifier.track ({action: trigger._id, TRIGGER_TYPE: 'TRIGGER_HTML'});  }); `` ` -Note 1: As we are traqueando the id of the trigger must inform the trigger type as trigger_html, but the server will interpret the id as the id action. +- Note 1: As we are traqueando the id of the trigger must inform the trigger type as trigger_html, but the server will interpret the id as the id action. +- Note 2: If you do the track manually, you must retonar false in pre validate to avoid unexpected behavior, as more than once traquear the same event. -Note 2: If you do the track manually, you must retonar false in pre validate to avoid unexpected behavior, as more than once traquear the same event. +# Pre Validity (optional) +-Validation function performed before being made the track, waiting for the return of a boolean if the false seje return will not be made the track. -### Pre Validity (optional) -Validation function performed before being made the track, waiting for the return of a boolean if the false seje return will not be made the track. - -Available variables: +- Available variables: - Element: element gift - Trigger: object -    * _id: String -    * Name: string -    * Actions: array -    * Trigger: string ('click', 'pageview' ...) -    * Selector: string, -    * Page: string, -    * Pre_script: string +    * _id: **String** - Required +    * Name: **String** - Required +    * Actions: **String** - Required +    * Trigger: **string ('click', 'pageview' ...)** +    * Selector: **String** - Required +    * Page: **String** - Required +    * Pre_script: **String** - Required     * Port_script: string,     * Pre_validation_script: string -Example: +### Example `` `Javascript  var value = Funifier ._ $ ('# name') val ().;  if (value.length> 0) { @@ -73,81 +67,74 @@ Example: } return true; `` ` - - -### Post Script (optional) +# Post Script (optional) Function performed after the track. -Available variables: +- Available variables: - Trigger: object -    * _id: String -    * Name: string -    * Actions: array -    * Trigger: string ('click', 'pageview' ...) -    * Selector: string, -    * Page: string, -    * Pre_script: string -    * Port_script: string, -    * Pre_validation_script: string -     -Example: +    * _id: **String** - Required +    * Name: **String** - Required +    * Actions: **array** +    * Trigger: **string ('click', 'pageview' ...)** +    * Selector: **String** - Required +    * Page: **String** - Required +    * Pre_script: **String** - Required +    * Port_script: **String** - Required +    * Pre_validation_script: **String** - Required + +### Example `` `Javascript  alert ('traqueada action'); `` ` -Note: In some cases these function can not be performed, depending on the context, such as in a page redirection. - - -### Run only client +- Note: In some cases these function can not be performed, depending on the context, such as in a page redirection. -If the event seje "Page View", you can cancel the track on the server of the shares in order to run any script as traquear manually. +# Run only client +- If the event seje "Page View", you can cancel the track on the server of the shares in order to run any script as traquear manually. - -### Name (Optional) +# Name (Optional) Name for reference in the studio -Variáveis disponíveis: +- Variáveis disponíveis: - element : dom element - trigger : object - * _id : string - * name : string - * actions : array - * trigger : string ('click','pageview' ...) - * selector : string, + * _id : **String** - Required + * name : **String** - Required + * actions : **array** + * trigger : **string ('click','pageview' ...)** + * selector : **String** - Required * page : string, - * pre_script : string - * port_script : string, - * pre_validation_script : string - -Exemplo: + * pre_script : **String** - Required + * port_script : **String** - Required + * pre_validation_script : **String** - Required -Caso o elemento seja renderizado via ajax, pode-se criar uma função para fazer o track manualmente. +### Example +- Caso o elemento seja renderizado via ajax, pode-se criar uma função para fazer o track manualmente. ```javascript Funifier._$('body').on('click',trigger.selector,function(){ Funifier.track({action:trigger._id,trigger_type: 'TRIGGER_HTML'}); }); ``` -Observação1: Como estamos traqueando o id da trigger devemos informar o trigger type como trigger_html, senão o servidor irá interpretar o id como id da action. +- Observação1: Como estamos traqueando o id da trigger devemos informar o trigger type como trigger_html, senão o servidor irá interpretar o id como id da action. +- Observação2: Caso você faça o track manualmente, você deve retonar false no pre validate, para evitar comportamentos inesperados, como traquear mais de uma vez o mesmo evento. -Observação2: Caso você faça o track manualmente, você deve retonar false no pre validate, para evitar comportamentos inesperados, como traquear mais de uma vez o mesmo evento. - -### Pré Validade (opcional) +# Pré Validade (opcional) Função de validação executada antes de ser efetuado o track, espera o retorno de um boolean, caso o retorno seje falso não será feito o track. -Variáveis disponíveis: +- Variáveis disponíveis: - element : dom element - trigger : object - * _id : string - * name : string - * actions : array - * trigger : string ('click','pageview' ...) - * selector : string, - * page : string, - * pre_script : string - * port_script : string, - * pre_validation_script : string - -Exemplo: + * _id : **String** - Required + * name : **String** - Required + * actions : **array** + * trigger : **string ('click','pageview' ...)** + * selector : **String** - Required + * page : **String** - Required + * pre_script : **String** - Required + * port_script : **String** - Required + * pre_validation_script : **String** - Required + +### Example ```javascript var value= Funifier._$('#name').val(); if(value.length>0){ @@ -156,35 +143,28 @@ Exemplo: } return true; ``` - - -### Post Script (opcional) +# Post Script (opcional) Função executada depois do track. - -Variáveis disponíveis: +- Variáveis disponíveis: - trigger : object - * _id : string - * name : string - * actions : array - * trigger : string ('click','pageview' ...) - * selector : string, - * page : string, - * pre_script : string - * port_script : string, - * pre_validation_script : string + * _id :**String** - Required + * name : **String** - Required + * actions : **array** + * trigger : **string ('click','pageview' ...)** + * selector : **String** - Required + * page : **String** - Required + * pre_script : **String** - Required + * port_script : **String** - Required + * pre_validation_script : **String** - Required -Exemplo: +### Example ```javascript alert('Acão traqueada'); ``` +- Observação: Em alguns casos essas função pode não ser executada, dependendo do contexto, como por exemplo em um redirecionamento de pagina. -Observação: Em alguns casos essas função pode não ser executada, dependendo do contexto, como por exemplo em um redirecionamento de pagina. - - -### Run only client - -Caso o evento seje "Page View", pode-se cancelar o track no servidor das ações para poder executar algum script como traquear manualmente. - +# Run only client +- Caso o evento seje "Page View", pode-se cancelar o track no servidor das ações para poder executar algum script como traquear manualmente. -### Name (opcional) -Nome para referencia dentro do studio. \ No newline at end of file +# Name (opcional) +- Nome para referencia dentro do studio. \ No newline at end of file -- libgit2 0.22.2