dphelper 0.2.31 → 0.2.32
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/{scripts/camelCase.js → data/.OLD/~camelCase.js} +0 -0
- package/{scripts → data}/.OLD/~date2Iso.js +0 -0
- package/{scripts → data}/.OLD/~date2MMDDYYYY.js +0 -0
- package/{scripts → data}/.OLD/~dateConvert.js +0 -0
- package/{scripts → data}/.OLD/~dateIso2Epoch.js +0 -0
- package/{scripts → data}/.OLD/~dateLocal-ISOTime.js +0 -0
- package/{scripts → data}/.OLD/~dateUTC.js +0 -0
- package/{scripts → data}/.OLD/~disableSpellCheck.js +0 -0
- package/{scripts → data}/.OLD/~loadJson.js +0 -0
- package/{scripts → data}/.OLD/~loadJsonExternal.js +0 -0
- package/{scripts/nl2br.js → data/.OLD/~nl2br.js} +0 -0
- package/{scripts → data}/.OLD/~object2array.js +0 -0
- package/{scripts → data}/.OLD/~parseDate.js +0 -0
- package/{scripts → data}/.OLD/~pathHash.js +0 -0
- package/{scripts → data}/.OLD/~pathQuery.js +0 -0
- package/{scripts → data}/.OLD/~pathRail.js +0 -0
- package/{scripts/randomNumTmr.js → data/.OLD/~randomNumTmr.js} +0 -0
- package/{scripts → data}/.OLD/~scrollIndicator.js +0 -0
- package/{scripts → data}/.OLD/~scrollMemory.js +0 -0
- package/{scripts → data}/.OLD/~scrollSmooth.js +0 -0
- package/{scripts → data}/.OLD/~scrollToElement.js +0 -0
- package/{scripts → data}/.OLD/~svgSupport.js +0 -0
- package/package.json +1 -1
- package/scripts/{addListenerMulti.js → event.js} +15 -8
- package/scripts/number.js +42 -0
- package/scripts/text.js +29 -0
- package/scripts/timer.js +35 -0
- package/scripts/randomNum.js +0 -26
- package/scripts/sleep.js +0 -26
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -7,11 +7,16 @@
|
|
|
7
7
|
/***********************************************************************/
|
|
8
8
|
|
|
9
9
|
var description = {
|
|
10
|
-
"name" : "
|
|
10
|
+
"name" : "Event Listener",
|
|
11
11
|
"description" : "test",
|
|
12
12
|
"version" : "0.0.1",
|
|
13
|
-
"command" : "
|
|
14
|
-
"subCommand" : [
|
|
13
|
+
"command" : "event",
|
|
14
|
+
"subCommand" : [
|
|
15
|
+
{
|
|
16
|
+
"name":"multi",
|
|
17
|
+
"description":"test",
|
|
18
|
+
}
|
|
19
|
+
],
|
|
15
20
|
"example" : "",
|
|
16
21
|
"author" : "Dario Passariello",
|
|
17
22
|
"active" : true
|
|
@@ -21,12 +26,14 @@
|
|
|
21
26
|
|
|
22
27
|
/***********************************************************************/
|
|
23
28
|
|
|
24
|
-
window.dphelper.
|
|
29
|
+
window.dphelper.event ={
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
multi: ( element, eventNames, listener ) => {
|
|
32
|
+
var events = eventNames.split(' ');
|
|
33
|
+
for (var i=0, iLen = events.length; i < iLen; ++i ) {
|
|
34
|
+
element.addEventListener( events[i], listener, false );
|
|
35
|
+
}
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
element.addEventListener( events[i], listener, false );
|
|
30
|
-
}
|
|
37
|
+
},
|
|
31
38
|
|
|
32
39
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
+
* Copyright (c) 2021, Dario Passariello.
|
|
4
|
+
* Licensed under the Apache-2.0 License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/***********************************************************************/
|
|
8
|
+
|
|
9
|
+
var description = {
|
|
10
|
+
"name" : "Number Generator",
|
|
11
|
+
"description" : "test",
|
|
12
|
+
"version" : "0.0.1",
|
|
13
|
+
"command" : "number",
|
|
14
|
+
"subCommand" : [
|
|
15
|
+
{
|
|
16
|
+
"name":"rnd",
|
|
17
|
+
"description":"test",
|
|
18
|
+
},{
|
|
19
|
+
"name":"tmr",
|
|
20
|
+
"description":"test",
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"example" : "",
|
|
24
|
+
"author" : "Dario Passariello",
|
|
25
|
+
"active" : true
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
window.dphelper._list.scripts.push( description );
|
|
29
|
+
|
|
30
|
+
/***********************************************************************/
|
|
31
|
+
|
|
32
|
+
window.dphelper.number = {
|
|
33
|
+
|
|
34
|
+
rnd: () => {
|
|
35
|
+
return Math.floor( 100000 + Math.random() * dphelper.number.tmr() );
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
tmr: () => {
|
|
39
|
+
return Math.round( dphelper.time.epoch() / 1000 );
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
};
|
package/scripts/text.js
CHANGED
|
@@ -21,6 +21,15 @@
|
|
|
21
21
|
},{
|
|
22
22
|
"name":"upper",
|
|
23
23
|
"description":"test"
|
|
24
|
+
},{
|
|
25
|
+
"name":"nl2br",
|
|
26
|
+
"description":"test"
|
|
27
|
+
},{
|
|
28
|
+
"name":"camelCase.toSpace",
|
|
29
|
+
"description":"test"
|
|
30
|
+
},{
|
|
31
|
+
"name":"camelCase.toUnderscore",
|
|
32
|
+
"description":"test"
|
|
24
33
|
}
|
|
25
34
|
],
|
|
26
35
|
"example" : "",
|
|
@@ -44,6 +53,26 @@
|
|
|
44
53
|
|
|
45
54
|
upper: (txt) => {
|
|
46
55
|
return txt.toUpperCase();
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
nl2br: (str) => {
|
|
59
|
+
return str.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
camelCase: {
|
|
63
|
+
|
|
64
|
+
toSpace: ( string ) => {
|
|
65
|
+
return string
|
|
66
|
+
.replace(/([A-Z])/g, ' $1')
|
|
67
|
+
.replace(/^./, function(str){ return str.toUpperCase(); });
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
toUnderscore: ( string ) => {
|
|
71
|
+
return string
|
|
72
|
+
.replace(/\.?([A-Z])/g, function (x,y){ return "_" + y.toLowerCase(); })
|
|
73
|
+
.replace(/^_/, "");
|
|
74
|
+
},
|
|
75
|
+
|
|
47
76
|
}
|
|
48
77
|
|
|
49
78
|
};
|
package/scripts/timer.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
+
* Copyright (c) 2021, Dario Passariello.
|
|
4
|
+
* Licensed under the Apache-2.0 License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/***********************************************************************/
|
|
8
|
+
|
|
9
|
+
var description = {
|
|
10
|
+
"name" : "Timer Options",
|
|
11
|
+
"description" : "test",
|
|
12
|
+
"version" : "0.0.1",
|
|
13
|
+
"command" : "timer",
|
|
14
|
+
"subCommand" : [
|
|
15
|
+
{
|
|
16
|
+
"name":"sleep",
|
|
17
|
+
"description":"test",
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"example" : "",
|
|
21
|
+
"author" : "Dario Passariello",
|
|
22
|
+
"active" : true
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
window.dphelper._list.scripts.push( description );
|
|
26
|
+
|
|
27
|
+
/***********************************************************************/
|
|
28
|
+
|
|
29
|
+
window.dphelper.timer ={
|
|
30
|
+
|
|
31
|
+
sleep: (ms) => {
|
|
32
|
+
return new Promise( resolve => setTimeout( resolve, ms) );
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
};
|
package/scripts/randomNum.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
4
|
-
* Licensed under the Apache-2.0 License.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/***********************************************************************/
|
|
8
|
-
|
|
9
|
-
var description = {
|
|
10
|
-
"name" : "Random Number Generator",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "rnd",
|
|
14
|
-
"subCommand" : [],
|
|
15
|
-
"example" : "",
|
|
16
|
-
"author" : "Dario Passariello",
|
|
17
|
-
"active" : true
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
window.dphelper._list.scripts.push( description );
|
|
21
|
-
|
|
22
|
-
/***********************************************************************/
|
|
23
|
-
|
|
24
|
-
window.dphelper.rnd = () => {
|
|
25
|
-
return Math.floor( 100000 + Math.random() * dphelper.tmr() );
|
|
26
|
-
};
|
package/scripts/sleep.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
4
|
-
* Licensed under the Apache-2.0 License.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/***********************************************************************/
|
|
8
|
-
|
|
9
|
-
var description = {
|
|
10
|
-
"name" : "Sleep In ms",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "sleep",
|
|
14
|
-
"subCommand" : [],
|
|
15
|
-
"example" : "",
|
|
16
|
-
"author" : "Dario Passariello",
|
|
17
|
-
"active" : true
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
window.dphelper._list.scripts.push( description );
|
|
21
|
-
|
|
22
|
-
/***********************************************************************/
|
|
23
|
-
|
|
24
|
-
window.dphelper.sleep = (ms) => {
|
|
25
|
-
return new Promise( resolve => setTimeout( resolve, ms) );
|
|
26
|
-
};
|