MediaWiki:Gadget-jsonDoc.js: Difference between revisions

no edit summary
(Created page with "if (mw.config.get('wgPageContentModel') === 'json' && !$('.json-contentmodel-documentation').length && mw.config.get('wgArticleId')!==0) { var raw_url = mw.config.get('wgServer')+mw.util.getUrl(null, {action:'raw', ctype:'application/json'}); $('#mw-content-text').prepend($( '<div class="documentation json-contentmodel-documentation">'+ '<div class="documentation-header">'+ '<span class="documentation-title">JSON module documentation</span>'+ '</div>'...")
 
No edit summary
Tag: Reverted
Line 1:
if (mw.config.get('wgPageContentModel') === 'json' && !$('.json-contentmodel-documentation').length && mw.config.get('wgArticleId')!==0) {
var raw_url = mw.config.get('wgServer')+mw.mw.util.getUrl(null, {action:'raw', ctype:'application/json'});
$('#mw-content-text').prepend($(
'<div class="documentation json-contentmodel-documentation">'+
Line 12:
'</div>'+
'<div class="documentation-content">'+
'<p>This page is set to the JSON content model. Below is a parsed version of the data, as a table. To see the raw data, you can <a href="'+mw.mw.util.getUrl(null, {action:'edit'})+'">edit the page</a>.</p>'+
'<p>To load this data in an on-wiki scribunto module, use <code>mw.loadJsonData("'+mw.config.get('wgPageName')+'")</code> (<a href="https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.loadJsonData">documentation</a>).</p>'+
'<p>To load this data externally, it is recommended to send a GET request to <a href="'+raw_url+'">'+raw_url+'</a></p>'+