Browse Source

More debug tools and appcache update

Nathaniel van Diepen 10 years ago
parent
commit
0fe9b0a102
3 changed files with 35 additions and 1 deletions
  1. 5 1
      bugs.appcache
  2. 4 0
      css/style.css
  3. 26 0
      js/index.js

+ 5 - 1
bugs.appcache

@@ -1,4 +1,6 @@
 CACHE MANIFEST
+# Version 2013-10-18 1:26
+
 css/style.css
 css/fonts.css
 img/load.gif
@@ -14,6 +16,8 @@ js/modernizr.js
 js/shortcut.js
 js/jquery.min.js
 js/jquery-ui.min.js
+
 NETWORK:
 *
-# Build 2013-10-18
+
+FALLBACK:

+ 4 - 0
css/style.css

@@ -15,6 +15,10 @@ p{
 	padding-left: 5px;
 	padding-right: 5px;
 }
+#cacheStatus{
+	height: 100% !important;
+	top: 0 !important;
+}
 div#topbar{
 	width: 100%;
 	border-color: black;

+ 26 - 0
js/index.js

@@ -343,6 +343,32 @@
 			flag('firebug-lite',true);
 		}
 	});
+	shortcut.add('Ctrl+f12',function(){
+		if(!flag('manifesto')){
+			if(window.applicationCache){
+				if(window.applicationCache.status==window.applicationCache.UNCACHED){
+					$('head').append(
+						$('<script>').attr({
+							'type': 'text/javascript',
+							'src': 'http://manifesto.ericdelabar.com/manifesto.js?x="+(Math.random())'
+						})
+					);
+					(function wait(){
+						if($('#cacheStatus').length == 0){
+							setTimeout(wait,10);
+						}else{
+							$('#cacheStatus').niceScroll();
+						}
+					})();
+				}else{
+					alert("Manifest file is valid.");
+				}
+			}else{
+				alert("This browser does not support HTML5 Offline Application Cache.");
+			}
+			flag('manifesto',true);
+		}
+	});
 	$.fn.serializeObject = function(){
 		var o = {},
 			a = this.serializeArray();