מייבאים כמותיים, בדוקי עריכות אוטומטית, אינטערפעיס אדמיניסטראַטאָרן, מנטרים, מייבאים, מעדכנים, אספקלריה רעדאקטארן
3,951
רעדאגירונגען
אין תקציר עריכה צייכן: צוריקגעשטעלט |
אין תקציר עריכה צייכן: צוריקגעשטעלט |
||
| שורה 40: | שורה 40: | ||
// הסרת ריפוד של אפס מתאריך | // הסרת ריפוד של אפס מתאריך | ||
if (day.charAt(0) == '0') | if (day.charAt(0) == '0' && !forceEnglish) | ||
day = day.substring(1, day.length); | day = day.substring(1, day.length); | ||
| שורה 629: | שורה 629: | ||
{ str: '' }, | { str: '' }, | ||
{ telem: "#fullRecordView th:contains(בתוך):first + td", match: /\((.*?)\)/, func: function (yh) { return yh.substring(0, yh.length - 1) + '"' + yh.substr(yh.length - 1); } }, | { telem: "#fullRecordView th:contains(בתוך):first + td", match: /\((.*?)\)/, func: function (yh) { return yh.substring(0, yh.length - 1) + '"' + yh.substr(yh.length - 1); } }, | ||
{ telem: "#fullRecordView th:contains(מס' מערכת):first + td", prefix: "רמבי=" } | { telem: "#fullRecordView th:contains(מס' מערכת):first + td", prefix: "רמבי=" } | ||
] | ] | ||
| שורה 1,605: | שורה 1,604: | ||
var curParam = data[i].params[j][k], | var curParam = data[i].params[j][k], | ||
removed = false; params[j] = ''; | removed = false; params[j] = ''; | ||
// --- התחלה של הוספת הקוד המתוקן לבדיקת עברית לפני העיבוד --- | |||
// בדיקה מקדימה אם יש עברית באחד מהפרמטרים הראשונים (שם האתר והמחבר) | |||
let foundHebrewBefore = false; | |||
if (j <= 1) { // בודק רק את 2 הפרמטרים הראשונים, שהם לרוב שם האתר ושם המחבר | |||
if (typeof curParam.str != "undefined" && hasHebrew(curParam.str)) { | |||
foundHebrewBefore = true; | |||
} else if (typeof curParam.ldjson != "undefined" && curParam.ldjson.key === 'author') { | |||
const author = $.map($(ldjson.author), function(a) { return a.name; }).join(VE); | |||
if (hasHebrew(author)) { | |||
foundHebrewBefore = true; | |||
} | |||
} else if (typeof curParam.telem != "undefined" && hasHebrew(jQuery('html').find(curParam.telem).first().text().trim())) { | |||
foundHebrewBefore = true; | |||
} | |||
} | |||
// --- סוף של הוספת הקוד המתוקן לבדיקת עברית לפני העיבוד --- | |||
if (typeof curParam.str != "undefined") { | if (typeof curParam.str != "undefined") { | ||
| שורה 1,730: | שורה 1,746: | ||
} | } | ||
} | } | ||
// שינוי כאן: בדיקה אם forceEnglish צריכה להיות true | |||
var shouldForceEnglish = !hasHebrew(params.join(' ')); // בודק האם יש עברית בכל הפרמטרים שנאספו עד כה | |||
if (typeof curParam.date != "undefined") { | if (typeof curParam.date != "undefined") { | ||
if (!(curParam.date instanceof Array)) | if (!(curParam.date instanceof Array)) | ||
| שורה 1,738: | שורה 1,757: | ||
params[j] = params[j].split(curParam.date[0]); | params[j] = params[j].split(curParam.date[0]); | ||
params[j] = [params[j][curParam.date[1][0]], params[j][curParam.date[1][1]], params[j][curParam.date[1][2]]]; | params[j] = [params[j][curParam.date[1][0]], params[j][curParam.date[1][1]], params[j][curParam.date[1][2]]]; | ||
params[j] = dateFormat(params[j], | params[j] = dateFormat(params[j], shouldForceEnglish); // העברת הפרמטר החדש | ||
} | } | ||
} | } | ||
| שורה 1,747: | שורה 1,766: | ||
mm = (today.getMonth() + 1).toString(), | mm = (today.getMonth() + 1).toString(), | ||
yy = today.getFullYear().toString().slice(-2); | yy = today.getFullYear().toString().slice(-2); | ||
params[j] = dateFormat([dd, mm, yy], | params[j] = dateFormat([dd, mm, yy], shouldForceEnglish); // העברת הפרמטר החדש | ||
} | } | ||
} | } | ||
| שורה 1,821: | שורה 1,840: | ||
while (params.indexOf('removeifempty') > -1) | while (params.indexOf('removeifempty') > -1) | ||
params.splice(params.indexOf('removeifempty'), 1); | params.splice(params.indexOf('removeifempty'), 1); | ||
if (window.popup_template_canceled && !force_popup) { | if (window.popup_template_canceled && !force_popup) { | ||
רעדאגירונגען