Discussioni MediaWiki:Gadget-LiveRC 1x.js/InserisciTemplate.js

Versione del 27 giu 2014 alle 15:01 di Dr Brains (discussione | contributi) (Nuova pagina: Hello, According to [//fr.wikipedia.org/w/index.php?title=Discussion_utilisateur:Dr_Brains&diff=104907203&oldid=104896380 my response at frwiki], I've done some little...)
(diff) ← Versione meno recente | Versione attuale (diff) | Versione più recente → (diff)

Ultimo commento: 11 anni fa di Dr Brains

Hello,

According to my response at frwiki, I've done some little changes :

The purpose of these mofications is to permit using two (or more) kinds of templates, each kind managed by its own function.

For that, I added a "Standard" className to the templates added by LiveRC. The function getLiveTag() has become a rooter function leading to another function called getLiveTagFunctions["TheClassNameOfTheOption"] (it checks if it is a function).

So, old templates (ie simple standard templates) are really managed within getLiveTagFunctions["Standard"] function.

So, I also edited the extension to :

  • avoid the total remplacement of all <option> and the main function under the <input>
  • add the new templates with their own classname (here "InserisciTemplateExtension")
  • create the proper function to manage them, ie rename myGetLiveTag in getLiveTagFunctions["InserisciTemplateExtension"]

I didn't test it but it should work fine with both types of templates

Additionnal nota : function names should be less standard, to avoid conflicts. The best way is to prefix them with the extension name :

  • dumpTemplateInserisciTemplate_dumpTemplate


The integration of this extension variables to the configuration panel will be far more difficult...

Dr Brains (msg) 15:01, 27 giu 2014 (CEST)Rispondi

Ritorna alla pagina "Gadget-LiveRC 1x.js/InserisciTemplate.js".