MooIndent 1.1

A class that allows you to use tab, shift-tab, and return to indent text in a textarea. Just create a new instance of the class as seen below, and the textarea will be given the power of indentation through tabs in the following ways

*tab: hitting tab will insert a tab

*Select text, press tab: This will shift the text lines selected over by one tab

*Select text, press shift-tab: This will unshift the text lines selected over by one tab

*return: if the line you are on is indented when you hit return, the next line will also be indented, by the same amount.



Details

Author
Adam Meyer
Current version
1.1
GitHub
ameyer/MooIndent
Downloads
4602
Category
Interface
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.2.4:
  • more/1.2.4:

How to use

You just need this one line of JavaScript code. The ID must be the element ID of a textarea (as seen below)

var indentor = new MooIndent($('textAreaID'));

<textarea id="textAreaID"></textarea>

General Info

Tabs are actual tabs, not spaces. If the line you are on is indented with spaces, this will convert 4 spaces to a tab if you either tab or untab a line.


Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus