dphelper 0.2.28 → 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/data/.OLD/~camelCase.js +41 -0
- package/{scripts/date2Iso.js → data/.OLD/~date2Iso.js} +31 -20
- package/{scripts/date2MMDDYYYY.js → data/.OLD/~date2MMDDYYYY.js} +27 -16
- package/{scripts/dateConvert.js → data/.OLD/~dateConvert.js} +31 -20
- package/{scripts/dateIso2Epoch.js → data/.OLD/~dateIso2Epoch.js} +28 -17
- package/{scripts/dateLocal-ISOTime.js → data/.OLD/~dateLocal-ISOTime.js} +28 -17
- package/data/.OLD/~dateUTC.js +25 -0
- package/{scripts/disableSpellCheck.js → data/.OLD/~disableSpellCheck.js} +32 -21
- package/data/.OLD/~loadJson.js +27 -0
- package/{scripts/loadJsonExternal.js → data/.OLD/~loadJsonExternal.js} +44 -32
- package/data/.OLD/~nl2br.js +26 -0
- package/{scripts/object2array.js → data/.OLD/~object2array.js} +15 -3
- package/data/.OLD/~parseDate.js +30 -0
- package/data/.OLD/~pathHash.js +27 -0
- package/data/.OLD/~pathQuery.js +28 -0
- package/data/.OLD/~pathRail.js +27 -0
- package/data/.OLD/~randomNumTmr.js +26 -0
- package/{scripts/scrollIndicator.js → data/.OLD/~scrollIndicator.js} +0 -0
- package/{scripts/scrollMemory.js → data/.OLD/~scrollMemory.js} +0 -0
- package/{scripts/scrollSmooth.js → data/.OLD/~scrollSmooth.js} +0 -0
- package/{scripts/scrollToElement.js → data/.OLD/~scrollToElement.js} +0 -0
- package/{scripts/svgSupport.js → data/.OLD/~svgSupport.js} +0 -0
- package/data/list.json +19 -26
- package/init.js +19 -5
- package/package.json +7 -9
- package/scripts/anchorToOnClick.js +15 -3
- package/scripts/array.js +29 -3
- package/scripts/console.js +86 -0
- package/scripts/cookie.js +97 -71
- package/scripts/currency.js +31 -11
- package/scripts/date.js +101 -0
- package/scripts/disable.js +88 -0
- package/scripts/event.js +39 -0
- package/scripts/font.js +52 -0
- package/scripts/form.js +113 -0
- package/scripts/indexedDB.js +47 -10
- package/scripts/isPromise.js +26 -14
- package/scripts/json.js +42 -0
- package/scripts/load.js +70 -0
- package/scripts/noCache.js +26 -14
- package/scripts/number.js +42 -0
- package/scripts/obj.js +81 -0
- package/scripts/onBeforeUnLoad.js +120 -108
- package/scripts/parseBool.js +27 -15
- package/scripts/path.js +94 -0
- package/scripts/printInfo.js +28 -16
- package/scripts/purge.js +53 -41
- package/scripts/pushState.js +33 -14
- package/scripts/screen.js +64 -0
- package/scripts/scrollbar.js +226 -0
- package/scripts/{handleEvent.js → shortcut.js} +70 -59
- package/scripts/storage.js +29 -3
- package/scripts/svg.js +372 -0
- package/scripts/text.js +78 -0
- package/scripts/time.js +41 -0
- package/scripts/timer.js +35 -0
- package/scripts/trigger.js +37 -0
- package/scripts/uuid.js +33 -14
- package/scripts/window.js +50 -38
- package/#cmd.exe.lnk +0 -0
- package/.github/workflows/codeql-analysis.yml +0 -70
- package/README.md.bak +0 -70
- package/scripts/.OLD/arrayDeleteItem.js +0 -35
- package/scripts/.OLD/arrayItemFinder.js +0 -22
- package/scripts/.OLD/arrayMerge.js +0 -20
- package/scripts/.OLD/arrayUnique.js +0 -15
- package/scripts/.OLD/loadAsset.js +0 -26
- package/scripts/addListenerMulti.js +0 -10
- package/scripts/camelCase.js +0 -29
- package/scripts/dateUTC.js +0 -14
- package/scripts/disableSelect.js +0 -46
- package/scripts/epoch.js +0 -14
- package/scripts/fontFit.js +0 -24
- package/scripts/fullScreen.js +0 -40
- package/scripts/jsonCounter.js +0 -21
- package/scripts/loadFile.js +0 -17
- package/scripts/loadJson.js +0 -15
- package/scripts/nl2br.js +0 -14
- package/scripts/parseDate.js +0 -19
- package/scripts/pathHash.js +0 -20
- package/scripts/pathQuery.js +0 -24
- package/scripts/pathRail.js +0 -26
- package/scripts/randomNum.js +0 -14
- package/scripts/randomNumTmr.js +0 -14
- package/scripts/scrollCustom.js +0 -41
- package/scripts/serializeForm.js +0 -94
- package/scripts/serializeObj.js +0 -47
- package/scripts/sleep.js +0 -14
- package/scripts/stopConsole.js +0 -49
- package/scripts/textChanger.js +0 -24
- package/scripts/triggerClick.js +0 -16
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
|
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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,16 +1,27 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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,20 +1,31 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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,17 +1,28 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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,17 +1,28 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
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
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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,21 +1,32 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
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,32 +1,44 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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,12 +1,24 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* object2array
|
|
5
|
-
*
|
|
6
3
|
* Copyright (c) 2021, Dario Passariello.
|
|
7
4
|
* Licensed under the Apache-2.0 License.
|
|
8
5
|
*/
|
|
9
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
|
+
|
|
10
22
|
/***********************************************************************/
|
|
11
23
|
|
|
12
24
|
window.dphelper.obj2array = ( object ) => {
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
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" : "Array From Hash Path",
|
|
11
|
+
"description" : "test",
|
|
12
|
+
"version" : "0.0.1",
|
|
13
|
+
"command" : "pathHash",
|
|
14
|
+
"subCommand" : [],
|
|
15
|
+
"example" : "",
|
|
16
|
+
"author" : "Dario Passariello",
|
|
17
|
+
"active" : true
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
window.dphelper._list.scripts.push( description );
|
|
21
|
+
|
|
22
|
+
/***********************************************************************/
|
|
23
|
+
// ALIAS
|
|
24
|
+
window.dphelper.pathHash = () => {
|
|
25
|
+
console.log( 'Please use "dphelper.path.hash()"' );
|
|
26
|
+
return window.dphelper.path.hash();
|
|
27
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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" : "Array From Query",
|
|
11
|
+
"description" : "test",
|
|
12
|
+
"version" : "0.0.1",
|
|
13
|
+
"command" : "pathQuery",
|
|
14
|
+
"subCommand" : [],
|
|
15
|
+
"example" : "",
|
|
16
|
+
"author" : "Dario Passariello",
|
|
17
|
+
"active" : true
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
window.dphelper._list.scripts.push( description );
|
|
21
|
+
|
|
22
|
+
/***********************************************************************/
|
|
23
|
+
// ALIAS
|
|
24
|
+
|
|
25
|
+
window.dphelper.pathQuery = () => {
|
|
26
|
+
console.log( 'Please use "dphelper.path.query()"' );
|
|
27
|
+
return window.dphelper.path.query();
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
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" : "Array From Rail",
|
|
11
|
+
"description" : "test",
|
|
12
|
+
"version" : "0.0.1",
|
|
13
|
+
"command" : "pathRail",
|
|
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.pathRail = () => {
|
|
25
|
+
console.log( 'Please use "dphelper.path.rail()"' );
|
|
26
|
+
return window.dphelper.path.rail();
|
|
27
|
+
};
|