אונטערשייד צווישן ווערסיעס פון "מעדיעוויקי:Gadget-Checkty.js"

37 בייטן אראפגענומען ,  פֿאַר 2 יאָר
קיין רעדאגירונג באמערקונג
ק ((diffedit))
אין תקציר עריכה
שורה 243: שורה 243:
  var txt = this.textbox.value,
  var txt = this.textbox.value,
  isPerson = false,
  isPerson = false,
  firstFamilyRgx = /^([^ ]+) ([^ ]+)$/,
firstFamilyRgx = /^([^ ]+) ([^ ]+)$/,
  name, defaultSortMsg;
name, defaultSortMsg;
  if (/\{\{(מיון רגיל|גרונטסארטיר|DEFAULTSORT):/.exec(txt)) return; // skip if already exists
if (/\{\{(מיון רגיל|גרונטסארטיר|DEFAULTSORT):/.exec(txt)) return; // skip if already exists
  if (!firstFamilyRgx.exec(mw.config.get('wgTitle'))) return; // skip if can't suggest
if (!firstFamilyRgx.exec(mw.config.get('wgTitle'))) return; // skip if can't suggest


  isPerson = /== ?(ביאגראפיע|לעבנס געשיכטע|האט געלעבט]) ?==/.exec(txt); // heuristic to identify biographic articles
  isPerson = /== ?(ביאגראפיע|לעבנס געשיכטע|האט געלעבט]) ?==/.exec(txt); // heuristic to identify biographic articles
שורה 252: שורה 252:


  if (!execute) {
  if (!execute) {
  defaultSortMsg = $('<div>', { text: mw.msg('checkty-defaultsort-suggest') }).append($('<a>', {
defaultSortMsg = $('<div>', { text: mw.msg('checkty-defaultsort-suggest') }).append($('<a>', {
  href: '#',
href: '#',
  text: 'צולייגן DEFAULTSORT',
text: 'צולייגן DEFAULTSORT',
  }).click(function(){ chectTyTool.defaultSortSuggest(true); return false;}));
}).click(function(){ chectTyTool.defaultSortSuggest(true); return false;}));
  this.writeMsg(defaultSortMsg, 'info');
this.writeMsg(defaultSortMsg, 'info');
  } else {
} else {
  name = firstFamilyRgx.exec(mw.config.get('wgTitle'));
name = firstFamilyRgx.exec(mw.config.get('wgTitle'));
  txt = txt.replace(/\[\[(קאַטעגאָריע|קאטעגאריע)/, '{{DEFAULTSORT:' + name[2] + ', ' + name[1] + '}}\n[[קאטעגאריע');
txt = txt.replace(/\[\[(קאַטעגאָריע|קאטעגאריע)/, '{{DEFAULTSORT:' + name[2] + ', ' + name[1] + '}}\n[[קאטעגאריע');
  this.addSummary('DEFAULTSORT');
this.addSummary('DEFAULTSORT');
  this.updateText(txt);
this.updateText(txt);
  }
}
},
},
categoryOrder: function(execute) {
categoryOrder: function(execute) {