mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
readme updated
This commit is contained in:
@ -22,6 +22,28 @@ dialogs.prompt("Some message", "Default text for the input", {
|
|||||||
title: "My custom title", okButtonText: "Yes",
|
title: "My custom title", okButtonText: "Yes",
|
||||||
cancelButtonText: "No", neutralButtonText: "Not sure", inputType: dialogs.InputType.Password
|
cancelButtonText: "No", neutralButtonText: "Not sure", inputType: dialogs.InputType.Password
|
||||||
}).then(function (r) { dialogs.alert("Boolean result: " + r.result + ", entered text: " + r.text); });
|
}).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:
|
Custom dialogs:
|
||||||
```js
|
```js
|
||||||
|
Reference in New Issue
Block a user