Enable preserveWhitespace: false
, add spaces where needed, fix whitespace when copying text
This commit is contained in:
parent
5f0f745d10
commit
42717e3dec
@ -5,7 +5,7 @@
|
|||||||
:data-from="message.from && message.from.nick">
|
:data-from="message.from && message.from.nick">
|
||||||
<span
|
<span
|
||||||
:aria-label="message.time | localetime"
|
:aria-label="message.time | localetime"
|
||||||
class="time tooltipped tooltipped-e">{{ messageTime }}</span>
|
class="time tooltipped tooltipped-e">{{ messageTime }} </span>
|
||||||
<template v-if="message.type === 'unhandled'">
|
<template v-if="message.type === 'unhandled'">
|
||||||
<span class="from">[{{ message.command }}]</span>
|
<span class="from">[{{ message.command }}]</span>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
@ -15,16 +15,16 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="isAction()">
|
<template v-else-if="isAction()">
|
||||||
<span class="from" />
|
<span class="from"><span class="only-copy">*** </span></span>
|
||||||
<component
|
<component
|
||||||
:is="messageComponent"
|
:is="messageComponent"
|
||||||
:network="network"
|
:network="network"
|
||||||
:message="message" />
|
:message="message" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="message.type === 'action'">
|
<template v-else-if="message.type === 'action'">
|
||||||
<span class="from" />
|
<span class="from"><span class="only-copy">* </span></span>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
<span class="only-copy">* </span><Username :user="message.from" /> <ParsedMessage
|
<Username :user="message.from" /> <ParsedMessage
|
||||||
:network="network"
|
:network="network"
|
||||||
:message="message" />
|
:message="message" />
|
||||||
<LinkPreview
|
<LinkPreview
|
||||||
@ -35,9 +35,22 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<span class="from">
|
<span
|
||||||
|
v-if="message.type === 'message'"
|
||||||
|
class="from">
|
||||||
<template v-if="message.from && message.from.nick">
|
<template v-if="message.from && message.from.nick">
|
||||||
|
<span class="only-copy"><</span>
|
||||||
<Username :user="message.from" />
|
<Username :user="message.from" />
|
||||||
|
<span class="only-copy">> </span>
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
class="from">
|
||||||
|
<template v-if="message.from && message.from.nick">
|
||||||
|
<span class="only-copy">-</span>
|
||||||
|
<Username :user="message.from" />
|
||||||
|
<span class="only-copy">- </span>
|
||||||
</template>
|
</template>
|
||||||
</span>
|
</span>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
<Username :user="message.from" />
|
<Username :user="message.from" /> 
|
||||||
<span class="ctcp-message"><ParsedMessage :text="message.ctcpMessage" /></span>
|
<span class="ctcp-message"><ParsedMessage :text="message.ctcpMessage" /></span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
<Username :user="message.from" />
|
<Username :user="message.from" />
|
||||||
<i class="hostmask">({{ message.hostmask }})</i>
|
<i class="hostmask"> ({{ message.hostmask }})</i>
|
||||||
has joined the channel
|
has joined the channel
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<Username :user="message.target" />
|
<Username :user="message.target" />
|
||||||
<i
|
<i
|
||||||
v-if="message.text"
|
v-if="message.text"
|
||||||
class="part-reason">(<ParsedMessage
|
class="part-reason"> (<ParsedMessage
|
||||||
:network="network"
|
:network="network"
|
||||||
:message="message" />)</i>
|
:message="message" />)</i>
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
<Username :user="message.from" />
|
<Username :user="message.from" />
|
||||||
<i class="hostmask">({{ message.hostmask }})</i>
|
<i class="hostmask"> ({{ message.hostmask }})</i> has left the channel <i
|
||||||
has left the channel
|
|
||||||
<i
|
|
||||||
v-if="message.text"
|
v-if="message.text"
|
||||||
class="part-reason">(<ParsedMessage
|
class="part-reason">(<ParsedMessage
|
||||||
:network="network"
|
:network="network"
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
<Username :user="message.from" />
|
<Username :user="message.from" />
|
||||||
<i class="hostmask">({{ message.hostmask }})</i>
|
<i class="hostmask"> ({{ message.hostmask }})</i> has quit <i
|
||||||
has quit
|
|
||||||
<i
|
|
||||||
v-if="message.text"
|
v-if="message.text"
|
||||||
class="quit-reason">(<ParsedMessage
|
class="quit-reason">(<ParsedMessage
|
||||||
:network="network"
|
:network="network"
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
<template v-if="message.from && message.from.nick">
|
<template v-if="message.from && message.from.nick"><Username :user="message.from" /> has changed the topic to: </template>
|
||||||
<Username :user="message.from" />
|
<template v-else>The topic is: </template>
|
||||||
has changed the topic to:
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
The topic is:
|
|
||||||
</template>
|
|
||||||
<span
|
<span
|
||||||
v-if="message.text"
|
v-if="message.text"
|
||||||
class="new-topic"><ParsedMessage
|
class="new-topic"><ParsedMessage
|
||||||
|
@ -2498,6 +2498,12 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#chat .from::after {
|
||||||
|
/* Add a space because mobile view changes to block display without paddings */
|
||||||
|
content: " ";
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
|
||||||
#chat .channel .msg.highlight {
|
#chat .channel .msg.highlight {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const $ = require("jquery");
|
|
||||||
|
|
||||||
module.exports = function(chat) {
|
module.exports = function(chat) {
|
||||||
const selection = window.getSelection();
|
const selection = window.getSelection();
|
||||||
|
|
||||||
@ -14,13 +12,6 @@ module.exports = function(chat) {
|
|||||||
const documentFragment = range.cloneContents();
|
const documentFragment = range.cloneContents();
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
|
|
||||||
$(documentFragment)
|
|
||||||
.find(".from .user")
|
|
||||||
.each((_, el) => {
|
|
||||||
el = $(el);
|
|
||||||
el.text(`<${el.text()}>`);
|
|
||||||
});
|
|
||||||
|
|
||||||
div.id = "js-copy-hack";
|
div.id = "js-copy-hack";
|
||||||
div.appendChild(documentFragment);
|
div.appendChild(documentFragment);
|
||||||
chat.appendChild(div);
|
chat.appendChild(div);
|
||||||
|
@ -24,6 +24,11 @@ const config = {
|
|||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
use: {
|
use: {
|
||||||
loader: "vue-loader",
|
loader: "vue-loader",
|
||||||
|
options: {
|
||||||
|
compilerOptions: {
|
||||||
|
preserveWhitespace: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user