99 <span class =" ml-3" >Hide</span >
1010 </button >
1111 </div >
12- <div v-if =" document " class =" flex flex-col flex-grow" >
12+ <div v-if =" doc " class =" flex flex-col flex-grow" >
1313 <div >
14- <DiscardableAction v-if =" document .id" :discardedAt =" document .discardedAt" :onDiscard =" discardDocument" :onRestore =" restoreDocument" class =" sidebar-button w-full" ></DiscardableAction >
14+ <DiscardableAction v-if =" doc .id" :discardedAt =" doc .discardedAt" :onDiscard =" discardDocument" :onRestore =" restoreDocument" class =" sidebar-button w-full" ></DiscardableAction >
1515 <button @click.stop =" duplicateDocument" class =" sidebar-button w-full" >
1616 <svg height =" 1.25em" width =" 1.25em" xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
1717 <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" />
2525 <span class =" ml-6 md:ml-3 flex-grow text-left" >Create Sandbox</span >
2626 </button >
2727 <div >
28- <div v-if =" document .public" >
28+ <div v-if =" doc .public" >
2929 <button @click =" restrictDocument" class =" sidebar-button w-full" >
3030 <svg height =" 1.25em" width =" 1.25em" xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
3131 <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
5151 </div >
5252 </div >
5353 <div class =" mt-4" >
54- <TagLink v-for =" tag in document .tags" :key =" tag" :tag =" tag" class =" sidebar-link" ></TagLink >
54+ <TagLink v-for =" tag in doc .tags" :key =" tag" :tag =" tag" class =" sidebar-link" ></TagLink >
5555 </div >
5656 <div class =" mt-4" >
57- <div v-for =" task in document .tasks" class =" flex items-center px-3 py-2 my-1 md:px-2 md:py-1" >
57+ <div v-for =" task in doc .tasks" class =" flex items-center px-3 py-2 my-1 md:px-2 md:py-1" >
5858 <svg height =" 1.25em" width =" 1.25em" xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
5959 <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M5 13l4 4L19 7" />
6060 </svg >
6161 <span class =" flex-grow overflow-hidden truncate ml-3" >{{ task }}</span >
6262 </div >
6363 </div >
6464 <div class =" flex flex-col justify-end flex-grow px-3 md:p-2 mt-4 mb-3 md:mb-1" >
65- <div v-if =" document .updatedAt" >
65+ <div v-if =" doc .updatedAt" >
6666 <small class =" text-gray-700" >Last Saved</small >
6767 <div class =" capitalize pt-2 md:pt-1" >{{ savedAt }}</div >
6868 </div >
69- <div v-if =" document .createdAt" class =" mt-3 md:mt-2" >
69+ <div v-if =" doc .createdAt" class =" mt-3 md:mt-2" >
7070 <small class =" text-gray-700" >Created</small >
7171 <div class =" pt-2 md:pt-1" >{{ createdAt }}</div >
7272 </div >
73- <div v-if =" document .updatedAt" class =" mt-3 md:mt-2" >
73+ <div v-if =" doc .updatedAt" class =" mt-3 md:mt-2" >
7474 <small class =" text-gray-700" >Updated</small >
7575 <div class =" pt-2 md:pt-1" >{{ updatedAt }}</div >
7676 </div >
77- <div v-if =" document .discardedAt" class =" mt-3 md:mt-2" >
77+ <div v-if =" doc .discardedAt" class =" mt-3 md:mt-2" >
7878 <small class =" text-gray-700" >Discarded</small >
7979 <div class =" pt-2 md:pt-1" >{{ discardedAt }}</div >
8080 </div >
@@ -117,44 +117,44 @@ export default {
117117 },
118118 computed: {
119119 codeblocks () {
120- return parseCodeblocks (this .document .text )
120+ return parseCodeblocks (this .doc .text )
121121 },
122122 createdAt () {
123123 if (this .$route .params .id ) {
124- return moment (this .document .createdAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
124+ return moment (this .doc .createdAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
125125 }
126126
127127 return ' Not yet created'
128128 },
129129 discardedAt () {
130- return moment (this .document .discardedAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
130+ return moment (this .doc .discardedAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
131131 },
132- document () {
132+ doc () {
133133 return this .$store .getters .currentDoc
134134 },
135135 hasCodeblocks () {
136136 return this .codeblocks .length > 0
137137 },
138138 publicUrl () {
139- const path = this .$router .resolve ({ name: ' shared ' , params: { id: this .document .id } }).href
139+ const path = this .$router .resolve ({ name: ' public_doc ' , params: { id: this .doc .id } }).href
140140
141141 return ` ${ location .protocol } //${ location .host }${ path} `
142142 },
143143 savedAt () {
144144 if (this .$route .params .id ) {
145- if (this .now .diff (this .document .updatedAt , ' seconds' ) < 5 ) {
145+ if (this .now .diff (this .doc .updatedAt , ' seconds' ) < 5 ) {
146146 return ' just now'
147147 }
148148 else {
149- return ` ${ moment (this .document .updatedAt ).from (this .now , true )} ago`
149+ return ` ${ moment (this .doc .updatedAt ).from (this .now , true )} ago`
150150 }
151151 }
152152
153153 return ' Not yet saved'
154154 },
155155 updatedAt () {
156156 if (this .$route .params .id ) {
157- return moment (this .document .updatedAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
157+ return moment (this .doc .updatedAt ).format (' ddd, MMM Do, YYYY [at] h:mm A' )
158158 }
159159
160160 return ' Not yet updated'
@@ -164,15 +164,15 @@ export default {
164164 async copyPublicUrl () {
165165 // copy link to clipboard
166166 this .$refs .link .select ()
167- document .execCommand (' copy' )
167+ doc .execCommand (' copy' )
168168 },
169169 async discardDocument () {
170- this .$store .dispatch (DISCARD_DOCUMENT , { id: this .document .id })
170+ this .$store .dispatch (DISCARD_DOCUMENT , { id: this .doc .id })
171171
172172 open ({ name: ' dashboard' })
173173 },
174174 async duplicateDocument () {
175- const newDocId = await this .$store .dispatch (DUPLICATE_DOCUMENT , { id: this .document .id })
175+ const newDocId = await this .$store .dispatch (DUPLICATE_DOCUMENT , { id: this .doc .id })
176176
177177 open ({ name: ' doc' , params: { id: newDocId } })
178178 },
@@ -191,13 +191,13 @@ export default {
191191 CodeSandbox .create (files).then (sandbox_id => CodeSandbox .open (sandbox_id))
192192 },
193193 async restoreDocument () {
194- this .$store .dispatch (RESTORE_DOCUMENT , { id: this .document .id })
194+ this .$store .dispatch (RESTORE_DOCUMENT , { id: this .doc .id })
195195 },
196196 async restrictDocument () {
197- this .$store .dispatch (RESTRICT_DOCUMENT , { id: this .document .id })
197+ this .$store .dispatch (RESTRICT_DOCUMENT , { id: this .doc .id })
198198 },
199199 async shareDocument () {
200- this .$store .dispatch (SHARE_DOCUMENT , { id: this .document .id })
200+ this .$store .dispatch (SHARE_DOCUMENT , { id: this .doc .id })
201201 },
202202 async toggleMeta () {
203203 this .$store .dispatch (SET_RIGHT_SIDEBAR_VISIBILITY , ! this .$store .state .showRightSidebar )
0 commit comments