בדוקי עריכות אוטומטית, אינטערפעיס רעדאקטארן, אינטערפעיס אדמיניסטראַטאָרן, סיסאפן, מייבאים, מעדכנים, מייבא, אספקלריה רעדאקטארן
46,362
רעדאגירונגען
(אפדעיט) |
אין תקציר עריכה |
||
| (30 מיטלסטע ווערסיעס פון 2 באַניצער נישט געוויזן.) | |||
| שורה 1: | שורה 1: | ||
/* This code | /* 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) { | function dateFormat(dateArr) { | ||
if (dateArr instanceof Array) { | if (dateArr instanceof Array) { | ||
var m = ["יאנואר", "פעברואר", "מערץ", "אפריל", "מאי", "יוני", "יולי", " | var m = ["יאנואר", "פעברואר", "מערץ", "אפריל", "מאי", "יוני", "יולי", "אויגוסט", "סעפטעמבער", "אקטאבער", "נאוועמבער", "דעצעמבער"]; | ||
if (dateArr.length != 3) | if (dateArr.length != 3) | ||
| שורה 23: | שורה 28: | ||
return jQuery.trim(dateArr); | return jQuery.trim(dateArr); | ||
} | } | ||
function dateFormatEng(dateArr) { | |||
if (dateArr instanceof Array) { | |||
var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | |||
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]; | |||
} | |||
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"]; | ||
| שורה 44: | שורה 68: | ||
.replace(/\s+/gm, ' ')) | .replace(/\s+/gm, ' ')) | ||
.replace(/&[mn]dash;/g, '-') | .replace(/&[mn]dash;/g, '-') | ||
.replace( | .replace(/"/g, '"') | ||
.replace( | .replace(/ /g, ' ') | ||
.replace( | .replace(/״/g, '"') | ||
.replace( | .replace(/׳/g, "'") | ||
.replace(/(\n|\r)/g, ' ') | .replace(/(\n|\r)/g, ' ') | ||
.replace(/=/g, "{{=}}") | .replace(/=/g, "{{=}}") | ||
| שורה 53: | שורה 77: | ||
.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', ''); | |||
} | } | ||
function getWikiLink() { | function getWikiLink() { | ||
let result = ""; | |||
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:", | |||
}; | |||
const wikinamespace = document.querySelector(".mw-page-title-namespace"); | |||
const wikiname = document.querySelector(".mw-page-title-main"); | |||
const wikiarticle = wikiname | |||
? wikinamespace | |||
? `${wikinamespace.textContent}:${wikiname.textContent}` | |||
: wikiname.textContent | |||
: null; | |||
const wikitype = nms[host]; | |||
if (wikitype !== undefined && wikiname) { | |||
result = `[[${wikitype}${wikiarticle}${wikitype ? "|" + wikiname.textContent : ""}]]`; | |||
} | |||
} | |||
if (result) { | |||
navigator.clipboard.writeText(result).then(() => { | |||
alert("✅ קאפירט: " + result); | |||
}); | |||
return true; | |||
} | |||
return false; | |||
} | } | ||
if (window.location.host. | if (window.location.host.includes("hamichlol")) { | ||
if (getWikiLink()) { | |||
if (window.old$) { window.$ = window.old$; } | |||
return; | |||
} | |||
} | } | ||
| שורה 91: | שורה 134: | ||
var data = [ | var data = [ | ||
{ | { | ||
hostname: | hostname: /yediot(h)?(.ynet)?\.co\.il/, | ||
params: [ | params: [ | ||
{ str: "ידיעות אחרונות" }, | |||
{ str: "ידיעות אחרונות" }, | |||
{ telem: ".ya-author-additional" }, | { telem: ".ya-author-additional" }, | ||
{ telem: ".ahya-title" }, | { telem: ".ahya-title" }, | ||
| שורה 121: | שורה 154: | ||
{ telem: ".text16w", match: /\/(.*?)$/ }, | { telem: ".text16w", match: /\/(.*?)$/ }, | ||
{ telem: ".text16w" }, | { telem: ".text16w" }, | ||
{ telem: ".art_header_footer_author span" | { telem: ".art_header_footer_author span" }, | ||
{ attr: ["meta[property='vr:author']", 'content'], remove: ['מערכת ONE'] } | { attr: ["meta[property='vr:author']", 'content'], remove: ['מערכת ONE'] } | ||
], | ], | ||
[ | [ | ||
{ telem: '.art_header_title' }, | { telem: '.art_header_title' }, | ||
{ attr: ["meta[property='og:title']", "content"] }, | { attr: ["meta[property='og:title']", "content"], remove: [/ - אוכל - ynet.*/] }, | ||
{ elem: 'head>title', match: /(?:ynet\s*-?)?([^\-]*)/ }, | { elem: 'head>title', match: /(?:ynet\s*-?)?([^\-]*)/ }, | ||
{ telem: 'h1' } | { telem: 'h1' }, | ||
{ elem: 'font.leshonit' } | |||
], | ], | ||
[ | [ | ||
{ url: 1, match: /co\.il\/((?:ency|home|headlines)\/.*?html?)/ }, | |||
{ url: 1, match: /L-(.*?),/ }, | { url: 1, match: /L-(.*?),/ }, | ||
{ url: 1, match: /co\.il\/(.*)/ } | { url: 1, match: /co\.il\/(.*)/, remove: ['#autoplay'] } | ||
], | ], | ||
[ | [ | ||
{ url: 1, match: /co\.il\/((?:ency)\/.*?html?)/, prefix: "תאריך=", func: function(s) { return s ? 'ללא' : ''; }}, | |||
{ elem: 'td:has(h1:first) .text12g:last', date: '.' }, | { elem: 'td:has(h1:first) .text12g:last', date: '.' }, | ||
{ elem: ".text12g + .text12g", date: '.' }, | { elem: ".text12g + .text12g", date: '.' }, | ||
| שורה 146: | שורה 182: | ||
}, | }, | ||
{ | { | ||
hostname: /(www| | 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; } }, | ||
{ | { attr: ["meta[property='vr:author']", "content"], remove: ['מערכת mynet'] }, | ||
{ | { attr: ["meta[property='og:title']", "content"] }, | ||
{ url: 1, match: /article\/(.*)$/ }, | { url: 1, match: /article\/(.*)$/ }, | ||
{ | { attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] } | ||
] | ] | ||
}, | }, | ||
| שורה 165: | שורה 201: | ||
{ telem: '.info .author:first, .provider', match: /^([^\|]*)/ }, | { telem: '.info .author:first, .provider', match: /^([^\|]*)/ }, | ||
{ telem: 'div.wp-0-b:first span:first', match: /מאת:(.*),/ }, | { telem: 'div.wp-0-b:first span:first', match: /מאת:(.*),/ }, | ||
{ telem: '.author > div', match: /^([^\|]*)/ | { telem: '.author > div', match: /^([^\|]*)/ } | ||
], | ], | ||
{ attr: ["meta[property='og:title']", "content"], remove: [ / - וואלה!?.*/ ] }, | { attr: ["meta[property='og:title']", "content"], remove: [ / - וואלה!?.*/ ] }, | ||
| שורה 179: | שורה 215: | ||
{ telem: ".w2.txt-w:last", match: /, (\d+ ב.*? \d+),/ } | { telem: ".w2.txt-w:last", match: /, (\d+ ב.*? \d+),/ } | ||
] | ] | ||
] | ], | ||
removeparam: { | |||
'1': [/(מערכת )?וואלה!?[א-ת ]+/] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 188: | שורה 227: | ||
{ var: ['articlePage', 'dimension1'] }, | { var: ['articlePage', 'dimension1'] }, | ||
{ telements: ["header address", VE] }, | { telements: ["header address", VE] }, | ||
{ attr: ["meta[name='author']", "content"] }, | |||
{ telem: 'address > a' }, | { telem: 'address > a' }, | ||
{ | { telem: 'main > div > section > div > div > a', remove: [ 'שיתוף בוואטסאפ' ] }, | ||
{ telem: 'address' } | { telem: 'address' } | ||
], | |||
[ | [ | ||
{ telem: 'header | { telem: 'h1#article-header' }, | ||
{ attr: ['meta[property="og:title"]', 'content'] } | { attr: ['meta[property="og:title"]', 'content'] } | ||
], | ], | ||
| שורה 228: | שורה 269: | ||
{ attr: ["meta[property='og:title']", "content"] } | { attr: ["meta[property='og:title']", "content"] } | ||
], | ], | ||
{ url: 1, match: /(\d+)/ }, | [ | ||
{ url: 1, match: /org\.il\/(.*p-\d{4,}.*)/ }, | |||
{ url: 1, match: /(\d+)/ } | |||
], | |||
[ | [ | ||
{ telem: '.story_autor_date' }, | { telem: '.story_autor_date' }, | ||
| שורה 305: | שורה 349: | ||
{ str: 'ערוץ7' }, | { str: 'ערוץ7' }, | ||
[ | [ | ||
{ telem: '.article-credit--author' | { telem: '.article-credit--author' }, | ||
{ telem: '.article-info--author' | { telem: '.article-info--author' } | ||
], | ], | ||
{ telem: 'h1.article-title' }, | { telem: 'h1.article-title' }, | ||
| שורה 313: | שורה 357: | ||
{ telem: '.article-date-gregorian', date: '.' }, | { telem: '.article-date-gregorian', date: '.' }, | ||
{ telem: '.article-date-gregorian-date', date: '.' } | { telem: '.article-date-gregorian-date', date: '.' } | ||
] | ], | ||
] | { url: 1, match: /.*(flashes).*/ } | ||
], | |||
removeparam: { | |||
'1': ['ערוץ 7'] // needed because of the space | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 324: | שורה 372: | ||
{ ldjson: { key:'author' } } | { ldjson: { key:'author' } } | ||
], | ], | ||
{ elem: '#F_Title, .mainArticletitle' }, | [ | ||
{ elem: '#F_Title, .mainArticletitle' }, | |||
{ telem: 'h1.project_title' } | |||
], | |||
{ url: 1, match: /=(\d+)/ }, | { url: 1, match: /=(\d+)/ }, | ||
[ | [ | ||
{ elem: '.articleInfo .timestamp, #coteret_Modified, #F_Modified_on, .g_Article_DateTime', date: '/' }, | { elem: '.articleInfo .timestamp, #coteret_Modified, #F_Modified_on, .g_Article_DateTime', date: '/' }, | ||
{ attr: ["meta[name='article_created']", "content"], date: '/' }, | { attr: ["meta[name='article_created']", "content"], date: '/' }, | ||
{ telem: '.articleInfo .timestamp', date: '.'} | { telem: '.articleInfo .timestamp', date: '.'}, | ||
{ telem: 'span.project_date', date: '.'} | |||
] | ] | ||
] | ] | ||
| שורה 347: | שורה 399: | ||
params: [ | params: [ | ||
{ str: 'בחדרי חרדים' }, | { str: 'בחדרי חרדים' }, | ||
{ ldjson: { key:'author' } }, | { ldjson: { key:'author' }, remove: [ /,? ?(כתב )?בחדרי חרדים/ ] }, | ||
{ attr: ["meta[property='og:title']", "content"] }, | { attr: ["meta[property='og:title']", "content"], remove:[' - בחדרי חרדים'] }, | ||
[ | [ | ||
{ url: 1, match: /news\/(\d+)/ }, | { url: 1, match: /news\/(\d+)/ }, | ||
| שורה 357: | שורה 409: | ||
}, | }, | ||
{ | { | ||
hostname: "www. | hostname: "www.kore.co.il", | ||
params: [ | |||
{ str: 'כל רגע' }, | |||
{ ldjson: { key:'author' } }, | |||
{ attr: ["meta[property='og:title']", "content"], remove:[' - כל רגע'] }, | |||
[ | |||
{ url: 1, match: /viewArticle\/(\d+)/ }, | |||
{ var: 'userid' } | |||
], | |||
{ ldjson: { key:'datePublished' } } | |||
] | |||
}, | |||
{ | |||
hostname: "www.c14.co.il", | |||
params: [ | params: [ | ||
{ str: 'עכשיו 14' }, | { str: 'עכשיו 14' }, | ||
{ telem: ' | [ // הימור, אין מקור טוב אחר (opt 1 + opt 2) | ||
{ telem: ' | { telem: "a[href^='/author/'] p" }, // opt 1 | ||
{ url: 1, match: / | { attr: [ 'main > section > article > div:nth-of-type(3) > div > div > div > img', 'alt' ] } // opt 2 | ||
{ | ], | ||
{ telem: 'h1' }, | |||
{ url: 1, match: /article\/(\d+)/ }, | |||
{ attr: ["meta[name='article:published_time']", "content"], date:['-',[2,1,0]] } | |||
], | |||
removeparam: { | |||
'1': [ /מערכת.*/, 'דסק החדשות C14' ] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 387: | שורה 458: | ||
}, | }, | ||
{ | { | ||
hostname: "www.makorrishon.co.il", condition: function () { return location.pathname.startsWith('/nrg/'); }, minimum: 7, | |||
hostname: "www.makorrishon.co.il", condition: function () { return | |||
params: [ | params: [ | ||
{ str: 'nrg' }, | { str: 'nrg' }, | ||
[ | [ | ||
{ elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_WRITER_START -->(.*)<!-- ARTICLE_WRITER_END -->/ }, | { elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_WRITER_START -->(.*)<!-- ARTICLE_WRITER_END -->/ }, | ||
{ telem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a" } | { telem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a" }, | ||
{ telem: '.newsVitzCredit > sprint' } | |||
], | ], | ||
[ | [ | ||
{ var: 'titleName'}, | { var: 'titleName'}, | ||
{ elem: 'h1', match: [/<!-- ARTICLE_TITLE_START --> (.*?)<!-- ARTICLE_TITLE_END -->/, /(.*?) \|/] } | { elem: 'h1', match: [/<!-- ARTICLE_TITLE_START --> (.*?)<!-- ARTICLE_TITLE_END -->/, /(.*?) \|/] }, | ||
{ elem: '#titleS1' } | |||
], | ], | ||
[ | [ | ||
| שורה 428: | שורה 478: | ||
{ elem: "#articleCBar span:first, .articleBar h4:first", date: '/' }, | { elem: "#articleCBar span:first, .articleBar h4:first", date: '/' }, | ||
{ telem: ".jeg_meta_date", date: '-' }, | { telem: ".jeg_meta_date", date: '-' }, | ||
{ elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_DATE_START -->(.*)<!-- ARTICLE_DATE_END -->/, date: '/'} | { elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_DATE_START -->(.*)<!-- ARTICLE_DATE_END -->/, date: '/'}, | ||
{ telem: '.newsVitzCredit:nth-of-type(2)', date: '/' } | |||
], | ], | ||
[ | [ | ||
| שורה 441: | שורה 492: | ||
params: [ | params: [ | ||
{ str: 'מקור ראשון' }, | { str: 'מקור ראשון' }, | ||
{ | { ldjson: { key:'author'}, remove: [/(:?כתב|מערכת)? מקור ראשון/] }, | ||
{ telem: "h1:first" }, | { telem: "h1:first" }, | ||
{ url:1, match: /makorrishon\.co\.il\/(.*?)\/?$/ }, | { url:1, match: /makorrishon\.co\.il\/(.*?)\/?$/ }, | ||
] | |||
}, | |||
] | |||
}, | |||
{ | { | ||
hostname: "www.one.co.il", | hostname: "www.one.co.il", | ||
params: [ | params: [ | ||
{ str: 'one' }, | { str: 'one' }, | ||
{ elem: ".article-credit > a", match: /^.*$/gm, remove: ["מאת | { elem: ".article-credit > a", match: /^.*$/gm, remove: ["מאת ", "</a>"] }, | ||
{ telem: "h1, #_ctl0_Main_ucFullArticle_lblCaption, #_ctl0_Main_ucFullArticle_lbColCaption" }, | { telem: "h1, #_ctl0_Main_ucFullArticle_lblCaption, #_ctl0_Main_ucFullArticle_lbColCaption" }, | ||
{ url: 1, match: [/Article\/\d\d\-\d\d\/\d,\d+,\d+,\d+\/(\d+)/i, /Article\/(\d+)/i, /id=(\d+)/] }, | { url: 1, match: [/Article\/\d\d\-\d\d\/\d,\d+,\d+,\d+\/(\d+)/i, /Article\/(\d+)/i, /id=(\d+)/] }, | ||
| שורה 486: | שורה 513: | ||
[ | [ | ||
{ telem: ".normal14 .normal, .content li.taxonomy-term-reference-0, .views-field-name .field-content" }, | { telem: ".normal14 .normal, .content li.taxonomy-term-reference-0, .views-field-name .field-content" }, | ||
{ ldjson: { key:'author' } } | { ldjson: { key:'author'} } | ||
], | ], | ||
[ | [ | ||
| שורה 498: | שורה 525: | ||
{ elem: '.time', date: '.' } | { elem: '.time', date: '.' } | ||
] | ] | ||
] | ], | ||
removeparam: { | |||
'1': [/(:?כתבי|מערכת) [א-ת]+ היום/] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 528: | שורה 558: | ||
{ str: 'TheMarker' }, | { str: 'TheMarker' }, | ||
[ | [ | ||
{ telements: [".prsnlArticleEnvelope .autorBarAnchor, .prsnlArticleEnvelope .autorBarWriters", VE | { telements: [".prsnlArticleEnvelope .autorBarAnchor, .prsnlArticleEnvelope .autorBarWriters", VE] }, | ||
{ attr: ['meta[name="author"]', "content"] }, | { attr: ['meta[name="author"]', "content"] }, | ||
{ 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"] } | { var: ["_sf_async_config","authors"] } | ||
], | ], | ||
[ { var: ['articlePage', 'name'] }, | [ { var: ['articlePage', 'name'] }, | ||
{ telem: "header > h1" }, | |||
{ telem: "header > div > h1" }, | |||
{ attr: ['meta[property="og:title"]', 'content'] }, | { attr: ['meta[property="og:title"]', 'content'] }, | ||
{ telem: "h1.h-mb--xxtight, h1.mainTitle" }, | { telem: "h1.h-mb--xxtight, h1.mainTitle" }, | ||
| שורה 544: | שורה 576: | ||
{ telem: ".author-bar li:eq(1), .h3_date, div.art__info time", date: '.' }, | { telem: ".author-bar li:eq(1), .h3_date, div.art__info time", date: '.' }, | ||
{ telem: ".inner_bar", date:'/'}, | { telem: ".inner_bar", date:'/'}, | ||
{ url: 1, match: /\.com.*\/(\d{4}-\d{2}-\d{2})\/.*/, date:['-',[2,1,0]] }, | |||
{ telem: 'time', remove: [ /\d\d\:\d\d\, / ], removeDatePadding: true } | { telem: 'time', remove: [ /\d\d\:\d\d\, / ], removeDatePadding: true } | ||
], | ], | ||
{ url: 1, match: /\/\/(.*?).themarker/i, defvalue: "www" } | { url: 1, match: /\/\/(.*?).themarker/i, defvalue: "www" } | ||
] | ], | ||
removeparam: { | |||
'1': ["מאת:"] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 555: | שורה 591: | ||
[ | [ | ||
{ telem: ".shahor.art-author" }, | { telem: ".shahor.art-author" }, | ||
{ telem: ".calcalistArticleHeader_footer .authors" } | { telem: ".calcalistArticleHeader_footer .authors" }, | ||
{ telem: "span.authorArticle" } | |||
], | ], | ||
{ | { 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\/(.*)/ } | ||
], | ], | ||
[ | [ | ||
{ telem: ".art-publish-date.afor > .l-date:last", date: '.' }, | { telem: ".art-publish-date.afor > .l-date:last", date: '.' }, | ||
{ telem: ".calcalistArticleHeader_footer .date", date: '.'} | { telem: ".calcalistArticleHeader_footer .date", date: '.'}, | ||
{ telem: "span.art-publish-date", date: '.'} | |||
] | ] | ||
] | ] | ||
| שורה 584: | שורה 622: | ||
params: [ | params: [ | ||
{ str: 'NFC' }, | { str: 'NFC' }, | ||
{ telem: "# | { telem: "#titleTop > table a", remove: ["מחלקה ראשונה"] }, | ||
{ attr: ['meta[property="og:title"]', 'content'] }, | { attr: ['meta[property="og:title"]', 'content'] }, | ||
{ url: 1, match: /ve\/(.*?)\.html/ }, | { url: 1, match: /ve\/(.*?)\.html/ }, | ||
| שורה 637: | שורה 675: | ||
params: [ | params: [ | ||
{ str: 'British Pathe' }, | { str: 'British Pathe' }, | ||
{ telem: " | [ | ||
{ telem: ".searchTermVal", func: function(val) { return 'סרטוני חדשות על ' + val; }, remove: [/"/g] }, | |||
{ telem: " | { attr: ["meta[property='og:title']", "content"] } | ||
], | |||
[ | |||
{ telem: ".searchTermVal", remove: [/"/g] }, | |||
{ url: 1, match: /britishpathe\.com\/.*?(\d+)\// } | |||
] | |||
] | ] | ||
}, | }, | ||
| שורה 646: | שורה 689: | ||
params: [ | params: [ | ||
{ str: 'אתר צה"ל' }, | { str: 'אתר צה"ל' }, | ||
{ telem: ".article | { telem: ".author-article", remove: [ /,?\s*?מערכת (את"צ|אתר צה"ל|צה"ל)/ ] }, | ||
{ telem: "h1" }, | { telem: "h1" }, | ||
[ | [ | ||
{ attr: ["body | { attr: ["body", "data-uid"] }, | ||
{ url: 'decodeURI', match: /idf\.il\/(.*)$/ } | { url: 'decodeURI', match: /idf\.il\/(.*)$/ } | ||
], | ], | ||
{ 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; } } | |||
] | ] | ||
}, | }, | ||
| שורה 663: | שורה 714: | ||
{ str: 'כיכר השבת' }, | { str: 'כיכר השבת' }, | ||
{ attr: ["meta[name='author']", "content"] }, | { attr: ["meta[name='author']", "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[ | { attr: ["meta[property='article:published_time']", "content"], date:['-', '210'] } | ||
] | ] | ||
}, | }, | ||
| שורה 675: | שורה 726: | ||
params: [ | params: [ | ||
{ str: 'כיפה' }, | { str: 'כיפה' }, | ||
{ telem: "author", remove: [ | { telem: "author", remove: [", כיפה"] }, | ||
{ telem: "h1" }, | { telem: "h1" }, | ||
{ url: 1, match: /co\.il\/(.+)/ }, | { url: 1, match: /co\.il\/(.+)/ }, | ||
| שורה 733: | שורה 784: | ||
], | ], | ||
{ urlparam: 'pgnum', prefix: 'page=' } | { urlparam: 'pgnum', prefix: 'page=' } | ||
] | |||
}, | |||
{ | |||
hostname: "www.izkor.gov.il", | |||
params: [ | |||
{ str: 'יזכור' }, | |||
{ url: 1, match: /gov\.il\/(.*)/, func: function (val) { return val.replace(/%20/, '%2520'); } }, | |||
{ url: 1, match: /gov\.il\/(.*?)\// } | |||
] | ] | ||
}, | }, | ||
| שורה 742: | שורה 801: | ||
{ telem: "title", remove: "HBreader - " }, | { telem: "title", remove: "HBreader - " }, | ||
{ urlparam: 'sfid' }, | { urlparam: 'sfid' }, | ||
{prefix: 'page=', url: 1, match:/p\=(\d+)/i, remove: "contents not available "}, | {prefix: 'page=', url: 1, match:/p\=(\d+)/i, remove: "contents not available אין תוכן העניינים"}, | ||
] | ] | ||
}, | }, | ||
| שורה 787: | שורה 846: | ||
{ 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+)/ } | |||
] | ] | ||
}, | }, | ||
| שורה 812: | שורה 881: | ||
'ajns': 'עיתונות|ajns', | 'ajns': 'עיתונות|ajns', | ||
'ashnav': 'אשנב', | 'ashnav': 'אשנב', | ||
'baderech': 'עיתונות|baderech', | |||
'bamar': 'במערכה', | 'bamar': 'במערכה', | ||
'bustenai': 'עיתונות|bustenai', | |||
'dav': 'דבר', | 'dav': 'דבר', | ||
'dhy': 'דואר היום', | 'dhy': 'דואר היום', | ||
'diedeborah' :'עיתונות|diedeborah', | |||
'dmt': 'מאמענט', | 'dmt': 'מאמענט', | ||
'dnajlb': 'עיתונות|dnajlb', | 'dnajlb': 'עיתונות|dnajlb', | ||
'emda': 'עמדה', | 'emda': 'עמדה', | ||
'eretzh': 'עיתונות|eretzh', | 'eretzh': 'עיתונות|eretzh', | ||
'etger': 'עיתונות|etger', | |||
'frw': 'פארווערטס', | 'frw': 'פארווערטס', | ||
'haa': 'המאסף', | 'haa': 'המאסף', | ||
| שורה 826: | שורה 899: | ||
'hadt': 'האחדות', | 'hadt': 'האחדות', | ||
'haibri': 'העברי', | 'haibri': 'העברי', | ||
'hairtlv': 'העיר', | |||
'ham': 'העם', | 'ham': 'העם', | ||
'haolam': 'העולם', | 'haolam': 'העולם', | ||
| שורה 831: | שורה 905: | ||
'has': 'השומר הצעיר ורשה', | 'has': 'השומר הצעיר ורשה', | ||
'haschiloah': 'השילוח1', | 'haschiloah': 'השילוח1', | ||
'haumaisr': 'האומה1', | |||
'hayal': 'לחייל', | 'hayal': 'לחייל', | ||
'hayomisr': 'עיתונות|hayomisr', | 'hayomisr': 'עיתונות|hayomisr', | ||
| שורה 837: | שורה 912: | ||
'hbkr': 'הבקר', | 'hbkr': 'הבקר', | ||
'hcl': 'הכרמל', | 'hcl': 'הכרמל', | ||
'heatid': 'עיתונות|heatid', | |||
'hebrew': 'שרהזאהן', | 'hebrew': 'שרהזאהן', | ||
'hed': 'הד המזרח', | 'hed': 'הד המזרח', | ||
| שורה 867: | שורה 943: | ||
'ktuvim': 'כתובים', | 'ktuvim': 'כתובים', | ||
'lbf': 'לעבנס-פראגן', | 'lbf': 'לעבנס-פראגן', | ||
'lehiton': 'להיטון', | |||
'lmrv': 'למרחב', | 'lmrv': 'למרחב', | ||
'ltb': 'ליטערארישע בלעטער', | 'ltb': 'ליטערארישע בלעטער', | ||
'mad': 'מחזיקי הדת', | 'mad': 'מחזיקי הדת', | ||
'mahanayim': 'מחניים', | |||
'mar': 'מעריב', | 'mar': 'מעריב', | ||
'mgd': 'המגיד', | 'mgd': 'המגיד', | ||
'mrh': 'מוריה', | 'mrh': 'מוריה', | ||
'mzp': 'המצפה', | 'mzp': 'המצפה', | ||
'newpalestine' :'עיתונות|newpalestine', | |||
'omer': 'אמר', | 'omer': 'אמר', | ||
'pisgoh': 'הפסגה', | 'pisgoh': 'הפסגה', | ||
'plb' :'עיתונות|plb', | |||
'pls': 'PalPost', | |||
'shar': 'שערים', | 'shar': 'שערים', | ||
'sulm': 'סלם', | 'sulm': 'סלם', | ||
| שורה 881: | שורה 962: | ||
'yomyom': 'יוםיום', | 'yomyom': 'יוםיום', | ||
'ytlv': 'ידיעות תל אביב', | 'ytlv': 'ידיעות תל אביב', | ||
'zim': 'עיתונות|zim', | |||
'zmanim': 'זמנים' | 'zmanim': 'זמנים' | ||
}[s.toLowerCase()]; } } | }[s.toLowerCase()]; } } | ||
| שורה 888: | שורה 970: | ||
{ var: 'canonical_url', match: /newspapers\/\w+\/(\d+\/\d+\/\d+)\//, remove: '///'}, | { var: 'canonical_url', match: /newspapers\/\w+\/(\d+\/\d+\/\d+)\//, remove: '///'}, | ||
{ var: 'canonical_url', match: /article\/(\d+\.?\d*)(\/|$)/ } | { var: 'canonical_url', match: /article\/(\d+\.?\d*)(\/|$)/ } | ||
] | |||
}, | |||
{ | |||
hostname: "blog.nli.org.il", | |||
params: [ | |||
{ str: 'הספרנים' }, | |||
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-meta span:nth-of-type(1)').textContent; } }, | |||
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-title').textContent; } }, | |||
{ var: ['nliLayersActiveItem', 'data_url'], remove: [ /^\//, /\/$/ ] }, | |||
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-meta span:nth-of-type(2)').textContent; }, date: '.' } | |||
] | ] | ||
}, | }, | ||
| שורה 987: | שורה 1,079: | ||
params: [ | params: [ | ||
{ str: 'חרדים10' }, | { str: 'חרדים10' }, | ||
{ | { attr: ['meta[name="author"]', 'content'], remove: ['חרדים 10'] }, | ||
{ | { 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'] } | ||
] | ] | ||
}, | }, | ||
| שורה 1,007: | שורה 1,099: | ||
{ str: 'מעריב אונליין' }, | { str: 'מעריב אונליין' }, | ||
[ | [ | ||
{ telem: 'span.article-reporter a' | { ldjson: { key: 'author' } }, | ||
{ telem: 'span.article-reporter a' }, | |||
{ telem: 'a[rel=Author]' }, | { telem: 'a[rel=Author]' }, | ||
{ telem: '.article-date-report-wrap', match: /^.*\|(.*)$/m }, | { telem: '.article-date-report-wrap', match: /^.*\|(.*)$/m }, | ||
{ telem: 'span.article-reporter', | { telem: 'span.article-reporter' }, | ||
], | ], | ||
[ | [ | ||
| שורה 1,020: | שורה 1,113: | ||
{ telem: '.article-date-time, .article-he-date', date: '/' }, | { telem: '.article-date-time, .article-he-date', date: '/' }, | ||
{ telem: '.article-date-report-wrap', date: '/' }, | { telem: '.article-date-report-wrap', date: '/' }, | ||
{ telem: '.article-publish-date', date: '/' } | { telem: '.article-publish-date', date: '/' }, | ||
{ telem: 'div.tmi-article-reporter-date', date: '/'}, // tmi articles | |||
{ telem: 'time.tmi-article-info-date-time', date: '/'}, // tmi articles | |||
{ telem: 'time.blog-publish-date', date: '/'} // blogs | |||
] | ] | ||
] | ] | ||
| שורה 1,034: | שורה 1,130: | ||
] | ] | ||
}, | }, | ||
{ | { | ||
hostname: "davidson. | hostname: "davidson.org.il", | ||
params: [ | params: [ | ||
{ str: ' | { str: 'דוידסון1' }, | ||
{ | { attr: ['meta[name="twitter:data1"]', 'content'] }, | ||
{ attr: ['meta[property="og:title"]', 'content'] }, | { attr: ['meta[property="og:title"]', 'content'], remove: [' | מגזין | מכון דוידסון'] }, | ||
{ url: 1, match: / | { 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,061: | שורה 1,157: | ||
params: [ | params: [ | ||
{ str: 'אתר הגבורה' }, | { str: 'אתר הגבורה' }, | ||
{ attr: ['input[name=hdaid]', 'value'] }, | |||
{ attr: ['input[name=hdaid]', 'value'] } | { telem: 'h1' } | ||
] | ] | ||
}, | }, | ||
| שורה 1,072: | שורה 1,168: | ||
{ 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,126: | שורה 1,225: | ||
{ var: ['detail_data', 'YEAR'] } | { var: ['detail_data', 'YEAR'] } | ||
], | ], | ||
{ str: '' }, | |||
[ | [ | ||
{ attr: ["ab", "value"], match: /^([^ ]*) /, prefix: 'page=' }, | { attr: ["ab", "value"], match: /^([^ ]*) /, prefix: 'page=' }, | ||
| שורה 1,139: | שורה 1,239: | ||
{ str: 'דבר העובדים' }, | { str: 'דבר העובדים' }, | ||
[ | [ | ||
{ attr: ['section', 'data-author_name | { attr: ['section', 'data-author_name'] }, | ||
{ attr: ['article', 'data-author_name | { attr: ['article', 'data-author_name'] } | ||
], | ], | ||
[ | [ | ||
| שורה 1,146: | שורה 1,246: | ||
{ telem: '.g-article-headline'} | { telem: '.g-article-headline'} | ||
], | ], | ||
{ url: 1, match: /www\.davar1\.co\.il\/(\d+)/ }, | { url: 1, match: /www\.davar1\.co\.il(?:\/.*)?\/(\d+)/ }, | ||
[ | [ | ||
{ attr: ['meta[itemprop="dateCreated"]', 'content'], date: '.' }, | { attr: ['meta[itemprop="dateCreated"]', 'content'], date: '.' }, | ||
{ telem: '.g-article-date', date: '.' } | { telem: '.g-article-date', date: '.' } | ||
] | ] | ||
] | ], | ||
removeparam: { | |||
'1': [ 'דבר ראשון' ] // old name in old articles | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 1,239: | שורה 1,342: | ||
{ str: "פס\"ד עליון" } | { str: "פס\"ד עליון" } | ||
], | ], | ||
{ prefix:'קישור=', urlparam: 'fileName'}, | [ | ||
{ prefix:'קישור=', urlparam: 'path', func: function(s) { return !s.indexOf('NetVerdicts') ? s.replace('NetVerdicts/', '') : false; } }, | |||
{ 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:'סוג=', var: 'all_text', match: /([^\s]+?)[\s]+\d+\/\d+/m}, | ||
[ | [ | ||
| שורה 1,290: | שורה 1,397: | ||
params:[ | params:[ | ||
{ str: "JDN"}, | { str: "JDN"}, | ||
{ telem: "span.elementor-post-info__item--type-author" | { telem: "span.elementor-post-info__item--type-author" }, | ||
{ telem: "h1.elementor-heading-title" }, | { telem: "h1.elementor-heading-title" }, | ||
{ url: 1, match: /\/(\d+)\// }, | { url: 1, match: /\/(\d+)\// }, | ||
{ | { attr: ['meta[property="article:published_time"]', 'content'], date: ['-', '210'] } | ||
] | ] | ||
}, | }, | ||
| שורה 1,326: | שורה 1,433: | ||
params: [ | params: [ | ||
{ str: 'יובל אראל'}, | { str: 'יובל אראל'}, | ||
{ telem: 'a.author-name' | { telem: 'a.author-name' }, | ||
{ telem: 'h1.post-title ' }, | { telem: 'h1.post-title ' }, | ||
{ url: 1, match: /com\/(.*)/ } | { url: 1, match: /com\/(.*)/ } | ||
| שורה 1,336: | שורה 1,443: | ||
{ str: 'גיקטיים'}, | { str: 'גיקטיים'}, | ||
[ | [ | ||
{ telem: 'p.post-meta > a' | { telem: 'p.post-meta > a' }, | ||
{ telem: 'section.post-content > p > strong' | { telem: 'section.post-content > p > strong' }, | ||
{ telem: '.author' | { telem: '.author' } | ||
], | ], | ||
| שורה 1,350: | שורה 1,457: | ||
{ telem: '.date', date: '.' } | { telem: '.date', date: '.' } | ||
], | ], | ||
] | ], | ||
removeparam: { | |||
'1': [ 'כתב אורח', /מאת:? / ] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 1,400: | שורה 1,510: | ||
params: [ | params: [ | ||
{ str: 'שיחה מקומית'}, | { str: 'שיחה מקומית'}, | ||
{ telem: 'article#main > header > div.post_details > a' | { telem: 'article#main > header > div.post_details > a' }, | ||
{ telem: 'article#main > header > h1.post_title' }, | { telem: 'article#main > header > h1.post_title' }, | ||
{ url: 1, match: /il\/(.*)\// }, | { url: 1, match: /il\/(.*)\// }, | ||
| שורה 1,411: | שורה 1,521: | ||
{ str: 'עונג שבת'}, | { str: 'עונג שבת'}, | ||
[ | [ | ||
{ telem: 'div.post-body > div > span' | { telem: 'div.post-body > div > span' }, | ||
{ telem: 'div.post-body > div > b' | { telem: 'div.post-body > div > b' }, | ||
{ telem: 'div.post-body > div > strong' | { telem: 'div.post-body > div > strong' } | ||
], | ], | ||
{ telem: 'h3.post-title' }, | { telem: 'h3.post-title' }, | ||
| שורה 1,419: | שורה 1,529: | ||
{ url: 1, match: /blog-post_(\d+).html/ }, | { url: 1, match: /blog-post_(\d+).html/ }, | ||
{ telem: 'h2.date-header', remove: [ /.*, / ] } | { telem: 'h2.date-header', remove: [ /.*, / ] } | ||
] | ], | ||
removeparam: { | |||
'1': ['מאת', 'כתב וצילם', 'כתב'] | |||
} | |||
}, | }, | ||
{ | { | ||
hostname: "anumuseum.org.il", | hostname: "dbs.anumuseum.org.il", | ||
params: [ | params: [ | ||
{ str: 'אנו – מוזיאון העם היהודי'}, | { str: 'אנו – מוזיאון העם היהודי'}, | ||
| שורה 1,441: | שורה 1,554: | ||
{ str: 'גיידסטאר'}, | { str: 'גיידסטאר'}, | ||
{ url: 1, match: /il\/organization\/(\d+)/ }, | { url: 1, match: /il\/organization\/(\d+)/ }, | ||
{ | { elem: 'title', remove: [' | גיידסטאר - אתר התאגידים של ישראל | משרד המשפטים' ] } | ||
] | ] | ||
}, | }, | ||
| שורה 1,482: | שורה 1,595: | ||
{ url: 1, match: /tidhar\/view\/(\d+)\/.+/ }, | { url: 1, match: /tidhar\/view\/(\d+)\/.+/ }, | ||
{ url: 1, match: /tidhar\/view\/\d+\/(\d+)/ } | { url: 1, match: /tidhar\/view\/\d+\/(\d+)/ } | ||
] | |||
}, | |||
{ | |||
hostname: "zman.co.il", | |||
params: [ | |||
{ str: 'זמן ישראל' }, | |||
{ ldjson: { key: 'author' } }, | |||
{ telem: "h1.headline" }, | |||
{ url: 1, match: /co\.il\/(\d+)/, dirty: true }, | |||
{ ldjson: { key: 'datePublished' } } | |||
] | |||
}, | |||
{ | |||
hostname: "wikirefua.org.il", | |||
params: [ | |||
{ str: 'ויקירפואה' }, | |||
{ telem: "h1.firstHeading" }, | |||
{ telem: "h1.firstHeading", func: function(data) { var match = data.match(/ - [A-Za-z].*/); return match ? data.replace(match[0], '') : false; } } | |||
] | ] | ||
}, | }, | ||
| שורה 1,493: | שורה 1,624: | ||
{ 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,510: | שורה 1,654: | ||
for (var k=0; k < data[i].params[j].length; k++) { | for (var k=0; k < data[i].params[j].length; k++) { | ||
try { | try { | ||
var curParam = data[i].params[j][k]; | var curParam = data[i].params[j][k], | ||
removed = false; params[j] = ''; | |||
if (typeof curParam.str != "undefined") { | if (typeof curParam.str != "undefined") { | ||
| שורה 1,517: | שורה 1,661: | ||
} else if (typeof curParam.ldjson != "undefined") { | } else if (typeof curParam.ldjson != "undefined") { | ||
var ldjson = null; | var ldjson = null; | ||
var ldjsons = $('script[type="application/ld+json"]').map(function(i,e) { return JSON.parse($(e).text()); }); | 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[curParam.ldjson.n]; | ||
| שורה 1,544: | שורה 1,688: | ||
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++) { | ||
params[j] = params[j][curParam.ldjson.raw[t]]; | params[j] = params[j][curParam.ldjson.raw[t]]; | ||
} | } | ||
| שורה 1,669: | שורה 1,812: | ||
console.error(e); | console.error(e); | ||
} | } | ||
params[j] = cleanText(params[j]); | !curParam.dirty && (params[j] = cleanText(params[j])); | ||
} else if (jQuery.isArray(params[j])) { | } else if (jQuery.isArray(params[j])) { | ||
params[j] = jQuery.trim(params[j].join("|")); | params[j] = jQuery.trim(params[j].join("|")); | ||
| שורה 1,681: | שורה 1,824: | ||
if (typeof curParam.shouldnt != "undefined" && typeof params[j] == "string" && params[j].match(curParam.shouldnt)) | if (typeof curParam.shouldnt != "undefined" && typeof params[j] == "string" && params[j].match(curParam.shouldnt)) | ||
params[j] = ''; | params[j] = ''; | ||
if (typeof curParam.removeifempty != "undefined" && !params[j]) | |||
params[j] = 'removeifempty'; | |||
if (data[i].removeparam) { | |||
if (data[i].removeparam[j]) { | |||
for (var r = 0; r < data[i].removeparam[j].length; ++r) { | |||
var currName = params[j]; | |||
params[j] = params[j].replace(data[i].removeparam[j][r], ''); | |||
if (currName != params[j]) { | |||
removed = true; | |||
} | |||
} | |||
} | |||
} | |||
// if the author is the same as the template, remove it | |||
if (j == 1 && params[0] && params[1]) { | |||
if ((params[1] == params[0]) || ((params[1].split(' ').length-1 <= params[0].split(' ').length) && params[1].toLowerCase().indexOf(params[0].toLowerCase()) > -1)) { | |||
params[1] = ''; | |||
removed = true; | |||
} | |||
} | |||
if ((params[j] != '') && (params[j] != undefined)) { | if ((params[j] != '') && (params[j] != undefined)) { | ||
console.log('found', j, params[j]); | console.log('found', j, params[j]); | ||
break; | break; | ||
} else if (removed) { | |||
console.log('not used', j, curParam); | |||
} else { | |||
console.log('not found', j, curParam); | |||
} | } | ||
} | } | ||
catch (e) { | catch (e) { | ||
| שורה 1,698: | שורה 1,867: | ||
while (params[params.length - 1] == "" && params.length > minimum) //remove all last empty params | while (params[params.length - 1] == "" && params.length > minimum) //remove all last empty params | ||
params.pop(); | params.pop(); | ||
// remove removeifempty child | |||
while (params.indexOf('removeifempty') > -1) | |||
params.splice(params.indexOf('removeifempty'), 1); | |||
if (window.popup_template_canceled && !force_popup) { | if (window.popup_template_canceled && !force_popup) { | ||
| שורה 1,738: | שורה 1,911: | ||
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 = { | ||
'שרייבער': שרייבער, | |||
'קעפל': קעפל, | |||
'אדרעס': location.href, | |||
'זייטל': זייטל, | |||
'דאטום': formattedDate, | |||
}; | }; | ||
console.log('data', general); | console.log('data', general); | ||
var gresult = '{{ | var gresult = '{{לינק|'+$.map(general, function(v,k) { | ||
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,772: | שורה 1,957: | ||
} | } | ||
var s = document.createElement('script'); | var s = document.createElement('script'); | ||
s.setAttribute('src', "https:// | 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); | ||
רעדאגירונגען