소스 검색

show a banner at the bottom when a new version is available

pull/10/head
Aaron Parecki 9 년 전
부모
커밋
e03d6c359b
4개의 변경된 파일39개의 추가작업 그리고 2개의 파일을 삭제
  1. +21
    -0
      public/css/style.css
  2. +1
    -1
      views/appcache.php
  3. +6
    -0
      views/layout.php
  4. +11
    -1
      views/new-post.php

+ 21
- 0
public/css/style.css 파일 보기

@ -45,6 +45,27 @@ body {
}
#new_version_available {
display: none;
position: fixed;
z-index: 1000;
bottom: 0;
left: 0;
right: 0;
background: rgba(255,255,255,0.9);
}
#new_version_available .inner {
padding: 10px;
width: 300px;
margin: 0 auto;
text-align: center;
font-weight: bold;
color: #cf224f;
}
/**
* Bootstrap callouts
*/

+ 1
- 1
views/appcache.php 파일 보기

@ -12,4 +12,4 @@ CACHE MANIFEST
NETWORK:
*
# v11
# v25

+ 6
- 0
views/layout.php 파일 보기

@ -65,5 +65,11 @@
</div>
<div id="new_version_available">
<div class="inner">
There is a new version available! Refresh to load the new version.
</div>
</div>
</body>
</html>

+ 11
- 1
views/new-post.php 파일 보기

@ -209,6 +209,16 @@ $(function(){
}
});
function onUpdateReady() {
// Show the notice that says there is a new version of the app
$("#new_version_available").show();
}
window.applicationCache.addEventListener('updateready', onUpdateReady);
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
onUpdateReady();
}
});
</script>
@ -220,4 +230,4 @@ $(function(){
.scroll-container .break {
word-break: break-all;
}
</style>
</style>

불러오는 중...
취소
저장