אונטערשייד צווישן ווערסיעס פון "מעדיעוויקי:Common.js/externalsmaker.js"

אפדעיט
אין תקציר עריכה
צייכן: צוריקגעשטעלט
(אפדעיט)
 
(17 מיטלסטע ווערסיעס פון 2 באַניצער נישט געוויזן.)
שורה 1: שורה 1:
/* This code doesn't run in wikipedia but in other sites as bookmarklet */
/* This code runs in different sites as bookmarklet */
function wikiit(event, force_popup) {
function wikiit(event, force_popup) {
window.$ = window.jQuery;
window.$ = window.jQuery;
    function hasHebrew(text) {
    if (typeof text !== 'string') {
        return false;
    }
    return /[\u0590-\u05FF]/.test(text);
    }
function dateFormat(dateArr) {
if (dateArr instanceof Array) {
var m = ["יאנואר", "פעברואר", "מערץ", "אפריל", "מאי", "יוני", "יולי", "אויגוסט", "סעפטעמבער", "אקטאבער", "נאוועמבער", "דעצעמבער"];
if (dateArr.length != 3)
return '';
dateArr[1] = m[Number(dateArr[1]) - 1];
if (Number(dateArr[2]) <= 50)
dateArr[2] = 20 + dateArr[2];
else if (Number(dateArr[2]) >= 50 && Number(dateArr[2]) < 100)
dateArr[2] = 19 + dateArr[2];
if (dateArr[0].charAt(0) == '0')
dateArr[0] = dateArr[0].substring(1, dateArr[0].length);


// פונקציה חדשה ופשוטה לבדיקת אותיות עבריות בטקסט
dateArr = dateArr[1] + " " + dateArr[0] + ", " + dateArr[2];
function hasHebrew(text) {
if (typeof text !== 'string') {
return false;
}
}
for (var i = 0; i < text.length; i++) {
return jQuery.trim(dateArr);
var charCode = text.charCodeAt(i);
if (charCode >= 0x05D0 && charCode <= 0x05EA) { // טווח תווי יוניקוד של עברית
return true;
}
}
return false;
}
}
 
    function dateFormatEng(dateArr) {
function dateFormat(dateArr, forceEnglish) {
if (dateArr instanceof Array) {
if (dateArr instanceof Array) {
var m;
var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
if (forceEnglish) {
m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
} else {
m = ["יאנואר", "פעברואר", "מערץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "סעפטעמבער", "אקטאבער", "נאוועמבער", "דעצעמבער"];
}


if (dateArr.length != 3)
if (dateArr.length != 3)
return '';
return '';


var day = dateArr[0];
dateArr[1] = m[Number(dateArr[1]) - 1];
var month = dateArr[1];
if (Number(dateArr[2]) <= 50)
var year = dateArr[2];
dateArr[2] = 20 + dateArr[2];
else if (Number(dateArr[2]) >= 50 && Number(dateArr[2]) < 100)
// טיפול בפורמט התאריך: אם יש רק 2 ספרות בשנה, מוסיפים 19 או 20
dateArr[2] = 19 + dateArr[2];
if (Number(year) <= 50)
 
year = '20' + year;
if (dateArr[0].charAt(0) == '0')
else if (Number(year) >= 50 && Number(year) < 100)
dateArr[0] = dateArr[0].substring(1, dateArr[0].length);
year = '19' + year;


// הסרת ריפוד של אפס מתאריך
dateArr = dateArr[1] + " " + dateArr[0] + ", " + dateArr[2];
if (day.charAt(0) == '0')
day = day.substring(1, day.length);
// המרה לפורמט הרצוי
return m[Number(month) - 1] + " " + day + ", " + year;
}
}
return jQuery.trim(dateArr);
return jQuery.trim(dateArr);
}
}
function engDateParse(engDate) {
function engDateParse(engDate) {
var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
שורה 76: שורה 75:
.replace(/=/g, "{{=}}")
.replace(/=/g, "{{=}}")
.replace(/''/g, '"')
.replace(/''/g, '"')
.replace(/((?<!עיתונות)\|\|?)/gm, function (x) { return "{{" + x.replace(/\|/g, "!") + "}}"; })
.replace(/((?<!עיתונות)\|\|?)/gm, function (x) { return "{" + "{" + x.replace(/\|/g, "!") + "}}"; }) .replace(/[\u200B\u200E\u200F\u2028\u202A\u202B\u202C\u202D\u202E]/g, '') // remove invisible Unicode control characters
.replace(/[\u200B\u200E\u200F\u2028\u202A\u202B\u202C\u202D\u202E]/g, '') // remove invisible Unicode control characters
.replace(/ {2,}/g, ' ')
.replace(/ {2,}/g, ' ')
.replace('#google_vignette', '');
.replace('#google_vignette', '');
שורה 83: שורה 81:


function getWikiLink() {
function getWikiLink() {
var result = '',
  let result = "";
oldid = getParameterByName('oldid') || getParameterByName('diff');
  const oldid = getParameterByName("oldid") || getParameterByName("diff");
  const host = window.location.host;
 
  if (host.startsWith("yi.hamichlol.org.il") && oldid) {
    const oldComment = window.prompt("קעפּל פאַר די לינק. קען בלייבן ליידיג.", "");
    result = `{{אונטערשייד צווישן ווערסיעס|${getParameterByName("title")}|${oldid}||${oldComment || "אונטערשייד צווישן ווערסיעס"}}}`;
  } else {
    const nms = {
      "yi.hamichlol.org.il": "",
      "www.hamichlol.org.il": "ע:",
      "he.wikiquote.org": "q:",
      "he.wikisource.org": "s:",
      "en.wiktionary.org": "wikt:",
    };


if (window.location.host == 'yi.hamichlol.org.il' && oldid) {
    const wikinamespace = document.querySelector(".mw-page-title-namespace");
var oldComment = '';
    const wikiname = document.querySelector(".mw-page-title-main");
oldComment = window.prompt("קעפּל פאַר די לינק. קען בלייבן ליידיג.", oldComment);
    const wikiarticle = wikiname
result = '{{הבדל בין גרסאות|' + getParameterByName('title') + '|' + oldid + '||' + (oldComment ? oldComment : 'הבדל בין גרסאות') + '}}';
      ? wikinamespace
} else {
        ? `${wikinamespace.textContent}:${wikiname.textContent}`
var nms = {
        : wikiname.textContent
'yi.hamichlol.org.il': '',
      : null;
'www.hamichlol.org.il': 'ע:',
    const wikitype = nms[host];
'he.wikiquote.org': 'q:',
'he.wikisource.org': 's:',
'en.wiktionary.org': 'wikt:'
},
wikinamespace = document.querySelector('.mw-page-title-namespace'),
wikiname = document.querySelector('.mw-page-title-main'),
wikiarticle = wikiname ? wikinamespace ? wikinamespace.textContent + ':' + wikiname.textContent : wikiname.textContent : null,
wikitype = nms[window.location.host];


if (wikitype != undefined && wikiname) {
    if (wikitype !== undefined && wikiname) {
result = '[[' + wikitype + wikiarticle + (wikitype ? '|' + wikiname.textContent : '') + ']]';
      result = `[[${wikitype}${wikiarticle}${wikitype ? "|" + wikiname.textContent : ""}]]`;
}
    }
}
  }


if (result) {
  if (result) {
if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", result) != null) {
    navigator.clipboard.writeText(result).then(() => {
$('<input>').val(result).appendTo('body').select();document.execCommand('copy');
      alert("✅ קאפירט: " + result);
}
    });
return true;
    return true;
}
  }
return false;
  return false;
}
}
 
if (window.location.host.indexOf('he.wik') == 0) {
if (window.location.host.includes("hamichlol")) {
if (getWikiLink()) {
  if (getWikiLink()) {
return true;
    if (window.old$) { window.$ = window.old$; }
}
    return;
  }
}
}


שורה 128: שורה 132:


var data = [
var data = [
{
hostname: "www.kore.co.il",
params: [
{ str: 'כל רגע' },
{ telem: 'article p.extraInfo span:nth-child(1)' },
{ telem: 'article h1' },
{ url: 1, match: /viewArticle\/(\d+)/ },
{ telem: 'article p.extraInfo span.pull-left' , match:/(.*)\|/}
]
},
{
{
hostname: /yediot(h)?(.ynet)?\.co\.il/,
hostname: /yediot(h)?(.ynet)?\.co\.il/,
שורה 172: שורה 166:
{ url: 1, match: /co\.il\/((?:ency|home|headlines)\/.*?html?)/ },
{ url: 1, match: /co\.il\/((?:ency|home|headlines)\/.*?html?)/ },
{ url: 1, match: /L-(.*?),/ },
{ url: 1, match: /L-(.*?),/ },
{ url: 1, match: /co\.il\/(.*)/, remove: ['#autoplay'] }
{ url: 1, match: /co\.il\/(.*)/ } ],
],
[
[
{ url: 1, match: /co\.il\/((?:ency)\/.*?html?)/, prefix: "תאריך=", func: function(s) { return s ? 'ללא' : ''; }},
{ url: 1, match: /co\.il\/((?:ency)\/.*?html?)/, prefix: "תאריך=", func: function(s) { return s ? 'ללא' : ''; }},
שורה 187: שורה 180:
},
},
{
{
hostname: /(www|jerusalem|krayot|kibbutz|rishon|hadera|netania|netanya|herzliya|holon|petahtikva|batyam|roshhaayin|kfarsaba|hodhasharon|rehovot|raanana|afula|emek|haifa|beersheva)\.mynet\.co\.il$/i,
hostname: /(www|afula|ashdod|batyam|beersheva|emek|hadera|haifa|herzliya|hodhasharon|holon|jerusalem|kfarsaba|kibbutz|krayot|modiin|netania|netanya|petahtikva|raanana|rehovot|rishon|roshhaayin)\.mynet\.co\.il$/i,
params: [
params: [
{ str: 'mynet3' },
{ str: 'mynet3' },
{ attr: ["meta[property='channel-name']", "content"] , remove: ['MYNET ', 'mynet ', 'מיינט '], func:function(s) { return s=='עפולה ועמק'?'העמק':s; } },
{ attr: ["meta[property='channel-name']", "content"], remove: ['MYNET ', 'mynet ', 'מיינט '], func:function(s) { return (s=='עפולה ועמק'||s=='עפולה והעמק')?'העמק':s=='פתח תקוה'?'פתח תקווה':s=='ראשון'?'ראשון לציון':s; } },
{ telem: 'div.authors' },
{ attr: ["meta[property='vr:author']", "content"], remove: ['מערכת mynet'] },
{ telem: 'h1.mainTitle' },
{ attr: ["meta[property='og:title']", "content"] },
{ url: 1, match: /article\/(.*)$/ },
{ url: 1, match: /article\/(.*)$/ },
{ telem: 'div.date:last', date: '.' }
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] }
]
]
},
},
שורה 226: שורה 219:
},
},
{
{
hostname: "www.haaretz\\.(co\\.il|com)",
hostname: "www.haaretz.co.il", condition: function () { return location.pathname.startsWith('/ty-WRITER/'); },
params: [
{ str: 'הארץ - עיתונאי' },
{ url: 1, match: /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/ }
]
},
{
hostname: "www.haaretz.(co.il|com)",
params: [
params: [
{ str: 'הארץ' },
{ str: 'הארץ' },
שורה 257: שורה 257:
{ telem: '#article-container div.col-lg-12 h1' },
{ telem: '#article-container div.col-lg-12 h1' },
{ url: 1, match: /article\/(\d+)/ },
{ url: 1, match: /article\/(\d+)/ },
{ telem: '#article-container div.credit time span:first', date: '/' }
[
{ telem: '#article-container div.credit time span:first', date: '/' },
{ ldjson: { key: 'dateModified' } }
]
]
]
},
},
שורה 281: שורה 284:
{ telem: '.story_autor_date' },
{ telem: '.story_autor_date' },
{ telem: '.player_time', date: '.' },
{ telem: '.player_time', date: '.' },
{ attr: ["div[class='date date-local']", "data-date-utc"], date: '.' },
{ attr: ["div[class*='date date-local']", "data-date-utc"], date: '.' },
{ attr: ["*[class='date-local']", "data-date-utc"], date: '.' }
{ attr: ["*[class*='date-local']", "data-date-utc"], date: '.' }
],
],
{ url: 1, match: /org\.il\/(.+?)\// }
{ url: 1, match: /org\.il\/(.+?)\// }
]
],
},
removeparam: {
{
'1': ['מערכת כאן חדשות', 'כתבי כאן חדשות']
hostname: "archive.kan.org.il",
}
params: [
{ str: 'כאן ארכיון' },
{ attr: ["meta[property='og:title']", "content"], remove: ['כאן ארכיון |'] },
{ url: 1, match: /(\d+)/ },
{ telem: 'span.itemPageDate', remove: ['תאריך שידור:'], date: '.' }
]
},
},
{
{
שורה 381: שורה 378:
{ telem: 'h1.project_title' }
{ telem: 'h1.project_title' }
],
],
{ url: 1, match: /=(\d+)/ },
{ url: 1, match: /=(\d+)/, fullhref: true },
[
[
{ elem: '.articleInfo .timestamp, #coteret_Modified, #F_Modified_on, .g_Article_DateTime', date: '/' },
{ elem: '.articleInfo .timestamp, #coteret_Modified, #F_Modified_on, .g_Article_DateTime', date: '/' },
שורה 396: שורה 393:
{ telem: "article a[rel='tag'], article a[href*='/writer/']" },
{ telem: "article a[rel='tag'], article a[href*='/writer/']" },
{ telem: "h1.headline" },
{ telem: "h1.headline" },
{ url: 1, match: /\/www\.the7eye\.org\.il\/(\d+)/ },
{ url: 1, match: /www\.the7eye\.org\.il\/(\d+)/ },
{ telem: "article span.date", date: '.' }
{ telem: "article span.date", date: '.' }
]
]
שורה 404: שורה 401:
params: [
params: [
{ str: 'בחדרי חרדים' },
{ str: 'בחדרי חרדים' },
{ ldjson: { key:'author' } },
{ ldjson: { key:'author' }, remove: [ /,? ?(כתב )?בחדרי חרדים/ ] },
{ attr: ["meta[property='og:title']", "content"], remove:[' - בחדרי חרדים'] },
{ attr: ["meta[property='og:title']", "content"], remove:[' - בחדרי חרדים'] },
[
[
{ url: 1, match: /news\/(\d+)/ },
{ url: 1, match: /news\/(\d+)/ },
{ var: 'userid' }
],
{ ldjson: { key:'datePublished' } }
]
},
{
hostname: "www.kore.co.il",
params: [
{ str: 'כל רגע' },
{ ldjson: { key:'author' } },
{ attr: ["meta[property='og:title']", "content"], remove:[' - כל רגע'] },
[
{ url: 1, match: /viewArticle\/(\d+)/ },
{ var: 'userid' }
{ var: 'userid' }
],
],
שורה 447: שורה 457:
{ telem: '.curr_issue_title > ._date', date: '/' }
{ telem: '.curr_issue_title > ._date', date: '/' }
]
]
]
],
removeparam: {
'1': [ 'מערכת אתר חיל-האוויר' ]
}
},
},
{
{
שורה 525: שורה 538:
hostname: "www.mako.co.il",
hostname: "www.mako.co.il",
params: [
params: [
{ str: 'mako' },
{ str: 'מאקו' },
[
[
{ elements: ['.writerData *:visible:first a', VE], shouldnt: /\d+\/\d+\/\d+/ },
{ elements: ['.writerData *:visible:first a', VE], shouldnt: /\d+\/\d+\/\d+/ },
{ telem: 'span.katav', match: /^(.*?),?\s?$/ },
{ telem: 'span.katav', match: /^(.*?),?\s?$/ },
{ attr:['span[itemprop=author]', 'content'] }
{ attr:['span[itemprop=author]', 'content'] },
{ attr: ["meta[name='author']", "content"] }
],
],
[
[
שורה 543: שורה 557:
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] }
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] }
]
]
]
],
removeparam: {
'1': [/(מערכת )?mako[א-ת ]+/]
}
},
},
{
{
שורה 554: שורה 571:
{ telem: "a.author-bar li:eq(2), .h3_author" },
{ telem: "a.author-bar li:eq(2), .h3_author" },
{ telem: "div.art__info address" },
{ telem: "div.art__info address" },
{ var: ["_sf_async_config","authors"] }
{ telements: [ "address > a", ' ' ] }
],
],
[ { var: ['articlePage', 'name'] },
[ { var: ['articlePage', 'name'] },
שורה 588: שורה 605:
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | כלכליסט'] },
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | כלכליסט'] },
[
[
{ url: 1, match: /L\-(\d+)/ }, { attr: ["link[rel='alternate']", "href"], match: /guid=(\d+)/},
{ url: 1, match: /L\-(\d+)/ },
{ attr: ["link[rel='alternate']", "href"], match: /guid=(\d+)/},
{ url: 1, match: /calcalist\.co\.il\/(.*)/ }
{ url: 1, match: /calcalist\.co\.il\/(.*)/ }
],
],
שורה 650: שורה 668:
[
[
{ url: 1, match: /Article\.\d+\.(\d+)\.html/ },
{ url: 1, match: /Article\.\d+\.(\d+)\.html/ },
{ url: 1, match: /docID=(\d+)/i }
{ url: 1, match: /docID=(\d+)/i, fullhref: true }
],
],
[
[
{ url: 1, match: /Article\.(\d+)\.\d+\.html/ },
{ url: 1, match: /Article\.(\d+)\.\d+\.html/ },
{ url: 1, match: /FolderID=(\d+)/i }
{ url: 1, match: /FolderID=(\d+)/i, fullhref: true }
],
],
[
[
שורה 667: שורה 685:
params: [
params: [
{ str: 'British Pathe' },
{ str: 'British Pathe' },
{ telem: "#record-container>h1", remove: ["video newsreel film"] },
[
{ urlparam: 'id' },
{ telem: ".searchTermVal", func: function(val) { return 'סרטוני חדשות על ' + val; }, remove: [/"/g] },
{ telem: "#researcher-stats td:eq(0)", date: '/' }
{ attr: ["meta[property='og:title']", "content"] }
],
[
{ telem: ".searchTermVal", remove: [/"/g] },
{ url: 1, match: /britishpathe\.com\/.*?(\d+)\// }
]
]
]
},
},
שורה 683: שורה 706:
],
],
{ telem: ".rating-article > .rating-item", date: '.' }
{ telem: ".rating-article > .rating-item", date: '.' }
]
},
{
hostname: "maarachot.idf.il",
params: [
{ str: 'מערכות1' },
{ telem: "p.author > a" },
{ attr: ["meta[property='og:title']", "content"] },
{ url: 'decodeURI', match: /idf\.il\/.*\/מערכות-([\d-]+)\//, func: function (val) { return val ? val : '0'; } },
{ url: 1, match: /idf\.il\/(\d{4})\// },
{ url: 'decodeURI', match: /idf\.il\/.*\/(?:מערכות-[\d-]+)?(.*)\//, func: function (val) { return (document.querySelector("meta[property='og:title']").content.replace(/ /g, '-').replace(/[?"'\(\)]/g, '') == val) ? '' : val; } }
]
]
},
},
שורה 690: שורה 724:
{ str: 'כיכר השבת' },
{ str: 'כיכר השבת' },
{ attr: ["meta[name='author']", "content"] },
{ attr: ["meta[name='author']", "content"] },
{ "attr": ["meta[property='og:title']", "content"] },
{ attr: ["meta[property='og:title']", "content"] },
[
[
{ url: 1, match: /il\/.*?\/(\d*)/ },
{ url: 1, match: /il\/.*?\/(\d*)/ },
{ url: 1, match: /il\/(.*)/ }
{ url: 1, match: /il\/(.*)/ }
],
],
{ "attr": ["meta[property='article:published_time']", "content"] }
{ attr: ["meta[property='article:published_time']", "content"], date:['-', '210'] }
]
]
},
},
שורה 724: שורה 758:
{ telem: "a[rel='author'], span.author, li[itemprop='author']", remove: ["מאת "] },
{ telem: "a[rel='author'], span.author, li[itemprop='author']", remove: ["מאת "] },
{ telem: "h1.entry-title, h1.single-title, div.title-primary, span.breadcrumb_last" },
{ telem: "h1.entry-title, h1.single-title, div.title-primary, span.breadcrumb_last" },
{ url: 1, match: /https?:\/\/www.hayadan\.org\.il\/(.*?)$/i },
{ url: 1, match: /www.hayadan\.org\.il\/(.*?)$/i },
[
[
{ telem: "span.meta-date, span.date" },
{ telem: "span.meta-date, span.date" },
שורה 730: שורה 764:
{
{
attr: ['meta[property="article:published_time"]', 'content'],
attr: ['meta[property="article:published_time"]', 'content'],
func: function(s) { return dateFormat(new Date(s).toLocaleDateString('he').split('.'), false); }, // just for after 22:00 articles as https://www.hayadan.org.il/colluns-astronauts-are-not-celebs-2307093
func: function(s) { return dateFormat(new Date(s).toLocaleDateString('he').split('.')); }, // just for after 22:00 articles as https://www.hayadan.org.il/colluns-astronauts-are-not-celebs-2307093
}
}
]
]
שורה 822: שורה 856:
{ urlparam: "id" },
{ urlparam: "id" },
{ telem: "#themag" }
{ telem: "#themag" }
]
},
{
hostname: 'www.nli.org.il', hrefmatch: /newspapers\/bamahane/, // it's own thing and not part of the larger nli
params: [
{ str: 'במחנה' },
{ str: '', func: function (str) { return window.prompt("שם מחבר", str!='N/A'?str:''); } },
{ str: '', func: function (str) { return window.prompt("כותרת הדף", str); } }, // $('.pageblockselected').attr('title')
{ url: 1, match: /newspapers\/bamahane\/(\d{4}\/\d{2}\/\d{2})\// },
{ url: 1, match: /page\/(\d+)/ }
]
]
},
},
שורה 848: שורה 892:
'ashnav': 'אשנב',
'ashnav': 'אשנב',
'baderech': 'עיתונות|baderech',
'baderech': 'עיתונות|baderech',
'bamahane' :'עיתונות|bamahane',
'bamar': 'במערכה',
'bamar': 'במערכה',
'bustenai': 'עיתונות|bustenai',
'bustenai': 'עיתונות|bustenai',
'dav': 'דבר',
'dav': 'דבר',
'dhy': 'דואר היום',
'dhy': 'דואר היום',
'diedeborah' :'עיתונות|diedeborah',
'dmt': 'מאמענט',
'dmt': 'מאמענט',
'dnajlb': 'עיתונות|dnajlb',
'dnajlb': 'עיתונות|dnajlb',
שורה 921: שורה 965:
'omer': 'אמר',
'omer': 'אמר',
'pisgoh': 'הפסגה',
'pisgoh': 'הפסגה',
'plb' :'עיתונות|plb',
'plb' :'PalBull',
'pls': 'PalPost',
'shar': 'שערים',
'shar': 'שערים',
'sulm': 'סלם',
'sulm': 'סלם',
שורה 1,002: שורה 1,047:
params: [
params: [
{ str: 'מזהה חסיד אומות העולם' },
{ str: 'מזהה חסיד אומות העולם' },
{ url: 1, match: /&itemId\=(\d+)/ }
{ url: 1, match: /&itemId\=(\d+)/, fullhref: true }
]
]
},
},
שורה 1,017: שורה 1,062:
params: [
params: [
{ str: 'מוג\'ו' },
{ str: 'מוג\'ו' },
{ urlparam: 'id', match: /(.*?)\.htm/ }
{ url: 1, match: /mojo\.com\/.*?(rl\d+|tt\d+)\// }
]
]
},
},
שורה 1,044: שורה 1,089:
params: [
params: [
{ str: 'חרדים10' },
{ str: 'חרדים10' },
{ attr: ['meta[name="author"]', "content"], remove: ['חרדים 10'] },
{ attr: ['meta[name="author"]', 'content'], remove: ['חרדים 10'] },
{ attr: ['meta[property="og:title"]', "content"] },
{ attr: ['meta[property="og:title"]', 'content'] },
{ url: 1, match: /news\/(\d+)/ },
{ url: 1, match: /news\/(\d+)/ },
{ attr: ['meta[property="article:published_time"]', "content"], date: ['-', '210'] }
{ attr: ['meta[property="article:published_time"]', 'content'], date: ['-', '210'] }
]
]
},
},
שורה 1,055: שורה 1,100:
{ str: 'רשות העתיקות' },
{ str: 'רשות העתיקות' },
{ str: '{{ס:' + "שם הדף בלי הסוגריים}}" },
{ str: '{{ס:' + "שם הדף בלי הסוגריים}}" },
{ url: 1, match: /loc_id\=(\d+)/ },
{ url: 1, match: /loc_id\=(\d+)/, fullhref: true },
{ url: 1, match: /\?id\=(\d+)/ }
{ url: 1, match: /\?id\=(\d+)/, fullhref: true }
]
]
},
},
שורה 1,079: שורה 1,124:
{ telem: '.article-date-report-wrap', date: '/' },
{ telem: '.article-date-report-wrap', date: '/' },
{ telem: '.article-publish-date', date: '/' },
{ telem: '.article-publish-date', date: '/' },
{ ldjson: { key: 'datePublished' } },
{ telem: 'div.tmi-article-reporter-date', date: '/'}, // tmi articles
{ telem: 'div.tmi-article-reporter-date', date: '/'}, // tmi articles
{ telem: 'time.tmi-article-info-date-time', date: '/'}, // tmi articles
{ telem: 'time.tmi-article-info-date-time', date: '/'}, // tmi articles
{ telem: 'time.blog-publish-date', date: '/'} // blogs
{ telem: 'time.blog-publish-date', date: '/'} // blogs
]
]
]
],
removeparam: {
'1': ['מערכת TMI'],
'2': ['{{!}} TMI']
}
},
},
{
{
שורה 1,095: שורה 1,145:
]
]
},
},
{ // site changed their CSP and no longer supported // TODO: remove after 2024-08-31 if not fixed
{
hostname: "davidson.weizmann.ac.il", hrefmatch: /online/,
hostname: "davidson.org.il",
params: [
params: [
{ str: 'דוידסון' },
{ str: 'דוידסון1' },
{ telem: 'span.name' },
[
{ attr: ['meta[property="og:title"]', 'content'] },
{ attr: ['meta[name="twitter:data2"]', 'content'] },
{ url: 1, match: /davidson\.weizmann\.ac\.il\/online\/(.*)$/ },
{ attr: ['meta[name="twitter:data1"]', 'content'] }
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] }
],
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | מגזין | מכון דוידסון'] },
{ url: 1, match: /org\.il\/read-experience\/(.*)$/ },
{ telem: 'div.date', func: function (val) { var x = val.split(' '); x[1] = 'ב' + x[1]; return x.join(' '); } }
]
]
},
},
שורה 1,130: שורה 1,183:
params: [
params: [
{ str: 'סרוגים' },
{ str: 'סרוגים' },
{ telem: '.post_author', match: /(.+?)\d/, remove: [', חדשות סרוגים', 'חדשות סרוגים'] },
[
{ telem: '.post_author', match: /(.+?)\d/ },
{ attr: ["meta[name='author']", "content"] }
],
{ telem: 'h1' },
{ telem: 'h1' },
{ url: 1, match: /\.srugim\.co\.il\/(.*)$/ },
{ url: 1, match: /\.srugim\.co\.il\/(.*)$/ },
{ telem: '.post_details', date: '.' }
[
]
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] },
{ telem: '.post_details', date: '.' }
]
],
removeparam: {
'1': [', חדשות סרוגים', 'חדשות סרוגים']
}
},
},
{
{
שורה 1,175: שורה 1,237:
[
[
{ var: ['detail_data','bookid'] },
{ var: ['detail_data','bookid'] },
{ url: 1, match: /(?:book|b)\/(\d*)\// }
{ url: 1, match: /(?:book|b)\/(\d+)\//, fullhref: true }
],
],
[
[
שורה 1,308: שורה 1,370:
{ prefix:'קישור=', urlparam: 'fileName'}
{ prefix:'קישור=', urlparam: 'fileName'}
],
],
{ prefix:'קובץ=', url: 1, func: function(s) { return s.indexOf('NetVerdicts') > -1 ? getParameterByName('fileName') : ''; }, removeifempty: true },
[
{ prefix:'סוג=', var: 'all_text', match: /([^\s]+?)[\s]+\d+\/\d+/m},
{ prefix:'קובץ=', attr: ["link[rel='themeData']", "href"], match: /(.*)\.files/ },
{ prefix:'קובץ=', url: 1, func: function(s) { return s.indexOf('NetVerdicts') > -1 ? getParameterByName('fileName') : ''; }, removeifempty: true }
],
{ prefix:'סוג=', var: 'all_text', match: /\(?([^\s]+)[\s]+\d+\/\d+/m},
[
[
{ prefix:'עותר=', var:['parsed_data', 'OTTER'] },
{ prefix:'עותר=', var:['parsed_data', 'OTTER'] },
שורה 1,428: שורה 1,493:
params: [
params: [
{ str: 'אאוריקה'},
{ str: 'אאוריקה'},
{ telem: 'div.head-text > h2' },
[
{ url: 1, match: /il\/item\/(\d*)\// }
{ url: 1, match: /il\/(?!item)(.*)/, func: function(val) { return val.replace('_', ' '); } },
{ telem: 'div.head-text > h2' },
],
[
{ url: 1, match: /il\/item\/(\d*)\// },
{ url: 1, match: /il\/(?!item)(.*)/ }
]
]
]
},
},
שורה 1,537: שורה 1,608:
{ str: 'יומן חדשות'},
{ str: 'יומן חדשות'},
{ telem: 'h1.content_title' },
{ telem: 'h1.content_title' },
{ url: 1, match: /il\/news_journal\/([\d-]+\/[\d-]+)/ },
{ url: 1, match: /il\/news_journal\/([\d-]+\/?[\d-]+)/ },
{ telem: '.content_subtitle' }
{ telem: '.content_subtitle' }
]
]
שורה 1,586: שורה 1,657:
{ attr: ["meta[name='citation_journal_title']", "content"] },
{ attr: ["meta[name='citation_journal_title']", "content"] },
{ attr: ["meta[name='citation_publication_date']", "content"] }
{ attr: ["meta[name='citation_publication_date']", "content"] }
]
},
{
hostname: "i24news.tv",
params: [
{ str: 'i24' },
{ telem: ".signature-link > a", remove: ['i24NEWS'] },
{ attr: ["meta[property='og:title']", "content"], remove: [' - i24NEWS'] },
{ url: 1, match: /i24news\.tv\/(.*)/ },
[
{ attr: ["meta[property='pubdate']", "content"], date:['-',[2,1,0]], func: function(val) { return window.location.pathname.indexOf('/he/') == 0 ? val : ''; } },
{ telem: ".common-information-wrapper > span > time ", func: function(val) { if (val) { var arr = val.split(' '); return [arr[0], arr[1], arr[2]].join(' '); } return ''; } }
]
]
},
{
hostname: "vanleer.org.il",
params: [
{ str: 'תיאוריה וביקורת' },
{ telem: ".single-heading > .blacktext" },
{ telem: ".single-heading > .heading > h1", },
{ url: 1, match: /vanleer\.org\.il\/tac_posts\/(.*)\// },
{ telem: ".single-heading > .taxonomy", remove: [ 'גיליון' ], func: function(val) { return val.replace(' | ', ', '); } }
]
},
{
hostname: "psik.io",
params: [
{ str: 'צ-ספר' },
{ ldjson: { raw: 'author', n: 0 }, prefix: "מחבר=" },
{ ldjson: { raw: 'name', n: 0 }, prefix: "שם=" },
{ ldjson: { raw: 'publisher', n: 0 }, prefix: "מו\"ל=", suffix: '}}, {{פסיק' },
{ url: 1, match: /psik\.io\/.*?(?!\/book\/|\/pdfViewer\/|book_id\=)(\d+)/, fullhref: true }
]
},
{
hostname: "cityofdavid.org.il",
params: [
{ str: 'הר הזיתים' },
{ url: 1, match: /grave-card=(\d+)/, fullhref: true }
]
]
}
}
שורה 1,612: שורה 1,723:
var ldjsons = $('script[type="application/ld+json"]').map(function(i,e) { try { return JSON.parse($(e).text().replace(/[\t\n\r]/g, ' ')); } catch (e) { return false; } });
var ldjsons = $('script[type="application/ld+json"]').map(function(i,e) { try { return JSON.parse($(e).text().replace(/[\t\n\r]/g, ' ')); } catch (e) { return false; } });
if (typeof curParam.ldjson.n != "undefined") {
if (typeof curParam.ldjson.n != "undefined") {
ldjson = ldjsons[curParam.ldjson.n];
ldjson = ldjsons.length ? ldjsons[curParam.ldjson.n] : {};
} else {
} else {
var filteredLdjson = ldjsons.filter(function(i,e) { return (curParam.ldjson.type?[curParam.ldjson.type]:['NewsArticle','Article']).includes(e['@type']); });
var filteredLdjson = ldjsons.filter(function(i,e) { return (curParam.ldjson.type?[curParam.ldjson.type]:['NewsArticle','Article']).includes(e['@type']); });
שורה 1,618: שורה 1,729:
ldjson = filteredLdjson[0];
ldjson = filteredLdjson[0];
} else {
} else {
console.error("more/less than single ldjson", filteredLdjson);
console.error("more/less than single ldjson, trying first", filteredLdjson);
return;
ldjson = filteredLdjson[0];
}
}
}
}
שורה 1,637: שורה 1,748:
params[j] = ldjson;
params[j] = ldjson;
for (var t=0; t < curParam.ldjson.raw.length; t++) {
for (var t=0; t < curParam.ldjson.raw.length; t++) {
console.log('curParam.ldjson.raw[t]', curParam.ldjson.raw[t]);
params[j] = params[j][curParam.ldjson.raw[t]];
params[j] = params[j][curParam.ldjson.raw[t]];
}
}
}
}
} else if (typeof curParam.url != "undefined") {
} else if (typeof curParam.url != "undefined") {
params[j] = location.href;
params[j] = curParam.fullhref ? location.href : location.hostname+location.pathname;
if (curParam.url == 'decodeURIComponent')
if (curParam.url == 'decodeURIComponent')
params[j] = decodeURIComponent(params[j]);
params[j] = decodeURIComponent(params[j]);
שורה 1,738: שורה 1,848:
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], false);  
params[j] = dateFormat(params[j]);
}
}
}
}
שורה 1,747: שורה 1,857:
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], false);  
params[j] = dateFormat([dd, mm, yy]);
}
}
}
}
שורה 1,768: שורה 1,878:
if (params[j] && typeof curParam.prefix != "undefined")
if (params[j] && typeof curParam.prefix != "undefined")
params[j] = curParam.prefix + params[j];
params[j] = curParam.prefix + params[j];
if (params[j] && typeof curParam.suffix != "undefined")
params[j] = params[j] + curParam.suffix;


