From 82d090c9305e2a2b7bc94856ef73866a0135a62d Mon Sep 17 00:00:00 2001 From: d11e9 Date: Mon, 5 Oct 2015 15:37:36 +0100 Subject: [PATCH 1/2] improved error and warning navigation --- index.html | 9 +++++++-- stylesheets/browser-solidity.css | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 6ecf5ac6e6..652f29a463 100644 --- a/index.html +++ b/index.html @@ -104,6 +104,7 @@ THE SOFTWARE. SOL_CACHE_FILE = getFiles()[0]; editor.setValue( window.localStorage[SOL_CACHE_FILE], -1); + editor.resize(true); session.setMode("ace/mode/javascript"); session.setTabSize(4); session.setUseSoftTabs(true); @@ -393,8 +394,8 @@ THE SOFTWARE. var renderError = function(message) { var type = message.match(/^[0-9:]* Warning: /) ? 'warning' : 'error'; - $('#output') - .append($('
').text(message));
+			var $error = $('
').text(message);
+			$('#output').append( $error );
 			var err = message.match(/^:([0-9]*):([0-9]*)/)
 			if (err && err.length) {
 				var errLine = parseInt(err[1], 10) - 1;
@@ -406,6 +407,10 @@ THE SOFTWARE.
 					type: type
 				};
 				editor.getSession().setAnnotations(sourceAnnotations);
+				$error.click(function(ev){
+					editor.focus()
+					editor.gotoLine(errLine + 1, errCol - 1, true);
+				})
 			}
 		};
 
diff --git a/stylesheets/browser-solidity.css b/stylesheets/browser-solidity.css
index 3471b6c6db..ed1048dbbc 100644
--- a/stylesheets/browser-solidity.css
+++ b/stylesheets/browser-solidity.css
@@ -224,7 +224,7 @@ body {
     background-color: rgba(210, 202, 36, 0.5);
     border-radius: 0;
     word-wrap: break-word;
-    border: 1px solid #D00909;
+    border: 1px solid #BBB427;
 }
 
 #ghostbar {

From 31e603419865b18e4435970a45721a507404e2ea Mon Sep 17 00:00:00 2001
From: d11e9 
Date: Mon, 5 Oct 2015 16:13:28 +0100
Subject: [PATCH 2/2] add missing semicolons

---
 index.html | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/index.html b/index.html
index 652f29a463..05f31c21d8 100644
--- a/index.html
+++ b/index.html
@@ -279,7 +279,7 @@ THE SOFTWARE.
 				$('#ghostbar').remove();
 				$(document).unbind('mousemove');
 				dragging = false;
-				setEditorSize(delta)
+				setEditorSize(delta);
 				window.localStorage.setItem(EDITOR_SIZE_CACHE_KEY, delta);
 			}
 		});
@@ -347,7 +347,7 @@ THE SOFTWARE.
 		var onChange = function() {
 			var input = editor.getValue();
 			if (input === "") {
-				window.localStorage.setItem(SOL_CACHE_FILE, '')
+				window.localStorage.setItem(SOL_CACHE_FILE, '');
 				return;
 			}
 			if (input === previousInput)
@@ -365,18 +365,18 @@ THE SOFTWARE.
 	};
 
 	function includeLocalImports(input) {
-		var importRegex = /import\s[\'\"]([^\'\"]+)[\'\"];/g
+		var importRegex = /import\s[\'\"]([^\'\"]+)[\'\"];/g;
 		var imports = [];
 		var matches = [];
 		var match;
 		while ((match = importRegex.exec(input)) !== null) {
 		if (match[1] && getFiles().indexOf(fileKey(match[1])) !== -1) {
-			imports.push(match[1])
-			matches.push(match[0])
+			imports.push(match[1]);
+			matches.push(match[0]);
 		}
 		}
 		for (var i in imports) {
-			imported = includeLocalImports(window.localStorage.getItem( fileKey(imports[i]) ))
+			imported = includeLocalImports(window.localStorage.getItem( fileKey(imports[i]) ));
 			input = input.replace(matches[i], imported);
 		}
 		return input;
@@ -396,11 +396,11 @@ THE SOFTWARE.
 			var type = message.match(/^[0-9:]* Warning: /) ? 'warning' : 'error';
 			var $error = $('
').text(message);
 			$('#output').append( $error );
-			var err = message.match(/^:([0-9]*):([0-9]*)/)
+			var err = message.match(/^:([0-9]*):([0-9]*)/);
 			if (err && err.length) {
 				var errLine = parseInt(err[1], 10) - 1;
 				var errCol = err[2] ? parseInt(err[2], 10) : 0;
-				sourceAnnotations[sourceAnnotations.length] ={
+				sourceAnnotations[sourceAnnotations.length] = {
 					row: errLine,
 					column: errCol,
 					text: message,
@@ -408,9 +408,9 @@ THE SOFTWARE.
 				};
 				editor.getSession().setAnnotations(sourceAnnotations);
 				$error.click(function(ev){
-					editor.focus()
+					editor.focus();
 					editor.gotoLine(errLine + 1, errCol - 1, true);
-				})
+				});
 			}
 		};