• Stars
    star
    1,135
  • Rank 39,549 (Top 0.9 %)
  • Language
    JavaScript
  • Created almost 11 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create expandable textarea and write large amount of text easily.

Widearea

Lightweight, easy-to-use JavaScript/CSS library to create expandable textarea and write large amount of text easily.

How to use

Really simple. Just include both widearea.js and widearea.css in your page (use minified version for production) and then call this JavaScript function:

wideArea();

See online demo.

API

###wideArea([selector])

Creating a Widearea object.

Available since: v0.1.0

Parameters:

  • selector : String (optional) Should be defined to search for textareas in a specific container

Returns:

  • wideArea object.

Example:

wideArea() //without selector, to search all textarea(s) in the page
wideArea("#writingContainer") //search for textarea(s) only in #writingContainer

###wideArea.setOption(option, value)

Set a single option to wideArea object.

Available since: v0.1.0

Parameters:

  • option : String Option key name.

  • value : String/Number Value of the option.

Returns:

  • wideArea object.

Example:

wideArea().setOption("defaultColorScheme", "dark");

###wideArea.setOptions(options)

Set a group of options to the wideArea object.

Available since: v0.1.0

Parameters:

  • options : Object Object that contains option keys with values.

Returns:

  • wideArea object.

Example:

wideArea().setOptions({ defaultColorScheme: "dark", closeIconLabel: "Exit" });

###wideArea.clearData(value)

Clear the textarea value from localStorage

Available since: v0.3.0

Parameters:

  • value : Object | String | Number This method accept parameter with different types
    1. Object for clearing data using DOM object
    2. String for clearing data using CSS selector
    3. Number for clearing data using the widearea id

Returns:

  • wideArea object.

Example:

wideArea().clearData(1); //clear textarea data with `data-widearea-id` == 1
wideArea().clearData("#first"); //clear textarea data with `#first` selector
wideArea().clearData($("#first")); //get DOM object with jQuery and pass it to clearData()

###Options:

  • wideAreaAttr: Extra attribute name for detecting textareas that uses Widearea, default is data-widearea
  • exitOnEsc: Close Fullscreen mode when pressing Escape, default is true
  • defaultColorScheme: Default color scheme, default is light
  • closeIconLabel: Close icon label, default is Close WideArea.
  • changeThemeIconLabel: Change color scheme icon label, default is Toggle Color Scheme
  • fullScreenIconLabel: Fullscreen mode icon label, default is WideArea Mode
  • autoSaveKeyPrefix: Prefix key for localStorage items

Build

First you should install nodejs and npm, then first run this command: npm install to install all dependencies.

Now you can run this command to minify all static resources:

make build

Roadmap

  • More browser compatibility
  • Provide more examples
  • Add templating option

Release History

  • v0.3.0 - 2013-07-26

    • Add auto-save option for all textareas
    • Bug fixes
  • v0.2.0 - 2013-06-07

    • Basic changes in initiating WideArea
    • Remove WideArea div wrapper
    • Code refactoring
  • v0.1.1 - 2013-05-26

    • Adding tab-key support while typing
    • Fix some bugs in multiple textareas
    • Fix bug when textarea has an existing value
  • v0.1.0 - 2013-05-22

    • First commit.

Author

Afshin Mehrabani

Ehsan Arasteh

License

Copyright (C) 2012 Afshin Mehrabani ([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

intro.js

Lightweight, user-friendly onboarding tour library
TypeScript
22,527
star
2

front-end-frameworks

A collection of best front-end frameworks for faster and easier web development.
2,777
star
3

progress.js

ProgressJs is a JavaScript and CSS3 library which help developers to create and manage progress bar for every objects on the page.
JavaScript
2,372
star
4

kissui.scrollanim

CSS3 scroll animation library
CSS
1,429
star
5

label.css

Just a simply easy way to label each element you want!
Ruby
766
star
6

persian.js

A simple library for Persian language localization.
JavaScript
356
star
7

liaar

Create fake REST API in a minute
Python
201
star
8

motion.js

Motion.js is a easy to use, cross-browser CSS3 library for creating animations in web.
JavaScript
80
star
9

_s

_s: Pythonic array slicing in JavaScript
JavaScript
72
star
10

density

NodeJs module for calculating keyword density in a text/html
JavaScript
45
star
11

lup

Easy to use CSS3 transition manager
JavaScript
40
star
12

doc42

Jekyll-Kissui bundle to create awesome documentations
24
star
13

kissui.position

Track element(s) on the page like a boss.
JavaScript
23
star
14

kissui

💫 Simple, easy to use, modern web development framework
CSS
17
star
15

dummychat

A NodeJS-Socket.IO dummy chat, every client has a dummy and can play with it!
JavaScript
14
star
16

otobox.js

Simple and fast JavaScript/HTML5 library to create autocomplete inputs
JavaScript
14
star
17

semver.ir

Semantic Versioning Specification (Persian)
JavaScript
13
star
18

sourcedoc

Document your code, continuously.
CSS
12
star
19

kissui.sticky

Simple and lightweight sticky position that works everywhere
CSS
11
star
20

introjs-website

Intro.js website and documentation
JavaScript
10
star
21

hello-backbonejs-fa

Tutorial of increasing complexity for Backbone.js, translated to Persian
JavaScript
8
star
22

parserjs

Javascript AST parser
JavaScript
7
star
23

algorithms

Implementation of common algorithms
Rust
4
star
24

localr

Map localhost ports to localr.io
JavaScript
4
star
25

datatube

Javascript library to import, process and export data
JavaScript
2
star
26

readr

News API client in React Native + ES6 version of AYLIEN News API SDK
JavaScript
2
star