зеркало из https://github.com/mozilla/gecko-dev.git
Bug 257026 - Feature Request: URL Logger
Exclude URL logging for topics p=silver@warwickcompsoc.co.uk r=samuel@sieb.net chatzilla only
This commit is contained in:
Родитель
6bfd396479
Коммит
c8a4b3e183
|
@ -437,8 +437,9 @@ function updateChannel()
|
||||||
|
|
||||||
if (view.topic)
|
if (view.topic)
|
||||||
{
|
{
|
||||||
var nodes = client.munger.munge(view.topic, null,
|
var data = getObjectDetails(view);
|
||||||
getObjectDetails(view));
|
data.dontLogURLs = true;
|
||||||
|
var nodes = client.munger.munge(view.topic, null, data);
|
||||||
header["topicnodes"].appendChild(nodes);
|
header["topicnodes"].appendChild(nodes);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -475,8 +476,9 @@ function updateUser()
|
||||||
header["descnodes"].removeChild(header["descnodes"].firstChild);
|
header["descnodes"].removeChild(header["descnodes"].firstChild);
|
||||||
if (typeof view.desc != "undefined")
|
if (typeof view.desc != "undefined")
|
||||||
{
|
{
|
||||||
var nodes = client.munger.munge(view.desc, null,
|
var data = getObjectDetails(view);
|
||||||
getObjectDetails(view));
|
data.dontLogURLs = true;
|
||||||
|
var nodes = client.munger.munge(view.desc, null, data);
|
||||||
header["descnodes"].appendChild(nodes);
|
header["descnodes"].appendChild(nodes);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -727,7 +727,7 @@ function getConnectedNetworks()
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
function insertLink (matchText, containerTag)
|
function insertLink (matchText, containerTag, data)
|
||||||
{
|
{
|
||||||
var href;
|
var href;
|
||||||
var linkText;
|
var linkText;
|
||||||
|
@ -773,10 +773,19 @@ function insertLink (matchText, containerTag)
|
||||||
href = "http://" + linkText;
|
href = "http://" + linkText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This gives callers to the munger control over URLs being logged; the
|
||||||
|
* channel topic munger uses this, as well as the "is important" checker.
|
||||||
|
* If either of |dontLogURLs| or |noStateChange| is present and true, we
|
||||||
|
* don't log.
|
||||||
|
*/
|
||||||
|
if ((!("dontLogURLs" in data) || !data.dontLogURLs) &&
|
||||||
|
(!("noStateChange" in data) || !data.noStateChange))
|
||||||
|
{
|
||||||
var max = client.prefs["urls.store.max"];
|
var max = client.prefs["urls.store.max"];
|
||||||
if (client.prefs["urls.list"].unshift(href) > max)
|
if (client.prefs["urls.list"].unshift(href) > max)
|
||||||
client.prefs["urls.list"].pop();
|
client.prefs["urls.list"].pop();
|
||||||
client.prefs["urls.list"].update();
|
client.prefs["urls.list"].update();
|
||||||
|
}
|
||||||
|
|
||||||
var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml",
|
var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml",
|
||||||
"html:a");
|
"html:a");
|
||||||
|
@ -957,8 +966,15 @@ function insertSmiley(emoticon, containerTag)
|
||||||
|
|
||||||
function mircChangeColor (colorInfo, containerTag, data)
|
function mircChangeColor (colorInfo, containerTag, data)
|
||||||
{
|
{
|
||||||
if (!client.enableColors)
|
/* If colors are disabled, the caller doesn't want colors specifically, or
|
||||||
|
* the caller doesn't want any state-changing effects, we drop out.
|
||||||
|
*/
|
||||||
|
if (!client.enableColors ||
|
||||||
|
(("noMircColors" in data) && data.noMircColors) ||
|
||||||
|
(("noStateChange" in data) && data.noStateChange))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var ary = colorInfo.match (/.(\d{1,2}|)(,(\d{1,2})|)/);
|
var ary = colorInfo.match (/.(\d{1,2}|)(,(\d{1,2})|)/);
|
||||||
|
|
||||||
|
@ -1004,8 +1020,12 @@ function mircChangeColor (colorInfo, containerTag, data)
|
||||||
|
|
||||||
function mircToggleBold (colorInfo, containerTag, data)
|
function mircToggleBold (colorInfo, containerTag, data)
|
||||||
{
|
{
|
||||||
if (!client.enableColors)
|
if (!client.enableColors ||
|
||||||
|
(("noMircColors" in data) && data.noMircColors) ||
|
||||||
|
(("noStateChange" in data) && data.noStateChange))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ("isBold" in data)
|
if ("isBold" in data)
|
||||||
delete data.isBold;
|
delete data.isBold;
|
||||||
|
@ -1016,8 +1036,12 @@ function mircToggleBold (colorInfo, containerTag, data)
|
||||||
|
|
||||||
function mircToggleUnder (colorInfo, containerTag, data)
|
function mircToggleUnder (colorInfo, containerTag, data)
|
||||||
{
|
{
|
||||||
if (!client.enableColors)
|
if (!client.enableColors ||
|
||||||
|
(("noMircColors" in data) && data.noMircColors) ||
|
||||||
|
(("noStateChange" in data) && data.noStateChange))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ("isUnderline" in data)
|
if ("isUnderline" in data)
|
||||||
delete data.isUnderline;
|
delete data.isUnderline;
|
||||||
|
@ -1028,8 +1052,13 @@ function mircToggleUnder (colorInfo, containerTag, data)
|
||||||
|
|
||||||
function mircResetColor (text, containerTag, data)
|
function mircResetColor (text, containerTag, data)
|
||||||
{
|
{
|
||||||
if (!client.enableColors || !("hasColorInfo" in data))
|
if (!client.enableColors ||
|
||||||
|
(("noMircColors" in data) && data.noMircColors) ||
|
||||||
|
(("noStateChange" in data) && data.noStateChange) ||
|
||||||
|
!("hasColorInfo" in data))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
delete data.currFgColor;
|
delete data.currFgColor;
|
||||||
delete data.currBgColor;
|
delete data.currBgColor;
|
||||||
|
@ -1040,8 +1069,12 @@ function mircResetColor (text, containerTag, data)
|
||||||
|
|
||||||
function mircReverseColor (text, containerTag, data)
|
function mircReverseColor (text, containerTag, data)
|
||||||
{
|
{
|
||||||
if (!client.enableColors)
|
if (!client.enableColors ||
|
||||||
|
(("noMircColors" in data) && data.noMircColors) ||
|
||||||
|
(("noStateChange" in data) && data.noStateChange))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var tempColor = ("currFgColor" in data ? data.currFgColor : "01");
|
var tempColor = ("currFgColor" in data ? data.currFgColor : "01");
|
||||||
|
|
||||||
|
@ -1370,8 +1403,11 @@ function msgIsImportant (msg, sourceNick, network)
|
||||||
* a) works, and
|
* a) works, and
|
||||||
* b) is fast enough to not cause problems,
|
* b) is fast enough to not cause problems,
|
||||||
* so it will do for now.
|
* so it will do for now.
|
||||||
|
*
|
||||||
|
* Note also that we don't want to log URLs munged here, or generally do
|
||||||
|
* any state-changing stuff.
|
||||||
*/
|
*/
|
||||||
var plainMsg = client.munger.munge(msg, null, {});
|
var plainMsg = client.munger.munge(msg, null, { noStateChange: true });
|
||||||
plainMsg = plainMsg.innerHTML.replace(/<[^>]+>/g, "");
|
plainMsg = plainMsg.innerHTML.replace(/<[^>]+>/g, "");
|
||||||
|
|
||||||
var re = network.stalkExpression;
|
var re = network.stalkExpression;
|
||||||
|
@ -2069,17 +2105,6 @@ function gotoIRCURL (url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopicText (text)
|
|
||||||
{
|
|
||||||
var topic = client.statusBar["channel-topic"];
|
|
||||||
var span = document.createElementNS ("http://www.w3.org/1999/xhtml",
|
|
||||||
"html:span");
|
|
||||||
|
|
||||||
span.appendChild(stringToMsg(text, client.currentObject));
|
|
||||||
topic.removeChild(topic.firstChild);
|
|
||||||
topic.appendChild(span);
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateProgress()
|
function updateProgress()
|
||||||
{
|
{
|
||||||
var busy;
|
var busy;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче