[dw-free] Track icon on recent entries/readpage throws a JS error
[commit: http://hg.dwscoalition.org/dw-free/rev/a9fbb12e6ff8]
http://bugs.dwscoalition.org/show_bug.cgi?id=1249
Don't reference undefined variables.
Patch by
afuna.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1249
Don't reference undefined variables.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- htdocs/js/esn.js
-------------------------------------------------------------------------------- diff -r e36c136e204d -r a9fbb12e6ff8 htdocs/js/esn.js --- a/htdocs/js/esn.js Thu Jul 16 21:46:29 2009 -0500 +++ b/htdocs/js/esn.js Thu Jul 16 22:10:15 2009 -0500 @@ -142,7 +142,17 @@ ESN.trackBtnClickHandler = function (evt commentsTrackBtn = TrackCheckbox("someone replies in this comment thread", 1); } else { // entry tracking button - newEntryTrackBtn = TrackCheckbox(LJ_cmtinfo["journal"] + " posts a new entry", trackingNewEntries); + var journal; + + if ( typeof LJ_cmtinfo !== 'undefined' ) { + journal = LJ_cmtinfo["journal"]; + } else if ( typeof Site !== 'undefined' ) { + journal = Site.currentJournal; + } + + if ( journal ) { + newEntryTrackBtn = TrackCheckbox( journal + " posts a new entry", trackingNewEntries ); + } commentsTrackBtn = TrackCheckbox("someone comments on this post", trackingNewComments); } --------------------------------------------------------------------------------
no subject
(Are we using the same whitespace rules in JS that we are in Perl, btw? It makes sense to me, but I've been following whatever is in the file)
no subject