( function ( $ ) { 'use strict'; var selectorTemplate, MutationObserver; function IMESelector( element, options ) { this.$element = $( element ); this.options = $.extend( {}, IMESelector.defaults, options ); this.active = false; this.$imeSetting = null; this.$menu = null; this.inputmethod = null; this.timer = null; this.init(); this.listen(); } IMESelector.prototype = { constructor: IMESelector, init: function () { this.prepareSelectorMenu(); this.position(); this.$imeSetting.hide(); }, prepareSelectorMenu: function () { // TODO: In this approach there is a menu for each editable area. // With correct event mapping we can probably reduce it to one menu. this.$imeSetting = $( selectorTemplate ); this.$menu = $( '