dphelper 0.2.26 → 0.2.27
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/{cmd.exe.lnk → #cmd.exe.lnk} +0 -0
- package/data/list.json +25 -17
- package/init.js +5 -0
- package/package.json +11 -1
- package/scripts/addListenerMulti.js +10 -0
- package/scripts/disableSelect.js +9 -6
- package/scripts/fontFit.js +24 -0
|
File without changes
|
package/data/list.json
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
{
|
|
3
|
-
"
|
|
4
|
-
"description" : "
|
|
5
|
-
"version" : "0.0.1",
|
|
6
|
-
"command" : "<command>\r\ndphelper.anchorToOnClick\r\n</command>",
|
|
7
|
-
"author" : "Dario Passariello",
|
|
8
|
-
"active" : true
|
|
1
|
+
{
|
|
2
|
+
"info" : {
|
|
3
|
+
"title" : "List",
|
|
4
|
+
"description" : "Complete list of tools"
|
|
9
5
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
"scripts" : [
|
|
7
|
+
{
|
|
8
|
+
"name" : "Anchors to onClick",
|
|
9
|
+
"description" : "Transform all anchor inside specific elements in to onClick (DOM)\r\n<br/>\r\n<br/>\r\n\r\nUsage: <br/>\r\n<br/>\r\n\r\n<code>\r\ndphelper.anchorToOnClick( \"your element(s)\" )\r\n</code>\r\n\r\n<br/>\r\n<br/>\r\nAutomatically all anchors became onClick. Use it at end off page or defer or after DOMs loaded \r\n\r\n",
|
|
10
|
+
"version" : "0.0.1",
|
|
11
|
+
"command" : "anchorToOnClick",
|
|
12
|
+
"example" : "dphelper.anchorToOnClick(\"nav\") --> now all nav anchor are onClick ( href is removed )",
|
|
13
|
+
"author" : "Dario Passariello",
|
|
14
|
+
"active" : true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name" : "Arrays Tools",
|
|
18
|
+
"description" : "Useful way to andle array without efforts\r\n<br/>\r\n\r\n\r\n",
|
|
19
|
+
"version" : "0.0.1",
|
|
20
|
+
"command" : "array",
|
|
21
|
+
"example" : "// FIND\r\ndphelper.array.find( 12345 , YourArray ) --> search your data\r\n\r\n// UNIQUE\r\ndphelper.array.unique( YourArray ) --> remove duplicates\r\n\r\n// DELETE\r\ndphelper.array.delete( 12345 , YourArray ) --> remove a sub-data using id\r\n\r\n// MERGE\r\ndphelper.array.merge( YourArray1 , YourArray2 ) --> result is YourArray3 ",
|
|
22
|
+
"author" : "Dario Passariello",
|
|
23
|
+
"active" : true
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
package/init.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
const dphelper = window.dphelper = {};
|
|
20
20
|
|
|
21
21
|
window.dphelper.list = require('./data/list.json');
|
|
22
|
+
window.dphelper.list.version = pjson.version;
|
|
22
23
|
|
|
23
24
|
// FIRST MESSAGE
|
|
24
25
|
console.groupCollapsed( `%c${pjson.name} v${pjson.version}%c`,"color:orange","" );
|
|
@@ -36,6 +37,9 @@
|
|
|
36
37
|
|
|
37
38
|
const $ = require("jquery");
|
|
38
39
|
|
|
40
|
+
// SYSTEM
|
|
41
|
+
require('./scripts/addListenerMulti.js');
|
|
42
|
+
|
|
39
43
|
// 3party
|
|
40
44
|
require('./3party/shortcut.js');
|
|
41
45
|
|
|
@@ -94,6 +98,7 @@
|
|
|
94
98
|
require('./scripts/scrollCustom.js');
|
|
95
99
|
|
|
96
100
|
// OTHER
|
|
101
|
+
require('./scripts/fontFit.js');
|
|
97
102
|
require('./scripts/uuid.js');
|
|
98
103
|
require('./scripts/noCache.js');
|
|
99
104
|
require('./scripts/parseBool.js');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dphelper",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"description": "Many utils for your projects",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {},
|
|
@@ -27,6 +27,16 @@
|
|
|
27
27
|
"url": "https://github.com/passariello/dpHelper",
|
|
28
28
|
"help": "https://github.com/passariello/dpHelper#readme"
|
|
29
29
|
},
|
|
30
|
+
"funding": [
|
|
31
|
+
{
|
|
32
|
+
"type" : "individual",
|
|
33
|
+
"url" : "https://www.paypal.com/donate/?business=HC7LJ2ZXRRNDL&no_recurring=0&item_name=I+am+a+software+developer.+Just+a+donation+can+help+me+to+have+more+time+to+dedicate+on+this+project¤cy_code=CAD"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type" : "patreon",
|
|
37
|
+
"url" : "https://www.patreon.com/passariello"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
30
40
|
"eslintConfig": {
|
|
31
41
|
"globals": {
|
|
32
42
|
"window": true
|
package/scripts/disableSelect.js
CHANGED
|
@@ -9,13 +9,16 @@
|
|
|
9
9
|
|
|
10
10
|
/***********************************************************************/
|
|
11
11
|
|
|
12
|
-
window.dphelper.disableSelect = function(
|
|
12
|
+
window.dphelper.disableSelect = function( el = 'body' ){
|
|
13
|
+
|
|
14
|
+
var $ = require( "jquery" );
|
|
15
|
+
var e = e || event;
|
|
13
16
|
|
|
14
|
-
const disabling = (
|
|
17
|
+
const disabling = ( el ) => {
|
|
15
18
|
|
|
16
|
-
const $ = require("jquery");
|
|
19
|
+
const $ = require( "jquery" );
|
|
17
20
|
|
|
18
|
-
$(
|
|
21
|
+
$( el ).each( function( e ){
|
|
19
22
|
|
|
20
23
|
$( this )
|
|
21
24
|
.prop( "unselectable" , "on" )
|
|
@@ -36,8 +39,8 @@
|
|
|
36
39
|
|
|
37
40
|
};
|
|
38
41
|
|
|
39
|
-
document.
|
|
40
|
-
document.
|
|
42
|
+
document.querySelector( el ).addEventListener( 'mousedown' , function( e ){ disabling( el ); }, false );
|
|
43
|
+
document.querySelector( el ).onmousedown = function( e ){ disabling( el ); };
|
|
41
44
|
console.debug("%cSelection Disabled:%c true", "color:gray", "");
|
|
42
45
|
|
|
43
46
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
|