Skip to content

Instantly share code, notes, and snippets.

@santhoshtr
Created October 24, 2016 01:45
Show Gist options
  • Save santhoshtr/1cb8c14715e3ffba5c14b9bf53c620cd to your computer and use it in GitHub Desktop.
Save santhoshtr/1cb8c14715e3ffba5c14b9bf53c620cd to your computer and use it in GitHub Desktop.
jquery.ime custom language set
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery IME example</title>
<meta name="author" content="Santhosh Thottingal" />
<link href="../css/jquery.ime.css" rel="stylesheet" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/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>
<!-- Demo -->
<link href="demo.css" rel="stylesheet" />
<script>
var imesetup = function () {
$( 'body' ).on( 'focus.ime', 'input, textarea', function () {
var $input = $( this );
$input.ime( {
languages: [ 'en', 'bn', 'ml', 'mr', 'kok', 'ne', 'ta', 'hi', 'he', 'th' ],
// Optional
languageSelector: function () {
return "...";
}
} );
imeselector = $input.data('imeselector');
imeselector.selectLanguage('hi');
imeselector.selectIM('hi-phonetic');
} )
}
$( document ).ready( function () {
imesetup();
} );
</script>
<style>
.wierd li {
color: red;
}
</style>
</head>
<body>
<div>
<header>
<h1>jQuery IME Demo</h1>
</header>
<div>
<input lang='ml' type="text" />
</div>
<div>
<textarea></textarea>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment