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

קפיצה לניווט קפיצה לחיפוש
אפדעיט
ק (טעות סופר)
(אפדעיט)
שורה 84: שורה 84:
  to: ''
  to: ''
}, { // remove accidental nowiki and simplify code
}, { // remove accidental nowiki and simplify code
from: /\[\[([^|\[\]]+)([^|\[\]]+?)\|\1\]\](?:<nowiki\/>)?\2/g,
from: /\[\[([^|\[\]]+)([^|\[\]]+?)\|\1\]\](?:<nowiki\/>)?\2/g,
to: '[[$1$2]]',
to: '[[$1$2]]',
comment: 'פישוט קישור'
}, { // simplify common links prefix
from: / \[\[([^|\]]+)\|([בהו])\1\]\]/g,
to: ' $2[[$1]]',
  comment: 'פישוט קישור'
  comment: 'פישוט קישור'
}, { // trim beginning from redundant spaces
}, { // trim beginning from redundant spaces
שורה 1,302: שורה 1,306:
},
},
extractWikidataLabelsSuggestions: function() {
extractWikidataLabelsSuggestions: function() {
var suggestLabelsREen = /(?:\[\[|\|)([א-ת' \-]+?)\]\](?: \('*([a-z][^א-ת]+?)'*\)| *\{\{אנג?\|(.+?)\}\})/gi,
var suggestLabelsREen = /(?:\[\[|\|)([א-ת' \-]+?)\]\](?: \('*([a-z][^א-ת]+?)'*\)| *\{\{אנג?\|(.+?)\}\})/gi,
langLink = /\{\{קישור שפה\|([א-ת]+)\| *([^|]+?)\| *([א-ת '\-]+?)\}\}/gi,
langLink = /\{\{קישור שפה\|(?:([א-ת]*)\|)?(?: *2=)? *([^|]+?)\|(?: *3=)? *([א-ת '\-]+?)\}\}/gi,
langTable = { 'ספרדית': 'es', 'אנגלית': 'en' },
langTable = { 'ספרדית': 'es', 'אנגלית': 'en' },
self = this,
self = this,
  text = this.textbox.value,
  text = this.textbox.value,
  suggestionsByLang={}, // lang -> { foreign title -> hebrew label }
  suggestionsByLang={}, // lang -> { foreign title -> hebrew label }
שורה 1,311: שורה 1,315:
  m, lang, suggestions;
  m, lang, suggestions;
   
   
suggestionsByLang['en'] = {};
suggestionsByLang['en'] = {};
// populate suggestions
// populate suggestions
while(m = suggestLabelsREen.exec(text)) suggestionsByLang['en'][m[2] || m[3]] = m[1];
while(m = suggestLabelsREen.exec(text)) suggestionsByLang['en'][m[2] || m[3]] = (m[1]||'אנגלית');
while(m = langLink.exec(text)) {
while(m = langLink.exec(text)) {
if (!langTable.hasOwnProperty(m[1]))
if(!m[1]) m[1] = 'אנגלית'
{
if (!langTable.hasOwnProperty(m[1]))  
{
  console.log('wikidataLabelsSuggested: Missing lang: ' + m[1]);
  console.log('wikidataLabelsSuggested: Missing lang: ' + m[1]);
  continue;
  continue;
שורה 1,497: שורה 1,502:
},
},
addAuthorityControl: function(v) {
addAuthorityControl: function(v) {
var t = this.textbox.value,
var t = this.textbox.value,
acTemplate = /\{\{בקרת זהויות[\}|]/g,
acTemplate = /\{\{בקרת זהויות[\}|]/g,
artsTitle = /== *(?:מ?ספרי[הו]|מ?יצירותי[הו]|מ?חיבורי[הו]|מאמרים נבחרים|פילמוגרפיה.*|(?:מבחר)? (?:כתבי)|דיסקוגרפיה|יצירות) *==/, //cheap hint for art occuption in text
artsTitle = /== *(?:מ?ספרי[הו]|מ?יצירותי[הו]|מ?חיבורי[הו]|(פרסומים|מאמרים) נבחרים|פילמוגרפיה.*|(?:מבחר)? (?:כתבי)|דיסקוגרפיה|יצירות) *==/, //cheap hint for art occuption in text
artsCategory = /\[\[קאטעגאריע:(מוזיקאיות|מוזיקאנטן|זמרות|זינגערס|שרייבערס|סופרות|משוררים|משוררות|מתרגמים|ציירות|ציירים|במאי|רבנים|רבניות)(?!.+\*)/; //cheap hint for art occuption in category
artsCategory = /\[\[קאטעגאריע:(מוזיקאיות|מוזיקאנטן|זמרות|זינגערס|שרייבערס|סופרות|משוררים|משוררות|מתרגמים|ציירות|ציירים|במאי|רבנים|רבניות)(?!.+\*)/; //cheap hint for art occuption in category
if ( acTemplate.exec( t ) ) return; // AC already exist
if ( acTemplate.exec( t ) ) return; // AC already exist
  if ( !artsTitle.exec( t ) && !artsCategory.exec( t ) ) return; // no hint will have authority control
  if ( !artsTitle.exec( t ) && !artsCategory.exec( t ) ) return; // no hint will have authority control
  this.getWikidataApi().get({
  this.getWikidataApi().get({

נאוויגאציע מעניו