3

1

I am new to bugmonkey, so please tell me what's the most proper way to do it?

What I want to do, as the title suggests, is to remove the letters "FogBugz: " from titles of wiki and case pages. This is to save space in browser tabs.

For example, <title>FogBugz: FMC fault investigation</title> would become <title>FMC 45 fault investigation</title>

Thanks

flag

3 Answers

2

This has been fixed in FogBugz 8 (which is currently in beta)!

The "FogBugz" portion of the page title is now a suffix rather than a prefix.

link|flag
Accepted with happiness. Luckily, bugmonkey is used for temporary fixes only. – Pavel Radzivilovsky Aug 29 2010 at 11:55
Not strictly related, but another minor tweak you're likely to notice in FogBugz 8 is a new favicon for FogBugz pages. We use a small kiwi head for FogBugz now, but made sure to use a slightly different icon than the one used here on fogbugz.stackexchange.com (our support staff in particular wanted tabs between the two sites to easily distinguishable). We felt this made sense considering Kiln uses its mascot as its favicon. :) – db Aug 29 2010 at 19:18
3

Wait, I found the problem with Pavel's code: the title tag cannot contain HTML, so changing the innerHTML is not valid. See for instance this issue.
This code works fine, at least for me:

var el = $('title');
el.text(el.text().replace(/FogBugz/i, ""));
link|flag
1 
why /ig? I think it should be /i, to match only the first occurance, no? – Pavel Radzivilovsky Jun 8 2010 at 16:20
Please tell me - does this work in chrome for you? – Pavel Radzivilovsky Jun 9 2010 at 17:50
@Pavel, the /ig was incorrect, I edited that, thanks for catching! This all works fine with both Chrome. Now that I look at it, it does not with IE8. :-( – Michel de Ruiter Jun 10 2010 at 11:10
With IE8, text() returns an empty string, and text(x) fails with "Unexpected call to method or property access". I give up. – Michel de Ruiter Jun 10 2010 at 11:39
1

Ok, I solved it

// Remove "FogBugz: " from <title> of every page, to be browser-tab-friendly
$("title").html($("title").html().substr(8));
link|flag
This doesn't seem to work in Google Chrome. I get this error: Uncaught Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7 – cdeszaq Apr 30 2010 at 16:22
works okay for me.. – Pavel Radzivilovsky May 2 2010 at 17:20
It works in Firefox, but not in IE8 or Chrome. Are there other ways to solve the title? – Michel de Ruiter Jun 7 2010 at 8:52

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.