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

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 15:
var inputArea = $('#wpTextbox1');
// flag for default browser behaviour on the shortcut
var keystrokeDefault = true;
$(function() {
inputArea.keydown(function(e) {
// triggers on ctrl+y, in talk pages only
if (!e.altKey && !e.shiftKey && !e.metaKey &&
e.ctrlKey && e.keyCode === 89 /* "y" key */ &&
mw.config.get('wgNamespaceNumber') === 1 /* talkpage only */) {
// suppress browser's default response on shortcut keystroke
keystrokeDefault = false;
// get language from the input in the textarea (last 2 chars)
Riga 28 ⟶ 33:
var wiki = lang + 'wiki';
keystrokeDefault = false;
var page = mw.config.get('wgTitle');
// query wikidata to get the title in the other language
Riga 40 ⟶ 41:
'action': 'wbgetentities',
'sites': mw.config.get('wgDBname'),
'titles': pagemw.config.get('wgTitle'),
'props': 'sitelinks',
'languages': lang
Riga 111 ⟶ 112:
});
// prevent default browser action only, when needed only
inputArea.keypress(function(e) {
if (!e.altKey && !e.shiftKey && !e.metaKey &&