הערה: לאחר השמירה, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload), או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר: להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh), או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: לפתוח תפריט ← הגדרות (במחשב מק: Opera ← העדפות) ואז ללחוץ על פרטיות ואבטחה ← מחק היסטוריית גלישה ← Cached images and files.
/* Warning! Global gadget file! */
( function() {
	var entries = {};

	entries.testimonials = [
		{ text: "אני עובדת עם מתמודדי נפש. אני והצוות שלי מכירים היטב את כל הזכאויות  מתחום סל השיקום... בעזרת האתר למדתי איך להשיג להם השלמת הכנסה לקשישים, תו נכה לרכב ועוד...", subtitle: "02/2020" },
		{ text: "האתר שלכם הוא מאגר המידע הכי חיוני שפגשתי. מצאתי כאן מידע על תהליך המשכנתא כשהייתי צריכה וגם על כל תהליך העסקת עובד זר בסיעוד, פרטים אודות זיקנה ודמנציה עקב מצבו של קרוב משפחה ועוד. אתר פגז!", subtitle: "14/06/2020" },
		{ text: "כל הכבוד על האתר המדהים. ויותר מזה - כל הכבוד על התרגום לערבית. אני עובד בחברה עם עובדים בשתי השפות, והגישה הישירה של עובדים פלסטינים למידע זמין היא יקרה מפז.", subtitle: "28/05/2015" },
		{ text: "עובדים שלי שואלים אותי שאלות, לכאורה פשוטות, אך אסור לי להטעות אותם, לכן אני נעזר בכם. אתר פשוט ומעולה. תודה רבה רבה, עושים מלאכת קודש!!!", subtitle: "06/2015" }
	];

	entries.videos = [
		{ name: "eden", id: "DBQT4I4TwjM", subtitle: "עדן פוקס, סמנכ\"ל" },
		{ name: "hadas", id: "_PgHGc_o8hs", subtitle: "הדס בשן, עורכת תוכן" },
		{ name: "amitay", id: "gM3mp0xdfgE", subtitle: "אמתי קורן, מנכ\"ל" },
		{ name: "einat", id: "mzgDY-I-Kak", subtitle: "עינת רביב, מנהלת שותפויות" },
		{ name: "sigal", id: "Ut9oz5cQVkA", subtitle: "עו\"ד סיגל רונן-כץ, עורכת תוכן" },
		{ name: "oren", id: "uzSYY_HZ6_c", subtitle: "אורן ברקת, אחראי הצעות שינוי" },
		{ name: "sharon", id: "CmYTyGiORfk", subtitle: "עו\"ד שרון הורנשטיין, עורך ראשי" },
		{ name: "dror", id: "7PS00nS46Fc", subtitle: "דרור שניר-חיים, מתכנת" }
	];

	function getRandomInt(max) {
		return Math.floor(Math.random() * Math.floor(max));
	}

	function getEntry( type ) {
		return entries[ type ][ getRandomInt( entries[ type ].length ) ];
	}

	function renderDonateButton( type, name ) {
		name = name || '';
		return '<a class="btn donation-btn" data-location="kz10anniversary-'+ type + '" href="https://www.jgive.com/new/he/ils/external/charity-organizations/2263?utm_source=kolzchut.org.il&utm_medium=' + type + '&utm_campaign=kz10anniversary&utm_content=' + name + '">נודה אם תסייעו לנו לסייע לכם &gt;</a>';
	}

	function renderTestimonialEntry( entry ) {
		return '<div class="testimonial">' +
			'<div class="header"><div class="logo"></div></div>' +
			'<div class="title">חוות דעת גולשים:</div>' +
			'<div class="quote">”' + entry.text + '“</div>' +
			renderDonateButton( 'video', entry.subtitle ) +
		'</div>';
	}

	function renderVideoEntry( entry ) {
		return '<div class="testimonial video-testimonial">' +
			'<div class="header"><div class="logo"></div></div>' +
			'<div class="title">הפנים שמאחורי "כל זכות"</div>' +
			'<div class="video"><iframe class="video-frame" width="240" height="135" src="https://www.youtube-nocookie.com/embed/' + entry.id + '?modestbranding=1&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>' +
			'<div class="subtitle">' + entry.subtitle + '</div>' +
			renderDonateButton( 'testimonial', entry.name ) +
		'</div>';
	}

	function renderEntry( type, entry ) {
		if ( type === 'videos' ) {
			return renderVideoEntry( entry );
		} else {
			return renderTestimonialEntry( entry );
		}
	}

	var type = getRandomInt( 3 ) ? 'videos' : 'testimonials';
	var entry = getEntry ( type );
	var html = renderEntry( type, entry );

	$( '.sidebar-section-discovery' ).before( html );
})();