From 2e08141fffb8de9790b42a44208e2f44d50beed5 Mon Sep 17 00:00:00 2001 From: Marak Date: Mon, 15 Sep 2014 04:02:14 +0200 Subject: [examples] Added drop down for locale selection --- examples/index.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'examples') diff --git a/examples/index.html b/examples/index.html index 3caf325a..eb9daf7f 100644 --- a/examples/index.html +++ b/examples/index.html @@ -35,6 +35,10 @@ $(document).ready(function(e){ + for (var locale in faker.locales) { + $('#locale').append(''); + } + var card = faker.helpers.createCard(); $('#output').html(prettyPrint(card)); @@ -43,6 +47,14 @@ $('#output').html(prettyPrint(card)); }); + + $('#locale').change(function(e){ + var locale = $(this).attr('value'); + faker.locale = locale; + var card = faker.helpers.createCard(); + $('#output').html(prettyPrint(card)); + }); + $('#generateSet').click(function(){ setTimeout(function(){ @@ -65,6 +77,13 @@ Fork me on GitHub +
+
+ locale card count :

protip: open your console on this page and run: console.log(faker); var randomName = faker.name.findName(); console.log(randomName);
-- cgit v1.2.3