מדיה ויקי:Gadget-CiteTooltip.js: הבדלים בין גרסאות בדף

מתוך צפונות ויקי
(←‏using [[mw:CodeEditor|CodeEditor]]: כשההערה ברבע השמאלי של המסך, להסיט ימינה כדי למנוע חריגה.)
(אוטומציה גם ב-ew וגם ב-ns)
שורה 1: שורה 1:
if (wgAction == 'view')
if (wgAction == 'view')
mw.loader.using('jquery.tipsy', function() {
mw.loader.using('jquery.tipsy', function() {
שורה 7: שורה 6:
},
},
gravity = function() {
gravity = function() {
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 4) ? 'n' : 'nw';
return  
($(this).offset().top > ($(document).scrollTop() + $(window).height() -80) ? 's' : 'n') +
($(this).offset().left > ($(document).scrollLeft() + $(window).width() / 4) ? '' : 'w');
},
},
tipsyParams = {html: true, delayOut: 1500, delayIn: 300, fade: true, opacity: 1, gravity: gravity, title: createHint};
tipsyParams = {html: true, delayOut: 1500, delayIn: 300, fade: true, opacity: 1, gravity: gravity, title: createHint};

גרסה מ־18:35, 3 בפברואר 2012

if (wgAction == 'view')
mw.loader.using('jquery.tipsy', function() {
	var 
		createHint = function() {
			return $($.escapeRE(this.href.replace(/.*#/, '#'))).html();
		},
		gravity = function() {
			return 
				($(this).offset().top > ($(document).scrollTop() + $(window).height() -80) ? 's' : 'n') +
				($(this).offset().left > ($(document).scrollLeft() + $(window).width() / 4) ? '' : 'w');
		},
		tipsyParams = {html: true, delayOut: 1500, delayIn: 300, fade: true, opacity: 1, gravity: gravity, title: createHint};
		
	$(function() {$('sup.reference a').tipsy(tipsyParams);});
});