4949 </div >
5050 </div >
5151 <div class =" app__footer" >
52- <div class =" app__footer-message" />
5352 <div
5453 class =" app__version-item"
5554 v-for =" (v, name) in versions"
5958 v{{ v.version }}
6059 </div >
6160 </div >
61+ <div class =" app__update-ready-toast" v-if =" showUpdateReadyToast" >
62+ <div >Please reload because a new version of this site is available.</div >
63+ <button @click =" reload" >Reload</button >
64+ </div >
6265 </div >
6366</template >
6467
@@ -79,7 +82,7 @@ export default {
7982 },
8083
8184 data () {
82- return new AppState (window . location .hash .slice (1 ))
85+ return new AppState (location .hash .slice (1 ))
8386 },
8487
8588 computed: {
@@ -140,11 +143,15 @@ export default {
140143 },
141144
142145 onUrlHashChange () {
143- this .$data .deserialize (window . location .hash .slice (1 ))
146+ this .$data .deserialize (location .hash .slice (1 ))
144147 },
145148
146149 applyUrlHash () {
147- window .location .replace (` #${ this .$data .serialize ()} ` )
150+ location .replace (` #${ this .$data .serialize ()} ` )
151+ },
152+
153+ reload () {
154+ location .reload (false )
148155 },
149156 },
150157}
@@ -234,15 +241,44 @@ a:hover {
234241 flex-shrink : 0 ;
235242 border-top : 1px solid #CCC ;
236243}
237- .app__footer-message {
238- flex-grow : 1 ;
239- color : #B71C1C ;
240- }
241244.app__version-item {
242245 flex-shrink : 0 ;
243246 margin-right : 8px ;
244247}
245248.app__version-item :not (:last-child )::after {
246249 content : " ,"
247250}
251+
252+ .app__update-ready-toast {
253+ display : block ;
254+ position : absolute ;
255+ right : 24px ;
256+ bottom : 32px ;
257+ width : 320px ;
258+ padding : 8px ;
259+ border : 1px solid #4CAF50 ;
260+ border-radius : 3px ;
261+ background : white ;
262+ box-shadow : 0 4px 16px rgba (0 ,0 ,0 , 0.5 );
263+ text-align : center ;
264+ animation : AppToastIn 0.333s ;
265+ }
266+ .app__update-ready-toast > div {
267+ text-align : left ;
268+ }
269+ .app__update-ready-toast > button {
270+ margin-top : 8px ;
271+ padding : 4px 32px ;
272+ }
273+
274+ @keyframes AppToastIn {
275+ 0% {
276+ opacity : 0 ;
277+ transform : translate (0 , 50% ) scale (0.5 );
278+ }
279+ 100% {
280+ opacity : 1 ;
281+ transform : none ;
282+ }
283+ }
248284 </style >
0 commit comments