Skip to content

leovafme/paper-search-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paper-search-input

input search and voice commands

Use

import:

<link rel="import" href="/bower_components/paper-search-input/paper-search-input.html">

html

<paper-search-input id="paper-search-input" languaje="es-CO"></paper-search-input>

Config commands

var paperInputSearch = document.getElementById('paper-search-input');
      paperInputSearch._commandsVoice(
        {
          'hola': function() { alert('Hello world!'); annyang.abort(); },
          'busca a *val':function(val) {
            alert('Buscando a:'+ val);

            paperInputSearch.hearVoiceStop();
          },
          'cuanto es :val + :val2':function(val, val2) {
            var v1 = parseInt(val);
            var v2 = parseInt(val2);

            paperInputSearch.value = 'cuanto es '+v1+' + '+v2;
            alert('el resultado es:'+ (v1 + v2) );

            paperInputSearch.hearVoiceStop();
          }
        }
      );

alt tag

alt tag

Use search history option

<paper-search-input id="paper-search-input" languaje="es-CO" search-history></paper-search-input>

add items searchHistory

var paperInputSearch = document.getElementById('paper-search-input');

paperInputSearch.searchItems = [
  {
    "title":'Historial',
    "subtitle":'',
    "value":'',
    "icon":'history'
  },
  {
    "title":'Clientes enero',
    "subtitle":'ene, 19 2016',
    "value":'2015-01-19',
    "icon":'chevron-right'
  }
];

alt tag

License

MIT

Free Component, Yeah!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages