Diferència entre revisions de la pàgina «MediaWiki:Gadget-traduccions/editor.js»

deprecated: wgUserName, wgPageName, wgScriptPath, wgEnableAPI
(Use of "wgAction"/"wgTitle" is deprecated. Use mw.config instead.)
(deprecated: wgUserName, wgPageName, wgScriptPath, wgEnableAPI)
 
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) {
 
// @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
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)")));
// 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);
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();
14.850

modificacions