{{ book.summary | characters: 300 }}
去豆瓣看这本书diff --git a/assets/resource/manifest.json b/assets/resource/manifest.json index 11ee681..28289d0 100644 --- a/assets/resource/manifest.json +++ b/assets/resource/manifest.json @@ -1,7 +1,7 @@ { "name": "读书笔记", "description": "豆瓣读书笔记第三方应用", - "version": "0.2.0", + "version": "0.2.1", "manifest_version": 2, "minimum_chrome_version": "29", "app": { diff --git a/public/background.js b/public/background.js index 0199594..91291c8 100644 --- a/public/background.js +++ b/public/background.js @@ -1,6 +1,6 @@ chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { - 'minWidth': 660, + 'minWidth': 860, 'minHeight': 580, 'bounds': { 'width': 960, diff --git a/public/css/style.css b/public/css/style.css index 9d4831a..d1c31a8 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -75,6 +75,8 @@ input.ng-invalid{color:#dc143c !important} header.header{padding:.5em;font-size:1.8em;position:fixed;top:0;left:0;right:0;z-index:999;box-shadow:0 1px 1px rgba(0,0,0,0.1);background:rgba(95,158,160,0.96);color:rgba(255,255,255,0.9);line-height:0;} header.header span.icon-sidebar{float:left} header.vanished{right:auto;box-shadow:none;background:none;color:#aaa} +header .title{font-size:.8em;line-height:1.25;margin-left:1em;font-family:Hiragino Sans GB,STHeiti,Microsoft Yahei,sans-serif;} +header .title a{color:#fff} aside{position:fixed;z-index:1000;top:0;left:0;bottom:0;-webkit-transform:translateX(-200px);-moz-transform:translateX(-200px);transform:translateX(-200px);-webkit-transition:-webkit-transform .3s;-moz-transition:-moz-transform .3s;-webkit-transition:transform .3s;-moz-transition:transform .3s;transition:transform .3s;width:200px;background:#363636;padding-top:1em;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiWCbjxoZJUaCBj1CjH7GIaDbc9kqBY3W/Rgjda1iqQcOJu2WW+76pZC9QG7M00dffe9hNnseupFL53r8F7YHSwJWUKP2q+k7RdsxyOB11n0xtOvnW4irMMFNV4H0uqwS5ExsmP9AxbDTc9JwgneAT5vTiUSm1E7BSflSt3bfa1tv8Di3R8n3Af7MNWzs49hmauE2wP+ttrq+AsWpFG2awvsuOqbipWHgtuvuaAE+A1Z/7gC9hesnr+7wqCwG8c5yAg3AL1fm8T9AZtp/bbJGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==");box-shadow:inset -3px 0 8px #444;} aside.show{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0)} aside ul{margin:0;padding:0;} @@ -93,9 +95,10 @@ aside .avatar{display:block;width:100px;height:100px;border-radius:50px;margin:0 ul.books{padding:0;margin:0 -1em} li.book{margin:1em} .book{display:inline-block;vertical-align:top;} -.book .cover{position:relative;min-width:120px;height:160px;overflow:hidden;background-size:cover;background-position:center;box-shadow:0 2px 3px #ddd;position:relative;} +.book .cover{position:relative;min-width:120px;height:160px;overflow:hidden;background-size:cover;background-position:center;box-shadow:0 2px 3px #ddd;position:relative;border-radius:2px;} .book .cover a{text-decoration:initial} -.book .cover .book-link{min-width:120px;height:160px;display:inline-block;box-shadow:inset 0 0 1px #000;position:relative;background-color:transparent;-webkit-transition:background-color .3s;-moz-transition:background-color .3s;transition:background-color .3s} +.book .cover .book-link{min-width:120px;height:160px;display:inline-block;box-shadow:inset 0 0 1px rgba(50,55,58,0.5),inset 2px 0 5px rgba(255,255,255,0.5);border-radius:2px;position:relative;background-color:transparent;-webkit-transition:background-color .3s;-moz-transition:background-color .3s;transition:background-color .3s} +.book .cover:hover a{box-shadow:initial} .book .cover:hover .book-link{background-color:rgba(0,0,0,0.65)} .book .cover:hover .add-note{display:block;bottom:.7em;opacity:1} .book .cover:hover .notes-count{top:0;opacity:1} @@ -133,14 +136,16 @@ li.book{margin:1em} .ng-view.pushed .main{top:60px} #one-book h1 a{color:#000;text-decoration:none} .cubic-view{float:left} -.main{margin-left:310px;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);transform:translateZ(0)} -header h2,header .order{display:inline-block} -header .order{position:relative;left:3em} -header .utils{padding:.8em 0;} -header .utils .button-primary{border-radius:.3em;margin-right:1em;background:#aaa;border-color:#aaa;-webkit-transition:all .3s;-moz-transition:all .3s;transition:all .3s;} -header .utils .button-primary:hover{background:#20b2aa;border-color:#20b2aa} -header .title{font-size:.8em;line-height:1.25;margin-left:1em;font-family:Hiragino Sans GB,STHeiti,Microsoft Yahei,sans-serif;} -header .title a{color:#fff} +.main{margin-left:310px;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);transform:translateZ(0);} +.main header{padding-bottom:1em;border-bottom:1px solid #eee;margin-bottom:1em;} +.main header span{color:#999;margin-right:1em;font-size:12px} +.main header .button-default{color:#000;border-radius:3px;margin-right:1em} +.main header .order{display:inline-block} +.main header .button-primary{display:inline-block;border-radius:2px;margin-right:.5em;background:#aaa;border:none;border-bottom:3px solid #777;-webkit-transition:all .3s;-moz-transition:all .3s;transition:all .3s;} +.main header .button-primary:before{vertical-align:middle} +.main header .button-primary:hover{background:#20b2aa;border-radius:2px;border-color:#12837d} +.main header [class*="icon-"]:before{margin-right:.5em} +.main header .right-actions{float:right;margin-top:.2em;margin-bottom:1em} .book-large{display:inline-block;box-shadow:10px 4px 5px rgba(0,0,0,0.08),-10px 20px 12px rgba(0,0,0,0.15);position:relative;font-size:0;} .book-large:before{content:"";position:absolute;top:1px;bottom:1px;left:1%;width:1px;box-shadow:10px 0 6px #111} .book-large img{position:relative;z-index:-1} @@ -170,7 +175,7 @@ header .title a{color:#fff} .book-cube .book-left .book-title{-webkit-writing-mode:vertical-rl;width:40px;line-height:40px;font-size:1.8em;height:calc(400px - 2em);overflow:hidden;position:relative;top:1em} .book-cube .book-page{width:300px;height:400px;background:#fff;text-align:center;-webkit-transform:translate3d(0,0,19px);-moz-transform:translate3d(0,0,19px);transform:translate3d(0,0,19px);background:#f1f1f1;} .book-cube .book-page .page-content{opacity:0;position:relative;top:50%;left:50%;width:50%;-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transition:opacity 1s;-moz-transition:opacity 1s;transition:opacity 1s;} -.book-cube .book-page .page-content .summary{color:#666;margin:0 -2em 1em;text-align:justify} +.book-cube .book-page .page-content .summary{color:#666;margin:0 -2em 1em;text-align:left;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical} .book-cube .book-page a{display:block;color:#666;padding:.8em 1.2em;text-decoration:none;margin-bottom:1em;-webkit-transition:all .5s;-moz-transition:all .5s;transition:all .5s;border-radius:3px;} .book-cube .book-page a:hover{color:#fff;background:#222} .book-cube .book-left .book-title{opacity:1;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;transition:opacity 1s} @@ -210,6 +215,7 @@ ul.notes{padding:0} .icon-star-empty:before{content:"\e61e"} .icon-plus:before{content:"\e61f"} .icon-export:before{content:"\e620"} +.icon-edit:before{content:"\e621";vertical-align:middle} ul.notes{margin:0 -.8em} .note{display:inline-block;vertical-align:top;border-radius:.2em;width:calc(33% - 1.6em * 4 / 3);min-width:260px;margin:.8em;box-shadow:0 0 3px #aaa;background:-webkit-gradient(linear,0 0,0 100%,from(#d9eaf3),color-stop(4%,#fcfcfc)) 0 .3em;background:-webkit-linear-gradient(top,#d9eaf3 0%,#fcfcfc 8%) 0 .3em;background:-moz-linear-gradient(top,#d9eaf3 0%,#fcfcfc 8%) 0 .3em;background:-ms-linear-gradient(top,#d9eaf3 0%,#fcfcfc 8%) 0 .3em;background:-o-linear-gradient(top,#d9eaf3 0%,#fcfcfc 8%) 0 .3em;background:linear-gradient(top,#d9eaf3 0%,#fcfcfc 8%) 0 .3em;background-size:100% 20px;position:relative;} .note:before{content:'';position:absolute;width:4px;top:0;left:1.1em;bottom:0;border:1px solid;border-color:transparent #efe4e4} @@ -245,7 +251,7 @@ ul.notes{margin:0 -.8em} pre{background:transparent} code.hljs{background:transparent} .global_note .ng-view{margin-top:0;padding-top:50px} -#one-note{margin:3em 0;} +#one-note{margin:3em 0;word-wrap:break-word;} #one-note pre{background:#eee;white-space:pre-wrap} #one-note .content{margin-bottom:40px;-webkit-user-select:text;user-select:text} #one-note .share{margin-bottom:60px} @@ -300,6 +306,9 @@ html.global_editor .ng-view{overflow:hidden;width:calc(100% - 64px);margin-top:0 #title,#page{display:block} #title{font-size:2em;font-weight:bold;margin-bottom:1em;width:100%;box-sizing:border-box} #page{font-size:1.1em;margin-bottom:2em;color:#808080} +#privacy{color:#808080;} +#privacy input{margin-right:.5em} +#privacy label{margin-right:1em} #page_no{line-height:1.65;color:#808080;vertical-align:baseline;min-width:12em} .warning{background:rgba(240,72,72,0.8);color:#fff;padding:.2em .8em;border-radius:3px;display:inline-block;opacity:1;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;transition:opacity .2s;} .warning.right{-webkit-transform:translateX(-105%);-moz-transform:translateX(-105%);transform:translateX(-105%)} diff --git a/public/fonts/icomoon.eot b/public/fonts/icomoon.eot index 34d6d46..73b6ec4 100644 Binary files a/public/fonts/icomoon.eot and b/public/fonts/icomoon.eot differ diff --git a/public/fonts/icomoon.json b/public/fonts/icomoon.json index a1bdddc..fe73781 100644 --- a/public/fonts/icomoon.json +++ b/public/fonts/icomoon.json @@ -1,7 +1,7 @@ { "metadata": { "name": "icomoon", - "iconsHash": -2097918904 + "iconsHash": -162555413 }, "height": 1024, "prevSize": 32, @@ -11,32 +11,28 @@ "M887.757 207.77c0-58.88-88.678-65.434-88.678-65.434l-208.333-13.107c0 0-4.454-56.73-46.592-76.39-42.086-19.61-88.371-13.67-121.6-13.312s-41.165 42.803-41.165 82.842 0.768 86.118 0.768 115.2c0 52.019-22.886 74.189-80.179 74.189h-118.118c-33.024-2.15-58.778 3.277-58.778 30.003 0 26.675 38.912 254.566 92.262 307.149 30.976 30.515 220.365 51.917 260.25 51.917s26.624-117.811 37.683-117.811 23.296 66.56 86.118 82.125c62.822 15.667 146.688 12.749 151.142 57.446 5.786 58.982 11.059 135.322-27.75 140.749l-87.808 3.482c-60.211-4.352-44.083-70.093-17.51-70.093s39.885-1.075 39.885-1.075l3.328-71.987c0 0-137.882-16.282-143.77 76.749-5.325 84.992 9.267 125.082 19.968 133.786 10.752 8.806 29.286 25.805 198.144 25.805 237.926 0 150.733-693.402 150.733-752.23zM790.528 515.635c-9.318 9.933-43.11-16.435-75.366-16.435-32.307 0-67.174 17.101-75.366 5.888-8.141-11.264 7.526-101.99 68.352-101.99s91.75 102.554 82.381 112.538zM297.114 200.499c0-11.622 3.021-152.781 3.021-152.781l-179.507 176.077c0 0 124.006 0 148.326 0 24.422 0 28.16-11.622 28.16-23.296z" ], "defaultCode": 58880, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M776.806 89.6h-572.006c-56.32 0-102.4 46.080-102.4 102.4v614.4c0 56.32 46.080 102.4 102.4 102.4h614.4c56.32 0 102.4-46.080 102.4-102.4v-556.698l-144.794-160.102zM716.8 396.8c0 28.16-23.040 51.2-51.2 51.2h-307.2c-28.16 0-51.2-23.040-51.2-51.2v-256h409.6v256zM665.6 192h-102.4v204.8h102.4v-204.8z" ], "defaultCode": 58881, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M809.011 396.902h-92.211v-71.68c0-148.326-68.301-235.52-204.8-235.52-136.448 0-204.8 87.194-204.8 235.52v71.68h-102.4c-28.262 0-51.2 33.126-51.2 61.44v399.36c0 28.16 21.965 58.317 48.742 66.918l61.235 19.814c26.778 8.653 71.731 15.718 99.942 15.718h296.96c28.16 0 73.165-7.066 99.942-15.718l61.235-19.814c26.829-8.602 48.742-38.758 48.742-66.918v-399.36c0-28.314-33.126-61.44-61.389-61.44zM409.6 304.742c0-73.984 40.858-112.64 102.4-112.64 61.594 0 102.4 38.656 102.4 112.64v92.16h-204.8v-92.16z" ], "defaultCode": 58882, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M217.805 999.014c15.667-51.251 39.424-123.443 71.219-227.891 138.547-22.374 195.891 17.869 283.904-142.541-71.424 22.323-157.542-41.421-152.883-69.018 4.608-27.648 200.346 19.917 328.448-165.786-161.485 36.301-213.197-43.674-192.358-55.757 48.077-27.904 190.822-11.571 266.906-87.194 39.219-38.912 57.549-133.581 41.626-167.373-19.2-40.755-136.038-101.581-200.448-95.898-64.41 5.734-165.427 250.317-195.379 248.371s-35.942-109.517 16.333-209.562c-55.142 24.883-156.16 102.349-187.853 168.55-59.034 123.187 5.53 405.658-15.155 415.744-20.736 10.035-90.419-129.69-111.206-193.024-28.416 97.075-29.082 194.355 53.965 323.584-31.334 84.787-48.435 182.374-51.046 231.987-1.229 39.731 37.018 48.23 43.93 25.805z" ], "defaultCode": 58883, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ @@ -53,25 +49,21 @@ "M272.384 197.325c-195.686 113.562-184.422 298.496-177.664 366.899 252.774-299.366 630.835-284.826 630.835-284.826s-535.962 183.757-693.402 552.397c-12.39 29.184 58.368 67.021 74.496 32.614 48.179-102.502 115.354-179.405 115.354-179.405 99.123 36.915 270.49 80.077 392.038-5.376 161.331-113.613 144.845-365.363 375.245-487.936 53.811-28.672-451.584-148.326-716.902 5.632z" ], "defaultCode": 58885, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ - "M507.424 676.576l66.272-66.272-86.848-86.848-66.272 66.272v32h54.848v54.848h32zM758.848 265.152q-9.152-9.152-18.848 0.576l-200 200q-9.728 9.728-0.576 18.848t18.848-0.576l200-200q9.728-9.728 0.576-18.848zM804.576 604.576v108.576q0 68-48.288 116.288t-116.288 48.288h-475.424q-68 0-116.288-48.288t-48.288-116.288v-475.424q0-68 48.288-116.288t116.288-48.288h475.424q36 0 66.848 14.272 8.576 4 10.272 13.152 1.728 9.728-5.152 16.576l-28 28q-8 8-18.272 4.576-13.152-3.424-25.728-3.424h-475.424q-37.728 0-64.576 26.848t-26.848 64.576v475.424q0 37.728 26.848 64.576t64.576 26.848h475.424q37.728 0 64.576-26.848t26.848-64.576v-72q0-7.424 5.152-12.576l36.576-36.576q8.576-8.576 20-4t11.424 16.576zM749.728 182.848l164.576 164.576-384 384h-164.576v-164.576zM1003.424 258.272l-52.576 52.576-164.576-164.576 52.576-52.576q16-16 38.848-16t38.848 16l86.848 86.848q16 16 16 38.848t-16 38.848z" + "M960.004 288.006l-223.998-223.998 64-64 223.998 223.998zM896 352l-32 352c-288 0-704 320-704 320l-53.13-53.13 273.664-273.664c10.974 4.368 22.934 6.794 35.466 6.794 53.020 0 96-42.98 96-96 0-53.020-42.98-96-96-96-53.020 0-96 42.98-96 96 0 12.532 2.426 24.49 6.794 35.466l-273.664 273.664-53.13-53.13c0 0 320-416 320-704l352-32 224 224z" ], - "grid": 0, - "tags": [ - "edit" - ] + "defaultCode": 58886, + "grid": 0 }, { "paths": [ "M1024 397.050l-353.78-51.408-158.22-320.582-158.216 320.582-353.784 51.408 256 249.538-60.432 352.352 316.432-166.358 316.432 166.358-60.434-352.352 256.002-249.538z" ], "defaultCode": 58887, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ @@ -79,216 +71,199 @@ ], "width": 951, "defaultCode": 58888, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M876.8 354.458l-104.755-288.563c-7.731-21.299-30.464-32.563-50.637-25.19l-696.166 254.106c-20.224 7.322-30.413 30.566-22.682 51.866l110.438 304.23v-163.072c0-73.574 58.778-133.376 131.123-133.376h183.962l219.392-154.010 126.976 154.010h102.349zM984.986 446.822h-740.864c-21.504 0-39.014 18.381-39.014 41.062v482.355c0 22.63 17.459 41.062 39.014 41.062h740.864c21.555 0 39.014-18.381 39.014-41.062v-482.406c0-22.63-17.459-41.011-39.014-41.011zM928.461 908.646h-614.144v-88.013l94.464-219.904 141.773 175.974 132.966-136.294 170.957-61.696 73.984 164.966v164.966z" ], "defaultCode": 58889, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M512 192c-223.318 0-416.882 130.042-512 320 95.118 189.958 288.682 320 512 320 223.314 0 416.878-130.042 512-320-95.116-189.958-288.686-320-512-320zM764.45 361.704c60.162 38.374 111.142 89.774 149.434 150.296-38.292 60.522-89.274 111.922-149.436 150.298-75.594 48.216-162.89 73.702-252.448 73.702-89.56 0-176.856-25.486-252.45-73.704-60.16-38.372-111.14-89.772-149.434-150.296 38.292-60.524 89.274-111.924 149.434-150.296 3.918-2.5 7.876-4.922 11.858-7.3-9.958 27.328-15.408 56.822-15.408 87.596 0 141.384 114.616 256 256 256s256-114.616 256-256c0-30.774-5.45-60.268-15.408-87.598 3.98 2.378 7.938 4.802 11.858 7.302zM512 410c0 53.020-42.98 96-96 96s-96-42.98-96-96 42.98-96 96-96 96 42.98 96 96z" ], "defaultCode": 58890, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M995.828 995.828c-37.566 37.562-98.452 37.562-136.016 0l-169.726-169.728c-69.778 44.732-152.262 71.436-241.32 71.436-247.83 0-448.766-200.908-448.766-448.768s200.936-448.768 448.766-448.768c247.862 0 448.768 200.906 448.768 448.768 0 89.058-26.704 171.542-71.436 241.35l169.728 169.696c37.564 37.564 37.564 98.448 0.002 136.014zM448.766 128.22c-177.022 0-320.548 143.526-320.548 320.548 0 177.052 143.526 320.548 320.548 320.548 177.054 0 320.548-143.496 320.548-320.548 0-177.022-143.494-320.548-320.548-320.548zM512.876 641.096h-128.218v-128.218h-128.218v-128.218h128.218v-128.22h128.218v128.22h128.22v128.218h-128.22v128.218z" ], "defaultCode": 58891, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M995.828 859.812l-169.728-169.696c44.732-69.806 71.436-152.292 71.436-241.35 0-247.86-200.908-448.766-448.77-448.766-247.83 0-448.766 200.906-448.766 448.768s200.936 448.768 448.766 448.768c89.058 0 171.542-26.704 241.32-71.436l169.726 169.728c37.564 37.562 98.45 37.562 136.016 0 37.562-37.566 37.562-98.45 0-136.016zM448.766 769.316c-177.022 0-320.548-143.496-320.548-320.548 0-177.022 143.526-320.548 320.548-320.548 177.054 0 320.548 143.526 320.548 320.548 0 177.052-143.494 320.548-320.548 320.548zM256.438 512.876h384.658v-128.218h-384.658v128.218z" ], "defaultCode": 58892, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M953.396 74.642l-4.028-4.042c-94.148-94.134-248.194-94.134-342.326 0l-218.106 218.136c-94.134 94.132-94.134 248.176 0 342.31l4.026 4.026c7.832 7.848 16.146 14.924 24.736 21.458l79.848-79.85c-9.302-5.494-18.126-12.072-26.116-20.060l-4.042-4.042c-51.114-51.098-51.114-134.272 0-185.39l218.128-218.112c51.116-51.118 134.274-51.118 185.386 0l4.042 4.024c51.1 51.116 51.1 134.292 0 185.39l-98.686 98.686c17.132 42.308 25.248 87.4 24.538 132.386l152.604-152.604c94.134-94.136 94.134-248.178-0.004-342.316zM631.042 388.934c-7.832-7.832-16.146-14.922-24.736-21.44l-79.848 79.832c9.304 5.496 18.126 12.074 26.116 20.062l4.042 4.040c51.116 51.116 51.116 134.272 0 185.388l-218.13 218.134c-51.118 51.102-134.276 51.102-185.388 0l-4.042-4.042c-51.098-51.12-51.098-134.276 0-185.388l98.688-98.686c-17.134-42.306-25.246-87.402-24.538-132.386l-152.602 152.598c-94.136 94.132-94.136 248.178 0 342.324l4.026 4.032c94.152 94.128 248.192 94.128 342.328 0l218.11-218.118c94.134-94.132 94.134-248.194 0-342.326l-4.026-4.024z" ], "defaultCode": 58893, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M512 1024c282.77 0 512-229.23 512-512s-229.23-512-512-512-512 229.23-512 512 229.23 512 512 512zM512 96c229.75 0 416 186.25 416 416s-186.25 416-416 416-416-186.25-416-416 186.25-416 416-416zM800 256c17.6 0 32 14.4 32 32v96c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64h-128c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64v-96c0-17.6 14.4-32 32-32h192c17.6 0 32 14.4 32 32v32h128v-32c0-17.6 14.4-32 32-32h192zM512 768c93.208 0 174.772-49.818 219.546-124.278l54.88 32.934c-55.966 93.070-157.916 155.344-274.426 155.344-48.458 0-94.384-10.796-135.54-30.082l33.162-55.278c31.354 13.714 65.964 21.36 102.378 21.36z" ], "defaultCode": 58894, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M384 832h640v128h-640zM384 448h640v128h-640zM384 64h640v128h-640zM192 0v256h-64v-192h-64v-64zM128 526v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM256 704v320h-192v-64h128v-64h-128v-64h128v-64h-128v-64z" ], "defaultCode": 58895, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M512 1024c282.77 0 512-229.23 512-512s-229.23-512-512-512-512 229.23-512 512 229.23 512 512 512zM512 96c229.75 0 416 186.25 416 416s-186.25 416-416 416-416-186.25-416-416 186.25-416 416-416zM256 320c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64zM640 320c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64zM319.902 780.74l-82.328-49.396c55.962-93.070 157.916-155.344 274.426-155.344 116.508 0 218.462 62.274 274.426 155.344l-82.328 49.396c-39.174-65.148-110.542-108.74-192.098-108.74-81.558 0-152.924 43.592-192.098 108.74z" ], "defaultCode": 58896, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M512 0c-282.77 0-512 229.23-512 512s229.226 512 512 512c282.77 0 512-229.23 512-512s-229.23-512-512-512zM512 832c-48.458 0-94.384-10.796-135.542-30.082l33.162-55.276c31.356 13.712 65.966 21.358 102.38 21.358 93.208 0 174.772-49.818 219.542-124.278l54.882 32.934c-55.964 93.070-157.914 155.344-274.424 155.344zM832 384c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64h-128c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64v-96c0-17.6 14.4-32 32-32h192c17.6 0 32 14.4 32 32v32h128v-32c0-17.6 14.4-32 32-32h192c17.6 0 32 14.4 32 32v96z" ], "defaultCode": 58897, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M512 0c-282.77 0-512 229.23-512 512s229.23 512 512 512 512-229.23 512-512-229.23-512-512-512zM704 256c35.346 0 64 28.654 64 64s-28.654 64-64 64-64-28.654-64-64 28.654-64 64-64zM320 256c35.346 0 64 28.654 64 64s-28.654 64-64 64-64-28.654-64-64 28.654-64 64-64zM704.098 780.74c-39.174-65.148-110.544-108.74-192.098-108.74-81.556 0-152.924 43.592-192.098 108.74l-82.328-49.396c55.96-93.070 157.916-155.344 274.426-155.344 116.508 0 218.464 62.274 274.426 155.344l-82.328 49.396z" ], "defaultCode": 58898, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M1024 512c-1.278-66.862-15.784-133.516-42.576-194.462-26.704-61-65.462-116.258-113.042-161.92-47.552-45.696-103.944-81.82-164.984-105.652-61.004-23.924-126.596-35.352-191.398-33.966-64.81 1.282-129.332 15.374-188.334 41.356-59.048 25.896-112.542 63.47-156.734 109.576-44.224 46.082-79.16 100.708-102.186 159.798-23.114 59.062-34.128 122.52-32.746 185.27 1.286 62.76 14.964 125.148 40.134 182.206 25.088 57.1 61.476 108.828 106.11 151.548 44.61 42.754 97.472 76.504 154.614 98.72 57.118 22.304 118.446 32.902 179.142 31.526 60.708-1.29 120.962-14.554 176.076-38.914 55.15-24.282 105.116-59.48 146.366-102.644 41.282-43.14 73.844-94.236 95.254-149.43 13.034-33.458 21.88-68.4 26.542-103.798 1.246 0.072 2.498 0.12 3.762 0.12 35.346 0 64-28.652 64-64 0-1.796-0.094-3.572-0.238-5.332h0.238zM922.306 681.948c-23.472 53.202-57.484 101.4-99.178 141.18-41.67 39.81-91 71.186-144.244 91.79-53.228 20.678-110.29 30.452-166.884 29.082-56.604-1.298-112.596-13.736-163.82-36.474-51.25-22.666-97.684-55.49-135.994-95.712-38.338-40.198-68.528-87.764-88.322-139.058-19.87-51.284-29.228-106.214-27.864-160.756 1.302-54.552 13.328-108.412 35.254-157.69 21.858-49.3 53.498-93.97 92.246-130.81 38.73-36.868 84.53-65.87 133.874-84.856 49.338-19.060 102.136-28.006 154.626-26.644 52.5 1.306 104.228 12.918 151.562 34.034 47.352 21.050 90.256 51.502 125.624 88.782 35.396 37.258 63.21 81.294 81.39 128.688 18.248 47.392 26.782 98.058 25.424 148.496h0.238c-0.144 1.76-0.238 3.536-0.238 5.332 0 33.012 24.992 60.174 57.086 63.624-6.224 34.822-16.53 68.818-30.78 100.992z" ], "defaultCode": 58899, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M707.88 484.652c37.498-44.542 60.12-102.008 60.12-164.652 0-141.16-114.842-256-256-256h-320v896h384c141.158 0 256-114.842 256-256 0-92.956-49.798-174.496-124.12-219.348zM384 192h101.5c55.968 0 101.5 57.42 101.5 128s-45.532 128-101.5 128h-101.5v-256zM543 832h-159v-256h159c58.45 0 106 57.42 106 128s-47.55 128-106 128z" ], "defaultCode": 58900, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M896 64v64h-128l-320 768h128v64h-448v-64h128l320-768h-128v-64z" ], "defaultCode": 58901, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M896 192h-768v640h768v-640zM1024 64v0 896h-1024v-896h1024zM832 768h-640v-128l192-320 263 320 185-128v64zM640 352c0-53.019 42.981-96 96-96s96 42.981 96 96c0 53.019-42.981 96-96 96-53.019 0-96-42.981-96-96z" ], "defaultCode": 58902, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M1024 896v-384h-256c0-141.12 114.752-256 256-256v-128c-211.744 0-384 172.256-384 384v384h384zM384 896v-384h-256c0-141.12 114.752-256 256-256v-128c-211.744 0-384 172.256-384 384v384h384z" ], "defaultCode": 58903, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M512 0c-282.77 0-512 229.23-512 512s229.23 512 512 512 512-229.23 512-512-229.23-512-512-512zM512 928c-229.75 0-416-186.25-416-416s186.25-416 416-416 416 186.25 416 416-186.25 416-416 416zM448 256h128v128h-128zM640 768h-256v-64h64v-192h-64v-64h192v256h64z" ], "defaultCode": 58904, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M384 64h640v128h-640v-128zM384 448h640v128h-640v-128zM384 832h640v128h-640v-128zM0 128c0-70.692 57.308-128 128-128s128 57.308 128 128c0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 512c0-70.692 57.308-128 128-128s128 57.308 128 128c0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 896c0-70.692 57.308-128 128-128s128 57.308 128 128c0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128z" ], "defaultCode": 58905, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M1024 777.143v73.143q0 14.857-10.857 25.714t-25.714 10.857h-950.857q-14.857 0-25.714-10.857t-10.857-25.714v-73.143q0-14.857 10.857-25.714t25.714-10.857h950.857q14.857 0 25.714 10.857t10.857 25.714zM1024 557.714v73.143q0 14.857-10.857 25.714t-25.714 10.857h-950.857q-14.857 0-25.714-10.857t-10.857-25.714v-73.143q0-14.857 10.857-25.714t25.714-10.857h950.857q14.857 0 25.714 10.857t10.857 25.714zM1024 338.286v73.143q0 14.857-10.857 25.714t-25.714 10.857h-950.857q-14.857 0-25.714-10.857t-10.857-25.714v-73.143q0-14.857 10.857-25.714t25.714-10.857h950.857q14.857 0 25.714 10.857t10.857 25.714zM1024 118.857v73.143q0 14.857-10.857 25.714t-25.714 10.857h-950.857q-14.857 0-25.714-10.857t-10.857-25.714v-73.143q0-14.857 10.857-25.714t25.714-10.857h950.857q14.857 0 25.714 10.857t10.857 25.714z" ], "defaultCode": 58906, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M505.754 28.211c-260.147 3.482-468.224 217.19-464.742 477.338 3.482 259.994 217.19 468.122 477.338 464.64 260.045-3.482 468.173-217.19 464.64-477.338-3.43-260.045-217.139-468.122-477.235-464.64zM504.371 785.92h-2.611c-40.038-1.178-68.301-30.72-67.174-70.195 1.126-38.758 30.054-66.97 68.813-66.97l2.355 0.051c41.165 1.229 69.12 30.464 67.891 71.066-1.126 38.861-29.645 66.048-69.274 66.048zM672.87 451.482c-9.472 13.363-30.157 30.003-56.269 50.33l-28.774 19.866c-15.77 12.288-25.293 23.808-28.826 35.123-2.867 9.011-4.198 11.315-4.454 29.491l-0.051 4.659h-109.722l0.307-9.318c1.331-38.195 2.304-60.621 18.125-79.206 24.832-29.133 79.616-64.41 81.92-65.894 7.834-5.939 14.438-12.646 19.405-19.814 11.52-15.872 16.589-28.416 16.589-40.653 0-17.050-5.069-32.819-15.053-46.848-9.626-13.568-27.904-20.429-54.323-20.429-26.214 0-44.134 8.346-54.886 25.395-11.11 17.562-16.64 35.942-16.64 54.784v4.71h-113.152l0.205-4.915c2.918-69.325 27.648-119.194 73.523-148.326 28.774-18.586 64.614-27.955 106.394-27.955 54.733 0 101.018 13.312 137.37 39.526 36.864 26.573 55.552 66.406 55.552 118.323 0 29.082-9.165 56.371-27.238 81.152z" ], "defaultCode": 58907, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M786.752 877.248l146.752 146.752 90.496-90.496-146.752-146.752 146.752-146.752h-384v384zM0 384h384v-384l-146.752 146.752-145.248-145.376-90.496 90.496 145.248 145.376zM0 933.504l90.496 90.496 146.752-146.752 146.752 146.752v-384h-384l146.752 146.752zM640 384h384l-146.752-146.752 145.504-145.376-90.496-90.496-145.504 145.376-146.752-146.752z" ], "defaultCode": 58908, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M877.248 786.752l-146.752-146.752-90.496 90.496 146.752 146.752-146.752 146.752h384v-384zM384 0h-384v384l146.752-146.752 145.376 145.248 90.496-90.496-145.376-145.248zM384 730.496l-90.496-90.496-146.752 146.752-146.752-146.752v384h384l-146.752-146.752zM1024 0h-384l146.752 146.752-145.376 145.248 90.496 90.496 145.376-145.248 146.752 146.752z" ], "defaultCode": 58909, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ "M1024 397.050l-353.78-51.408-158.22-320.582-158.216 320.582-353.784 51.408 256 249.538-60.432 352.352 316.432-166.358 316.432 166.358-60.434-352.352 256.002-249.538zM512 753.498l-223.462 117.48 42.676-248.83-180.786-176.222 249.84-36.304 111.732-226.396 111.736 226.396 249.836 36.304-180.788 176.222 42.678 248.83-223.462-117.48z" ], "defaultCode": 58910, - "grid": 0, - "matchesSearch": false + "grid": 0 }, { "paths": [ - "M992 384h-352v-352c0-17.664-14.336-32-32-32h-192c-17.664 0-32 14.336-32 32v352h-352c-17.664 0-32 14.336-32 32v192c0 17.664 14.336 32 32 32h352v352c0 17.664 14.336 32 32 32h192c17.664 0 32-14.336 32-32v-352h352c17.664 0 32-14.336 32-32v-192c0-17.664-14.336-32-32-32z" + "M992 384h-352v-352c0-17.672-14.328-32-32-32h-192c-17.672 0-32 14.328-32 32v352h-352c-17.672 0-32 14.328-32 32v192c0 17.672 14.328 32 32 32h352v352c0 17.672 14.328 32 32 32h192c17.672 0 32-14.328 32-32v-352h352c17.672 0 32-14.328 32-32v-192c0-17.672-14.328-32-32-32z" + ], + "defaultCode": 58911, + "grid": 0 + }, + { + "paths": [ + "M768 796.16h-665.6v-460.8h132.864c0 0 35.277-45.875 111.104-102.4h-295.168c-28.262 0-51.2 22.938-51.2 51.2v563.2c0 28.314 22.938 51.2 51.2 51.2h768c28.314 0 51.2-22.886 51.2-51.2v-191.795l-102.4 84.224v56.371zM684.134 440.32v181.76l339.866-266.291-339.866-255.949v160.256c-412.774 0.051-412.774 408.064-412.774 408.064 116.838-191.898 188.723-227.84 412.774-227.84z" + ], + "defaultCode": 58912, + "grid": 0 + }, + { + "paths": [ + "M507.424 676.576l66.272-66.272-86.848-86.848-66.272 66.272v32h54.848v54.848h32zM758.848 265.152q-9.152-9.152-18.848 0.576l-200 200q-9.728 9.728-0.576 18.848t18.848-0.576l200-200q9.728-9.728 0.576-18.848zM804.576 604.576v108.576q0 68-48.288 116.288t-116.288 48.288h-475.424q-68 0-116.288-48.288t-48.288-116.288v-475.424q0-68 48.288-116.288t116.288-48.288h475.424q36 0 66.848 14.272 8.576 4 10.272 13.152 1.728 9.728-5.152 16.576l-28 28q-8 8-18.272 4.576-13.152-3.424-25.728-3.424h-475.424q-37.728 0-64.576 26.848t-26.848 64.576v475.424q0 37.728 26.848 64.576t64.576 26.848h475.424q37.728 0 64.576-26.848t26.848-64.576v-72q0-7.424 5.152-12.576l36.576-36.576q8.576-8.576 20-4t11.424 16.576zM749.728 182.848l164.576 164.576-384 384h-164.576v-164.576zM1003.424 258.272l-52.576 52.576-164.576-164.576 52.576-52.576q16-16 38.848-16t38.848 16l86.848 86.848q16 16 16 38.848t-16 38.848z" ], "grid": 0, "tags": [ - "plus" - ], - "defaultCode": 58911 + "edit" + ] } ], "preferences": { "showGlyphs": true, "showQuickUse": true, "fontPref": { - "prefix": "arkicon-", + "prefix": "icon-", "metadata": { - "fontFamily": "", - "majorVersion": 1, - "minorVersion": 0 + "fontFamily": "icomoon" }, "metrics": { "emSize": 512, "baseline": 6.25, "whitespace": 50 - }, - "resetPoint": 58880, - "ie7": false, - "showMetrics": true, - "showMetadata": true, - "includeMetadata": false + } }, "imagePref": { "color": 0, @@ -297,10 +272,7 @@ "margin": 16 }, "historySize": 100, - "showCodes": true, - "gridSize": 16, - "showGrid": false, - "showLiga": false + "showCodes": true }, "IcoMoonType": "icon-set" } \ No newline at end of file diff --git a/public/fonts/icomoon.svg b/public/fonts/icomoon.svg index 0975725..90bff35 100644 --- a/public/fonts/icomoon.svg +++ b/public/fonts/icomoon.svg @@ -3,41 +3,42 @@ \ No newline at end of file diff --git a/public/fonts/icomoon.ttf b/public/fonts/icomoon.ttf index e97b70f..dd391e8 100644 Binary files a/public/fonts/icomoon.ttf and b/public/fonts/icomoon.ttf differ diff --git a/public/fonts/icomoon.woff b/public/fonts/icomoon.woff index 20b5e7b..dd0939c 100644 Binary files a/public/fonts/icomoon.woff and b/public/fonts/icomoon.woff differ diff --git a/public/js/controllers.min.js b/public/js/controllers.min.js index c59b530..ef84097 100644 --- a/public/js/controllers.min.js +++ b/public/js/controllers.min.js @@ -1 +1 @@ -var annoCtrl=angular.module("ANNO.controllers",["infinite-scroll"]);annoCtrl.controller("LoginCtrl",["$scope","$window","AuthService",function($scope,$window,AuthService){$scope.reload=function(){$window.location.href="/auth"},$scope.getToken=AuthService.auth}]),annoCtrl.controller("appFrameCtrl",["$scope","$rootScope","$location","$modal","$compile","UserService",function($scope,$rootScope,$location,$modal,$compile,UserService){$scope.asideVisible=0,$scope.toggleSidebar=function(){$scope.asideVisible^=1},$scope.$on("$routeChangeStart",function(){$scope.lastBook=null,$scope.globalTitle=""}),$scope.$on("nav:lastBook",function(e,author,book){$scope.author=author,$scope.lastBook=book}),$scope.$on("page:change",function(e,mode,title){$scope.headerInvisible="note"==mode||"editor"==mode,$scope.globalCSSClass="global_"+mode,$scope.globalTitle=title||""}),$scope.logout=function(){$modal.open({templateUrl:"modalLogout.html",controller:function($scope,$modalInstance){$scope.ok=function(){UserService.logout(function(){$location.path("/login"),$modalInstance.close()})},$scope.cancel=function(){$modalInstance.dismiss("cancel")}}})}}]),annoCtrl.controller("BooksCtrl",["$scope","$routeParams","$modal","$timeout","UserService","SerializeService",function($scope,$routeParams,$modal,$timeout,UserService,SerializeService){var uid=$routeParams.uid;UserService.getUser(uid).then(function(user){$scope.user=user,$scope.$emit("page:change","books",(user.name||"我")+"的书架"),SerializeService.fetchAllBooks(user.id).then(function(books){$scope.books=books,$scope.tipVisible=!user.is_self&&_.isEmpty(books)}),$scope.searchBook=function(){$modal.open({templateUrl:"modalSearchBook.html",controller:"SearchBookCtrl",resolve:{user:function(){return user}}}).opened.then(function(){$timeout(function(){var firstInput=$('.modal-dialog input[type="text"]');firstInput.length&&firstInput[0].focus()},50)})}})}]).controller("SearchBookCtrl",["$scope","$modalInstance","$location","$http","BookService","user",function($scope,$modalInstance,$location,$http,BookService,user){$scope.searchBook=function(query){query.match(/^\d{8}$/)?BookService.get(query).then(function(book){$scope.selectedIndex=0,$scope.selectedBook=book,$scope.books=[book]}):$http.get("/api/v2/book/search",{params:{q:query}}).success(function(res){$scope.books=res.books,res.books.length&&($scope.selectedIndex=0,$scope.selectedBook=res.books[0])}),$scope.has_searched=!0},$scope.selectBook=function($index,book){$scope.selectedIndex=$index,$scope.selectedBook=book},$scope.ok=function(bid){$location.path("/"+user.uid+"/book/"+bid+"/new"),$modalInstance.close()},$scope.cancel=function(){$modalInstance.dismiss("cancel")}}]),annoCtrl.controller("BookCtrl",["$scope","$routeParams","$modal","$timeout","UserService","SerializeService","TranslateService","FileSystemService",function($scope,$routeParams,$modal,$timeout,UserService,SerializeService,TranslateService,FileSystemService){var uid=$routeParams.uid,bid=$routeParams.bid;UserService.login().then(function(user){$scope.user=user}),UserService.getUser(uid).then(function(user){$scope.dominateColor={background:"#fff",foreground:"#000"},$scope.author=user,SerializeService.fetchBook(user.id,bid).then(function(book){$scope.$emit("page:change","book",(user.name?''+user.name+"的书架 ❯ ":"")+book.title),$scope.book=book,$scope.order="time",$scope.reverse=!0,$scope.book_cover=book.images.large}),$scope.book_opened=0,$scope.openBook=function(){$scope.book_opened=1},$scope.closeBook=function(){$scope.book_opened=0},$scope.book_sided=!1,$scope.$watch("dominateColor",function(colors){"#fff"!=colors.background&&($scope.book_sided=!0)}),$scope.exportNotes=function(){SerializeService.fetchBook(user.id,bid).then(function(book){var exports;exports=book.notes.map(function(note){return(note.chapter?"#"+note.chapter+"\n\n":"")+TranslateService.doubanToMarkdown(note.content,note.photos)}).join("\n\n-----\n\n");$modal.open({templateUrl:"modalExport.html",controller:function($scope,$modalInstance){$scope.download=function(){if("markdown"==$scope.exportFormat){var blob=new Blob([exports],{type:"text/plain;charset=utf-8"});FileSystemService.save(blob,book.title,"md",function(is_saved){is_saved&&$modalInstance.close()})}else if("html"==$scope.exportFormat){var blob=new Blob([angular.element(document.querySelector(".preview-html")).html()],{type:"text/html;charset=utf-8"});FileSystemService.save(blob,book.title,"html",function(is_saved){is_saved&&$modalInstance.close()})}},$scope.cancel=function(){$modalInstance.dismiss("cancel")},$scope.exports=exports,$scope.exportFormat="markdown",$scope.changeExportFormat=function(mode){$scope.exportFormat=mode},$scope.popupEvernote=function(){$modal.open({templateUrl:"modalEvernote.html",controller:"EvernoteCtrl",resolve:{title:function(){return book.title}},windowClass:"mask-evernote"})}}})})}})}]),annoCtrl.controller("NoteCtrl",["$scope","$http","$routeParams","$modal","$location","UserService","NoteService","TranslateService","FavouriteService","EvernoteService",function($scope,$http,$routeParams,$modal,$location,UserService,NoteService,TranslateService,FavouriteService){function deleteNote(id){return NoteService.remove({id:id,bid:$scope.book.id}).success(function(){$location.path("/"+$scope.user.uid+"/book/"+$scope.book.id)})}$scope.$emit("page:change","note");var note,nid=$routeParams.nid;UserService.login().then(function(user){NoteService.get({id:nid}).success(function(resp){note=_.pick(resp,"id","chapter","page_no","privacy","summary","content","photos","last_photo"),note.content=TranslateService.doubanToMarkdown(note.content,note.photos),$scope.note=note,$scope.book=_.pick(resp.book,"id","title"),$scope.author=resp.author_user,$scope.can_operate=resp.author_id==user.id,$scope.$emit("nav:lastBook",$scope.author,$scope.book),FavouriteService.getState(note,function(state){$scope.has_starred=state,$scope.$apply()}),$scope.toggleStar=function(state){FavouriteService[state?"star":"unstar"](_.omit(note,"content"),function(state){$scope.has_starred=state.is_starred,$scope.$apply()})},$scope.popupEvernote=function(){$modal.open({templateUrl:"modalEvernote.html",controller:"EvernoteCtrl",resolve:{title:function(){return note.chapter||book.title+"第"+note.page_no+"页"}}})}}).catch(function(error){$scope.error=error})}),$scope.open=function(){var modalInstance=$modal.open({templateUrl:"modalDeleteNote.html",controller:function($scope,$modalInstance){$scope.ok=function(){deleteNote(nid),$modalInstance.close()},$scope.cancel=function(){$modalInstance.dismiss("cancel")}},resolve:function(){}});modalInstance.result.then(function(selectedItem){$scope.selected=selectedItem})}}]),annoCtrl.controller("EditorCtrl",["$scope","$routeParams","$http","$location","UserService","BookService","NoteService","TranslateService",function($scope,$routeParams,$http,$location,UserService,BookService,NoteService,TranslateService){$scope.$emit("page:change","editor"),UserService.login().then(function(user){var note;if($routeParams.nid){var nid=$routeParams.nid;$scope.action="put",$scope.note=NoteService.get({id:nid}).success(function(resp){note=_.pick(resp,"id","chapter","page_no","privacy","content","book_id","photos","last_photo","book"),note.page_no=note.page_no||null,note.content=TranslateService.doubanToMarkdown(note.content,note.photos),note.privacy="2"==note.privacy?"public":"private",$scope.note=note,$scope.$emit("nav:lastBook",user,_.pick(resp.book,"id","title"))})}else $routeParams.bid&&($scope.note={chapter:"",content:"",page_no:null,photos:{},privacy:"public"},$scope.action="post",BookService.get($routeParams.bid).then(function(book){$scope.note.book=book,$scope.$emit("nav:lastBook",user,book)}))}),$scope.mode="column-mode",$scope.changeMode=function(mode){$scope.mode=mode},$scope.is_fullscreen=0,$scope.fullscreen=function(){$scope.is_fullscreen?chrome.app.window.current().restore():chrome.app.window.current().fullscreen(),$scope.is_fullscreen^=1},$scope.images=[],$scope.save=function(){{var payload={content:TranslateService.markdownToDouban($scope.note.content),page:$scope.note.page_no,chapter:$scope.note.chapter,privacy:$scope.note.privacy};$scope.note.last_photo}"put"==$scope.action?NoteService.put({id:$routeParams.nid},payload,$scope.images).success(function(note){$location.path("/note/"+note.id)}):"post"==$scope.action&&NoteService.post({bid:$routeParams.bid},payload,$scope.images).success(function(note){$location.path("/note/"+note.id)})}}]),annoCtrl.controller("InfoCtrl",["$scope","AuthService","UserService","SerializeService",function($scope,AuthService,UserService,SerializeService){$scope.$emit("page:change","info","个人信息"),UserService.getUserInfo().then(function(user){$scope.user=user,SerializeService.fetchAll(user.id).then(function(resp){var books=resp[0],notes=resp[1];$scope.total_books=_.size(books);var max_id,max=0;_.each(books,function(book,bid){book.notes_count>max&&(max=book.notes_count,max_id=bid)}),$scope.max_book=books[max_id],$scope.total_notes=notes.length;var start,start_bid,start_nid,end,end_id,time;start=end=new Date(notes[0].time),_.each(notes,function(note,nid){time=new Date(note.time),start>time&&(start=time,start_bid=note.book_id,start_nid=nid),time>end&&(end=time,end_id=nid)}),$scope.start=start.toLocaleDateString(),$scope.end=end.toLocaleDateString(),$scope.start_book=books[start_bid],$scope.start_note=notes[start_nid];var note_group=_.groupBy(notes,function(note){return note.book_id});$scope.recent_books=_.map(_.sortBy(_.values(note_group),function(notes){return new Date(notes[0].time)}).reverse().slice(0,5),function(notes){return books[notes[0].book_id]})})}),AuthService.isEvernoteAuthed().then(function(type){$scope[type+"_bound"]=!0}),$scope.authEvernote=function(type){AuthService.evernote(type,function(){$scope[type+"_bound"]=!0,$scope.$apply()})},$scope.unbind=function(type){AuthService.unbindEvernote(type,function(){$scope[type+"_bound"]=!1,$scope.$apply()})}}]),annoCtrl.controller("FriendsCtrl",["$scope","$http","FriendsService",function($scope,$http,FriendsService){$scope.$emit("page:change","friends","友邻的笔记"),$scope.showMoreFriends=function(){FriendsService.getMore().then(function(){$scope.and_more=FriendsService.has_more})},$scope.friends=FriendsService.getAllLocal(),$scope.and_more=FriendsService.has_more,$scope.friends.length||$scope.showMoreFriends()}]),annoCtrl.controller("FavCtrl",["$scope","FavouriteService",function($scope,FavouriteService){$scope.$emit("page:change","fav","我收藏的笔记*"),FavouriteService.fetchAll(function(notes){$scope.notes=notes})}]),annoCtrl.controller("EvernoteCtrl",["$scope","$rootScope","$modalInstance","EvernoteService","title",function($scope,$rootScope,$modalInstance,EvernoteService,title){function saveNoteTo(notebook){EvernoteService.save(title,$(".content"),notebook.guid,function(){$rootScope.$broadcast("alert:success","保存成功 :)"),$modalInstance.close()},function(msg){$scope.status=STATUS.NOTE.FAIL+(msg&&"错误:"+msg+" 告知开发者让他修复吧:)"),$scope.$apply()})}var STATUS={NOTEBOOK:{PENDING:"正在获取Evernote笔记本列表...",SUCCESS:"",FAIL:"与Evernote服务器通信失败,请检查Internet是否正常。"},NOTE:{PENDING:"正在保存",SUCCESS:"",FAIL:"保存失败,请检查Internet是否正常,或者关闭窗口重试一次。"}};$scope.status=STATUS.NOTEBOOK.PENDING,EvernoteService.listNoteBooks(function(res){$scope.notebooks=Array.prototype.slice.call(res,0),$scope.selectedNotebook=$scope.notebooks[0],$scope.status=STATUS.NOTEBOOK.SUCCESS,$scope.$apply()},function(){$scope.status=STATUS.NOTEBOOK.FAIL,$scope.$apply()}),$scope.choice_notebook="exist",$scope.ok=function(choice,existbook,newbook){"exist"==choice?saveNoteTo(existbook):"new"==choice&&EvernoteService.createNoteBook(newbook,function(newbook){saveNoteTo(newbook)})},$scope.cancel=function(){$modalInstance.close()}}]); \ No newline at end of file +var annoCtrl=angular.module("ANNO.controllers",["infinite-scroll"]);annoCtrl.controller("LoginCtrl",["$scope","$window","AuthService",function($scope,$window,AuthService){$scope.reload=function(){$window.location.href="/auth"},$scope.getToken=AuthService.auth}]),annoCtrl.controller("appFrameCtrl",["$scope","$rootScope","$location","$modal","$compile","UserService",function($scope,$rootScope,$location,$modal,$compile,UserService){$scope.asideVisible=0,$scope.toggleSidebar=function(){$scope.asideVisible^=1},$scope.$on("$routeChangeStart",function(){$scope.lastBook=null,$scope.globalTitle=""}),$scope.$on("nav:lastBook",function(e,author,book){$scope.author=author,$scope.lastBook=book}),$scope.$on("page:change",function(e,mode,title){$scope.headerInvisible="note"==mode||"editor"==mode,$scope.globalCSSClass="global_"+mode,$scope.globalTitle=title||""}),$scope.logout=function(){$modal.open({templateUrl:"modalLogout.html",controller:function($scope,$modalInstance){$scope.ok=function(){UserService.logout(function(){$location.path("/login"),$modalInstance.close()})},$scope.cancel=function(){$modalInstance.dismiss("cancel")}}})}}]),annoCtrl.controller("BooksCtrl",["$scope","$routeParams","$modal","$timeout","UserService","SerializeService",function($scope,$routeParams,$modal,$timeout,UserService,SerializeService){var uid=$routeParams.uid;UserService.getUser(uid).then(function(user){$scope.user=user,$scope.$emit("page:change","books",(user.name||"我")+"的书架"),SerializeService.fetchAllBooks(user.id).then(function(books){$scope.books=books,$scope.tipVisible=!user.is_self&&_.isEmpty(books)}),$scope.searchBook=function(){$modal.open({templateUrl:"modalSearchBook.html",controller:"SearchBookCtrl",resolve:{user:function(){return user}}}).opened.then(function(){$timeout(function(){var firstInput=$('.modal-dialog input[type="text"]');firstInput.length&&firstInput[0].focus()},50)})}})}]).controller("SearchBookCtrl",["$scope","$modalInstance","$location","$http","BookService","user",function($scope,$modalInstance,$location,$http,BookService,user){$scope.searchBook=function(query){query.match(/^\d{8}$/)?BookService.get(query).then(function(book){$scope.selectedIndex=0,$scope.selectedBook=book,$scope.books=[book]}):$http.get("/api/v2/book/search",{params:{q:query}}).success(function(res){$scope.books=res.books,res.books.length&&($scope.selectedIndex=0,$scope.selectedBook=res.books[0])}),$scope.has_searched=!0},$scope.selectBook=function($index,book){$scope.selectedIndex=$index,$scope.selectedBook=book},$scope.ok=function(bid){$location.path("/"+user.uid+"/book/"+bid+"/new"),$modalInstance.close()},$scope.cancel=function(){$modalInstance.dismiss("cancel")}}]),annoCtrl.controller("BookCtrl",["$scope","$routeParams","$modal","$timeout","UserService","SerializeService","TranslateService","FileSystemService",function($scope,$routeParams,$modal,$timeout,UserService,SerializeService,TranslateService,FileSystemService){var uid=$routeParams.uid,bid=$routeParams.bid;UserService.login().then(function(user){$scope.user=user}),UserService.getUser(uid).then(function(user){$scope.dominateColor={background:"#fff",foreground:"#000"},$scope.author=user,SerializeService.fetchBook(user.id,bid).then(function(book){$scope.$emit("page:change","book",(user.is_self?'我的书架 ❯ ':''+user.name+"的书架 ❯ ")+book.title),$scope.book=book,$scope.order="time",$scope.reverse=!0,$scope.book_cover=book.images.large}),$scope.book_opened=0,$scope.openBook=function(){$scope.book_opened=1},$scope.closeBook=function(){$scope.book_opened=0},$scope.book_sided=!1,$scope.$watch("dominateColor",function(colors){"#fff"!=colors.background&&($scope.book_sided=!0)}),$scope.exportNotes=function(){SerializeService.fetchBook(user.id,bid).then(function(book){var exports;exports=book.notes.map(function(note){return(note.chapter?"#"+note.chapter+"\n\n":"")+TranslateService.doubanToMarkdown(note.content,note.photos)}).join("\n\n-----\n\n");$modal.open({templateUrl:"modalExport.html",controller:function($scope,$modalInstance){$scope.download=function(){if("markdown"==$scope.exportFormat){var blob=new Blob([exports],{type:"text/plain;charset=utf-8"});FileSystemService.save(blob,book.title,"md",function(is_saved){is_saved&&$modalInstance.close()})}else if("html"==$scope.exportFormat){var blob=new Blob([angular.element(document.querySelector(".preview-html")).html()],{type:"text/html;charset=utf-8"});FileSystemService.save(blob,book.title,"html",function(is_saved){is_saved&&$modalInstance.close()})}},$scope.cancel=function(){$modalInstance.dismiss("cancel")},$scope.exports=exports,$scope.exportFormat="markdown",$scope.changeExportFormat=function(mode){$scope.exportFormat=mode},$scope.popupEvernote=function(){$modal.open({templateUrl:"modalEvernote.html",controller:"EvernoteCtrl",resolve:{title:function(){return book.title}},windowClass:"mask-evernote"})}}})})}})}]),annoCtrl.controller("NoteCtrl",["$scope","$http","$routeParams","$modal","$location","UserService","NoteService","TranslateService","FavouriteService","EvernoteService",function($scope,$http,$routeParams,$modal,$location,UserService,NoteService,TranslateService,FavouriteService){function deleteNote(id){return NoteService.remove({id:id,bid:$scope.book.id}).success(function(){$location.path("/"+$scope.user.uid+"/book/"+$scope.book.id)})}$scope.$emit("page:change","note");var note,nid=$routeParams.nid;UserService.login().then(function(user){NoteService.get({id:nid}).success(function(resp){note=_.pick(resp,"id","chapter","page_no","privacy","summary","content","photos","last_photo"),note.content=TranslateService.doubanToMarkdown(note.content,note.photos),$scope.note=note,$scope.book=_.pick(resp.book,"id","title"),$scope.author=resp.author_user,$scope.can_operate=resp.author_id==user.id,$scope.$emit("nav:lastBook",$scope.author,$scope.book),FavouriteService.getState(note,function(state){$scope.has_starred=state,$scope.$apply()}),$scope.toggleStar=function(state){FavouriteService[state?"star":"unstar"](_.omit(note,"content"),function(state){$scope.has_starred=state.is_starred,$scope.$apply()})},$scope.popupEvernote=function(){$modal.open({templateUrl:"modalEvernote.html",controller:"EvernoteCtrl",resolve:{title:function(){return note.chapter||book.title+"第"+note.page_no+"页"}}})}}).catch(function(error){$scope.error=error})}),$scope.open=function(){var modalInstance=$modal.open({templateUrl:"modalDeleteNote.html",controller:function($scope,$modalInstance){$scope.ok=function(){deleteNote(nid),$modalInstance.close()},$scope.cancel=function(){$modalInstance.dismiss("cancel")}},resolve:function(){}});modalInstance.result.then(function(selectedItem){$scope.selected=selectedItem})}}]),annoCtrl.controller("EditorCtrl",["$scope","$routeParams","$http","$location","UserService","BookService","NoteService","TranslateService",function($scope,$routeParams,$http,$location,UserService,BookService,NoteService,TranslateService){$scope.$emit("page:change","editor"),UserService.login().then(function(user){var note;if($routeParams.nid){var nid=$routeParams.nid;$scope.action="put",$scope.note=NoteService.get({id:nid}).success(function(resp){note=_.pick(resp,"id","chapter","page_no","privacy","content","book_id","photos","last_photo","book"),note.page_no=note.page_no||null,note.content=TranslateService.doubanToMarkdown(note.content,note.photos),note.privacy="2"==note.privacy?"public":"private",$scope.note=note,$scope.$emit("nav:lastBook",user,_.pick(resp.book,"id","title"))})}else $routeParams.bid&&($scope.note={chapter:"",content:"",page_no:null,photos:{},privacy:"public"},$scope.action="post",BookService.get($routeParams.bid).then(function(book){$scope.note.book=book,$scope.$emit("nav:lastBook",user,book)}))}),$scope.mode="column-mode",$scope.changeMode=function(mode){$scope.mode=mode},$scope.is_fullscreen=0,$scope.fullscreen=function(){$scope.is_fullscreen?chrome.app.window.current().restore():chrome.app.window.current().fullscreen(),$scope.is_fullscreen^=1},$scope.images=[],$scope.save=function(){{var payload={content:TranslateService.markdownToDouban($scope.note.content),page:$scope.note.page_no,chapter:$scope.note.chapter,privacy:$scope.note.privacy};$scope.note.last_photo}"put"==$scope.action?NoteService.put({id:$routeParams.nid},payload,$scope.images).success(function(note){$location.path("/note/"+note.id)}):"post"==$scope.action&&NoteService.post({bid:$routeParams.bid},payload,$scope.images).success(function(note){$location.path("/note/"+note.id)})}}]),annoCtrl.controller("InfoCtrl",["$scope","AuthService","UserService","SerializeService",function($scope,AuthService,UserService,SerializeService){$scope.$emit("page:change","info","个人信息"),UserService.getUserInfo().then(function(user){$scope.user=user,SerializeService.fetchAll(user.id).then(function(resp){var books=resp[0],notes=resp[1];$scope.total_books=_.size(books);var max_id,max=0;_.each(books,function(book,bid){book.notes_count>max&&(max=book.notes_count,max_id=bid)}),$scope.max_book=books[max_id],$scope.total_notes=notes.length;var start,start_bid,start_nid,end,end_id,time;start=end=new Date(notes[0].time),_.each(notes,function(note,nid){time=new Date(note.time),start>time&&(start=time,start_bid=note.book_id,start_nid=nid),time>end&&(end=time,end_id=nid)}),$scope.start=start.toLocaleDateString(),$scope.end=end.toLocaleDateString(),$scope.start_book=books[start_bid],$scope.start_note=notes[start_nid];var note_group=_.groupBy(notes,function(note){return note.book_id});$scope.recent_books=_.map(_.sortBy(_.values(note_group),function(notes){return new Date(notes[0].time)}).reverse().slice(0,5),function(notes){return books[notes[0].book_id]})})}),AuthService.isEvernoteAuthed().then(function(type){$scope[type+"_bound"]=!0}),$scope.authEvernote=function(type){AuthService.evernote(type,function(){$scope[type+"_bound"]=!0,$scope.$apply()})},$scope.unbind=function(type){AuthService.unbindEvernote(type,function(){$scope[type+"_bound"]=!1,$scope.$apply()})}}]),annoCtrl.controller("FriendsCtrl",["$scope","$http","FriendsService",function($scope,$http,FriendsService){$scope.$emit("page:change","friends","友邻的笔记"),$scope.showMoreFriends=function(){FriendsService.getMore().then(function(){$scope.and_more=FriendsService.has_more})},$scope.friends=FriendsService.getAllLocal(),$scope.and_more=FriendsService.has_more,$scope.friends.length||$scope.showMoreFriends()}]),annoCtrl.controller("FavCtrl",["$scope","FavouriteService",function($scope,FavouriteService){$scope.$emit("page:change","fav","我收藏的笔记*"),FavouriteService.fetchAll(function(notes){$scope.notes=notes})}]),annoCtrl.controller("EvernoteCtrl",["$scope","$rootScope","$modalInstance","EvernoteService","title",function($scope,$rootScope,$modalInstance,EvernoteService,title){function saveNoteTo(notebook){EvernoteService.save(title,$(".content"),notebook.guid,function(){$rootScope.$broadcast("alert:success","保存成功 :)"),$modalInstance.close()},function(msg){$scope.status=STATUS.NOTE.FAIL+(msg&&"错误:"+msg+" 告知开发者让他修复吧:)"),$scope.$apply()})}var STATUS={NOTEBOOK:{PENDING:"正在获取Evernote笔记本列表...",SUCCESS:"",FAIL:"与Evernote服务器通信失败,请检查Internet是否正常。"},NOTE:{PENDING:"正在保存",SUCCESS:"",FAIL:"保存失败,请检查Internet是否正常,或者关闭窗口重试一次。"}};$scope.status=STATUS.NOTEBOOK.PENDING,EvernoteService.listNoteBooks(function(res){$scope.notebooks=Array.prototype.slice.call(res,0),$scope.selectedNotebook=$scope.notebooks[0],$scope.status=STATUS.NOTEBOOK.SUCCESS,$scope.$apply()},function(){$scope.status=STATUS.NOTEBOOK.FAIL,$scope.$apply()}),$scope.choice_notebook="exist",$scope.ok=function(choice,existbook,newbook){"exist"==choice?saveNoteTo(existbook):"new"==choice&&EvernoteService.createNoteBook(newbook,function(newbook){saveNoteTo(newbook)})},$scope.cancel=function(){$modalInstance.close()}}]); \ No newline at end of file diff --git a/public/js/directives.min.js b/public/js/directives.min.js index 81955d4..43d5362 100644 --- a/public/js/directives.min.js +++ b/public/js/directives.min.js @@ -1 +1 @@ -"use strict";angular.module("ANNO.directives",[]).directive("inputEnter",function(){var ENTER_KEY=13;return function(scope,elem,attrs){elem.bind("keydown",function(event){event.keyCode===ENTER_KEY&&scope.$apply(attrs.inputEnter)})}}).directive("editor",["$modal",function($modal){return{restrict:"E",replace:!0,templateUrl:"/partials/widgets/editor.html",scope:{article:"=",images:"="},controller:function($scope){var utils={bold:function(s,editor){editor.replaceSelection("*"===s.charAt(0)&&s.charAt(s.length-1==="*")?s.replace(/\*/g,""):"**"+s.replace(/\*/g,"")+"**")},italic:function(s,editor){editor.replaceSelection("_"===s.charAt(0)&&s.charAt(s.length-1==="_")?s.replace(/_/g,""):"_"+s.replace(/_/g,"")+"_")},quote:function(s,editor){editor.replaceSelection(">"===s.charAt(0)?util.lTrim(s.replace(/\>/g,"")):"> "+s.replace(/\>/g,""))}},self=this;this.codeMirrorLoad=function(editor){$scope.bold=function(){""!==editor.getSelection()&&utils.bold(editor.getSelection(),editor)},$scope.italic=function(){""!==editor.getSelection()&&utils.italic(editor.getSelection(),editor)},$scope.quote=function(){""!==editor.getSelection()&&utils.quote(editor.getSelection(),editor)},self.uploadPhoto=function(dataURL,file){$scope.article.last_photo=$scope.article.last_photo||0,++$scope.article.last_photo,$scope.images.push({name:"pic"+$scope.article.last_photo,src:dataURL,obj:file}),editor.replaceSelection("<图片"+$scope.article.last_photo+">")},$scope.toggleEditorHelp=function(){$modal.open({templateUrl:"modalEditorHelp.html",controller:function($scope,$modalInstance){$scope.ok=function(){$modalInstance.close()}}})}}}}}]).directive("codemirror",function(){return{restrict:"E",require:["^editor","ngModel"],replace:!0,link:function(scope,elem,attrs,ctrls){var editorCtrl=ctrls[0],ngModel=ctrls[1],editor=new CodeMirror(elem[0],{mode:"gfm",lineWrapping:!0,lineNumbers:!1,matchBrackets:!0,autofocus:!0,theme:"prose-bright",placeholder:"开始写笔记"});editor.refresh(),editor.on("change",function(cm){var phase=scope.$root.$$phase;"$apply"==phase||"$digest"==phase?ngModel.$setViewValue(cm.getValue()):scope.$apply(function(){ngModel.$setViewValue(cm.getValue())})}),ngModel.$render=function(){ngModel.$viewValue&&editor.setValue(ngModel.$viewValue)},editorCtrl.codeMirrorLoad(editor)}}}).directive("filereader",function(){return{restrict:"A",require:"^editor",link:function(scope,elem,attrs,editorCtrl){var reader=new FileReader;reader.onload=function(e){editorCtrl.uploadPhoto(e.target.result,elem[0].files[0])},elem.on("change",function(){reader.readAsDataURL(elem[0].files[0])})}}}).directive("reader",function(){return{restrict:"E",replace:!0,templateUrl:"/partials/widgets/reader.html",scope:{article:"=",images:"="},controller:function($scope){this.images=$scope.images}}}).directive("previewer",["$timeout","$http",function($timeout,$http){var imageCache={};return{restrict:"E",scope:{markdown:"=",images:"="},template:'