diff --git a/res/css/_content.sass b/res/css/_content.sass index 9e279a671b2d0281422cb693f5ede47059d59bcd..98ca7e56fa949b1512c684996c763c74fe82c698 100644 --- a/res/css/_content.sass +++ b/res/css/_content.sass @@ -21,8 +21,9 @@ position: relative &.focus:not(.hasmore) - .inline-button - display: none + > .container + > .inline-button + display: none .title border-bottom: 1px solid transparent diff --git a/res/css/search.css b/res/css/search.css index b08e97fc3cc8931ea1d03d7d792ae6dacc0dc7dd..5fee15f5bdfe2490d3e46f3396d8a33b5cbccfab 100644 --- a/res/css/search.css +++ b/res/css/search.css @@ -914,7 +914,7 @@ body { margin-top: 0; margin-bottom: 20px; position: relative; } - .results .buffer.focus:not(.hasmore) .inline-button { + .results .buffer.focus:not(.hasmore) > .container > .inline-button { display: none; } .results .buffer .title { border-bottom: 1px solid transparent; diff --git a/res/js/component/message.js b/res/js/component/message.js index c8501ca84f543d4fb7c76d43672510f656701b65..d9ea3326f6db722b6d60ec6f34d528eb82a7a348 100644 --- a/res/js/component/message.js +++ b/res/js/component/message.js @@ -15,46 +15,51 @@ class Message extends Component { classes.push('notice'); if ((this.type & 4) !== 0) classes.push('action'); + const content = MircColorHandler.render(this.content); return this.elem = function () { var $$a = document.createElement('span'); $$a.setAttribute('class', classes.join(' ')); - var $$b = document.createElement('span'); + var $$b = document.createElement('div'); + $$b.setAttribute('class', 'hidden'); $$a.appendChild($$b); - var $$c = document.createElement('time'); - $$b.appendChild($$c); - $$c.appendChildren(this.formatTime()); - var $$e = document.createElement('span'); - $$e.setAttribute('class', 'container'); - $$a.appendChild($$e); - var $$f = document.createElement('span'); - $$f.setAttribute('class', 'sender'); - $$f.setAttribute('data-sendercolor', SenderColorHandler.nickToColor(this.getNick())); - $$e.appendChild($$f); + $$b.appendChildren(JSON.stringify(MircColorHandler.render(this.content))); + var $$d = document.createElement('span'); + $$a.appendChild($$d); + var $$e = document.createElement('time'); + $$d.appendChild($$e); + $$e.appendChildren(this.formatTime()); var $$g = document.createElement('span'); - $$g.setAttribute('class', 'invisible'); - $$f.appendChild($$g); - var $$h = document.createTextNode(' <'); + $$g.setAttribute('class', 'container'); + $$a.appendChild($$g); + var $$h = document.createElement('span'); + $$h.setAttribute('class', 'sender'); + $$h.setAttribute('data-sendercolor', SenderColorHandler.nickToColor(this.getNick())); $$g.appendChild($$h); - $$f.appendChildren(this.getNick()); - var $$j = document.createElement('span'); - $$j.setAttribute('class', 'invisible'); - $$f.appendChild($$j); - var $$k = document.createTextNode('> '); - $$j.appendChild($$k); + var $$i = document.createElement('span'); + $$i.setAttribute('class', 'invisible'); + $$h.appendChild($$i); + var $$j = document.createTextNode(' <'); + $$i.appendChild($$j); + $$h.appendChildren(this.getNick()); var $$l = document.createElement('span'); - $$l.setAttribute('class', 'content'); - $$e.appendChild($$l); - $$l.appendChildren(MircColorHandler.render(this.content)); + $$l.setAttribute('class', 'invisible'); + $$h.appendChild($$l); + var $$m = document.createTextNode('> '); + $$l.appendChild($$m); + var $$n = document.createElement('span'); + $$n.setAttribute('class', 'content'); + $$g.appendChild($$n); + $$n.appendChildren(content.length ? content : null); $$a.appendChildren(this.isAnchor ? function () { - var $$o = document.createElement('a'); - $$o.setAttribute('class', 'more icon'); - $$o.addEventListener('click', () => this.sendEvent('focus', [])); - var $$p = document.createTextNode('list'); - $$o.appendChild($$p); - return $$o; + var $$q = document.createElement('a'); + $$q.setAttribute('class', 'more icon'); + $$q.addEventListener('click', () => this.sendEvent('focus', [])); + var $$r = document.createTextNode('list'); + $$q.appendChild($$r); + return $$q; }.call(this) : null); - var $$q = document.createElement('br'); - $$a.appendChild($$q); + var $$s = document.createElement('br'); + $$a.appendChild($$s); return $$a; }.call(this); } diff --git a/res/js/component/message.jsx b/res/js/component/message.jsx index cfad04c139ccced2e73937bd5cb05e238e6354cb..48f27eaa08f6cdc332c6eb41a1eeea60d21c636e 100644 --- a/res/js/component/message.jsx +++ b/res/js/component/message.jsx @@ -19,8 +19,11 @@ class Message extends Component { if ((this.type & 0x00000004) !== 0) classes.push("action"); + const content = MircColorHandler.render(this.content); + return this.elem = ( <span className={classes.join(" ")}> + <div className="hidden">{JSON.stringify(MircColorHandler.render(this.content))}</div> <span><time>{this.formatTime()}</time></span> <span className="container"> <span className="sender" data-sendercolor={SenderColorHandler.nickToColor(this.getNick())}> @@ -29,7 +32,7 @@ class Message extends Component { <span className="invisible">> </span> </span> <span className="content"> - {MircColorHandler.render(this.content)} + {content.length ? content : null} </span> </span> {this.isAnchor ? (