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.
Files changed (29) hide show
  1. package/{scripts/camelCase.js → data/.OLD/~camelCase.js} +0 -0
  2. package/{scripts → data}/.OLD/~date2Iso.js +0 -0
  3. package/{scripts → data}/.OLD/~date2MMDDYYYY.js +0 -0
  4. package/{scripts → data}/.OLD/~dateConvert.js +0 -0
  5. package/{scripts → data}/.OLD/~dateIso2Epoch.js +0 -0
  6. package/{scripts → data}/.OLD/~dateLocal-ISOTime.js +0 -0
  7. package/{scripts → data}/.OLD/~dateUTC.js +0 -0
  8. package/{scripts → data}/.OLD/~disableSpellCheck.js +0 -0
  9. package/{scripts → data}/.OLD/~loadJson.js +0 -0
  10. package/{scripts → data}/.OLD/~loadJsonExternal.js +0 -0
  11. package/{scripts/nl2br.js → data/.OLD/~nl2br.js} +0 -0
  12. package/{scripts → data}/.OLD/~object2array.js +0 -0
  13. package/{scripts → data}/.OLD/~parseDate.js +0 -0
  14. package/{scripts → data}/.OLD/~pathHash.js +0 -0
  15. package/{scripts → data}/.OLD/~pathQuery.js +0 -0
  16. package/{scripts → data}/.OLD/~pathRail.js +0 -0
  17. package/{scripts/randomNumTmr.js → data/.OLD/~randomNumTmr.js} +0 -0
  18. package/{scripts → data}/.OLD/~scrollIndicator.js +0 -0
  19. package/{scripts → data}/.OLD/~scrollMemory.js +0 -0
  20. package/{scripts → data}/.OLD/~scrollSmooth.js +0 -0
  21. package/{scripts → data}/.OLD/~scrollToElement.js +0 -0
  22. package/{scripts → data}/.OLD/~svgSupport.js +0 -0
  23. package/package.json +1 -1
  24. package/scripts/{addListenerMulti.js → event.js} +15 -8
  25. package/scripts/number.js +42 -0
  26. package/scripts/text.js +29 -0
  27. package/scripts/timer.js +35 -0
  28. package/scripts/randomNum.js +0 -26
  29. 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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dphelper",
3
- "version": "0.2.31",
3
+ "version": "0.2.32",
4
4
  "description": "Developer Tools",
5
5
  "main": "index.js",
6
6
  "publishConfig": {},
@@ -7,11 +7,16 @@
7
7
  /***********************************************************************/
8
8
 
9
9
  var description = {
10
- "name" : "Multi Event Listener",
10
+ "name" : "Event Listener",
11
11
  "description" : "test",
12
12
  "version" : "0.0.1",
13
- "command" : "addListenerMulti",
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.addListenerMulti = ( element, eventNames, listener ) => {
29
+ window.dphelper.event ={
25
30
 
26
- var events = eventNames.split(' ');
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
- for (var i=0, iLen=events.length; i < iLen; ++i ) {
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
  };
@@ -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
+ };
@@ -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
- };