Skip to content

Commit

Permalink
add chinese pinyin and wubi input support
Browse files Browse the repository at this point in the history
  • Loading branch information
atoponce committed Aug 11, 2017
1 parent 19a0c0c commit 1b3e86b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ <h1>Passphrase and Password Generator</h1>
<option name="diceware_list" onclick="load_js('diceware');">Beale</option>
<!--option name="diceware_list" onclick="load_js('diceware');">Bulgarian</option-->
<option name="diceware_list" onclick="load_js('diceware');">Catalan</option>
<option name="diceware_list" onclick="load_js('diceware');">Chinese (Pinyin)</option>
<option name="diceware_list" onclick="load_js('diceware');">Chinese (Wubi)</option>
<option name="diceware_list" onclick="load_js('diceware');">Czech</option>
<option name="diceware_list" onclick="load_js('diceware');">Danish</option>
<option name="diceware_list" onclick="load_js('diceware');">Dutch</option>
Expand Down
1 change: 1 addition & 0 deletions lists/pinyin.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lists/wubi.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ function generate_passphrase(source) {
if (s_list == "Distant Words") { file = "eff_distant"; }
else if (s_list == "Long Words") { file = "eff_long"; }
else if (s_list == "Short Words") { file = "eff_short"; }
else if (s_list == "Chinese (Pinyin)") { file = "pinyin"; }
else if (s_list == "Chinese (Wubi)") { file = "wubi"; }
else file = s_list.toLowerCase();

if (!wordlists.hasOwnProperty(s_list)) {
Expand All @@ -81,7 +83,6 @@ function generate_passphrase(source) {
case 'alternate': generate_alternate(wordlists[s_list]); break;
}
}

}

function load_js(script_obj, source) {
Expand All @@ -95,6 +96,8 @@ function load_js(script_obj, source) {
case "Bitcoin": wordlists[s_list] = bitcoin_wordlist; break;
case "Bulgarian": wordlists[s_list] = bulgarian_wordlist; break;
case "Catalan": wordlists[s_list] = catalan_wordlist; break;
case "Chinese (Pinyin)": wordlists[s_list] = pinyin_wordlist; break;
case "Chinese (Wubi)": wordlists[s_list] = wubi_wordlist; break;
case "Czech": wordlists[s_list] = czech_wordlist; break;
case "Danish": wordlists[s_list] = danish_wordlist; break;
case "Distant Words": wordlists[s_list] = eff_distant; break;
Expand Down

0 comments on commit 1b3e86b

Please sign in to comment.