q78kgblog 1.0.0
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/.github/workflows/HexoSeoAutoPush.yml +36 -0
- package/404.html +933 -0
- package/BingSiteAuth.xml +4 -0
- package/CNAME +1 -0
- package/about/index.html +1096 -0
- package/archives/2022/06/index.html +942 -0
- package/archives/2022/index.html +942 -0
- package/archives/2023/02/index.html +942 -0
- package/archives/2023/04/index.html +942 -0
- package/archives/2023/05/index.html +942 -0
- package/archives/2023/08/index.html +942 -0
- package/archives/2023/09/index.html +942 -0
- package/archives/2023/index.html +942 -0
- package/archives/2024/01/index.html +942 -0
- package/archives/2024/02/index.html +942 -0
- package/archives/2024/index.html +942 -0
- package/archives/index.html +942 -0
- package/assets/css/APlayer.min.css +3 -0
- package/assets/douban-loading.gif +0 -0
- package/assets/js/APlayer.min.js +2 -0
- package/assets/js/Meting.min.js +1 -0
- package/atom.xml +311 -0
- package/baidusitemap.xml +43 -0
- package/bangumis/index.html +1247 -0
- package/bigpie/index.html +714 -0
- package/bing.json +1 -0
- package/categories/Hello-World/index.html +954 -0
- package/categories/Hexo/index.html +954 -0
- package/categories/index.html +710 -0
- package/categories//345/271/264/347/273/210/346/200/273/347/273/223/index.html +954 -0
- package/categories//346/201/260/351/245/255/index.html +954 -0
- package/categories//347/264/240/346/235/220/index.html +954 -0
- package/categories//351/227/262/350/201/212/346/235/202/350/260/210/index.html +954 -0
- package/content.json +1 -0
- package/css/404page.css +65 -0
- package/css/ariasakablog.css +5632 -0
- package/css/commentBarrage.css +111 -0
- package/css/danmaku.css +89 -0
- package/css/essay.css +306 -0
- package/css/iconfont.css +55 -0
- package/css/iconfont.ttf +0 -0
- package/css/iconfont.woff +0 -0
- package/css/iconfont.woff2 +0 -0
- package/css/index.css +7006 -0
- package/css/people.css +18 -0
- package/css/stylessimple.css +40 -0
- package/css/swiper.min.css +701 -0
- package/css/swiperstyle.css +567 -0
- package/css/var.css +0 -0
- package/essay/index.html +701 -0
- package/favicon.ico +0 -0
- package/fcircle/index.html +733 -0
- package/fontawesome/index.html +716 -0
- package/google.txt +10 -0
- package/googlebe706248808ee393.html +1 -0
- package/img/144.png +0 -0
- package/img/16.png +0 -0
- package/img/1666416625095-iPhone X.png +0 -0
- package/img/1666416702650-Macbook Pro 2016 (1).png +0 -0
- package/img/1666416764216-Nexus 9.png +0 -0
- package/img/180.png +0 -0
- package/img/192.png +0 -0
- package/img/20200904222157.png +0 -0
- package/img/20200924153652.png +0 -0
- package/img/256.png +0 -0
- package/img/36.png +0 -0
- package/img/48.png +0 -0
- package/img/512.png +0 -0
- package/img/72.png +0 -0
- package/img/72645310.jpg +0 -0
- package/img/8DSTSS20990281646044689944.PNG +0 -0
- package/img/96.png +0 -0
- package/img/O35HOG22090681654187900371.jpg +0 -0
- package/img/a.webp +0 -0
- package/img/ad.png +0 -0
- package/img/apple-touch-icon.png +0 -0
- package/img/avatar.jpg +0 -0
- package/img/buYgVO22990681624844309044.jpg +0 -0
- package/img/comment.png +0 -0
- package/img/favicon.ico +0 -0
- package/img/favicon.jpg +0 -0
- package/img/friend_404.gif +0 -0
- package/img/mqaizf23990681654186719414.jpeg +0 -0
- package/img/nyancat.gif +0 -0
- package/img/siteshot.png +0 -0
- package/img/uTools_1666416859497-iMac.png +0 -0
- package/img-col/index.html +802 -0
- package/index.html +1056 -0
- package/js/aplayersave.js +268 -0
- package/js/baiduhistory.js +76 -0
- package/js/bbtalk.js +11354 -0
- package/js/bbtalklunbo.js +78 -0
- package/js/browser.js +35 -0
- package/js/calendar.js +380 -0
- package/js/cate.js +22 -0
- package/js/commentBarrage.js +240 -0
- package/js/commentsCount.js +43 -0
- package/js/copy.js +23 -0
- package/js/countup.js +209 -0
- package/js/cursor.js +82 -0
- package/js/danmaku.js +106 -0
- package/js/day.js +199 -0
- package/js/dianzan.js +249 -0
- package/js/dis.js +255 -0
- package/js/dist/baiduhistory.dev.js +102 -0
- package/js/dist/bbtalk.dev.js +12876 -0
- package/js/dist/bbtalklunbo.dev.js +45 -0
- package/js/dist/calendar.dev.js +395 -0
- package/js/dist/fixbugpjax.dev.js +8 -0
- package/js/dist/gongnong.dev.js +565 -0
- package/js/dist/heimu.dev.js +19 -0
- package/js/dist/links.dev.js +13 -0
- package/js/dist/main.dev.js +845 -0
- package/js/dist/resizeTop.dev.js +50 -0
- package/js/dist/seo.dev.js +33 -0
- package/js/dist/twikoo.all.min.dev.js +1 -0
- package/js/fixbugpjax.js +7 -0
- package/js/fixed_card_widget.js +46 -0
- package/js/fps.js +58 -0
- package/js/gitalker.js +11 -0
- package/js/gsap.min.js +11 -0
- package/js/heimu.js +16 -0
- package/js/hide.show.js +17 -0
- package/js/jike.js +121 -0
- package/js/jikewater.js +60 -0
- package/js/languages.js +511 -0
- package/js/latest.js +49 -0
- package/js/local-search.js +476 -0
- package/js/lunar.js +1071 -0
- package/js/lyxTalk.js +12 -0
- package/js/main.js +783 -0
- package/js/nav.js +30 -0
- package/js/noie.js +3 -0
- package/js/owo.js +52 -0
- package/js/people.js +175 -0
- package/js/pikaday.js +109 -0
- package/js/random.js +1 -0
- package/js/randomFriend.js +95 -0
- package/js/resizeTop.js +43 -0
- package/js/rightmenu.js +335 -0
- package/js/sakura.js +164 -0
- package/js/search/algolia.js +155 -0
- package/js/search/local-search.js +188 -0
- package/js/settings.js +353 -0
- package/js/sitetime.js +25 -0
- package/js/smooth-scrolling.js +546 -0
- package/js/sw-toolbox.js +16 -0
- package/js/swiperinit.js +23 -0
- package/js/tw_cn.js +100 -0
- package/js/twikoo.all.min.js +2 -0
- package/js/utils.js +278 -0
- package/js/welcome.js +107 -0
- package/js/welcomeconsole.js +23 -0
- package/links/index.html +842 -0
- package/live2d-widget/LICENSE +674 -0
- package/live2d-widget/README.md +188 -0
- package/live2d-widget/assets/screenshot-1.png +0 -0
- package/live2d-widget/assets/screenshot-2.png +0 -0
- package/live2d-widget/assets/screenshot-3.png +0 -0
- package/live2d-widget/autoload.js +63 -0
- package/live2d-widget/demo/demo.html +34 -0
- package/live2d-widget/demo/login.html +271 -0
- package/live2d-widget/live2d.min.js +1 -0
- package/live2d-widget/package.json +31 -0
- package/live2d-widget/rollup.config.js +38 -0
- package/live2d-widget/src/index.js +178 -0
- package/live2d-widget/src/message.js +22 -0
- package/live2d-widget/src/model.js +75 -0
- package/live2d-widget/src/tools.js +78 -0
- package/live2d-widget/src/utils.js +5 -0
- package/live2d-widget/src/waifu-tips.js +3 -0
- package/live2d-widget/waifu-tips.js +5 -0
- package/live2d-widget/waifu-tips.json +255 -0
- package/live2d-widget/waifu.css +310 -0
- package/manifest.json +1 -0
- package/noie.html +69 -0
- package/othersite/index.html +779 -0
- package/owo.json +1 -0
- package/package.json +1 -0
- package/people.html +24 -0
- package/posts/164ef646/index.html +1027 -0
- package/posts/228c2ef8/index.html +1014 -0
- package/posts/4a17b156/index.html +1010 -0
- package/posts/6f3c565b/index.html +1013 -0
- package/posts/7da7c3f6/index.html +1070 -0
- package/posts/a9a6c1fb/index.html +1041 -0
- package/posts/c262e439/index.html +1002 -0
- package/posts/c81531cf/index.html +1080 -0
- package/posts/da2093a1/index.html +1022 -0
- package/posts/e54f7476/index.html +1052 -0
- package/projects.html +424 -0
- package/random.html +32 -0
- package/robots.txt +17 -0
- package/search.xml +309 -0
- package/sitemap.txt +62 -0
- package/sitemap.xml +488 -0
- package/sw.js +190 -0
- package/swReg.js +29 -0
- package/tags/AI/index.html +955 -0
- package/tags/Butterfly/index.html +955 -0
- package/tags/Cloudflare/index.html +955 -0
- package/tags/DiffSinger/index.html +955 -0
- package/tags/Hexo/index.html +955 -0
- package/tags/Next/index.html +955 -0
- package/tags/RAID/index.html +955 -0
- package/tags/VPS/index.html +955 -0
- package/tags/Vercel/index.html +955 -0
- package/tags/Workers/index.html +955 -0
- package/tags/hello-world/index.html +955 -0
- package/tags/index.html +710 -0
- package/tags//344/270/273/351/242/230/index.html +955 -0
- package/tags//344/272/221/346/234/215/345/212/241/345/231/250/index.html +955 -0
- package/tags//344/276/277/345/256/234/index.html +955 -0
- package/tags//345/206/231/344/275/234/index.html +955 -0
- package/tags//345/245/263/346/200/247/346/204/217/350/257/206/index.html +955 -0
- package/tags//345/255/246/344/271/240/index.html +955 -0
- package/tags//345/256/266/351/207/214/344/272/221/index.html +955 -0
- package/tags//345/271/264/347/273/210/346/200/273/347/273/223/index.html +955 -0
- package/tags//346/200/247/344/273/267/346/257/224/index.html +955 -0
- package/tags//346/212/230/350/205/276/index.html +955 -0
- package/tags//346/217/220/344/276/233/345/225/206/index.html +955 -0
- package/tags//346/227/245/345/270/270/index.html +955 -0
- package/tags//346/234/215/345/212/241/345/231/250/index.html +955 -0
- package/tags//346/265/252/346/275/256/index.html +955 -0
- package/tags//347/256/200/347/210/261/index.html +955 -0
- package/tags//350/207/252/345/212/250/346/240/207/346/263/250/index.html +955 -0
- package/tags//350/256/272/346/226/207/index.html +955 -0
- package/tags//350/260/267/346/255/214/347/277/273/350/257/221/index.html +955 -0
- package/tags//350/264/237/350/275/275/345/235/207/350/241/241/index.html +955 -0
- package/tags//351/207/221/345/217/245/index.html +955 -0
- package/tags//351/255/224/346/224/271/index.html +955 -0
@@ -0,0 +1,45 @@
|
|
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
|
+
};
|
@@ -0,0 +1,395 @@
|
|
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
|
+
});
|