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.
Files changed (60) hide show
  1. package/.vscode/settings.json +19 -4
  2. package/README.md +73 -28
  3. package/assets/images/banner.png +0 -0
  4. package/assets/logos/logo.svg +64 -0
  5. package/linuxone_biglogic.session.sql +0 -0
  6. package/linuxone_ug3d.session.sql +0 -0
  7. package/localhost.session.sql +0 -0
  8. package/package.json +1 -1
  9. package/scripts/anchorToOnClick.js +4 -4
  10. package/scripts/array.js +1 -1
  11. package/scripts/browser.js +69 -0
  12. package/scripts/console.js +1 -1
  13. package/scripts/cookie.js +1 -1
  14. package/scripts/date.js +1 -1
  15. package/scripts/disable.js +8 -6
  16. package/scripts/event.js +1 -1
  17. package/scripts/font.js +1 -1
  18. package/scripts/form.js +1 -1
  19. package/scripts/function.js +47 -0
  20. package/scripts/indexedDB.js +1 -1
  21. package/scripts/json.js +1 -1
  22. package/scripts/load.js +1 -1
  23. package/scripts/noCache.js +1 -1
  24. package/scripts/number.js +26 -2
  25. package/scripts/obj.js +3 -3
  26. package/scripts/onBeforeUnLoad.js +1 -1
  27. package/scripts/path.js +14 -14
  28. package/scripts/{pushState.js → promise.js} +9 -7
  29. package/scripts/screen.js +3 -3
  30. package/scripts/scrollbar.js +2 -2
  31. package/scripts/storage.js +1 -1
  32. package/scripts/text.js +1 -1
  33. package/scripts/time.js +1 -1
  34. package/scripts/timer.js +1 -1
  35. package/scripts/trigger.js +10 -1
  36. package/scripts/type.js +56 -0
  37. package/data/.OLD/~camelCase.js +0 -41
  38. package/data/.OLD/~date2Iso.js +0 -31
  39. package/data/.OLD/~date2MMDDYYYY.js +0 -27
  40. package/data/.OLD/~dateConvert.js +0 -31
  41. package/data/.OLD/~dateIso2Epoch.js +0 -28
  42. package/data/.OLD/~dateLocal-ISOTime.js +0 -28
  43. package/data/.OLD/~dateUTC.js +0 -25
  44. package/data/.OLD/~disableSpellCheck.js +0 -32
  45. package/data/.OLD/~loadJson.js +0 -27
  46. package/data/.OLD/~loadJsonExternal.js +0 -44
  47. package/data/.OLD/~nl2br.js +0 -26
  48. package/data/.OLD/~object2array.js +0 -28
  49. package/data/.OLD/~parseDate.js +0 -30
  50. package/data/.OLD/~pathHash.js +0 -27
  51. package/data/.OLD/~pathQuery.js +0 -28
  52. package/data/.OLD/~pathRail.js +0 -27
  53. package/data/.OLD/~randomNumTmr.js +0 -26
  54. package/data/.OLD/~scrollIndicator.js +0 -67
  55. package/data/.OLD/~scrollMemory.js +0 -26
  56. package/data/.OLD/~scrollSmooth.js +0 -74
  57. package/data/.OLD/~scrollToElement.js +0 -25
  58. package/data/.OLD/~svgSupport.js +0 -346
  59. package/scripts/isPromise.js +0 -26
  60. package/scripts/printInfo.js +0 -28
