Modify the default conversation style to apply the CSS rule 'white-space: pre-wrap;' only on the text of inserted messages. Fix the default margins of smileys.
This commit is contained in:
Родитель
5f187d9ca8
Коммит
9b18cdca26
|
@ -141,7 +141,7 @@ function getRegexp(aIconsHash)
|
|||
// unused. May be useful later to process a string instead of an HTML node
|
||||
function smileString(aString)
|
||||
{
|
||||
const smileFormat = '<img src="smile://$1" alt="$1" title="$1"/>';
|
||||
const smileFormat = '<img class="ib-img-smile" src="smile://$1" alt="$1" title="$1"/>';
|
||||
return aString.replace(getRegexp(), smileFormat);
|
||||
}
|
||||
|
||||
|
@ -167,6 +167,7 @@ function smileNode(aNode)
|
|||
elt.setAttribute("src", "smile://" + smile);
|
||||
elt.setAttribute("title", smile);
|
||||
elt.setAttribute("alt", smile);
|
||||
elt.setAttribute("class", "ib-img-smile");
|
||||
smileNode.parentNode.replaceChild(elt, smileNode);
|
||||
exp.lastIndex = 0;
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ const headerFooterReplacements = {
|
|||
};
|
||||
|
||||
const statusMessageReplacements = {
|
||||
message: function(aMsg) aMsg.message,
|
||||
message: function(aMsg) "<span class=\"ib-msg-txt\">" + aMsg.message + "</span>",
|
||||
time: function(aMsg, aFormat) aMsg.time,
|
||||
shortTime: function(aMsg, aFormat) "FIXME",
|
||||
messageClasses: function(aMsg) {
|
||||
|
|
|
@ -35,12 +35,17 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
* {
|
||||
.ib-msg-txt {
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
*:-moz-any-link img {
|
||||
.ib-img-smile {
|
||||
margin-bottom: -3px;
|
||||
}
|
||||
|
||||
*:-moz-any-link .ib-img-smile {
|
||||
border: none;
|
||||
border-bottom: solid 1px;
|
||||
margin-bottom: -2px;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче