MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 3,155: | Line 3,155: | ||
// back to the author baked into the page (usually none). | // back to the author baked into the page (usually none). | ||
var API_BASE = window.GR_LIBRARY_API || '/api/granthas'; | var API_BASE = window.GR_LIBRARY_API || '/api/granthas'; | ||
// Set to false while the library is not yet reachable: no request is | |||
// made at all, and citations use whatever the page itself carries. | |||
// Flip it back to true once API_BASE resolves. | |||
var LIBRARY_ENABLED = true; | |||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||
var API = API_BASE.replace(/\/+$/, ''); | var API = API_BASE.replace(/\/+$/, ''); | ||
| Line 3,163: | Line 3,167: | ||
// the same answer. Stop asking: a wrong or missing API base otherwise | // the same answer. Stop asking: a wrong or missing API base otherwise | ||
// fills the network log with one 404 per work on the page. | // fills the network log with one 404 per work on the page. | ||
var libraryDown = | var libraryDown = !LIBRARY_ENABLED; | ||
function cacheGet(id) { | function cacheGet(id) { | ||