Ext JS TextField’lar için Webkit speech (webkit-speech) eklentisi

Bu eklenti webkit temelli tarayıcılarda textField komponentlerinizin webkit speech özelliğini etlinleştirir.


Nasıl kullanılır

{
    xtype: 'textfield',
    plugins: [ Ext.ux.FieldSpeecher ],
    listeners: {
        speech: function(field, value) {
            // todo...
        }
    }
}

Kaynak kodu

Ext.ns('Ext.ux');

/**
 * A plugin for webkit speech feature is activated.
 *
 * @author      Tayfun Öziş ERİKAN
 * @copyright   Copyright (c) 2010-2011 lab2023 - internet technologies TURKEY Inc. (http://www.lab2023.com)
 * @license     http://www.kebab-project.com/cms/licensing
 * @class Ext.ux.FieldSpeecher
 *
 *
Usage:

*
<code> { xtype: 'textfield', plugins: [ Ext.ux.FieldSpeecher ], listeners: { speech: function(field, value) { // todo... } } } * </code>
 */
Ext.ux.FieldSpeecher = {

    init: function(f) {
        if (Ext.isWebKit) {

            f.addEvents('speech');

            f.on('render', function() {

                f.getEl().set({
                    'x-webkit-speech': true,
                    'speech': true
                });

                f.getEl().on('webkitspeechchange', function() {
                    f.fireEvent('speech', f, f.getValue());
                });
            });
        }
    }
};

URL:
Kebab project github sayfasından dosyaya ulaşabilirsiniz.
https://github.com/kebab-project/kebab-project/blob/master/web/assets/kebab/system/library/ext/ux/FieldSpeecher.js

İyi çalışmalar.

About tayfun.ozis.erikan

Web Developer, Graphic & Web Designer Zend Framework, CodeIgniter, ExtJS & Sencha Touch User Kebab Framework Developer The co-founder of lab2023 - internet technologies
This entry was posted in Ext JS, JavaScript and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>