From 495b6822f1c9423e0e47918dc17c96c8fb27760e Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Sat, 2 Jul 2011 17:37:34 +0200 Subject: [PATCH] revamped document titles - better readability; --- app/views/layouts/application.html.haml | 2 +- public/javascripts/title.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 37a6a57..1956c45 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,7 +1,7 @@ !!! %html %head - %title Nineminutes + %title 9minutes = include_stylesheets :common, :media=>'all' = javascript_include_tag "http://www.google.com/jsapi" = include_javascripts :jquery, :helper, :plugins, :common diff --git a/public/javascripts/title.js b/public/javascripts/title.js index d369988..3bb0148 100644 --- a/public/javascripts/title.js +++ b/public/javascripts/title.js @@ -7,12 +7,19 @@ titleLink = titleLink.replaceAll("/",""); - if(titleLink == "artists") + switch(titleLink) { - titleLink = special; - special = null; + case "artists": + titleLink = special; + special = null; + break; + case "home": + document.title = documentTitle; + return; + break; } - document.title = documentTitle + " » " + titleLink.urifyAll(); + document.title = titleLink.urifyAll(); if (special) document.title += " » " + special.urifyAll(); + document.title += " on " + documentTitle; } \ No newline at end of file