Bug 257026 - Add 'URL catcher' to ChatZilla, and /urls command to display said caught URLs.

ChatZilla only.
r=rginda
This commit is contained in:
silver%warwickcompsoc.co.uk 2004-12-11 14:19:44 +00:00
Родитель 4762cdf0f8
Коммит e5ccebfb56
4 изменённых файлов: 46 добавлений и 0 удалений

Просмотреть файл

@ -161,6 +161,7 @@ function initCommands()
["topic", cmdTopic, CMD_NEED_CHAN | CMD_CONSOLE],
["unignore", cmdIgnore, CMD_NEED_NET | CMD_CONSOLE],
["unstalk", cmdUnstalk, CMD_CONSOLE],
["urls", cmdURLs, CMD_CONSOLE],
["usermode", cmdUsermode, CMD_CONSOLE],
["user-motif", cmdMotif, CMD_NEED_USER | CMD_CONSOLE],
["user-pref", cmdPref, CMD_NEED_USER | CMD_CONSOLE],
@ -3126,3 +3127,31 @@ function cmdInputTextDirection(e)
return true;
}
function cmdURLs(e)
{
if (client.prefs["urls.list"].length == 0)
{
display(MSG_URLS_NONE);
}
else
{
/* Store the current URL list, so we can put it back afterwards. This
* is needed because the process of displaying the list changes the
* list! (think about it for a second)
*/
var oldList = client.prefs["urls.list"];
client.prefs["urls.list"] = new Array();
var num = e.number || client.prefs["urls.display"];
if (num > oldList.length)
num = oldList.length;
display(getMsg(MSG_URLS_HEADER, num));
for (var i = 0; i < num; i++)
display(getMsg(MSG_URLS_ITEM, [i + 1, oldList[i]]));
// Restore old URL list so displaying it has no effect.
client.prefs["urls.list"] = oldList;
}
}

Просмотреть файл

@ -178,6 +178,9 @@ function initPrefs()
["sound.user.stalk", "beep", "global.soundEvts"],
["timestamps", false, "appearance.timestamps"],
["timestampFormat", "[%h:%n]", "appearance.timestamps"],
["urls.list", [], "hidden"],
["urls.store.max", 100, "global"],
["urls.display", 10, "hidden"],
["username", "chatzilla", ".ident"],
["usermode", "+i", ".ident"],
["userHeader", true, "global.header"],

Просмотреть файл

@ -622,6 +622,11 @@ function insertLink (matchText, containerTag)
href = "http://" + linkText;
}
var max = client.prefs["urls.store.max"];
if (client.prefs["urls.list"].unshift(href) > max)
client.prefs["urls.list"].pop();
client.prefs["urls.list"].update();
var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml",
"html:a");
anchor.setAttribute ("href", href);

Просмотреть файл

@ -496,6 +496,9 @@ cmd.unignore.help = Removes someone from your ignore list for the current netw
cmd.unstalk.params = <text>
cmd.unstalk.help = Remove word from list of terms for which you would like to see alerts.
cmd.urls.params = [<number>]
cmd.urls.help = Displays the last few URLs seen by ChatZilla. Specify <number> to change how many it displays, or omit to display the default 10.
cmd.disable-plugin.params = <plugin>
cmd.disable-plugin.help = This command calls the plugin's disablePlugin function, if it exists. There are no guarantees that the plugin will properly disable itself.
@ -949,6 +952,10 @@ msg.supports.miscOption = "%S=%S"
msg.supports.miscOptions = Server settings/limits: %S"
msg.urls.none = There are no stored URLs.
msg.urls.header = Listing the %S most recent stored URLs (most recent first):
msg.urls.item = URL %S: %S"
munger.mailto=Mailto
munger.link=URLs
munger.channel-link=IRC channel
@ -1148,6 +1155,8 @@ pref.stalkWholeWords.label = Stalk whole words only
pref.stalkWholeWords.help = This preferences toggles Chatzilla's handling of stalk words between finding matching words, or simple substrings. For example, "Chatzilla is cool" will match the stalk word "zilla" only if this preferences is off.
pref.stalkWords.label = Stalk words
pref.stalkWords.help = A list of words that, when a line contains one, make Chatzilla make the line as "important", and will try to get your attention if "Aggressive notify" is turned on.
pref.urls.store.max.label = Max stored URLs
pref.urls.store.max.help = Sets the maximum number of URLs collected and stored by ChatZilla. The "/urls" command displays the last 10 stored, or more if you do "/urls 20", for example.
pref.username.label = Username
pref.username.help = Your username is used to construct your "host mask", which is a string representing you, by including your connection's host name and this username. It is sometimes used for setting auto-op, bans, and other things specific to one person.
pref.usermode.label = Usermode