Discussioni MediaWiki:Gadget-common.js

Ultimo commento: 8 mesi fa, lasciato da Candalua in merito all'argomento Better syncing wrt to EditInSequence

Revisione lettura wikitext modifica

Inserita funxione getWikitext(pagina) (esportata in mw.getWikitext).

  • se pagina === undefined restituisce il wikitext della pagina corrente
  • se pagina !== undefined restituisce il wikitext di pagina

La funzione è sincrona e si basa su api.php?action=parse.

Tutte le istanze di index.php&action=raw vanno sostituite con getWikicode(). --Alex brollo (disc.) 15:36, 23 feb 2019 (CET)Rispondi

Better syncing wrt to EditInSequence modifica

Currently, the way the scriviBox(...) function is written, it is incompatible with EditInSequence. It would be great if the following changes could be made to the function since, that will allow EditInSequence to sync with it better.

diff --git a/home/sohom/old.js b/home/sohom/new.js
index 17e46ef..8db6398 100644
--- a/home/sohom/old.js
+++ b/home/sohom/new.js
@@ -6,10 +6,9 @@ function scriviBox(testo, area, ss, se) {
                        area = 0;
                }
        }
-       $('textarea')[area].value = testo;
+       $('textarea').eq(area).textSelection( 'setContents', testo );
        if (ss !== undefined && se !== undefined) {
                $('textarea')[area].selectionStart = ss;
                $('textarea')[area].selectionEnd = se;
        }
 }
-

cc @Ruthven -- Sohom Datta (disc.) 10:04, 7 ago 2023 (CEST)Rispondi

Pingo gli amministratori dell'interfaccia correnti: Alex brollo e Candalua. Ruthven (msg) 21:29, 9 ago 2023 (CEST)Rispondi
@Candalua Ce la fai tu, per favore? Non capisco a fondo... :-( Alex brollo (disc.). 21:46, 9 ago 2023 (CEST)Rispondi
  Fatto, thank you Sohom Datta. Can da Lua (disc.) 09:05, 10 ago 2023 (CEST)Rispondi
Ritorna alla pagina "Gadget-common.js".