|
704 | 704 | $.each(abs.constants, function (key, info) { |
705 | 705 | $dd = $('<dd class="constant ' + info.visibility + '">' + |
706 | 706 | '<span class="t_modifier_' + info.visibility + '">' + info.visibility + '</span> ' + |
| 707 | + (info.isFinal |
| 708 | + ? '<span class="t_modifier_final">final</span> ' |
| 709 | + : '' |
| 710 | + ) + |
707 | 711 | '<span class="t_identifier"' + (outPhpDoc && info.desc ? ' title="' + info.desc.escapeHtml() + '"' : '') + '>' + key + '</span> ' + |
708 | 712 | '<span class="t_operator">=</span> ' + |
709 | 713 | self.dumper.dump(info.value) + |
|
787 | 791 | // console.info('property info', info) |
788 | 792 | var $dd; |
789 | 793 | var isPrivateAncestor = $.inArray('private', info.visibility) >= 0 && info.inheritedFrom; |
790 | | - var modifiers = ''; |
791 | 794 | var classes = { |
792 | | - 'debuginfo-value': info.valueFrom === 'debugInfo', |
793 | 795 | 'debug-value': info.valueFrom === 'debug', |
794 | | - excluded: info.isExcluded, |
| 796 | + 'debuginfo-excluded': info.debugInfoExcluded, |
| 797 | + 'debuginfo-value': info.valueFrom === 'debugInfo', |
795 | 798 | forceShow: info.forceShow, |
796 | 799 | 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 |
798 | 805 | }; |
799 | 806 | name = name.replace('debug.', ''); |
800 | 807 | if (typeof info.visibility !== 'object') { |
801 | 808 | info.visibility = [info.visibility]; |
802 | 809 | } |
803 | 810 | 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) + |
812 | 813 | (isPrivateAncestor |
813 | 814 | ? ' (<i>' + info.inheritedFrom + '</i>)' |
814 | 815 | : '' |
|
846 | 847 | return html |
847 | 848 | }; |
848 | 849 |
|
| 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 | + |
849 | 865 | DumpObject.prototype.dumpMethods = function (abs) { |
850 | 866 | var self = this; |
851 | 867 | var html = ''; |
|
1637 | 1653 | DumpString.prototype.dump = function (val, abs) { |
1638 | 1654 | var dumpOpts = this.dumper.getDumpOpts(); |
1639 | 1655 | if ($.isNumeric(val)) { |
1640 | | - dumpOpts.attribs.class.push('numeric'); |
1641 | | - this.dumper.checkTimestamp(val); |
| 1656 | + this.dumper.checkTimestamp(val, abs); |
1642 | 1657 | } |
1643 | 1658 | if (!dumpOpts.addQuotes) { |
1644 | 1659 | dumpOpts.attribs.class.push('no-quotes'); |
|
1837 | 1852 | this.TYPE_FLOAT_NAN = '\x00nan\x00'.parseHex(); |
1838 | 1853 | }; |
1839 | 1854 |
|
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) { |
1843 | 1856 | var date; |
1844 | 1857 | 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 />', { |
1851 | 1867 | 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 | + }; |
1857 | 1878 | }; |
1858 | 1879 |
|
1859 | 1880 | Dump.prototype.dump = function (val, opts) { |
|
2034 | 2055 | return this.markupIdentifier(abs.name) |
2035 | 2056 | }; |
2036 | 2057 |
|
2037 | | - Dump.prototype.dumpFloat = function (val) { |
2038 | | - this.checkTimestamp(val); |
| 2058 | + Dump.prototype.dumpFloat = function (val, abs) { |
| 2059 | + this.checkTimestamp(val, abs); |
2039 | 2060 | if (val === this.TYPE_FLOAT_INF) { |
2040 | 2061 | return 'INF' |
2041 | 2062 | } |
|
2045 | 2066 | return val |
2046 | 2067 | }; |
2047 | 2068 |
|
2048 | | - Dump.prototype.dumpInt = function (val) { |
2049 | | - return this.dumpFloat(val) |
| 2069 | + Dump.prototype.dumpInt = function (val, abs) { |
| 2070 | + return this.dumpFloat(val, abs) |
2050 | 2071 | }; |
2051 | 2072 |
|
2052 | 2073 | Dump.prototype.dumpNotInspected = function () { |
|
2980 | 3001 | return false |
2981 | 3002 | } |
2982 | 3003 | /* |
2983 | | - console.warn('adding channel', { |
| 3004 | + console.info('adding channel', { |
2984 | 3005 | name: info.channelName, |
2985 | 3006 | icon: meta.channelIcon, |
2986 | 3007 | show: meta.channelShow |
|
0 commit comments