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
package/scripts/window.js
CHANGED
|
@@ -1,38 +1,50 @@
|
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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" : "Window Options",
|
|
11
|
+
"description" : "test",
|
|
12
|
+
"version" : "0.0.1",
|
|
13
|
+
"command" : "window",
|
|
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.window = () => {
|
|
25
|
+
|
|
26
|
+
window.offScreenBuffering = "auto";
|
|
27
|
+
|
|
28
|
+
// HIDE STATUS INFORMATION ON BROWSER BAR
|
|
29
|
+
//***************************************
|
|
30
|
+
|
|
31
|
+
window.status = "";
|
|
32
|
+
window.defaultStatus = "";
|
|
33
|
+
|
|
34
|
+
// WINDOW ANIMATION
|
|
35
|
+
//**********************************
|
|
36
|
+
|
|
37
|
+
( () => {
|
|
38
|
+
return (
|
|
39
|
+
window.requestAnimationFrame ||
|
|
40
|
+
window.webkitRequestAnimationFrame ||
|
|
41
|
+
window.mozRequestAnimationFrame ||
|
|
42
|
+
window.oRequestAnimationFrame ||
|
|
43
|
+
window.msRequestAnimationFrame ||
|
|
44
|
+
function( callback ){
|
|
45
|
+
window.setTimeout( callback, 1000 / 120 );
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
})();
|
|
49
|
+
|
|
50
|
+
};
|
package/#cmd.exe.lnk
DELETED
|
Binary file
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
-
# to commit it to your repository.
|
|
3
|
-
#
|
|
4
|
-
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
-
# or to provide custom queries or build logic.
|
|
6
|
-
#
|
|
7
|
-
# ******** NOTE ********
|
|
8
|
-
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
-
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
-
# supported CodeQL languages.
|
|
11
|
-
#
|
|
12
|
-
name: "CodeQL"
|
|
13
|
-
|
|
14
|
-
on:
|
|
15
|
-
push:
|
|
16
|
-
branches: [ main ]
|
|
17
|
-
pull_request:
|
|
18
|
-
# The branches below must be a subset of the branches above
|
|
19
|
-
branches: [ main ]
|
|
20
|
-
schedule:
|
|
21
|
-
- cron: '41 18 * * 4'
|
|
22
|
-
|
|
23
|
-
jobs:
|
|
24
|
-
analyze:
|
|
25
|
-
name: Analyze
|
|
26
|
-
runs-on: ubuntu-latest
|
|
27
|
-
permissions:
|
|
28
|
-
actions: read
|
|
29
|
-
contents: read
|
|
30
|
-
security-events: write
|
|
31
|
-
|
|
32
|
-
strategy:
|
|
33
|
-
fail-fast: false
|
|
34
|
-
matrix:
|
|
35
|
-
language: [ 'javascript' ]
|
|
36
|
-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
37
|
-
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
|
38
|
-
|
|
39
|
-
steps:
|
|
40
|
-
- name: Checkout repository
|
|
41
|
-
uses: actions/checkout@v2
|
|
42
|
-
|
|
43
|
-
# Initializes the CodeQL tools for scanning.
|
|
44
|
-
- name: Initialize CodeQL
|
|
45
|
-
uses: github/codeql-action/init@v1
|
|
46
|
-
with:
|
|
47
|
-
languages: ${{ matrix.language }}
|
|
48
|
-
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
49
|
-
# By default, queries listed here will override any specified in a config file.
|
|
50
|
-
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
51
|
-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
52
|
-
|
|
53
|
-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
54
|
-
# If this step fails, then you should remove it and run the build manually (see below)
|
|
55
|
-
- name: Autobuild
|
|
56
|
-
uses: github/codeql-action/autobuild@v1
|
|
57
|
-
|
|
58
|
-
# ℹ️ Command-line programs to run using the OS shell.
|
|
59
|
-
# 📚 https://git.io/JvXDl
|
|
60
|
-
|
|
61
|
-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
62
|
-
# and modify them (or add more) to build your code if your project
|
|
63
|
-
# uses a compiled language
|
|
64
|
-
|
|
65
|
-
#- run: |
|
|
66
|
-
# make bootstrap
|
|
67
|
-
# make release
|
|
68
|
-
|
|
69
|
-
- name: Perform CodeQL Analysis
|
|
70
|
-
uses: github/codeql-action/analyze@v1
|
package/README.md.bak
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# dpHelper
|
|
2
|
-
|
|
3
|
-
Many utils for your projects
|
|
4
|
-
|
|
5
|
-
Use "npm i dphelper" to install
|
|
6
|
-
|
|
7
|
-
in the index:
|
|
8
|
-
|
|
9
|
-
```js
|
|
10
|
-
import "dphelper"
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
type 'dphelper' in your console to have a look about all available functions that you can use globaly!
|
|
14
|
-
|
|
15
|
-
You can call these from everywhere without import
|
|
16
|
-
|
|
17
|
-
## CURRENCY
|
|
18
|
-
|
|
19
|
-
```js
|
|
20
|
-
dphelper.currency( val, int = 'en-US', cur = 'USD' )
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## MEMORY
|
|
24
|
-
|
|
25
|
-
### STORAGE
|
|
26
|
-
|
|
27
|
-
```js
|
|
28
|
-
dphelper.storage.get( name )
|
|
29
|
-
dphelper.storage.set( name , value )
|
|
30
|
-
dphelper.storage.delete( name )
|
|
31
|
-
dphelper.storage.clearAll()
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### COOKIE
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
dphelper.cookie.set( name , value , time , path = '/' )
|
|
38
|
-
dphelper.cookie.get( name )
|
|
39
|
-
dphelper.cookie.delete( name )
|
|
40
|
-
dphelper.cookie.clearAll()
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### INDEXED-DB
|
|
44
|
-
|
|
45
|
-
```js
|
|
46
|
-
dphelper.indexedDB.create( storeName, table, name )
|
|
47
|
-
dphelper.indexedDB.open( storeName )
|
|
48
|
-
dphelper.indexedDB.store( storeName, table )
|
|
49
|
-
dphelper.indexedDB.insert( storeName, table, key, value )
|
|
50
|
-
dphelper.indexedDB.update( storeName, table, key, value )
|
|
51
|
-
dphelper.indexedDB.get( storeName, table, key )
|
|
52
|
-
|
|
53
|
-
window.dphelper.dbExist() -> know databases
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### NUMBERS
|
|
57
|
-
|
|
58
|
-
```js
|
|
59
|
-
dphelper.rnd() // generate long random number
|
|
60
|
-
dphelper.tmr() // generate number by timer
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### TIME
|
|
64
|
-
|
|
65
|
-
```js
|
|
66
|
-
dphelper.epoch() // return epoch time
|
|
67
|
-
dphelper.parseDate(value) // epoch to human date
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### 3Party
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* arrayDeleteItem
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.arrayDeleteItem = ( array, id ) =>{
|
|
13
|
-
|
|
14
|
-
array.some(function iter (o,i,a) {
|
|
15
|
-
|
|
16
|
-
if (o.Id === id) {
|
|
17
|
-
a.splice(i, 1);
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var key = Object.keys(o);
|
|
22
|
-
|
|
23
|
-
for (let key of Object.keys(o)) {
|
|
24
|
-
let value = o[key];
|
|
25
|
-
if(value.length && typeof value === 'object') return value && value.map(iter);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// OLD SCHOOL WAY
|
|
29
|
-
// for (var p=0; p < key.length; ++p){
|
|
30
|
-
// if( o[key[p]]?.length && typeof o[key[p]] === 'object') return o[key[p]] && o[key[p]].some(iter);
|
|
31
|
-
// }
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* arrayItemFinder
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.arrayItemFinder = (id, array) => {
|
|
13
|
-
for (let node of array) {
|
|
14
|
-
if (node.id === id) return node;
|
|
15
|
-
|
|
16
|
-
if (node.children) {
|
|
17
|
-
let finalNode = window.dphelper.arrayFindItem(id, node.children);
|
|
18
|
-
if (finalNode) return finalNode;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* arrayMerge
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.arrayMerge = (target, source) => {
|
|
13
|
-
|
|
14
|
-
for (const key of Object.keys(source)) {
|
|
15
|
-
if (source[key] instanceof Object && target[key]) Object.assign(source[key], window.dphelper.mergeArrays(target[key], source[key]));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
Object.assign(target || {}, source);
|
|
19
|
-
return target;
|
|
20
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* arrayUnique
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.arrayUnique = ( array ) => {
|
|
13
|
-
let unique = [...new Set( array )];
|
|
14
|
-
return unique;
|
|
15
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* loadAsset
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
dphelper.loadAsset = ( folder, img, path = '/assets/images/') => {
|
|
13
|
-
|
|
14
|
-
const check = /\.(ttf|eot|svg|gif|png)(\?v=[0-9]\.[0-9]\.[0-9])?$/;
|
|
15
|
-
|
|
16
|
-
const asset = require.context( path , true, /\.(ttf|eot|svg|gif|png)(\?v=[0-9]\.[0-9]\.[0-9])?$/ );
|
|
17
|
-
let dynamicLoad = null;
|
|
18
|
-
dynamicLoad = asset(`./${img}`);
|
|
19
|
-
|
|
20
|
-
if( dynamicLoad !== null ){
|
|
21
|
-
return dynamicLoad.default;
|
|
22
|
-
}else{
|
|
23
|
-
console.error(e, folder +" "+ img + ' error' );
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
};
|
package/scripts/camelCase.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* camelCase / PascalCase
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.camelCase = {
|
|
13
|
-
|
|
14
|
-
// toSpace
|
|
15
|
-
toSpace: ( string ) => {
|
|
16
|
-
string
|
|
17
|
-
.replace(/([A-Z])/g, ' $1')
|
|
18
|
-
.replace(/^./, function(str){ return str.toUpperCase(); })
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// toUnderscore
|
|
22
|
-
toUnderscore: ( string ) => {
|
|
23
|
-
string
|
|
24
|
-
.replace(/\.?([A-Z])/g, function (x,y){ return "_" + y.toLowerCase()})
|
|
25
|
-
.replace(/^_/, "");
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
|
package/scripts/dateUTC.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* parse date
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.dateUTC = () => {
|
|
13
|
-
return moment().toISOString();
|
|
14
|
-
};
|
package/scripts/disableSelect.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* disableSelect
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.disableSelect = function( el = 'body' ){
|
|
13
|
-
|
|
14
|
-
var $ = require( "jquery" );
|
|
15
|
-
var e = e || event;
|
|
16
|
-
|
|
17
|
-
const disabling = ( el ) => {
|
|
18
|
-
|
|
19
|
-
const $ = require( "jquery" );
|
|
20
|
-
|
|
21
|
-
$( el ).each( function( e ){
|
|
22
|
-
|
|
23
|
-
$( this )
|
|
24
|
-
.prop( "unselectable" , "on" )
|
|
25
|
-
.css( "MozUserSelect" , "none" )
|
|
26
|
-
.css( "WebKitUserSelect" , "none" )
|
|
27
|
-
.on( "select" , function(){ return false; })
|
|
28
|
-
.on( "selectstart" , function(){ return false; });
|
|
29
|
-
|
|
30
|
-
//this.onselectstart = function() { return false }
|
|
31
|
-
//this.oncontextmenu = function() { return false }
|
|
32
|
-
|
|
33
|
-
$( 'img, a, input, button' ).on( 'dragstart' , function( e ) {
|
|
34
|
-
e.preventDefault();
|
|
35
|
-
return false;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
document.querySelector( el ).addEventListener( 'mousedown' , function( e ){ disabling( el ); }, false );
|
|
43
|
-
document.querySelector( el ).onmousedown = function( e ){ disabling( el ); };
|
|
44
|
-
console.debug("%cSelection Disabled:%c true", "color:gray", "");
|
|
45
|
-
|
|
46
|
-
};
|
package/scripts/epoch.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* epoch
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.epoch = () => {
|
|
13
|
-
return new Date().getTime();
|
|
14
|
-
};
|
package/scripts/fontFit.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function fontFitStart(){
|
|
4
|
-
|
|
5
|
-
var divs = document.querySelectorAll( name );
|
|
6
|
-
if( divs.length <= 0 ) return;
|
|
7
|
-
|
|
8
|
-
for(var i = 0; i < divs.length; i++) {
|
|
9
|
-
var fontSize = divs[i].offsetWidth * 0.05;
|
|
10
|
-
divs[i].style.fontSize = fontSize+'px';
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
window.dphelper.fontFit = ( name ) => {
|
|
15
|
-
|
|
16
|
-
if( !name ) return;
|
|
17
|
-
window.dphelper.addListenerMulti( window , 'load resize', () => {
|
|
18
|
-
fontFitStart( name );
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
package/scripts/fullScreen.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* fullScreenToggle, fullScreen
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.fullScreenToggle = function( el ) {
|
|
13
|
-
|
|
14
|
-
let requestFullScreen = el.requestFullscreen || el.mozRequestFullScreen || el.webkitRequestFullScreen || el.msRequestFullscreen;
|
|
15
|
-
let cancelFullScreen = el.exitFullscreen || el.mozCancelFullScreen || el.webkitExitFullscreen || el.msExitFullscreen;
|
|
16
|
-
|
|
17
|
-
if( !doc.fullscreenElement && !el.mozFullScreenElement && !el.webkitFullscreenElement && !el.msFullscreenElement ) {
|
|
18
|
-
requestFullScreen.call( el );
|
|
19
|
-
}else{
|
|
20
|
-
cancelFullScreen.call( el );
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// window.dphelper.fullScreenToggle( document.body )
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/*****************************************************************************************/
|
|
27
|
-
|
|
28
|
-
window.dphelper.fullScreen = function( el ){
|
|
29
|
-
|
|
30
|
-
if ( el.requestFullScreen ) {
|
|
31
|
-
el.requestFullScreen();
|
|
32
|
-
} else if ( el.mozRequestFullScreen ) {
|
|
33
|
-
el.mozRequestFullScreen();
|
|
34
|
-
} else if ( el.webkitRequestFullScreen ) {
|
|
35
|
-
el.webkitRequestFullScreen();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// window.dphelper.fullScreen( document.body )
|
|
39
|
-
|
|
40
|
-
};
|
package/scripts/jsonCounter.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* jsonCounter
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.jsonCounter = (json, key, val) => {
|
|
13
|
-
if (!json) return null;
|
|
14
|
-
let keyCount;
|
|
15
|
-
if (key && val) {
|
|
16
|
-
keyCount = Object.keys(jsonObject).length;
|
|
17
|
-
} else {
|
|
18
|
-
keyCount = json.items.filter(value => value.key === val).lengt;
|
|
19
|
-
}
|
|
20
|
-
return keyCount;
|
|
21
|
-
};
|
package/scripts/loadFile.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* loadFile
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.loadFile = (element, path) => {
|
|
13
|
-
fetch(path).then(async function (response) {
|
|
14
|
-
const text = await response.text();
|
|
15
|
-
document.querySelector( element ).innerHTML = dphelper.nl2br( String(text) );
|
|
16
|
-
});
|
|
17
|
-
};
|
package/scripts/loadJson.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* loadJson
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.loadJson = function( file ){
|
|
13
|
-
if ( file.match(/.(json)$/i ) ) return require( '' + file + '' );
|
|
14
|
-
};
|
|
15
|
-
|
package/scripts/nl2br.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* nl2br
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.nl2br = (str) => {
|
|
13
|
-
return str.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
|
14
|
-
};
|
package/scripts/parseDate.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* parse date
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.parseDate = (value) => {
|
|
13
|
-
if (!value) return null;
|
|
14
|
-
let separator = '/';
|
|
15
|
-
let month = value.substring(0, 2);
|
|
16
|
-
let day = value.substring(2, 4);
|
|
17
|
-
let year = value.substring(4, 8);
|
|
18
|
-
return month + separator + day + separator + year;
|
|
19
|
-
};
|
package/scripts/pathHash.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* path Hash
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.pathHash = () => {
|
|
13
|
-
const array = location.hash
|
|
14
|
-
.replace('#', '').split('/');
|
|
15
|
-
if (array.length) {
|
|
16
|
-
return array.filter(item => item);
|
|
17
|
-
} else {
|
|
18
|
-
return ["empty"];
|
|
19
|
-
}
|
|
20
|
-
};
|
package/scripts/pathQuery.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* dpHelper <https://github.com/passariello/dpHelper>
|
|
3
|
-
*
|
|
4
|
-
* path Query
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021, Dario Passariello.
|
|
7
|
-
* Licensed under the Apache-2.0 License.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/***********************************************************************/
|
|
11
|
-
|
|
12
|
-
window.dphelper.pathQuery = () => {
|
|
13
|
-
let x, y, array = [], search = location.search;
|
|
14
|
-
if (search) {
|
|
15
|
-
search.replace("?", '').split('&')
|
|
16
|
-
.map(x => {
|
|
17
|
-
y = x.split('=');
|
|
18
|
-
array[y[0]] = y[1];
|
|
19
|
-
});
|
|
20
|
-
return array;
|
|
21
|
-
} else {
|
|
22
|
-
return ["empty"];
|
|
23
|
-
}
|
|
24
|
-
};
|