-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
1 lines (1 loc) · 24 KB
/
index.js
1
!function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";r(4),new Vue({el:"body",data:{normal:!0},components:{normal:r(8),min:r(11)},ready:function(){var e=this;window.innerWidth<900||window.innerHeight<500?this.normal=!1:this.normal=!0,window.onresize=function(t){t.stopPropagation(),window.innerWidth<900||window.innerHeight<500?e.normal=!1:e.normal=!0}}})},,,,function(e,t,r){var i=r(5);"string"==typeof i&&(i=[[e.id,i,""]]);r(7)(i,{});i.locals&&(e.exports=i.locals)},function(e,t,r){t=e.exports=r(6)(),t.push([e.id,'*{font-family:"monospace",Consolas,Microsoft YaHei;-webkit-tap-highlight-color:transparent}*,:focus{outline:none}body,html{padding:0;margin:0}i{font-style:normal}a,a:active,a:hover,a:link,a:visited{text-decoration:none;color:inherit}ul{list-style-type:none;padding:0;margin:0}body,html{height:100%;overflow:hidden}body{overflow-y:auto;-webkit-user-select:none;background:linear-gradient(135deg,#cebe29,#9b1f50 33%,#2989d8 71%,#89b4ff 91%);background:-webkit-gradient(linear,left top,right bottom,color-stop(0,#cebe29),color-stop(33%,#9b1f50),color-stop(71%,#2989d8),color-stop(91%,#89b4ff))}*{font-family:Lato,Calibri,Arial,sans-serif}.normal{width:100%;max-width:1280px;height:100%;color:hsla(0,0%,100%,.9);padding:2rem;box-sizing:border-box;margin:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center}.normal .status{font-size:1.5rem;display:-webkit-box!important;display:-webkit-flex!important;display:flex!important}.normal .status>div{-webkit-box-flex:1;-webkit-flex:1;flex:1}.normal .status .left,.normal .status .right{letter-spacing:.1rem;font-weight:lighter;text-shadow:0 1px 1px rgba(0,0,0,.4);color:hsla(0,0%,100%,.9)}.normal .status .right{text-align:right;font-size:0}.normal .status .right:after{content:"";width:0;height:100%;display:inline-block;vertical-align:middle}.normal .status .right i{font-size:1.5rem;display:inline-block;vertical-align:middle}.normal .status .right .fa{font-size:1rem;display:inline-block;background-color:hsla(0,0%,100%,.5);cursor:pointer}.normal .status .right .fa.fa-caret-left,.normal .status .right .fa.fa-caret-right,.normal .status .right .fa.fa-refresh{width:2rem;line-height:2rem;height:2rem;text-align:center}.normal .status .right .fa.fa-caret-left:hover,.normal .status .right .fa.fa-caret-right:hover,.normal .status .right .fa.fa-refresh:hover{background-color:hsla(0,0%,100%,.8)}.normal .status .right .fa.fa-caret-left{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem;margin-left:.5rem}.normal .status .right .fa.fa-caret-right{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem;margin-right:.5rem}.normal .status .right .fa.fa-refresh{border-radius:.3rem}.normal .calendar{margin-top:1rem;border-radius:.5rem;overflow:hidden;font-weight:lighter;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center}.normal .calendar .week{background-color:hsla(0,0%,100%,.2);display:-webkit-box!important;display:-webkit-flex!important;display:flex!important}.normal .calendar .week li{text-align:center;font-size:1rem;color:#fff;text-transform:uppercase;letter-spacing:.1rem;text-shadow:0 1px 1px rgba(0,0,0,.4);line-height:2.5rem;-webkit-box-flex:1;-webkit-flex:1;flex:1}.normal .calendar .date{padding:1rem;box-sizing:border-box;background-color:hsla(0,0%,100%,.1);-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box!important;display:-webkit-flex!important;display:flex!important}.normal .calendar .date .col{border-left:1px solid hsla(0,0%,100%,.3);-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center}.normal .calendar .date .col:first-child{border-left:none}.normal .calendar .date .col li{font-size:1.3rem;text-shadow:0 1px 1px rgba(0,0,0,.4);font-weight:lighter;box-sizing:border-box;padding:.5rem;border-bottom:1px solid hsla(0,0%,100%,.3);-webkit-box-flex:1;-webkit-flex:1;flex:1}.normal .calendar .date .col li:last-child{border-bottom:none}.normal .calendar .date .col li.enable{cursor:pointer}.normal .calendar .date .col li i{width:2rem;height:2rem;line-height:2rem;text-align:center;display:inline-block}.normal .calendar .date .col li i.hide{visibility:hidden}.normal .calendar .date .col li i.fa-star{font-size:1rem}.normal .calendar .date .col li .today{border-radius:1rem;background-color:hsla(0,0%,100%,.5)}.min{width:100%;max-width:1280px;height:100%;color:hsla(0,0%,100%,.9);padding:2rem;box-sizing:border-box;margin:auto}.min .status{font-size:1.5rem}.min .status .left{margin-bottom:.5rem}.min .status .left,.min .status .right{letter-spacing:.1rem;font-weight:lighter;text-shadow:0 1px 1px rgba(0,0,0,.4);color:hsla(0,0%,100%,.9)}.min .status .right{font-size:0}.min .status .right:after{content:"";width:0;height:100%;display:inline-block;vertical-align:middle}.min .status .right i{font-size:1.5rem;display:inline-block;vertical-align:middle}.min .status .right .fa{font-size:1rem;display:inline-block;background-color:hsla(0,0%,100%,.5);cursor:pointer}.min .status .right .fa.fa-caret-left,.min .status .right .fa.fa-caret-right,.min .status .right .fa.fa-refresh{width:2rem;line-height:2rem;height:2rem;text-align:center}.min .status .right .fa.fa-caret-left:hover,.min .status .right .fa.fa-caret-right:hover,.min .status .right .fa.fa-refresh:hover{background-color:hsla(0,0%,100%,.8)}.min .status .right .fa.fa-caret-left{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem;margin-left:.5rem}.min .status .right .fa.fa-caret-right{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem;margin-right:.5rem}.min .status .right .fa.fa-refresh{border-radius:.3rem}.min .calendar{margin-top:1rem;margin-bottom:2rem}.min .calendar li{padding:.5rem;border-bottom:1px solid hsla(0,0%,100%,.3);cursor:pointer}.min .calendar li.today{background-color:hsla(0,0%,100%,.2)}.min .calendar li:last-child{border-bottom:none}.min .calendar li .day,.min .calendar li .week{font-weight:lighter;text-shadow:0 1px 1px rgba(0,0,0,.4);color:hsla(0,0%,100%,.9)}.min .calendar li .day{font-size:1.3rem;width:1.1em;display:inline-block;margin-right:.5rem;text-align:right}.min .calendar li .week{letter-spacing:.1rem;font-size:.8rem}.mask{position:fixed;top:0;left:0;width:100%;height:100%;visibility:hidden}.mask.editor,.mask.show{visibility:visible}.mask.editor .panel,.mask.show .panel{opacity:1;visibility:visible;transform:translateY(0)}.mask.editor label.input input{display:inline-block}.mask.editor .btn-box.editor,.mask.editor label.textarea textarea{display:block}.mask.show label{border:none;box-shadow:none;border-radius:none}.mask.show label.input i,.mask.show label.textarea i{display:block}.mask.show label.textarea{margin-top:0}.mask.show .btn-box.show{display:block}.panel{max-width:800px;min-height:300px;width:80%;height:50%;background-color:#fff;border-radius:.3rem;position:absolute;z-index:9;top:0;left:0;right:0;bottom:0;margin:auto;box-shadow:3px 3px 6px rgba(0,0,0,.6);padding:1rem;box-sizing:border-box;white-space:nowrap;overflow:hidden;visibility:hidden;transform:translateY(3rem);opacity:0;transition:transform .5s,opacity .5s;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center}.panel h3{color:green;text-align:center;font-weight:lighter;text-shadow:0 1px 1px rgba(0,0,0,.4);letter-spacing:.1rem;margin:0;padding:0}.panel .editor,.panel .show{display:none}.panel .in-box{margin-top:1rem;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.075);border-radius:.2rem;padding:.5rem;box-sizing:border-box;display:block}.panel .in-box.focus{border-color:#51a7e8;outline:none;box-shadow:inset 0 1px 2px rgba(0,0,0,.075),0 0 6px rgba(81,167,232,.5)}.panel .in-box input{width:100%;border:0;font-size:.9rem;color:#555;display:none;font-family:"monospace",Consolas,Microsoft YaHei}.panel .in-box.textarea{padding:0;overflow:hidden;align-items:stretch;box-align:stretch;-webkit-box-align:stretch;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center}.panel .in-box.textarea i{padding:.5rem;box-sizing:border-box;word-break:break-all;word-wrap:break-word;white-space:normal;overflow:auto;line-height:1.5rem;font-size:.9rem;-webkit-box-flex:1;-webkit-flex:1;flex:1}.panel .in-box.input i{font-weight:700;font-size:1.2rem}.panel .in-box i,.panel textarea{display:none;color:#555}.panel textarea{margin:0;padding:.5rem;resize:none;border:0;font-size:.9rem;font-family:"monospace",Consolas,Microsoft YaHei;-webkit-box-flex:1;-webkit-flex:1;flex:1}.panel .btn-box{margin-top:1rem;text-align:right;display:none}.panel .btn-box button{cursor:pointer;display:inline-block;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.15);border-radius:3px;padding:3px 10px;font-size:.9rem;line-height:20px;-webkit-user-select:none;-webkit-appearance:button}.panel .btn-box button.ok{background-color:#60b044;background-image:-webkit-linear-gradient(#8add6d,#60b044);background-image:linear-gradient(#8add6d,#60b044);border-color:#5ca941;border:1px solid #4a993e}.panel .btn-box button.ok:hover{color:#fff;background-color:#569e3d;background-image:-webkit-linear-gradient(#79d858,#569e3d);background-image:linear-gradient(#79d858,#569e3d)}.panel .btn-box button.ok:active{text-shadow:0 1px 0 rgba(0,0,0,.15);background-color:#569e3d;background-image:none;border-color:#418737}.panel .btn-box button.cancel{margin-right:1rem;color:#900;background-color:#eee;background-image:-webkit-linear-gradient(#fcfcfc,#eee);background-image:linear-gradient(#fcfcfc,#eee);border:1px solid #d5d5d5;text-shadow:none}.panel .btn-box button.cancel:hover{color:#fff;background-color:#b33630;background-image:-webkit-linear-gradient(#dc5f59,#b33630);background-image:linear-gradient(#dc5f59,#b33630);border-color:#cd504a}.panel .btn-box button.cancel:active{color:#fff;background-color:#b33630;background-image:none;border-color:#9f312c}',""])},function(e,t){"use strict";e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var r=this[t];r[2]?e.push("@media "+r[2]+"{"+r[1]+"}"):e.push(r[1])}return e.join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},n=0;n<this.length;n++){var a=this[n][0];"number"==typeof a&&(i[a]=!0)}for(n=0;n<t.length;n++){var o=t[n];"number"==typeof o[0]&&i[o[0]]||(r&&!o[2]?o[2]=r:r&&(o[2]="("+o[2]+") and ("+r+")"),e.push(o))}},e}},function(e,t,r){function i(e,t){for(var r=0;r<e.length;r++){var i=e[r],n=f[i.id];if(n){n.refs++;for(var a=0;a<n.parts.length;a++)n.parts[a](i.parts[a]);for(;a<i.parts.length;a++)n.parts.push(d(i.parts[a],t))}else{for(var o=[],a=0;a<i.parts.length;a++)o.push(d(i.parts[a],t));f[i.id]={id:i.id,refs:1,parts:o}}}}function n(e){for(var t=[],r={},i=0;i<e.length;i++){var n=e[i],a=n[0],o=n[1],s=n[2],l=n[3],d={css:o,media:s,sourceMap:l};r[a]?r[a].parts.push(d):t.push(r[a]={id:a,parts:[d]})}return t}function a(e,t){var r=p(),i=y[y.length-1];if("top"===e.insertAt)i?i.nextSibling?r.insertBefore(t,i.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),y.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");r.appendChild(t)}}function o(e){e.parentNode.removeChild(e);var t=y.indexOf(e);t>=0&&y.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",a(e,t),t}function l(e){var t=document.createElement("link");return t.rel="stylesheet",a(e,t),t}function d(e,t){var r,i,n;if(t.singleton){var a=x++;r=g||(g=s(t)),i=c.bind(null,r,a,!1),n=c.bind(null,r,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=l(t),i=u.bind(null,r),n=function(){o(r),r.href&&URL.revokeObjectURL(r.href)}):(r=s(t),i=h.bind(null,r),n=function(){o(r)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else n()}}function c(e,t,r,i){var n=r?"":i.css;if(e.styleSheet)e.styleSheet.cssText=k(t,n);else{var a=document.createTextNode(n),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function h(e,t){var r=t.css,i=t.media;t.sourceMap;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function u(e,t){var r=t.css,i=(t.media,t.sourceMap);i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var n=new Blob([r],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(n),a&&URL.revokeObjectURL(a)}var f={},b=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},m=b(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),p=b(function(){return document.head||document.getElementsByTagName("head")[0]}),g=null,x=0,y=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=m()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var r=n(e);return i(r,t),function(e){for(var a=[],o=0;o<r.length;o++){var s=r[o],l=f[s.id];l.refs--,a.push(l)}if(e){var d=n(e);i(d,t)}for(var o=0;o<a.length;o++){var l=a[o];if(0===l.refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete f[l.id]}}}};var k=function(){var e=[];return function(t,r){return e[t]=r,e.filter(Boolean).join("\n")}}()},function(e,t,r){var i,n;i=r(9),n=r(10),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports["default"]),n&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=n)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={data:function(){return{panel:null,mask:null,db:null,store:null,weeks:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],months:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."],current:{year:null,month:null,day:null,week:null},today:{year:null,month:null,day:null,week:null},date:{weeks:[[],[],[],[],[],[],[]]},indices:{week:0,day:0},task:{"in":{title:"",content:""},out:{title:"",content:"",id:""},years:[]}}},methods:{init:function(){var e=new Date;this.today.year=this.current.year=e.getFullYear(),this.today.month=this.current.month=e.getMonth(),this.today.day=this.current.day=e.getDate(),this.today.week=this.current.week=e.getDay()},isToday:function(e){return this.today.year==e.getFullYear()&&this.today.month==e.getMonth()&&this.today.day==e.getDate()},getTasks:function(e){var t=this;if(!this.store)return void alert("很抱歉,我的内心不配我的外表。");var r=this.store.index("year");if(this.task.years=[],r){var i=IDBKeyRange.only(e);r.openCursor(i).onsuccess=function(e){var r=e.target.result;r&&(r.value.content=r.value.content.replace(/\n/g,"<br>"),t.task.years.push(r.value),r["continue"]()),t.render()}}else alert("很抱歉,我的内心不配我的外表。")},render:function(){var e=this,t=new Date(this.current.year,this.current.month,1),r=t.getDay()-1,i=0;for(this.clear(),0>r?r=6:null,this.date.weeks[r].push({day:t.getDate(),flag:!1,star:!1});r>i;)this.date.weeks[i].push({day:"-",flag:!1,star:!1}),i++;for(;;){if(t.setDate(t.getDate()+1),t.getMonth()!==this.current.month)break;r=t.getDay()-1,0>r?r=6:null,this.date.weeks[r].push({day:t.getDate(),flag:this.isToday(t),star:!1})}for(;6>r;)this.date.weeks[++r].push({day:"-",flag:!1,star:!1});this.task.years.forEach(function(t){t.month===e.current.month&&(e.date.weeks[t.indices.week][t.indices.day].star=!0)}),this.date.weeks=this.date.weeks},clear:function(){for(var e=0;e<this.date.weeks.length;e++)this.date.weeks.$set(e,[])},prev:function(){0==this.current.month?(this.current.month=11,this.getTasks(--this.current.year)):(this.current.month--,this.render())},next:function(){11==this.current.month?(this.current.month=0,this.getTasks(++this.current.year)):(this.current.month++,this.render())},refresh:function(){this.current.year=this.today.year,this.current.month=this.today.month,this.current.day=this.today.day,this.getTasks(this.current.year)},handle:function(e,t){var r=this;switch(t){case"click-day":if("-"==(arguments.length<=2?void 0:arguments[2]))return;this.current.day=arguments.length<=2?void 0:arguments[2],this.indices.week=arguments.length<=3?void 0:arguments[3],this.indices.day=arguments.length<=4?void 0:arguments[4],(arguments.length<=5?void 0:arguments[5])?(this.task.years.forEach(function(e){e.year==r.current.year&&e.month==r.current.month&&e.day==r.current.day&&(r.task.out.title=e.title,r.task.out.content=e.content,r.task.out.id=e.date)}),this.mask.classList.add("show")):this.mask.classList.add("editor");break;case"focus-input":e.target.parentElement.classList.add("focus");break;case"blur-input":e.target.parentElement.classList.remove("focus");break;case"click-btn":if(arguments.length-2&&"cancel"==(arguments.length<=2?void 0:arguments[2])&&this.mask.classList.remove("editor"),arguments.length-2&&"ok"==(arguments.length<=2?void 0:arguments[2])){if(/^\s*$/.test(this.task["in"].content))return void alert("没写内容是不会提交的……");var i=this.date.weeks[this.indices.week];i[this.indices.day].star=!0,this.date.weeks.$set(this.indices.week,i),this.store&&(this.store.put({date:""+this.current.year+(this.current.month+1<10?"0"+(this.current.month+1):this.current.month+1)+(this.current.day<10?"0"+this.current.day:this.current.day),year:this.current.year,month:this.current.month,day:this.current.day,title:this.task["in"].title,content:this.task["in"].content,indices:this.indices}).then(function(e){e.err?(alert("提交遇到问题了"),console.log(e.err)):(r.mask.classList.remove("editor"),r.getTasks(r.current.year))}),this.task["in"].title=this.task["in"].content="")}arguments.length-2&&"editor"==(arguments.length<=2?void 0:arguments[2])&&(this.task["in"].title=this.task.out.title,this.task["in"].content=this.task.out.content.replace(/<br>/g,"\n"),this.mask.classList.remove("show"),this.mask.classList.add("editor")),arguments.length-2&&"delete"==(arguments.length<=2?void 0:arguments[2])&&window.confirm("确认删除?")&&this.store["delete"](this.task.out.id).then(function(e){e.err?(alert("删除失败"),console.log(e.err)):(alert("删除成功"),r.getTasks(r.current.year),r.mask.classList.remove("show"))})}},run:function(){var e=this;this.getTasks((new Date).getFullYear()),this.init(),this.panel=document.querySelector(".panel"),this.mask=document.querySelector(".mask"),document.addEventListener("click",function(t){t.target===e.panel||e.panel.contains(t.target)||e.mask.classList.remove("show","editor")})}},ready:function(){var e=this;Flex.open("todo-list").then(function(t){t.err?(alert("很抱歉,我的内心不配我的外表。"),console.log(t.err)):(e.db=t.db,e.store=e.db.getStore("task"),e.store?e.run():e.db.createStore("task",{keyPath:"date",autoIncrement:!0}).then(function(t){t.err?(alert("很抱歉,我的内心不配我的外表。"),console.log(t.err)):(e.store=t.store,e.store.createIndex([{name:"year",key:"year",opts:{unique:!1}}]).then(function(t){t.err?(alert("很抱歉,我的内心不配我的外表。"),console.log(t.err)):e.run()}))}))})}}},function(e,t){e.exports='<div class=normal> <div class=status> <div class=left>To-do List</div> <div class=right> <i v-text=months[current.month]></i> <i v-text=current.year></i> <i class="fa fa-caret-left" @click=prev></i><i class="fa fa-caret-right" @click=next></i> <i class="fa fa-refresh" @click=refresh></i> </div> </div> <div class=calendar> <ul class=week> <li v-for="x in weeks" v-text=x></li> </ul> <div class=date> <ul class=col v-for="($w, week) in date.weeks"> <li v-for="($d, day) in week" : :class="{\'enable\': day.day != \'-\'}" @click.stop="handle($event, \'click-day\', day.day, $w, $d, day.star)"><i :class="{\'today\': day.flag, \'hide\': day.day == \'-\'}" v-text=day.day></i><i class="fa fa-star" v-show=day.star></i></li> </ul> </div> </div> <div class=mask> <div class=panel> <h3> <i v-text=current.year></i> <i>-</i> <i v-text="current.month + 1 < 10 ? \'0\' + (current.month + 1) : current.month + 1"></i> <i>-</i> <i v-text="current.day < 10 ? \'0\' + current.day : current.day"></i> </h3> <label class="in-box input"><input type=text placeholder=标题 v-model=task.in.title maxlength=20 @focus="handle($event, \'focus-input\')" @blur="handle($event, \'blur-input\')"><i v-text=task.out.title></i></label> <label class="in-box textarea"><textarea placeholder=写点什么... v-model=task.in.content @focus="handle($event, \'focus-input\')" @blur="handle($event, \'blur-input\')"></textarea><i v-html=task.out.content></i></label> <div class="btn-box editor"> <button class=cancel @click="handle($event, \'click-btn\', \'cancel\')">取消</button><button class=ok @click="handle($event, \'click-btn\', \'ok\')">确定</button> </div> <div class="btn-box show"> <button class=cancel @click="handle($event, \'click-btn\', \'delete\')">删除</button><button class=ok @click="handle($event, \'click-btn\', \'editor\')">编辑</button> </div> </div> </div> </div>'},function(e,t,r){var i,n;i=r(12),n=r(13),e.exports=i||{},e.exports.__esModule&&(e.exports=e.exports["default"]),n&&(("function"==typeof e.exports?e.exports.options||(e.exports.options={}):e.exports).template=n)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={data:function(){return{weeks:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."],current:{year:null,month:null,day:null,week:null},today:{year:null,month:null,day:null,week:null},date:{days:[]}}},methods:{init:function(){var e=new Date;this.today.year=this.current.year=e.getFullYear(),this.today.month=this.current.month=e.getMonth(),this.today.day=this.current.day=e.getDate(),this.today.week=this.current.week=e.getDay()},isToday:function(e){return this.today.year==e.getFullYear()&&this.today.month==e.getMonth()&&this.today.day==e.getDate()},render:function(){var e=new Date(this.current.year,this.current.month,1),t=e.getDay()-1;for(this.clear();;){if(e.getMonth()!==this.current.month)break;t=e.getDay()-1,0>t?t=6:null,this.date.days.push({day:e.getDate(),flag:this.isToday(e),week:e.getDay()}),e.setDate(e.getDate()+1)}},clear:function(){this.date.days=[]},prev:function(){0==this.current.month?(this.current.month=11,this.current.year--):this.current.month--,this.render()},next:function(){11==this.current.month?(this.current.month=0,this.current.year++):this.current.month++,this.render()},refresh:function(){this.current.year=this.today.year,this.current.month=this.today.month,this.current.day=this.today.day,this.render()}},ready:function(){this.init(),this.render()}}},function(e,t){e.exports='<div class=min> <div class=status> <div class=left>To-do List</div> <div class=right> <i v-text=months[current.month]></i> <i v-text=current.year></i> <i class="fa fa-caret-left" @click=prev></i><i class="fa fa-caret-right" @click=next></i> <i class="fa fa-refresh" @click=refresh></i> </div> </div> <ul class=calendar> <li v-for="day in date.days" :class="{\'today\': day.flag}"> <i class=day v-text=day.day></i> <i class=week v-text=weeks[day.week]></i> </li> </ul> </div>'}]);