Diferència entre revisions de la pàgina «MediaWiki:Common.js/menucanvisorto.js»
De Català a Cort
| Línia 19: | Línia 19: | ||
} | } | ||
jQuery("#menucanvisorto").html(h); | jQuery("#menucanvisorto").html(h); | ||
| + | jQuery("#menucanvisorto input").click(pitjatCanviOrto); | ||
}()); | }()); | ||
| + | |||
| + | function pitjatCanviOrto(e) | ||
| + | { | ||
| + | nom = e.target.id; | ||
| + | lletra = nom[3]; | ||
| + | if (jQuery("#" + nom).prop("checked")) | ||
| + | jQuery("tr.orto" + lletra).show(); | ||
| + | else | ||
| + | jQuery("tr.orto" + lletra).hide(); | ||
| + | } | ||
Revisió del 11:37, 18 maig 2017
$(function () {
if (jQuery("#menucanvisorto").length == 0)
return;
window.canvisorto = {
A: "Mots prefixats i compostos amb el segon formant començat per r",
B: "Ús del guionet en mots compostos i prefixats",
C: "Mots compostos i prefixats amb el segon formant començat per s seguida de consonant",
D: "Supressió de l’accent diacrític",
E: "Supressió de la dièresi en derivats cultes acabats en -al",
F: "Canvis ortogràfics diversos en expressions llatines i manlleus",
};
h = "";
for(i=0; i<6; ++i) {
lletra = String.fromCharCode(65 + i);
desc = window.canvisorto[lletra];
h += "<input id=\"cb-" + lletra + "\" type=\"checkbox\" checked/>";
h += "<span class=\"orto" + lletra + "\" style=\"margin-left:10px\">" + lletra + "</span>";
h += "<span style=\"margin-left:10px\">" + desc + "</span><br/>";
}
jQuery("#menucanvisorto").html(h);
jQuery("#menucanvisorto input").click(pitjatCanviOrto);
}());
function pitjatCanviOrto(e)
{
nom = e.target.id;
lletra = nom[3];
if (jQuery("#" + nom).prop("checked"))
jQuery("tr.orto" + lletra).show();
else
jQuery("tr.orto" + lletra).hide();
}