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

פון המכלול
קפיצה לניווט קפיצה לחיפוש
אין תקציר עריכה
אין תקציר עריכה
שורה 2: שורה 2:
     var stubparts = [
     var stubparts = [
"javascript:(function(){if(typeof(",  
"javascript:(function(){if(typeof(",  
")=='undefined'){var s=document.createElement('script');s.setAttribute('src','//yi.hamichlol.org.il//w/index.php?title= ",
")=='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 ",
"&action=raw&maxage=3600&ctype=text/javascript&dontcountme=s');document.getElementsByTagName('body')[0].appendChild(s);}else ",
"();})()"
"();})()"

רעוויזיע פון 08:39, 19 פעברואר 2023

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, nrg, ynet ועוד): '},
		{func: 'coords', sourcepage: 'Mediawiki:Common.js/coords.js', name: 'coord מוסטער', description: 'יצירת תבנית coord ממפה של גוגל או עמוד ענן (ראו הוראות למטה): '}
	];
	var $ol = $("#bmList ol:first");
	$ol.contents().remove();
	$(bookmarklets).each(function(idx, item){
		$("<li>").text(item.description)
		.append(
			$("<a>",
				{
				"href": stubparts[0] + item.func + stubparts[1]+ item.sourcepage + stubparts[2] + item.func + stubparts[3],
				"click": bookmarlets_wrong,
				"text" : item.name
				}
			)
		).appendTo($ol)
	});
	
	function bookmarlets_wrong(e)
	{
		e.preventDefault();
		alert('את הקישור יש לגרור לסרגל המועדפים, ולהפעיל באתרים המתאימים.\nקישור זה לא מיועד להפעלה מתוך המכלול. למידע נוסף קראו את ההוראות בדף.');
	}
	
};

$(create_bookmarklets);