├── .gitattributes
├── .gitignore
├── README.md
├── install.js
├── package.json
├── public
├── admin.html
├── css
│ └── style.css
├── donate.html
├── favicon.ico
├── font
│ ├── blogile.eot
│ ├── blogile.svg
│ ├── blogile.ttf
│ └── blogile.woff
└── js
│ ├── admin.js
│ ├── ajax.js
│ └── scripts.js
├── server.js
├── setpw.js
└── views
├── 404.jade
├── index.jade
└── post.jade
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Directory for instrumented libs generated by jscoverage/JSCover
11 | lib-cov
12 |
13 | # Coverage directory used by tools like istanbul
14 | coverage
15 |
16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17 | .grunt
18 |
19 | # Compiled binary addons (http://nodejs.org/api/addons.html)
20 | build/Release
21 |
22 | # Dependency directory
23 | # Commenting this out is preferred by some people, see
24 | # https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
25 | node_modules
26 |
27 | # Users Environment Variables
28 | .lock-wscript
29 |
30 | # =========================
31 | # Operating System Files
32 | # =========================
33 |
34 | # OSX
35 | # =========================
36 |
37 | .DS_Store
38 | .AppleDouble
39 | .LSOverride
40 |
41 | # Icon must end with two \r
42 | Icon
43 |
44 | # Thumbnails
45 | ._*
46 |
47 | # Files that might appear on external disk
48 | .Spotlight-V100
49 | .Trashes
50 |
51 | # Directories potentially created on remote AFP share
52 | .AppleDB
53 | .AppleDesktop
54 | Network Trash Folder
55 | Temporary Items
56 | .apdisk
57 |
58 | # Windows
59 | # =========================
60 |
61 | # Windows image file caches
62 | Thumbs.db
63 | ehthumbs.db
64 |
65 | # Folder config file
66 | Desktop.ini
67 |
68 | # Recycle Bin used on file shares
69 | $RECYCLE.BIN/
70 |
71 | # Windows Installer files
72 | *.cab
73 | *.msi
74 | *.msm
75 | *.msp
76 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is my first time using node .... so ...
2 | I will re-implement it with other language in the future....
3 |
--------------------------------------------------------------------------------
/install.js:
--------------------------------------------------------------------------------
1 | var mysql = require('mysql');
2 | var pw;
3 | if(process.argv[5]!="no"){
4 | pw = process.argv[5];
5 | }
6 | var connection = mysql.createConnection({
7 | host : process.argv[2],
8 | port : process.argv[3],
9 | user : process.argv[4],
10 | password : pw,
11 | database : process.argv[6]
12 | });
13 |
14 | var dbengine = "InnoDB";
15 | if(process.argv[7]){
16 | dbengine = process.argv[7];
17 | }
18 | connection.connect(function(err) {
19 | if(err != null){
20 | console.log("Mysql Connect error:");
21 | console.log(err);
22 | process.exit(0);
23 | }else{
24 | console.log("Mysql Connected!");
25 | runsql("SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO'");
26 | runsql("CREATE TABLE IF NOT EXISTS `bi_categorys` ( `id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(50) NOT NULL,`url_short` varchar(50) NOT NULL,PRIMARY KEY (`id`)) ENGINE="+ dbengine +" DEFAULT CHARSET=utf8 AUTO_INCREMENT=1");
27 | runsql("CREATE TABLE IF NOT EXISTS `bi_links` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `url` varchar(200) NOT NULL, `rel` varchar(20) NOT NULL, PRIMARY KEY (`id`)) ENGINE="+ dbengine +" DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ");
28 | runsql("CREATE TABLE IF NOT EXISTS `bi_posts` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `time` int(10) NOT NULL, `title` text NOT NULL, `content` longtext NOT NULL, `shortname` VARCHAR(50) NOT NULL , `category` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `category` (`category`)) ENGINE="+ dbengine +" DEFAULT CHARSET=utf8 AUTO_INCREMENT=2");
29 | runsql("ALTER TABLE `bi_posts` ADD UNIQUE (`shortname`);");
30 | runsql("INSERT INTO `bi_posts` (`id`, `time`, `title`, `content`, `shortname`,`category`) VALUES(1, 1415303515, 'Sample Post', 'This is a sample post generate by system. Delete or Edit it now !','sample-post', 0)");
31 |
32 | console.log("Install Success!");
33 | process.exit(0);
34 | }
35 | });
36 |
37 | function runsql(sql){
38 | connection.query(sql, function(err) {
39 | if(err) throw err;
40 | });
41 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "blogile",
3 | "version": "0.1.4",
4 | "description": "A simple lightweight blog system.",
5 | "main": "server.js",
6 | "repository": "git://github.com/typcn/Blogile.git",
7 | "author": "TYPCN ",
8 | "dependencies": {
9 | "async": "~0.2.8",
10 | "express": "~4.10.1",
11 | "jade": "~1.7.0",
12 | "marked": "~0.3.2",
13 | "memory-cache": "~0.0.5",
14 | "mysql": "~2.5.2",
15 | "sha1": "~1.1.0",
16 | "body-parser": "~1.9.2",
17 | "cookie-parser": "~1.3.3",
18 | "wait.for": "~0.6.6",
19 | "highlight.js": "~8.3.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/public/admin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Blogile Manager
5 |
8 |
9 |
10 |
11 |
12 |
28 |
75 |
132 |
133 |
--------------------------------------------------------------------------------
/public/css/style.css:
--------------------------------------------------------------------------------
1 | /*
2 | Blogile Default StyleSheet V0.1
3 | By:typcn
4 | Site:http://blog.eqoe.cn
5 | */
6 |
7 | body, input, select, textarea {
8 | color: #646464;
9 | font-family: "Heiti SC","Microsoft YaHei";
10 | font-size: 15pt;
11 | font-weight: 300;
12 | line-height: 1.75em;
13 | text-shadow: 0px 0px 0.3px #999;
14 | background-color:#f2f2f2;
15 | }
16 | h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
17 | color: inherit;
18 | text-decoration: none;
19 | }
20 | img{
21 | max-width:100%;
22 | }
23 | #header h1 a img{
24 | margin-top:10px;
25 | }
26 | input[type=text], input[type=password], select, textarea {
27 | -webkit-appearance: none;
28 | width: 100%;
29 | border: 0;
30 | padding: 0.70em 1em;
31 | font-size: 1em;
32 | border-radius: 6px;
33 | background: rgba(0,0,0,0.03);
34 | border: 1px solid rgba(0,0,0,0);
35 | -moz-transition: background-color 0.25s ease-in-out, border-color 0.35s ease-in-out;
36 | -webkit-transition: background-color 0.25s ease-in-out, border-color 0.35s ease-in-out;
37 | -o-transition: background-color 0.25s ease-in-out, border-color 0.35s ease-in-out;
38 | -ms-transition: background-color 0.25s ease-in-out, border-color 0.35s ease-in-out;
39 | transition: background-color 0.25s ease-in-out, border-color 0.35s ease-in-out;
40 | outline: none;
41 | color: #888787;
42 | margin-top:1em;
43 | }
44 | input[type="text"]:focus,
45 | input[type="password"]:focus,
46 | input[type="email"]:focus,
47 | select:focus,
48 | textarea:focus {
49 | background: rgba(224, 224, 224, 0.15);
50 | border-color: #66CCFF;
51 | }
52 | .button {
53 | -moz-appearance: none;
54 | -webkit-appearance: none;
55 | -o-appearance: none;
56 | -ms-appearance: none;
57 | appearance: none;
58 | -moz-transition: background-color 0.2s ease-in-out !important;
59 | -webkit-transition: background-color 0.2s ease-in-out !important;
60 | -o-transition: background-color 0.2s ease-in-out !important;
61 | -ms-transition: background-color 0.2s ease-in-out !important;
62 | transition: background-color 0.2s ease-in-out !important;
63 | background-color: none;
64 | border-radius: 6px;
65 | border: solid 1px;
66 | color: inherit;
67 | cursor: pointer;
68 | display: inline-block;
69 | font-size: 0.8em;
70 | font-weight: 900;
71 | letter-spacing: 2px;
72 | min-width: 18em;
73 | padding: 0 0.75em;
74 | line-height: 3.75em;
75 | text-align: center;
76 | text-decoration: none;
77 | text-transform: uppercase;
78 | }
79 | .button:hover {
80 | color:inherit !important;
81 | background-color: rgba(188, 202, 206, 0.15);
82 | }
83 |
84 | #header {
85 | background-color: #fff;
86 | box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
87 | color: inherit;
88 | cursor: default;
89 | height: 3em;
90 | left: 0;
91 | line-height: 3em;
92 | position: fixed;
93 | top: 0;
94 | width: 100%;
95 | z-index: 10000;
96 | }
97 | #header h1 {
98 | color: inherit;
99 | font-size: 1.5em;
100 | height: inherit;
101 | left: 1.25em;
102 | line-height: inherit;
103 | margin: 0;
104 | padding: 0;
105 | position: absolute;
106 | top: 0;
107 | }
108 | #header #nav {
109 | height: inherit;
110 | line-height: inherit;
111 | position: absolute;
112 | right: 1.5em;
113 | top: 0;
114 | vertical-align: middle;
115 | -webkit-user-select:none
116 | }
117 | #header #nav ul {
118 | list-style: none;
119 | margin: 0;
120 | padding-left: 0;
121 | }
122 | #header #nav ul li{
123 | color: inherit;
124 | border-radius: 0.5em;
125 | display: inline-block;
126 | margin-left: 2em;
127 | padding-left: 0;
128 | -webkit-transition:color 0.3s linear;
129 | -moz-transition:color 0.3s linear;
130 | -o-transition:color 0.3s linear;
131 | }
132 | #header #nav ul li:first-child {
133 | margin-left: 0;
134 | }
135 | #header #nav ul li:hover {
136 | color:#66CCFF;
137 | transition:color 0.3s linear;
138 | -webkit-transition:color 0.3s linear;
139 | -moz-transition:color 0.3s linear;
140 | -o-transition:color 0.3s linear;
141 | }
142 | #header #nav ul li .current {
143 | color:#66CCFF;
144 | }
145 | #header #nav ul li a {
146 | border: 0;
147 | color: inherit;
148 | display: inline-block;
149 | text-decoration: none;
150 | }
151 | #header #nav .menu{
152 | display:none;
153 | }
154 | #main{
155 | margin-top:4em;
156 | }
157 | #main > ul > li a{
158 | text-decoration:none;
159 | color:inherit;
160 | transition:color 0.3s linear;
161 | -webkit-transition:color 0.3s linear;
162 | -moz-transition:color 0.3s linear;
163 | -o-transition:color 0.3s linear;
164 | }
165 | #main > ul > li a:hover{
166 | color:#66CCFF;
167 | transition:color 0.3s linear;
168 | -webkit-transition:color 0.3s linear;
169 | -moz-transition:color 0.3s linear;
170 | -o-transition:color 0.3s linear;
171 | }
172 | #main > ul{
173 | float:left;
174 | margin-left:2%;
175 | padding:0;
176 | list-style: none;
177 | }
178 | #main > ul > li{
179 | position: relative;
180 | background: #ffffff;
181 | border-radius: 0.5em;
182 | padding:0.5em 1em;
183 | margin-top:1em;
184 | }
185 | #main > ul > li:first-child{
186 | margin-top:0;
187 | }
188 | #main > ul > li #container{
189 | display:table;
190 | width:100%;
191 | }
192 | #main > ul > li #container img{
193 | float:left;
194 | margin-right:1em;
195 | }
196 | #main > ul > li #container p{
197 | margin:0;
198 | word-break:break-all;
199 | }
200 | ul.links{
201 | list-style:none;
202 | padding:0;
203 | }
204 | .postlist{
205 | width:70%;
206 | overflow:hidden;
207 | }
208 | .postlist li a h1{
209 | word-break:break-all;
210 | }
211 | .sidebar{
212 | width:25%;
213 | }
214 | .sidebar li h3{
215 | margin-top:0.5em;
216 | }
217 | .postitle{
218 | text-align:center;
219 | }
220 | .postitle > span{
221 | margin-left:1em;
222 | }
223 | .postitle > span:first-child{
224 | margin-left:0;
225 | }
226 | .postarch{
227 | margin-bottom:0;
228 | text-align:right;
229 | font-size:0.8em;
230 | }
231 | .postarch > span{
232 | margin-left:1em;
233 | }
234 | .ds-top-threads{
235 | list-style:none;
236 | padding:0;
237 | }
238 | .ds-top-threads > li ,.links > li{
239 | border-top:solid 1px rgba(0,0,0,0.1);
240 | }
241 | .ds-top-threads > li:first-child , .links > li:first-child{
242 | border-top:0;
243 | }
244 | #ds-notify{
245 | top:5em !important;
246 | }
247 | #ds-recent-visitors .ds-avatar{
248 | display:inline-block !important;
249 | }
250 | #ds-recent-visitors{
251 | max-height:120px;
252 | overflow:hidden;
253 | }
254 | .ds-avatar img{
255 | margin:0 !important;
256 | }
257 | #pageNav{
258 | width:100%;
259 | height:60px;
260 | text-align: center;
261 | }
262 | .button.pagenav{
263 | display:none;
264 | min-width:32px;
265 | border-radius:0;
266 | border-left:0;
267 | }
268 | .button.pagenav:first-child{
269 | border-left:solid 1px;
270 | border-top-left-radius:6px;
271 | border-bottom-left-radius:6px;
272 | }
273 | .button.pagenav:last-child{
274 | border-top-right-radius:6px;
275 | border-bottom-right-radius:6px;
276 | }
277 | .button.pagenav:hover,.button.pagenav.current{
278 | background-color: #66CCFF;
279 | color:#ffffff !important;
280 | border-color:#646464 !important;
281 | }
282 | .button.pagenav.show{
283 | display:inline-block !important;
284 | }
285 | .tool{
286 | cursor:pointer;
287 | }
288 | .tool a{
289 | position: fixed;
290 | right:2%;
291 | bottom:2%;
292 | background-color:#fff;
293 | border-radius: 6px;
294 | padding:1em;
295 | width:28px;
296 | height:20px;
297 | line-height:1em;
298 | border:solid 1px rgba(0,0,0,0.2);
299 | background-color: #fff;
300 | z-index:9999;
301 | }
302 | .tool a:hover{
303 | color:#66CCFF;
304 | }
305 | .tool a i:before{
306 | -webkit-transition:color 0.3s linear;
307 | -moz-transition:color 0.3s linear;
308 | -o-transition:color 0.3s linear;
309 | }
310 | #backtop{
311 | display:none;
312 | }
313 | .copyright{
314 | text-align: center;
315 | }
316 | .copyright p{
317 | margin:0;
318 | font-size:0.7em;
319 | }
320 | @media screen and (max-width: 1023px){
321 | .postlist{
322 | width:97%;
323 | }
324 | .sidebar{
325 | width:97%;
326 | }
327 | #header #nav .menu{
328 | display: block;
329 | position: absolute;
330 | right: 2px;
331 | top: 1em;
332 | }
333 | #header #nav .menu span{
334 | display: block;
335 | margin: 4px 0px 4px 0px;
336 | height: 2px;
337 | background: #646464;
338 | width: 25px;
339 | }
340 | #header #nav ul{
341 | display:none;
342 | position:fixed;
343 | top:3em;
344 | left:0;
345 | }
346 | #header #nav ul li{
347 | display:block;
348 | background-color:#ffffff;
349 | margin-left:0;
350 | text-align:center;
351 | }
352 | }
353 |
354 | @media screen and (max-width: 800px){
355 | .postitle > span{
356 | margin-left:0;
357 | display:block;
358 | }
359 | .postitle > span span{
360 | display:inline-block;
361 | width:185px;
362 | text-align:left;
363 | margin-left:2px;
364 | white-space:nowrap;
365 | overflow:visible;
366 | }
367 | .postlist li a h1,.postitle h1{
368 | font-size:1em;
369 | }
370 | #main > ul > li #container img{
371 | width:100%;
372 | float:none;
373 | }
374 | #main > ul > li #container p{
375 | max-height:144px;
376 | font-size:0.8em;
377 | overflow:hidden;
378 | }
379 | .postarch{
380 | line-height: 1em;
381 | }
382 | .postarch > span{
383 | display:block;
384 | font-size:0.6em;
385 | }
386 | .postarch > span span{
387 | display: inline-block;
388 | width:95px;
389 | white-space: nowrap;
390 | }
391 | .postcontent blockquote{
392 | padding:0;
393 | }
394 | }
395 |
396 | @media screen and (min-width: 1023px){
397 | #header #nav ul {
398 | width:auto !important;
399 | display:block !important;
400 | }
401 | }
402 | @font-face {
403 | font-family: 'blogile';
404 | src: url('../font/blogile.eot?73970392');
405 | src: url('../font/blogile.eot?73970392#iefix') format('embedded-opentype'),
406 | url('../font/blogile.woff?73970392') format('woff'),
407 | url('../font/blogile.ttf?73970392') format('truetype'),
408 | url('../font/blogile.svg?73970392#blogile') format('svg');
409 | font-weight: normal;
410 | font-style: normal;
411 | }
412 |
413 | [class^="icon-"]:before, [class*=" icon-"]:before {
414 | font-family: "blogile";
415 | font-style: normal;
416 | font-weight: normal;
417 | speak: none;
418 |
419 | display: inline-block;
420 | text-decoration: inherit;
421 | width: 1em;
422 | margin-right: .2em;
423 | text-align: center;
424 | font-variant: normal;
425 | text-transform: none;
426 | line-height: 1em;
427 | margin-left: .2em;
428 |
429 | }
430 |
431 | .icon-calendar:before { content: '\e800'; } /* '' */
432 | .icon-user:before { content: '\e801'; } /* '' */
433 | .icon-upload:before { content: '\e802'; } /* '' */
434 | .icon-pencil:before { content: '\e803'; } /* '' */
435 | .icon-ok:before { content: '\e804'; } /* '' */
436 | .icon-briefcase:before { content: '\e805'; } /* '' */
437 | .icon-comment:before { content: '\e806'; } /* '' */
438 | .icon-search:before { content: '\e807'; } /* '' */
439 | .icon-up-open:before { content: '\e808'; } /* '' */
440 | .icon-down-open:before { content: '\e809'; } /* '' */
441 | .icon-right-open:before { content: '\e80a'; } /* '' */
442 | .icon-left-open:before { content: '\e80b'; } /* '' */
443 |
444 |
445 | /* Markdown Style */
446 | .postcontent a{
447 | color:#66CCFF !important;
448 | }
449 | .postcontent a:hover{
450 | color:#428EFF !important;
451 | }
452 | .postcontent table {
453 | margin: 10px 0 15px 0;
454 | border-collapse: collapse;
455 | }
456 | .postcontent td,th {
457 | border: 1px solid #ddd;
458 | padding: 3px 10px;
459 | }
460 | .postcontent th {
461 | padding: 5px 10px;
462 | }
463 | .postcontent a img {
464 | border: none;
465 | }
466 | .postcontent p {
467 | margin-bottom: 9px;
468 | }
469 | .postcontent h1,
470 | .postcontent h2,
471 | .postcontent h3,
472 | .postcontent h4,
473 | .postcontent h5,
474 | .postcontent h6 {
475 | color: #404040;
476 | line-height: 36px;
477 | }
478 | .postcontent h1 {
479 | margin-bottom: 18px;
480 | font-size: 30px;
481 | }
482 | .postcontent h2 {
483 | font-size: 24px;
484 | }
485 | .postcontent h3 {
486 | font-size: 18px;
487 | }
488 | .postcontent h4 {
489 | font-size: 16px;
490 | }
491 | .postcontent h5 {
492 | font-size: 14px;
493 | }
494 | .postcontent h6 {
495 | font-size: 13px;
496 | }
497 | .postcontent hr {
498 | margin: 0 0 19px;
499 | border: 0;
500 | border-bottom: 1px solid #ccc;
501 | }
502 | .postcontent blockquote {
503 | padding: 13px 13px 21px 15px;
504 | margin-bottom: 18px;
505 | font-family:georgia,serif;
506 | font-style: italic;
507 | }
508 | .postcontent blockquote:before {
509 | content:"\201C";
510 | font-size:40px;
511 | margin-left:-10px;
512 | font-family:georgia,serif;
513 | color:#eee;
514 | }
515 | .postcontent blockquote p {
516 | font-size: 14px;
517 | font-weight: 300;
518 | line-height: 18px;
519 | margin-bottom: 0;
520 | font-style: italic;
521 | }
522 | .postcontent code, pre {
523 | font-family: Monaco, Andale Mono, Courier New, monospace;
524 | }
525 | .postcontent code {
526 | background-color: #fee9cc;
527 | color: rgba(0, 0, 0, 0.75);
528 | padding: 1px 3px;
529 | font-size: 12px;
530 | -webkit-border-radius: 3px;
531 | -moz-border-radius: 3px;
532 | border-radius: 3px;
533 | }
534 | .postcontent pre {
535 | display: block;
536 | padding: 14px;
537 | margin: 0 0 18px;
538 | line-height: 16px;
539 | font-size: 11px;
540 | border: 1px solid #d9d9d9;
541 | white-space: pre-wrap;
542 | word-wrap: break-word;
543 | }
544 | .postcontent pre code {
545 | background-color: #fff;
546 | color:#737373;
547 | font-size: 14px;
548 | padding: 0;
549 | }
550 | .postcontent sup {
551 | font-size: 0.83em;
552 | vertical-align: super;
553 | line-height: 0;
554 | }
555 | .postcontent iframe{
556 | max-width:100%;
557 | border: 1px solid #66CCFF;
558 | }
559 | .postcontent * {
560 | -webkit-print-color-adjust: exact;
561 | }
562 | @media print {
563 | body,code,pre code,h1,h2,h3,h4,h5,h6 {
564 | color: black;
565 | }
566 | .postcontent table, pre {
567 | page-break-inside: avoid;
568 | }
569 | }
570 |
571 | /* Code Hightlight Style */
572 | /* Tomorrow Comment */
573 | .hljs-comment,
574 | .hljs-title {
575 | color: #8e908c;
576 | }
577 |
578 | /* Tomorrow Red */
579 | .hljs-variable,
580 | .hljs-attribute,
581 | .hljs-tag,
582 | .hljs-regexp,
583 | .ruby .hljs-constant,
584 | .xml .hljs-tag .hljs-title,
585 | .xml .hljs-pi,
586 | .xml .hljs-doctype,
587 | .html .hljs-doctype,
588 | .css .hljs-id,
589 | .css .hljs-class,
590 | .css .hljs-pseudo {
591 | color: #c82829;
592 | }
593 |
594 | /* Tomorrow Orange */
595 | .hljs-number,
596 | .hljs-preprocessor,
597 | .hljs-pragma,
598 | .hljs-built_in,
599 | .hljs-literal,
600 | .hljs-params,
601 | .hljs-constant {
602 | color: #f5871f;
603 | }
604 |
605 | /* Tomorrow Yellow */
606 | .ruby .hljs-class .hljs-title,
607 | .css .hljs-rules .hljs-attribute {
608 | color: #eab700;
609 | }
610 |
611 | /* Tomorrow Green */
612 | .hljs-string,
613 | .hljs-value,
614 | .hljs-inheritance,
615 | .hljs-header,
616 | .ruby .hljs-symbol,
617 | .xml .hljs-cdata {
618 | color: #718c00;
619 | }
620 |
621 | /* Tomorrow Aqua */
622 | .css .hljs-hexcolor {
623 | color: #3e999f;
624 | }
625 |
626 | /* Tomorrow Blue */
627 | .hljs-function,
628 | .python .hljs-decorator,
629 | .python .hljs-title,
630 | .ruby .hljs-function .hljs-title,
631 | .ruby .hljs-title .hljs-keyword,
632 | .perl .hljs-sub,
633 | .javascript .hljs-title,
634 | .coffeescript .hljs-title {
635 | color: #4271ae;
636 | }
637 |
638 | /* Tomorrow Purple */
639 | .hljs-keyword,
640 | .javascript .hljs-function {
641 | color: #8959a8;
642 | }
643 |
644 | .hljs {
645 | display: block;
646 | overflow-x: auto;
647 | background: white;
648 | color: #4d4d4c;
649 | padding: 0.5em;
650 | -webkit-text-size-adjust: none;
651 | }
652 |
653 | .coffeescript .javascript,
654 | .javascript .xml,
655 | .tex .hljs-formula,
656 | .xml .javascript,
657 | .xml .vbscript,
658 | .xml .css,
659 | .xml .hljs-cdata {
660 | opacity: 0.5;
661 | }
662 |
663 | @-webkit-keyframes swingInX{0%{-webkit-transform:perspective(400px) rotateX(-90deg)}100%{-webkit-transform:perspective(400px) rotateX(0deg)}}@-moz-keyframes swingInX{0%{-moz-transform:perspective(400px) rotateX(-90deg)}100%{-moz-transform:perspective(400px) rotateX(0deg)}}@-o-keyframes swingInX{0%{-o-transform:perspective(400px) rotateX(-90deg)}100%{-o-transform:perspective(400px) rotateX(0deg)}}@keyframes swingInX{0%{transform:perspective(400px) rotateX(-90deg)}100%{transform:perspective(400px) rotateX(0deg)}}.animated.swingInX{-webkit-transform-origin:top;-moz-transform-origin:top;-ie-transform-origin:top;-o-transform-origin:top;transform-origin:top;-webkit-backface-visibility:visible!important;-webkit-animation-name:swingInX;-moz-backface-visibility:visible!important;-moz-animation-name:swingInX;-o-backface-visibility:visible!important;-o-animation-name:swingInX;backface-visibility:visible!important;animation-name:swingInX}@-webkit-keyframes swingOutX{0%{-webkit-transform:perspective(400px) rotateX(0deg)}100%{-webkit-transform:perspective(400px) rotateX(-90deg)}}@-moz-keyframes swingOutX{0%{-moz-transform:perspective(400px) rotateX(0deg)}100%{-moz-transform:perspective(400px) rotateX(-90deg)}}@-o-keyframes swingOutX{0%{-o-transform:perspective(400px) rotateX(0deg)}100%{-o-transform:perspective(400px) rotateX(-90deg)}}@keyframes swingOutX{0%{transform:perspective(400px) rotateX(0deg)}100%{transform:perspective(400px) rotateX(-90deg)}}.animated.swingOutX{-webkit-transform-origin:top;-webkit-animation-name:swingOutX;-webkit-backface-visibility:visible!important;-moz-animation-name:swingOutX;-moz-backface-visibility:visible!important;-o-animation-name:swingOutX;-o-backface-visibility:visible!important;animation-name:swingOutX;backface-visibility:visible!important}
664 | .animated {
665 | -webkit-animation-duration: .5s;
666 | -moz-animation-duration: .5s;
667 | -o-animation-duration: .5s;
668 | animation-duration: .5s;
669 | -webkit-animation-fill-mode: both;
670 | -moz-animation-fill-mode: both;
671 | -o-animation-fill-mode: both;
672 | animation-fill-mode: both
673 | }
674 |
675 | .container {
676 | display: none;
677 | }
678 |
679 | .container.show {
680 | display: block;
681 | }
682 |
683 | .pageload-overlay {
684 | position: fixed;
685 | width: 100%;
686 | height: 100%;
687 | top: 0;
688 | left: 0;
689 | visibility: hidden;
690 | }
691 |
692 | .pageload-overlay.show {
693 | visibility: visible;
694 | }
695 |
696 | .pageload-overlay svg {
697 | position: absolute;
698 | top: 0;
699 | left: 0;
700 | pointer-events: none;
701 | }
702 |
703 | .pageload-overlay svg path {
704 | fill: #fff;
705 | }
706 |
707 | .pageload-overlay::after,
708 | .pageload-overlay::before {
709 | content: '';
710 | position: fixed;
711 | width: 20px;
712 | height: 20px;
713 | top: 50%;
714 | left: 50%;
715 | margin: -10px 0 0 -10px;
716 | border-radius: 50%;
717 | visibility: hidden;
718 | opacity: 0;
719 | z-index: 1000;
720 | -webkit-transition: opacity 0.15s, visibility 0s 0.15s;
721 | transition: opacity 0.15s, visibility 0s 0.15s;
722 | }
723 |
724 | .pageload-overlay::after {
725 | background: #6cc88a;
726 | -webkit-transform: translateX(-20px);
727 | transform: translateX(-20px);
728 | -webkit-animation: moveRight 0.6s linear infinite alternate;
729 | animation: moveRight 0.6s linear infinite alternate;
730 | }
731 |
732 | .pageload-overlay::before {
733 | background: #4fc3f7;
734 | -webkit-transform: translateX(20px);
735 | transform: translateX(20px);
736 | -webkit-animation: moveLeft 0.6s linear infinite alternate;
737 | animation: moveLeft 0.6s linear infinite alternate;
738 | }
739 |
740 | @-webkit-keyframes moveRight {
741 | to { -webkit-transform: translateX(20px); }
742 | }
743 |
744 | @keyframes moveRight {
745 | to { transform: translateX(20px); }
746 | }
747 |
748 | @-webkit-keyframes moveLeft {
749 | to { -webkit-transform: translateX(-20px); }
750 | }
751 |
752 | @keyframes moveLeft {
753 | to { transform: translateX(-20px); }
754 | }
755 |
756 | .pageload-loading.pageload-overlay::after,
757 | .pageload-loading.pageload-overlay::before {
758 | opacity: 1;
759 | visibility: visible;
760 | -webkit-transition: opacity 0.3s;
761 | transition: opacity 0.3s;
762 | }
763 |
764 | .copyright p{
765 | line-height: 1.2em;
766 | }
767 |
768 | #tipinfo{
769 | position:absolute;
770 | bottom:4em;
771 | left:50%;
772 | width:auto;
773 | background:#FFFFFF;
774 | padding:10px;
775 | border-radius: 10px;
776 | border: 1px solid #66CCFF;
777 | display:none;
778 | max-width: 80%;
779 | transform:translate(-50%,-50%);
780 | -webkit-transform:translate(-50%,-50%);
781 | -moz-transform:translate(-50%,-50%);
782 | -ms-transform:translate(-50%,-50%);
783 | }
784 | #searchword{
785 | width:80%;
786 | float:left;
787 | margin:0;
788 | margin-bottom:16px;
789 | margin-top:16px;
790 | display: inline-block;
791 | box-sizing: border-box;
792 | }
793 | #search{
794 | width:15%;
795 | float:right;
796 | min-width:0 !important;
797 | box-sizing: border-box;
798 | margin-bottom:16px;
799 | margin-top:16px;
800 | }
801 | @media screen and (max-width: 1400px){
802 | #searchword{
803 | width:70%;
804 | }
805 | #search{
806 | width:60px;
807 | }
808 | }
--------------------------------------------------------------------------------
/public/donate.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Donate TYPCN
5 |
8 |
9 |
10 |
11 |
12 |
23 |
24 |
25 | -
26 |
捐助
27 | 支付宝: 1-2136749961
28 | PayPal: web@typcn.com
29 | Bitcoin: 1EprnUzBwcF52SZAnPZKRrj4rRaS6yhtQW
30 |
31 |
32 |
33 |
36 |
37 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/typcn/Blogile/7bdcc72af426cc10837eb84b7a2c9f4ad2067382/public/favicon.ico
--------------------------------------------------------------------------------
/public/font/blogile.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/typcn/Blogile/7bdcc72af426cc10837eb84b7a2c9f4ad2067382/public/font/blogile.eot
--------------------------------------------------------------------------------
/public/font/blogile.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/public/font/blogile.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/typcn/Blogile/7bdcc72af426cc10837eb84b7a2c9f4ad2067382/public/font/blogile.ttf
--------------------------------------------------------------------------------
/public/font/blogile.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/typcn/Blogile/7bdcc72af426cc10837eb84b7a2c9f4ad2067382/public/font/blogile.woff
--------------------------------------------------------------------------------
/public/js/admin.js:
--------------------------------------------------------------------------------
1 | /*
2 | MD5 Script
3 | Thanks for myersdaily.org
4 | */
5 | function md5cycle(x,k){var a=x[0],b=x[1],c=x[2],d=x[3];a=ff(a,b,c,d,k[0],7,-680876936);d=ff(d,a,b,c,k[1],12,-389564586);c=ff(c,d,a,b,k[2],17,606105819);b=ff(b,c,d,a,k[3],22,-1044525330);a=ff(a,b,c,d,k[4],7,-176418897);d=ff(d,a,b,c,k[5],12,1200080426);c=ff(c,d,a,b,k[6],17,-1473231341);b=ff(b,c,d,a,k[7],22,-45705983);a=ff(a,b,c,d,k[8],7,1770035416);d=ff(d,a,b,c,k[9],12,-1958414417);c=ff(c,d,a,b,k[10],17,-42063);b=ff(b,c,d,a,k[11],22,-1990404162);a=ff(a,b,c,d,k[12],7,1804603682);d=ff(d,a,b,c,k[13],12,-40341101);c=ff(c,d,a,b,k[14],17,-1502002290);b=ff(b,c,d,a,k[15],22,1236535329);a=gg(a,b,c,d,k[1],5,-165796510);d=gg(d,a,b,c,k[6],9,-1069501632);c=gg(c,d,a,b,k[11],14,643717713);b=gg(b,c,d,a,k[0],20,-373897302);a=gg(a,b,c,d,k[5],5,-701558691);d=gg(d,a,b,c,k[10],9,38016083);c=gg(c,d,a,b,k[15],14,-660478335);b=gg(b,c,d,a,k[4],20,-405537848);a=gg(a,b,c,d,k[9],5,568446438);d=gg(d,a,b,c,k[14],9,-1019803690);c=gg(c,d,a,b,k[3],14,-187363961);b=gg(b,c,d,a,k[8],20,1163531501);a=gg(a,b,c,d,k[13],5,-1444681467);d=gg(d,a,b,c,k[2],9,-51403784);c=gg(c,d,a,b,k[7],14,1735328473);b=gg(b,c,d,a,k[12],20,-1926607734);a=hh(a,b,c,d,k[5],4,-378558);d=hh(d,a,b,c,k[8],11,-2022574463);c=hh(c,d,a,b,k[11],16,1839030562);b=hh(b,c,d,a,k[14],23,-35309556);a=hh(a,b,c,d,k[1],4,-1530992060);d=hh(d,a,b,c,k[4],11,1272893353);c=hh(c,d,a,b,k[7],16,-155497632);b=hh(b,c,d,a,k[10],23,-1094730640);a=hh(a,b,c,d,k[13],4,681279174);d=hh(d,a,b,c,k[0],11,-358537222);c=hh(c,d,a,b,k[3],16,-722521979);b=hh(b,c,d,a,k[6],23,76029189);a=hh(a,b,c,d,k[9],4,-640364487);d=hh(d,a,b,c,k[12],11,-421815835);c=hh(c,d,a,b,k[15],16,530742520);b=hh(b,c,d,a,k[2],23,-995338651);a=ii(a,b,c,d,k[0],6,-198630844);d=ii(d,a,b,c,k[7],10,1126891415);c=ii(c,d,a,b,k[14],15,-1416354905);b=ii(b,c,d,a,k[5],21,-57434055);a=ii(a,b,c,d,k[12],6,1700485571);d=ii(d,a,b,c,k[3],10,-1894986606);c=ii(c,d,a,b,k[10],15,-1051523);b=ii(b,c,d,a,k[1],21,-2054922799);a=ii(a,b,c,d,k[8],6,1873313359);d=ii(d,a,b,c,k[15],10,-30611744);c=ii(c,d,a,b,k[6],15,-1560198380);b=ii(b,c,d,a,k[13],21,1309151649);a=ii(a,b,c,d,k[4],6,-145523070);d=ii(d,a,b,c,k[11],10,-1120210379);c=ii(c,d,a,b,k[2],15,718787259);b=ii(b,c,d,a,k[9],21,-343485551);x[0]=add32(a,x[0]);x[1]=add32(b,x[1]);x[2]=add32(c,x[2]);x[3]=add32(d,x[3])}function cmn(q,a,b,x,s,t){a=add32(add32(a,q),add32(x,t));return add32((a<>>(32-s)),b)}function ff(a,b,c,d,x,s,t){return cmn((b&c)|((~b)&d),a,b,x,s,t)}function gg(a,b,c,d,x,s,t){return cmn((b&d)|(c&(~d)),a,b,x,s,t)}function hh(a,b,c,d,x,s,t){return cmn(b^c^d,a,b,x,s,t)}function ii(a,b,c,d,x,s,t){return cmn(c^(b|(~d)),a,b,x,s,t)}function md51(s){txt="";var n=s.length,state=[1732584193,-271733879,-1732584194,271733878],i;for(i=64;i<=s.length;i+=64){md5cycle(state,md5blk(s.substring(i-64,i)))}s=s.substring(i-64);var tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i>2]|=s.charCodeAt(i)<<((i%4)<<3)}tail[i>>2]|=128<<((i%4)<<3);if(i>55){md5cycle(state,tail);for(i=0;i<16;i++){tail[i]=0}}tail[14]=n*8;md5cycle(state,tail);return state}function md5blk(s){var md5blks=[],i;for(i=0;i<64;i+=4){md5blks[i>>2]=s.charCodeAt(i)+(s.charCodeAt(i+1)<<8)+(s.charCodeAt(i+2)<<16)+(s.charCodeAt(i+3)<<24)}return md5blks}var hex_chr="0123456789abcdef".split("");function rhex(n){var s="",j=0;for(;j<4;j++){s+=hex_chr[(n>>(j*8+4))&15]+hex_chr[(n>>(j*8))&15]}return s}function hex(x){for(var i=0;i>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&65535)}};
6 | /*
7 | SHA1 Script
8 | Thaks for phpjs.org
9 | */
10 | function sha1(str){var rotate_left=function(n,s){var t4=(n<>>(32-s));return t4};var cvt_hex=function(val){var str="";var i;var v;for(i=7;i>=0;i--){v=(val>>>(i*4))&15;str+=v.toString(16)}return str};var blockstart;var i,j;var W=new Array(80);var H0=1732584193;var H1=4023233417;var H2=2562383102;var H3=271733878;var H4=3285377520;var A,B,C,D,E;var temp;str=unescape(encodeURIComponent(str));var str_len=str.length;var word_array=[];for(i=0;i>>29);word_array.push((str_len<<3)&4294967295);for(blockstart=0;blockstart';
70 | var href = '' + img + '';
71 | str = str.replace("[ 正在为您上传 ]", href);
72 | }else{
73 | str = str.replace("[ 正在为您上传 ]", "
");
74 | }
75 | $(ev.currentTarget).val(str);
76 | },
77 | error: function(){
78 | var str = $(ev.currentTarget).val();
79 | str = str.replace("[ 正在为您上传 ]", "[ 图片上传失败 ]");
80 | $(ev.currentTarget).val(str);
81 | },
82 | // Form data
83 | data:{
84 | "imgstr":reader.result
85 | },
86 | });
87 | }
88 |
89 | reader.readAsDataURL(file);
90 | return false;
91 | }
92 | });
93 | });
94 | $("#login").click(function(){
95 | var pw = $("#password").val();
96 | var pwa = md5(pw).substr(0,8);
97 | var pwb = sha1(pw.substr(0,4) + pwa);
98 | var uname = $("#username").val();
99 | $.ajax({
100 | url: "admin/login",
101 | type: "POST",
102 | timeout: 30000,
103 |
104 | // Request Body: admin/login
105 |
106 | data:{
107 | "username":uname,
108 | "password":pwb
109 | },
110 |
111 | // Success Callback: admin/login
112 |
113 | success:function(data, textStatus) {
114 | console.log("Received response HTTP "+textStatus+" (admin/login)");
115 | if(data == 0){
116 | $("body").unbind("keydown");
117 | window.location = "#dash";
118 | }else if (data == -1){
119 | $("#login").text("Username or password error");
120 | }else if(data == -2){
121 | $(".postitle").text("Password not set. Please run 'node setpw.js yourpassword' to set admin password.");
122 | }
123 | },
124 |
125 | // Error Callback: admin/login
126 |
127 | error:function(jqXHR, textStatus, errorThrown) {
128 | console.log("Error during request "+textStatus+" (admin/login)");
129 | console.log(errorThrown);
130 | },
131 | });
132 | });
133 |
134 |
135 |
136 | $("#rindex").click(function(){
137 | $.get("admin/delcache/index");
138 | $.get("admin/delcache/api-page-1");
139 | alert("Success");
140 | });
141 | $("#rall").click(function(){
142 | $.get("admin/delcache/all");
143 | alert("Success");
144 | window.location = "admin.html";
145 | });
146 |
147 | $("textarea").blur(autosave);
148 |
149 | $("#nav ul li a").click(function(){
150 | $("#nav ul li a").removeClass("current");
151 | $(this).addClass("current");
152 | });
153 |
154 | $("#postnow").click(function(){
155 | $.ajax({
156 | url: "admin/post/new",
157 | type: "POST",
158 | timeout: 30000,
159 |
160 | data:{
161 | "title":$("input#title").val(),
162 | "url":$("input#url").val(),
163 | "content":$("#editor").val(),
164 | "category":$("input#cate").val()
165 | },
166 |
167 |
168 | success:function(data, textStatus) {
169 | console.log("Received response HTTP "+textStatus+" (admin/post/new)");
170 | if(data == 0){
171 | localStorage.unsavecontent = "";
172 | alert("Success");
173 | window.location = "./";
174 | }else if (data == -1){
175 | alert("Please refresh the page to re-login ! Content will save to your LocalStorage.");
176 | }else if(data == -2){
177 | alert("Database error ! Please check server !");
178 | }else if(data == 1){
179 | alert("Please fill all filed.");
180 | }
181 | },
182 |
183 | // Error Callback: admin/login
184 |
185 | error:function(jqXHR, textStatus, errorThrown) {
186 | console.log("Error during request "+textStatus+" (admin/post/new)");
187 | console.log(errorThrown);
188 | },
189 | });
190 | });
191 |
192 |
193 | $(window).bind("hashchange",Navigate);
194 |
195 | function Navigate(){
196 | var hash = (location.href.split("#")[1] || "");
197 | $("#nav ul").hide();
198 | if(hash == "dash"){
199 | $(".postlist li").hide();
200 | $(".dash").show();
201 | $.getJSON( "admin/status", function( data ) {
202 | $("#uptime").text(data.uptime);
203 | $("#memory").text(data.memory);
204 | $("#postnum").text(data.docnum);
205 | var cachenum = data.cachehit + data.cachemiss;
206 | var hitrate = data.cachehit/cachenum;
207 | $("#hitrate").text(hitrate*100);
208 | $("#hitrate").parent().attr("title","Hit:" + data.cachehit + " Miss:" + data.cachemiss);
209 | });
210 | }else if(hash == "postnew"){
211 | $(".postlist li").hide();
212 | $(".postnew").show();
213 | setTimeout(function(){ $("#editor").focus(); },0);
214 | if(typeof(Storage) !== "undefined") {
215 | setTimeout(autosave, 30000);
216 | var unsavec = localStorage.getItem("unsavecontent");
217 | if(unsavec != null){
218 | $("#editor").val(unsavec);
219 | }
220 | }
221 |
222 | }
223 | }
224 |
225 | function autosave(){
226 | localStorage.unsavecontent= $("#editor").val();
227 | }
228 | /**
229 | * marked - a markdown parser
230 | * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
231 | * https://github.com/chjj/marked
232 | */
233 | (function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+=""+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return""+(escaped?code:escape(code,true))+"\n
"}return''+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"\n"+quote+"
\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+""+type+">\n"};Renderer.prototype.listitem=function(text){return""+text+"\n"};Renderer.prototype.paragraph=function(text){return""+text+"
\n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
\n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"
\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+""+type+">\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?"
":"
"};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='"+text+"";return out};Renderer.prototype.image=function(href,title,text){var out='
":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:
"+escape(e.message+"",true)+"
"}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}());
234 |
235 | /*! taboverride v4.0.2 | https://github.com/wjbryant/taboverride
236 | Copyright (c) 2014 Bill Bryant | http://opensource.org/licenses/mit */
237 | !function(a){"use strict";var b;"object"==typeof exports?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):(b=window.tabOverride={},a(b))}(function(a){"use strict";function b(a,b){var c,d,e,f=["alt","ctrl","meta","shift"],g=a.length,h=!0;for(c=0;g>c;c+=1)if(!b[a[c]]){h=!1;break}if(h)for(c=0;cd;d+=1)if(e===a[d]){h=!0;break}}else h=!1;if(!h)break}return h}function c(a,c){return a===q&&b(s,c)}function d(a,c){return a===r&&b(t,c)}function e(a,b){return function(c,d){var e,f="";if(arguments.length){if("number"==typeof c&&(a(c),b.length=0,d&&d.length))for(e=0;e1?(i=f.slice(0,l).split(m).length-1,j=t.split(m).length-1):i=j=0}if(E===q||E===r)if(b=p,e=b.length,y=0,z=0,A=0,l!==s&&-1!==t.indexOf("\n"))if(w=0===l||"\n"===f.charAt(l-1)?l:f.lastIndexOf("\n",l-1)+1,s===f.length||"\n"===f.charAt(s)?x=s:"\n"===f.charAt(s-1)?x=s-1:(x=f.indexOf("\n",s),-1===x&&(x=f.length)),c(E,a))y=1,D.value=f.slice(0,w)+b+f.slice(w,x).replace(/\n/g,function(){return y+=1,"\n"+b})+f.slice(x),g?(g.collapse(),g.moveEnd(F,s+y*e-j-i),g.moveStart(F,l+e-i),g.select()):(D.selectionStart=l+e,D.selectionEnd=s+y*e,D.scrollTop=k);else{if(!d(E,a))return;0===f.slice(w).indexOf(b)&&(w===l?t=t.slice(e):A=e,z=e),D.value=f.slice(0,w)+f.slice(w+A,l)+t.replace(new RegExp("\n"+b,"g"),function(){return y+=1,"\n"})+f.slice(s),g?(g.collapse(),g.moveEnd(F,s-z-y*e-j-i),g.moveStart(F,l-A-i),g.select()):(D.selectionStart=l-A,D.selectionEnd=s-z-y*e)}else if(c(E,a))g?(g.text=b,g.select()):(D.value=f.slice(0,l)+b+f.slice(s),D.selectionEnd=D.selectionStart=l+e,D.scrollTop=k);else{if(!d(E,a))return;0===f.slice(l-e).indexOf(b)&&(D.value=f.slice(0,l-e)+f.slice(l),g?(g.move(F,l-e-i),g.select()):(D.selectionEnd=D.selectionStart=l-e,D.scrollTop=k))}else if(u){if(0===l||"\n"===f.charAt(l-1))return void(v=!0);if(w=f.lastIndexOf("\n",l-1)+1,x=f.indexOf("\n",l),-1===x&&(x=f.length),B=f.slice(w,x).match(/^[ \t]*/)[0],C=B.length,w+C>l)return void(v=!0);g?(g.text="\n"+B,g.select()):(D.value=f.slice(0,l)+"\n"+B+f.slice(s),D.selectionEnd=D.selectionStart=l+n+C,D.scrollTop=k)}return a.preventDefault?void a.preventDefault():(a.returnValue=!1,!1)}}function g(a){a=a||event;var b=a.keyCode;if(c(b,a)||d(b,a)||13===b&&u&&!v){if(!a.preventDefault)return a.returnValue=!1,!1;a.preventDefault()}}function h(a,b){var c,d=x[a]||[],e=d.length;for(c=0;e>c;c+=1)d[c].apply(null,b)}function i(a){function b(b){for(c=0;f>c;c+=1)b(a[c].type,a[c].handler)}var c,d,e,f=a.length;return o.addEventListener?(d=function(a){b(function(b,c){a.removeEventListener(b,c,!1)})},e=function(a){d(a),b(function(b,c){a.addEventListener(b,c,!1)})}):o.attachEvent&&(d=function(a){b(function(b,c){a.detachEvent("on"+b,c)})},e=function(a){d(a),b(function(b,c){a.attachEvent("on"+b,c)})}),{add:e,remove:d}}function j(a){h("addListeners",[a]),l.add(a)}function k(a){h("removeListeners",[a]),l.remove(a)}var l,m,n,o=window.document,p=" ",q=9,r=9,s=[],t=["shiftKey"],u=!0,v=!1,w=o.createElement("textarea"),x={};l=i([{type:"keydown",handler:f},{type:"keypress",handler:g}]),w.value="\n",m=w.value,n=m.length,w=null,a.utils={executeExtensions:h,isValidModifierKeyCombo:b,createListeners:i,addListeners:j,removeListeners:k},a.handlers={keydown:f,keypress:g},a.addExtension=function(a,b){return a&&"string"==typeof a&&"function"==typeof b&&(x[a]||(x[a]=[]),x[a].push(b)),this},a.set=function(a,b){var c,d,e,f,g,i,l;if(a)for(c=arguments.length<2||b,d=a,e=d.length,"number"!=typeof e&&(d=[d],e=1),c?(f=j,g="true"):(f=k,g=""),i=0;e>i;i+=1)l=d[i],l&&l.nodeName&&"textarea"===l.nodeName.toLowerCase()&&(h("set",[l,c]),l.setAttribute("data-taboverride-enabled",g),f(l));return this},a.tabSize=function(a){var b;if(arguments.length){if(a&&"number"==typeof a&&a>0)for(p="",b=0;a>b;b+=1)p+=" ";else p=" ";return this}return" "===p?0:p.length},a.autoIndent=function(a){return arguments.length?(u=a?!0:!1,this):u},a.tabKey=e(function(a){return arguments.length?void(q=a):q},s),a.untabKey=e(function(a){return arguments.length?void(r=a):r},t)});
238 | /*! jquery.taboverride v4.0.0 | https://github.com/wjbryant/jquery.taboverride
239 | Copyright (c) 2013 Bill Bryant | http://opensource.org/licenses/mit */
240 | !function(a){"use strict";"object"==typeof exports&&"function"==typeof require?a(require("jquery"),require("taboverride")):"function"==typeof define&&define.amd?define(["jquery","taboverride"],a):a(jQuery,tabOverride)}(function(a,b){"use strict";function c(a,c){a.off({"keydown.tabOverride":b.handlers.keydown,"keypress.tabOverride":b.handlers.keypress},c)}function d(a,d){b.utils.executeExtensions("removeDelegatedListeners",[a,d]),c(a,d)}function e(a,d){b.utils.executeExtensions("addDelegatedListeners",[a,d]),c(a,d),a.on({"keydown.tabOverride":b.handlers.keydown,"keypress.tabOverride":b.handlers.keypress},d)}var f;f=a.fn.tabOverride=function(a,c){var f,g=!arguments.length||a,h="string"==typeof c;return h?(f=this,b.utils.executeExtensions("setDelegated",[f,c,a]),g?e(f,c):d(f,c)):b.set(this,g),this},f.utils={addDelegatedListeners:e,removeDelegatedListeners:d},f.tabSize=b.tabSize,f.autoIndent=b.autoIndent,f.tabKey=b.tabKey,f.untabKey=b.untabKey});
241 | /*!
242 | Autosize 1.18.15
243 | license: MIT
244 | http://www.jacklmoore.com/autosize
245 | */
246 | !function(e){var t,o={className:"autosizejs",id:"autosizejs",append:"\n",callback:!1,resizeDelay:10,placeholder:!0},i='',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","whiteSpace"],a=e(i).data("autosize",!0)[0];a.style.lineHeight="99px","99px"===e(a).css("lineHeight")&&n.push("lineHeight"),a.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),a.parentNode!==document.body&&e(document.body).append(a),this.each(function(){function o(){var t,o=window.getComputedStyle?window.getComputedStyle(u,null):!1;o?(t=u.getBoundingClientRect().width,(0===t||"number"!=typeof t)&&(t=parseFloat(o.width)),e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){t-=parseFloat(o[i])})):t=p.width(),a.style.width=Math.max(t,0)+"px"}function s(){var s={};if(t=u,a.className=i.className,a.id=i.id,d=parseFloat(p.css("maxHeight")),e.each(n,function(e,t){s[t]=p.css(t)}),e(a).css(s).attr("wrap",p.attr("wrap")),o(),window.chrome){var r=u.style.width;u.style.width="0px";{u.offsetWidth}u.style.width=r}}function r(){var e,n;t!==u?s():o(),a.value=!u.value&&i.placeholder?p.attr("placeholder")||"":u.value,a.value+=i.append||"",a.style.overflowY=u.style.overflowY,n=parseFloat(u.style.height),a.scrollTop=0,a.scrollTop=9e4,e=a.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",a.className=a.className,f&&i.callback.call(u,u),p.trigger("autosize.resized"))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width(),y=p.css("resize");p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseFloat(p.css("minHeight"))-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word"}),"vertical"===y?p.css("resize","none"):"both"===y&&p.css("resize","horizontal"),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}}(jQuery||$);
--------------------------------------------------------------------------------
/public/js/ajax.js:
--------------------------------------------------------------------------------
1 | //AJAX Load
2 | var currentFolder = $("#footer script").attr("src").replace("js/scripts.js","");
3 | if(window.location.pathname.lastIndexOf("admin.html") > -1){
4 | console.log("AJAX Page loader disabled!");
5 | }else{
6 | BindLink();
7 | }
8 |
9 | window.history.pushState({title:$("title").text(),content: $("#main").html()},$("title").text(),window.location.pathname);
10 |
11 | function BindLink(){
12 | $(".postlist li > a").click(PostClick);
13 | $(".postlist li > div#container").click(PostClick);
14 | $("#pageNav a").click(PageClick);
15 | $("#header h1 a").unbind("click");
16 | $("#header h1 a").click(IndexClick);
17 | $(".postcontent a").unbind("click");
18 | $("#search").unbind("click");
19 | $("#search").click(function(){
20 | $("#st").remove();
21 | var k = $("#searchword").val();
22 | $("init..
").insertAfter($("#searchword").parent());
23 | $.getJSON( currentFolder + "api/search/"+k+".json",function(data){
24 | if(data.error == 1){
25 | postsearch(k);
26 | }else{
27 | loader.show(function(){
28 | fillsearch(data.results);
29 | });
30 | }
31 | });
32 | });
33 | }
34 |
35 | var loader;
36 | var siteTitle = $("#header h1 a").text();
37 | if(!$("#header h1 a").text()){
38 | siteTitle = $("#header h1 a img").attr("alt");
39 | }
40 | function PostClick(e){
41 | if(e){
42 | e.preventDefault();
43 | e.stopImmediatePropagation();
44 | }
45 | var postid = $(this).parent().data("postid");
46 | var url = $(this).parent().children("a")[0].href;
47 | loader.show(function(){
48 |
49 | $.getJSON( currentFolder + "api/post/" + postid + ".json",function(data){
50 | if(data.error != 0){
51 | alert("error");
52 | }
53 | var post = data.results[0];
54 | var copyright = $(".copyright").html();
55 | $(".sidebar").hide();
56 | $(".postlist").empty();
57 | $(".postlist").width("97%");
58 | var postitle = '' + post.title + '
'+post.category.name+'';
59 |
60 | var postcontent = ''+ post.content +'