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

פון המכלול
קפיצה לניווט קפיצה לחיפוש
(אימפארטירט פון די העברעאישע המכלול, זע ביישטייערער ליסטע)
 
(אפדעיט)
 
(7 מיטלסטע ווערסיעס פון 2 באַניצער נישט געוויזן.)
שורה 2: שורה 2:
     var stubparts = [
     var stubparts = [
"javascript:(function(){if(typeof(",  
"javascript:(function(){if(typeof(",  
")=='undefined'){var s=document.createElement('script');s.setAttribute('src','//https://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 ",
"();})()"
"();})()"
];
];
var bookmarklets = [
var bookmarklets = [
{func: 'wikiit', sourcepage: 'Mediawiki:Common.js/externalsmaker.js'  , name: 'תבנית למכלול', description: 'יצירת תבנית קישור ממאמרים באתרי עיתונות ("הארץ", nrg, ynet ועוד): '},
{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 ממפה של גוגל או עמוד ענן (ראו הוראות למטה): '}
{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");
var $ol = $("#bmList ol:first");
שורה 17: שורה 19:
$("<a>",
$("<a>",
{
{
"href": stubparts[0] + item.func + stubparts[1]+ item.sourcepage + stubparts[2] + item.func + stubparts[3],
"href": item.sourcepage ? (stubparts[0] + item.func + stubparts[1]+ item.sourcepage + stubparts[2] + item.func + stubparts[3]) : item.specifiedcode,
"click": bookmarlets_wrong,
"click": bookmarlets_wrong,
"text" : item.name
"text" : item.name
}
}
)
)
).appendTo($ol)
).append(
$("<span>",
{
"text": ' (' + (item.autoupdate ? 'מתעדכן אוטומטית' : ('עודכן לאחרונה ב-' + item.lastupdate)) + ')'
}
)
).appendTo($ol);
});
});
function bookmarlets_wrong(e)
function bookmarlets_wrong(e)
{
{
e.preventDefault();
e.preventDefault();
alert('את הקישור יש לגרור לסרגל המועדפים, ולהפעיל באתרים המתאימים.\nקישור זה לא מיועד להפעלה מתוך המכלול. למידע נוסף קראו את ההוראות בדף.');
alert('מען ברויך שלעפּן דעם לינק צום בוקמארק באַר, און אַקטיווירן אויף די פּאַסיגע זייטלעך.\nדי לינק איז נישט געמאכט צו דרוקן פון המכלול. פאר מער אינפארמאציע ליינט די אנווייזונגען אין בלאַט.');
}
}
}
};


$(create_bookmarklets);
$(create_bookmarklets);

יעצטיגע רעוויזיע זינט 00:36, 10 יאנואר 2024

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);