if (typeof curParam.defvalue != "undefined" && params[j] == curParam.defvalue)
if (typeof curParam.defvalue != "undefined" && params[j] == curParam.defvalue)
שורה 1,821: שורה 1,934:
while (params.indexOf('removeifempty') > -1)
while (params.indexOf('removeifempty') > -1)
params.splice(params.indexOf('removeifempty'), 1);
params.splice(params.indexOf('removeifempty'), 1);
// --- התחלה של הוספת הקוד המתוקן לבדיקת עברית ---
let foundHebrew = false;
let dateParamIndex = -1;
for (let h = 0; h < params.length; h++) {
if (hasHebrew(params[h])) {
foundHebrew = true;
}
// זיהוי הפרמטר של התאריך לפי זיהוי חודש עברי
const hebrewMonths = ["יאנואר", "פעברואר", "מערץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "סעפטעמבער", "אקטאבער", "נאוועמבער", "דעצעמבער"];
if (typeof params[h] === 'string' && hebrewMonths.some(month => params[h].includes(month))) {
dateParamIndex = h;
}
}
// אם לא נמצאה עברית בכל הפרמטרים, נשנה את פורמט התאריך לאנגלי
if (!foundHebrew && dateParamIndex !== -1) {
const hebrewDate = params[dateParamIndex];
try {
const hebrewMonthsMap = {
"יאנואר": 1, "פעברואר": 2, "מערץ": 3, "אפריל": 4, "מאי": 5, "יוני": 6, "יולי": 7, "אוגוסט": 8, "סעפטעמבער": 9, "אקטאבער": 10, "נאוועמבער": 11, "דעצעמבער": 12
};
// פירוק התאריך העברי
const parts = hebrewDate.split(' ');
const day = parts[1].replace(',', '');
const month = hebrewMonthsMap[parts[0]];
const year = parts[2];
if (day && month && year) {
params[dateParamIndex] = dateFormat([day, month, year], true); // המרה לאנגלית
}
} catch (e) {
console.error("Failed to convert Hebrew date to English:", e);
}
}
// --- סוף של הוספת הקוד המתוקן לבדיקת עברית ---


if (window.popup_template_canceled && !force_popup) {
if (window.popup_template_canceled && !force_popup) {
console.log('popup_template_canceled');
console.log('popup_template_canceled');
} else {
} else {
var result = '{{' + params.join('|') + '}}';
var result = '{' + '{' + params.join('|') + '}}';
if (window.addWikiNote) result = '{{הערה|' + result + '}}';
if (window.addWikiNote) result = '{{הערה|' + result + '}}';


שורה 1,898: שורה 1,974:
if (isNaN(date)) {
if (isNaN(date)) {
date = new Date(ldojson.publisher.datePublished);
date = new Date(ldojson.publisher.datePublished);
}
var שרייבער = $.map($(ldojson.author), function(a) { return a.name; }).join(VE);
var קעפל = ldojson.name || ldojson.headline;
var זייטל = (ldojson.publisher||ldojson_website[0]).name;
var hebrewFound = hasHebrew(שרייבער) || hasHebrew(קעפל) || hasHebrew(זייטל);
var dateFormatter = hebrewFound ? dateFormat : dateFormatEng;
var formattedDate = '';
if (date != "Invalid Date") {
    var dateParts = [''+date.getDate(), ''+(date.getMonth()+1), ''+date.getFullYear()];
    formattedDate = dateFormatter(dateParts);
}
}
var general = {
var general = {
'שרייבער': $.map($(ldojson.author), function(a) { return a.name; }).join(VE),
    'שרייבער': שרייבער,
'קעפל': ldojson.name || ldojson.headline,
    'קעפל': קעפל,
'אדרעס': location.href,
    'אדרעס': location.href,
'זייטל': (ldojson.publisher||ldojson_website[0]).name,
    'זייטל': זייטל,
'דאטום': date != "Invalid Date" ? dateFormat([''+date.getDate(), ''+(date.getMonth()+1), ''+date.getFullYear()], !hasHebrew(ldojson.name || ldojson.headline)) : '' // שינוי כאן: בדיקה אם יש עברית בכותרת
    'דאטום': formattedDate,
};
};
console.log('data', general);
console.log('data', general);
שורה 1,911: שורה 1,998:
return k + '=' + cleanText(jQuery.trim(decodeURIComponent($('<a />').html(v).text())));
return k + '=' + cleanText(jQuery.trim(decodeURIComponent($('<a />').html(v).text())));
}).join('|') + '}}';
}).join('|') + '}}';
if (window.addWikiNote) gresult = '{{הערה|' + gresult + '}}';
if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", gresult) != null) {
if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", gresult) != null) {
$('<input>').val(gresult).appendTo('body').select();document.execCommand('copy');
$('<input>').val(gresult).appendTo('body').select();document.execCommand('copy');
שורה 1,932: שורה 2,020:
}
}
var s = document.createElement('script');
var s = document.createElement('script');
s.setAttribute('src', "https://he.wikipedia.org/w/load.php?modules=jquery&only=scripts");
s.setAttribute('src', "https://yi.hamichlol.org.il/w/load.php?modules=jquery&only=scripts");
s.onload = wikiit;
s.onload = wikiit;
document.getElementsByTagName('body')[0].appendChild(s);
document.getElementsByTagName('body')[0].appendChild(s);