משתמש:שמוליק/קישורים חיצוניים/beta2019.js

הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: ללחוץ על Ctrl-F5.
	/* This code doesn't run in wikipedia but in other sites as bookmarklet */

	function wikiit(event, force_popup) {
		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[0] + " ב" + dateArr[1] + " " + dateArr[2];
			}
			return jQuery.trim(dateArr);
		}

		function engDateParse(engDate) {
			var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
			engDate = engDate.match(/(\w+) (\d+), (\d+)/);
			return [engDate[2], (m.indexOf(engDate[1]) + 1), engDate[3]];
		}

		function match(str, expr) { str = str ? str.match(expr) : str; return (str && str.length > 1) ? str[1] : ''; }

		function getParameterByName(name) {
			/* http://james.padolsey.com/javascript/bujs-1-getparameterbyname/ */
			var match = RegExp('[?&]' + name + '=([^&]*)')
				.exec(window.location.search);
			return match && decodeURIComponent(match[1].replace(/\+/gi, ' '));
		}

		var data = [
			{
				hostname: /yediot(h)?(.ynet)?\.co\.il/,
				params: [
					{ str: "ynet" },
					{ telem: ".ya-author-additional" },
					{ telem: ".ahya-title" },
					{ var: "dcContentID" },
					{ telem: ".ahya-date", date: '.' },
				]
			},
			{
				hostname: /www\.m?ynet\.co\.il/, minimum: 4,
				params: [
					{ url:1, match:/(m?ynet)/ },
					[
						{ elements: ['.authorHtmlCss', ' ו'] },
						{ telem: 'td:has(h1:first) .text14:first', match: /^(.{0,100})$/ },
						{ elem: 'font.text14 span p:last', match: /^\((.*?)\)$/ },
						{ telem: "style+span a[href^='http://www.ynet.co.il/tags/']" }, // for ynet bug
						{ telem: ".text16w", match: /\/(.*?)$/ },
						{ telem: ".text16w" },
						{ telem: ".art_header_footer_author span" },
					],
					[
						{ telem: 'h1' },
						{ telem: '.art_header_title' },
						{ attr: ["meta[property='og:title']", "content"] }, //seems wrong on http://www.ynet.co.il/articles/0,7340,L-3676702,00.html
						{ elem: 'head>title', match: /(?:ynet\s*-?)?([^\-]*)/ },
					],
					{ url: 1, match: /L-(.*?),/ },
					[
						{ elem: 'td:has(h1:first) .text12g:last', date: '.' },
						{ elem: ".text12g + .text12g", date: '.' },
						{ elem: ".art_header_footer_author:last", date: '.' },
					],
					{ url: 1, match: /ynet.co.il\/[^[\/]*\/(\d+)/, defvalue: '0' },
					{ url: 1, match: /ynet.co.il\/([^[\/]*)/, defvalue: 'articles' }
				]
			},
			{
				hostname: /mynet(jerusalem|krayot|kibbutz|rishon|hadera|netania|netanya|herzliya|holon|petahtikva|batyam|roshhaayin|kfarsaba|hodhasharon|rehovot|raanana|afula|emek|haifa|beersheva)\.co\.il$/i,
				params: [
					{ str: 'mynet2' },
					{ telem: 'div.BreadCrumbs a:first', remove: ['MYNET ', 'mynet '] },
					{ telem: 'a.PostCreator' },
					{ telem: 'h1.PostH1' },
					{ url: 1, match: /\.co\.il\/(.*)$/ },
					{ telem: 'div.PostInfo:last', date: '.' },
				]
			},
			{
				hostname: "xnet.ynet.co.il", minimum: 5,
				params: [
					{ str: 'xnet' },
					[{ telem: 'div.ahxnet_author, div.author div.cp-h2' }],
					{ telem: "h1" }, //can use ".colorTitle:first>.right" for descrition or join them to one long title
					{ url: 1, match: /L-(.*?),/ },
					{ telem: ".BlogInfo,.author.clearFix cite,.time", date: '.' },
					{ str: '' },
					{ url: 1, match: /articles\/(\d+),/, defvalue: '0' }
				]
			},
			{
				hostname: "pplus.ynet.co.il", minimum: 5,
				params: [
					{ str: 'פנאי פלוס' },
					[{ telem: '.ahpp_author a:last' }],
					{ telem: 'div.ahpp_title' },
					{ url: 1, match: /L-(.*?),/ },
					{ telem: ".ahpp_date", date: '.', remove: ['פורסם '] },
					{ str: '' },
					{ url: 1, match: /articles\/(\d+),/, defvalue: '0' }
				]
			},
			{
				hostname: /^\w+\.walla\.co\.il$/,
				params: [
					{ str: 'וואלה!' },
					[{ telem: '.info .author:first, .provider', match: /^([^\|]*)/ },
					{ telem: 'div.wp-0-b:first span:first', match: /מאת:(.*),/ }],
					{ telem: 'h1' },
					[{ url: 1, match: /item\/(\d+)/ },
					{ url: 1, match: /w=\/\d*\/(\d+)/ }],
					[
						{ telem: '.info .date:first', match: /, (\d+ ב.*? \d+),/ },
						{ elem: ["h1", "parent", "children", "eq,2"], match: /,(.*),/, shouldnt: "online_presence" }, //TODO:
						{ telem: ".w2.txt-w:last", match: /, (\d+ ב.*? \d+),/ }
					]
				]
			},
			{
				hostname: /^\w+\.nana(10)?\.co\.il$/i, minimum: 6,
				params: [
					{ str: 'נענע10' },
					{ telem: '.Author:first', remove: ['תרבות ובידור נענע 10', 'נענע 10'] },
					[{ telem: '#ArtTitle' }, { telem: 'h1' },],
					{ urlparam: 'ArticleID' },
					{ elem: '.ArticleDate:first,.Date', date: '/' },
					{ str: '' },
					{ url: 1, match: /(\w+)\.nana/i }
				]
			},
			{
				hostname: "www.haaretz.co.il",
				params: [
					{ str: 'הארץ' },
					[{ var: ['articlePage', 'dimension1'] }, { telements: ["header address", " ו"] }],
					{ telem: 'header h1' },
					[
						{ var: ['articlePage', 'id'] },
						{ url: 1, match: /\.il\/(\d\.\d+)/ },
						{ url: 1, match: /(\d\.\d+)$/ }
					],
					{ telem: "header time", date: '.' }
				]
			},
			{
				hostname: "www.inn.co.il", hrefmatch: /www\.inn\.co\.il.*Besheva/i,
				params: [
					{ str: 'בשבע' },
					{ elem: '.Author:first', match: /<\/div>(.*)$/ },
					{ telem: 'h3:first' },
					{ url: 1, match: /^.*\/(.*)$/ },
					{ telem: '.Date:first', date: '/' }, //normal pages
				]
			},
			{
				hostname: "www.ice.co.il",
				params: [
					{ str: 'אייס' },
					{ telem: '#article-container div.credit span:first a' },
					{ telem: '#article-container div.col-lg-12 h1' },
					{ url: 1, match: /article\/(\d+)/ },
					{ telem: '#article-container div.credit time span:first', date: '/' },
				]
			},
			{
				hostname: "www.kan.org.il",
				params: [
					{ str: 'כאן' },
					{ telem: '.story_autor_name' },
					{ telem: '.story_title' },
					{ url: 1, match: /Id\=(\d+)/i },
					{ telem: '.story_autor_date' },
					{ url: 1, match: /org\.il\/(.+?)\// },
				]
			},
			{
				hostname: "(10.tv|13news.co.il)",
				params: [
					{ str: 'ערוץ עשר' },
					{ telem: 'li:contains("כתבים: ") + li' },
					{ telem: 'h1' },
					{ url: 1, match: /\/(\d+)$/ },
					{ telem: 'li:contains("פורסם ב: ") + li', date: '/' },
					{ url: 1, match: /\/([^\/]*?)\/\d+$/, defvalue: 'news' },
				]
			},
			{
				hostname: "mida.org.il",
				params: [
					{ str: 'מידה' },
					{ telem: '.author', prefix: "כותב=" },
					{ telem: '.entry-title', prefix: "כותרת=" },
					{ elem: 'body', prefix: "מספר כתבה=", match: /post-(\d+)/ },
					{ telem: '.published', prefix: "תאריך=", date: '/' },
				]
			},
			{
				hostname: "www.inn.co.il",
				params: [
					{ str: 'ערוץ7' },
					[
						{ telem: '.ArticleAuthor h5' }, //http://www.inn.co.il/Articles/Article.aspx/7513
						{ first_text_node:".Author *:first", match:/^(.*),\s+$/}, // https://www.inn.co.il/News/News.aspx/403520
						{ telem: '.Author a' }
					],
					[
						{ telem: (location.href.indexOf("News/Flash") < 0) ? 'h2:first' : '#divMC h3' }, //TODO:
						{ telem: 'h1' }
					],
					{ url: 1, match: /^.*\/(.*)$/ },
					[{ telem: '.Date:first, .Author', date: '/' },
					{ telem: '.NewsMain .Top .Right', match: /(\d+ (.*?) \d+)/, split: ' ', func: dateFormat },
					{ telem: '.NewsMain .Top .Right', date: '/' }], //flashnews
					{ url: 1, match: /www\.inn\.co\.il\/(\w+\/\w+)\.aspx/, defvalue: 'News/News' },
				]
			},
			{
				hostname: "www.globes.co.il",
				params: [
					{ str: 'גלובס' },
					{ telem: 'div.articleInfo a:first' },
					{ elem: '#F_Title, .mainArticletitle' },
					{ url: 1, match: /=(\d+)/ },
					[
						{ elem: '.articleInfo .timestamp, #coteret_Modified, #F_Modified_on, .g_Article_DateTime', date: '/' },
						{ attr: ["meta[name='article_created']", "content"], date: '/' },
					]
				]
			},
			{
				hostname: "www.the7eye.org.il",
				params: [
					{ str: 'העין השביעית' },
					{ telem: "article a[rel='tag'], article a[href*='/writer/']" },
					{ telem: "h1.headline" },
					{ url: 1, match: /\/www\.the7eye\.org\.il\/(\d+)/ },
					{ telem: "article span.date", date: '.' },
				]
			},
			{
				hostname: "www.bhol.co.il",
				params: [
					{ str: 'בחדרי חרדים' },
					{ telem: 'div.meta-info.article-place .date:first', match: /^\n(.*)\n/m },
					{ elem: '.article-heading h1:first' },
					[{ url: 1, match: /news\/(\d+)/ }, { var: 'userid' }],
					{ telem: 'div.meta-info.article-place .date:first', date: '/' }
				]
			},
			{
				hostname: "www.20il.co.il",
				params: [
					{ str: 'ערוץ 20' },
					{ telem: '.post-meta-author' },
					{ telem: '.post-title' },
					{ url: 1, match: /il\/(.+?)\// },
					{ telem: '.tie-date', date: '/' }
				]
			},
			{
				hostname: "iaf.org.il",
				params: [
					{ str: 'אתר חיל האוויר' },
					{ telem: '#ctl00_ContentPlaceHolder1_ucEventLog_divOuther' },
					{ telem: '#ctl00_ContentPlaceHolder1_ucEventLog_titleText' },
					{ url: 1, match: /(\d+-\d+)-/ },
					{ telem: '#ctl00_ContentPlaceHolder1_ucEventLog_publishDate', date: '.' }
				]
			},
			{
				hostname: "actv.haifa.ac.il",
				params: [
					{ str: 'הערוץ האקדמי' },
					{ elements: ["#ctl00_ContentPlaceHolder_Content_Repeater_Humans_ctl00_HyperLink_Human_Name", ' ו'] },
					{ elem: '#ctl00_ContentPlaceHolder_Content_Label_Title' },
					{ urlparam: 'it' },
					{ elem: "#ctl00_ContentPlaceHolder_Content_Label_DateBroadcast", remove: ["תאריך הקלטה:"], date: '/' }
				]
			},
			{
				hostname: "www.mouse.co.il", //only "CM.articles" have a template!
				params: [
					{ str: 'עכבר העיר' },
					{ telem: "address.u-d--i > span:nth-child(1)", remove: [", עכבר העיר אונליין", ', עכבר העיר'] },
					{ telem: ".katava-box.box h1, h1" },
					{ url: 1, match: /(\d+\.\d+)$/ },
					[{ elem: "p.katava-info:first", match: /^\W+ (\d+ \W+ \d+)/ },
					{ elem: "p.katava-infoVer2:first", match: /^יום \W+ (\d+ \W+ \d+)/ }]
				]
			},
			{
				hostname: "www.makorrishon.co.il", condition: function () { return ($("h1:first").length > 0 && location.pathname.startsWith('/nrg/')) }, minimum: 7,
				params: [
					{ str: 'nrg' },
					[
						{ 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" },
					],
					[{ elem: 'h1', match: [/<!-- ARTICLE_TITLE_START --> (.*?)<!-- ARTICLE_TITLE_END -->/, /(.*?)&nbsp;\|/] }],
					[{ url: 1, match: /(\d+\/\d+)\.html/ }, { url: 1, match: /\/(\d+)\/$/ }],
					[
						{ elem: "#articleCBar span:first, .articleBar h4:first", 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: '/'},
					],
					[{ url: 1, match: /online\/(.*?)\/ART/ }, { url: 1, match: /il\/(.*?)\/\d+\/$/ }],
					{ url: 1, match: /ART(\d+)/ }
				]
			},
			{
				hostname: "www.makorrishon.co.il", condition: function () { return !location.pathname.startsWith('/nrg/') }, minimum: 3,
				params: [
					{ str: 'מקור ראשון' },
					{ telem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a" },
					{ telem: "h1:first" },
					{ url:1, match: /makorrishon\.co\.il\/(.*?)\/$/ },
					[{ telem: ".jeg_meta_date", date: '-' }, { telem: ".jeg_meta_date", date:['/',[1,0,2]] }],
				]
			},
			{
				hostname: "www.nrg.co.il", condition: function () { return ($("h1:first").length == 0) }, minimum: 7,
				params: [
					{ str: 'nrg' },
					[
						{ telem: "font.newsVitzCredit", remove: ["NRG מעריב"] },
						{ elem: "td.newsVitzCredit", match: /^(.*?)<br>/, remove: ["NRG מעריב"] },
						{ telem: "font.newsVitzBody:first", match: /^(.*)/, remove: ["NRG מעריב"] }
					],
					{ telem: "#titleS1" },
					{ url: 1, match: /(\d+\/\d+)\.html/ },
					[
						{ telem: "font.newsVitzCredit:last, .opinionMainVitzBody", date: '/' },
						{ telements: ["td.newsVitzCredit", ""], date: '/' }
					],
					{ url: 1, match: /online\/(.*?)\/ART/ },
					{ url: 1, match: /ART(\d+)/ }
				]
			},
			{
				hostname: "www.one.co.il",
				params: [
					{ str: 'one' },
					{ elem: "#ArticleCredit", match: /^.*$/gm, remove: ["מאת מערכת ONE", "מאת "] },
					{ telem: "h1, #_ctl0_Main_ucFullArticle_lblCaption, #_ctl0_Main_ucFullArticle_lbColCaption" },
					{ url: 1, match: [/Article\/\d\d\-\d\d\/\d,\d+,\d,\d\/(\d+)/, /Article\/(\d+)/, /id=(\d+)/] },
					{ elem: "#ArticleCredit, .f10.left", date: '/' }
				]
			},
			{
				hostname: "www.israelhayom.co.il",
				params: [
					{ str: 'ישראל היום' },
					{ telem: ".normal14 .normal, .content li.taxonomy-term-reference-0, .views-field-name .field-content" },
					[{ telem: ".pane-title" }, { attr: ['meta[property="og:title"]', 'content'] }],
					[{ urlparam: 'id' }, { url: 1, match: /article\/(\d+)/ }, { url: 1, match: /\w+\/(\d+)$/ }],
					[{ telem: ".newsletter_title_date, .time time:first", date: '.' }, { telem: ".pane-node-created", match: /,(.*?\d+\, \d+)/ }],
					{ url: 1, func: function (x) { return x.indexOf('opinion') >= 0 ? "1" : ""; }, def: '' }
				]
			},
			{
				hostname: "www.mako.co.il",
				params: [
					{ str: 'mako' },
					[{ elements: ['.writerData *:visible:first a', ' ו'], shouldnt: /\d+\/\d+\/\d+/ },
					{ telem: 'span.katav', match: /^(.*?),?\s?$/, }],
					[{ telem: ".article.clearer h1" }, { telem: "h1" }],
					{ url: 1, match: /Article-(.*?).htm/ },
					{ url: 1, match: /www\.mako\.co\.il\/(.*?)\/Article/ },
					[{ elem: ".writerData *:last", date: '/' },
					{ elem: "span.displayDate", date: '/' },
					]
				]
			},
			{
				hostname: /^\w+\.themarker\.com$/i,
				params: [
					{ str: 'TheMarker' },
					[
						{ telements: [".prsnlArticleEnvelope .autorBarAnchor, .prsnlArticleEnvelope .autorBarWriters", "ו "], remove: ["מאת:"] },
						{ telem: "a.author-bar li:eq(2), .h3_author", remove: ["מאת:"] },
						{ telem: "div.art__info address" },
						{ attr: ['meta[name="author"]', "content"] }
					],
					[	{ var: ['articlePage', 'name']},
						{ telem: "h1.h-mb--xxtight, h1.mainTitle" },
						{ telem: "h2" }, {attr:['meta[property="og:title"]', 'content']}
					],
					{ url: 1, match: /^.*\/(.+?)\/?$/ },
					[
						{ telem: ".author-bar li:eq(1), .h3_date, div.art__info time", date: '.' },
						{ telem: ".inner_bar", date:'/'}
					],
					{ url: 1, match: /\/\/(.*?).themarker/i, defvalue: "www" }
				]
			},
			{
				hostname: "www.calcalist.co.il", minimum: 5,
				params: [
					{ str: 'כלכליסט' },
					{ telem: ".shahor.art-author" },
					{ telem: "h1" },
					{ url: 1, match: /L\-(\d+)/ },
					{ telem: ".art-publish-date.afor > .l-date:last", date: '.' }
				]
			},
			{
				hostname: "www.news1.co.il",
				params: [
					{ str: 'NFC' },
					{ telem: "#ctl00_ContentMain_UcArticle1_lnkWriterName, #ctl00_ContentMain_UcArticle1_lblTopWriterName", remove: ["מחלקה ראשונה"] },
					{ telem: "#ctl00_ContentMain_UcArticle1_lblHead1, #ctl00_ContentMain_UcArticle1_lblSpecialTitle" },
					{ url: 1, match: /ve\/(.*?)\.html/ },
					{ telem: "#ctl00_ContentMain_UcArticle1_lblCreateDate", date: '/' }
				]
			},
			{ //even this is not exactly "External Link Template"
				hostname: "aleph.nli.org.il",
				params: [
					{ str: 'מאמר' },
					{ telem: "#fullRecordView th:contains(מחבר):first + td", func: function (str) { var strs = str.match(/^(.*?), (.*?)$/); return (strs.length == 3) ? (strs[2] + " " + strs[1]) : str; } },
					{ telem: "#fullRecordView th:contains(כותר):first + td", match: /^(.*?)\.?[\s\u202c]*$/ },
					{ telem: "#fullRecordView th:contains(בתוך):first + td", match: /^(.*?) \(/ },
					{ str: '' },
					{ telem: "#fullRecordView th:contains(בתוך):first + td", match: /\((.*?)\)/, func: function (yh) { return yh.substring(0, yh.length - 1) + '"' + yh.substr(yh.length - 1); } },
					{ telem: "#fullRecordView th:contains(בתוך):first + td", match: /(\d+\-\d+)/ },
					{ telem: "#fullRecordView th:contains(מס' מערכת):first + td", prefix: "רמבי=" }
				]
			},
			{
				hostname: "www.rollingstone.com",
				params: [
					{ str: 'רולינג סטון' },
					{ telem: ".author", remove: ["By"] },
					[{ telem: "h1" }, { telements: ["h3:first, h4", " - "] }],
					{ url: 1, match: /rollingstone.com\/(.*)$/ },
					{ telem: ".date", match: /(\w+ \d+, \d+)/m, func: [engDateParse, dateFormat] }
				]
			},
			{
				hostname: "www.yeshiva.org.il", hrefmatch: /\/midrash\/shiur\.asp\?id=\d+/i,
				params: [
					{ str: 'אתר ישיבה1' },
					{ telem: ".trav", remove: ["הרב"] },
					{ telem: "h1" },
					{ urlparam: "id" }
				]
			},
			{
				hostname: "www.yeshiva.org.il",
				params: [
					{ str: 'אתר ישיבה' },
					{ telem: ".trav", remove: ["הרב", "שליט\"א"], prefix: "הרב=" },
					{ telem: "h1", prefix: "נושא=" },
					{ url: 1, prefix: "קישור=" }
				]
			},
			{
				hostname: "www.sport5.co.il",
				params: [
					{ str: 'ספורט 5' },
					{ telem: "#ContentPlaceHolder1_ancWriter, span#lblWriter2, #tdAuthorDateTime font", remove: ["מערכת אתר ערוץ הספורט"] },
					{ telem: "h1.article-main, h1#divTopTitle" },
					[
						{ url: 1, match: /Article\.\d+\.(\d+)\.html/ },
						{ url: 1, match: /docID=(\d+)/i }
					],
					[
						{ url: 1, match: /Article\.(\d+)\.\d+\.html/ },
						{ url: 1, match: /FolderID=(\d+)/i }
					],
					[{ telem: "#lblDate2", date: '/' }, { telem: ".hint", date: '.' }]
				]
			},
			{
				hostname: "britishpathe.com",
				hrefmatch: /britishpathe\.com/i,
				params: [
					{ str: 'British Pathe' },
					{ telem: "#record-container>h1", remove: ["video newsreel film"] },
					{ urlparam: 'id' },
					{ telem: "#researcher-stats td:eq(0)", date: '/' }
				]
			},
			{
				hostname: "www.idf.il",
				params: [
					{ str: 'אתר צה"ל' },
					{ telem: ".article-primary p strong:eq(0)", match: /(.+)\|/ },
					{ telem: "h1" },
					{ url: 'decodeURI', match: /^.(.*)$/ },
					{ telem: ".article-primary p strong:eq(0)", date: '.' }
				]
			},
			{
				hostname: "www.kikar.co.il",
				params: [
					{ str: 'כיכר השבת' },
					{ telem: ".article_buttons_field:first" },
					{ telem: "h1.article-title" },
					{ url: 'decodeURIComponent', match: /kikar\.co\.il\/(.*?)\.html$/i },
					{ telem: ".article_buttons_field:last", date: '.' }
				]
			},
			{
				hostname: "www.kipa.co.il",
				params: [
					{ str: 'כיפה' },
					{ telem: "author", remove: ["מערכת כיפה", ", כיפה"] },
					{ telem: "h1" },
					{ url: 1, match: /co\.il\/(.+)/ },
					{ telem: ".date" }
				]
			},
			{
				hostname: "www.hebpsy.net",
				params: [
					{ str: 'פסיכולוגיה עברית' },
					{ attr: ["meta[name='auhtor']", "content"] },
					{ telem: "h2.head" },
					{ urlparam: 'id' },
					{ telem: ".body_textarea:first > div:last", func: function (str) { arr = str.match(/(\d+)..([א-ת]+)..(\d+)/); return arr[1].replace(/^0+/, '') + " ב" + arr[2] + " " + arr[3]; } } //it's not space but other character
				]
			},
			{
				hostname: "www.hayadan.org.il",
				params: [
					{ str: 'הידען' },
					{ telem: "a[rel='author'], span.author, li[itemprop='author']", remove: ["מאת "] },
					{ telem: "h1.entry-title, h1.single-title, div.title-primary, span.breadcrumb_last" },
					{ url: 1, match: /https?:\/\/www.hayadan\.org\.il\/(.*?)$/i },
					[
						{ telem: "span.meta-date, span.date" },
						{ telem: ".entry-header .published" },
						{
							attr: ['meta[property="article:published_time"]', 'content'],
							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
						}
					]
				]
			},
			{
				hostname: "hebrewbooks.org", hrefmatch: /org\/\d/,
				params: [
					{ str: 'HebrewBooks' },
					{ telem: "span.authorname" },
					{ telem: "span.sefername" },
					[{ urlparam: 'req' }, { url: 1, match: /hebrewbooks\.org\/(\d+)$/i }],
					{ prefix: "{{כ}}", telements: ["#cpMstr_lblHebPlace:first, #cpMstr_lblHebDate:first", " "] },
					{ urlparam: 'pgnum', prefix: 'עמוד=' }
				]
			},
			{
				hostname: "hebrewbooks.org", hrefmatch: /pgnum/,
				params: [
					{ str: 'HebrewBooks' },
					{ telem: "span.authorname" },
					{ telem: "span.sefername", remove: "-----" },
					[{ urlparam: 'req' }, { url: 1, match: /hebrewbooks\.org\/(\d+)$/i }],
					{ telements: ["#cpMstr_lblHebPlace:first, #cpMstr_lblHebDate:first", " "] },
					{ urlparam: 'pgnum', prefix: 'עמוד=' }
				]
			},
			{
				hostname: "www.izkor.gov.il", hrefmatch: /HalalKorot/i,
				params: [
					{ str: 'נזכור את כולם' },
					{ urlparam: "id" },
					{ attr: ['#ctl00_ctl00_MainContent_MainContent_HiddenFieldFullName', 'value'] },
					{ prefix: 'מלא=', str: 'כן' }
				]
			},
			{
				hostname: "tchelet.org.il",
				params: [
					{ str: 'תכלת' },
					{ telem: "h2 + a.author" },
					{ telem: "h2" },
					{ urlparam: "id" },
					{ telem: "#themag" }
				]
			},
			{
				hostname: /jpress(\.nli)?.org.il/,
				params: [
					{
						str: 'עיתונות יהודית היסטורית 2', func: function (str) {
							var pub = $.parseJSON($("span[data-json]").first().attr("data-json")).pub;
							var codes = {
								"BUL": { "title": "Bulletin de l'Alliance Israélite Universelle", "hasTemplate": false },
								"DAV": { "title": "דבר", "hasTemplate": true },
								"HLB": { "title": "הלבנון", "hasTemplate": false },
								"HZV": { "title": "הצבי", "hasTemplate": true },
								"ISR": { "title": "Israël", "hasTemplate": false },
								"LLB": { "title": "לה ליברט (צרפתית)", "hasTemplate": false },
								"LLR": { "title": "La Libert - Judeo-Arabic", "hasTemplate": false },
								"LRI": { "title": "L'Avenir Illustré", "hasTemplate": false },
								"MGD": { "title": "המגיד", "hasTemplate": true },
								"PLS": { "title": "PalPost", "hasTemplate": true },
								"PED": { "title": "Paix et Droit", "hasTemplate": false },
								"VDC": { "title": "La Voix des Communaut?s", "hasTemplate": false },
								"EGY": { "title": "Egyenlöség", "hasTemplate": false },
								"HSK": { "title": "השקפה", "hasTemplate": true },
								"HMZ": { "title": "המליץ", "hasTemplate": true },
								"NOR": { "title": "נער", "hasTemplate": false },
								"HZT": { "title": "חבצלת", "hasTemplate": true },
								"HZN": { "title": "הזמן", "hasTemplate": true },
								"HZF": { "title": "הצפירה", "hasTemplate": true },
								"OCC": { "title": "The Occident", "hasTemplate": false },
								"MAR": { "title": "מעריב", "hasTemplate": true },
								"HED": { "title": "הד המזרח", "hasTemplate": true },
								"HHR": { "title": "הפועל הצעיר", "hasTemplate": true },
								"HYM": { "title": "היום", "hasTemplate": true },
								"IVA": { "title": "עברי אנכי", "hasTemplate": true },
								"KMD": { "title": "קול מחזיקי הדת", "hasTemplate": true },
								"MAD": { "title": "מחזיקי הדת", "hasTemplate": true },
								"DHY": { "title": "דואר היום", "hasTemplate": true },
								"AHR": { "title": "על המשמר", "hasTemplate": true },
								"HRT": { "title": "חרות", "hasTemplate": true },
								"HYT": { "title": "היינט", "hasTemplate": true },
								"HMD": { "title": "המודיע", "hasTemplate": true },
								"MRH": { "title": "מוריה", "hasTemplate": true },
								"TAS": { "title": "מגיד מישרים", "hasTemplate": true },
								"HMI": { "title": "המזרחי", "hasTemplate": true },
								"MZP": { "title": "המצפה", "hasTemplate": true },
								"HZH": { "title": "הצופה", "hasTemplate": true },
								"HAM": { "title": "העם", "hasTemplate": true },
								"DMT": { "title": "דער מאמענט", "hasTemplate": true },
								"PLB": { "title": "PalBull", "hasTemplate": true },
								"INF": { "title": "Information Juive", "hasTemplate": false },
								"HMF": { "title": "המשקיף", "hasTemplate": true },
								"UES": { "title": "אונזער אקספרעס", "hasTemplate": false },
								"CGS": { "title": "Chicago Sentinel", "hasTemplate": false },
								"HCL": { "title": "הכרמל", "hasTemplate": true },
								"HCR": { "title": "הכרמלֹ רוסית", "hasTemplate": false },
								"LTB": { "title": "ליטערארישע בלעטער", "hasTemplate": false },
							};
							if (pub in codes && codes[pub]["hasTemplate"])
								return codes[pub]["title"];
							else if (pub in codes)
								return [str, codes[pub]["title"], pub];
							else
								return [str, $.parseJSON($("span[data-json]").first().attr("data-json")).pubt, pub];
						}
					},
					{ str: '', func: function (str) { return window.prompt("שם מחבר", "") } },
					{ str: '', func: function (str) { return window.prompt("כותרת הדף (מובא מגרסת הטקסט האוטומטי)", $.parseJSON($("span[data-json]").first().attr("data-json")).n) } },
					{ str: '', func: function (str) { return $.parseJSON($("span[data-json]").first().attr("data-json")).href.match(/(\d+\/\d+\/\d+)/)[1]; } },
					{ str: '', func: function (str) { return $.parseJSON($("span[data-json]").first().attr("data-json")).cid.match(/(\d+)/)[1] } },
					{ str: '' },
					{ str: '' },
					{ str: '', defvalue: "Ar", func: function (str) { return $.parseJSON($("span[data-json]").first().attr("data-json")).cid.match(/^(\w+?)\d+/)[1] } },
				]
			},
			{
				hostname: "www.pc.co.il",
				params: [
					{ str: 'אנשים ומחשבים' },
					{ telem: "span.author a" },
					{ telem: ".post_header > h2:nth-child(2)" },
					[{ urlparam: 'p' }, { url: 1, match: /\/(\d+)\/$/ }],
					{ telem: "span.date", match: /(\d+ ב[א-ת]+ \d+)/ }
				]
			},
			{
				hostname: "shironet.mako.co.il", hrefmatch: /type=lyrics/,
				params: [
					{ str: 'שירונט שיר' },
					{ urlparam: 'wrkid' },
					{ urlparam: 'prfid' },
					{ telem: '.artist_song_name_txt' },
					{ urlparam: 'lang', defvalue: '1' },
				]
			},
			{
				hostname: "shironet.mako.co.il", hrefmatch: /type=works/,
				params: [
					{ str: 'שירונט' },
					{ urlparam: 'prfid', prefix: 'מספר=' },
					{ telem: 'h1', prefix: 'שם=' }
				]
			},
			/* currently no page available in this format
			{
		
				hostname: 'www.sciam.co.il', hrefmatch: /archive/,
				params:[
					{str : 'סיינטיפיק אמריקן'},
					{telem: '#post-' + location.href.match(/(\d+)/)[1], match: / \/ (.+)/},
					{telem: '#post-' + location.href.match(/(\d+)/)[1], match: /(.+) \//},
					{url:1, match: /(\d+)/},
					{telem: '.postinfo', match:/בתאריך (.+) בשעה/},
				]
			},
			*/
			{
				hostname: 'www.sciam.co.il', hrefmatch: /%/,
				params: [
					{ str: 'סיינטיפיק אמריקן' },
					{ telem: '.author-name' },
					{ telem: '.entry-title' },
					{ url: 1, match: /il\/(.+?)\// },
					{ telem: '.entry-date', date: '.' },
				]
			},
			{
				hostname: "ratings.fide.com",
				params: [
					{ str: 'כרטיס פיד"ה' },
					{ urlparam: 'event', prefix: '' },
				]
			},
			{
				hostname: "www.db.yadvashem.org",
				params: [
					{ str: 'חסיד אומות העולם' },
					{ url: 1, match: /&itemId\=(\d+)/ },
				]
			},
			{
				hostname: "www.yadvashem.org",
				params: [
					{ str: 'חסיד אומות העולם' },
					{ url: 1, match: /stories\/([a-z]+)/ },
					{ prefix: 'עברית=', str: 'כן' },
				]
			},
			{
				hostname: "www.boxofficemojo.com",
				params: [
					{ str: 'מוג\'ו' },
					{ urlparam: 'id', match: /(.*?)\.htm/ },
				]
			},
			{
				hostname: /article.yedioth?.co.il/,
				params: [
					{ str: 'ידיעות אחרונות' },
					{ telem: '#lblAuthor' },
					{ telem: '#lblTitle' },
					{ urlparam: 'articleid' },
					{ telem: '#lblDatePublished', date: '.' }
				]
			},
			{
				hostname: "www.0404.co.il",
				params: [
					{ str: '0404א' },
					{ telem: '.post_admin' },
					{ telem: '.stitle' },
					{ urlparam: 'p' },
					{ telem: '.post_date', date: '/' },
				]
			},
			{
				hostname: "www.ch10.co.il",
				params: [
					{ str: 'חרדים10' },
					{ telem: '.author' },
					{ telem: '.main-post h1 a' },
					{ url: 1, match: /news\/(\d+)/ },
					{ telem: '.date', date: '.' },
				]
			},
			{
				hostname: 'www.iaa-archives.org.il',
				params: [
					{ str: 'רשות העתיקות' },
					{ str: '{{ס:' + "שם הדף בלי הסוגריים}}" },
					{ url: 1, match: /loc_id\=(\d+)/ },
					{ url: 1, match: /\?id\=(\d+)/ },
				]
			},
			{
				hostname: /(tmi|www)\.maariv\.co\.il/,
				params: [
					{ str: 'מעריב אונליין' },
					[
						{ telem: 'span.article-reporter a' },
						{ telem: 'a[rel=Author]' },
						{ telem: '.article-date-report-wrap', match: /^.*\|(.*)$/m },
						{ telem: 'span.article-reporter' },
						{ telem: 'span.tmi-article-reporter' } // tmi articles
					],
					[
						{ telem: '.article-title' },
						{ telem: 'h1.tmi-article-title' }, // tmi articles
					],
					{ url: 1, match: /co\.il\/(.*)/ },
					[
						{ telem: '.article-date-time, .article-he-date', date: '/' },
						{ telem: '.article-date-report-wrap', date: '/' },
						{ telem: '.article-publish-date', date: '/' },
						{ telem: 'div.tmi-article-reporter-date', date: '/'}, // tmi articles
					],
				]
			},
			{
				hostname: "www.onlife.co.il",
				params: [
					{ str: 'onlife' },
					{ telem: '.status a' },
					[{ telem: '.cafe_title' }, { attr: ["meta[name='dc.title']", "content"] }],
					{ url: 1, match: /www\.onlife\.co\.il\/(.*)$/ },
					{ telem: '.status em', date: '.' },
				]
			},
			{
				hostname: "davidson.weizmann.ac.il", hrefmatch: /online/,
				params: [
					{ str: 'דוידסון' },
					{ telem: 'span.name' },
					{ attr: ['meta[property="og:title"]', 'content'] },
					{ url: 1, match: /davidson\.weizmann\.ac\.il\/online\/(.*)$/ },
					{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] },
				]
			},
			{
				hostname: "alaxon.co.il",
				params: [
					{ str: 'אלכסון' },
					{ telem: '.author' },
					{ telem: 'h1' },
					{ url: 1, match: /alaxon\.co\.il\/(.*)$/ },
					{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] },
				]
			},
			{
				hostname: "www.gvura.org",
				params: [
					{ str: 'אתר הגבורה' },
					{ telem: 'h1' },
					{ attr: ['input[name=hdaid]', 'value'] },
				]
			},
			{
				hostname: "www.srugim.co.il",
				params: [
					{ str: 'סרוגים' },
					{ telem: '.post_author', match: /(.+?)\d/, remove: [', חדשות סרוגים', 'חדשות סרוגים'] },
					{ telem: 'h1' },
					{ url: 1, match: /\.srugim\.co\.il\/(.*)$/ },
					{ telem: '.post_details', date: '.' },
				]
			},
			{
				hostname: 'otzar.org',
				params: [
					{ str: 'אוצר החכמה' },
					[
						{ urlparam: 'book', func: function(bookid){
							if (!bookid) try{bookid = $('#book-iframe').attr('src').match(/book=(\d+)/)[1]}catch{}
							if (bookid && location.hostname == 'tablet.otzar.org' ) {
								window.detail_data = 
									$.parseJSON($.post({url:'//tablet.otzar.org/he/php/detailBook.php', async: false,
										data:'{"ParamQuery":"{\\"NUMBOOK\\":\\"'+bookid+'\\",\\"USERDATAID\\":0}","sqlFile":"selectSubOfBook"}'}
									).responseText).arr[0];
							} else if (window.booknameS && window.authorS){
								bookid = bookid || window.bookid;
								window.detail_data = {
									AUTHOR: authorS,
									FULLNAME: booknameS,
									bookid: bookid,
								}
							} else {
								bookid = bookid || window.bookid;
								var parts = $('title').text().replace('  - אוצר החכמה','').split('/');
								window.detail_data = {
									AUTHOR: parts[1],
									FULLNAME: parts[0],
									YEAR: parts[2],
									PrintedP_AND_YEAR: parts[0].split('-')[1],
									bookid: bookid,
								}
							}
						}}, // TODO: hack to have all the info ready in tablet page
						{ var: ['detail_data', 'AUTHOR']},
					],
					{ var: ['detail_data','FULLNAME']},
					{ var: ['detail_data','bookid']},
					[
						{ var: ['detail_data', 'PrintedP_AND_YEAR']},
						{ func: function () {
							return [
								window.detail_data['PrintedP'].match(/[\u0590-\u05FF ]+/)[0],
								window.detail_data['YEAR'],
							].join(' ')
						}},
						{ var: ['detail_data', 'YEAR']},
					],
					{ str: '' },
					[
						{ attr: ["ab", "value"], match: /^([^ ]*) /, prefix: 'עמוד=' },
						{ elem: ["#ab", "val"], prefix: 'עמוד=', match: /^(\d+) / },
						{ urlparam: 'pagenum', prefix: 'עמוד=' }
					],
				]
			},
			{
				hostname: "www.davar1.co.il",
				params: [
					{ str: 'דבר ראשון' },
					{ attr: ['section', 'data-author_name'] },
					{ telem: '.headline' }, // it might be {attr:['section', 'data-article_title']},
					{ url: 1, match: /www\.davar1\.co\.il\/(\d+)/ },
					{ attr: ['meta[itemprop="dateCreated"]', 'content'], date: '.' },
				]
			},
			{
				hostname: "www.youtube.com", hrefmatch: /youtube\.com\/watch\?v=.*/i,
				params: [
					{ str: "יוטיוב" },
					{ urlparam: "v" },
					{ telem: "h1", prefix: "שם=" },
					{ telem: ".ytp-time-duration", prefix: "אורך=" },
				]
			},
			{
				hostname: "www.forbes.co.il",
				params: [
					{ str: "פורבס" },
					{ telem: "#divforprint td.date", match:/.*\|(.*)$/ },
					{ telem: "h1.newsTitle"},
					{ url:1, match:/\?(.*)$/, prefix:'3=' },
					{ telem: "#divforprint td.date", date:'/' , prefix:'4='},
				]
			},
			{
				hostname: "supremedecisions.court.gov.il",
				params: [
					[	
						{func:function(){
							var f = function(body_j, head_j){
								window.body_j = body_j; // just for debug
								window.head_j = head_j; // just for debug
								window.all_text = body_j.text();
								if (!window.all_text)
									return
								window.parsed_data = {
									OTTER:
										body_j.find('td:contains("העותר:"):first + td:first').first().text() ||
										body_j.find('td:contains("העותרת:"):first + td:first').first().text() ||
										body_j.find('td:contains("המערער:"):first + td:first').first().text() ||
										body_j.find('td:contains("המערערת:"):first + td:first').first().text() ||
										body_j.find('td:contains("המבקש:"):first + td:first').first().text()||
										body_j.find('td:contains("המבקשת:"):first + td:first').first().text(),
									MESHIV:
										body_j.find('td:contains("המשיב:"):first + td:first').first().text() ||
										body_j.find('td:contains("המשיבה:"):first + td:first').first().text(),
									OTTERS:
										head_j.find('meta[name="side_nm"]').map(function(m){
											return head_j.find('meta[name="side_ty"]:eq('+m+')').attr('content') == "תביעה" ? [
													$(this).attr('content')
											] : []
										}).toArray(),
								}
								if (window.parsed_data.OTTERS && !window.parsed_data.OTTER){
									window.parsed_data.OTTER = (window.parsed_data.OTTERS.length > 1) ?
									(window.parsed_data.OTTERS[0] + ' ואחרים') :
									(window.parsed_data.OTTERS[0])
								}
							}
							if (!window.all_text){
								f($('body'), $('head'));
							}
							if (!window.all_text){
								var xhr = new XMLHttpRequest();
								xhr.open('GET', location.href.replace('type=4','type=2'), true);
								xhr.responseType = 'arraybuffer';
								xhr.onload = function(e) {
									if (this.status == 200) {
										console.log('this.response', this.response, this)
										var jo;
										if (new Uint8Array(this.response).indexOf(0) < 0){
											var text = new TextDecoder("windows-1255").decode(this.response)
										} else {
											var text = new TextDecoder("UTF-16LE").decode(this.response)
										}
										var head_as_div = '<div id="head>'+text.replace(/^[\s\S]*<head.*?>|<\/head>[\s\S]*$/ig, '')+'</div>';
										var body_as_div = '<div id="body>'+text.replace(/^[\s\S]*<body.*?>|<\/body>[\s\S]*$/ig, '')+'</div>';
										f($(body_as_div), $(head_as_div))
										if (window.all_text)
											wikiit(undefined, 1);
									} else {
										window.all_text = 'Error! ' + this.status
									}
								};
								window.popup_template_canceled = true;
								xhr.send();
							}
						}}, //TODO: trick to have all the text
						{ str: "פס\"ד עליון" },
					],
					{ prefix:'קישור=', urlparam: 'fileName'},
					{ prefix:'סוג=', var: 'all_text', match: /([^\s]+?)\s+\d+\/\d+/sm},
					[
						{ prefix:'עותר=', var:['parsed_data', 'OTTER']},
						{ prefix:'עותר=', var: 'all_text', match: /המבקש(?:ים|ות)\:\s*1\.(.+?)2\./ms, func:function(s){return s && (s+' ואחרים')}},
						{ prefix:'עותר=', var: 'all_text', match: /העותר(?:ים|ות)\:\s*1\.(.+?)2\./ms, func:function(s){return s && (s+' ואחרים')}},
						{ prefix:'עותר=', var: 'all_text', match: /המערער(?:ים|ות)\:\s*1\.(.+?)2\./ms, func:function(s){return s && (s+' ואחרים')}},
					],
					[
						{ prefix:'משיב=', var:['parsed_data', 'MESHIV']},
						{ prefix:'משיב=', var: 'all_text', match: /המשיב(?:ים|ות).*?1\.(.+?)2\./ms, func:function(s){return s && (s+' ואחרים')}},
					],
					[
						{ prefix:'ניתן ב=', var: 'all_text', match: /ניתן\s+היום,.*?\((.*?)\)/ms, date:'.'}, // https://supremedecisions.court.gov.il/Home/Download?path=HebrewVerdicts\11/850/019/o24&fileName=11019850.o24&type=4
						/*{ prefix:'ניתן ב=', var: 'all_text', match: /תאריך הישיבה:.*?(\d+\.\d+\.\d+)/ms, date:'.'},*/
					]
				]
			},
			{
				hostname: "www.colbonews.co.il",
				params: [
					{str:'כלבו'},
					{telem:'#post_author', remove:['מאת:']},
					{url:1, match:/www\.colbonews\.co\.il\/(.*)\/$/},
					{telem:'#post_h1'},
					{telem:'#post_time', date:'.'},
				]
			}		
		];
		for (var i = 0; i < data.length; i++) {
			if (
				location.hostname.match(data[i].hostname)
				&& (!data[i].hrefmatch || location.href.match(data[i].hrefmatch))
				&& (!data[i].condition || data[i].condition())
			) {
				var params = [];
				for (var j = 0; j < data[i].params.length; j++) {
					if (!(data[i].params[j] instanceof Array)) {
						data[i].params[j] = [data[i].params[j]];
					}
					for (var k=0; k < data[i].params[j].length; k++) {
						try {
							var curParam = data[i].params[j][k];
							params[j] = '';
							if (typeof curParam.str != "undefined") {
								params[j] = curParam.str;
							} else if (typeof curParam.url != "undefined") {
								params[j] = location.href;
								if (curParam.url == 'decodeURIComponent')
									params[j] = decodeURIComponent(params[j])
								else if (curParam.url == 'decodeURI')
									params[j] = decodeURI(params[j])
							} else if (typeof curParam.attr != "undefined"){
								params[j] = jQuery('html').find(curParam.attr[0]).attr(curParam.attr[1]);
							} else if (typeof curParam.var != "undefined") {
								if (!(curParam.var instanceof Array))
									curParam.var = [curParam.var]
								params[j] = window;
								for (var v in curParam.var) {
									params[j] = params[j][curParam.var[v]]
									//console.log(v, params[j], curParam.var[v])
									if (!params[j])
										break
								}
								if (params[j] == window)
									params[j] = undefined
							}
							else if (typeof curParam.urlparam != "undefined") {
								params[j] = getParameterByName(curParam.urlparam) || "";
							} else if (typeof curParam.elem != "undefined") {
								if (curParam.elem instanceof Array) {
									params[j] = jQuery('html').find(curParam.elem[0]);
									for (var elemIdx = 1; elemIdx < curParam.elem.length; elemIdx++) {
										var func = curParam.elem[elemIdx].split(',');
										params[j] = (func.length > 1) ? params[j][func[0]](func[1]) : params[j] = params[j][func[0]]();
									}
									if (typeof (params[j]) != "string")
										params[j] = params[j].html();
								}
								else
									params[j] = jQuery('html').find(curParam.elem).html();
							}
							else if (typeof curParam.first_text_node != "undefined"){
								params[j] = jQuery('html').find(curParam.first_text_node).contents().filter(function () { return this.nodeType === 3 }).text()
							} else if (typeof curParam.elements != "undefined" || (typeof curParam.telements != "undefined")) {
								var sep;
								if (typeof curParam.elements != "undefined"){
									params[j] = jQuery('html').find(curParam.elements[0]).map(function (el) { return $(this).html(); }).toArray()
									sep = curParam.elements[1];
								}
								if (typeof curParam.telements != "undefined"){
									params[j] = jQuery('html').find(curParam.telements[0]).map(function (el) { return $(this).text(); }).toArray().join(curParam.telements[1]);
									sep = curParam.telements[1];
								}
								if (sep != 'ו '){ // hack for VE
									params[j] = params[j].join(sep);
								} else {
									if (params[j].length > 2){
										params[j] = [params[j].slice(0,-1).join(', '), params[j].slice(-1)].join(sep);
									} else {
										params[j] = params[j].join(sep);
									}
								}
							}
							else if (typeof curParam.telem != "undefined") {
								params[j] = jQuery('html').find(curParam.telem).first().text().trim();
							}

							if (typeof curParam.match != "undefined") {
								if (!(curParam.match instanceof Array))
									params[j] = match(params[j], curParam.match);
								else for (var patIdx = 0; patIdx < curParam.match.length; patIdx++) {
									temp = match(params[j], curParam.match[patIdx]);
									if (temp != '') {
										params[j] = temp;
										break;
									}
								}
							}


							if (typeof curParam.remove != "undefined")
								for (var removeIdx = 0; removeIdx < curParam.remove.length; removeIdx++)
									params[j] = params[j].replace(curParam.remove[removeIdx], "");

							if (typeof curParam.split != "undefined")
								params[j] = params[j].split(curParam.split);


							if (typeof curParam.func != "undefined") {
								if (!(curParam.func instanceof Array))
									curParam.func = [curParam.func];
								for (var funcIdx = 0; funcIdx < curParam.func.length; funcIdx++) {
									params[j] = curParam.func[funcIdx](params[j]);
								}
							}
							if (typeof curParam.date != "undefined") {
								if (!(curParam.date instanceof Array))
									curParam.date = [curParam.date, [0,1,2]];
								var sep = curParam.date[0].replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
								params[j] = match(params[j], RegExp(('(\\d+' + sep + '\\d+' + sep + '\\d+)')))
								if (params[j]){
									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] = dateFormat(params[j]);
								}
							}
							if (typeof params[j] == "string") {
								params[j] = jQuery.trim(decodeURIComponent(params[j].replace(/&nbsp;|\u202B-\u202d/gm, " ").replace(/\s+/gm, ' '))
									.replace(/=/g, "{{=}}")
									.replace(/(\|\|?)/gm, function (x) { return "{{" + x.replace(/\|/g, "!") + "}}" }));
							}
							else if (jQuery.isArray(params[j])) {
								params[j] = jQuery.trim(params[j].join("|"));
							}

							if (params[j] && typeof curParam.prefix != "undefined")
								params[j] = curParam.prefix + params[j];

							if (typeof curParam.defvalue != "undefined" && params[j] == curParam.defvalue)
								params[j] = '';

							if (typeof curParam.shouldnt != "undefined" && typeof params[j] == "string" && params[j].match(curParam.shouldnt))
								params[j] = '';


							if ((params[j] != '') && (params[j] != undefined)) {
								console.log('found', j, params[j])
								break;
							}
							console.log('not found', j, curParam)
						}
						catch (e) {
							console.error(e)
						}
					}
				}


				var minimum = (typeof data[i].minimum != "undefined") ? (data[i].minimum) : (0);

				while (params[params.length - 1] == "" && params.length > minimum) //remove all last empty params
					params.pop();


				if (window.popup_template_canceled && !force_popup){
					console.log('popup_template_canceled');
				} else {
					prompt("העתק תבנית זו:", '{{' + params.join('|') + '}}');
					window.popup_template_canceled = false;
				}
				return
			}
		}

		alert("אתר או עמוד זה אינו נתמך על ידי הבוקמרקלט.");
	}
	(function () {
		if (typeof (jQuery) != "undefined")
			window.$ = jQuery;
		var s = document.createElement('script');
		s.setAttribute('src', "https://he.wikipedia.org/w/load.php?modules=jquery&only=scripts");
		s.onload = wikiit;
		document.getElementsByTagName('body')[0].appendChild(s);
	})();