dphelper 0.2.89 → 0.2.93
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/{LICENSE.txt → LICENSE.md} +0 -0
- package/README.md +6 -0
- package/index.js +2 -12
- package/package.json +130 -136
- package/.editorconfig +0 -13
- package/.env +0 -3
- package/.eslintignore +0 -13
- package/.eslintrc.json +0 -87
- package/.eslintrc.legacy.json +0 -91
- package/.gitattributes +0 -2
- package/.github/FUNDING.yml +0 -12
- package/.github/dependabot.yml +0 -12
- package/.hintrc +0 -11
- package/.jsbeautifyrc +0 -25
- package/.jshintrc +0 -16
- package/.prettierignore +0 -2
- package/.prettierrc.json +0 -8
- package/.stylelintignore +0 -0
- package/.stylelintrc.json +0 -468
- package/.vscode/launch.json +0 -34
- package/.vscode/settings.json +0 -58
- package/3party/shortcut.js +0 -224
- package/CHANGELOG.txt +0 -4
- package/SECURITY.md +0 -3
- package/__mocks__/fileMock.js +0 -3
- package/__mocks__/styleMock.js +0 -3
- package/babel.config.js +0 -30
- package/backup.bat +0 -43
- package/coverage/coverage-final.json +0 -1
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -101
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -0
- package/data/list.json +0 -19
- package/dist/LICENSE.txt +0 -209
- package/dist/README.md +0 -79
- package/elements/button/component.js +0 -0
- package/elements/code/component.js +0 -0
- package/elements/costants.tsx +0 -13
- package/elements/fieldset/component.js +0 -0
- package/elements/input/checkbox/component.js +0 -0
- package/elements/input/date/component.js +0 -27
- package/elements/input/number/component.js +0 -0
- package/elements/input/radio/component.js +0 -0
- package/elements/input/search/component.js +0 -0
- package/elements/input/select/component.js +0 -0
- package/elements/input/slider/component.js +0 -0
- package/elements/input/switch/component.js +0 -0
- package/elements/tab/component.js +0 -0
- package/elements/table/component.js +0 -0
- package/elements/tags.less +0 -0
- package/elements/textarea/component.js +0 -0
- package/elements/x-foo/define.js +0 -33
- package/elements/x-foo/namespace.d.ts +0 -7
- package/init.js +0 -87
- package/jest.config.js +0 -81
- package/node/createTag.js +0 -7
- package/node/gitDeploy.js +0 -7
- package/node/goLive.js +0 -7
- package/public/assets/images/banner.png +0 -0
- package/public/assets/logos/logo.svg +0 -64
- package/public/documents/iDB/list.html +0 -11
- package/public/documents/iDB/toState.html +0 -11
- package/scripts/.OLD/import.js +0 -48
- package/scripts/.OLD/onBeforeUnLoad.js +0 -120
- package/scripts/.OLD/purge.js +0 -53
- package/scripts/.OLD/string.js +0 -27
- package/scripts/anchor.js +0 -73
- package/scripts/array.js +0 -203
- package/scripts/avoid.js +0 -48
- package/scripts/browser.js +0 -100
- package/scripts/color.js +0 -121
- package/scripts/console.js +0 -97
- package/scripts/console.mapped.js +0 -160
- package/scripts/coods.js +0 -57
- package/scripts/cookie.js +0 -105
- package/scripts/date.js +0 -179
- package/scripts/disable.js +0 -91
- package/scripts/errors.js +0 -3
- package/scripts/event.js +0 -57
- package/scripts/font.js +0 -60
- package/scripts/form.js +0 -211
- package/scripts/format.js +0 -71
- package/scripts/function.js +0 -55
- package/scripts/iDB.js +0 -688
- package/scripts/json.js +0 -84
- package/scripts/load.js +0 -112
- package/scripts/math.js +0 -100
- package/scripts/obj.js +0 -118
- package/scripts/path.js +0 -101
- package/scripts/promise.js +0 -56
- package/scripts/screen.js +0 -82
- package/scripts/scrollbar.js +0 -293
- package/scripts/shortcut.js +0 -83
- package/scripts/socket.js +0 -184
- package/scripts/state.js +0 -87
- package/scripts/storage.js +0 -93
- package/scripts/store.js +0 -115
- package/scripts/svg.js +0 -380
- package/scripts/text.js +0 -116
- package/scripts/time.js +0 -43
- package/scripts/timer.js +0 -54
- package/scripts/tool.js +0 -73
- package/scripts/trigger.js +0 -57
- package/scripts/type.js +0 -76
- package/scripts/ui.js +0 -41
- package/scripts/window.js +0 -244
- package/styles/console.less +0 -95
- package/tests/setupJest.tsx +0 -4
- package/typings/.OLD/cordova.d.ts +0 -12
- package/typings/.OLD/layerpro.d.ts +0 -20
- package/typings/.OLD/menupro.d.ts +0 -20
- package/typings/dphelper.d.ts +0 -26
- package/typings/image.d.ts +0 -5
- package/typings/styles.d.ts +0 -23
- package/webpack.config.js +0 -249
package/scripts/time.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
dpHelper
|
|
3
|
-
Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under the Apache-2.0, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/***********************************************************************/
|
|
9
|
-
|
|
10
|
-
var description = {
|
|
11
|
-
"name" : "Time",
|
|
12
|
-
"description" : "",
|
|
13
|
-
"version" : "0.0.1",
|
|
14
|
-
"command" : "time",
|
|
15
|
-
"subCommand" : [
|
|
16
|
-
{
|
|
17
|
-
"name":"epoch",
|
|
18
|
-
"description":"test"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"example" : "",
|
|
22
|
-
"author" : "Dario Passariello",
|
|
23
|
-
"active" : true
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
dphelper._list.scripts.push( description );
|
|
27
|
-
|
|
28
|
-
/***********************************************************************/
|
|
29
|
-
|
|
30
|
-
dphelper.time ={
|
|
31
|
-
|
|
32
|
-
epoch: () => {
|
|
33
|
-
return new Date().getTime();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
Object.defineProperty( dphelper, 'time', {
|
|
39
|
-
writable: false,
|
|
40
|
-
configurable: false
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
//console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
|
package/scripts/timer.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
dpHelper
|
|
3
|
-
Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under the Apache-2.0, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/***********************************************************************/
|
|
9
|
-
|
|
10
|
-
var description = {
|
|
11
|
-
"name" : "Timer",
|
|
12
|
-
"description" : "",
|
|
13
|
-
"version" : "0.0.1",
|
|
14
|
-
"command" : "timer",
|
|
15
|
-
"subCommand" : [
|
|
16
|
-
{
|
|
17
|
-
"name":"sleep",
|
|
18
|
-
"description":"test",
|
|
19
|
-
},{
|
|
20
|
-
"name":"percentage",
|
|
21
|
-
"description":"test",
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"example" : "",
|
|
25
|
-
"author" : "Dario Passariello",
|
|
26
|
-
"active" : true
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
dphelper._list.scripts.push( description );
|
|
30
|
-
|
|
31
|
-
/***********************************************************************/
|
|
32
|
-
|
|
33
|
-
dphelper.timer ={
|
|
34
|
-
|
|
35
|
-
sleep: (ms) => {
|
|
36
|
-
return new Promise( resolve => setTimeout( resolve, ms) );
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
percentage: ( start , end ) => {
|
|
40
|
-
function totalSeconds(time){
|
|
41
|
-
var parts = time.split(':');
|
|
42
|
-
return parts[0] * 3600 + parts[1] * 60 + parts[2];
|
|
43
|
-
}
|
|
44
|
-
return (100 * totalSeconds( start ) / totalSeconds( end )).toFixed(2);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
Object.defineProperty( dphelper, 'timer', {
|
|
50
|
-
writable: false,
|
|
51
|
-
configurable: false
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
//console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
|
package/scripts/tool.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
dpHelper
|
|
3
|
-
Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under the Apache-2.0, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/***********************************************************************/
|
|
9
|
-
|
|
10
|
-
var description = {
|
|
11
|
-
"name" : "Tool",
|
|
12
|
-
"description" : "",
|
|
13
|
-
"version" : "0.0.1",
|
|
14
|
-
"command" : "tool",
|
|
15
|
-
"subCommand" : [
|
|
16
|
-
{
|
|
17
|
-
"name":"uuid",
|
|
18
|
-
"description":"test",
|
|
19
|
-
"subCommand" : [
|
|
20
|
-
{
|
|
21
|
-
"name":"v5",
|
|
22
|
-
"description":"test",
|
|
23
|
-
"example":"dphelper.tools.uuid.v5"
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
},{
|
|
27
|
-
"name":"percent",
|
|
28
|
-
"description":"test"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"example" : "",
|
|
32
|
-
"author" : "Dario Passariello",
|
|
33
|
-
"active" : true
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
dphelper._list.scripts.push( description );
|
|
37
|
-
|
|
38
|
-
/***********************************************************************/
|
|
39
|
-
|
|
40
|
-
dphelper.tool = {
|
|
41
|
-
|
|
42
|
-
uuid: {
|
|
43
|
-
v5: () => {
|
|
44
|
-
return ( [1e7] + -1e3 + -4e3 + -8e3 + -1e11 ).replace( /[018]/g, ( a ) => ( a ^ ( ( Math.random() * 16) >> ( a / 4 ) ) ).toString( 16 ) );
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
byteSize: (bytes) => {
|
|
49
|
-
var thresh = 1024;
|
|
50
|
-
if(Math.abs(bytes) < thresh) {
|
|
51
|
-
return bytes + 'b';
|
|
52
|
-
}
|
|
53
|
-
var units = ['Kb','Mb','Gb','Tb','Pb','Eb','Zb','Yb'];
|
|
54
|
-
var u = -1;
|
|
55
|
-
do {
|
|
56
|
-
bytes /= thresh;
|
|
57
|
-
++u;
|
|
58
|
-
} while(Math.abs(bytes) >= thresh && u < units.length - 1);
|
|
59
|
-
return bytes.toFixed(1) + units[u];
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
percent: ( number , total ) => {
|
|
63
|
-
return ( 100 * number / total ).toFixed(2);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
Object.defineProperty( dphelper, 'tool', {
|
|
69
|
-
writable: false,
|
|
70
|
-
configurable: false
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
//console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
|
package/scripts/trigger.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
dpHelper
|
|
3
|
-
Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under the Apache-2.0, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/***********************************************************************/
|
|
9
|
-
|
|
10
|
-
var description = {
|
|
11
|
-
"name" : "Trigger",
|
|
12
|
-
"description" : "",
|
|
13
|
-
"version" : "0.0.1",
|
|
14
|
-
"command" : "trigger",
|
|
15
|
-
"subCommand" : [
|
|
16
|
-
{
|
|
17
|
-
"name":"click",
|
|
18
|
-
"description":"test"
|
|
19
|
-
},{
|
|
20
|
-
"name":"change",
|
|
21
|
-
"description":"test"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"example" : "",
|
|
25
|
-
"author" : "Dario Passariello",
|
|
26
|
-
"active" : true
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
dphelper._list.scripts.push( description );
|
|
30
|
-
|
|
31
|
-
/***********************************************************************/
|
|
32
|
-
|
|
33
|
-
dphelper.trigger = {
|
|
34
|
-
|
|
35
|
-
click: ( elem ) => {
|
|
36
|
-
let selector = document.querySelector( elem );
|
|
37
|
-
if( selector ) selector.click();
|
|
38
|
-
return;
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
change: ( elem ) => {
|
|
42
|
-
let selector = document.querySelector( elem );
|
|
43
|
-
var ev = new Event('input', { bubbles: true} );
|
|
44
|
-
ev.simulated = true;
|
|
45
|
-
//selector.value = 'Something new';
|
|
46
|
-
selector.dispatchEvent(ev);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
Object.defineProperty( dphelper, 'trigger', {
|
|
52
|
-
writable: false,
|
|
53
|
-
configurable: false
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
//console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
|
|
57
|
-
|
package/scripts/type.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
dpHelper
|
|
3
|
-
Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under the Apache-2.0, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/***********************************************************************/
|
|
9
|
-
|
|
10
|
-
var description = {
|
|
11
|
-
"name" : "Type",
|
|
12
|
-
"description" : "",
|
|
13
|
-
"version" : "0.0.1",
|
|
14
|
-
"command" : "type",
|
|
15
|
-
"subCommand" : [
|
|
16
|
-
{
|
|
17
|
-
"name":"of",
|
|
18
|
-
"description":"test"
|
|
19
|
-
},{
|
|
20
|
-
"name":"instOfObj",
|
|
21
|
-
"description":"test"
|
|
22
|
-
},{
|
|
23
|
-
"name":"isNaN",
|
|
24
|
-
"description":"test"
|
|
25
|
-
},{
|
|
26
|
-
"name":"isPrime",
|
|
27
|
-
"description":"test"
|
|
28
|
-
},{
|
|
29
|
-
"name":"isBool",
|
|
30
|
-
"description":"test"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"example" : "",
|
|
34
|
-
"author" : "Dario Passariello",
|
|
35
|
-
"active" : true
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
dphelper._list.scripts.push( description );
|
|
39
|
-
|
|
40
|
-
/***********************************************************************/
|
|
41
|
-
|
|
42
|
-
dphelper.type = {
|
|
43
|
-
|
|
44
|
-
of: (p) => { return typeof p; },
|
|
45
|
-
|
|
46
|
-
instOfObj: (p) => { return p instanceof Object; },
|
|
47
|
-
|
|
48
|
-
isNaN: (p) => { return function (i) { return !p(i); }; },
|
|
49
|
-
|
|
50
|
-
isPrime: (number) => {
|
|
51
|
-
var divisor = parseInt(number / 2, 10);
|
|
52
|
-
var prime = true;
|
|
53
|
-
while (divisor > 1) {
|
|
54
|
-
if (number % divisor === 0) {
|
|
55
|
-
prime = false;
|
|
56
|
-
divisor = 0;
|
|
57
|
-
} else {
|
|
58
|
-
divisor -= 1;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return prime === true;
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
isBool: ( val ) => {
|
|
65
|
-
if ( !val || val.length == null ) return true;
|
|
66
|
-
return val === '1' ? true : false;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
Object.defineProperty( dphelper, 'type', {
|
|
72
|
-
writable: false,
|
|
73
|
-
configurable: false
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
//console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
|
package/scripts/ui.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
dpHelper
|
|
3
|
-
Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under the Apache-2.0, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/***********************************************************************/
|
|
9
|
-
|
|
10
|
-
var description = {
|
|
11
|
-
"name" : "UI",
|
|
12
|
-
"description" : "",
|
|
13
|
-
"version" : "0.0.1",
|
|
14
|
-
"command" : "ui",
|
|
15
|
-
"subCommand" : [
|
|
16
|
-
{
|
|
17
|
-
"name":"input",
|
|
18
|
-
"description":""
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"example" : "",
|
|
22
|
-
"author" : "Dario Passariello",
|
|
23
|
-
"active" : true
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
dphelper._list.scripts.push( description );
|
|
27
|
-
|
|
28
|
-
/***********************************************************************/
|
|
29
|
-
|
|
30
|
-
dphelper.ui = {
|
|
31
|
-
|
|
32
|
-
input: () => { return null; },
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
Object.defineProperty( dphelper, 'ui', {
|
|
37
|
-
writable: false,
|
|
38
|
-
configurable: false
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
//console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
|
package/scripts/window.js
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
dpHelper
|
|
3
|
-
Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under the Apache-2.0, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/***********************************************************************/
|
|
9
|
-
|
|
10
|
-
var description = {
|
|
11
|
-
"name" : "Window",
|
|
12
|
-
"description" : "",
|
|
13
|
-
"version" : "0.0.1",
|
|
14
|
-
"command" : "window",
|
|
15
|
-
"example" : "",
|
|
16
|
-
"author" : "Dario Passariello",
|
|
17
|
-
"active" : true,
|
|
18
|
-
"subCommand" : [
|
|
19
|
-
{
|
|
20
|
-
"name":"enhancement",
|
|
21
|
-
"version" : "0.0.1",
|
|
22
|
-
"example" : "dphelper.window.enhancement()",
|
|
23
|
-
"type" : "function",
|
|
24
|
-
"active": true,
|
|
25
|
-
"description":"Use only one time at end of application",
|
|
26
|
-
"subCommand" : []
|
|
27
|
-
},{
|
|
28
|
-
"name":"center",
|
|
29
|
-
"version" : "0.0.1",
|
|
30
|
-
"example" : "dphelper.window.center({ url, title, name, w, h })",
|
|
31
|
-
"type" : "function",
|
|
32
|
-
"active": true,
|
|
33
|
-
"description":"Use to center popup to screen",
|
|
34
|
-
"subCommand" : []
|
|
35
|
-
},{
|
|
36
|
-
"name":"onBeforeUnLoad",
|
|
37
|
-
"version" : "0.0.1",
|
|
38
|
-
"example" : "dphelper.window.onBeforeUnLoad",
|
|
39
|
-
"type" : "function",
|
|
40
|
-
"active": true,
|
|
41
|
-
"description":"message during leave the site",
|
|
42
|
-
"subCommand" : []
|
|
43
|
-
},{
|
|
44
|
-
"name":"purge",
|
|
45
|
-
"version" : "0.0.1",
|
|
46
|
-
"example" : "dphelper.window.purge",
|
|
47
|
-
"type" : "function",
|
|
48
|
-
"active": true,
|
|
49
|
-
"description":"Purge from memory",
|
|
50
|
-
"subCommand" : []
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
dphelper._list.scripts.push( description );
|
|
56
|
-
|
|
57
|
-
/***********************************************************************/
|
|
58
|
-
|
|
59
|
-
dphelper.window = {
|
|
60
|
-
|
|
61
|
-
enhancement: () => {
|
|
62
|
-
|
|
63
|
-
window.offScreenBuffering = "auto";
|
|
64
|
-
|
|
65
|
-
// HIDE STATUS INFORMATION ON BROWSER BAR
|
|
66
|
-
//***************************************
|
|
67
|
-
|
|
68
|
-
window.status = "";
|
|
69
|
-
window.defaultStatus = "";
|
|
70
|
-
|
|
71
|
-
// WINDOW ANIMATION
|
|
72
|
-
//**********************************
|
|
73
|
-
|
|
74
|
-
( () => {
|
|
75
|
-
return (
|
|
76
|
-
window.requestAnimationFrame ||
|
|
77
|
-
window.webkitRequestAnimationFrame ||
|
|
78
|
-
window.mozRequestAnimationFrame ||
|
|
79
|
-
window.oRequestAnimationFrame ||
|
|
80
|
-
window.msRequestAnimationFrame ||
|
|
81
|
-
function( callback ){
|
|
82
|
-
window.setTimeout( callback, 1000 / 120 );
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
})();
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
center: ({url, title, name, w, h}) => {
|
|
90
|
-
|
|
91
|
-
// Fixes dual-screen position Most browsers Firefox
|
|
92
|
-
const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
|
|
93
|
-
const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
|
|
94
|
-
|
|
95
|
-
const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
|
|
96
|
-
const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
|
|
97
|
-
|
|
98
|
-
const systemZoom = width / window.screen.availWidth;
|
|
99
|
-
const left = (width - w) / 2 / systemZoom + dualScreenLeft;
|
|
100
|
-
const top = (height - h) / 2 / systemZoom + dualScreenTop;
|
|
101
|
-
const newWindow = window.open(url, title,
|
|
102
|
-
`
|
|
103
|
-
scrollbars=yes,
|
|
104
|
-
width=${w / systemZoom},
|
|
105
|
-
height=${h / systemZoom},
|
|
106
|
-
top=${top},
|
|
107
|
-
left=${left}
|
|
108
|
-
`
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
if (window.focus) newWindow.focus();
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
onBeforeUnLoad: () => {
|
|
116
|
-
|
|
117
|
-
let is_dirty = false;
|
|
118
|
-
let answer = null;
|
|
119
|
-
let mex = "You have made some changes which you might want to save.";
|
|
120
|
-
let loadOnce = false;
|
|
121
|
-
let save_button = document.querySelector("#save_button");
|
|
122
|
-
|
|
123
|
-
const beforeUnloadListener = ( event ) => {
|
|
124
|
-
event.preventDefault();
|
|
125
|
-
return mex;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const nameInput = document.querySelector("#name");
|
|
129
|
-
|
|
130
|
-
if( nameInput ){
|
|
131
|
-
nameInput.addEventListener( "input" , (event) => {
|
|
132
|
-
if (event.target.value !== "") {
|
|
133
|
-
addEventListener("beforeunload", beforeUnloadListener, { capture: true });
|
|
134
|
-
} else {
|
|
135
|
-
removeEventListener("beforeunload", beforeUnloadListener, { capture: true });
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/****************************************************************************** */
|
|
141
|
-
|
|
142
|
-
let handleEvent = function( event ){
|
|
143
|
-
if( event.target.type === 'textarea' || event.target.type === 'input' ){
|
|
144
|
-
if( is_dirty === false ){
|
|
145
|
-
return is_dirty = true;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
/****************************************************************************** */
|
|
151
|
-
|
|
152
|
-
let TEST = function (){
|
|
153
|
-
// CHANGE ON KEY
|
|
154
|
-
document.body.addEventListener( "keyup" , handleEvent );
|
|
155
|
-
}();
|
|
156
|
-
|
|
157
|
-
/****************************************************************************** */
|
|
158
|
-
|
|
159
|
-
// CHANGE ON ASIDE CLICK
|
|
160
|
-
if( loadOnce === false ){
|
|
161
|
-
document.body.addEventListener( "click" , function( event ){
|
|
162
|
-
if( event.target.tagName === 'IMG'){
|
|
163
|
-
if( is_dirty === true ) {
|
|
164
|
-
// if the user navigates away from this page via an anchor link,
|
|
165
|
-
// popup a new boxy confirmation.
|
|
166
|
-
answer = confirm( mex );
|
|
167
|
-
if ( answer === true ) {
|
|
168
|
-
return is_dirty = false;
|
|
169
|
-
}else{
|
|
170
|
-
event.preventDefault();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
});
|
|
176
|
-
loadOnce = true;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/****************************************************************************** */
|
|
180
|
-
|
|
181
|
-
addEventListener('popstate', function(event) {
|
|
182
|
-
|
|
183
|
-
if( is_dirty === true ){
|
|
184
|
-
answer = confirm( mex );
|
|
185
|
-
if ( answer === true ) {
|
|
186
|
-
return is_dirty = false;
|
|
187
|
-
} else {
|
|
188
|
-
event.stopImmediatePropagation();
|
|
189
|
-
event.preventDefault();
|
|
190
|
-
return mex;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
/****************************************************************************** */
|
|
197
|
-
|
|
198
|
-
window.onbeforeunload = function( event ) {
|
|
199
|
-
if( ( is_dirty === true ) && ( answer === null ) ){
|
|
200
|
-
event.preventDefault();
|
|
201
|
-
return event.returnValue = mex;
|
|
202
|
-
//return mex
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
purge: ( d = body, time = 10000 ) => {
|
|
209
|
-
|
|
210
|
-
setTimeout(() => {
|
|
211
|
-
if( d === undefined ) return null;
|
|
212
|
-
|
|
213
|
-
let a = d.attributes, i, l, n;
|
|
214
|
-
|
|
215
|
-
if (a) {
|
|
216
|
-
l = a.length;
|
|
217
|
-
for( i = 0; i < l; i += 1 ) {
|
|
218
|
-
n = a[i].name;
|
|
219
|
-
if( typeof d[n] === 'function' ) { d[n] = null; }
|
|
220
|
-
if( typeof d[n] === 'undefined' ) { d[n] = null; }
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
a = d.childNodes;
|
|
226
|
-
|
|
227
|
-
if (a) {
|
|
228
|
-
l = a.length;
|
|
229
|
-
for( i = 0; i < l; i += 1 ) {
|
|
230
|
-
Purge( d.childNodes[i] );
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}, time );
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
Object.defineProperty( dphelper, 'window', {
|
|
240
|
-
writable: false,
|
|
241
|
-
configurable: false
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
//console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
|
package/styles/console.less
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
.debugConsole{
|
|
2
|
-
|
|
3
|
-
--console-background: rgb(30,30,40);
|
|
4
|
-
--console-color: rgb(255,255,255);
|
|
5
|
-
--console-input-background: var( --console-background );
|
|
6
|
-
//--console-input-background: rgb(43, 43, 58);
|
|
7
|
-
--console-input-color: rgb(255,255,255);
|
|
8
|
-
--left-padding: 25px;
|
|
9
|
-
|
|
10
|
-
background: var( --console-background );
|
|
11
|
-
color: var( --console-background );
|
|
12
|
-
padding: 10px;
|
|
13
|
-
border-radius:4px;
|
|
14
|
-
height:200px;
|
|
15
|
-
overflow:auto;
|
|
16
|
-
font-size:.9em;
|
|
17
|
-
font-family: Menlo, monospace;
|
|
18
|
-
|
|
19
|
-
form{
|
|
20
|
-
position:relative;
|
|
21
|
-
display: flex;
|
|
22
|
-
//padding: 0 0 5px 0;
|
|
23
|
-
flex-direction: row;
|
|
24
|
-
flex-wrap: nowrap;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
|
|
27
|
-
div.comm{
|
|
28
|
-
position:relative;
|
|
29
|
-
width:100%;
|
|
30
|
-
|
|
31
|
-
input[type=text]{
|
|
32
|
-
padding: 0 0 0 var(--left-padding);
|
|
33
|
-
width: 100%;
|
|
34
|
-
background: var(--console-input-background);
|
|
35
|
-
color: var(--console-input-color);
|
|
36
|
-
/* margin-top: 5px; */
|
|
37
|
-
z-index: 1;
|
|
38
|
-
font-size:.9em;
|
|
39
|
-
font-family: Menlo, monospace;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&:after {
|
|
43
|
-
content:"›";
|
|
44
|
-
font-size:1.2em;
|
|
45
|
-
font-weight: 700;
|
|
46
|
-
position:absolute;
|
|
47
|
-
//padding:10px 0 0 0;
|
|
48
|
-
top:0;
|
|
49
|
-
left:0;
|
|
50
|
-
bottom:0;
|
|
51
|
-
color:rgb(43, 128, 226);
|
|
52
|
-
width:var( --left-padding );
|
|
53
|
-
height:100%;
|
|
54
|
-
z-index:2;
|
|
55
|
-
display: flex;
|
|
56
|
-
justify-content: center;
|
|
57
|
-
align-content: center;
|
|
58
|
-
align-items: stretch;
|
|
59
|
-
flex-direction: row;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
input[type=button],
|
|
65
|
-
input[type=submit]{
|
|
66
|
-
margin-left: 2px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.messages{
|
|
72
|
-
width:100%;
|
|
73
|
-
background: var( --console-input-background );
|
|
74
|
-
color: var( --console-input-color );
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
#debugConsole{
|
|
78
|
-
width:100%;
|
|
79
|
-
min-width:30px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
input,
|
|
83
|
-
textarea{
|
|
84
|
-
//border-radius:4px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
br{
|
|
88
|
-
content: " ";
|
|
89
|
-
display:block;
|
|
90
|
-
height:1px;
|
|
91
|
-
border-top:1px solid rgba(240, 255, 255, 0.15);
|
|
92
|
-
margin: 5px 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
}
|
package/tests/setupJest.tsx
DELETED