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

אפדעיט
אין תקציר עריכה
(אפדעיט)
שורה 114: שורה 114:
}
}
return false;
return false;
}
function getLangWikiLink() {
var langs = { en: "אנ", ru: "רו", de: "גר", it: "איט", hu: "הו", nl: "הול", tr: "טר", yi: "יי", el: "יוו", no: "נו", zh: "סי", es: "ספ", ar: "ער", pl: "פל", fa: "פר'", cs: "צ'כ", fr: "צר", ro: "רומ" };
var result = '',
name = location.pathname.replace('/wiki/', '').replace(/_/g, ' '),
lang = location.hostname.split('.')[0];
if (!langs[lang]) {
return false;
}
result = '{{'+langs[lang]+'|'+name+'}}';
if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", result) != null) {
$('<input>').val(result).appendTo('body').select();document.execCommand('copy');
}
return true;
}
}


if (window.location.host.indexOf('he.wik') == 0) {
if (window.location.host.indexOf('he.wik') == 0) {
if (getWikiLink()) {
if (getWikiLink()) {
return true;
}
}
if (window.location.host.indexOf('wikipedia') > 0) {
if (getLangWikiLink()) {
return true;
return true;
}
}
שורה 186: שורה 210:
},
},
{
{
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]] }
]
]
},
},
שורה 403: שורה 427:
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:[' - בחדרי חרדים'] },
[
[
שורה 666: שורה 690:
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+)\// }
]
]
]
},
},
שורה 682: שורה 711:
],
],
{ 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; } }
]
]
},
},
שורה 689: שורה 729:
{ 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'] }
]
]
},
},
שורה 821: שורה 861:
{ 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+)/ }
]
]
},
},
שורה 847: שורה 897:
'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: שורה 971:
'pisgoh': 'הפסגה',
'pisgoh': 'הפסגה',
'plb' :'עיתונות|plb',
'plb' :'עיתונות|plb',
'pls': 'PalPost',
'shar': 'שערים',
'shar': 'שערים',
'sulm': 'סלם',
'sulm': 'סלם',
שורה 1,094: שורה 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[name="twitter:data1"]', 'content'] },
{ attr: ['meta[property="og:title"]', 'content'] },
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | מגזין | מכון דוידסון'] },
{ url: 1, match: /davidson\.weizmann\.ac\.il\/online\/(.*)$/ },
{ url: 1, match: /org\.il\/read-experience\/(.*)$/ },
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] }
{ telem: 'div.date', func: function (val) { var x = val.split(' '); x[1] = 'ב' + x[1]; return x.join(' '); } }
]
]
},
},
שורה 1,132: שורה 1,183:
{ 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: '.' }
]
]
]
},
},
שורה 1,585: שורה 1,639:
{ 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 ''; } }
]
]
]
}
}
שורה 1,636: שורה 1,703:
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]];
}
}