// Copyright (c) 2013 Keith Perhac @ DelfiNet (http://delfi-net.com) // // Based on the AutoRuby library created by: // Copyright (c) 2005-2008 spinelz.org (http://script.spinelz.org/) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. !function(n){n.fn.autoKana=function(e,a,t){function i(n){if(!y)if(Math.abs(values.length-n.length)>1){var e=n.join("").replace(x,"").split("");Math.abs(values.length-e.length)>1&&b()}else values.length==K.length&&values.join("")!=K&&b()}function r(){var n,e;if(n=j.val(),""==n)h(),v();else{if(n=g(n),K==n)return;K=n,y||(e=n.replace(w,"").split(""),i(e),v(e))}}function l(){clearInterval(m)}function u(){l()}function o(){p(),s()}function f(){y&&p()}function c(n){return n>=12353&&12435>=n||12445==n||12446==n}function g(n){if(n.match(ignoreString))return n.replace(ignoreString,"");var e,a,t;for(a=ignoreString.split(""),t=n.split(""),e=0;e