Browse Source

Debug updates. Topbar display fix. Commit tools fix

Nathaniel van Diepen 10 years ago
parent
commit
b776ed6555
6 changed files with 63 additions and 44 deletions
  1. 1 1
      bugs.appcache
  2. 4 1
      css/style.css
  3. 1 1
      data/version
  4. 54 39
      js/index.js
  5. 1 1
      php/config.php
  6. 2 1
      update-version.sh

+ 1 - 1
bugs.appcache

@@ -111,4 +111,4 @@ NETWORK:
 *
 
 FALLBACK:
-Version Thu, Nov 28, 2013  3:19:32 PM
+#Version Sat Mar 29 19:55:22 MDT 2014

+ 4 - 1
css/style.css

@@ -116,6 +116,9 @@ div.topbar-right{
 div.topbar-left{
 	float: left;
 }
+.topbar-notifications{
+	display: none;
+}
 div#content{
 	width: 100%;
 	-webkit-overflow-scrolling: touch;
@@ -238,7 +241,7 @@ div#loading{
 	.topbar-back,.topbar-history{
 		background: url(../img/headers/ui/separator.png) no-repeat scroll right center transparent;
 	}
-	.screen-small{
+	.screen-small:not(.topbar-notifications){
 		display: block;
 	}
 }

+ 1 - 1
data/version

@@ -1 +1 @@
-Thu, Nov 28, 2013  3:19:32 PM
+Sat Mar 29 19:55:22 MDT 2014

+ 54 - 39
js/index.js

@@ -586,6 +586,56 @@
 					$('#loading').show();
 				}
 			}
+		},
+		debug = window.debug = {
+			hardReload: function(){
+				debug.clearCache();
+				location.reload();
+			},
+			clearCache: function(){
+				templates = [];
+				$.localStorage('templates',null);
+				console.log('Templates cleared.');
+			},
+			manifesto: 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);
+				}
+			},
+			firebug: function(){
+				if(!flag('firebug-lite')){
+					$('head').append(
+						$('<script>').attr({
+							'type': 'text/javascript',
+							'src': 'https://getfirebug.com/firebug-lite.js#startOpened',
+							'id': 'FirebugLite'
+						})
+					);
+					$('<image>').attr('src','https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png');
+					flag('firebug-lite',true);
+				}
+			}
 		};
 	if(exists($.cookie('key'))){
 		setKey($.cookie('key'));
@@ -682,7 +732,7 @@
 							loadState('page-messages');
 						});
 					}
-					$('.topbar-notifications').css('display',d.count>0?'':'none').text('('+d.count+')');
+					$('.topbar-notifications').css('display',d.count>0?'block':'').text('('+d.count+')');
 					$.localStorage('last_pm_check',d.timestamp);
 				}
 				setTimeout(notifications,5*1000); // every 5 seconds
@@ -690,48 +740,13 @@
 		})();
 	});
 	shortcut.add('f12',function(){
-		if(!flag('firebug-lite')){
-			$('head').append(
-				$('<script>').attr({
-					'type': 'text/javascript',
-					'src': 'https://getfirebug.com/firebug-lite.js#startOpened',
-					'id': 'FirebugLite'
-				})
-			);
-			$('<image>').attr('src','https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png');
-			flag('firebug-lite',true);
-		}
+		debug.firebug();
 	});
 	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);
-		}
+		debug.manifesto();
 	});
 	shortcut.add('Shift+f12',function(){
-		templates = [];
-		$.localStorage('templates',null);
-		console.log('Templates cleared.');
+		debug.clearCache();
 	});
 	$.fn.serializeObject = function(){
 		var o = {},

+ 1 - 1
php/config.php

@@ -23,7 +23,7 @@
 				'error'=>"\n{$errnostr}: {$error['message']} on {$error['file']}[{$error['line']}]"
 			));
 		}else{
-			obj_end_flush();
+			ob_end_flush();
 		}
 		echo PHP_EOL;
 	}

+ 2 - 1
update-version.sh

@@ -1,3 +1,4 @@
 #!/bin/bash
 date > data/version;
-sed -i -e "s/Version .*/Version $(date)/g" bugs.appcache
+sed -i -e "s/Version .*/Version $(date)/g" bugs.appcache;
+git add bugs.appcache;