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.
Files changed (121) hide show
  1. package/{LICENSE.txt → LICENSE.md} +0 -0
  2. package/README.md +6 -0
  3. package/index.js +2 -12
  4. package/package.json +130 -136
  5. package/.editorconfig +0 -13
  6. package/.env +0 -3
  7. package/.eslintignore +0 -13
  8. package/.eslintrc.json +0 -87
  9. package/.eslintrc.legacy.json +0 -91
  10. package/.gitattributes +0 -2
  11. package/.github/FUNDING.yml +0 -12
  12. package/.github/dependabot.yml +0 -12
  13. package/.hintrc +0 -11
  14. package/.jsbeautifyrc +0 -25
  15. package/.jshintrc +0 -16
  16. package/.prettierignore +0 -2
  17. package/.prettierrc.json +0 -8
  18. package/.stylelintignore +0 -0
  19. package/.stylelintrc.json +0 -468
  20. package/.vscode/launch.json +0 -34
  21. package/.vscode/settings.json +0 -58
  22. package/3party/shortcut.js +0 -224
  23. package/CHANGELOG.txt +0 -4
  24. package/SECURITY.md +0 -3
  25. package/__mocks__/fileMock.js +0 -3
  26. package/__mocks__/styleMock.js +0 -3
  27. package/babel.config.js +0 -30
  28. package/backup.bat +0 -43
  29. package/coverage/coverage-final.json +0 -1
  30. package/coverage/lcov-report/base.css +0 -224
  31. package/coverage/lcov-report/block-navigation.js +0 -87
  32. package/coverage/lcov-report/favicon.png +0 -0
  33. package/coverage/lcov-report/index.html +0 -101
  34. package/coverage/lcov-report/prettify.css +0 -1
  35. package/coverage/lcov-report/prettify.js +0 -2
  36. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  37. package/coverage/lcov-report/sorter.js +0 -196
  38. package/coverage/lcov.info +0 -0
  39. package/data/list.json +0 -19
  40. package/dist/LICENSE.txt +0 -209
  41. package/dist/README.md +0 -79
  42. package/elements/button/component.js +0 -0
  43. package/elements/code/component.js +0 -0
  44. package/elements/costants.tsx +0 -13
  45. package/elements/fieldset/component.js +0 -0
  46. package/elements/input/checkbox/component.js +0 -0
  47. package/elements/input/date/component.js +0 -27
  48. package/elements/input/number/component.js +0 -0
  49. package/elements/input/radio/component.js +0 -0
  50. package/elements/input/search/component.js +0 -0
  51. package/elements/input/select/component.js +0 -0
  52. package/elements/input/slider/component.js +0 -0
  53. package/elements/input/switch/component.js +0 -0
  54. package/elements/tab/component.js +0 -0
  55. package/elements/table/component.js +0 -0
  56. package/elements/tags.less +0 -0
  57. package/elements/textarea/component.js +0 -0
  58. package/elements/x-foo/define.js +0 -33
  59. package/elements/x-foo/namespace.d.ts +0 -7
  60. package/init.js +0 -87
  61. package/jest.config.js +0 -81
  62. package/node/createTag.js +0 -7
  63. package/node/gitDeploy.js +0 -7
  64. package/node/goLive.js +0 -7
  65. package/public/assets/images/banner.png +0 -0
  66. package/public/assets/logos/logo.svg +0 -64
  67. package/public/documents/iDB/list.html +0 -11
  68. package/public/documents/iDB/toState.html +0 -11
  69. package/scripts/.OLD/import.js +0 -48
  70. package/scripts/.OLD/onBeforeUnLoad.js +0 -120
  71. package/scripts/.OLD/purge.js +0 -53
  72. package/scripts/.OLD/string.js +0 -27
  73. package/scripts/anchor.js +0 -73
  74. package/scripts/array.js +0 -203
  75. package/scripts/avoid.js +0 -48
  76. package/scripts/browser.js +0 -100
  77. package/scripts/color.js +0 -121
  78. package/scripts/console.js +0 -97
  79. package/scripts/console.mapped.js +0 -160
  80. package/scripts/coods.js +0 -57
  81. package/scripts/cookie.js +0 -105
  82. package/scripts/date.js +0 -179
  83. package/scripts/disable.js +0 -91
  84. package/scripts/errors.js +0 -3
  85. package/scripts/event.js +0 -57
  86. package/scripts/font.js +0 -60
  87. package/scripts/form.js +0 -211
  88. package/scripts/format.js +0 -71
  89. package/scripts/function.js +0 -55
  90. package/scripts/iDB.js +0 -688
  91. package/scripts/json.js +0 -84
  92. package/scripts/load.js +0 -112
  93. package/scripts/math.js +0 -100
  94. package/scripts/obj.js +0 -118
  95. package/scripts/path.js +0 -101
  96. package/scripts/promise.js +0 -56
  97. package/scripts/screen.js +0 -82
  98. package/scripts/scrollbar.js +0 -293
  99. package/scripts/shortcut.js +0 -83
  100. package/scripts/socket.js +0 -184
  101. package/scripts/state.js +0 -87
  102. package/scripts/storage.js +0 -93
  103. package/scripts/store.js +0 -115
  104. package/scripts/svg.js +0 -380
  105. package/scripts/text.js +0 -116
  106. package/scripts/time.js +0 -43
  107. package/scripts/timer.js +0 -54
  108. package/scripts/tool.js +0 -73
  109. package/scripts/trigger.js +0 -57
  110. package/scripts/type.js +0 -76
  111. package/scripts/ui.js +0 -41
  112. package/scripts/window.js +0 -244
  113. package/styles/console.less +0 -95
  114. package/tests/setupJest.tsx +0 -4
  115. package/typings/.OLD/cordova.d.ts +0 -12
  116. package/typings/.OLD/layerpro.d.ts +0 -20
  117. package/typings/.OLD/menupro.d.ts +0 -20
  118. package/typings/dphelper.d.ts +0 -26
  119. package/typings/image.d.ts +0 -5
  120. package/typings/styles.d.ts +0 -23
  121. package/webpack.config.js +0 -249
