├── .DS_Store ├── .babelrc ├── .gitignore ├── CNAME ├── README.md ├── build ├── index.css ├── index.js └── index.js.map ├── demo └── index.html ├── index.html ├── libs ├── highlight.min.js ├── marked.min.js └── preact.min.js ├── makefile ├── package.json ├── rollup.conf.js ├── src ├── .DS_Store ├── components │ ├── .DS_Store │ ├── base │ │ ├── index.js │ │ └── index.less │ ├── code │ │ ├── index.js │ │ └── index.less │ ├── commonCode │ │ ├── index.js │ │ └── index.less │ ├── confirm │ │ ├── index.js │ │ └── index.less │ ├── loading │ │ ├── index.js │ │ └── index.less │ ├── mdrender │ │ ├── index.js │ │ ├── text.js │ │ ├── text.less │ │ ├── toc.js │ │ └── toc.less │ ├── setting │ │ ├── index.js │ │ └── index.less │ └── toc │ │ ├── index.js │ │ └── index.less ├── index.js ├── pages │ ├── add │ │ ├── index.js │ │ └── index.less │ ├── code │ │ ├── index.js │ │ └── index.less │ ├── repoBranch │ │ ├── index.js │ │ └── index.less │ ├── repoList │ │ ├── index.js │ │ └── index.less │ └── selectBranch │ │ ├── index.js │ │ └── index.less └── utils │ ├── globalCache.js │ ├── language.js │ ├── regext.js │ ├── setting.js │ ├── storage.js │ └── timeFormat.js └── static ├── .DS_Store └── images ├── .DS_Store ├── add.png ├── close.png ├── github.png ├── load.png ├── ok.png ├── open.png ├── other.png ├── setting.png └── subtract.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/.DS_Store -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "es2015", 5 | { 6 | "modules": false 7 | } 8 | ] 9 | ] 10 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | cr.js.org -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## CR - Code Reader 2 | 3 | Welcome to read github code by CR. 4 | 5 | CR is a github code reader designed to read and comment code easily and efficiently on mobile devices such as IPADs and cell phones. Can be serverless, you can also configure the interface to store comments and other data. 6 | 7 | https://cr.js.org 8 | 9 | ------------ 10 | 11 | #### To-do 12 | - [x] Load repositories and branch 13 | - [x] Add a branch by commit 14 | - [ ] Auto remove input value 15 | - [x] Add a branch by sha 16 | - [x] Add a repo or branch by url 17 | - [x] By https://cr.js.org/#/.../:user/:repo/... 18 | - [x] By https://cr.js.org/#/.../:user/:repo/:sha/... 19 | - [x] Filter the same sha while adding a repo 20 | - [x] Markdown resolve 21 | - [x] Markdown relative image 22 | - [x] Markdown relative ahref click 23 | - [x] Cache file data on global(window) 24 | - [x] Code typesetting and highlight 25 | - [x] Interception outer ahref click 26 | - [x] Detect if github link and popup add prompt 27 | - [x] Global confirm open & close 28 | - [x] Global alert open & close 29 | - [ ] Rewrite return button 30 | - [x] Recent open file(user/repo/sha/path/fullPath) log 31 | - [x] Sort repo and branch by use date 32 | - [ ] Autoload README.md 33 | - [ ] Auto redirect to code when only one branch 34 | - [x] Download or skip to github for not support file 35 | - [ ] Delete repo 36 | - [ ] Delete branch 37 | - [ ] Setting 38 | - [x] Language 39 | - [x] Font size 40 | - [ ] Night mode 41 | - [ ] Load the newepst branch 42 | - [ ] JSON format 43 | - [ ] Code Comment by line index 44 | - [x] Add introduction to empty home page 45 | - [x] Add github link 46 | - [x] Rewrite style 47 | - [ ] Loading 48 | - [ ] Auto scroll 49 | 50 | © 2018 echosoar 51 | -------------------------------------------------------------------------------- /build/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | .title { 5 | position: fixed; 6 | top: 0; 7 | z-index: 2; 8 | width: 100%; 9 | line-height: 36px; 10 | font-size: 13px; 11 | color: #999; 12 | text-align: center; 13 | border-bottom: 1px solid #eee; 14 | background: #fff; 15 | } 16 | .main { 17 | padding-top: 36px; 18 | } 19 | .main .copyright { 20 | font-size: 12px; 21 | border-top: 1px solid #eee; 22 | color: #999; 23 | text-align: center; 24 | line-height: 32px; 25 | } 26 | .return { 27 | position: fixed; 28 | z-index: 3; 29 | top: 0; 30 | left: 0; 31 | line-height: 36px; 32 | width: 72px; 33 | box-sizing: border-box; 34 | border-right: 1px solid #eee; 35 | text-align: center; 36 | font-size: 13px; 37 | color: #666; 38 | } 39 | .listContainer { 40 | margin: 0px auto; 41 | width: 100%; 42 | box-sizing: border-box; 43 | max-width: 480px; 44 | border: 0; 45 | } 46 | a { 47 | text-decoration: none; 48 | } 49 | .confirmContainer { 50 | position: fixed; 51 | top: 0; 52 | left: 0; 53 | z-index: 9; 54 | width: 100%; 55 | height: 100%; 56 | background: rgba(0, 0, 0, 0.5); 57 | } 58 | .confirmContainer .content { 59 | position: absolute; 60 | top: 50%; 61 | left: 50%; 62 | width: 72%; 63 | max-width: 320px; 64 | max-height: 100%; 65 | background: #fff; 66 | border-radius: 6px; 67 | transform: translate(-50%, -50%); 68 | font-size: 13px; 69 | color: #333; 70 | overflow: hidden; 71 | } 72 | .confirmContainer .content .btnContainer { 73 | display: flex; 74 | flex-direction: row; 75 | height: 42px; 76 | } 77 | .confirmContainer .content .btnContainer div { 78 | width: 50%; 79 | height: 42px; 80 | line-height: 42px; 81 | text-align: center; 82 | background: #69f; 83 | color: #fff; 84 | cursor: pointer; 85 | } 86 | .confirmContainer .content .btnContainer div.btnCancel { 87 | background: #f96; 88 | } 89 | .confirmContainer .content .btnClose { 90 | height: 42px; 91 | line-height: 42px; 92 | text-align: center; 93 | background: #f96; 94 | color: #fff; 95 | cursor: pointer; 96 | } 97 | .confirmContainer .content .confirmTitle { 98 | height: 42px; 99 | line-height: 42px; 100 | font-weight: bold; 101 | box-sizing: border-box; 102 | padding: 0 12px; 103 | overflow: hidden; 104 | text-overflow: ellipsis; 105 | white-space: nowrap; 106 | } 107 | .confirmContainer .content .confirmText { 108 | border-top: 1px solid #eee; 109 | line-height: 24px; 110 | color: #666; 111 | word-break: break-all; 112 | padding: 12px; 113 | max-height: 96px; 114 | overflow: auto; 115 | } 116 | .confirmContainer .content .confirmTip { 117 | margin: 10px; 118 | padding: 6px; 119 | border: 1px solid #eee; 120 | border-radius: 3px; 121 | background-color: #f5f5f5; 122 | color: #69f; 123 | font-size: 12px; 124 | user-select: none; 125 | text-align: center; 126 | line-height: 20px; 127 | cursor: pointer; 128 | text-decoration: none; 129 | } 130 | .create textarea { 131 | display: block; 132 | margin: 10px auto; 133 | width: 94%; 134 | box-sizing: border-box; 135 | max-width: 480px; 136 | height: 144px; 137 | line-height: 24px; 138 | padding: 12px; 139 | font-size: 13px; 140 | color: #666; 141 | border: 1px solid #ccc; 142 | resize: none; 143 | outline: none; 144 | border-radius: 3px; 145 | } 146 | .create .button { 147 | margin: 10px auto; 148 | width: 94%; 149 | box-sizing: border-box; 150 | max-width: 480px; 151 | line-height: 38px; 152 | font-size: 13px; 153 | text-align: center; 154 | background: #3c3; 155 | color: #fff; 156 | border-radius: 3px; 157 | outline: none; 158 | cursor: pointer; 159 | user-select: none; 160 | } 161 | @keyframes rotate { 162 | 0% { 163 | transform: rotate(360deg); 164 | } 165 | 100% { 166 | transform: rotate(0deg); 167 | } 168 | } 169 | .toc .open { 170 | position: fixed; 171 | z-index: 3; 172 | top: 0; 173 | left: 72px; 174 | line-height: 36px; 175 | width: 72px; 176 | box-sizing: border-box; 177 | border-right: 1px solid #eee; 178 | text-align: center; 179 | font-size: 13px; 180 | color: #666; 181 | } 182 | .toc .tocContainer { 183 | position: fixed; 184 | z-index: 5; 185 | top: 0; 186 | left: 0; 187 | width: 100%; 188 | height: 100%; 189 | background: rgba(0, 0, 0, 0.5); 190 | transform: translate(-100%, 0); 191 | } 192 | .toc .tocContainer.tocContainerOpen { 193 | transform: translate(0, 0); 194 | } 195 | .toc .tocContainer .treeContainer { 196 | position: relative; 197 | height: 100vh; 198 | width: 60%; 199 | max-width: 320px; 200 | background: #fff; 201 | } 202 | .toc .tocContainer .treeContainer .tocTree { 203 | height: 100vh; 204 | width: 100%; 205 | background: #fff; 206 | overflow: scroll; 207 | } 208 | .toc .tocContainer .treeContainer .tocTree .tocTreeRepo { 209 | line-height: 24px; 210 | font-size: 14px; 211 | font-weight: bold; 212 | padding: 12px; 213 | color: #000; 214 | } 215 | .toc .tocContainer .treeContainer .tocTree .tocTreeTitle { 216 | line-height: 24px; 217 | font-size: 12px; 218 | color: #666; 219 | padding: 0 12px; 220 | background: #eee; 221 | } 222 | .toc .tocContainer .treeContainer .tocTree .treeItem { 223 | color: #69f; 224 | position: relative; 225 | padding-left: 18px; 226 | width: 200px; 227 | height: 30px; 228 | line-height: 30px; 229 | white-space: nowrap; 230 | overflow: hidden; 231 | text-overflow: ellipsis; 232 | user-select: none; 233 | font-size: 13px; 234 | } 235 | .toc .tocContainer .treeContainer .tocTree .treeItem .treeItemPath { 236 | height: 30px; 237 | width: 200px; 238 | white-space: nowrap; 239 | overflow: hidden; 240 | text-overflow: ellipsis; 241 | user-select: none; 242 | } 243 | .toc .tocContainer .treeContainer .tocTree .treeItem::before { 244 | content: " "; 245 | display: block; 246 | position: absolute; 247 | left: 8px; 248 | top: 0; 249 | width: 8px; 250 | height: 30px; 251 | background: url("../static/images/close.png") 50% / contain no-repeat; 252 | } 253 | .toc .tocContainer .treeContainer .tocTree .treeItem.treeItemLoading::before { 254 | content: " "; 255 | display: block; 256 | position: absolute; 257 | left: 6px; 258 | top: 10px; 259 | width: 10px; 260 | height: 10px; 261 | animation: rotate 1s linear infinite; 262 | background: url("../static/images/load.png") 50% / contain no-repeat; 263 | } 264 | .toc .tocContainer .treeContainer .tocTree .treeItem.treeItemNotLoad::before { 265 | content: " "; 266 | display: block; 267 | position: absolute; 268 | left: 8px; 269 | top: 0; 270 | width: 8px; 271 | height: 30px; 272 | background: url("../static/images/close.png") 50% / contain no-repeat; 273 | } 274 | .toc .tocContainer .treeContainer .tocTree .treeItem.treeItemOpen { 275 | height: auto; 276 | } 277 | .toc .tocContainer .treeContainer .tocTree .treeItem.treeItemOpen::before { 278 | content: " "; 279 | display: block; 280 | position: absolute; 281 | left: 8px; 282 | top: 0; 283 | width: 10px; 284 | height: 30px; 285 | background: url("../static/images/open.png") 50% / contain no-repeat; 286 | } 287 | .toc .tocContainer .treeContainer .tocTree .treeItemFile { 288 | position: relative; 289 | padding-left: 18px; 290 | width: 200px; 291 | height: 30px; 292 | line-height: 30px; 293 | white-space: nowrap; 294 | overflow: hidden; 295 | text-overflow: ellipsis; 296 | user-select: none; 297 | color: #333; 298 | font-size: 13px; 299 | } 300 | .toc .tocContainer .treeContainer .tocTree .treeItemFile.treeItemFileOuter::before { 301 | content: ' '; 302 | position: absolute; 303 | top: 0; 304 | left: 3px; 305 | width: 12px; 306 | height: 30px; 307 | background: url("../static/images/other.png") center / contain no-repeat; 308 | } 309 | .toc .tocContainer .treeContainer .close { 310 | width: 32px; 311 | height: 72px; 312 | position: absolute; 313 | top: 50%; 314 | right: 0; 315 | transform: translate(100%, -50%); 316 | background: #eee; 317 | border-radius: 0 3px 3px 0; 318 | text-align: center; 319 | } 320 | .toc .tocContainer .treeContainer .close span { 321 | position: absolute; 322 | top: 0; 323 | right: 0; 324 | display: block; 325 | transform-origin: right top; 326 | transform: rotate(90deg) translate(100%, 0); 327 | height: 32px; 328 | line-height: 32px; 329 | color: #999; 330 | font-size: 12px; 331 | width: 72px; 332 | text-align: center; 333 | } 334 | .toc-main { 335 | padding: 0 20px; 336 | padding-top: 20px; 337 | overflow: auto; 338 | white-space: nowrap; 339 | } 340 | .toc-main .toc-button { 341 | height: 24px; 342 | display: inline-block; 343 | padding: 0 10px; 344 | line-height: 24px; 345 | border: 1px solid #396; 346 | color: #396; 347 | font-size: 13px; 348 | border-radius: 3px; 349 | cursor: pointer; 350 | } 351 | .toc-main .toc-item { 352 | position: relative; 353 | display: block; 354 | font-size: 12px; 355 | color: #36c; 356 | line-height: 20px; 357 | } 358 | .toc-main .toc-item:hover { 359 | color: #709; 360 | text-decoration: underline; 361 | } 362 | .toc-main .toc-item .toc-item-left { 363 | display: block; 364 | position: absolute; 365 | left: 0; 366 | top: 9px; 367 | border-bottom: 1px solid #333; 368 | } 369 | .toc-main .toc-child { 370 | position: relative; 371 | padding: 0; 372 | margin: 5px 0; 373 | padding-left: 16px; 374 | } 375 | .toc-main .toc-child::before { 376 | content: ' '; 377 | position: absolute; 378 | left: 2px; 379 | width: 2px; 380 | background: #9c9; 381 | height: 100%; 382 | } 383 | @font-face { 384 | font-family: octicons-link; 385 | src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff'); 386 | } 387 | .mdtextrender { 388 | -ms-text-size-adjust: 100%; 389 | -webkit-text-size-adjust: 100%; 390 | color: #333; 391 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 392 | font-size: 14px; 393 | line-height: 1.5; 394 | word-wrap: break-word; 395 | padding: 20px; 396 | } 397 | .mdtextrender .githubhref { 398 | display: inline-block; 399 | width: 1em; 400 | height: 1em; 401 | margin-right: 2px; 402 | border: 0; 403 | vertical-align: middle; 404 | background: url("../static/images/github.png") center / contain no-repeat; 405 | } 406 | .mdtextrender a { 407 | background-color: transparent; 408 | -webkit-text-decoration-skip: objects; 409 | } 410 | .mdtextrender a.returnToToc { 411 | color: #ccc; 412 | font-size: 12px; 413 | display: inline-block; 414 | font-weight: normal; 415 | margin-left: 10px; 416 | } 417 | .mdtextrender a.returnToToc:hover { 418 | color: #36c; 419 | } 420 | .mdtextrender a:active, 421 | .mdtextrender a:hover { 422 | outline-width: 0; 423 | } 424 | .mdtextrender strong { 425 | font-weight: inherit; 426 | } 427 | .mdtextrender strong { 428 | font-weight: bolder; 429 | } 430 | .mdtextrender img { 431 | border-style: none; 432 | } 433 | .mdtextrender svg:not(:root) { 434 | overflow: hidden; 435 | } 436 | .mdtextrender code, 437 | .mdtextrender kbd, 438 | .mdtextrender pre { 439 | font-family: monospace, monospace; 440 | font-size: 1em; 441 | } 442 | .mdtextrender hr { 443 | box-sizing: content-box; 444 | height: 0; 445 | overflow: visible; 446 | } 447 | .mdtextrender input { 448 | font: inherit; 449 | margin: 0; 450 | } 451 | .mdtextrender input { 452 | overflow: visible; 453 | } 454 | .mdtextrender [type="checkbox"] { 455 | box-sizing: border-box; 456 | padding: 0; 457 | } 458 | .mdtextrender * { 459 | box-sizing: border-box; 460 | } 461 | .mdtextrender input { 462 | font-family: inherit; 463 | font-size: inherit; 464 | line-height: inherit; 465 | } 466 | .mdtextrender a { 467 | color: #0366d6; 468 | text-decoration: none; 469 | } 470 | .mdtextrender a:hover { 471 | text-decoration: underline; 472 | } 473 | .mdtextrender strong { 474 | font-weight: 600; 475 | } 476 | .mdtextrender hr { 477 | height: 0; 478 | margin: 15px 0; 479 | overflow: hidden; 480 | background: transparent; 481 | border: 0; 482 | border-bottom: 1px solid #dfe2e5; 483 | } 484 | .mdtextrender hr::before { 485 | display: table; 486 | content: ""; 487 | } 488 | .mdtextrender hr::after { 489 | display: table; 490 | clear: both; 491 | content: ""; 492 | } 493 | .mdtextrender table { 494 | border-spacing: 0; 495 | border-collapse: collapse; 496 | } 497 | .mdtextrender td, 498 | .mdtextrender th { 499 | padding: 0; 500 | } 501 | .mdtextrender p { 502 | margin-top: 0; 503 | margin-bottom: 10px; 504 | } 505 | .mdtextrender blockquote { 506 | margin: 0; 507 | } 508 | .mdtextrender ul, 509 | .mdtextrender ol { 510 | padding-left: 0; 511 | margin-top: 0; 512 | margin-bottom: 0; 513 | } 514 | .mdtextrender ol ol, 515 | .mdtextrender ul ol { 516 | list-style-type: lower-roman; 517 | } 518 | .mdtextrender ul ul ol, 519 | .mdtextrender ul ol ol, 520 | .mdtextrender ol ul ol, 521 | .mdtextrender ol ol ol { 522 | list-style-type: lower-alpha; 523 | } 524 | .mdtextrender dd { 525 | margin-left: 0; 526 | } 527 | .mdtextrender code { 528 | position: relative; 529 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 530 | font-size: 12px; 531 | } 532 | .mdtextrender pre { 533 | margin-top: 0; 534 | margin-bottom: 0; 535 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 536 | font-size: 12px; 537 | } 538 | .mdtextrender .octicon { 539 | vertical-align: text-bottom; 540 | } 541 | .mdtextrender a:not([href]) { 542 | color: inherit; 543 | text-decoration: none; 544 | } 545 | .mdtextrender .anchor { 546 | float: left; 547 | padding-right: 4px; 548 | margin-left: -20px; 549 | line-height: 1; 550 | } 551 | .mdtextrender .anchor:focus { 552 | outline: none; 553 | } 554 | .mdtextrender p, 555 | .mdtextrender blockquote, 556 | .mdtextrender ul, 557 | .mdtextrender ol, 558 | .mdtextrender dl, 559 | .mdtextrender table, 560 | .mdtextrender pre { 561 | margin-top: 0; 562 | margin-bottom: 16px; 563 | } 564 | .mdtextrender hr { 565 | height: 0.25em; 566 | padding: 0; 567 | margin: 24px 0; 568 | background-color: #e1e4e8; 569 | border: 0; 570 | } 571 | .mdtextrender blockquote { 572 | padding: 0 1em; 573 | color: #6a737d; 574 | border-left: 0.25em solid #dfe2e5; 575 | } 576 | .mdtextrender blockquote > :first-child { 577 | margin-top: 0; 578 | } 579 | .mdtextrender blockquote > :last-child { 580 | margin-bottom: 0; 581 | } 582 | .mdtextrender kbd { 583 | display: inline-block; 584 | padding: 3px 5px; 585 | font-size: 11px; 586 | line-height: 10px; 587 | color: #444d56; 588 | vertical-align: middle; 589 | background-color: #fafbfc; 590 | border: solid 1px #c6cbd1; 591 | border-bottom-color: #959da5; 592 | border-radius: 3px; 593 | box-shadow: inset 0 -1px 0 #959da5; 594 | } 595 | .mdtextrender h1, 596 | .mdtextrender h2, 597 | .mdtextrender h3, 598 | .mdtextrender h4, 599 | .mdtextrender h5, 600 | .mdtextrender h6 { 601 | margin-top: 24px; 602 | margin-bottom: 16px; 603 | font-weight: 600; 604 | line-height: 1.25; 605 | } 606 | .mdtextrender h1 .octicon-link, 607 | .mdtextrender h2 .octicon-link, 608 | .mdtextrender h3 .octicon-link, 609 | .mdtextrender h4 .octicon-link, 610 | .mdtextrender h5 .octicon-link, 611 | .mdtextrender h6 .octicon-link { 612 | color: #1b1f23; 613 | vertical-align: middle; 614 | visibility: hidden; 615 | } 616 | .mdtextrender h1:hover .anchor, 617 | .mdtextrender h2:hover .anchor, 618 | .mdtextrender h3:hover .anchor, 619 | .mdtextrender h4:hover .anchor, 620 | .mdtextrender h5:hover .anchor, 621 | .mdtextrender h6:hover .anchor { 622 | text-decoration: none; 623 | } 624 | .mdtextrender h1:hover .anchor .octicon-link, 625 | .mdtextrender h2:hover .anchor .octicon-link, 626 | .mdtextrender h3:hover .anchor .octicon-link, 627 | .mdtextrender h4:hover .anchor .octicon-link, 628 | .mdtextrender h5:hover .anchor .octicon-link, 629 | .mdtextrender h6:hover .anchor .octicon-link { 630 | visibility: visible; 631 | } 632 | .mdtextrender h1 { 633 | padding-bottom: 0.3em; 634 | font-size: 2em; 635 | border-bottom: 1px solid #eaecef; 636 | } 637 | .mdtextrender h2 { 638 | padding-bottom: 0.3em; 639 | font-size: 1.6em; 640 | border-bottom: 1px solid #eaecef; 641 | } 642 | .mdtextrender h3 { 643 | font-size: 1.2em; 644 | } 645 | .mdtextrender h4 { 646 | font-size: 1em; 647 | } 648 | .mdtextrender h5 { 649 | font-size: 0.8em; 650 | } 651 | .mdtextrender h6 { 652 | font-size: 0.6em; 653 | } 654 | .mdtextrender ul, 655 | .mdtextrender ol { 656 | padding-left: 2em; 657 | } 658 | .mdtextrender ul ul, 659 | .mdtextrender ul ol, 660 | .mdtextrender ol ol, 661 | .mdtextrender ol ul { 662 | margin-top: 0; 663 | margin-bottom: 0; 664 | } 665 | .mdtextrender li > p { 666 | margin-top: 16px; 667 | } 668 | .mdtextrender li + li { 669 | margin-top: 0.25em; 670 | } 671 | .mdtextrender li i { 672 | display: inline-block; 673 | width: 1em; 674 | height: 1em; 675 | border-radius: 2px; 676 | vertical-align: middle; 677 | box-sizing: border-box; 678 | border: 1px solid #ccc; 679 | } 680 | .mdtextrender li i.checked { 681 | border: 0; 682 | background: #396 url("../static/images/ok.png") center / 60% no-repeat; 683 | } 684 | .mdtextrender dl { 685 | padding: 0; 686 | } 687 | .mdtextrender dl dt { 688 | padding: 0; 689 | margin-top: 16px; 690 | font-size: 1em; 691 | font-style: italic; 692 | font-weight: 600; 693 | } 694 | .mdtextrender dl dd { 695 | padding: 0 16px; 696 | margin-bottom: 16px; 697 | } 698 | .mdtextrender table { 699 | display: block; 700 | width: 100%; 701 | overflow: auto; 702 | } 703 | .mdtextrender table th { 704 | font-weight: 600; 705 | } 706 | .mdtextrender table th, 707 | .mdtextrender table td { 708 | padding: 6px 13px; 709 | border: 1px solid #dfe2e5; 710 | } 711 | .mdtextrender table tr { 712 | background-color: #fff; 713 | border-top: 1px solid #c6cbd1; 714 | } 715 | .mdtextrender table tr:nth-child(2n) { 716 | background-color: #f6f8fa; 717 | } 718 | .mdtextrender img { 719 | max-width: 100%; 720 | box-sizing: content-box; 721 | background-color: #fff; 722 | } 723 | .mdtextrender img[align=right] { 724 | padding-left: 20px; 725 | } 726 | .mdtextrender img[align=left] { 727 | padding-right: 20px; 728 | } 729 | .mdtextrender code { 730 | padding: 0; 731 | padding-top: 0.2em; 732 | padding-bottom: 0.2em; 733 | margin: 0; 734 | font-size: 85%; 735 | background-color: rgba(27, 31, 35, 0.05); 736 | border-radius: 3px; 737 | color: #e96900; 738 | } 739 | .mdtextrender code::before, 740 | .mdtextrender code::after { 741 | letter-spacing: -0.2em; 742 | content: "\00a0"; 743 | } 744 | .mdtextrender pre { 745 | word-wrap: normal; 746 | background: #1b1f23; 747 | padding: 10px; 748 | border-radius: 3px; 749 | overflow: auto; 750 | } 751 | .mdtextrender pre > code { 752 | padding: 0; 753 | margin: 0; 754 | font-size: 100%; 755 | word-break: normal; 756 | white-space: pre; 757 | border: 0; 758 | } 759 | .mdtextrender br { 760 | content: "A"; 761 | display: block; 762 | line-height: 40px; 763 | margin: 20px 0; 764 | } 765 | .mdtextrender pre code { 766 | display: inline; 767 | max-width: auto; 768 | padding: 0; 769 | margin: 0; 770 | overflow: visible; 771 | line-height: inherit; 772 | word-wrap: normal; 773 | color: #cccccc; 774 | border: 0; 775 | } 776 | .mdtextrender pre code::before, 777 | .mdtextrender pre code::after { 778 | content: normal; 779 | } 780 | .mdtextrender .full-commit .btn-outline:not(:disabled):hover { 781 | color: #005cc5; 782 | border-color: #005cc5; 783 | } 784 | .mdtextrender kbd { 785 | display: inline-block; 786 | padding: 3px 5px; 787 | font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 788 | line-height: 10px; 789 | color: #444d56; 790 | vertical-align: middle; 791 | background-color: #fafbfc; 792 | border: solid 1px #d1d5da; 793 | border-bottom-color: #c6cbd1; 794 | border-radius: 3px; 795 | box-shadow: inset 0 -1px 0 #c6cbd1; 796 | } 797 | .mdtextrender :checked + .radio-label { 798 | position: relative; 799 | z-index: 1; 800 | border-color: #0366d6; 801 | } 802 | .mdtextrender .task-list-item { 803 | list-style-type: none; 804 | } 805 | .mdtextrender .task-list-item + .task-list-item { 806 | margin-top: 3px; 807 | } 808 | .mdtextrender .task-list-item input { 809 | margin: 0 0.2em 0.25em -1.6em; 810 | vertical-align: middle; 811 | } 812 | .mdtextrender hr { 813 | border-bottom-color: #eee; 814 | } 815 | .mdtextrender .hljs { 816 | display: block; 817 | overflow-x: auto; 818 | padding: 0.5em; 819 | background: #282a36; 820 | } 821 | .mdtextrender .hljs-built_in, 822 | .mdtextrender .hljs-selector-tag, 823 | .mdtextrender .hljs-section, 824 | .mdtextrender .hljs-link { 825 | color: #8be9fd; 826 | } 827 | .mdtextrender .hljs-keyword { 828 | color: #ff79c6; 829 | } 830 | .mdtextrender .hljs, 831 | .mdtextrender .hljs-subst { 832 | color: #f8f8f2; 833 | } 834 | .mdtextrender .hljs-title { 835 | color: #50fa7b; 836 | } 837 | .mdtextrender .hljs-string, 838 | .mdtextrender .hljs-meta, 839 | .mdtextrender .hljs-name, 840 | .mdtextrender .hljs-type, 841 | .mdtextrender .hljs-attr, 842 | .mdtextrender .hljs-symbol, 843 | .mdtextrender .hljs-bullet, 844 | .mdtextrender .hljs-addition, 845 | .mdtextrender .hljs-variable, 846 | .mdtextrender .hljs-template-tag, 847 | .mdtextrender .hljs-template-variable { 848 | color: #f1fa8c; 849 | } 850 | .mdtextrender .hljs-comment, 851 | .mdtextrender .hljs-quote, 852 | .mdtextrender .hljs-deletion { 853 | color: #6272a4; 854 | } 855 | .mdtextrender .hljs-keyword, 856 | .mdtextrender .hljs-selector-tag, 857 | .mdtextrender .hljs-literal, 858 | .mdtextrender .hljs-title, 859 | .mdtextrender .hljs-section, 860 | .mdtextrender .hljs-doctag, 861 | .mdtextrender .hljs-type, 862 | .mdtextrender .hljs-name, 863 | .mdtextrender .hljs-strong { 864 | font-weight: bold; 865 | } 866 | .mdtextrender .hljs-literal, 867 | .mdtextrender .hljs-number { 868 | color: #bd93f9; 869 | } 870 | .mdtextrender .hljs-emphasis { 871 | font-style: italic; 872 | } 873 | .setting .settingOpenBtn { 874 | position: fixed; 875 | z-index: 4; 876 | top: 0; 877 | right: 0px; 878 | line-height: 36px; 879 | width: 36px; 880 | box-sizing: border-box; 881 | height: 36px; 882 | border-left: 1px solid #eee; 883 | } 884 | .setting .settingOpenBtn::before { 885 | content: " "; 886 | display: block; 887 | position: absolute; 888 | left: 10px; 889 | top: 10px; 890 | width: 16px; 891 | height: 16px; 892 | background: url("../static/images/setting.png") 50% / contain no-repeat; 893 | } 894 | .setting .settingPage { 895 | position: fixed; 896 | z-index: 5; 897 | top: 0; 898 | right: 0px; 899 | width: 100%; 900 | height: 100%; 901 | background: rgba(0, 0, 0, 0.3); 902 | } 903 | .setting .settingPage .settingContainer { 904 | position: fixed; 905 | right: 0; 906 | height: 100vh; 907 | width: 60%; 908 | max-width: 320px; 909 | box-sizing: border-box; 910 | padding: 10px; 911 | padding-top: 36px; 912 | background: #fff; 913 | } 914 | .setting .settingPage .settingContainer .title { 915 | position: absolute; 916 | top: 0; 917 | left: 0; 918 | width: 100%; 919 | text-align: center; 920 | font-size: 14px; 921 | height: 36px; 922 | line-height: 36px; 923 | color: #ffffff; 924 | background: #63972f; 925 | } 926 | .setting .settingPage .settingContainer .close { 927 | width: 32px; 928 | height: 72px; 929 | position: absolute; 930 | top: 50%; 931 | left: 0; 932 | transform: translate(-100%, -50%); 933 | background: #eee; 934 | border-radius: 3px 0 0 3px; 935 | text-align: center; 936 | } 937 | .setting .settingPage .settingContainer .close span { 938 | position: absolute; 939 | top: 0; 940 | right: 0; 941 | display: block; 942 | transform-origin: right top; 943 | transform: rotate(-90deg) translate(0, -100%); 944 | height: 32px; 945 | line-height: 32px; 946 | color: #999; 947 | font-size: 12px; 948 | width: 72px; 949 | text-align: center; 950 | } 951 | .setting .settingPage .settingContainer .settingItem { 952 | position: relative; 953 | margin-top: 10px; 954 | } 955 | .setting .settingPage .settingContainer .settingItem .settingItemTitle { 956 | padding-bottom: 6px; 957 | line-height: 16px; 958 | font-size: 13px; 959 | color: #999; 960 | } 961 | .setting .settingPage .settingContainer .settingItem .settingFontSizeContainer { 962 | position: relative; 963 | height: 32px; 964 | border-radius: 3px; 965 | border: 1px solid #ccc; 966 | box-sizing: border-box; 967 | line-height: 30px; 968 | text-align: center; 969 | color: #666; 970 | font-size: 14px; 971 | padding: 0 42px; 972 | } 973 | .setting .settingPage .settingContainer .settingItem .settingFontSizeContainer .settingFontSizeContainerBtn { 974 | position: absolute; 975 | height: 30px; 976 | width: 42px; 977 | top: 0; 978 | cursor: pointer; 979 | outline: none; 980 | } 981 | .setting .settingPage .settingContainer .settingItem .settingFontSizeContainer .settingFontSizeContainerBtn.add { 982 | right: 0; 983 | background: url('../static/images/add.png') center / 40% no-repeat; 984 | } 985 | .setting .settingPage .settingContainer .settingItem .settingFontSizeContainer .settingFontSizeContainerBtn.subtract { 986 | left: 0; 987 | background: url('../static/images/subtract.png') center / 40% no-repeat; 988 | } 989 | .setting .settingPage .settingContainer .settingItem .settingLanguageBtn { 990 | position: relative; 991 | height: 32px; 992 | border-radius: 3px; 993 | border: 1px solid #eee; 994 | box-sizing: border-box; 995 | line-height: 30px; 996 | text-align: center; 997 | color: #666; 998 | cursor: pointer; 999 | outline: none; 1000 | font-size: 13px; 1001 | margin-top: 4px; 1002 | } 1003 | .setting .settingPage .settingContainer .settingItem .settingLanguageBtn .settingLanguageBtnSelected { 1004 | position: absolute; 1005 | height: 16px; 1006 | width: 16px; 1007 | top: 8px; 1008 | border-radius: 50%; 1009 | right: 8px; 1010 | background: #396 url("../static/images/ok.png") center / 60% no-repeat; 1011 | } 1012 | .setting .settingPage .settingContainer .settingItem .settingItemAutoScroll { 1013 | position: relative; 1014 | height: 32px; 1015 | line-height: 32px; 1016 | font-size: 13px; 1017 | box-sizing: border-box; 1018 | border-radius: 3px; 1019 | padding: 0 6px; 1020 | background: #f5f5f5; 1021 | color: #666; 1022 | } 1023 | .setting .settingPage .settingContainer .settingItem .settingItemAutoScroll .settingItemAutoScrollBtn { 1024 | position: absolute; 1025 | right: 6px; 1026 | border: 1px solid #ccc; 1027 | box-sizing: border-box; 1028 | width: 40px; 1029 | border-radius: 12px; 1030 | height: 20px; 1031 | top: 6px; 1032 | } 1033 | .setting .settingPage .settingContainer .settingItem .settingItemAutoScroll .settingItemAutoScrollBtn::before { 1034 | content: ' '; 1035 | position: absolute; 1036 | top: 1px; 1037 | left: 2px; 1038 | height: 16px; 1039 | width: 16px; 1040 | border-radius: 8px; 1041 | background: #ccc; 1042 | } 1043 | .setting .settingAutoScroll { 1044 | position: fixed; 1045 | z-index: 15; 1046 | top: 0; 1047 | right: 0px; 1048 | width: 100%; 1049 | height: 100%; 1050 | background: rgba(0, 0, 0, 0); 1051 | } 1052 | .commoncode { 1053 | font-size: 12px; 1054 | } 1055 | .commoncode .commoncode-line { 1056 | position: relative; 1057 | border-bottom: 1px dotted #eee; 1058 | word-break: break-all; 1059 | line-height: 2em; 1060 | font-size: 1.08333333em; 1061 | text-indent: -1em; 1062 | min-height: 2em; 1063 | } 1064 | .commoncode .commoncode-line:last-child { 1065 | border-bottom: 0; 1066 | } 1067 | .commoncode .commoncode-line .commoncode-lineindex { 1068 | position: absolute; 1069 | left: 0; 1070 | padding-left: 0.5em; 1071 | top: 0; 1072 | font-size: 1em; 1073 | color: #999; 1074 | line-height: 2em; 1075 | text-indent: 0; 1076 | } 1077 | .commoncode.light .hljs { 1078 | display: block; 1079 | color: black; 1080 | } 1081 | .commoncode.light .hljs-comment, 1082 | .commoncode.light .hljs-quote, 1083 | .commoncode.light .hljs-variable { 1084 | color: #008000; 1085 | } 1086 | .commoncode.light .hljs-keyword, 1087 | .commoncode.light .hljs-selector-tag, 1088 | .commoncode.light .hljs-built_in, 1089 | .commoncode.light .hljs-name, 1090 | .commoncode.light .hljs-tag { 1091 | color: #36f; 1092 | } 1093 | .commoncode.light .hljs-string, 1094 | .commoncode.light .hljs-title, 1095 | .commoncode.light .hljs-section, 1096 | .commoncode.light .hljs-attribute, 1097 | .commoncode.light .hljs-literal, 1098 | .commoncode.light .hljs-template-tag, 1099 | .commoncode.light .hljs-template-variable, 1100 | .commoncode.light .hljs-type, 1101 | .commoncode.light .hljs-addition { 1102 | color: #a31515; 1103 | } 1104 | .commoncode.light .hljs-deletion, 1105 | .commoncode.light .hljs-selector-attr, 1106 | .commoncode.light .hljs-selector-pseudo, 1107 | .commoncode.light .hljs-meta { 1108 | color: #2b91af; 1109 | } 1110 | .commoncode.light .hljs-doctag { 1111 | color: #808080; 1112 | } 1113 | .commoncode.light .hljs-attr { 1114 | color: #f00; 1115 | } 1116 | .commoncode.light .hljs-symbol, 1117 | .commoncode.light .hljs-bullet, 1118 | .commoncode.light .hljs-link { 1119 | color: #00b0e8; 1120 | } 1121 | .commoncode.light .hljs-emphasis { 1122 | font-style: italic; 1123 | } 1124 | .commoncode.light .hljs-strong { 1125 | font-weight: bold; 1126 | } 1127 | .loading { 1128 | padding: 32px 0; 1129 | text-align: center; 1130 | color: #999; 1131 | font-size: 12px; 1132 | } 1133 | .componentCode .notSupport { 1134 | padding: 20px 0; 1135 | text-align: center; 1136 | } 1137 | .componentCode .notSupport .notSupportTip { 1138 | margin: 10px; 1139 | font-size: 12px; 1140 | text-align: center; 1141 | color: #c33; 1142 | } 1143 | .componentCode .notSupport .toDownload { 1144 | display: inline-block; 1145 | margin: 10px; 1146 | padding: 6px 20px; 1147 | border: 1px solid #eee; 1148 | border-radius: 3px; 1149 | background-color: #f5f5f5; 1150 | color: #69f; 1151 | font-size: 12px; 1152 | user-select: none; 1153 | text-align: center; 1154 | line-height: 20px; 1155 | cursor: pointer; 1156 | text-decoration: none; 1157 | } 1158 | .code .codeContent { 1159 | margin: 0px auto; 1160 | width: 100%; 1161 | box-sizing: border-box; 1162 | max-width: 960px; 1163 | border: 0; 1164 | border-left: 1px solid #eee; 1165 | border-right: 1px solid #eee; 1166 | } 1167 | .selectBranch .title span { 1168 | margin-left: 10px; 1169 | color: #ccc; 1170 | } 1171 | .selectBranch .title .selected { 1172 | color: #000; 1173 | font-weight: bold; 1174 | } 1175 | .selectBranch .user { 1176 | padding: 8px 12px; 1177 | font-size: 12px; 1178 | font-weight: bold; 1179 | color: #ffffff; 1180 | background-color: #3e508e; 1181 | border-bottom: 1px solid #eee; 1182 | } 1183 | .selectBranch .branch { 1184 | border-bottom: 1px solid #eee; 1185 | padding: 12px; 1186 | } 1187 | .selectBranch .branch:last-child { 1188 | border-bottom: 0; 1189 | } 1190 | .selectBranch .branch .branchName { 1191 | line-height: 24px; 1192 | font-size: 14px; 1193 | color: #333; 1194 | font-weight: bold; 1195 | word-break: break-all; 1196 | } 1197 | .selectBranch .branch .branchSha { 1198 | line-height: 24px; 1199 | font-size: 12px; 1200 | color: #666; 1201 | word-break: break-all; 1202 | } 1203 | .selectBranch .commit { 1204 | border-bottom: 1px solid #eee; 1205 | padding: 12px; 1206 | } 1207 | .selectBranch .commit:last-child { 1208 | border-bottom: 0; 1209 | } 1210 | .selectBranch .commit .commitMsg { 1211 | line-height: 18px; 1212 | font-size: 13px; 1213 | color: #999; 1214 | word-break: break-all; 1215 | } 1216 | .selectBranch .commit .commitInfo { 1217 | line-height: 24px; 1218 | font-size: 13px; 1219 | color: #333; 1220 | word-break: break-all; 1221 | } 1222 | .selectBranch .hash textarea { 1223 | display: block; 1224 | margin: 10px auto; 1225 | width: 94%; 1226 | box-sizing: border-box; 1227 | max-width: 480px; 1228 | height: 144px; 1229 | line-height: 24px; 1230 | padding: 12px; 1231 | font-size: 13px; 1232 | color: #666; 1233 | border: 1px solid #ccc; 1234 | resize: none; 1235 | outline: none; 1236 | border-radius: 3px; 1237 | } 1238 | .selectBranch .hash .button { 1239 | margin: 10px auto; 1240 | width: 94%; 1241 | box-sizing: border-box; 1242 | max-width: 480px; 1243 | line-height: 38px; 1244 | font-size: 13px; 1245 | text-align: center; 1246 | background: #6ba06b; 1247 | color: #fff; 1248 | border-radius: 3px; 1249 | outline: none; 1250 | cursor: pointer; 1251 | user-select: none; 1252 | } 1253 | .repoList a { 1254 | text-decoration: none; 1255 | } 1256 | .repoList a.add { 1257 | display: block; 1258 | position: relative; 1259 | margin: 10px auto; 1260 | line-height: 36px; 1261 | width: 94%; 1262 | border-radius: 3px; 1263 | color: #fff; 1264 | text-align: center; 1265 | font-size: 12px; 1266 | background-color: #da7878; 1267 | font-weight: bold; 1268 | } 1269 | .repoList .listItem { 1270 | position: relative; 1271 | display: block; 1272 | padding: 12px; 1273 | padding-left: 32px; 1274 | user-select: none; 1275 | } 1276 | .repoList .listItem::before { 1277 | content: ' '; 1278 | position: absolute; 1279 | height: 100%; 1280 | top: 0; 1281 | left: 15px; 1282 | width: 1px; 1283 | background: #eee; 1284 | } 1285 | .repoList .listItem::after { 1286 | content: ' '; 1287 | position: absolute; 1288 | height: 9px; 1289 | top: 20px; 1290 | left: 11px; 1291 | width: 9px; 1292 | border-radius: 50%; 1293 | background: #fc9; 1294 | } 1295 | .repoList .listItem:nth-child(n)::after { 1296 | background: #fc9; 1297 | } 1298 | .repoList .listItem:nth-child(2n)::after { 1299 | background: #69daf7; 1300 | } 1301 | .repoList .listItem:nth-child(3n)::after { 1302 | background: #b1d6c8; 1303 | } 1304 | .repoList .listItem .listName { 1305 | line-height: 24px; 1306 | font-size: 14px; 1307 | font-weight: bold; 1308 | color: #333; 1309 | } 1310 | .repoList .listItem .listInfo { 1311 | position: relative; 1312 | line-height: 20px; 1313 | font-size: 12px; 1314 | color: #999; 1315 | } 1316 | .repoList .listItem .listInfo::before { 1317 | content: ' '; 1318 | position: absolute; 1319 | left: 0; 1320 | bottom: 0; 1321 | width: 64%; 1322 | } 1323 | .repoList .introduction { 1324 | padding: 12px; 1325 | font-size: 13px; 1326 | max-width: 640px; 1327 | margin: 0 auto; 1328 | } 1329 | .repoList .introduction .howTo { 1330 | border-left: 4px solid #cdf; 1331 | padding: 6px; 1332 | margin-bottom: 16px; 1333 | } 1334 | .repoList .introduction .introductionTitle { 1335 | font-size: 18px; 1336 | font-weight: bold; 1337 | color: #000; 1338 | padding: 12px 0; 1339 | } 1340 | .repoList .introduction .paragraph { 1341 | margin-bottom: 16px; 1342 | } 1343 | .repoList .introduction .paragraph a { 1344 | color: #39f; 1345 | } 1346 | .repoList .introduction .paragraph.bold { 1347 | font-size: 14px; 1348 | font-weight: bold; 1349 | } 1350 | .repoList .introduction .paragraph.list { 1351 | padding-left: 16px; 1352 | text-indent: -16px; 1353 | } 1354 | .branchList a { 1355 | text-decoration: none; 1356 | } 1357 | .branchList a.add { 1358 | display: block; 1359 | position: relative; 1360 | margin: 10px auto; 1361 | line-height: 36px; 1362 | width: 94%; 1363 | border-radius: 3px; 1364 | color: #706464; 1365 | text-align: center; 1366 | font-size: 12px; 1367 | background-color: #ecf8fa; 1368 | font-weight: bold; 1369 | } 1370 | .branchList .user { 1371 | padding: 8px 12px; 1372 | font-size: 12px; 1373 | font-weight: bold; 1374 | color: #ffffff; 1375 | background-color: #3e508e; 1376 | border-bottom: 1px solid #eee; 1377 | } 1378 | .branchList .branchItem { 1379 | position: relative; 1380 | display: block; 1381 | padding: 12px; 1382 | padding-left: 32px; 1383 | } 1384 | .branchList .branchItem::before { 1385 | content: ' '; 1386 | position: absolute; 1387 | height: 100%; 1388 | top: 0; 1389 | left: 15px; 1390 | width: 1px; 1391 | background: #eee; 1392 | } 1393 | .branchList .branchItem::after { 1394 | content: ' '; 1395 | position: absolute; 1396 | height: 9px; 1397 | top: 20px; 1398 | left: 11px; 1399 | width: 9px; 1400 | border-radius: 50%; 1401 | background: #fc9; 1402 | } 1403 | .branchList .branchItem:nth-child(n)::after { 1404 | background: #fc9; 1405 | } 1406 | .branchList .branchItem:nth-child(2n)::after { 1407 | background: #69daf7; 1408 | } 1409 | .branchList .branchItem:nth-child(3n)::after { 1410 | background: #b1d6c8; 1411 | } 1412 | .branchList .branchItem .branchName { 1413 | line-height: 24px; 1414 | font-size: 14px; 1415 | font-weight: bold; 1416 | color: #333; 1417 | } 1418 | .branchList .branchItem .branchInfo { 1419 | line-height: 20px; 1420 | font-size: 12px; 1421 | color: #999; 1422 | } 1423 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Code Reader 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Code Reader 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /libs/highlight.min.js: -------------------------------------------------------------------------------- 1 | /*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */ 2 | !function(e){var t="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):t&&(t.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return t.hljs}))}(function(e){function t(e){return e.replace(/&/g,"&").replace(//g,">")}function r(e){return e.nodeName.toLowerCase()}function a(e,t){var r=e&&e.exec(t);return r&&0===r.index}function n(e){return E.test(e)}function i(e){var t,r,a,i,s=e.className+" ";if(s+=e.parentNode?e.parentNode.className:"",r=M.exec(s))return w(r[1])?r[1]:"no-highlight";for(s=s.split(/\s+/),t=0,a=s.length;a>t;t++)if(i=s[t],n(i)||w(i))return i}function s(e){var t,r={},a=Array.prototype.slice.call(arguments,1);for(t in e)r[t]=e[t];return a.forEach(function(e){for(t in e)r[t]=e[t]}),r}function c(e){var t=[];return function a(e,n){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?n+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:n,node:i}),n=a(i,n),r(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:n,node:i}));return n}(e,0),t}function o(e,a,n){function i(){return e.length&&a.length?e[0].offset!==a[0].offset?e[0].offset"}function c(e){u+=""}function o(e){("start"===e.event?s:c)(e.node)}for(var l=0,u="",d=[];e.length||a.length;){var b=i();if(u+=t(n.substring(l,b[0].offset)),l=b[0].offset,b===e){d.reverse().forEach(c);do o(b.splice(0,1)[0]),b=i();while(b===e&&b.length&&b[0].offset===l);d.reverse().forEach(s)}else"start"===b[0].event?d.push(b[0].node):d.pop(),o(b.splice(0,1)[0])}return u+t(n.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(t){return s(e,{v:null},t)})),e.cached_variants||e.eW&&[s(e)]||[e]}function u(e){function t(e){return e&&e.source||e}function r(r,a){return new RegExp(t(r),"m"+(e.cI?"i":"")+(a?"g":""))}function a(n,i){if(!n.compiled){if(n.compiled=!0,n.k=n.k||n.bK,n.k){var s={},c=function(t,r){e.cI&&(r=r.toLowerCase()),r.split(" ").forEach(function(e){var r=e.split("|");s[r[0]]=[t,r[1]?Number(r[1]):1]})};"string"==typeof n.k?c("keyword",n.k):k(n.k).forEach(function(e){c(e,n.k[e])}),n.k=s}n.lR=r(n.l||/\w+/,!0),i&&(n.bK&&(n.b="\\b("+n.bK.split(" ").join("|")+")\\b"),n.b||(n.b=/\B|\b/),n.bR=r(n.b),n.e||n.eW||(n.e=/\B|\b/),n.e&&(n.eR=r(n.e)),n.tE=t(n.e)||"",n.eW&&i.tE&&(n.tE+=(n.e?"|":"")+i.tE)),n.i&&(n.iR=r(n.i)),null==n.r&&(n.r=1),n.c||(n.c=[]),n.c=Array.prototype.concat.apply([],n.c.map(function(e){return l("self"===e?n:e)})),n.c.forEach(function(e){a(e,n)}),n.starts&&a(n.starts,i);var o=n.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([n.tE,n.i]).map(t).filter(Boolean);n.t=o.length?r(o.join("|"),!0):{exec:function(){return null}}}}a(e)}function d(e,r,n,i){function s(e,t){var r,n;for(r=0,n=t.c.length;n>r;r++)if(a(t.c[r].bR,e))return t.c[r]}function c(e,t){if(a(e.eR,t)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?c(e.parent,t):void 0}function o(e,t){return!n&&a(t.iR,e)}function l(e,t){var r=v.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(r)&&e.k[r]}function p(e,t,r,a){var n=a?"":L.classPrefix,i='',i+t+s}function m(){var e,r,a,n;if(!N.k)return t(E);for(n="",r=0,N.lR.lastIndex=0,a=N.lR.exec(E);a;)n+=t(E.substring(r,a.index)),e=l(N,a),e?(M+=e[1],n+=p(e[0],t(a[0]))):n+=t(a[0]),r=N.lR.lastIndex,a=N.lR.exec(E);return n+t(E.substr(r))}function f(){var e="string"==typeof N.sL;if(e&&!x[N.sL])return t(E);var r=e?d(N.sL,E,!0,k[N.sL]):b(E,N.sL.length?N.sL:void 0);return N.r>0&&(M+=r.r),e&&(k[N.sL]=r.top),p(r.language,r.value,!1,!0)}function g(){C+=null!=N.sL?f():m(),E=""}function _(e){C+=e.cN?p(e.cN,"",!0):"",N=Object.create(e,{parent:{value:N}})}function h(e,t){if(E+=e,null==t)return g(),0;var r=s(t,N);if(r)return r.skip?E+=t:(r.eB&&(E+=t),g(),r.rB||r.eB||(E=t)),_(r,t),r.rB?0:t.length;var a=c(N,t);if(a){var n=N;n.skip?E+=t:(n.rE||n.eE||(E+=t),g(),n.eE&&(E=t));do N.cN&&(C+=R),N.skip||(M+=N.r),N=N.parent;while(N!==a.parent);return a.starts&&_(a.starts,""),n.rE?0:t.length}if(o(t,N))throw new Error('Illegal lexeme "'+t+'" for mode "'+(N.cN||"")+'"');return E+=t,t.length||1}var v=w(e);if(!v)throw new Error('Unknown language: "'+e+'"');u(v);var y,N=i||v,k={},C="";for(y=N;y!==v;y=y.parent)y.cN&&(C=p(y.cN,"",!0)+C);var E="",M=0;try{for(var B,S,$=0;;){if(N.t.lastIndex=$,B=N.t.exec(r),!B)break;S=h(r.substring($,B.index),B[0]),$=B.index+S}for(h(r.substr($)),y=N;y.parent;y=y.parent)y.cN&&(C+=R);return{r:M,value:C,language:e,top:N}}catch(A){if(A.message&&-1!==A.message.indexOf("Illegal"))return{r:0,value:t(r)};throw A}}function b(e,r){r=r||L.languages||k(x);var a={r:0,value:t(e)},n=a;return r.filter(w).forEach(function(t){var r=d(t,e,!1);r.language=t,r.r>n.r&&(n=r),r.r>a.r&&(n=a,a=r)}),n.language&&(a.second_best=n),a}function p(e){return L.tabReplace||L.useBR?e.replace(B,function(e,t){return L.useBR&&"\n"===e?"
":L.tabReplace?t.replace(/\t/g,L.tabReplace):""}):e}function m(e,t,r){var a=t?C[t]:r,n=[e.trim()];return e.match(/\bhljs\b/)||n.push("hljs"),-1===e.indexOf(a)&&n.push(a),n.join(" ").trim()}function f(e){var t,r,a,s,l,u=i(e);n(u)||(L.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e,l=t.textContent,a=u?d(u,l,!0):b(l),r=c(t),r.length&&(s=document.createElementNS("http://www.w3.org/1999/xhtml","div"),s.innerHTML=a.value,a.value=o(r,c(s),l)),a.value=p(a.value),e.innerHTML=a.value,e.className=m(e.className,u,a.language),e.result={language:a.language,re:a.r},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.r}))}function g(e){L=s(L,e)}function _(){if(!_.called){_.called=!0;var e=document.querySelectorAll("pre code");N.forEach.call(e,f)}}function h(){addEventListener("DOMContentLoaded",_,!1),addEventListener("load",_,!1)}function v(t,r){var a=x[t]=r(e);a.aliases&&a.aliases.forEach(function(e){C[e]=t})}function y(){return k(x)}function w(e){return e=(e||"").toLowerCase(),x[e]||x[C[e]]}var N=[],k=Object.keys,x={},C={},E=/^(no-?highlight|plain|text)$/i,M=/\blang(?:uage)?-([\w-]+)\b/i,B=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,R="
",L={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=d,e.highlightAuto=b,e.fixMarkup=p,e.highlightBlock=f,e.configure=g,e.initHighlighting=_,e.initHighlightingOnLoad=h,e.registerLanguage=v,e.listLanguages=y,e.getLanguage=w,e.inherit=s,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(t,r,a){var n=e.inherit({cN:"comment",b:t,e:r,c:[]},a||{});return n.c.push(e.PWM),n.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),n},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e.registerLanguage("apache",function(e){var t={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"section",b:""},{cN:"attribute",b:/\w+/,r:0,k:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"meta",b:"\\s\\[",e:"\\]$"},{cN:"variable",b:"[\\$%]\\{",e:"\\}",c:["self",t]},t,e.QSM]}}],i:/\S/}}),e.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},r={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,r,a,t]}}),e.registerLanguage("coffeescript",function(e){var t={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",built_in:"npm require console print module global window document"},r="[A-Za-z$_][0-9A-Za-z$_]*",a={cN:"subst",b:/#\{/,e:/}/,k:t},n=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,a]},{b:/"/,e:/"/,c:[e.BE,a]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[a,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{b:"@"+r},{sL:"javascript",eB:!0,eE:!0,v:[{b:"```",e:"```"},{b:"`",e:"`"}]}];a.c=n;var i=e.inherit(e.TM,{b:r}),s="(\\(.*\\))?\\s*\\B[-=]>",c={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:t,c:["self"].concat(n)}]};return{aliases:["coffee","cson","iced"],k:t,i:/\/\*/,c:n.concat([e.C("###","###"),e.HCM,{cN:"function",b:"^\\s*"+r+"\\s*=\\s*"+s,e:"[-=]>",rB:!0,c:[i,c]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:s,e:"[-=]>",rB:!0,c:[c]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[i]},i]},{b:r+":",e:":",rB:!0,rE:!0,r:0}])}}),e.registerLanguage("cpp",function(e){var t={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[{b:'(u8?|U)?L?"',e:'"',i:"\\n",c:[e.BE]},{b:'(u8?|U)?R"',e:'"',c:[e.BE]},{b:"'\\\\?.",e:"'",i:"."}]},a={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},n={cN:"meta",b:/#\s*[a-z]+\b/,e:/$/,k:{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},c:[{b:/\\\n/,r:0},e.inherit(r,{cN:"meta-string"}),{cN:"meta-string",b:/<[^\n>]*>/,e:/$/,i:"\\n"},e.CLCM,e.CBCM]},i=e.IR+"\\s*\\(",s={keyword:"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr",literal:"true false nullptr NULL"},c=[t,e.CLCM,e.CBCM,a,r];return{aliases:["c","cc","h","c++","h++","hpp"],k:s,i:"",k:s,c:["self",t]},{b:e.IR+"::",k:s},{v:[{b:/=/,e:/;/},{b:/\(/,e:/\)/},{bK:"new throw return else",e:/;/}],k:s,c:c.concat([{b:/\(/,e:/\)/,k:s,c:c.concat(["self"]),r:0}]),r:0},{cN:"function",b:"("+e.IR+"[\\*&\\s]+)+"+i,rB:!0,e:/[{;=]/,eE:!0,k:s,i:/[^\w\s\*&]/,c:[{b:i,rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:s,r:0,c:[e.CLCM,e.CBCM,r,a,t]},e.CLCM,e.CBCM,n]},{cN:"class",bK:"class struct",e:/[{;:]/,c:[{b://,c:["self"]},e.TM]}]),exports:{preprocessor:n,strings:r,k:s}}}),e.registerLanguage("cs",function(e){var t={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long nameof object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield",literal:"null false true"},r={cN:"string",b:'@"',e:'"',c:[{b:'""'}]},a=e.inherit(r,{i:/\n/}),n={cN:"subst",b:"{",e:"}",k:t},i=e.inherit(n,{i:/\n/}),s={cN:"string",b:/\$"/,e:'"',i:/\n/,c:[{b:"{{"},{b:"}}"},e.BE,i]},c={cN:"string",b:/\$@"/,e:'"',c:[{b:"{{"},{b:"}}"},{b:'""'},n]},o=e.inherit(c,{i:/\n/,c:[{b:"{{"},{b:"}}"},{b:'""'},i]});n.c=[c,s,r,e.ASM,e.QSM,e.CNM,e.CBCM],i.c=[o,s,a,e.ASM,e.QSM,e.CNM,e.inherit(e.CBCM,{i:/\n/})];var l={v:[c,s,r,e.ASM,e.QSM]},u=e.IR+"(<"+e.IR+"(\\s*,\\s*"+e.IR+")*>)?(\\[\\])?";return{aliases:["csharp"],k:t,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:""},{b:""}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},l,e.CNM,{bK:"class interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{cN:"meta",b:"^\\s*\\[",eB:!0,e:"\\]",eE:!0,c:[{cN:"meta-string",b:/"/,e:/"/}]},{bK:"new return throw await else",r:0},{cN:"function",b:"("+u+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:t,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,r:0,c:[l,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}}),e.registerLanguage("css",function(e){var t="[a-zA-Z-][a-zA-Z0-9_-]*",r={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:t,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,r]}]}}),e.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"meta",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"comment",v:[{b:/Index: /,e:/$/},{b:/={3,}/,e:/$/},{b:/^\-{3}/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+{3}/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"addition",b:"^\\!",e:"$"}]}}),e.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}}),e.registerLanguage("ini",function(e){var t={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},t,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}}),e.registerLanguage("java",function(e){var t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+"(<"+t+"(\\s*,\\s*"+t+")*>)?",a="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",n="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",i={cN:"number",b:n,r:0};return{aliases:["jsp"],k:a,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+r+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:a,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:a,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},i,{cN:"meta",b:"@[A-Za-z]+"}]}}),e.registerLanguage("javascript",function(e){var t="[A-Za-z$_][0-9A-Za-z$_]*",r={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:r,c:[]},i={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,i,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:r,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,i,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:t+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:t,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+t+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:t},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:r,c:s}]}]},{b://,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:t}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}}),e.registerLanguage("json",function(e){var t={literal:"true false null"},r=[e.QSM,e.CNM],a={e:",",eW:!0,eE:!0,c:r,k:t},n={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(a,{b:/:/})],i:"\\S"},i={b:"\\[",e:"\\]",c:[e.inherit(a)],i:"\\S"};return r.splice(r.length,0,n,i),{c:r,k:t,i:"\\S"}}),e.registerLanguage("makefile",function(e){var t={cN:"variable",v:[{b:"\\$\\("+e.UIR+"\\)",c:[e.BE]},{b:/\$[@%`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},e.C("",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0}]},{cN:"tag",b:"|$)",e:">",k:{name:"style"},c:[r],starts:{e:"",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"|$)",e:">",k:{name:"script"},c:[r],starts:{e:"",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"meta",v:[{b:/<\?xml/,e:/\?>/,r:10},{b:/<\?\w+/,e:/\?>/}]},{cN:"tag",b:"",c:[{cN:"name",b:/[^\/><\s]+/,r:0},r]}]}}),e.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}}),e.registerLanguage("nginx",function(e){var t={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},r={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,t],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[t]},{cN:"regexp",c:[e.BE,t],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},t]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:r}],r:0}],i:"[^\\s\\}]"}}),e.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:r,l:a,i:""}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:a,c:[e.UTM]},{b:"\\."+e.UIR,r:0}]}}),e.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},a={b:"->{",e:"}"},n={v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=[e.BE,r,n],s=[n,e.HCM,e.C("^\\=\\w","\\=cut",{eW:!0}),a,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"function",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",eE:!0,r:5,c:[e.TM]},{b:"-\\w\\b",r:0},{b:"^__DATA__$",e:"^__END__$",sL:"mojolicious",c:[{b:"^@@.*",e:"$",cN:"comment"}]}];return r.c=s,a.c=s,{aliases:["pl","pm"],l:/[\w\.]+/,k:t,c:s}}),e.registerLanguage("php",function(e){var t={b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},r={cN:"meta",b:/<\?(php)?|\?>/},a={cN:"string",c:[e.BE,r],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},n={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.HCM,e.C("//","$",{c:[r]}),e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:/<<<['"]?\w+['"]?$/,e:/^\w+;?$/,c:[e.BE,{cN:"subst",v:[{b:/\$\w+/},{b:/\{\$/,e:/\}/}]}]},r,{cN:"keyword",b:/\$this\b/},t,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",t,e.CBCM,a,n]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},a,n]}}),e.registerLanguage("python",function(e){var t={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},r={cN:"meta",b:/^(>>>|\.\.\.) /},a={cN:"subst",b:/\{/,e:/\}/,k:t,i:/#/},n={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[r],r:10},{b:/(fr|rf|f)'''/,e:/'''/,c:[r,a]},{b:/(fr|rf|f)"""/,e:/"""/,c:[r,a]},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},{b:/(fr|rf|f)'/,e:/'/,c:[a]},{b:/(fr|rf|f)"/,e:/"/,c:[a]},e.ASM,e.QSM]},i={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},s={cN:"params",b:/\(/,e:/\)/,c:["self",r,i,n]};return a.c=[n,i,r],{aliases:["py","gyp"],k:t,i:/(<\/|->|\?)|=>/,c:[r,i,n,e.HCM,{v:[{cN:"function",bK:"def"},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,s,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}}),e.registerLanguage("ruby",function(e){ 3 | var t="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},a={cN:"doctag",b:"@[A-Za-z]+"},n={b:"#<",e:">"},i=[e.C("#","$",{c:[a]}),e.C("^\\=begin","^\\=end",{c:[a],r:10}),e.C("^__END__","\\n$")],s={cN:"subst",b:"#\\{",e:"}",k:r},c={cN:"string",c:[e.BE,s],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},o={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},l=[c,n,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(i)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:t}),o].concat(i)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[c,{b:t}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[n,{cN:"regexp",c:[e.BE,s],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(i),r:0}].concat(i);s.c=l,o.c=l;var u="[>?]>",d="[\\w#]+\\(\\w+\\):\\d+:\\d+>",b="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",p=[{b:/^\s*=>/,starts:{e:"$",c:l}},{cN:"meta",b:"^("+u+"|"+d+"|"+b+")",starts:{e:"$",c:l}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:i.concat(p).concat(l)}}),e.registerLanguage("shell",function(e){return{aliases:["console"],c:[{cN:"meta",b:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{e:"$",sL:"bash"}}]}}),e.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*#]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text varchar varying void"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}}),e}); -------------------------------------------------------------------------------- /libs/marked.min.js: -------------------------------------------------------------------------------- 1 | (function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=u.breaks:this.rules=u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function l(e,t){return baseUrls[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?baseUrls[" "+e]=e+"/":baseUrls[" "+e]=e.replace(/[^/]*$/,"")),e=baseUrls[" "+e],"//"===t.slice(0,2)?e.replace(/:[^]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[^]*/,"$1")+t:e+t}function o(){}function h(e){for(var t,n,r=1;rAn error occured:

"+s(e.message+"",!0)+"
";throw e}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=i(p.item,"gm")(/bull/g,p.bullet)(),p.list=i(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p._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",p.html=i(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=i(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=i(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){return new e(n).lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){var r,s,i,l,o,h,a,u,c;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,u=0;u1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=i(u.link)("inside",u._inside)("href",u._href)(),u.reflink=i(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:i(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:i(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:i(u.br)("{2,}","*")(),text:i(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){return new t(n,r).output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1])),r=this.mangle("mailto:")+n):r=n=s(i[1]),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),r=n=s(i[1]),l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:s(e,!0))+"\n
\n":"
"+(n?e:s(e,!0))+"\n
"},n.prototype.blockquote=function(e){return"
\n"+e+"
\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(function(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return""}this.options.baseUrl&&!originIndependentUrl.test(e)&&(e=l(this.options.baseUrl,e));var s='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!originIndependentUrl.test(e)&&(e=l(this.options.baseUrl,e));var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){return new r(t,n).parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.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 e,t,n,r,s="",i="";for(n="",e=0;e2;)W.push(arguments[l]);n&&null!=n.children&&(W.length||W.push(n.children),delete n.children);while(W.length)if((r=W.pop())&&void 0!==r.pop)for(l=r.length;l--;)W.push(r[l]);else r!==!0&&r!==!1||(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r+="":"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===E?a=[r]:a.push(r),o=i;var _=new e;return _.nodeName=t,_.children=a,_.attributes=null==n?void 0:n,_.key=null==n?void 0:n.key,void 0!==S.vnode&&S.vnode(_),_}function n(e,t){for(var n in t)e[n]=t[n];return e}function o(e,o){return t(e.nodeName,n(n({},e.attributes),o),arguments.length>2?[].slice.call(arguments,2):e.children)}function r(e){!e.__d&&(e.__d=!0)&&1==A.push(e)&&(S.debounceRendering||setTimeout)(i)}function i(){var e,t=A;A=[];while(e=t.pop())e.__d&&k(e)}function l(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function _(e){var t=n({},e.attributes);t.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var r in o)void 0===t[r]&&(t[r]=o[r]);return t}function u(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function c(e){e.parentNode&&e.parentNode.removeChild(e)}function p(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&V.test(i)===!1?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var l=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,d,l):e.removeEventListener(t,d,l),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)s(e,t,null==o?"":o),null!=o&&o!==!1||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||o===!1?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function s(e,t,n){try{e[t]=n}catch(e){}}function d(e){return this.__l[e.type](S.event&&S.event(e)||e)}function f(){var e;while(e=D.pop())S.afterMount&&S.afterMount(e),e.componentDidMount&&e.componentDidMount()}function h(e,t,n,o,r,i){H++||(P=null!=r&&void 0!==r.ownerSVGElement,R=null!=e&&!("__preactattr_"in e));var l=m(e,t,n,o,i);return r&&l.parentNode!==r&&r.appendChild(l),--H||(R=!1,i||f()),l}function m(e,t,n,o,r){var i=e,l=P;if(null==t&&(t=""),"string"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),b(e,!0))),i.__preactattr_=!0,i;if("function"==typeof t.nodeName)return U(e,t,n,o);if(P="svg"===t.nodeName||"foreignObject"!==t.nodeName&&P,(!e||!a(e,t.nodeName+""))&&(i=u(t.nodeName+"",P),e)){while(e.firstChild)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),b(e,!0)}var _=i.firstChild,c=i.__preactattr_||(i.__preactattr_={}),p=t.children;return!R&&p&&1===p.length&&"string"==typeof p[0]&&null!=_&&void 0!==_.splitText&&null==_.nextSibling?_.nodeValue!=p[0]&&(_.nodeValue=p[0]):(p&&p.length||null!=_)&&v(i,p,n,o,R||null!=c.dangerouslySetInnerHTML),g(i,t.attributes,c),P=l,i}function v(e,t,n,o,r){var i,a,_,u,p=e.childNodes,s=[],d={},f=0,h=0,v=p.length,y=0,g=t?t.length:0;if(0!==v)for(var N=0;N=v?e.appendChild(u):u!==p[N]&&(u===p[N+1]?c(p[N]):e.insertBefore(u,p[N]||null)))}if(f)for(var N in d)void 0!==d[N]&&b(d[N],!1);while(h<=y)void 0!==(u=s[y--])&&b(u,!1)}function b(e,t){var n=e._component;n?L(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),t!==!1&&null!=e.__preactattr_||c(e),y(e))}function y(e){e=e.lastChild;while(e){var t=e.previousSibling;b(e,!0),e=t}}function g(e,t,n){var o;for(o in n)t&&null!=t[o]||null==n[o]||p(e,o,n[o],n[o]=void 0,P);for(o in t)"children"===o||"innerHTML"===o||o in n&&t[o]===("value"===o||"checked"===o?e[o]:n[o])||p(e,o,n[o],n[o]=t[o],P)}function N(e){var t=e.constructor.name;(j[t]||(j[t]=[])).push(e)}function w(e,t,n){var o,r=j[e.name];if(e.prototype&&e.prototype.render?(o=new e(t,n),T.call(o,t,n)):(o=new T(t,n),o.constructor=e,o.render=C),r)for(var i=r.length;i--;)if(r[i].constructor===e){o.__b=r[i].__b,r.splice(i,1);break}return o}function C(e,t,n){return this.constructor(e,n)}function x(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&S.syncComponentUpdates===!1&&e.base?r(e):k(e,1,i)),e.__r&&e.__r(e))}function k(e,t,o,r){if(!e.__x){var i,l,a,u=e.props,c=e.state,p=e.context,s=e.__p||u,d=e.__s||c,m=e.__c||p,v=e.base,y=e.__b,g=v||y,N=e._component,C=!1;if(v&&(e.props=s,e.state=d,e.context=m,2!==t&&e.shouldComponentUpdate&&e.shouldComponentUpdate(u,c,p)===!1?C=!0:e.componentWillUpdate&&e.componentWillUpdate(u,c,p),e.props=u,e.state=c,e.context=p),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!C){i=e.render(u,c,p),e.getChildContext&&(p=n(n({},p),e.getChildContext()));var U,T,M=i&&i.nodeName;if("function"==typeof M){var W=_(i);l=N,l&&l.constructor===M&&W.key==l.__k?x(l,W,1,p,!1):(U=l,e._component=l=w(M,W,p),l.__b=l.__b||y,l.__u=e,x(l,W,0,p,!1),k(l,1,o,!0)),T=l.base}else a=g,U=N,U&&(a=e._component=null),(g||1===t)&&(a&&(a._component=null),T=h(a,i,p,o||!v,g&&g.parentNode,!0));if(g&&T!==g&&l!==N){var E=g.parentNode;E&&T!==E&&(E.replaceChild(T,g),U||(g._component=null,b(g,!1)))}if(U&&L(U),e.base=T,T&&!r){var V=e,A=e;while(A=A.__u)(V=A).base=T;T._component=V,T._componentConstructor=V.constructor}}if(!v||o?D.unshift(e):C||(f(),e.componentDidUpdate&&e.componentDidUpdate(s,d,m),S.afterUpdate&&S.afterUpdate(e)),null!=e.__h)while(e.__h.length)e.__h.pop().call(e);H||r||f()}}function U(e,t,n,o){var r=e&&e._component,i=r,l=e,a=r&&e._componentConstructor===t.nodeName,u=a,c=_(t);while(r&&!u&&(r=r.__u))u=r.constructor===t.nodeName;return r&&u&&(!o||r._component)?(x(r,c,3,n,o),e=r.base):(i&&!a&&(L(i),e=l=null),r=w(t.nodeName,c,n),e&&!r.__b&&(r.__b=e,l=null),x(r,c,1,n,o),e=r.base,l&&e!==l&&(l._component=null,b(l,!1))),e}function L(e){S.beforeUnmount&&S.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?L(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,c(t),N(e),y(t)),e.__r&&e.__r(null)}function T(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}function M(e,t,n){return h(n,e,{},!1,t,!1)}var S={},W=[],E=[],V=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,A=[],D=[],H=0,P=!1,R=!1,j={};n(T.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),k(this,2)},render:function(){}});var I={h:t,createElement:t,cloneElement:o,Component:T,render:M,rerender:i,options:S};"undefined"!=typeof module?module.exports=I:self.preact=I}(); 2 | //# sourceMappingURL=preact.min.js.map -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | # GMF 2 | # @author:echosoar 3 | # @site: https://github.com/echosoar/autoGit 4 | # @version: 0.0.1 5 | # 6 | # The best way to use: 7 | # curl -O https://raw.githubusercontent.com/echosoar/gmf/master/makefile 8 | 9 | .PHONY: all ci ad ps npmbuild build up init initjs 10 | .IGNORE: init 11 | 12 | BUILDID = $(shell date +%Y/%m/%d-%H:%M:%S) 13 | NOWBRANCH = $(shell git rev-parse --abbrev-ref HEAD) 14 | NPMFILE = ./package.json 15 | ECHOSOAR = "https://raw.githubusercontent.com/echosoar/" 16 | CCONF = "$(ECHOSOAR)cconf/master/" 17 | 18 | ## init type 19 | type = none 20 | 21 | all: 22 | make ps 23 | 24 | autoGit: 25 | @echo GMF by echosoar 26 | 27 | # check can execute orders npm run build 28 | npmbuild: 29 | ifeq ("$(shell test -e $(NPMFILE) && echo exists)", "exists") 30 | ifeq ($(shell grep -l scripts $(NPMFILE)), $(NPMFILE)) 31 | ifeq ($(shell grep -l build $(NPMFILE)), $(NPMFILE)) 32 | @npm run build 33 | endif 34 | endif 35 | endif 36 | 37 | # git add 38 | ad: autoGit npmbuild 39 | @git add --all 40 | 41 | # git commit 42 | ci: ad 43 | @git commit -m 'commit at $(BUILDID) by echosoar/gmf' 44 | 45 | # git push 46 | ps: ci 47 | @git push origin ${NOWBRANCH} 48 | 49 | build: npmbuild 50 | 51 | # init project command:make init type=js 52 | # Please refer to https://github.com/echosoar/cconf for all type types currently supported 53 | init: 54 | ifeq ($(type), none) 55 | @echo type is not input 56 | else 57 | ifeq ($(shell curl -s "$(CCONF)$(type)/.cconf"), exists) 58 | @echo init $(type) start... 59 | @for dirName in $(shell curl -s "$(CCONF)$(type)/.cconfDir");do\ 60 | mkdir -p $$dirName;\ 61 | done 62 | @for fileName in $(shell curl -s "$(CCONF)$(type)/.cconfFile");do\ 63 | curl -s -o ./$$fileName $(CCONF)$(type)/$$fileName;\ 64 | done 65 | @echo init $(type) complete! 66 | else 67 | @echo type is not support 68 | endif 69 | endif 70 | 71 | # update makefile 72 | up: 73 | @curl -s -O $(ECHOSOAR)gmf/master/makefile 74 | @echo GMF is the latest version. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codereader", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "rollup --c rollup.conf.js -w", 8 | "build": "rollup --c rollup.conf.js" 9 | }, 10 | "repository": {}, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^0.18.0", 15 | "libbase64": "^1.0.2", 16 | "path": "^0.12.7", 17 | "react-router-dom": "^4.2.2", 18 | "rollup": "^0.50.0" 19 | }, 20 | "devDependencies": { 21 | "babel-core": "^6.26.0", 22 | "babel-plugin-transform-react-jsx": "^6.24.1", 23 | "babel-preset-es2015": "^6.24.1", 24 | "preact": "^8.2.5", 25 | "preact-router": "^2.5.7", 26 | "rollup-plugin-alias": "^1.3.1", 27 | "rollup-plugin-babel": "^3.0.2", 28 | "rollup-plugin-buble": "^0.15.0", 29 | "rollup-plugin-commonjs": "^8.2.1", 30 | "rollup-plugin-jsx": "^1.0.3", 31 | "rollup-plugin-less": "^0.1.3", 32 | "rollup-plugin-node-builtins": "^2.1.2", 33 | "rollup-plugin-node-globals": "^1.1.0", 34 | "rollup-plugin-node-resolve": "^3.0.0", 35 | "rollup-plugin-replace": "^2.0.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /rollup.conf.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import buble from 'rollup-plugin-buble' 3 | import cjs from 'rollup-plugin-commonjs' 4 | import builtins from 'rollup-plugin-node-builtins'; 5 | import globals from 'rollup-plugin-node-globals' 6 | import replace from 'rollup-plugin-replace' 7 | import resolve from 'rollup-plugin-node-resolve' 8 | import less from 'rollup-plugin-less'; 9 | import alias from 'rollup-plugin-alias'; 10 | 11 | export default { 12 | input: './src/index.js', 13 | output: { 14 | file: './build/index.js', 15 | format: 'iife' 16 | }, 17 | plugins: [ 18 | resolve({jsnext: true}), 19 | less({ 20 | output: './build/index.css' 21 | }), 22 | alias({ 23 | _: path.resolve(__dirname, './src') 24 | }), 25 | cjs({ 26 | include: 'node_modules/**' 27 | }), 28 | buble(), 29 | 30 | globals(), 31 | builtins(), 32 | replace({ 'process.env.NODE_ENV': JSON.stringify('development') , 'React.createElement': 'preact.h'}) 33 | ], 34 | sourcemap: true 35 | } 36 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/src/.DS_Store -------------------------------------------------------------------------------- /src/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/src/components/.DS_Store -------------------------------------------------------------------------------- /src/components/base/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import './index.less'; 4 | import Storage from '_/utils/storage.js'; 5 | class Base extends Component { 6 | 7 | constructor(props) { 8 | super(props); 9 | 10 | this.state = { 11 | nowChild: [] 12 | } 13 | Storage.checkURL(); 14 | window.onhashchange = this.filterChildren.bind(this); 15 | this.filterChildren(); 16 | } 17 | 18 | filterChildren() { 19 | let nowPath = location.hash || ''; 20 | nowPath = nowPath.replace(/^(#\/|\/)/, '').replace(/\/$/, '').split('/'); 21 | 22 | let nowMatchChildLength = 0; 23 | let nowChild = []; 24 | let noMatterChild = []; 25 | let home = {}; 26 | 27 | this.props.children.map((e, eIndex) => { 28 | let path = e.attributes && e.attributes.path || ''; 29 | 30 | if (e.attributes && e.attributes.home) { 31 | home.ele = e; 32 | home.index = eIndex; 33 | return; 34 | } 35 | 36 | if (!path) { // no matter match path 37 | noMatterChild.push({ 38 | index: eIndex, 39 | ele: e 40 | }); 41 | return; 42 | } 43 | 44 | let pathArrLen = 0; 45 | let pathArr = path.replace(/^(#\/|\/)/, '').replace(/\/$/, '').split('/').map(path => { 46 | if (/^\(.*?\)$/.test(path)) { 47 | return path.replace(/(^\(|\)$)/g, ''); 48 | } 49 | pathArrLen ++; 50 | return path; 51 | }); 52 | let nowMatch = 0; 53 | let nowParam = {}; 54 | 55 | if (pathArrLen > nowPath.length) return; 56 | 57 | pathArr.map((pathItem, pathIndex) => { 58 | if (nowMatch == pathIndex) { 59 | if (pathItem == nowPath[pathIndex]) { 60 | nowMatch ++; 61 | } else if (/^:(.*)$/.test(pathItem)) { 62 | nowMatch ++; 63 | let param = /^:(.*)$/.exec(pathItem)[1]; 64 | nowParam[param] = nowPath[pathIndex]; 65 | } 66 | } 67 | }); 68 | 69 | if (nowMatch > nowMatchChildLength) { 70 | nowMatchChildLength = nowMatch; 71 | nowChild = [{ 72 | index: eIndex, 73 | ele: e, 74 | param: nowParam 75 | }]; 76 | } else if(nowMatch && nowMatch == nowMatchChildLength) { 77 | nowChild.push({ 78 | index: eIndex, 79 | ele: e, 80 | param: nowParam 81 | }); 82 | } 83 | }); 84 | 85 | if (!nowChild.length && home.ele) { 86 | nowChild = [home]; 87 | } 88 | 89 | let display = nowChild.concat(noMatterChild).sort((a, b) => { 90 | return a.index - b.index 91 | }).map(item => { 92 | let ele = item.ele; 93 | ele.attributes = ele.attributes || {}; 94 | ele.attributes.urlParams = item.param; 95 | return item.ele; 96 | }); 97 | 98 | this.setState({ 99 | nowChild: display 100 | }); 101 | } 102 | 103 | render() { 104 | return 108 | } 109 | } 110 | 111 | export default Base; 112 | 113 | -------------------------------------------------------------------------------- /src/components/base/index.less: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | .title { 5 | position: fixed; 6 | top: 0; 7 | z-index: 2; 8 | width: 100%; 9 | line-height: 36px; 10 | font-size: 13px; 11 | color: #999; 12 | text-align: center; 13 | border-bottom: 1px solid #eee; 14 | background: #fff; 15 | } 16 | .main { 17 | padding-top: 36px; 18 | .copyright { 19 | font-size: 12px; 20 | border-top: 1px solid #eee; 21 | color: #999; 22 | text-align: center; 23 | line-height: 32px; 24 | } 25 | } 26 | 27 | .return { 28 | position: fixed; 29 | z-index: 3; 30 | top: 0; 31 | left: 0; 32 | line-height: 36px; 33 | width: 72px; 34 | box-sizing: border-box; 35 | border-right: 1px solid #eee; 36 | text-align: center; 37 | font-size: 13px; 38 | color: #666; 39 | } 40 | 41 | .listContainer { 42 | margin: 0px auto; 43 | width: 100%; 44 | box-sizing: border-box; 45 | max-width: 480px; 46 | border: 0; 47 | } 48 | a { 49 | text-decoration: none; 50 | } 51 | -------------------------------------------------------------------------------- /src/components/code/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import axios from 'axios/dist/axios'; 4 | import MdRender from '_/components/mdrender/index.js'; 5 | import CommonCode from '_/components/commonCode/index.js'; 6 | import Loading from '_/components/loading/index.js'; 7 | import GlobalCache from '_/utils/globalCache.js'; 8 | import libbase64 from 'libbase64'; 9 | import './index.less'; 10 | 11 | let SupportFileReg = /(\.(?:c|cs|css|gitignore|go|h|html|java|js|json|jsx|m|map|md|php|podspec|ts|txt|vue|xml|xtpl|yml)|cname|license|makefile|rc)$/i; 12 | 13 | class Code extends Component { 14 | 15 | constructor(props) { 16 | super(props); 17 | 18 | this.state = { 19 | nowsha: '' 20 | }; 21 | 22 | this.load(props.file); 23 | } 24 | 25 | componentWillReceiveProps(newProps) { 26 | this.props = newProps; 27 | this.load(newProps.file); 28 | } 29 | 30 | load(file) { 31 | if (!file) return; 32 | if (file.sha == this.state.nowsha) return; 33 | let cacheData = GlobalCache.get('code', file.sha); 34 | if (cacheData) { 35 | this.setState({ 36 | nowsha: cacheData.sha 37 | }); 38 | } else { 39 | this.getRemote(file); 40 | } 41 | } 42 | 43 | getRemote(file) { 44 | let { user, repo, sha: branch} = this.props.urlParams; 45 | let { sha, path, fullPath } = file; 46 | 47 | this.setState({ 48 | loading: true 49 | }); 50 | if (!SupportFileReg.test(fullPath)) { 51 | GlobalCache.add('code', sha, { 52 | branch: [user,repo,branch].join('/'), 53 | sha, 54 | path, 55 | data: '', 56 | fullPath 57 | }); 58 | GlobalCache.add('path', path, sha); 59 | this.setState({ 60 | loading: false, 61 | nowsha: sha 62 | }); 63 | return; 64 | } 65 | axios.get(`//api.github.com/repos/${user}/${repo}/git/blobs/` + sha) 66 | .then((response) => { 67 | let data = libbase64.decode(response.data.content).toString(); 68 | 69 | GlobalCache.add('code', sha, { 70 | branch: [user,repo,branch].join('/'), 71 | sha, 72 | path, 73 | data, 74 | fullPath 75 | }); 76 | GlobalCache.add('path', path, sha); 77 | this.setState({ 78 | loading: false, 79 | nowsha: sha 80 | }); 81 | }).catch((error) => { 82 | this.handleError(error); 83 | }); 84 | } 85 | 86 | handleError(error) { 87 | if (/403/.test(error + '')) { 88 | this.setState({ 89 | loading: false 90 | }); 91 | window.crConfirm.open(
    92 |
    Error
    93 |
    Github api rate limit exceeded
    94 |
    , 'alert'); 95 | } else { 96 | console.log(error); 97 | } 98 | } 99 | 100 | getRemoteByPath(fullPath) { 101 | 102 | let { user, repo, sha: branch } = this.props.urlParams; 103 | 104 | let path = fullPath.split('/').pop(); 105 | 106 | let cachePath = GlobalCache.get('path', path); 107 | if (cachePath) { 108 | this.setState({ 109 | nowsha: cachePath 110 | }); 111 | return; 112 | } 113 | this.setState({ 114 | loading: true 115 | }); 116 | axios.get(`//api.github.com/repos/${user}/${repo}/contents/` + fullPath) 117 | .then((response) => { 118 | 119 | let sha = response.data.sha; 120 | let data = libbase64.decode(response.data.content).toString(); 121 | 122 | GlobalCache.add('code', sha, { 123 | branch: [user,repo,branch].join('/'), 124 | sha, 125 | path, 126 | data, 127 | fullPath 128 | }); 129 | GlobalCache.add('path', path, sha); 130 | this.setState({ 131 | loading: false, 132 | nowsha: sha 133 | }); 134 | }).catch((error) => { 135 | this.handleError(error); 136 | }); 137 | } 138 | 139 | renderCode() { 140 | let { nowsha, loading } = this.state; 141 | let { user, repo, sha} = this.props.urlParams; 142 | let data = GlobalCache.get('code', nowsha); 143 | if (!data || loading) return ; 144 | if (/\.md$/i.test(data.fullPath)) { 145 | return ; 146 | } else if(SupportFileReg.test(data.fullPath)) { 147 | return ; 148 | } else { 149 | return
    150 |
    { data.path }
    151 |
    not support file type
    152 | Click here to Github
    153 | Click here to Download 154 |
    ; 155 | } 156 | 157 | 158 | } 159 | 160 | render() { 161 | return
    { this.renderCode() }
    ; 162 | } 163 | } 164 | 165 | export default Code; 166 | 167 | -------------------------------------------------------------------------------- /src/components/code/index.less: -------------------------------------------------------------------------------- 1 | .componentCode { 2 | .notSupport { 3 | padding: 20px 0; 4 | text-align: center; 5 | 6 | .notSupportTip { 7 | margin: 10px; 8 | font-size: 12px; 9 | text-align: center; 10 | color: #c33; 11 | } 12 | 13 | .toDownload { 14 | display: inline-block; 15 | margin: 10px; 16 | padding: 6px 20px; 17 | border: 1px solid #eee; 18 | border-radius: 3px; 19 | background-color: #f5f5f5; 20 | color: #69f; 21 | font-size: 12px; 22 | user-select: none; 23 | text-align: center; 24 | line-height: 20px; 25 | cursor: pointer; 26 | text-decoration: none; 27 | } 28 | } 29 | 30 | 31 | } -------------------------------------------------------------------------------- /src/components/commonCode/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import './index.less'; 4 | class CommonCode extends Component { 5 | 6 | formatData(code) { 7 | let codeTransfromData = hljs.highlightAuto(code || '').value; 8 | let codeLines = (codeTransfromData || '').split('\n'); 9 | 10 | let lineIndexLen = (codeLines.length + '').length * 2; 11 | console.log(lineIndexLen) 12 | 13 | return `
    ${ 14 | codeLines.map((line, lineIndex) => { 15 | let preSpaceSize = 0; 16 | let style = []; 17 | let preSpace = /^(\s*)/.exec(line); 18 | if (preSpace) { 19 | preSpaceSize = preSpace[0].length; 20 | } 21 | if (preSpaceSize > 20) preSpaceSize = 20; 22 | style.push('padding-left:' + ( lineIndexLen + preSpaceSize + 2)/2 + 'em'); 23 | style.push('padding-right: 0.5em'); 24 | return `
    ${ lineIndex + 1 }
    ${ line }
    `; 25 | }).join('') 26 | }
    `; 27 | } 28 | 29 | render() { 30 | return
    31 | } 32 | } 33 | 34 | export default CommonCode; -------------------------------------------------------------------------------- /src/components/commonCode/index.less: -------------------------------------------------------------------------------- 1 | @fz: 12em; 2 | .commoncode { 3 | font-size: 12px; 4 | .commoncode-line { 5 | position: relative; 6 | border-bottom: 1px dotted #eee; 7 | word-break: break-all; 8 | line-height: 24/@fz; 9 | font-size: 13/@fz; 10 | text-indent: -12/@fz; 11 | min-height: 24/@fz; 12 | 13 | &:last-child { 14 | border-bottom: 0; 15 | } 16 | 17 | .commoncode-lineindex { 18 | position: absolute; 19 | left: 0; 20 | padding-left: 6/@fz; 21 | top: 0; 22 | font-size: 12/@fz; 23 | color: #999; 24 | line-height: 24/@fz; 25 | text-indent: 0; 26 | } 27 | } 28 | 29 | &.light { 30 | 31 | 32 | .hljs { 33 | display: block; 34 | color: black; 35 | } 36 | 37 | .hljs-comment, 38 | .hljs-quote, 39 | .hljs-variable { 40 | color: #008000; 41 | } 42 | 43 | .hljs-keyword, 44 | .hljs-selector-tag, 45 | .hljs-built_in, 46 | .hljs-name, 47 | .hljs-tag { 48 | color: #36f; 49 | } 50 | 51 | .hljs-string, 52 | .hljs-title, 53 | .hljs-section, 54 | .hljs-attribute, 55 | .hljs-literal, 56 | .hljs-template-tag, 57 | .hljs-template-variable, 58 | .hljs-type, 59 | .hljs-addition { 60 | color: #a31515; 61 | } 62 | 63 | .hljs-deletion, 64 | .hljs-selector-attr, 65 | .hljs-selector-pseudo, 66 | .hljs-meta { 67 | color: #2b91af; 68 | } 69 | 70 | .hljs-doctag { 71 | color: #808080; 72 | } 73 | 74 | .hljs-attr { 75 | color: #f00; 76 | } 77 | 78 | .hljs-symbol, 79 | .hljs-bullet, 80 | .hljs-link { 81 | color: #00b0e8; 82 | } 83 | 84 | 85 | .hljs-emphasis { 86 | font-style: italic; 87 | } 88 | 89 | .hljs-strong { 90 | font-weight: bold; 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /src/components/confirm/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import Language from '_/utils/language.js'; 4 | import './index.less'; 5 | 6 | class Confirm extends Component { 7 | 8 | constructor(props) { 9 | super(props); 10 | this.state = { 11 | isAlert: false, 12 | isOpen: false 13 | } 14 | 15 | window.crConfirm = { 16 | open: this.confirm.bind(this), 17 | close: this.onlyClose.bind(this) 18 | } 19 | } 20 | 21 | confirm(ele, ok, cancel) { 22 | if (this.state.isOpen) return; 23 | let isAlert = false; 24 | if (ok == 'alert') { 25 | ok = null; 26 | isAlert = true; 27 | } 28 | this.setState({ 29 | isAlert, 30 | isOpen: true, 31 | ele, 32 | ok, 33 | cancel 34 | }); 35 | } 36 | 37 | onlyClose() { 38 | this.setState({ 39 | isOpen: false 40 | }); 41 | } 42 | 43 | close() { 44 | this.setState({ 45 | isOpen: false 46 | }); 47 | this.state.cancel && this.state.cancel.handle && this.state.cancel.handle(); 48 | } 49 | 50 | ok() { 51 | this.setState({ 52 | isOpen: false 53 | }); 54 | this.state.ok && this.state.ok.handle && this.state.ok.handle(); 55 | } 56 | render() { 57 | let { isOpen, ele, ok, cancel, isAlert } = this.state; 58 | let { data, repo } = this.props; 59 | return
    60 | { 61 | isOpen && ele &&
    62 |
    63 | { ele } 64 | 65 | { 66 | !isAlert ?
    67 |
    { ok && ok.text || Language('confirm') }
    68 |
    { cancel && cancel.text || Language('cancel') }
    69 |
    :
    { Language('close') }
    70 | } 71 |
    72 |
    73 | } 74 |
    ; 75 | } 76 | } 77 | 78 | export default Confirm; -------------------------------------------------------------------------------- /src/components/confirm/index.less: -------------------------------------------------------------------------------- 1 | .confirmContainer { 2 | position: fixed; 3 | top: 0; 4 | left: 0; 5 | z-index: 9; 6 | width: 100%; 7 | height: 100%; 8 | background: rgba(0,0,0,0.5); 9 | 10 | .content { 11 | position: absolute; 12 | top: 50%; 13 | left: 50%; 14 | width: 72%; 15 | max-width: 320px; 16 | max-height: 100%; 17 | background: #fff; 18 | border-radius: 6px; 19 | transform: translate(-50%, -50%); 20 | font-size: 13px; 21 | color: #333; 22 | overflow: hidden; 23 | 24 | .btnContainer { 25 | display: flex; 26 | flex-direction: row; 27 | height: 42px; 28 | 29 | div { 30 | width: 50%; 31 | height: 42px; 32 | line-height: 42px; 33 | text-align: center; 34 | background: #69f; 35 | color: #fff; 36 | cursor: pointer; 37 | 38 | &.btnCancel { 39 | background: #f96; 40 | } 41 | } 42 | } 43 | 44 | .btnClose { 45 | height: 42px; 46 | line-height: 42px; 47 | text-align: center; 48 | background: #f96; 49 | color: #fff; 50 | cursor: pointer; 51 | } 52 | 53 | .confirmTitle { 54 | height: 42px; 55 | line-height: 42px; 56 | font-weight: bold; 57 | box-sizing: border-box; 58 | padding: 0 12px; 59 | overflow: hidden; 60 | text-overflow: ellipsis; 61 | white-space: nowrap; 62 | } 63 | .confirmText { 64 | border-top: 1px solid #eee; 65 | line-height: 24px; 66 | color: #666; 67 | word-break: break-all; 68 | padding: 12px; 69 | max-height: 96px; 70 | overflow: auto; 71 | } 72 | .confirmTip { 73 | margin: 10px; 74 | padding: 6px; 75 | border: 1px solid #eee; 76 | border-radius: 3px; 77 | background-color: #f5f5f5; 78 | color: #69f; 79 | font-size: 12px; 80 | user-select: none; 81 | text-align: center; 82 | line-height: 20px; 83 | cursor: pointer; 84 | text-decoration: none; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /src/components/loading/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | 4 | import './index.less'; 5 | 6 | class Loading extends Component { 7 | 8 | render() { 9 | return
    10 | Loading... 11 |
    12 | } 13 | } 14 | 15 | export default Loading; 16 | 17 | -------------------------------------------------------------------------------- /src/components/loading/index.less: -------------------------------------------------------------------------------- 1 | .loading { 2 | padding: 32px 0; 3 | text-align: center; 4 | color: #999; 5 | font-size: 12px; 6 | } -------------------------------------------------------------------------------- /src/components/mdrender/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import Toc from './toc.js'; 4 | import TextRender from './text.js'; 5 | import SettingData from '_/utils/setting.js'; 6 | import Setting from '_/components/setting/index.js'; 7 | 8 | class MdRender extends Component { 9 | 10 | constructor(props) { 11 | super(props); 12 | this.state = { 13 | toc: {}, 14 | date: Date.now(), 15 | mdFontSize: SettingData.get('mdFontSize') || 14 16 | } 17 | 18 | 19 | } 20 | 21 | handleTocChange(index, toc) { 22 | this.state.toc[index] = toc; 23 | this.setState({ 24 | date: Date.now() 25 | }); 26 | } 27 | 28 | settingChange(type, value) { 29 | this.setState({ 30 | [type]: value 31 | }); 32 | } 33 | 34 | render() { 35 | let { toc, mdFontSize } = this.state; 36 | let { data, repo } = this.props; 37 | return
    38 | 39 | 40 | { data.data && } 41 |
    ; 42 | } 43 | } 44 | 45 | export default MdRender; -------------------------------------------------------------------------------- /src/components/mdrender/text.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import path from 'path'; 4 | import Language from '_/utils/language.js'; 5 | import './text.less'; 6 | 7 | 8 | let githubRepoReg = /github\.com\/(.*?)\/(.*?)(?:\/|$)/i; 9 | 10 | class TextRender extends Component { 11 | 12 | constructor(props) { 13 | super(props); 14 | this.toc = []; 15 | this.markedConfig(); 16 | } 17 | 18 | shouldComponentUpdate(newProps) { 19 | if (newProps.fontSize != this.props.fontSize) return true; 20 | if (newProps.data == this.props.data) return false; 21 | } 22 | 23 | componentDidMount() { 24 | this.props.toc && this.props.toc(this.toc); 25 | let ele = document.getElementById('mdtextrender'); 26 | ele.onclick = this.handleClick.bind(this, ele); 27 | } 28 | 29 | handleClick(ele, e) { 30 | let target = e.target; 31 | while(target != ele) { 32 | if (target.nodeName == 'A') { 33 | break; 34 | } 35 | target = target.parentNode; 36 | } 37 | if (!target || target.nodeName != 'A') return; 38 | let link = target.getAttribute('href'); 39 | if (!link) return; 40 | 41 | e.preventDefault(); 42 | e.stopPropagation(); 43 | 44 | if (/(?:http[s]?\/|\/\/)/i.test(link)) { // outer 45 | 46 | let gitRepoLink = null; 47 | 48 | if (githubRepoReg.test(link)) { 49 | let gitinfo = githubRepoReg.exec(link); 50 | gitRepoLink = '#/branch/' + gitinfo[1] + '/' + gitinfo[2].replace(/#.*$/i, ''); 51 | } 52 | 53 | window.crConfirm && window.crConfirm.open(
    54 |
    { Language('openLink') }
    55 |
    { link }
    56 | { gitRepoLink &&
    { 57 | window.crConfirm.close(); 58 | location.href = gitRepoLink; 59 | }}> 60 | This is a github repo
    61 | Add this repo to your cr list? 62 |
    } 63 |
    , { 64 | text: Language('openLink'), 65 | handle: () => { 66 | window.open(link); 67 | } 68 | }) 69 | } else if (/^#/.test(link)) { // anchor 70 | 71 | } else { // local 72 | if (!/^\./.test(link)) link = './' + link; 73 | link = link.replace(/\\/g, ''); 74 | let nowPath = path.resolve(this.props.fullPath, '../', link).replace(/^\//, ''); 75 | this.props.getRemoteByPath(nowPath); 76 | } 77 | } 78 | 79 | componentDidUpdate() { 80 | this.props.toc && this.props.toc(this.toc); 81 | window.scrollTo({top: 0}); 82 | } 83 | 84 | formatData(data) { 85 | return data.replace(/ { 86 | return ' { 94 | return hljs.highlightAuto(code).value; 95 | }, 96 | gfm: true, 97 | tables: true, 98 | breaks: true 99 | }); 100 | 101 | this.renderer = new marked.Renderer(); 102 | this.renderer.listitem = this.markedRendererTodo.bind(this); 103 | this.renderer.heading = this.markedRendererHeading.bind(this); 104 | this.renderer.link = this.markedRendererLink.bind(this); 105 | this.renderer.image = this.markedRendererImage.bind(this); 106 | } 107 | 108 | markedRendererTodo(text) { 109 | if (/^\s*\[[x ]\]\s*/.test(text)) { 110 | text = text 111 | .replace(/^\s*\[ \]\s*/, ' ') 112 | .replace(/^\s*\[x\]\s*/, ' '); 113 | return '
  • ' + text + '
  • '; 114 | } else { 115 | return '
  • ' + text + '
  • '; 116 | } 117 | } 118 | 119 | markedRendererHeading(text, level, raw) { 120 | var anchor = raw.toLowerCase().replace(/[^\w\u4e00-\u9fa5]+/g, '-'); 121 | this.toc.push({ 122 | anchor: anchor, 123 | level: level, 124 | text: text 125 | }); 126 | return '' 127 | + text + (level < 4 ? 'TOC' : '') 128 | + '\n'; 129 | } 130 | 131 | markedRendererLink(href, title, text) { 132 | let add = ''; 133 | if (githubRepoReg.test(href) && !/<[^>]+>/.test(text)) { 134 | add += ''; 135 | } 136 | 137 | return add + '' + text + ''; 138 | } 139 | 140 | markedRendererImage(src, title, text) { 141 | return `${ title }`; 142 | } 143 | 144 | checkRelativeImgLink(src) { 145 | if (!/(?:http[s]?\/|\/\/)/i.test(src)) { // local 146 | if (!/^\./.test(src)) src = './' + src; 147 | src = src.replace(/\\/g, ''); 148 | let { user, repo, sha } = this.props.repo; 149 | return `//raw.githubusercontent.com/${ user }/${ repo }/${ sha }/` + path.resolve(this.props.fullPath, '../', src).replace(/^\//, ''); 150 | } else { 151 | return src; 152 | } 153 | } 154 | 155 | render() { 156 | this.toc = []; 157 | let { data, fontSize } = this.props; 158 | data = this.formatData(data); 159 | return
    ; 160 | } 161 | } 162 | 163 | export default TextRender; -------------------------------------------------------------------------------- /src/components/mdrender/text.less: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: octicons-link; 3 | src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff'); 4 | } 5 | 6 | 7 | 8 | .mdtextrender { 9 | -ms-text-size-adjust: 100%; 10 | -webkit-text-size-adjust: 100%; 11 | color: #333; 12 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 13 | font-size: 14px; 14 | line-height: 1.5; 15 | word-wrap: break-word; 16 | padding: 20px; 17 | 18 | .githubhref { 19 | display: inline-block; 20 | width: 1em; 21 | height: 1em; 22 | margin-right: 2px; 23 | border: 0; 24 | vertical-align: middle; 25 | background: url("../static/images/github.png") center/contain no-repeat; 26 | } 27 | 28 | a { 29 | background-color: transparent; 30 | -webkit-text-decoration-skip: objects; 31 | 32 | &.returnToToc { 33 | color: #ccc; 34 | font-size: 12px; 35 | display: inline-block; 36 | font-weight: normal; 37 | margin-left: 10px; 38 | 39 | &:hover { 40 | color: #36c; 41 | } 42 | } 43 | } 44 | 45 | a:active, 46 | a:hover { 47 | outline-width: 0; 48 | } 49 | 50 | strong { 51 | font-weight: inherit; 52 | } 53 | 54 | strong { 55 | font-weight: bolder; 56 | } 57 | 58 | img { 59 | border-style: none; 60 | } 61 | 62 | svg:not(:root) { 63 | overflow: hidden; 64 | } 65 | 66 | code, 67 | kbd, 68 | pre { 69 | font-family: monospace, monospace; 70 | font-size: 1em; 71 | } 72 | 73 | hr { 74 | box-sizing: content-box; 75 | height: 0; 76 | overflow: visible; 77 | } 78 | 79 | input { 80 | font: inherit; 81 | margin: 0; 82 | } 83 | 84 | input { 85 | overflow: visible; 86 | } 87 | 88 | [type="checkbox"] { 89 | box-sizing: border-box; 90 | padding: 0; 91 | } 92 | 93 | * { 94 | box-sizing: border-box; 95 | } 96 | 97 | input { 98 | font-family: inherit; 99 | font-size: inherit; 100 | line-height: inherit; 101 | } 102 | 103 | a { 104 | color: #0366d6; 105 | text-decoration: none; 106 | } 107 | 108 | a:hover { 109 | text-decoration: underline; 110 | } 111 | 112 | strong { 113 | font-weight: 600; 114 | } 115 | 116 | hr { 117 | height: 0; 118 | margin: 15px 0; 119 | overflow: hidden; 120 | background: transparent; 121 | border: 0; 122 | border-bottom: 1px solid #dfe2e5; 123 | } 124 | 125 | hr::before { 126 | display: table; 127 | content: ""; 128 | } 129 | 130 | hr::after { 131 | display: table; 132 | clear: both; 133 | content: ""; 134 | } 135 | 136 | table { 137 | border-spacing: 0; 138 | border-collapse: collapse; 139 | } 140 | 141 | td, 142 | th { 143 | padding: 0; 144 | } 145 | 146 | p { 147 | margin-top: 0; 148 | margin-bottom: 10px; 149 | } 150 | 151 | blockquote { 152 | margin: 0; 153 | } 154 | 155 | ul, 156 | ol { 157 | padding-left: 0; 158 | margin-top: 0; 159 | margin-bottom: 0; 160 | } 161 | 162 | ol ol, 163 | ul ol { 164 | list-style-type: lower-roman; 165 | } 166 | 167 | ul ul ol, 168 | ul ol ol, 169 | ol ul ol, 170 | ol ol ol { 171 | list-style-type: lower-alpha; 172 | } 173 | 174 | dd { 175 | margin-left: 0; 176 | } 177 | 178 | code { 179 | position: relative; 180 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 181 | font-size: 12px; 182 | } 183 | 184 | pre { 185 | margin-top: 0; 186 | margin-bottom: 0; 187 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 188 | font-size: 12px; 189 | } 190 | 191 | .octicon { 192 | vertical-align: text-bottom; 193 | } 194 | 195 | a:not([href]) { 196 | color: inherit; 197 | text-decoration: none; 198 | } 199 | 200 | .anchor { 201 | float: left; 202 | padding-right: 4px; 203 | margin-left: -20px; 204 | line-height: 1; 205 | } 206 | 207 | .anchor:focus { 208 | outline: none; 209 | } 210 | 211 | p, 212 | blockquote, 213 | ul, 214 | ol, 215 | dl, 216 | table, 217 | pre { 218 | margin-top: 0; 219 | margin-bottom: 16px; 220 | } 221 | 222 | hr { 223 | height: 0.25em; 224 | padding: 0; 225 | margin: 24px 0; 226 | background-color: #e1e4e8; 227 | border: 0; 228 | } 229 | 230 | blockquote { 231 | padding: 0 1em; 232 | color: #6a737d; 233 | border-left: 0.25em solid #dfe2e5; 234 | } 235 | 236 | blockquote>:first-child { 237 | margin-top: 0; 238 | } 239 | 240 | blockquote>:last-child { 241 | margin-bottom: 0; 242 | } 243 | 244 | kbd { 245 | display: inline-block; 246 | padding: 3px 5px; 247 | font-size: 11px; 248 | line-height: 10px; 249 | color: #444d56; 250 | vertical-align: middle; 251 | background-color: #fafbfc; 252 | border: solid 1px #c6cbd1; 253 | border-bottom-color: #959da5; 254 | border-radius: 3px; 255 | box-shadow: inset 0 -1px 0 #959da5; 256 | } 257 | 258 | h1, 259 | h2, 260 | h3, 261 | h4, 262 | h5, 263 | h6 { 264 | margin-top: 24px; 265 | margin-bottom: 16px; 266 | font-weight: 600; 267 | line-height: 1.25; 268 | } 269 | 270 | h1 .octicon-link, 271 | h2 .octicon-link, 272 | h3 .octicon-link, 273 | h4 .octicon-link, 274 | h5 .octicon-link, 275 | h6 .octicon-link { 276 | color: #1b1f23; 277 | vertical-align: middle; 278 | visibility: hidden; 279 | } 280 | 281 | h1:hover .anchor, 282 | h2:hover .anchor, 283 | h3:hover .anchor, 284 | h4:hover .anchor, 285 | h5:hover .anchor, 286 | h6:hover .anchor { 287 | text-decoration: none; 288 | } 289 | 290 | h1:hover .anchor .octicon-link, 291 | h2:hover .anchor .octicon-link, 292 | h3:hover .anchor .octicon-link, 293 | h4:hover .anchor .octicon-link, 294 | h5:hover .anchor .octicon-link, 295 | h6:hover .anchor .octicon-link { 296 | visibility: visible; 297 | } 298 | 299 | h1 { 300 | padding-bottom: 0.3em; 301 | font-size: 2em; 302 | border-bottom: 1px solid #eaecef; 303 | } 304 | 305 | h2 { 306 | padding-bottom: 0.3em; 307 | font-size: 1.6em; 308 | border-bottom: 1px solid #eaecef; 309 | } 310 | 311 | h3 { 312 | font-size: 1.2em; 313 | } 314 | 315 | h4 { 316 | font-size: 1em; 317 | } 318 | 319 | h5 { 320 | font-size: 0.8em; 321 | } 322 | 323 | h6 { 324 | font-size: 0.6em; 325 | } 326 | 327 | ul, 328 | ol { 329 | padding-left: 2em; 330 | } 331 | 332 | ul ul, 333 | ul ol, 334 | ol ol, 335 | ol ul { 336 | margin-top: 0; 337 | margin-bottom: 0; 338 | } 339 | 340 | li>p { 341 | margin-top: 16px; 342 | } 343 | 344 | li+li { 345 | margin-top: 0.25em; 346 | } 347 | 348 | li { 349 | i { 350 | display: inline-block; 351 | width: 1em; 352 | height: 1em; 353 | border-radius: 2px; 354 | vertical-align: middle; 355 | box-sizing: border-box; 356 | border: 1px solid #ccc; 357 | 358 | &.checked { 359 | border: 0; 360 | background: #396 url("../static/images/ok.png") center/60% no-repeat; 361 | } 362 | } 363 | } 364 | 365 | dl { 366 | padding: 0; 367 | } 368 | 369 | dl dt { 370 | padding: 0; 371 | margin-top: 16px; 372 | font-size: 1em; 373 | font-style: italic; 374 | font-weight: 600; 375 | } 376 | 377 | dl dd { 378 | padding: 0 16px; 379 | margin-bottom: 16px; 380 | } 381 | 382 | table { 383 | display: block; 384 | width: 100%; 385 | overflow: auto; 386 | } 387 | 388 | table th { 389 | font-weight: 600; 390 | } 391 | 392 | table th, 393 | table td { 394 | padding: 6px 13px; 395 | border: 1px solid #dfe2e5; 396 | } 397 | 398 | table tr { 399 | background-color: #fff; 400 | border-top: 1px solid #c6cbd1; 401 | } 402 | 403 | table tr:nth-child(2n) { 404 | background-color: #f6f8fa; 405 | } 406 | 407 | img { 408 | max-width: 100%; 409 | box-sizing: content-box; 410 | background-color: #fff; 411 | } 412 | 413 | img[align=right] { 414 | padding-left: 20px; 415 | } 416 | 417 | img[align=left] { 418 | padding-right: 20px; 419 | } 420 | 421 | code { 422 | padding: 0; 423 | padding-top: 0.2em; 424 | padding-bottom: 0.2em; 425 | margin: 0; 426 | font-size: 85%; 427 | background-color: rgba(27, 31, 35, 0.05); 428 | border-radius: 3px; 429 | color: rgb(233, 105, 0); 430 | } 431 | 432 | code::before, 433 | code::after { 434 | letter-spacing: -0.2em; 435 | content: "\00a0"; 436 | } 437 | 438 | pre { 439 | word-wrap: normal; 440 | background: #1b1f23; 441 | padding: 10px; 442 | border-radius: 3px; 443 | overflow: auto; 444 | } 445 | 446 | pre > code { 447 | padding: 0; 448 | margin: 0; 449 | font-size: 100%; 450 | word-break: normal; 451 | white-space: pre; 452 | border: 0; 453 | } 454 | 455 | br { 456 | content:"A"; 457 | display: block; 458 | line-height: 40px; 459 | margin: 20px 0; 460 | } 461 | 462 | pre code { 463 | display: inline; 464 | max-width: auto; 465 | padding: 0; 466 | margin: 0; 467 | overflow: visible; 468 | line-height: inherit; 469 | word-wrap: normal; 470 | color: #cccccc; 471 | border: 0; 472 | } 473 | 474 | pre code::before, 475 | pre code::after { 476 | content: normal; 477 | } 478 | 479 | .full-commit .btn-outline:not(:disabled):hover { 480 | color: #005cc5; 481 | border-color: #005cc5; 482 | } 483 | 484 | kbd { 485 | display: inline-block; 486 | padding: 3px 5px; 487 | font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 488 | line-height: 10px; 489 | color: #444d56; 490 | vertical-align: middle; 491 | background-color: #fafbfc; 492 | border: solid 1px #d1d5da; 493 | border-bottom-color: #c6cbd1; 494 | border-radius: 3px; 495 | box-shadow: inset 0 -1px 0 #c6cbd1; 496 | } 497 | 498 | :checked+.radio-label { 499 | position: relative; 500 | z-index: 1; 501 | border-color: #0366d6; 502 | } 503 | 504 | .task-list-item { 505 | list-style-type: none; 506 | } 507 | 508 | .task-list-item+.task-list-item { 509 | margin-top: 3px; 510 | } 511 | 512 | .task-list-item input { 513 | margin: 0 0.2em 0.25em -1.6em; 514 | vertical-align: middle; 515 | } 516 | 517 | hr { 518 | border-bottom-color: #eee; 519 | } 520 | 521 | 522 | .hljs { 523 | display: block; 524 | overflow-x: auto; 525 | padding: 0.5em; 526 | background: #282a36; 527 | } 528 | 529 | .hljs-built_in, 530 | .hljs-selector-tag, 531 | .hljs-section, 532 | .hljs-link { 533 | color: #8be9fd; 534 | } 535 | 536 | .hljs-keyword { 537 | color: #ff79c6; 538 | } 539 | 540 | .hljs, 541 | .hljs-subst { 542 | color: #f8f8f2; 543 | } 544 | 545 | .hljs-title { 546 | color: #50fa7b; 547 | } 548 | 549 | .hljs-string, 550 | .hljs-meta, 551 | .hljs-name, 552 | .hljs-type, 553 | .hljs-attr, 554 | .hljs-symbol, 555 | .hljs-bullet, 556 | .hljs-addition, 557 | .hljs-variable, 558 | .hljs-template-tag, 559 | .hljs-template-variable { 560 | color: #f1fa8c; 561 | } 562 | 563 | .hljs-comment, 564 | .hljs-quote, 565 | .hljs-deletion { 566 | color: #6272a4; 567 | } 568 | 569 | .hljs-keyword, 570 | .hljs-selector-tag, 571 | .hljs-literal, 572 | .hljs-title, 573 | .hljs-section, 574 | .hljs-doctag, 575 | .hljs-type, 576 | .hljs-name, 577 | .hljs-strong { 578 | font-weight: bold; 579 | } 580 | 581 | .hljs-literal, 582 | .hljs-number { 583 | color: #bd93f9; 584 | } 585 | 586 | .hljs-emphasis { 587 | font-style: italic; 588 | } 589 | } -------------------------------------------------------------------------------- /src/components/mdrender/toc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import './toc.less'; 4 | class Toc extends Component { 5 | 6 | constructor(props) { 7 | this.state = { 8 | isOpen: false 9 | } 10 | 11 | this.levelQueue = []; 12 | window.mdTocClick = this.handleTocClick.bind(this); 13 | } 14 | 15 | handleClick(isOpen) { 16 | this.setState({ 17 | isOpen 18 | }); 19 | } 20 | 21 | handleSkip(anchor) { 22 | let ele = document.getElementById(anchor); 23 | if (!ele) return; 24 | let posi = ele.getBoundingClientRect(); 25 | window.scrollTo({ top: posi.top - 60 }); 26 | } 27 | 28 | renderToc(toc, degree) { 29 | if (!toc.child) return ''; 30 | return
    { 31 | toc.child.map((item, index) => { 32 | return
    33 | {index + 1}. { item.title } 34 | { 35 | item.child.length ?
    36 | { 37 | this.renderToc(item, degree + 1) 38 | } 39 |
    : '' 40 | } 41 |
    ; 42 | }) 43 | }
    44 | 45 | 46 | 47 | return
    { 48 | Object.keys(this.props.data).map(key => { 49 | return
    { 50 | this.props.data[key] && this.props.data[key].map(item => { 51 | 52 | let style = { 53 | 'padding-left': (item.level - 1) * 24 + 'px' 54 | } 55 | return { item.text }; 56 | }) 57 | }
    ; 58 | }) 59 | }
    60 | 61 | } 62 | 63 | filterHavaItem() { 64 | return Object.keys(this.props.data).some(key => { 65 | if (this.props.data[key] && this.props.data[key].length) { 66 | return true; 67 | }; 68 | }); 69 | } 70 | 71 | 72 | execData() { 73 | /** 74 | * [ 75 | * { 76 | * title: 77 | * anchor: [] 78 | * child: [] 79 | * }] 80 | */ 81 | 82 | /** 83 | * 如果当期anchor小于上一级的anchor那么就是上一级的child 84 | * 如果当前anchor等于上一级,那么平等 85 | * 如果当前anchor大于上一级从根节点最后一个开始对比 86 | */ 87 | let toc = { 88 | title: 'toc', 89 | anchor: '', 90 | level: 0, 91 | child: [] 92 | }; 93 | 94 | Object.keys(this.props.data).map(key => { 95 | 96 | this.props.data[key] && this.props.data[key].map(item => { 97 | 98 | let last = toc; 99 | let ischeck = false; 100 | while(item.level > last.level && !ischeck) { 101 | if (last.child.length) { 102 | let temNode = last.child[last.child.length - 1]; 103 | if (item.level > temNode.level) { 104 | last = temNode; 105 | } else { 106 | ischeck = true; 107 | } 108 | } else { 109 | ischeck = true; 110 | } 111 | } 112 | 113 | last.child.push({ 114 | title: item.text, 115 | anchor: item.anchor, 116 | level: item.level, 117 | child: [] 118 | }); 119 | 120 | }); 121 | }); 122 | return toc; 123 | } 124 | 125 | handleTocClick() { 126 | let ele = document.getElementById('cr-md-toc'); 127 | if (!ele) return; 128 | let posi = ele.getBoundingClientRect(); 129 | window.scrollTo({ top: posi.top - 60 }); 130 | } 131 | 132 | render() { 133 | if (!this.filterHavaItem()) return ; 134 | 135 | let toc = this.execData(); 136 | 137 | let { isOpen } = this.state; 138 | return
    139 |   140 | { 141 | isOpen && this.renderToc(toc, 1) 142 | } 143 |
    { 144 | isOpen ? '- Close Toc' : '+ Open Toc' 145 | }
    146 |
    147 | } 148 | } 149 | 150 | export default Toc; -------------------------------------------------------------------------------- /src/components/mdrender/toc.less: -------------------------------------------------------------------------------- 1 | 2 | .toc-main { 3 | padding: 0 20px; 4 | padding-top: 20px; 5 | overflow: auto; 6 | white-space: nowrap; 7 | 8 | .toc-container { 9 | 10 | } 11 | 12 | .toc-button { 13 | height: 24px; 14 | display: inline-block; 15 | padding: 0 10px; 16 | line-height: 24px; 17 | border: 1px solid #396; 18 | color: #396; 19 | font-size: 13px; 20 | border-radius: 3px; 21 | cursor: pointer; 22 | } 23 | 24 | .toc-item { 25 | position: relative; 26 | display: block; 27 | font-size: 12px; 28 | color: #36c; 29 | line-height: 20px; 30 | 31 | &:hover { 32 | color: #709; 33 | text-decoration: underline; 34 | } 35 | 36 | .toc-item-left { 37 | display: block; 38 | position: absolute; 39 | left: 0; 40 | top: 9px; 41 | border-bottom: 1px solid #333; 42 | } 43 | } 44 | 45 | .toc-child { 46 | position: relative; 47 | padding: 0; 48 | margin: 5px 0; 49 | padding-left: 16px; 50 | &::before { 51 | content: ' '; 52 | position: absolute; 53 | left: 2px; 54 | width: 2px; 55 | background: #9c9; 56 | height: 100%; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /src/components/setting/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import SettingData from '_/utils/setting.js'; 4 | import Language from '_/utils/language.js'; 5 | import './index.less'; 6 | 7 | class Setting extends Component { 8 | 9 | constructor(props) { 10 | super(props); 11 | 12 | this.state = { 13 | isOpen: false, 14 | autoScroll: false, 15 | mdFontSize: SettingData.get('mdFontSize') || 14 16 | } 17 | 18 | } 19 | 20 | changeOpen(isOpen, e) { 21 | e.stopPropagation(); 22 | this.setState({ isOpen }); 23 | } 24 | 25 | renderItem() { 26 | let { type } = this.props; 27 | if (!type || !type.length) return ; 28 | return
    29 | { 30 | type.map(item => { 31 | if (this['render_' + item.toLowerCase()]) { 32 | return this['render_' + item.toLowerCase()](); 33 | } 34 | return ; 35 | }) 36 | } 37 |
    38 | } 39 | 40 | render_mdfontsize() { 41 | let nowValue = this.state.mdFontSize; 42 | return
    43 |
    { Language('fontSize') }
    44 |
    45 |
    46 |
    47 | { nowValue } 48 |
    49 |
    50 | } 51 | 52 | change_mdfontsize(zl) { 53 | let newValue = Math.ceil(this.state.mdFontSize - 0 + zl); 54 | if (newValue < 12 || newValue > 72) return; 55 | this.props.onChange && this.props.onChange('mdFontSize', newValue); 56 | SettingData.set('mdFontSize', newValue); 57 | this.setState({ 58 | mdFontSize: newValue 59 | }); 60 | } 61 | 62 | render_language() { 63 | let nowLang = SettingData.get('crlang') || 'cn'; 64 | return
    65 |
    Language
    66 | { 67 | [{ 68 | title: '中文', 69 | value: 'cn' 70 | }, { 71 | title: 'English', 72 | value: 'en' 73 | }].map(item => { 74 | return
    75 | { item.title } 76 | { item.value == nowLang &&
    } 77 |
    ; 78 | }) 79 | } 80 |
    81 | } 82 | 83 | change_language(lang) { 84 | SettingData.set('crlang', lang); 85 | location.reload(); 86 | } 87 | 88 | render_autoscroll() { 89 | return
    90 |
    { Language('autoScroll') }
    91 |
    92 | { Language('autoScrollClose') } 93 |
    94 |
    95 |
    96 | } 97 | 98 | change_autoscroll() { 99 | this.setState({ isOpen: false, autoScroll: false }); 100 | } 101 | 102 | render() { 103 | 104 | let { type } = this.props; 105 | if (!type || !type.length) return ; 106 | 107 | let { isOpen, autoScroll } = this.state; 108 | 109 | return
    110 |
    111 | { isOpen &&
    112 |
    113 |
    114 | { Language('close') } 115 |
    116 |
    { Language('settingTitle') }
    117 | { 118 | this.renderItem() 119 | } 120 |
    121 |
    } 122 | { 123 | autoScroll &&
    124 |
    125 | 126 |
    127 |
    128 | } 129 |
    ; 130 | } 131 | } 132 | 133 | export default Setting; -------------------------------------------------------------------------------- /src/components/setting/index.less: -------------------------------------------------------------------------------- 1 | .setting { 2 | .settingOpenBtn { 3 | position: fixed; 4 | z-index: 4; 5 | top: 0; 6 | right: 0px; 7 | line-height: 36px; 8 | width: 36px; 9 | box-sizing: border-box; 10 | height: 36px; 11 | border-left: 1px solid #eee; 12 | 13 | &::before { 14 | content: " "; 15 | display: block; 16 | position: absolute; 17 | left: 10px; 18 | top: 10px; 19 | width: 16px; 20 | height: 16px; 21 | background: url("../static/images/setting.png") 50%/contain no-repeat; 22 | } 23 | } 24 | .settingPage { 25 | position: fixed; 26 | z-index: 5; 27 | top: 0; 28 | right: 0px; 29 | width: 100%; 30 | height: 100%; 31 | background: rgba(0, 0, 0, .3); 32 | 33 | .settingContainer { 34 | position: fixed; 35 | right: 0; 36 | height: 100vh; 37 | width: 60%; 38 | max-width: 320px; 39 | box-sizing: border-box; 40 | padding: 10px; 41 | padding-top: 36px; 42 | background: #fff; 43 | 44 | .title { 45 | position: absolute; 46 | top: 0; 47 | left: 0; 48 | width: 100%; 49 | text-align: center; 50 | font-size: 14px; 51 | height: 36px; 52 | line-height: 36px; 53 | color: #ffffff; 54 | background: #63972f; 55 | } 56 | 57 | .close { 58 | width: 32px; 59 | height: 72px; 60 | position: absolute; 61 | top: 50%; 62 | left: 0; 63 | transform: translate(-100%, -50%); 64 | background: #eee; 65 | border-radius: 3px 0 0 3px; 66 | text-align: center; 67 | 68 | span { 69 | position: absolute; 70 | top: 0; 71 | right: 0; 72 | display: block; 73 | transform-origin: right top; 74 | transform: rotate(-90deg) translate(0, -100%); 75 | height: 32px; 76 | line-height: 32px; 77 | color: #999; 78 | font-size: 12px; 79 | width: 72px; 80 | text-align: center; 81 | } 82 | } 83 | 84 | .settingItem { 85 | position: relative; 86 | margin-top: 10px; 87 | 88 | .settingItemTitle { 89 | padding-bottom: 6px; 90 | line-height: 16px; 91 | font-size: 13px; 92 | color: #999; 93 | } 94 | 95 | .settingFontSizeContainer { 96 | position: relative; 97 | height: 32px; 98 | border-radius: 3px; 99 | border: 1px solid #ccc; 100 | box-sizing: border-box; 101 | line-height: 30px; 102 | text-align: center; 103 | color: #666; 104 | font-size: 14px; 105 | padding: 0 42px; 106 | 107 | .settingFontSizeContainerBtn { 108 | position: absolute; 109 | height: 30px; 110 | width: 42px; 111 | top: 0; 112 | cursor: pointer; 113 | outline: none; 114 | 115 | &.add { 116 | right: 0; 117 | background: url('../static/images/add.png') center/40% no-repeat; 118 | } 119 | 120 | &.subtract { 121 | left: 0; 122 | background: url('../static/images/subtract.png') center/40% no-repeat; 123 | } 124 | } 125 | } 126 | .settingLanguageBtn { 127 | position: relative; 128 | height: 32px; 129 | border-radius: 3px; 130 | border: 1px solid #eee; 131 | box-sizing: border-box; 132 | line-height: 30px; 133 | text-align: center; 134 | color: #666; 135 | cursor: pointer; 136 | outline: none; 137 | font-size: 13px; 138 | margin-top: 4px; 139 | 140 | .settingLanguageBtnSelected { 141 | position: absolute; 142 | height: 16px; 143 | width: 16px; 144 | top: 8px; 145 | border-radius: 50%; 146 | right: 8px; 147 | background: #396 url("../static/images/ok.png") center/60% no-repeat; 148 | } 149 | } 150 | 151 | .settingItemAutoScroll { 152 | position: relative; 153 | height: 32px; 154 | line-height: 32px; 155 | font-size: 13px; 156 | box-sizing: border-box; 157 | border-radius: 3px; 158 | padding: 0 6px; 159 | background: #f5f5f5; 160 | color: #666; 161 | 162 | .settingItemAutoScrollBtn { 163 | position: absolute; 164 | right: 6px; 165 | border: 1px solid #ccc; 166 | box-sizing: border-box; 167 | width: 40px; 168 | border-radius: 12px; 169 | height: 20px; 170 | top: 6px; 171 | 172 | &::before { 173 | content: ' '; 174 | position: absolute; 175 | top: 1px; 176 | left: 2px; 177 | height: 16px; 178 | width: 16px; 179 | border-radius: 8px; 180 | background: #ccc; 181 | } 182 | } 183 | } 184 | } 185 | } 186 | } 187 | 188 | .settingAutoScroll { 189 | position: fixed; 190 | z-index: 15; 191 | top: 0; 192 | right: 0px; 193 | width: 100%; 194 | height: 100%; 195 | background: rgba(0, 0, 0, 0); 196 | } 197 | } -------------------------------------------------------------------------------- /src/components/toc/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import axios from 'axios/dist/axios'; 4 | import GlobalCache from '_/utils/globalCache.js'; 5 | import Language from '_/utils/language.js'; 6 | import './index.less'; 7 | 8 | class Toc extends Component { 9 | constructor(props) { 10 | super(props); 11 | 12 | this.state = { 13 | isOpen: true, 14 | tree: null, 15 | loading: {}, 16 | open: {}, 17 | date: new Date() 18 | } 19 | } 20 | 21 | changeOpen(isOpen, e) { 22 | e.stopPropagation(); 23 | this.setState({ isOpen }); 24 | } 25 | 26 | componentDidMount() { 27 | this.getTree(this.props.sha); 28 | } 29 | 30 | componentWillReceiveProps(newProps) { 31 | if (newProps.sha != this.props.sha) { 32 | this.props = newProps; 33 | this.getTree(newProps.sha); 34 | } 35 | } 36 | 37 | getTree(sha) { 38 | let tree = this.getLocalTree(sha); 39 | if (!tree) { 40 | this.getRemoteTree(sha); 41 | } else { 42 | this.setState({ 43 | tree 44 | }); 45 | } 46 | } 47 | 48 | getLocalTree(childSha) { 49 | if (this.state.tree) { 50 | return this.state.tree[childSha]; 51 | } else { 52 | let { sha } = this.props; 53 | let storageData = localStorage.getItem('crTree'); 54 | if (!storageData) return false; 55 | storageData = JSON.parse(storageData); 56 | this.state.tree = storageData[sha]; 57 | return this.state.tree; 58 | } 59 | } 60 | 61 | getRemoteTree(childSha) { 62 | this.state.loading[childSha] = true; 63 | this.setState({ 64 | date: new Date() 65 | }); 66 | let {user, repo, sha } = this.props; 67 | axios.get(`//api.github.com/repos/${user}/${repo}/git/trees/${childSha}`) 68 | .then((response) => { 69 | let storageData = JSON.parse(localStorage.getItem('crTree') || '{}'); 70 | let mainTree = response.data.tree.map(treeItem => { 71 | return { 72 | path: treeItem.path, 73 | type: treeItem.type == 'tree' ? 1 : 0, 74 | sha: treeItem.sha, 75 | }; 76 | }).sort((a, b) => { 77 | return b.type - a.type; 78 | }); 79 | if (!storageData[sha]) storageData[sha] = {}; 80 | storageData[sha][childSha] = mainTree; 81 | 82 | localStorage.setItem('crTree', JSON.stringify(storageData)); 83 | if (childSha == sha) { 84 | this.setState({ 85 | tree: storageData[sha] 86 | }); 87 | } else { 88 | this.state.loading[childSha] = false; 89 | this.state.open[childSha] = true; 90 | this.setState({ 91 | tree: storageData[sha], 92 | date: new Date() 93 | }); 94 | } 95 | }).catch((error) => { 96 | console.log("err") 97 | }); 98 | 99 | 100 | } 101 | 102 | closeTree(sha) { 103 | this.state.open[sha] = false; 104 | this.setState({ 105 | date: new Date() 106 | }); 107 | } 108 | 109 | openTree(sha) { 110 | this.state.open[sha] = true; 111 | this.setState({ 112 | date: new Date() 113 | }); 114 | } 115 | 116 | fileClick(sha, path, fullPath, otherBranch,e) { 117 | e.stopPropagation(); 118 | this.setState({ 119 | isOpen: false, 120 | date: new Date() 121 | }); 122 | if (otherBranch) { 123 | location.href = '#/code/' + otherBranch + '/' + sha; 124 | } else { 125 | this.props.fileClick && this.props.fileClick({ 126 | sha, 127 | path, 128 | fullPath 129 | }); 130 | } 131 | } 132 | 133 | 134 | renderTree(sha, path) { 135 | let nowTree = this.state.tree[sha]; 136 | if (nowTree == null) return null; 137 | if (!nowTree || !nowTree.map) return false; 138 | path = path || ''; 139 | return
    140 | { 141 | nowTree.map(treeItem => { 142 | 143 | if (treeItem.type == 0) { 144 | return
    { treeItem.path }
    ; 145 | } 146 | let clickHandle = () => {}; 147 | let className = 'treeItem'; 148 | let child = this.renderTree(treeItem.sha, path + '/' + treeItem.path); 149 | 150 | if (child == null) { 151 | if (this.state.loading[treeItem.sha]) { 152 | className += ' treeItemLoading'; 153 | } else { 154 | clickHandle = this.getRemoteTree.bind(this, treeItem.sha); 155 | className += ' treeItemNotLoad'; 156 | } 157 | } else if (this.state.open[treeItem.sha]) { 158 | clickHandle = this.closeTree.bind(this, treeItem.sha); 159 | className += ' treeItemOpen'; 160 | } else { 161 | clickHandle = this.openTree.bind(this, treeItem.sha); 162 | } 163 | return
    164 |
    { treeItem.path }
    165 | { child } 166 |
    167 | }) 168 | } 169 |
    ; 170 | } 171 | 172 | render() { 173 | let { isOpen, tree } = this.state; 174 | 175 | let { user, repo, sha } = this.props; 176 | let nowBranch = [user, repo, sha].join('/'); 177 | let recent = GlobalCache.get('code'); 178 | return
    179 | { !isOpen &&
    { Language('toc') }
    } 180 |
    181 |
    182 |
    183 | { Language('close') } 184 |
    185 |
    186 |
    {user} / {repo}
    187 | { recent &&
    188 |
    { Language('recentOpen') }
    189 | { 190 | recent.slice(0, 5).map(item => { 191 | let className = 'treeItemFile'; 192 | let otherBranch = null; 193 | if (item.data.branch != nowBranch) { 194 | otherBranch = item.data.branch; 195 | className += ' treeItemFileOuter'; 196 | } 197 | return
    { item.data.path }
    ; 198 | }) 199 | } 200 |
    } 201 |
    { Language('fileTree') }
    202 | { 203 | tree && this.renderTree(sha) 204 | } 205 |
    206 |
    207 | 208 |
    209 |
    ; 210 | } 211 | } 212 | 213 | export default Toc; 214 | 215 | -------------------------------------------------------------------------------- /src/components/toc/index.less: -------------------------------------------------------------------------------- 1 | @keyframes rotate { 2 | 0% { 3 | transform: rotate(360deg) 4 | } 5 | 100% { 6 | transform: rotate(0deg) 7 | } 8 | } 9 | 10 | .toc { 11 | .open { 12 | position: fixed; 13 | z-index: 3; 14 | top: 0; 15 | left: 72px; 16 | line-height: 36px; 17 | width: 72px; 18 | box-sizing: border-box; 19 | border-right: 1px solid #eee; 20 | text-align: center; 21 | font-size: 13px; 22 | color: #666; 23 | } 24 | 25 | 26 | 27 | .tocContainer { 28 | position: fixed; 29 | z-index: 5; 30 | top: 0; 31 | left: 0; 32 | width: 100%; 33 | height: 100%; 34 | background: rgba(0,0,0,.5); 35 | transform: translate(-100%, 0); 36 | 37 | &.tocContainerOpen { 38 | transform: translate(0, 0); 39 | } 40 | 41 | .treeContainer { 42 | position: relative; 43 | height: 100vh; 44 | width: 60%; 45 | max-width: 320px; 46 | background: #fff; 47 | 48 | .tocTree { 49 | height: 100vh; 50 | width: 100%; 51 | background: #fff; 52 | overflow: scroll; 53 | 54 | .tocTreeRepo { 55 | line-height: 24px; 56 | font-size: 14px; 57 | font-weight: bold; 58 | padding: 12px; 59 | color: #000; 60 | } 61 | 62 | .tocTreeTitle { 63 | line-height: 24px; 64 | font-size: 12px; 65 | color: #666; 66 | padding: 0 12px; 67 | background: #eee; 68 | } 69 | 70 | .treeItem { 71 | color: #69f; 72 | position: relative; 73 | padding-left: 18px; 74 | width: 200px; 75 | height: 30px; 76 | line-height: 30px; 77 | white-space: nowrap; 78 | overflow: hidden; 79 | text-overflow: ellipsis; 80 | user-select: none; 81 | font-size: 13px; 82 | 83 | .treeItemPath { 84 | height: 30px; 85 | width: 200px; 86 | white-space: nowrap; 87 | overflow: hidden; 88 | text-overflow: ellipsis; 89 | user-select: none; 90 | } 91 | 92 | &::before { 93 | content: " "; 94 | display: block; 95 | position: absolute; 96 | left: 8px; 97 | top: 0; 98 | width: 8px; 99 | height: 30px; 100 | background: url("../static/images/close.png") 50%/contain no-repeat; 101 | } 102 | 103 | &.treeItemLoading::before { 104 | content: " "; 105 | display: block; 106 | position: absolute; 107 | left: 6px; 108 | top: 10px; 109 | width: 10px; 110 | height: 10px; 111 | animation: rotate 1s linear infinite; 112 | background: url("../static/images/load.png") 50%/contain no-repeat; 113 | } 114 | 115 | &.treeItemNotLoad::before { 116 | content: " "; 117 | display: block; 118 | position: absolute; 119 | left: 8px; 120 | top: 0; 121 | width: 8px; 122 | height: 30px; 123 | background: url("../static/images/close.png") 50%/contain no-repeat; 124 | } 125 | 126 | &.treeItemOpen{ 127 | height: auto; 128 | &::before { 129 | content: " "; 130 | display: block; 131 | position: absolute; 132 | left: 8px; 133 | top: 0; 134 | width: 10px; 135 | height: 30px; 136 | background: url("../static/images/open.png") 50%/contain no-repeat; 137 | } 138 | } 139 | } 140 | .treeItemFile { 141 | position: relative; 142 | padding-left: 18px; 143 | width: 200px; 144 | height: 30px; 145 | line-height: 30px; 146 | white-space: nowrap; 147 | overflow: hidden; 148 | text-overflow: ellipsis; 149 | user-select: none; 150 | color: #333; 151 | font-size: 13px; 152 | 153 | &.treeItemFileOuter { 154 | &::before { 155 | content: ' '; 156 | position: absolute; 157 | top: 0; 158 | left: 3px; 159 | width: 12px; 160 | height: 30px; 161 | background: url("../static/images/other.png") center/contain no-repeat; 162 | } 163 | } 164 | } 165 | } 166 | 167 | .close { 168 | width: 32px; 169 | height: 72px; 170 | position: absolute; 171 | top: 50%; 172 | right: 0; 173 | transform: translate(100%, -50%); 174 | background: #eee; 175 | border-radius: 0 3px 3px 0; 176 | text-align: center; 177 | 178 | span { 179 | position: absolute; 180 | top: 0; 181 | right: 0; 182 | display: block; 183 | transform-origin: right top; 184 | transform: rotate(90deg) translate(100%, 0); 185 | height: 32px; 186 | line-height: 32px; 187 | color: #999; 188 | font-size: 12px; 189 | width: 72px; 190 | text-align: center; 191 | } 192 | } 193 | } 194 | 195 | 196 | 197 | 198 | } 199 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { h, Component, render } from 'preact'; 4 | 5 | import Base from '_/components/base/index.js'; 6 | import Confirm from '_/components/confirm/index.js'; 7 | import Add from '_/pages/add/index.js'; 8 | import Code from '_/pages/code/index.js'; 9 | import SelectBranch from '_/pages/selectBranch/index.js'; 10 | import RepoList from '_/pages/repoList/index.js'; 11 | import RepoBranch from '_/pages/repoBranch/index.js'; 12 | 13 | 14 | const Cr = () => { 15 | return 16 | 17 | 18 | 19 | 20 | 21 | 22 | ; 23 | } 24 | 25 | 26 | render(, document.getElementById('container')); -------------------------------------------------------------------------------- /src/pages/add/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import Language from '_/utils/language.js'; 4 | import './index.less'; 5 | 6 | class Create extends Component { 7 | 8 | add() { 9 | let value = document.getElementById('addTextarea').value || ''; 10 | 11 | if (value[value.length - 1]!= '/') value += '/'; 12 | 13 | let mainMatchReg = /github\.com\/(.*?)\/(.*?)(?:\/|$)/i; 14 | let mainMatchRes = mainMatchReg.exec(value); 15 | 16 | if (mainMatchRes[1] && mainMatchRes[2]) { 17 | location.href = '#/branch/' + mainMatchRes[1] + '/' + mainMatchRes[2].replace(/#.*$/i, ''); 18 | } else { 19 | // error 20 | } 21 | } 22 | 23 | handleBack() { 24 | history.back(); 25 | } 26 | 27 | render() { 28 | return
    29 |
    { Language('addNewRepo') }
    30 |
    { Language('back') }
    31 | 32 |
    { Language('confirm') }
    33 |
    34 | } 35 | } 36 | 37 | export default Create; 38 | 39 | -------------------------------------------------------------------------------- /src/pages/add/index.less: -------------------------------------------------------------------------------- 1 | .create { 2 | textarea { 3 | display: block; 4 | margin: 10px auto; 5 | width: 94%; 6 | box-sizing: border-box; 7 | max-width: 480px; 8 | height: 144px; 9 | line-height: 24px; 10 | padding: 12px; 11 | font-size: 13px; 12 | color: #666; 13 | border: 1px solid #ccc; 14 | resize: none; 15 | outline: none; 16 | border-radius: 3px; 17 | } 18 | .button { 19 | margin: 10px auto; 20 | width: 94%; 21 | box-sizing: border-box; 22 | max-width: 480px; 23 | line-height: 38px; 24 | font-size: 13px; 25 | text-align: center; 26 | background: #3c3; 27 | color: #fff; 28 | border-radius: 3px; 29 | outline: none; 30 | cursor: pointer; 31 | user-select: none; 32 | } 33 | } -------------------------------------------------------------------------------- /src/pages/code/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import Toc from '_/components/toc/index.js'; 4 | import CodeRender from '_/components/code/index.js'; 5 | import GlobalCache from '_/utils/globalCache.js'; 6 | import Language from '_/utils/language.js'; 7 | import './index.less'; 8 | 9 | class Code extends Component { 10 | 11 | constructor(props) { 12 | super(props); 13 | this.state = { 14 | file: null 15 | } 16 | } 17 | 18 | fileClick(file) { 19 | this.setState({ 20 | file 21 | }); 22 | } 23 | 24 | componentWillReceiveProps(newProps) { 25 | if (newProps.urlParams.fileSha && this.props.urlParams.fileSha != newProps.urlParams.fileSha) { 26 | this.props = newProps; 27 | this.changeNewFile(newProps.urlParams.fileSha); 28 | } 29 | } 30 | 31 | changeNewFile(newSha) { 32 | let { user, repo, sha } = this.props.urlParams; 33 | let newCode = GlobalCache.get('code', newSha); 34 | if (!newCode) return; 35 | this.setState({ 36 | file: { 37 | sha: newSha, 38 | path: newCode.path, 39 | fullPath: newCode.fullPath 40 | } 41 | }); 42 | } 43 | 44 | 45 | render() { 46 | let { user, repo, sha } = this.props.urlParams; 47 | 48 | let { file } = this.state; 49 | 50 | return
    51 |
    { Language('cr') }
    52 |
    { Language('back') }
    53 | 54 |
    55 | { file && } 56 |
    57 | 58 |
    59 | } 60 | } 61 | 62 | export default Code; 63 | 64 | -------------------------------------------------------------------------------- /src/pages/code/index.less: -------------------------------------------------------------------------------- 1 | .code { 2 | .codeContent { 3 | margin: 0px auto; 4 | width: 100%; 5 | box-sizing: border-box; 6 | max-width: 960px; 7 | border: 0; 8 | border-left: 1px solid #eee; 9 | border-right: 1px solid #eee; 10 | } 11 | } -------------------------------------------------------------------------------- /src/pages/repoBranch/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import TimeFormat from '_/utils/timeFormat.js'; 4 | import Storage from '_/utils/storage.js'; 5 | import Language from '_/utils/language.js'; 6 | import './index.less'; 7 | 8 | class RepoBranch extends Component { 9 | 10 | getList() { 11 | let {user, repo} = this.props.urlParams; 12 | 13 | return
    { 14 | Storage.BranchList(user, repo).map(rep => { 15 | return 16 |
    {rep.name || rep.sha}
    17 |
    { TimeFormat(rep.date, 'yyyy-MM-dd hh:mm:ss') }
    18 |
    19 | }) 20 | }
    ; 21 | } 22 | 23 | handleBack() { 24 | history.back(); 25 | } 26 | 27 | render() { 28 | let {user, repo} = this.props.urlParams; 29 | 30 | return
    31 |
    { Language('branchList') }
    32 |
    { Language('back') }
    33 | 34 |
    35 |
    {user} / {repo}
    36 |
    37 |
    38 | { this.getList() } 39 |
    40 | + { Language('addBranch') } 41 |
    42 | } 43 | } 44 | 45 | export default RepoBranch; 46 | 47 | -------------------------------------------------------------------------------- /src/pages/repoBranch/index.less: -------------------------------------------------------------------------------- 1 | .branchList { 2 | 3 | a { 4 | text-decoration: none; 5 | &.add { 6 | display: block; 7 | position: relative; 8 | margin: 10px auto; 9 | line-height: 36px; 10 | width: 94%; 11 | border-radius: 3px; 12 | color: rgb(112, 100, 100); 13 | text-align: center; 14 | font-size: 12px; 15 | background-color: #ecf8fa; 16 | font-weight: bold; 17 | } 18 | } 19 | 20 | .user { 21 | padding: 8px 12px; 22 | font-size: 12px; 23 | font-weight: bold; 24 | color: #ffffff; 25 | background-color: #3e508e; 26 | border-bottom: 1px solid #eee; 27 | } 28 | 29 | 30 | .branchItem { 31 | position: relative; 32 | display: block; 33 | padding: 12px; 34 | padding-left: 32px; 35 | 36 | &::before { 37 | content: ' '; 38 | position: absolute; 39 | height: 100%; 40 | top: 0; 41 | left: 15px; 42 | width: 1px; 43 | background: #eee; 44 | } 45 | 46 | &::after { 47 | content: ' '; 48 | position: absolute; 49 | height: 9px; 50 | top: 20px; 51 | left: 11px; 52 | width: 9px; 53 | border-radius: 50%; 54 | background: #fc9; 55 | } 56 | 57 | &:nth-child(n) { &::after { background: #fc9; } } 58 | &:nth-child(2n) { &::after { background: rgb(105, 218, 247); } } 59 | &:nth-child(3n) { &::after { background: rgb(177, 214, 200); } } 60 | 61 | .branchName { 62 | line-height: 24px; 63 | font-size: 14px; 64 | font-weight: bold; 65 | color: #333; 66 | } 67 | .branchInfo { 68 | line-height: 20px; 69 | font-size: 12px; 70 | color: #999; 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /src/pages/repoList/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { Component } from 'preact'; /** @jsx h */ 4 | import TimeFormat from '_/utils/timeFormat.js'; 5 | import Storage from '_/utils/storage.js'; 6 | import Setting from '_/components/setting/index.js'; 7 | import Language from '_/utils/language.js'; 8 | import './index.less'; 9 | 10 | class RepoList extends Component { 11 | 12 | getList(repoList) { 13 | return ; 21 | } 22 | 23 | render() { 24 | 25 | let repoList = Storage.RepoList(); 26 | return
    27 |
    { Language('cr') }
    28 | 29 | + { Language('addRepo') } 30 | { 31 | repoList && repoList.length ? this.getList(repoList) : Language('introduction') 32 | } 33 |
    34 | } 35 | } 36 | 37 | export default RepoList; 38 | 39 | -------------------------------------------------------------------------------- /src/pages/repoList/index.less: -------------------------------------------------------------------------------- 1 | .repoList { 2 | a { 3 | text-decoration: none; 4 | &.add { 5 | display: block; 6 | position: relative; 7 | margin: 10px auto; 8 | line-height: 36px; 9 | width: 94%; 10 | border-radius: 3px; 11 | color: #fff; 12 | text-align: center; 13 | font-size: 12px; 14 | background-color: #da7878; 15 | font-weight: bold; 16 | } 17 | } 18 | 19 | .listItem { 20 | position: relative; 21 | display: block; 22 | padding: 12px; 23 | padding-left: 32px; 24 | user-select: none; 25 | 26 | &::before { 27 | content: ' '; 28 | position: absolute; 29 | height: 100%; 30 | top: 0; 31 | left: 15px; 32 | width: 1px; 33 | background: #eee; 34 | } 35 | 36 | &::after { 37 | content: ' '; 38 | position: absolute; 39 | height: 9px; 40 | top: 20px; 41 | left: 11px; 42 | width: 9px; 43 | border-radius: 50%; 44 | background: #fc9; 45 | } 46 | 47 | &:nth-child(n) { &::after { background: #fc9; } } 48 | &:nth-child(2n) { &::after { background: rgb(105, 218, 247); } } 49 | &:nth-child(3n) { &::after { background: rgb(177, 214, 200); } } 50 | 51 | .listName { 52 | line-height: 24px; 53 | font-size: 14px; 54 | font-weight: bold; 55 | color: #333; 56 | } 57 | .listInfo { 58 | position: relative; 59 | line-height: 20px; 60 | font-size: 12px; 61 | color: #999; 62 | 63 | &::before { 64 | content: ' '; 65 | position: absolute; 66 | left: 0; 67 | bottom: 0; 68 | width: 64%; 69 | } 70 | } 71 | } 72 | 73 | .introduction { 74 | padding: 12px; 75 | font-size: 13px; 76 | max-width: 640px; 77 | margin: 0 auto; 78 | 79 | .howTo { 80 | border-left: 4px solid #cdf; 81 | padding: 6px; 82 | margin-bottom: 16px; 83 | } 84 | .introductionTitle { 85 | font-size: 18px; 86 | font-weight: bold; 87 | color: #000; 88 | padding: 12px 0; 89 | } 90 | 91 | .paragraph { 92 | margin-bottom: 16px; 93 | 94 | a { 95 | color: #39f; 96 | } 97 | 98 | &.bold { 99 | font-size: 14px; 100 | font-weight: bold; 101 | } 102 | 103 | &.list { 104 | padding-left: 16px; 105 | text-indent: -16px; 106 | } 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /src/pages/selectBranch/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { Component } from 'preact'; /** @jsx h */ 3 | import Loading from '_/components/loading/index.js'; 4 | import Storage from '_/utils/storage.js'; 5 | import Language from '_/utils/language.js'; 6 | import axios from 'axios/dist/axios'; 7 | import './index.less'; 8 | 9 | class SelectBranch extends Component { 10 | 11 | constructor(props) { 12 | super(props); 13 | 14 | let { sha } = this.props.urlParams; 15 | 16 | this.state = { 17 | isLoading: sha? false: true, 18 | branches: null, 19 | commits: null, 20 | nowType: sha? 'Hash' : 'Branch' 21 | } 22 | 23 | !sha && this.getBranch(); 24 | } 25 | 26 | getBranch() { 27 | if (this.state.branches!= null) { 28 | return; 29 | } 30 | let {user, repo} = this.props.urlParams; 31 | // https://api.github.com/repos/:user/:repo/branches 32 | axios.get(`//api.github.com/repos/${user}/${repo}/branches`) 33 | .then((response) => { 34 | this.setState({ 35 | isLoading: false, 36 | branches: response.data 37 | }); 38 | }).catch((error) => { 39 | console.log(error) 40 | this.setState({ 41 | isLoading: false 42 | }); 43 | }); 44 | } 45 | 46 | getCommit() { 47 | if (this.state.commits!= null) { 48 | return; 49 | } 50 | let {user, repo} = this.props.urlParams; 51 | this.setState({ 52 | isLoading: true 53 | }); 54 | axios.get(`//api.github.com/repos/${user}/${repo}/commits`) 55 | .then((response) => { 56 | this.setState({ 57 | isLoading: false, 58 | commits: response.data 59 | }); 60 | }).catch((error) => { 61 | this.setState({ 62 | isLoading: false 63 | }); 64 | }); 65 | } 66 | 67 | addCommit(name, sha) { 68 | let {user, repo} = this.props.urlParams; 69 | Storage.BranchAdd(user, repo, name, sha); 70 | location.href = '#/'; 71 | } 72 | 73 | changeType(type) { 74 | this.setState({ 75 | nowType: type 76 | }); 77 | this['get' + type] && this['get' + type](); 78 | } 79 | 80 | handleBack() { 81 | // history.back(); 82 | location.href = '#'; 83 | } 84 | 85 | addHashHandle() { 86 | let ele = document.getElementById('selectBranchTextarea'); 87 | let sha = ele.value; 88 | if (!sha) return; 89 | let { user, repo } = this.props.urlParams; 90 | Storage.BranchAdd(user, repo, sha, sha); 91 | location.href = '#/'; 92 | } 93 | 94 | render() { 95 | let {isLoading, branches, nowType, commits} = this.state; 96 | let {user, repo, sha} = this.props.urlParams; 97 | return
    98 |
    99 | { Language('by') }{ 100 | ['Branch', 'Commit', 'Hash'].map(type => { 101 | return {Language(type.toLowerCase())}; 102 | }) 103 | } 104 |
    105 |
    { Language('back') }
    106 |
    107 |
    {user} / {repo}
    108 |
    109 |
    110 | 111 | { 112 | isLoading && 113 | } 114 | { 115 | !isLoading && nowType == 'Branch' && branches!=null && branches.map(branch => { 116 | return
    117 |
    { branch.name }
    118 |
    { branch.commit.sha }
    119 |
    120 | }) 121 | } 122 | { 123 | !isLoading && nowType == 'Commit' && commits!=null && commits.map(commit => { 124 | return
    125 |
    { commit.commit.message }
    126 |
    { commit.commit.author.name } @ { commit.commit.author.date }
    127 |
    128 | }) 129 | } 130 | { 131 | nowType == 'Hash' &&
    132 | 133 |
    { Language('confirm') }
    134 |
    135 | } 136 |
    137 |
    138 | } 139 | } 140 | 141 | export default SelectBranch; 142 | 143 | -------------------------------------------------------------------------------- /src/pages/selectBranch/index.less: -------------------------------------------------------------------------------- 1 | .selectBranch { 2 | 3 | 4 | .title { 5 | span { 6 | margin-left: 10px; 7 | color: #ccc; 8 | } 9 | .selected { 10 | color: #000; 11 | font-weight: bold; 12 | } 13 | } 14 | 15 | .user { 16 | padding: 8px 12px; 17 | font-size: 12px; 18 | font-weight: bold; 19 | color: #ffffff; 20 | background-color: #3e508e; 21 | border-bottom: 1px solid #eee; 22 | } 23 | 24 | 25 | .branch { 26 | border-bottom: 1px solid #eee; 27 | padding: 12px; 28 | &:last-child { 29 | border-bottom: 0; 30 | } 31 | .branchName { 32 | line-height: 24px; 33 | font-size: 14px; 34 | color: #333; 35 | font-weight: bold; 36 | word-break: break-all; 37 | } 38 | .branchSha { 39 | line-height: 24px; 40 | font-size: 12px; 41 | color: #666; 42 | word-break: break-all; 43 | } 44 | } 45 | 46 | .commit { 47 | border-bottom: 1px solid #eee; 48 | padding: 12px; 49 | &:last-child { 50 | border-bottom: 0; 51 | } 52 | .commitMsg { 53 | line-height: 18px; 54 | font-size: 13px; 55 | color: #999; 56 | word-break: break-all; 57 | } 58 | .commitInfo { 59 | line-height: 24px; 60 | font-size: 13px; 61 | color: #333; 62 | word-break: break-all; 63 | } 64 | 65 | } 66 | 67 | .hash { 68 | textarea { 69 | display: block; 70 | margin: 10px auto; 71 | width: 94%; 72 | box-sizing: border-box; 73 | max-width: 480px; 74 | height: 144px; 75 | line-height: 24px; 76 | padding: 12px; 77 | font-size: 13px; 78 | color: #666; 79 | border: 1px solid #ccc; 80 | resize: none; 81 | outline: none; 82 | border-radius: 3px; 83 | } 84 | .button { 85 | margin: 10px auto; 86 | width: 94%; 87 | box-sizing: border-box; 88 | max-width: 480px; 89 | line-height: 38px; 90 | font-size: 13px; 91 | text-align: center; 92 | background: #6ba06b; 93 | color: #fff; 94 | border-radius: 3px; 95 | outline: none; 96 | cursor: pointer; 97 | user-select: none; 98 | } 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/utils/globalCache.js: -------------------------------------------------------------------------------- 1 | // global cache data 2 | // 1. file data 3 | 4 | /** 5 | * { 6 | * name, 7 | * date, 8 | * data 9 | * } 10 | */ 11 | class GlobalCache { 12 | constructor() { 13 | if (!window.crGlobalCache) window.crGlobalCache = {}; 14 | 15 | this.dataCacheSizeDefault = 6; 16 | this.dataCacheSizeType = { 17 | code: 20 18 | } 19 | } 20 | 21 | add(type, name, data) { 22 | let size = this.dataCacheSizeType[type] || this.dataCacheSizeDefault; 23 | if (!window.crGlobalCache[type]) window.crGlobalCache[type] = []; 24 | 25 | let cacheIndex = this.getIndex(name, window.crGlobalCache[type]); 26 | if (cacheIndex) { 27 | data = window.crGlobalCache[type][cacheIndex].data; 28 | window.crGlobalCache[type].splice(cacheIndex, 1); 29 | } 30 | if (window.crGlobalCache[type].length >= size -1) { 31 | window.crGlobalCache[type].pop(); 32 | } 33 | window.crGlobalCache[type].unshift({ 34 | name, 35 | date: new Date() - 0, 36 | data 37 | }); 38 | } 39 | 40 | getIndex(name, cacheData) { 41 | let matchIndex = null; 42 | cacheData.map((item, index) => { 43 | if (item.name == name) matchIndex = index; 44 | }); 45 | return matchIndex; 46 | } 47 | 48 | get(type, name) { 49 | if (!window.crGlobalCache[type]) return null; 50 | if (!name) return window.crGlobalCache[type]; 51 | let cacheIndex = this.getIndex(name, window.crGlobalCache[type]); 52 | if (cacheIndex == null) return; 53 | let data = window.crGlobalCache[type][cacheIndex].data; 54 | window.crGlobalCache[type].splice(cacheIndex, 1); 55 | window.crGlobalCache[type].unshift({ 56 | name, 57 | date: new Date() - 0, 58 | data 59 | }); 60 | return data; 61 | } 62 | 63 | } 64 | 65 | export default new GlobalCache(); -------------------------------------------------------------------------------- /src/utils/language.js: -------------------------------------------------------------------------------- 1 | import SettingData from './setting.js'; 2 | 3 | const data = { 4 | addBranch: { 5 | en: 'Add Branch', 6 | cn: '添加新分支' 7 | }, 8 | addRepo: { 9 | en: 'Add Repo', 10 | cn: '添加新仓库' 11 | }, 12 | addNewRepo: { 13 | en: 'Add New Repositorie', 14 | cn: '添加新仓库' 15 | }, 16 | addNewRepoTip: { 17 | en: 'Please enter the repositorie\'s address \nE.g: https://github.com/echosoar/cr', 18 | cn: '请输入github仓库地址 \n例如: https://github.com/echosoar/cr' 19 | }, 20 | autoScroll: { 21 | en: 'Automatic scrolling', 22 | cn: '自动滚屏' 23 | }, 24 | autoScrollClose: { 25 | en: 'Closed, click to use', 26 | cn: '已关闭,点击使用' 27 | }, 28 | back: { 29 | en: 'Back', 30 | cn: '返回' 31 | }, 32 | branch: { 33 | en: 'Branch', 34 | cn: '分支' 35 | }, 36 | branchList: { 37 | en: 'Branch List', 38 | cn: '分支列表' 39 | }, 40 | by: { 41 | en: 'By', 42 | cn: '通过' 43 | }, 44 | cancel: { 45 | en: 'Cancel', 46 | cn: '取消' 47 | }, 48 | close: { 49 | en: 'Close', 50 | cn: '关闭' 51 | }, 52 | commit: { 53 | en: 'Commit', 54 | cn: '提交记录' 55 | }, 56 | confirm: { 57 | en: 'Confirm', 58 | cn: '确认' 59 | }, 60 | cr: { 61 | en: 'Code Reader', 62 | cn: '代码阅读器' 63 | }, 64 | enterHashTip: { 65 | en: 'Please enter the hash', 66 | cn: '请输入哈希(hash)值' 67 | }, 68 | fileTree: { 69 | en: 'Tree', 70 | cn: '文件树' 71 | }, 72 | fontSize: { 73 | en: 'Font Size', 74 | cn: '文字大小' 75 | }, 76 | hash: { 77 | en: 'Hash', 78 | cn: '哈希值' 79 | }, 80 | introduction: { 81 | en:
    82 |
    Guidelines for use
    83 |
    CR is a Web application that helps you read Github code more easily and comfortably.
    84 |
    How to use?
    85 |
    86 |
    1. Click "Add Repo" to add a Git repository to this application
    87 |
    2. CR will help you pull his branch, recent Commit, or you manually enter the version of the SHA string, from which you can choose a branch of code you wish to read.
    88 |
    89 |
    After a simple two-step process above, you can happily read the code on your mobile device.
    90 |
    Currently, CR has made special optimizations for Markdown files, and the code has also been adapted to read on the mobile.
    91 |
    If you have a better idea, you can submit an issue by clicking on the Github link at the bottom of the page. If you like this project you can give star, and you are interested in participating in this project.
    92 |
    In addition, you can directly share the code you are reading to others by link. For example, directly opening the link below will automatically add the CR code to your reading list.
    93 | https://cr.js.org/#/code/echosoar/cr 94 |
    , 95 | cn:
    96 |
    使用指引
    97 |
    CR是一个无后端的Web应用,能够帮助你更加方便、舒适地阅读Github的代码。
    98 |
    如何使用?
    99 |
    100 |
    1. 点击上方的 “添加新仓库” 按钮添加一个Git仓库到本应用。
    101 |
    2. CR会帮您拉取他的分支、最近Commit,或者是你手动输入版本的SHA字符串,你可以从中选取一个你希望阅读的代码分支。
    102 |
    103 |
    经过上面简单的两步你就可以愉快地在移动设备(手机、平板)上面阅读代码了。
    104 |
    目前CR对于Markdown文件做了特殊的优化展示,对于代码也进行了适合在移动端阅读的适配。
    105 |
    如果有更好的想法可以点击页面底部的Github链接提交 issue,如果喜欢这个项目可以给予 star ,有兴趣可以一起参与这个项目。
    106 |
    另外你可以直接通过链接分享你正在阅读的代码给其他人,比如直接打开下面的链接就会自动添加 CR 的代码到你的阅读列表中
    107 | https://cr.js.org/#/code/echosoar/cr 108 |
    109 | }, 110 | openLink: { 111 | en: 'Open Link', 112 | cn: '打开链接' 113 | }, 114 | recentOpen: { 115 | en: 'Recent Open', 116 | cn: '最近打开' 117 | }, 118 | settingTitle:{ 119 | en: 'Setting', 120 | cn: '设置' 121 | }, 122 | toc: { 123 | en: 'TOC', 124 | cn: '目录' 125 | } 126 | } 127 | 128 | let lang = (type) => { 129 | let language = SettingData.get('crlang') || 'cn'; 130 | return data[type] && data[type][language] || type || ''; 131 | } 132 | export default lang; -------------------------------------------------------------------------------- /src/utils/regext.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/utils/setting.js: -------------------------------------------------------------------------------- 1 | let set = (name, value) => { 2 | let settingData = window.localStorage.getItem('crSetting') || '{}'; 3 | try { 4 | settingData = JSON.parse(settingData); 5 | } catch (e) { 6 | settingData = {}; 7 | } 8 | settingData[name] = value; 9 | window.localStorage.setItem('crSetting', JSON.stringify(settingData)); 10 | } 11 | 12 | let get = (name) => { 13 | let settingData = window.localStorage.getItem('crSetting') || '{}'; 14 | try { 15 | settingData = JSON.parse(settingData); 16 | } catch (e) { 17 | settingData = {}; 18 | } 19 | return settingData[name]; 20 | } 21 | 22 | export default { 23 | set, 24 | get 25 | } -------------------------------------------------------------------------------- /src/utils/storage.js: -------------------------------------------------------------------------------- 1 | let Storage = {} 2 | 3 | Storage.RepoList = () => { 4 | let repoList = {}; 5 | try { 6 | let storageData = localStorage.getItem('crRepoList') || ''; 7 | repoList = JSON.parse(storageData); 8 | } catch(e){}; 9 | 10 | return Object.keys(repoList).map(repo => { 11 | return repoList[repo]; 12 | }).sort((a, b) => { 13 | return b.date - a.date; 14 | }); 15 | } 16 | 17 | Storage.RepoCheck = (user, repo) => { 18 | let repoList = {}; 19 | try { 20 | let storageData = localStorage.getItem('crRepoList') || ''; 21 | repoList = JSON.parse(storageData); 22 | } catch(e){}; 23 | let repoItem = repoList[user + '/' + repo]; 24 | if (repoItem) return repoItem; 25 | return false; 26 | } 27 | /** 28 | * name 为分支名称,添加commit sha或者sha的时候为sha 29 | */ 30 | Storage.BranchAdd = (user, repo, name, sha) => { 31 | let repoList = {}; 32 | try { 33 | let storageData = localStorage.getItem('crRepoList') || ''; 34 | repoList = JSON.parse(storageData); 35 | } catch(e){}; 36 | 37 | if (!repoList[user + '/' + repo]) { 38 | repoList[user + '/' + repo] = { 39 | date: new Date() - 0, 40 | branch: [], 41 | user, 42 | repo 43 | }; 44 | } 45 | 46 | let nowIndex = -1; 47 | 48 | repoList[user + '/' + repo].branch.map((branch, index) => { 49 | if (branch.sha == sha) { 50 | nowIndex = index; 51 | } 52 | }); 53 | 54 | let insertData = { 55 | sha, 56 | name, 57 | date: new Date() - 0 58 | }; 59 | 60 | if (nowIndex != -1) { 61 | repoList[user + '/' + repo].branch.splice(nowIndex, 1); 62 | } 63 | repoList[user + '/' + repo].branch.unshift(insertData); 64 | repoList[user + '/' + repo].date = new Date() - 0; 65 | localStorage.setItem('crRepoList', JSON.stringify(repoList)); 66 | } 67 | 68 | Storage.BranchCheck = (repoItem, sha) => { 69 | if (!repoItem.branch) return; 70 | let branch = repoItem.branch.find(branch => { 71 | if (branch.sha == sha) return branch; 72 | return false; 73 | }); 74 | return branch; 75 | } 76 | 77 | Storage.BranchList = (user, repo) => { 78 | let repoList = {}; 79 | try { 80 | let storageData = localStorage.getItem('crRepoList') || ''; 81 | repoList = JSON.parse(storageData); 82 | } catch(e){}; 83 | let repoItem = repoList[user + '/' + repo]; 84 | if (!repoItem || !repoItem.branch) { 85 | return null; 86 | } else { 87 | return repoItem.branch.sort((a, b) => { 88 | return b.date - a.date; 89 | }); 90 | } 91 | } 92 | 93 | Storage.checkURL = () => { 94 | let nowPath = location.hash || ''; 95 | nowPath = nowPath.replace(/^(#\/|\/)/, '').replace(/\/$/, '').split('/'); 96 | if (nowPath.length < 3) return; 97 | let user = nowPath[1], repo = nowPath[2], sha = nowPath[3] || ''; 98 | 99 | let repoExists = Storage.RepoCheck(user, repo); 100 | if (!repoExists) location.href = '#/branch/' + user + '/' + repo; 101 | if (!sha) return; 102 | let branchExists = Storage.BranchCheck(repoExists, sha); 103 | // if repo and sha exists return; 104 | if (!branchExists) location.href = '#/branch/' + user + '/' + repo + '/' + sha; 105 | 106 | } 107 | export default Storage; -------------------------------------------------------------------------------- /src/utils/timeFormat.js: -------------------------------------------------------------------------------- 1 | let _type = function(obj) { 2 | var class2type = {}; 3 | var toString = class2type.toString; 4 | return obj == null ? String(obj) : 5 | class2type[toString.call(obj)] || 'object'; 6 | } 7 | let isObject = function(obj) { 8 | return _type(obj) == 'object'; 9 | } 10 | let format = function(date, fmt) { 11 | if (isObject(date) == false) { 12 | return date; 13 | } 14 | date = new Date(date); 15 | if (fmt === undefined) { 16 | fmt = 'yyyy-MM-dd hh:mm:ss'; 17 | } 18 | var o = { 19 | 'M+': date.getMonth() + 1, //月份 20 | 'd+': date.getDate(), //日 21 | 'h+': date.getHours(), //小时 22 | 'm+': date.getMinutes(), //分 23 | 's+': date.getSeconds(), //秒 24 | 'q+': Math.floor((date.getMonth() + 3) / 3), //季度 25 | 'S': date.getMilliseconds() //毫秒 26 | }; 27 | if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); 28 | for (var k in o) 29 | if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))); 30 | return fmt; 31 | }; 32 | 33 | 34 | export default format; -------------------------------------------------------------------------------- /static/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/.DS_Store -------------------------------------------------------------------------------- /static/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/.DS_Store -------------------------------------------------------------------------------- /static/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/add.png -------------------------------------------------------------------------------- /static/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/close.png -------------------------------------------------------------------------------- /static/images/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/github.png -------------------------------------------------------------------------------- /static/images/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/load.png -------------------------------------------------------------------------------- /static/images/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/ok.png -------------------------------------------------------------------------------- /static/images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/open.png -------------------------------------------------------------------------------- /static/images/other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/other.png -------------------------------------------------------------------------------- /static/images/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/setting.png -------------------------------------------------------------------------------- /static/images/subtract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/echosoar/cr/cdf7507dbd651c69c54a85b3ddec455425c088b8/static/images/subtract.png --------------------------------------------------------------------------------