Skip to content

Commit

Permalink
add sanity check to fix pageSection bug
Browse files Browse the repository at this point in the history
- pageSection is interfering with followRedirect: until such time as followRedirect can be fixed to use API redirect resolution, this sanity check is needed
- plus a capitalisation fix that has been annoying me
  • Loading branch information
atlight committed Mar 25, 2011
1 parent a5affb0 commit 0bafa63
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion morebits.js
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,12 @@ Wikipedia.page = function(pageName, currentAction) {
return;
}

// sanity check
if (ctx.pageSection && ctx.followRedirect) {
ctx.statusElement.error("Internal error: cannot use followRedirect=true when using pageSection!! Sorry about that.");
return;
}

ctx.loadQuery = {
action: 'query',
prop: 'info|revisions',
Expand Down Expand Up @@ -2119,7 +2125,7 @@ Wikipedia.page = function(pageName, currentAction) {
var link = document.createElement('a');
link.setAttribute('href', wgArticlePath.replace('$1', ctx.pageName));
link.appendChild(document.createTextNode(ctx.pageName));
ctx.statusElement.info(['Completed (', link, ')']);
ctx.statusElement.info(['completed (', link, ')']);
}
};

Expand Down

0 comments on commit 0bafa63

Please sign in to comment.