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

cxdialog

v2.0.0

Published

JavaScript Dialog plugins.

Downloads

4

Readme

cxDialog

cxDialog 是基于 JavaScript 的对话框插件,支持自定义外观样式。

Demo: https://ciaoca.github.io/cxDialog/

从 v2.0 开始,已移除 jQuery 的依赖,如果需要使用旧版,可查看 v1 分支

安装方法

浏览器端引入

<link rel="stylesheet" href="cxdialog.css">
<script src="cxdialog.js"></script>

从 NPM 安装,作为模块引入

npm install cxdialog
import 'cxdialog.css';
import cxDialog from 'cxdialog';

使用

// 简易的方式
cxDialog('内容');

cxDialog('内容', () => {
  // click ok callback
}, () => {
  // click no callback
});

// 传入参数
cxDialog({
  title: '标题',
  info: '内容',
  ok: () => {},
  no: () => {}
});

设置默认参数

cxDialog.defaults.title = '提示';

参数说明

名称|类型|默认值|说明 ---|---|---|--- title|string|''|标题 info|stringelement|''|内容,可设置为文本内容,或 DOM 元素 ok|function|undefined|确认按钮回调函数※ 值为 function 类型时,才会显示对应按钮 no|function|undefined|取消按钮回调函数 okText|string|'确 定'|确认按钮文字 noText|string|'取 消'|取消按钮文字 buttons|array|[]|自定义按钮 baseClass|string|''|追加样式名称,不会覆盖默认的 class maskClose|boolean|true|是否允许点击遮罩层关闭对话框

buttons 参数

cxDialog({
  info: '内容',
  buttons: [
    {
      text:'按钮1',
      callback: () => {}
    },
    {
      text:'按钮2',
      callback: () => {}
    }
  ]
});

名称|类型|说明 ---|---|--- text|string|按钮文字 callback|function|回调函数

API 接口

cxDialog.close();

名称|说明 ---|--- close|关闭对话框