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

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

Notification Rotpunkt, Jalo
Dr Brains (msg) 15:09, 27 giu 2014 (CEST)Rispondi
[@ Dr Brains]
Updated and tested. It works. Thanks Jalo 15:38, 27 giu 2014 (CEST)Rispondi
Ritorna alla pagina "Gadget-LiveRC 1x.js/InserisciTemplate.js".