dphelper 0.2.22 → 0.2.26

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/.jshintrc CHANGED
@@ -1,13 +1,13 @@
1
- {
2
- "esversion": 9,
3
- "asi": false,
4
- "esnext": false,
5
- "moz": true,
6
- "boss": true,
7
- "node": true,
8
- "validthis": true,
9
- "globals": {
10
- "EventEmitter": true,
11
- "Promise": true
12
- }
13
- }
1
+ {
2
+ "esversion": 11,
3
+ "asi": false,
4
+ "esnext": false,
5
+ "moz": true,
6
+ "boss": true,
7
+ "node": true,
8
+ "validthis": true,
9
+ "globals": {
10
+ "EventEmitter": true,
11
+ "Promise": true
12
+ }
13
+ }
package/README.md CHANGED
@@ -1,20 +1,30 @@
1
1
  # dpHelper
2
2
 
3
- Many utils for your projects
3
+ Many tools for your projects
4
4
 
5
- Use "npm i dphelper" to install
5
+ ## about
6
6
 
7
- in the index:
7
+ You have a lot of tools for you that make your life easier and faster!
8
+
9
+ ## install
10
+
11
+ ```js
12
+ npm install dphelper
13
+ ```
14
+
15
+ in the index (and only there):
8
16
 
9
17
  ```js
10
18
  import "dphelper"
11
19
  ```
12
20
 
13
- type 'dphelper' in your console to have a look about all available functions that you can use globaly!
21
+ ## check
22
+
23
+ type 'dphelper' in your console to have a look about all available tools that you can use globaly!
14
24
 
15
- You can call these from everywhere without import
25
+ You can call these from everywhere without import (just one at index)
16
26
 
17
- ## OPTIONS
27
+ ## LIST
18
28
 
19
29
  ### CURRENCY
20
30
 
package/data/list.json ADDED
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "name" : "Anchors to onClick",
4
+ "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",
5
+ "version" : "0.0.1",
6
+ "command" : "<command>\r\ndphelper.anchorToOnClick\r\n</command>",
7
+ "author" : "Dario Passariello",
8
+ "active" : true
9
+ },
10
+ {
11
+ "name" : "Arrays Tools",
12
+ "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.array.set( \"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",
13
+ "version" : "0.0.1",
14
+ "command" : "<command>\r\ndphelper.array \r\n</command>",
15
+ "author" : "Dario Passariello",
16
+ "active" : true
17
+ }
18
+ ]
package/init.js CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  /***********************************************************************/
9
9
 
10
- (function () {
10
+ ( () => {
11
11
 
12
12
  if (typeof window === 'undefined') {
13
13
  global.window = {};
@@ -18,6 +18,8 @@
18
18
  // CREATE ROOT STORE
19
19
  const dphelper = window.dphelper = {};
20
20
 
21
+ window.dphelper.list = require('./data/list.json');
22
+
21
23
  // FIRST MESSAGE
22
24
  console.groupCollapsed( `%c${pjson.name} v${pjson.version}%c`,"color:orange","" );
23
25
  console.debug( `%c${pjson.name} v${pjson.version}%c by Dario Passariello started`,"color:orange","" );
package/package.json CHANGED
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "name": "dphelper",
3
- "version": "0.2.22",
3
+ "version": "0.2.26",
4
4
  "description": "Many utils for your projects",
5
5
  "main": "index.js",
6
6
  "publishConfig": {},
7
-
8
7
  "scripts": {
9
8
  "test1": "echo \"Error: no test specified\" && exit 1",
10
9
  "test": "jest --silent --detectOpenHandles",
11
10
  "test-coverage": "jest --coverage --silent"
12
11
  },
13
-
14
12
  "targets": {
15
13
  "main": {
16
14
  "includeNodeModules": {
@@ -21,29 +19,23 @@
21
19
  }
22
20
  },
23
21
  "deprecated": false,
24
-
25
22
  "engines": {
26
23
  "node": ">=0.10.0"
27
24
  },
28
-
29
25
  "repository": {
30
26
  "type": "git",
31
27
  "url": "https://github.com/passariello/dpHelper",
32
28
  "help": "https://github.com/passariello/dpHelper#readme"
33
29
  },
34
-
35
30
  "eslintConfig": {
36
31
  "globals": {
37
32
  "window": true
38
33
  }
39
34
  },
40
-
41
35
  "bugs": {
42
36
  "url": "https://github.com/passariello/dpHelper/issues"
43
37
  },
44
-
45
38
  "homepage": "https://github.com/passariello/dpHelper",
46
-
47
39
  "keywords": [
48
40
  "utils",
49
41
  "tools",
@@ -56,21 +48,18 @@
56
48
  "powerful",
57
49
  "passariello"
58
50
  ],
59
-
60
51
  "author": {
61
52
  "name": "Dario Passariello",
62
53
  "website": "https://dario.passariello.ca",
63
54
  "email": "dariopassariello@gmail.com"
64
55
  },
65
-
66
56
  "license": "Apache-2.0",
67
-
68
57
  "dependencies": {
69
58
  "jquery": "^3.6.0",
70
59
  "jshint": "^2.13.1",
71
- "require": "^0.4.4"
60
+ "require": "^0.4.4",
61
+ "uglify-js": "^3.14.5"
72
62
  },
73
-
74
63
  "contributors": [
75
64
  {
76
65
  "name": "Dario Passariello",
@@ -81,5 +70,4 @@
81
70
  "email": "valeriacalascaglitta@gmail.com"
82
71
  }
83
72
  ]
84
-
85
73
  }
@@ -10,26 +10,25 @@
10
10
  /***********************************************************************/
11
11
 
12
12
  window.dphelper.anchorToOnClick = function( container ){
13
- // const $ = require("jquery");
14
13
 
15
14
  $( container + ' a' ).each( function( index ) {
16
15
 
17
- let elem = $( this );
18
- let href = elem.attr( 'href' );
16
+ let elem = $( this );
17
+ let href = elem.attr( 'href' );
19
18
 
20
- if( href ){
21
- elem
22
- .on( 'mouseup', function(){
23
- Loader( 'body' , null );
24
- })
25
- .css('cursor','pointer')
26
- .addClass( dphelper.pathRail()[3].replace(/\//g, '') )
27
- .removeAttr( 'href' )
19
+ if( href ){
20
+ elem
21
+ .on( 'mouseup', function(){
22
+ Loader( 'body' , null );
23
+ })
24
+ .css('cursor','pointer')
25
+ .addClass( dphelper.pathRail()[3].replace(/\//g, '') )
26
+ .removeAttr( 'href' )
28
27
  .on( 'click', function(){
29
28
  window.location.href = href;
30
29
  window.history.pushState('', '', href);
31
30
  });
32
- }
31
+ }
33
32
 
34
33
  });
35
34
 
@@ -15,14 +15,17 @@ window.dphelper.storage = {
15
15
  if(!name) return;
16
16
  return window.localStorage.getItem( name );
17
17
  },
18
+
18
19
  set: function( name, value ) {
19
20
  if(!name || !value) return;
20
21
  window.localStorage.setItem( name, JSON.stringify(value) );
21
22
  },
23
+
22
24
  delete: function( name ) {
23
25
  if(!name) return;
24
26
  window.localStorage.removeItem( name );
25
27
  },
28
+
26
29
  clearAll: function() {
27
30
  window.localStorage.clear();
28
31
  }