Differenze tra le versioni di "Discussioni utente:Samuele Papa"

→‎Updated scripts: re: another update
(→‎Updated scripts: re: another update)
: Lo script di Pathoschild è fantastico. Potrebbe rivoluzionare il nostro lavoro: consente una libertà pressochè asssoluta all'interno di un'architettura condivisa e ben strutturata. Ne ho capiti i principi fondamentali, ma sono ben lontano dall'aver capito tutto: spero che Candalua abbia tempo & voglia per "preparare la transizione". [[User:Alex brollo|Alex brollo]] ([[User talk:Alex brollo|disc.]]) 10:00, 19 ago 2015 (CEST)
: I`ll try it out, thanks for sharing this tool. [[Utente:Samuele Papa|<span style="color:#ff6600">Samuele</span>]] 14:25, 19 ago 2015 (CEST)
 
:: Hi again. I updated your <tt>[[Utente:Samuele Papa/common.js|common.js]]</tt> to use the new features in [[m:TemplateScript|TemplateScript]] intended to make writing scripts easier. For example, this code:
:: <source lang="javascript">
var editbox = context.$target;
editbox.val(editbox.val()
.replace(lista[i], "")
.replace("<sup>nota</sup>", lista[i])
);
</source>
:: can be rewritten like this in the latest version:
:: <source lang="javascript">
editor
.replace(lista[i], "")
.replace("<sup>nota</sup>", lista[i]);
</source>
:: See [[m:TemplateScript#Adding scripts]] for more details. Note that <code>editor.$target</code> is deprecated and will be removed soon; if the <code>editor</code> can't do what you want, you can get the text with <code>editor.get()</code> and overwrite it with <code>editor.set(text)</code> instead. If you really need a reference to the DOM element, you can replace <code>editor.$target</code> with <code>$('#wpTextbox1')</code>. (This change is necessary to add [[mw:VisualEditor|VisualEditor]] and [[mw:Extension:CodeEditor|CodeEditor]] compatibility.)
 
:: Let me know if anything breaks or if you have any questions. :) <small>—[[User:Pathoschild|Pathoschild]] ([[User talk:Pathoschild|disc.]]) 05:12, 24 ago 2015 (CEST)</small>
 
== UPF ==
409

contributi