Files
rappaurio-sae501_502/app/node_modules/cejs/_documents/JsDoc/symbols/src/D__USB_cgi-bin_lib_JS_data_code_API.origin.js.html
2023-09-25 13:27:24 +02:00

647 lines
95 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="TOKN"></span><span class="WHIT">
<span class='line'> 2</span> </span><span class="COMM">/**
<span class='line'> 3</span> * @name CeL function for API
<span class='line'> 4</span> * @fileoverview
<span class='line'> 5</span> * 本檔案包含了 include API 專用的 functions。
<span class='line'> 6</span> * @since 2010/6/20 13:28:50
<span class='line'> 7</span> */</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="COMM">/*
<span class='line'> 10</span>
<span class='line'> 11</span> */</span><span class="WHIT">
<span class='line'> 12</span>
<span class='line'> 13</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">CeL</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="NAME">CeL.setup_module</span><span class="PUNC">(</span><span class="STRN">'data.code.API'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">library_namespace</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">load_arguments</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 16</span>
<span class='line'> 17</span>
<span class='line'> 18</span> </span><span class="COMM">// nothing required</span><span class="WHIT">
<span class='line'> 19</span>
<span class='line'> 20</span>
<span class='line'> 21</span> </span><span class="COMM">/**
<span class='line'> 22</span> * null module constructor
<span class='line'> 23</span> * @class 相容性 test 專用的 functions
<span class='line'> 24</span> */</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="COMM">// null module constructor</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span>
<span class='line'> 30</span> </span><span class="COMM">/**
<span class='line'> 31</span> * for JSDT: 有 prototype 才會將之當作 Class
<span class='line'> 32</span> */</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="PUNC">.</span><span class="NAME">prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span>
<span class='line'> 37</span>
<span class='line'> 38</span>
<span class='line'> 39</span>
<span class='line'> 40</span>
<span class='line'> 41</span> </span><span class="COMM">/* 2008/5/29 20:6:23-6/4 2:10:21
<span class='line'> 42</span> 7/3 13:34 showNeighbor: 可拖曳 loc->name/address, 有資料的提高優先權, bug fix: 有些太遠的還是會被列入, 有些近的可能因為不是住址而不會被列入
<span class='line'> 43</span> 7/9 13:9:15 context menu
<span class='line'> 44</span> 7/9 21:12:3 getLocations
<span class='line'> 45</span> 2009/7/20 20:27:58 稍作修正
<span class='line'> 46</span>
<span class='line'> 47</span>
<span class='line'> 48</span> bug:
<span class='line'> 49</span> 名稱相同時會出現被覆蓋的情況!
<span class='line'> 50</span>
<span class='line'> 51</span>
<span class='line'> 52</span> TO TEST:
<span class='line'> 53</span>
<span class='line'> 54</span>
<span class='line'> 55</span> showClass.setRepository('_ev_');
<span class='line'> 56</span>
<span class='line'> 57</span> sC=showClass.showOnScope;
<span class='line'> 58</span>
<span class='line'> 59</span> sC('mp',GLog.write);
<span class='line'> 60</span>
<span class='line'> 61</span> sC('Fb','mp');
<span class='line'> 62</span>
<span class='line'> 63</span> sC('y','Fb');
<span class='line'> 64</span>
<span class='line'> 65</span> sC('A','y');
<span class='line'> 66</span>
<span class='line'> 67</span>
<span class='line'> 68</span> to use:
<span class='line'> 69</span>
<span class='line'> 70</span> &lt;script type="text/javascript" src="map.js">&lt;/script>
<span class='line'> 71</span> &lt;script type="text/javascript">//&lt;![CDATA[
<span class='line'> 72</span> wAPIcode('Gmap');
<span class='line'> 73</span> //]]>&lt;/script>
<span class='line'> 74</span>
<span class='line'> 75</span>
<span class='line'> 76</span> TODO:
<span class='line'> 77</span> 分類(Categories)&分顏色顯示
<span class='line'> 78</span> Auto Zoom Out http://esa.ilmari.googlepages.com/sorry.htm
<span class='line'> 79</span> search data only
<span class='line'> 80</span> preload map & markers
<span class='line'> 81</span> GDirections
<span class='line'> 82</span> 圈選
<span class='line'> 83</span> 用經緯度查詢
<span class='line'> 84</span>
<span class='line'> 85</span> c.f. http://jmaps.digitalspaghetti.me.uk/
<span class='line'> 86</span>
<span class='line'> 87</span> http://www.ascc.sinica.edu.tw/nl/90/1706/02.txt
<span class='line'> 88</span> 臺灣地區地名網站
<span class='line'> 89</span> http://tgnis.ascc.net
<span class='line'> 90</span> http://placesearch.moi.gov.tw/index_tw.php
<span class='line'> 91</span>
<span class='line'> 92</span> 地名學名詞解釋彙編
<span class='line'> 93</span> http://webgis.sinica.edu.tw/geo/Termquery.asp
<span class='line'> 94</span>
<span class='line'> 95</span> 臺灣地區地名相關文獻查詢系統
<span class='line'> 96</span> http://webgis.sinica.edu.tw/geo/reference.html
<span class='line'> 97</span>
<span class='line'> 98</span> 經濟部中央地質調查所-地質資料整合查詢
<span class='line'> 99</span> http://datawarehouse.moeacgs.gov.tw/geo/index/GISSearch/MSDefault.htm
<span class='line'>100</span>
<span class='line'>101</span>
<span class='line'>102</span> http://gissrv3.sinica.edu.tw/tgnis_query/link.php?cid=1
<span class='line'>103</span> http://www.edu.geo.ntnu.edu.tw/modules/wordpress/2008/06/08/yxaewaweaeobmh/
<span class='line'>104</span>
<span class='line'>105</span>
<span class='line'>106</span> http://gissrv3.sinica.edu.tw/search/left2_detail.php?d_number=1&d_database=25k_2002
<span class='line'>107</span> http://gissrv3.sinica.edu.tw/search/left2_detail.php?d_number=1085&d_database=5000_1
<span class='line'>108</span> http://gissrv3.sinica.edu.tw/search/left2_detail.php?d_number=01663&d_database=chen_quo
<span class='line'>109</span> http://gissrv3.sinica.edu.tw/search/left2_detail.php?d_number=1663&d_database=chen_jen
<span class='line'>110</span> http://gissrv3.sinica.edu.tw/search/left2_detail.php?d_number=11880&d_database=tw_fort
<span class='line'>111</span> http://gissrv3.sinica.edu.tw/search/left2_detail.php?d_number=02713&d_database=ching
<span class='line'>112</span>
<span class='line'>113</span> http://gissrv3.sinica.edu.tw/input/detail.php?input_id=45875
<span class='line'>114</span>
<span class='line'>115</span> 資料庫 編號 類型(類別) 名稱 地理座標(經緯度) 所屬縣市鄉鎮(所屬行政區,地點) 別稱 註記(所在圖號) 意義(說明)
<span class='line'>116</span>
<span class='line'>117</span>
<span class='line'>118</span>
<span class='line'>119</span> http://www.isp.tw/zip.php
<span class='line'>120</span>
<span class='line'>121</span> 小工具
<span class='line'>122</span>
<span class='line'>123</span> 1.溫度轉換
<span class='line'>124</span> 2.進位換算
<span class='line'>125</span> 3.BMI值及熱量需求計算
<span class='line'>126</span> 4.角度徑度換算
<span class='line'>127</span> 5.度量衡計算
<span class='line'>128</span> 6.區碼國碼查詢
<span class='line'>129</span> 7.郵遞區號查詢
<span class='line'>130</span> 8.金融機構代號查詢
<span class='line'>131</span> 9.色彩表示法查詢
<span class='line'>132</span> 10.摩斯密碼及字母述語
<span class='line'>133</span> 11.生肖星座查詢
<span class='line'>134</span> 12.婦女安全期計算
<span class='line'>135</span> 13.花言花語查詢
<span class='line'>136</span> 14.常用機關電話查詢
<span class='line'>137</span> 15.航空公司機場代碼查詢
<span class='line'>138</span> 16.簡易匯率換算
<span class='line'>139</span> 17.國曆農曆換算
<span class='line'>140</span> 18.急救及疾病忌口寶典
<span class='line'>141</span> 19.尺碼對照表
<span class='line'>142</span> 20.自訂公式計算
<span class='line'>143</span> 21.股票投資組合管理
<span class='line'>144</span>
<span class='line'>145</span>
<span class='line'>146</span> */</span><span class="WHIT">
<span class='line'>147</span>
<span class='line'>148</span>
<span class='line'>149</span>
<span class='line'>150</span>
<span class='line'>151</span> </span><span class="COMM">/* 初始化 Google Gears
<span class='line'>152</span> http://code.google.com/apis/gears/gears_init.js
<span class='line'>153</span> http://blog.ericsk.org/archives/978
<span class='line'>154</span> http://chuiwenchiu.spaces.live.com/blog/cns!CA5D9227DF9E78E8!1063.entry
<span class='line'>155</span>
<span class='line'>156</span> Google Gears退休: Gears功能正被整合到HTML5規格中
<span class='line'>157</span> we expect developers to use HTML5 for these features moving forward as it's a standards-based approach that will be available across all browsers.
<span class='line'>158</span> http://it.solidot.org/article.pl?sid=09/12/03/0539248
<span class='line'>159</span> */</span><span class="WHIT">
<span class='line'>160</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">init_Google_Gears</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="COMM">// 檢查是否已經定義 Google Gear</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.google</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">google.gears</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span>
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">factory</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="COMM">// 依據不同的瀏覽器,採用不同方式產生 GearFactory</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">GearsFactory</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="COMM">// Firefox</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="NAME">factory</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">GearsFactory</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="COMM">// IE</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="NAME">factory</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">'Gears.Factory'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="COMM">// privateSetGlobalObject is only required and supported on WinCE.</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">factory.getBuildInfo</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">indexOf</span><span class="PUNC">(</span><span class="STRN">'ie_mobile'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="NAME">factory.privateSetGlobalObject</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="COMM">// Safari</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">navigator.mimeTypes</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">navigator.mimeTypes</span><span class="PUNC">[</span><span class="STRN">"application/x-googlegears"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="NAME">factory</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"object"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">factory.style.display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="NAME">factory.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">factory.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="NAME">factory.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"application/x-googlegears"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">document.documentElement.appendChild</span><span class="PUNC">(</span><span class="NAME">factory</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">factory</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>190</span>
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">window.google</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="NAME">window.google</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">google.gears</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="NAME">google.gears</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">factory</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">factory</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>197</span>
<span class='line'>198</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>199</span>
<span class='line'>200</span>
<span class='line'>201</span> </span><span class="COMM">/*
<span class='line'>202</span> f={catch:true/false/update, restore:false/true.}
<span class='line'>203</span> */</span><span class="WHIT">
<span class='line'>204</span> </span><span class="NAME">catchFile.ls</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// localServer</span><span class="WHIT">
<span class='line'>205</span> </span><span class="NAME">catchFile.sn</span><span class="PUNC">=</span><span class="STRN">'catch-files'</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// storeName: 定義 Managed Store 的名稱,這個名稱可用於 createManagedStore, removeManagedStore 和 openManagedStore 三個 API</span><span class="WHIT">
<span class='line'>206</span> </span><span class="NAME">catchFile.s</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// managed store</span><span class="WHIT">
<span class='line'>207</span> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>208</span> </span><span class="NAME">catchFile.f</span><span class="PUNC">=</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">,</span><span class="NAME">success</span><span class="PUNC">,</span><span class="NAME">captureId</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>209</span> </span><span class="NAME">catchFile.fL</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="NAME">location.pathname</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// file list</span><span class="WHIT">
<span class='line'>210</span> </span><span class="NAME">catchFile.doCache</span><span class="PUNC">=</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>211</span> </span><span class="NAME">catchFile.noAsk</span><span class="PUNC">=</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>212</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">catchFile</span><span class="PUNC">(</span><span class="NAME">fList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">f</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_f</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments.callee</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_f.doCache</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span>
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.location.protocol</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'file:'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="NAME">sl</span><span class="PUNC">(</span><span class="STRN">'catchFile: Google Gears 不能在本機上執行或測試!'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>221</span>
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">init_Google_Gears</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_f.answered</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="NAME">_f.answered</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_f.noAsk</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">confirm</span><span class="PUNC">(</span><span class="STRN">'使用本功能必須安裝 Google Gears請問您要安裝嗎'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="COMM">// ?action=install&message=加入你的訊息&return=安裝後要導回的網址</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="NAME">window.location.href</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'http://gears.google.com/'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="NAME">sl</span><span class="PUNC">(</span><span class="STRN">'&lt;em>catchFile: 若不安裝 Google Gears 則將無法使用本功能!&lt;/em>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>233</span>
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_f.ls</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="COMM">// 建立 Local Server</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT"> </span><span class="NAME">_f.ls</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.google.gears.factory.create</span><span class="PUNC">(</span><span class="STRN">'beta.localserver'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="STRN">'1.0'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="NAME">sl</span><span class="PUNC">(</span><span class="STRN">'catchFile: Could not create local server: ['</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.number</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">0xFFFF</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>244</span>
<span class='line'>245</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_f.s</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="COMM">// 建立儲存空間</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="NAME">_f.s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_f.ls.createManagedStore</span><span class="PUNC">(</span><span class="NAME">_f.sn</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT"> </span><span class="NAME">_f.s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_f.ls.createStore</span><span class="PUNC">(</span><span class="NAME">_f.sn</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.location.protocol</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'file:'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT"> </span><span class="NAME">sl</span><span class="PUNC">(</span><span class="STRN">'Google Gears 不能在本機上執行測試!'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="NAME">sl</span><span class="PUNC">(</span><span class="STRN">'catchFile: Could not create managed store: ['</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.number</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">0xFFFF</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>258</span>
<span class='line'>259</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">fList</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">fList</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT"> </span><span class="COMM">// TODO: untested!!</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT"> </span><span class="COMM">// 指定 json 的 url</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT"> </span><span class="NAME">_f.s.manifestUrl</span><span class="PUNC">(</span><span class="NAME">fList</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT"> </span><span class="COMM">// 開始確定版本及同步</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT"> </span><span class="NAME">_f.s.checkForUpdate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>265</span>
<span class='line'>266</span> </span><span class="WHIT"> </span><span class="COMM">// 為了確認是否同步結束了,可以加入下列的 timer 來檢查:</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">timer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">google.gears.factory.create</span><span class="PUNC">(</span><span class="STRN">'beta.timer'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT"> </span><span class="COMM">// 每 500ms 檢查一下</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">timerId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">timer.setInterval</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT"> </span><span class="COMM">// 同步完成</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">store.currentVersion</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="NAME">timer.clearInterval</span><span class="PUNC">(</span><span class="NAME">timerId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT"> </span><span class="NAME">sl</span><span class="PUNC">(</span><span class="STRN">'同步完成'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">500</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">fList</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">fList.length</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="NAME">_f.fL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_f.fL.concat</span><span class="PUNC">(</span><span class="NAME">fList</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>278</span>
<span class='line'>279</span> </span><span class="WHIT"> </span><span class="COMM">// If the store already exists, it will be opened</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_f.s</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT"> </span><span class="NAME">_f.s.capture</span><span class="PUNC">(</span><span class="NAME">_f.fL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">_f.f</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.message</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'Url is not from the same origin'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="NAME">sl</span><span class="PUNC">(</span><span class="STRN">'需要在同樣的 domain!'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT"> </span><span class="NAME">sl</span><span class="PUNC">(</span><span class="STRN">'catchFile: Could not capture file: ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.number</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">0xFFFF</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>291</span>
<span class='line'>292</span> </span><span class="COMM">/*
<span class='line'>293</span> // uncapture
<span class='line'>294</span> for ( var i = 0; i &lt; fList.length; i++) {
<span class='line'>295</span> _f.s.remove(fList[i]);
<span class='line'>296</span> }
<span class='line'>297</span> // removeStore
<span class='line'>298</span> if (localServer.openStore(storeName)) {
<span class='line'>299</span> localServer.removeStore(storeName);
<span class='line'>300</span> _f.s = null;
<span class='line'>301</span> }
<span class='line'>302</span> */</span><span class="WHIT">
<span class='line'>303</span>
<span class='line'>304</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>305</span>
<span class='line'>306</span>
<span class='line'>307</span>
<span class='line'>308</span> </span><span class="COMM">/* http://blog.wctang.info/2007/07/use-google-map-api-without-api-key.html
<span class='line'>309</span> 驗證的程式叫 GValidateKey是定義在 main.js但呼叫的動作是寫在 maps.js 裡
<span class='line'>310</span>
<span class='line'>311</span>
<span class='line'>312</span>
<span class='line'>313</span> function showClass(c, n) {
<span class='line'>314</span> var i, sp = '&lt;hr style="width:40%;float:left;"/>&lt;br style="clear:both;"/>', h = '&lt;span style="color:#bbb;font-size:.8em;">', p = function(
<span class='line'>315</span> m, p) {
<span class='line'>316</span> sl(h + n + (p ? '.prototype' : '') + '.&lt;/span>&lt;em>' + m + '&lt;/em> ' + h
<span class='line'>317</span> + '=&lt;/span> ' + f(c[m]));
<span class='line'>318</span> }, f = function(f) {
<span class='line'>319</span> return (f + '').replace(/\n/g, '&lt;br/>').replace(/ /g, '&nbsp;');
<span class='line'>320</span> };
<span class='line'>321</span> if (typeof c == 'string') {
<span class='line'>322</span> if (!n)
<span class='line'>323</span> n = c;
<span class='line'>324</span> c = eval(c);
<span class='line'>325</span> }
<span class='line'>326</span> if (!n)
<span class='line'>327</span> n = '';
<span class='line'>328</span> sl('&lt;hr/>Show class: (' + (typeof c) + ')'
<span class='line'>329</span> + (n ? ' [&lt;em>' + n + '&lt;/em>]' : '') + '&lt;br/>'
<span class='line'>330</span> // +(n?'&lt;em>'+n+'&lt;/em> '+h+'=&lt;/span> ':'')
<span class='line'>331</span> + f(c));
<span class='line'>332</span> if (c) {
<span class='line'>333</span> sl(sp + 'class member:');
<span class='line'>334</span> for (i in c)
<span class='line'>335</span> if (i != 'prototype')
<span class='line'>336</span> p(i);
<span class='line'>337</span> sl(sp + 'prototype:');
<span class='line'>338</span> c = c.prototype;
<span class='line'>339</span> for (i in c)
<span class='line'>340</span> p(i, 1);
<span class='line'>341</span> }
<span class='line'>342</span> sl('&lt;hr/>');
<span class='line'>343</span> }
<span class='line'>344</span>
<span class='line'>345</span> //showClass('GValidateKey');
<span class='line'>346</span>
<span class='line'>347</span> _v = {};
<span class='line'>348</span> eval('_v.lp=lp;', GValidateKey);
<span class='line'>349</span> //showClass(_v.lp,'lp');
<span class='line'>350</span>
<span class='line'>351</span> eval('_v.j=j;', GValidateKey);
<span class='line'>352</span> //showClass(_v.j,'j');
<span class='line'>353</span>
<span class='line'>354</span> eval('_v.ep=ep;', GValidateKey);
<span class='line'>355</span> showClass(_v.ep, 'ep');
<span class='line'>356</span>
<span class='line'>357</span> //sl(_v.lp('http:', 'lyrics.meicho.com.tw', '/game/index.htm').join('&lt;br/>'));
<span class='line'>358</span>
<span class='line'>359</span> var b = _v.lp('http:', 'lyrics.meicho.com.tw', '/game/index.htm');
<span class='line'>360</span> for ( var c = 0; c &lt; b.length; ++c) {
<span class='line'>361</span> var d = b[c];
<span class='line'>362</span> sl(d + '; ' + _v.ep(d));
<span class='line'>363</span> }
<span class='line'>364</span>
<span class='line'>365</span> */</span><span class="WHIT">
<span class='line'>366</span>
<span class='line'>367</span>
<span class='line'>368</span>
<span class='line'>369</span>
<span class='line'>370</span>
<span class='line'>371</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>372</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>373</span> </span><span class="COMM">/**
<span class='line'>374</span> * 自動挑選 domain
<span class='line'>375</span> * @param API API name
<span class='line'>376</span> * @param callback null: do NOT load
<span class='line'>377</span> * @return [ API url, API key ]
<span class='line'>378</span> * @since 2010/6/20 22:12:23
<span class='line'>379</span> * @see
<span class='line'>380</span> *
<span class='line'>381</span> */</span><span class="WHIT">
<span class='line'>382</span> </span><span class="NAME">use_API</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">API</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>383</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_.use_API</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT"> </span><span class="NAME">url_set</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_s.API_URL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.location</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT"> </span><span class="NAME">key_set</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_s.API_key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">API_key</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>386</span>
<span class='line'>387</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">library_namespace.is_Array</span><span class="PUNC">(</span><span class="NAME">url_set</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">url_set</span><span class="PUNC">[</span><span class="NAME">API</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">url_set</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">library_namespace.is_Object</span><span class="PUNC">(</span><span class="NAME">key_set</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">key_set</span><span class="PUNC">[</span><span class="NAME">url_set</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT"> </span><span class="NAME">CeL.err</span><span class="PUNC">(</span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'use_API: The kind of API ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">API</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] is not included in the code pool!'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>393</span>
<span class='line'>394</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">url.protocol</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'file:'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT"> </span><span class="COMM">// 取得任何 legal key</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">url</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">key_set</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">key_set</span><span class="PUNC">[</span><span class="NAME">url</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>400</span>
<span class='line'>401</span> </span><span class="WHIT"> </span><span class="COMM">// this is for domain + path</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT"> </span><span class="COMM">//else if ((url = url.href.replace(/[^\/]+$/, '')) in key_set) ;</span><span class="WHIT">
<span class='line'>403</span>
<span class='line'>404</span> </span><span class="WHIT"> </span><span class="COMM">// this is for domain. 不能用 .pathname: IE 會作特殊處置</span><span class="WHIT">
<span class='line'>405</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="PUNC">(</span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">url.href.match</span><span class="PUNC">(</span><span class="REGX">/^([a-z-]+:\/\/[^\/]+\/)/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">key_set</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>406</span> </span><span class="WHIT"> </span><span class="NAME">CeL.err</span><span class="PUNC">(</span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'use_API: This domain ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] is not included in '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url_set</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' code pool!'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>407</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>408</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>409</span>
<span class='line'>410</span> </span><span class="WHIT"> </span><span class="COMM">//library_namespace.debug('[' + url + ']\n' + key_set[url] + '\n' + location.href + '\n' + location.pathname);</span><span class="WHIT">
<span class='line'>411</span>
<span class='line'>412</span> </span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">url_set</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">(</span><span class="NAME">API_key</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">key_set</span><span class="PUNC">[</span><span class="NAME">url</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">_s.language</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>413</span>
<span class='line'>414</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>415</span> </span><span class="WHIT"> </span><span class="NAME">library_namespace.include_resource</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>416</span> </span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>417</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT">
<span class='line'>418</span> </span><span class="WHIT"> </span><span class="COMM">// 某些舊版 Firefox 使用 createElement('script') 不被接受,因此可能需要用寫的。</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>422</span>
<span class='line'>423</span> </span><span class="WHIT"> </span><span class="NAME">library_namespace.debug</span><span class="PUNC">(</span><span class="STRN">'load ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url_set</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">API</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">': [&lt;a href="'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'">'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'&lt;/a>].'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>425</span>
<span class='line'>426</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">API_key</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>427</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>428</span>
<span class='line'>429</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>430</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>431</span> </span><span class="COMM">/**
<span class='line'>432</span> * 語系. e.g., zh-TW, ja, en
<span class='line'>433</span> */</span><span class="WHIT">
<span class='line'>434</span> </span><span class="NAME">use_API.language</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'zh-TW'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>435</span>
<span class='line'>436</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>437</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>438</span> </span><span class="NAME">use_API.API_key</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT"> </span><span class="NAME">Google</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT"> </span><span class="COMM">/*
<span class='line'>441</span> * 在本機上試用 Google Map API 並不需要去申請 API Key。
<span class='line'>442</span> * 2008/7/15 20:40:49 但幾天前起 GClientGeocoder 需要。而在 Firefox即使在 file:// 也不可行??
<span class='line'>443</span> */</span><span class="WHIT">
<span class='line'>444</span>
<span class='line'>445</span> </span><span class="WHIT"> </span><span class="COMM">/*
<span class='line'>446</span> // by account fan0123321
<span class='line'>447</span> 'http://lyrics.meicho.com.tw/' : 'ABQIAAAAx1BFd-K0IXzdNnudsKfW3BR_OWH2p1vlzGygO-LFq-ywbfjcNBQ4wJpNt5E4VTHG4JLZ_HX8LQxVEQ',
<span class='line'>448</span> 'https://lyrics.meicho.com.tw/' : 'ABQIAAAAx1BFd-K0IXzdNnudsKfW3BQ2grkpcb8ONU70KrnysR7Wz3iAOhQ7rov77Kc_pTW2t8r5-BSiIg5j6w',
<span class='line'>449</span> 'http://kanashimi.meicho.com.tw/' : 'ABQIAAAAx1BFd-K0IXzdNnudsKfW3BSETOz6DhT-d0fFy_mIERGWK3ymyxQKcydi2zFol0W_QslvBsxp3BffQQ',
<span class='line'>450</span> 'https://kanashimi.meicho.com.tw/' : 'ABQIAAAAx1BFd-K0IXzdNnudsKfW3BTFY8WBNAy3k9U7ZNA5kvqHv9VA-BSzdXmlU2Sm9WU6hvuSysY85kLdGw',
<span class='line'>451</span> */</span><span class="WHIT">
<span class='line'>452</span>
<span class='line'>453</span> </span><span class="WHIT"> </span><span class="COMM">// by account cedegree</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT"> </span><span class="COMM">// AJAX Search API Key: http://code.google.com/intl/zh-TW/apis/ajaxsearch/signup.html</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT"> </span><span class="STRN">'http://meicho.com.tw/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'ABQIAAAA8YsRfLuORC22bc07JTNYsBS3JAeykUxPSpDNfPvIbcz6s5aBrRRdn1nyUM_9cYox7ymS-IgI-2CNuA'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>456</span> </span><span class="WHIT"> </span><span class="STRN">'http://211.22.213.114/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'ABQIAAAA8YsRfLuORC22bc07JTNYsBQ1Uh1TD6YMX-95u9UsztRVu87z9xSXJOXSHjEtKMQm2v4PGPwji5o2oA'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>457</span>
<span class='line'>458</span> </span><span class="WHIT"> </span><span class="COMM">// by account kanasimi</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT"> </span><span class="STRN">'http://lyrics.meicho.com.tw/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'ABQIAAAAgGipxXX8cQ5RHLEVH9TO-RR_OWH2p1vlzGygO-LFq-ywbfjcNBQcZtd9Bp9zMEQhrEtSnBy9_wJQmg'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT"> </span><span class="COMM">// 事實上 domain-key 就夠了。</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT"> </span><span class="COMM">//'http://lyrics.meicho.com.tw/program/map/' : 'ABQIAAAAgGipxXX8cQ5RHLEVH9TO-RQQofoUntuAmbaLi2tPP0I7mS20HxSIGUQ5BPerzSbJB2mFqHQq07idRg',</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT"> </span><span class="STRN">'https://lyrics.meicho.com.tw/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'ABQIAAAAgGipxXX8cQ5RHLEVH9TO-RQ2grkpcb8ONU70KrnysR7Wz3iAOhS24gkxeP-OqUBmABKA7PZQoacWHQ'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT"> </span><span class="STRN">'http://kanashimi.meicho.com.tw/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'ABQIAAAAgGipxXX8cQ5RHLEVH9TO-RSETOz6DhT-d0fFy_mIERGWK3ymyxSPw4AHxgM4dHjkgesM0FKx4ui2BQ'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT"> </span><span class="STRN">'https://kanashimi.meicho.com.tw/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'ABQIAAAAgGipxXX8cQ5RHLEVH9TO-RTFY8WBNAy3k9U7ZNA5kvqHv9VA-BRu-OKx8fvfBtyuqJZfb5PK0HllUQ'</span><span class="WHIT">
<span class='line'>465</span>
<span class='line'>466</span> </span><span class="COMM">/*
<span class='line'>467</span> 事實上 [*.]*.com.tw 用下面這個也行。
<span class='line'>468</span> 'http://com.tw/':'ABQIAAAAgGipxXX8cQ5RHLEVH9TO-RTXVjoday36ta5qc6JGQW5WaWldDhTZrWmq9ZDX6Bhhzgk7MlY9qQXvzA',
<span class='line'>469</span>
<span class='line'>470</span> 對 http://lyrics.meicho.com.tw/game/ 會檢查的:
<span class='line'>471</span> http://lyrics.meicho.com.tw/game/
<span class='line'>472</span> http://lyrics.meicho.com.tw/
<span class='line'>473</span> http://www.lyrics.meicho.com.tw/game/
<span class='line'>474</span> http://www.lyrics.meicho.com.tw/
<span class='line'>475</span> http://meicho.com.tw/game/
<span class='line'>476</span> http://meicho.com.tw/
<span class='line'>477</span> http://com.tw/game/
<span class='line'>478</span> http://com.tw/
<span class='line'>479</span> */</span><span class="WHIT">
<span class='line'>480</span>
<span class='line'>481</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>482</span>
<span class='line'>483</span> </span><span class="WHIT"> </span><span class="NAME">Yahoo</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>484</span> </span><span class="WHIT"> </span><span class="COMM">// by account colorlessecho for Yahoo! map</span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT"> </span><span class="STRN">'http://lyrics.meicho.com.tw/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'XX9YCu_V34G1xvKMy7EOmVkPFtALrHIkVP_qG5ANRAzuTNlQKuoXVssSTBYiGSX9gjssAA--'</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>487</span>
<span class='line'>488</span> </span><span class="WHIT"> </span><span class="NAME">Microsoft</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>489</span> </span><span class="WHIT"> </span><span class="COMM">// by account cedegree@hotmail.com for VLS</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT"> </span><span class="COMM">// http://www.bing.com/developers/</span><span class="WHIT">
<span class='line'>491</span> </span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'BCBE2B0C4E58461B987145E3EBB1BFAB96FBCCD0'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>492</span> </span><span class="WHIT"> </span><span class="STRN">'http://meicho.com.tw/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'BCBE2B0C4E58461B987145E3EBB1BFAB96FBCCD0'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>493</span> </span><span class="WHIT"> </span><span class="STRN">'http://211.22.213.114/'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'BCBE2B0C4E58461B987145E3EBB1BFAB96FBCCD0'</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>495</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>496</span>
<span class='line'>497</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>498</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>499</span> </span><span class="NAME">use_API.API_URL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>500</span> </span><span class="WHIT"> </span><span class="NAME">Gmap</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>501</span> </span><span class="WHIT"> </span><span class="STRN">'Google'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>502</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>503</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'http://maps.google.com/maps?file=api&v=2&hl='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'&key='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>504</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT"> </span><span class="NAME">GAPI</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="STRN">'Google'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'http://www.google.com/jsapi?hl='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'&key='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>508</span>
<span class='line'>509</span> </span><span class="WHIT"> </span><span class="NAME">YMap</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="STRN">'Yahoo'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'http://api.maps.yahoo.com/ajaxymap?v=3.8&appid='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT"> </span><span class="NAME">twYMap</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="STRN">'Yahoo'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'http://tw.api.maps.yahoo.com/ajaxymap?v=3.8&appid='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>515</span>
<span class='line'>516</span> </span><span class="WHIT"> </span><span class="NAME">Bing</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="STRN">'Microsoft'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'http://api.microsofttranslator.com/V1/Ajax.svc/Embed?appId='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>519</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>520</span>
<span class='line'>521</span>
<span class='line'>522</span>
<span class='line'>523</span>
<span class='line'>524</span>
<span class='line'>525</span>
<span class='line'>526</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>527</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>528</span> </span><span class="COMM">/**
<span class='line'>529</span> * 為 Microsoft Translator 設置
<span class='line'>530</span> * @param text test to translate
<span class='line'>531</span> * @param callback callback(from text,to text)
<span class='line'>532</span> * @param [from_enc]
<span class='line'>533</span> * @param [to_enc]
<span class='line'>534</span> * @return
<span class='line'>535</span> * @see
<span class='line'>536</span> * &lt;a href="http://msdn.microsoft.com/en-us/library/ff512406.aspx" accessdate="2010/7/12 20:22">Translate Method&lt;/a>,
<span class='line'>537</span> * &lt;a href="http://www.west-wind.com/Weblog/posts/107136.aspx" accessdate="2010/7/12 20:22">JSONP for cross-site Callbacks - Rick Strahl's Web Log&lt;/a>
<span class='line'>538</span> */</span><span class="WHIT">
<span class='line'>539</span> </span><span class="NAME">add_Microsoft_translate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">from_enc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">to_enc</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>542</span>
<span class='line'>543</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_.add_Microsoft_translate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_s.url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_s.reference_name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT"> </span><span class="COMM">// 初始化 initialization</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">url</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT"> </span><span class="NAME">_s.url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'http://api.microsofttranslator.com/V2/Ajax.svc/Translate?appId='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>547</span> </span><span class="WHIT"> </span><span class="NAME">_.use_API</span><span class="PUNC">(</span><span class="STRN">'Bing'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>548</span>
<span class='line'>549</span> </span><span class="WHIT"> </span><span class="COMM">//library_namespace.debug('&lt;a href="' + url + encodeURIComponent(text) + '">' + url + encodeURIComponent(text) + '&lt;/a>');</span><span class="WHIT">
<span class='line'>550</span>
<span class='line'>551</span> </span><span class="WHIT"> </span><span class="NAME">_s.buffer</span><span class="PUNC">[</span><span class="NAME">count</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_s.counter</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>552</span> </span><span class="WHIT"> </span><span class="COMM">// response, count, function name of add_Microsoft_translate</span><span class="WHIT">
<span class='line'>553</span> </span><span class="WHIT"> </span><span class="NAME">_s</span><span class="PUNC">[</span><span class="STRN">'c'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Function</span><span class="PUNC">(</span><span class="STRN">'r'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>554</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.callback(r,'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">count</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">',"'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'");'</span><span class="WHIT">
<span class='line'>555</span> </span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>556</span> </span><span class="WHIT"> </span><span class="NAME">library_namespace.include_resource</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>557</span> </span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT">
<span class='line'>558</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'&from='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">from_enc</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">_s.from</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>559</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'&to='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">to_enc</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">_s.to</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>560</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'&text='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">encodeURIComponent</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>561</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'&oncomplete='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.c'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>562</span> </span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>563</span> </span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT">
<span class='line'>564</span> </span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>565</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>566</span>
<span class='line'>567</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>568</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>569</span> </span><span class="NAME">add_Microsoft_translate.from</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'en'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>570</span>
<span class='line'>571</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>572</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>573</span> </span><span class="NAME">add_Microsoft_translate.to</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'zh-cht'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>574</span>
<span class='line'>575</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>576</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>577</span> </span><span class="NAME">add_Microsoft_translate.reference_name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">library_namespace.Class</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.add_Microsoft_translate'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>578</span>
<span class='line'>579</span>
<span class='line'>580</span>
<span class='line'>581</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>582</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>583</span> </span><span class="COMM">/**
<span class='line'>584</span> * @inner
<span class='line'>585</span> * @private
<span class='line'>586</span> */</span><span class="WHIT">
<span class='line'>587</span> </span><span class="NAME">add_Microsoft_translate.counter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>588</span>
<span class='line'>589</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>590</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>591</span> </span><span class="COMM">/**
<span class='line'>592</span> * @inner
<span class='line'>593</span> * @private
<span class='line'>594</span> */</span><span class="WHIT">
<span class='line'>595</span> </span><span class="NAME">add_Microsoft_translate.buffer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>596</span>
<span class='line'>597</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ELEMENT_NODE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>598</span>
<span class='line'>599</span> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>600</span> </span><span class="PUNC">.</span><span class="WHIT">
<span class='line'>601</span> </span><span class="COMM">/**
<span class='line'>602</span> * @inner
<span class='line'>603</span> * @private
<span class='line'>604</span> */</span><span class="WHIT">
<span class='line'>605</span> </span><span class="NAME">add_Microsoft_translate.callback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>606</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>607</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">library_namespace.get_various</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>608</span> </span><span class="WHIT"> </span><span class="NAME">origin</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_s.buffer</span><span class="PUNC">[</span><span class="NAME">count</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>609</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">origin</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>610</span> </span><span class="WHIT"> </span><span class="NAME">origin</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">origin</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">_s.buffer</span><span class="PUNC">[</span><span class="NAME">count</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>612</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">_s</span><span class="PUNC">[</span><span class="STRN">'c'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>613</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">origin</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="WHIT">
<span class='line'>619</span> </span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">callback.nodeType</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">ELEMENT_NODE</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>620</span> </span><span class="WHIT"> </span><span class="NAME">callback.appendChild</span><span class="PUNC">(</span><span class="NAME">document.createTextNode</span><span class="PUNC">(</span><span class="NAME">response</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>622</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>623</span> </span><span class="WHIT"> </span><span class="NAME">library_namespace.warn</span><span class="PUNC">(</span><span class="STRN">'add_Microsoft_translate.callback: '</span><span class="PUNC">+</span><span class="NAME">name</span><span class="PUNC">+</span><span class="STRN">': error!'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>625</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>626</span>
<span class='line'>627</span>
<span class='line'>628</span>
<span class='line'>629</span>
<span class='line'>630</span>
<span class='line'>631</span>
<span class='line'>632</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>633</span> </span><span class="WHIT"> </span><span class="NAME">CeL.data.code.API</span><span class="WHIT">
<span class='line'>634</span> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>635</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>636</span>
<span class='line'>637</span>
<span class='line'>638</span> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>639</span>
<span class='line'>640</span> </span></pre></body></html>