@@ -1,224 +0,0 @@
1
- /**
2
- * http://www.openjs.com/scripts/events/keyboard_shortcuts/
3
- * Version : 2.01.B
4
- * By Binny V A
5
- * License : BSD
6
- */
7
-
8
- shortcut = {
9
- 'all_shortcuts':{},//All the shortcuts are stored in this array
10
- 'add': function(shortcut_combination,callback,opt) {
11
- //Provide a set of default options
12
- let default_options = {
13
- 'type':'keydown',
14
- 'propagate':false,
15
- 'disable_in_input':false,
16
- 'target':document,
17
- 'keycode':false
18
- }
19
- if(!opt) opt = default_options;
20
- else {
21
- for(let dfo in default_options) {
22
- if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo];
23
- }
24
- }
25
-
26
- let ele = opt.target;
27
- if(typeof opt.target == 'string') ele = document.getElementById(opt.target);
28
- let ths = this;
29
- shortcut_combination = shortcut_combination.toLowerCase();
30
-
31
- //The function to be called at keypress
32
- let func = function( e ) {
33
- e = e || window.event;
34
-
35
- if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields
36
- let element;
37
- if(e.target) element=e.target;
38
- else if(e.srcElement) element=e.srcElement;
39
- if(element.nodeType==3) element=element.parentNode;
40
-
41
- if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
42
- }
43
-
44
- //Find Which key is pressed
45
- if (e.keyCode) code = e.keyCode;
46
- else if (e.which) code = e.which;
47
- let character = String.fromCharCode(code).toLowerCase();
48
-
49
- if(code == 188) character=","; //If the user presses , when the type is onkeydown
50
- if(code == 190) character="."; //If the user presses , when the type is onkeydown
51
-
52
- let keys = shortcut_combination.split("+");
53
- //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked
54
- let kp = 0;
55
-
56
- //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken
57
- let shift_nums = {
58
- "`":"~",
59
- "1":"!",
60
- "2":"@",
61
- "3":"#",
62
- "4":"$",
63
- "5":"%",
64
- "6":"^",
65
- "7":"&",
66
- "8":"*",
67
- "9":"(",
68
- "0":")",
69
- "-":"_",
70
- "=":"+",
71
- ";":":",
72
- "'":"\"",
73
- ",":"<",
74
- ".":">",
75
- "/":"?",
76
- "\\":"|"
77
- }
78
- //Special Keys - and their codes
79
- let special_keys = {
80
- 'esc':27,
81
- 'escape':27,
82
- 'tab':9,
83
- 'space':32,
84
- 'return':13,
85
- 'enter':13,
86
- 'backspace':8,
87
-
88
- 'scrolllock':145,
89
- 'scroll_lock':145,
90
- 'scroll':145,
91
- 'capslock':20,
92
- 'caps_lock':20,
93
- 'caps':20,
94
- 'numlock':144,
95
- 'num_lock':144,
96
- 'num':144,
97
-
98
- 'pause':19,
99
- 'break':19,
100
-
101
- 'insert':45,
102
- 'home':36,
103
- 'delete':46,
104
- 'end':35,
105
-
106
- 'pageup':33,
107
- 'page_up':33,
108
- 'pu':33,
109
-
110
- 'pagedown':34,
111
- 'page_down':34,
112
- 'pd':34,
113
-
114
- 'left':37,
115
- 'up':38,
116
- 'right':39,
117
- 'down':40,
118
-
119
- 'f1':112,
120
- 'f2':113,
121
- 'f3':114,
122
- 'f4':115,
123
- 'f5':116,
124
- 'f6':117,
125
- 'f7':118,
126
- 'f8':119,
127
- 'f9':120,
128
- 'f10':121,
129
- 'f11':122,
130
- 'f12':123
131
- }
132
-
133
- let modifiers = {
134
- shift: { wanted:false, pressed:false},
135
- ctrl : { wanted:false, pressed:false},
136
- alt : { wanted:false, pressed:false},
137
- meta : { wanted:false, pressed:false} //Meta is Mac specific
138
- };
139
-
140
- if(e.ctrlKey) modifiers.ctrl.pressed = true;
141
- if(e.shiftKey) modifiers.shift.pressed = true;
142
- if(e.altKey) modifiers.alt.pressed = true;
143
- if(e.metaKey) modifiers.meta.pressed = true;
144
-
145
- for(let i=0; k=keys[i],i<keys.length; i++) {
146
- //Modifiers
147
- if(k == 'ctrl' || k == 'control') {
148
- kp++;
149
- modifiers.ctrl.wanted = true;
150
-
151
- } else if(k == 'shift') {
152
- kp++;
153
- modifiers.shift.wanted = true;
154
-
155
- } else if(k == 'alt') {
156
- kp++;
157
- modifiers.alt.wanted = true;
158
- } else if(k == 'meta') {
159
- kp++;
160
- modifiers.meta.wanted = true;
161
- } else if(k.length > 1) { //If it is a special key
162
- if(special_keys[k] == code) kp++;
163
-
164
- } else if(opt['keycode']) {
165
- if(opt['keycode'] == code) kp++;
166
-
167
- } else { //The special keys did not match
168
- if(character == k) kp++;
169
- else {
170
- if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
171
- character = shift_nums[character];
172
- if(character == k) kp++;
173
- }
174
- }
175
- }
176
- }
177
-
178
- if(kp == keys.length &&
179
- modifiers.ctrl.pressed == modifiers.ctrl.wanted &&
180
- modifiers.shift.pressed == modifiers.shift.wanted &&
181
- modifiers.alt.pressed == modifiers.alt.wanted &&
182
- modifiers.meta.pressed == modifiers.meta.wanted) {
183
- callback( e );
184
-
185
- if(!opt['propagate']) { //Stop the event
186
- //e.cancelBubble is supported by IE - this will kill the bubbling process.
187
- e.cancelBubble = true;
188
- e.returnValue = false;
189
-
190
- //e.stopPropagation works in Firefox.
191
- if (e.stopPropagation) {
192
- e.stopPropagation();
193
- e.preventDefault();
194
- }
195
- return false;
196
- }
197
- }
198
- }
199
- this.all_shortcuts[shortcut_combination] = {
200
- 'callback':func,
201
- 'target':ele,
202
- 'event': opt['type']
203
- };
204
- //Attach the function with the event
205
- if(ele.addEventListener) ele.addEventListener(opt['type'], func, false);
206
- else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func);
207
- else ele['on'+opt['type']] = func;
208
- },
209
-
210
- //Remove the shortcut - just specify the shortcut and I will remove the binding
211
- 'remove':function(shortcut_combination) {
212
- shortcut_combination = shortcut_combination.toLowerCase();
213
- let binding = this.all_shortcuts[shortcut_combination];
214
- delete(this.all_shortcuts[shortcut_combination])
215
- if(!binding) return;
216
- let type = binding['event'];
217
- let ele = binding['target'];
218
- let callback = binding['callback'];
219
-
220
- if(ele.detachEvent) ele.detachEvent('on'+type, callback);
221
- else if(ele.removeEventListener) ele.removeEventListener(type, callback, false);
222
- else ele['on'+type] = false;
223
- }
224
- }
package/CHANGELOG.txt DELETED
@@ -1,4 +0,0 @@
1
- New minor (feature) releases of this app/software are released every six months and
2
- patch (bugfix) releases are released every month. More information on the
3
- release cycle: see package.json
4
-
package/SECURITY.md DELETED
@@ -1,3 +0,0 @@
1
- # Security
2
-
3
- Please email [@passariello](https://github.com/passariello) or see https://dario.passariello.ca/contact/ if you have a potential security vulnerability to report.
@@ -1,3 +0,0 @@
1
- // __mocks__/fileMock.js
2
-
3
- module.exports = 'test-file-stub';
@@ -1,3 +0,0 @@
1
- // __mocks__/styleMock.js
2
-
3
- module.exports = {};
package/babel.config.js DELETED
@@ -1,30 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: CC BY-NC-ND 4.0
4
- */
5
-
6
- module.exports = {
7
- presets: [
8
- "@babel/preset-env",
9
- "@babel/preset-typescript",
10
- "@babel/preset-react"
11
- ],
12
- plugins: [
13
- "@babel/plugin-proposal-class-properties",
14
- [
15
- "@babel/plugin-transform-runtime",
16
- {
17
- regenerator: true,
18
- },
19
- ],
20
- ],
21
- env: {
22
- development: {
23
- presets: [['@babel/preset-react', { development: true, useBuiltIns: true }]]
24
- },
25
- production: {
26
- presets: [['@babel/preset-react', { useBuiltIns: true }]],
27
- plugins: [['transform-react-remove-prop-types', { removeImport: true }]]
28
- }
29
- }
30
- };
package/backup.bat DELETED
@@ -1,43 +0,0 @@
1
- @echo off
2
-
3
- @REM echo THIS FILE RUN BACKUP.
4
- @REM echo CREATED BY DARIO PASSARIELLO.
5
- @REM echo[
6
-
7
- @REM goto :start
8
-
9
- @REM This file permit to run BackUp as Zip file (using 7z) for the APP.
10
- @REM Please don't change anything without authorization.
11
- @REM In case needs help please call the back-end department.
12
- @REM You need to install 7z free software before using this batch
13
-
14
- @REM :start
15
-
16
- @REM :choice
17
- @REM set /P c=Are you sure you want to continue( [Y]/N )? Y
18
- @REM if /I "%c%" EQU "" goto :yes
19
- @REM if /I "%c%" EQU "y" goto :yes
20
- @REM if /I "%c%" EQU "Y" goto :yes
21
- @REM if /I "%c%" EQU "N" goto :no
22
- @REM goto :choice
23
-
24
- @REM :yes
25
-
26
- pushd %~dp0
27
- set THIS_DIR=%CD%
28
- popd
29
-
30
- for /f "tokens=3,2,4 delims=/- " %%x in ("%date%") do set d=%%z%%x%%y
31
- for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I
32
- set logtime=%datetime:~8,6%
33
- for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined tmpDate set tmpDate=%%x
34
- set data=%tmpDate:~0,4%%tmpDate:~4,2%%tmpDate:~6,2%
35
-
36
- "C:\Program Files\7-Zip\7z.exe" a -tzip %THIS_DIR%\.backup\%data%.%logtime%.zip %THIS_DIR% -xr!node_modules -xr!.backup -xr!.git
37
- attrib +h %THIS_DIR%\.backup
38
- echo Zip created into %THIS_DIR%\.backup!
39
- @REM pause
40
- exit
41
-
42
- :no
43
- exit
@@ -1 +0,0 @@
1
- {}
@@ -1,224 +0,0 @@
1
- body, html {
2
- margin:0; padding: 0;
3
- height: 100%;
4
- }
5
- body {
6
- font-family: Helvetica Neue, Helvetica, Arial;
7
- font-size: 14px;
8
- color:#333;
9
- }
10
- .small { font-size: 12px; }
11
- *, *:after, *:before {
12
- -webkit-box-sizing:border-box;
13
- -moz-box-sizing:border-box;
14
- box-sizing:border-box;
15
- }
16
- h1 { font-size: 20px; margin: 0;}
17
- h2 { font-size: 14px; }
18
- pre {
19
- font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
20
- margin: 0;
21
- padding: 0;
22
- -moz-tab-size: 2;
23
- -o-tab-size: 2;
24
- tab-size: 2;
25
- }
26
- a { color:#0074D9; text-decoration:none; }
27
- a:hover { text-decoration:underline; }
28
- .strong { font-weight: bold; }
29
- .space-top1 { padding: 10px 0 0 0; }
30
- .pad2y { padding: 20px 0; }
31
- .pad1y { padding: 10px 0; }
32
- .pad2x { padding: 0 20px; }
33
- .pad2 { padding: 20px; }
34
- .pad1 { padding: 10px; }
35
- .space-left2 { padding-left:55px; }
36
- .space-right2 { padding-right:20px; }
37
- .center { text-align:center; }
38
- .clearfix { display:block; }
39
- .clearfix:after {
40
- content:'';
41
- display:block;
42
- height:0;
43
- clear:both;
44
- visibility:hidden;
45
- }
46
- .fl { float: left; }
47
- @media only screen and (max-width:640px) {
48
- .col3 { width:100%; max-width:100%; }
49
- .hide-mobile { display:none!important; }
50
- }
51
-
52
- .quiet {
53
- color: #7f7f7f;
54
- color: rgba(0,0,0,0.5);
55
- }
56
- .quiet a { opacity: 0.7; }
57
-
58
- .fraction {
59
- font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
60
- font-size: 10px;
61
- color: #555;
62
- background: #E8E8E8;
63
- padding: 4px 5px;
64
- border-radius: 3px;
65
- vertical-align: middle;
66
- }
67
-
68
- div.path a:link, div.path a:visited { color: #333; }
69
- table.coverage {
70
- border-collapse: collapse;
71
- margin: 10px 0 0 0;
72
- padding: 0;
73
- }
74
-
75
- table.coverage td {
76
- margin: 0;
77
- padding: 0;
78
- vertical-align: top;
79
- }
80
- table.coverage td.line-count {
81
- text-align: right;
82
- padding: 0 5px 0 20px;
83
- }
84
- table.coverage td.line-coverage {
85
- text-align: right;
86
- padding-right: 10px;
87
- min-width:20px;
88
- }
89
-
90
- table.coverage td span.cline-any {
91
- display: inline-block;
92
- padding: 0 5px;
93
- width: 100%;
94
- }
95
- .missing-if-branch {
96
- display: inline-block;
97
- margin-right: 5px;
98
- border-radius: 3px;
99
- position: relative;
100
- padding: 0 4px;
101
- background: #333;
102
- color: yellow;
103
- }
104
-
105
- .skip-if-branch {
106
- display: none;
107
- margin-right: 10px;
108
- position: relative;
109
- padding: 0 4px;
110
- background: #ccc;
111
- color: white;
112
- }
113
- .missing-if-branch .typ, .skip-if-branch .typ {
114
- color: inherit !important;
115
- }
116
- .coverage-summary {
117
- border-collapse: collapse;
118
- width: 100%;
119
- }
120
- .coverage-summary tr { border-bottom: 1px solid #bbb; }
121
- .keyline-all { border: 1px solid #ddd; }
122
- .coverage-summary td, .coverage-summary th { padding: 10px; }
123
- .coverage-summary tbody { border: 1px solid #bbb; }
124
- .coverage-summary td { border-right: 1px solid #bbb; }
125
- .coverage-summary td:last-child { border-right: none; }
126
- .coverage-summary th {
127
- text-align: left;
128
- font-weight: normal;
129
- white-space: nowrap;
130
- }
131
- .coverage-summary th.file { border-right: none !important; }
132
- .coverage-summary th.pct { }
133
- .coverage-summary th.pic,
134
- .coverage-summary th.abs,
135
- .coverage-summary td.pct,
136
- .coverage-summary td.abs { text-align: right; }
137
- .coverage-summary td.file { white-space: nowrap; }
138
- .coverage-summary td.pic { min-width: 120px !important; }
139
- .coverage-summary tfoot td { }
140
-
141
- .coverage-summary .sorter {
142
- height: 10px;
143
- width: 7px;
144
- display: inline-block;
145
- margin-left: 0.5em;
146
- background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147
- }
148
- .coverage-summary .sorted .sorter {
149
- background-position: 0 -20px;
150
- }
151
- .coverage-summary .sorted-desc .sorter {
152
- background-position: 0 -10px;
153
- }
154
- .status-line { height: 10px; }
155
- /* yellow */
156
- .cbranch-no { background: yellow !important; color: #111; }
157
- /* dark red */
158
- .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
159
- .low .chart { border:1px solid #C21F39 }
160
- .highlighted,
161
- .highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
162
- background: #C21F39 !important;
163
- }
164
- /* medium red */
165
- .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
166
- /* light red */
167
- .low, .cline-no { background:#FCE1E5 }
168
- /* light green */
169
- .high, .cline-yes { background:rgb(230,245,208) }
170
- /* medium green */
171
- .cstat-yes { background:rgb(161,215,106) }
172
- /* dark green */
173
- .status-line.high, .high .cover-fill { background:rgb(77,146,33) }
174
- .high .chart { border:1px solid rgb(77,146,33) }
175
- /* dark yellow (gold) */
176
- .status-line.medium, .medium .cover-fill { background: #f9cd0b; }
177
- .medium .chart { border:1px solid #f9cd0b; }
178
- /* light yellow */
179
- .medium { background: #fff4c2; }
180
-
181
- .cstat-skip { background: #ddd; color: #111; }
182
- .fstat-skip { background: #ddd; color: #111 !important; }
183
- .cbranch-skip { background: #ddd !important; color: #111; }
184
-
185
- span.cline-neutral { background: #eaeaea; }
186
-
187
- .coverage-summary td.empty {
188
- opacity: .5;
189
- padding-top: 4px;
190
- padding-bottom: 4px;
191
- line-height: 1;
192
- color: #888;
193
- }
194
-
195
- .cover-fill, .cover-empty {
196
- display:inline-block;
197
- height: 12px;
198
- }
199
- .chart {
200
- line-height: 0;
201
- }
202
- .cover-empty {
203
- background: white;
204
- }
205
- .cover-full {
206
- border-right: none !important;
207
- }
208
- pre.prettyprint {
209
- border: none !important;
210
- padding: 0 !important;
211
- margin: 0 !important;
212
- }
213
- .com { color: #999 !important; }
214
- .ignore-none { color: #999; font-weight: normal; }
215
-
216
- .wrapper {
217
- min-height: 100%;
218
- height: auto !important;
219
- height: 100%;
220
- margin: 0 auto -48px;
221
- }
222
- .footer, .push {
223
- height: 48px;
224
- }
@@ -1,87 +0,0 @@
1
- /* eslint-disable */
2
- var jumpToCode = (function init() {
3
- // Classes of code we would like to highlight in the file view
4
- var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
5
-
6
- // Elements to highlight in the file listing view
7
- var fileListingElements = ['td.pct.low'];
8
-
9
- // We don't want to select elements that are direct descendants of another match
10
- var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
11
-
12
- // Selecter that finds elements on the page to which we can jump
13
- var selector =
14
- fileListingElements.join(', ') +
15
- ', ' +
16
- notSelector +
17
- missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
18
-
19
- // The NodeList of matching elements
20
- var missingCoverageElements = document.querySelectorAll(selector);
21
-
22
- var currentIndex;
23
-
24
- function toggleClass(index) {
25
- missingCoverageElements
26
- .item(currentIndex)
27
- .classList.remove('highlighted');
28
- missingCoverageElements.item(index).classList.add('highlighted');
29
- }
30
-
31
- function makeCurrent(index) {
32
- toggleClass(index);
33
- currentIndex = index;
34
- missingCoverageElements.item(index).scrollIntoView({
35
- behavior: 'smooth',
36
- block: 'center',
37
- inline: 'center'
38
- });
39
- }
40
-
41
- function goToPrevious() {
42
- var nextIndex = 0;
43
- if (typeof currentIndex !== 'number' || currentIndex === 0) {
44
- nextIndex = missingCoverageElements.length - 1;
45
- } else if (missingCoverageElements.length > 1) {
46
- nextIndex = currentIndex - 1;
47
- }
48
-
49
- makeCurrent(nextIndex);
50
- }
51
-
52
- function goToNext() {
53
- var nextIndex = 0;
54
-
55
- if (
56
- typeof currentIndex === 'number' &&
57
- currentIndex < missingCoverageElements.length - 1
58
- ) {
59
- nextIndex = currentIndex + 1;
60
- }
61
-
62
- makeCurrent(nextIndex);
63
- }
64
-
65
- return function jump(event) {
66
- if (
67
- document.getElementById('fileSearch') === document.activeElement &&
68
- document.activeElement != null
69
- ) {
70
- // if we're currently focused on the search input, we don't want to navigate
71
- return;
72
- }
73
-
74
- switch (event.which) {
75
- case 78: // n
76
- case 74: // j
77
- goToNext();
78
- break;
79
- case 66: // b
80
- case 75: // k
81
- case 80: // p
82
- goToPrevious();
83
- break;
84
- }
85
- };
86
- })();
87
- window.addEventListener('keydown', jumpToCode);
Binary file