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 :

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

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

[@ Jalo]
Hello,
I think I have finished the job at Utente:Dr Brains/Sandbox.js.
The only thing I still need is the italian translation for the texts (see at the end of my sandbox. You can do the translation directly in there before copying the code in the released extension). Once I get them, I will able to add them in fr:MediaWiki:Gadget-LiveRC.js/i18n/it.js (and en and fr translations pages).
A "problem" remains : the templates and their params are always saved in /LiveRCparam.js. There is no comparisons between the standard and the customized templates. This should be done to avoid non-customized params to be saved.
If you have any idea or comment, you're welcome, of course.
Dr Brains (msg) 16:39, 10 lug 2014 (CEST)Rispondi
[@ Dr Brains]
Translation done. Tomorrow in the morning I'll copy it into the extension. Thanks Jalo 17:00, 10 lug 2014 (CEST)Rispondi
[@ Jalo] OK. Don't forget to copy .css page too, and to change the related target at the beginning of the .js page.
Dr Brains (msg) 18:18, 10 lug 2014 (CEST)Rispondi
Ritorna alla pagina "Gadget-LiveRC 1x.js/InserisciTemplate.js".