MediaWiki:Common.js: различия между версиями

Нет описания правки
Метка: отменено
Нет описания правки
Метка: отменено
Строка 678: Строка 678:
return '{{#vardefine:JsonPath|' + jsonPath + '}}\n' + String(wikiText || '');
return '{{#vardefine:JsonPath|' + jsonPath + '}}\n' + String(wikiText || '');
}
}
 
function fetchParsedData(wikiText) {
function fetchParsedData(wikiText) {
var apiUrl = "https://station14.ru/api.php?action=parse&format=json&prop=text&text=" + encodeURIComponent(wikiText) + "&origin=*";
return $.ajax({
return $.ajax({
url: mw.util.wikiScript('api'),
url: apiUrl,
method: 'POST',
method: "GET",
dataType: 'json',
dataType: "json"
data: {
action: 'parse',
format: 'json',
prop: 'text',
text: wikiText,
origin: '*'
}
});
});
}
}