Discussioni MediaWiki:Gadget-LiveRC 1x.js/InserisciTemplate.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
ValterVBot (discussione | contributi)
m tag source deprecati, replaced: <source lang= → <syntaxhighlight lang= (3), </source> → </syntaxhighlight> (3)
 
(14 versioni intermedie di 3 utenti non mostrate)
Riga 1:
__TOC__
== Dev ==
 
Hello,
 
Riga 66 ⟶ 69:
::::Note that [[:fr:Discussion_MediaWiki:Gadget-LiveRC.js/i18n/it.js|somme CSS styles descriptions]] still need to be translated in italian.
::::[[Utente:Dr Brains|Dr Brains]] ([[Discussioni utente:Dr Brains|msg]]) 18:49, 10 lug 2014 (CEST)
:::::{{ping|Dr Brains}}
:::::Done '''''<span style="font-size:medium;font-family:Comic Sans MS">[[Utente:Jalo|<span style="color:#BB0011">J</span>]][[Discussioni utente:Jalo|<span style="font-size:small;color:#DD2233">alo</span>]]</span>''''' 09:59, 11 lug 2014 (CEST)
::::::{{ping|Jalo}}
::::::I tried to [[:fr:Utilisateur:Dr_Brains/LiveRC/AddComplexTemplateExtension.js|adapt the gadget to fr.wiki]] and I found three other texts I didn't put in translation system ([https://it.wikipedia.org/w/index.php?title=Utente%3ADr_Brains%2FSandbox.js&diff=66986235&oldid=66963505 see the diff]).
::::::* The text "Parametri", added in the <legend> of the dialog box (param description <code>lrcParamDesc["DescIT_InsertTemplateParams"]</code> is perhaps to be checked)
::::::* the text for the two "buttons" of the dialog box ("Inserisci" and "Annulla")
::::::Please update the gadget with these new modifs.
::::::[[Utente:Dr Brains|Dr Brains]] ([[Discussioni utente:Dr Brains|msg]]) 18:27, 12 lug 2014 (CEST)
:::::::<s>Edit : Update with [//it.wikipedia.org/w/index.php?title=Utente:Dr_Brains/Sandbox.js&oldid=66986235 this oldid], because I continue working on the param saving function.</s>
:::::::<s>[[Utente:Dr Brains|Dr Brains]] ([[Discussioni utente:Dr Brains|msg]]) 17:32, 13 lug 2014 (CEST)</s>
::::::::Edit (2) : The actual code seems to be OK (I added a function to compare old templates and new templates, and prevent non-customized templates to be saved).
::::::::[[Utente:Dr Brains|Dr Brains]] ([[Discussioni utente:Dr Brains|msg]]) 18:39, 13 lug 2014 (CEST)
:{{ping|Jalo}}
:Hello,
:I noticed a problem in the functions <code>lrcRunInsertTemplate</code> and <code>getLiveTagFunctions["InserisciTemplateExtension"]</code>
:The actual code doesn't check if there is customized templates when it creates and checks the "tag" tool options.
:The changes to do are (lines <small>5-6-7</small> and <small>28-29-30</small>) :
{{cassetto
|titolo=Before
|testo=
<syntaxhighlight lang=javascript line>
// Add options in the "Tag" form
function lrcRunInsertTemplate(data){
var TagSelect = document.getElementById('LiveTagReason');
 
 
jQuery.each(lstMyTemplate, function(i, val) {
var optTag = document.createElement('option');
optTag.value = i;
optTag.className = "InserisciTemplateExtension";
optTag.innerHTML = val.string;
TagSelect.appendChild(optTag);
});
// setup dialog
mw.loader.using(['jquery.ui.dialog'], function () {
$('<div>')
.attr('id', 'gtb-dialog')
.appendTo('body');
});
}
LiveRC_AddHook("AfterPreviewArticle", lrcRunInsertTemplate);
// Function launched when choosing one of this extension options
getLiveTagFunctions["InserisciTemplateExtension"] = function(page, option){
lrcDisableLink("LiveTagReason");
lrcDisableLink("LiveTagLink");
 
 
var message = lstMyTemplate[option.value];
wpajax.http({ url: wgServer + wgScriptPath + '/api.php?format=xml'
+ '&action=query&prop=info&intoken=edit'
+ '&inprop=protection'
+ '&titles=' + encodeURIComponent(page),
onSuccess: InserisciTemplate_PostTagPage,
page: page,
message: message});
return false;
}
</syntaxhighlight>
}}
{{cassetto
|titolo=After
|testo=
<syntaxhighlight lang=javascript line>
// Add options in the "Tag" form
function lrcRunInsertTemplate(data){
var TagSelect = document.getElementById('LiveTagReason');
var TemplateList = Custom_lstMyTemplate;
if(!lrcGetObjectLength(TemplateList)) TemplateList = lstMyTemplate;
jQuery.each(TemplateList, function(i, val) {
var optTag = document.createElement('option');
optTag.value = i;
optTag.className = "InserisciTemplateExtension";
optTag.innerHTML = val.string;
TagSelect.appendChild(optTag);
});
// setup dialog
mw.loader.using(['jquery.ui.dialog'], function () {
$('<div>')
.attr('id', 'gtb-dialog')
.appendTo('body');
});
}
LiveRC_AddHook("AfterPreviewArticle", lrcRunInsertTemplate);
// Function launched when choosing one of this extension options
getLiveTagFunctions["InserisciTemplateExtension"] = function(page, option){
lrcDisableLink("LiveTagReason");
lrcDisableLink("LiveTagLink");
var TemplateList = Custom_lstMyTemplate;
if(!lrcGetObjectLength(TemplateList)) TemplateList = lstMyTemplate;
var message = TemplateList[option.value];
wpajax.http({ url: wgServer + wgScriptPath + '/api.php?format=xml'
+ '&action=query&prop=info&intoken=edit'
+ '&inprop=protection'
+ '&titles=' + encodeURIComponent(page),
onSuccess: InserisciTemplate_PostTagPage,
page: page,
message: message});
return false;
}
</syntaxhighlight>
}}
:[[Utente:Dr Brains|Dr Brains]] ([[Discussioni utente:Dr Brains|msg]]) 01:41, 10 ago 2014 (CEST)
:PS: Note that there are new italian translations needed [[:fr:Discussion_MediaWiki:Gadget-LiveRC.js/i18n/it.js|here]].
::Done '''''<span style="font-size:medium;font-family:Comic Sans MS">[[Utente:Jalo|<span style="color:#BB0011">J</span>]][[Discussioni utente:Jalo|<span style="font-size:small;color:#DD2233">alo</span>]]</span>''''' 18:29, 10 ago 2014 (CEST)
 
== New management system for installed extensions ==
 
{{ping|Jalo}}
Hello,
 
I'm about to create a new system to manage the installed LiveRC extensions.
 
What does the actual system :
# get the /LiveRCparam.js last oldid,
# get the /LiveRCparam.js (last oldid) wikitext
# parse the wikitext, searching the line beginning with <code>//EXTENSIONS SETUP :</code>
# set an "installed" item in <code>lrcExtensions</code> or <code>Custom_lrcExtensions</code> to true if each extension name is found in the line, or false if not found
 
The new system will be based on the <code>LiveRC_Config["InstalledLiveRCExtensions"]</code> global variable:
# each extension (if installed and loaded) add an item to the Array
# LiveRC search the Array and set an "installed" item in <code>lrcExtensions</code> and/or <code>Custom_lrcExtensions</code> to true if its name is found, or false if not
 
As you can see, this way, two ajax requests will be saved, so it will be far better for LiveRC launching.
I already [//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js&diff=107189645&oldid=107189107 set the <kbd><nowiki>LiveRC_Config["InstalledLiveRCExtensions"]</nowiki></kbd> global variable], to prevent errors due to adding an item in a non-existent Array. Now, I need that all extensions add an item with their name to this Array.
 
So I need that you edit [[MediaWiki:Gadget-LiveRC_1x.js/InserisciTemplate.js]] to add the code below just after the '''<code>if (typeof(lrcHooks)!="undefined")</code>''' test :
<syntaxhighlight lang=javascript>
LiveRC_Config["InstalledLiveRCExtensions"].push("InserisciTemplate");
</syntaxhighlight>
 
Please, warn me when it's done, so that I could start the main code update.
 
Thank you
 
[[Utente:Dr Brains|Dr Brains]] ([[Discussioni utente:Dr Brains|msg]]) 01:57, 6 set 2014 (CEST)
:{{ping|Dr Brains}}
:[http://it.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC_1x.js/InserisciTemplate.js&diff=68023287&oldid=67536945 Done]. Bye '''''<span style="font-size:medium;font-family:Comic Sans MS">[[Utente:Jalo|<span style="color:#BB0011">J</span>]][[Discussioni utente:Jalo|<span style="font-size:small;color:#DD2233">alo</span>]]</span>''''' 09:17, 8 set 2014 (CEST)
 
== Obsolete functions ==
 
{{ping|Jalo}}
 
Hello ,
 
I started to [//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js&diff=107420331&oldid=107419027 replace some functions that are noted as obsolète]. This extension is the last one to be corrected.
 
Could you replace all occurrences of :
* <kbd>'''getElementsByClass'''</kbd> by <kbd>'''lrcGetElementsByClass'''</kbd> (2 times)
* <kbd>'''hasClass'''</kbd> by <kbd>'''lrcHasClass'''</kbd> (1 time)
 
Thank you.
 
Perhaps you noticed that I have created a nex extension, ToolbarExtension, and added some other little stuffs. I tried to do the italian translation myself, but perhaps [//fr.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LiveRC.js/i18n/it.js&diff=107408414&oldid=107376503 it has to be checked]. If you have some time to waste...
 
[[Utente:Dr Brains|Dr Brains]] ([[Discussioni utente:Dr Brains|msg]]) 23:58, 13 set 2014 (CEST)
:{{ping|Jalo}}
:Additionnal translation needed [[:fr:Wikipédia:LiveRC/Documentation/Installation/it#Page_content_ids||here]].
:Thank you.
:[[Utente:Dr Brains|Dr Brains]] ([[Discussioni utente:Dr Brains|msg]]) 15:27, 14 set 2014 (CEST)
::{{fatto}} '''''<span style="font-size:medium;font-family:Comic Sans MS">[[Utente:Jalo|<span style="color:#BB0011">J</span>]][[Discussioni utente:Jalo|<span style="font-size:small;color:#DD2233">alo</span>]]</span>''''' 09:13, 15 set 2014 (CEST)
Ritorna alla pagina "Gadget-LiveRC 1x.js/InserisciTemplate.js".