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

ק
(DFAULTSORT)
ק ((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) {