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

jquery-tabby

v0.13.1

Published

A jQuery plugin that allows usage of the tab key to indent and outdent text within a textarea.

Downloads

129

Readme

Tabby

This jQuery plugin is by Ted Devito, originally found at http://teddevito.com/demos/textarea.html.

(Update: His website is gone now, but the Internet Archive has a copy, and remarkably, I also had the foresight to include the original page within this repository before his site disappeared.)

There did not seem to be a GitHub repo for it yet, so I made one.

This is also an npm module, available as jquery-tabby.

Purpose

Ted:

The "Tabby" Javascript jQuery plugin … [allows use of the Tab key] in regular textareas to make them suitable for in-browser coding [in] languages like HTML, CSS, Javascript, or your favorite server-side language. The idea is to be able to use a press of the TAB button or SHIFT+TAB to indent or outdent your code.

It works pretty well for Markdown editors, too.

Usage

Can’t be any simpler:

	$('.my-textarea').tabby();

To use e.g. four spaces instead of the default tab character:

	var tabby_opts = {tabString:'    '};
	$('.my-textarea').tabby(tabby_opts);

Demo

Please see Ted’s demo here.

Differences from original

I made a small change to better support alternate tag strings besides the actual tab character \t (e.g. four spaces).

Kind contributors have also provided patches here on GitHub, such as better window.setTimeout calls.

Caveats / Issues

  1. Outdenting will not work if there are (hard) tab characters used but tabby was initialized with a number of spaces as the tabString (i.e. soft tabs), and vice-versa. You should probably standardize input to your preferred tab string (soft or hard tabs) before presenting a Tabby-enabled textarea to your users.

  2. Sometimes the selection can change slightly (e.g. grow to include a previous line) when outdenting. Pull requests are welcome!

Bookmarklet

Grab the bookmarklet here.

See Also

For a description of the problem and how this solution is implemented, please see Ted’s original description.