MediaWiki:Gadget-TranslationAdder.js: diferència entre les revisions

Contingut suprimit Contingut afegit
Use of "wgAction"/"wgTitle" is deprecated. Use mw.config instead.
deprecated: wgUserName, wgPageName, wgScriptPath, wgEnableAPI
Línia 5:
 
if (!api_url) {
if (typeof(mw.config.get("wgEnableAPI")) === 'undefined' || mw.config.get("wgEnableAPI") == false) throw "Local API is not usable.";
api_url = mw.config.get("wgScriptPath") + "/api.php";
}
if (!request_type) {
Línia 240:
 
// @public - the JsMwApi object for the current page
this.page = JsMwApi().page(mw.config.get("wgPageName"));
 
// get the current text of the article and call the callback with it
Línia 426:
try {saveLi.appendChild(newNode('span', newNode('b', " Desat "),
newNode('a', {'href': wgScript +
'?title=' + encodeURIComponent(mw.config.get("wgPageName")) +
'&diff=' + encodeURIComponent(res.edit.newrevid) +
'&oldid=' + encodeURIComponent(res.edit.oldrevid)}, "(Mostra canvis)")));
Línia 484:
// pos is a position in the line containing the gloss
getWikitextGloss: function (txt, pos) {
txt = txt.replace("{"+"{inici}}", "{"+"{inici|Traduccions de "+mw.config.get("wgPageName")+"}}");
var g_start = txt.lastIndexOf('\n{'+'{inici', pos) + 1;
var g_end = txt.indexOf('\n', pos);
Línia 1.288:
if (prefs.get('enabled', 'true') == 'true') {
if (! window.loadedEditor) {
prefs.setDefault('labeller', mw.config.get("wgUserName") ? 'true' : 'false' );
window.loadedEditor = true;
var editor = new Editor();