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

תוכן שנמחק תוכן שנוסף
Ladsgroup (שיחה | תרומות)
מ Maintenance: Replacing legacy global variable (phab:T72470)
Jon (WMF) (שיחה | תרומות)
<maintenance> phab:T336019 jquery.tipsy will be removed from MediaWiki core
תגית: שוחזרה
שורה 804:
'#headertemplate':"position:absolute; top:0em; right:-23em; width:21em;float:right; text-align:left;"
};
 
 
 
/* תבנית גימטריה - נכתבה ע"י קיפודנחש */
"use strict"
$(function() {
if ($('.gim-calc, .gim-product .gim-factor').length)
mw.loader.using('jquery.tipsy', function() {
var gimvals = {'א': 1, 'ב': 2, 'ג': 3, 'ד': 4, 'ה': 5, 'ו': 6, 'ז': 7, 'ח': 8, 'ט': 9, 'י': 10, 'כ': 20, 'ך': 20, 'ל': 30, 'מ': 40, 'ם': 40, 'נ': 50, 'ן': 50, 'ס': 60, 'ע': 70, 'פ': 80, 'ף': 80, 'צ': 90, 'ץ': 90, 'ק': 100, 'ר': 200, 'ש': 300, 'ת': 400},
smallgimvals={'א':1,'ב':2,'ג':3,'ד':4,'ה':5,'ו':6,'ז':7,'ח':8,'ט':9,'י':1,'כ':2,'ך':2,'ל':3,'מ':4,'ם':4,
'נ':5,'ן':5,'ס':6,'ע':7,'פ':8,'ף':8,'צ':9,'ץ':9,'ק':1,'ר':2,'ש':3,'ת':4},
tipsyParams = {
title: function() {
function gimatria(str, small) {
var tar = str.split(''),
sum = 0;
for (var ind in tar)
sum += (small ? (smallgimvals[tar[ind]] || 0) : (gimvals[tar[ind]] || 0));
return sum;
}
function trim(str) {
return str.substr(0, 100) + (str.length > 100 ? '...' : '');
}
var $this = $(this),
product = $this.hasClass('gim-factor'),
is_smallgim = $this.hasClass('smallgim');
if (product) {
var factors = $this.closest('.gim-product').find('.gim-factor'),
prod = 1,
desc = [],
glue = $('<span>').append($('<p>').text('בגימטריה כפול')).html();
factors.each(function() {
var t = $(this).text(),
fact = gimatria(t, false),
p = $('<p>').css({fontWeight: 'bold', border: 'solid red 1px'});
p.text(t + ' (' + fact + ')');
prod *= fact;
desc.push($('<span>').append(p).html());
});
return ('הערך של'
+ desc.join(glue)
+ 'בגימטריה הוא: '
+ prod
);
} else {
var str = $this.text();
return (
'הערך של <p style="font-weight:bold; border: solid red 1px;">'
+ trim(str)
+'</p> בגימטריה'
+(is_smallgim? ' קטנה ': ' ' )
+ 'הוא: '
+ gimatria(str, is_smallgim)
);
}
},
gravity: function() {
var loc =
($(this).offset().top > ($(document).scrollTop() + $(window).height() - 120) ? 's' : 'n') +
($(this).offset().left > ($(document).scrollLeft() + $(window).width() / 4) ? '' : 'w');
return loc;
},
html: true,
delayOut: 150,
delayIn: 150,
fade: true, opacity: 1,
};
$('.gim-calc, .gim-product .gim-factor').tipsy(tipsyParams);
});
});
 
/*