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

מתוך מורה הנבוכים
קפיצה אל: ניווט, חיפוש
 
שורה 10: שורה 10:
 
$(".hamore-sources-cb").click(function() {
 
$(".hamore-sources-cb").click(function() {
 
$t.toggleClass("hamore-hide-sources");
 
$t.toggleClass("hamore-hide-sources");
 +
localStorage['hamore-sources-cb'] = this.checked ? "1" : "0";
 
});
 
});
 
$(".hamore-terms-cb").click(function() {
 
$(".hamore-terms-cb").click(function() {
 
$t.toggleClass("hamore-hide-terms");
 
$t.toggleClass("hamore-hide-terms");
 +
localStorage['hamore-terms-cb'] = this.checked ? "1" : "0";
 
});
 
});
 
$(".hamore-circles-cb").click(function() {
 
$(".hamore-circles-cb").click(function() {
 
$t.toggleClass("hamore-hide-circles");
 
$t.toggleClass("hamore-hide-circles");
 +
localStorage['hamore-circles-cb'] = this.checked ? "1" : "0";
 
});
 
});
 
$(".hamore-squares-cb").click(function() {
 
$(".hamore-squares-cb").click(function() {
 
$t.toggleClass("hamore-hide-squares");
 
$t.toggleClass("hamore-hide-squares");
 +
localStorage['hamore-squares-cb'] = this.checked ? "1" : "0";
 
});
 
});
 
$(".hamore-indexes-cb").click(function() {
 
$(".hamore-indexes-cb").click(function() {
 
$t.toggleClass("hamore-hide-indexes");
 
$t.toggleClass("hamore-hide-indexes");
 +
localStorage['hamore-indexes-cb'] = this.checked ? "1" : "0";
 
});
 
});
 
$(".hamore-sourced-hebrews-cb").click(function() {
 
$(".hamore-sourced-hebrews-cb").click(function() {
 
$t.toggleClass("hamore-hide-sourced-hebrews");
 
$t.toggleClass("hamore-hide-sourced-hebrews");
 +
localStorage['hamore-sourced-hebrews-cb'] = this.checked ? "1" : "0";
 
});
 
});
 
$(".hamore-hebrew-cb").click(function() {
 
$(".hamore-hebrew-cb").click(function() {
 
$t.toggleClass("hamore-hide-hebrew");
 
$t.toggleClass("hamore-hide-hebrew");
 +
localStorage['hamore-hebrew-cb'] = this.checked ? "1" : "0";
 
});
 
});
 
$(".hamore-arabic-cb").click(function() {
 
$(".hamore-arabic-cb").click(function() {
 
$t.toggleClass("hamore-hide-arabic");
 
$t.toggleClass("hamore-hide-arabic");
 +
localStorage['hamore-arabic-cb'] = this.checked ? "1" : "0";
 
});
 
});
  

גרסה אחרונה מ־11:57, 14 בספטמבר 2018

$(function() {
	var $t = $("table.hamore");
	if(!$t.length)
		return;
	$("h1").before('<div class="hamore-toolbox"><input type="checkbox" class="hamore-sources-cb" /> מקורות <input type="checkbox" class="hamore-terms-cb" /> מונחים <input type="checkbox" class="hamore-circles-cb" disabled="disabled" /> (הבהרות תרגום) <input type="checkbox" class="hamore-squares-cb" disabled="disabled" /> [השלמת ציטוטים] <input type="checkbox" class="hamore-indexes-cb" /> מספור פנימי <input type="checkbox" class="hamore-sourced-hebrews-cb" /> צביעת עברית במקור <input type="checkbox" class="hamore-hebrew-cb" /> תרגום עברי <input type="checkbox" class="hamore-arabic-cb" /> מקור ערבי</div>');
	
	$(".hamore-toolbox input").click();
	if (!localStorage) localStorage = {};
		
	$(".hamore-sources-cb").click(function() {
		$t.toggleClass("hamore-hide-sources");
		localStorage['hamore-sources-cb'] = this.checked ? "1" : "0";
	});
	$(".hamore-terms-cb").click(function() {
		$t.toggleClass("hamore-hide-terms");
		localStorage['hamore-terms-cb'] = this.checked ? "1" : "0";
	});
	$(".hamore-circles-cb").click(function() {
		$t.toggleClass("hamore-hide-circles");
		localStorage['hamore-circles-cb'] = this.checked ? "1" : "0";
	});
	$(".hamore-squares-cb").click(function() {
		$t.toggleClass("hamore-hide-squares");
		localStorage['hamore-squares-cb'] = this.checked ? "1" : "0";
	});
	$(".hamore-indexes-cb").click(function() {
		$t.toggleClass("hamore-hide-indexes");
		localStorage['hamore-indexes-cb'] = this.checked ? "1" : "0";
	});
	$(".hamore-sourced-hebrews-cb").click(function() {
		$t.toggleClass("hamore-hide-sourced-hebrews");
		localStorage['hamore-sourced-hebrews-cb'] = this.checked ? "1" : "0";
	});
	$(".hamore-hebrew-cb").click(function() {
		$t.toggleClass("hamore-hide-hebrew");
		localStorage['hamore-hebrew-cb'] = this.checked ? "1" : "0";
	});
	$(".hamore-arabic-cb").click(function() {
		$t.toggleClass("hamore-hide-arabic");
		localStorage['hamore-arabic-cb'] = this.checked ? "1" : "0";
	});

	if(localStorage['hamore-sources-cb'] === "0")
		$(".hamore-sources-cb").click();
	if(localStorage['hamore-terms-cb'] === "0")
		$(".hamore-terms-cb").click();
	if(localStorage['hamore-circles-cb'] === "0")
		$(".hamore-circles-cb").click();
	if(localStorage['hamore-squares-cb'] === "0")
		$(".hamore-squares-cb").click();
	if(localStorage['hamore-indexes-cb'] === "0")
		$(".hamore-indexes-cb").click();
	if(localStorage['hamore-sourced-hebrews-cb'] === "0")
		$(".hamore-sourced-hebrews-cb").click();
	if(localStorage['hamore-hebrew-cb'] === "0")
		$(".hamore-hebrew-cb").click();
	if(localStorage['hamore-arabic-cb'] === "0")
		$(".hamore-arabic-cb").click();
});