2

1

For a number of BugMonkey scripts I am developing, the scripts are targeted to specific pages within FogBugz (ie. New Case, New Wiki Article, Edit Wiki Article, Edit Case, etc.)

What is the best way to determine the page the user is currently viewing?

I realize this gets complicated, especially for things like switching from the view-mode to edit-mode of a case because a full-page-reload does not happen, but in most cases it does. So, is there any way to determine the current page?

As a bonus, if there is a way to detect, perhaps with an event handler, the switch from view-mode to edit-mode on a case, that would be great also!

flag

1 Answer

2

One way is to inspect window.location.href for an indicator of the page you're on (e.g., pg=pgList for case listing, pg=pgEditBug for case edit).

I'm sure we could think of other ways to do this, but this seems to work well.

Here's an example: http://fogbugz.stackexchange.com/questions/2260/how-do-i-dismiss-or-hide-all-error-notifications

link|flag
Is there any list, unofficial or otherwise, of the various page indicators? – cdeszaq Apr 30 2010 at 16:01
No official list to my knowledge, but you could inspect default.was and find what you're looking for. – Rob Sobers Apr 30 2010 at 16:56

Your Answer

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