Utente:Tino/TradottoDa.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 15:
$(function() {
$('#wpTextbox1').keydown(function(e) {
alert(mw.config.get('wgNamespaceNumber')); return;
if (!e.altKey && !e.shiftKey && !e.metaKey &&
e.ctrlKey && e.keyCode === 89 /* "y" key */ &&
mw.config.get('wgNamespaceNumber') === 21) {
var lang, cursorPosition;
Riga 36 ⟶ 35:
'format': 'json',
'action': 'wbgetentities',
'sites': wikimw.config.get('wgDBname'),
'titles': page,
'props': 'sitelinks',
Riga 52 ⟶ 51:
];
var text = lang + '|';
var index;
Riga 86 ⟶ 85:
text += page.revisions[0].revid;
// close template
text += '}}\n'
// insert template at the beginning of the pagecompletion
$('#wpTextbox1').val(textvar +inputArea = $('#wpTextbox1').val());
inputArea.textSelection('setSelection', {start: cursorPosition - 2, end: cursorPosition});
inputArea.textSelection('encapsulateSelection', {peri: text, replace: true});
}
}