Files
9minutes/app/assets/javascripts/title.js
T
2012-12-29 01:53:06 +01:00

25 lines
636 B
JavaScript

function changeDocumentTitle(to, special)
{
special = (typeof special == "undefined" || typeof special == "boolean") ? null : special;
titleLink = (to.substring(to.length-1, to.length) == "/") ?
to.substring(0, to.length-1) : to;
titleLink = titleLink.replaceAll("/","");
switch(titleLink)
{
case "artists":
titleLink = special;
special = null;
break;
case "home":
document.title = documentTitle;
return;
break;
}
document.title = titleLink.urifyAll();
if (special) document.title += " » " + special.urifyAll();
document.title += " on " + documentTitle;
}