PageSourceSearch

https://kobe-investment.jp/wp-content/themes/invest/assets/js/switch_style.js

js kobe-investment.jp collected 2026-10-02 12:09:33 UTC 3,090 bytes, 112 lines download raw bytes

1var windowWidth = parseInt(window.innerWidth);
2
3	var common = {
4		// expiration day
5		ckDays: 1,
6		// Cookiepath
7		ckPath: "/",
8		GetCookie: function (name) {
9			var arg = name + "=";
10			var alen = arg.length;
11			var clen = document.cookie.length;
12			var i = 0;
13			while (i < clen) {
14				var j = i + alen;
15				if (document.cookie.substring(i, j) == arg)
16					return common.getCookieVal(j);
17				i = document.cookie.indexOf(" ", i) + 1;
18				if (i == 0) break;
19			}
20			return null;
21		},
22
23		SetCookie: function (name, value) {
24			// expiration_date
25			var dobj = new Date();
26			dobj.setTime(dobj.getTime() + 24 * 60 * 60 * common.ckDays * 1000);
27			var expiryDate = dobj.toGMTString();
28			document.cookie = name + '=' + escape(value) + ';expires=' + expiryDate + ';path=' + common.ckPath;
29		},
30		getCookieVal: function (offset) {
31			var endstr = document.cookie.indexOf(";", offset);
32			if (endstr == -1) endstr = document.cookie.length;
33			return unescape(document.cookie.substring(offset, endstr));
34		}
35	};
36
37	var sw_size = {
38		fontSizeUnit: '%',
39		current_size: 0,
40		perOrder: 10,
41		normalSize: 62.5,
42		url: document.location.href,
43		// cookie name
44		ckName: "switchsize",
45		init: function () {
46
47			var fsCK = common.GetCookie(sw_size.ckName);
48			sw_size.current_size = (!fsCK) ? sw_size.normalSize : eval(fsCK);
49
50			var result_size = 'html{font-size: ' + sw_size.current_size + sw_size.fontSizeUnit + '}' + "\n";
51
52			var sty = document.createElement('style');
53			sty.type = 'text/css';
54			var head = document.getElementsByTagName('head')[0];
55
56			if (sty.styleSheet) {
57				sty.styleSheet.cssText = result_size;
58			} else { //Other IE
59				var t = document.createTextNode(result_size);
60				sty.appendChild(t);
61			}
62			head.appendChild(sty);
63		},
64		sizeSet: function (CMD) {
65			var newSize = 0;
66			if (CMD == "zoom" && sw_size.current_size <= 90) {
67				newSize = Number(sw_size.current_size + sw_size.perOrder);
68				console.log(sw_size.current_size);
69			} else if (CMD == "normal") newSize = sw_size.normalSize;
70
71			if (newSize) common.SetCookie(sw_size.ckName, newSize);
72			window.location.reload();
73			return false;
74		}
75	};
76
77	var sw_color = {
78		url: document.location.href,
79		// cookie name
80		ckName: "switchcol",
81		init: function () {
82			var loadCol = common.GetCookie(sw_color.ckName);
83			var current_col = (loadCol == null) ? false : loadCol;
84
85			if (current_col) {
86				var lnk = document.createElement('link');
87				lnk.setAttribute('rel', 'stylesheet');
88				lnk.setAttribute('type', 'text/css');
89				// css配置場所に応じて変更
90				lnk.setAttribute('href', '/wp-content/themes/invest/assets/css/' + current_col + '.css');
91				var head = document.getElementsByTagName('head')[0];
92				head.appendChild(lnk);
93			}
94		}
95	};
96
97//html size event name
98	var fe_size = function (mode) {
99		sw_size.sizeSet(mode);
100	};
101	
102//html color event name
103	var fe_col = function (CMD) {
104		if (CMD == "c_black") common.SetCookie(sw_color.ckName, CMD);
105		else if (CMD == "c_white") common.SetCookie(sw_color.ckName, '');
106		window.location.reload();
107		return false;
108	};
109	
110	sw_size.init();
111	sw_color.init();
112

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.