diff --git a/app/bitwise/expression.js b/app/bitwise/expression.js index 40b465a..0040fbe 100644 --- a/app/bitwise/expression.js +++ b/app/bitwise/expression.js @@ -20,7 +20,6 @@ app.compose(function() { if(matches != null) { return createListOfNumbersExpression(string) } - } }); diff --git a/app/cmd/commands.js b/app/cmd/commands.js index 6dc6ce6..00a30da 100644 --- a/app/cmd/commands.js +++ b/app/cmd/commands.js @@ -8,12 +8,12 @@ app.run(function() { cmd.commands({ 'help': function() { - var helpResult = document.querySelector('.result .help'); + var helpResult = document.querySelector('.result .helpResultTpl'); if(helpResult != null) { - moveHelpResultUp(helpResult); - return; + moveResultUp(helpResult); + return; } - return new app.models.HelpResult(); + return new app.models.ViewResult('helpResultTpl'); }, 'clear': function() { cmd.clear(); @@ -26,6 +26,14 @@ app.run(function() { }, light: function () { shell.setLightTheme(); + }, + about: function() { + var aboutResult = document.querySelector('.result .aboutTpl'); + if(aboutResult != null) { + moveResultUp(aboutResult); + return; + } + return new app.models.ViewResult('aboutTpl'); } }); @@ -37,7 +45,7 @@ app.run(function() { } }); - function moveHelpResultUp(helpResult) { + function moveResultUp(helpResult) { var container = helpResult.parentNode.parentNode; if(container.parentNode.firstChild != container) { diff --git a/app/modelViews.js b/app/modelViews.js index 94f712f..939d004 100644 --- a/app/modelViews.js +++ b/app/modelViews.js @@ -48,9 +48,9 @@ app.compose(function () { } }); - app.modelView(app.models.HelpResult, { + app.modelView(app.models.ViewResult, { renderView: function(model) { - var template = app.template('helpResultTpl'); + var template = app.template(model.template); return template.render(); } }); diff --git a/app/models.js b/app/models.js index 6ce3599..79d86e3 100644 --- a/app/models.js +++ b/app/models.js @@ -16,8 +16,8 @@ this.message = message; } - function HelpResult (commands) { - this.commands = commands; + function ViewResult (template) { + this.template = template; } function DisplayResult (input, content) { @@ -28,7 +28,7 @@ app.models.BitwiseOperation = BitwiseOperation; app.models.BitwiseNumbers = BitwiseNumbers; app.models.ErrorResult = ErrorResult; - app.models.HelpResult = HelpResult; + app.models.ViewResult = ViewResult; app.models.DisplayResult = DisplayResult; })(window.app); diff --git a/css/styles.css b/css/styles.css index 85d79f0..c81b33e 100644 --- a/css/styles.css +++ b/css/styles.css @@ -34,4 +34,5 @@ code { font-size: 1.2em; font-weight: bold; } /* Dark */ .dark { background: black; color: white;} .dark .help { background: #222 } -.dark .expressionInput { background: black; color: white; } \ No newline at end of file +.dark .expressionInput { background: black; color: white; } +.dark a, .dark a:visited { color: white; } \ No newline at end of file diff --git a/index.html b/index.html index d425f3e..0a108f9 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,6 @@ - @@ -45,7 +44,7 @@