There are 2 previous versions of this script.
// kanjikoohiiforumtagtitle.user.js! user script for Firefox's GreaseMonkey extension
// version 0.1 BETA! Copyright (c) 2007-2008, Mario Huys
// Released under the GPL license: http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// 0.2 2008.08.21 woelpad Added Script Update Checker
// 0.1 2007.02.23 woelpad First release
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.5 (?) or later: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "Kanji.Koohii: Tag Forum Title", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name Kanji.Koohii: Tag Forum Title
// @namespace http://userscripts.org/scripts/show/7657
// @description Tag category to the forum window title and reverse the order. Note: To reference messages in other threads, browse to that message, right-click the time stamp and select "Copy URL link".
// @include http://forum.koohii.com/*
// ==/UserScript==
// [Script Update Checker] (http://userscripts.org/scripts/show/20145) written by Jarett (http://userscripts.org/users/38602)
var version_scriptNum = 7657; // Change this to the number given to the script by userscripts.org (check the address bar)
var version_timestamp = 1239351697992; // Used to differentiate one version of the script from an older one. Will be automatically updated each time you alter the script and release it on userscripts.org.
if(version_timestamp){function updateCheck(forced) {if((forced)||(parseInt(GM_getValue("lastUpdate", "0")) + 86400000 <= (new Date().getTime()))) {try {GM_xmlhttpRequest({method: "GET",url: "http://userscripts.org/scripts/review/" + version_scriptNum + "?" + new Date().getTime(),headers: {'Cache-Control': 'no-cache'},onload: function(xhrResponse) {GM_setValue("lastUpdate", new Date().getTime() + ""); var rt = xhrResponse.responseText.replace(/ ?/gm, " ").replace(/<li>/gm, "\n").replace(/<[^>]*>/gm, "").replace(/
/gi, "\n"); var scriptName = (/@name\s*(.*?)\s*$/m.exec(rt))[1]; GM_setValue("targetScriptName", scriptName); if (parseInt(/version_timestamp\s*=\s*([0-9]+)/.exec(rt)[1]) > version_timestamp) {if (confirm("There is an update available for the Greasemonkey script \"" + scriptName + ".\"\nWould you like to go to the install page now?")) {GM_openInTab("http://userscripts.org/scripts/show/" + version_scriptNum);}} else if (forced) {alert("No update is available for \"" + scriptName + ".\"");}}});} catch (err) {if (forced) {alert("An error occurred while checking for updates:\n" + err);}}}} GM_registerMenuCommand(GM_getValue("targetScriptName", "???") + " - Manual Update Check", function() {updateCheck(true);}); updateCheck(false)};
// [/Script Update Checker]
function xpath(query) {
return document.evaluate(query, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
}
function xpathi(query) {
return xpath(query).snapshotItem(0);
}
var forumTitle = 'Reviewing the Kanji Forums';
var forumTitleHead = forumTitle + ' / ';
if (document.title.substr(0, forumTitleHead.length) == forumTitleHead) {
document.title = document.title.substr(forumTitleHead.length);
var categories = xpathi('//div[@id="viewtopic_head"]/h3');
if (categories) {
var category = categories.lastChild.firstChild.data;
document.title += ' | ' + category;
}
document.title += ' | ' + forumTitle;
}