מדיה ויקי:Gadget-Cat-a-lot.js: הבדלים בין גרסאות בדף

make result dialog dismissable
fix last edit; only show "remove" if != searchmode
שורה 11: שורה 11:
apiUrl: wgScriptPath + "/api.php",
apiUrl: wgScriptPath + "/api.php",
searchmode: false,
searchmode: false,
version: 2.02,
version: 2.03,
init: function () {
init: function () {
שורה 19: שורה 19:
importScriptURI(wgServer + '/w/extensions/UsabilityInitiative/js/js2stopgap/jui.combined.min.js');
importScriptURI(wgServer + '/w/extensions/UsabilityInitiative/js/js2stopgap/jui.combined.min.js');
}
}
$("#column-one, #mw-panel").append('<div id="cat_a_lot">' + '<div id="cat_a_lot_data"><div>' + '<input type="text" id="cat_a_lot_searchcatname" placeholder="Enter category name"/>' + '</div><div id="cat_a_lot_category_list"></div>' + '<div id="cat_a_lot_mark_counter"> </div>' + '<div id="cat_a_lot_selections">Select <a  id="cat_a_lot_select_all">all</a> / ' + '<a  id="cat_a_lot_select_none">none</a>' + '<br><a id="cat_a_lot_remove"><b>Remove from this category</b></a>' + '</div></div><div id="cat_a_lot_head">' + '<a id="cat_a_lot_toggle">Cat-a-lot</a></div></div>');
$("#column-one, #mw-panel").append('<div id="cat_a_lot">' + '<div id="cat_a_lot_data"><div>' + '<input type="text" id="cat_a_lot_searchcatname" placeholder="Enter category name"/>' + '</div><div id="cat_a_lot_category_list"></div>' + '<div id="cat_a_lot_mark_counter"> </div>' + '<div id="cat_a_lot_selections">Select <a  id="cat_a_lot_select_all">all</a> / ' + '<a  id="cat_a_lot_select_none">none</a>' + '<br>' + '</div></div><div id="cat_a_lot_head">' + '<a id="cat_a_lot_toggle">Cat-a-lot</a></div></div>');
if (!this.searchmode) $('#cat_a_lot_selections').append('<a id="cat_a_lot_remove"><b>Remove from this category</b></a>');
$('#cat_a_lot_searchcatname').keypress(function(e){
$('#cat_a_lot_searchcatname').keypress(function(e){
if(e.which == 13) catALot.updateCats($(this).val());
if(e.which == 13) catALot.updateCats($(this).val());
שורה 251: שורה 254:
  catALot.toggleAll(false);
  catALot.toggleAll(false);
});
});
 
    rep.append(close);
if (this.alreadyThere.length) {
if (this.alreadyThere.length) {
rep.append('<h5>The following pages were skipped, because the page was already in the category:</h5>');
rep.append('<h5>The following pages were skipped, because the page was already in the category:</h5>');