Skip to content

Commit 155547f

Browse files
author
WebCoder49
committed
Prepare for NPM
1 parent a307c60 commit 155547f

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# code-input
2+
![Click to Switch](https://img.shields.io/static/v1?label=&message=Click%20to%20Switch:%20&color=grey&style=for-the-badge)[![GitHub](https://img.shields.io/static/v1?label=&message=GitHub&color=navy&style=for-the-badge&logo=github)](https://github.com/WebCoder49/code-input)[![NPM](https://img.shields.io/static/v1?label=&message=NPM&color=red&style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@webcoder49/code-input)
3+
24
[![View License](https://img.shields.io/github/license/webcoder49/code-input?style=for-the-badge)](LICENSE) [![View Releases](https://img.Shields.io/github/v/release/webcoder49/code-input?style=for-the-badge)](https://github.com/WebCoder49/code-input/releases) [![View the demo on CodePen](https://img.shields.io/static/v1?label=Demo&message=on%20CodePen&color=orange&logo=codepen&style=for-the-badge)](https://codepen.io/WebCoder49/details/jOypJOx)
35

46
> ___Fully customisable syntax-highlighted textareas.___ [[🚀 View the Demo](https://codepen.io/WebCoder49/details/jOypJOx)]
@@ -44,8 +46,8 @@ From JSDelivr CDN
4446

4547
```html
4648
<!--In the <head>-->
47-
<script src="https://cdn.jsdelivr.net/gh/WebCoder49/code-input@1.3/code-input.min.js"></script>
48-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/WebCoder49/code-input@1.3/code-input.min.css">
49+
<script src="https://cdn.jsdelivr.net/gh/WebCoder49/code-input@1.5/code-input.min.js"></script>
50+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/WebCoder49/code-input@1.5/code-input.min.css">
4951
```
5052
</details>
5153

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "@webcoder49/code-input",
3+
"version": "1.5.0",
4+
"description": "Fully customisable, editable syntax-highlighted textareas.",
5+
"browser": "code-input.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/WebCoder49/code-input.git"
12+
},
13+
"keywords": [
14+
"front-end",
15+
"syntax",
16+
"highlight",
17+
"textarea",
18+
"editable",
19+
"web-components"
20+
],
21+
"author": {
22+
"name": "WebCoder49",
23+
"email": "[email protected]",
24+
"url": "https://webcoder49.github.io/"
25+
},
26+
"license": "MIT",
27+
"bugs": {
28+
"url": "https://github.com/WebCoder49/code-input/issues"
29+
},
30+
"homepage": "https://github.com/WebCoder49/code-input#readme"
31+
}

plugins/indent.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* possible to indent/unindent multiple lines using Tab/Shift+Tab
44
* Files: indent.js
55
*/
6-
codeInput.plugins.Indent = class extends codeInput.Plugin {
6+
codeInput.plugins.Indent = class extends codeInput.Plugin {
77
constructor() {
88
super();
99
}
@@ -129,6 +129,7 @@
129129

130130
// save the current cursor position
131131
let selection_start = input_element.selectionStart;
132+
let selection_end = input_element.selectionEnd;
132133

133134
document.execCommand("insertText", false, "\n" + new_line); // Write new line, including auto-indentation
134135

@@ -150,4 +151,4 @@
150151
input_element.scrollTop += 20; // px
151152
}
152153
}
153-
}
154+
}

0 commit comments

Comments
 (0)