jekyll-zeta 0.10.4 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_includes/encrypt_page.js +17 -0
- data/_includes/encrypted.html +15 -241
- data/_includes/getPostData.js +6 -128
- data/_includes/getmapdata.js +17 -280
- data/_includes/heatmap.html +3 -6
- data/_includes/heatmap.js +28 -463
- data/_includes/heatmap_svg.js +38 -489
- data/_includes/js_source/encrypt_page.js +229 -0
- data/_includes/js_source/getPostData.js +128 -0
- data/_includes/js_source/getmapdata.js +280 -0
- data/_includes/js_source/heatmap.js +463 -0
- data/_includes/js_source/heatmap_svg.js +490 -0
- data/_includes/js_source/terser.json +11 -0
- data/_includes/lovemap_layout.html +6 -2
- metadata +8 -1
@@ -0,0 +1,229 @@
|
|
1
|
+
function _InitEnc(
|
2
|
+
preFix,
|
3
|
+
contentEnc,
|
4
|
+
keyData,
|
5
|
+
TestData,
|
6
|
+
forbid_cache_password
|
7
|
+
) {
|
8
|
+
function uint8ArrayToHex(uint8Array) {
|
9
|
+
return Array.from(uint8Array)
|
10
|
+
.map((byte) => byte.toString(16).padStart(2, "0")) // 转换每个字节为2位16进制
|
11
|
+
.join(""); // 连接成字符串
|
12
|
+
}
|
13
|
+
|
14
|
+
!(function () {
|
15
|
+
const substl = crypto.subtle;
|
16
|
+
|
17
|
+
const encid = preFix;
|
18
|
+
const encryptedContent = contentEnc;
|
19
|
+
const base64str = encryptedContent.substring(3);
|
20
|
+
const bfMsg = base64js.decode(base64str);
|
21
|
+
const bfIv = bfMsg.subarray(0, 12);
|
22
|
+
const bfCipher = bfMsg.subarray(12);
|
23
|
+
|
24
|
+
async function genKey(psw) {
|
25
|
+
var keyRaw = new TextEncoder().encode(psw);
|
26
|
+
var key = await substl.importKey("raw", keyRaw, "PBKDF2", false, [
|
27
|
+
"deriveBits",
|
28
|
+
]);
|
29
|
+
const salt = "this is a salt string 20221019";
|
30
|
+
let pbkdf2 = {
|
31
|
+
name: "PBKDF2",
|
32
|
+
hash: "SHA-256",
|
33
|
+
iterations: 12345,
|
34
|
+
salt: new TextEncoder().encode(salt),
|
35
|
+
};
|
36
|
+
return await substl.deriveBits(pbkdf2, key, 256);
|
37
|
+
}
|
38
|
+
|
39
|
+
async function decryptRaw(bf, key, outV) {
|
40
|
+
if (bf.length < 8) {
|
41
|
+
if (outV) {
|
42
|
+
outV.count = bf.length;
|
43
|
+
}
|
44
|
+
throw "err";
|
45
|
+
}
|
46
|
+
let count = 0;
|
47
|
+
for (let i = 0; i < 4; i++) {
|
48
|
+
count |= (bf[i] ^ bf[i + 4] ^ i) << ((3 - i) * 8);
|
49
|
+
}
|
50
|
+
|
51
|
+
if (outV) {
|
52
|
+
outV.count = count;
|
53
|
+
}
|
54
|
+
if (bf.length < count) {
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
|
58
|
+
let bfIv = bf.slice(4, 20);
|
59
|
+
let bfCipher = bf.slice(20, count);
|
60
|
+
|
61
|
+
var aeskey = {
|
62
|
+
name: "AES-CTR",
|
63
|
+
};
|
64
|
+
var keyObj = await substl.importKey("raw", key, aeskey, false, [
|
65
|
+
"decrypt",
|
66
|
+
]);
|
67
|
+
var aesDec = { name: "AES-CTR", counter: bfIv, length: 64 };
|
68
|
+
try {
|
69
|
+
let bfDec = await substl.decrypt(aesDec, keyObj, bfCipher);
|
70
|
+
return new Uint8Array(bfDec);
|
71
|
+
} catch (error) {
|
72
|
+
throw error;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
async function decryptBase64Msg(msg64, key) {
|
77
|
+
const base64str = msg64;
|
78
|
+
const bfMsg = base64js.decode(base64str);
|
79
|
+
return await decryptRaw(bfMsg, key);
|
80
|
+
}
|
81
|
+
async function checkKey(key) {
|
82
|
+
const arrTest = TestData.split(".");
|
83
|
+
const testData = arrTest[0];
|
84
|
+
const testDataEnc = arrTest[1];
|
85
|
+
const bfTestData = base64js.decode(testDataEnc);
|
86
|
+
|
87
|
+
const bfKeyData = base64js.decode(keyData);
|
88
|
+
let keyBf = null;
|
89
|
+
let C = 0;
|
90
|
+
let sum = 0;
|
91
|
+
while (C++ < 400) {
|
92
|
+
if (sum >= bfKeyData.length) {
|
93
|
+
break;
|
94
|
+
}
|
95
|
+
let bfSub = bfKeyData.slice(sum);
|
96
|
+
|
97
|
+
try {
|
98
|
+
let outV = { count: 0 };
|
99
|
+
let d = await decryptRaw(bfSub, key, outV);
|
100
|
+
|
101
|
+
sum += outV.count;
|
102
|
+
if (d) {
|
103
|
+
let dec = await decryptRaw(bfTestData, d);
|
104
|
+
let s = new TextDecoder().decode(dec);
|
105
|
+
if (s == testData) {
|
106
|
+
keyBf = d;
|
107
|
+
break;
|
108
|
+
}
|
109
|
+
} else {
|
110
|
+
}
|
111
|
+
} catch (error) {}
|
112
|
+
}
|
113
|
+
|
114
|
+
return keyBf;
|
115
|
+
}
|
116
|
+
|
117
|
+
async function decrypt(key0, isCached) {
|
118
|
+
// const key = Uint8Array([...]); // 32 bytes key
|
119
|
+
var key = "";
|
120
|
+
if (isCached) {
|
121
|
+
key = readKey();
|
122
|
+
} else {
|
123
|
+
var keyS = preFix + key0 + preFix;
|
124
|
+
key = await genKey(keyS);
|
125
|
+
}
|
126
|
+
if (key.length == 0) {
|
127
|
+
return;
|
128
|
+
}
|
129
|
+
try {
|
130
|
+
let keyBf = await checkKey(key);
|
131
|
+
if (!keyBf) {
|
132
|
+
throw "error psw";
|
133
|
+
}
|
134
|
+
var bfDec = await decryptBase64Msg(contentEnc, keyBf);
|
135
|
+
var plain = new TextDecoder().decode(bfDec);
|
136
|
+
setKey(key);
|
137
|
+
document.getElementById("encrypted").style.display = "none";
|
138
|
+
// / show decrypted
|
139
|
+
|
140
|
+
document.getElementById("decrypted").style.display = "block";
|
141
|
+
document.getElementById("decryptContent").innerHTML = plain;
|
142
|
+
|
143
|
+
const DECFUN = window["_after_dec_fun"];
|
144
|
+
|
145
|
+
if (DECFUN && typeof DECFUN == "function") {
|
146
|
+
DECFUN();
|
147
|
+
}
|
148
|
+
setTimeout(function () {
|
149
|
+
var loadevent = document.createEvent("Event");
|
150
|
+
loadevent.initEvent("load", true, true);
|
151
|
+
|
152
|
+
var DOMContentLoaded_event = document.createEvent("Event");
|
153
|
+
DOMContentLoaded_event.initEvent("DOMContentLoaded", true, true);
|
154
|
+
|
155
|
+
window.dispatchEvent(loadevent);
|
156
|
+
window.dispatchEvent(DOMContentLoaded_event);
|
157
|
+
}, 100);
|
158
|
+
} catch (error) {
|
159
|
+
console.log(error);
|
160
|
+
// alert("wrong password.")
|
161
|
+
document.getElementById("passwordinput").classList.add("errPsw");
|
162
|
+
setTimeout(() => {
|
163
|
+
document.getElementById("passwordinput").classList.remove("errPsw");
|
164
|
+
}, 500);
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
document.getElementById("DecryptBtn").onclick = function () {
|
169
|
+
var key = document.getElementById("passwordinput").value;
|
170
|
+
decrypt(key);
|
171
|
+
};
|
172
|
+
|
173
|
+
document.getElementById("EncryptBtn").onclick = function () {
|
174
|
+
/// hide input
|
175
|
+
document.getElementById("encrypted").style.display = "block";
|
176
|
+
// / show decrypted
|
177
|
+
document.getElementById("decrypted").style.display = "none";
|
178
|
+
document.getElementById("decryptContent").innerHTML = ":)";
|
179
|
+
|
180
|
+
clearKey();
|
181
|
+
|
182
|
+
const ENCFUN = window["_after_enc_fun"];
|
183
|
+
if (ENCFUN && typeof ENCFUN == "function") {
|
184
|
+
ENCFUN();
|
185
|
+
}
|
186
|
+
};
|
187
|
+
|
188
|
+
document.getElementById("ClearBtn1").onclick = function () {
|
189
|
+
localStorage.clear();
|
190
|
+
document.getElementById("passwordinput").value = "";
|
191
|
+
};
|
192
|
+
document.getElementById("ClearBtn2").onclick = function () {
|
193
|
+
localStorage.clear();
|
194
|
+
};
|
195
|
+
|
196
|
+
function readKey0() {}
|
197
|
+
function setKey0(value) {}
|
198
|
+
function clearKey0() {}
|
199
|
+
|
200
|
+
function readKey1() {
|
201
|
+
var key = encid;
|
202
|
+
var v = localStorage.getItem(key);
|
203
|
+
if (v) {
|
204
|
+
return base64js.decode(v);
|
205
|
+
} else {
|
206
|
+
return null;
|
207
|
+
}
|
208
|
+
}
|
209
|
+
function setKey1(value) {
|
210
|
+
var key = encid;
|
211
|
+
var arr = new Uint8Array(value);
|
212
|
+
var b64 = base64js.encode(arr);
|
213
|
+
return localStorage.setItem(key, b64);
|
214
|
+
}
|
215
|
+
function clearKey1() {
|
216
|
+
var key = encid;
|
217
|
+
localStorage.removeItem(key);
|
218
|
+
}
|
219
|
+
|
220
|
+
const readKey = forbid_cache_password ? readKey0 : readKey1;
|
221
|
+
const setKey = forbid_cache_password ? setKey0 : setKey1;
|
222
|
+
const clearKey = forbid_cache_password ? clearKey0 : clearKey1;
|
223
|
+
|
224
|
+
var cachekey = readKey();
|
225
|
+
if (cachekey) {
|
226
|
+
decrypt(cachekey, true);
|
227
|
+
}
|
228
|
+
})();
|
229
|
+
}
|
@@ -0,0 +1,128 @@
|
|
1
|
+
;function hm_getPostData( endYear ,_allyearurl) {
|
2
|
+
endYear = ('' + endYear).substring(0,4)
|
3
|
+
|
4
|
+
let arr = _allyearurl.split("/");
|
5
|
+
arr.pop();
|
6
|
+
const jsonUrlBase = arr.join("/");
|
7
|
+
|
8
|
+
var GDATA = window['__GDATA__']
|
9
|
+
if (!GDATA) {
|
10
|
+
GDATA = {}
|
11
|
+
window['__GDATA__']
|
12
|
+
}
|
13
|
+
|
14
|
+
|
15
|
+
let queue = window._y_queue || []
|
16
|
+
window._y_queue = queue;
|
17
|
+
|
18
|
+
|
19
|
+
function getAllYearCfg(){
|
20
|
+
|
21
|
+
|
22
|
+
if (GDATA['_allYear']) {
|
23
|
+
return GDATA['_allYear'];
|
24
|
+
}
|
25
|
+
|
26
|
+
if (window._isFetchAllYearData == 1) {
|
27
|
+
return new Promise(r=>{
|
28
|
+
queue.push(r);
|
29
|
+
})
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
window._isFetchAllYearData = 1;
|
34
|
+
return fetch(_allyearurl)
|
35
|
+
.then((r) => r.json())
|
36
|
+
.then(d => {
|
37
|
+
window._isFetchAllYearData = 0;
|
38
|
+
if (queue.length) {
|
39
|
+
queue.forEach(calback=>{calback(d)});
|
40
|
+
queue.length = 0;
|
41
|
+
}
|
42
|
+
GDATA['_allYear'] = d ;return d ;})
|
43
|
+
}
|
44
|
+
|
45
|
+
function getYearData(year) {
|
46
|
+
year = '' + year
|
47
|
+
|
48
|
+
if(GDATA[year]){
|
49
|
+
return GDATA[year]
|
50
|
+
}
|
51
|
+
|
52
|
+
let queueFlgKey = '_singleyearFlg' + year
|
53
|
+
let queueArrKey = '_singleyearQueue' + year
|
54
|
+
if (GDATA[queueFlgKey] == 1) {
|
55
|
+
// console.log('put in queue',year,Math.random())
|
56
|
+
let arrQueue = GDATA[queueArrKey]
|
57
|
+
if (!arrQueue) {
|
58
|
+
arrQueue = []
|
59
|
+
GDATA[queueArrKey] = arrQueue;
|
60
|
+
}
|
61
|
+
|
62
|
+
return new Promise(r=>{
|
63
|
+
arrQueue.push(r);
|
64
|
+
});
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
GDATA[queueFlgKey] = 1;
|
69
|
+
// console.log('RealQuery',year,Math.random())
|
70
|
+
return fetch(`${jsonUrlBase}/${year}.json`)
|
71
|
+
.then((r) => r.json())
|
72
|
+
.then(d=>{
|
73
|
+
GDATA[queueFlgKey] = 0 ;GDATA[year] = d;
|
74
|
+
let queue = GDATA[queueArrKey];
|
75
|
+
// console.log('queryFinish',year)
|
76
|
+
if(queue && queue.length){
|
77
|
+
queue.forEach(cb=>{
|
78
|
+
// console.log('queryFinishQueue',year,queue.length,Math.random());
|
79
|
+
cb(d);})
|
80
|
+
queue.length = 0;
|
81
|
+
GDATA[queueArrKey] = undefined
|
82
|
+
}
|
83
|
+
|
84
|
+
return d})
|
85
|
+
.catch((e) => {
|
86
|
+
return null;
|
87
|
+
});
|
88
|
+
}
|
89
|
+
|
90
|
+
function _getAllData() {
|
91
|
+
let year = "" + endYear
|
92
|
+
let preYear = "" + (Number(year) - 1);
|
93
|
+
return getAllYearCfg()
|
94
|
+
.then((d) => {
|
95
|
+
let yearCfg = d;
|
96
|
+
|
97
|
+
let arr = [];
|
98
|
+
if (yearCfg[year]) {
|
99
|
+
arr.push(getYearData(year));
|
100
|
+
}
|
101
|
+
|
102
|
+
if (yearCfg[preYear]) {
|
103
|
+
arr.push(getYearData(preYear));
|
104
|
+
}
|
105
|
+
return Promise.all(arr).then((alldata) => {
|
106
|
+
let combineData = {};
|
107
|
+
let d1 = alldata[0];
|
108
|
+
let d2 = alldata[1];
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
if(d1 && d1.year){
|
113
|
+
combineData[d1.year] = d1
|
114
|
+
}
|
115
|
+
|
116
|
+
if(d2 && d2.year){
|
117
|
+
combineData[d2.year] = d2
|
118
|
+
}
|
119
|
+
|
120
|
+
return Promise.resolve(combineData)
|
121
|
+
});
|
122
|
+
});
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
return _getAllData()
|
127
|
+
|
128
|
+
};
|
@@ -0,0 +1,280 @@
|
|
1
|
+
|
2
|
+
(function () {
|
3
|
+
var g_id = 100;
|
4
|
+
|
5
|
+
function ymd2Date(ymd) {
|
6
|
+
const parts = ymd.split('-').map(Number);
|
7
|
+
if (parts.length !== 3) {
|
8
|
+
throw new Error(`Invalid date format: ${ymd}`);
|
9
|
+
}
|
10
|
+
const [year, month, day] = parts;
|
11
|
+
return new Date(year, month - 1, day); // month 从 0 开始
|
12
|
+
};
|
13
|
+
|
14
|
+
function normalizeYmd(ymd){
|
15
|
+
if (ymd) {
|
16
|
+
const arr = ymd.split('-')
|
17
|
+
return `${arr[0]}-${arr[1].padStart(2,'0')}-${arr[2].padStart(2,'0')}`
|
18
|
+
}
|
19
|
+
|
20
|
+
return ymd
|
21
|
+
}
|
22
|
+
|
23
|
+
|
24
|
+
function getConfigFromStr(str,obj){
|
25
|
+
if (str && str.startsWith('#')) {
|
26
|
+
// #color #121212
|
27
|
+
// #title 123
|
28
|
+
let arr = str.split(' ')
|
29
|
+
if(arr.length >= 2){
|
30
|
+
let key = arr[0].substring(1)
|
31
|
+
if(key ){
|
32
|
+
obj[key] = str.substring(key.length + 2).trim()
|
33
|
+
return 1
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
return 0
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
function date2ymd(t) {
|
43
|
+
let m = t.getMonth() + 1;
|
44
|
+
let d = t.getDate();
|
45
|
+
return `${t.getFullYear()}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d}`;
|
46
|
+
}
|
47
|
+
/// 2025-01-01 描述,日期格式yyyy-mm-dd,空格后跟上 描述
|
48
|
+
function getDataFromSignleLine(str0,gData) {
|
49
|
+
if(!str0) return null
|
50
|
+
let str = str0.trim()
|
51
|
+
if (!str) return null
|
52
|
+
|
53
|
+
if(gData && getConfigFromStr(str,gData)) return null
|
54
|
+
|
55
|
+
|
56
|
+
var arr = str.split(" ")
|
57
|
+
var date0 = arr[0]
|
58
|
+
date0 = date0.replace('~','~')
|
59
|
+
if (gData && date0.indexOf("~") > 0) {
|
60
|
+
let arrRg = date0.split('~')
|
61
|
+
let beginYmd = arrRg[0]
|
62
|
+
let endYmd = arrRg[1]
|
63
|
+
let dateBegin = ymd2Date(normalizeYmd(beginYmd))
|
64
|
+
if (!dateBegin || isNaN(dateBegin)) {
|
65
|
+
|
66
|
+
return
|
67
|
+
}
|
68
|
+
let rangCount = 7
|
69
|
+
if(endYmd){
|
70
|
+
let dend = ymd2Date(normalizeYmd(endYmd))
|
71
|
+
if (dend && !isNaN(dend)) {
|
72
|
+
rangCount = Math.floor((dend.getTime() - dateBegin.getTime())/ 86400000) + 1
|
73
|
+
}
|
74
|
+
|
75
|
+
}else{
|
76
|
+
rangCount = Math.floor((Date.now() - dateBegin.getTime())/ 86400000) + 1;
|
77
|
+
if(rangCount > 7) rangCount =7
|
78
|
+
}
|
79
|
+
|
80
|
+
const desc = arr.slice(1).join(' ')
|
81
|
+
|
82
|
+
let resultArr = []
|
83
|
+
const timeStampBegin = dateBegin.getTime()
|
84
|
+
for (let i = 0; i < rangCount; i ++) {
|
85
|
+
const ymd = date2ymd(new Date(timeStampBegin + i * 86400000))
|
86
|
+
const newStr = ymd + ' ' + desc
|
87
|
+
const newEle = getDataFromSignleLine(newStr)
|
88
|
+
if(newEle){
|
89
|
+
resultArr.push(newEle)
|
90
|
+
}
|
91
|
+
}
|
92
|
+
return resultArr.length ? resultArr : null
|
93
|
+
|
94
|
+
}
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
let date = ''
|
99
|
+
if (date0) {
|
100
|
+
let ymd = date0.split("-")
|
101
|
+
if (ymd.length == 3) {
|
102
|
+
let year = ymd[0]
|
103
|
+
let month = ymd[1]
|
104
|
+
let day = ymd[2]
|
105
|
+
|
106
|
+
let nY = Number(year)
|
107
|
+
let nM = Number(month)
|
108
|
+
let nD = Number(month)
|
109
|
+
if (isNaN(nY) || isNaN(nD) || isNaN(nM) || nY < 1900 || nY > 2100 || nM < 1 || nM > 12 || nD < 1 || nD > 31) {
|
110
|
+
return null
|
111
|
+
}
|
112
|
+
date = year + "-" + month.padStart(2, '0') + "-" + day.padStart(2, '0')
|
113
|
+
}
|
114
|
+
}
|
115
|
+
else {
|
116
|
+
return null
|
117
|
+
}
|
118
|
+
|
119
|
+
if (!date) {
|
120
|
+
return null
|
121
|
+
}
|
122
|
+
var title = ""
|
123
|
+
let color = undefined
|
124
|
+
if (arr.length > 1) {
|
125
|
+
title = arr.slice(1).join(" ")
|
126
|
+
|
127
|
+
const regColor = /#[0-9a-fA-F]{6}/
|
128
|
+
let colorScaned = regColor.exec(title)
|
129
|
+
if (colorScaned && colorScaned.length) {
|
130
|
+
color = colorScaned[0]
|
131
|
+
title = title.replace(regColor,'')
|
132
|
+
}
|
133
|
+
|
134
|
+
}
|
135
|
+
return { date: date, title: title ,color}
|
136
|
+
}
|
137
|
+
|
138
|
+
function fillDataObj(data, item) {
|
139
|
+
if (!item) return
|
140
|
+
let y = item.date.substring(0, 4);
|
141
|
+
let m = item.date.substring(5, 7);
|
142
|
+
let c = data.allYear[y];
|
143
|
+
data.allYear[y] = c ? c + 1 : 1;
|
144
|
+
|
145
|
+
let yObj = data[y]
|
146
|
+
if (!yObj) {
|
147
|
+
yObj = {}
|
148
|
+
data[y] = yObj;
|
149
|
+
}
|
150
|
+
|
151
|
+
let arr = yObj[m]
|
152
|
+
if (!arr) {
|
153
|
+
arr = []
|
154
|
+
yObj[m] = arr
|
155
|
+
}
|
156
|
+
arr.push(item)
|
157
|
+
|
158
|
+
}
|
159
|
+
|
160
|
+
|
161
|
+
async function wait (t ) {
|
162
|
+
return new Promise(function(r){
|
163
|
+
setTimeout(() => {
|
164
|
+
r()
|
165
|
+
}, t );
|
166
|
+
})
|
167
|
+
}
|
168
|
+
|
169
|
+
function parseDataAndCeateMap(strData,node) {
|
170
|
+
|
171
|
+
|
172
|
+
let allYear = {}
|
173
|
+
let dataObj = { allYear: allYear };
|
174
|
+
|
175
|
+
let Recent365Count = 0;
|
176
|
+
let nowDate = new Date
|
177
|
+
let Recent365YMD = `${nowDate.getFullYear() - 1}-${(nowDate.getMonth() + 1).toString().padStart(2, '0')}-${nowDate.getDate().toString().padStart(2, '0')}`
|
178
|
+
|
179
|
+
|
180
|
+
strData.split("\n").forEach(function (str,idx) {
|
181
|
+
if(idx == 0) return
|
182
|
+
let item = getDataFromSignleLine(str,dataObj)
|
183
|
+
if (item && Array.isArray(item)) {
|
184
|
+
item.forEach(e=>{
|
185
|
+
fillDataObj(dataObj, e)
|
186
|
+
if (e) {
|
187
|
+
if (e.date >= Recent365YMD) {
|
188
|
+
Recent365Count++
|
189
|
+
}
|
190
|
+
}
|
191
|
+
})
|
192
|
+
}else{
|
193
|
+
fillDataObj(dataObj, item)
|
194
|
+
if (item) {
|
195
|
+
if (item.date >= Recent365YMD) {
|
196
|
+
Recent365Count++
|
197
|
+
}
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
})
|
202
|
+
|
203
|
+
|
204
|
+
if (dataObj.title ) {
|
205
|
+
|
206
|
+
|
207
|
+
let divTitle = document.createElement('div')
|
208
|
+
divTitle.className = 'custom-map-title'
|
209
|
+
divTitle.innerText = dataObj.title || ''
|
210
|
+
|
211
|
+
let codeHolder = node.parentNode
|
212
|
+
codeHolder.insertBefore(divTitle,node)
|
213
|
+
|
214
|
+
}
|
215
|
+
|
216
|
+
|
217
|
+
let allYearArr = Object.keys(allYear).sort().reverse()
|
218
|
+
|
219
|
+
|
220
|
+
let RCT = dataObj['recent'];
|
221
|
+
let showRct = true
|
222
|
+
if (!RCT) {
|
223
|
+
showRct = Recent365Count && allYearArr.length > 1
|
224
|
+
}else{
|
225
|
+
showRct = RCT == '1'
|
226
|
+
}
|
227
|
+
if(showRct){
|
228
|
+
create_heatmap_lv('lmpRecent365' + g_id ++, '', dataObj, "Last 1Y", Recent365Count,node)
|
229
|
+
}
|
230
|
+
|
231
|
+
for (let i = 0; i < allYearArr.length; i++) {
|
232
|
+
let y = allYearArr[i]
|
233
|
+
create_heatmap_lv('lmp' + y + g_id ++ , y, dataObj,undefined,undefined,node)
|
234
|
+
}
|
235
|
+
|
236
|
+
node.style.display = 'none'
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
};
|
241
|
+
|
242
|
+
async function initData(){
|
243
|
+
let arrCodes = document.querySelectorAll('pre > code')
|
244
|
+
if (!arrCodes || arrCodes.length == 0) return
|
245
|
+
|
246
|
+
if (arrCodes.length > 0) {
|
247
|
+
for (let i = 0; i < arrCodes.length; i ++) {
|
248
|
+
const code = arrCodes[i ];
|
249
|
+
var strAll = code.textContent
|
250
|
+
if (!strAll.startsWith("#mapdata")) {
|
251
|
+
return
|
252
|
+
}
|
253
|
+
|
254
|
+
parseDataAndCeateMap(strAll,code.parentNode.parentNode.parentNode)
|
255
|
+
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
}
|
260
|
+
}
|
261
|
+
|
262
|
+
initData()
|
263
|
+
|
264
|
+
window['_after_dec_fun'] = function () {
|
265
|
+
let con = document.getElementById('loveiContainer')
|
266
|
+
if (!con) {
|
267
|
+
let decryptContent = document.getElementById('decryptContent')
|
268
|
+
if (!decryptContent) return
|
269
|
+
con = document.createElement('div')
|
270
|
+
con.id = 'loveiContainer'
|
271
|
+
decryptContent.insertBefore(con, decryptContent.firstChild)
|
272
|
+
|
273
|
+
}
|
274
|
+
|
275
|
+
initData()
|
276
|
+
}
|
277
|
+
window['_after_enc_fun'] = function () {
|
278
|
+
document.getElementById('loveiContainer').innerHTML = ''
|
279
|
+
}
|
280
|
+
})();
|