בדוקי עריכות אוטומטית, אינטערפעיס רעדאקטארן, אינטערפעיס אדמיניסטראַטאָרן, סיסאפן, מייבאים, מעדכנים, מייבא, אספקלריה רעדאקטארן
46,716
רעדאגירונגען
ק (טעות סופר) |
(אפדעיט) |
||
| שורה 84: | שורה 84: | ||
to: '' | to: '' | ||
}, { // remove accidental nowiki and simplify code | }, { // remove accidental nowiki and simplify code | ||
from: /\[\[([^|\[\]]+)([^|\[\]]+?)\|\1\]\](?:<nowiki\/>)?\2/g, | |||
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, | |||
langLink = /\{\{קישור שפה\|(?:([א-ת]*)\|)?(?: *2=)? *([^|]+?)\|(?: *3=)? *([א-ת '\-]+?)\}\}/gi, | |||
langTable = { 'ספרדית': 'es', 'אנגלית': 'en' }, | |||
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'] = {}; | |||
// populate suggestions | |||
while(m = suggestLabelsREen.exec(text)) suggestionsByLang['en'][m[2] || m[3]] = (m[1]||'אנגלית'); | |||
while(m = langLink.exec(text)) { | |||
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, | |||
acTemplate = /\{\{בקרת זהויות[\}|]/g, | |||
artsTitle = /== *(?:מ?ספרי[הו]|מ?יצירותי[הו]|מ?חיבורי[הו]|(פרסומים|מאמרים) נבחרים|פילמוגרפיה.*|(?:מבחר)? (?:כתבי)|דיסקוגרפיה|יצירות) *==/, //cheap hint for art occuption in text | |||
artsCategory = /\[\[קאטעגאריע:(מוזיקאיות|מוזיקאנטן|זמרות|זינגערס|שרייבערס|סופרות|משוררים|משוררות|מתרגמים|ציירות|ציירים|במאי|רבנים|רבניות)(?!.+\*)/; //cheap hint for art occuption in category | |||
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({ | ||
רעדאגירונגען