Skip to content

Commit

Permalink
Merge "Some special wikis should use the default proxy"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Jan 29, 2015
2 parents 88605a4 + 11c67db commit 6bb8b0d
Show file tree
Hide file tree
Showing 3 changed files with 7,490 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/fetch-sitematrix.js
Expand Up @@ -20,7 +20,7 @@ request({
if ( res.statusCode !== 200 ) {
throw "Error fetching sitematrix! Returned " + res.statusCode;
}
return writeFile(filename, JSON.stringify(body));
return writeFile(filename, JSON.stringify(body, null, "\t"));
}).then(function() {
console.log("Success!");
}).done();
18 changes: 13 additions & 5 deletions lib/mediawiki.ParsoidConfig.js
Expand Up @@ -233,16 +233,24 @@ ParsoidConfig.prototype.initInterwikiMap = function() {
}
};

// See MWParserEnvironment.prototype.getAPIProxyURI for these values.
var normal = insertInMaps.bind(this, undefined);
var special = insertInMaps.bind(this, null);
// See MWParserEnvironment.prototype.getAPIProxyURI for the meaning
// of null / undefined in setInterwiki.

var self = this;
Object.keys( sitematrix ).forEach(function( key ) {
var val = sitematrix[key];
if ( !Number.isNaN( Number(key) ) ) {
val.site.forEach(normal);
val.site.forEach(insertInMaps.bind(self, undefined));
} else if ( key === "specials" ) {
val.forEach(special);
val.forEach(function( site ) {
// Don't use the default proxy for restricted sites.
// private: Restricted read and write access.
// fishbowl: Restricted write access, full read access.
// closed: No write access.
var prv = site.hasOwnProperty("private") ||
site.hasOwnProperty("fishbowl");
insertInMaps.call( self, prv ? null : undefined, site );
});
}
});
};
Expand Down
7,477 changes: 7,476 additions & 1 deletion lib/sitematrix.json

Large diffs are not rendered by default.

0 comments on commit 6bb8b0d

Please sign in to comment.