q78kgblog 0.0.0-1720441708496 → 0.0.0-1720859005089
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.
- package/404.html +3 -3
- package/about/index.html +5 -5
- package/archives/2023/02/index.html +4 -4
- package/archives/2023/04/index.html +4 -4
- package/archives/2023/05/index.html +4 -4
- package/archives/2023/08/index.html +4 -4
- package/archives/2023/09/index.html +4 -4
- package/archives/2023/index.html +4 -4
- package/archives/2024/01/index.html +4 -4
- package/archives/2024/02/index.html +4 -4
- package/archives/2024/index.html +4 -4
- package/archives/index.html +4 -4
- package/atom.xml +9 -9
- package/baidusitemap.xml +8 -8
- package/bangumis/index.html +4 -4
- package/bigpie/index.html +3 -3
- package/categories/Hexo/index.html +4 -4
- package/categories/index.html +3 -3
- package/categories//345/271/264/347/273/210/346/200/273/347/273/223/index.html +4 -4
- package/categories//347/264/240/346/235/220/index.html +4 -4
- package/categories//351/227/262/350/201/212/346/235/202/350/260/210/index.html +4 -4
- package/content.json +1 -1
- package/css/404page.css +1 -65
- package/css/ariasakablog.css +1 -6669
- package/css/commentBarrage.css +1 -118
- package/css/danmaku.css +1 -106
- package/css/essay.css +1 -306
- package/css/iconfont.css +1 -55
- package/css/index.css +1 -7006
- package/css/people.css +1 -18
- package/css/stylessimple.css +1 -40
- package/css/swiperstyle.css +1 -567
- package/fcircle/index.html +3 -3
- package/fontawesome/index.html +3 -3
- package/index.html +11 -11
- package/js/aplayersave.js +1 -268
- package/js/baiduhistory.js +1 -76
- package/js/browser.js +1 -35
- package/js/calendar.js +1 -380
- package/js/cate.js +1 -22
- package/js/commentBarrage.js +17 -232
- package/js/commentsCount.js +1 -43
- package/js/copy.js +1 -23
- package/js/countup.js +1 -209
- package/js/cursor.js +1 -82
- package/js/danmaku.js +0 -106
- package/js/day.js +13 -195
- package/js/dianzan.js +1 -249
- package/js/dis.js +4 -252
- package/js/dist/baiduhistory.dev.js +1 -102
- package/js/dist/bbtalk.dev.js +159 -12872
- package/js/dist/bbtalklunbo.dev.js +1 -45
- package/js/dist/calendar.dev.js +1 -395
- package/js/dist/fixbugpjax.dev.js +1 -8
- package/js/dist/gongnong.dev.js +1 -565
- package/js/dist/heimu.dev.js +1 -19
- package/js/dist/links.dev.js +1 -13
- package/js/dist/main.dev.js +5 -843
- package/js/dist/resizeTop.dev.js +1 -50
- package/js/dist/seo.dev.js +1 -33
- package/js/dist/twikoo.all.min.dev.js +946 -1
- package/js/fixbugpjax.js +1 -7
- package/js/fixed_card_widget.js +1 -46
- package/js/fps.js +1 -58
- package/js/gitalker.js +1 -11
- package/js/heimu.js +1 -16
- package/js/hide.show.js +1 -17
- package/js/languages.js +1 -511
- package/js/latest.js +1 -49
- package/js/local-search.js +2 -476
- package/js/lunar.js +1 -1071
- package/js/lyxTalk.js +1 -12
- package/js/main.js +5 -781
- package/js/nav.js +1 -30
- package/js/noie.js +1 -3
- package/js/owo.js +1 -52
- package/js/people.js +2 -175
- package/js/randomFriend.js +1 -95
- package/js/resizeTop.js +1 -43
- package/js/rightmenu.js +3 -333
- package/js/sakura.js +1 -164
- package/js/search/algolia.js +4 -154
- package/js/search/local-search.js +1 -188
- package/js/settings.js +3 -343
- package/js/sitetime.js +1 -25
- package/js/smooth-scrolling.js +1 -546
- package/js/sw-toolbox.js +1 -16
- package/js/swiperinit.js +1 -23
- package/js/tw_cn.js +1 -100
- package/js/utils.js +1 -278
- package/js/welcome.js +1 -107
- package/js/welcomeconsole.js +1 -23
- package/links/index.html +3 -3
- package/othersite/index.html +3 -3
- package/package.json +1 -1
- package/posts/164ef646/index.html +6 -6
- package/posts/228c2ef8/index.html +6 -6
- package/posts/a9a6c1fb/index.html +6 -6
- package/posts/c262e439/index.html +6 -6
- package/posts/c81531cf/index.html +6 -6
- package/posts/ccdf7cfc/index.html +6 -6
- package/posts/de1f83f4/index.html +6 -6
- package/posts/e54f7476/index.html +6 -6
- package/sitemap.xml +49 -49
- package/sw.js +2 -193
- package/swReg.js +1 -29
- package/tags/AI/index.html +5 -5
- package/tags/Butterfly/index.html +5 -5
- package/tags/Cloudflare/index.html +5 -5
- package/tags/DiffSinger/index.html +5 -5
- package/tags/Hexo/index.html +5 -5
- package/tags/Next/index.html +5 -5
- package/tags/RAID/index.html +5 -5
- package/tags/Vercel/index.html +5 -5
- package/tags/Workers/index.html +5 -5
- package/tags/index.html +3 -3
- package/tags//344/270/273/351/242/230/index.html +5 -5
- package/tags//345/206/231/344/275/234/index.html +5 -5
- package/tags//345/245/263/346/200/247/346/204/217/350/257/206/index.html +5 -5
- package/tags//345/255/246/344/271/240/index.html +5 -5
- package/tags//345/256/266/351/207/214/344/272/221/index.html +5 -5
- package/tags//345/271/264/347/273/210/346/200/273/347/273/223/index.html +5 -5
- package/tags//346/212/230/350/205/276/index.html +5 -5
- package/tags//346/227/245/345/270/270/index.html +5 -5
- package/tags//346/234/215/345/212/241/345/231/250/index.html +5 -5
- package/tags//346/265/252/346/275/256/index.html +5 -5
- package/tags//347/256/200/347/210/261/index.html +5 -5
- package/tags//350/207/252/345/212/250/346/240/207/346/263/250/index.html +5 -5
- package/tags//350/256/272/346/226/207/index.html +5 -5
- package/tags//350/260/267/346/255/214/347/277/273/350/257/221/index.html +5 -5
- package/tags//350/264/237/350/275/275/345/235/207/350/241/241/index.html +5 -5
- package/tags//351/207/221/345/217/245/index.html +5 -5
- package/tags//351/255/224/346/224/271/index.html +5 -5
|
@@ -1,45 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// import { createRequire } from 'module';
|
|
4
|
-
// const require = createRequire(import.meta.url);
|
|
5
|
-
// const AV = require('leancloud-storage');
|
|
6
|
-
var _AV = AV,
|
|
7
|
-
Query = _AV.Query,
|
|
8
|
-
User = _AV.User;
|
|
9
|
-
AV.init({
|
|
10
|
-
appId: "IvW3T1NjMoh7OmKEdAz1tM0o-gzGzoHsz",
|
|
11
|
-
appKey: "vG8s9ukVO5bgozEHzR923dew",
|
|
12
|
-
serverURL: "https://ivw3t1nj.lc-cn-n1-shared.com"
|
|
13
|
-
});
|
|
14
|
-
var speaks = [];
|
|
15
|
-
var query = new AV.Query('content');
|
|
16
|
-
query.find().then(function (talks) {
|
|
17
|
-
for (i = talks.length - 1; i >= 0; i--) {
|
|
18
|
-
speaks.push(talks[i]["attributes"]["content"]);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
window.onload = function () {
|
|
23
|
-
// function f1(){
|
|
24
|
-
// var count=1;
|
|
25
|
-
// setTimeout(function () {
|
|
26
|
-
// document.getElementsByClassName("shuoshuo")[0].innerHTML=speaks[count%speaks.length];
|
|
27
|
-
// f1();
|
|
28
|
-
// count++;
|
|
29
|
-
// }, 5000);
|
|
30
|
-
// }
|
|
31
|
-
// var count=0;
|
|
32
|
-
// document.getElementsByClassName("shuoshuo")[0].innerHTML=speaks[count%speaks.length];
|
|
33
|
-
// count++;
|
|
34
|
-
// f1()
|
|
35
|
-
var count = 0;
|
|
36
|
-
|
|
37
|
-
function countSecond() {
|
|
38
|
-
document.getElementsByClassName("shuoshuo")[0].innerHTML = speaks[count % speaks.length];
|
|
39
|
-
count++;
|
|
40
|
-
console.log(count);
|
|
41
|
-
setTimeout("countSecond()", 5000);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
countSecond();
|
|
45
|
-
};
|
|
1
|
+
"use strict";var _AV=AV,Query=_AV.Query,User=_AV.User;AV.init({appId:"IvW3T1NjMoh7OmKEdAz1tM0o-gzGzoHsz",appKey:"vG8s9ukVO5bgozEHzR923dew",serverURL:"https://ivw3t1nj.lc-cn-n1-shared.com"});var speaks=[],query=new AV.Query("content");query.find().then(function(e){for(i=e.length-1;i>=0;i--)speaks.push(e[i].attributes.content)}),window.onload=function(){var e=0;function n(){document.getElementsByClassName("shuoshuo")[0].innerHTML=speaks[e%speaks.length],e++,console.log(e),setTimeout("countSecond()",5e3)}n()};
|
package/js/dist/calendar.dev.js
CHANGED
|
@@ -1,395 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Calendar - displays a calendar of the current month. Dates appear links if there are posts for that day.
|
|
5
|
-
*/
|
|
6
|
-
(function ($) {
|
|
7
|
-
var aCalendar = function aCalendar(language, options, object) {
|
|
8
|
-
var now = new Date();
|
|
9
|
-
var nDay = now.getDate();
|
|
10
|
-
var nMonth = now.getMonth();
|
|
11
|
-
var nYear = now.getFullYear();
|
|
12
|
-
var dDay = nDay;
|
|
13
|
-
var dMonth = nMonth;
|
|
14
|
-
var dYear = nYear;
|
|
15
|
-
var instance = object;
|
|
16
|
-
var allPosts = null;
|
|
17
|
-
var months = null;
|
|
18
|
-
/* Current month's posts */
|
|
19
|
-
|
|
20
|
-
var current = {
|
|
21
|
-
posts: [],
|
|
22
|
-
prev: null,
|
|
23
|
-
next: null
|
|
24
|
-
};
|
|
25
|
-
var currentLanguage = 'en';
|
|
26
|
-
initLanguage(language);
|
|
27
|
-
var settings = $.extend({}, $.fn.aCalendar.defaults, typeof calLanguages === 'undefined' ? {} : calLanguages[currentLanguage], options);
|
|
28
|
-
|
|
29
|
-
if (settings.root[0] !== '/') {
|
|
30
|
-
settings.root = '/' + settings.root;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (settings.root[settings.root.length - 1] !== '/') {
|
|
34
|
-
settings.root += '/';
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Initial language.
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
function initLanguage(key) {
|
|
42
|
-
if (key && typeof calLanguages !== 'undefined' && calLanguages[key]) {
|
|
43
|
-
currentLanguage = key;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Click handler for next month arrow button.
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
function nextMonth() {
|
|
52
|
-
if (dMonth < 11) {
|
|
53
|
-
dMonth++;
|
|
54
|
-
} else {
|
|
55
|
-
dMonth = 0;
|
|
56
|
-
dYear++;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
draw();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
;
|
|
63
|
-
/**
|
|
64
|
-
* Click handler for previous month arrow button.
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
function previousMonth() {
|
|
68
|
-
if (dMonth > 0) {
|
|
69
|
-
dMonth--;
|
|
70
|
-
} else {
|
|
71
|
-
dMonth = 11;
|
|
72
|
-
dYear--;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
draw();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
;
|
|
79
|
-
/**
|
|
80
|
-
* Click handler for navigating to a month if there are posts.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
function toPostsMonth(date) {
|
|
84
|
-
if (date) {
|
|
85
|
-
dYear = date.getFullYear();
|
|
86
|
-
dMonth = date.getMonth();
|
|
87
|
-
draw();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Load current month's posts.
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
function loadPosts() {
|
|
96
|
-
if (settings.single) {
|
|
97
|
-
loadAllPosts();
|
|
98
|
-
} else {
|
|
99
|
-
loadPostsByMonth();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Load all month's posts.
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
function loadAllPosts() {
|
|
108
|
-
if (settings.url != null && settings.url != '') {
|
|
109
|
-
if (allPosts === null) {
|
|
110
|
-
$.ajax({
|
|
111
|
-
url: settings.url,
|
|
112
|
-
async: false,
|
|
113
|
-
success: function success(data) {
|
|
114
|
-
allPosts = data;
|
|
115
|
-
initMonths(Object.keys(allPosts));
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (allPosts !== null) {
|
|
121
|
-
if (parse()) {
|
|
122
|
-
current.posts = allPosts[dYear + '-' + (dMonth + 1)];
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Load posts by the month.
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
function loadPostsByMonth() {
|
|
133
|
-
if (months === null) {
|
|
134
|
-
$.ajax({
|
|
135
|
-
url: settings.root + 'list.json',
|
|
136
|
-
async: false,
|
|
137
|
-
success: function success(data) {
|
|
138
|
-
initMonths(data);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (parse()) {
|
|
144
|
-
$.ajax({
|
|
145
|
-
url: settings.root + dYear + '-' + (dMonth + 1) + '.json',
|
|
146
|
-
async: false,
|
|
147
|
-
success: function success(data) {
|
|
148
|
-
current.posts = data;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Initial months array.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
function initMonths(array) {
|
|
159
|
-
months = array.map(function (item) {
|
|
160
|
-
var ym = item.split('-');
|
|
161
|
-
return new Date(Date.UTC(+ym[0], +ym[1] - 1));
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Parse posts month array, and set current.next and current.prev.
|
|
166
|
-
*
|
|
167
|
-
* @return if there are posts in this month, return true. ortherwise return false.
|
|
168
|
-
*/
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
function parse() {
|
|
172
|
-
var time = Date.UTC(dYear, dMonth);
|
|
173
|
-
|
|
174
|
-
if (months === null || months.length === 0) {
|
|
175
|
-
return false;
|
|
176
|
-
} //If no posts in the current month, and before (or after) the current month yet not published articles, then the response to click previous month's (or next month's) event don't need to parse months array
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if (current.posts.length === 0 && (current.prev === null && current.next !== null && current.next.getTime() > time || current.next === null && current.prev !== null && current.prev.getTime() < time)) {
|
|
180
|
-
return false;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
current.posts = [];
|
|
184
|
-
|
|
185
|
-
for (var i = 0; i < months.length; i++) {
|
|
186
|
-
var cTime = months[i].getTime();
|
|
187
|
-
|
|
188
|
-
if (time === cTime) {
|
|
189
|
-
current.prev = i === 0 ? null : months[i - 1];
|
|
190
|
-
current.next = i === months.length - 1 ? null : months[i + 1];
|
|
191
|
-
return true;
|
|
192
|
-
} else if (time < cTime) {
|
|
193
|
-
current.prev = i === 0 ? null : months[i - 1];
|
|
194
|
-
current.next = months[i];
|
|
195
|
-
break;
|
|
196
|
-
} else {
|
|
197
|
-
current.prev = months[i];
|
|
198
|
-
current.next = null;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Format date object.
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
function simpleDateFormat(date, fmt) {
|
|
210
|
-
var o = {
|
|
211
|
-
'LMM+': settings.months[date.getMonth()],
|
|
212
|
-
'MM+': date.getMonth() + 1
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
if (/(y+)/.test(fmt)) {
|
|
216
|
-
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
for (var k in o) {
|
|
220
|
-
if (new RegExp('(' + k + ')').test(fmt)) {
|
|
221
|
-
fmt = fmt.replace(RegExp.$1, k === 'LMM+' ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
return fmt;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Draw calendar.
|
|
229
|
-
*
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
function draw() {
|
|
234
|
-
loadPosts();
|
|
235
|
-
var dWeekDayOfMonthStart = new Date(dYear, dMonth, 1).getDay() - settings.weekOffset;
|
|
236
|
-
|
|
237
|
-
if (dWeekDayOfMonthStart <= 0) {
|
|
238
|
-
dWeekDayOfMonthStart = 6 - (dWeekDayOfMonthStart + 1) * -1;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
var dLastDayOfMonth = new Date(dYear, dMonth + 1, 0).getDate();
|
|
242
|
-
var dLastDayOfPreviousMonth = new Date(dYear, dMonth, 0).getDate() - dWeekDayOfMonthStart + 1;
|
|
243
|
-
var cHead = $('<div/>').addClass('cal-head');
|
|
244
|
-
var cNext = $('<div/>');
|
|
245
|
-
var cPrevious = $('<div/>');
|
|
246
|
-
var cTitle = $('<div/>').addClass('cal-title');
|
|
247
|
-
cPrevious.html(settings.headArrows.previous);
|
|
248
|
-
cNext.html(settings.headArrows.next);
|
|
249
|
-
curDate = new Date(Date.UTC(dYear, dMonth));
|
|
250
|
-
|
|
251
|
-
if (current.posts.length === 0) {
|
|
252
|
-
cTitle.html(simpleDateFormat(curDate, settings.titleFormat));
|
|
253
|
-
} else {
|
|
254
|
-
cTitleLink = $('<a/>').attr('href', simpleDateFormat(curDate, settings.titleLinkFormat)).attr('title', simpleDateFormat(curDate, settings.postsMonthTip)).html(simpleDateFormat(curDate, settings.titleFormat));
|
|
255
|
-
cTitle.html(cTitleLink);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
cPrevious.on('click', previousMonth);
|
|
259
|
-
cNext.on('click', nextMonth);
|
|
260
|
-
cHead.append(cPrevious);
|
|
261
|
-
cHead.append(cTitle);
|
|
262
|
-
cHead.append(cNext);
|
|
263
|
-
var cBody = $('<table/>').addClass('cal');
|
|
264
|
-
var dayOfWeek = settings.weekOffset;
|
|
265
|
-
var cWeekHead = $('<thead/>');
|
|
266
|
-
var cWeekHeadRow = $('<tr/>');
|
|
267
|
-
|
|
268
|
-
for (var i = 0; i < 7; i++) {
|
|
269
|
-
if (dayOfWeek > 6) {
|
|
270
|
-
dayOfWeek = 0;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
var cWeekDay = $('<th/>').attr('scope', 'col').attr('title', settings.dayOfWeek[dayOfWeek]);
|
|
274
|
-
cWeekDay.html(settings.dayOfWeekShort[dayOfWeek]);
|
|
275
|
-
cWeekHeadRow.append(cWeekDay);
|
|
276
|
-
dayOfWeek++;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
cWeekHead.append(cWeekHeadRow);
|
|
280
|
-
cBody.append(cWeekHead);
|
|
281
|
-
var cFoot = $('<tfoot/>');
|
|
282
|
-
var cFootRow = $('<tr/>');
|
|
283
|
-
var cPrevPosts = $('<td/>').attr('colspan', 3);
|
|
284
|
-
var cPad = $('<td/>').html(' ');
|
|
285
|
-
var cNextPosts = $('<td/>').attr('colspan', 3);
|
|
286
|
-
|
|
287
|
-
if (current.prev) {
|
|
288
|
-
cPrevPosts.html(settings.footArrows.previous + settings.months[current.prev.getMonth()]).addClass('cal-foot').attr('title', simpleDateFormat(current.prev, settings.postsMonthTip));
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (current.next) {
|
|
292
|
-
cNextPosts.html(settings.months[current.next.getMonth()] + settings.footArrows.next).addClass('cal-foot').attr('title', simpleDateFormat(current.next, settings.postsMonthTip));
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
cPrevPosts.on('click', function () {
|
|
296
|
-
toPostsMonth(current.prev);
|
|
297
|
-
});
|
|
298
|
-
cNextPosts.on('click', function () {
|
|
299
|
-
toPostsMonth(current.next);
|
|
300
|
-
});
|
|
301
|
-
cFootRow.append(cPrevPosts);
|
|
302
|
-
cFootRow.append(cPad);
|
|
303
|
-
cFootRow.append(cNextPosts);
|
|
304
|
-
cFoot.append(cFootRow);
|
|
305
|
-
var cMainPad = $('<tbody/>');
|
|
306
|
-
var day = 1;
|
|
307
|
-
var dayOfNextMonth = 1;
|
|
308
|
-
|
|
309
|
-
for (var i = 0; i < 6; i++) {
|
|
310
|
-
var cWeek = $('<tr/>');
|
|
311
|
-
|
|
312
|
-
for (var j = 0; j < 7; j++) {
|
|
313
|
-
var cDay = $('<td/>');
|
|
314
|
-
|
|
315
|
-
if (i * 7 + j < dWeekDayOfMonthStart) {
|
|
316
|
-
cDay.addClass('cal-gray');
|
|
317
|
-
cDay.html(dLastDayOfPreviousMonth++);
|
|
318
|
-
} else if (day <= dLastDayOfMonth) {
|
|
319
|
-
if (day == dDay && nMonth == dMonth && nYear == dYear) {
|
|
320
|
-
cDay.addClass('cal-today');
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
var count = {
|
|
324
|
-
num: 0,
|
|
325
|
-
keys: []
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
for (var k = 0; k < current.posts.length; k++) {
|
|
329
|
-
var d = new Date(Date.parse(current.posts[k].date));
|
|
330
|
-
|
|
331
|
-
if (d.getDate() == day) {
|
|
332
|
-
count.keys[count.num++] = k;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
if (count.num !== 0) {
|
|
337
|
-
var index = count.keys[0];
|
|
338
|
-
var cLink = $('<a>').attr('href', current.posts[index].link).attr('title', current.posts[index].title).html(day++);
|
|
339
|
-
cDay.append(cLink);
|
|
340
|
-
} else {
|
|
341
|
-
cDay.html(day++);
|
|
342
|
-
}
|
|
343
|
-
} else {
|
|
344
|
-
cDay.addClass('cal-gray');
|
|
345
|
-
cDay.html(dayOfNextMonth++);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
cWeek.append(cDay);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
cMainPad.append(cWeek);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
cBody.append(cWeekHead);
|
|
355
|
-
cBody.append(cFoot);
|
|
356
|
-
cBody.append(cMainPad);
|
|
357
|
-
$(instance).html(cHead);
|
|
358
|
-
$(instance).append(cBody);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
return draw();
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
$.fn.aCalendar = function (Lang, oInit) {
|
|
365
|
-
return this.each(function () {
|
|
366
|
-
return aCalendar(Lang, oInit, $(this));
|
|
367
|
-
});
|
|
368
|
-
}; // plugin defaults
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
$.fn.aCalendar.defaults = {
|
|
372
|
-
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
373
|
-
dayOfWeekShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
|
374
|
-
dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
375
|
-
postsMonthTip: 'Posts published in LMM yyyy',
|
|
376
|
-
titleFormat: 'yyyy LMM',
|
|
377
|
-
titleLinkFormat: '/archives/yyyy/MM/',
|
|
378
|
-
headArrows: {
|
|
379
|
-
previous: '<span class="cal-prev"></span>',
|
|
380
|
-
next: '<span class="cal-next"></span>'
|
|
381
|
-
},
|
|
382
|
-
footArrows: {
|
|
383
|
-
previous: '« ',
|
|
384
|
-
next: ' »'
|
|
385
|
-
},
|
|
386
|
-
weekOffset: 0,
|
|
387
|
-
single: true,
|
|
388
|
-
root: '/calendar/',
|
|
389
|
-
url: '/calendar.json'
|
|
390
|
-
};
|
|
391
|
-
})(jQuery);
|
|
392
|
-
|
|
393
|
-
$(document).ready(function () {
|
|
394
|
-
$("#calendar").aCalendar("zh-CN");
|
|
395
|
-
});
|
|
1
|
+
"use strict";(function(n){var Q=function(w,q,G){var D=new Date,I=D.getDate(),A=D.getMonth(),S=D.getFullYear(),K=I,s=A,u=S,W=G,c=null,l=null,e={posts:[],prev:null,next:null},j="en";V(w);var t=n.extend({},n.fn.aCalendar.defaults,typeof calLanguages>"u"?{}:calLanguages[j],q);t.root[0]!=="/"&&(t.root="/"+t.root),t.root[t.root.length-1]!=="/"&&(t.root+="/");function V(r){r&&typeof calLanguages<"u"&&calLanguages[r]&&(j=r)}function X(){s<11?s++:(s=0,u++),y()}function Z(){s>0?s--:(s=11,u--),y()}function R(r){r&&(u=r.getFullYear(),s=r.getMonth(),y())}function _(){t.single?ee():te()}function ee(){t.url!=null&&t.url!=""&&(c===null&&n.ajax({url:t.url,async:!1,success:function(a){c=a,N(Object.keys(c))}}),c!==null&&Y()&&(e.posts=c[u+"-"+(s+1)]))}function te(){l===null&&n.ajax({url:t.root+"list.json",async:!1,success:function(a){N(a)}}),Y()&&n.ajax({url:t.root+u+"-"+(s+1)+".json",async:!1,success:function(a){e.posts=a}})}function N(r){l=r.map(function(a){var o=a.split("-");return new Date(Date.UTC(+o[0],+o[1]-1))})}function Y(){var r=Date.UTC(u,s);if(l===null||l.length===0||e.posts.length===0&&(e.prev===null&&e.next!==null&&e.next.getTime()>r||e.next===null&&e.prev!==null&&e.prev.getTime()<r))return!1;e.posts=[];for(var a=0;a<l.length;a++){var o=l[a].getTime();if(r===o)return e.prev=a===0?null:l[a-1],e.next=a===l.length-1?null:l[a+1],!0;if(r<o){e.prev=a===0?null:l[a-1],e.next=l[a];break}else e.prev=l[a],e.next=null}return!1}function p(r,a){var o={"LMM+":t.months[r.getMonth()],"MM+":r.getMonth()+1};/(y+)/.test(a)&&(a=a.replace(RegExp.$1,(r.getFullYear()+"").substr(4-RegExp.$1.length)));for(var i in o)new RegExp("("+i+")").test(a)&&(a=a.replace(RegExp.$1,i==="LMM+"?o[i]:("00"+o[i]).substr((""+o[i]).length)));return a}function y(){_();var r=new Date(u,s,1).getDay()-t.weekOffset;r<=0&&(r=6-(r+1)*-1);var a=new Date(u,s+1,0).getDate(),o=new Date(u,s,0).getDate()-r+1,i=n("<div/>").addClass("cal-head"),C=n("<div/>"),L=n("<div/>"),T=n("<div/>").addClass("cal-title");L.html(t.headArrows.previous),C.html(t.headArrows.next),curDate=new Date(Date.UTC(u,s)),e.posts.length===0?T.html(p(curDate,t.titleFormat)):(cTitleLink=n("<a/>").attr("href",p(curDate,t.titleLinkFormat)).attr("title",p(curDate,t.postsMonthTip)).html(p(curDate,t.titleFormat)),T.html(cTitleLink)),L.on("click",Z),C.on("click",X),i.append(L),i.append(T),i.append(C);for(var v=n("<table/>").addClass("cal"),h=t.weekOffset,k=n("<thead/>"),E=n("<tr/>"),f=0;f<7;f++){h>6&&(h=0);var H=n("<th/>").attr("scope","col").attr("title",t.dayOfWeek[h]);H.html(t.dayOfWeekShort[h]),E.append(H),h++}k.append(E),v.append(k);var J=n("<tfoot/>"),M=n("<tr/>"),F=n("<td/>").attr("colspan",3),ae=n("<td/>").html(" "),O=n("<td/>").attr("colspan",3);e.prev&&F.html(t.footArrows.previous+t.months[e.prev.getMonth()]).addClass("cal-foot").attr("title",p(e.prev,t.postsMonthTip)),e.next&&O.html(t.months[e.next.getMonth()]+t.footArrows.next).addClass("cal-foot").attr("title",p(e.next,t.postsMonthTip)),F.on("click",function(){R(e.prev)}),O.on("click",function(){R(e.next)}),M.append(F),M.append(ae),M.append(O),J.append(M);for(var U=n("<tbody/>"),g=1,ne=1,f=0;f<6;f++){for(var B=n("<tr/>"),b=0;b<7;b++){var d=n("<td/>");if(f*7+b<r)d.addClass("cal-gray"),d.html(o++);else if(g<=a){g==K&&A==s&&S==u&&d.addClass("cal-today");for(var m={num:0,keys:[]},x=0;x<e.posts.length;x++){var re=new Date(Date.parse(e.posts[x].date));re.getDate()==g&&(m.keys[m.num++]=x)}if(m.num!==0){var z=m.keys[0],se=n("<a>").attr("href",e.posts[z].link).attr("title",e.posts[z].title).html(g++);d.append(se)}else d.html(g++)}else d.addClass("cal-gray"),d.html(ne++);B.append(d)}U.append(B)}v.append(k),v.append(J),v.append(U),n(W).html(i),n(W).append(v)}return y()};n.fn.aCalendar=function(P,w){return this.each(function(){return Q(P,w,n(this))})},n.fn.aCalendar.defaults={months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["S","M","T","W","T","F","S"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],postsMonthTip:"Posts published in LMM yyyy",titleFormat:"yyyy LMM",titleLinkFormat:"/archives/yyyy/MM/",headArrows:{previous:'<span class="cal-prev"></span>',next:'<span class="cal-next"></span>'},footArrows:{previous:"\xAB ",next:" \xBB"},weekOffset:0,single:!0,root:"/calendar/",url:"/calendar.json"}})(jQuery),$(document).ready(function(){$("#calendar").aCalendar("zh-CN")});
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
loadJs("/js/barrage.js");
|
|
4
|
-
loadJs("/js/calendar.js");
|
|
5
|
-
loadJs("/js/heimu.js");
|
|
6
|
-
loadJs("/js/commentBarrage.js");
|
|
7
|
-
loadJs("/js/bbtalk.js");
|
|
8
|
-
loadJs("/js/resizeTop.js");
|
|
1
|
+
"use strict";loadJs("/js/barrage.js"),loadJs("/js/calendar.js"),loadJs("/js/heimu.js"),loadJs("/js/commentBarrage.js"),loadJs("/js/bbtalk.js"),loadJs("/js/resizeTop.js");
|