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

אפדעיט
אין תקציר עריכה
(אפדעיט)
 
שורה 75: שורה 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', '');
שורה 167: שורה 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 ? 'ללא' : ''; }},
שורה 221: שורה 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: 'הארץ' },
שורה 252: שורה 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' } }
]
]
]
},
},
שורה 276: שורה 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: '.' }
]
},
},
{
{
שורה 376: שורה 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: '/' },
שורה 391: שורה 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: '.' }
]
]
שורה 455: שורה 457:
{ telem: '.curr_issue_title > ._date', date: '/' }
{ telem: '.curr_issue_title > ._date', date: '/' }
]
]
]
],
removeparam: {
'1': [ 'מערכת אתר חיל-האוויר' ]
}
},
},
{
{
שורה 533: שורה 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"] }
],
],
[
[
שורה 551: שורה 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[א-ת ]+/]
}
},
},
{
{
שורה 562: שורה 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'] },
שורה 596: שורה 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\/(.*)/ }
],
],
שורה 658: שורה 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 }
],
],
[
[
שורה 748: שורה 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" },
שורה 955: שורה 965:
'omer': 'אמר',
'omer': 'אמר',
'pisgoh': 'הפסגה',
'pisgoh': 'הפסגה',
'plb' :'עיתונות|plb',
'plb' :'PalBull',
'pls': 'PalPost',
'pls': 'PalPost',
'shar': 'שערים',
'shar': 'שערים',
שורה 1,037: שורה 1,047:
params: [
params: [
{ str: 'מזהה חסיד אומות העולם' },
{ str: 'מזהה חסיד אומות העולם' },
{ url: 1, match: /&itemId\=(\d+)/ }
{ url: 1, match: /&itemId\=(\d+)/, fullhref: true }
]
]
},
},
שורה 1,052: שורה 1,062:
params: [
params: [
{ str: 'מוג\'ו' },
{ str: 'מוג\'ו' },
{ urlparam: 'id', match: /(.*?)\.htm/ }
{ url: 1, match: /mojo\.com\/.*?(rl\d+|tt\d+)\// }
]
]
},
},
שורה 1,090: שורה 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,114: שורה 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,134: שורה 1,149:
params: [
params: [
{ str: 'דוידסון1' },
{ str: 'דוידסון1' },
{ attr: ['meta[name="twitter:data1"]', 'content'] },
[
{ attr: ['meta[name="twitter:data2"]', 'content'] },
{ attr: ['meta[name="twitter:data1"]', 'content'] }
],
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | מגזין | מכון דוידסון'] },
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | מגזין | מכון דוידסון'] },
{ url: 1, match: /org\.il\/read-experience\/(.*)$/ },
{ url: 1, match: /org\.il\/read-experience\/(.*)$/ },
שורה 1,165: שורה 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\/(.*)$/ },
שורה 1,172: שורה 1,193:
{ telem: '.post_details', date: '.' }
{ telem: '.post_details', date: '.' }
]
]
]
],
removeparam: {
'1': [', חדשות סרוגים', 'חדשות סרוגים']
}
},
},
{
{
שורה 1,213: שורה 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,346: שורה 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,466: שורה 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,575: שורה 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,637: שורה 1,670:
{ telem: ".common-information-wrapper > span > time ", func: function(val) { if (val) { var arr = val.split(' '); return [arr[0], arr[1], arr[2]].join(' '); } return ''; } }
{ 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,663: שורה 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,669: שורה 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,692: שורה 1,752:
}
}
} 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,818: שורה 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,875: שורה 1,938:
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 + '}}';