npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-password-dialog

v1.2.0

Published

Cordova plugin for showing password prompt dialogs.

Downloads

12

Readme

Password Dialog for Cordova

This is a Cordova plugin for showing password prompt dialogs.

There are currently four dialogs available:

  • User Name And Password
  • Enter Password
  • Confirm Password
  • Change Password

Install

To add the plugin to your Cordova project, simply add the plugin from the npm registry:

cordova plugin add cordova-plugin-password-dialog

Alternatively, you can install the latest version of the plugin directly from git:

cordova plugin add https://github.com/Justin-Credible/cordova-plugin-password-dialog

Usage

The plugin is available via a global variable named PasswordDialogPlugin. It exposes the following properties and functions.

All functions accept optional success and failure callbacks as their final two arguments, where the failure callback will receive an error string as an argument unless otherwise noted.

A TypeScript definition file for the JavaScript interface is available in the typings directory as well as on DefinitelyTyped via the tsd tool.

User Name And Password Dialog

Used to show a dialog that prompts the user to enter a user name and password.

Method Signature:

showEnterUserNameAndPassword(options, successCallback, failureCallback)

Options Parameter:

  • title (string): The title for the dialog (optional, defaults to "Enter Credentials").
  • message (string): The message for the dialog (optional, defaults to empty string).
  • minLength (number): The minimum length for the new password (optional, defaults to not enforcing a minimum length).
  • userNamePlaceholder (string): The placeholder text for the user name text entry (optional, defaults to "user Name" if not provided).
  • defaultUserName (string): The user name value to default into the user name field (optional, defaults to empty string if not provided).

Example Usage:

var options = {
    title: "Enter Credentials",
    message: "Please enter your login credentials.",
    minLength: 8,
    userNamePlaceholder: "User Name",
    defaultUserName: "user123"
};

PasswordDialogPlugin.showEnterUserNameAndPassword(options,
    function(result) {
        if (result.cancel) {
            console.log("User cancelled the enter credentials dialog.");
        }
        else {
            console.log("User completed the enter credentials dialog.", result.password);
        }
    },
    function(err) {
        console.log("Enter password dialog error.", err);
    });

Password Dialog

Used to show a dialog that prompts the user to enter a password.

Method Signature:

showEnterPassword(options, successCallback, failureCallback)

Options Parameter:

  • title (string): The title for the dialog (optional, defaults to "Enter Password").
  • message (string): The message for the dialog (optional, defaults to empty string).
  • minLength (number): The minimum length for the new password (optional, defaults to not enforcing a minimum length).

Example Usage:

var options = {
    title: "Enter Password",
    message: "Please enter your login password.",
    minLength: 8
};

PasswordDialogPlugin.showEnterPassword(options,
    function(result) {
        if (result.cancel) {
            console.log("User cancelled the enter password dialog.");
        }
        else {
            console.log("User completed the enter password dialog.", result.password);
        }
    },
    function(err) {
        console.log("Enter password dialog error.", err);
    });

Confirm Password Dialog

Used to show a dialog that prompts the user to confirm their password. The user must enter their their password twice.

Method Signature:

showConfirmPassword(options, successCallback, failureCallback)

Options Parameter:

  • title (string): The title for the dialog (optional, defaults to "Confirm Password").
  • message (string): The message for the dialog (optional, defaults to empty string).
  • minLength (number): The minimum length for the new password (optional, defaults to not enforcing a minimum length).

Example Usage:

var options = {
    title: "Confirm Password",
    message: "Please confirm your password.",
    minLength: 8
};

PasswordDialogPlugin.showConfirmPassword(options,
    function(result) {
        if (result.cancel) {
            console.log("User cancelled the confirm password dialog.");
        }
        else {
            console.log("User completed the confirm password dialog.", result.password);
        }
    },
    function(err) {
        console.log("Confirm password dialog error.", err);
    });

Change Password Dialog

Used to show a dialog that prompts the user to change their password. The user must enter their current password as well as their new password twice.

Method Signature:

showChangePassword(options, successCallback, failureCallback)

Options Parameter:

  • title (string): The title for the dialog (optional, defaults to "Change Password").
  • message (string): The message for the dialog (optional, defaults to empty string).
  • minLength (number): The minimum length for the new password (optional, defaults to not enforcing a minimum length).

Example Usage:

var options = {
    title: "Change Password",
    message: "Please change your password.",
    minLength: 8
};

PasswordDialogPlugin.showChangePassword(options,
    function(result) {
        if (result.cancel) {
            console.log("User cancelled the change password dialog.");
        }
        else {
            console.log("User completed the change password dialog.", result.currentPassword, result.newPassword);
        }
    },
    function(err) {
        console.log("Change password dialog error.", err);
    });