diff --git a/ui/dialogs/Readme.md b/ui/dialogs/Readme.md index 7aa5eb235..9b05d7081 100644 --- a/ui/dialogs/Readme.md +++ b/ui/dialogs/Readme.md @@ -22,6 +22,28 @@ dialogs.prompt("Some message", "Default text for the input", { title: "My custom title", okButtonText: "Yes", cancelButtonText: "No", neutralButtonText: "Not sure", inputType: dialogs.InputType.Password }).then(function (r) { dialogs.alert("Boolean result: " + r.result + ", entered text: " + r.text); }); + +dialogs.login("Enter your user name and password:").then(function(r) { + dialogs.alert("Result:" + r.result + " User name:" + r.userName + " Password:" + r.password); + }); + +dialogs.login("Enter your user name and password:", "", "", + { + title: "Login", + okButtonText: "Sign In", + cancelButtonText: "Cancel", + neutralButtonText:"Sign Up" + }) + .then(function(r) { + dialogs.alert("Result:" + r.result + " User name:" + r.userName + " Password:" + r.password); + if(r.result) { + // login here + } else if(r.result === false) { + // perform something on cancel if you want + } else if(r.result === "undefined") { + // you can create new user credentials here for example + } + }).fail(function(e){ console.log(e)}); ``` Custom dialogs: ```js