@@ -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" : "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
- };
@@ -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" : "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
- };
@@ -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" : "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
- };
@@ -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" : "Random Number From Timer",
11
- "description" : "test",
12
- "version" : "0.0.1",
13
- "command" : "tmr",
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.tmr = () => {
25
- return Math.round(dphelper.epoch() / 1000);
26
- };
@@ -1,67 +0,0 @@
1
- /*!
2
- * dpHelper <https://github.com/passariello/dpHelper>
3
- *
4
- * scrollIndicator
5
- *
6
- * Copyright (c) 2021, Dario Passariello.
7
- * Licensed under the Apache-2.0 License.
8
- */
9
-
10
- /***********************************************************************/
11
-
12
- window.dphelper.scrollIndicator = ( props ) => {
13
-
14
- /**
15
- /* This timeout it's to be suse that whole UI is loaded
16
- /* Just smaller trick!
17
- */
18
-
19
- let cont = document.querySelector( props.el );
20
- let sc = document.querySelector('.scrollindicator');
21
-
22
- if( !sc ){
23
-
24
- const createEl = document.createElement('div');
25
- createEl.classList.add("scrollindicator");
26
- document.querySelector('header').appendChild(createEl);
27
-
28
- createEl.style.cssText = `
29
- height:5px;
30
- background:#65c45c;
31
- position:absolute;
32
- bottom:0;
33
- left:0;
34
- z-index:2
35
- `;
36
- }
37
-
38
- if( !props.el && sc) {
39
- sc.style.width = 0 + '%';
40
- return null;
41
- }
42
-
43
- try{
44
- let sc = document.querySelector('.scrollindicator');
45
- cont.addEventListener( 'scroll' , function ( e ) {
46
-
47
- sc.style.width = 0 + '%';
48
- let winScroll = this.scrollTop || this.scrollTop;
49
- let height = this.scrollHeight - this.clientHeight;
50
- let scrolled = Math.min(Math.max(parseInt( (winScroll / height) * 100 ), 0), 100);
51
- sc.style.width = scrolled + '%';
52
-
53
- sc.click();
54
-
55
- });
56
-
57
- window.addEventListener('popstate', function ( e ) {
58
- sc.style.width = 0;
59
- });
60
-
61
- }catch( e ){
62
- return;
63
- }
64
-
65
- return null;
66
-
67
- };
@@ -1,26 +0,0 @@
1
- /*!
2
- * dpHelper <https://github.com/passariello/dpHelper>
3
- *
4
- * setScrollPos, getScrollPos
5
- *
6
- * Copyright (c) 2021, Dario Passariello.
7
- * Licensed under the Apache-2.0 License.
8
- */
9
-
10
- /*****************************************************************************************/
11
- // SAVE OLD SCROLL POSITION
12
-
13
- window.dphelper.setScrollPos = ( el ) => {
14
- let ar = [ $( el ).scrollTop() , $( el ).scrollLeft() ];
15
- if( ar[0] != null && ar[1] != null ){ window.dphelper.storage.set( el , ar ); }
16
- };
17
-
18
- /*****************************************************************************************/
19
- // LOAD OLD SCROLL POSITION
20
-
21
- window.dphelper.getScrollPos = ( el ) => {
22
- if( !window.dphelper.storage.get( el ) ) return;
23
- let ar = window.dphelper.storage.get( el ).trim().split(',');
24
- $( el ).scrollTop( ar[0] );
25
- $( el ).scrollLeft( ar[1] );
26
- };
@@ -1,74 +0,0 @@
1
- /*!
2
- * dpHelper <https://github.com/passariello/dpHelper>
3
- *
4
- * scrollSmooth
5
- *
6
- * Copyright (c) 2021, Dario Passariello.
7
- * Licensed under the Apache-2.0 License.
8
- */
9
-
10
- /***********************************************************************/
11
-
12
- // function init(){
13
- // new scrollSmooth(document,120,12);
14
- // }
15
-
16
- window.dphelper.scrollSmooth = (target, speed, smooth) => {
17
- if (target === document)
18
- target = (document.scrollingElement || document.documentElement || document.body.parentNode || document.body); // cross browser support for document scrolling
19
-
20
- let moving = false;
21
- let pos = target.scrollTop;
22
- let frame = target === document.body && document.documentElement ? document.documentElement : target; // safari is the new IE
23
-
24
- target.addEventListener('mousewheel', scrolled, { passive: false });
25
- target.addEventListener('DOMMouseScroll', scrolled, { passive: false });
26
-
27
- function scrolled( e ) {
28
- e.preventDefault(); // disable default scrolling
29
-
30
- let delta = normalizeWheelDelta( e );
31
-
32
- pos += -delta * speed;
33
- pos = Math.max(0, Math.min(pos, target.scrollHeight - frame.clientHeight)); // limit scrolling
34
-
35
- if (!moving) update();
36
- }
37
-
38
- function normalizeWheelDelta( e ){
39
- if(e.detail){
40
- if(e.wheelDelta)
41
- return e.wheelDelta/e.detail/40 * (e.detail>0 ? 1 : -1); // Opera
42
- else
43
- return -e.detail/3; // Firefox
44
- }else
45
- return e.wheelDelta/120; // IE,Safari,Chrome
46
- }
47
-
48
- function update() {
49
- moving = true;
50
-
51
- let delta = (pos - target.scrollTop) / smooth;
52
-
53
- target.scrollTop += delta;
54
-
55
- if (Math.abs(delta) > 0.5)
56
- requestFrame(update);
57
- else
58
- moving = false;
59
- }
60
-
61
- let requestFrame = function() { // requestAnimationFrame cross browser
62
- return (
63
- window.requestAnimationFrame ||
64
- window.webkitRequestAnimationFrame ||
65
- window.mozRequestAnimationFrame ||
66
- window.oRequestAnimationFrame ||
67
- window.msRequestAnimationFrame ||
68
- function(func) {
69
- window.setTimeout(func, 1000 / 50);
70
- }
71
- );
72
- }();
73
-
74
- };
@@ -1,25 +0,0 @@
1
- /*!
2
- * dpHelper <https://github.com/passariello/dpHelper>
3
- *
4
- * scrollToElement
5
- *
6
- * Copyright (c) 2021, Dario Passariello.
7
- * Licensed under the Apache-2.0 License.
8
- */
9
-
10
- /***********************************************************************/
11
-
12
- window.dphelper.scrollToElement = function( container, element, gap = 0 ) {
13
-
14
- let el1 = document.querySelector( container );
15
- let el2 = document.querySelector( element );
16
- let el3 = gap; // DIVERGENCE
17
-
18
- if( !el1 || !el2 || !el3 ) return;
19
-
20
- el1.scrollTo({
21
- top: el2.offsetTop,
22
- behavior: "smooth"
23
- });
24
-
25
- };
@@ -1,346 +0,0 @@
1
- /*!
2
- * dpHelper <https://github.com/passariello/dpHelper>
3
- *
4
- * svgSupport
5
- *
6
- * Copyright (c) 2021, Dario Passariello.
7
- * Licensed under the Apache-2.0 License.
8
- */
9
-
10
- /***********************************************************************/
11
-
12
- window.dphelper.svg_supportsVml = function () {
13
-
14
- if ( typeof window.dphelper.svg_supportsVml.supported == "undefined" ) {
15
-
16
- let a = document.body.appendChild( document.createElement( 'div' ) );
17
- a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
18
-
19
- let b = a.firstChild;
20
- b.style.behavior = "url(#default#VML)";
21
- window.dphelper.svg_supportsVml.supported = b ? typeof b.adj == "object" : true;
22
- a.parentNode.removeChild( a );
23
-
24
- }
25
-
26
- return window.dphelper.svg_supportsVml.supported;
27
-
28
- };
29
-
30
- window.dphelper.svg_supportsVml();
31
-
32
- /**************************************************************************************************/
33
- /**************************************************************************************************/
34
-
35
- window.dphelper.svg_initConnection = function( container, source1, source2, cb ) {
36
-
37
- if( $( container ).find( 'svg' ) ) {
38
- window.dphelper.svg_removeConnection( container );
39
- }
40
-
41
- source1 = window.dphelper.svg_setConnector( source1[ 0 ], source1[ 1 ] );
42
- source2 = window.dphelper.svg_setConnector( source2[ 0 ], source2[ 1 ] );
43
-
44
- let parentCoords = container.getBoundingClientRect();
45
-
46
- let xmlns = "http://www.w3.org/2000/svg";
47
- let boxWidth = container.offsetWidth * 10;
48
- let boxHeight = container.offsetHeight * 10;
49
-
50
- // create svg container
51
- let svgElem = document.createElementNS( xmlns, "svg" );
52
-
53
- svgElem.setAttribute( "xmlns" , xmlns );
54
- svgElem.setAttributeNS( null , "id" , "pathConnection" );
55
- svgElem.setAttributeNS( null , "viewBox" , "0 0 " + boxWidth + " " + boxHeight );
56
- svgElem.setAttributeNS( null , "width" , boxWidth );
57
- svgElem.setAttributeNS( null , "height" , boxHeight );
58
- svgElem.style.display = "block";
59
-
60
- /*
61
- // TO DO: smaller cyrcle
62
- // DARIO: probably is too invasive on UI, I change just border on parts_container_
63
-
64
- // create arrow
65
- let defs = document.createElementNS(xmlns, "defs");
66
- let marker = document.createElementNS(xmlns, "marker");
67
- let path = document.createElementNS(xmlns, "path");
68
- marker.setAttributeNS(null, 'id', 'head');
69
- marker.setAttributeNS(null, 'orient', 'auto');
70
- marker.setAttributeNS(null, 'markerWidth', '20');
71
- marker.setAttributeNS(null, 'markerHeight', '40');
72
- marker.setAttributeNS(null, 'refX', '0');
73
- marker.setAttributeNS(null, 'refY', '3');
74
- path.setAttributeNS(null, 'd', 'M0,0 V6 L3,3 Z');
75
- marker.appendChild(path);
76
- defs.appendChild(marker);
77
- svgElem.appendChild(defs);
78
- */
79
-
80
- // create rect which overlaps source1
81
- let rect1 = document.createElementNS( xmlns , "rect" );
82
- let coords = source1.getBoundingClientRect();
83
-
84
- rect1.setAttributeNS( null, 'x', coords.left - parentCoords.left );
85
- rect1.setAttributeNS( null, 'y', coords.top - parentCoords.top );
86
- rect1.setAttributeNS( null, 'width', coords.width );
87
- rect1.setAttributeNS( null, 'height', coords.height );
88
- svgElem.appendChild( rect1 );
89
-
90
- // create rect which overlaps source2
91
- let rect2 = document.createElementNS( xmlns, "rect" );
92
- coords = source2.getBoundingClientRect();
93
-
94
- rect2.setAttributeNS( null, 'x', coords.left - parentCoords.left );
95
- rect2.setAttributeNS( null, 'y', coords.top - parentCoords.top );
96
- rect2.setAttributeNS( null, 'width', coords.width );
97
- rect2.setAttributeNS( null, 'height', coords.height );
98
- svgElem.appendChild( rect2 );
99
-
100
- // create path connecting both rects
101
- let path = document.createElementNS( xmlns, "path" );
102
-
103
- path.setAttributeNS( null, 'id', 'connection' );
104
- path.setAttributeNS( null, 'marker-end', 'url(#head)' );
105
- svgElem.appendChild( path );
106
-
107
- container.appendChild( svgElem );
108
-
109
- window.dphelper.svg_updateConnection( $( rect1 )[0], $( rect2 )[0], $( '#connection' )[0]);
110
-
111
- if( typeof cb == 'function' ) {
112
- cb( source1, source2 );
113
- }
114
-
115
- };
116
-
117
- /**************************************************************************************************/
118
-
119
- window.dphelper.svg_updateConnection = function( rect1 , rect2 , cxn ) {
120
-
121
- // Top left coordinates
122
- let x1 = parseFloat( rect1.getAttribute( 'x' ) );
123
- let y1 = parseFloat( rect1.getAttribute( 'y' ) );
124
- let x2 = parseFloat( rect2.getAttribute( 'x') );
125
- let y2 = parseFloat( rect2.getAttribute( 'y' ) );
126
-
127
- // Half widths and half heights
128
- let w1 = parseFloat( rect1.getAttribute( 'width' ) ) / 2;
129
- let h1 = parseFloat( rect1.getAttribute( 'height' ) ) / 2;
130
- let w2 = parseFloat( rect2.getAttribute( 'width' ) ) / 2;
131
- let h2 = parseFloat( rect2.getAttribute( 'height' ) ) / 2;
132
-
133
- // Center coordinates
134
- let cx1 = x1 + w1;
135
- let cy1 = y1 + h1;
136
- let cx2 = x2 + w2;
137
- let cy2 = y2 + h2;
138
-
139
- // Distance between centers
140
- let dx = cx2 - cx1;
141
- let dy = cy2 - cy1;
142
-
143
- let p1 = window.dphelper.svg_getIntersection( dx , dy , cx1 , cy1 , w1 , h1 );
144
- let p2 = window.dphelper.svg_getIntersection( -dx , -dy , cx2 , cy2 , w2 , h2 );
145
-
146
- // Distance between edges
147
- let dx1 = p2[ 0 ] - p1[ 0 ];
148
-
149
- let d = window.dphelper.svg_getCurve( p1 , p2 , dx1 );
150
-
151
- // Set a path connector
152
- cxn.setAttributeNS( null , 'd' , "M" + cx1 + "," + cy1 + d + cx2 + "," + cy2 );
153
-
154
- // Set a line connector
155
- // cxn.setAttributeNS( null , 'x1' , p1[0] );
156
- // cxn.setAttributeNS( null , 'y1' , p1[1] );
157
- // cxn.setAttributeNS( null , 'x2' , p2[0] );
158
- // cxn.setAttributeNS( null , 'y2' , p2[1] );
159
-
160
- };
161
-
162
- /**************************************************************************************************/
163
-
164
- window.dphelper.svg_getCurve = function( p1 , p2 , dx ) {
165
-
166
- let curve = dx / 2;
167
- let d = " C" + ( curve + p1[0] ) + "," + p1[1] + " " + ( p2[0] - curve ) + "," + p2[1] + " ";
168
- return d;
169
-
170
- };
171
-
172
- window.dphelper.svg_getIntersection = function( dx , dy , cx , cy , w , h ) {
173
-
174
- if ( Math.abs( dy / dx ) < h / w )
175
- return [ cx + ( dx > 0 ? w : -w ), cy + dy * w / Math.abs( dx ) ];
176
- else
177
- return [ cx + dx * h / Math.abs( dy ), cy + ( dy > 0 ? h : -h ) ];
178
-
179
- };
180
-
181
- /**************************************************************************************************/
182
-
183
- window.dphelper.svg_makeScrollable = function( svgContainer , scrollContainer , elm1 , elm2 , rect1 , rect2 ) {
184
-
185
- //let scrollCoords = scrollContainer.getBoundingClientRect();
186
- let svgCoords = svgContainer.getBoundingClientRect();
187
-
188
- let el = [ elm1 , elm2 ];
189
- let rec = [ rect1 , rect2 ];
190
- let coords = [];
191
-
192
- for( let i = 0; i < el.length; i++ ){
193
-
194
- coords[ i ] = el[ i ].getBoundingClientRect();
195
-
196
- rec[ i ].setAttributeNS( null, 'x', coords[ i ].left - svgCoords.left );
197
- rec[ i ].setAttributeNS( null, 'y', coords[ i ].top - svgCoords.top );
198
- rec[ i ].setAttributeNS( null, 'width', coords[ i ].width );
199
- rec[ i ].setAttributeNS( null, 'height', coords[ i ].height );
200
-
201
- }
202
-
203
- //***************************************************************
204
-
205
- window.dphelper.svg_updateConnection( $( rect1 )[ 0 ], $( rect2 )[ 0 ], $( '#connection' )[ 0 ]);
206
-
207
- };
208
-
209
- /**************************************************************************************************/
210
-
211
- window.dphelper.svg_makeDraggable = function( evt ) {
212
-
213
- let svg = evt.target;
214
- svg.addEventListener( 'mousedown' , startDrag );
215
- svg.addEventListener( 'mousemove' , drag );
216
- svg.addEventListener( 'mouseup' , endDrag );
217
-
218
- function getMousePosition( e ) {
219
- let CTM = svg.getScreenCTM();
220
- return {
221
- x: ( evt.clientX - CTM.e ) / CTM.a,
222
- y: ( evt.clientY - CTM.f ) / CTM.d
223
- };
224
- }
225
-
226
- let selectedElement, offset;
227
-
228
- function startDrag( evt ) {
229
-
230
- if ( evt.target.classList.contains( 'draggable' ) ) {
231
- selectedElement = evt.target;
232
- offset = getMousePosition( evt );
233
- offset.x -= parseFloat( selectedElement.getAttributeNS( null , "x" ) );
234
- offset.y -= parseFloat( selectedElement.getAttributeNS( null , "y" ) );
235
- }
236
-
237
- }
238
-
239
- function drag( evt ) {
240
-
241
- if ( selectedElement ) {
242
- let coord = getMousePosition( evt );
243
- selectedElement.setAttributeNS( null, "x" , coord.x - offset.x );
244
- selectedElement.setAttributeNS( null, "y" , coord.y - offset.y );
245
- window.dphelper.svg_updateConnection();
246
- }
247
-
248
- }
249
-
250
- function endDrag( evt ) {
251
- selectedElement = null;
252
- }
253
-
254
- };
255
-
256
- /**************************************************************************************************/
257
-
258
- window.dphelper.svg_setConnector = function( source , side ) {
259
-
260
- let style;
261
- let span = $( '<span class="connector"></span>' );
262
-
263
- $( source ).css( 'position' , 'relative' );
264
-
265
- span.css({
266
- position: 'absolute',
267
- width: '5px',
268
- height: '5px',
269
- });
270
-
271
- switch( side ) {
272
- case 'top':
273
- style = {
274
- left: '50%',
275
- top: '2.5px',
276
- marginLeft: '2.5px'
277
- };
278
- break;
279
- case 'right':
280
- style = {
281
- top: '50%',
282
- right: '2.5px',
283
- marginTop: '-2.5px'
284
- };
285
- break;
286
- case 'bottom':
287
- style = {
288
- left: '50%',
289
- bottom: '-2.5px',
290
- marginLeft: '2.5px'
291
- };
292
- break;
293
- case 'left':
294
- style = {
295
- top: '50%',
296
- left: '-2.5px',
297
- marginTop: '-2.5px'
298
- };
299
- break;
300
- default:
301
- style = {};
302
- }
303
-
304
- span.css( style );
305
-
306
- $( source ).append( span );
307
-
308
- return $( span )[ 0 ];
309
- };
310
-
311
- /**************************************************************************************************/
312
-
313
- window.dphelper.svg_handleSvgToggle = function( evt , container , source1 , source2 ) {
314
-
315
- if( $( evt.target ).prop( 'checked' ) && $( source1 ).length && $( source2 ).length ) {
316
-
317
- window.dphelper.cookie.set( $( evt.target ).attr( 'id' ), 1, 365 );
318
-
319
- window.dphelper.svg_initConnection( container[0], [ $( source1 )[0], 'right' ], [ $( source2 )[0], 'left' ], function( source1 , source2 ) {
320
-
321
- $( '#parts-left-body' ).on( 'scroll', function( evt ){
322
- window.dphelper.svg_makeScrollable( $( container )[0], $( '#parts-left-body' )[0], $( source1 )[0],
323
- $( source2 )[0], $( '#parts svg rect' )[0], $( '#parts svg rect' )[ 1 ] );
324
- });
325
-
326
- });
327
-
328
- } else {
329
-
330
- window.dphelper.svg_removeConnection( container );
331
- $( '#parts-left-body' ).unbind( 'scroll' );
332
- window.dphelper.cookie.set( $( evt.target ).attr( 'id' ), 0, 365 );
333
-
334
- }
335
-
336
- };
337
-
338
- /**************************************************************************************************/
339
-
340
- window.dphelper.svg_removeConnection = function( container ) {
341
-
342
- $( container ).find( 'svg#pathConnection' ).each( function( i , elm ) {
343
- $( elm ).remove();
344
- });
345
-
346
- };
@@ -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" : "Check If It's a Promise",
11
- "description" : "test",
12
- "version" : "0.0.1",
13
- "command" : "isPromise",
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.isPromise = (p) => {
25
- return p && Object.prototype.toString.call(p) === "[object Promise]";
26
- };