Created
September 28, 2010 14:53
-
-
Save freddiefujiwara/601133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** ime.js.org 2010-09-28 23:46:02.000000000 +0900 | |
--- ime.js 2010-09-28 23:26:53.741986819 +0900 | |
*************** | |
*** 120,125 **** | |
--- 120,126 ---- | |
////////////////////////////////////////////////////////////////////////////////////////// | |
var ImeCGI_ = "http://api.chasen.org/ajaxime/"; | |
+ var GoogleImeCGI_ = "http://kindle-3.appspot.com/api/transliterate?"; | |
var ImeBackGroundColor_ = '#c0c0d0'; | |
var ImeID_ = 0; | |
var ImeCache_ = []; | |
*************** | |
*** 460,469 **** | |
function ImeShowCandidates() { | |
if (!ImeIsHidden()) return; | |
if (ImeRawInput_ == '') ImeRawInput_ = roma2hiragana(ImePreEdit_.value, false); | |
! var request = "action=conv&to=" + ImeTo_ + "&query=" + encodeURI(ImeRawInput_) + | |
! "&id=" + ImeID_; | |
ImeCurrentDocument_ = ImeDocument_; | |
! ImeJsonp_ = new JSONRequest(ImeCGI_ + request); | |
} | |
function ImePreEditKeyDown(event) { | |
--- 461,471 ---- | |
function ImeShowCandidates() { | |
if (!ImeIsHidden()) return; | |
if (ImeRawInput_ == '') ImeRawInput_ = roma2hiragana(ImePreEdit_.value, false); | |
! //var request = "action=conv&to=" + ImeTo_ + "&query=" + encodeURI(ImeRawInput_) + | |
! // "&id=" + ImeID_; | |
! var request = "langpair=ja-Hira|ja&callback=GoogleImeRequestCallback&text=" + encodeURI(ImeRawInput_); | |
ImeCurrentDocument_ = ImeDocument_; | |
! ImeJsonp_ = new JSONRequest(GoogleImeCGI_ + request); | |
} | |
function ImePreEditKeyDown(event) { | |
*************** | |
*** 666,671 **** | |
--- 668,677 ---- | |
ImeChangeModeRecursive(window); | |
} | |
+ function GoogleImeRequestCallback(result) { | |
+ ImeCurrentDocument_.ImeRequestCallback(result[0][1]); | |
+ } | |
+ | |
function ImeRequestCallback(result) { | |
ImeCurrentDocument_.ImeRequestCallback(result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment