mirror of
https://github.com/dmuth/diceware.git
synced 2024-12-22 16:23:42 +00:00
Now doing conditional loading of Javascript based on GET method. #4
This commit is contained in:
parent
6ca25671df
commit
d721364030
1 changed files with 11 additions and 1 deletions
12
main.js
12
main.js
|
@ -522,10 +522,20 @@ Diceware.go = function() {
|
|||
|
||||
var get_data = Diceware.extractGetData(location.search);
|
||||
|
||||
var dice = 5;
|
||||
if (get_data["dice"]) {
|
||||
if (get_data["dice"] >= 5 && get_data["dice"] <= 7) {
|
||||
dice = get_data["dice"];
|
||||
}
|
||||
}
|
||||
|
||||
var js = "./wordlist/wordlist-" + dice + "-dice.js";
|
||||
console.log("Looks like we're loading '" + js + "'!");
|
||||
|
||||
//
|
||||
// Load our wordlist.
|
||||
//
|
||||
jQuery.getScript("./wordlist/wordlist-5-dice.js").done(
|
||||
jQuery.getScript(js).done(
|
||||
function(data) {
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue