Skip to content

Commit ca6ee0f

Browse files
committed
object modifiers / table row attribs
1 parent 85ceae2 commit ca6ee0f

File tree

5 files changed

+41
-109
lines changed

5 files changed

+41
-109
lines changed

src/js/main.js

Lines changed: 20 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -401,38 +401,6 @@
401401
return $table
402402
};
403403

404-
/*
405-
function unsafeKeys (rows) {
406-
var k
407-
var k2
408-
var row
409-
var rowNew
410-
var rowsNew = {}
411-
var val
412-
for (k in rows) {
413-
row = rows[k]
414-
rowNew = {}
415-
if (typeof row === 'object') {
416-
for (k2 in row) {
417-
val = row[k2]
418-
console.log('k2', k2, val)
419-
if (k2.substr(0, 6) === '_b64_:') {
420-
k2 = base64.decode(k2.substr(6))
421-
}
422-
rowNew[k2] = val
423-
}
424-
} else {
425-
rowNew = row
426-
}
427-
if (k.substr(0, 6) === '_b64_:') {
428-
k = base64.decode(k.substr(6))
429-
}
430-
rowsNew[k] = rowNew
431-
}
432-
return rowsNew
433-
}
434-
*/
435-
436404
Table.prototype.buildBody = function (rows, tableInfo, onBuildRow) {
437405
var i;
438406
var length;
@@ -462,7 +430,7 @@
462430
rowKey = parseInt(rowKey, 10);
463431
}
464432
parsed = this.dump.parseTag(this.dump.dump(rowKey));
465-
$tr = $('<tr></tr>')
433+
$tr = $('<tr></tr>', rowInfo.attribs || {})
466434
.append(
467435
$('<th scope="row" class="t_key text-right"></th>')
468436
.addClass(/^\d+$/.test(rowKey) ? 't_int' : parsed.attribs.class.join(' '))
@@ -2977,10 +2945,7 @@
29772945
html = this.dumpToString(abs) +
29782946
strClassname +
29792947
'<dl class="object-inner">' +
2980-
(abs.isFinal
2981-
? '<dt class="t_modifier_final">final</dt>'
2982-
: ''
2983-
) +
2948+
this.dumpModifiers(abs) +
29842949
(abs.extends && abs.extends.length
29852950
? '<dt>extends</dt>' +
29862951
abs.extends.map(function (classname) {
@@ -3006,6 +2971,24 @@
30062971
return html
30072972
};
30082973

2974+
DumpObject.prototype.dumpModifiers = function (abs) {
2975+
var modifiers = [];
2976+
var html = '<dt class="modifiers">modifiers</dt>';
2977+
if (abs.isFinal) {
2978+
modifiers.push('final');
2979+
}
2980+
if (abs.isReadOnly) {
2981+
modifiers.push('readonly');
2982+
}
2983+
if (modifiers.length === 0) {
2984+
return ''
2985+
}
2986+
$.each(modifiers, function (i, modifier) {
2987+
html += '<dd class="t_modifier_' + modifier + '">' + modifier + '</dt>';
2988+
});
2989+
return html
2990+
};
2991+
30092992
DumpObject.prototype.dumpClassname = function (abs) {
30102993
var phpDoc = abs.phpDoc || {};
30112994
var strClassname = abs.className;
@@ -5137,23 +5120,6 @@
51375120
return $('<li>', { class: 'm_' + logEntry.method }).append($table)
51385121
},
51395122
trace: function (logEntry, info) {
5140-
/*
5141-
var $table = table.build(
5142-
logEntry.args[0],
5143-
logEntry.meta,
5144-
// 'table-bordered',
5145-
logEntry.meta.inclContext
5146-
? tableAddContextRow
5147-
: null
5148-
)
5149-
if (logEntry.meta.inclContext) {
5150-
$table.addClass('trace-context')
5151-
}
5152-
if (logEntry.meta.sortable) {
5153-
$table.addClass('sortable')
5154-
}
5155-
return $('<li class="m_trace"></li>').append($table)
5156-
*/
51575123
return this.table(logEntry, info)
51585124
},
51595125
default: function (logEntry, info) {

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/DumpObject.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@ DumpObject.prototype.dump = function (abs) {
121121
html = this.dumpToString(abs) +
122122
strClassname +
123123
'<dl class="object-inner">' +
124-
(abs.isFinal
125-
? '<dt class="t_modifier_final">final</dt>'
126-
: ''
127-
) +
124+
this.dumpModifiers(abs) +
128125
(abs.extends && abs.extends.length
129126
? '<dt>extends</dt>' +
130127
abs.extends.map(function (classname) {
@@ -150,6 +147,24 @@ DumpObject.prototype.dump = function (abs) {
150147
return html
151148
}
152149

150+
DumpObject.prototype.dumpModifiers = function (abs) {
151+
var modifiers = []
152+
var html = '<dt class="modifiers">modifiers</dt>';
153+
if (abs.isFinal) {
154+
modifiers.push('final')
155+
}
156+
if (abs.isReadOnly) {
157+
modifiers.push('readonly')
158+
}
159+
if (modifiers.length === 0) {
160+
return ''
161+
}
162+
$.each(modifiers, function (i, modifier) {
163+
html += '<dd class="t_modifier_' + modifier + '">' + modifier + '</dt>'
164+
})
165+
return html
166+
}
167+
153168
DumpObject.prototype.dumpClassname = function (abs) {
154169
var phpDoc = abs.phpDoc || {}
155170
var strClassname = abs.className

src/js_src/Logger/MethodTable.js

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,6 @@ Table.prototype.build = function (rows, meta, onBuildRow) {
3535
return $table
3636
}
3737

38-
/*
39-
function unsafeKeys (rows) {
40-
var k
41-
var k2
42-
var row
43-
var rowNew
44-
var rowsNew = {}
45-
var val
46-
for (k in rows) {
47-
row = rows[k]
48-
rowNew = {}
49-
if (typeof row === 'object') {
50-
for (k2 in row) {
51-
val = row[k2]
52-
console.log('k2', k2, val)
53-
if (k2.substr(0, 6) === '_b64_:') {
54-
k2 = base64.decode(k2.substr(6))
55-
}
56-
rowNew[k2] = val
57-
}
58-
} else {
59-
rowNew = row
60-
}
61-
if (k.substr(0, 6) === '_b64_:') {
62-
k = base64.decode(k.substr(6))
63-
}
64-
rowsNew[k] = rowNew
65-
}
66-
return rowsNew
67-
}
68-
*/
69-
7038
Table.prototype.buildBody = function (rows, tableInfo, onBuildRow) {
7139
var i
7240
var length
@@ -96,7 +64,7 @@ Table.prototype.buildBody = function (rows, tableInfo, onBuildRow) {
9664
rowKey = parseInt(rowKey, 10)
9765
}
9866
parsed = this.dump.parseTag(this.dump.dump(rowKey))
99-
$tr = $('<tr></tr>')
67+
$tr = $('<tr></tr>', rowInfo.attribs || {})
10068
.append(
10169
$('<th scope="row" class="t_key text-right"></th>')
10270
.addClass(/^\d+$/.test(rowKey) ? 't_int' : parsed.attribs.class.join(' '))

src/js_src/Logger/Methods.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -309,23 +309,6 @@ export var methods = {
309309
return $('<li>', { class: 'm_' + logEntry.method }).append($table)
310310
},
311311
trace: function (logEntry, info) {
312-
/*
313-
var $table = table.build(
314-
logEntry.args[0],
315-
logEntry.meta,
316-
// 'table-bordered',
317-
logEntry.meta.inclContext
318-
? tableAddContextRow
319-
: null
320-
)
321-
if (logEntry.meta.inclContext) {
322-
$table.addClass('trace-context')
323-
}
324-
if (logEntry.meta.sortable) {
325-
$table.addClass('sortable')
326-
}
327-
return $('<li class="m_trace"></li>').append($table)
328-
*/
329312
return this.table(logEntry, info)
330313
},
331314
default: function (logEntry, info) {

0 commit comments

Comments
 (0)