dphelper 0.2.32 → 0.2.36
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/.vscode/settings.json +19 -4
- package/README.md +73 -28
- package/assets/images/banner.png +0 -0
- package/assets/logos/logo.svg +64 -0
- package/linuxone_biglogic.session.sql +0 -0
- package/linuxone_ug3d.session.sql +0 -0
- package/localhost.session.sql +0 -0
- package/package.json +1 -1
- package/scripts/anchorToOnClick.js +4 -4
- package/scripts/array.js +1 -1
- package/scripts/browser.js +69 -0
- package/scripts/console.js +1 -1
- package/scripts/cookie.js +1 -1
- package/scripts/date.js +1 -1
- package/scripts/disable.js +8 -6
- package/scripts/event.js +1 -1
- package/scripts/font.js +1 -1
- package/scripts/form.js +1 -1
- package/scripts/function.js +47 -0
- package/scripts/indexedDB.js +1 -1
- package/scripts/json.js +1 -1
- package/scripts/load.js +1 -1
- package/scripts/noCache.js +1 -1
- package/scripts/number.js +26 -2
- package/scripts/obj.js +3 -3
- package/scripts/onBeforeUnLoad.js +1 -1
- package/scripts/path.js +14 -14
- package/scripts/{pushState.js → promise.js} +9 -7
- package/scripts/screen.js +3 -3
- package/scripts/scrollbar.js +2 -2
- package/scripts/storage.js +1 -1
- package/scripts/text.js +1 -1
- package/scripts/time.js +1 -1
- package/scripts/timer.js +1 -1
- package/scripts/trigger.js +10 -1
- package/scripts/type.js +56 -0
- package/data/.OLD/~camelCase.js +0 -41
- package/data/.OLD/~date2Iso.js +0 -31
- package/data/.OLD/~date2MMDDYYYY.js +0 -27
- package/data/.OLD/~dateConvert.js +0 -31
- package/data/.OLD/~dateIso2Epoch.js +0 -28
- package/data/.OLD/~dateLocal-ISOTime.js +0 -28
- package/data/.OLD/~dateUTC.js +0 -25
- package/data/.OLD/~disableSpellCheck.js +0 -32
- package/data/.OLD/~loadJson.js +0 -27
- package/data/.OLD/~loadJsonExternal.js +0 -44
- package/data/.OLD/~nl2br.js +0 -26
- package/data/.OLD/~object2array.js +0 -28
- package/data/.OLD/~parseDate.js +0 -30
- package/data/.OLD/~pathHash.js +0 -27
- package/data/.OLD/~pathQuery.js +0 -28
- package/data/.OLD/~pathRail.js +0 -27
- package/data/.OLD/~randomNumTmr.js +0 -26
- package/data/.OLD/~scrollIndicator.js +0 -67
- package/data/.OLD/~scrollMemory.js +0 -26
- package/data/.OLD/~scrollSmooth.js +0 -74
- package/data/.OLD/~scrollToElement.js +0 -25
- package/data/.OLD/~svgSupport.js +0 -346
- package/scripts/isPromise.js +0 -26
- package/scripts/printInfo.js +0 -28
package/scripts/path.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/***********************************************************************/
|
|
8
8
|
|
|
9
9
|
var description = {
|
|
10
|
-
"name" : "
|
|
10
|
+
"name" : "Path To Array",
|
|
11
11
|
"description" : "test",
|
|
12
12
|
"version" : "0.0.1",
|
|
13
13
|
"command" : "path",
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
|
|
33
33
|
/***********************************************************************/
|
|
34
34
|
|
|
35
|
-
// ALIAS
|
|
36
|
-
window.dphelper.pathHash = () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
35
|
+
// // ALIAS
|
|
36
|
+
// window.dphelper.pathHash = () => {
|
|
37
|
+
// console.debug( 'dpHelper: Please use "dphelper.path.hash()"' );
|
|
38
|
+
// return window.dphelper.path.hash();
|
|
39
|
+
// };
|
|
40
40
|
|
|
41
|
-
window.dphelper.pathQuery = () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
41
|
+
// window.dphelper.pathQuery = () => {
|
|
42
|
+
// console.debug( 'dpHelper: Please use "dphelper.path.query()"' );
|
|
43
|
+
// return window.dphelper.path.query();
|
|
44
|
+
// };
|
|
45
45
|
|
|
46
|
-
window.dphelper.pathRail = () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
46
|
+
// window.dphelper.pathRail = () => {
|
|
47
|
+
// console.debug( 'dpHelper: Please use "dphelper.path.rail()"' );
|
|
48
|
+
// return window.dphelper.path.rail();
|
|
49
|
+
// };
|
|
50
50
|
|
|
51
51
|
/***********************************************************************/
|
|
52
52
|
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
/***********************************************************************/
|
|
8
8
|
|
|
9
9
|
var description = {
|
|
10
|
-
"name" : "
|
|
10
|
+
"name" : "Promises",
|
|
11
11
|
"description" : "test",
|
|
12
12
|
"version" : "0.0.1",
|
|
13
|
-
"command" : "
|
|
13
|
+
"command" : "promise",
|
|
14
14
|
"subCommand" : [
|
|
15
15
|
{
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
name:"check",
|
|
17
|
+
description:"test"
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
20
|
"example" : "",
|
|
@@ -26,8 +26,10 @@
|
|
|
26
26
|
|
|
27
27
|
/***********************************************************************/
|
|
28
28
|
|
|
29
|
-
window.dphelper.
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
window.dphelper.promise = {
|
|
30
|
+
|
|
31
|
+
check: (p) => {
|
|
32
|
+
return p && Object.prototype.toString.call(p) === "[object Promise]";
|
|
32
33
|
}
|
|
34
|
+
|
|
33
35
|
};
|
package/scripts/screen.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"name":"fullScreen",
|
|
17
17
|
"description":"test"
|
|
18
18
|
},{
|
|
19
|
-
"name":"
|
|
19
|
+
"name":"toggle",
|
|
20
20
|
"description":"test"
|
|
21
21
|
}
|
|
22
22
|
],
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
/***********************************************************************/
|
|
31
31
|
|
|
32
|
-
window.dphelper.
|
|
32
|
+
window.dphelper.screen = {
|
|
33
33
|
|
|
34
34
|
fullScreen: function( el ){
|
|
35
35
|
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
},
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
toggle: function( el ) {
|
|
47
47
|
|
|
48
48
|
let requestFullScreen = el.requestFullscreen || el.mozRequestFullScreen || el.webkitRequestFullScreen || el.msRequestFullscreen;
|
|
49
49
|
let cancelFullScreen = el.exitFullscreen || el.mozCancelFullScreen || el.webkitExitFullscreen || el.msExitFullscreen;
|
package/scripts/scrollbar.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
/***********************************************************************/
|
|
8
8
|
|
|
9
9
|
var description = {
|
|
10
|
-
"name" : "
|
|
10
|
+
"name" : "Scrollbar",
|
|
11
11
|
"description" : "test",
|
|
12
12
|
"version" : "0.0.1",
|
|
13
|
-
"command" : "
|
|
13
|
+
"command" : "scrollbar",
|
|
14
14
|
"subCommand" : [
|
|
15
15
|
{
|
|
16
16
|
"name":"custom",
|
package/scripts/storage.js
CHANGED
package/scripts/text.js
CHANGED
package/scripts/time.js
CHANGED
package/scripts/timer.js
CHANGED
package/scripts/trigger.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/***********************************************************************/
|
|
8
8
|
|
|
9
9
|
var description = {
|
|
10
|
-
"name" : "
|
|
10
|
+
"name" : "Triggers",
|
|
11
11
|
"description" : "test",
|
|
12
12
|
"version" : "0.0.1",
|
|
13
13
|
"command" : "trigger",
|
|
@@ -32,6 +32,15 @@
|
|
|
32
32
|
let selector = document.querySelector( elem );
|
|
33
33
|
if( selector ) selector.click();
|
|
34
34
|
return;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
change: ( elem ) => {
|
|
38
|
+
let selector = document.querySelector( elem );
|
|
39
|
+
var ev = new Event('input', { bubbles: true} );
|
|
40
|
+
ev.simulated = true;
|
|
41
|
+
//selector.value = 'Something new';
|
|
42
|
+
selector.dispatchEvent(ev);
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
};
|
|
46
|
+
|
package/scripts/type.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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" : "Type",
|
|
11
|
+
"description" : "test",
|
|
12
|
+
"version" : "0.0.1",
|
|
13
|
+
"command" : "type",
|
|
14
|
+
"subCommand" : [
|
|
15
|
+
{
|
|
16
|
+
name:"typeOf",
|
|
17
|
+
description:"test"
|
|
18
|
+
},{
|
|
19
|
+
name:"instOfObj",
|
|
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.type = {
|
|
33
|
+
|
|
34
|
+
typeOf: (p) => { return typeof p; },
|
|
35
|
+
|
|
36
|
+
instOfObj: (p) => { return p instanceof Object; },
|
|
37
|
+
|
|
38
|
+
isNaN: (p) => { return function (i) { return !p(i); }; },
|
|
39
|
+
|
|
40
|
+
isPrime: (number) => {
|
|
41
|
+
var divisor = parseInt(number / 2, 10);
|
|
42
|
+
var prime = true;
|
|
43
|
+
while (divisor > 1) {
|
|
44
|
+
if (number % divisor === 0) {
|
|
45
|
+
prime = false;
|
|
46
|
+
divisor = 0;
|
|
47
|
+
} else {
|
|
48
|
+
divisor -= 1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return prime === true;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
};
|
package/data/.OLD/~camelCase.js
DELETED
|
@@ -1,41 +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" : "Camel Case / Pascal Case",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "camelCase",
|
|
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.camelCase = {
|
|
25
|
-
|
|
26
|
-
// toSpace
|
|
27
|
-
toSpace: ( string ) => {
|
|
28
|
-
return string
|
|
29
|
-
.replace(/([A-Z])/g, ' $1')
|
|
30
|
-
.replace(/^./, function(str){ return str.toUpperCase(); })
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
// toUnderscore
|
|
34
|
-
toUnderscore: ( string ) => {
|
|
35
|
-
return string
|
|
36
|
-
.replace(/\.?([A-Z])/g, function (x,y){ return "_" + y.toLowerCase()})
|
|
37
|
-
.replace(/^_/, "");
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
|
package/data/.OLD/~date2Iso.js
DELETED
|
@@ -1,31 +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" : "Date To Iso",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "date2Iso",
|
|
14
|
-
"example" : "",
|
|
15
|
-
"author" : "Dario Passariello",
|
|
16
|
-
"active" : true
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
window.dphelper._list.scripts.push( description );
|
|
20
|
-
|
|
21
|
-
/***********************************************************************/
|
|
22
|
-
|
|
23
|
-
window.dphelper.date2Iso = (value , int = 'en' ) => {
|
|
24
|
-
if (!value) value = '';
|
|
25
|
-
let date = new Date(value);
|
|
26
|
-
if (date == 'Invalid Date') return null; //date = new Date()
|
|
27
|
-
const dateTimeFormat = new Intl.DateTimeFormat( int , {
|
|
28
|
-
year: 'numeric', month: 'long', day: 'numeric',
|
|
29
|
-
});
|
|
30
|
-
return dateTimeFormat.format(date);
|
|
31
|
-
};
|
|
@@ -1,27 +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" : "Date To MMDDYYYY",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "date2MMDDYYYY",
|
|
14
|
-
"example" : "",
|
|
15
|
-
"author" : "Dario Passariello",
|
|
16
|
-
"active" : true
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
window.dphelper._list.scripts.push( description );
|
|
20
|
-
|
|
21
|
-
/***********************************************************************/
|
|
22
|
-
|
|
23
|
-
window.dphelper.date2MMDDYYYY = (value) => {
|
|
24
|
-
if (!value) value = '';
|
|
25
|
-
let date = new Date(value);
|
|
26
|
-
return ('0' + (date.getMonth() + 1)).slice(-2) + "" + ('0' + date.getDate()).slice(-2) + "" + date.getFullYear();
|
|
27
|
-
};
|
|
@@ -1,31 +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" : "Convert Date",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "dateConvert",
|
|
14
|
-
"example" : "",
|
|
15
|
-
"author" : "Dario Passariello",
|
|
16
|
-
"active" : true
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
window.dphelper._list.scripts.push( description );
|
|
20
|
-
|
|
21
|
-
/***********************************************************************/
|
|
22
|
-
|
|
23
|
-
window.dphelper.dateConvert = (value , format ) => {
|
|
24
|
-
if( !format) format = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
25
|
-
if (!value) return null;
|
|
26
|
-
let monthNames = format;
|
|
27
|
-
let month = value.substring(0, 2).replace('0', '');
|
|
28
|
-
let day = value.substring(2, 4);
|
|
29
|
-
let year = value.substring(value.length - 4);
|
|
30
|
-
return day + ' ' + monthNames[Number(month) - 1] + ' ' + year;
|
|
31
|
-
};
|
|
@@ -1,28 +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" : "Date Iso To Epoch",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "dateIso2Epoch",
|
|
14
|
-
"example" : "",
|
|
15
|
-
"author" : "Dario Passariello",
|
|
16
|
-
"active" : true
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
window.dphelper._list.scripts.push( description );
|
|
20
|
-
|
|
21
|
-
/***********************************************************************/
|
|
22
|
-
|
|
23
|
-
window.dphelper.dateIso2Epoch = (value) => {
|
|
24
|
-
if (!value) value = '';
|
|
25
|
-
let date = new Date(value);
|
|
26
|
-
let milliseconds = date.getTime();
|
|
27
|
-
return milliseconds;
|
|
28
|
-
};
|
|
@@ -1,28 +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" : "Local Iso Time",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "localISOTime",
|
|
14
|
-
"example" : "",
|
|
15
|
-
"author" : "Dario Passariello",
|
|
16
|
-
"active" : true
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
window.dphelper._list.scripts.push( description );
|
|
20
|
-
|
|
21
|
-
/***********************************************************************/
|
|
22
|
-
|
|
23
|
-
window.dphelper.localISOTime = (value) => {
|
|
24
|
-
if (!value) value = '';
|
|
25
|
-
let tzoffset = (new Date(value)).getTimezoneOffset() * 60000;
|
|
26
|
-
let localISOTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -1);
|
|
27
|
-
return localISOTime;
|
|
28
|
-
};
|
package/data/.OLD/~dateUTC.js
DELETED
|
@@ -1,25 +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" : "Date UTC",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "dateUTC",
|
|
14
|
-
"example" : "",
|
|
15
|
-
"author" : "Dario Passariello",
|
|
16
|
-
"active" : true
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
window.dphelper._list.scripts.push( description );
|
|
20
|
-
|
|
21
|
-
/***********************************************************************/
|
|
22
|
-
|
|
23
|
-
window.dphelper.dateUTC = () => {
|
|
24
|
-
return moment().toISOString();
|
|
25
|
-
};
|
|
@@ -1,32 +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" : "Disable SpellCheck",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "disableSpellCheck",
|
|
14
|
-
"example" : "",
|
|
15
|
-
"author" : "Dario Passariello",
|
|
16
|
-
"active" : true
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
window.dphelper._list.scripts.push( description );
|
|
20
|
-
|
|
21
|
-
/***********************************************************************/
|
|
22
|
-
|
|
23
|
-
window.dphelper.disableSpellCheck = ( tmr = 5000 ) => {
|
|
24
|
-
setInterval( () => {
|
|
25
|
-
let inputs = document.querySelectorAll("input[type=text], textarea");
|
|
26
|
-
for(let i = 0; i < inputs.length; i++){
|
|
27
|
-
if( !inputs[i].getAttribute("spellcheck") ){
|
|
28
|
-
inputs[i].setAttribute("spellcheck", "false");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}, tmr );
|
|
32
|
-
};
|
package/data/.OLD/~loadJson.js
DELETED
|
@@ -1,27 +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" : "Load Internal Json",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "loadJson",
|
|
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.loadJson = function( file ){
|
|
25
|
-
if ( file.match(/.(json)$/i ) ) return require( '' + file + '' );
|
|
26
|
-
};
|
|
27
|
-
|
|
@@ -1,44 +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" : "Load External Json",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "loadJsonExternal",
|
|
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.loadJsonExternal = ( path, method='GET', type='application/json' ) => {
|
|
25
|
-
|
|
26
|
-
fetch( path ,{
|
|
27
|
-
method: method,
|
|
28
|
-
headers : {
|
|
29
|
-
'Content-Type': type
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
.then(
|
|
33
|
-
function(response) {
|
|
34
|
-
//return response.json();
|
|
35
|
-
return response;
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
.then(
|
|
39
|
-
function( myFile ) {
|
|
40
|
-
return myFile;
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
};
|
package/data/.OLD/~nl2br.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" : "New Line To Break Line ( nl 2 br )",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "nl2br",
|
|
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.nl2br = (str) => {
|
|
25
|
-
return str.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
|
26
|
-
};
|
|
@@ -1,28 +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" : "Convert Object To Array",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "obj2array",
|
|
14
|
-
"sub-command" : [],
|
|
15
|
-
"example" : "",
|
|
16
|
-
"author" : "Dario Passariello",
|
|
17
|
-
"active" : true
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
window.dphelper._list.scripts.push( description );
|
|
21
|
-
|
|
22
|
-
/***********************************************************************/
|
|
23
|
-
|
|
24
|
-
window.dphelper.obj2array = ( object ) => {
|
|
25
|
-
return Object
|
|
26
|
-
.entries( object )
|
|
27
|
-
.map( ( [ key, value ] ) => Object.assign( { key } , value && typeof value === 'object' ? { forms: ObjToArray( value ) } : { value, forms: [] } ) );
|
|
28
|
-
};
|
package/data/.OLD/~parseDate.js
DELETED
|
@@ -1,30 +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" : "MMDDYYYY To DD/MM/YYYY",
|
|
11
|
-
"description" : "test",
|
|
12
|
-
"version" : "0.0.1",
|
|
13
|
-
"command" : "parseDate",
|
|
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.parseDate = ( value , separator = '/' ) => {
|
|
25
|
-
if (!value) return null;
|
|
26
|
-
let month = value.substring(0, 2);
|
|
27
|
-
let day = value.substring(2, 4);
|
|
28
|
-
let year = value.substring(4, 8);
|
|
29
|
-
return month + separator + day + separator + year;
|
|
30
|
-
};
|