הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
- אופרה: ללחוץ על Ctrl-F5.
// Load jQuery from CDN if it isn’t already loaded
if (typeof jQuery === 'undefined') {
mw.loader.load('https://code.jquery.com/jquery-3.6.0.min.js');
}
// Load CanvasJS from CDN
mw.loader.load('https://canvasjs.com/assets/script/jquery.canvasjs.min.js');
var isInitedPageScripts = false;
function onInitMaccabipediaPage() {
var elPageContent = $('.mw-body-content');
initIndexSlider(elPageContent);
// initIndexChartTest(elPageContent);
initImagesSlider(elPageContent);
initLongTextTeaser(elPageContent);
initVBGamePageOpponentNameTabChange(elPageContent);
initShirtsListOnTabChange(elPageContent);
isInitedPageScripts = true;
}
function initIndexChartTest(elPageContent) {
var options = {
animationEnabled: true,
title: {
text: "GDP Growth Rate - 2016"
},
axisY: {
title: "Growth Rate (in %)",
suffix: "%"
},
axisX: {
title: "Countries"
},
data: [{
type: "column",
yValueFormatString: "#,##0.0#"%"",
dataPoints: [
{ label: "Iraq", y: 10.09 },
{ label: "Turks & Caicos Islands", y: 9.40 },
{ label: "Nauru", y: 8.50 },
{ label: "Ethiopia", y: 7.96 },
{ label: "Uzbekistan", y: 7.80 },
{ label: "Nepal", y: 7.56 },
{ label: "Iceland", y: 7.20 },
{ label: "India", y: 7.1 }
]
}]
};
$("#chartContainer").CanvasJSChart(options);
}
function initIndexSlider(elPageContent) {
elPageContent.find('.mp-index-slider-container').slick({
autoplay: true,
arrows: false,
dots: true,
infinite: true,
autoplaySpeed: 10000,
rtl: true
});
}
function initImagesSlider(elPageContent) {
elPageContent.find('.mp-image-slider-container').slick({
autoplay: false,
lazyLoad: false,
dots: true,
fade: false,
infinite: true,
rtl: true
});
}
function initLongTextTeaser(elPageContent) {
var elsLongTextTeaser = elPageContent.find('.atom-long-text-teaser');
elsLongTextTeaser.each(function (index, element) {
function longTextTeaserCtaButtonTextAdjust(){
if ($(element).hasClass('collapsed')){
$(element).find('.cta-button-container').text('קרא עוד');
} else {
$(element).find('.cta-button-container').text('צמצם טקסט');
}
}
longTextTeaserCtaButtonTextAdjust();
$(element).find('.controller').on('click', function (ev) {
ev.stopPropagation();
$(element).toggleClass('collapsed');
longTextTeaserCtaButtonTextAdjust();
});
});
}
function initVBGamePageOpponentNameTabChange(elPageContent){
var elsVBGameTabs = elPageContent.find('.vbgame-details-team-statistic-container nav a');
var elVBGameTeams = elPageContent.find('.vbgame-banner-team-container .vbgame-banner-team-name');
var vbGameOpponentName = undefined;
elVBGameTeams.each(function (index) {
var vbGameTeamName = $(this).text();
if (vbGameTeamName !== 'מכבי תל אביב') {
vbGameOpponentName = vbGameTeamName;
}
})
elsVBGameTabs.each(function (index) {
var elVBGameCurrentTabText = $(this).text();
if (elVBGameCurrentTabText === 'יריבה') {
$(this).text(vbGameOpponentName);
}
})
}
function initShirtsListOnTabChange(elPageContent){
var elsShirtsListTabs = elPageContent.find('.shirts-navigation-tab-container li');
elsShirtsListTabs.each(function (index, element) {
$(element).on('click', function () {
setTimeout(function () {
elPageContent.find('.mp-image-slider-container').slick('refresh');
}, 100);
});
});
}
$(document).ready(function () {
setTimeout(function () {
while (!isInitedPageScripts) {
onInitMaccabipediaPage();
}
}, 50);
});
/* Simple counters bumper */
$(document).ready(function () {
var elCounters = $('.bumping-counter')
elCounters.each(function (index) {
var elCurrCounter = elCounters[index]
function formatNumber(number) {
return new Intl.NumberFormat('en-US').format(number)
}
function animateCounter() {
var counterBumpSpeed = 8
var currCounterValue = +elCurrCounter.innerText
var currCounterDestination = +elCurrCounter.getAttribute('data-destination')
var currCounterSpeed = elCurrCounter.getAttribute('data-speed')
switch (currCounterSpeed) {
case 'extra-slow':
counterBumpSpeed = 1000
break
case 'slow':
counterBumpSpeed = 500
break
case 'regular':
counterBumpSpeed = 200
break
case 'fast':
counterBumpSpeed = 100
break
case 'extra-fast':
counterBumpSpeed = 50
break
default:
counterBumpSpeed = 200
}
var currCounterTime = currCounterDestination / counterBumpSpeed
if (currCounterValue < currCounterDestination) {
elCurrCounter.innerText = formatNumber(Math.ceil(currCounterValue + currCounterTime))
setTimeout(animateCounter, 100)
} else {
elCurrCounter.innerText = formatNumber(currCounterDestination)
}
}
animateCounter()
})
})
/* Expand/Collapse paragraph | Feb 2024 */
$('.simple-styled-paragraph h3, .entity-profile h3').on('click', function (ev) {
ev.stopPropagation()
$(this).toggleClass('close')
var elClossablePart = $(this).siblings('.text, .profile-container')
elClossablePart.toggle('fast', 'linear')
})
/* Expand/Collapse TOC | Feb 2024 */
$('.atom-toc').on('click', function (ev) {
$(this).toggleClass('active')
})
$(document).mouseup(function (e) {
var elTOCcontainer = $('.atom-toc');
if (!elTOCcontainer.is(e.target) && elTOCcontainer.has(e.target).length === 0) {
elTOCcontainer.removeClass('active')
}
})
/* sending mails (fanzine) */
function sendMail() {
var data = {
service_id: 'service_vxigmjz',
template_id: 'template_2nrbvsd',
user_id: 'V1S5vDtbtB7zZxrSP',
template_params: {
'username': 'James',
'g-recaptcha-response': '03AHJ_ASjnLA214KSNKFJAK12sfKASfehbmfd...'
}
};
$.ajax('https://api.emailjs.com/api/v1.0/email/send', {
type: 'POST',
data: JSON.stringify(data),
contentType: 'application/json'
}).done(function () {
alert('Your mail is sent!');
}).fail(function (error) {
alert('Oops... ' + JSON.stringify(error));
});
}
$('#fanzine-conact').submit(function (event) {
event.preventDefault();
sendMail();
});
/* כל הסקריפטים שנכתבים כאן ייטענו עבור כל המשתמשים בכל טעינת עמוד. */
/* הצגת ערכים הנטענים באופן דינמי */
mw.loader.using('mediawiki.legacy.wikibits', function () {
importScript('MediaWiki:LoadingContent.js');
});
function escapeSelector(s) {
return s.replace(/(:|\.|\[|\])/g, "\\$1");
}
/* --- Jump to ID - Handle links with @href started with '#' only --- */
/* Last update by Shlomi */
$(document).on('click', 'a[href^="#"]', function (e) {
// target element id
var id = $(escapeSelector($(this).attr('href')));
// target element
var $id = $(id);
if ($id.length === 0) {
return;
}
// prevent standard hash navigation (avoid blinking in IE)
e.preventDefault();
// top position relative to the document
var pos = $id.offset().top - 50;
// animated top scrolling
$('body, html').animate({ scrollTop: pos }, 950);
});
/* --- Functions for top-menu (by Shlomi, 02/09/2017) --- */
/* Last update by Shlomi (26/09/2017) */
$(function () {
$('#div-nav').css('top', $('.topnav').height());
});
$(document).on('click', function (e) {
var $menu = $('#div-nav');
var clicked = $(e.target).attr('class');
if (clicked === 'nav-button' || clicked === 'fas fa-bars') {
$menu.toggleClass('open');
} else if (clicked == 'link-header' || clicked == 'ddIcon') {
if (Modernizr.mq('screen and (max-width:76.5em)')) {
e.preventDefault();
$(e.target).next().toggleClass('open-sub-menu');
}
} else if (clicked == 'link') {
$(e.target).next().toggleClass('open-sub-menu');
} else if (clicked == 'fas fa-pencil-alt' || clicked == 'far fa-user' || clicked == 'fas fa-cogs' || clicked == 'mobile-desc') {
if (Modernizr.mq('screen and (max-width:76.5em)')) {
e.preventDefault();
$(e.target).parent().next().toggleClass('open-sub-menu');
}
} else {
$menu.removeClass('open');
}
});
/*! modernizr 3.5.0 (Custom Build) | MIT *
* https://modernizr.com/download/?-mq-setclasses !*/
!function (e, n, t) { function o(e, n) { return typeof e === n } function a() { var e, n, t, a, s, i, r; for (var l in d) if (d.hasOwnProperty(l)) { if (e = [], n = d[l], n.name && (e.push(n.name.toLowerCase()), n.options && n.options.aliases && n.options.aliases.length)) for (t = 0; t < n.options.aliases.length; t++)e.push(n.options.aliases[t].toLowerCase()); for (a = o(n.fn, "function") ? n.fn() : n.fn, s = 0; s < e.length; s++)i = e[s], r = i.split("."), 1 === r.length ? Modernizr[r[0]] = a : (!Modernizr[r[0]] || Modernizr[r[0]] instanceof Boolean || (Modernizr[r[0]] = new Boolean(Modernizr[r[0]])), Modernizr[r[0]][r[1]] = a), f.push((a ? "" : "no-") + r.join("-")) } } function s(e) { var n = u.className, t = Modernizr._config.classPrefix || ""; if (p && (n = n.baseVal), Modernizr._config.enableJSClass) { var o = new RegExp("(^|\\s)" + t + "no-js(\\s|$)"); n = n.replace(o, "$1" + t + "js$2") } Modernizr._config.enableClasses && (n += " " + t + e.join(" " + t), p ? u.className.baseVal = n : u.className = n) } function i() { return "function" != typeof n.createElement ? n.createElement(arguments[0]) : p ? n.createElementNS.call(n, "http://www.w3.org/2000/svg", arguments[0]) : n.createElement.apply(n, arguments) } function r() { var e = n.body; return e || (e = i(p ? "svg" : "body"), e.fake = !0), e } function l(e, t, o, a) { var s, l, f, d, c = "modernizr", p = i("div"), m = r(); if (parseInt(o, 10)) for (; o--;)f = i("div"), f.id = a ? a[o] : c + (o + 1), p.appendChild(f); return s = i("style"), s.type = "text/css", s.id = "s" + c, (m.fake ? m : p).appendChild(s), m.appendChild(p), s.styleSheet ? s.styleSheet.cssText = e : s.appendChild(n.createTextNode(e)), p.id = c, m.fake && (m.style.background = "", m.style.overflow = "hidden", d = u.style.overflow, u.style.overflow = "hidden", u.appendChild(m)), l = t(p, e), m.fake ? (m.parentNode.removeChild(m), u.style.overflow = d, u.offsetHeight) : p.parentNode.removeChild(p), !!l } var f = [], d = [], c = { _version: "3.5.0", _config: { classPrefix: "", enableClasses: !0, enableJSClass: !0, usePrefixes: !0 }, _q: [], on: function (e, n) { var t = this; setTimeout(function () { n(t[e]) }, 0) }, addTest: function (e, n, t) { d.push({ name: e, fn: n, options: t }) }, addAsyncTest: function (e) { d.push({ name: null, fn: e }) } }, Modernizr = function () { }; Modernizr.prototype = c, Modernizr = new Modernizr; var u = n.documentElement, p = "svg" === u.nodeName.toLowerCase(), m = function () { var n = e.matchMedia || e.msMatchMedia; return n ? function (e) { var t = n(e); return t && t.matches || !1 } : function (n) { var t = !1; return l("@media " + n + " { #modernizr { position: absolute; } }", function (n) { t = "absolute" == (e.getComputedStyle ? e.getComputedStyle(n, null) : n.currentStyle).position }), t } }(); c.mq = m, a(), s(f), delete c.addTest, delete c.addAsyncTest; for (var h = 0; h < Modernizr._q.length; h++)Modernizr._q[h](); e.Modernizr = Modernizr }(window, document);