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

[@ Rotpunkt, Jalo] I continue to work on the extension at Utente:Dr Brains/Sandbox.js. I've started to watch over the integration of the customization in the config panel.

What I've done for now :

  • I added in LiveRC code a new hook permitting to define some additionnal text to be saved in the /LiveRCparam.js page. This will permit to save our customized stuffs (see the todo list below).
  • I modified the way templates are declared in the extension :
    • The item "format" was a problem (difficult to save a function object, even more to customize it for noobs), so I deleted it, using a standard function.
    • I integrated time parameters in the "parameters" item, like all others.
  • Now a new panel/tab is created in the customization menu, where you can edit almost all templates params, add new params, delete existing params, etc...
  • Some CSS styles are used, fro now through Utente:Dr Brains/Sandbox.css

What is still to do :

  • In the customization panel, when a "type" select is change, the corresponding "value" select or input should change (from select to input, or reverse). This isn't the case, yet. Done Dr Brains (msg) 13:23, 10 lug 2014 (CEST)Rispondi
  • I didn't yet work on the "check menu & save" function. So all changes made in the panel are just for testing.
  • Some texts have to be managed throught the translation system

If you have any idea or comment, you're welcome, of course.

Dr Brains (msg) 17:32, 29 giu 2014 (CEST)Rispondi

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