typed-controls 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +30 -30
- package/lib/typed-controls.js +17 -6
- package/package.json +95 -93
package/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015 Codenautas
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Codenautas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
# typed-controls
|
|
2
|
-
typed controls, widgets and others
|
|
3
|
-
|
|
4
|
-

|
|
5
|
-
[](https://npmjs.org/package/typed-controls)
|
|
6
|
-
[](https://npmjs.org/package/typed-controls)
|
|
7
|
-
[](https://travis-ci.org/codenautas/typed-controls)
|
|
8
|
-
[](https://david-dm.org/codenautas/typed-controls)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
language: 
|
|
13
|
-
also available in:
|
|
14
|
-
[](LEEME.md)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Install
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
$ npm install typed-controls
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## License
|
|
25
|
-
|
|
26
|
-
[MIT](LICENSE)
|
|
27
|
-
|
|
28
|
-
----------------
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
# typed-controls
|
|
2
|
+
typed controls, widgets and others
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+
[](https://npmjs.org/package/typed-controls)
|
|
6
|
+
[](https://npmjs.org/package/typed-controls)
|
|
7
|
+
[](https://travis-ci.org/codenautas/typed-controls)
|
|
8
|
+
[](https://david-dm.org/codenautas/typed-controls)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
language: 
|
|
13
|
+
also available in:
|
|
14
|
+
[](LEEME.md)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
$ npm install typed-controls
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
[MIT](LICENSE)
|
|
27
|
+
|
|
28
|
+
----------------
|
|
29
|
+
|
|
30
|
+
|
package/lib/typed-controls.js
CHANGED
|
@@ -32,7 +32,7 @@ TypedControls.SIGNAL_UNKNOWN_DATA='//';
|
|
|
32
32
|
var likeAr = require('like-ar');
|
|
33
33
|
var DialogPromise = require('dialog-promise');
|
|
34
34
|
|
|
35
|
-
TypedControls.
|
|
35
|
+
TypedControls.enablePasteCorrections=true;
|
|
36
36
|
TypedControls.doubleClickExpands=false;
|
|
37
37
|
TypedControls.showLupa=0.5;
|
|
38
38
|
TypedControls.showOn={
|
|
@@ -192,13 +192,24 @@ BestControls.div = {
|
|
|
192
192
|
},300);
|
|
193
193
|
},
|
|
194
194
|
'paste': function(event){
|
|
195
|
-
if (
|
|
195
|
+
if (TypedControls.enablePasteCorrections){
|
|
196
196
|
let paste = (event.clipboardData || window.clipboardData).getData('text');
|
|
197
197
|
paste = paste.replace(/\u00A0/g,' ');
|
|
198
|
-
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
var element = event.target;
|
|
199
|
+
if(element && (element.tagName == "INPUT" || element.tagName == "TEXTAREA")){
|
|
200
|
+
var start = element.selectionStart;
|
|
201
|
+
element.setRangeText(paste);
|
|
202
|
+
var pos = (start||0) + paste.length
|
|
203
|
+
element.setSelectionRange(pos, pos);
|
|
204
|
+
}else{
|
|
205
|
+
const selection = window.getSelection();
|
|
206
|
+
if (!selection.rangeCount) return false;
|
|
207
|
+
console.log(selection.rangeCount);
|
|
208
|
+
for(var i=0; i<selection.rangeCount; i++) console.log('e',selection.getRangeAt(i))
|
|
209
|
+
selection.deleteFromDocument();
|
|
210
|
+
selection.getRangeAt(0).insertNode(document.createTextNode(paste));
|
|
211
|
+
selection.collapseToEnd()
|
|
212
|
+
}
|
|
202
213
|
event.preventDefault();
|
|
203
214
|
}
|
|
204
215
|
},
|
package/package.json
CHANGED
|
@@ -1,93 +1,95 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "typed-controls",
|
|
3
|
-
"description": "typed controls, widgets and others",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": "codenautas/typed-controls",
|
|
8
|
-
"contributors": [
|
|
9
|
-
{
|
|
10
|
-
"name": "Emilio Platzer",
|
|
11
|
-
"email": "emilioplatzer@gmail.com"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "Estefanía Capece",
|
|
15
|
-
"email": "eycapece@gmail.com"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"name": "Diego Florio",
|
|
19
|
-
"email": "diegoefe@gmail.com"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"name": "Manuel De la Penna",
|
|
23
|
-
"email": "manueldelapenna@gmail.com"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"main": "lib/typed-controls.js",
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"pikaday": "^1.8.2",
|
|
29
|
-
"best-globals": "~1.0.0",
|
|
30
|
-
"js-to-html": "^1.2.1",
|
|
31
|
-
"like-ar": "~0.3.6",
|
|
32
|
-
"type-store": "~0.2.41",
|
|
33
|
-
"dialog-promise": "~0.9.4"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"big.js": "^6.1.1",
|
|
37
|
-
"body-parser": "^1.19.0",
|
|
38
|
-
"cookie-parser": "^1.4.6",
|
|
39
|
-
"es6-promise": "^4.2.8",
|
|
40
|
-
"esprima": "^4.0.1",
|
|
41
|
-
"expect.js": "~0.3.1",
|
|
42
|
-
"express": "^4.17.1",
|
|
43
|
-
"express-session": "^1.17.2",
|
|
44
|
-
"express-useragent": "^1.0.15",
|
|
45
|
-
"fs-extra": "^10.0.0",
|
|
46
|
-
"istanbul": "~0.4.5",
|
|
47
|
-
"karma": "^6.3.9",
|
|
48
|
-
"karma-chrome-launcher": "^3.1.0",
|
|
49
|
-
"karma-coverage": "^2.0.3",
|
|
50
|
-
"karma-coverage-html-index-reporter": "^1.0.2",
|
|
51
|
-
"karma-expect": "^1.1.3",
|
|
52
|
-
"karma-firefox-launcher": "^2.1.2",
|
|
53
|
-
"karma-mocha": "^2.0.1",
|
|
54
|
-
"mocha": "^9.1.3",
|
|
55
|
-
"moment": "^2.29.1",
|
|
56
|
-
"pug": "^3.0.2",
|
|
57
|
-
"read-yaml-promise": "^1.0.2",
|
|
58
|
-
"slimerjs": "^1.0.0",
|
|
59
|
-
"ajax-best-promise": "~0.3.7",
|
|
60
|
-
"discrepances": "~0.2.6",
|
|
61
|
-
"json4all": "~1.1.0",
|
|
62
|
-
"require-bro": "~0.2.2",
|
|
63
|
-
"self-explain": "~0.10.22",
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"test
|
|
80
|
-
"
|
|
81
|
-
"ctest
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "typed-controls",
|
|
3
|
+
"description": "typed controls, widgets and others",
|
|
4
|
+
"version": "0.10.0",
|
|
5
|
+
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": "codenautas/typed-controls",
|
|
8
|
+
"contributors": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Emilio Platzer",
|
|
11
|
+
"email": "emilioplatzer@gmail.com"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Estefanía Capece",
|
|
15
|
+
"email": "eycapece@gmail.com"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "Diego Florio",
|
|
19
|
+
"email": "diegoefe@gmail.com"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "Manuel De la Penna",
|
|
23
|
+
"email": "manueldelapenna@gmail.com"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"main": "lib/typed-controls.js",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"pikaday": "^1.8.2",
|
|
29
|
+
"best-globals": "~1.0.0",
|
|
30
|
+
"js-to-html": "^1.2.1",
|
|
31
|
+
"like-ar": "~0.3.6",
|
|
32
|
+
"type-store": "~0.2.41",
|
|
33
|
+
"dialog-promise": "~0.9.4"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"big.js": "^6.1.1",
|
|
37
|
+
"body-parser": "^1.19.0",
|
|
38
|
+
"cookie-parser": "^1.4.6",
|
|
39
|
+
"es6-promise": "^4.2.8",
|
|
40
|
+
"esprima": "^4.0.1",
|
|
41
|
+
"expect.js": "~0.3.1",
|
|
42
|
+
"express": "^4.17.1",
|
|
43
|
+
"express-session": "^1.17.2",
|
|
44
|
+
"express-useragent": "^1.0.15",
|
|
45
|
+
"fs-extra": "^10.0.0",
|
|
46
|
+
"istanbul": "~0.4.5",
|
|
47
|
+
"karma": "^6.3.9",
|
|
48
|
+
"karma-chrome-launcher": "^3.1.0",
|
|
49
|
+
"karma-coverage": "^2.0.3",
|
|
50
|
+
"karma-coverage-html-index-reporter": "^1.0.2",
|
|
51
|
+
"karma-expect": "^1.1.3",
|
|
52
|
+
"karma-firefox-launcher": "^2.1.2",
|
|
53
|
+
"karma-mocha": "^2.0.1",
|
|
54
|
+
"mocha": "^9.1.3",
|
|
55
|
+
"moment": "^2.29.1",
|
|
56
|
+
"pug": "^3.0.2",
|
|
57
|
+
"read-yaml-promise": "^1.0.2",
|
|
58
|
+
"slimerjs": "^1.0.0",
|
|
59
|
+
"ajax-best-promise": "~0.3.7",
|
|
60
|
+
"discrepances": "~0.2.6",
|
|
61
|
+
"json4all": "~1.1.0",
|
|
62
|
+
"require-bro": "~0.2.2",
|
|
63
|
+
"self-explain": "~0.10.22",
|
|
64
|
+
"server4test": "^0.8.3",
|
|
65
|
+
"serve-content": "~0.3.16"
|
|
66
|
+
},
|
|
67
|
+
"optionalDependencies": {
|
|
68
|
+
"dialog-promise": "~0.9.14",
|
|
69
|
+
"castellano": "~0.1.3"
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">= 14"
|
|
73
|
+
},
|
|
74
|
+
"files": [
|
|
75
|
+
"lib"
|
|
76
|
+
],
|
|
77
|
+
"scripts": {
|
|
78
|
+
"infinito": "node server/karma-server.js --karma karma.conf.js",
|
|
79
|
+
"test": "node server/karma-server.js --karma karma.conf.js --single-run",
|
|
80
|
+
"test-cov": "node server/karma-server.js --karma karma.conf.js --single-run",
|
|
81
|
+
"ctest": "node server/pdemo-server.js --use-casper --coverage",
|
|
82
|
+
"ctest-h": "node server/pdemo-server.js --use-casper --coverage --hold",
|
|
83
|
+
"x-start": "node server/pdemo-server.js",
|
|
84
|
+
"start": "server4test",
|
|
85
|
+
"all": "npm test && npm run ctest && qa-control . -v",
|
|
86
|
+
"report": "istanbul report"
|
|
87
|
+
},
|
|
88
|
+
"qa-control": {
|
|
89
|
+
"package-version": "0.3.0",
|
|
90
|
+
"coverage": 100,
|
|
91
|
+
"run-in": "both",
|
|
92
|
+
"stability": "extending",
|
|
93
|
+
"type": "lib"
|
|
94
|
+
}
|
|
95
|
+
}
|