undate

WebJar for undate

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

undate
Last Version

Last Version

0.2.4
Release Date

Release Date

Type

Type

jar
Description

Description

undate
WebJar for undate
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/yuku/undate

Download undate

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/undate/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>undate</artifactId>
    <version>0.2.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/undate/
implementation 'org.webjars.npm:undate:0.2.4'
// https://jarcasting.com/artifacts/org.webjars.npm/undate/
implementation ("org.webjars.npm:undate:0.2.4")
'org.webjars.npm:undate:jar:0.2.4'
<dependency org="org.webjars.npm" name="undate" rev="0.2.4">
  <artifact name="undate" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='undate', version='0.2.4')
)
libraryDependencies += "org.webjars.npm" % "undate" % "0.2.4"
[org.webjars.npm/undate "0.2.4"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

undate

Undoable update for HTMLTextAreaElement

NPM version Build Status Code Climate

Install

npm install --save undate

Usage

import {update, wrapCursor} from 'undate';

const textareaElement = document.getElementById('textarea');

textareaElement.value; //=> ''

// Update whole value
update(textareaElement, 'string before cursor', 'optional string after cursor');

textareaElement.value; //=> 'string before cursoroptional string after cursor'

// Update around the cursor
wrapCursor(textareaElement, ' _', '_ ');

textareaElement.value; //=> 'string before cursor __ optional string after cursor'

// Press cmd-z

textareaElement.value; //=> 'string before cursoroptional string after cursor'

textareaElement.setSelectionRange(14, 27);

textareaElement.value; //=> 'string before cursoroptional string after cursor'
                       //                  ^^^^^^^^^^^^^^ selected

wrapCursor(textareaElement, '**', '**');

textareaElement.value; //=> 'string before **cursoroptional** string after cursor'
                       //                    ^^^^^^^^^^^^^^ selected

// Press cmd-z

textareaElement.value; //=> 'string before cursoroptional string after cursor'
                       //                  ^^^^^^^^^^^^^^ selected

// Press cmd-z

textareaElement.value; //=> ''

License

The MIT License

Versions

Version
0.2.4