« MediaWiki:Common-IntersectionCategorie.js » : différence entre les versions

Contenu supprimé Contenu ajouté
Phe (discussion | contributions)
mAucun résumé des modifications
Phe (discussion | contributions)
mAucun résumé des modifications
Ligne 134 :
],
 
get_catget_group_name : function () {
// FIXME possible_intersection and get_cat() : there is surely a more
var text =return this.possible_intersection[$("#dropdown option:selected").text()];
// elegant way to do that.
// définition des possibilités d’intersections par groupe. Pas de "'" dans les noms
possible_intersection : [
"Intersection d’auteurs",
"Intersection d’articles",
],
 
get_cat : function () {
var text = $("#dropdown option:selected").text();
if (text == "Intersection d’auteurs")
return this.possible_author_category;
else if (text == "Intersection d’articles")
return this.possible_article_category;
return null;
},
 
Ligne 157 ⟶ 144 :
this.cat_from_string(location.search, cat, nocat);
if (cat.length)
this.set_selected(cat, this.get_catget_group_name());
},
 
Ligne 246 ⟶ 233 :
this.cat_from_string(location.search, cat, nocat);
if (cat.length) {
for (var igroup = 0; i <in this.possible_author_category.length; ++ipossible_intersection) {
var ifpossible_cat (cat[0].replace("_", "") == this.possible_author_categorypossible_intersection[igroup]);
for (var i = 0; returni "Intersection< d’auteurs"possible_cat.length; ++i) {
if (cat[0].replace("_", "") == this.possible_article_categorypossible_cat[i])
}
for (var i = 0; i < this.possible_article_category.length; ++i) { return group;
}
if (cat[0].replace("_", "") == this.possible_article_category[i])
return "Intersection d’articles";
}
}
Ligne 259 ⟶ 245 :
 
dropdown_change : function() {
$("#input_listbox").html(this.build_listbox(this.get_catget_group_name()));
},
 
add_dropdown_list : function () {
var html = "<select id='dropdown' onchange='intersection_categorie.dropdown_change()''>";
for (var igroup = 0; i <in this.possible_intersection.length; ++i)
html += "\n<option value='" + this.possible_intersection[i]group + "'>" + this.possible_intersection[i]group + "</option>";
html += "\n</select><br />";
$("#input_cat").html(html);
Ligne 281 ⟶ 267 :
}
 
if (mw.config.get("wgPageName") == "Spécial:Intersection_de_catégorie") {
intersection_categorie.possible_intersection := [{
"Intersection d’auteurs" : intersection_categorie.possible_author_category,
"Intersection d’articles", : intersection_categorie.possible_article_category
], };
intersection_categorie.setup();
}