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

septcuts

v1.1.2

Published

七天网络快捷下拉框

Downloads

15

Readme

Septcuts npm

七天网络快键菜单

JSON: https://static.7net.cc/septcuts/septcuts.json

Demo: https://static.7net.cc/septcuts/examples/index.html

Getting Started

Install with NPM:


$ npm install --save septcuts

Import into your project:


import Septcuts from 'septcuts'

Usage

	<button class='btn-septcuts'>七天网络</button>

	var septcuts=new Septcuts(".btn-septcuts");

Options

var septcuts = new Septcuts('.btn-septcuts', {
	  //应用列表,默认全部七天全部产品,也可设置为接口地址,如https://static.7net.cc/septcuts/septcuts.json
	  groups: 'https://static.7net.cc/septcuts/septcuts.json',
	  http: { url: 'https://static.7net.cc/septcuts/septcuts.json', method: 'post', header: {}, data: {} },//接口请求,设置groups未设置时,可设置此项
	  cssClass: 'drop-item', //给下拉菜单额外添加的className
	  itemWidth: 180,  //菜单项的宽度,默认180px
	  iconSize: 28,  //菜单icon的大小,默认28px
	  colNum: 3, //一行最多显示几个菜单项,默认3个
	  trigger: 'click',  //弹出菜单的触发方式,默认hover

	  //菜单项的点击事件,配置此项后点击将不执行跳转
	  click: function (item) { 
		//todo
		//
		//
	  },
		//初始化完成后执行,可在此处获取应用列表
	  onInit:function(septcuts){
	   // console.log(septcuts);
	   //测试快发适用,不同环境动态修改url域名,不建议在生产环境继续使用
	   if(DEBUG==true){
			septcuts.groups.forEach(group => {
			group.items.map(item => {
				item.url = item.url.split('.')[0] +
							window.location.hostname.substr(window.location.hostname.indexOf('.')) +
							(item.url.replace('://', '').includes('/') ? (item.url.substr(item.url.replace('://', '')
								.indexOf('/') + 3) || '') : '')
				return item;
			 })
			});
			septcuts.update()
		}
	  }
	})
	septcuts.groups=[{
				"title": "应用平台",
				"items": [
				{ "label": "考试管理", "url": "https://office.7net.cc", "icon": "https://static.7net.cc/septcuts/icons/ksgl.png" },
				{ "label": "阅卷任务", "url": "https://yj.7net.cc", "icon": "https://static.7net.cc/septcuts/icons/yjrw.png" }
				]
			}]; //应用列表
	septcuts.update()//应用列表更新应用列表||septcuts.update([]);
	septcuts.destroy(); //销毁事件

In Browser

	<script src="path/septcuts.min.js"></script>
	var septcuts=new Septcuts(".drop-button");

CDN

	<script src="//static.7net.cc/septcuts/septcuts.min.js"></script>