מעדיעוויקי:BookmarkletsInit.js

פון המכלול
קפיצה לניווט קפיצה לחיפוש

אַכטונג: נאכן היטן, ברויכט איר אפשר נאך אויסקרויזן דעם בראוזער'ס זאַפאַס צו זען די ענדערונגען.

  • פייערפוקס/סאפארי: האלט אראפ שיפט בשעת'ן דרוקן Reload, אדער דרוקט Ctrl-F5 אדער Ctrl-R (אויף א מאקינטאש ⌘-R)
  • גוגל כראם: דרוקט Ctrl-Shift-R (אויף א מאקינטאש ⌘-Shift-R)
  • אינטערנעט עקספלארער: האלט אראפ Ctrl בשעת'ן קליקן Refresh, אדער דרוקט Ctrl-F5
  • אפערע: גייט צו מעניו → שטעלונגען ( אפערע → פרעפערנצן אויף א מעק) און דערנאך צו פריוואטקייט & און זיכערהייט → רוימען בראוזער דאטא → בילדער און טעקעס אין זאפאס
function create_bookmarklets() {
    var stubparts = [
		"javascript:(function(){if(typeof(", 
		")=='undefined'){var s=document.createElement('script');s.setAttribute('src','//yi.hamichlol.org.il/w/index.php?title= ",
		"&action=raw&maxage=3600&ctype=text/javascript&dontcountme=s');document.getElementsByTagName('body')[0].appendChild(s);}else ",
		"();})()"
	];
	var bookmarklets = [
		{func: 'wikiit', sourcepage: 'Mediawiki:Common.js/externalsmaker.js'  , name: 'המכלול מוסטער', description: 'שאַפן א לינק מוסטער פון אַרטיקלען אויף דרוק זייטלעך ("היברובוקס", JDN, "בחדרי" און נאך): ', autoupdate: true},
		{func: 'coords', sourcepage: 'Mediawiki:Common.js/coords.js', name: 'coord מוסטער', description: 'שאפן א coord מוסטער פון א גוגל מאַפּע אדער קלאוד עמוד (זעט אנווייזונגען אונטן): ', autoupdate: true},
		{func: 'twitlink', specifiedcode: 'javascript:var getxDate = function() { var times = document.querySelectorAll(\'article[data-testid] time\'), m = ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], date; for (var i=0;i<times.length;++i) { if (times[i].parentNode.nodeName==\'A\') { date=new Date(times[i].getAttribute(\'datetime\')); return date.getDate() + " ב" + m[date.getMonth()] + " " + date.getFullYear();} } },loc=window.location.href.split(\'/\');navigator.clipboard.writeText("{{ציוץ|" + loc[3] + "|" + document.querySelector(\'meta[property="og:title"]\').content.replace(/( on X|\\n).*/g, \'\').replace(\'|\', \'{{!}}\')+ "|" +loc[5]+ "|" + getxDate() + "}}")', name: 'תבנית ציוץ', description: 'יצירת תבנית ציוץ עבור X (לשעבר טוויטר): ', lastupdate: '15 בדצמבר 2023'},
		{func: 'wikilibrary', specifiedcode: 'javascript:void(location.href="https://login.wikipedialibrary.idm.oclc.org/login?url="+location.href)', name: 'דורך Wikilibrary', description: 'עפענען לינק דורך Wikipedia Library: ', lastupdate: '15 בדצמבר 2023'}
	];
	var $ol = $("#bmList ol:first");
	$ol.contents().remove();
	$(bookmarklets).each(function(idx, item){
		$("<li>").text(item.description)
		.append(
			$("<a>",
				{
					"href": item.sourcepage ? (stubparts[0] + item.func + stubparts[1]+ item.sourcepage + stubparts[2] + item.func + stubparts[3]) : item.specifiedcode,
					"click": bookmarlets_wrong,
					"text" : item.name
				}
			)
		).append(
			$("<span>",
				{
					"text": ' (' + (item.autoupdate ? 'מתעדכן אוטומטית' : ('עודכן לאחרונה ב-' + item.lastupdate)) + ')'
				}
			)
		).appendTo($ol);
	});
	function bookmarlets_wrong(e)
	{
		e.preventDefault();
		alert('מען ברויך שלעפּן דעם לינק צום בוקמארק באַר, און אַקטיווירן אויף די פּאַסיגע זייטלעך.\nדי לינק איז נישט געמאכט צו דרוקן פון המכלול. פאר מער אינפארמאציע ליינט די אנווייזונגען אין בלאַט.');
	}
}

$(create_bookmarklets);