Experimenting audioContext for Apple (Safari)
[sgc3.git] / wordlists_plus.js
blobd7a46b6d5d5e5822c9c26a76e38e02334781e4ca
1 /*
2  *      Wordlists added here will be automatically added to the global list 
3  */
4  
5 var wordlists_plus = [
6 // Add your wordlists here like "New Wordlist"
7 //      [
8 //              "New Wordlist", 
9 //              [["ni3hao3","nǐhǎo","你好","hello!","1","wordlists/Test1/bi4.wav"],["qing3wen4","qǐngwèn","请问","May I ask..?","1","-"]]
10 //      ] 
13 global_wordlists = wordlists_plus.concat(global_wordlists);
16  * 
17  * Read wordlists from the wordlists/ subdirectory at the origin
18  * 
19  */
21 // Read all wordlists stored in the wordlists subdirectory
23 function readAllRemoteWordlists (url) {
24         if(!navigator.onLine)return null; // Only when Online
25         var rawFile = new XMLHttpRequest(); 
26         rawFile.overrideMimeType("text/plain");
27         rawFile.open("GET", url, true);
28         rawFile.onreadystatechange = function () {
29                 if(rawFile.readyState === 4) {
30                         if(rawFile.status === 200 || rawFile.status == 0) {
31                                 var allText = rawFile.responseText;
32                                 var wordlistFiles = allText.match(/wordlists\/[^\"\']+/g);
33                                 if (wordlistFiles) {
34                                         for (var u = 0; u < wordlistFiles.length; ++u) {
35                                                 var url = wordlistFiles [u];
36                                                 if (url.match(/\.(Table|tsv|csv)$/)) {
37                                                         readWordlist (url);
38                                                 } else if (!url.match(/\.[^\.]+$/)) {
39                                                         readAllRemoteWordlists (url);
40                                                 };
41                                         };
42                                 };
43                         }
44                 }
45         }
46         rawFile.send(null);