• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

wikimedia/jquery.ime: jQuery based input methods library

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

wikimedia/jquery.ime

开源软件地址:

https://github.com/wikimedia/jquery.ime

开源编程语言:

JavaScript 99.5%

开源软件介绍:

jQuery.IME

jQuery.IME is a jQuery based input method editor library supporting more than 220 input methods across more than 120 languages.

jQuery.IME Demo

These input methods are well tested. Initially the input methods were contributed by the Wikimedia community. By now many input methods have also been contributed by Red Hat.

This project is a Wikimedia foundation initiative to provide language technology tools to a wider audience outside the Wikimedia universe.

This input tool is widely deployed in all Wikimedia projects (eg: wikipedia).

Quick start

git clone https://github.com/wikimedia/jquery.ime.git

Load the necessary scripts:

<link href="../css/jquery.ime.css" rel="stylesheet" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" ></script>
<script src="../src/jquery.ime.js"></script>
<script src="../src/jquery.ime.selector.js"></script>
<script src="../src/jquery.ime.preferences.js"></script>
<script src="../src/jquery.ime.inputmethods.js"></script>

To add input method support to all editable elements:

$( 'textarea, [contenteditable], input[type=text], input[type=search], input:not([type])' ).ime();

jquery.ime provides a jquery plugin function $.fn.ime() to add input method support for any editable elements in a page.

Language selection API

Instead of using the default language selector, you can roll your own:

$myDiv= $( '.foo' );
$myDiv.ime( { showSelector: false } );
ime = $myDiv.data( 'ime' );
$elements.on( 'imeLanguageChange', function () { ... } );
$elements.on( 'imeMethodChange', function () { ... } );

currentLanguageCode = ime.getLanguage();
currentLanguageName = ime.getAutonym( currentLanguageCode );
allLanguageCodes = ime.getLanguageCodes();
inputMethods = ime.getInputMethods( currentLanguageCode );
ime.setIM( inputMethods[ 0 ].id );

See examples/ced/ced.html for a more complete example.

Running

-If you have python installed, run -bash python -m SimpleHTTPServer -

Alternatively, many programming languages provide one liner commands to start a simple http static servers. You can use any one of them.

and, you can access examples from

http://localhost:8000/examples/index.html

Alternatively you can use tools like webfsd. If you know how to use advanced web servers like Apache or Nginx, you already know how to put the code in a webserver.

Plugin Options

Option Description
imePath Relative/Absolute path for the rules folder of jquery.ime. Default value: '../'
languages Languages to be used- by default all languages. Default value: []. Eg: ['hi', 'ml']. It can also be a function returning an array.
helpHandler Called for each ime option in the menu, default value: null
showSelector Whether the input method selector to be used or not. Default value is true

Browser extensions

This input tool is also available as a Chrome extension:

For Developers

Read rules/README.md to learn how to write an input method for a language.

Read test/README.md to learn how to write and run tests for an input method.

Read the technical specification of the project from wiki.

Do watch the code walkthrough by Chris Forno: http://www.youtube.com/watch?v=LPec-KIBVeI

License

This project is dual licensed with GPLv2+ and MIT license. See the license files in the source code for more details.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap