Skip to content

Commit 7819592

Browse files
committed
"maintenence" commit
1 parent 6080d2b commit 7819592

12 files changed

Lines changed: 9877 additions & 646 deletions

File tree

.stylelintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "stylelint-config-standard-scss",
3+
"rules": {
4+
"rule-empty-line-before": null,
5+
"at-rule-no-unknown": [ true, {
6+
"ignoreAtRules": ["extend", "at-root", "debug", "warn", "error", "if", "else", "for", "each", "while", "mixin", "include", "content", "return", "function"]
7+
}]
8+
}
9+
}

package-lock.json

Lines changed: 9659 additions & 419 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
],
99
"main": "index.js",
1010
"scripts": {
11-
"build": "npx npm-run-all --parallel build:*",
12-
"build:css": "scss -t compact --sourcemap=none ./src/scss/WampClient.scss ./src/css/WampClient.css",
11+
"build": "npm run nra -- --parallel build:*",
12+
"build:css": "npx node-sass --output-style compressed ./src/scss/WampClient.scss ./src/css/WampClient.css",
1313
"build:js": "npx rollup -c",
14-
"cs": "npx npm-run-all --continue-on-error cs:*",
14+
"cs": "npm run nra -- --continue-on-error cs:*",
1515
"cs:css": "npx stylelint ./src/scss",
1616
"cs:js": "npx eslint ./src/js_src/*",
17+
"nra": "node node_modules/npm-run-all/bin/npm-run-all",
1718
"test": "echo \"Error: no test specified\" && exit 1",
18-
"watch": "npx npm-run-all --parallel watch:*",
19+
"watch": "npm run nra -- --parallel watch:*",
1920
"watch:js": "NODE_ENV=watch npx nodemon --watch js_src/ --ext js --exec \"npm run build:js\"",
2021
"watch:scss": "npx nodemon --watch ./src/scss/ --ext scss --exec \"npm run build:css\""
2122
},
@@ -37,7 +38,9 @@
3738
"rollup-plugin-commonjs": "^9.2.2",
3839
"rollup-plugin-legacy": "^1.0.0",
3940
"rollup-plugin-node-resolve": "^4.0.1",
40-
"rollup-plugin-uglify": "^6.0.4"
41+
"rollup-plugin-uglify": "^6.0.4",
42+
"stylelint": "^14.1.0",
43+
"stylelint-config-standard-scss": "^3.0.0"
4144
},
4245
"dependencies": {}
4346
}

src/WampClient.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
class WampClient
2424
{
25-
2625
protected $cfg = array();
2726
protected $debug;
2827
protected $request;

src/css/WampClient.css

Lines changed: 1 addition & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/main.js

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,10 @@
704704
$.each(abs.constants, function (key, info) {
705705
$dd = $('<dd class="constant ' + info.visibility + '">' +
706706
'<span class="t_modifier_' + info.visibility + '">' + info.visibility + '</span> ' +
707+
(info.isFinal
708+
? '<span class="t_modifier_final">final</span> '
709+
: ''
710+
) +
707711
'<span class="t_identifier"' + (outPhpDoc && info.desc ? ' title="' + info.desc.escapeHtml() + '"' : '') + '>' + key + '</span> ' +
708712
'<span class="t_operator">=</span> ' +
709713
self.dumper.dump(info.value) +
@@ -787,28 +791,25 @@
787791
// console.info('property info', info)
788792
var $dd;
789793
var isPrivateAncestor = $.inArray('private', info.visibility) >= 0 && info.inheritedFrom;
790-
var modifiers = '';
791794
var classes = {
792-
'debuginfo-value': info.valueFrom === 'debugInfo',
793795
'debug-value': info.valueFrom === 'debug',
794-
excluded: info.isExcluded,
796+
'debuginfo-excluded': info.debugInfoExcluded,
797+
'debuginfo-value': info.valueFrom === 'debugInfo',
795798
forceShow: info.forceShow,
796799
inherited: typeof info.inheritedFrom === 'string',
797-
'private-ancestor': info.isPrivateAncestor
800+
isPromoted: info.isPromoted,
801+
isReadOnly: info.isReadOnly,
802+
isStatic: info.isStatic,
803+
'private-ancestor': info.isPrivateAncestor,
804+
property: true
798805
};
799806
name = name.replace('debug.', '');
800807
if (typeof info.visibility !== 'object') {
801808
info.visibility = [info.visibility];
802809
}
803810
classes[info.visibility.join(' ')] = $.inArray('debug', info.visibility) < 0;
804-
$.each(info.visibility, function (i, vis) {
805-
modifiers += '<span class="t_modifier_' + vis + '">' + vis + '</span> ';
806-
});
807-
if (info.isStatic) {
808-
modifiers += '<span class="t_modifier_static">static</span> ';
809-
}
810-
$dd = $('<dd class="property">' +
811-
modifiers +
811+
$dd = $('<dd>' +
812+
self.dumpPropertyModifiers(info) +
812813
(isPrivateAncestor
813814
? ' (<i>' + info.inheritedFrom + '</i>)'
814815
: ''
@@ -846,6 +847,21 @@
846847
return html
847848
};
848849

850+
DumpObject.prototype.dumpPropertyModifiers = function (info) {
851+
var html = '';
852+
var modifiers = JSON.parse(JSON.stringify(info.visibility));
853+
if (info.isReadOnly) {
854+
modifiers.push('readonly');
855+
}
856+
if (info.isStatic) {
857+
modifiers.push('static');
858+
}
859+
$.each(modifiers, function (i, modifier) {
860+
html += '<span class="t_modifier_' + modifier + '">' + modifier + '</span> ';
861+
});
862+
return html
863+
};
864+
849865
DumpObject.prototype.dumpMethods = function (abs) {
850866
var self = this;
851867
var html = '';
@@ -1637,8 +1653,7 @@
16371653
DumpString.prototype.dump = function (val, abs) {
16381654
var dumpOpts = this.dumper.getDumpOpts();
16391655
if ($.isNumeric(val)) {
1640-
dumpOpts.attribs.class.push('numeric');
1641-
this.dumper.checkTimestamp(val);
1656+
this.dumper.checkTimestamp(val, abs);
16421657
}
16431658
if (!dumpOpts.addQuotes) {
16441659
dumpOpts.attribs.class.push('no-quotes');
@@ -1837,23 +1852,29 @@
18371852
this.TYPE_FLOAT_NAN = '\x00nan\x00'.parseHex();
18381853
};
18391854

1840-
Dump.prototype.checkTimestamp = function (val) {
1841-
var secs = 86400 * 90; // 90 days worth o seconds
1842-
var tsNow = Date.now() / 1000;
1855+
Dump.prototype.checkTimestamp = function (val, abs) {
18431856
var date;
18441857
var dumpOpts;
1845-
val = parseFloat(val, 10);
1846-
if (val > tsNow - secs && val < tsNow + secs) {
1847-
date = (new Date(val * 1000)).toString();
1848-
dumpOpts = this.getDumpOpts();
1849-
dumpOpts.postDump = function (val, dumpOpts) {
1850-
return $('<span />', {
1858+
if (typeof abs === 'undefined' || abs.typeMore !== 'timestamp') {
1859+
return;
1860+
}
1861+
date = (new Date(val * 1000)).toString();
1862+
dumpOpts = this.getDumpOpts();
1863+
dumpOpts.postDump = function (dumped, opts) {
1864+
if (opts.tagName === 'td') {
1865+
opts.attribs.class = 't_' + opts.type;
1866+
return $('<td />', {
18511867
class: 'timestamp value-container',
1852-
'data-type': dumpOpts.type,
1853-
title: date
1854-
}).html(val)
1855-
};
1856-
}
1868+
title: date,
1869+
html: $('<span />', opts.attribs).html(val)
1870+
})
1871+
}
1872+
return $('<span />', {
1873+
class: 'timestamp value-container',
1874+
title: date,
1875+
html: dumped
1876+
})
1877+
};
18571878
};
18581879

18591880
Dump.prototype.dump = function (val, opts) {
@@ -2034,8 +2055,8 @@
20342055
return this.markupIdentifier(abs.name)
20352056
};
20362057

2037-
Dump.prototype.dumpFloat = function (val) {
2038-
this.checkTimestamp(val);
2058+
Dump.prototype.dumpFloat = function (val, abs) {
2059+
this.checkTimestamp(val, abs);
20392060
if (val === this.TYPE_FLOAT_INF) {
20402061
return 'INF'
20412062
}
@@ -2045,8 +2066,8 @@
20452066
return val
20462067
};
20472068

2048-
Dump.prototype.dumpInt = function (val) {
2049-
return this.dumpFloat(val)
2069+
Dump.prototype.dumpInt = function (val, abs) {
2070+
return this.dumpFloat(val, abs)
20502071
};
20512072

20522073
Dump.prototype.dumpNotInspected = function () {
@@ -2980,7 +3001,7 @@
29803001
return false
29813002
}
29823003
/*
2983-
console.warn('adding channel', {
3004+
console.info('adding channel', {
29843005
name: info.channelName,
29853006
icon: meta.channelIcon,
29863007
show: meta.channelShow

src/js/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js_src/Logger/Dump.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,28 @@ export var Dump = function () {
2626
this.TYPE_FLOAT_NAN = '\x00nan\x00'.parseHex()
2727
}
2828

29-
Dump.prototype.checkTimestamp = function (val) {
30-
var secs = 86400 * 90 // 90 days worth o seconds
31-
var tsNow = Date.now() / 1000
29+
Dump.prototype.checkTimestamp = function (val, abs) {
3230
var date
3331
var dumpOpts
34-
val = parseFloat(val, 10)
35-
if (val > tsNow - secs && val < tsNow + secs) {
36-
date = (new Date(val * 1000)).toString()
37-
dumpOpts = this.getDumpOpts()
38-
dumpOpts.postDump = function (val, dumpOpts) {
39-
return $('<span />', {
32+
if (typeof abs === 'undefined' || abs.typeMore !== 'timestamp') {
33+
return;
34+
}
35+
date = (new Date(val * 1000)).toString()
36+
dumpOpts = this.getDumpOpts()
37+
dumpOpts.postDump = function (dumped, opts) {
38+
if (opts.tagName === 'td') {
39+
opts.attribs.class = 't_' + opts.type
40+
return $('<td />', {
4041
class: 'timestamp value-container',
41-
'data-type': dumpOpts.type,
42-
title: date
43-
}).html(val)
42+
title: date,
43+
html: $('<span />', opts.attribs).html(val)
44+
})
4445
}
46+
return $('<span />', {
47+
class: 'timestamp value-container',
48+
title: date,
49+
html: dumped
50+
})
4551
}
4652
}
4753

@@ -223,8 +229,8 @@ Dump.prototype.dumpConst = function (abs) {
223229
return this.markupIdentifier(abs.name)
224230
}
225231

226-
Dump.prototype.dumpFloat = function (val) {
227-
this.checkTimestamp(val)
232+
Dump.prototype.dumpFloat = function (val, abs) {
233+
this.checkTimestamp(val, abs)
228234
if (val === this.TYPE_FLOAT_INF) {
229235
return 'INF'
230236
}
@@ -234,8 +240,8 @@ Dump.prototype.dumpFloat = function (val) {
234240
return val
235241
}
236242

237-
Dump.prototype.dumpInt = function (val) {
238-
return this.dumpFloat(val)
243+
Dump.prototype.dumpInt = function (val, abs) {
244+
return this.dumpFloat(val, abs)
239245
}
240246

241247
Dump.prototype.dumpNotInspected = function () {

src/js_src/Logger/DumpObject.js

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ DumpObject.prototype.dumpConstants = function (abs) {
156156
$.each(abs.constants, function (key, info) {
157157
$dd = $('<dd class="constant ' + info.visibility + '">' +
158158
'<span class="t_modifier_' + info.visibility + '">' + info.visibility + '</span> ' +
159+
(info.isFinal
160+
? '<span class="t_modifier_final">final</span> '
161+
: ''
162+
) +
159163
'<span class="t_identifier"' + (outPhpDoc && info.desc ? ' title="' + info.desc.escapeHtml() + '"' : '') + '>' + key + '</span> ' +
160164
'<span class="t_operator">=</span> ' +
161165
self.dumper.dump(info.value) +
@@ -239,28 +243,25 @@ DumpObject.prototype.dumpProperties = function (abs, meta) {
239243
// console.info('property info', info)
240244
var $dd
241245
var isPrivateAncestor = $.inArray('private', info.visibility) >= 0 && info.inheritedFrom
242-
var modifiers = ''
243246
var classes = {
244-
'debuginfo-value': info.valueFrom === 'debugInfo',
245247
'debug-value': info.valueFrom === 'debug',
246-
excluded: info.isExcluded,
248+
'debuginfo-excluded': info.debugInfoExcluded,
249+
'debuginfo-value': info.valueFrom === 'debugInfo',
247250
forceShow: info.forceShow,
248251
inherited: typeof info.inheritedFrom === 'string',
249-
'private-ancestor': info.isPrivateAncestor
252+
isPromoted: info.isPromoted,
253+
isReadOnly: info.isReadOnly,
254+
isStatic: info.isStatic,
255+
'private-ancestor': info.isPrivateAncestor,
256+
property: true
250257
}
251258
name = name.replace('debug.', '')
252259
if (typeof info.visibility !== 'object') {
253260
info.visibility = [info.visibility]
254261
}
255262
classes[info.visibility.join(' ')] = $.inArray('debug', info.visibility) < 0
256-
$.each(info.visibility, function (i, vis) {
257-
modifiers += '<span class="t_modifier_' + vis + '">' + vis + '</span> '
258-
})
259-
if (info.isStatic) {
260-
modifiers += '<span class="t_modifier_static">static</span> '
261-
}
262-
$dd = $('<dd class="property">' +
263-
modifiers +
263+
$dd = $('<dd>' +
264+
self.dumpPropertyModifiers(info) +
264265
(isPrivateAncestor
265266
? ' (<i>' + info.inheritedFrom + '</i>)'
266267
: ''
@@ -298,6 +299,21 @@ DumpObject.prototype.dumpProperties = function (abs, meta) {
298299
return html
299300
}
300301

302+
DumpObject.prototype.dumpPropertyModifiers = function (info) {
303+
var html = ''
304+
var modifiers = JSON.parse(JSON.stringify(info.visibility));
305+
if (info.isReadOnly) {
306+
modifiers.push('readonly')
307+
}
308+
if (info.isStatic) {
309+
modifiers.push('static')
310+
}
311+
$.each(modifiers, function (i, modifier) {
312+
html += '<span class="t_modifier_' + modifier + '">' + modifier + '</span> '
313+
})
314+
return html
315+
}
316+
301317
DumpObject.prototype.dumpMethods = function (abs) {
302318
var self = this
303319
var html = ''

0 commit comments

Comments
 (0)