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

מ rm leftover from previous version
Oops -- reinstall "no_autocommit" support
שורה 254: שורה 254:
   var summary = new Array () ;
   var summary = new Array () ;
   var t = document.editform.wpTextbox1.value ;
   var t = document.editform.wpTextbox1.value ;
   var errors = false;
   var prevent_autocommit = 0;
  if ( typeof hotcat_no_autocommit != "undefined" && hotcat_no_autocommit != 0 )
    prevent_autocommit = 1;


   var cat_rm  = hotcatGetParamValue ('hotcat_removecat');
   var cat_rm  = hotcatGetParamValue ('hotcat_removecat');
שורה 263: שורה 265:
     if (!matches || matches.length == 0) {
     if (!matches || matches.length == 0) {
       alert ('Category "' + cat_rm + '" not found; maybe it is in a template?');
       alert ('Category "' + cat_rm + '" not found; maybe it is in a template?');
       errors = true;
       prevent_autocommit = 1;
     } else if (matches.length > 1) {
     } else if (matches.length > 1) {
       alert ('Category "' + cat_rm
       alert ('Category "' + cat_rm
             + "\" found several times; don't know which occurrence to remove.");
             + "\" found several times; don't know which occurrence to remove.");
       errors = true;
       prevent_autocommit = 1;
     } else {
     } else {
       if (cat_add != null && cat_add.length > 0 && matches[0].match.length > 1)
       if (cat_add != null && cat_add.length > 0 && matches[0].match.length > 1)
שורה 296: שורה 298:
     if (matches && matches.length > 0) {
     if (matches && matches.length > 0) {
       alert ('Category "' + cat_add + '" already exists; not added.');
       alert ('Category "' + cat_add + '" already exists; not added.');
       error = true;
       prevent_autocommit = 1;
     } else {
     } else {
       if (t.charAt (t.length - 1) != '\n') t = t + '\n';
       if (t.charAt (t.length - 1) != '\n') t = t + '\n';
שורה 314: שורה 316:
                                       + " (using [[MediaWiki:Gadget-HotCat.js|HotCat.js]])" ;
                                       + " (using [[MediaWiki:Gadget-HotCat.js|HotCat.js]])" ;
     document.editform.wpMinoredit.checked = true ;
     document.editform.wpMinoredit.checked = true ;
     if (!errors) {
     if (!prevent_autocommit) {
       // Hide the entire edit section so as not to tempt the user into editing...
       // Hide the entire edit section so as not to tempt the user into editing...
       document.getElementById("bodyContent").style.display = "none" ;
       document.getElementById("bodyContent").style.display = "none" ;